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: <2385656.yKrmzQ4Hd0@diego>
Date: Fri, 23 Feb 2024 14:43:41 +0100
From: Heiko Stübner <heiko@...ech.de>
To: Jonathan Cameron <jic23@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
 Andy Shevchenko <andy.shevchenko@...il.com>,
 Shreeya Patel <shreeya.patel@...labora.com>, Simon Xue <xxm@...k-chips.com>,
 Philipp Zabel <p.zabel@...gutronix.de>,
 Quentin Schulz <foss+kernel@...il.net>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>, linux-iio@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-rockchip@...ts.infradead.org,
 linux-kernel@...r.kernel.org,
 Quentin Schulz <quentin.schulz@...obroma-systems.com>,
 Quentin Schulz <foss+kernel@...il.net>
Subject:
 Re: [PATCH 2/3] iio: adc: rockchip_saradc: use mask for write_enable bitfield

Am Freitag, 23. Februar 2024, 13:45:22 CET schrieb Quentin Schulz:
> From: Quentin Schulz <quentin.schulz@...obroma-systems.com>
> 
> Some of the registers on the SARADCv2 have bits write protected except
> if another bit is set. This is usually done by having the lowest 16 bits
> store the data to write and the highest 16 bits specify which of the 16
> lowest bits should have their value written to the hardware block.
> 
> The write_enable mask for the channel selection was incorrect because it
> was just the value shifted by 16 bits, which means it would only ever
> write bits and never clear them. So e.g. if someone starts a conversion
> on channel 5, the lowest 4 bits would be 0x5, then starts a conversion
> on channel 0, it would still be 5.
> 
> Instead of shifting the value by 16 as the mask, let's use the OR'ing of
> the appropriate masks shifted by 16.
> 
> Note that this is not an issue currently because the only SARADCv2
> currently supported has a reset defined in its Device Tree, that reset
> resets the SARADC controller before starting a conversion on a channel.
> However, this reset is handled as optional by the probe function and
> thus proper masking should be used in the event an SARADCv2 without a
> reset ever makes it upstream.
> 
> Fixes: 757953f8ec69 ("iio: adc: rockchip_saradc: Add support for RK3588")
> Cc: Quentin Schulz <foss+kernel@...il.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@...obroma-systems.com>

Reviewed-by: Heiko Stuebner <heiko@...ech.de>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ