linux-yocto/drivers/soc/qcom
Johan Hovold a8ec526969 soc: qcom: pmic_glink_altmode: fix spurious DP hotplug events
commit 5090ac9191 upstream.

The PMIC GLINK driver is currently generating DisplayPort hotplug
notifications whenever something is connected to (or disconnected from)
a port regardless of the type of notification sent by the firmware.

These notifications are forwarded to user space by the DRM subsystem as
connector "change" uevents:

    KERNEL[1556.223776] change   /devices/platform/soc@0/ae00000.display-subsystem/ae01000.display-controller/drm/card0 (drm)
    ACTION=change
    DEVPATH=/devices/platform/soc@0/ae00000.display-subsystem/ae01000.display-controller/drm/card0
    SUBSYSTEM=drm
    HOTPLUG=1
    CONNECTOR=36
    DEVNAME=/dev/dri/card0
    DEVTYPE=drm_minor
    SEQNUM=4176
    MAJOR=226
    MINOR=0

On the Lenovo ThinkPad X13s and T14s, the PMIC GLINK firmware sends two
identical notifications with orientation information when connecting a
charger, each generating a bogus DRM hotplug event. On the X13s, two
such notification are also sent every 90 seconds while a charger remains
connected, which again are forwarded to user space:

    port = 1, svid = ff00, mode = 255, hpd_state = 0
    payload = 01 00 00 00 00 00 00 ff 00 00 00 00 00 00 00 00

Note that the firmware only sends on of these when connecting an
ethernet adapter.

Fix the spurious hotplug events by only forwarding hotplug notifications
for the Type-C DisplayPort service id. This also reduces the number of
uevents from four to two when an actual DisplayPort altmode device is
connected:

    port = 0, svid = ff01, mode = 2, hpd_state = 0
    payload = 00 01 02 00 f2 0c 01 ff 03 00 00 00 00 00 00 00
    port = 0, svid = ff01, mode = 2, hpd_state = 1
    payload = 00 01 02 00 f2 0c 01 ff 43 00 00 00 00 00 00 00

Fixes: 080b4e2485 ("soc: qcom: pmic_glink: Introduce altmode support")
Cc: stable@vger.kernel.org	# 6.3
Cc: Bjorn Andersson <andersson@kernel.org>
Reported-by: Clayton Craft <clayton@craftyguy.net>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Acked-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Tested-by: Clayton Craft <clayton@craftyguy.net>
Link: https://lore.kernel.org/r/20250324132448.6134-1-johan+linaro@kernel.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-27 11:11:22 +01:00
..
apr.c
cmd-db.c
icc-bwmon.c
ice.c
Kconfig
kryo-l2-accessors.c
llcc-qcom.c
Makefile
mdt_loader.c
ocmem.c
pdr_interface.c
pdr_internal.h
pmic_glink_altmode.c
pmic_glink.c
pmic_pdcharger_ulog.c
pmic_pdcharger_ulog.h
qcom_aoss.c
qcom_gsbi.c
qcom_pd_mapper.c
qcom_pdr_msg.c
qcom_stats.c
qcom-geni-se.c
qcom-pbs.c
qmi_encdec.c
qmi_interface.c
ramp_controller.c
rmtfs_mem.c
rpm_master_stats.c
rpm-proc.c
rpmh-internal.h
rpmh-rsc.c
rpmh.c
smd-rpm.c
smem_state.c
smem.c
smp2p.c
smsm.c
socinfo.c
spm.c
trace_icc-bwmon.h
trace-aoss.h
trace-rpmh.h
trace-smp2p.h
wcnss_ctrl.c