Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4757073pxj; Tue, 22 Jun 2021 07:24:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoFw8wB8EWImympB8ehQaT8c3nV36pOR6yuVo4CXIW7YE6L33eHOLZrN2ZajDDLM6ac/oX X-Received: by 2002:a6b:a10:: with SMTP id z16mr3054663ioi.70.1624371868214; Tue, 22 Jun 2021 07:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624371868; cv=none; d=google.com; s=arc-20160816; b=pXsauXmXnLrh9NK/aWsMmmguPsBTGIrOzbyPzGHIWECLoIWnJAJs4bhtKJm/xtU7PX 1IFLPItJzruAzn0kFuG6Ao4J752rhEJLAnO7w6TDGavmQPSp3cAHAxhOdEFsTkDwDW2L TDniRZ/GIBr2YoDVx88dYPO+pHeRg1LF0SyFMfUfByOK9kt4z1Aue4z1XE6coZd3nuZq mTB73nIvXEO7/AqPVU/G5wUn+lhhAGeBD3KO8BoUOWQ2oG44k0kd43eZReDND6iRNAX1 LnddKPX3/jKMTijAKAh0gDZH4GoNEb46+7jQHLbapRxg3HMzKkJ4MYgtBehp+G2ZE/LE MKJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ljc9b1ExE6XnPbO7PPW8Ed+POV0lFGqYTJ+yl7WImEQ=; b=t4fHTDSTtOzhaaOVYYEaQK5hapaPVplc4XGQ8WBkTrpgpHYhcfFKuzfsnaW+quawND 7NOgwM8513VYgngETv36vnQYGzfkFJyjWAEAw2et904CVZjt9lEHNijbdCswpNz28qw5 p9DaZ4KB+mMRn8VI1ElhLIvVqjkZP9m0LPKltGrx0JquhbRKADiRZZacGJ9oJXlf4KtP Vag7JWWj86QVasmcapBGBVwNeXWiKvS0qX2cTm/DzBI8MIGCoOW8OIDpamVGinEGE2Bh RsWD+AVVrfDLDp66qKhs/UMizaARxZbCmG1GYW6UnkqFk7YqDj9a8PHvSLrMIAZDk5lf 1Rdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f17si10822036jaj.104.2021.06.22.07.24.16; Tue, 22 Jun 2021 07:24:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231348AbhFVOZu (ORCPT + 99 others); Tue, 22 Jun 2021 10:25:50 -0400 Received: from foss.arm.com ([217.140.110.172]:50244 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230047AbhFVOZt (ORCPT ); Tue, 22 Jun 2021 10:25:49 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7A0CC31B; Tue, 22 Jun 2021 07:23:33 -0700 (PDT) Received: from lpieralisi (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1C1923F694; Tue, 22 Jun 2021 07:23:32 -0700 (PDT) Date: Tue, 22 Jun 2021 15:23:25 +0100 From: Lorenzo Pieralisi To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: linus.walleij@linaro.org, kishon@ti.com, Luca Ceresoli , linux-pci@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rob Herring , Bjorn Helgaas Subject: Re: [PATCH v2] PCI: dra7xx: Fix reset behaviour Message-ID: <20210622142325.GA27099@lpieralisi> References: <20210531090540.2663171-1-luca@lucaceresoli.net> <20210531133211.llyiq3jcfy25tmz4@pali> <8ff1c54f-bb29-1e40-8342-905e34361e1c@lucaceresoli.net> <9fdbada4-4902-cec1-f283-0d12e1d4ac64@ti.com> <20210531162242.jm73yzntzmilsvbg@pali> <8207a53c-4de9-d0e5-295a-c165e7237e36@lucaceresoli.net> <20210622110627.aqzxxtf2j3uxfeyl@pali> <20210622115604.GA25503@lpieralisi> <20210622121649.ouiaecdvwutgdyy5@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210622121649.ouiaecdvwutgdyy5@pali> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 22, 2021 at 02:16:49PM +0200, Pali Roh?r wrote: > On Tuesday 22 June 2021 12:56:04 Lorenzo Pieralisi wrote: > > [Adding Linus for GPIO discussion, thread: > > https://lore.kernel.org/linux-pci/20210531090540.2663171-1-luca@lucaceresoli.net] > > > > On Tue, Jun 22, 2021 at 01:06:27PM +0200, Pali Roh?r wrote: > > > Hello! > > > > > > On Tuesday 22 June 2021 12:57:22 Luca Ceresoli wrote: > > > > Nothing happened after a few weeks... I understand that knowing the > > > > correct reset timings is relevant, but unfortunately I cannot help much > > > > in finding out the correct values. > > > > > > > > However I'm wondering what should happen to this patch. It *does* fix a > > > > real bug, but potentially with an incorrect or non-optimal usleep range. > > > > Do we really want to ignore a bugfix because we are not sure about how > > > > long this delay should be? > > > > > > As there is no better solution right now, I'm fine with your patch. But > > > patch needs to be approved by Lorenzo, so please wait for his final > > > answer. > > > > I am not a GPIO expert and I have a feeling this is platform specific > > beyond what the PCI specification can actually define architecturally. > > In my opinion timeout is not platform specific as I wrote in email: > https://lore.kernel.org/linux-pci/20210310110535.zh4pnn4vpmvzwl5q@pali/ > > My experiments already proved that some PCIe cards needs to be in reset > state for some minimal time otherwise they cannot be enumerated. And it > does not matter to which platform you connect those (endpoint) cards. > > I do not think that timeout itself is platform specific. GPIO controls > PERST# pin and therefore specified sleep value directly drives how long > is card on the other end of PCIe slot in Warm Reset state. PCIe CEM spec > directly says that PERST# signal controls PCIe Warm Reset. Point taken but regardless this deviates from the PCI electromechanical specifications (ie T-PERST-CLK), does not it ? I misused "platform" to define something that apparently is not contemplated by the PCI specifications (and I would like to understand why). I guess on ACPI systems (ie where the PERST# handling is implemented in FW) this is handled in BIOS/UEFI - need to peruse the code to check how PERST# is handled and whether the delay is per host controller driver. > > What is here platform specific thing is that PERST# signal is controlled > by GPIO. But value of signal (high / low) and how long is in signal in > which state for me sounds like not an platform specific thing, but as > PCIe / CEM related. There are two different things to agree on this patch 1) how GPIO drives PERST# 2) the PERST# de-assertion delay. I appreciate they are related and that Luca had to handle them together but logically they are separated "issues", it'd be great if we manage to nail down how they should be handled before we merge this code. Lorenzo > > > There are two things I'd like to see: > > > > 1) If Linus can have a look at the GPIO bits in this thread that would > > definitely help clarify any pending controversy > > 2) Kishon to test on *existing* platforms and confirm there are no > > regressions triggered > > > > > I would suggest to add a comment for call "usleep_range(1000, 2000);" > > > that you have chosen some "random" values which worked fine on your > > > setup and that they fix mentioned bug. Comment just to mark this sleep > > > code that is suboptimal / not-so-correct and to prevent other people to > > > copy+paste this code into other (new) drivers... > > > > Yes a comment would help but as I say above I am afraid this is > > a platform specific set-up, ie that delay is somewhat tied to > > a platform, not sure there is anything we can do. > > > > If Linus and Kishon are happy with the approach we can merge this > > patch. > > > > Lorenzo