Message ID | 20210517153557.429623-1-luca@lucaceresoli.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=iJAY=KM=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04C19C433ED for <linux-arm-kernel@archiver.kernel.org>; Mon, 17 May 2021 15:38:54 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B832861004 for <linux-arm-kernel@archiver.kernel.org>; Mon, 17 May 2021 15:38:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B832861004 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lucaceresoli.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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-Owner; bh=uV3IddDpn2zfQ0/f5nfKYs4LWLkuvTHWTdtkA09F+I8=; b=p/kqPz5Zhjmc/yOAtJZ0P0exZ0 fdLh+NvrCfs906Y8Is5FT3T1tdHIK0JR2gibzofTPZYwWA52zfJT51eZS+zOnYwIupSb/lo+QIGXL AB7ldeSTmcLhgD9FOinz2sDx5JwgdIRo3omyB3MEcwsWFRkL54F9H73VqayisI/CUnyT7IDh6dQBl 3GSo9qFQJBOirDhfaJMgSvQ7tUeBWJapqkEcYkKoBIqyEUvMKkFdw84yWHoUzJmD3OwapJ2hFv2MI 0aepgrCeDziSxOX0H8H7WdJCPIeFByQN29iYGw3luYaOrzIvEuzQeY2b8g345fT1JdTWrwk4BmF4j aDVLpqWg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lifI9-00FQbB-Qz; Mon, 17 May 2021 15:36:25 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lifI5-00FQaX-BO for linux-arm-kernel@desiato.infradead.org; Mon, 17 May 2021 15:36:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=ygCBvqU6a/fwgXNghZa1INS6FSV49fiYbwnH1G3upiI=; b=4Ds3tJjgDkyqofNB7EsaqCaQl5 RgiVT0IPIm5I58x9/nnZtKzLxZMCJayoMlTV4IUucF82rPSTlvQlJr2ZitEgo9HypHFPsQfIk4sD5 u6Sl9pyOxQSdQ47gOMoWEWTmWiOlsdMXDHS1FSwD4eEGXQWfLNpjM2yB6tqI81EddhCYkEYPB/kzO GSQCz5JjV9ShPPixxiptW3//083scLsKfDIZhxyxqtMbEWDHo+fBXIB7gm4a9uf0hT6l9RpMRKDrU RZyGkRETkDk37Ij7ZS0rWlo+It+B4f4MfdnLvHnoe0tyXckCzchg6Lsv+/yX2Q16gYQNqYQL6BEC0 +8SEC4/A==; Received: from hostingweb31-40.netsons.net ([89.40.174.40]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lifHz-00DvlH-G1 for linux-arm-kernel@lists.infradead.org; Mon, 17 May 2021 15:36:20 +0000 Received: from [77.244.183.192] (port=64716 helo=melee.fritz.box) by hostingweb31.netsons.net with esmtpa (Exim 4.94.2) (envelope-from <luca@lucaceresoli.net>) id 1lifHt-000CDv-67; Mon, 17 May 2021 17:36:09 +0200 From: Luca Ceresoli <luca@lucaceresoli.net> To: linux-pci@vger.kernel.org Cc: Luca Ceresoli <luca@lucaceresoli.net>, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I <kishon@ti.com>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Rob Herring <robh@kernel.org>, Bjorn Helgaas <bhelgaas@google.com> Subject: [PATCH] PCI: dwc: pci-dra7xx: fix reset behaviour Date: Mon, 17 May 2021 17:35:57 +0200 Message-Id: <20210517153557.429623-1-luca@lucaceresoli.net> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hostingweb31.netsons.net X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: hostingweb31.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: hostingweb31.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_083615_716856_5FD36086 X-CRM114-Status: UNSURE ( 7.65 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
PCI: dwc: pci-dra7xx: fix reset behaviour
|
expand
|
diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c index dacd6da70c35..8dd20b394d0c 100644 --- a/drivers/pci/controller/dwc/pci-dra7xx.c +++ b/drivers/pci/controller/dwc/pci-dra7xx.c @@ -800,6 +800,8 @@ static int dra7xx_pcie_probe(struct platform_device *pdev) dev_err(&pdev->dev, "gpio request failed, ret %d\n", ret); goto err_gpio; } + usleep_range(1000, 2000); + gpiod_set_value(reset, 0); reg = dra7xx_pcie_readl(dra7xx, PCIECTRL_DRA7XX_CONF_DEVICE_CMD); reg &= ~LTSSM_EN;
The PCIe PERSTn reset pin is active low and should be asserted, then deasserted. The current implementation only drives the pin once in "HIGH" position, thus presumably it was intended to deassert the pin. This has two problems: 1) it assumes the pin was asserted by other means before loading the driver 2) it has the wrong polarity, since "HIGH" means "active", and the pin is presumably configured as active low coherently with the PCIe convention, thus it is driven physically to 0, keeping the device under reset unless the pin is configured as active high. Fix both problems by: 1) keeping devm_gpiod_get_optional(dev, NULL, GPIOD_OUT_HIGH) as is, but assuming the pin is correctly configured as "active low" this now becomes a reset assertion 2) adding gpiod_set_value(reset, 0) after a delay to deassert reset Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> --- drivers/pci/controller/dwc/pci-dra7xx.c | 2 ++ 1 file changed, 2 insertions(+)