From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AD52606A32C for ; Tue, 1 Dec 2026 04:19:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=pZU/RZYe; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=KdeLbAqO DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=wNaDgxxU8IFify8luL/kmcUGOwE42h1TaxH2CDU34lE=; b=pZU/RZYevqQFtuLawynDYxkuaU LKG09Q7tePYLwfs8izNqTqv/MMiSDDFCmaevxW+Y3U53vmu40Z9a1CGsl9jrQmIuxH9hvPX/40Cbx SCq4FwvhMIH5ER5iP8QOnZ6DiAEjwJ680hCBKh/avFe4WRPUWtuwan/nOq0ZzQkAYdIEtySP7rMVW SydWIiX4tMePkFhn3l5YjM8o/NYRHX0aqeB2D8cO8Hw1mjmYxMx/DRqJhhr3nPMX+dPMAvL3NLNlY snexmZW3ziEhWefEdyr4o/xXgQRhRPYXG3+Uld3NgyIgR9TWhnatj6ZMrkQ7bstVuALqPpA/4+IK1 uSsI5yQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYFL8-00000006Viu-3rho; Tue, 01 Dec 2026 04:19:38 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYFL7-00000006Vi9-0GY7 for linux-phy@lists.infradead.org; Tue, 01 Dec 2026 04:19:38 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2f0634667aaso43688025ad.0 for ; Mon, 30 Nov 2026 20:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796098776; x=1796703576; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=kRC39BuigG9FG5V/UUuMl7xliddc44quTUNp8b03qiE=; b=KdeLbAqOhsS9HCyi30o1uCDyLNFhjn+YWpqGvc0JzHwf0hWXZCdHWf8LagvFE26254 Ejy01eTIRBKQy5Koez5WEisnqbR9mx/RRSiIscMpcVGmyyroHqyKgbiQNCdB1FcxFzhM 7qGVgbxTQDoWBCD/EgAPQI8JERPSsYjFsNRQaQPaJ9S2uQd/DKFewV/UFRt1TmK2sBIZ pxapMFHvJlTLufmgydNa8jSOtXQooACj4u8S0RNH8Mk5F67hneW0SNHck/Lpz2HZcsZR W20wHuFmgNGatZ0JkRNevzXqI6gr7V97LADhcGRriuM/hII2onyhYy2zF1bhRW/7qiNe CmtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796098776; x=1796703576; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kRC39BuigG9FG5V/UUuMl7xliddc44quTUNp8b03qiE=; b=SZBlDj7iHysegedW7Vo7ymZG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xitUANITRudzA QoAp4tL5Yu0XXHDQebSQ6nFZI2elzTL64lmVC6n1nNCWTxuSWucSM5p8vZfVZ0fHz0HxGcY5aC9 wdXSVGUjLH8M3EilLhrwl71vFEWNVDCpDQehEkoqRC7CQJk= X-Received: by 2002:a17:902:f54c:b0:2e3:643:279b with SMTP id d9443c01a7336-2f03f1ed636mr265654625ad.31.1796098775663; Mon, 30 Nov 2026 20:19:35 -0800 (PST) Received: from SGN-LDSENG.tasernet.com ([2405:4800:5cc3:11a:1ac0:4dff:fe8b:4a69]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f03ee84364sm178067075ad.5.2026.11.30.20.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 20:19:35 -0800 (PST) From: Cong Nguyen To: Vinod Koul Cc: Neil Armstrong , Manivannan Sadhasivam , Tony Lindgren , linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] phy: mapphone-mdm6600: cancel delayed work on probe error Date: Tue, 1 Dec 2026 11:19:28 +0700 Message-Id: <20261201041928.3163542-1-congnt264@gmail.com> X-Mailer: git-send-email 2.25.1 X-Archived-By: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261130_201937_103359_3F2A8D6A X-CRM114-Status: GOOD ( 11.30 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 phy_mdm6600_probe() queues bootup_work before it can fail, and the status IRQ and runtime resume queue status_work and modem_wake_work. If a later step fails, nothing cancels them, and they can run after the devres-managed ddata is freed. Use devm_delayed_work_autocancel() for the three works. It is set up before the devm IRQs, so devres frees the IRQs first and cancels the works after, and the IRQ handlers cannot queue them again. Fixes: 2ad2af081622 ("phy: mapphone-mdm6600: Improve phy related runtime PM calls") Signed-off-by: Cong Nguyen --- Changes in v2: - Use devm_delayed_work_autocancel() instead of cancelling by hand in the probe error path. The devm IRQs can still queue status_work after a manual cancel (Sashiko review of v1). drivers/phy/motorola/phy-mapphone-mdm6600.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c index ff364a990187..cbe05f8984e8 100644 --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -561,10 +562,21 @@ static int phy_mdm6600_probe(struct platform_device *pdev) if (!ddata) return -ENOMEM; - INIT_DELAYED_WORK(&ddata->bootup_work, - phy_mdm6600_deferred_power_on); - INIT_DELAYED_WORK(&ddata->status_work, phy_mdm6600_status); - INIT_DELAYED_WORK(&ddata->modem_wake_work, phy_mdm6600_modem_wake); + error = devm_delayed_work_autocancel(&pdev->dev, &ddata->bootup_work, + phy_mdm6600_deferred_power_on); + if (error) + return error; + + error = devm_delayed_work_autocancel(&pdev->dev, &ddata->status_work, + phy_mdm6600_status); + if (error) + return error; + + error = devm_delayed_work_autocancel(&pdev->dev, &ddata->modem_wake_work, + phy_mdm6600_modem_wake); + if (error) + return error; + init_completion(&ddata->ack); ddata->dev = &pdev->dev; -- 2.25.1 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy