Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 296565 Details for
Bug 435670
RHEL5.2: USB stress test failure on AMD SBX00
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
backported patch to fix USB stress test failure
SBX00_USB_hang_fix_RHEL5.1_4.patch (text/plain), 9.11 KB, created by
Shane Huang
on 2008-03-03 09:01:49 UTC
(
hide
)
Description:
backported patch to fix USB stress test failure
Filename:
MIME Type:
Creator:
Shane Huang
Created:
2008-03-03 09:01:49 UTC
Size:
9.11 KB
patch
obsolete
>diff -ruN a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h >--- a/drivers/usb/host/ehci.h 2008-02-26 17:39:10.000000000 +0800 >+++ b/drivers/usb/host/ehci.h 2008-02-26 17:40:07.000000000 +0800 >@@ -58,7 +58,6 @@ > /* async schedule support */ > struct ehci_qh *async; > struct ehci_qh *reclaim; >- unsigned reclaim_ready : 1; > unsigned scanning : 1; > > /* periodic schedule support */ >@@ -81,6 +80,7 @@ > struct dma_pool *itd_pool; /* itd per iso urb */ > struct dma_pool *sitd_pool; /* sitd per split iso urb */ > >+ struct timer_list iaa_watchdog; > struct timer_list watchdog; > struct notifier_block reboot_notifier; > unsigned long actions; >@@ -115,9 +115,21 @@ > } > > >+static inline void >+iaa_watchdog_start(struct ehci_hcd *ehci) >+{ >+ WARN_ON(timer_pending(&ehci->iaa_watchdog)); >+ mod_timer(&ehci->iaa_watchdog, >+ jiffies + msecs_to_jiffies(EHCI_IAA_MSECS)); >+} >+ >+static inline void iaa_watchdog_done(struct ehci_hcd *ehci) >+{ >+ del_timer(&ehci->iaa_watchdog); >+} >+ > enum ehci_timer_action { > TIMER_IO_WATCHDOG, >- TIMER_IAA_WATCHDOG, > TIMER_ASYNC_SHRINK, > TIMER_ASYNC_OFF, > }; >@@ -135,9 +147,6 @@ > unsigned long t; > > switch (action) { >- case TIMER_IAA_WATCHDOG: >- t = EHCI_IAA_JIFFIES; >- break; > case TIMER_IO_WATCHDOG: > t = EHCI_IO_JIFFIES; > break; >@@ -154,8 +163,7 @@ > // async queue SHRINK often precedes IAA. while it's ready > // to go OFF neither can matter, and afterwards the IO > // watchdog stops unless there's still periodic traffic. >- if (action != TIMER_IAA_WATCHDOG >- && t > ehci->watchdog.expires >+ if (time_before_eq(t, ehci->watchdog.expires) > && timer_pending (&ehci->watchdog)) > return; > mod_timer (&ehci->watchdog, t); >diff -ruN a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c >--- a/drivers/usb/host/ehci-hcd.c 2008-02-26 17:39:16.000000000 +0800 >+++ b/drivers/usb/host/ehci-hcd.c 2008-02-26 17:39:55.000000000 +0800 >@@ -111,7 +111,7 @@ > #define EHCI_TUNE_MULT_TT 1 > #define EHCI_TUNE_FLS 2 /* (small) 256 frame schedule */ > >-#define EHCI_IAA_JIFFIES (HZ/100) /* arbitrary; ~10 msec */ >+#define EHCI_IAA_MSECS 10 /* arbitrary */ > #define EHCI_IO_JIFFIES (HZ/10) /* io watchdog > irq_thresh */ > #define EHCI_ASYNC_JIFFIES (HZ/20) /* async idle timeout */ > #define EHCI_SHRINK_JIFFIES (HZ/200) /* async qh unlink delay */ >@@ -254,6 +254,7 @@ > > /*-------------------------------------------------------------------------*/ > >+static void end_unlink_async(struct ehci_hcd *ehci, struct pt_regs *regs); > static void ehci_work(struct ehci_hcd *ehci, struct pt_regs *regs); > > #include "ehci-hub.c" >@@ -263,26 +264,41 @@ > > /*-------------------------------------------------------------------------*/ > >-static void ehci_watchdog (unsigned long param) >+static void ehci_iaa_watchdog(unsigned long param) > { > struct ehci_hcd *ehci = (struct ehci_hcd *) param; > unsigned long flags; >+ u32 status, cmd; > > spin_lock_irqsave (&ehci->lock, flags); >+ WARN_ON(!ehci->reclaim); > >- /* lost IAA irqs wedge things badly; seen with a vt8235 */ >- if (ehci->reclaim) { >- u32 status = readl (&ehci->regs->status); >+ status = readl(&ehci->regs->status); >+ cmd = readl(&ehci->regs->command); >+ ehci_dbg(ehci, "IAA watchdog: status %x cmd %x\n", status, cmd); > >+ /* lost IAA irqs wedge things badly; seen first with a vt8235 */ >+ if (ehci->reclaim) { > if (status & STS_IAA) { > ehci_vdbg (ehci, "lost IAA\n"); > COUNT (ehci->stats.lost_iaa); > writel (STS_IAA, &ehci->regs->status); >- ehci->reclaim_ready = 1; > } >+ writel(cmd & ~CMD_IAAD, &ehci->regs->command); >+ end_unlink_async(ehci, NULL); > } > >- /* stop async processing after it's idled a bit */ >+ spin_unlock_irqrestore(&ehci->lock, flags); >+} >+ >+static void ehci_watchdog(unsigned long param) >+{ >+ struct ehci_hcd *ehci = (struct ehci_hcd *) param; >+ unsigned long flags; >+ >+ spin_lock_irqsave(&ehci->lock, flags); >+ >+ /* stop async processing after it's idled a bit */ > if (test_bit (TIMER_ASYNC_OFF, &ehci->actions)) > start_unlink_async (ehci, ehci->async); > >@@ -334,8 +350,6 @@ > static void ehci_work (struct ehci_hcd *ehci, struct pt_regs *regs) > { > timer_action_done (ehci, TIMER_IO_WATCHDOG); >- if (ehci->reclaim_ready) >- end_unlink_async (ehci, regs); > > /* another CPU may drop ehci->lock during a schedule scan while > * it reports urb completions. this flag guards against bogus >@@ -370,6 +384,7 @@ > > /* no more interrupts ... */ > del_timer_sync (&ehci->watchdog); >+ del_timer_sync(&ehci->iaa_watchdog); > > spin_lock_irq(&ehci->lock); > if (HC_IS_RUNNING (hcd->state)) >@@ -417,6 +432,10 @@ > ehci->watchdog.function = ehci_watchdog; > ehci->watchdog.data = (unsigned long) ehci; > >+ init_timer(&ehci->iaa_watchdog); >+ ehci->iaa_watchdog.function = ehci_iaa_watchdog; >+ ehci->iaa_watchdog.data = (unsigned long) ehci; >+ > /* > * hw default: 1K periodic list heads, one per frame. > * periodic_size can shrink by USBCMD update if hcc_params allows. >@@ -433,7 +452,6 @@ > ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params); > > ehci->reclaim = NULL; >- ehci->reclaim_ready = 0; > ehci->next_uframe = -1; > > /* >@@ -611,8 +629,7 @@ > /* complete the unlinking of some qh [4.15.2.3] */ > if (status & STS_IAA) { > COUNT (ehci->stats.reclaim); >- ehci->reclaim_ready = 1; >- bh = 1; >+ end_unlink_async(ehci, NULL); > } > > /* remote wakeup [4.3.1] */ >@@ -715,10 +732,16 @@ > > static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) > { >- /* if we need to use IAA and it's busy, defer */ >- if (qh->qh_state == QH_STATE_LINKED >- && ehci->reclaim >- && HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) { >+ /* failfast */ >+ if (!HC_IS_RUNNING(ehci_to_hcd(ehci)->state)) >+ end_unlink_async(ehci, NULL); >+ >+ /* if it's not linked then there's nothing to do */ >+ if (qh->qh_state != QH_STATE_LINKED) >+ ; >+ >+ /* defer till later if busy */ >+ else if (ehci->reclaim) { > struct ehci_qh *last; > > for (last = ehci->reclaim; >@@ -728,12 +751,8 @@ > qh->qh_state = QH_STATE_UNLINK_WAIT; > last->reclaim = qh; > >- /* bypass IAA if the hc can't care */ >- } else if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state) && ehci->reclaim) >- end_unlink_async (ehci, NULL); >- >- /* something else might have unlinked the qh by now */ >- if (qh->qh_state == QH_STATE_LINKED) >+ /* start IAA cycle */ >+ } else > start_unlink_async (ehci, qh); > } > >@@ -755,7 +774,19 @@ > qh = (struct ehci_qh *) urb->hcpriv; > if (!qh) > break; >- unlink_async (ehci, qh); >+ switch (qh->qh_state) { >+ case QH_STATE_LINKED: >+ case QH_STATE_COMPLETING: >+ unlink_async(ehci, qh); >+ break; >+ case QH_STATE_UNLINK: >+ case QH_STATE_UNLINK_WAIT: >+ /* already started */ >+ break; >+ case QH_STATE_IDLE: >+ WARN_ON(1); >+ break; >+ } > break; > > case PIPE_INTERRUPT: >@@ -847,6 +878,7 @@ > unlink_async (ehci, qh); > /* FALL THROUGH */ > case QH_STATE_UNLINK: /* wait for hw to finish? */ >+ case QH_STATE_UNLINK_WAIT: > idle_timeout: > spin_unlock_irqrestore (&ehci->lock, flags); > schedule_timeout_uninterruptible(1); >diff -ruN a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c >--- a/drivers/usb/host/ehci-hub.c 2008-02-26 17:52:58.000000000 +0800 >+++ b/drivers/usb/host/ehci-hub.c 2008-02-26 17:45:59.000000000 +0800 >@@ -37,6 +37,8 @@ > > if (time_before (jiffies, ehci->next_statechange)) > msleep(5); >+ del_timer_sync(&ehci->watchdog); >+ del_timer_sync(&ehci->iaa_watchdog); > > port = HCS_N_PORTS (ehci->hcs_params); > spin_lock_irq (&ehci->lock); >@@ -48,7 +50,7 @@ > } > ehci->command = readl (&ehci->regs->command); > if (ehci->reclaim) >- ehci->reclaim_ready = 1; >+ end_unlink_async(ehci, NULL); > ehci_work(ehci, NULL); > > /* suspend any active/unsuspended ports, maybe allow wakeup */ >@@ -72,7 +74,6 @@ > } > > /* turn off now-idle HC */ >- del_timer_sync (&ehci->watchdog); > ehci_halt (ehci); > hcd->state = HC_STATE_SUSPENDED; > >diff -ruN a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c >--- a/drivers/usb/host/ehci-pci.c 2008-02-26 17:39:29.000000000 +0800 >+++ b/drivers/usb/host/ehci-pci.c 2008-02-26 17:40:03.000000000 +0800 >@@ -297,7 +297,7 @@ > /* emptying the schedule aborts any urbs */ > spin_lock_irq(&ehci->lock); > if (ehci->reclaim) >- ehci->reclaim_ready = 1; >+ end_unlink_async(ehci, NULL); > ehci_work(ehci, NULL); > spin_unlock_irq(&ehci->lock); > >diff -ruN a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c >--- a/drivers/usb/host/ehci-q.c 2008-02-26 17:39:35.000000000 +0800 >+++ b/drivers/usb/host/ehci-q.c 2008-03-03 16:33:22.000000000 +0800 >@@ -967,7 +967,12 @@ > struct ehci_qh *qh = ehci->reclaim; > struct ehci_qh *next; > >- timer_action_done (ehci, TIMER_IAA_WATCHDOG); >+ iaa_watchdog_done(ehci); >+ >+ if (!qh) { >+ WARN_ON(1); >+ return; >+ } > > // qh->hw_next = cpu_to_le32 (qh->qh_dma); > qh->qh_state = QH_STATE_IDLE; >@@ -977,7 +982,6 @@ > /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */ > next = qh->reclaim; > ehci->reclaim = next; >- ehci->reclaim_ready = 0; > qh->reclaim = NULL; > > qh_completions (ehci, qh, regs); >@@ -1052,11 +1056,10 @@ > return; > } > >- ehci->reclaim_ready = 0; > cmd |= CMD_IAAD; > writel (cmd, &ehci->regs->command); > (void) readl (&ehci->regs->command); >- timer_action (ehci, TIMER_IAA_WATCHDOG); >+ iaa_watchdog_start(ehci); > } > > /*-------------------------------------------------------------------------*/
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 435670
: 296565 |
296703
|
297010