Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usbcore: remove usb_suspend_root_hub

This patch (as740) removes the existing support for autosuspend of
root hubs. That support fit in rather awkwardly with the rest of
usbcore and it was used only by ohci-hcd. It won't be needed any more
since the hub driver will take care of autosuspending all hubs, root
or external.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Alan Stern and committed by
Greg Kroah-Hartman
02c399ee 01d883d4

+1 -71
-44
drivers/usb/core/hcd.c
··· 1431 1431 return status; 1432 1432 } 1433 1433 1434 - /* 1435 - * usb_hcd_suspend_root_hub - HCD autosuspends downstream ports 1436 - * @hcd: host controller for this root hub 1437 - * 1438 - * This call arranges that usb_hcd_resume_root_hub() is safe to call later; 1439 - * that the HCD's root hub polling is deactivated; and that the root's hub 1440 - * driver is suspended. HCDs may call this to autosuspend when their root 1441 - * hub's downstream ports are all inactive: unpowered, disconnected, 1442 - * disabled, or suspended. 1443 - * 1444 - * The HCD will autoresume on device connect change detection (using SRP 1445 - * or a D+/D- pullup). The HCD also autoresumes on remote wakeup signaling 1446 - * from any ports that are suspended (if that is enabled). In most cases, 1447 - * overcurrent signaling (on powered ports) will also start autoresume. 1448 - * 1449 - * Always called with IRQs blocked. 1450 - */ 1451 - void usb_hcd_suspend_root_hub (struct usb_hcd *hcd) 1452 - { 1453 - struct urb *urb; 1454 - 1455 - spin_lock (&hcd_root_hub_lock); 1456 - usb_suspend_root_hub (hcd->self.root_hub); 1457 - 1458 - /* force status urb to complete/unlink while suspended */ 1459 - if (hcd->status_urb) { 1460 - urb = hcd->status_urb; 1461 - urb->status = -ECONNRESET; 1462 - urb->hcpriv = NULL; 1463 - urb->actual_length = 0; 1464 - 1465 - del_timer (&hcd->rh_timer); 1466 - hcd->poll_pending = 0; 1467 - hcd->status_urb = NULL; 1468 - } else 1469 - urb = NULL; 1470 - spin_unlock (&hcd_root_hub_lock); 1471 - hcd->state = HC_STATE_SUSPENDED; 1472 - 1473 - if (urb) 1474 - usb_hcd_giveback_urb (hcd, urb, NULL); 1475 - } 1476 - EXPORT_SYMBOL_GPL(usb_hcd_suspend_root_hub); 1477 - 1478 1434 /** 1479 1435 * usb_hcd_resume_root_hub - called by HCD to resume its root hub 1480 1436 * @hcd: host controller for this root hub
-6
drivers/usb/core/hcd.h
··· 368 368 #define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN)) 369 369 370 370 #ifdef CONFIG_PM 371 - extern void usb_hcd_suspend_root_hub (struct usb_hcd *hcd); 372 371 extern void usb_hcd_resume_root_hub (struct usb_hcd *hcd); 373 372 extern void usb_root_hub_lost_power (struct usb_device *rhdev); 374 373 extern int hcd_bus_suspend (struct usb_bus *bus); 375 374 extern int hcd_bus_resume (struct usb_bus *bus); 376 375 #else 377 - static inline void usb_hcd_suspend_root_hub(struct usb_hcd *hcd) 378 - { 379 - return; 380 - } 381 - 382 376 static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) 383 377 { 384 378 return;
+1 -17
drivers/usb/core/hub.c
··· 452 452 msleep(max(pgood_delay, (unsigned) 100)); 453 453 } 454 454 455 - static inline void __hub_quiesce(struct usb_hub *hub) 455 + static void hub_quiesce(struct usb_hub *hub) 456 456 { 457 457 /* (nonblocking) khubd and related activity won't re-trigger */ 458 458 hub->quiescing = 1; 459 459 hub->activating = 0; 460 460 hub->resume_root_hub = 0; 461 - } 462 461 463 - static void hub_quiesce(struct usb_hub *hub) 464 - { 465 462 /* (blocking) stop khubd and related activity */ 466 - __hub_quiesce(hub); 467 463 usb_kill_urb(hub->urb); 468 464 if (hub->has_indicators) 469 465 cancel_delayed_work(&hub->leds); ··· 1909 1913 #define hub_suspend NULL 1910 1914 #define hub_resume NULL 1911 1915 #endif 1912 - 1913 - void usb_suspend_root_hub(struct usb_device *hdev) 1914 - { 1915 - struct usb_hub *hub = hdev_to_hub(hdev); 1916 - 1917 - /* This also makes any led blinker stop retriggering. We're called 1918 - * from irq, so the blinker might still be scheduled. Caller promises 1919 - * that the root hub status URB will be canceled. 1920 - */ 1921 - __hub_quiesce(hub); 1922 - mark_quiesced(to_usb_interface(hub->intfdev)); 1923 - } 1924 1916 1925 1917 void usb_resume_root_hub(struct usb_device *hdev) 1926 1918 {
-1
drivers/usb/core/usb.h
··· 20 20 extern int usb_set_configuration(struct usb_device *dev, int configuration); 21 21 22 22 extern void usb_kick_khubd(struct usb_device *dev); 23 - extern void usb_suspend_root_hub(struct usb_device *hdev); 24 23 extern void usb_resume_root_hub(struct usb_device *dev); 25 24 26 25 extern int usb_hub_init(void);
-3
drivers/usb/host/ohci-hub.c
··· 135 135 hcd->poll_rh = 0; 136 136 137 137 done: 138 - /* external suspend vs self autosuspend ... same effect */ 139 - if (status == 0) 140 - usb_hcd_suspend_root_hub(hcd); 141 138 spin_unlock_irqrestore (&ohci->lock, flags); 142 139 return status; 143 140 }