From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796044097; b=XAKVcJnA/XV4Uox9/98qiE5FwBloIUUhHwQ8aznmpsBZL+XN+2VBzWfrnH+thlRy6kZy xY4BXZaQekV499M8PNxvYljTGe3kKhbEN6sZufjL+AxwmUSS8FrJtCZZeO+8XwoxxoR3Y 6LJirpTUcn7FihMPuRBXZ5hGDkqive8E9jt0tsdNAh/hvMnH9UjbWQ4p/JzXrFxOKsUQ3 P+jzokWnGqFsP+pVdegWKzbG5kKB/5Afpvlxqt1Panw/nTDljDn8jJwtqGPPxYjK64hfT D/7cY0lWUWRw0VpObRkl4cO1v1n3fMWAEugAGeGXQ3kSbroJ2B6avbxocAMKzOh9EoQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796044097; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=z5fp1gEYs6msfjlxCZkcGpobguvM7SjxHSzuqV9LyOc=; b=ILwIJR5dwL69k3RYIvVoiruVr3QP1oBpNdN1YMf1OHLrVWdzeuAu9ZazcaSAfwEyb6ey o/u6WSNsKy74PJcQo0MRjlGcceCS5KRM/0cOmqk9gyXGQTC4VKUCp0LxSbslhp3/4Y2wY WBEdRDuDJLQJQohfcJJRFn961EP9K/qApSC+DGfa8m6zf5INfaHwhtcNErQkNhGQyiJ3r aYbgGMMBM5Pv9JdajNHDTbH87ZDTHgSWLpnGl1h4lCaCMHPeFA26VD1o2rOgXRN7t89bu whqeSJfbX56zGPiopb/JZQo8SbbsJT0PLSTaqw8QqkrIZ57S4dyscQsNju5ktkhN5IQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bBZXXU4r; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C837D606A320 for ; Mon, 30 Nov 2026 13:08:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bBZXXU4r Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DE051F0092B; Mon, 30 Nov 2026 13:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796044097; bh=z5fp1gEYs6msfjlxCZkcGpobguvM7SjxHSzuqV9LyOc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=bBZXXU4rAH0wtSvoMAMn7LDFVxzINAlfyDLpI85JNqtH9dGmQ5G0bHgqliAeWu80T EDs1kb1coPsuo2ISoXDCNLdBlJRtKR58xkk0+vMN3XpHiI7Xur4d2FpvcvKbGwgNPe DcPtYnVEa/24HAVKrSp1SHxkOuxQu9Cn34EmGdgTpOQkzJQIyCKOjxN5gpg7jTxlP7 W3iA1ZB1Shq48EAyYhvAXl7pdDxBL1kx1yDjFyOsWlEpgQhJfV/s+l5M6TRkDwI3DY rg3E4q/zh94KR49hAm2t5T2tGyzyTPTZf/lAitczUkTIy6GXQcauIiOw4w53bgsNJQ RB+7qdJ3pZ0nw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] usb: typec: tipd: cancel the poll work on probe error Reply-To: sashiko-reviews@lists.linux.dev To: "Cong Nguyen" Cc: linux-usb@vger.kernel.org In-Reply-To: <20261130125448.2300198-1-congnt264@gmail.com> References: <20261130125448.2300198-1-congnt264@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 13:08:17 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] usb: typec: tipd: tps6598x_probe() queues wq_poll after connect() error -- commit d10e175d4dc048ad0066d5eb5967c060b86270e0 Author: Cong Nguyen usb: typec: tipd: cancel the poll work on probe error This commit cancels tps->wq_poll on the err_disconnect error path in tps6598x_probe() when running in polling mode. > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c > index 02539378ffeda..991d42e35777a 100644 > --- a/drivers/usb/typec/tipd/core.c > +++ b/drivers/usb/typec/tipd/core.c > @@ -1928,6 +1928,8 @@ static int tps6598x_probe(struct i2c_client *client) > return 0; > =20 > err_disconnect: > + if (!client->irq) > + cancel_delayed_work_sync(&tps->wq_poll); > tps6598x_disconnect(tps, 0); > err_unregister_port: > tps->data->unregister_port(tps); [Severity: Medium] Why queue tps->wq_poll when ret is already non-zero, only to immediately jump to err_disconnect and cancel it? drivers/usb/typec/tipd/core.c:tps6598x_probe() { ... ret =3D tps->data->connect(tps, status); if (ret) dev_err(&client->dev, "failed to register partner\n"); } if (client->irq) { ret =3D devm_request_threaded_irq(&client->dev, client->irq, NULL, tps->data->irq_handler, IRQF_SHARED | IRQF_ONESHOT, dev_name(&client->dev), tps); } else { dev_dbg(tps->dev, "no IRQ specified, using polling mode\n"); INIT_DELAYED_WORK(&tps->wq_poll, tps6598x_poll_work); queue_delayed_work(system_power_efficient_wq, &tps->wq_poll, msecs_to_jiffies(POLL_INTERVAL)); } if (ret) goto err_disconnect; ... } In IRQ mode, devm_request_threaded_irq() overwrites ret from tps->data->connect(), so an initial partner registration error is logged and probe succeeds. In polling mode, nothing after queue_delayed_work() sets ret or jumps to err_disconnect, so a connect() failure queues tps->wq_poll, immediately cancels it, and fails the controller probe. Checking ret inside the if (client->irq) block (or before it if connect() failures are meant to be fatal in both modes) would avoid queuing and immediately canceling tps->wq_poll. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130125448.2300= 198-1-congnt264@gmail.com?part=3D1