From: Pratyush Yadav <p.yadav@ti.com>
To: Evgeny Novikov <novikov@ispras.ru>
Cc: Tudor Ambarus <tudor.ambarus@microchip.com>,
Michael Walle <michael@walle.cc>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Lee Jones <lee.jones@linaro.org>, Pan Bian <bianpan2016@163.com>,
<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
<ldv-project@linuxtesting.org>
Subject: Re: [PATCH] mtd: spi-nor: hisi-sfc: Remove excessive clk_disable_unprepare()
Date: Fri, 9 Jul 2021 15:49:32 +0530 [thread overview]
Message-ID: <20210709101930.dxgr22tl46turyhg@ti.com> (raw)
In-Reply-To: <20210709093542.18718-1-novikov@ispras.ru>
On 09/07/21 12:35PM, Evgeny Novikov wrote:
> hisi_spi_nor_probe() invokes clk_disable_unprepare() on all paths after
> successful call of clk_prepare_enable(), so, there is no need in one
> more clk_disable_unprepare() in hisi_spi_nor_remove(). The patch fixes
> that.
This is true, but I think the patch should also mention that 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 big point is not that the probe disabled the clock, but that every
path would make sure to disable the clock, so it will already be
disabled when remove is called.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
Fixes tag?
With these comments addressed,
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
> Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
> ---
> 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
>
--
Regards,
Pratyush Yadav
Texas Instruments Inc.
prev parent reply other threads:[~2021-07-09 10:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-09 9:35 Evgeny Novikov
2021-07-09 10:19 ` Pratyush Yadav [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210709101930.dxgr22tl46turyhg@ti.com \
--to=p.yadav@ti.com \
--cc=bianpan2016@163.com \
--cc=ldv-project@linuxtesting.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=michael@walle.cc \
--cc=miquel.raynal@bootlin.com \
--cc=novikov@ispras.ru \
--cc=richard@nod.at \
--cc=tudor.ambarus@microchip.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®