Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp743282lqh; Thu, 28 Mar 2024 15:17:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWn9Ep9tK++QGzY7cQJhjPmhwfMdYKzwvjp2Zktv4JofF1/jV5TB90RbwOt8Xo/MXH4WxRsZrFUQeXB9fv2kmfTxvJuMj3oizUDarUoKA== X-Google-Smtp-Source: AGHT+IGsIabEM4/qneXu6e3tGNnU4rBGYZ7eDIJyqkwF93MLQXokKPq7IV5GPBdDPMXm7fNecP3G X-Received: by 2002:a50:a697:0:b0:56b:d212:b032 with SMTP id e23-20020a50a697000000b0056bd212b032mr351397edc.14.1711664230559; Thu, 28 Mar 2024 15:17:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711664230; cv=pass; d=google.com; s=arc-20160816; b=0moen6Zk/jk0nLIzXOGdzGss06O5kvBC1Jr6p8SL1ExnLwTEzRXIGrCeW4J0rfI6f0 FdIc0YsXW0nEq+eqIJjb1kS/RQwRM2Z/z9M1h0YovSlwn/YDEaecFzfT9JGuYQUy00El BQ94TimGcb5cjThIFwDGEKvnAiB5OLvsuVVGdD1vaa/GD8Furzzj+Y/uhGP3cB1OPjCm DpM3iJomgjjVAPuAeJx85wB6jJ1NmM8goIA97xcvf6N7N/drZRrkJkFhSXS1v3OfqG5m 5oJ/t7SYLOJ6wfWYlC5lFNhoDBRR3n/Et/nWopWmh4CkjBXCUYoJmDuOzg3xLsaBdMlw yG4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:subject:cc:to:from:date:dkim-signature; bh=MnfJun7c+oBs+BKL5SrAx6XwqHu5q9APlwmGokMteaU=; fh=Ie17qMGRU++WxE+kWsKWdRWTyFlEAqtkckt/vGXoQzE=; b=vT8L9Iiu15Tzy/H9Lrzu4JOlODWsQSTS7gAn7xWzrZDgOVM+5nLgr8at1scwtHYuIg THtpq0NLKsxL0kGTfVF2107+TldNUnpXzyaj7E2FBOWbc9h7czRSEC6bBdpmDmgBSOW/ 2RNuUj9L5FEY8b0+/lmmjEKnAnbI2F5b85+Hb41X0PJO/B2yqjtLdDKzeqg/jpJ+ahqq j4JuOlhLlFepn1fZewk7s8iODysVpJJzLMB8ujDysZlNqbUYRDK+m2WOm2Lr/niyaATr o8GIZy05sA3wO62+Ap3U8TuQmDYLQdRG0JAf2PIKd5bT4KoZ1uc80kzU42QAOeK1jeoC kVGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V4OxVoCD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123744-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 3-20020a508e43000000b0056c24e6409asi1163029edx.255.2024.03.28.15.17.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 15:17:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V4OxVoCD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123744-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123744-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2B5811F21BFB for ; Thu, 28 Mar 2024 22:17:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 124F8146D4A; Thu, 28 Mar 2024 22:07:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V4OxVoCD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21FB6146A9D; Thu, 28 Mar 2024 22:07:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711663673; cv=none; b=K9UfdHWbYwAcT/7O0rGYYutGWaRCfwB03TY1H65hntoK3eDJCHBkpNiezQiaHvyKr1gf0dW6z+lvtgCVHdP44dm6wDxqRsuOc0+hKPxumzN2Jci1ziC5jmCVDAsLFEMxeKfQWp9Dh6wn69RtufYPfNTvPu+DWgQK/ztuiDqnv9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711663673; c=relaxed/simple; bh=W4ByrRn+4LKetxSuLsKEBOpQVyml+dZHE4/n83TVljc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=UHv1CM/89YCdaR/PiK8E9LofDvhdJ1q8te2nSHxqG/rCCb5cHk3/ccxSOP2ZQij3kZXUOsEXxd82RGgjhomjgYOAMxeRnkLVpOgU+gLoK2q8nd6/UTLKA+Su+oI9GTv/iPxmyVXETTglw9AOuNrv0hl7Io7iOE3uGtKoVBLlaG8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V4OxVoCD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6A53C43390; Thu, 28 Mar 2024 22:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711663673; bh=W4ByrRn+4LKetxSuLsKEBOpQVyml+dZHE4/n83TVljc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=V4OxVoCDai/enFPnJBLQJykhNDl1EcgFkrrTcoUNMqRgYCsT3pKvCQ4pUMTw9c5EV 7ps/B6RtmKls0wISTrTzJx0RlRfQcXeF2RY8SZiUL7i0ypKS1dLF7N6aZlbm0pweIC LFaO67i9Oj0i3UhJ3KHZ10ZxkwNoNG3eWgoSsLtZLbS17N4z+u64fF8VEx1yoq97/0 DXM6Ed5G/l+aHVasdfhXppVn+Eekxz/UclPWyo1nU2dcbxkOitwfFqOYiBb1FSY4lh yJrHD6RSB0jUdgMYWUg5JYyO1xllzQfHIzDRgLwalJClI3LBKR5WgpTPQRC9/uy9D8 EmwXkoGdDd/1w== Date: Thu, 28 Mar 2024 17:07:51 -0500 From: Bjorn Helgaas To: Thomas Richard Cc: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com Subject: Re: [PATCH v4 18/18] PCI: j721e: Add suspend and resume support Message-ID: <20240328220751.GA1613553@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240102-j7200-pcie-s2r-v4-18-6f1f53390c85@bootlin.com> On Mon, Mar 04, 2024 at 04:36:01PM +0100, Thomas Richard wrote: > From: Théo Lebrun > > Add suspend and resume support. Only the rc mode is supported. > > During the suspend stage PERST# is asserted, then deasserted during the > resume stage. > + * "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. Please cite current spec (r5.1 was published August 2023), section, and parameter name. I think this is T_PERST-CLK, "REFCLK stable before PERST# inactive", from sec 2.9.2. > + */ > + if (pcie->reset_gpio) { > + fsleep(100); I'd like to see a macro used here instead of a bare number. Since this isn't anything specific to j721e, maybe add something like #define PCIE_T_PERST_CLK_US alongside PCIE_T_PVPERL_MS. > + gpiod_set_value_cansleep(pcie->reset_gpio, 1); > + }