Re: [PATCH] usb: typec: mux: Fix typec_switch_match()

From: Jens Glathe

Date: Fri Aug 21 2026 - 15:21:57 EST


Hi Marek,

On 8/18/26 19:43, Marek Vasut wrote:
On 8/18/26 7:05 PM, Jens Glathe wrote:
Hi Marek,

On 8/18/26 18:56, Marek Vasut wrote:
Hello Sebastian,
[...]
Could you revert f576c75f95a5 ("Revert "usb: typec: mux: avoid duplicated mux switches"") and apply the following patch (equivalent to this patch, applies to mux instead of switch) and see if that fixes the T14s for you too then ? If yes, than, I think this might be the proper fix rather than the revert:

diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c
index 4a4297f15aad3..afa6fc1813978 100644
--- a/drivers/usb/typec/mux.c
+++ b/drivers/usb/typec/mux.c
@@ -294,6 +294,8 @@ static void *typec_mux_match(const struct fwnode_handle *fwnode,

        dev = class_find_device(&typec_mux_class, NULL, fwnode,
                                mux_fwnode_match);
+       if (!dev)
+               return ERR_PTR(-EPROBE_DEFER);

        /* Skip duplicates */
        for (i = 0; i < TYPEC_MUX_MAX_DEVS; i++)
@@ -303,7 +305,7 @@ static void *typec_mux_match(const struct fwnode_handle *fwnode,
                }


-       return dev ? to_typec_mux_dev(dev) : ERR_PTR(-EPROBE_DEFER);
+       return to_typec_mux_dev(dev);
 }

 /**

I will test that one with the f576c75f95a5 reverted on the x1p and sc8280xp boxes I have here, let's see. T14s G6 shouldn't be affected either way.

with best regards
Thank you

I did the test: switch patch, revert f576c75f95a5, mux patch. Afterwards let it run on the zoo here... ps883x devices are unaffected and work well, and your proposed mux patch appears to fix the problem with the gpio-sbu-mux, too. So it would be a good idea to do this instead of f576c75f95a5.

Tested on:

Lenovo IdeaCeentre mini 01q8x10 (ps8833)

Lenovo Thinkpad T14s G6 21N1 (ps8830)

Lenovo Ideapad Slim5 14q8x9 (gpio mux)

Lenovo Ideapad 5 2in1 14q8x9 (gpio mux)

Microsoft Windows Dev Kit 2023 (sc8280xp, gpio mux)

Tested-by: Jens Glathe <jens.glathe@xxxxxxxxxxxxxxxxxxxxxx>

with best regards

Jens