Thank you for your contribution! Sashiko AI review found 2 potential issue(s) 
to consider:
- [Medium] The `ignore_rxsense` flag is applied too late in the IRQ handler, 
breaking CEC physical address invalidation and PHY power-down on hotplug 
disconnect.
- [Low] The commit introduces a new device tree property `ignore-rxsense` 
without providing the corresponding YAML binding update.
--

commit daf606cf171e0645fecfea5f019e9fab9dd7eb6f
Author: Ian Ray <[email protected]>

drm/bridge: dw-hdmi: optionally ignore rxsense when detecting hotplug

This commit introduces a new optional device tree property 'ignore-rxsense'
to bypass the rxsense state during hotplug detection. It is designed to
handle boards where rxsense is always active, such as when an HDMI to DP
converter is used.

> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 17d5caedb32e0..5e8f56fba8e96 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c

[ ... ]

> @@ -3156,6 +3157,9 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id)
>               if (phy_stat & HDMI_PHY_HPD)
>                       status = connector_status_connected;
>  
> +             if (hdmi->ignore_rxsense)
> +                     phy_stat &= ~HDMI_PHY_RX_SENSE;
> +

[Severity: Medium]
Is this modification applied too late in the interrupt handler?

Earlier in dw_hdmi_irq(), the raw phy_stat is passed to
dw_hdmi_setup_rx_sense():

                dw_hdmi_setup_rx_sense(hdmi,
                                       phy_stat & HDMI_PHY_HPD,
                                       phy_stat & HDMI_PHY_RX_SENSE);

When the cable is disconnected on a board where RX_SENSE is stuck high,
feeding the unmodified phy_stat into dw_hdmi_setup_rx_sense() prevents
it from clearing hdmi->rxsense, leaving the PHY incorrectly powered on.

Additionally, the raw phy_stat prevents the CEC invalidation block from
executing on disconnect:

                if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) {
                        mutex_lock(&hdmi->cec_notifier_mutex);
                        cec_notifier_phys_addr_invalidate(hdmi->cec_notifier);

Could the mask be applied to phy_stat earlier in the function, before
it is used by the PHY power management and CEC invalidation logic?

>               if (!(phy_stat & (HDMI_PHY_HPD | HDMI_PHY_RX_SENSE)))
>                       status = connector_status_disconnected;
>       }

[ ... ]

> @@ -3362,6 +3366,8 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device 
> *pdev,
>       mutex_init(&hdmi->cec_notifier_mutex);
>       spin_lock_init(&hdmi->audio_lock);
>  
> +     hdmi->ignore_rxsense = of_property_read_bool(np, "ignore-rxsense");
> +

[Severity: Low]
Is there a corresponding yaml binding update for this new property?

This introduces 'ignore-rxsense' as a new device tree property, but the
commit does not seem to include documentation for it. Missing
documentation makes it difficult for other board developers to know the
property exists and how to use it properly.

>       ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
>       if (ddc_node) {
>               hdmi->ddc = of_get_i2c_adapter_by_node(ddc_node);

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=2

Reply via email to