Re: [PATCH v4 09/19] mtd: rawnand: Use the data interface mode entry when relevant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 25 May 2020 19:42:29 +0200
Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote:

> The data interface setup does not care about the default timing mode
> but cares about the actual timing mode at the time of the call of this
> helper.
> 
> Use this entry instead and let chip->default_timing_mode only be used
> at initialization time.

Yep, that's the right thing to do

Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>

> 
> Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
> ---
>  drivers/mtd/nand/raw/nand_base.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> index adbc12580e2e..514ac78899ec 100644
> --- a/drivers/mtd/nand/raw/nand_base.c
> +++ b/drivers/mtd/nand/raw/nand_base.c
> @@ -951,9 +951,8 @@ static int nand_reset_data_interface(struct nand_chip *chip, int chipnr)
>   */
>  static int nand_setup_data_interface(struct nand_chip *chip, int chipnr)
>  {
> -	u8 tmode_param[ONFI_SUBFEATURE_PARAM_LEN] = {
> -		chip->default_timing_mode,
> -	};
> +	u8 mode = chip->data_interface.timings.mode;
> +	u8 tmode_param[ONFI_SUBFEATURE_PARAM_LEN] = { mode, };
>  	int ret;
>  
>  	if (!nand_has_setup_data_iface(chip))
> @@ -987,9 +986,9 @@ static int nand_setup_data_interface(struct nand_chip *chip, int chipnr)
>  	if (ret)
>  		goto err_reset_chip;
>  
> -	if (tmode_param[0] != chip->default_timing_mode) {
> +	if (tmode_param[0] != mode) {
>  		pr_warn("timing mode %d not acknowledged by the NAND chip\n",
> -			chip->default_timing_mode);
> +			mode);
>  		goto err_reset_chip;
>  	}
>  


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux