Skip to content

Commit

Permalink
malta uhci quirks: make allowance for slow 4k(e)c
Browse files Browse the repository at this point in the history
This works around an unexpected IRQ torvalds#255 seen during initial USB host
mass storage device initialization and access.
* wait up to 50us for HCRESET to clear, a slow 4kc needs a longer time.
* leave FSBR enabled so that a slow 4kec/24kec will not be overwhelmed.

Signed-off-by: <[email protected]> Weixing Shi
Signed-off-by: <[email protected]> Bruce Ashfield
  • Loading branch information
Weixing Shi authored and zeddii committed Dec 28, 2020
1 parent 8246a44 commit 5108504
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 12 additions & 2 deletions drivers/usb/host/pci-quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,9 @@ EXPORT_SYMBOL_GPL(usb_amd_pt_check_port);
*/
void uhci_reset_hc(struct pci_dev *pdev, unsigned long base)
{
#ifdef CONFIG_MIPS_MALTA
int timeout = 10;
#endif
/* Turn off PIRQ enable and SMI enable. (This also turns off the
* BIOS's USB Legacy Support.) Turn off all the R/WC bits too.
*/
Expand All @@ -652,9 +655,16 @@ void uhci_reset_hc(struct pci_dev *pdev, unsigned long base)
outw(UHCI_USBCMD_HCRESET, base + UHCI_USBCMD);
mb();
udelay(5);
if (inw(base + UHCI_USBCMD) & UHCI_USBCMD_HCRESET)
dev_warn(&pdev->dev, "HCRESET not completed yet!\n");

#ifdef CONFIG_MIPS_MALTA
while (inw(base + UHCI_USBCMD) & UHCI_USBCMD_HCRESET) {
if (--timeout < 0) {
dev_warn(&pdev->dev, "HCRESET timed out!\n");
break;
}
udelay(5);
}
#endif
/* Just to be safe, disable interrupt requests and
* make sure the controller is stopped.
*/
Expand Down
4 changes: 3 additions & 1 deletion drivers/usb/host/uhci-q.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ static void uhci_fsbr_off(struct uhci_hcd *uhci)
static void uhci_add_fsbr(struct uhci_hcd *uhci, struct urb *urb)
{
struct urb_priv *urbp = urb->hcpriv;

#ifdef CONFIG_MIPS_MALTA
return;
#endif
urbp->fsbr = 1;
}

Expand Down

0 comments on commit 5108504

Please sign in to comment.