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=1796379622; b=T30zAor+7s3ir4zwl9/qpYDbVTy/VfO3m/BCH7VzHkeL0t/XphRlV0qTmbljHqjVSvIi YG7ECj2o2X28Pp/PtsEjnOKDqzMDH6+AJy01MIRjP0v3fZpJ9fKlcf3mshPMXrS2L0UiW 6G8+R6WOsfQmKvOmofKi45ZBwWWDOIoUFO2p1rCs3dbqnbVAJFfQK/QxeOsriZOVE1oiy bTrhMnpbZ26vjjF6HXrDqgjCUKGDqdrOHkYpubbyEiwS+gZCoX+Zx8DRXYcAvzGV8mDyF egKB8jGgEDjkARYhFCSAp6MI0R2s68HMpOk7HPFxQPQxqqGWiSYUKNhjjicR50YURFw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379622; 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=CMHlxITDoD5xYDaLIciVMLtDYWnFgYJ31jb3IytiOAU=; b=XSIO9soKigYpI3IPqXHQgt7CXOURHj8Ie5kErOFRhip1ji8lTf4FiNmcd9waPFCG6UQZ w174NKTVRa/BFxcH+LHihp9J8fXiBTpVpGe5WfUHkTCkJMqCc0Ye8X6FogQHol+mdD1pI 6fYL6ftFcM2lLhRcScaoGdAlbHgP1uG7g7Hqx5/ZwYqEt360exzM+5B/VrQ9BlVOSYgeG sPrCUgg73r8qvcF7ICGx1R4q/axNVMo+poqR1Zq5AdQwnE7X2DTA9chwvQcun3+oanyiG j7KRYru4GSfqDkatc9h0nc2ddumK8hTrBwWAfppC518mTvZmPWsyY/0zmqXJCx8SoMw== 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=PKG7MbQn; 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 983F0606A322; Fri, 4 Dec 2026 10:20:22 +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=PKG7MbQn Received: by smtp.kernel.org (Postfix) with ESMTPSA id D22861F000C2; Fri, 4 Dec 2026 10:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379622; bh=CMHlxITDoD5xYDaLIciVMLtDYWnFgYJ31jb3IytiOAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PKG7MbQnRcKbHuLICH+98RIuGb28hIB4l+DSjLeR/sU0q7uBSGQJjRyLqzEGFUKRA SdEC2N7wNayv+EDLIVcTq+a5aIQPqowY8iq8wHM25hsRRF3FpbRXYOHEmhorLW/Vk0 jtGqHj7koGIpbjiFHRWdXlfC9v3X2Har5+kU/LHY= 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.1 0034/1059] gpio: omap: Propagate runtime PM failures in probe and request Date: Fri, 4 Dec 2026 18:52:45 +0900 Message-ID: <20261204100644.926201579@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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.1-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 7f19af08f91c6..80aa94700a476 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -777,8 +777,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); @@ -1463,7 +1466,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