linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* kernel drivers and ioctls and mutexes?
@ 2001-11-29  2:42 Kevin B. Hendricks
  2001-11-29 10:58 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin B. Hendricks @ 2001-11-29  2:42 UTC (permalink / raw)
  To: linuxppc-dev


Hi,

Can anyone tell me if your need mutexes to prevent problems when ioctls
initiated from userland that change dev structure values are used in
kernel drivers?

For example in NIC modules a broken link can cause nway_start on some
cards but a userland ioctl can (asynchronously) cause the same things to
happen?  Should I be using mutexes inside the driver to prevent this or is
there some synchronization mechanism I am missing here?  Given how nway
negotiations are started and given them may take a few seconds to
complete, something should shield the nway start routine from being
re-entered.

Thanks,

Kevin

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: kernel drivers and ioctls and mutexes?
  2001-11-29  2:42 kernel drivers and ioctls and mutexes? Kevin B. Hendricks
@ 2001-11-29 10:58 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2001-11-29 10:58 UTC (permalink / raw)
  To: Kevin B. Hendricks, linuxppc-dev


>Can anyone tell me if your need mutexes to prevent problems when ioctls
>initiated from userland that change dev structure values are used in
>kernel drivers?
>
>For example in NIC modules a broken link can cause nway_start on some
>cards but a userland ioctl can (asynchronously) cause the same things to
>happen?  Should I be using mutexes inside the driver to prevent this or is
>there some synchronization mechanism I am missing here?  Given how nway
>negotiations are started and given them may take a few seconds to
>complete, something should shield the nway start routine from being
>re-entered.

It depends on your driver, mutexes may or may not be the right solution.

I've implemented ethtool ioctl support in sungem and have done my own
synchronisation mecanism, basically the ioctl to restart autoneg will
interrupt any pending autoneg and restart one, there should be no
re-entrancy, except if I missed a case ;)

Ben.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2001-11-29 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-29  2:42 kernel drivers and ioctls and mutexes? Kevin B. Hendricks
2001-11-29 10:58 ` Benjamin Herrenschmidt

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).