From patchwork Tue Jul 24 18:17:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10542895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67883157A for ; Tue, 24 Jul 2018 18:18:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 520D22906F for ; Tue, 24 Jul 2018 18:18:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44E2E29077; Tue, 24 Jul 2018 18:18:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B746A2906F for ; Tue, 24 Jul 2018 18:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=mWM1gPORJ90RlSwEoJ+BERaMr2UqhUKo25/jfPxZ1Sw=; b=S/Sggbs/VlkxT7 /1x+aFc0UAUs2iq/roYdS6jA8ltL2x3MLcA2XCEacUwY8sSLu4DNHn/WYmfIiIoASJjONH4rmyirl yBp4ON73qziNsGemkT/zhHSMLGRmDDypGpE24f7TdJb3y2079nFZ3rrIqfrxWGlrLxUN9vPiLzBoO IasY22ZwwCxsnKLaOF4juGt9qCi0XV3l6vVbl5shaoAPg8DZL3u/TddNxwTYfJBHvFpsPpHdWOQdC qBZoPrCw63Hd9BUb6Rba3KWXAhDuk6E4ekcHhZSGAmMoWM5MP9idsZH3LQ2ADQ3NmdLRkLAtIahbc 3vh+5SVK9khUFTxfxSQA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fi1sx-0005xs-AN; Tue, 24 Jul 2018 18:18:11 +0000 Received: from mail-he1eur02on060b.outbound.protection.outlook.com ([2a01:111:f400:fe05::60b] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fi1st-0005vr-KF for linux-arm-kernel@lists.infradead.org; Tue, 24 Jul 2018 18:18:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vYG1lxLsTYHU3rAqt3pbkR0xfE216Y33h+4p/aHyXdM=; b=tSfS6PNMPNrJqWY7Gpo8um9++MXu18ziSiQ3Ev85pHuWrZVnnVtYI30ZQT/TMXgyQWyH/2JKh2nVGEgH5idqZ4/CxPKFgia7hvZYWFn8ym4yIKYoEFE65xAVUPFsgJ9/JNFV+8Z5N3mHk9E/W6f56rgSg3NiN4vAQpvfZveKiUQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.22; Tue, 24 Jul 2018 18:17:51 +0000 From: Leonard Crestez To: Ulf Hansson , Lucas Stach , "Rafael J. Wysocki" Subject: [RFC] PCI: imx: Add multi-pd support Date: Tue, 24 Jul 2018 21:17:38 +0300 Message-Id: <8018069bc772376caef29e76280e4d0facffdb68.1532455922.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: AM5PR0502CA0016.eurprd05.prod.outlook.com (2603:10a6:203:91::26) To VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae2c77a1-46cf-4e63-00d6-08d5f191c58e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4301; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4301; 3:x8D1F3UuR19idhx8JGL1U8ml0KS1S2ZZ4XQmSYIamg2wsZ4GOBPD8nitbTZaylnQ1V1LsUVEWSZtDbYRB4nhG+RmbgtB7a7dgHrk1gHeAtRMHnE3RhmwSi26h2LOzLKwcTJBf0Dnzn4CFNyjrT8byxr8zBH++AS+29rCiuCjGlCFAo6Xpr6qlvL1VIQRwCBv4hf0ZHHC2nI9CJ5+/iy+RMgDeUfkSPzh9J1wrjELegsnqTvyNQyVPh8nLJ7YCDtd; 25:V6mHEYemVmmMaOTR6QHzoswJQKMEDgn6JUGVzNbS9Xc4gkTzWzvLxXRvItN6+6jlyWYUEGx4ZVg/RLjOyE9+CsAKyQGXea6oIBlTFJaf8f6KALSXKmqS3I3htrrzgTQ07u0Q44jSLtT7WtHZsKevUZcpfTfEk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GgFevJQ52k+GIeZByB0zs0ZloGQy3d1ebuCOvO2fXOktbGzp9JQsEcdkoISd/71FOez+DLeyKslplFr35vgQ+9n52nIk6qh2IZfGT/ZW37mleCggxo7jBKXj8SgGKMytsq1k/pHVpAXqHV2PhX1/zyZOwviA3PNbQYti1kGwQ26nh8JxtLvAFO9RWgh02LpR0LJN7ftDF0wAOFZEC/MJPlo5RpGa3h23aHsCb1jnYCFR3LVdp6vEMkWtwD3BbtB58xkRzHHaji9HlYfHoJPosCEE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR04MB4301; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4301; X-Forefront-PRVS: 0743E8D0A6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(39860400002)(366004)(346002)(136003)(376002)(189003)(199004)(386003)(81166006)(8676002)(25786009)(81156014)(7416002)(50466002)(48376002)(4326008)(47776003)(7736002)(5024004)(14444005)(66066001)(39060400002)(97736004)(2906002)(86362001)(118296001)(6306002)(53936002)(6486002)(50226002)(8936002)(5660300001)(966005)(51416003)(956004)(2616005)(476003)(305945005)(16586007)(54906003)(6666003)(3846002)(316002)(110136005)(6512007)(68736007)(6116002)(44832011)(105586002)(36756003)(6506007)(486006)(186003)(106356001)(26005)(52116002)(478600001)(16526019); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4301; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB4301; 23:v8NBdtGMoIm8/jpORioCny3k6wNNIm/dQO4YUAh/O?= vB8CXfFwXKjrNnD74zvi5WPVPSwYNtpWtMEnnLHQGKVFWiVEcKmYcjRBJUKXEYqAkTILEtIqzH+MWq3WbrgO425cTv4Qf7MBdMDgz7gCJVFcVjRfGnEcolA0ND4R816dEwRV/GtnBDcsktvdY3Xgm22I0zLM2FFtkYzKib0qMLgDLE0Ntuhie4HZQXPBxp6afHy2lY5hlvp9nfG/Wo4VfoQgLaZmxJ2K/voKgj4JsvSLQwgudzHq6zppzU2l3AdSXtfhvVeX/UNFCGHBJPfGzDhLolnr2TcUdRP1WH2o+EIRqQ9AKRBrlgmmJt/VLZTWQ/BanY0pi15liHYt021KaWa8npIVxnxWcwg+A9ogOBQoTpLlngOAUil9y6vjynQoa3VZs0B2pJfIRuxDz7odb1ijEPhocW4azMQECHGjODNP1U6XEuP4wwuaFxgEy0PcFV7veosajAmNbwdXeDWVltwTwtsoggw3GjroPfwRq7/DiosPQxkryorFGNX+xB/0EtPfTqcGMojG34PGuAG2SnhP8ZWDJOcqBcVFZ2XMzUhGd+ZD8YXC+DFzHc5WhzUsu5oYhC8KIRUQuoJSV1IsuH0uoRC0plou3bvM72RXdVenSo1IAY6Z8kSl38BL63KXv5sOpNFZFyn5jkCJm0L6c/4MRzhbw8/X+TxqpvuOAC5GO9bGR6CKnapNOV9Z2zM5ElWoyu0uQgOjtZzqGM5AAhMrj5+iC8mNPN2osQ6AHK67+if8vtI5Kibisb3fzPIGg80Z8x0km9uEyz45QZ7fTUxygQbUH0+lUcsC+LyXfMD/OCBA74FkrLYl15Er3E8WB2UvYqj0rMoo2go2XbvrKSWo70c/G0DN2+UbL42Jc7FlL2lrQ5PfGi28eBO6DW1mckBpb7qic5YquohwN1BmjKEiVzwhwF678Jl9mUqB7N9wEwJHhuWdc7qysukz878/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1dfMcin3pYyoG2tuqD71Rr86Q7TMEe0EHfuUku4wsR2mdd0hzLE5xOv9wYT8Mdcq75xb+yvh/4zqUMSOfrMqn1hR+hI+UIgZQsnqqPbqJpWKYt0O5ZNmiUe3cCd+AvC8KPpVFlqm1Gg==; 5:hqD9jjq0iKLsx5uho5bOAA9Eb2E3SZMYwKL5B0NNzCmYpYKQUQnMHu7cPKomyN2sVo9PaJNNiOYzrPNDmuWBZDmgLqBp7sOgy3RLmHxxmh4Z71OKoBMmXyvkPaYWP10H2SkaZSsy7WUh6ae3d/tNm9kayaIyUzv2mXJN/7dPcXE=; 7:FII5M9IfhIOa6XqCMi4duBXe0EpiMnprblPfcbyjUzudM+PMSC03RrXdWNt3SotvVvVq0aP20t9Ph3m+Miw183ZT8FhHYcaLmWiRn29Zz7tE8rhneBLy8aVeeRZAQ4OOdMb2qd/KGYVYD/F2QnIJj+n+2OkUiZkHoAsoDicD/npDeauvolMcpnHwbThWjOuFgZCwOc88iZNkQHfWVo696c36lykziW6wEJuegA+4aK710IlvFR2rbl5WpAgxCb+E SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2018 18:17:51.9606 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae2c77a1-46cf-4e63-00d6-08d5f191c58e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4301 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180724_111807_836113_041B56D8 X-CRM114-Status: GOOD ( 20.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Zhu , Anson Huang , linux-pm@vger.kernel.org, Andrey Smirnov , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Jon Hunter , linux-imx@nxp.com, kernel@pengutronix.de, Fabio Estevam , Shawn Guo , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On some chips the PCIE and PCIE_PHY blocks are in separate power domains which can be power-gated independently. The driver needs to handle this by keeping both domain active. This is intended for imx6sx where PCIE is in DISPMIX and PCIE_PHY in it's own domain. Defining the DISPMIX domain requires a way for pcie to keep it active or it will break when displays are off. The power-domains on imx6sx are meant to look like this: power-domains = <&pd_disp>, <&pd_pci>; power-domain-names = "pcie", "pcie_phy"; Signed-off-by: Leonard Crestez Reviewed-by: Ulf Hansson --- Right now if a device has a single power domain it will be activated before probe but if it has multiple domains they need to be explicitly "attached" to and controlled. Supporting both is a bit awkward, this patch makes the distinction based on (dev->pm_domain != NULL). Maybe the PM core should make this distinction based on a flag in struct device_driver instead of number of power-domains? So by default when a device has multiple power domains they would would be activated together and this patch would be unnecessary. This is marked as "RFC" mostly because I believe it should be handled inside PM core, without driver code. Does this make sense to anyone else? This is independent of recent patches adding suspend/resume support to imx pci, but supporting suspend with multi-pd requires adding device links, not just activating pds at probe time. The device_link is marked as "STATELESS" because otherwise a warning is triggered in device_links_driver_bound. This seems to happen because the pd devices are always marked as "DL_DEV_NO_DRIVER". Maybe they should be instead always be marked as DL_DEV_DRIVER_BOUND? The imx pci driver doesn't support unbind or removal anyway so this is not handled for multi-pd either. Previously: https://lkml.org/lkml/2018/7/10/230 --- drivers/pci/controller/dwc/pci-imx6.c | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index fc9529619469..7403918010e9 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -25,10 +25,12 @@ #include #include #include #include #include +#include +#include #include "pcie-designware.h" #define to_imx6_pcie(x) dev_get_drvdata((x)->dev) @@ -57,10 +59,15 @@ struct imx6_pcie { u32 tx_deemph_gen2_6db; u32 tx_swing_full; u32 tx_swing_low; int link_gen; struct regulator *vpcie; + + /* power domain for pcie itself (dispmix) */ + struct device *pd_pcie; + /* power domain for pcie phy */ + struct device *pd_pcie_phy; }; /* Parameters for the waiting for PCIe PHY PLL to lock on i.MX7 */ #define PHY_PLL_LOCK_WAIT_MAX_RETRIES 2000 #define PHY_PLL_LOCK_WAIT_USLEEP_MIN 50 @@ -805,10 +812,47 @@ static int imx6_pcie_resume_noirq(struct device *dev) static const struct dev_pm_ops imx6_pcie_pm_ops = { SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx6_pcie_suspend_noirq, imx6_pcie_resume_noirq) }; +static int imx6_pcie_attach_pd(struct device *dev) +{ + struct imx6_pcie *imx6_pcie = dev_get_drvdata(dev); + struct device_link *link; + + /* Do nothing when in a single power domain */ + if (dev->pm_domain) + return 0; + + imx6_pcie->pd_pcie = dev_pm_domain_attach_by_name(dev, "pcie"); + if (IS_ERR(imx6_pcie->pd_pcie)) + return PTR_ERR(imx6_pcie->pd_pcie); + link = device_link_add(dev, imx6_pcie->pd_pcie, + DL_FLAG_STATELESS | + DL_FLAG_PM_RUNTIME | + DL_FLAG_RPM_ACTIVE); + if (IS_ERR(link)) { + dev_err(dev, "Failed to add device_link to pcie pd: %ld\n", PTR_ERR(link)); + return PTR_ERR(link); + } + + imx6_pcie->pd_pcie_phy = dev_pm_domain_attach_by_name(dev, "pcie_phy"); + if (IS_ERR(imx6_pcie->pd_pcie_phy)) + return PTR_ERR(imx6_pcie->pd_pcie_phy); + + device_link_add(dev, imx6_pcie->pd_pcie_phy, + DL_FLAG_STATELESS | + DL_FLAG_PM_RUNTIME | + DL_FLAG_RPM_ACTIVE); + if (IS_ERR(link)) { + dev_err(dev, "Failed to add device_link to pcie_phy pd: %ld\n", PTR_ERR(link)); + return PTR_ERR(link); + } + + return 0; +} + static int imx6_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct dw_pcie *pci; struct imx6_pcie *imx6_pcie; @@ -945,10 +989,14 @@ static int imx6_pcie_probe(struct platform_device *pdev) imx6_pcie->vpcie = NULL; } platform_set_drvdata(pdev, imx6_pcie); + ret = imx6_pcie_attach_pd(dev); + if (ret) + return ret; + ret = imx6_add_pcie_port(imx6_pcie, pdev); if (ret < 0) return ret; return 0;