From patchwork Fri May 18 07:07:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 136246 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp874175lji; Fri, 18 May 2018 00:07:42 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqAC5J/e16n/9LztoK58wSKhDqalz9R2CWWKBVgMvgNFU04bpTS7XlyrSJwAeR89clKw7V5 X-Received: by 2002:a17:902:9a8a:: with SMTP id w10-v6mr8443607plp.333.1526627262682; Fri, 18 May 2018 00:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526627262; cv=none; d=google.com; s=arc-20160816; b=FTdV1iGdd2EF0Bfnp6sSeqm8n2jYTyovqDl3CQr65D5o5vckpHTrRPYmBGFGuREqVp txbzKkaJRee8QqNZwYZzlM5nc4FowgjFUuMLYyng3HUJIE07ykN5+LaQpEQJMGtSfkGc CAj2ACbm8HBUHIUrTZbAVhMavdUcPcQXY4qB8EbUCGSIW/kJC288rU/utG65WCeDbQPH bOYCyqoK9qtDqFS6/qz7Z5JKpnbWoU6GrrTXqoDM7SL6E3DUoIsfvBM6zmQvMPQwJ28V YJySi4FRRNKGG2xllOLQbzYR0+YCHkODYHHArmbSTI7HvTgpufKAj5b9bYvQ2nNL0dMH K4Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=fWKmLbg/JpD5wp/oIx2syyap6bfpZS//YQ3naZqO63g=; b=mnLG6R/Bz6yPP3JelnFIvH1v9ptH7bAtTMf7EEbwkD4lfr3HaAIUYstPMq7xDHwPc7 M//KT5fbHZaeooRr++qMamtfw0wBlJSFGnMKDMKK8sdTZAz3aPBdn8a9iiyO+BEX8SwZ DTGk2bz32aEcIhcqpx5g/fTSetFopgshYiYWNhBxs/Nyma10cgb/NWvDq2osO73L+pSG 6FPyGEe1adNt5OKZg1PE2LNKsZGPXmvYIbxwEcVhxH/U6RhCvDvRBwveKw1UZrhw9hnV bvGxGUWL33qmfCAnKexgH8N+ngWm6M7sljiMFv7PtvkdAFFpOmAgatCCpR1t9uoYqqf1 cLJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kpXNts2v; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b40-v6si6775670plb.44.2018.05.18.00.07.42; Fri, 18 May 2018 00:07:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kpXNts2v; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751368AbeERHHl (ORCPT + 13 others); Fri, 18 May 2018 03:07:41 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:37625 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbeERHHk (ORCPT ); Fri, 18 May 2018 03:07:40 -0400 Received: by mail-pg0-f67.google.com with SMTP id a13-v6so2921121pgu.4 for ; Fri, 18 May 2018 00:07:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=3XmQSTo+zwLa/uWRaQZdyyijyRtX79+d6CkGhY+mtYk=; b=kpXNts2vu1bXbz1hF5KErmdjUoJTWurRKhgNhywc8yMyCCIfOlwBVdBm7ahRI+HiWa QIVC2ohJa0AqeZy58WERVj16MBmCucEGABEN4TOf6sXIIdq5tdnKDF1ZlvQMysQdXfKd z0JmybPBZkhpoDwcluR4S8dPVT1Kidh3CzIy0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3XmQSTo+zwLa/uWRaQZdyyijyRtX79+d6CkGhY+mtYk=; b=IE6rsmj1eoqcvCUpbPZFEtI39Djxk+xgjFW92cOnj9/40woc5Ph3c/TKiia5ZBw/PE Sbvh22Mz9AXIijW5ltMblCqCwWIJk+5v+lS2Hl0v8nmFl5blZZfWdJjFcQzxWY/pzHsz 2X2jnVy+ZA02947RujB3rqPT/SEsLq4JOE9pVL86AcBUb8ttWtARndP+hOKIroolVvjS ahC3wroMFVKEpmI2sZTqOnuMM0qJJ9enoTENL5CC0ExryIovg9ukoNrLLMbuD/LEYmhm Vp1hlbnMJWZbugyjOEbmtGfObOSsSCm99S//euDczfQjOkxsWCSE+KwIuIzBvDoILEtk lGTw== X-Gm-Message-State: ALKqPweYBoVRocqgMBQGiC8oZ43QjY78ie/nBAJvVrFIcNPt9GsvXimD 994f4fFdTxIlcEXYPRo3+gTPvA== X-Received: by 2002:a62:c103:: with SMTP id i3-v6mr8233356pfg.148.1526627259735; Fri, 18 May 2018 00:07:39 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id w134-v6sm10638391pfd.187.2018.05.18.00.07.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 00:07:38 -0700 (PDT) From: Bjorn Andersson To: Stanimir Varbanov , Lorenzo Pieralisi , Bjorn Helgaas Cc: Srinivas Kandagatla , linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] PCI: qcom: add runtime pm support to pcie_port Date: Fri, 18 May 2018 00:07:36 -0700 Message-Id: <20180518070736.3003-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.17.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Srinivas Kandagatla This patch is required when the pcie controller sits on a bus with its own power domain and clocks which are controlled via a bus driver like simple pm bus. As these bus driver have runtime pm enabled, it makes sense to update the usage counter so that the runtime pm does not suspend the clks or power domain associated with the bus driver. Signed-off-by: Srinivas Kandagatla Signed-off-by: Bjorn Andersson --- This patch was posted 18 months ago but was somehow lost. linux-next recently enabled PCIe on MSM8996 and DB820c, but the system stalls as the agnoc gdsc isn't enabled. This patch still fixes this problem for me. drivers/pci/dwc/pcie-qcom.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c index 5897af7d3355..3f35098b71b1 100644 --- a/drivers/pci/dwc/pcie-qcom.c +++ b/drivers/pci/dwc/pcie-qcom.c @@ -1088,6 +1088,8 @@ static int qcom_pcie_host_init(struct pcie_port *pp) struct qcom_pcie *pcie = to_qcom_pcie(pci); int ret; + pm_runtime_get_sync(pci->dev); + qcom_ep_reset_assert(pcie); ret = pcie->ops->init(pcie); @@ -1124,6 +1126,7 @@ static int qcom_pcie_host_init(struct pcie_port *pp) phy_power_off(pcie->phy); err_deinit: pcie->ops->deinit(pcie); + pm_runtime_put_sync(pci->dev); return ret; } @@ -1204,6 +1207,7 @@ static int qcom_pcie_probe(struct platform_device *pdev) struct qcom_pcie *pcie; int ret; + pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL); if (!pcie) return -ENOMEM; @@ -1212,6 +1216,8 @@ static int qcom_pcie_probe(struct platform_device *pdev) if (!pci) return -ENOMEM; + pm_runtime_enable(dev); + pci->dev = dev; pci->ops = &dw_pcie_ops; pp = &pci->pp;