public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Cc: stable@vger.kernel.org, stable-commits@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Subject: Re: Patch "gpio: protect the list of GPIO devices with SRCU" has been added to the 6.8-stable tree
Date: Thu, 4 Apr 2024 08:45:41 +0200	[thread overview]
Message-ID: <2024040422-barista-expel-7757@gregkh> (raw)
In-Reply-To: <CACMJSesiDWonw83FfnneRLXu=ED27HHeqdsjUS0Xooba2fRZZA@mail.gmail.com>

On Wed, Apr 03, 2024 at 11:05:42PM +0200, Bartosz Golaszewski wrote:
> On Wed, 3 Apr 2024 at 18:02, Sasha Levin <sashal@kernel.org> wrote:
> >
> > This is a note to let you know that I've just added the patch titled
> >
> >     gpio: protect the list of GPIO devices with SRCU
> >
> > to the 6.8-stable tree which can be found at:
> >     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> >
> > The filename of the patch is:
> >      gpio-protect-the-list-of-gpio-devices-with-srcu.patch
> > and it can be found in the queue-6.8 subdirectory.
> >
> > If you, or anyone else, feels it should not be added to the stable tree,
> > please let <stable@vger.kernel.org> know about it.
> >
> >
> >
> > commit 077106f97c7d113ebacb00725d83b817d0e89288
> > Author: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > Date:   Fri Jan 19 16:43:13 2024 +0100
> >
> >     gpio: protect the list of GPIO devices with SRCU
> >
> >     [ Upstream commit e348544f7994d252427ed3ae637c7081cbb90f66 ]
> >
> >     We're working towards removing the "multi-function" GPIO spinlock that's
> >     implemented terribly wrong. We tried using an RW-semaphore to protect
> >     the list of GPIO devices but it turned out that we still have old code
> >     using legacy GPIO calls that need to translate the global GPIO number to
> >     the address of the associated descriptor and - to that end - traverse
> >     the list while holding the lock. If we change the spinlock to a sleeping
> >     lock then we'll end up with "scheduling while atomic" bugs.
> >
> >     Let's allow lockless traversal of the list using SRCU and only use the
> >     mutex when modyfing the list.
> >
> >     While at it: let's protect the period between when we start the lookup
> >     and when we finally request the descriptor (increasing the reference
> >     count of the GPIO device) with the SRCU read lock.
> >
> >     Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >     Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> >     Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >     Stable-dep-of: 5c887b65bbd1 ("gpiolib: Fix debug messaging in gpiod_find_and_request()")
> >     Signed-off-by: Sasha Levin <sashal@kernel.org>
> >
> 
> I'm not sure what the reason for picking this up into stable was but I
> believe it's not a good idea. This is just the first patch in a big
> series[1] of 24 commits total on top of which we had several bug fixes
> during the stabilization phase in next. Without the rest of the
> rework, it doesn't really improve the situation a lot.
> 
> I suggest dropping this and not trying to backport any of the GPIOLIB
> locking rework to stable branches.

I've dropped this and fixed up the commit this was a dependency for now,
thanks for the review!

greg k-h

      reply	other threads:[~2024-04-04  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240403160213.267317-1-sashal@kernel.org>
2024-04-03 21:05 ` Patch "gpio: protect the list of GPIO devices with SRCU" has been added to the 6.8-stable tree Bartosz Golaszewski
2024-04-04  6:45   ` Greg KH [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=2024040422-barista-expel-7757@gregkh \
    --to=greg@kroah.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.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