Re: runtime PM usage_count during driver_probe_device()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 30 Jun 2011, Kevin Hilman wrote:

> I'm still confused about the usage_count increment around ->probe
> though.

As a few people have already pointed out, some subsystems do perform 
runtime PM on driverless devices.

The basic idea is simple: We don't want any PM callbacks to race with
each other or with other driver-core callbacks.  Incrementing the
usage_count prevents runtime_suspend callbacks while the probe callback
is running.

This does leave open the possibility of runtime_resume occurring 
concurrently with probe.  For the most part this should be okay 
because without a driver, no part of the kernel will try to resume the 
device.

Hmmm, but a resume could occur as a result of userspace writing to a 
sysfs attribute.  It looks like we need to add some lock_device() calls 
to control_store() and autosuspend_delay_ms_store().

Alan Stern

_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux