From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 584C4C433F5 for ; Wed, 17 Nov 2021 20:14:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0EDDF61A58 for ; Wed, 17 Nov 2021 20:14:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0EDDF61A58 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=WRDqaR0j/Rfdn90vKCP3b13ySm/n9fyjn/1usvRCUe4=; b=MuY1xsmP35yvfz qFOoxOA+yMZWCMVEUqhW/D3ZVsZjUvDc0+rWsMoxhZtHIZHyFAqlCX+BI8N+nlOuDy2pLc5b7VATn 6C25YEdF6NO84zwXaLepY5TtHr0H8sl0u0iPOIAypoqqujot9OMYxQRccll8W9FMwKukuqytIEJAS LjcvN03t9bAELnvfQGG9oCKrkUW1/6RIJDC10Nk93RLakpSjMnirsh3aYGsZrXYwrEKdRb+Yda6hZ fXTBjoHzs2060IRVksmyLykMyempb4t/CUAKDuv3lHrfDCL+sEVo9boG/3ggdjSE+AJgsXb8q1ZmB nrRk4YV3aG2b4Pc2ceyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnRId-006Dkf-Bx; Wed, 17 Nov 2021 20:12:55 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnRIZ-006Djb-Qs for linux-arm-kernel@lists.infradead.org; Wed, 17 Nov 2021 20:12:53 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id CA21661A02; Wed, 17 Nov 2021 20:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637179967; bh=904k1QZHkAzDkH8p/NTXmVnMiM16fjvDv4rwfiAd0tw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=pYV1mCKBdiYayyLyQDWR03NiyHn3HA1Xwise2m/GJf78mXdAd5GEOlXgRmc29Tygj 3vSrP/lOQRxJaUQfS5do0gP14yjoBPEwqRByWLXTQ8610bx3JDgbEqPAn8QfH+dNp8 44KU0J0LvraiTm45Gz/GJFIdYpRWqOSMveaUbbp8Zvw3IcrHLRyhARHXE2T5aztIBh jUJEZBezcBXULMao2/KT6+XUXwqti/7sgnW6piccaz5mfkolDwORsYY5r3zU2psiD7 oV9uS+lL5vFIx2ptQpgiGfwjxpsGagR96QehVWQZbQ9Wb/GoS0SXL0sbsyBpXir2eZ xdlh+ZexkKOYA== Date: Wed, 17 Nov 2021 14:12:45 -0600 From: Bjorn Helgaas To: Marc Zyngier Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, kernel-team@android.com, Alyssa Rosenzweig , Lorenzo Pieralisi , Bjorn Helgaas , Pali =?iso-8859-1?Q?Roh=E1r?= Subject: Re: [PATCH] PCI: apple: Reset the port for 100ms on probe Message-ID: <20211117201245.GA1768803@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211117160053.232158-1-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211117_121251_914890_2202B1B6 X-CRM114-Status: GOOD ( 18.70 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org [+cc Pali] On Wed, Nov 17, 2021 at 04:00:53PM +0000, Marc Zyngier wrote: > While the Apple PCIe driver works correctly when directly booted > from the firmware, it fails to initialise when the kernel is booted > from a bootloader using PCIe such as u-boot. > > That's beacuse we're missing a proper reset of the port (we only > clear the reset, but never assert it). s/beacuse/because/ > Bring the port back to life by wiggling the #PERST pin for 100ms > (as per the spec). I cc'd Pali because I think he's interested in consolidating or somehow rationalizing delays like this. If we have a specific spec reference here, I think it would help that effort. I *think* it's PCIe r5.0, sec 6.6.1, which mentions the 100ms along with some additional constraints, like waiting 100ms after Link training completes for ports that support > 5.0 GT/s, whether Readiness Notifications are used, and CRS Software Visiblity. > Fixes: 1e33888fbe44 ("PCI: apple: Add initial hardware bring-up") > Signed-off-by: Marc Zyngier > Cc: Alyssa Rosenzweig > Cc: Lorenzo Pieralisi > Cc: Bjorn Helgaas > --- > drivers/pci/controller/pcie-apple.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c > index 1bf4d75b61be..bbea5f6e0a68 100644 > --- a/drivers/pci/controller/pcie-apple.c > +++ b/drivers/pci/controller/pcie-apple.c > @@ -543,6 +543,9 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie, > if (ret < 0) > return ret; > > + /* Hold #PERST for 100ms as per the spec */ > + gpiod_set_value(reset, 0); > + msleep(100); > rmw_set(PORT_PERST_OFF, port->base + PORT_PERST); > gpiod_set_value(reset, 1); > > -- > 2.30.2 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel