Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp445708rdb; Mon, 22 Jan 2024 08:58:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEz6t1a1DWwisCfy2T5ZX/yT+e6/165tFTkFaIMbfSyWVJcjuLfBZ80vjLoNMVep9Ac6yAb X-Received: by 2002:a05:6a20:9194:b0:199:8ae6:6419 with SMTP id v20-20020a056a20919400b001998ae66419mr5496072pzd.1.1705942711693; Mon, 22 Jan 2024 08:58:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705942711; cv=pass; d=google.com; s=arc-20160816; b=w/O7mc/J0iGxrThyyAVn74QQbXiwPK0mWAu+FiUdWuvT9/AlnK1EkAKKtOMJ6P7mYq xjDPmKlxxmqybvxsGVwBPm2AbmkTpBjOUAWeDfNajREICvdhLQtoY1f3KsvWK1t7CkDo IMEqBCMvYvY0rJwSMfSiXAHVCMo1hW9xkjCxjeFIkkmIbCbsX1APaWd8XvYqBTIY3QIR k5TB3O+/KEhHX65/IPxpWL8vrx2iX3DYfhXFNOLB6OKAwD/DXCDoXesHSbUr9oYox3l/ oc0BPeXP/EKecbNt676vCvRomCnPrnUv9AlydswRer/F+qChlS9/Dq0XRlrpo9RX75EH PH/A== 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:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Ad8iZ7cAOLjC59VsXGmNvP0Dte+iZHPsXSv80mGa8CY=; fh=zJ6tyQPSPJtpNE1kDDjqZJNbBRQIRffCQQMnrzX3sgI=; b=VB3hsP8BtAdazXJSha9fkpg/SDon6ySRI43kKyXGzRmgRwp+Hlu1M8mpRcgdhJAlo4 5BLfVCW8edY38rpQ0h8erVmbt8q+BZRim4/Wu6UYw0xsFEobHY3BZOhEzOzHegmSBjyp Ezraq42YlnlIbjlZE0qHaYQI78FCqK7hWNhatE32i20TcxKHzDbA1NKkKoWLF9+MXxc2 6Oa8ejfixKPuuUJmgROQxA9STX6Qh2ktVyL3/h7Ex2eBHOSaq6PiXzWy1ehNPb+TkoE8 WxHof5wHEJH2CpooqBMUsRnq9L4jRQHD64PMosp/RbY+Ipd1WPmU7q0HKtB4HlxjiBdg +/ng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=aVCff82c; 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-33602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y6-20020a63ce06000000b005cdf71e2b13si7976305pgf.633.2024.01.22.08.58.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 08:58:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=aVCff82c; 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-33602-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33602-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4F2C5282C80 for ; Mon, 22 Jan 2024 16:57:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CDAF5F842; Mon, 22 Jan 2024 15:30:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="aVCff82c" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 723B53D963; Mon, 22 Jan 2024 15:30:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705937434; cv=none; b=ZcaW5xhWQDpTf2MMTGr73OIl9U8GjY37a/GoJ5+04Ns0gQUCK8f0YSlP9nGK63xJL90k2Z4aas9yj3YahoVkuXUGP76pTh4NPKuG29WPZSCUW5jQg6VWaiInq/zynT4PwOZ+LiHw42cGO54hKD3tcHSuZrmxw+5hgcpjVKg+Tc8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705937434; c=relaxed/simple; bh=gVMMJSucJVrsOQI7wa8WRq4Iqy9YmtcGWO5GPgFu3T4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KxjCU+cXCOndsPlWnK+JUnyiN+lqPGtP2Q4cWmjVZRi0lJ8gShwsQIFF7dRmxZdekWXVO7Kk0FQrakkWbKCIutFGY0pnAdX5687/fJYFVYrysGdsNQ+3btAWFltSqwQKWHYtRLzCDePYH5ueCvnuJpb9EGV7FaGFd50lQ6+eX/g= 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=aVCff82c; arc=none smtp.client-ip=217.70.183.194 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 E11E740005; Mon, 22 Jan 2024 15:30:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705937428; 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=Ad8iZ7cAOLjC59VsXGmNvP0Dte+iZHPsXSv80mGa8CY=; b=aVCff82cAuUdGWnH6XJ5zxRCCb74hOkkbM+j+P+f8CkTkim32vuf+HKFY9Kt2/sX+1eDq1 3s/POnlwJJi2GuKXxbTIMbWYpV/NbIqDQBnJ4zlAaMiyVmVn+eqSpBsrMxnYcSX2zvNW3k 3N5pReSGFlppvUTmwSqQxqa1kXzcXd+ErnfpGawcUR4dvFZIJjjwoOyrTuluKifAAp1BNx HvdRodBSQRvBf3KlAenpmTj6amh/BRx3m5fsVT8T95utZkNphW4e1R2MINb4jt+L0hVCN7 vzwZ9lmNs1zn5a1nWyNnE6oYFbm2hZUkfOYNsOfddRAWok8+bjtjY5uUNSOVRA== Message-ID: <9cb47f37-bd98-4136-b844-33cf2be593df@bootlin.com> Date: Mon, 22 Jan 2024 16:30:26 +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 Content-Language: en-US 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> From: Thomas Richard In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: thomas.richard@bootlin.com Hello Andy, On 1/15/24 21:13, Andy Shevchenko wrote: > On Mon, Jan 15, 2024 at 6:16 PM Thomas Richard > wrote: >> >> From: Théo Lebrun >> >> Add suspend and resume support for rc mode. > > Same comments as for earlier patches. > Since it's wide, please, check the whole series for the same issues > and address them. > > ... > >> + 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]. > >> + 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 > >> + gpiod_set_value_cansleep(pcie->reset_gpio, 1); >> + } > > ... > >> + ret = cdns_pcie_host_setup(rc, false); >> + if (ret < 0) { >> + clk_disable_unprepare(pcie->refclk); >> + return -ENODEV; > > Why is the error code being shadowed? Yes I should return ret instead. > >> + } > > ... > >> +#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). Regards, -- Thomas Richard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com