linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* to schedule() or not to schedule() ?
@ 2008-08-03 18:33 Kevin Diggs
  2008-08-05 18:37 ` Chris Friesen
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Diggs @ 2008-08-03 18:33 UTC (permalink / raw)
  To: linuxppc-dev

Hi,


	I have the following near the top of my cpufreq driver target routine:

while(test_and_set_bit(cf750gxmCfgChangeBit,&cf750gxvStateBits)) {
         /*
          * Someone mucking with our cfg? (I hope it is ok to call
          * schedule() here! - truth is I have no idea what I am doing
          * ... my reasoning is I want to yeild the cpu so whoever is
          * mucking around can finish)
          */
         schedule();
}

This is to prevent bad things from happening if someone is trying to 
change a parameter for the driver via sysfs while the target routine is 
running. Fortunately, because I had a bug where this bit was not getting 
cleared on one of the paths through the target routine ... I now know it 
is not safe to call schedule (it got stuck in there - knocked out my adb 
keyboard! - (I think target is called from a timer that the governor 
sets up ... interrupt context?)).

	How does one very briefly yield the cpu in this context?

kevin

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

end of thread, other threads:[~2008-08-06 21:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-03 18:33 to schedule() or not to schedule() ? Kevin Diggs
2008-08-05 18:37 ` Chris Friesen
2008-08-05 19:26   ` Kevin Diggs
2008-08-05 23:00     ` Michael Ellerman
2008-08-06  1:59       ` Kevin Diggs
2008-08-06 21:12         ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).