[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1784e8d6-c754-4e7f-ad48-611b9c392eb8@tuxon.dev>
Date: Mon, 17 Feb 2025 11:10:52 +0200
From: Claudiu Beznea <claudiu.beznea@...on.dev>
To: Alexander Dahl <ada@...rsis.com>
Cc: Nicolas Ferre <nicolas.ferre@...rochip.com>,
Ryan Wanner <ryan.wanner@...rochip.com>,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v2 09/16] nvmem: microchip-otpc: Avoid reading a
write-only register
On 10.02.2025 18:50, Alexander Dahl wrote:
> The OTPC Control Register (OTPC_CR) has just write-only members.
> Reading from that register leads to a warning in OTPC Write Protection
> Status Register (OTPC_WPSR) in field Software Error Type (SWETYP) of
> type READ_WO (A write-only register has been read (warning).)
>
> Just create the register write content from scratch is sufficient here.
>
> Signed-off-by: Alexander Dahl <ada@...rsis.com>
> Fixes: 98830350d3fc ("nvmem: microchip-otpc: add support")
Fixes tag goes above your SoB.
> ---
>
> Notes:
> v2:
> - Add Fixes tag
> - Remove temporary variable usage
> - Reword misleading subject (s/writing/reading/)
>
> drivers/nvmem/microchip-otpc.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/nvmem/microchip-otpc.c b/drivers/nvmem/microchip-otpc.c
> index df979e8549fdb..e2851c63cc0b4 100644
> --- a/drivers/nvmem/microchip-otpc.c
> +++ b/drivers/nvmem/microchip-otpc.c
> @@ -82,9 +82,7 @@ static int mchp_otpc_prepare_read(struct mchp_otpc *otpc,
> writel_relaxed(tmp, otpc->base + MCHP_OTPC_MR);
>
> /* Set read. */
> - tmp = readl_relaxed(otpc->base + MCHP_OTPC_CR);
> - tmp |= MCHP_OTPC_CR_READ;
> - writel_relaxed(tmp, otpc->base + MCHP_OTPC_CR);
> + writel_relaxed(MCHP_OTPC_CR_READ, otpc->base + MCHP_OTPC_CR);
>
> /* Wait for packet to be transferred into temporary buffers. */
> return read_poll_timeout(readl_relaxed, tmp, !(tmp & MCHP_OTPC_SR_READ),
Powered by blists - more mailing lists