[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210208114125.5bmdvywjcruvhu7a@ti.com>
Date: Mon, 8 Feb 2021 17:11:25 +0530
From: Pratyush Yadav <p.yadav@...com>
To: Tudor Ambarus <tudor.ambarus@...rochip.com>
CC: <Takahiro.Kuwano@...ineon.com>, <miquel.raynal@...tlin.com>,
<richard@....at>, <vigneshr@...com>,
<linux-mtd@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] mtd: spi-nor: core: Add dbg msg for
spi_nor_erase_multi_sectors()
On 05/02/21 03:52PM, Tudor Ambarus wrote:
> Useful when debugging non-uniform erase.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@...rochip.com>
> ---
> drivers/mtd/spi-nor/core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index bcaa161bc7db..7401c60b53e6 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -1622,6 +1622,9 @@ static int spi_nor_erase_multi_sectors(struct spi_nor *nor, u64 addr, u32 len)
> if (ret)
> goto destroy_erase_cmd_list;
>
> + dev_dbg(nor->dev, "erase_cmd->size = 0x%08x, erase_cmd->opcode = 0x%02x, erase_cmd->count = %d\n",
> + cmd->size, cmd->opcode, cmd->count);
> +
I don't like the position of this debug message. This prints cmd->count
_after_ the erase is done but _before_ cmd->count is updated. It might
end up giving some wrong or misleading information. Can you either move
it before the start of the erase or after all the bookkeeping is done?
> addr += cmd->size;
> cmd->count--;
> }
> --
> 2.25.1
--
Regards,
Pratyush Yadav
Texas Instruments Inc.
Powered by blists - more mailing lists