Kernel Newbies archive on
 help / color / Atom feed
* suspend mode
@ 2019-10-05 10:54 nunojsa
  0 siblings, 0 replies; only message in thread
From: nunojsa @ 2019-10-05 10:54 UTC (permalink / raw)
  To: kernelnewbies

Hi all,

I have a HWMON driver which is using simple pm options. So, I have a suspend() and resume() where I try
to lock a mutex before suspending/resuming. This mutex is shared with the read/write path of the
hwmon attributes. I also have a flag which is set when suspend() is done so that, if someone tries to
read some attribute, will get an error since doing a read/write on the device bus will wake it up. Im
starting to think that this does not make any sense. Is there any way that a userland process runs during
suspend? As I understand, all tasks should be frozen before starting to suspend the HW devices. Is this right?
Furthermore, now that I think about this, trying to lock the mutex on the PM callbacks seems dangerous
since it can lead to deadlock (if some frozen task is helding the lock?). However, I definitely saw drivers
trying to lock shared mutexes in the PM callbacks. Aren't these callbacks atomic? Is there any scenario where
it makes to sense to care about concurrency in these functions?

Thanks for the help!
- Nuno Sá

Kernelnewbies mailing list

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-05 10:54 suspend mode nunojsa

Kernel Newbies archive on

Archives are clonable:
	git clone --mirror kernelnewbies/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kernelnewbies kernelnewbies/ \
	public-inbox-index kernelnewbies

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox