lkml.org 
[lkml]   [2023]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mtd: spi-nor: Ensure operation completion before shutdown
Hi,

Am 2023-10-12 07:51, schrieb Md Sadre Alam:
> Ensure that there are no pending spi operation inprogress
> when system halts.

What operation might be in progress here? Did you encounter some
problems?
Please explain it in more detail in the commit message.

Fixes tag?

-michael

> Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.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 1c443fe568cf..adc4d2c68695 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -3690,6 +3690,9 @@ static void spi_nor_shutdown(struct spi_mem
> *spimem)
> {
> struct spi_nor *nor = spi_mem_get_drvdata(spimem);
>
> + /* Ensure no pending spi operation in progress */
> + spi_nor_wait_till_ready(nor);
> +
> spi_nor_restore(nor);
> }

\
 
 \ /
  Last update: 2023-10-12 11:12    [W:0.123 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site