linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250
@ 2021-01-17  1:31 Dmitry Baryshkov
  2021-01-17  1:31 ` [PATCH v5 1/2] dt-bindings: pci: qcom: Document ddrss_sf_tbu clock for sm8250 Dmitry Baryshkov
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2021-01-17  1:31 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Rob Herring, Lorenzo Pieralisi
  Cc: linux-arm-msm, Manivannan Sadhasivam, linux-pci

SM8250 platform requires additional clock to be enabled for PCIe to
function. In case it is disabled, PCIe access will result in IOMMU
timeouts. Add device tree binding and driver support for this clock.

Canges since v4:
 - Remove QCOM_PCIE_2_7_0_MAX_CLOCKS define and has_sf_tbu variable.

Changes since v3:
 - Merge clock handling back into qcom_pcie_get_resources_2_7_0().
   Define res->num_clks to the amount of clocks used for this particular
   platform.

Changes since v2:
 - Split this clock handling from qcom_pcie_get_resources_2_7_0()
 - Change comment to point that the clock is required rather than
   optional

Changes since v1:
 - Added Fixes: tags, as respective patches have hit the upstream Linux
   tree.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v5 1/2] dt-bindings: pci: qcom: Document ddrss_sf_tbu clock for sm8250
  2021-01-17  1:31 [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250 Dmitry Baryshkov
@ 2021-01-17  1:31 ` Dmitry Baryshkov
  2021-01-17  1:31 ` [PATCH v5 2/2] PCI: qcom: add support for ddrss_sf_tbu clock Dmitry Baryshkov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2021-01-17  1:31 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Rob Herring, Lorenzo Pieralisi
  Cc: linux-arm-msm, Manivannan Sadhasivam, linux-pci

On SM8250 additional clock is required for PCIe devices to access NOC.
Document this requirement in devicetree bindings.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: 458168247ccc ("dt-bindings: pci: qcom: Document PCIe bindings for SM8250 SoC")
---
 .../devicetree/bindings/pci/qcom,pcie.txt       | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie.txt b/Documentation/devicetree/bindings/pci/qcom,pcie.txt
index 3b55310390a0..0da458a051b6 100644
--- a/Documentation/devicetree/bindings/pci/qcom,pcie.txt
+++ b/Documentation/devicetree/bindings/pci/qcom,pcie.txt
@@ -132,8 +132,20 @@
 			- "master_bus"	AXI Master clock
 			- "slave_bus"	AXI Slave clock
 
--clock-names:
-	Usage: required for sdm845 and sm8250
+- clock-names:
+	Usage: required for sdm845
+	Value type: <stringlist>
+	Definition: Should contain the following entries
+			- "aux"		Auxiliary clock
+			- "cfg"		Configuration clock
+			- "bus_master"	Master AXI clock
+			- "bus_slave"	Slave AXI clock
+			- "slave_q2a"	Slave Q2A clock
+			- "tbu"		PCIe TBU clock
+			- "pipe"	PIPE clock
+
+- clock-names:
+	Usage: required for sm8250
 	Value type: <stringlist>
 	Definition: Should contain the following entries
 			- "aux"		Auxiliary clock
@@ -142,6 +154,7 @@
 			- "bus_slave"	Slave AXI clock
 			- "slave_q2a"	Slave Q2A clock
 			- "tbu"		PCIe TBU clock
+			- "ddrss_sf_tbu" PCIe SF TBU clock
 			- "pipe"	PIPE clock
 
 - resets:
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v5 2/2] PCI: qcom: add support for ddrss_sf_tbu clock
  2021-01-17  1:31 [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250 Dmitry Baryshkov
  2021-01-17  1:31 ` [PATCH v5 1/2] dt-bindings: pci: qcom: Document ddrss_sf_tbu clock for sm8250 Dmitry Baryshkov
@ 2021-01-17  1:31 ` Dmitry Baryshkov
  2021-02-05  7:12   ` Stanimir Varbanov
  2021-01-26 20:11 ` [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250 Dmitry Baryshkov
  2021-02-05 17:10 ` Lorenzo Pieralisi
  3 siblings, 1 reply; 9+ messages in thread
From: Dmitry Baryshkov @ 2021-01-17  1:31 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Rob Herring, Lorenzo Pieralisi
  Cc: linux-arm-msm, Manivannan Sadhasivam, linux-pci

On SM8250 additional clock is required for PCIe devices to access NOC.
Update PCIe controller driver to control this clock.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: e1dd639e374a ("PCI: qcom: Add SM8250 SoC support")
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index affa2713bf80..ab21aa01c95d 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -159,8 +159,10 @@ struct qcom_pcie_resources_2_3_3 {
 	struct reset_control *rst[7];
 };
 
+/* 6 clocks typically, 7 for sm8250 */
 struct qcom_pcie_resources_2_7_0 {
-	struct clk_bulk_data clks[6];
+	struct clk_bulk_data clks[7];
+	int num_clks;
 	struct regulator_bulk_data supplies[2];
 	struct reset_control *pci_reset;
 	struct clk *pipe_clk;
@@ -1152,8 +1154,14 @@ static int qcom_pcie_get_resources_2_7_0(struct qcom_pcie *pcie)
 	res->clks[3].id = "bus_slave";
 	res->clks[4].id = "slave_q2a";
 	res->clks[5].id = "tbu";
+	if (of_device_is_compatible(dev->of_node, "qcom,pcie-sm8250")) {
+		res->clks[6].id = "ddrss_sf_tbu";
+		res->num_clks = 7;
+	} else {
+		res->num_clks = 6;
+	}
 
-	ret = devm_clk_bulk_get(dev, ARRAY_SIZE(res->clks), res->clks);
+	ret = devm_clk_bulk_get(dev, res->num_clks, res->clks);
 	if (ret < 0)
 		return ret;
 
@@ -1175,7 +1183,7 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
 		return ret;
 	}
 
-	ret = clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks);
+	ret = clk_bulk_prepare_enable(res->num_clks, res->clks);
 	if (ret < 0)
 		goto err_disable_regulators;
 
@@ -1227,7 +1235,7 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
 
 	return 0;
 err_disable_clocks:
-	clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks);
+	clk_bulk_disable_unprepare(res->num_clks, res->clks);
 err_disable_regulators:
 	regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies);
 
@@ -1238,7 +1246,7 @@ static void qcom_pcie_deinit_2_7_0(struct qcom_pcie *pcie)
 {
 	struct qcom_pcie_resources_2_7_0 *res = &pcie->res.v2_7_0;
 
-	clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks);
+	clk_bulk_disable_unprepare(res->num_clks, res->clks);
 	regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies);
 }
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250
  2021-01-17  1:31 [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250 Dmitry Baryshkov
  2021-01-17  1:31 ` [PATCH v5 1/2] dt-bindings: pci: qcom: Document ddrss_sf_tbu clock for sm8250 Dmitry Baryshkov
  2021-01-17  1:31 ` [PATCH v5 2/2] PCI: qcom: add support for ddrss_sf_tbu clock Dmitry Baryshkov
@ 2021-01-26 20:11 ` Dmitry Baryshkov
  2021-02-04 15:06   ` Dmitry Baryshkov
  2021-02-05 17:10 ` Lorenzo Pieralisi
  3 siblings, 1 reply; 9+ messages in thread
From: Dmitry Baryshkov @ 2021-01-26 20:11 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Rob Herring, Lorenzo Pieralisi
  Cc: linux-arm-msm, Manivannan Sadhasivam, linux-pci

Rob, Lorenzo, gracious poke for this patchset.


On 17/01/2021 04:31, Dmitry Baryshkov wrote:
> SM8250 platform requires additional clock to be enabled for PCIe to
> function. In case it is disabled, PCIe access will result in IOMMU
> timeouts. Add device tree binding and driver support for this clock.
> 
> Canges since v4:
>   - Remove QCOM_PCIE_2_7_0_MAX_CLOCKS define and has_sf_tbu variable.
> 
> Changes since v3:
>   - Merge clock handling back into qcom_pcie_get_resources_2_7_0().
>     Define res->num_clks to the amount of clocks used for this particular
>     platform.
> 
> Changes since v2:
>   - Split this clock handling from qcom_pcie_get_resources_2_7_0()
>   - Change comment to point that the clock is required rather than
>     optional
> 
> Changes since v1:
>   - Added Fixes: tags, as respective patches have hit the upstream Linux
>     tree.
> 
> 


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250
  2021-01-26 20:11 ` [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250 Dmitry Baryshkov
@ 2021-02-04 15:06   ` Dmitry Baryshkov
  2021-02-04 17:02     ` Lorenzo Pieralisi
  0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Baryshkov @ 2021-02-04 15:06 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Rob Herring, Lorenzo Pieralisi
  Cc: open list:DRM DRIVER FOR MSM ADRENO GPU, Manivannan Sadhasivam, PCI

On Tue, 26 Jan 2021 at 23:11, Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
>
> Rob, Lorenzo, gracious poke for this patchset.

Dear colleagues, another gracious ping. I'm not insisting on getting
this into 5.12 (it would be good though), but I'd kindly ask for these
patches to be reviewed/acked.

> On 17/01/2021 04:31, Dmitry Baryshkov wrote:
> > SM8250 platform requires additional clock to be enabled for PCIe to
> > function. In case it is disabled, PCIe access will result in IOMMU
> > timeouts. Add device tree binding and driver support for this clock.
> >
> > Canges since v4:
> >   - Remove QCOM_PCIE_2_7_0_MAX_CLOCKS define and has_sf_tbu variable.
> >
> > Changes since v3:
> >   - Merge clock handling back into qcom_pcie_get_resources_2_7_0().
> >     Define res->num_clks to the amount of clocks used for this particular
> >     platform.
> >
> > Changes since v2:
> >   - Split this clock handling from qcom_pcie_get_resources_2_7_0()
> >   - Change comment to point that the clock is required rather than
> >     optional
> >
> > Changes since v1:
> >   - Added Fixes: tags, as respective patches have hit the upstream Linux
> >     tree.
> >
> >
>
>
> --
> With best wishes
> Dmitry



-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250
  2021-02-04 15:06   ` Dmitry Baryshkov
@ 2021-02-04 17:02     ` Lorenzo Pieralisi
  0 siblings, 0 replies; 9+ messages in thread
From: Lorenzo Pieralisi @ 2021-02-04 17:02 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Andy Gross, Bjorn Andersson, Rob Herring,
	open list:DRM DRIVER FOR MSM ADRENO GPU, Manivannan Sadhasivam,
	PCI, Stanimir Varbanov

[+Stanimir]

On Thu, Feb 04, 2021 at 06:06:16PM +0300, Dmitry Baryshkov wrote:
> On Tue, 26 Jan 2021 at 23:11, Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
> >
> > Rob, Lorenzo, gracious poke for this patchset.
> 
> Dear colleagues, another gracious ping. I'm not insisting on getting
> this into 5.12 (it would be good though), but I'd kindly ask for these
> patches to be reviewed/acked.

I need an ACK from the maintainer(s) to pull them.

Thanks,
Lorenzo

> > On 17/01/2021 04:31, Dmitry Baryshkov wrote:
> > > SM8250 platform requires additional clock to be enabled for PCIe to
> > > function. In case it is disabled, PCIe access will result in IOMMU
> > > timeouts. Add device tree binding and driver support for this clock.
> > >
> > > Canges since v4:
> > >   - Remove QCOM_PCIE_2_7_0_MAX_CLOCKS define and has_sf_tbu variable.
> > >
> > > Changes since v3:
> > >   - Merge clock handling back into qcom_pcie_get_resources_2_7_0().
> > >     Define res->num_clks to the amount of clocks used for this particular
> > >     platform.
> > >
> > > Changes since v2:
> > >   - Split this clock handling from qcom_pcie_get_resources_2_7_0()
> > >   - Change comment to point that the clock is required rather than
> > >     optional
> > >
> > > Changes since v1:
> > >   - Added Fixes: tags, as respective patches have hit the upstream Linux
> > >     tree.
> > >
> > >
> >
> >
> > --
> > With best wishes
> > Dmitry
> 
> 
> 
> -- 
> With best wishes
> Dmitry

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 2/2] PCI: qcom: add support for ddrss_sf_tbu clock
  2021-01-17  1:31 ` [PATCH v5 2/2] PCI: qcom: add support for ddrss_sf_tbu clock Dmitry Baryshkov
@ 2021-02-05  7:12   ` Stanimir Varbanov
  0 siblings, 0 replies; 9+ messages in thread
From: Stanimir Varbanov @ 2021-02-05  7:12 UTC (permalink / raw)
  To: Dmitry Baryshkov, Andy Gross, Bjorn Andersson, Rob Herring,
	Lorenzo Pieralisi
  Cc: linux-arm-msm, Manivannan Sadhasivam, linux-pci

Thanks for the patch!

On 1/17/21 3:31 AM, Dmitry Baryshkov wrote:
> On SM8250 additional clock is required for PCIe devices to access NOC.
> Update PCIe controller driver to control this clock.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Fixes: e1dd639e374a ("PCI: qcom: Add SM8250 SoC support")
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>  drivers/pci/controller/dwc/pcie-qcom.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)

Acked-by: Stanimir Varbanov <svarbanov@mm-sol.com>


-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250
  2021-01-17  1:31 [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250 Dmitry Baryshkov
                   ` (2 preceding siblings ...)
  2021-01-26 20:11 ` [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250 Dmitry Baryshkov
@ 2021-02-05 17:10 ` Lorenzo Pieralisi
  2021-02-05 17:12   ` Dmitry Baryshkov
  3 siblings, 1 reply; 9+ messages in thread
From: Lorenzo Pieralisi @ 2021-02-05 17:10 UTC (permalink / raw)
  To: Andy Gross, Rob Herring, Dmitry Baryshkov, Bjorn Andersson
  Cc: Lorenzo Pieralisi, Manivannan Sadhasivam, linux-arm-msm, linux-pci

On Sun, 17 Jan 2021 04:31:12 +0300, Dmitry Baryshkov wrote:
> SM8250 platform requires additional clock to be enabled for PCIe to
> function. In case it is disabled, PCIe access will result in IOMMU
> timeouts. Add device tree binding and driver support for this clock.
> 
> Canges since v4:
>  - Remove QCOM_PCIE_2_7_0_MAX_CLOCKS define and has_sf_tbu variable.
> 
> [...]

Applied to pci/qcom, thanks!

[1/2] dt-bindings: pci: qcom: Document ddrss_sf_tbu clock for sm8250
      https://git.kernel.org/lpieralisi/pci/c/a8069a4831
[2/2] PCI: qcom: add support for ddrss_sf_tbu clock
      https://git.kernel.org/lpieralisi/pci/c/f5d48a3328

Thanks,
Lorenzo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250
  2021-02-05 17:10 ` Lorenzo Pieralisi
@ 2021-02-05 17:12   ` Dmitry Baryshkov
  0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2021-02-05 17:12 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Andy Gross, Rob Herring, Bjorn Andersson, Manivannan Sadhasivam,
	open list:DRM DRIVER FOR MSM ADRENO GPU, PCI

On Fri, 5 Feb 2021 at 20:11, Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
>
> On Sun, 17 Jan 2021 04:31:12 +0300, Dmitry Baryshkov wrote:
> > SM8250 platform requires additional clock to be enabled for PCIe to
> > function. In case it is disabled, PCIe access will result in IOMMU
> > timeouts. Add device tree binding and driver support for this clock.
> >
> > Canges since v4:
> >  - Remove QCOM_PCIE_2_7_0_MAX_CLOCKS define and has_sf_tbu variable.
> >
> > [...]
>
> Applied to pci/qcom, thanks!

Thank you!

>
> [1/2] dt-bindings: pci: qcom: Document ddrss_sf_tbu clock for sm8250
>       https://git.kernel.org/lpieralisi/pci/c/a8069a4831
> [2/2] PCI: qcom: add support for ddrss_sf_tbu clock
>       https://git.kernel.org/lpieralisi/pci/c/f5d48a3328

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-05 19:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-17  1:31 [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250 Dmitry Baryshkov
2021-01-17  1:31 ` [PATCH v5 1/2] dt-bindings: pci: qcom: Document ddrss_sf_tbu clock for sm8250 Dmitry Baryshkov
2021-01-17  1:31 ` [PATCH v5 2/2] PCI: qcom: add support for ddrss_sf_tbu clock Dmitry Baryshkov
2021-02-05  7:12   ` Stanimir Varbanov
2021-01-26 20:11 ` [PATCH v5 0/2] PCI: qcom: fix PCIe support on sm8250 Dmitry Baryshkov
2021-02-04 15:06   ` Dmitry Baryshkov
2021-02-04 17:02     ` Lorenzo Pieralisi
2021-02-05 17:10 ` Lorenzo Pieralisi
2021-02-05 17:12   ` Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).