Skip to content

driver model wakeup flags

David Brownell linux-pm 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3driver model wakeup flagsdrivers/base/core.c drivers/base/power/sysfs.c include/linux/pm.h+99 -10 replies
2/3usb device wakeup flagsdrivers/usb/core/hub.c+9 -70 replies
3/3pci device wakeup flagsdrivers/pci/pci.c drivers/pci/probe.c+19 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/3] driver model wakeup flags

This is a refresh of the patch to add wakeup infrastructure to the driver model, in three parts. Comments? Merge?

pm-wake.patch ... adds the flags, and sysfs support pm-usb.patch ... usb devices use it pm-pci.patch ... pci devices use it

The default gives the current behavior: wakeup is enabled on all devices that support it. (Assuming ACPI etc don't get in the way...)

This goes back to having the sysfs "wakeup" file be tristate. Wakeup can be "enabled" or "disabled", and toggled from userspace. Or it can be unavailable, value "", if the hardware doesn't support wakeup or if no software has marked the device as supporting wakeup.

I attach a simple script I wrote to show what devices are capable of wakeup events. On one system, it reports wakeup allowed for several builtin devices and a USB keyboard/hub:

  lan        on  pci0000:00/0000:00:0a.0/0000:02:01.0
  modem      on  pci0000:00/0000:00:06.1
  hub        on  pci0000:00/0000:00:02.2/usb1
  usb_host   on  pci0000:00/0000:00:02.2
  input      on  pci0000:00/0000:00:02.1/usb3/3-1/3-1.1
  hub        on  pci0000:00/0000:00:02.1/usb3/3-1
  hub        on  pci0000:00/0000:00:02.1/usb3
  usb_host   on  pci0000:00/0000:00:02.1
  hub        on  pci0000:00/0000:00:02.0/usb2
  usb_host   on  pci0000:00/0000:00:02.0
  i2c        on  pci0000:00/0000:00:01.1

On this system /proc/acpi/wakeup says

  Device  Sleep state     Status
  USB0       3            disabled
  USB1       3            disabled
  USB2       3            disabled
  MAC0       3            disabled

I'm guessing those are the 00:02.* and 02:01.0 nodes. The hubs and input device (USB keyboard) use USB-internal wakeups and kick the usb_host nodes ... ACPI wouldn't know about them. (I understand that firewire could do the same sort of thing too.) The I2C device is actually SMBUS, waking up from D3hot or D3cold; I suspect that's handled by ACPI somehow.

- Dave