[RFC PATCH 2/2] mtd: nand: always request data transfer for parameter page

Boris Brezillon boris.brezillon at free-electrons.com
Fri Jan 12 02:42:31 PST 2018


On Fri, 12 Jan 2018 00:50:37 +0100
Stefan Agner <stefan at agner.ch> wrote:

> To make sure the controller actually transfers data add a
> DATA_IN op even if len is 0.

Nope, this is wrong. You should patch the caller of
nand_read_param_page_op() to always pass a valid buffer and
len != 0 instead.

> 
> Signed-off-by: Stefan Agner <stefan at agner.ch>
> ---
>  drivers/mtd/nand/nand_base.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 96c97588e1ba..26bbf54e125b 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -1510,10 +1510,6 @@ static int nand_read_param_page_op(struct nand_chip *chip, u8 page, void *buf,
>  		};
>  		struct nand_operation op = NAND_OPERATION(instrs);
>  
> -		/* Drop the DATA_IN instruction if len is set to 0. */
> -		if (!len)
> -			op.ninstrs--;
> -
>  		return nand_exec_op(chip, &op);
>  	}
>  




More information about the linux-mtd mailing list