lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<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

Powered by Openwall GNU/*/Linux Powered by OpenVZ