Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109994
b: refs/heads/master
c: 01c1714
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Sep 23, 2008
1 parent f15f8df commit 2882f3b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0590d5875e3a5dc6586fb16354037f115628896d
refs/heads/master: 01c17142659c02d8cd4c67acdd8358180c5c4fb6
32 changes: 14 additions & 18 deletions trunk/drivers/usb/host/ehci-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ static int enable_periodic (struct ehci_hcd *ehci)
u32 cmd;
int status;

if (ehci->periodic_sched++)
return 0;

/* did clearing PSE did take effect yet?
* takes effect only at frame boundaries...
*/
Expand All @@ -461,6 +464,9 @@ static int disable_periodic (struct ehci_hcd *ehci)
u32 cmd;
int status;

if (--ehci->periodic_sched)
return 0;

/* did setting PSE not take effect yet?
* takes effect only at frame boundaries...
*/
Expand Down Expand Up @@ -544,13 +550,10 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
: (qh->usecs * 8);

/* maybe enable periodic schedule processing */
if (!ehci->periodic_sched++)
return enable_periodic (ehci);

return 0;
return enable_periodic(ehci);
}

static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
static int qh_unlink_periodic(struct ehci_hcd *ehci, struct ehci_qh *qh)
{
unsigned i;
unsigned period;
Expand Down Expand Up @@ -586,9 +589,7 @@ static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
qh_put (qh);

/* maybe turn off periodic schedule */
ehci->periodic_sched--;
if (!ehci->periodic_sched)
(void) disable_periodic (ehci);
return disable_periodic(ehci);
}

static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
Expand Down Expand Up @@ -1562,9 +1563,7 @@ itd_link_urb (
urb->hcpriv = NULL;

timer_action (ehci, TIMER_IO_WATCHDOG);
if (unlikely (!ehci->periodic_sched++))
return enable_periodic (ehci);
return 0;
return enable_periodic(ehci);
}

#define ISO_ERRS (EHCI_ISOC_BUF_ERR | EHCI_ISOC_BABBLE | EHCI_ISOC_XACTERR)
Expand Down Expand Up @@ -1642,7 +1641,7 @@ itd_complete (
ehci_urb_done(ehci, urb, 0);
retval = true;
urb = NULL;
ehci->periodic_sched--;
(void) disable_periodic(ehci);
ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;

if (unlikely (list_empty (&stream->td_list))) {
Expand Down Expand Up @@ -1951,9 +1950,7 @@ sitd_link_urb (
urb->hcpriv = NULL;

timer_action (ehci, TIMER_IO_WATCHDOG);
if (!ehci->periodic_sched++)
return enable_periodic (ehci);
return 0;
return enable_periodic(ehci);
}

/*-------------------------------------------------------------------------*/
Expand Down Expand Up @@ -2019,7 +2016,7 @@ sitd_complete (
ehci_urb_done(ehci, urb, 0);
retval = true;
urb = NULL;
ehci->periodic_sched--;
(void) disable_periodic(ehci);
ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;

if (list_empty (&stream->td_list)) {
Expand Down Expand Up @@ -2243,8 +2240,7 @@ scan_periodic (struct ehci_hcd *ehci)
if (unlikely (modified)) {
if (likely(ehci->periodic_sched > 0))
goto restart;
/* maybe we can short-circuit this scan! */
disable_periodic(ehci);
/* short-circuit this scan */
now_uframe = clock;
break;
}
Expand Down

0 comments on commit 2882f3b

Please sign in to comment.