All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
To: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] spi: Push the BKL down into the drivers
Date: Fri, 23 May 2008 12:09:48 +0100	[thread overview]
Message-ID: <20080523120948.4b992d67@core> (raw)
In-Reply-To: <200805221740.51016.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>

On Thu, 22 May 2008 17:40:50 -0700
David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:

> On Thursday 22 May 2008, Alan Cox wrote:
> > Another step to removing ->ioctl and to removing the BKL
> 
> This happens to not apply with the latest patches; I'll
> address that.
> 
> Where is the writeup about exactly what lock_kernel() is
> supposed to have been protecting against in ioctl code?

There isn't one. The big problem we have is that the ioctl methods were
implicitly called under the big kernel lock. Without pushing them down
into drivers we can't take the step of actually thinking at the driver
level "is this needed". Historically therefore we've never documented
*why* or *if* it was needed - it's just there. Pushing them into the
driver means the subsystem owner gets to see the implicit locking and can
actually ask the right questions with internal driver knowledge.

Whether it is needed is dependant on the internal locking model of the
driver - does it handle parallel ioctls correctly, are there races
against other functions in the driver (eg hot unplugs). That can't be
evaluated at a high level.

It's also made harder by the fact lots of drivers have buggy assumptions
about ioctl locking (watchdog was a fine example).

Alan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

WARNING: multiple messages have this Message-ID (diff)
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: David Brownell <david-b@pacbell.net>
Cc: linux-kernel@vger.kernel.org, spi-devel-general@lists.sourceforge.net
Subject: Re: [PATCH] spi: Push the BKL down into the drivers
Date: Fri, 23 May 2008 12:09:48 +0100	[thread overview]
Message-ID: <20080523120948.4b992d67@core> (raw)
In-Reply-To: <200805221740.51016.david-b@pacbell.net>

On Thu, 22 May 2008 17:40:50 -0700
David Brownell <david-b@pacbell.net> wrote:

> On Thursday 22 May 2008, Alan Cox wrote:
> > Another step to removing ->ioctl and to removing the BKL
> 
> This happens to not apply with the latest patches; I'll
> address that.
> 
> Where is the writeup about exactly what lock_kernel() is
> supposed to have been protecting against in ioctl code?

There isn't one. The big problem we have is that the ioctl methods were
implicitly called under the big kernel lock. Without pushing them down
into drivers we can't take the step of actually thinking at the driver
level "is this needed". Historically therefore we've never documented
*why* or *if* it was needed - it's just there. Pushing them into the
driver means the subsystem owner gets to see the implicit locking and can
actually ask the right questions with internal driver knowledge.

Whether it is needed is dependant on the internal locking model of the
driver - does it handle parallel ioctls correctly, are there races
against other functions in the driver (eg hot unplugs). That can't be
evaluated at a high level.

It's also made harder by the fact lots of drivers have buggy assumptions
about ioctl locking (watchdog was a fine example).

Alan

  parent reply	other threads:[~2008-05-23 11:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-22 21:45 [PATCH] spi: Push the BKL down into the drivers Alan Cox
2008-05-22 21:45 ` Alan Cox
2008-05-23  0:40 ` David Brownell
2008-05-23  0:40   ` David Brownell
     [not found]   ` <200805221740.51016.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-05-23 11:09     ` Alan Cox [this message]
2008-05-23 11:09       ` Alan Cox

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=20080523120948.4b992d67@core \
    --to=alan-qbu/x9rampvanceybjwyrvxrex20p6io@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.