Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30829707rwd; Thu, 6 Jul 2023 11:17:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlFU3YFCihmb39I35IHXafhu8PJXM16oLNaNq78HVaOGgZNeg6V0oojL7HuPz/a7+ElOdiVU X-Received: by 2002:a17:902:7d97:b0:1b0:f8:9b2d with SMTP id a23-20020a1709027d9700b001b000f89b2dmr2728562plm.29.1688667424042; Thu, 06 Jul 2023 11:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688667424; cv=none; d=google.com; s=arc-20160816; b=lhmM4Z1xOyOQ7FV1ds6hiaqaztjWDB4jNSKouA3DkZTuODFlg5lTi+tCB42XJSZrS+ 4SeOxkT/yp6/bNqX6YQrfvVXOoqm4MCtTwSraF3mrOi+ozZ3OaeFYsbeV8JUTAk4Yt1h NoEtMOz7fY3WxzmrwEVkRXVtGLxzGNPb/MtWIsJs7ZWcHhalh6qAdzzz1qdkqNJ4L1f0 ccKk+m0cj4f8b9F9VW0NaT94Ohr2Uinq+n3chW9iz/J+/VIBTOuOCjPw/vyJViy5rZ5m qCHNV5mGSS4x7TzJ7meaADEznQyZqMXPkMQO7lpGRGTn0qWxOXJ0mpE/FjWMW0uHVF6N XGnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=CXcwVbt4/zJqerR5/2DKh/CrbX1DwDeWUed0ga+TQqU=; fh=m/1cJkFFNzrXGss71hSMY8ln4R08EjvHLppwVc23w5M=; b=T+/8W9qV0gbTlOdQZgnbiiAYfmD9mqT5O7m/1BUvD6pqEoDBUJm08+seB5F7uu2W+O M2wMfSYpfMjEErDTq7Hgd1fGKg4zDUGjaj+9QZIIEExyVF9PqeSfsMpBkD3Hf8cpm8M9 o4mpeAxyGTux18BQUDp1ErJhupTi7N0dVTxzRRTKcw3bx2Qcu18jV+QhUetlZKSqUXjs 0+NqNnMYW+x0zdBV17nj3M60ucr570je5vZF9tr5bUdPVS2eU2bc9d7cuCl2BvKRnm3a SyL/T+05T9hpnoZYypVwCCB36nfo4Ue+AhChg5Tc2XgaD238st+o41ka9QkgbLavAjXK mXgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tyg0mflT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a170902c94600b001b81a9aa3d1si1931052pla.223.2023.07.06.11.16.48; Thu, 06 Jul 2023 11:17:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tyg0mflT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232135AbjGFR6A (ORCPT + 99 others); Thu, 6 Jul 2023 13:58:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjGFR57 (ORCPT ); Thu, 6 Jul 2023 13:57:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4904C199F; Thu, 6 Jul 2023 10:57:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D8B4461140; Thu, 6 Jul 2023 17:57:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F233C433C8; Thu, 6 Jul 2023 17:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688666277; bh=F0YCEMz+odMRbJqorHQE3V8C/7tKkwnudxHV68TPaNk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=tyg0mflToQ+t1YTLf03Rb3HotFd44LCSdV8mOF8CDfjjcIVAGSfNnmOZrwy5Rt599 9aiRQenEh7raYpqYohB2snebRwfWrcCN/W37GB9WxUSixwIwYpGbnvtgRqcKQPLHvj abMtiXbemSry0vIk5shP5vhSBychVo3kExxy8v4C+ch+pWAYn3sJ7MOD/SDvRuQQdR Pz0xdmnXCUY39qFwdGS6CkBQ1o4yhNNfK+h8NDX8DCYMRsO3vitatFcYgXQzkH+ofr 1WZ8l6R3nFu1hxuDpz5AxfT21Llp+DGn/cH5RQkeU+IDzbQ/cQGXGJJ/fQSoNiYXWO ZcJKRIQDkGmew== Date: Thu, 6 Jul 2023 12:57:55 -0500 From: Bjorn Helgaas To: Achal Verma Cc: Vignesh Raghavendra , Lorenzo Pieralisi , Krzysztof Wilczy_ski , Rob Herring , Bjorn Helgaas , linux-omap@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] PCI: j721e: Delay 100ms T_PVPERL from power stable to PERST# inactive Message-ID: <20230706175755.GA104094@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230706043438.407600-1-a-verma1@ti.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Thu, Jul 06, 2023 at 10:04:38AM +0530, Achal Verma wrote: > As per the PCIe Card Electromechanical specification REV. 5.0, PERST# > signal should be de-asserted after minimum 100ms from the time power-rails > become stable. > So, to ensure 100ms delay to give sufficient time for power-rails and > refclk to become stable, change delay from 100us to 100ms. Looks like the above is intended to be two paragraphs. Add a blank line between, or rewrap into a single paragraph if you prefer that. > From PCIe Card Electromechanical specification REV. 5.0 section 2.9.2: > TPVPERL: Power stable to PERST# inactive - 100ms > T-PERST-CLK: REFCLK stable before PERST# inactive - 100 usec. Is T-PERST-CLK relevant here? Omit if not. > Fixes: f3e25911a430 ("PCI: j721e: Add TI J721E PCIe driver") > Signed-off-by: Achal Verma > --- > drivers/pci/controller/cadence/pci-j721e.c | 11 +++++------ > drivers/pci/pci.h | 2 ++ > 2 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c > index e70213c9060a..a3c8273b7320 100644 > --- a/drivers/pci/controller/cadence/pci-j721e.c > +++ b/drivers/pci/controller/cadence/pci-j721e.c > @@ -498,14 +498,13 @@ static int j721e_pcie_probe(struct platform_device *pdev) > > /* > * "Power Sequencing and Reset Signal Timings" table in > - * PCI EXPRESS CARD ELECTROMECHANICAL SPECIFICATION, REV. 3.0 > - * indicates PERST# should be deasserted after minimum of 100us > - * once REFCLK is stable. The REFCLK to the connector in RC > - * mode is selected while enabling the PHY. So deassert PERST# > - * after 100 us. > + * PCI EXPRESS CARD ELECTROMECHANICAL SPECIFICATION, REV. 5.0 > + * indicates PERST# should be deasserted after minimum of 100ms > + * after power rails achieve specified operating limits and > + * within this period reference clock should also become stable. > */ > if (gpiod) { > - usleep_range(100, 200); > + msleep(PCI_TPVPERL_DELAY); > gpiod_set_value_cansleep(gpiod, 1); > } > > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h > index a4c397434057..7482cff16fef 100644 > --- a/drivers/pci/pci.h > +++ b/drivers/pci/pci.h > @@ -13,6 +13,8 @@ > > #define PCIE_LINK_RETRAIN_TIMEOUT_MS 1000 > > +#define PCI_TPVPERL_DELAY 100 /* msec; see PCIe r5.0, sec 2.9.2 */ Perhaps make the name "PCIE_..." since this is a PCIe-specific time. Also add "_MS" to the name so it's easy to verify that users are using the correct mechanism (usleep/msleep/etc). Otherwise looks good to me, thanks! > extern const unsigned char pcie_link_speed[]; > extern bool pci_early_dump; > > -- > 2.25.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel