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=1796379699; b=eVcHRdAMyhw84FL4LqbpJYfZYZvRNpoLB8Ig9I2Qnkker2OEMvM+kt7ZPg2EyF9vJfln 8aMQW6RqlNd+qDUQ4eT3IplCwtTS3oR+G56fk86uBmlf2/nxZieLAvUIKjyM8zVS+0OvX zWSbvC36miw2Z35ffx8izYlH4FSNuscPYC2dLsKamJlG3I+cMfIHJu7qB/iiHzuDq1f3Y yCtAt5rpcESxV/GA52hzrv9dBASB1KqLjf+QOM/8l7Dq3bnEI5F4ASTi6ZTeqhN+SSeg6 eZ+BXqdXCNMcjBkYzwvMUDBhPN9szYsjPS2/UTEnIKPtH3mP2Yfr30TKd+AOQByLvcA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379699; 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=p9uhYxmm2AOY7Og0hdJw6E65TYKE8ctKrf62fiS3CdY=; b=Hh1f1+7hp6QG4fqm70eSE2AoDcsGJC4OpG2P4qqZuTYOaY0o1PJXRuOt6jYcxGox9hHW G29rvcfBpB5LSeA0KfI/WBVUWzCX/ZZIKG+CBaJPxkqR5knsP7lr0pQaemPYNy/8ndbYQ xIzH6rN5qfsrFDozUGAm0M0cpikFl7fuajnJmuU+0MdudzjtRRSriZQwUJ33mQhJjE64v BsyqtX1tSp9X7W2novAHlZnyqjOukTZ7EyaYw68IbGdU7SARBRRMmZnkaZM5HRYOGPrhQ Z50R0sKVBaQ162PMCn88lvWvoBBZjqCE/3Ae/+3Bl/dDHkJnj1LshUeycrbQVCVEE0Q== 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=u+GWdvhm; 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 99618606A322; Fri, 4 Dec 2026 10:21:39 +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=u+GWdvhm Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11DE41F000C2; Fri, 4 Dec 2026 10:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379699; bh=p9uhYxmm2AOY7Og0hdJw6E65TYKE8ctKrf62fiS3CdY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=u+GWdvhmGQwMTexRrt5VNWkjpY4Hcs3P23aiXgJ8RrgZ3kN8k2Rx10SIjVcS9IRdd XRIo8ndPBzGTTJzYfrTEeSbF4GZtFM/tYAp+MoIcKUobdybyFRj4EcIss6+7PFIYFL AnskbNsLhtsoWce3lpiK2StmiuA54Nis8f+fBXBA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Avi Weiss , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 6.6 0050/1167] gpio: omap: Propagate runtime PM failures in probe and request Date: Fri, 4 Dec 2026 18:51:17 +0900 Message-ID: <20261204100703.369517260@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: patches@lists.linux.dev 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: Avi Weiss [ Upstream commit 05be1a99d6d68b24cbe24a191e1af67c70193ac3 ] pm_runtime_get_sync() can fail when the OMAP PM domain cannot resume a GPIO controller, but omap_gpio_probe() and omap_gpio_request() ignore its return value. Consequently, probe can register a GPIO controller despite a failed resume, while a GPIO request can report success and modify GPIO state even though runtime-PM acquisition failed. Use pm_runtime_resume_and_get() in both paths and propagate resume errors. On probe failure, disable runtime PM and unprepare the debounce clock when applicable. Reproduced both failures on QEMU N800 by injecting -EIO from the OMAP PM-domain resume callback. The original driver continues probe and accepts the GPIO request - while the patched driver rejects both operations with -EIO. Normal GPIO controller registration continues to work without fault injection. Fixes: 77640aabd755 ("OMAP: GPIO: Implement GPIO as a platform device") Fixes: 55b93c32520d ("gpio/omap: use pm-runtime framework") Signed-off-by: Avi Weiss Link: https://patch.msgid.link/20261029103626.1527919-2-thnkslprpt@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpio-omap.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 772fddc02b818..a23b3195af1d1 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -814,8 +814,11 @@ static int omap_gpio_request(struct gpio_chip *chip, unsigned offset) { struct gpio_bank *bank = gpiochip_get_data(chip); unsigned long flags; + int ret; - pm_runtime_get_sync(chip->parent); + ret = pm_runtime_resume_and_get(chip->parent); + if (ret < 0) + return ret; raw_spin_lock_irqsave(&bank->lock, flags); omap_enable_gpio_module(bank, offset); @@ -1466,7 +1469,13 @@ static int omap_gpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, bank); pm_runtime_enable(dev); - pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) { + pm_runtime_disable(dev); + if (bank->dbck_flag) + clk_unprepare(bank->dbck); + return ret; + } if (bank->is_mpuio) omap_mpuio_init(bank); -- 2.53.0