From patchwork Tue Apr 1 09:17:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 14034619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65308C36018 for ; Tue, 1 Apr 2025 09:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=O4HLE4y09n6i2k65vnUFlg74H/qGWIa37uSi5NNsd5s=; b=1S7yFUNqbiXcPs3TDm9VP1ucFs NEFaRrF/ceGvZ8e7PP+33pBu8dDMzVx+Er3+UdPUwOIQuSWeb5DkUTtM2T/+X/LCOIIwSbH9Znk9v xqv2ri1z/i9keBO2jsG4D2B1GsWUhnE/XRt4CXCjI8Ld6EhLDlXsIn2zMw8LbMMDndJgcXalz/0k7 Ev0cTCZWrGkex3slKcHgJb2NoqBkOVNxvqjDHpGr6uWULs4gOijR8Ik0tPWP7DF8UCI7lWr07cGuj g8qiL0FNk8deuF5vIhAtDGvH5TMQxO82gUUh5iEIn8J5vmY5o/7dYYh2jEd/KKOCSFp8Gy4CGar2u E3N/M9DQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzYJG-00000002XDC-0WMX; Tue, 01 Apr 2025 09:53:30 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzXka-00000002Rfm-3OtM for linux-arm-kernel@lists.infradead.org; Tue, 01 Apr 2025 09:17:42 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id EDF5444E20; Tue, 1 Apr 2025 09:17:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 365EEC4CEE9; Tue, 1 Apr 2025 09:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743499059; bh=EM9XHMhnBOcNMKfEDCUevD8DkRau/lycdQVCM5ZOl+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bp26S07nMjmeBFS/PThVtenygXjPM6em5P84un53yBj/IoBn1ca4XSPddY80Arkw3 /fs7UjzgQamgsxY9YoSMW+fDqR/bt4NNf6uCKpyKb2l5H0Q8GzUCb7x14wmp54XFDu TM0FLs5Mmw4fdvp5RpFhmmXMZpALXnp6ZBEHADc9En7Zo2Q3LkM9d9WrbwHjcpe7EP n9pP39TBoPl070oeWkrPT7aXX+lu/mCksDM7oT+ta1yi3IMHHeDXDiNWqcF8K89z4h 9P8p1j5uuxamr100BU89tLJ0mWH6yWKvuQwBmEKGzRAZyYj558LuTgZvjLtX0moUm5 Wm0ev/UUjUdAw== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tzXkX-001GqU-CK; Tue, 01 Apr 2025 10:17:37 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev Cc: Alyssa Rosenzweig , Janne Grunau , Hector Martin , Sven Peter , Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Manivannan Sadhasivam , Rob Herring , Krzysztof Kozlowski , Mark Kettenis Subject: [PATCH v3 11/13] PCI: apple: Use gpiod_set_value_cansleep in probe flow Date: Tue, 1 Apr 2025 10:17:11 +0100 Message-Id: <20250401091713.2765724-12-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20250401091713.2765724-1-maz@kernel.org> References: <20250401091713.2765724-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, alyssa@rosenzweig.io, j@jannau.net, marcan@marcan.st, sven@svenpeter.dev, bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com, manivannan.sadhasivam@linaro.org, robh@kernel.org, krzk+dt@kernel.org, mark.kettenis@xs4all.nl X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250401_021740_994647_118FBAC6 X-CRM114-Status: GOOD ( 13.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Hector Martin We're allowed to sleep here, so tell the GPIO core by using gpiod_set_value_cansleep instead of gpiod_set_value. Fixes: 1e33888fbe44 ("PCI: apple: Add initial hardware bring-up") Reviewed-by: Rob Herring (Arm) Acked-by: Alyssa Rosenzweig Tested-by: Janne Grunau Signed-off-by: Hector Martin Signed-off-by: Alyssa Rosenzweig Signed-off-by: Marc Zyngier --- drivers/pci/controller/pcie-apple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c index c00ec0781fabc..505adf64bd66d 100644 --- a/drivers/pci/controller/pcie-apple.c +++ b/drivers/pci/controller/pcie-apple.c @@ -562,7 +562,7 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie, rmw_set(PORT_APPCLK_EN, port->base + PORT_APPCLK); /* Assert PERST# before setting up the clock */ - gpiod_set_value(reset, 1); + gpiod_set_value_cansleep(reset, 1); ret = apple_pcie_setup_refclk(pcie, port); if (ret < 0) @@ -573,7 +573,7 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie, /* Deassert PERST# */ rmw_set(PORT_PERST_OFF, port->base + PORT_PERST); - gpiod_set_value(reset, 0); + gpiod_set_value_cansleep(reset, 0); /* Wait for 100ms after PERST# deassertion (PCIe r5.0, 6.6.1) */ msleep(100);