* [PATCH v4 1/5] mtd: rawnand: denali_dt: set clk_x_rate to 200 MHz unconditionally [not found] <1529683598-25783-1-git-send-email-yamada.masahiro@socionext.com> @ 2018-06-22 16:06 ` Masahiro Yamada 2018-06-22 16:49 ` Boris Brezillon 0 siblings, 1 reply; 2+ messages in thread From: Masahiro Yamada @ 2018-06-22 16:06 UTC (permalink / raw) To: linux-mtd, Boris Brezillon Cc: Rob Herring, Miquel Raynal, Richard Weinberger, Masahiro Yamada, linux-stable #4 . 14+, linux-kernel, Marek Vasut, Brian Norris, David Woodhouse Since commit 1bb88666775e ("mtd: nand: denali: handle timing parameters by setup_data_interface()"), denali_dt.c gets the clock rate from the clock driver. The driver expects the frequency of the bus interface clock, whereas the clock driver of SOCFPGA provides the core clock. Thus, the setup_data_interface() hook calculates timing parameters based on a wrong frequency. To make it work without relying on the clock driver, hard-code the clock frequency, 200MHz. This is fine for existing DT of UniPhier, and also fixes the issue of SOCFPGA because both platforms use 200 MHz for the bus interface clock. Fixes: 1bb88666775e ("mtd: nand: denali: handle timing parameters by setup_data_interface()") Cc: linux-stable <stable@vger.kernel.org> #4.14+ Reported-by: Philipp Rosenberger <p.rosenberger@linutronix.de> Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Tested-by: Richard Weinberger <richard@nod.at> --- Changes in v4: - split into a very simple patch for backport candiate drivers/mtd/nand/raw/denali_dt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/denali_dt.c b/drivers/mtd/nand/raw/denali_dt.c index cfd33e6..5869e90 100644 --- a/drivers/mtd/nand/raw/denali_dt.c +++ b/drivers/mtd/nand/raw/denali_dt.c @@ -123,7 +123,11 @@ static int denali_dt_probe(struct platform_device *pdev) if (ret) return ret; - denali->clk_x_rate = clk_get_rate(dt->clk); + /* + * Hardcode the clock rate for the backward compatibility. + * This works for both SOCFPGA and UniPhier. + */ + denali->clk_x_rate = 200000000; ret = denali_init(denali); if (ret) -- 2.7.4 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v4 1/5] mtd: rawnand: denali_dt: set clk_x_rate to 200 MHz unconditionally 2018-06-22 16:06 ` [PATCH v4 1/5] mtd: rawnand: denali_dt: set clk_x_rate to 200 MHz unconditionally Masahiro Yamada @ 2018-06-22 16:49 ` Boris Brezillon 0 siblings, 0 replies; 2+ messages in thread From: Boris Brezillon @ 2018-06-22 16:49 UTC (permalink / raw) To: Masahiro Yamada Cc: linux-mtd, Rob Herring, Miquel Raynal, Richard Weinberger, linux-stable #4 . 14+, linux-kernel, Marek Vasut, Brian Norris, David Woodhouse On Sat, 23 Jun 2018 01:06:34 +0900 Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > Since commit 1bb88666775e ("mtd: nand: denali: handle timing parameters > by setup_data_interface()"), denali_dt.c gets the clock rate from the > clock driver. The driver expects the frequency of the bus interface > clock, whereas the clock driver of SOCFPGA provides the core clock. > Thus, the setup_data_interface() hook calculates timing parameters > based on a wrong frequency. > > To make it work without relying on the clock driver, hard-code the clock > frequency, 200MHz. This is fine for existing DT of UniPhier, and also > fixes the issue of SOCFPGA because both platforms use 200 MHz for the > bus interface clock. > > Fixes: 1bb88666775e ("mtd: nand: denali: handle timing parameters by setup_data_interface()") > Cc: linux-stable <stable@vger.kernel.org> #4.14+ > Reported-by: Philipp Rosenberger <p.rosenberger@linutronix.de> > Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> > Tested-by: Richard Weinberger <richard@nod.at> Applied. Thanks, Boris > --- > > Changes in v4: > - split into a very simple patch for backport candiate > > drivers/mtd/nand/raw/denali_dt.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/raw/denali_dt.c b/drivers/mtd/nand/raw/denali_dt.c > index cfd33e6..5869e90 100644 > --- a/drivers/mtd/nand/raw/denali_dt.c > +++ b/drivers/mtd/nand/raw/denali_dt.c > @@ -123,7 +123,11 @@ static int denali_dt_probe(struct platform_device *pdev) > if (ret) > return ret; > > - denali->clk_x_rate = clk_get_rate(dt->clk); > + /* > + * Hardcode the clock rate for the backward compatibility. > + * This works for both SOCFPGA and UniPhier. > + */ > + denali->clk_x_rate = 200000000; > > ret = denali_init(denali); > if (ret) ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-22 16:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1529683598-25783-1-git-send-email-yamada.masahiro@socionext.com>
2018-06-22 16:06 ` [PATCH v4 1/5] mtd: rawnand: denali_dt: set clk_x_rate to 200 MHz unconditionally Masahiro Yamada
2018-06-22 16:49 ` Boris Brezillon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox