diff options
author | David Howells <dhowells@redhat.com> | 2006-10-05 09:55:46 -0400 |
---|---|---|
committer | David Howells <dhowells@warthog.cambridge.redhat.com> | 2006-10-05 10:10:12 -0400 |
commit | 7d12e780e003f93433d49ce78cfedf4b4c52adc5 (patch) | |
tree | 6748550400445c11a306b132009f3001e3525df8 /drivers/usb/host | |
parent | da482792a6d1a3fbaaa25fae867b343fb4db3246 (diff) |
IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.
The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).
Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.
Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.
I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.
This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
struct pt_regs *old_regs = set_irq_regs(regs);
And put the old one back at the end:
set_irq_regs(old_regs);
Don't pass regs through to generic_handle_irq() or __do_IRQ().
In timer_interrupt(), this sort of change will be necessary:
- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);
I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().
Some notes on the interrupt handling in the drivers:
(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.
(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.
(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.
Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 26 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-pci.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-q.c | 21 | ||||
-rw-r--r-- | drivers/usb/host/ehci-sched.c | 21 | ||||
-rw-r--r-- | drivers/usb/host/hc_crisv10.c | 12 | ||||
-rw-r--r-- | drivers/usb/host/isp116x-hcd.c | 16 | ||||
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 14 | ||||
-rw-r--r-- | drivers/usb/host/ohci-hub.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/ohci-q.c | 16 | ||||
-rw-r--r-- | drivers/usb/host/sl811-hcd.c | 21 | ||||
-rw-r--r-- | drivers/usb/host/u132-hcd.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/uhci-hcd.c | 8 | ||||
-rw-r--r-- | drivers/usb/host/uhci-hub.c | 2 | ||||
-rw-r--r-- | drivers/usb/host/uhci-q.c | 15 |
15 files changed, 96 insertions, 100 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 5ac918591131..aac6ec5dd7cf 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -254,8 +254,8 @@ static void ehci_quiesce (struct ehci_hcd *ehci) | |||
254 | 254 | ||
255 | /*-------------------------------------------------------------------------*/ | 255 | /*-------------------------------------------------------------------------*/ |
256 | 256 | ||
257 | static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs); | 257 | static void end_unlink_async (struct ehci_hcd *ehci); |
258 | static void ehci_work(struct ehci_hcd *ehci, struct pt_regs *regs); | 258 | static void ehci_work(struct ehci_hcd *ehci); |
259 | 259 | ||
260 | #include "ehci-hub.c" | 260 | #include "ehci-hub.c" |
261 | #include "ehci-mem.c" | 261 | #include "ehci-mem.c" |
@@ -280,7 +280,7 @@ static void ehci_iaa_watchdog (unsigned long param) | |||
280 | ehci_vdbg (ehci, "lost IAA\n"); | 280 | ehci_vdbg (ehci, "lost IAA\n"); |
281 | COUNT (ehci->stats.lost_iaa); | 281 | COUNT (ehci->stats.lost_iaa); |
282 | writel (STS_IAA, &ehci->regs->status); | 282 | writel (STS_IAA, &ehci->regs->status); |
283 | end_unlink_async (ehci, NULL); | 283 | end_unlink_async (ehci); |
284 | } | 284 | } |
285 | } | 285 | } |
286 | 286 | ||
@@ -299,7 +299,7 @@ static void ehci_watchdog (unsigned long param) | |||
299 | start_unlink_async (ehci, ehci->async); | 299 | start_unlink_async (ehci, ehci->async); |
300 | 300 | ||
301 | /* ehci could run by timer, without IRQs ... */ | 301 | /* ehci could run by timer, without IRQs ... */ |
302 | ehci_work (ehci, NULL); | 302 | ehci_work (ehci); |
303 | 303 | ||
304 | spin_unlock_irqrestore (&ehci->lock, flags); | 304 | spin_unlock_irqrestore (&ehci->lock, flags); |
305 | } | 305 | } |
@@ -342,7 +342,7 @@ static void ehci_port_power (struct ehci_hcd *ehci, int is_on) | |||
342 | * ehci_work is called from some interrupts, timers, and so on. | 342 | * ehci_work is called from some interrupts, timers, and so on. |
343 | * it calls driver completion functions, after dropping ehci->lock. | 343 | * it calls driver completion functions, after dropping ehci->lock. |
344 | */ | 344 | */ |
345 | static void ehci_work (struct ehci_hcd *ehci, struct pt_regs *regs) | 345 | static void ehci_work (struct ehci_hcd *ehci) |
346 | { | 346 | { |
347 | timer_action_done (ehci, TIMER_IO_WATCHDOG); | 347 | timer_action_done (ehci, TIMER_IO_WATCHDOG); |
348 | 348 | ||
@@ -353,9 +353,9 @@ static void ehci_work (struct ehci_hcd *ehci, struct pt_regs *regs) | |||
353 | if (ehci->scanning) | 353 | if (ehci->scanning) |
354 | return; | 354 | return; |
355 | ehci->scanning = 1; | 355 | ehci->scanning = 1; |
356 | scan_async (ehci, regs); | 356 | scan_async (ehci); |
357 | if (ehci->next_uframe != -1) | 357 | if (ehci->next_uframe != -1) |
358 | scan_periodic (ehci, regs); | 358 | scan_periodic (ehci); |
359 | ehci->scanning = 0; | 359 | ehci->scanning = 0; |
360 | 360 | ||
361 | /* the IO watchdog guards against hardware or driver bugs that | 361 | /* the IO watchdog guards against hardware or driver bugs that |
@@ -397,7 +397,7 @@ static void ehci_stop (struct usb_hcd *hcd) | |||
397 | /* root hub is shut down separately (first, when possible) */ | 397 | /* root hub is shut down separately (first, when possible) */ |
398 | spin_lock_irq (&ehci->lock); | 398 | spin_lock_irq (&ehci->lock); |
399 | if (ehci->async) | 399 | if (ehci->async) |
400 | ehci_work (ehci, NULL); | 400 | ehci_work (ehci); |
401 | spin_unlock_irq (&ehci->lock); | 401 | spin_unlock_irq (&ehci->lock); |
402 | ehci_mem_cleanup (ehci); | 402 | ehci_mem_cleanup (ehci); |
403 | 403 | ||
@@ -573,7 +573,7 @@ static int ehci_run (struct usb_hcd *hcd) | |||
573 | 573 | ||
574 | /*-------------------------------------------------------------------------*/ | 574 | /*-------------------------------------------------------------------------*/ |
575 | 575 | ||
576 | static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs) | 576 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) |
577 | { | 577 | { |
578 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); | 578 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); |
579 | u32 status; | 579 | u32 status; |
@@ -619,7 +619,7 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs) | |||
619 | /* complete the unlinking of some qh [4.15.2.3] */ | 619 | /* complete the unlinking of some qh [4.15.2.3] */ |
620 | if (status & STS_IAA) { | 620 | if (status & STS_IAA) { |
621 | COUNT (ehci->stats.reclaim); | 621 | COUNT (ehci->stats.reclaim); |
622 | end_unlink_async (ehci, regs); | 622 | end_unlink_async (ehci); |
623 | bh = 1; | 623 | bh = 1; |
624 | } | 624 | } |
625 | 625 | ||
@@ -670,7 +670,7 @@ dead: | |||
670 | } | 670 | } |
671 | 671 | ||
672 | if (bh) | 672 | if (bh) |
673 | ehci_work (ehci, regs); | 673 | ehci_work (ehci); |
674 | spin_unlock (&ehci->lock); | 674 | spin_unlock (&ehci->lock); |
675 | return IRQ_HANDLED; | 675 | return IRQ_HANDLED; |
676 | } | 676 | } |
@@ -727,7 +727,7 @@ static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
727 | 727 | ||
728 | /* failfast */ | 728 | /* failfast */ |
729 | if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) | 729 | if (!HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) |
730 | end_unlink_async (ehci, NULL); | 730 | end_unlink_async (ehci); |
731 | 731 | ||
732 | /* defer till later if busy */ | 732 | /* defer till later if busy */ |
733 | else if (ehci->reclaim) { | 733 | else if (ehci->reclaim) { |
@@ -787,7 +787,7 @@ static int ehci_urb_dequeue (struct usb_hcd *hcd, struct urb *urb) | |||
787 | intr_deschedule (ehci, qh); | 787 | intr_deschedule (ehci, qh); |
788 | /* FALL THROUGH */ | 788 | /* FALL THROUGH */ |
789 | case QH_STATE_IDLE: | 789 | case QH_STATE_IDLE: |
790 | qh_completions (ehci, qh, NULL); | 790 | qh_completions (ehci, qh); |
791 | break; | 791 | break; |
792 | default: | 792 | default: |
793 | ehci_dbg (ehci, "bogus qh %p state %d\n", | 793 | ehci_dbg (ehci, "bogus qh %p state %d\n", |
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index b2ee13c58517..2012213c0a25 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c | |||
@@ -48,8 +48,8 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) | |||
48 | } | 48 | } |
49 | ehci->command = readl (&ehci->regs->command); | 49 | ehci->command = readl (&ehci->regs->command); |
50 | if (ehci->reclaim) | 50 | if (ehci->reclaim) |
51 | end_unlink_async (ehci, NULL); | 51 | end_unlink_async (ehci); |
52 | ehci_work(ehci, NULL); | 52 | ehci_work(ehci); |
53 | 53 | ||
54 | /* suspend any active/unsuspended ports, maybe allow wakeup */ | 54 | /* suspend any active/unsuspended ports, maybe allow wakeup */ |
55 | while (port--) { | 55 | while (port--) { |
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 08d0472d4f57..35e3fab6fc4e 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -303,8 +303,8 @@ restart: | |||
303 | /* emptying the schedule aborts any urbs */ | 303 | /* emptying the schedule aborts any urbs */ |
304 | spin_lock_irq(&ehci->lock); | 304 | spin_lock_irq(&ehci->lock); |
305 | if (ehci->reclaim) | 305 | if (ehci->reclaim) |
306 | end_unlink_async (ehci, NULL); | 306 | end_unlink_async (ehci); |
307 | ehci_work(ehci, NULL); | 307 | ehci_work(ehci); |
308 | spin_unlock_irq(&ehci->lock); | 308 | spin_unlock_irq(&ehci->lock); |
309 | 309 | ||
310 | /* restart; khubd will disconnect devices */ | 310 | /* restart; khubd will disconnect devices */ |
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 7fc25b6bd7d2..46327272f614 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -214,7 +214,7 @@ static void qtd_copy_status ( | |||
214 | } | 214 | } |
215 | 215 | ||
216 | static void | 216 | static void |
217 | ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb, struct pt_regs *regs) | 217 | ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb) |
218 | __releases(ehci->lock) | 218 | __releases(ehci->lock) |
219 | __acquires(ehci->lock) | 219 | __acquires(ehci->lock) |
220 | { | 220 | { |
@@ -262,7 +262,7 @@ __acquires(ehci->lock) | |||
262 | 262 | ||
263 | /* complete() can reenter this HCD */ | 263 | /* complete() can reenter this HCD */ |
264 | spin_unlock (&ehci->lock); | 264 | spin_unlock (&ehci->lock); |
265 | usb_hcd_giveback_urb (ehci_to_hcd(ehci), urb, regs); | 265 | usb_hcd_giveback_urb (ehci_to_hcd(ehci), urb); |
266 | spin_lock (&ehci->lock); | 266 | spin_lock (&ehci->lock); |
267 | } | 267 | } |
268 | 268 | ||
@@ -279,7 +279,7 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh); | |||
279 | */ | 279 | */ |
280 | #define HALT_BIT __constant_cpu_to_le32(QTD_STS_HALT) | 280 | #define HALT_BIT __constant_cpu_to_le32(QTD_STS_HALT) |
281 | static unsigned | 281 | static unsigned |
282 | qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs) | 282 | qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh) |
283 | { | 283 | { |
284 | struct ehci_qtd *last = NULL, *end = qh->dummy; | 284 | struct ehci_qtd *last = NULL, *end = qh->dummy; |
285 | struct list_head *entry, *tmp; | 285 | struct list_head *entry, *tmp; |
@@ -317,7 +317,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs) | |||
317 | /* clean up any state from previous QTD ...*/ | 317 | /* clean up any state from previous QTD ...*/ |
318 | if (last) { | 318 | if (last) { |
319 | if (likely (last->urb != urb)) { | 319 | if (likely (last->urb != urb)) { |
320 | ehci_urb_done (ehci, last->urb, regs); | 320 | ehci_urb_done (ehci, last->urb); |
321 | count++; | 321 | count++; |
322 | } | 322 | } |
323 | ehci_qtd_free (ehci, last); | 323 | ehci_qtd_free (ehci, last); |
@@ -407,7 +407,7 @@ halt: | |||
407 | 407 | ||
408 | /* last urb's completion might still need calling */ | 408 | /* last urb's completion might still need calling */ |
409 | if (likely (last != NULL)) { | 409 | if (likely (last != NULL)) { |
410 | ehci_urb_done (ehci, last->urb, regs); | 410 | ehci_urb_done (ehci, last->urb); |
411 | count++; | 411 | count++; |
412 | ehci_qtd_free (ehci, last); | 412 | ehci_qtd_free (ehci, last); |
413 | } | 413 | } |
@@ -962,7 +962,7 @@ submit_async ( | |||
962 | 962 | ||
963 | /* the async qh for the qtds being reclaimed are now unlinked from the HC */ | 963 | /* the async qh for the qtds being reclaimed are now unlinked from the HC */ |
964 | 964 | ||
965 | static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs) | 965 | static void end_unlink_async (struct ehci_hcd *ehci) |
966 | { | 966 | { |
967 | struct ehci_qh *qh = ehci->reclaim; | 967 | struct ehci_qh *qh = ehci->reclaim; |
968 | struct ehci_qh *next; | 968 | struct ehci_qh *next; |
@@ -979,7 +979,7 @@ static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs) | |||
979 | ehci->reclaim = next; | 979 | ehci->reclaim = next; |
980 | qh->reclaim = NULL; | 980 | qh->reclaim = NULL; |
981 | 981 | ||
982 | qh_completions (ehci, qh, regs); | 982 | qh_completions (ehci, qh); |
983 | 983 | ||
984 | if (!list_empty (&qh->qtd_list) | 984 | if (!list_empty (&qh->qtd_list) |
985 | && HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) | 985 | && HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) |
@@ -1047,7 +1047,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
1047 | /* if (unlikely (qh->reclaim != 0)) | 1047 | /* if (unlikely (qh->reclaim != 0)) |
1048 | * this will recurse, probably not much | 1048 | * this will recurse, probably not much |
1049 | */ | 1049 | */ |
1050 | end_unlink_async (ehci, NULL); | 1050 | end_unlink_async (ehci); |
1051 | return; | 1051 | return; |
1052 | } | 1052 | } |
1053 | 1053 | ||
@@ -1059,8 +1059,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
1059 | 1059 | ||
1060 | /*-------------------------------------------------------------------------*/ | 1060 | /*-------------------------------------------------------------------------*/ |
1061 | 1061 | ||
1062 | static void | 1062 | static void scan_async (struct ehci_hcd *ehci) |
1063 | scan_async (struct ehci_hcd *ehci, struct pt_regs *regs) | ||
1064 | { | 1063 | { |
1065 | struct ehci_qh *qh; | 1064 | struct ehci_qh *qh; |
1066 | enum ehci_timer_action action = TIMER_IO_WATCHDOG; | 1065 | enum ehci_timer_action action = TIMER_IO_WATCHDOG; |
@@ -1084,7 +1083,7 @@ rescan: | |||
1084 | */ | 1083 | */ |
1085 | qh = qh_get (qh); | 1084 | qh = qh_get (qh); |
1086 | qh->stamp = ehci->stamp; | 1085 | qh->stamp = ehci->stamp; |
1087 | temp = qh_completions (ehci, qh, regs); | 1086 | temp = qh_completions (ehci, qh); |
1088 | qh_put (qh); | 1087 | qh_put (qh); |
1089 | if (temp != 0) { | 1088 | if (temp != 0) { |
1090 | goto rescan; | 1089 | goto rescan; |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index e5e9c653c907..65c402a0fa7a 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -1553,8 +1553,7 @@ itd_link_urb ( | |||
1553 | static unsigned | 1553 | static unsigned |
1554 | itd_complete ( | 1554 | itd_complete ( |
1555 | struct ehci_hcd *ehci, | 1555 | struct ehci_hcd *ehci, |
1556 | struct ehci_itd *itd, | 1556 | struct ehci_itd *itd |
1557 | struct pt_regs *regs | ||
1558 | ) { | 1557 | ) { |
1559 | struct urb *urb = itd->urb; | 1558 | struct urb *urb = itd->urb; |
1560 | struct usb_iso_packet_descriptor *desc; | 1559 | struct usb_iso_packet_descriptor *desc; |
@@ -1613,7 +1612,7 @@ itd_complete ( | |||
1613 | 1612 | ||
1614 | /* give urb back to the driver ... can be out-of-order */ | 1613 | /* give urb back to the driver ... can be out-of-order */ |
1615 | dev = urb->dev; | 1614 | dev = urb->dev; |
1616 | ehci_urb_done (ehci, urb, regs); | 1615 | ehci_urb_done (ehci, urb); |
1617 | urb = NULL; | 1616 | urb = NULL; |
1618 | 1617 | ||
1619 | /* defer stopping schedule; completion can submit */ | 1618 | /* defer stopping schedule; completion can submit */ |
@@ -1930,8 +1929,7 @@ sitd_link_urb ( | |||
1930 | static unsigned | 1929 | static unsigned |
1931 | sitd_complete ( | 1930 | sitd_complete ( |
1932 | struct ehci_hcd *ehci, | 1931 | struct ehci_hcd *ehci, |
1933 | struct ehci_sitd *sitd, | 1932 | struct ehci_sitd *sitd |
1934 | struct pt_regs *regs | ||
1935 | ) { | 1933 | ) { |
1936 | struct urb *urb = sitd->urb; | 1934 | struct urb *urb = sitd->urb; |
1937 | struct usb_iso_packet_descriptor *desc; | 1935 | struct usb_iso_packet_descriptor *desc; |
@@ -1978,7 +1976,7 @@ sitd_complete ( | |||
1978 | 1976 | ||
1979 | /* give urb back to the driver */ | 1977 | /* give urb back to the driver */ |
1980 | dev = urb->dev; | 1978 | dev = urb->dev; |
1981 | ehci_urb_done (ehci, urb, regs); | 1979 | ehci_urb_done (ehci, urb); |
1982 | urb = NULL; | 1980 | urb = NULL; |
1983 | 1981 | ||
1984 | /* defer stopping schedule; completion can submit */ | 1982 | /* defer stopping schedule; completion can submit */ |
@@ -2065,8 +2063,7 @@ sitd_submit (struct ehci_hcd *ehci, struct urb *urb, gfp_t mem_flags) | |||
2065 | static inline unsigned | 2063 | static inline unsigned |
2066 | sitd_complete ( | 2064 | sitd_complete ( |
2067 | struct ehci_hcd *ehci, | 2065 | struct ehci_hcd *ehci, |
2068 | struct ehci_sitd *sitd, | 2066 | struct ehci_sitd *sitd |
2069 | struct pt_regs *regs | ||
2070 | ) { | 2067 | ) { |
2071 | ehci_err (ehci, "sitd_complete %p?\n", sitd); | 2068 | ehci_err (ehci, "sitd_complete %p?\n", sitd); |
2072 | return 0; | 2069 | return 0; |
@@ -2077,7 +2074,7 @@ sitd_complete ( | |||
2077 | /*-------------------------------------------------------------------------*/ | 2074 | /*-------------------------------------------------------------------------*/ |
2078 | 2075 | ||
2079 | static void | 2076 | static void |
2080 | scan_periodic (struct ehci_hcd *ehci, struct pt_regs *regs) | 2077 | scan_periodic (struct ehci_hcd *ehci) |
2081 | { | 2078 | { |
2082 | unsigned frame, clock, now_uframe, mod; | 2079 | unsigned frame, clock, now_uframe, mod; |
2083 | unsigned modified; | 2080 | unsigned modified; |
@@ -2131,7 +2128,7 @@ restart: | |||
2131 | temp.qh = qh_get (q.qh); | 2128 | temp.qh = qh_get (q.qh); |
2132 | type = Q_NEXT_TYPE (q.qh->hw_next); | 2129 | type = Q_NEXT_TYPE (q.qh->hw_next); |
2133 | q = q.qh->qh_next; | 2130 | q = q.qh->qh_next; |
2134 | modified = qh_completions (ehci, temp.qh, regs); | 2131 | modified = qh_completions (ehci, temp.qh); |
2135 | if (unlikely (list_empty (&temp.qh->qtd_list))) | 2132 | if (unlikely (list_empty (&temp.qh->qtd_list))) |
2136 | intr_deschedule (ehci, temp.qh); | 2133 | intr_deschedule (ehci, temp.qh); |
2137 | qh_put (temp.qh); | 2134 | qh_put (temp.qh); |
@@ -2169,7 +2166,7 @@ restart: | |||
2169 | *hw_p = q.itd->hw_next; | 2166 | *hw_p = q.itd->hw_next; |
2170 | type = Q_NEXT_TYPE (q.itd->hw_next); | 2167 | type = Q_NEXT_TYPE (q.itd->hw_next); |
2171 | wmb(); | 2168 | wmb(); |
2172 | modified = itd_complete (ehci, q.itd, regs); | 2169 | modified = itd_complete (ehci, q.itd); |
2173 | q = *q_p; | 2170 | q = *q_p; |
2174 | break; | 2171 | break; |
2175 | case Q_TYPE_SITD: | 2172 | case Q_TYPE_SITD: |
@@ -2185,7 +2182,7 @@ restart: | |||
2185 | *hw_p = q.sitd->hw_next; | 2182 | *hw_p = q.sitd->hw_next; |
2186 | type = Q_NEXT_TYPE (q.sitd->hw_next); | 2183 | type = Q_NEXT_TYPE (q.sitd->hw_next); |
2187 | wmb(); | 2184 | wmb(); |
2188 | modified = sitd_complete (ehci, q.sitd, regs); | 2185 | modified = sitd_complete (ehci, q.sitd); |
2189 | q = *q_p; | 2186 | q = *q_p; |
2190 | break; | 2187 | break; |
2191 | default: | 2188 | default: |
diff --git a/drivers/usb/host/hc_crisv10.c b/drivers/usb/host/hc_crisv10.c index 61e571782cf7..87eca6aeacf2 100644 --- a/drivers/usb/host/hc_crisv10.c +++ b/drivers/usb/host/hc_crisv10.c | |||
@@ -478,9 +478,9 @@ static int etrax_usb_submit_urb(struct urb *urb, unsigned mem_flags); | |||
478 | static int etrax_usb_unlink_urb(struct urb *urb, int status); | 478 | static int etrax_usb_unlink_urb(struct urb *urb, int status); |
479 | static int etrax_usb_get_frame_number(struct usb_device *usb_dev); | 479 | static int etrax_usb_get_frame_number(struct usb_device *usb_dev); |
480 | 480 | ||
481 | static irqreturn_t etrax_usb_tx_interrupt(int irq, void *vhc, struct pt_regs *regs); | 481 | static irqreturn_t etrax_usb_tx_interrupt(int irq, void *vhc); |
482 | static irqreturn_t etrax_usb_rx_interrupt(int irq, void *vhc, struct pt_regs *regs); | 482 | static irqreturn_t etrax_usb_rx_interrupt(int irq, void *vhc); |
483 | static irqreturn_t etrax_usb_hc_interrupt_top_half(int irq, void *vhc, struct pt_regs *regs); | 483 | static irqreturn_t etrax_usb_hc_interrupt_top_half(int irq, void *vhc); |
484 | static void etrax_usb_hc_interrupt_bottom_half(void *data); | 484 | static void etrax_usb_hc_interrupt_bottom_half(void *data); |
485 | 485 | ||
486 | static void etrax_usb_isoc_descr_interrupt_bottom_half(void *data); | 486 | static void etrax_usb_isoc_descr_interrupt_bottom_half(void *data); |
@@ -1573,7 +1573,7 @@ static int etrax_usb_get_frame_number(struct usb_device *usb_dev) | |||
1573 | return (*R_USB_FM_NUMBER & 0x7ff); | 1573 | return (*R_USB_FM_NUMBER & 0x7ff); |
1574 | } | 1574 | } |
1575 | 1575 | ||
1576 | static irqreturn_t etrax_usb_tx_interrupt(int irq, void *vhc, struct pt_regs *regs) | 1576 | static irqreturn_t etrax_usb_tx_interrupt(int irq, void *vhc) |
1577 | { | 1577 | { |
1578 | DBFENTER; | 1578 | DBFENTER; |
1579 | 1579 | ||
@@ -1839,7 +1839,7 @@ static void etrax_usb_isoc_descr_interrupt_bottom_half(void *data) | |||
1839 | 1839 | ||
1840 | 1840 | ||
1841 | 1841 | ||
1842 | static irqreturn_t etrax_usb_rx_interrupt(int irq, void *vhc, struct pt_regs *regs) | 1842 | static irqreturn_t etrax_usb_rx_interrupt(int irq, void *vhc) |
1843 | { | 1843 | { |
1844 | struct urb *urb; | 1844 | struct urb *urb; |
1845 | etrax_urb_priv_t *urb_priv; | 1845 | etrax_urb_priv_t *urb_priv; |
@@ -3280,7 +3280,7 @@ static void etrax_usb_complete_urb(struct urb *urb, int status) | |||
3280 | 3280 | ||
3281 | 3281 | ||
3282 | 3282 | ||
3283 | static irqreturn_t etrax_usb_hc_interrupt_top_half(int irq, void *vhc, struct pt_regs *regs) | 3283 | static irqreturn_t etrax_usb_hc_interrupt_top_half(int irq, void *vhc) |
3284 | { | 3284 | { |
3285 | usb_interrupt_registers_t *reg; | 3285 | usb_interrupt_registers_t *reg; |
3286 | unsigned long flags; | 3286 | unsigned long flags; |
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index a72e041df8e7..2718b5dc4ec1 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
@@ -418,7 +418,7 @@ static void postproc_atl_queue(struct isp116x *isp116x) | |||
418 | processed urbs. | 418 | processed urbs. |
419 | */ | 419 | */ |
420 | static void finish_request(struct isp116x *isp116x, struct isp116x_ep *ep, | 420 | static void finish_request(struct isp116x *isp116x, struct isp116x_ep *ep, |
421 | struct urb *urb, struct pt_regs *regs) | 421 | struct urb *urb) |
422 | __releases(isp116x->lock) __acquires(isp116x->lock) | 422 | __releases(isp116x->lock) __acquires(isp116x->lock) |
423 | { | 423 | { |
424 | unsigned i; | 424 | unsigned i; |
@@ -432,7 +432,7 @@ __releases(isp116x->lock) __acquires(isp116x->lock) | |||
432 | urb_dbg(urb, "Finish"); | 432 | urb_dbg(urb, "Finish"); |
433 | 433 | ||
434 | spin_unlock(&isp116x->lock); | 434 | spin_unlock(&isp116x->lock); |
435 | usb_hcd_giveback_urb(isp116x_to_hcd(isp116x), urb, regs); | 435 | usb_hcd_giveback_urb(isp116x_to_hcd(isp116x), urb); |
436 | spin_lock(&isp116x->lock); | 436 | spin_lock(&isp116x->lock); |
437 | 437 | ||
438 | /* take idle endpoints out of the schedule */ | 438 | /* take idle endpoints out of the schedule */ |
@@ -568,7 +568,7 @@ static void start_atl_transfers(struct isp116x *isp116x) | |||
568 | /* | 568 | /* |
569 | Finish the processed transfers | 569 | Finish the processed transfers |
570 | */ | 570 | */ |
571 | static void finish_atl_transfers(struct isp116x *isp116x, struct pt_regs *regs) | 571 | static void finish_atl_transfers(struct isp116x *isp116x) |
572 | { | 572 | { |
573 | struct isp116x_ep *ep; | 573 | struct isp116x_ep *ep; |
574 | struct urb *urb; | 574 | struct urb *urb; |
@@ -590,12 +590,12 @@ static void finish_atl_transfers(struct isp116x *isp116x, struct pt_regs *regs) | |||
590 | occured, while URB_SHORT_NOT_OK was set */ | 590 | occured, while URB_SHORT_NOT_OK was set */ |
591 | if (urb && urb->status != -EINPROGRESS | 591 | if (urb && urb->status != -EINPROGRESS |
592 | && ep->nextpid != USB_PID_ACK) | 592 | && ep->nextpid != USB_PID_ACK) |
593 | finish_request(isp116x, ep, urb, regs); | 593 | finish_request(isp116x, ep, urb); |
594 | } | 594 | } |
595 | atomic_dec(&isp116x->atl_finishing); | 595 | atomic_dec(&isp116x->atl_finishing); |
596 | } | 596 | } |
597 | 597 | ||
598 | static irqreturn_t isp116x_irq(struct usb_hcd *hcd, struct pt_regs *regs) | 598 | static irqreturn_t isp116x_irq(struct usb_hcd *hcd) |
599 | { | 599 | { |
600 | struct isp116x *isp116x = hcd_to_isp116x(hcd); | 600 | struct isp116x *isp116x = hcd_to_isp116x(hcd); |
601 | u16 irqstat; | 601 | u16 irqstat; |
@@ -608,7 +608,7 @@ static irqreturn_t isp116x_irq(struct usb_hcd *hcd, struct pt_regs *regs) | |||
608 | 608 | ||
609 | if (irqstat & (HCuPINT_ATL | HCuPINT_SOF)) { | 609 | if (irqstat & (HCuPINT_ATL | HCuPINT_SOF)) { |
610 | ret = IRQ_HANDLED; | 610 | ret = IRQ_HANDLED; |
611 | finish_atl_transfers(isp116x, regs); | 611 | finish_atl_transfers(isp116x); |
612 | } | 612 | } |
613 | 613 | ||
614 | if (irqstat & HCuPINT_OPR) { | 614 | if (irqstat & HCuPINT_OPR) { |
@@ -824,7 +824,7 @@ static int isp116x_urb_enqueue(struct usb_hcd *hcd, | |||
824 | spin_lock(&urb->lock); | 824 | spin_lock(&urb->lock); |
825 | if (urb->status != -EINPROGRESS) { | 825 | if (urb->status != -EINPROGRESS) { |
826 | spin_unlock(&urb->lock); | 826 | spin_unlock(&urb->lock); |
827 | finish_request(isp116x, ep, urb, NULL); | 827 | finish_request(isp116x, ep, urb); |
828 | ret = 0; | 828 | ret = 0; |
829 | goto fail; | 829 | goto fail; |
830 | } | 830 | } |
@@ -870,7 +870,7 @@ static int isp116x_urb_dequeue(struct usb_hcd *hcd, struct urb *urb) | |||
870 | } | 870 | } |
871 | 871 | ||
872 | if (urb) | 872 | if (urb) |
873 | finish_request(isp116x, ep, urb, NULL); | 873 | finish_request(isp116x, ep, urb); |
874 | 874 | ||
875 | spin_unlock_irqrestore(&isp116x->lock, flags); | 875 | spin_unlock_irqrestore(&isp116x->lock, flags); |
876 | return 0; | 876 | return 0; |
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index d1d68c402251..9be6b303e784 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -261,7 +261,7 @@ static int ohci_urb_enqueue ( | |||
261 | if (urb->status != -EINPROGRESS) { | 261 | if (urb->status != -EINPROGRESS) { |
262 | spin_unlock (&urb->lock); | 262 | spin_unlock (&urb->lock); |
263 | urb->hcpriv = urb_priv; | 263 | urb->hcpriv = urb_priv; |
264 | finish_urb (ohci, urb, NULL); | 264 | finish_urb (ohci, urb); |
265 | retval = 0; | 265 | retval = 0; |
266 | goto fail; | 266 | goto fail; |
267 | } | 267 | } |
@@ -337,7 +337,7 @@ static int ohci_urb_dequeue (struct usb_hcd *hcd, struct urb *urb) | |||
337 | * any more ... just clean up every urb's memory. | 337 | * any more ... just clean up every urb's memory. |
338 | */ | 338 | */ |
339 | if (urb->hcpriv) | 339 | if (urb->hcpriv) |
340 | finish_urb (ohci, urb, NULL); | 340 | finish_urb (ohci, urb); |
341 | } | 341 | } |
342 | spin_unlock_irqrestore (&ohci->lock, flags); | 342 | spin_unlock_irqrestore (&ohci->lock, flags); |
343 | return 0; | 343 | return 0; |
@@ -369,7 +369,7 @@ rescan: | |||
369 | if (!HC_IS_RUNNING (hcd->state)) { | 369 | if (!HC_IS_RUNNING (hcd->state)) { |
370 | sanitize: | 370 | sanitize: |
371 | ed->state = ED_IDLE; | 371 | ed->state = ED_IDLE; |
372 | finish_unlinks (ohci, 0, NULL); | 372 | finish_unlinks (ohci, 0); |
373 | } | 373 | } |
374 | 374 | ||
375 | switch (ed->state) { | 375 | switch (ed->state) { |
@@ -691,7 +691,7 @@ retry: | |||
691 | 691 | ||
692 | /* an interrupt happens */ | 692 | /* an interrupt happens */ |
693 | 693 | ||
694 | static irqreturn_t ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs) | 694 | static irqreturn_t ohci_irq (struct usb_hcd *hcd) |
695 | { | 695 | { |
696 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 696 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
697 | struct ohci_regs __iomem *regs = ohci->regs; | 697 | struct ohci_regs __iomem *regs = ohci->regs; |
@@ -747,7 +747,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs) | |||
747 | if (HC_IS_RUNNING(hcd->state)) | 747 | if (HC_IS_RUNNING(hcd->state)) |
748 | ohci_writel (ohci, OHCI_INTR_WDH, ®s->intrdisable); | 748 | ohci_writel (ohci, OHCI_INTR_WDH, ®s->intrdisable); |
749 | spin_lock (&ohci->lock); | 749 | spin_lock (&ohci->lock); |
750 | dl_done_list (ohci, ptregs); | 750 | dl_done_list (ohci); |
751 | spin_unlock (&ohci->lock); | 751 | spin_unlock (&ohci->lock); |
752 | if (HC_IS_RUNNING(hcd->state)) | 752 | if (HC_IS_RUNNING(hcd->state)) |
753 | ohci_writel (ohci, OHCI_INTR_WDH, ®s->intrenable); | 753 | ohci_writel (ohci, OHCI_INTR_WDH, ®s->intrenable); |
@@ -760,7 +760,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs) | |||
760 | */ | 760 | */ |
761 | spin_lock (&ohci->lock); | 761 | spin_lock (&ohci->lock); |
762 | if (ohci->ed_rm_list) | 762 | if (ohci->ed_rm_list) |
763 | finish_unlinks (ohci, ohci_frame_no(ohci), ptregs); | 763 | finish_unlinks (ohci, ohci_frame_no(ohci)); |
764 | if ((ints & OHCI_INTR_SF) != 0 && !ohci->ed_rm_list | 764 | if ((ints & OHCI_INTR_SF) != 0 && !ohci->ed_rm_list |
765 | && HC_IS_RUNNING(hcd->state)) | 765 | && HC_IS_RUNNING(hcd->state)) |
766 | ohci_writel (ohci, OHCI_INTR_SF, ®s->intrdisable); | 766 | ohci_writel (ohci, OHCI_INTR_SF, ®s->intrdisable); |
@@ -852,7 +852,7 @@ static int ohci_restart (struct ohci_hcd *ohci) | |||
852 | urb->status = -ESHUTDOWN; | 852 | urb->status = -ESHUTDOWN; |
853 | spin_unlock (&urb->lock); | 853 | spin_unlock (&urb->lock); |
854 | } | 854 | } |
855 | finish_unlinks (ohci, 0, NULL); | 855 | finish_unlinks (ohci, 0); |
856 | spin_unlock_irq(&ohci->lock); | 856 | spin_unlock_irq(&ohci->lock); |
857 | 857 | ||
858 | /* paranoia, in case that didn't work: */ | 858 | /* paranoia, in case that didn't work: */ |
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index ec75774abeac..6f113596af66 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c | |||
@@ -47,8 +47,8 @@ static void ohci_rhsc_enable (struct usb_hcd *hcd) | |||
47 | #define OHCI_SCHED_ENABLES \ | 47 | #define OHCI_SCHED_ENABLES \ |
48 | (OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_PLE|OHCI_CTRL_IE) | 48 | (OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_PLE|OHCI_CTRL_IE) |
49 | 49 | ||
50 | static void dl_done_list (struct ohci_hcd *, struct pt_regs *); | 50 | static void dl_done_list (struct ohci_hcd *); |
51 | static void finish_unlinks (struct ohci_hcd *, u16 , struct pt_regs *); | 51 | static void finish_unlinks (struct ohci_hcd *, u16); |
52 | 52 | ||
53 | static int ohci_rh_suspend (struct ohci_hcd *ohci, int autostop) | 53 | static int ohci_rh_suspend (struct ohci_hcd *ohci, int autostop) |
54 | __releases(ohci->lock) | 54 | __releases(ohci->lock) |
@@ -94,8 +94,8 @@ __acquires(ohci->lock) | |||
94 | msleep (8); | 94 | msleep (8); |
95 | spin_lock_irq (&ohci->lock); | 95 | spin_lock_irq (&ohci->lock); |
96 | } | 96 | } |
97 | dl_done_list (ohci, NULL); | 97 | dl_done_list (ohci); |
98 | finish_unlinks (ohci, ohci_frame_no(ohci), NULL); | 98 | finish_unlinks (ohci, ohci_frame_no(ohci)); |
99 | 99 | ||
100 | /* maybe resume can wake root hub */ | 100 | /* maybe resume can wake root hub */ |
101 | if (device_may_wakeup(&ohci_to_hcd(ohci)->self.root_hub->dev) || | 101 | if (device_may_wakeup(&ohci_to_hcd(ohci)->self.root_hub->dev) || |
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c index e372306ed0da..e08d1a2664e6 100644 --- a/drivers/usb/host/ohci-q.c +++ b/drivers/usb/host/ohci-q.c | |||
@@ -7,6 +7,8 @@ | |||
7 | * This file is licenced under the GPL. | 7 | * This file is licenced under the GPL. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/irq.h> | ||
11 | |||
10 | static void urb_free_priv (struct ohci_hcd *hc, urb_priv_t *urb_priv) | 12 | static void urb_free_priv (struct ohci_hcd *hc, urb_priv_t *urb_priv) |
11 | { | 13 | { |
12 | int last = urb_priv->length - 1; | 14 | int last = urb_priv->length - 1; |
@@ -34,7 +36,7 @@ static void urb_free_priv (struct ohci_hcd *hc, urb_priv_t *urb_priv) | |||
34 | * PRECONDITION: ohci lock held, irqs blocked. | 36 | * PRECONDITION: ohci lock held, irqs blocked. |
35 | */ | 37 | */ |
36 | static void | 38 | static void |
37 | finish_urb (struct ohci_hcd *ohci, struct urb *urb, struct pt_regs *regs) | 39 | finish_urb (struct ohci_hcd *ohci, struct urb *urb) |
38 | __releases(ohci->lock) | 40 | __releases(ohci->lock) |
39 | __acquires(ohci->lock) | 41 | __acquires(ohci->lock) |
40 | { | 42 | { |
@@ -73,7 +75,7 @@ __acquires(ohci->lock) | |||
73 | 75 | ||
74 | /* urb->complete() can reenter this HCD */ | 76 | /* urb->complete() can reenter this HCD */ |
75 | spin_unlock (&ohci->lock); | 77 | spin_unlock (&ohci->lock); |
76 | usb_hcd_giveback_urb (ohci_to_hcd(ohci), urb, regs); | 78 | usb_hcd_giveback_urb (ohci_to_hcd(ohci), urb); |
77 | spin_lock (&ohci->lock); | 79 | spin_lock (&ohci->lock); |
78 | 80 | ||
79 | /* stop periodic dma if it's not needed */ | 81 | /* stop periodic dma if it's not needed */ |
@@ -910,7 +912,7 @@ static struct td *dl_reverse_done_list (struct ohci_hcd *ohci) | |||
910 | 912 | ||
911 | /* there are some urbs/eds to unlink; called in_irq(), with HCD locked */ | 913 | /* there are some urbs/eds to unlink; called in_irq(), with HCD locked */ |
912 | static void | 914 | static void |
913 | finish_unlinks (struct ohci_hcd *ohci, u16 tick, struct pt_regs *regs) | 915 | finish_unlinks (struct ohci_hcd *ohci, u16 tick) |
914 | { | 916 | { |
915 | struct ed *ed, **last; | 917 | struct ed *ed, **last; |
916 | 918 | ||
@@ -923,7 +925,7 @@ rescan_all: | |||
923 | /* only take off EDs that the HC isn't using, accounting for | 925 | /* only take off EDs that the HC isn't using, accounting for |
924 | * frame counter wraps and EDs with partially retired TDs | 926 | * frame counter wraps and EDs with partially retired TDs |
925 | */ | 927 | */ |
926 | if (likely (regs && HC_IS_RUNNING(ohci_to_hcd(ohci)->state))) { | 928 | if (likely (get_irq_regs() && HC_IS_RUNNING(ohci_to_hcd(ohci)->state))) { |
927 | if (tick_before (tick, ed->tick)) { | 929 | if (tick_before (tick, ed->tick)) { |
928 | skip_ed: | 930 | skip_ed: |
929 | last = &ed->ed_next; | 931 | last = &ed->ed_next; |
@@ -990,7 +992,7 @@ rescan_this: | |||
990 | /* if URB is done, clean up */ | 992 | /* if URB is done, clean up */ |
991 | if (urb_priv->td_cnt == urb_priv->length) { | 993 | if (urb_priv->td_cnt == urb_priv->length) { |
992 | modified = completed = 1; | 994 | modified = completed = 1; |
993 | finish_urb (ohci, urb, regs); | 995 | finish_urb (ohci, urb); |
994 | } | 996 | } |
995 | } | 997 | } |
996 | if (completed && !list_empty (&ed->td_list)) | 998 | if (completed && !list_empty (&ed->td_list)) |
@@ -1068,7 +1070,7 @@ rescan_this: | |||
1068 | * scanning the (re-reversed) donelist as this does. | 1070 | * scanning the (re-reversed) donelist as this does. |
1069 | */ | 1071 | */ |
1070 | static void | 1072 | static void |
1071 | dl_done_list (struct ohci_hcd *ohci, struct pt_regs *regs) | 1073 | dl_done_list (struct ohci_hcd *ohci) |
1072 | { | 1074 | { |
1073 | struct td *td = dl_reverse_done_list (ohci); | 1075 | struct td *td = dl_reverse_done_list (ohci); |
1074 | 1076 | ||
@@ -1084,7 +1086,7 @@ dl_done_list (struct ohci_hcd *ohci, struct pt_regs *regs) | |||
1084 | 1086 | ||
1085 | /* If all this urb's TDs are done, call complete() */ | 1087 | /* If all this urb's TDs are done, call complete() */ |
1086 | if (urb_priv->td_cnt == urb_priv->length) | 1088 | if (urb_priv->td_cnt == urb_priv->length) |
1087 | finish_urb (ohci, urb, regs); | 1089 | finish_urb (ohci, urb); |
1088 | 1090 | ||
1089 | /* clean schedule: unlink EDs that are no longer busy */ | 1091 | /* clean schedule: unlink EDs that are no longer busy */ |
1090 | if (list_empty (&ed->td_list)) { | 1092 | if (list_empty (&ed->td_list)) { |
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 3a586aab3939..5fa5647ea095 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
@@ -428,7 +428,6 @@ static void finish_request( | |||
428 | struct sl811 *sl811, | 428 | struct sl811 *sl811, |
429 | struct sl811h_ep *ep, | 429 | struct sl811h_ep *ep, |
430 | struct urb *urb, | 430 | struct urb *urb, |
431 | struct pt_regs *regs, | ||
432 | int status | 431 | int status |
433 | ) __releases(sl811->lock) __acquires(sl811->lock) | 432 | ) __releases(sl811->lock) __acquires(sl811->lock) |
434 | { | 433 | { |
@@ -444,7 +443,7 @@ static void finish_request( | |||
444 | spin_unlock(&urb->lock); | 443 | spin_unlock(&urb->lock); |
445 | 444 | ||
446 | spin_unlock(&sl811->lock); | 445 | spin_unlock(&sl811->lock); |
447 | usb_hcd_giveback_urb(sl811_to_hcd(sl811), urb, regs); | 446 | usb_hcd_giveback_urb(sl811_to_hcd(sl811), urb); |
448 | spin_lock(&sl811->lock); | 447 | spin_lock(&sl811->lock); |
449 | 448 | ||
450 | /* leave active endpoints in the schedule */ | 449 | /* leave active endpoints in the schedule */ |
@@ -484,7 +483,7 @@ static void finish_request( | |||
484 | } | 483 | } |
485 | 484 | ||
486 | static void | 485 | static void |
487 | done(struct sl811 *sl811, struct sl811h_ep *ep, u8 bank, struct pt_regs *regs) | 486 | done(struct sl811 *sl811, struct sl811h_ep *ep, u8 bank) |
488 | { | 487 | { |
489 | u8 status; | 488 | u8 status; |
490 | struct urb *urb; | 489 | struct urb *urb; |
@@ -608,7 +607,7 @@ done(struct sl811 *sl811, struct sl811h_ep *ep, u8 bank, struct pt_regs *regs) | |||
608 | } | 607 | } |
609 | 608 | ||
610 | if (urb && (urbstat != -EINPROGRESS || urb->status != -EINPROGRESS)) | 609 | if (urb && (urbstat != -EINPROGRESS || urb->status != -EINPROGRESS)) |
611 | finish_request(sl811, ep, urb, regs, urbstat); | 610 | finish_request(sl811, ep, urb, urbstat); |
612 | } | 611 | } |
613 | 612 | ||
614 | static inline u8 checkdone(struct sl811 *sl811) | 613 | static inline u8 checkdone(struct sl811 *sl811) |
@@ -641,7 +640,7 @@ static inline u8 checkdone(struct sl811 *sl811) | |||
641 | return irqstat; | 640 | return irqstat; |
642 | } | 641 | } |
643 | 642 | ||
644 | static irqreturn_t sl811h_irq(struct usb_hcd *hcd, struct pt_regs *regs) | 643 | static irqreturn_t sl811h_irq(struct usb_hcd *hcd) |
645 | { | 644 | { |
646 | struct sl811 *sl811 = hcd_to_sl811(hcd); | 645 | struct sl811 *sl811 = hcd_to_sl811(hcd); |
647 | u8 irqstat; | 646 | u8 irqstat; |
@@ -670,13 +669,13 @@ retry: | |||
670 | * issued ... that's fine if they're different endpoints. | 669 | * issued ... that's fine if they're different endpoints. |
671 | */ | 670 | */ |
672 | if (irqstat & SL11H_INTMASK_DONE_A) { | 671 | if (irqstat & SL11H_INTMASK_DONE_A) { |
673 | done(sl811, sl811->active_a, SL811_EP_A(SL811_HOST_BUF), regs); | 672 | done(sl811, sl811->active_a, SL811_EP_A(SL811_HOST_BUF)); |
674 | sl811->active_a = NULL; | 673 | sl811->active_a = NULL; |
675 | sl811->stat_a++; | 674 | sl811->stat_a++; |
676 | } | 675 | } |
677 | #ifdef USE_B | 676 | #ifdef USE_B |
678 | if (irqstat & SL11H_INTMASK_DONE_B) { | 677 | if (irqstat & SL11H_INTMASK_DONE_B) { |
679 | done(sl811, sl811->active_b, SL811_EP_B(SL811_HOST_BUF), regs); | 678 | done(sl811, sl811->active_b, SL811_EP_B(SL811_HOST_BUF)); |
680 | sl811->active_b = NULL; | 679 | sl811->active_b = NULL; |
681 | sl811->stat_b++; | 680 | sl811->stat_b++; |
682 | } | 681 | } |
@@ -723,7 +722,7 @@ retry: | |||
723 | container_of(sl811->active_a | 722 | container_of(sl811->active_a |
724 | ->hep->urb_list.next, | 723 | ->hep->urb_list.next, |
725 | struct urb, urb_list), | 724 | struct urb, urb_list), |
726 | NULL, -ESHUTDOWN); | 725 | -ESHUTDOWN); |
727 | sl811->active_a = NULL; | 726 | sl811->active_a = NULL; |
728 | } | 727 | } |
729 | #ifdef USE_B | 728 | #ifdef USE_B |
@@ -957,7 +956,7 @@ static int sl811h_urb_enqueue( | |||
957 | spin_lock(&urb->lock); | 956 | spin_lock(&urb->lock); |
958 | if (urb->status != -EINPROGRESS) { | 957 | if (urb->status != -EINPROGRESS) { |
959 | spin_unlock(&urb->lock); | 958 | spin_unlock(&urb->lock); |
960 | finish_request(sl811, ep, urb, NULL, 0); | 959 | finish_request(sl811, ep, urb, 0); |
961 | retval = 0; | 960 | retval = 0; |
962 | goto fail; | 961 | goto fail; |
963 | } | 962 | } |
@@ -1026,7 +1025,7 @@ static int sl811h_urb_dequeue(struct usb_hcd *hcd, struct urb *urb) | |||
1026 | } | 1025 | } |
1027 | 1026 | ||
1028 | if (urb) | 1027 | if (urb) |
1029 | finish_request(sl811, ep, urb, NULL, 0); | 1028 | finish_request(sl811, ep, urb, 0); |
1030 | else | 1029 | else |
1031 | VDBG("dequeue, urb %p active %s; wait4irq\n", urb, | 1030 | VDBG("dequeue, urb %p active %s; wait4irq\n", urb, |
1032 | (sl811->active_a == ep) ? "A" : "B"); | 1031 | (sl811->active_a == ep) ? "A" : "B"); |
@@ -1083,7 +1082,7 @@ sl811h_hub_status_data(struct usb_hcd *hcd, char *buf) | |||
1083 | */ | 1082 | */ |
1084 | local_irq_save(flags); | 1083 | local_irq_save(flags); |
1085 | if (!timer_pending(&sl811->timer)) { | 1084 | if (!timer_pending(&sl811->timer)) { |
1086 | if (sl811h_irq( /* ~0, */ hcd, NULL) != IRQ_NONE) | 1085 | if (sl811h_irq( /* ~0, */ hcd) != IRQ_NONE) |
1087 | sl811->stat_lost++; | 1086 | sl811->stat_lost++; |
1088 | } | 1087 | } |
1089 | local_irq_restore(flags); | 1088 | local_irq_restore(flags); |
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index 0a315200b331..32c635ecbf31 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c | |||
@@ -557,7 +557,7 @@ static void u132_hcd_giveback_urb(struct u132 *u132, struct u132_endp *endp, | |||
557 | u132_ring_queue_work(u132, ring, 0); | 557 | u132_ring_queue_work(u132, ring, 0); |
558 | up(&u132->scheduler_lock); | 558 | up(&u132->scheduler_lock); |
559 | u132_endp_put_kref(u132, endp); | 559 | u132_endp_put_kref(u132, endp); |
560 | usb_hcd_giveback_urb(hcd, urb, NULL); | 560 | usb_hcd_giveback_urb(hcd, urb); |
561 | return; | 561 | return; |
562 | } | 562 | } |
563 | 563 | ||
@@ -590,7 +590,7 @@ static void u132_hcd_abandon_urb(struct u132 *u132, struct u132_endp *endp, | |||
590 | endp->active = 0; | 590 | endp->active = 0; |
591 | spin_unlock_irqrestore(&endp->queue_lock.slock, irqs); | 591 | spin_unlock_irqrestore(&endp->queue_lock.slock, irqs); |
592 | kfree(urbq); | 592 | kfree(urbq); |
593 | } usb_hcd_giveback_urb(hcd, urb, NULL); | 593 | } usb_hcd_giveback_urb(hcd, urb); |
594 | return; | 594 | return; |
595 | } | 595 | } |
596 | 596 | ||
@@ -2434,7 +2434,7 @@ static int dequeue_from_overflow_chain(struct u132 *u132, | |||
2434 | endp->queue_size -= 1; | 2434 | endp->queue_size -= 1; |
2435 | urb->error_count = 0; | 2435 | urb->error_count = 0; |
2436 | urb->hcpriv = NULL; | 2436 | urb->hcpriv = NULL; |
2437 | usb_hcd_giveback_urb(hcd, urb, NULL); | 2437 | usb_hcd_giveback_urb(hcd, urb); |
2438 | return 0; | 2438 | return 0; |
2439 | } else | 2439 | } else |
2440 | continue; | 2440 | continue; |
@@ -2512,7 +2512,7 @@ static int u132_endp_urb_dequeue(struct u132 *u132, struct u132_endp *endp, | |||
2512 | kfree(urbq); | 2512 | kfree(urbq); |
2513 | } urb->error_count = 0; | 2513 | } urb->error_count = 0; |
2514 | urb->hcpriv = NULL; | 2514 | urb->hcpriv = NULL; |
2515 | usb_hcd_giveback_urb(hcd, urb, NULL); | 2515 | usb_hcd_giveback_urb(hcd, urb); |
2516 | return 0; | 2516 | return 0; |
2517 | } else if (list_empty(&endp->urb_more)) { | 2517 | } else if (list_empty(&endp->urb_more)) { |
2518 | dev_err(&u132->platform_dev->dev, "urb=%p not found in " | 2518 | dev_err(&u132->platform_dev->dev, "urb=%p not found in " |
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index eb4eab98e8bf..45ee6920a850 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c | |||
@@ -252,7 +252,7 @@ __acquires(uhci->lock) | |||
252 | uhci->is_stopped = UHCI_IS_STOPPED; | 252 | uhci->is_stopped = UHCI_IS_STOPPED; |
253 | uhci_to_hcd(uhci)->poll_rh = !int_enable; | 253 | uhci_to_hcd(uhci)->poll_rh = !int_enable; |
254 | 254 | ||
255 | uhci_scan_schedule(uhci, NULL); | 255 | uhci_scan_schedule(uhci); |
256 | uhci_fsbr_off(uhci); | 256 | uhci_fsbr_off(uhci); |
257 | } | 257 | } |
258 | 258 | ||
@@ -309,7 +309,7 @@ __acquires(uhci->lock) | |||
309 | mod_timer(&uhci_to_hcd(uhci)->rh_timer, jiffies); | 309 | mod_timer(&uhci_to_hcd(uhci)->rh_timer, jiffies); |
310 | } | 310 | } |
311 | 311 | ||
312 | static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs) | 312 | static irqreturn_t uhci_irq(struct usb_hcd *hcd) |
313 | { | 313 | { |
314 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); | 314 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); |
315 | unsigned short status; | 315 | unsigned short status; |
@@ -358,7 +358,7 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs) | |||
358 | usb_hcd_poll_rh_status(hcd); | 358 | usb_hcd_poll_rh_status(hcd); |
359 | else { | 359 | else { |
360 | spin_lock_irqsave(&uhci->lock, flags); | 360 | spin_lock_irqsave(&uhci->lock, flags); |
361 | uhci_scan_schedule(uhci, regs); | 361 | uhci_scan_schedule(uhci); |
362 | spin_unlock_irqrestore(&uhci->lock, flags); | 362 | spin_unlock_irqrestore(&uhci->lock, flags); |
363 | } | 363 | } |
364 | 364 | ||
@@ -671,7 +671,7 @@ static void uhci_stop(struct usb_hcd *hcd) | |||
671 | spin_lock_irq(&uhci->lock); | 671 | spin_lock_irq(&uhci->lock); |
672 | if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) && !uhci->dead) | 672 | if (test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) && !uhci->dead) |
673 | uhci_hc_died(uhci); | 673 | uhci_hc_died(uhci); |
674 | uhci_scan_schedule(uhci, NULL); | 674 | uhci_scan_schedule(uhci); |
675 | spin_unlock_irq(&uhci->lock); | 675 | spin_unlock_irq(&uhci->lock); |
676 | 676 | ||
677 | del_timer_sync(&uhci->fsbr_timer); | 677 | del_timer_sync(&uhci->fsbr_timer); |
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c index 16fb72eb6fc9..f8347f1a10b6 100644 --- a/drivers/usb/host/uhci-hub.c +++ b/drivers/usb/host/uhci-hub.c | |||
@@ -176,7 +176,7 @@ static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf) | |||
176 | 176 | ||
177 | spin_lock_irqsave(&uhci->lock, flags); | 177 | spin_lock_irqsave(&uhci->lock, flags); |
178 | 178 | ||
179 | uhci_scan_schedule(uhci, NULL); | 179 | uhci_scan_schedule(uhci); |
180 | if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) || uhci->dead) | 180 | if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) || uhci->dead) |
181 | goto done; | 181 | goto done; |
182 | uhci_check_ports(uhci); | 182 | uhci_check_ports(uhci); |
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c index 431e8f31f1a9..06115f22a4fa 100644 --- a/drivers/usb/host/uhci-q.c +++ b/drivers/usb/host/uhci-q.c | |||
@@ -1244,7 +1244,7 @@ done: | |||
1244 | * Finish unlinking an URB and give it back | 1244 | * Finish unlinking an URB and give it back |
1245 | */ | 1245 | */ |
1246 | static void uhci_giveback_urb(struct uhci_hcd *uhci, struct uhci_qh *qh, | 1246 | static void uhci_giveback_urb(struct uhci_hcd *uhci, struct uhci_qh *qh, |
1247 | struct urb *urb, struct pt_regs *regs) | 1247 | struct urb *urb) |
1248 | __releases(uhci->lock) | 1248 | __releases(uhci->lock) |
1249 | __acquires(uhci->lock) | 1249 | __acquires(uhci->lock) |
1250 | { | 1250 | { |
@@ -1293,7 +1293,7 @@ __acquires(uhci->lock) | |||
1293 | } | 1293 | } |
1294 | 1294 | ||
1295 | spin_unlock(&uhci->lock); | 1295 | spin_unlock(&uhci->lock); |
1296 | usb_hcd_giveback_urb(uhci_to_hcd(uhci), urb, regs); | 1296 | usb_hcd_giveback_urb(uhci_to_hcd(uhci), urb); |
1297 | spin_lock(&uhci->lock); | 1297 | spin_lock(&uhci->lock); |
1298 | 1298 | ||
1299 | /* If the queue is now empty, we can unlink the QH and give up its | 1299 | /* If the queue is now empty, we can unlink the QH and give up its |
@@ -1313,8 +1313,7 @@ __acquires(uhci->lock) | |||
1313 | (qh->state == QH_STATE_UNLINKING && \ | 1313 | (qh->state == QH_STATE_UNLINKING && \ |
1314 | uhci->frame_number + uhci->is_stopped != qh->unlink_frame) | 1314 | uhci->frame_number + uhci->is_stopped != qh->unlink_frame) |
1315 | 1315 | ||
1316 | static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh, | 1316 | static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh) |
1317 | struct pt_regs *regs) | ||
1318 | { | 1317 | { |
1319 | struct urb_priv *urbp; | 1318 | struct urb_priv *urbp; |
1320 | struct urb *urb; | 1319 | struct urb *urb; |
@@ -1347,7 +1346,7 @@ static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh, | |||
1347 | return; | 1346 | return; |
1348 | } | 1347 | } |
1349 | 1348 | ||
1350 | uhci_giveback_urb(uhci, qh, urb, regs); | 1349 | uhci_giveback_urb(uhci, qh, urb); |
1351 | if (status < 0 && qh->type != USB_ENDPOINT_XFER_ISOC) | 1350 | if (status < 0 && qh->type != USB_ENDPOINT_XFER_ISOC) |
1352 | break; | 1351 | break; |
1353 | } | 1352 | } |
@@ -1372,7 +1371,7 @@ restart: | |||
1372 | qh->is_stopped = 0; | 1371 | qh->is_stopped = 0; |
1373 | return; | 1372 | return; |
1374 | } | 1373 | } |
1375 | uhci_giveback_urb(uhci, qh, urb, regs); | 1374 | uhci_giveback_urb(uhci, qh, urb); |
1376 | goto restart; | 1375 | goto restart; |
1377 | } | 1376 | } |
1378 | } | 1377 | } |
@@ -1487,7 +1486,7 @@ done: | |||
1487 | /* | 1486 | /* |
1488 | * Process events in the schedule, but only in one thread at a time | 1487 | * Process events in the schedule, but only in one thread at a time |
1489 | */ | 1488 | */ |
1490 | static void uhci_scan_schedule(struct uhci_hcd *uhci, struct pt_regs *regs) | 1489 | static void uhci_scan_schedule(struct uhci_hcd *uhci) |
1491 | { | 1490 | { |
1492 | int i; | 1491 | int i; |
1493 | struct uhci_qh *qh; | 1492 | struct uhci_qh *qh; |
@@ -1515,7 +1514,7 @@ rescan: | |||
1515 | struct uhci_qh, node); | 1514 | struct uhci_qh, node); |
1516 | 1515 | ||
1517 | if (uhci_advance_check(uhci, qh)) { | 1516 | if (uhci_advance_check(uhci, qh)) { |
1518 | uhci_scan_qh(uhci, qh, regs); | 1517 | uhci_scan_qh(uhci, qh); |
1519 | if (qh->state == QH_STATE_ACTIVE) { | 1518 | if (qh->state == QH_STATE_ACTIVE) { |
1520 | uhci_urbp_wants_fsbr(uhci, | 1519 | uhci_urbp_wants_fsbr(uhci, |
1521 | list_entry(qh->queue.next, struct urb_priv, node)); | 1520 | list_entry(qh->queue.next, struct urb_priv, node)); |