Re: [PATCH v2 03/11] iio: dac: ad5686: acquire lock when doing powerdown control
From: Andy Shevchenko
Date: Mon Apr 27 2026 - 13:56:38 EST
On Mon, Apr 27, 2026 at 12:30:10PM +0100, Rodrigo Alencar via B4 Relay wrote:
> Protect write access of pwr_down_mode and pwr_down_mask fields with
> existing mutex lock. Each channel exposes their own attributes for
> controlling powerdown modes and powerdown state. This fixes potential race
> conditions as those functions perform non-atomic read-modify-write
> operations to those pwr_down_* fields. This issue exists since the ad5686
> driver was first introduced.
General rule, besides trying to occupy as much room as we have to still use
consistent (more or less equal) line lengths. I would rewrap
Protect write access of pwr_down_mode and pwr_down_mask fields with
existing mutex lock. Each channel exposes their own attributes for
controlling powerdown modes and powerdown state. This fixes potential
race conditions as those functions perform non-atomic read-modify-write
operations to those pwr_down_* fields. This issue exists since the
ad5686 driver was first introduced.
--
With Best Regards,
Andy Shevchenko