linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Kevin B. Hendricks" <khendricks@ivey.uwo.ca>,
	<linuxppc-dev@lists.linuxppc.org>
Subject: Re: kernel drivers and ioctls and mutexes?
Date: Thu, 29 Nov 2001 11:58:07 +0100	[thread overview]
Message-ID: <20011129105807.1293@mailhost.mipsys.com> (raw)
In-Reply-To: <20011129024133.EGCO16262.tomts14-srv.bellnexxia.net@there>


>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/

      reply	other threads:[~2001-11-29 10:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-29  2:42 kernel drivers and ioctls and mutexes? Kevin B. Hendricks
2001-11-29 10:58 ` Benjamin Herrenschmidt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011129105807.1293@mailhost.mipsys.com \
    --to=benh@kernel.crashing.org \
    --cc=khendricks@ivey.uwo.ca \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).