From: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> commit 4a22918810980897393fa1776ea3877e4baf8cca upstream. UCSI connector's indices start from 1 up to 3, PMIC_GLINK_MAX_PORTS. Correct the condition in the pmic_glink_ucsi_connector_status() callback, fixing Type-C orientation reporting for the third USB-C connector. Fixes: 76716fd5bf09 ("usb: typec: ucsi: glink: move GPIO reading into connector_status callback") Cc: stable@xxxxxxxxxxxxxxx Reported-by: Abel Vesa <abel.vesa@xxxxxxxxxx> Reviewed-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx> Reviewed-by: Johan Hovold <johan+linaro@xxxxxxxxxx> Tested-by: Johan Hovold <johan+linaro@xxxxxxxxxx> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Link: https://lore.kernel.org/r/20241109-ucsi-glue-fixes-v2-1-8b21ff4f9fbe@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/typec/ucsi/ucsi_glink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c index 3e4d88ab338e..2e12758000a7 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -185,7 +185,7 @@ static void pmic_glink_ucsi_connector_status(struct ucsi_connector *con) struct pmic_glink_ucsi *ucsi = ucsi_get_drvdata(con->ucsi); int orientation; - if (con->num >= PMIC_GLINK_MAX_PORTS || + if (con->num > PMIC_GLINK_MAX_PORTS || !ucsi->port_orientation[con->num - 1]) return; -- 2.47.1 Patches currently in stable-queue which might be from dmitry.baryshkov@xxxxxxxxxx are queue-6.11/drm-msm-dpu-cast-crtc_clk-calculation-to-u64-in-_dpu.patch queue-6.11/drm-imx-ipuv3-use-irqf_no_autoen-flag-in-request_irq.patch queue-6.11/drm-fsl-dcu-enable-pixclk-on-ls1021a.patch queue-6.11/drm-bridge-it6505-drop-edid-cache-on-bridge-power-of.patch queue-6.11/drm-imx-add-missing-drm_bridge_connector-dependency.patch queue-6.11/drm-imx-parallel-display-drop-edid-override-support.patch queue-6.11/drm-bridge-tc358767-fix-link-properties-discovery.patch queue-6.11/drm-bridge-anx7625-drop-edid-cache-on-bridge-power-o.patch queue-6.11/arm64-dts-qcom-qcs6390-rb3gen2-use-modem.mbn-for-mod.patch queue-6.11/drm-panel-nv3052c-correct-spi_device_id-for-rg35xx-p.patch queue-6.11/arm64-dts-qcom-sda660-ifc6560-fix-l10a-voltage-range.patch queue-6.11/drm-imx-ldb-switch-to-drm_panel_bridge.patch queue-6.11/arm64-dts-qcom-x1e80100-resize-gic-redistributor-reg.patch queue-6.11/clk-qcom-videocc-sm8550-depend-on-either-gcc-sm8550-.patch queue-6.11/drm-imx-dcss-use-irqf_no_autoen-flag-in-request_irq.patch queue-6.11/rpmsg-glink-use-only-lower-16-bits-of-param2-for-cmd.patch queue-6.11/drm-msm-adreno-use-irqf_no_autoen-flag-in-request_ir.patch queue-6.11/remoteproc-qcom-pas-add-minidump_id-to-sm8350-resour.patch queue-6.11/regulator-qcom-smd-make-smd_vreg_rpm-static.patch queue-6.11/drm-msm-dpu-on-sdm845-move-dspp_3-to-lm_5-block.patch queue-6.11/fbdev-sh7760fb-fix-a-possible-memory-leak-in-sh7760f.patch queue-6.11/arm64-dts-qcom-sc8180x-add-a-soc-specific-compatible.patch queue-6.11/drm-imx-parallel-display-switch-to-drm_panel_bridge.patch queue-6.11/drm-msm-dpu-drop-lm_3-lm_4-on-sdm845.patch queue-6.11/drm-msm-dpu-drop-lm_3-lm_4-on-msm8998.patch queue-6.11/usb-typec-ucsi-glink-fix-off-by-one-in-connector_status.patch queue-6.11/drm-imx-ldb-drop-custom-ddc-bus-support.patch queue-6.11/drm-imx-ldb-drop-custom-edid-support.patch