mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	Martin Kepplinger <martink@posteo.de>,
	Purism Kernel Team <kernel@puri.sm>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] media: imx-mipi-csis: Fix clock handling in remove()
Date: Wed, 22 Nov 2023 16:56:15 +0200	[thread overview]
Message-ID: <20231122145615.GE8627@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20231122-imx-csis-v1-1-0617368eb996@ideasonboard.com>

Hi Tomi,

Thank you for the patch.

On Wed, Nov 22, 2023 at 03:13:48PM +0200, Tomi Valkeinen wrote:
> The driver always calls mipi_csis_runtime_suspend() and
> mipi_csis_clk_disable() in remove(). This causes multiple WARNs from the
> kernel, as the clocks get disabled too many times.

Did you try to unload the driver ? What a weird idea :-)

> Fix the remove() to call mipi_csis_runtime_suspend() and
> mipi_csis_clk_disable() in a way that reverses what is done in probe().
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/platform/nxp/imx-mipi-csis.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
> index 6cb20b45e0a1..b39d7aeba750 100644
> --- a/drivers/media/platform/nxp/imx-mipi-csis.c
> +++ b/drivers/media/platform/nxp/imx-mipi-csis.c
> @@ -1502,8 +1502,10 @@ static void mipi_csis_remove(struct platform_device *pdev)
>  	v4l2_async_nf_cleanup(&csis->notifier);
>  	v4l2_async_unregister_subdev(&csis->sd);
>  
> +	if (!pm_runtime_enabled(&pdev->dev))
> +		mipi_csis_runtime_suspend(&pdev->dev);
> +
>  	pm_runtime_disable(&pdev->dev);
> -	mipi_csis_runtime_suspend(&pdev->dev);
>  	mipi_csis_clk_disable(csis);
>  	v4l2_subdev_cleanup(&csis->sd);
>  	media_entity_cleanup(&csis->sd.entity);
> 

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2023-11-22 14:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 13:13 [PATCH 0/2] media: imx-mipi-csis: csis clock fixes Tomi Valkeinen
2023-11-22 13:13 ` [PATCH 1/2] media: imx-mipi-csis: Fix clock handling in remove() Tomi Valkeinen
2023-11-22 14:56   ` Laurent Pinchart [this message]
2023-11-22 13:13 ` [PATCH 2/2] media: imx-mipi-csis: Drop extra clock enable at probe() Tomi Valkeinen
2023-11-22 15:04   ` Laurent Pinchart
2023-11-22 13:21 ` [PATCH 0/2] media: imx-mipi-csis: csis clock fixes Fabio Estevam
2023-11-22 13:22   ` Tomi Valkeinen
2023-11-22 13:44   ` Tomi Valkeinen
2023-11-22 15:05     ` Laurent Pinchart

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=20231122145615.GE8627@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kernel@puri.sm \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=martink@posteo.de \
    --cc=mchehab@kernel.org \
    --cc=rmfrfs@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tomi.valkeinen@ideasonboard.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®