Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4432512pxb; Mon, 21 Feb 2022 21:26:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPcy33Novo3Jbz654if+yVb05R11KIutUMpuPJCXrGRtkf5wG+j2XetxB7iknwiCEZhnUB X-Received: by 2002:a17:90a:dc09:b0:1bc:4af5:3a89 with SMTP id i9-20020a17090adc0900b001bc4af53a89mr2416015pjv.64.1645507619800; Mon, 21 Feb 2022 21:26:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645507619; cv=none; d=google.com; s=arc-20160816; b=m7+SfFq7xyl38/x3Ajcx2+VZdfXK7Rj53PV+1gERDMtYWLTxPd8VSBsApZVA1PmTVU +6hiLtBRCl70esy3EKBJNSAS1nTto0HhpEUYoZ+UlvmXiJA7/9kYDjHOJNr+p5OJNaKT KttBAbDfVKLQYz3GIKuVjwBMHqHI4qh9RXnvPsxNhK/xUBLUnU6BuXRi6Oq+o93pPJbg tIYutg5fj+yD99kAS8jIbUktku6lL7hRWj4BlSZ2iqMaVAaFOEecA0U1QsBSjk7zmThK KfBy2DLTd6ecYgQ8hIBhmnOWH185xrEXT6KRfwRluVX6wzo2mu7BguCi0aVQ6gWitlcf LN4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Vlt9wa/67MMmEjBZJ/30hOD+Ou8RwZTm8FKrAL9x9d0=; b=lG//+z5usulaU5LjvNtfMxbmlEkmZAmJFNU5+W9EaCPwENN+jpChyBDzO/BVkYVxSG m8mREVr3AZbzeQpaPsl4ybx15UNhhXqqVGz0dPHJNiYX1i6galzhEA/bpgodKCe+BJzj 8AAXNJDH1UWL9CPSBm1iMH163zOa4ho42l3RJB1TGjWwk2LneJ1Fj9hWZ1nL2wMeSToj 179GlHxIz9FIoo28yI0p1pOJFVCcPxtolrnXKP0L1yaJ+BrnM2CyeXBLUo2aPaWDqOqG 3NF93nePffx0Z3XFd5hqKKt4JyElbD6/Os4/lMZPnmAaoGelsp2ny86Axq06QJEk3YUq JZtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t22si18115937pgg.611.2022.02.21.21.26.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:26:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DCA891A82C; Mon, 21 Feb 2022 20:56:50 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234189AbiBUVEW (ORCPT + 99 others); Mon, 21 Feb 2022 16:04:22 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232450AbiBUVEU (ORCPT ); Mon, 21 Feb 2022 16:04:20 -0500 Received: from imap3.hz.codethink.co.uk (imap3.hz.codethink.co.uk [176.9.8.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00DD723BCD; Mon, 21 Feb 2022 13:03:55 -0800 (PST) Received: from cpc152649-stkp13-2-0-cust121.10-2.cable.virginm.net ([86.15.83.122] helo=rainbowdash) by imap3.hz.codethink.co.uk with esmtpsa (Exim 4.92 #3 (Debian)) id 1nMFqW-0000u1-RF; Mon, 21 Feb 2022 21:03:48 +0000 Received: from ben by rainbowdash with local (Exim 4.95) (envelope-from ) id 1nMFqW-005bIY-9j; Mon, 21 Feb 2022 21:03:48 +0000 From: Ben Dooks To: paul.walmsley@sifive.com, greentime.hu@sifive.com Cc: lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Ben Dooks Subject: [PATCHv4 1/2] PCI: fu740: fix finding GPIOs Date: Mon, 21 Feb 2022 21:03:46 +0000 Message-Id: <20220221210347.1335004-1-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The calls to devm_gpiod_get_optional() have the -gpios at the end of the name but the GPIO core code is already adding the suffix during the lookup. This means the PCIe driver is not finding the necessary reset or power lines to allow initialisation of the PCIe. This bug has not been noticed as if U-Boot has setup the GPIO lines for the hardware when it does the PCIe initialisation (either by booting from PCIe or user command to access PCIe) then the PCIe will work in Linux. The U-Boot as supplied by SiFive does not by default initialise any PCIe component. Signed-off-by: Ben Dooks --- drivers/pci/controller/dwc/pcie-fu740.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-fu740.c b/drivers/pci/controller/dwc/pcie-fu740.c index 00cde9a248b5..842b7202b96e 100644 --- a/drivers/pci/controller/dwc/pcie-fu740.c +++ b/drivers/pci/controller/dwc/pcie-fu740.c @@ -259,11 +259,11 @@ static int fu740_pcie_probe(struct platform_device *pdev) return PTR_ERR(afp->mgmt_base); /* Fetch GPIOs */ - afp->reset = devm_gpiod_get_optional(dev, "reset-gpios", GPIOD_OUT_LOW); + afp->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(afp->reset)) return dev_err_probe(dev, PTR_ERR(afp->reset), "unable to get reset-gpios\n"); - afp->pwren = devm_gpiod_get_optional(dev, "pwren-gpios", GPIOD_OUT_LOW); + afp->pwren = devm_gpiod_get_optional(dev, "pwren", GPIOD_OUT_LOW); if (IS_ERR(afp->pwren)) return dev_err_probe(dev, PTR_ERR(afp->pwren), "unable to get pwren-gpios\n"); -- 2.34.1