diff options
Diffstat (limited to 'drivers/usb/host/uhci-hcd.c')
-rw-r--r-- | drivers/usb/host/uhci-hcd.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index 79efaf7d86a3..dfe121d35887 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c | |||
@@ -23,11 +23,6 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/config.h> | 25 | #include <linux/config.h> |
26 | #ifdef CONFIG_USB_DEBUG | ||
27 | #define DEBUG | ||
28 | #else | ||
29 | #undef DEBUG | ||
30 | #endif | ||
31 | #include <linux/module.h> | 26 | #include <linux/module.h> |
32 | #include <linux/pci.h> | 27 | #include <linux/pci.h> |
33 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
@@ -67,10 +62,10 @@ Alan Stern" | |||
67 | 62 | ||
68 | /* | 63 | /* |
69 | * debug = 0, no debugging messages | 64 | * debug = 0, no debugging messages |
70 | * debug = 1, dump failed URB's except for stalls | 65 | * debug = 1, dump failed URBs except for stalls |
71 | * debug = 2, dump all failed URB's (including stalls) | 66 | * debug = 2, dump all failed URBs (including stalls) |
72 | * show all queues in /debug/uhci/[pci_addr] | 67 | * show all queues in /debug/uhci/[pci_addr] |
73 | * debug = 3, show all TD's in URB's when dumping | 68 | * debug = 3, show all TDs in URBs when dumping |
74 | */ | 69 | */ |
75 | #ifdef DEBUG | 70 | #ifdef DEBUG |
76 | static int debug = 1; | 71 | static int debug = 1; |
@@ -93,7 +88,7 @@ static void uhci_get_current_frame_number(struct uhci_hcd *uhci); | |||
93 | #define FSBR_DELAY msecs_to_jiffies(50) | 88 | #define FSBR_DELAY msecs_to_jiffies(50) |
94 | 89 | ||
95 | /* When we timeout an idle transfer for FSBR, we'll switch it over to */ | 90 | /* When we timeout an idle transfer for FSBR, we'll switch it over to */ |
96 | /* depth first traversal. We'll do it in groups of this number of TD's */ | 91 | /* depth first traversal. We'll do it in groups of this number of TDs */ |
97 | /* to make sure it doesn't hog all of the bandwidth */ | 92 | /* to make sure it doesn't hog all of the bandwidth */ |
98 | #define DEPTH_INTERVAL 5 | 93 | #define DEPTH_INTERVAL 5 |
99 | 94 | ||
@@ -478,8 +473,6 @@ static int uhci_start(struct usb_hcd *hcd) | |||
478 | struct dentry *dentry; | 473 | struct dentry *dentry; |
479 | 474 | ||
480 | hcd->uses_new_polling = 1; | 475 | hcd->uses_new_polling = 1; |
481 | if (pci_find_capability(to_pci_dev(uhci_dev(uhci)), PCI_CAP_ID_PM)) | ||
482 | hcd->can_wakeup = 1; /* Assume it supports PME# */ | ||
483 | 476 | ||
484 | dentry = debugfs_create_file(hcd->self.bus_name, | 477 | dentry = debugfs_create_file(hcd->self.bus_name, |
485 | S_IFREG|S_IRUGO|S_IWUSR, uhci_debugfs_root, uhci, | 478 | S_IFREG|S_IRUGO|S_IWUSR, uhci_debugfs_root, uhci, |
@@ -573,7 +566,7 @@ static int uhci_start(struct usb_hcd *hcd) | |||
573 | uhci->skel_bulk_qh->link = cpu_to_le32(uhci->skel_term_qh->dma_handle) | UHCI_PTR_QH; | 566 | uhci->skel_bulk_qh->link = cpu_to_le32(uhci->skel_term_qh->dma_handle) | UHCI_PTR_QH; |
574 | 567 | ||
575 | /* This dummy TD is to work around a bug in Intel PIIX controllers */ | 568 | /* This dummy TD is to work around a bug in Intel PIIX controllers */ |
576 | uhci_fill_td(uhci->term_td, 0, (UHCI_NULL_DATA_SIZE << 21) | | 569 | uhci_fill_td(uhci->term_td, 0, uhci_explen(0) | |
577 | (0x7f << TD_TOKEN_DEVADDR_SHIFT) | USB_PID_IN, 0); | 570 | (0x7f << TD_TOKEN_DEVADDR_SHIFT) | USB_PID_IN, 0); |
578 | uhci->term_td->link = cpu_to_le32(uhci->term_td->dma_handle); | 571 | uhci->term_td->link = cpu_to_le32(uhci->term_td->dma_handle); |
579 | 572 | ||
@@ -735,8 +728,9 @@ static int uhci_resume(struct usb_hcd *hcd) | |||
735 | 728 | ||
736 | dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__); | 729 | dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__); |
737 | 730 | ||
738 | /* We aren't in D3 state anymore, we do that even if dead as I | 731 | /* Since we aren't in D3 any more, it's safe to set this flag |
739 | * really don't want to keep a stale HCD_FLAG_HW_ACCESSIBLE=0 | 732 | * even if the controller was dead. It might not even be dead |
733 | * any more, if the firmware or quirks code has reset it. | ||
740 | */ | 734 | */ |
741 | set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | 735 | set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); |
742 | mb(); | 736 | mb(); |
@@ -755,8 +749,12 @@ static int uhci_resume(struct usb_hcd *hcd) | |||
755 | check_and_reset_hc(uhci); | 749 | check_and_reset_hc(uhci); |
756 | configure_hc(uhci); | 750 | configure_hc(uhci); |
757 | 751 | ||
758 | if (uhci->rh_state == UHCI_RH_RESET) | 752 | if (uhci->rh_state == UHCI_RH_RESET) { |
753 | |||
754 | /* The controller had to be reset */ | ||
755 | usb_root_hub_lost_power(hcd->self.root_hub); | ||
759 | suspend_rh(uhci, UHCI_RH_SUSPENDED); | 756 | suspend_rh(uhci, UHCI_RH_SUSPENDED); |
757 | } | ||
760 | 758 | ||
761 | spin_unlock_irq(&uhci->lock); | 759 | spin_unlock_irq(&uhci->lock); |
762 | 760 | ||
@@ -882,7 +880,7 @@ static int __init uhci_hcd_init(void) | |||
882 | 880 | ||
883 | init_failed: | 881 | init_failed: |
884 | if (kmem_cache_destroy(uhci_up_cachep)) | 882 | if (kmem_cache_destroy(uhci_up_cachep)) |
885 | warn("not all urb_priv's were freed!"); | 883 | warn("not all urb_privs were freed!"); |
886 | 884 | ||
887 | up_failed: | 885 | up_failed: |
888 | debugfs_remove(uhci_debugfs_root); | 886 | debugfs_remove(uhci_debugfs_root); |
@@ -900,7 +898,7 @@ static void __exit uhci_hcd_cleanup(void) | |||
900 | pci_unregister_driver(&uhci_pci_driver); | 898 | pci_unregister_driver(&uhci_pci_driver); |
901 | 899 | ||
902 | if (kmem_cache_destroy(uhci_up_cachep)) | 900 | if (kmem_cache_destroy(uhci_up_cachep)) |
903 | warn("not all urb_priv's were freed!"); | 901 | warn("not all urb_privs were freed!"); |
904 | 902 | ||
905 | debugfs_remove(uhci_debugfs_root); | 903 | debugfs_remove(uhci_debugfs_root); |
906 | kfree(errbuf); | 904 | kfree(errbuf); |