From: Kishon Vijay Abraham I <hidden> Date: 2016-01-13 06:48:36
This series adds pdata-quirk mechanism to reset PCIe as a temporary
fix till reset controller driver is added in mainline.
Without this series, a stall is observed if pci dra7xx driver
is enabled.
Changes from v1:
*) Removed 'HACK' from $subject
*) removed reviewed-by Suman
Kishon Vijay Abraham I (3):
ARM: DRA7: hwmod: Add reset data for PCIe
ARM: DRA7: add pdata-quirks to do reset of PCIe
pci: dra7xx: use pdata callbacks to perform reset
arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 15 ++++++++++++++
arch/arm/mach-omap2/pdata-quirks.c | 11 ++++++++++
arch/arm/mach-omap2/prm7xx.h | 1 +
drivers/pci/host/pci-dra7xx.c | 32 +++++++++++++++++++++++++++++
include/linux/platform_data/pci-dra7xx.h | 22 ++++++++++++++++++++
5 files changed, 81 insertions(+)
create mode 100644 include/linux/platform_data/pci-dra7xx.h
--
1.7.9.5
From: Kishon Vijay Abraham I <hidden> Date: 2016-01-13 06:48:29
Use pdata-quirks to reset PCIe IP. This is to be used until
a drivers/reset/ interface is available for this purpose.
Signed-off-by: Kishon Vijay Abraham I <redacted>
Signed-off-by: Sekhar Nori <redacted>
---
arch/arm/mach-omap2/pdata-quirks.c | 11 +++++++++++
include/linux/platform_data/pci-dra7xx.h | 22 ++++++++++++++++++++++
2 files changed, 33 insertions(+)
create mode 100644 include/linux/platform_data/pci-dra7xx.h
From: Kishon Vijay Abraham I <hidden> Date: 2016-01-13 06:48:34
Use platform populated reset assert and deassert
callbacks to perform reset of PCIe.
Use these callbacks until a reset interface using drivers/reset
is available for the purpose.
Signed-off-by: Kishon Vijay Abraham I <redacted>
Signed-off-by: Sekhar Nori <redacted>
---
drivers/pci/host/pci-dra7xx.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
@@ -329,6 +331,32 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,return0;}+staticintdra7xx_pcie_reset(structplatform_device*pdev)+{+intret;+structdevice*dev=&pdev->dev;+structpci_dra7xx_platform_data*pdata=pdev->dev.platform_data;++if(!(pdata&&pdata->deassert_reset&&pdata->assert_reset)){+dev_err(dev,"platform data for reset not found!\n");+return-EINVAL;+}++ret=pdata->assert_reset(pdev,pdata->reset_name);+if(ret){+dev_err(dev,"assert_reset failed: %d\n",ret);+returnret;+}++ret=pdata->deassert_reset(pdev,pdata->reset_name);+if(ret){+dev_err(dev,"deassert_reset failed: %d\n",ret);+returnret;+}++return0;+}+staticint__initdra7xx_pcie_probe(structplatform_device*pdev){u32reg;
@@ -347,6 +375,10 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)enumof_gpio_flagsflags;unsignedlonggpio_flags;+ret=dra7xx_pcie_reset(pdev);+if(ret)+returnret;+dra7xx=devm_kzalloc(dev,sizeof(*dra7xx),GFP_KERNEL);if(!dra7xx)return-ENOMEM;
From: Tony Lindgren <tony@atomide.com> Date: 2016-01-13 17:19:20
* Kishon Vijay Abraham I [off-list ref] [160112 22:48]:
Use platform populated reset assert and deassert
callbacks to perform reset of PCIe.
Use these callbacks until a reset interface using drivers/reset
is available for the purpose.
This one has a dependency to the second patch for the platform
data.
Bjorn, how do you prefer to merge this once there are no more
comments?
How about I set up an immutable branch against v4.5-rc1 with
just these three patches that we can both then merge in?
My preference is to add this to linux next after the merge
window for v4.6. Bjorn, if you want it merged as fixes, I'm
fine with that too naturally.
Regards,
Tony
From: Suman Anna <hidden> Date: 2016-01-13 17:35:57
Hi Kishon,
On 01/13/2016 12:47 AM, Kishon Vijay Abraham I wrote:
Use pdata-quirks to reset PCIe IP.
This can do with some clarity. The patch adds the platform data, doesn't
do reset.
This is to be used until
quoted hunk
a drivers/reset/ interface is available for this purpose.
Signed-off-by: Kishon Vijay Abraham I <redacted>
Signed-off-by: Sekhar Nori <redacted>
---
arch/arm/mach-omap2/pdata-quirks.c | 11 +++++++++++
include/linux/platform_data/pci-dra7xx.h | 22 ++++++++++++++++++++++
2 files changed, 33 insertions(+)
create mode 100644 include/linux/platform_data/pci-dra7xx.h
From: Suman Anna <hidden> Date: 2016-01-13 17:52:08
On 01/13/2016 12:47 AM, Kishon Vijay Abraham I wrote:
quoted hunk
Use platform populated reset assert and deassert
callbacks to perform reset of PCIe.
Use these callbacks until a reset interface using drivers/reset
is available for the purpose.
Signed-off-by: Kishon Vijay Abraham I <redacted>
Signed-off-by: Sekhar Nori <redacted>
---
drivers/pci/host/pci-dra7xx.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
@@ -329,6 +331,32 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,return0;}+staticintdra7xx_pcie_reset(structplatform_device*pdev)+{+intret;+structdevice*dev=&pdev->dev;+structpci_dra7xx_platform_data*pdata=pdev->dev.platform_data;++if(!(pdata&&pdata->deassert_reset&&pdata->assert_reset)){+dev_err(dev,"platform data for reset not found!\n");+return-EINVAL;+}++ret=pdata->assert_reset(pdev,pdata->reset_name);+if(ret){+dev_err(dev,"assert_reset failed: %d\n",ret);+returnret;+}++ret=pdata->deassert_reset(pdev,pdata->reset_name);+if(ret){+dev_err(dev,"deassert_reset failed: %d\n",ret);+returnret;+}
The only comment I have on this is the symmetry (assert_reset invocation
in driver remove). If you install and remove the module once, then the
reset stays deasserted. On Power-On-Reset, the resets by default will be
in asserted state.
regards
SUman
From: Kishon Vijay Abraham I <hidden> Date: 2016-01-14 08:38:30
Hi Suman,
On Wednesday 13 January 2016 11:21 PM, Suman Anna wrote:
On 01/13/2016 12:47 AM, Kishon Vijay Abraham I wrote:
quoted
Use platform populated reset assert and deassert
callbacks to perform reset of PCIe.
Use these callbacks until a reset interface using drivers/reset
is available for the purpose.
Signed-off-by: Kishon Vijay Abraham I <redacted>
Signed-off-by: Sekhar Nori <redacted>
---
drivers/pci/host/pci-dra7xx.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
@@ -329,6 +331,32 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,return0;}+staticintdra7xx_pcie_reset(structplatform_device*pdev)+{+intret;+structdevice*dev=&pdev->dev;+structpci_dra7xx_platform_data*pdata=pdev->dev.platform_data;++if(!(pdata&&pdata->deassert_reset&&pdata->assert_reset)){+dev_err(dev,"platform data for reset not found!\n");+return-EINVAL;+}++ret=pdata->assert_reset(pdev,pdata->reset_name);+if(ret){+dev_err(dev,"assert_reset failed: %d\n",ret);+returnret;+}++ret=pdata->deassert_reset(pdev,pdata->reset_name);+if(ret){+dev_err(dev,"deassert_reset failed: %d\n",ret);+returnret;+}
The only comment I have on this is the symmetry (assert_reset invocation
in driver remove). If you install and remove the module once, then the
reset stays deasserted. On Power-On-Reset, the resets by default will be
in asserted state.
hmm.. not sure of the benefits of leaving the reset lines de-asserted during
remove. The idea is irrespective of the initial sate or power-on state, during
probe the driver should assert and de-assert the reset lines.
Thanks
Kishon
From: Kishon Vijay Abraham I <hidden> Date: 2016-01-14 13:29:05
Hi,
On Thursday 14 January 2016 02:07 PM, Kishon Vijay Abraham I wrote:
Hi Suman,
On Wednesday 13 January 2016 11:21 PM, Suman Anna wrote:
quoted
On 01/13/2016 12:47 AM, Kishon Vijay Abraham I wrote:
quoted
Use platform populated reset assert and deassert
callbacks to perform reset of PCIe.
Use these callbacks until a reset interface using drivers/reset
is available for the purpose.
Signed-off-by: Kishon Vijay Abraham I <redacted>
Signed-off-by: Sekhar Nori <redacted>
---
drivers/pci/host/pci-dra7xx.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
@@ -329,6 +331,32 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx,return0;}+staticintdra7xx_pcie_reset(structplatform_device*pdev)+{+intret;+structdevice*dev=&pdev->dev;+structpci_dra7xx_platform_data*pdata=pdev->dev.platform_data;++if(!(pdata&&pdata->deassert_reset&&pdata->assert_reset)){+dev_err(dev,"platform data for reset not found!\n");+return-EINVAL;+}++ret=pdata->assert_reset(pdev,pdata->reset_name);+if(ret){+dev_err(dev,"assert_reset failed: %d\n",ret);+returnret;+}++ret=pdata->deassert_reset(pdev,pdata->reset_name);+if(ret){+dev_err(dev,"deassert_reset failed: %d\n",ret);+returnret;+}
The only comment I have on this is the symmetry (assert_reset invocation
in driver remove). If you install and remove the module once, then the
reset stays deasserted. On Power-On-Reset, the resets by default will be
in asserted state.
hmm.. not sure of the benefits of leaving the reset lines de-asserted during
remove. The idea is irrespective of the initial sate or power-on state, during
probe the driver should assert and de-assert the reset lines.
Also right now the pci-dra7xx can't be inserted as a module. However since that
might be added in the future, I'll add assert_reset in the remove path of this
driver.
Thanks
Kishon