Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1139965rdb; Wed, 24 Jan 2024 06:10:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRfB6SRCoKTytnafB3A/5AtwvAost11lqrkbLKzEjS5MSVeXl4wbIIqQLX1F7gebl8Yc3R X-Received: by 2002:aa7:c594:0:b0:55c:8ab7:9446 with SMTP id g20-20020aa7c594000000b0055c8ab79446mr1460087edq.7.1706105427580; Wed, 24 Jan 2024 06:10:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706105427; cv=pass; d=google.com; s=arc-20160816; b=F7IHYQgcS75OTmLSmmlFgiFJh5HJq76ZQUjDcFwxw91GrhXS/1jbB1JYEnQT9h5r73 WmAmQRtqPFBE+LVx27GHTyRsnFLzW6xRX+Y3JTthDpvhMsRAAp3D8w4lvpyXxkI1dXlm Hb4nlOotA/AO9CTvGYzZyuorlj9ZzI2PUhst/rdthm1QuOWYYBz8noz+gLKYAzBYkpGA EdFKPLZeI3F7gfxP5iiaDknufZn/BfmX+fRGKbvzoBUYIZ4oHE1Hn2OBvHTml+8SgOs6 15vDauWDCrtUWSHVdgoj5DjmI3qKwR9e3C3oCo8WIwP6f9zxpxFbRLZ5v+rqz5qfG0a9 iPKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=BVQptg6pNr7/Hd/yjH+uKmnG36EBffMLdBd048tdJ9I=; fh=zJ6tyQPSPJtpNE1kDDjqZJNbBRQIRffCQQMnrzX3sgI=; b=sd0PDCPIhXBzsLMgE69dadgmsIUWt5miUooijjbwLk9bkHez6sphIjlLkwEPqcpwJF wiDqwB6KrycAWvRauZpEzbYxy/cjMeTFjTFcAyQHQxYDrWU6A7eRANEYNj5rtIF7rn9G j2N39Eaky/Fk8VaDRZMBU++A3MwrJOXZGbMWa6fcyv0HFV9E7xh9NtEzbNZEbUVFOD17 zjLTe5U1Xv7OvBT13zCxuvEr6hqt6QuqXc9H5NgZbG/26KYl15fzwTGW/DU9ukeBZz/4 S8LpMFE59Op0cJ1NK1AmrohILcr2XFit+TqQzaGkm/Q2b/U/z2sQZU39Q5Be4MoveLfg d8og== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LGo7sy9O; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-37089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37089-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fk3-20020a056402398300b00559eed310b0si7897017edb.396.2024.01.24.06.10.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 06:10:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37089-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=@bootlin.com header.s=gm1 header.b=LGo7sy9O; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-37089-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37089-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 5A8751F23144 for ; Wed, 24 Jan 2024 14:10:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CEDD7A72D; Wed, 24 Jan 2024 14:10:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="LGo7sy9O" Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (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 A44877A702; Wed, 24 Jan 2024 14:10:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706105410; cv=none; b=ubjMC6XowjslgqrV/mEkQgzlbyF6D7lMECUjwOyiSXOUOQdilbC+ElmZURgLOPB8kQDbO4mqdW/2emLgAH4ccoXhZh5LGAjYltGB3hGWlaIEpUIHVNyRvjM0LcrurDXPp/VrTxuLDn839igERv948eao9Q8qKQOtz2UOpTFvwNk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706105410; c=relaxed/simple; bh=SMj/n/Z9fKpBrbi4uiZ+Ws8yfoCXVtmFG6mubuKu1dg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Y4DL00LSPFvb0zTxWmFabIqhpOC+ZrNY3a1m6d7YVmU2V16Ox/xzjg4hpSynJgjfu7zCgp3Y05fivMeLCYf6nB+6/1k8ROOfgPA6oeWo+buedwInnbKadPQFCuGmxqsSLRKnCXUgarh4/cLHhonXMUgXj1KEjZ0okGoraYfL24I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=LGo7sy9O; arc=none smtp.client-ip=217.70.183.196 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 2172EE000D; Wed, 24 Jan 2024 14:09:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706105400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BVQptg6pNr7/Hd/yjH+uKmnG36EBffMLdBd048tdJ9I=; b=LGo7sy9O/BrvsaySKByqO5iuOVvbA23QuQBoQKjSjld/7OxJ68DOdIyHmXoc6Za9y19/cx SYJq5ney0FY114kRsjbDJMLDAOJqtnwcE7LzQSxff7DK+1rpme72BZ8tdMxoLQvASEiU3X Bqdu+yBpbUgaefIxu/lPTMz5LyOCW7pfnD3AI5qNFjDit4K0ygVr7yqSTtUTywmUbGe93/ du8qimW3Gc78PalZceT1G0i8OWbWMpRwuEajFsDqog7Qsc+Xl448imyv3IdFIOJCNdmAR1 s1b/TcjdAWcKm8M2IHdo9GurQtybPkNfjCexpdaXnoikr62v6/WBbwaWZQd5CQ== Message-ID: <830324ea-7fdb-4769-a1c7-08d59905ca4b@bootlin.com> Date: Wed, 24 Jan 2024 15:09:56 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 14/14] PCI: j721e: add suspend and resume support To: Andy Shevchenko 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 , Tom Joseph , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_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 References: <20240102-j7200-pcie-s2r-v1-0-84e55da52400@bootlin.com> <20240102-j7200-pcie-s2r-v1-14-84e55da52400@bootlin.com> <9cb47f37-bd98-4136-b844-33cf2be593df@bootlin.com> Content-Language: en-US From: Thomas Richard In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: thomas.richard@bootlin.com On 1/22/24 22:36, Andy Shevchenko wrote: > On Mon, Jan 22, 2024 at 5:30 PM Thomas Richard > wrote: >> On 1/15/24 21:13, Andy Shevchenko wrote: >>> On Mon, Jan 15, 2024 at 6:16 PM Thomas Richard >>> wrote: > > ... > >>>> + if (pcie->reset_gpio) >>> >>> Dup, why? >> >> This pcie->reset_gpio corresponds to PERST# of PCIe endpoints. >> I assert it during suspend, because I have to deassert it (with a delay) >> during resume stage [1]. > > Ah, sorry for being unclear, I meant that gpiod_set_value*() already > has that check, you don't need it here. ok understood, check is useless. > >>>> + gpiod_set_value_cansleep(pcie->reset_gpio, 0); > > ... > >>>> + if (pcie->reset_gpio) { >>>> + usleep_range(100, 200); >>> >>> fsleep() ? >>> Btw, why is it needed here, perhaps a comment? >> >> The comment should be the same than in the probe [1]. >> Should I copy it? Or should I just add a reference to the probe? >> >> [1] >> https://elixir.bootlin.com/linux/v6.8-rc1/source/drivers/pci/controller/cadence/pci-j721e.c#L535 > > Either way works for me. > >>>> + gpiod_set_value_cansleep(pcie->reset_gpio, 1); >>>> + } > > ... > >>>> +#define cdns_pcie_to_rc(p) container_of(p, struct cdns_pcie_rc, pcie) >>> >>> Is container_of.h included in this file? >> >> linux/container_of.h is included in linux/kernel.h. >> And linux/kernel.h is included in pcie-cadence.h >> (https://elixir.bootlin.com/linux/v6.8-rc1/source/drivers/pci/controller/cadence/pcie-cadence.h#L9). > > Okay, so, try to clean up pcie-cadence.h so it won't use "proxy" headers. > There is an IWYU (include what you use) principle, please follow it. In fact, as cdns_pcie_to_rc is only used in pci-j721e.c, no need to have it in a header file. I prefer to move cdns_pcie_to_rc definition in pci-j721e.c. As I don't modify pcie-cadence.h, the cleanup to not use proxy headers is something that it can be done outside this series. -- Thomas Richard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com