Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp578520rdb; Thu, 30 Nov 2023 12:18:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHG9r87YSkEEl5u4Hud8TAkScDmDjXqmrVImvoopXIt+i2hn9Q0B+9sM51jTG+ycZozkoQw X-Received: by 2002:a05:6a20:258c:b0:187:9521:92b9 with SMTP id k12-20020a056a20258c00b00187952192b9mr21494551pzd.53.1701375487108; Thu, 30 Nov 2023 12:18:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701375487; cv=pass; d=google.com; s=arc-20160816; b=Yt9QSfOvg1kwUBZszD0o7bxXkpmh03itvQilXCSFroRFwrXotLhWwFl45pElgdrj/8 MWcxIqFL/D3uPQjJ04yRLMQNzY6yMsdqaEibTtORnVC6F8W3oCA+f0q5CjXvrP1GYu0z s/5vsPvjH4dwquFl4mpfShKPltzCGb6T+TWKg6LP9thPHMXChl3ALkdJij4iQc0fSp0O MA0L3S27P95f6Zouu7+jZ6F0Un41aUQYP3KMTLyaIrjVKKAvvjD2PxYDNzy1SlE6yfJ4 HKTejd/Yf3MDr3Lxv16XlCiIo4U4dyGru2ZxCx9inar/ZwM6D9Nvbtu/6ieqdOCcS7SN wmVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to :content-transfer-encoding:content-disposition:references:message-id :subject:cc:to:from:date:dkim-signature; bh=B6d2dxoOPTVQLUSqU3ggt4ZWS29MC9i2Alq0HpoNNsw=; fh=wMLl7litVbAmU17VUbv8dhTByAcdgK4QJjBh/i1+THk=; b=nPpT7P13dQZAvcPFagagT8eRMQBn0R5iOcdMBgFFvfkbVCPT1poqH9msU9E7h8efg2 J/JFZs0LdOBrxrTbH+YruEVgEpOR2onPpkBfpbWEloiELn9qYogM/ulhW3cZbMNY0A5U YKm+XykylEOS5Nh17WljYIQRUNxPD/yH4oakvvDUy/J33wiSmRvwvTIMgC1VQxBRN0A4 jH3+cv0iqdNi6EaMOfVKahwb92rNCNOef76SpqXTRrHGFHkFicq6VDw1Zf5KLtzoVhKG hV3RxInFuaHZ9ws85ZFEyCUzoqr7Mu71m3c0UpY5pzNwrZLnlV//oMDIUj3wo5sBZEGN eQVg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="V9ij63/B"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id d4-20020a056a0010c400b006cdeb7e9f6dsi1738456pfu.234.2023.11.30.12.18.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 12:18:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="V9ij63/B"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 49D7C808739A; Thu, 30 Nov 2023 12:18:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229982AbjK3URv (ORCPT + 99 others); Thu, 30 Nov 2023 15:17:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjK3URp (ORCPT ); Thu, 30 Nov 2023 15:17:45 -0500 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2048.outbound.protection.outlook.com [40.107.22.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CB3A1712; Thu, 30 Nov 2023 12:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PcyPuhDGJuQ0h2cVAmsoWJQ4OLsWRctkl/TlZS+0S2D8E79G8Ao+q5dspgvSEupDXT1mLP6gt6qtOsOP/J+UcbLxNyzVlQMMF09nSI5/q4SjSOuVokeTgsbt0fNd901/d4gWUhJ8an9V9kv0yInFEy1t5B54tRNg7+HoYdffeHcYrIZUPjCqziKO+D9SxaS0kb4/sZqYgfbDwyWlWy5iGwlpmJnGTCu4Jstsj3N27Ai05dFYcs/Yr0wdDdnru3aCMgrICCdfZjTHiqcmpClWsDsBD8dqLvwJD89YSUOTE4M2jyQBB+KukWqG13T3kqFNymbOPhu6KzexYfNZZhAykQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=B6d2dxoOPTVQLUSqU3ggt4ZWS29MC9i2Alq0HpoNNsw=; b=UTriP18QkYAPQP560AkIDijaxqU4/5shIbiLsJDihY80jCKUmo5gCxdrQY3vdaYEeD+4IDclWwEejPcsyIYnLAo26YsksEG3Sbza8xaHYVDRj1D3Qix3i7QyuWhZoZ6S+6pU3V9kcW+ENF9ueHQblbSzvLjRjbUKkqx1gdUPgalSeO0QQ0amSZZ/duPe5isYgrYjE2ceOJSkAGQxt/1YfIeNNqm8H3vCxZHpC9FevvJrQEPgVbHBfn/VC9X8fiZIfY00HV6HrH4P7L64dkRaNv7R7/ZQ6KyJO2c0M0gA03wwB7gRpoPIjWC+41dnUeB7ZuwTryzPGeIYUn+fZc7w8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B6d2dxoOPTVQLUSqU3ggt4ZWS29MC9i2Alq0HpoNNsw=; b=V9ij63/BqDb6iZqaIvQI/uzpySBigOU6ipMbk5aR1Ldjqecjc8TXEqRx4zmvSn1EqjOiJZH4ppE9F8NM3JBpEaexZO1tV3b1jqoVxdZzAJ7HRiWSo8WfkmcaisJgcrFjB1jdlF141WmaZDJJcyrjcc8N4fhm0iKgq3vFmDQb9eA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by AM7PR04MB6838.eurprd04.prod.outlook.com (2603:10a6:20b:10a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.13; Thu, 30 Nov 2023 20:17:47 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%6]) with mapi id 15.20.7046.015; Thu, 30 Nov 2023 20:17:47 +0000 Date: Thu, 30 Nov 2023 15:17:39 -0500 From: Frank Li To: Manivannan Sadhasivam 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 v4 4/4] PCI: layerscape: Add suspend/resume for ls1043a Message-ID: References: <20231129214412.327633-1-Frank.Li@nxp.com> <20231129214412.327633-5-Frank.Li@nxp.com> <20231130165100.GV3043@thinkpad> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231130165100.GV3043@thinkpad> X-ClientProxiedBy: BY5PR20CA0003.namprd20.prod.outlook.com (2603:10b6:a03:1f4::16) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AM7PR04MB6838:EE_ X-MS-Office365-Filtering-Correlation-Id: b23661c9-8a0d-4b5a-8fb4-08dbf1e16b10 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UpIrmstMw2HNIrIflCXkcCwQQLTbks4pEUqLE8HE9i6dwnnMoRrBgBS4E3tqFt5DR7y9BCHzIe+AP2deNqHDlvpCRDRVOk9tQhWPtr5Kf/5M0OIv7Q/AnGpPQpkpu0CN1D1DJSHLE+9llr3sURIdK9VjoJi5W9BUPqgKToxFfknzL7Jz9UksCEgyIgMEf6OcK34DhI0ZsyXo1nYE0rIhB+BEQU8bMK0bcYsRwkFvobUd2CbUO8x+BiliEvgTWBk+2JE8kvgh+sAPHtwruiKvtiQfPIqnKsynKsia9k7FF/Zj59lzW9MNTnSzIINPZ42v58sl4TPw+gRkcND5MCoPkIWtS49d5iOtbGUPl6or4L0Na13HR4qFsJMiHtGNPuD4MosIBl7q3Xa0k+c3Ca9RtoJV5GyrYwgSTnTsCY5OhXrZND3Tl+aTYpH4I7wKez3v5T93+nbrHLaenPulh8ORNm+9pvwwKA+cnPhoQ6DLkHP8AZcGGJ5++BKERvVZ9P3NSIvdVM8JLqHEEaQ4BRUoH+raQB0PqGQ4sEKwz1RoZmnG+HGMDd+FjTvDGvZB46yN/NBBj7T25Y5Nxsm1zYp2Wmswd3MqSEljua5zfkEKW2lfZPUsgUgk6eYIQURG5BdCiGfBWvIPnmBEEJr3ih/++OkqvpNJkdmBv6YRjMMsJnw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(396003)(376002)(346002)(39860400002)(366004)(136003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(38350700005)(86362001)(66946007)(66476007)(6916009)(38100700002)(83380400001)(26005)(6506007)(6512007)(52116002)(9686003)(6666004)(2906002)(316002)(33716001)(66556008)(15650500001)(6486002)(8676002)(5660300002)(478600001)(4326008)(7416002)(8936002)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Wk92cmJTeGxqNjBZTUIvMlprUjdQQjVocTR0UEpCOU9MWjZaQkFOeFhxaDN4?= =?utf-8?B?OTE0aEVTbTNBZ0FUQ1FYN21mR3Zuem1lZElZakhJMkc4dWdkSjhYYzc4T2cy?= =?utf-8?B?djhheVVZZDY5NTkwMGlySE9hSHlzckc4OUU5bzBWNmhuK3c5a3F3VDg4WnNs?= =?utf-8?B?dFFhYytOSnJOTERvZHE5SmdETHVTRzdMU2lKWHJ2dThFTlZURGxGamROY0Q2?= =?utf-8?B?OVVlN1FHdlJLeHN1Q1ZlUy84VnlKemhGOEh1QmNrVjB4SzU1b1RiWG1zY0JI?= =?utf-8?B?czNLMlZjNVRRNThpNlNB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?utf-8?Q?JOa4=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b23661c9-8a0d-4b5a-8fb4-08dbf1e16b10 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2023 20:17:47.3036 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: a94QdLmhZOBqXBW/9g/vIBLeicBcFf3kDqS0L29EGPIV7OXhEiU8u6lI09qFHQq3bb7zDKps/bCsckqCHVVFIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6838 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 12:18:04 -0800 (PST) On Thu, Nov 30, 2023 at 10:21:00PM +0530, Manivannan Sadhasivam wrote: > On Wed, Nov 29, 2023 at 04:44:12PM -0500, Frank Li wrote: > > In the suspend path, PME_Turn_Off message is sent to the endpoint to > > transition the link to L2/L3_Ready state. In this SoC, there is no way to > > check if the controller has received the PME_To_Ack from the endpoint or > > not. So to be on the safer side, the driver just waits for > > PCIE_PME_TO_L2_TIMEOUT_US before asserting the SoC specific PMXMTTURNOFF > > bit to complete the PME_Turn_Off handshake. This link would then enter > > L2/L3 state depending on the VAUX supply. > > > > In the resume path, the link is brought back from L2 to L0 by doing a > > software reset. > > > > Same comment on the patch description as on patch 2/4. > > > Signed-off-by: Frank Li > > --- > > > > Notes: > > Change from v3 to v4 > > - Call scfg_pcie_send_turnoff_msg() shared with ls1021a > > - update commit message > > > > Change from v2 to v3 > > - Remove ls_pcie_lut_readl(writel) function > > > > Change from v1 to v2 > > - Update subject 'a' to 'A' > > > > drivers/pci/controller/dwc/pci-layerscape.c | 63 ++++++++++++++++++++- > > 1 file changed, 62 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c > > index 590e07bb27002..d39700b3afaaa 100644 > > --- a/drivers/pci/controller/dwc/pci-layerscape.c > > +++ b/drivers/pci/controller/dwc/pci-layerscape.c > > @@ -41,6 +41,15 @@ > > #define SCFG_PEXSFTRSTCR 0x190 > > #define PEXSR(idx) BIT(idx) > > > > +/* LS1043A PEX PME control register */ > > +#define SCFG_PEXPMECR 0x144 > > +#define PEXPME(idx) BIT(31 - (idx) * 4) > > + > > +/* LS1043A PEX LUT debug register */ > > +#define LS_PCIE_LDBG 0x7fc > > +#define LDBG_SR BIT(30) > > +#define LDBG_WE BIT(31) > > + > > #define PCIE_IATU_NUM 6 > > > > struct ls_pcie_drvdata { > > @@ -225,6 +234,45 @@ static int ls1021a_pcie_exit_from_l2(struct dw_pcie_rp *pp) > > return scfg_pcie_exit_from_l2(pcie->scfg, SCFG_PEXSFTRSTCR, PEXSR(pcie->index)); > > } > > > > +static void ls1043a_pcie_send_turnoff_msg(struct dw_pcie_rp *pp) > > +{ > > + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); > > + struct ls_pcie *pcie = to_ls_pcie(pci); > > + > > + scfg_pcie_send_turnoff_msg(pcie->scfg, SCFG_PEXPMECR, PEXPME(pcie->index)); > > +} > > + > > +static int ls1043a_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); > > + u32 val; > > + > > + /* > > + * Only way let PEX module exit L2 is do a software reset. > > Can you expand PEX? What is it used for? > > Also if the reset is only for the PEX module, please use the same comment in > both patches 2 and 4. Patch 2 doesn't mention PEX in the comment. After read spec again, I think PEX is pci express. So it should software reset controller. I don't know what exactly did in the chip. But without below code, PCIe can't exit L2/L3. Any harmful if dwc controller reset? Anyway these code works well with intel network card. Frank > > - Mani > > > + * LDBG_WE: allows the user to have write access to the PEXDBG[SR] for both setting and > > + * clearing the soft reset on the PEX module. > > + * LDBG_SR: When SR is set to 1, the PEX module enters soft reset. > > + */ > > + val = ls_pcie_pf_lut_readl(pcie, LS_PCIE_LDBG); > > + val |= LDBG_WE; > > + ls_pcie_pf_lut_writel(pcie, LS_PCIE_LDBG, val); > > + > > + val = ls_pcie_pf_lut_readl(pcie, LS_PCIE_LDBG); > > + val |= LDBG_SR; > > + ls_pcie_pf_lut_writel(pcie, LS_PCIE_LDBG, val); > > + > > + val = ls_pcie_pf_lut_readl(pcie, LS_PCIE_LDBG); > > + val &= ~LDBG_SR; > > + ls_pcie_pf_lut_writel(pcie, LS_PCIE_LDBG, val); > > + > > + val = ls_pcie_pf_lut_readl(pcie, LS_PCIE_LDBG); > > + val &= ~LDBG_WE; > > + ls_pcie_pf_lut_writel(pcie, LS_PCIE_LDBG, val); > > + > > + return 0; > > +} > > + > > static const struct dw_pcie_host_ops ls_pcie_host_ops = { > > .host_init = ls_pcie_host_init, > > .pme_turn_off = ls_pcie_send_turnoff_msg, > > @@ -242,6 +290,19 @@ static const struct ls_pcie_drvdata ls1021a_drvdata = { > > .exit_from_l2 = ls1021a_pcie_exit_from_l2, > > }; > > > > +static const struct dw_pcie_host_ops ls1043a_pcie_host_ops = { > > + .host_init = ls_pcie_host_init, > > + .pme_turn_off = ls1043a_pcie_send_turnoff_msg, > > +}; > > + > > +static const struct ls_pcie_drvdata ls1043a_drvdata = { > > + .pf_lut_off = 0x10000, > > + .pm_support = true, > > + .scfg_support = true, > > + .ops = &ls1043a_pcie_host_ops, > > + .exit_from_l2 = ls1043a_pcie_exit_from_l2, > > +}; > > + > > static const struct ls_pcie_drvdata layerscape_drvdata = { > > .pf_lut_off = 0xc0000, > > .pm_support = true, > > @@ -252,7 +313,7 @@ static const struct of_device_id ls_pcie_of_match[] = { > > { .compatible = "fsl,ls1012a-pcie", .data = &layerscape_drvdata }, > > { .compatible = "fsl,ls1021a-pcie", .data = &ls1021a_drvdata }, > > { .compatible = "fsl,ls1028a-pcie", .data = &layerscape_drvdata }, > > - { .compatible = "fsl,ls1043a-pcie", .data = &ls1021a_drvdata }, > > + { .compatible = "fsl,ls1043a-pcie", .data = &ls1043a_drvdata }, > > { .compatible = "fsl,ls1046a-pcie", .data = &layerscape_drvdata }, > > { .compatible = "fsl,ls2080a-pcie", .data = &layerscape_drvdata }, > > { .compatible = "fsl,ls2085a-pcie", .data = &layerscape_drvdata }, > > -- > > 2.34.1 > > > > -- > மணிவண்ணன் சதாசிவம்