Skip to contentSkip to conversation

ARM: tegra: pcie: Add tegra3 support

PATCH Superseded Jay Agarwal 4 participants 19 messages Apr 8, 2013 – May 6, 2013

Subsystems (5)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ARM: tegra: pcie: Add tegra3 support

- Enable pcie root port 2 for cardhu
- Make private data structure for each SOC
- Add required tegra3 clocks and regulators
- Add tegra3 specific code in enable controller
- Modify clock tree to get clocks based on device
- Based on git://gitorious.org/thierryreding/linux.git

 drivers/clk/tegra/clk-tegra30.c |   12 ++--
 drivers/pci/host/pci-tegra.c    |  146 ++++++++++++++++++++++++++++++++++-----
 2 files changed, 133 insertions(+), 25 deletions(-)
drivers/clk/tegra/clk-tegra30.c +6 -6
index ba6f51b..6a80b40 100644
@@ -1592,6 +1592,12 @@ static void __init tegra30_periph_clk_init(void)
 	clk_register_clkdev(clk, "afi", "tegra-pcie");
 	clks[afi] = clk;
 
+	/* pciex */
+	clk = tegra_clk_register_periph_gate("pciex", "pll_e", 0, clk_base, 0,
+				    74, &periph_u_regs, periph_clk_enb_refcnt);
+	clk_register_clkdev(clk, "pciex", NULL);
+	clks[pciex] = clk;
+
 	/* kfuse */
 	clk = tegra_clk_register_periph_gate("kfuse", "clk_m",
 				    TEGRA_PERIPH_ON_APB,
@@ -1710,11 +1716,6 @@ static void __init tegra30_fixed_clk_init(void)
 				1, 0, &cml_lock);
 	clk_register_clkdev(clk, "cml1", NULL);
 	clks[cml1] = clk;
-
-	/* pciex */
-	clk = clk_register_fixed_rate(NULL, "pciex", "pll_e", 0, 100000000);
-	clk_register_clkdev(clk, "pciex", NULL);
-	clks[pciex] = clk;
 }
 
 static void __init tegra30_osc_clk_init(void)
@@ -1930,7 +1931,6 @@ static struct tegra_clk_duplicate tegra_clk_duplicates[] = {
 	TEGRA_CLK_DUPLICATE(bsea, "nvavp", "bsea"),
 	TEGRA_CLK_DUPLICATE(cml1, "tegra_sata_cml", NULL),
 	TEGRA_CLK_DUPLICATE(cml0, "tegra_pcie", "cml"),
-	TEGRA_CLK_DUPLICATE(pciex, "tegra_pcie", "pciex"),
 	TEGRA_CLK_DUPLICATE(vcp, "nvavp", "vcp"),
 	TEGRA_CLK_DUPLICATE(clk_max, NULL, NULL), /* MUST be the last entry */
 };
drivers/pci/host/pci-tegra.c +127 -19

351 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 2/3 ARM: dts: tegra: Correct PCIe entry

- Add interrupt-names property
- Correct downstream I/O size
- Correct cml clock name for tegra30
- Based on git://gitorious.org/thierryreding/linux.git

 arch/arm/boot/dts/tegra30.dtsi |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/tegra30.dtsi +3 -3
index 5a270ff..289ef93 100644
@@ -124,7 +124,7 @@
 		reg-names = "pads", "afi", "cs";
 		interrupts = <0 98 0x04   /* controller interrupt */
 		              0 99 0x04>; /* MSI interrupt */
-
+		interrupt-names = "intr", "msi";
 		bus-range = <0x00 0xff>;
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -132,13 +132,13 @@
 		ranges = <0x82000000 0 0x00000000 0x00000000 0 0x00001000   /* port 0 configuration space */
 			  0x82000000 0 0x00001000 0x00001000 0 0x00001000   /* port 1 configuration space */
 			  0x82000000 0 0x00004000 0x00004000 0 0x00001000   /* port 2 configuration space */
-			  0x81000000 0 0          0x02000000 0 0x00010000   /* downstream I/O */
+			  0x81000000 0 0          0x02000000 0 0x00100000   /* downstream I/O */
 			  0x82000000 0 0x20000000 0x20000000 0 0x10000000   /* non-prefetchable memory */
 			  0xc2000000 0 0x30000000 0x30000000 0 0x10000000>; /* prefetchable memory */
 
 		clocks = <&tegra_car 70>, <&tegra_car 72>, <&tegra_car 74>,
 			 <&tegra_car 118>, <&tegra_car 215>;
-		clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml";
+		clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml0";
 		status = "disabled";
 
 		pci@1,0 {
Signature · 1 line
1.7.0.4
#6 lore raw

PATCH 3/3 ARM: dts: tegra: Add PCIe entry for cardhu

In reply to Jay Agarwal

- Add PCIe node entry for cardhu
- Enable only root port 2
- Initialize regulators required for tegra30
- Based on git://gitorious.org/thierryreding/linux.git

 arch/arm/boot/dts/tegra30-cardhu.dtsi |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
arch/arm/boot/dts/tegra30-cardhu.dtsi +11 -0
index d2fdf95..b64113e 100644
@@ -137,6 +137,17 @@
 		};
 	};
 
+	pcie-controller {
+		status = "okay";
+		pex-clk-supply = <&pex_hvdd_3v3_reg>;
+		vdd-supply = <&ldo1_reg>;
+		avdd-supply = <&ldo2_reg>;
+
+		pci@3,0 {
+			status = "okay";
+		};
+	};
+
 	serial@70006000 {
 		status = "okay";
 	};
Signature · 1 line
1.7.0.4
#8 lore raw
In reply to Jay Agarwal
Quoted 8 lines · Jay Agarwal

- Enable pcie root port 2 for cardhu
- Make private data structure for each SOC
- Add required tegra3 clocks and regulators
- Add tegra3 specific code in enable controller
- Modify clock tree to get clocks based on device
- Based on git://gitorious.org/thierryreding/linux.git

There are quite a few capitalization errors above. The correct versions
are: PCIe, Cardhu, SoC, Tegra.

Upstream uses engineering names not marketing names, so Tegra30 not Tegra3.

Quoted 2 lines
 drivers/clk/tegra/clk-tegra30.c |   12 ++--
 drivers/pci/host/pci-tegra.c    |  146 ++++++++++++++++++++++++++++++++++-----

This patch touches two unrelated drivers. There is no dependency between the changes, since PCIe doesn't work yet on Tegra30, so there's no need for those unrelated changes to be part of the same patch. Please split them into separate patches. The clk patch can likely be applied very soon, without waiting for any of the other PCIe patches.

Quoted 1 line

- Modify clock tree to get clocks based on device

That description doesn't seem to describe the change made to clk-tegra30.c. Can you please include more details re: what the patch is doing and why.

drivers/pci/host/pci-tegra.c struct tegra_msi { · line 206

Quoted 3 lines
drivers/pci/host/pci-tegra.c +1 -0
 
+/* used to differente tegra chips code */

differentiate

Quoted 1 line

+struct tegra_pcie_soc_data {

...

drivers/pci/host/pci-tegra.c struct tegra_msi { · line 216

Quoted 2 lines
drivers/pci/host/pci-tegra.c +2 -0
+	bool need_avdd_supply;
+	bool need_cml0_clk;

s/need/has/ would be better.

drivers/pci/host/pci-tegra.c static int tegra_pcie_enable_controller(struct tegra_pcie *pcie) · line 785

Quoted 9 lines
drivers/pci/host/pci-tegra.c +5 -0
@@ -749,6 +778,11 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
 	struct tegra_pcie_port *port;
 	unsigned int timeout;
 	unsigned long value;
+	struct tegra_pcie_soc_data *soc = pcie->soc_data;
+
+	/* power down to PCIe slot clock bias pad */
+	if (soc->pex_bias_ctrl)
+		afi_writel(pcie, 0, AFI_PEXBIAS_CTRL_0);

Power down when /enabling/ a controller?

drivers/pci/host/pci-tegra.c static void tegra_pcie_power_off(struct tegra_pcie *pcie) · line 903

Quoted 11 lines
drivers/pci/host/pci-tegra.c +1 -1
 	err = regulator_disable(pcie->pex_clk_supply);
 	if (err < 0)
-		dev_err(pcie->dev, "failed to disable pex-clk regulator: %d\n",
+		dev_warn(pcie->dev, "failed to disable pex-clk regulator: %d\n",
drivers/pci/host/pci-tegra.c +1 -1
 			err);
 
 	err = regulator_disable(pcie->vdd_supply);
 	if (err < 0)
-		dev_err(pcie->dev, "failed to disable VDD regulator: %d\n",
+		dev_warn(pcie->dev, "failed to disable VDD regulator: %d\n",
 			err);

Please explain why that change is correct. If the regulators only exist on Tegra20, please represent that fact in the SoC data. Regulators must always exist, so enable/disable should never fail due to missing regulators. Actual run-time failures seem like something that really is an error.

drivers/pci/host/pci-tegra.c static int tegra_pcie_probe(struct platform_device *pdev) · line 1604

Quoted 9 lines
drivers/pci/host/pci-tegra.c +5 -0
@@ -1489,6 +1597,11 @@ static int tegra_pcie_probe(struct platform_device *pdev)
 	INIT_LIST_HEAD(&pcie->busses);
 	INIT_LIST_HEAD(&pcie->ports);
 	pcie->dev = &pdev->dev;
+	match = of_match_device(tegra_pcie_of_match, &pdev->dev);
+	if (match)
+		pcie->soc_data = (struct tegra_pcie_soc_data *)match->data;
+	else
+		return -ENODEV;

that would be more idiomatic as:

if (!match)

	return -ENODEV;

pcie->soc_data = ...;

#12 lore raw
In reply to Jay Agarwal
Quoted 8 lines · Jay Agarwal

- Enable pcie root port 2 for cardhu
- Make private data structure for each SOC
- Add required tegra3 clocks and regulators
- Add tegra3 specific code in enable controller
- Modify clock tree to get clocks based on device
- Based on git://gitorious.org/thierryreding/linux.git

A couple more points on this patch:

* You didn't mention that this series is based on Thierry's work-in-progress tree, and not something immediately destined for upstream. As such, only Thierry is expected to actually apply any of these patches.

* Your changes to the Tegra PCIe driver require that device tree include extra clocks and regulators. You need to update Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt to describe these new requirements.

#2 lore raw

Re: [PATCH 2/3] ARM: dts: tegra: Correct PCIe entry

In reply to Jay Agarwal
Quoted 1 line · Jay Agarwal

Your s-o-b line should be below the patch description, not above it. Please see Documentation/SubmittingPatches.

I also don't see a --- line between the patch description and diffstat. How are you generating these patch emails? Please see our internal wiki, or other git documentation.

arch/arm/boot/dts/tegra30.dtsi line 141

Quoted 4 lines
arch/arm/boot/dts/tegra30.dtsi +1 -1
 
-		clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml";
+		clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml0";

Can you please explain more about this change?

I see the Tegra clock driver provides both a "cml0" and a "cml1" clock. Are both of those used for PCIe?

If so, then why doesn't the driver and this DT change include both cml0 and cml1?

If not, then please note that the clock-names property doesn't have to match the name of the clock at the clock provider. This property names the clock inputs to the HW module. Hence, if the PCIe module only uses a single CML clock, it can quite legitimately name its clock input just "cml" rather than "cml0". In this case, you wouldn't need to make this change to the DT.

#7 lore raw

Re: [PATCH 3/3] ARM: dts: tegra: Add PCIe entry for cardhu

In reply to Jay Agarwal
Quoted 5 lines · Jay Agarwal

- Add PCIe node entry for cardhu
- Enable only root port 2
- Initialize regulators required for tegra30

Initialize isn't correct; this change makes no changes to any regulator; it simply includes the required regulator properties in the new node.

I think you'd want to re-write this patch description as:

Enable the PCIe controller on Cardhu. Only port 2 is connected on this board. It is connected to the Ethernet controller in the dock.

Quoted 3 lines
arch/arm/boot/dts/tegra30-cardhu.dtsi +1 -0
 
+	pcie-controller {

...

Quoted 1 line

serial at 70006000 {

It lookos like this node is added in the wrong place. Nodes should be sorted based on reg property, and judging by the reg property for this node in tegra30.dtsi in Thierry's branch, this should be the first node in the Cardhu file.

#3 lore raw

Re: [PATCH 2/3] ARM: dts: tegra: Correct PCIe entry

In reply to Stephen Warren
Quoted 12 lines · Stephen Warren
Quoted 1 line · Jay Agarwal

Your s-o-b line should be below the patch description, not above it. Please see Documentation/SubmittingPatches.

I also don't see a --- line between the patch description and diffstat. How are you generating these patch emails? Please see our internal wiki, or other git documentation.

Quoted 1 line
arch/arm/boot/dts/tegra30.dtsi +0 -0
Quoted 8 lines

arch/arm/boot/dts/tegra30.dtsi line 141

Quoted 2 lines
arch/arm/boot/dts/tegra30.dtsi +1 -1
-		clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml";
+		clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml0";

Can you please explain more about this change?

I see the Tegra clock driver provides both a "cml0" and a "cml1" clock. Are both of those used for PCIe?

cml0 is used for pcie and cml1 is used for sata.

Cheers,

Peter.

#4 lore raw

Re: [PATCH 2/3] ARM: dts: tegra: Correct PCIe entry

Quoted 18 lines · Peter De Schrijver
Quoted 17 lines · Stephen Warren
Quoted 1 line · Jay Agarwal

Your s-o-b line should be below the patch description, not above it. Please see Documentation/SubmittingPatches.

I also don't see a --- line between the patch description and diffstat. How are you generating these patch emails? Please see our internal wiki, or other git documentation.

arch/arm/boot/dts/tegra30.dtsi line 141

Quoted 4 lines
arch/arm/boot/dts/tegra30.dtsi +1 -1
 
-		clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml";
+		clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml0";

Can you please explain more about this change?

Quoted 5 lines
Quoted 3 lines

I see the Tegra clock driver provides both a "cml0" and a "cml1" clock. Are both of those used for PCIe?

cml0 is used for pcie and cml1 is used for sata.

OK, so the PCIe drivers' clock-names property may as well contain just cml then. Same for SATA. The clock name at the provider isn't relevant.

#17 lore raw
In reply to Jay Agarwal
Quoted 8 lines · Jay Agarwal

- Enable pcie root port 2 for cardhu
- Make private data structure for each SOC
- Add required tegra3 clocks and regulators
- Add tegra3 specific code in enable controller
- Modify clock tree to get clocks based on device
- Based on git://gitorious.org/thierryreding/linux.git

Did you test these patches? They don't work for me on my Cardhu A04.

First off, I had to change the num-lanes properties to match Cardhu's actual configuration:

Quoted 12 lines
arch/arm/boot/dts/tegra30-cardhu.dtsi +4 -0
index d64d12c..6426226 100644
@@ -143,8 +143,17 @@
                vdd-supply = <&ldo1_reg>;
                avdd-supply = <&ldo2_reg>;
 
+               pci at 1,0 {
+                       nvidia,num-lanes = <4>;
+               };
+

arch/arm/boot/dts/tegra30-cardhu.dtsi line 159

Quoted 10 lines
arch/arm/boot/dts/tegra30-cardhu.dtsi +5 -0
+               pci at 2,0 {
+                       nvidia,num-lanes = <1>;
+               };
+
                pci at 3,0 {
                        status = "okay";
+                       nvidia,num-lanes = <1>;
                };
        };
 

However, even after doing that, the driver doesn't detect anything attached to port at 3,0, even though I have the board plugged into the docking station, and hence the PCI Ethernet should be detected:

Quoted 6 lines
[    3.103860] tegra-pcie 3000.pcie-controller: 4x1, 1x2 configuration
[    3.113755] tegra-pcie 3000.pcie-controller: probing port 2, using 1 lanes
[    3.324364] tegra-pcie 3000.pcie-controller: link 2 down, retrying
[    3.534249] tegra-pcie 3000.pcie-controller: link 2 down, retrying
[    3.744160] tegra-pcie 3000.pcie-controller: link 2 down, retrying
[    3.751359] tegra-pcie 3000.pcie-controller: link 2 down, ignoring

(I see the same messages even without fixing the lane configuration, exception for the first configuration message obviously prints something different).

Are you testing with U-Boot, or using our binary bootloader? Upstream code must be tested with U-Boot, to make sure it doesn't rely on any HW programming performed by the bootloader.

#9 lore raw
In reply to Stephen Warren
Quoted 13 lines

drivers/pci/host/pci-tegra.c static void tegra_pcie_power_off(struct tegra_pcie *pcie)

Quoted 3 lines
drivers/pci/host/pci-tegra.c +0 -1
 	err = regulator_disable(pcie->pex_clk_supply);
 	if (err < 0)
-		dev_err(pcie->dev, "failed to disable pex-clk regulator:

%d\n",

Review

Quoted 1 line
(quoted diff) +1 -0
+		dev_warn(pcie->dev, "failed to disable pex-clk regulator:

%d\n",

drivers/pci/host/pci-tegra.c static void tegra_pcie_power_off(struct tegra_pcie *pcie)

Quoted 6 lines
drivers/pci/host/pci-tegra.c +1 -1
 			err);
 
 	err = regulator_disable(pcie->vdd_supply);
 	if (err < 0)
-		dev_err(pcie->dev, "failed to disable VDD regulator: %d\n",
+		dev_warn(pcie->dev, "failed to disable VDD regulator:

%d\n",

Quoted 7 lines
Quoted 1 line

err);

Please explain why that change is correct. If the regulators only exist on Tegra20, please represent that fact in the SoC data. Regulators must always exist, so enable/disable should never fail due to missing regulators. Actual run-time failures seem like something that really is an error.

[>] These regulators are needed for both tegra20 & tegra30. Since we are not returning error here, so changed to dev_warn.

#5 lore raw

RE: [PATCH 2/3] ARM: dts: tegra: Correct PCIe entry

In reply to Peter De Schrijver
Quoted 19 lines · Stephen Warren
Quoted 18 lines · Jay Agarwal
Quoted 1 line

Your s-o-b line should be below the patch description, not above it. Please see Documentation/SubmittingPatches.

I also don't see a --- line between the patch description and diffstat. How are you generating these patch emails? Please see our internal wiki, or other git documentation.

arch/arm/boot/dts/tegra30.dtsi line 141

Quoted 5 lines
arch/arm/boot/dts/tegra30.dtsi +1 -1
 
-		clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml";
+		clock-names = "pex", "afi", "pcie_xclk", "pll_e", "cml0";

Can you please explain more about this change?

Quoted 6 lines
Quoted 3 lines

I see the Tegra clock driver provides both a "cml0" and a "cml1" clock. Are both of those used for PCIe?

cml0 is used for pcie and cml1 is used for sata.

[>] Yes correct.

#10 lore raw
In reply to Jay Agarwal
Quoted 13 lines · Jay Agarwal
Quoted 13 lines

drivers/pci/host/pci-tegra.c static void tegra_pcie_power_off(struct tegra_pcie *pcie)

Quoted 3 lines
drivers/pci/host/pci-tegra.c +0 -1
 	err = regulator_disable(pcie->pex_clk_supply);
 	if (err < 0)
-		dev_err(pcie->dev, "failed to disable pex-clk regulator:

%d\n",

Review

Quoted 1 line
(quoted diff) +1 -0
+		dev_warn(pcie->dev, "failed to disable pex-clk regulator:

%d\n",

drivers/pci/host/pci-tegra.c static void tegra_pcie_power_off(struct tegra_pcie *pcie)

Quoted 6 lines
drivers/pci/host/pci-tegra.c +1 -1
 			err);
 
 	err = regulator_disable(pcie->vdd_supply);
 	if (err < 0)
-		dev_err(pcie->dev, "failed to disable VDD regulator: %d\n",
+		dev_warn(pcie->dev, "failed to disable VDD regulator:

%d\n",

Quoted 8 lines
Quoted 7 lines
Quoted 1 line

err);

Please explain why that change is correct. If the regulators only exist on Tegra20, please represent that fact in the SoC data. Regulators must always exist, so enable/disable should never fail due to missing regulators. Actual run-time failures seem like something that really is an error.

[>] These regulators are needed for both tegra20 & tegra30. Since we are not returning error here, so changed to dev_warn.

If the regulators are required, then any failure to operate them should be an error, hence dev_err() seems correct.

As to why the code doesn't actually return an error? I'm not sure. Perhaps that should be fixed with a separate patch, although I don't recall exactly where in the code the above excerpt is; if it's in remove(), then continuing on without returning an error would be appropriate.

#13 lore raw
In reply to Stephen Warren
Quoted 10 lines · Jay Agarwal
Quoted 8 lines

- Enable pcie root port 2 for cardhu
- Make private data structure for each SOC
- Add required tegra3 clocks and regulators
- Add tegra3 specific code in enable controller
- Modify clock tree to get clocks based on device
- Based on git://gitorious.org/thierryreding/linux.git

Quoted 6 lines

A couple more points on this patch:

* You didn't mention that this series is based on Thierry's work-in-progress tree, and not something immediately destined for upstream. As such, only Thierry is expected to actually apply any of these patches.

[>] Stephen, I have mentioned it in comment description as Based on git://gitorious.org/thierryreding/linux.git, is this not enough?

Quoted 4 lines

* Your changes to the Tegra PCIe driver require that device tree include extra clocks and regulators. You need to update Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt to describe these new requirements.

[>] Should I create tegra30-pcie.txt? or made changes in tegra20-pcie.txt itself?

#14 lore raw
Quoted 10 lines · Jay Agarwal
Quoted 10 lines · Jay Agarwal
Quoted 8 lines

- Enable pcie root port 2 for cardhu
- Make private data structure for each SOC
- Add required tegra3 clocks and regulators
- Add tegra3 specific code in enable controller
- Modify clock tree to get clocks based on device
- Based on git://gitorious.org/thierryreding/linux.git

Quoted 7 lines
Quoted 6 lines

A couple more points on this patch:

* You didn't mention that this series is based on Thierry's work-in-progress tree, and not something immediately destined for upstream. As such, only Thierry is expected to actually apply any of these patches.

[>] Stephen, I have mentioned it in comment description as Based on git://gitorious.org/thierryreding/linux.git, is this not enough?

Well, first off, there are many branches there, and secondly the branch that a series is based on doesn't necessarily imply much about what you expect people to do with it.

Quoted 7 lines
Quoted 5 lines

* Your changes to the Tegra PCIe driver require that device tree include extra clocks and regulators. You need to update Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt to describe these new requirements.

[>] Should I create tegra30-pcie.txt? or made changes in tegra20-pcie.txt itself?

(What is "[>]"?)

It'd probably be simplest to edit tegra20-pcie.txt, and just mention the extra requirements for Tegra30.

#15 lore raw
Quoted 16 lines · Jay Agarwal
Quoted 10 lines
Quoted 10 lines · Jay Agarwal
Quoted 8 lines

- Enable pcie root port 2 for cardhu
- Make private data structure for each SOC
- Add required tegra3 clocks and regulators
- Add tegra3 specific code in enable controller
- Modify clock tree to get clocks based on device
- Based on git://gitorious.org/thierryreding/linux.git

Quoted 5 lines
Quoted 5 lines

A couple more points on this patch:

* You didn't mention that this series is based on Thierry's work-in-progress tree, and not something immediately destined for upstream. As such, only Thierry is expected to actually apply any of these

Quoted 9 lines

patches.

Quoted 2 lines
Quoted 1 line

[>] Stephen, I have mentioned it in comment description as Based on

git://gitorious.org/thierryreding/linux.git, is this not enough?

Well, first off, there are many branches there, and secondly the branch that a series is based on doesn't necessarily imply much about what you expect people to do with it.

I am not clear, What should I mention then?

#16 lore raw
Quoted 18 lines · Jay Agarwal
Quoted 18 lines · Jay Agarwal
Quoted 10 lines
Quoted 10 lines · Jay Agarwal
Quoted 8 lines

- Enable pcie root port 2 for cardhu
- Make private data structure for each SOC
- Add required tegra3 clocks and regulators
- Add tegra3 specific code in enable controller
- Modify clock tree to get clocks based on device
- Based on git://gitorious.org/thierryreding/linux.git

Quoted 5 lines
Quoted 5 lines

A couple more points on this patch:

* You didn't mention that this series is based on Thierry's work-in-progress tree, and not something immediately destined for upstream. As such, only Thierry is expected to actually apply any of these

patches.

Quoted 1 line
Quoted 1 line
Quoted 8 lines
Quoted 7 lines
Quoted 1 line

[>] Stephen, I have mentioned it in comment description as Based on

git://gitorious.org/thierryreding/linux.git, is this not enough?

Well, first off, there are many branches there, and secondly the branch that a series is based on doesn't necessarily imply much about what you expect people to do with it.

I am not clear, What should I mention then?

The branch name. Thierry's branch has the following:

remotes/gitorious_thierryreding_linux/drm/hdmi-for-3.9 remotes/gitorious_thierryreding_linux/drm/tegra-for-3.9 remotes/gitorious_thierryreding_linux/tegra/drm/for-3.8 remotes/gitorious_thierryreding_linux/tegra/drm/next remotes/gitorious_thierryreding_linux/tegra/next remotes/gitorious_thierryreding_linux/tegra/next-20130122

which of those was it based on?

Also, you simply said it was based on that repo. If you intend Thierry to apply the patches to his repo/branch, rather than the usual maintainers of the files you're editing, who you also CC'd, you should specify that.

#11 lore raw
In reply to Stephen Warren
Quoted 23 lines · Stephen Warren
Quoted 13 lines · Jay Agarwal
Quoted 13 lines

drivers/pci/host/pci-tegra.c static void tegra_pcie_power_off(struct tegra_pcie *pcie)

Quoted 3 lines
drivers/pci/host/pci-tegra.c +0 -1
 	err = regulator_disable(pcie->pex_clk_supply);
 	if (err < 0)
-		dev_err(pcie->dev, "failed to disable pex-clk regulator:

%d\n",

Review

Quoted 1 line
(quoted diff) +1 -0
+		dev_warn(pcie->dev, "failed to disable pex-clk regulator:

%d\n",

drivers/pci/host/pci-tegra.c static void tegra_pcie_power_off(struct tegra_pcie *pcie)

Quoted 6 lines
drivers/pci/host/pci-tegra.c +1 -1
 			err);
 
 	err = regulator_disable(pcie->vdd_supply);
 	if (err < 0)
-		dev_err(pcie->dev, "failed to disable VDD regulator: %d\n",
+		dev_warn(pcie->dev, "failed to disable VDD regulator:

%d\n",

Quoted 8 lines
Quoted 7 lines
Quoted 1 line

err);

Please explain why that change is correct. If the regulators only exist on Tegra20, please represent that fact in the SoC data. Regulators must always exist, so enable/disable should never fail due to missing regulators. Actual run-time failures seem like something that really is an error.

[>] These regulators are needed for both tegra20 & tegra30. Since we are not returning error here, so changed to dev_warn.

Quoted 8 lines

If the regulators are required, then any failure to operate them should be an error, hence dev_err() seems correct.

As to why the code doesn't actually return an error? I'm not sure. Perhaps that should be fixed with a separate patch, although I don't recall exactly where in the code the above excerpt is; if it's in remove(), then continuing on without returning an error would be appropriate.

That code is from tegra_pcie_power_off(), which is called only during error cleanup or from tegra_pcie_put_resources() which in turn is also only called in cleanup paths or during module/device removal. Disabling as many regulators as possible is still what we want in that case, so returning an error prematurely might leave more regulators turned on than necessary.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130413/8453eb72/attachment.sig>

#18 lore raw
In reply to Jay Agarwal
Quoted 8 lines · Jay Agarwal

- Enable pcie root port 2 for cardhu
- Make private data structure for each SOC
- Add required tegra3 clocks and regulators
- Add tegra3 specific code in enable controller
- Modify clock tree to get clocks based on device
- Based on git://gitorious.org/thierryreding/linux.git

Jay, I made quite a few comments on this series, and pointed out that it didn't actually work for me. Are you planning on fixes these issues and reposting?