[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aF5xrHkTr8Tb71ZH@smile.fi.intel.com>
Date: Fri, 27 Jun 2025 13:25:48 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Uwe Kleine-König <ukleinek@...nel.org>,
linux-kernel@...r.kernel.org, linux-pwm@...r.kernel.org,
Benjamin Larsson <benjamin.larsson@...exis.eu>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Lorenzo Bianconi <lorenzo@...nel.org>
Subject: Re: [PATCH v18] pwm: airoha: Add support for EN7581 SoC
On Fri, Jun 27, 2025 at 11:32:46AM +0200, Christian Marangi wrote:
> On Fri, Jun 27, 2025 at 11:58:04AM +0300, Andy Shevchenko wrote:
> > On Fri, Jun 27, 2025 at 12:47:53AM +0200, Christian Marangi wrote:
...
> > > + /* Global mutex to protect bucket used refcount_t */
> > > + struct mutex mutex;
> >
> > This makes a little sense. Either you use refcount_t (which is atomic) or
> > use mutex + regular variable.
>
> Using a regular variable I lose all the benefits of refcount_t with
> underflow and other checks.
Then drop the mutex, atomic operations do not need an additional
synchronisation. Btw, have you looked at kref APIs? Maybe that
would make the intention clearer?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists