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=1795973209; b=o5uQI7dYaaXia8nE4J74JuUCjsYCfaza4Pl8vP+fu+k0X8Z80HCX2qzAwyroNySL4dTF vZt5YWuGH2bwVgr/QOqS44JSXEvSobJdzL567AuGzK0GwNh5KBa77DXP9d1BIlGnl1k8l FSjsDeCyhQlA2RwHkmgjmHE/p/ZcGYCi8BtlhxhLyxalPMEWhMYm8Lb77/nsCctpQdgeZ uw7T6stEi8lqz03DqulTEz3n+CPF3Tlsi0rPxzvouEJwDSI01MomGndUpyDaKlMOTYkTh /tRlOXMRlC5GXO1JRlclgmAjgmlIsXSSydMBX3LwvBx0Ll7mpV74YjnXw51NTSBX2jw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795973209; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=YzEFJzEBsUbAUUAtUJXpts/fbVmyUaATVO2yVEU2YgQ=; b=nMCp8sJ7c92E8aAyVMQHsC80DyQKtJLK9Yf5yxCvQA4XVQeWRpqpH8HXXveuQ0K9cO+5 CSFW+VqaPwnXBr3NRlSjCHU+daiWgduWPY3amxDj3tQxtVNixyDwIjRKabD/BjXAjok24 klUZ9L1M9QhgMnxn9IPV2KsWAgh/ILVy7Rd8Vo4lw0b1obbEaOWG+3XmTVzdZztYDHudb qolmITAQaiCIAlk6/cJbHYshkrrO/uBP3bmAZ1YYTGrSxBPA2FAAb6Zv6vVBq4D8veWQ1 JzbbdNp22u1LTRUWF/LSvYOq32QfERCpcQFFW9rBlCJjc4dm8T02jh4dzvDR5+KT8WA== 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=IjTE+PAM; 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 706A1606A31C for ; Sun, 29 Nov 2026 17:26:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IjTE+PAM Received: by smtp.kernel.org (Postfix) with ESMTPSA id D898C1F00896; Sun, 29 Nov 2026 17:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795973209; bh=YzEFJzEBsUbAUUAtUJXpts/fbVmyUaATVO2yVEU2YgQ=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=IjTE+PAMGgD3SHgwlbkgKqtnUoYOuA9+S0RFi6XccelNiBznMt1LxWOcNlGuXwwek hGB+qzWq1KH/hh2yqPKgfZHi3mMb9JLG/bC4vUhYd1DhsdAouJvkY6DBtrP2MZ3mMX /HUHJFx3cYkyeymIUE1+Lpo/oprkIOikrjP4owGKxOc0C1SQeMhkpmtY1TYJht2rRa UeV0nTGNDLqVmOdl2YNIOcF/TSJ0exJnbcM5isHSVm62jUwUtUVCsbfZlqTbRLWRMg itlD9Gm/dsf+45PH0Cdj7WyPC72QKRqkkOQNqiuVAS6sw6tN46ujbXvxrv/KRL+Ag1 H0WFrn8lR1WlQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/2] extcon: ptn5150: Make CON_DET configurable Reply-To: sashiko-reviews@lists.linux.dev To: "Marek Vasut" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261129171935.280160-2-marek.vasut+renesas@mailbox.org> References: <20261129171935.280160-1-marek.vasut+renesas@mailbox.org> <20261129171935.280160-2-marek.vasut+renesas@mailbox.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sun, 29 Nov 2026 17:26:48 +0000 X-Mailing-List: devicetree@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: - [Low] extcon: ptn5150: unchecked regmap_clear_bits() return in ptn5150_i2c_probe() It also noticed 1 related pre-existing issue this patch does not introduce: - [Critical] extcon: ptn5150: orient_sw leak and irq_work race in ptn5150_i2c_probe() [1] -- commit aeab3d399b32bd1935fe640269c15aa72b9b637c Author: Marek Vasut extcon: ptn5150: Make CON_DET configurable This commit adds support for the "nxp,con-det-enable" boolean property to enable the CON_DET output signal on the PTN5150 chip during probe. > diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5= 150.c > index eca1b140aeb0f..7d462680dd88e 100644 > --- a/drivers/extcon/extcon-ptn5150.c > +++ b/drivers/extcon/extcon-ptn5150.c [ ... ] > @@ -362,6 +363,11 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c) > if (ret) > return ret; [Severity: Critical] This problem wasn't introduced by this patch, but registering ptn5150_work_sync_and_put() via devm_add_action_or_reset() here is ordered after devm_request_threaded_irq() and after acquiring info->orient_sw [1]: drivers/extcon/extcon-ptn5150.c:ptn5150_i2c_probe() { ... ret =3D devm_request_threaded_irq(dev, info->irq, NULL, ptn5150_irq_handler, ...); ... if (connector) { info->orient_sw =3D fwnode_typec_switch_get(connector); if (IS_ERR(info->orient_sw)) return dev_err_probe(...); } info->role_sw =3D usb_role_switch_get(info->dev); if (!info->role_sw && connector) info->role_sw =3D fwnode_usb_role_switch_get(connector); if (IS_ERR(info->role_sw)) return dev_err_probe(...); ret =3D devm_add_action_or_reset(dev, ptn5150_work_sync_and_put, info); ... } Because devres runs teardown actions in reverse order, could an interrupt fire after ptn5150_work_sync_and_put() runs and before the IRQ is freed? CPU0 CPU1 ptn5150_work_sync_and_put() cancel_work_sync(&info->irq_work) usb_role_switch_put(info->role_sw) typec_switch_put(info->orient_sw) ptn5150_irq_handler() schedule_work(&info->irq_work) devm_irq_release() devm kfree(info) ptn5150_irq_work() mutex_lock(&info->mutex) <-- use-after-free In addition, if acquiring info->role_sw fails, probe returns before ptn5150_work_sync_and_put() is registered, leaking info->orient_sw and leaving any already-scheduled info->irq_work uncanceled. > + > + if (device_property_present(&i2c->dev, "nxp,con-det-enable")) { > + regmap_clear_bits(info->regmap, PTN5150_REG_CON_DET, > + PTN5150_REG_CON_DET_DIS); > + } [Severity: Low] Should the return value of regmap_clear_bits() be checked and propagated? If the I2C transfer fails, probe will succeed with CON_DET still disabled. [1] https://sashiko.dev/#/bug/linux-475a50da-a64e-4ed0-a654-d7f65166df20 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261129171935.2801= 60-1-marek.vasut+renesas@mailbox.org?part=3D2