Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5881994rdb; Thu, 14 Dec 2023 02:15:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBHaRYNRHaGAv7VzfXRdC7t8dFJH2dv5KU05GF3NbcLAjNr1NHrFPv0hnAR49Ke2nwWZz5 X-Received: by 2002:a05:6870:858d:b0:1fb:2f58:f1c4 with SMTP id f13-20020a056870858d00b001fb2f58f1c4mr11470541oal.48.1702548958918; Thu, 14 Dec 2023 02:15:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702548958; cv=none; d=google.com; s=arc-20160816; b=gEqyO5NR31ZIaLD1RYXIrdZ0dGmxp9tK9jroRy13InRmn647yN9DcRMkIME9GmgvSd TcOmto5bPVIZtwroSwmIMti3hoP/ajXgZfRh7kJqCQF5Y/d2OWv/3ko4jl1el0G8v7HQ 3dce/AXZdsqsS/wFFWFvVTWqVaYePvJR5buqc/9Z2mI0EZ3PbTqaPf88vgCpVtX/KJdE rervNQ/oXaslhRXZn6yfz2R+NzYLEX/FL0RKHPnZFFnnpE81VyRd0y6T6P4jxbo35XWP 9Tp7u8ULuhyBW/js1Qd1fGixKqXLIgvOUa6oSmvM3uvYkvW0M1hWUljzWztM+AQO47wO oVZw== 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=QUdVNRKMX4Cx5Orml+0GGoXetMeFfZaZP2784m2QjJ4=; fh=dJPXUZpm3ndRQIjSRlIjSBKiorDZr4VXyWyVKkLdp/Y=; b=alZll49a9pPaRQxbl1akxyutPH22Vj5pdDJgVwsF+qsV45mu1Jp+WaGwGvNIW/gwEN 0CNrJnxeYtBAQfy9RNEDOws77IFiOC3sHNK8oViMIwYrd4kNFLEOZHR21mts6bNR/Wi4 RjY3ZzewbNfhGIfQlBdgm4k8HRYeN0UIugp9L8jKgJwUoDBbIxP2vt9fN3kwC/fvkVqS 4Jypi6yZMqzOpndgRsUuFPCYgS5JsLXfwMLu16ZrFFxpwAdfOJZ6BROcbi6lH8QUIvi4 4aXzzMI7FDclElx1U0d69e1QGWGIIuNY9nsQ2Lf106LOrxsM3zd97LwcFi0ahoRDbDk+ Xqpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PMPPUwlQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id m2-20020a632602000000b005c2122e482csi11204257pgm.700.2023.12.14.02.15.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 02:15:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PMPPUwlQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 8CF69802AA2D; Thu, 14 Dec 2023 02:15:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443583AbjLNKPV (ORCPT + 99 others); Thu, 14 Dec 2023 05:15:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443555AbjLNKPU (ORCPT ); Thu, 14 Dec 2023 05:15:20 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A172E0 for ; Thu, 14 Dec 2023 02:15:26 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1d0ccda19eeso47907755ad.1 for ; Thu, 14 Dec 2023 02:15:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702548926; x=1703153726; 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=QUdVNRKMX4Cx5Orml+0GGoXetMeFfZaZP2784m2QjJ4=; b=PMPPUwlQeWlfUbRz2K+1wkZ3Zs+JvLCb26+QR59t0S8IrTd0GyONhnepM4rnPNlmWl Kz9mp39PgMYQYOprDf757gj0rP6Y+l8JqdhZHYVhTnUQvq5HTYlMVKPE7PQEg18Gq+HD ZSIGq6WSUJrXy+frw1r/OuNEP13GvktYJbcSsETuB7utd7SgaBtu2geXn3Id3IcHHRqc rch2RQGbWoNQwosB3zyiEDrHn3T8lziY6/rBs8QqmnRYwaLl4CZ2d6mz+I+Gta6R9U9v c2GFEuIhqGllUe5MvgpmBEqLvTcMhqdNLiigkLgg6hHJ8EhhhZly0VVyIJ5uetc9XjAP munQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702548926; x=1703153726; 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=QUdVNRKMX4Cx5Orml+0GGoXetMeFfZaZP2784m2QjJ4=; b=TDwnSA/wG5MNy6yTYa+YB8hi7UgoKGXAfa7Xur7bNCzf8/tmP/tBv4SE7nySQBBf66 2pQL+NmL3gp0cb7GROSaEcSwUlhi1N9RJgCkC2yaOHnXsKZFU2ckQb2e+wWEf17l2QWS Unl1VpEV4DZJBBQILyTTvC0WSnF+FHK+mmZ9wVdo23DUKU1nfdiTLx8FYmZuKlWRSkyP RTGQ5gfeTwpQDe7ZvkZ9QFD8Sk7e3F8yyWLHKThvcEowxqZtrybgCb9r2PUJ5aRkAusW 52Zc2MWJTdCPZpVG3qwJjZD2OvW2hU5EUrjM33Hl7+c5hmrjld13dRnUdsNL92J78eL0 9+eA== X-Gm-Message-State: AOJu0YwC4fR3S5jwZakJC8IfCrhdGMcWu6koZ11MvJ63LJHUK4baSGxk utK1mrKWwz2w9OGAdrY+lU++ X-Received: by 2002:a17:902:6e02:b0:1d3:2e0d:cd98 with SMTP id u2-20020a1709026e0200b001d32e0dcd98mr3152463plk.105.1702548925560; Thu, 14 Dec 2023 02:15:25 -0800 (PST) Received: from thinkpad ([117.216.120.87]) by smtp.gmail.com with ESMTPSA id u9-20020a170902e80900b001d0c37a9cdesm11989727plg.38.2023.12.14.02.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 02:15:25 -0800 (PST) Date: Thu, 14 Dec 2023 15:45:15 +0530 From: Manivannan Sadhasivam To: Sherry Sun Cc: Hongxing Zhu , "l.stach@pengutronix.de" , "lpieralisi@kernel.org" , "kw@linux.com" , "robh@kernel.org" , "bhelgaas@google.com" , "krzysztof.kozlowski+dt@linaro.org" , "conor+dt@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , dl-linux-imx , "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V2 0/4] PCI: imx6: Add pci host wakeup support Message-ID: <20231214101515.GJ2938@thinkpad> References: <20231213092850.1706042-1-sherry.sun@nxp.com> <20231214051328.GD2938@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 14 Dec 2023 02:15:39 -0800 (PST) On Thu, Dec 14, 2023 at 10:03:51AM +0000, Sherry Sun wrote: > > > > -----Original Message----- > > From: Manivannan Sadhasivam > > Sent: 2023年12月14日 13:13 > > To: Sherry Sun > > Cc: Hongxing Zhu ; l.stach@pengutronix.de; > > lpieralisi@kernel.org; kw@linux.com; robh@kernel.org; > > bhelgaas@google.com; krzysztof.kozlowski+dt@linaro.org; > > conor+dt@kernel.org; shawnguo@kernel.org; s.hauer@pengutronix.de; > > kernel@pengutronix.de; festevam@gmail.com; dl-linux-imx > imx@nxp.com>; linux-pci@vger.kernel.org; linux-arm- > > kernel@lists.infradead.org; devicetree@vger.kernel.org; linux- > > kernel@vger.kernel.org > > Subject: Re: [PATCH V2 0/4] PCI: imx6: Add pci host wakeup support > > > > On Wed, Dec 13, 2023 at 05:28:46PM +0800, Sherry Sun wrote: > > > Add pci host wakeup feature for imx platforms. The host wake pin is a > > > standard feature in the PCIe bus specification, so we can add this > > > property under PCI dts node to support the host gpio wakeup feature. > > > > > > Example of configuring the corresponding dts property under the PCI node: > > > wake-gpios = <&gpio5 21 GPIO_ACTIVE_LOW>; > > > > > > > As you mentioned, WAKE# is a standard sideband signal defined in the PCI > > spec. > > So the support for handling it has to be in the PCI core layer, not in the host > > controller drivers. > > > > There is already a series floating to add support for WAKE# in PCI core. > > Please take a look: > > > > https://lore.k/ > > ernel.org%2Flinux-pci%2F20230208111645.3863534-1- > > mmaddireddy%40nvidia.com%2F&data=05%7C02%7Csherry.sun%40nxp.co > > m%7C0254c001df61498c09d408dbfc636f5c%7C686ea1d3bc2b4c6fa92cd99c5 > > c301635%7C0%7C0%7C638381276239824912%7CUnknown%7CTWFpbGZsb3 > > d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0% > > 3D%7C3000%7C%7C%7C&sdata=IoBAwTy0qeb0J6JrK0WRhI8A4ThUfkVx6mri > > ve%2BK5xs%3D&reserved=0 > > Hi Manivannan, > I checked the patch set, the implementation of host wake gpio is different from mine, I referred to the mmc bus cd(card detect) pin implementation and I think it is simpler and clearer. It's not just about simple and clear code, but about scalability. See below. > Regarding whether the WAKE# support should be moved to PCI core layer, we may need more research and discussion. Thanks for your suggestions. > We can research and come up with a better solution, but the implementation has to be done in the PCI core layer. Otherwise, host controllers supporting WAKE# has to duplicate the code which is common. - Mani > Best Regards > Sherry > > > > > > - Mani > > > > > --- > > > changes in V2: > > > 1. Rename host-wake-gpio property to wake-gpios. > > > 2. Improve the wake-gpios property description in the dt-binding doc > > > to avoid confusion. > > > 3. Remove unnecessary debugging info in host_wake_irq_handler(). > > > 4. Remove unnecessary imx6_pcie->host_wake_irq = -1 resetting in error > > paths. > > > 5. Use dev_err_probe() to simplify error path code. > > > --- > > > > > > Sherry Sun (4): > > > PCI: imx6: Add pci host wakeup support on imx platforms. > > > dt-bindings: imx6q-pcie: Add wake-gpios property > > > arm64: dts: imx8mp-evk: add wake-gpios property for pci bus > > > arm64: dts: imx8mq-evk: add wake-gpios property for pci bus > > > > > > .../bindings/pci/fsl,imx6q-pcie.yaml | 6 ++ > > > arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 2 + > > > arch/arm64/boot/dts/freescale/imx8mq-evk.dts | 2 + > > > drivers/pci/controller/dwc/pci-imx6.c | 60 +++++++++++++++++++ > > > 4 files changed, 70 insertions(+) > > > > > > -- > > > 2.34.1 > > > > > > > > > > -- > > மணிவண்ணன் சதாசிவம் -- மணிவண்ணன் சதாசிவம்