Re: [PATCH] usb: typec: ucsi_ccg: Don't probe GPUs without a CCGx controller

From: Heikki Krogerus

Date: Tue Nov 17 2026 - 06:30:07 EST


On Fri, Nov 13, 2026 at 05:32:43PM -0800, Hex Lindqvist wrote:
> The NVIDIA GPU I2C driver adds a ccgx-ucsi client on every GPU, but
> GPUs without a USB Type-C port, such as the GTX 1660 Ti, have no CCGx
> controller, and every probe fails with:
>
> ucsi_ccg 4-0008: i2c_transfer failed -110
> ucsi_ccg 4-0008: ucsi_ccg_init failed - -110
> ucsi_ccg 4-0008: probe with driver ucsi_ccg failed with error -110
>
> Fix this by reading DEVICE_MODE first for clients created by the GPU
> driver, and returning -ENODEV if the read times out. Controllers
> described by firmware are not affected.
>
> Tested on an ASUS TUF Gaming A17 (FA706IU, GTX 1660 Ti): the three
> errors are gone, probe takes the same time (one timed-out transfer, as
> before), and the platform's own UCSI port and suspend/resume are not
> affected.
>
> Assisted by LLM.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=206653
> Link: https://lore.kernel.org/all/20200922054338.GA588161@xxxxxxxxx/
> Signed-off-by: Hex Lindqvist <hex@xxxxxxxxxxxxx>

Reviewed-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>

> ---
> The nvidia-gpu timeout line is fixed by a separate patch to linux-i2c.
>
> Not tested on a GPU with a CCGx controller; there this adds one
> DEVICE_MODE read before ucsi_ccg_init().
>
> drivers/usb/typec/ucsi/ucsi_ccg.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c
> index 3f12db95c7f4..0f082952272e 100644
> --- a/drivers/usb/typec/ucsi/ucsi_ccg.c
> +++ b/drivers/usb/typec/ucsi/ucsi_ccg.c
> @@ -357,6 +357,31 @@ static int ccg_op_region_update(struct ucsi_ccg *uc, u32 cci)
> return 0;
> }
>
> +/* GPUs without a USB Type-C port have no CCGx; transfers to it time out. */
> +static bool ccg_is_present(struct ucsi_ccg *uc)
> +{
> + struct i2c_client *client = uc->client;
> + unsigned char buf[2];
> + u8 data;
> + struct i2c_msg msgs[] = {
> + {
> + .addr = client->addr,
> + .len = sizeof(buf),
> + .buf = buf,
> + },
> + {
> + .addr = client->addr,
> + .flags = I2C_M_RD,
> + .len = sizeof(data),
> + .buf = &data,
> + },
> + };
> +
> + put_unaligned_le16(CCGX_RAB_DEVICE_MODE, buf);
> +
> + return i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs)) != -ETIMEDOUT;
> +}
> +
> static int ucsi_ccg_init(struct ucsi_ccg *uc)
> {
> unsigned int count = 10;
> @@ -1488,6 +1513,11 @@ static int ucsi_ccg_probe(struct i2c_client *client)
> dev_err(uc->dev, "failed to get FW build information\n");
> }
>
> + if (uc->fw_build == CCG_FW_BUILD_NVIDIA && !ccg_is_present(uc)) {
> + dev_dbg(dev, "no CCGx controller on this GPU\n");
> + return -ENODEV;
> + }
> +
> /* reset ccg device and initialize ucsi */
> status = ucsi_ccg_init(uc);
> if (status < 0) {
>
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
> --
> 2.56.0

--
heikki