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] [day] [month] [year] [list]
Message-ID: <20260125164335.GG13967@unreal>
Date: Sun, 25 Jan 2026 18:43:35 +0200
From: Leon Romanovsky <leon@...nel.org>
To: Pavan Chebbi <pavan.chebbi@...adcom.com>
Cc: jgg@...pe.ca, michael.chan@...adcom.com, linux-kernel@...r.kernel.org,
	dave.jiang@...el.com, saeedm@...dia.com,
	Jonathan.Cameron@...wei.com, gospo@...adcom.com,
	selvin.xavier@...adcom.com, kalesh-anakkur.purayil@...adcom.com
Subject: Re: [PATCH fwctl 2/5] fwctl/bnxt_en: Refactor aux bus functions to
 be more generic

On Sun, Jan 25, 2026 at 07:20:28PM +0530, Pavan Chebbi wrote:
> > > +     int                     auxdev_id;
> > > +     atomic_t                auxdev_state[__BNXT_AUXDEV_MAX];
> > > +#define      BNXT_ADEV_STATE_NONE    0
> > > +#define      BNXT_ADEV_STATE_INIT    1
> > > +#define      BNXT_ADEV_STATE_ADD     2
> >
> > This is indeed an incorrect use of atomic_t. This type only ensures that
> > individual arithmetic operations are performed atomically. It does not
> > eliminate the need for the locks that were removed.
> 
> Thanks for your review. Since the individual bp's auxdev state is
> going to be set only during probe(), and is read-only elsewhere,
> atomic operations are enough, no?

No. You can change the state of a specific auxdev by unbinding its driver.  
You must hold the appropriate lock whenever you read or depend on  
auxdev_state, and an atomic_t is not required for this case.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ