Skip to content

Commit c32ba30

Browse files
Paul Sericegregkh
authored andcommitted
[PATCH] USB: EHCI works again on NVidia controllers with >2GB RAM
From: Paul Serice <[email protected]> The workaround in commit f7201c3 broke. The work around requires memory for DMA transfers for some NVidia EHCI controllers to be below 2GB, but recent changes have caused some DMA memory to be allocated before the DMA mask is set. Signed-off-by: Paul Serice <[email protected]> Signed-off-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a5117ba commit c32ba30

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

drivers/usb/host/ehci-pci.c

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,30 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
7676
dbg_hcs_params(ehci, "reset");
7777
dbg_hcc_params(ehci, "reset");
7878

79+
/* ehci_init() causes memory for DMA transfers to be
80+
* allocated. Thus, any vendor-specific workarounds based on
81+
* limiting the type of memory used for DMA transfers must
82+
* happen before ehci_init() is called. */
83+
switch (pdev->vendor) {
84+
case PCI_VENDOR_ID_NVIDIA:
85+
/* NVidia reports that certain chips don't handle
86+
* QH, ITD, or SITD addresses above 2GB. (But TD,
87+
* data buffer, and periodic schedule are normal.)
88+
*/
89+
switch (pdev->device) {
90+
case 0x003c: /* MCP04 */
91+
case 0x005b: /* CK804 */
92+
case 0x00d8: /* CK8 */
93+
case 0x00e8: /* CK8S */
94+
if (pci_set_consistent_dma_mask(pdev,
95+
DMA_31BIT_MASK) < 0)
96+
ehci_warn(ehci, "can't enable NVidia "
97+
"workaround for >2GB RAM\n");
98+
break;
99+
}
100+
break;
101+
}
102+
79103
/* cache this readonly data; minimize chip reads */
80104
ehci->hcs_params = readl(&ehci->caps->hcs_params);
81105

@@ -88,8 +112,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
88112
if (retval)
89113
return retval;
90114

91-
/* NOTE: only the parts below this line are PCI-specific */
92-
93115
switch (pdev->vendor) {
94116
case PCI_VENDOR_ID_TDI:
95117
if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {
@@ -107,19 +129,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
107129
break;
108130
case PCI_VENDOR_ID_NVIDIA:
109131
switch (pdev->device) {
110-
/* NVidia reports that certain chips don't handle
111-
* QH, ITD, or SITD addresses above 2GB. (But TD,
112-
* data buffer, and periodic schedule are normal.)
113-
*/
114-
case 0x003c: /* MCP04 */
115-
case 0x005b: /* CK804 */
116-
case 0x00d8: /* CK8 */
117-
case 0x00e8: /* CK8S */
118-
if (pci_set_consistent_dma_mask(pdev,
119-
DMA_31BIT_MASK) < 0)
120-
ehci_warn(ehci, "can't enable NVidia "
121-
"workaround for >2GB RAM\n");
122-
break;
123132
/* Some NForce2 chips have problems with selective suspend;
124133
* fixed in newer silicon.
125134
*/

0 commit comments

Comments
 (0)