From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: linux-pwm@vger.kernel.org,
Thierry Reding <thierry.reding@gmail.com>,
linux-kernel@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH 2/4] pwm: Reduce time the pwm_lock mutex is held in pwmchip_add()
Date: Thu, 17 Nov 2022 17:33:35 +0200 [thread overview]
Message-ID: <Y3ZUT3SNmfInzEv9@smile.fi.intel.com> (raw)
In-Reply-To: <20221117140024.o77f5prewt5clgyh@pengutronix.de>
On Thu, Nov 17, 2022 at 03:00:24PM +0100, Uwe Kleine-König wrote:
> On Wed, Nov 16, 2022 at 10:11:32AM +0200, Andy Shevchenko wrote:
> > On Tue, Nov 15, 2022 at 10:15:13PM +0100, Uwe Kleine-König wrote:
> > > This simplifies error handling as the need for goto error handling goes
> > > away and at the end of the function the code can be simplified as this
> > > code isn't used in the error case any more.
...
> > > + mutex_unlock(&pwm_lock);
> > >
> > > if (IS_ENABLED(CONFIG_OF))
> > > of_pwmchip_add(chip);
> >
> > Why calling this without a lock is not a problem? Commit message doesn't share
> > a bit about this change.
>
> Maybe add another paragraph at the end reading:
>
> Now memory allocation and the call to of_pwmchip_add() are done without
> holding the lock. Both don't access the data structures protected by
> &pwm_lock.
Good to me, with that added
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-11-17 15:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 21:15 [PATCH 0/4] pwm: Some refactoring of pwmchip_add() Uwe Kleine-König
2022-11-15 21:15 ` [PATCH 1/4] pwm: Document variables protected by pwm_lock Uwe Kleine-König
2022-11-16 8:22 ` Andy Shevchenko
2022-11-15 21:15 ` [PATCH 2/4] pwm: Reduce time the pwm_lock mutex is held in pwmchip_add() Uwe Kleine-König
2022-11-16 8:11 ` Andy Shevchenko
2022-11-17 14:00 ` Uwe Kleine-König
2022-11-17 15:33 ` Andy Shevchenko [this message]
2022-11-15 21:15 ` [PATCH 3/4] pwm: Mark free pwm IDs as used in alloc_pwms() Uwe Kleine-König
2022-11-16 8:17 ` Andy Shevchenko
2022-11-16 13:59 ` Uwe Kleine-König
2022-11-16 14:04 ` Andy Shevchenko
2022-11-15 21:15 ` [PATCH 4/4] pwm: Don't initialize list head before calling list_add() Uwe Kleine-König
2022-11-16 8:21 ` Andy Shevchenko
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=Y3ZUT3SNmfInzEv9@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/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