mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
Cc: Bartosz Golaszewski <brgl@kernel.org>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Herve Codina <herve.codina@bootlin.com>,
	Jia Jia <physicalmtea@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v7 7/8] gpiolib: let the character device free its IRQs first on chip removal
Date: Sat, 21 Nov 2026 13:26:35 +0800	[thread overview]
Message-ID: <20261121052635.GA32792@rigel> (raw)
In-Reply-To: <20261121051900.4118973-2-aambrozewicz@nvidia.com>

On Sat, Nov 21, 2026 at 07:19:01AM +0200, Adrian Ambrozewicz wrote:
> On Sat, Nov 21, 2026 at 12:46:57PM +0800, Kent Gibson wrote:
> > > @@ -1690,7 +1697,6 @@ static int linereq_create(struct gpio_device *gdev, void __user *ip)
> > >  			return -ENOMEM;
> > >  	}
> > >  
> > > -	mutex_init(&lr->config_mutex);
> >
> > What is the rationale for relocating the mutex_init()?
> > Looks like a gratuitous change, and if this patch is going to be
> > backported then it should be kept minimal.
> 
> It is needed: linereq_free() now takes config_mutex, and __free() also
> calls it when linereq_create() fails after allocating lr. The first such
> failure, kstrndup(), returned before the old mutex_init(), so it would
> have locked an uninitialised mutex. I plan to say so in the commit
> message in v8.
> 

Ahh, I overlooked the __free().  That makes sense then.

Cheers,
Kent.

> > The lines removed/guarded were added in patch 3, so note that this patch is
> > dependent on patch 3 in the description[1].
> [...]
> > The line removed/guarded was added in patch 5, so note that this patch is
> > dependent on patch 5 in the description[1].
> 
> Agreed, I plan to note both dependencies in the v8 description.
> 
> Thanks for the review.
> 
> Adrian

  reply	other threads:[~2026-11-21  5:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  8:13 [PATCH v7 0/8] gpiolib: fix chip removal with lines still requested from user space Adrian Ambrozewicz
2026-11-20  8:13 ` [PATCH v7 1/8] gpiolib: wait for pending label frees before cleaning up desc_srcu Adrian Ambrozewicz
2026-11-20  8:13 ` [PATCH v7 2/8] gpiolib: free the label of lines released after their chip was removed Adrian Ambrozewicz
2026-11-20  8:13 ` [PATCH v7 3/8] gpiolib: cdev: do not free line IRQs again after the chip is removed Adrian Ambrozewicz
2026-11-20  8:13 ` [PATCH v7 4/8] gpiolib: cdev: don't sleep in the SRCU read section in read() Adrian Ambrozewicz
2026-11-20  8:13 ` [PATCH v7 5/8] gpiolib: cdev: don't leak the IRQ name when the chip is removed Adrian Ambrozewicz
2026-11-21  4:52   ` Kent Gibson
2026-11-20  8:13 ` [PATCH v7 6/8] gpiolib: cdev: don't report a failed line read as an edge Adrian Ambrozewicz
2026-11-20  8:13 ` [PATCH v7 7/8] gpiolib: let the character device free its IRQs first on chip removal Adrian Ambrozewicz
2026-11-21  4:46   ` Kent Gibson
2026-11-21  5:19     ` Adrian Ambrozewicz
2026-11-21  5:26       ` Kent Gibson [this message]
2026-11-20  8:14 ` [PATCH v7 8/8] gpiolib: remove the shared GPIO proxies before freeing the remaining IRQs Adrian Ambrozewicz
2026-11-21  5:08   ` Kent Gibson

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=20261121052635.GA32792@rigel \
    --to=warthog618@gmail.com \
    --cc=aambrozewicz@nvidia.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=herve.codina@bootlin.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=physicalmtea@gmail.com \
    --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

all inboxes | Powered by JetHome®