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=1796386109; b=ByM3t3NuKr3CnN9a1JHqR269gyjwhOjCgLQBp/TrEMF5w3SWUSoTmiWO8bKzrNE2kSVx G4XW59EK24u3/vtLbOueOuR+L0/DCQrTXcuKYoDuXBESGHogYZ9GKqmQpYvDWKqfksMgK SraOHXbzSiV3busv25ndmRHXwq4keR14wGil37Nt0bNYfBtk+2jbyrWQGG1y5FzLn4zRy m3BRlBECMLJ/PItYaMs5KrpQRP5nfdB+rewMeEwXRl+T1Y9Uc2JJLGm67v08kw3ck41XU qQraLY6uYnZPMZYfh12wCYn/jE9GRK0d8TDp+/68lUH/tJoURmK5+KLhwAVMBLEHEaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386109; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=31fdODAwoeHz2VjK68dMJFYpJbYqPk71QZzwdZdp1lM=; b=qjSYcD48t6bHeHiyCNevdxsExpKGXKhS79Jg+mXeqMX6uK6m1yQLQNxmOCc4Uj5GsiCk xRU+knR28GEGEWFMhufyjJ/CX1YcusCP6iM+kwwRiN+jSbDP93T/YhsiiUnLcn6dFyHrA BnV+MKlSBpRMolDrEPGZh44GGrXXpkDtTHYiEXEFREwHIZK9W82BFa/64weFbMyCkXFlO 9iq8F/cKSQ+temdjRiJMkemiXrOWBUtQoiup+Dt/EI5Uqo9y0nXMwBXQiGO90Hpd81Dav oRPgCJCf0Qs8hrrnlFVGcrRLHYuHL4QTsPS/mVkD0Y3fjODAMssQDVgkr0gMvKmWPhg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Wgd8+AsA; 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 10254606A322; Fri, 4 Dec 2026 12:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Wgd8+AsA Received: by smtp.kernel.org (Postfix) with ESMTPSA id 875311F000C2; Fri, 4 Dec 2026 12:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386108; bh=31fdODAwoeHz2VjK68dMJFYpJbYqPk71QZzwdZdp1lM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Wgd8+AsAz6VvGc1RFRrkeu9rlHtUa81ErtNXgJsS7AfFkSZ7NWc3M+2z3rSbCJ3g+ V2YaioDbzODw6HabWeUOtItTlrTdgcKXCO+GDaiFIk2g72YEIM43/G+qTTOxgAOeH1 HeaDDWboEqoZf96LIQIH1OHAP6L+OdrXgAdfYwvE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bryan ODonoghue , Fan Wu , Heikki Krogerus , Dickson Wu , Sasha Levin , stable Subject: [PATCH 6.6 0831/1167] usb: typec: qcom-pmic-typec: drain cc_debounce_dwork if port_start() fails Date: Fri, 4 Dec 2026 19:04:18 +0900 Message-ID: <20261204100723.767644808@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Fan Wu commit c9273c83885835dbd1e8835d5665dfb8503d65e0 upstream. cc_debounce_dwork can be queued before port_start() fails: tcpm_register_port() runs first, and its state machine may invoke set_cc() or start_toggling() from the TCPM worker. The error path then calls tcpm_unregister_port(), whose worker flush may queue the delayed work before devres frees pmic_typec_port. Disable and drain the delayed work directly at port_start()'s error exit. Do not use port_stop() for this path: its IRQs use IRQF_NO_AUTOEN and are enabled only after a successful port_start(). This issue was found by an in-house static analysis tool. Fixes: a4422ff22142 ("usb: typec: qcom: Add Qualcomm PMIC Type-C driver") Cc: stable # v6.10+ Suggested-by: Bryan O'Donoghue Assisted-by: Codex:gpt-5.6 Signed-off-by: Fan Wu Acked-by: Heikki Krogerus Link: https://patch.msgid.link/20260820135307.153773-3-fanwu01@zju.edu.cn Signed-off-by: Greg Kroah-Hartman [ adapted to 6.6.y: call the port's debounce shutdown helper ] Signed-off-by: Dickson Wu Signed-off-by: Sasha Levin --- drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c index f0e5e8ab06c04..8e6507ce895f1 100644 --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c @@ -502,6 +502,9 @@ int qcom_pmic_typec_port_start(struct pmic_typec_port *pmic_typec_port, enable_irq(pmic_typec_port->irq_data[i].irq); done: + if (ret) + qcom_pmic_typec_port_disable_debounce(pmic_typec_port); + return ret; } -- 2.53.0