From: Maxime Ripard <hidden> Date: 2021-09-22 12:54:31
Hi,
Here's another attempt at fixing the complete CPU stall while retrieving the
HDMI connector status when the connector is disabled.
This was fixed already, but eventually got reverted by Linus due to the same
symptom happening in another situation. This was likely (but not confirmed by
the reporter) due to the kernel being booted without an HDMI display connected,
in which case the firmware won't initialise the HDMI State Machine clock.
This is fixed by patch 3. However, further changes in the clock drivers were
needed for clk_set_min_rate to be used, which are patches 1 and 2.
Finally, patches 4 and 5 are the original patches that were reverted. Patch 4
got a small modification to move the clk_set_min_rate() call before the HSM
clock is enabled.
Let me know what you think,
Maxime
Maxime Ripard (5):
clk: bcm-2835: Pick the closest clock rate
clk: bcm-2835: Remove rounding up the dividers
drm/vc4: hdmi: Set a default HSM rate
drm/vc4: hdmi: Move the HSM clock enable to runtime_pm
drm/vc4: hdmi: Make sure the controller is powered in detect
drivers/clk/bcm/clk-bcm2835.c | 13 ++---
drivers/gpu/drm/vc4/vc4_hdmi.c | 90 ++++++++++++++++++++++++----------
2 files changed, 68 insertions(+), 35 deletions(-)
--
2.31.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Maxime Ripard <hidden> Date: 2021-09-22 12:54:31
The driver currently tries to pick the closest rate that is lower than
the rate being requested.
This causes an issue with clk_set_min_rate() since it actively checks
for the rounded rate to be above the minimum that was just set.
Let's change the logic a bit to pick the closest rate to the requested
rate, no matter if it's actually higher or lower.
Fixes: 6d18b8adbe67 ("clk: bcm2835: Support for clock parent selection")
Signed-off-by: Maxime Ripard <redacted>
---
drivers/clk/bcm/clk-bcm2835.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Maxime Ripard <hidden> Date: 2021-09-22 12:54:34
The driver, once it found a divider, tries to round it up by increasing
the least significant bit of the fractional part by one when the
round_up argument is set and there's a remainder.
However, since it increases the divider it will actually reduce the
clock rate below what we were asking for, leading to issues with
clk_set_min_rate() that will complain that our rounded clock rate is
below the minimum of the rate.
Since the dividers are fairly precise already, let's remove that part so
that we can have clk_set_min_rate() working.
This is effectively a revert of 9c95b32ca093 ("clk: bcm2835: add a round
up ability to the clock divisor").
Fixes: 9c95b32ca093 ("clk: bcm2835: add a round up ability to the clock divisor")
Signed-off-by: Maxime Ripard <redacted>
---
drivers/clk/bcm/clk-bcm2835.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
@@ -932,8 +932,7 @@ static int bcm2835_clock_is_on(struct clk_hw *hw)staticu32bcm2835_clock_choose_div(structclk_hw*hw,unsignedlongrate,-unsignedlongparent_rate,-boolround_up)+unsignedlongparent_rate){structbcm2835_clock*clock=bcm2835_clock_from_hw(hw);conststructbcm2835_clock_data*data=clock->data;
@@ -945,10 +944,6 @@ static u32 bcm2835_clock_choose_div(struct clk_hw *hw,rem=do_div(temp,rate);div=temp;--/* Round up and mask off the unused bits */-if(round_up&&((div&unused_frac_mask)!=0||rem!=0))-div+=unused_frac_mask+1;div&=~unused_frac_mask;/* different clamping limits apply for a mash clock */
@@ -1079,7 +1074,7 @@ static int bcm2835_clock_set_rate(struct clk_hw *hw,structbcm2835_clock*clock=bcm2835_clock_from_hw(hw);structbcm2835_cprman*cprman=clock->cprman;conststructbcm2835_clock_data*data=clock->data;-u32div=bcm2835_clock_choose_div(hw,rate,parent_rate,false);+u32div=bcm2835_clock_choose_div(hw,rate,parent_rate);u32ctl;spin_lock(&cprman->regs_lock);
@@ -1130,7 +1125,7 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw,if(!(BIT(parent_idx)&data->set_rate_parent)){*prate=clk_hw_get_rate(parent);-*div=bcm2835_clock_choose_div(hw,rate,*prate,true);+*div=bcm2835_clock_choose_div(hw,rate,*prate);*avgrate=bcm2835_clock_rate_from_divisor(clock,*prate,*div);
--
2.31.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Maxime Ripard <hidden> Date: 2021-09-22 12:54:39
When the firmware doesn't setup the HSM rate (such as when booting
without an HDMI cable plugged in), its rate is 0 and thus any register
access results in a CPU stall, even though HSM is enabled.
Let's enforce a minimum rate at boot to avoid this issue.
Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
Signed-off-by: Maxime Ripard <redacted>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
From: Maxime Ripard <hidden> Date: 2021-09-22 12:54:41
In order to access the HDMI controller, we need to make sure the HSM
clock is enabled. If we were to access it with the clock disabled, the
CPU would completely hang, resulting in an hard crash.
Since we have different code path that would require it, let's move that
clock enable / disable to runtime_pm that will take care of the
reference counting for us.
Since we also want to change the HSM clock rate and it's only valid
while the clock is disabled, we need to move the clk_set_min_rate() call
on the HSM clock above pm_runtime_get_and_sync().
Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
Signed-off-by: Maxime Ripard <redacted>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 72 ++++++++++++++++++++++------------
1 file changed, 46 insertions(+), 26 deletions(-)
@@ -894,28 +893,10 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,conn_state_to_vc4_hdmi_conn_state(conn_state);structdrm_display_mode*mode=&encoder->crtc->state->adjusted_mode;structvc4_hdmi*vc4_hdmi=encoder_to_vc4_hdmi(encoder);-unsignedlongbvb_rate,pixel_rate,hsm_rate;+unsignedlongpixel_rate=vc4_conn_state->pixel_rate;+unsignedlongbvb_rate,hsm_rate;intret;-ret=pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev);-if(ret<0){-DRM_ERROR("Failed to retain power domain: %d\n",ret);-return;-}--pixel_rate=vc4_conn_state->pixel_rate;-ret=clk_set_rate(vc4_hdmi->pixel_clock,pixel_rate);-if(ret){-DRM_ERROR("Failed to set pixel clock rate: %d\n",ret);-return;-}--ret=clk_prepare_enable(vc4_hdmi->pixel_clock);-if(ret){-DRM_ERROR("Failed to turn on pixel clock: %d\n",ret);-return;-}-/**AsstatedinRPi'svc4firmware"HDMI state machine (HSM) clock must*befasterthanpixelclock,infinitesimallyfaster,testedin
@@ -939,10 +920,21 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,return;}-ret=clk_prepare_enable(vc4_hdmi->hsm_clock);+ret=pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev);+if(ret<0){+DRM_ERROR("Failed to retain power domain: %d\n",ret);+return;+}++ret=clk_set_rate(vc4_hdmi->pixel_clock,pixel_rate);if(ret){-DRM_ERROR("Failed to turn on HSM clock: %d\n",ret);-clk_disable_unprepare(vc4_hdmi->pixel_clock);+DRM_ERROR("Failed to set pixel clock rate: %d\n",ret);+return;+}++ret=clk_prepare_enable(vc4_hdmi->pixel_clock);+if(ret){+DRM_ERROR("Failed to turn on pixel clock: %d\n",ret);return;}
@@ -958,7 +950,6 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,ret=clk_set_min_rate(vc4_hdmi->pixel_bvb_clock,bvb_rate);if(ret){DRM_ERROR("Failed to set pixel bvb clock rate: %d\n",ret);-clk_disable_unprepare(vc4_hdmi->hsm_clock);clk_disable_unprepare(vc4_hdmi->pixel_clock);return;}
@@ -966,7 +957,6 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,ret=clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);if(ret){DRM_ERROR("Failed to turn on pixel bvb clock: %d\n",ret);-clk_disable_unprepare(vc4_hdmi->hsm_clock);clk_disable_unprepare(vc4_hdmi->pixel_clock);return;}
@@ -2107,6 +2097,29 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi)return0;}+#ifdef CONFIG_PM+staticintvc4_hdmi_runtime_suspend(structdevice*dev)+{+structvc4_hdmi*vc4_hdmi=dev_get_drvdata(dev);++clk_disable_unprepare(vc4_hdmi->hsm_clock);++return0;+}++staticintvc4_hdmi_runtime_resume(structdevice*dev)+{+structvc4_hdmi*vc4_hdmi=dev_get_drvdata(dev);+intret;++ret=clk_prepare_enable(vc4_hdmi->hsm_clock);+if(ret)+returnret;++return0;+}+#endif+staticintvc4_hdmi_bind(structdevice*dev,structdevice*master,void*data){conststructvc4_hdmi_variant*variant=of_device_get_match_data(dev);
From: Maxime Ripard <hidden> Date: 2021-09-22 12:54:44
If the HPD GPIO is not available and drm_probe_ddc fails, we end up
reading the HDMI_HOTPLUG register, but the controller might be powered
off resulting in a CPU hang. Make sure we have the power domain and the
HSM clock powered during the detect cycle to prevent the hang from
happening.
Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
Signed-off-by: Maxime Ripard <redacted>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++++
1 file changed, 4 insertions(+)
From: Maxime Ripard <hidden> Date: 2021-09-24 07:40:53
Hi,
On Wed, Sep 22, 2021 at 02:54:14PM +0200, Maxime Ripard wrote:
Hi,
Here's another attempt at fixing the complete CPU stall while retrieving the
HDMI connector status when the connector is disabled.
This was fixed already, but eventually got reverted by Linus due to the same
symptom happening in another situation. This was likely (but not confirmed by
the reporter) due to the kernel being booted without an HDMI display connected,
in which case the firmware won't initialise the HDMI State Machine clock.
This is fixed by patch 3. However, further changes in the clock drivers were
needed for clk_set_min_rate to be used, which are patches 1 and 2.
Finally, patches 4 and 5 are the original patches that were reverted. Patch 4
got a small modification to move the clk_set_min_rate() call before the HSM
clock is enabled.
If we merge the clock patches and DRM patches separately we're going to
break bisectability. I guess the easiest approach would be to merge the
clk patches through DRM. Does that work for everyone?
Maxime
From: Maxime Ripard <hidden> Date: 2021-09-28 13:05:57
On Fri, Sep 24, 2021 at 09:40:44AM +0200, Maxime Ripard wrote:
Hi,
On Wed, Sep 22, 2021 at 02:54:14PM +0200, Maxime Ripard wrote:
quoted
Hi,
Here's another attempt at fixing the complete CPU stall while retrieving the
HDMI connector status when the connector is disabled.
This was fixed already, but eventually got reverted by Linus due to the same
symptom happening in another situation. This was likely (but not confirmed by
the reporter) due to the kernel being booted without an HDMI display connected,
in which case the firmware won't initialise the HDMI State Machine clock.
This is fixed by patch 3. However, further changes in the clock drivers were
needed for clk_set_min_rate to be used, which are patches 1 and 2.
Finally, patches 4 and 5 are the original patches that were reverted. Patch 4
got a small modification to move the clk_set_min_rate() call before the HSM
clock is enabled.
If we merge the clock patches and DRM patches separately we're going to
break bisectability. I guess the easiest approach would be to merge the
clk patches through DRM. Does that work for everyone?
Anyone? I can ask around for reviews on DRM, but I'd really like some
reviews on the clock patches here..
Maxime
From: nicolas saenz julienne <nsaenz@kernel.org> Date: 2021-09-28 16:26:16
On Wed, 2021-09-22 at 14:54 +0200, Maxime Ripard wrote:
The driver currently tries to pick the closest rate that is lower than
the rate being requested.
This causes an issue with clk_set_min_rate() since it actively checks
for the rounded rate to be above the minimum that was just set.
Let's change the logic a bit to pick the closest rate to the requested
rate, no matter if it's actually higher or lower.
Fixes: 6d18b8adbe67 ("clk: bcm2835: Support for clock parent selection")
Signed-off-by: Maxime Ripard <redacted>
---
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Tested-by: Nicolas Saenz Julienne <nsaenz@kernel.org> # boot and basic functionality
Regards,
Nicolas
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: nicolas saenz julienne <nsaenz@kernel.org> Date: 2021-09-28 16:27:02
On Wed, 2021-09-22 at 14:54 +0200, Maxime Ripard wrote:
The driver, once it found a divider, tries to round it up by increasing
the least significant bit of the fractional part by one when the
round_up argument is set and there's a remainder.
However, since it increases the divider it will actually reduce the
clock rate below what we were asking for, leading to issues with
clk_set_min_rate() that will complain that our rounded clock rate is
below the minimum of the rate.
Since the dividers are fairly precise already, let's remove that part so
that we can have clk_set_min_rate() working.
This is effectively a revert of 9c95b32ca093 ("clk: bcm2835: add a round
up ability to the clock divisor").
Fixes: 9c95b32ca093 ("clk: bcm2835: add a round up ability to the clock divisor")
Signed-off-by: Maxime Ripard <redacted>
---
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Tested-by: Nicolas Saenz Julienne <nsaenz@kernel.org> # boot and basic functionality
Regards,
Nicolas
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Maxime Ripard <hidden> Date: 2021-09-29 13:27:50
On Tue, Sep 28, 2021 at 06:26:55PM +0200, nicolas saenz julienne wrote:
On Wed, 2021-09-22 at 14:54 +0200, Maxime Ripard wrote:
quoted
The driver, once it found a divider, tries to round it up by increasing
the least significant bit of the fractional part by one when the
round_up argument is set and there's a remainder.
However, since it increases the divider it will actually reduce the
clock rate below what we were asking for, leading to issues with
clk_set_min_rate() that will complain that our rounded clock rate is
below the minimum of the rate.
Since the dividers are fairly precise already, let's remove that part so
that we can have clk_set_min_rate() working.
This is effectively a revert of 9c95b32ca093 ("clk: bcm2835: add a round
up ability to the clock divisor").
Fixes: 9c95b32ca093 ("clk: bcm2835: add a round up ability to the clock divisor")
Signed-off-by: Maxime Ripard <redacted>
---
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Tested-by: Nicolas Saenz Julienne <nsaenz@kernel.org> # boot and basic functionality
Does that mean you're ok with merging it through the DRM-misc tree?
Florian, Mike, Stephen, any objection?
Maxime
From: nicolas saenz julienne <nsaenz@kernel.org> Date: 2021-09-30 15:51:51
On Wed, 2021-09-22 at 14:54 +0200, Maxime Ripard wrote:
When the firmware doesn't setup the HSM rate (such as when booting
without an HDMI cable plugged in), its rate is 0 and thus any register
access results in a CPU stall, even though HSM is enabled.
Let's enforce a minimum rate at boot to avoid this issue.
Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
Signed-off-by: Maxime Ripard <redacted>
---
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Tested-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Regards,
Nicolas
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: nicolas saenz julienne <nsaenz@kernel.org> Date: 2021-09-30 15:54:51
On Wed, 2021-09-22 at 14:54 +0200, Maxime Ripard wrote:
In order to access the HDMI controller, we need to make sure the HSM
clock is enabled. If we were to access it with the clock disabled, the
CPU would completely hang, resulting in an hard crash.
Since we have different code path that would require it, let's move that
clock enable / disable to runtime_pm that will take care of the
reference counting for us.
Since we also want to change the HSM clock rate and it's only valid
while the clock is disabled, we need to move the clk_set_min_rate() call
on the HSM clock above pm_runtime_get_and_sync().
Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
Signed-off-by: Maxime Ripard <redacted>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Tested-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Regards,
Nicolas
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: nicolas saenz julienne <nsaenz@kernel.org> Date: 2021-09-30 15:55:34
On Wed, 2021-09-22 at 14:54 +0200, Maxime Ripard wrote:
If the HPD GPIO is not available and drm_probe_ddc fails, we end up
reading the HDMI_HOTPLUG register, but the controller might be powered
off resulting in a CPU hang. Make sure we have the power domain and the
HSM clock powered during the detect cycle to prevent the hang from
happening.
Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
Signed-off-by: Maxime Ripard <redacted>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Tested-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Regards,
Nicolas
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-09-30 18:08:33
Quoting Maxime Ripard (2021-09-22 05:54:15)
The driver currently tries to pick the closest rate that is lower than
the rate being requested.
This causes an issue with clk_set_min_rate() since it actively checks
for the rounded rate to be above the minimum that was just set.
Let's change the logic a bit to pick the closest rate to the requested
rate, no matter if it's actually higher or lower.
Fixes: 6d18b8adbe67 ("clk: bcm2835: Support for clock parent selection")
Signed-off-by: Maxime Ripard <redacted>
---
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-09-30 18:09:08
Quoting Maxime Ripard (2021-09-22 05:54:16)
The driver, once it found a divider, tries to round it up by increasing
the least significant bit of the fractional part by one when the
round_up argument is set and there's a remainder.
However, since it increases the divider it will actually reduce the
clock rate below what we were asking for, leading to issues with
clk_set_min_rate() that will complain that our rounded clock rate is
below the minimum of the rate.
Since the dividers are fairly precise already, let's remove that part so
that we can have clk_set_min_rate() working.
This is effectively a revert of 9c95b32ca093 ("clk: bcm2835: add a round
up ability to the clock divisor").
Fixes: 9c95b32ca093 ("clk: bcm2835: add a round up ability to the clock divisor")
Signed-off-by: Maxime Ripard <redacted>
---
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-09-30 18:09:40
Quoting Maxime Ripard (2021-09-28 06:05:49)
On Fri, Sep 24, 2021 at 09:40:44AM +0200, Maxime Ripard wrote:
quoted
Hi,
On Wed, Sep 22, 2021 at 02:54:14PM +0200, Maxime Ripard wrote:
quoted
Hi,
Here's another attempt at fixing the complete CPU stall while retrieving the
HDMI connector status when the connector is disabled.
This was fixed already, but eventually got reverted by Linus due to the same
symptom happening in another situation. This was likely (but not confirmed by
the reporter) due to the kernel being booted without an HDMI display connected,
in which case the firmware won't initialise the HDMI State Machine clock.
This is fixed by patch 3. However, further changes in the clock drivers were
needed for clk_set_min_rate to be used, which are patches 1 and 2.
Finally, patches 4 and 5 are the original patches that were reverted. Patch 4
got a small modification to move the clk_set_min_rate() call before the HSM
clock is enabled.
If we merge the clock patches and DRM patches separately we're going to
break bisectability. I guess the easiest approach would be to merge the
clk patches through DRM. Does that work for everyone?
Anyone? I can ask around for reviews on DRM, but I'd really like some
reviews on the clock patches here..
On Fri, Sep 24, 2021 at 09:40:44AM +0200, Maxime Ripard wrote:
quoted
Hi,
On Wed, Sep 22, 2021 at 02:54:14PM +0200, Maxime Ripard wrote:
quoted
Hi,
Here's another attempt at fixing the complete CPU stall while retrieving the
HDMI connector status when the connector is disabled.
This was fixed already, but eventually got reverted by Linus due to the same
symptom happening in another situation. This was likely (but not confirmed by
the reporter) due to the kernel being booted without an HDMI display connected,
in which case the firmware won't initialise the HDMI State Machine clock.
This is fixed by patch 3. However, further changes in the clock drivers were
needed for clk_set_min_rate to be used, which are patches 1 and 2.
Finally, patches 4 and 5 are the original patches that were reverted. Patch 4
got a small modification to move the clk_set_min_rate() call before the HSM
clock is enabled.
If we merge the clock patches and DRM patches separately we're going to
break bisectability. I guess the easiest approach would be to merge the
clk patches through DRM. Does that work for everyone?
Anyone? I can ask around for reviews on DRM, but I'd really like some
reviews on the clock patches here..
From: Maxime Ripard <hidden> Date: 2021-10-13 12:59:34
On Wed, 22 Sep 2021 14:54:15 +0200, Maxime Ripard wrote:
The driver currently tries to pick the closest rate that is lower than
the rate being requested.
This causes an issue with clk_set_min_rate() since it actively checks
for the rounded rate to be above the minimum that was just set.
Let's change the logic a bit to pick the closest rate to the requested
rate, no matter if it's actually higher or lower.
[...]
From: Maxime Ripard <hidden> Date: 2021-10-13 12:59:35
On Wed, 22 Sep 2021 14:54:16 +0200, Maxime Ripard wrote:
The driver, once it found a divider, tries to round it up by increasing
the least significant bit of the fractional part by one when the
round_up argument is set and there's a remainder.
However, since it increases the divider it will actually reduce the
clock rate below what we were asking for, leading to issues with
clk_set_min_rate() that will complain that our rounded clock rate is
below the minimum of the rate.
[...]
From: Maxime Ripard <hidden> Date: 2021-10-13 12:59:35
On Wed, 22 Sep 2021 14:54:17 +0200, Maxime Ripard wrote:
When the firmware doesn't setup the HSM rate (such as when booting
without an HDMI cable plugged in), its rate is 0 and thus any register
access results in a CPU stall, even though HSM is enabled.
Let's enforce a minimum rate at boot to avoid this issue.
[...]
From: Maxime Ripard <hidden> Date: 2021-10-13 12:59:36
On Wed, 22 Sep 2021 14:54:18 +0200, Maxime Ripard wrote:
In order to access the HDMI controller, we need to make sure the HSM
clock is enabled. If we were to access it with the clock disabled, the
CPU would completely hang, resulting in an hard crash.
Since we have different code path that would require it, let's move that
clock enable / disable to runtime_pm that will take care of the
reference counting for us.
[...]
From: Maxime Ripard <hidden> Date: 2021-10-13 12:59:38
On Wed, 22 Sep 2021 14:54:19 +0200, Maxime Ripard wrote:
If the HPD GPIO is not available and drm_probe_ddc fails, we end up
reading the HDMI_HOTPLUG register, but the controller might be powered
off resulting in a CPU hang. Make sure we have the power domain and the
HSM clock powered during the detect cycle to prevent the hang from
happening.
[...]