usb_suspend_both(9)
β¨ NAME β¨
Bestie, meet usb_suspend_both(9) β the Kernel API Manual baddie whose whole thing is suspending a USB device and its interfaces. π
β¨
πΈ SYNOPSIS πΈ
int usb_suspend_both (struct usb_device *udev , pm_message_t msg );
π ARGUMENTS π
udevβ theusb_deviceto suspend, aka the main character here πmsgβ the Power Management message describing this state transition π¦
π¦ DESCRIPTION π¦
Okay so this is the central routine for suspending USB devices. It calls the suspend methods for all the interface drivers in udev, and then it calls the suspend method for udev itself. Iconic behavior, no cap. π
When the routine is called in autosuspend, if an error occurs at any stage, all the interfaces which were suspended are resumed so that they remain in the same state as the device. But when itβs called from system sleep, all error from suspend methods of interfaces and the non-root-hub device itself are simply ignored, so all suspended interfaces are only resumed to the deviceβs state when udev is root-hub and its suspend method returns failure. Yes, that is a lot β read it twice, bestie. ππ
Autosuspend requests originating from a child device or an interface driver may be made without the protection of udevβs device lock, but all other suspend calls will hold the lock. Usbcore will insure that method calls do not arrive during bind, unbind, or reset operations. However drivers must be prepared to handle suspend calls arriving at unpredictable times. π«Ά
Process context only, bestie β this routine can run only in process context. π§π
π RETURN π
0 if the suspend succeeded. Periodt. β
π SEE ALSO π
Kernel file ./drivers/usb/core/driver.c β the whole squad π―:
usb_driver_claim_interface(9)usb_driver_release_interface(9)usb_match_id(9)usb_register_device_driver(9)usb_deregister_device_driver(9)usb_register_driver(9)usb_deregister(9)usb_resume_both(9)usb_enable_autosuspend(9)usb_disable_autosuspend(9)usb_autosuspend_device(9)usb_autoresume_device(9)usb_autopm_put_interface(9)usb_autopm_put_interface_async(9)usb_autopm_put_interface_no_suspend(9)usb_autopm_get_interface(9)usb_autopm_get_interface_async(9)usb_autopm_get_interface_no_resume(9)
Byeeee π β source/version vibes from ./drivers/usb/core, dated October 2026, and yes the manual is still usb_suspend_both(9). ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms