Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2104906rbb; Tue, 27 Feb 2024 10:42:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWanly5mS/NvD4HxpeStYTGD/nwiy+Bj940fWFOVOZ0jO+TZpEbHCpVU4VZ4iEI6HQoBJl1vGvSAcYzi6jOACGjVMql5PwOkum0yRscJg== X-Google-Smtp-Source: AGHT+IEA4f/Yw7BFiKKALFuHwbj+yCzIjlAiCWxUcTUT+WqWBifrhArz9EiIo8ASlfiFDBThfMaa X-Received: by 2002:ac8:5dca:0:b0:42e:a46d:722f with SMTP id e10-20020ac85dca000000b0042ea46d722fmr1325070qtx.23.1709059362989; Tue, 27 Feb 2024 10:42:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709059362; cv=pass; d=google.com; s=arc-20160816; b=eE0xJporQ5vf7IzPMIimIAgU1qGjp6JfpkA+kODeja82OoH82uRFAEboOjvBrZL4de 4b6FBqbu3650pgbXOmgAUdh444RbOHwU0oYUWJmB9XhPW5heiR4Vk3iNnEYMX3QTo9e3 FY/1kqix6Ic1bzoYDk/0LTBfpavRX1cTRXroiMYsPDS4GdnmmA+vRIcVbEYTJRn5v0xF nYvLRsxJe0F4laeFwv8McOTACrqP1ld0FL6npGDv9vBxv++spzMolbgHuPkUbbZ3RTbA /A55Cam3csPPwg2kxkELovLc6ULBIygYQlIwRPFCeXfH5/DEycLR85QY7wQFdv9a/+Dr vOIw== 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 :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+6rCPg+j8C1jvS9yOkEQeWpFYDNNuRJYfgnyrNY8KDs=; fh=/p7O2KKZ7E6+HeamyRQf9jBOmPxw0w2u3RUoXgC1kA0=; b=xta3nW2yIL8f+FHqVLnyNMJ/r68eO3pLqCWsEWwRVqecbIe//W0LDqpsv2VamVgQ4C PG4ReGnwp4t2DxzdxxMlYfwTWisI7fEh5wkxkymY0BaxApxamY/COLBP24M7OqgamVIl niT8tjlkMo0bx51uhoGyhPs4rqVQGFvAPMPhmMr9vlXLV7LR5k9b59KlQ0ebZh0+iIuy QGe1JLxPC7ANJG8u4wxuNPalDz4kv8Z8YHZ/Tx4GVpsG8rcdtzDtS33RYxY/ZgUOFkRl bjVznsCKw5PCauZ+nI3kY4t5DI2WtDcNLt/vcy1wgVN90C/BB92wuEa1d3S1Q0saIjpo FxvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OD4KwaAW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-83852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b24-20020ac86bd8000000b0042ea427730asi947839qtt.380.2024.02.27.10.42.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:42:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OD4KwaAW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-83852-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AE55D1C22B77 for ; Tue, 27 Feb 2024 18:42:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E690B4E1CF; Tue, 27 Feb 2024 18:42:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OD4KwaAW" Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AAC04C631 for ; Tue, 27 Feb 2024 18:42:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709059354; cv=none; b=biNcR+uiOSlGRICfujaaOeSA44TRY9O4926t/DfQfAlNaStVdgprPNUytjw7CFde4kz9XwrEN+xqkBrtUVX5xQtB8atbRg4lOqD5gbtMvIqEKylGeDxWr7ChpsMSRqlMh3PUzO6a31SxM6qfOTbhofbGVMdUIzp+FoWQ+n96N8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709059354; c=relaxed/simple; bh=TeDNuU90ly9acziamBX1PT4TgShziEBCnefgqu8SzNE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dpfTs1CHO5QbohCo9iBfmWQKV8Fr5QTptL5WAroO2+Q7e4j7hwESKD1lvHgvZO9KOcu4kOHzvW1xw8fispacg3YUy+s6slPwGSBkcc/beTMu5tKCyoio54wKnzngm1WfhFE3ASLJCaMe05MxAYPaeJipd0iqwCATCtqfXwKUb8s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=OD4KwaAW; arc=none smtp.client-ip=209.85.215.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-5cdbc4334edso3392573a12.3 for ; Tue, 27 Feb 2024 10:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709059352; x=1709664152; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=+6rCPg+j8C1jvS9yOkEQeWpFYDNNuRJYfgnyrNY8KDs=; b=OD4KwaAW5YRbf3nRwotlMQFuGPEEQqHOJ7Grl8+wj/23FYaYlioTcxFCEPN63qpWKD hcYHUCyBIGz+FtHeflthN/eGvK1w69FWDyuHH/KTYHjvrUdSKiUwNz0ZotyZ5POM2g4v yDZM1uFw1HbGFn088iaXuQyCN5hxuOaglTMjSrJ2IZwxiEDaZ1w7eAfSr8otQ4UJ0UIm Ef1sK7HMi64X4tr86rsDgPzHi49PF4Z1ZGCsAeYOKvF2qjg+Jl5qQRjoKTKbNNLYHj9C 41mq4i8R/qHdas64GsuSAmwzz/M/qED9491WlJtJW26KtBhCRSbuTKIiaDnE7IQkbIXV c8iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709059352; x=1709664152; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+6rCPg+j8C1jvS9yOkEQeWpFYDNNuRJYfgnyrNY8KDs=; b=FRlp3fm0r0i4TtN2zZOpIs0Ivw/smkH+sLXYfug4Dd+5wffokPLp5tsCjuNMWiI4GG 1liSJRklr8BntvwltGAS6Yhtiy8QAmaWV475G2ng29ZcJ5oMQzaFmc9kMapdFizbvXv9 M11V0N40T/t4fjzRZ8/EROrjVPbJAiJ7lDhNR5pqBsUQJfjGJFFSyHj/O34+P6SdiNlB +63w9SEFuyxFZyIandr2aYzshcvWSbm2f9zXitwm5e27E/nW2i2XN/ju7EStFlrIBo1G mlXvsvu78NS6VsxfgoYZHPLHZQ7p6P/7QUPI2wqY+wDDiIjXBrcKzMJIuY/ANAE/cA29 6HTQ== X-Forwarded-Encrypted: i=1; AJvYcCXMyfGvz/ctHy2tBZtPrGQsImW8CbdIAtaEKNwVtdpv5TpDOPu6DHtaBArX3Qqjbx4kUl+Nhuhio2fTfJ9+sgR1JhsgroAcM/g/+JwU X-Gm-Message-State: AOJu0YznixFXmnzE/NB1giBChLXRlPje25ejxIGoFCJkt4nb303JG1G5 lHrHM94zgj6c+y8zPYZ8ecDGaeYg5BOTJguuSF1WiELevA8yX1ACc1S8f88A/w== X-Received: by 2002:a17:90a:4285:b0:299:6a7f:cc09 with SMTP id p5-20020a17090a428500b002996a7fcc09mr7865801pjg.33.1709059351862; Tue, 27 Feb 2024 10:42:31 -0800 (PST) Received: from thinkpad ([117.213.97.177]) by smtp.gmail.com with ESMTPSA id nr14-20020a17090b240e00b00299332505d7sm3758838pjb.26.2024.02.27.10.42.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:42:31 -0800 (PST) Date: Wed, 28 Feb 2024 00:12:18 +0530 From: Manivannan Sadhasivam To: Frank Li Cc: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Marek Vasut , Yoshihiro Shimoda , Thierry Reding , Jonathan Hunter , Kishon Vijay Abraham I , Vidya Sagar , Vignesh Raghavendra , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Minghuan Lian , Mingkai Hu , Roy Zang , Kunihiko Hayashi , Masami Hiramatsu , Kishon Vijay Abraham I , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Niklas Cassel Subject: Re: [PATCH v8 06/10] PCI: dwc: ep: Call dw_pcie_ep_init_registers() API directly from all glue drivers Message-ID: <20240227184218.GT2587@thinkpad> References: <20240224-pci-dbi-rework-v8-0-64c7fd0cfe64@linaro.org> <20240224-pci-dbi-rework-v8-6-64c7fd0cfe64@linaro.org> <20240227122141.GN2587@thinkpad> 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: On Tue, Feb 27, 2024 at 12:28:41PM -0500, Frank Li wrote: > On Tue, Feb 27, 2024 at 05:51:41PM +0530, Manivannan Sadhasivam wrote: > > On Mon, Feb 26, 2024 at 12:04:33PM -0500, Frank Li wrote: > > > On Sat, Feb 24, 2024 at 12:24:12PM +0530, Manivannan Sadhasivam wrote: > > > > Currently, dw_pcie_ep_init_registers() API is directly called by the glue > > > > drivers requiring active refclk from host. But for the other drivers, it is > > > > getting called implicitly by dw_pcie_ep_init(). This is due to the fact > > > > that this API initializes DWC EP specific registers and that requires an > > > > active refclk (either from host or generated locally by endpoint itsef). > > > > > > > > But, this causes a discrepancy among the glue drivers. So to avoid this > > > > confusion, let's call this API directly from all glue drivers irrespective > > > > of refclk dependency. Only difference here is that the drivers requiring > > > > refclk from host will call this API only after the refclk is received and > > > > other drivers without refclk dependency will call this API right after > > > > dw_pcie_ep_init(). > > > > > > > > This change will also allow us to remove the "core_init_notifier" flag in > > > > the later commits. > > > > > > > > Signed-off-by: Manivannan Sadhasivam > > > > --- > > > > drivers/pci/controller/dwc/pci-dra7xx.c | 7 +++++++ > > > > drivers/pci/controller/dwc/pci-imx6.c | 8 ++++++++ > > > > drivers/pci/controller/dwc/pci-keystone.c | 9 +++++++++ > > > > drivers/pci/controller/dwc/pci-layerscape-ep.c | 7 +++++++ > > > > drivers/pci/controller/dwc/pcie-designware-ep.c | 22 ---------------------- > > > > drivers/pci/controller/dwc/pcie-designware-plat.c | 9 +++++++++ > > > > drivers/pci/controller/dwc/pcie-rcar-gen4.c | 12 +++++++++++- > > > > drivers/pci/controller/dwc/pcie-uniphier-ep.c | 13 ++++++++++++- > > > > 8 files changed, 63 insertions(+), 24 deletions(-) > > > > [...] > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c > > > > index ed1f2afd830a..278bdc9b2269 100644 > > > > --- a/drivers/pci/controller/dwc/pcie-designware-ep.c > > > > +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c > > > > @@ -729,7 +729,6 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) > > > > struct device *dev = pci->dev; > > > > struct platform_device *pdev = to_platform_device(dev); > > > > struct device_node *np = dev->of_node; > > > > - const struct pci_epc_features *epc_features; > > > > > > > > INIT_LIST_HEAD(&ep->func_list); > > > > > > > > @@ -775,29 +774,8 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) > > > > goto err_exit_epc_mem; > > > > } > > > > > > > > - if (ep->ops->get_features) { > > > > - epc_features = ep->ops->get_features(ep); > > > > - if (epc_features->core_init_notifier) > > > > - return 0; > > > > - } > > > > > > why remove this check? > > > > > > > There is no point in keeping this check since we are removing the call to > > dw_pcie_ep_init_registers() below. But I should've described this change in the > > commit message. > > Sperated patch will be helpful. This clean up does not related with other > change. > Well this is not a generic cleanup that could be moved to a separate patch. Due to the changes in this patch, the use of the flag becomes redundant. So it has to removed here itself. - Mani -- மணிவண்ணன் சதாசிவம்