Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: bcm: rpi: Mark ISP clock as critical
@ 2025-10-28 11:46 Jai Luthra
  2025-10-28 16:13 ` Stefan Wahren
  2025-11-04 22:20 ` Florian Fainelli
  0 siblings, 2 replies; 4+ messages in thread
From: Jai Luthra @ 2025-10-28 11:46 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Florian Fainelli,
	Broadcom internal kernel review list, Stefan Wahren,
	Maíra Canal
  Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
	Jai Luthra

The ISP clock should also be marked critical to prevent the clock
framework from disabling it on boot, which can lead to bus lockups when
the kernel tries to submit buffers to the VC4 ISP firmware.

Link: https://github.com/raspberrypi/linux/issues/7100
Fixes: 919d6924ae9b ("clk: bcm: rpi: Turn firmware clock on/off when preparing/unpreparing")
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 drivers/clk/bcm/clk-raspberrypi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
index 1a9162f0ae31e330c46f6eafdd00350599b0eede..dcc3ae5fb91650b042d52f02499922786b43afde 100644
--- a/drivers/clk/bcm/clk-raspberrypi.c
+++ b/drivers/clk/bcm/clk-raspberrypi.c
@@ -151,6 +151,7 @@ raspberrypi_clk_variants[RPI_FIRMWARE_NUM_CLK_ID] = {
 	[RPI_FIRMWARE_ISP_CLK_ID] = {
 		.export = true,
 		.minimize = true,
+		.flags = CLK_IS_CRITICAL,
 	},
 	[RPI_FIRMWARE_PIXEL_BVB_CLK_ID] = {
 		.export = true,

---
base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
change-id: 20251028-rpi-isp-clk-eb5c48346e51

Best regards,
-- 
Jai Luthra <jai.luthra@ideasonboard.com>



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

* Re: [PATCH] clk: bcm: rpi: Mark ISP clock as critical
  2025-10-28 11:46 [PATCH] clk: bcm: rpi: Mark ISP clock as critical Jai Luthra
@ 2025-10-28 16:13 ` Stefan Wahren
  2025-11-04 22:20 ` Florian Fainelli
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Wahren @ 2025-10-28 16:13 UTC (permalink / raw)
  To: Jai Luthra, Michael Turquette, Stephen Boyd, Florian Fainelli,
	Broadcom internal kernel review list, Maíra Canal
  Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel

Am 28.10.25 um 12:46 schrieb Jai Luthra:
> The ISP clock should also be marked critical to prevent the clock
> framework from disabling it on boot, which can lead to bus lockups when
> the kernel tries to submit buffers to the VC4 ISP firmware.
>
> Link: https://github.com/raspberrypi/linux/issues/7100
> Fixes: 919d6924ae9b ("clk: bcm: rpi: Turn firmware clock on/off when preparing/unpreparing")
> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Reviewed-by: Stefan Wahren <wahrenst@gmx.net>

Thanks
> ---
>   drivers/clk/bcm/clk-raspberrypi.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
> index 1a9162f0ae31e330c46f6eafdd00350599b0eede..dcc3ae5fb91650b042d52f02499922786b43afde 100644
> --- a/drivers/clk/bcm/clk-raspberrypi.c
> +++ b/drivers/clk/bcm/clk-raspberrypi.c
> @@ -151,6 +151,7 @@ raspberrypi_clk_variants[RPI_FIRMWARE_NUM_CLK_ID] = {
>   	[RPI_FIRMWARE_ISP_CLK_ID] = {
>   		.export = true,
>   		.minimize = true,
> +		.flags = CLK_IS_CRITICAL,
>   	},
>   	[RPI_FIRMWARE_PIXEL_BVB_CLK_ID] = {
>   		.export = true,
>
> ---
> base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
> change-id: 20251028-rpi-isp-clk-eb5c48346e51
>
> Best regards,



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

* Re: [PATCH] clk: bcm: rpi: Mark ISP clock as critical
  2025-10-28 11:46 [PATCH] clk: bcm: rpi: Mark ISP clock as critical Jai Luthra
  2025-10-28 16:13 ` Stefan Wahren
@ 2025-11-04 22:20 ` Florian Fainelli
  2025-11-05  6:51   ` Jai Luthra
  1 sibling, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2025-11-04 22:20 UTC (permalink / raw)
  To: Jai Luthra, Michael Turquette, Stephen Boyd,
	Broadcom internal kernel review list, Stefan Wahren,
	Maíra Canal
  Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel

On 10/28/25 04:46, Jai Luthra wrote:
> The ISP clock should also be marked critical to prevent the clock
> framework from disabling it on boot, which can lead to bus lockups when
> the kernel tries to submit buffers to the VC4 ISP firmware.

The commit message suggests that the driver that interfaces with the VC4 
ISP firmware is not ensuring that the clock remains enabled for the 
duration of the transactions. That would be a driver bug, would not it?

> 
> Link: https://github.com/raspberrypi/linux/issues/7100
> Fixes: 919d6924ae9b ("clk: bcm: rpi: Turn firmware clock on/off when preparing/unpreparing")
> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> ---
>   drivers/clk/bcm/clk-raspberrypi.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
> index 1a9162f0ae31e330c46f6eafdd00350599b0eede..dcc3ae5fb91650b042d52f02499922786b43afde 100644
> --- a/drivers/clk/bcm/clk-raspberrypi.c
> +++ b/drivers/clk/bcm/clk-raspberrypi.c
> @@ -151,6 +151,7 @@ raspberrypi_clk_variants[RPI_FIRMWARE_NUM_CLK_ID] = {
>   	[RPI_FIRMWARE_ISP_CLK_ID] = {
>   		.export = true,
>   		.minimize = true,
> +		.flags = CLK_IS_CRITICAL,
>   	},
>   	[RPI_FIRMWARE_PIXEL_BVB_CLK_ID] = {
>   		.export = true,
> 
> ---
> base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
> change-id: 20251028-rpi-isp-clk-eb5c48346e51
> 
> Best regards,


-- 
Florian


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

* Re: [PATCH] clk: bcm: rpi: Mark ISP clock as critical
  2025-11-04 22:20 ` Florian Fainelli
@ 2025-11-05  6:51   ` Jai Luthra
  0 siblings, 0 replies; 4+ messages in thread
From: Jai Luthra @ 2025-11-05  6:51 UTC (permalink / raw)
  To: Broadcom internal kernel review list, Florian Fainelli,
	Maíra Canal, Michael Turquette, Stefan Wahren, Stephen Boyd
  Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel

Hi Florian,

Quoting Florian Fainelli (2025-11-05 03:50:23)
> On 10/28/25 04:46, Jai Luthra wrote:
> > The ISP clock should also be marked critical to prevent the clock
> > framework from disabling it on boot, which can lead to bus lockups when
> > the kernel tries to submit buffers to the VC4 ISP firmware.
> 
> The commit message suggests that the driver that interfaces with the VC4 
> ISP firmware is not ensuring that the clock remains enabled for the 
> duration of the transactions. That would be a driver bug, would not it?
> 

Yes, from https://github.com/raspberrypi/linux/issues/7100#issuecomment-3467699055
the VC4 firmware should be responsible for stopping and starting that clock
when necessary.

The downstream bcm2835-isp linux driver currently does not consume this
clock at all, so I'm not sure if the cleaner solution is to drop this
altogether from linux, or mark it as a consumer, along with fixing the
firmware driver.

> > 
> > Link: https://github.com/raspberrypi/linux/issues/7100
> > Fixes: 919d6924ae9b ("clk: bcm: rpi: Turn firmware clock on/off when preparing/unpreparing")
> > Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> > ---
> >   drivers/clk/bcm/clk-raspberrypi.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
> > index 1a9162f0ae31e330c46f6eafdd00350599b0eede..dcc3ae5fb91650b042d52f02499922786b43afde 100644
> > --- a/drivers/clk/bcm/clk-raspberrypi.c
> > +++ b/drivers/clk/bcm/clk-raspberrypi.c
> > @@ -151,6 +151,7 @@ raspberrypi_clk_variants[RPI_FIRMWARE_NUM_CLK_ID] = {
> >       [RPI_FIRMWARE_ISP_CLK_ID] = {
> >               .export = true,
> >               .minimize = true,
> > +             .flags = CLK_IS_CRITICAL,
> >       },
> >       [RPI_FIRMWARE_PIXEL_BVB_CLK_ID] = {
> >               .export = true,
> > 
> > ---
> > base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
> > change-id: 20251028-rpi-isp-clk-eb5c48346e51
> > 
> > Best regards,
> 
> 
> -- 
> Florian

Thanks,
Jai


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

end of thread, other threads:[~2025-11-05  6:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-28 11:46 [PATCH] clk: bcm: rpi: Mark ISP clock as critical Jai Luthra
2025-10-28 16:13 ` Stefan Wahren
2025-11-04 22:20 ` Florian Fainelli
2025-11-05  6:51   ` Jai Luthra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox