Re: [PATCH 0/2] usb: typec: tcpm: improve handling of DISCOVER_MODES failures
From: Badhri Jagan Sridharan
Date: Tue Feb 17 2026 - 21:37:29 EST
On Fri, Feb 13, 2026 at 11:48 AM Sebastian Reichel
<sebastian.reichel@xxxxxxxxxxxxx> wrote:
>
> UGREEN USB-C Multifunction Adapter Model CM512 (AKA "Revodok 107")
> exposes two SVIDs: 0xff01 (DP Alt Mode) and 0x1d5c. The DISCOVER_MODES
> step succeeds for 0xff01 and gets a NAK for 0x1d5c. Currently this
> results in DP Alt Mode not being registered either, since the modes
> are only registered once all of them have been discovered. The NAK
> results in the processing being stopped and thus no Alt modes being
> registered.
>
> Improve the situation by handling the NAK gracefully and continue
> processing the other modes.
>
> The second patch moves the discover modes handling for ACK and NAK cases
> into its own function to avoid code duplication and having less code in
> total. If this is considered cleaner, I can send a v2 with it squashed
Thanks for sending the fix for this issue Sebastian !
Although the argument list is long, moving it to its own function
makes sense to avoid code duplication.
Feel free to send out the v2 as the squashed patch.
Also, when you send the v2, can you include the TCPM log stubs in the
commit message, both with and without the fix?
I am also leaving some comments for "usb: typec: tcpm: create helper
function for DISCOVER_MODES" which perhaps we can sort out before
sending out v2.
Regards,
Badhri
>
> into the first patch. I've not done so in v1, so that you can see both
> versions as I'm not sure which one is better. So far the processing
> logic is fully contained within tcpm_pd_svdm(), which would no longer
> be the case after the new function is added. Also the function itself
> is quite ugly with the huge amount of arguments.
>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
> ---
> Sebastian Reichel (2):
> usb: typec: tcpm: improve handling of DISCOVER_MODES failures
> usb: typec: tcpm: create helper function for DISCOVER_MODES
>
> drivers/usb/typec/tcpm/tcpm.c | 99 +++++++++++++++++++++++++++----------------
> 1 file changed, 63 insertions(+), 36 deletions(-)
> ---
> base-commit: 05f7e89ab9731565d8a62e3b5d1ec206485eeb0b
> change-id: 20260213-tcpm-discover-modes-nak-fix-09070bb529c5
>
> Best regards,
> --
> Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
>