[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5d2a6498-57c5-4fb4-9a68-e35072f4b8e3@tuxon.dev>
Date: Sat, 24 Aug 2024 18:51:46 +0300
From: claudiu beznea <claudiu.beznea@...on.dev>
To: Alexander Dahl <ada@...rsis.com>
Cc: Christian Melki <christian.melki@...ata.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
"moderated list:MICROCHIP OTPC DRIVER"
<linux-arm-kernel@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 08/12] nvmem: microchip-otpc: Add warnings for bad OTPC
conditions on probe
On 21.08.2024 13:59, Alexander Dahl wrote:
> These conditions could affect correct function of the driver.
Can you please detail why this has been added, what was the issue you
identified etc?
>
> Signed-off-by: Alexander Dahl <ada@...rsis.com>
> ---
> drivers/nvmem/microchip-otpc.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/nvmem/microchip-otpc.c b/drivers/nvmem/microchip-otpc.c
> index 4630e96243ac..a80535c3d162 100644
> --- a/drivers/nvmem/microchip-otpc.c
> +++ b/drivers/nvmem/microchip-otpc.c
> @@ -8,6 +8,7 @@
> */
>
> #include <linux/bitfield.h>
> +#include <linux/dev_printk.h>
> #include <linux/iopoll.h>
> #include <linux/module.h>
> #include <linux/nvmem-provider.h>
> @@ -260,6 +261,7 @@ static int mchp_otpc_probe(struct platform_device *pdev)
> struct nvmem_device *nvmem;
> struct mchp_otpc *otpc;
> u32 size;
> + u32 reg;
> int ret;
>
> otpc = devm_kzalloc(&pdev->dev, sizeof(*otpc), GFP_KERNEL);
> @@ -270,6 +272,16 @@ static int mchp_otpc_probe(struct platform_device *pdev)
> if (IS_ERR(otpc->base))
> return PTR_ERR(otpc->base);
>
> + reg = readl_relaxed(otpc->base + MCHP_OTPC_WPSR);
> + if (reg)
> + dev_warn(&pdev->dev,
> + "Write Protection Status Register Bit set: 0x%08x\n", reg);
There are many status bits in WPSR. Some of these bits suggests warnings
even when their values are zero (e.g., ECLASS, SWETYP). I don't know how
accurate is this message.
> +
> + reg = readl_relaxed(otpc->base + MCHP_OTPC_ISR);
> + if (reg & MCHP_OTPC_ISR_COERR)
> + dev_warn(&pdev->dev,
> + "A corruption occurred since the last read of OTPC_ISR.\n");
> +
> otpc->dev = &pdev->dev;
> ret = mchp_otpc_init_packets_list(otpc, &size);
> if (ret)
Powered by blists - more mailing lists