Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp516504rdb; Thu, 2 Nov 2023 09:58:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZ8rEfeohyCJWnCQSS732x7V4Y03MFepAlba7iprMVmwVpOq3MYbRpXHSIETMmPEpFm6cY X-Received: by 2002:a17:902:db0f:b0:1cc:5aef:f2d1 with SMTP id m15-20020a170902db0f00b001cc5aeff2d1mr12561043plx.25.1698944323212; Thu, 02 Nov 2023 09:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698944323; cv=none; d=google.com; s=arc-20160816; b=ROWuGoqeLQf6QUb1ZFLdG64T6gpJVHXenoI7Rt4PPDujQ1FsVPLFN7wduyBnxjopG8 5j3b0fi10yl5AmSUxzUwoJxbXWqTWjOPCMHbxhDmCydBzjEnsdq0ojHeF9tK5YH9Lg2N ibIRVu1qo2d8lQerja6z0b9a+jvqXAUKKNA1d2PXFUC8vmLvxoUgh/ETYy6GKw3IaiUs RcmUhmOfUp+Sbs0TguLV4BDysqPEhnX+9onzh3fYtXzk44vt7MQRxYkp6hwi9904oVMh Jp/8WTAucbi4cBxbofKIOtF0AgKJRnb9mm620zOhsO5Z8xw9Ui+kYVWm9mW+iXrEtolP QTLg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DfyS21pSAaN9Ul5DPXfGOsxbkU+EJCrhzTnYRsGJibU=; fh=m5kJ7K68eeTVidLlN9bOmoHTd7rLVwAhIyCccK14kOA=; b=T08D4R5AmV+AGWcA43JN3jv2ad9b7Ot9ZX6Pc2p11lx0o69sjXdHhAQYX7Lt2HM/Hz pWZVyYqDjn2bmQKHRmt/Zuqc5q0G/d9i3E8qheWt4s3Z1ZEw4RXJON8BOUFNzPnGctfl 3Bn741yE28zX7kNrz8nxVc93PInXcWfPEhPLdVVL7JNpaYnsH0XWt7bpAAYxpUUDTIZJ e+3c8ljfRxxYCFaaxIPdHy1otkNykTPk0qWiQz42bD2OdXX+59qkMUNym6ZavEvSgPPa aKzWe5htEMfuLdIjcLUtYjWsJeuGLYbS5B+IeI99Ln/bCaEzNQzabxP0p7xQH42bqxVT Al8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vYWJ6IGz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b1-20020a170903228100b001cbe7f1db37si149731plh.331.2023.11.02.09.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 09:58:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vYWJ6IGz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5A73A837D94F; Thu, 2 Nov 2023 09:58:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377110AbjKBQ61 (ORCPT + 99 others); Thu, 2 Nov 2023 12:58:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347676AbjKBQ60 (ORCPT ); Thu, 2 Nov 2023 12:58:26 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00500186 for ; Thu, 2 Nov 2023 09:58:19 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3b5714439b3so649706b6e.3 for ; Thu, 02 Nov 2023 09:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698944299; x=1699549099; 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=DfyS21pSAaN9Ul5DPXfGOsxbkU+EJCrhzTnYRsGJibU=; b=vYWJ6IGz5IiUWVcVOfopIIgzUrafHCoeoKUcwGX4ujQGvv/ctstHPGnqvsYG1BzbXy uTJ1L76cG8eawcblL/ksFM64CzBabkXyqE1tiAODx0lfzUa7/RKKARl97lzUFLI/YqsW qEPaSgwIXt3+PYRYLaco91rSMRk4q58GGRIu0Y+pHYRZ6856j5tCKgl6DBqm6udYbSTn /e0KZFAW/hcqUsNtOoLpU9O+1G6fa8cHKLBRhsAWEdm3uJBeoZDDDch8IGKyInQS7AAQ FUzIY2sJgmKAxSoo7MAM8EPP5+MYVK1UV+OVbUbafwq2iSzhCda5h7SxzH3pNb23jKXx P36A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698944299; x=1699549099; 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=DfyS21pSAaN9Ul5DPXfGOsxbkU+EJCrhzTnYRsGJibU=; b=gN8NDO0GnuthBvY74oFqquab6gAulQTUIm7RYf+YSCLCc0NH8Ks2wfuJ0m0nrKbjcv YwTRopXAN6jinhshC2koi1oLdQsEbtIwnvtV/x7s4oNuQXjEywAzqM1ZEj+MV71201ud FakqR9K59T6744uyh5+/w1wpCPmOQLBr5gyPLuGFUk+wq6Vlkbj1CTWB74bpuvlay2Bs FN2zvbFR3dW/t1XJTWquWXIr/T1WORfEaUeQmTyQkxaREizFa8Gx1zJhe+rnPa1iNns7 GghIyzeOQSGaOUAu6oHCHAg8fiOCxWT4yFQlw6UHqW7qtOnuSWd+GkHaC1uvua6BgE5r wh7w== X-Gm-Message-State: AOJu0YwL8m6xR1Gpgw2DAcO1P3Mm1zVTInvLRYDzTcR4u22opraYeTTn 7xQnp3+PEESyTadZw/W9zh1v X-Received: by 2002:a05:6808:209f:b0:3ad:fe8d:dfae with SMTP id s31-20020a056808209f00b003adfe8ddfaemr20056494oiw.57.1698944298897; Thu, 02 Nov 2023 09:58:18 -0700 (PDT) Received: from thinkpad ([117.217.189.228]) by smtp.gmail.com with ESMTPSA id z26-20020a05620a08da00b0077263636a95sm89742qkz.93.2023.11.02.09.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 09:58:18 -0700 (PDT) Date: Thu, 2 Nov 2023 22:28:08 +0530 From: Manivannan Sadhasivam To: Frank Li Cc: bhelgaas@google.com, imx@lists.linux.dev, kw@linux.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, lpieralisi@kernel.org, minghuan.Lian@nxp.com, mingkai.hu@nxp.com, robh@kernel.org, roy.zang@nxp.com Subject: Re: [PATCH v3 1/4] PCI: layerscape: Add function pointer for exit_from_l2() Message-ID: <20231102165808.GC20943@thinkpad> References: <20231017193145.3198380-1-Frank.Li@nxp.com> <20231017193145.3198380-2-Frank.Li@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231017193145.3198380-2-Frank.Li@nxp.com> X-Spam-Status: No, score=1.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SORTED_RECIPS,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 02 Nov 2023 09:58:39 -0700 (PDT) X-Spam-Level: * On Tue, Oct 17, 2023 at 03:31:42PM -0400, Frank Li wrote: > Since difference SoCs require different sequence for exiting L2, let's add > a separate "exit_from_l2()" callback. This callback can be used to execute > SoC specific sequence. > I missed the fact that this patch honors the return value of the callback (which was ignored previously). So this should be added to the description as well. > Signed-off-by: Frank Li With that, Reviewed-by: Manivannan Sadhasivam - Mani > --- > > Notes: > Change from v2 to v3 > - fixed according to mani's feedback > 1. update commit message > 2. move dw_pcie_host_ops to next patch > 3. check return value from exit_from_l2() > Change from v1 to v2 > - change subject 'a' to 'A' > > Change from v1 to v2 > - change subject 'a' to 'A' > > drivers/pci/controller/dwc/pci-layerscape.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c > index 37956e09c65bd..aea89926bcc4f 100644 > --- a/drivers/pci/controller/dwc/pci-layerscape.c > +++ b/drivers/pci/controller/dwc/pci-layerscape.c > @@ -39,6 +39,7 @@ > > struct ls_pcie_drvdata { > const u32 pf_off; > + int (*exit_from_l2)(struct dw_pcie_rp *pp); > bool pm_support; > }; > > @@ -125,7 +126,7 @@ static void ls_pcie_send_turnoff_msg(struct dw_pcie_rp *pp) > dev_err(pcie->pci->dev, "PME_Turn_off timeout\n"); > } > > -static void ls_pcie_exit_from_l2(struct dw_pcie_rp *pp) > +static int ls_pcie_exit_from_l2(struct dw_pcie_rp *pp) > { > struct dw_pcie *pci = to_dw_pcie_from_pp(pp); > struct ls_pcie *pcie = to_ls_pcie(pci); > @@ -150,6 +151,8 @@ static void ls_pcie_exit_from_l2(struct dw_pcie_rp *pp) > 10000); > if (ret) > dev_err(pcie->pci->dev, "L2 exit timeout\n"); > + > + return ret; > } > > static int ls_pcie_host_init(struct dw_pcie_rp *pp) > @@ -180,6 +183,7 @@ static const struct ls_pcie_drvdata ls1021a_drvdata = { > static const struct ls_pcie_drvdata layerscape_drvdata = { > .pf_off = 0xc0000, > .pm_support = true, > + .exit_from_l2 = ls_pcie_exit_from_l2, > }; > > static const struct of_device_id ls_pcie_of_match[] = { > @@ -247,11 +251,14 @@ static int ls_pcie_suspend_noirq(struct device *dev) > static int ls_pcie_resume_noirq(struct device *dev) > { > struct ls_pcie *pcie = dev_get_drvdata(dev); > + int ret; > > if (!pcie->drvdata->pm_support) > return 0; > > - ls_pcie_exit_from_l2(&pcie->pci->pp); > + ret = pcie->drvdata->exit_from_l2(&pcie->pci->pp); > + if (ret) > + return ret; > > return dw_pcie_resume_noirq(pcie->pci); > } > -- > 2.34.1 > -- மணிவண்ணன் சதாசிவம்