[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zke2XTKqgKR4sEoY@lizhi-Precision-Tower-5810>
Date: Fri, 17 May 2024 15:56:13 -0400
From: Frank Li <Frank.li@....com>
To: Miquel Raynal <miquel.raynal@...tlin.com>
Cc: Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Han Xu <han.xu@....com>,
Vinod Koul <vkoul@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>, Marek Vasut <marex@...x.de>,
linux-mtd@...ts.infradead.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, dmaengine@...r.kernel.org,
imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 3/5] mtd: rawnand: gpmi: add iMX8QXP support.
On Fri, May 17, 2024 at 08:39:04PM +0200, Miquel Raynal wrote:
> Hi Frank,
>
> Frank.Li@....com wrote on Fri, 17 May 2024 14:09:50 -0400:
>
> > From: Han Xu <han.xu@....com>
> >
> > Add "fsl,imx8qxp-gpmi-nand" compatible string. iMX8QXP gpmi nand is similar
> > with iMX7D. But it using 4 clock: "gpmi_io", "gpmi_apb", "gpmi_bch" and
>
> to? is clocks
>
> > "gpmi_bch_apb".
> >
> > Signed-off-by: Han Xu <han.xu@....com>
> > Signed-off-by: Frank Li <Frank.Li@....com>
> > ---
> > drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 20 +++++++++++++++++---
> > drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h | 4 ++++
> > 2 files changed, 21 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> > index e71ad2fcec232..f90c5207bacb6 100644
> > --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> > +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> > @@ -983,7 +983,8 @@ static int gpmi_setup_interface(struct nand_chip *chip, int chipnr,
> > return PTR_ERR(sdr);
> >
> > /* Only MX28/MX6 GPMI controller can reach EDO timings */
> > - if (sdr->tRC_min <= 25000 && !GPMI_IS_MX28(this) && !GPMI_IS_MX6(this))
> > + if (sdr->tRC_min <= 25000 && !GPMI_IS_MX28(this) &&
> > + !(GPMI_IS_MX6(this) || GPMI_IS_MX8(this)))
>
> Feels completely redundant, no? If it's not an imx6 nor an imx28, it
> already returns -ENOTSUPP.
if this is mx8
sdr->tRC_min <= 25000: true
!GPMI_IS_MX28(this): true
!GPMI_IS_MX6(this): true
so whole statement is true
after change
sdr->tRC_min <= 25000: true
!GPMI_IS_MX28(this): true
!(GPMI_IS_MX6(this) || GPMI_IS_MX8(this)): false
(GPMI_IS_MX6(this) || GPMI_IS_MX8(this)): true
GPMI_IS_MX6(this): false
GPMI_IS_MX8(this): true
so whole statement is false. Maybe use
sdr->tRC_min <= 25000 && !GPMI_IS_MX28(this) && !(GPMI_IS_MX6(this) &&
!(GPMI_IS_MX8(this))
looks better.
Or use a drvflag.
if (sdr->tRC_min <= 25000 && (!this->drvflag->support_tRC_min))
Frank
>
> > return -ENOTSUPP;
>
>
> Fine otherwise.
>
> Thanks,
> Miquèl
Powered by blists - more mailing lists