mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Clayton Craft <clayton@craftyguy.net>
To: Johan Hovold <johan+linaro@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] soc: qcom: pmic_glink_altmode: fix spurious DP hotplug events
Date: Mon, 24 Mar 2025 10:05:44 -0700	[thread overview]
Message-ID: <dd1bc01c-75f4-4071-a2ac-534a12dd3029@craftyguy.net> (raw)
In-Reply-To: <20250324132448.6134-1-johan+linaro@kernel.org>

On 3/24/25 06:24, Johan Hovold wrote:
> 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: 080b4e24852b ("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>
> ---
> 
> Clayton reported seeing display flickering with recent RC kernels, which
> may possibly be related to these spurious events being generated with
> even greater frequency.
> 
> That still remains to be fully understood, but the spurious events, that
> on the X13s are generated every 90 seconds, should be fixed either way.

When a display/dock (which has ethernet) is connected, I see this 
hotplug change event 2 times (every 30 seconds) which I think you said 
this is expected now?

> UDEV  [236.150574] change   /devices/platform/soc@0/ae00000.display-subsystem/ae01000.display-controller/drm/card0 (drm)
> UDEV  [236.588696] change   /devices/platform/soc@0/ae00000.display-subsystem/ae01000.display-controller/drm/card0 (drm)
> UDEV  [266.208175] change   /devices/platform/soc@0/ae00000.display-subsystem/ae01000.display-controller/drm/card0 (drm)
> UDEV  [266.644710] change   /devices/platform/soc@0/ae00000.display-subsystem/ae01000.display-controller/drm/card0 (drm)
> UDEV  [296.243187] change   /devices/platform/soc@0/ae00000.display-subsystem/ae01000.display-controller/drm/card0 (drm)
> UDEV  [296.678177] change   /devices/platform/soc@0/ae00000.display-subsystem/ae01000.display-controller/drm/card0 (drm)
> UDEV  [326.276256] change   /devices/platform/soc@0/ae00000.display-subsystem/ae01000.display-controller/drm/card0 (drm)
> UDEV  [326.712248] change   /devices/platform/soc@0/ae00000.display-subsystem/ae01000.display-controller/drm/card0 (drm)

Not sure about you seeing it every 90s vs my 30s... anyways, I no longer 
see these events when a PD charger is connected though, so this patch 
seems to help with that!

Tested-by: Clayton Craft <clayton@craftyguy.net>

  reply	other threads:[~2025-03-24 17:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24 13:24 Johan Hovold
2025-03-24 17:05 ` Clayton Craft [this message]
2025-03-25  8:32   ` Johan Hovold
2025-03-26 14:43     ` Johan Hovold
2025-04-01 18:18       ` Clayton Craft
2025-04-02  7:13         ` Johan Hovold
2025-03-24 19:21 ` Konrad Dybcio
2025-03-25  8:40   ` Johan Hovold
2025-03-25 11:29     ` Konrad Dybcio
2025-05-09 22:13 ` Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd1bc01c-75f4-4071-a2ac-534a12dd3029@craftyguy.net \
    --to=clayton@craftyguy.net \
    --cc=andersson@kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®