All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mtd: spi-nor: hisi-sfc: Remove excessive clk_disable_unprepare()
@ 2021-07-09 14:45 ` Evgeny Novikov
  0 siblings, 0 replies; 4+ messages in thread
From: Evgeny Novikov @ 2021-07-09 14:45 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: Evgeny Novikov, Michael Walle, Pratyush Yadav, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, Lee Jones, Pan Bian,
	linux-mtd, linux-kernel, ldv-project

hisi_spi_nor_probe() invokes clk_disable_unprepare() on all paths after
successful call of clk_prepare_enable(). Besides, the clock is enabled by
hispi_spi_nor_prep() and disabled by hispi_spi_nor_unprep(). So at remove
time it is not possible to have the clock enabled. The patch removes
excessive clk_disable_unprepare() from hisi_spi_nor_remove().

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: e523f11141bd ("mtd: spi-nor: add hisilicon spi-nor flash controller driver")
Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
---
v2: Fix notes from Pratyush Yadav:
    - Describe better why clock disabling is not necessary at remove time.
    - Add tag Fixes.
---
 drivers/mtd/spi-nor/controllers/hisi-sfc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/controllers/hisi-sfc.c b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
index 47fbf1d1e557..516e50269478 100644
--- a/drivers/mtd/spi-nor/controllers/hisi-sfc.c
+++ b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
@@ -477,7 +477,6 @@ static int hisi_spi_nor_remove(struct platform_device *pdev)
 
 	hisi_spi_nor_unregister_all(host);
 	mutex_destroy(&host->lock);
-	clk_disable_unprepare(host->clk);
 	return 0;
 }
 
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] mtd: spi-nor: hisi-sfc: Remove excessive clk_disable_unprepare()
@ 2021-07-09 14:45 ` Evgeny Novikov
  0 siblings, 0 replies; 4+ messages in thread
From: Evgeny Novikov @ 2021-07-09 14:45 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: Evgeny Novikov, Michael Walle, Pratyush Yadav, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, Lee Jones, Pan Bian,
	linux-mtd, linux-kernel, ldv-project

hisi_spi_nor_probe() invokes clk_disable_unprepare() on all paths after
successful call of clk_prepare_enable(). Besides, the clock is enabled by
hispi_spi_nor_prep() and disabled by hispi_spi_nor_unprep(). So at remove
time it is not possible to have the clock enabled. The patch removes
excessive clk_disable_unprepare() from hisi_spi_nor_remove().

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: e523f11141bd ("mtd: spi-nor: add hisilicon spi-nor flash controller driver")
Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
---
v2: Fix notes from Pratyush Yadav:
    - Describe better why clock disabling is not necessary at remove time.
    - Add tag Fixes.
---
 drivers/mtd/spi-nor/controllers/hisi-sfc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/controllers/hisi-sfc.c b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
index 47fbf1d1e557..516e50269478 100644
--- a/drivers/mtd/spi-nor/controllers/hisi-sfc.c
+++ b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
@@ -477,7 +477,6 @@ static int hisi_spi_nor_remove(struct platform_device *pdev)
 
 	hisi_spi_nor_unregister_all(host);
 	mutex_destroy(&host->lock);
-	clk_disable_unprepare(host->clk);
 	return 0;
 }
 
-- 
2.26.2

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mtd: spi-nor: hisi-sfc: Remove excessive clk_disable_unprepare()
  2021-07-09 14:45 ` Evgeny Novikov
@ 2021-10-19 10:16   ` Tudor.Ambarus
  -1 siblings, 0 replies; 4+ messages in thread
From: Tudor.Ambarus @ 2021-10-19 10:16 UTC (permalink / raw)
  To: novikov
  Cc: michael, p.yadav, miquel.raynal, richard, vigneshr, lee.jones,
	bianpan2016, linux-mtd, linux-kernel, ldv-project

On 7/9/21 5:45 PM, Evgeny Novikov wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> hisi_spi_nor_probe() invokes clk_disable_unprepare() on all paths after
> successful call of clk_prepare_enable(). Besides, the clock is enabled by
> hispi_spi_nor_prep() and disabled by hispi_spi_nor_unprep(). So at remove
> time it is not possible to have the clock enabled. The patch removes
> excessive clk_disable_unprepare() from hisi_spi_nor_remove().
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Fixes: e523f11141bd ("mtd: spi-nor: add hisilicon spi-nor flash controller driver")
> Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
> Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
> ---
> v2: Fix notes from Pratyush Yadav:
>     - Describe better why clock disabling is not necessary at remove time.
>     - Add tag Fixes.
> ---
>  drivers/mtd/spi-nor/controllers/hisi-sfc.c | 1 -
>  1 file changed, 1 deletion(-)
> 

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mtd: spi-nor: hisi-sfc: Remove excessive clk_disable_unprepare()
@ 2021-10-19 10:16   ` Tudor.Ambarus
  0 siblings, 0 replies; 4+ messages in thread
From: Tudor.Ambarus @ 2021-10-19 10:16 UTC (permalink / raw)
  To: novikov
  Cc: michael, p.yadav, miquel.raynal, richard, vigneshr, lee.jones,
	bianpan2016, linux-mtd, linux-kernel, ldv-project

On 7/9/21 5:45 PM, Evgeny Novikov wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> hisi_spi_nor_probe() invokes clk_disable_unprepare() on all paths after
> successful call of clk_prepare_enable(). Besides, the clock is enabled by
> hispi_spi_nor_prep() and disabled by hispi_spi_nor_unprep(). So at remove
> time it is not possible to have the clock enabled. The patch removes
> excessive clk_disable_unprepare() from hisi_spi_nor_remove().
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Fixes: e523f11141bd ("mtd: spi-nor: add hisilicon spi-nor flash controller driver")
> Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
> Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
> ---
> v2: Fix notes from Pratyush Yadav:
>     - Describe better why clock disabling is not necessary at remove time.
>     - Add tag Fixes.
> ---
>  drivers/mtd/spi-nor/controllers/hisi-sfc.c | 1 -
>  1 file changed, 1 deletion(-)
> 

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-19 10:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 14:45 [PATCH v2] mtd: spi-nor: hisi-sfc: Remove excessive clk_disable_unprepare() Evgeny Novikov
2021-07-09 14:45 ` Evgeny Novikov
2021-10-19 10:16 ` Tudor.Ambarus
2021-10-19 10:16   ` Tudor.Ambarus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.