diff mbox series

[1/2] mtd: rawnand: gpmi: Remove explicit default gpmi clock setting for i.MX6

Message ID 20211102202022.15551-1-ceggers@arri.de
State Accepted
Headers show
Series [1/2] mtd: rawnand: gpmi: Remove explicit default gpmi clock setting for i.MX6 | expand

Commit Message

Christian Eggers Nov. 2, 2021, 8:20 p.m. UTC
From: Stefan Riedmueller <s.riedmueller@phytec.de>

There is no need to explicitly set the default gpmi clock rate during
boot for the i.MX 6 since this is done during nand_detect anyway.

Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
Cc: stable@vger.kernel.org
---
@stable: This patch fixes a bug because this (superfluous) call to
         clk_set_rate() misses the required clock gating. The resulting
         clock glitches can prevent the system from booting.

Changelog:
-----------
RFC --> v1
- Cc: stable@vger.kernel.org

 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 9 ---------
 1 file changed, 9 deletions(-)

Comments

Han Xu Nov. 3, 2021, 4:13 p.m. UTC | #1
On 21/11/02 09:20PM, Christian Eggers wrote:
> From: Stefan Riedmueller <s.riedmueller@phytec.de>
> 
> There is no need to explicitly set the default gpmi clock rate during
> boot for the i.MX 6 since this is done during nand_detect anyway.
> 
> Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
> Cc: stable@vger.kernel.org
> ---
> @stable: This patch fixes a bug because this (superfluous) call to
>          clk_set_rate() misses the required clock gating. The resulting
>          clock glitches can prevent the system from booting.
> 
> Changelog:
> -----------
> RFC --> v1
> - Cc: stable@vger.kernel.org
> 
>  drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> index 4d08e4ab5c1b..a1f7000f033e 100644
> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> @@ -1034,15 +1034,6 @@ static int gpmi_get_clks(struct gpmi_nand_data *this)
>  		r->clock[i] = clk;
>  	}
>  
> -	if (GPMI_IS_MX6(this))
> -		/*
> -		 * Set the default value for the gpmi clock.
> -		 *
> -		 * If you want to use the ONFI nand which is in the
> -		 * Synchronous Mode, you should change the clock as you need.
> -		 */
> -		clk_set_rate(r->clock[0], 22000000);
> -

Acked-by: Han Xu <han.xu@nxp.com>

>  	return 0;
>  
>  err_clock:
> -- 
> Christian Eggers
> Embedded software developer
> 
> Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
> Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918
> Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
> Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477
> Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
>
Miquel Raynal Nov. 19, 2021, 6:43 p.m. UTC | #2
On Tue, 2021-11-02 at 20:20:21 UTC, Christian Eggers wrote:
> From: Stefan Riedmueller <s.riedmueller@phytec.de>
> 
> There is no need to explicitly set the default gpmi clock rate during
> boot for the i.MX 6 since this is done during nand_detect anyway.
> 
> Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
> Cc: stable@vger.kernel.org
> Acked-by: Han Xu <han.xu@nxp.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index 4d08e4ab5c1b..a1f7000f033e 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -1034,15 +1034,6 @@  static int gpmi_get_clks(struct gpmi_nand_data *this)
 		r->clock[i] = clk;
 	}
 
-	if (GPMI_IS_MX6(this))
-		/*
-		 * Set the default value for the gpmi clock.
-		 *
-		 * If you want to use the ONFI nand which is in the
-		 * Synchronous Mode, you should change the clock as you need.
-		 */
-		clk_set_rate(r->clock[0], 22000000);
-
 	return 0;
 
 err_clock: