public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Sysfs and suicidal attributes
@ 2007-07-08 14:31 Alan Stern
  2007-07-09 15:26 ` Cornelia Huck
  2007-07-10  5:09 ` Tejun Heo
  0 siblings, 2 replies; 18+ messages in thread
From: Alan Stern @ 2007-07-08 14:31 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Cornelia Huck, Kernel development list

Tejun:

You remember the problem we faced with "suicidal" sysfs attributes and 
the device_schedule_callback() routine that fixes it?

Well, it turns out that this approach may confict with suspend/resume
processing.  In brief, it's not a good idea to unregister devices while
a suspend is in progress, but on the other hand it's not a good idea to
block keventd waiting until the suspend is over.

There are some ways around this such as using a different workqueue, 
one that could safely be blocked during the suspend.  But I had another 
thought.

I haven't paid much attention to your sysfs updates.  Is it still true
that calls to show/store methods are mutually exclusive with attribute
unregistration?  Assuming the answer is Yes, would it be possible to
bypass that mutual exclusion in certain explicit cases?  Here's what I
have in mind:

	The user writes to an attribute file.

	The sysfs core calls the attribute's store method.

	The method tells the sysfs core to pretend that the call
	temporarily doesn't exist, or has completed, or something
	like that.

	The method safely unregisters the attribute file, with no
	mutual exclusion problems and no deadlock.  Of course, the
	unregistration will still block until all _other_ method
	calls for this attribute are complete.

	The method tells the sysfs core to stop pretending and
	go back to its normal state.

	The method returns, and the sysfs core takes whatever actions
	are needed to fully release the attribute file.

The idea is that there could be a way to allow unregistration while a 
method is still running, if the method specifically requests it.  If we 
could do this then device_schedule_callback() would be unnecessary.

What do you think?

Alan Stern


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-07-11 15:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-08 14:31 Sysfs and suicidal attributes Alan Stern
2007-07-09 15:26 ` Cornelia Huck
2007-07-09 22:28   ` Alan Stern
2007-07-10  5:09 ` Tejun Heo
2007-07-10  8:28   ` Cornelia Huck
2007-07-10  8:49     ` Tejun Heo
2007-07-10  9:04       ` Cornelia Huck
2007-07-10  9:13         ` Tejun Heo
2007-07-10 10:50           ` Cornelia Huck
2007-07-10 14:42           ` Alan Stern
2007-07-10 14:41   ` Alan Stern
2007-07-10 15:11     ` Tejun Heo
2007-07-10 17:18       ` Alan Stern
2007-07-10 18:08         ` Tejun Heo
2007-07-10 19:31           ` Alan Stern
2007-07-11  5:04             ` Tejun Heo
2007-07-11 12:36               ` Cornelia Huck
2007-07-11 15:04               ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox