Update pcie-tegra194 driver with bug fixing and cleanup
Changes from V2->V3
Updated subject line from "PCI: tegra:" to "PCI: tegra194:"
Changes from V1->V2
PCI: tegra: Fix handling BME_CHGED event
- Update variable naming
PCI: tegra: Fix MSI-X programming
- No change
PCI: tegra: Disable interrupts before entering L2
- Rephrase the commit message
PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode
- Update return value to -ENOTSUPP.
PCI: tegra: Cleanup unused code
- No Change
V1:
http://patchwork.ozlabs.org/project/linux-pci/cover/[email protected]/
V2:
http://patchwork.ozlabs.org/project/linux-pci/cover/[email protected]/
Om Prakash Singh (5):
PCI: tegra: Fix handling BME_CHGED event
PCI: tegra: Fix MSI-X programming
PCI: tegra: Disable interrupts before entering L2
PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode
PCI: tegra: Cleanup unused code
drivers/pci/controller/dwc/pcie-tegra194.c | 36 +++++++++++++---------
1 file changed, 22 insertions(+), 14 deletions(-)
--
2.17.1
Lower order MSI-X address is programmed in MSIX_ADDR_MATCH_HIGH_OFF
DBI register instead of higher order address. This patch fixes this
programming mistake.
Signed-off-by: Om Prakash Singh <[email protected]>
Reviewed-by: Bjorn Helgaas <[email protected]>
Acked-by: Vidya Sagar <[email protected]>
---
drivers/pci/controller/dwc/pcie-tegra194.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 6f388523bffe..66e00b276cd3 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1863,7 +1863,7 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
val = (ep->msi_mem_phys & MSIX_ADDR_MATCH_LOW_OFF_MASK);
val |= MSIX_ADDR_MATCH_LOW_OFF_EN;
dw_pcie_writel_dbi(pci, MSIX_ADDR_MATCH_LOW_OFF, val);
- val = (lower_32_bits(ep->msi_mem_phys) & MSIX_ADDR_MATCH_HIGH_OFF_MASK);
+ val = (upper_32_bits(ep->msi_mem_phys) & MSIX_ADDR_MATCH_HIGH_OFF_MASK);
dw_pcie_writel_dbi(pci, MSIX_ADDR_MATCH_HIGH_OFF, val);
ret = dw_pcie_ep_init_complete(ep);
--
2.17.1
When Tegra PCIe is in endpoint mode it should be available for root port.
PCIe link up by root port fails if it is in suspend state. So, don't allow
Tegra to suspend when endpoint mode is enabled.
Signed-off-by: Om Prakash Singh <[email protected]>
Reviewed-by: Bjorn Helgaas <[email protected]>
Acked-by: Vidya Sagar <[email protected]>
---
drivers/pci/controller/dwc/pcie-tegra194.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 64ec0da31b5b..ae4c0a29818d 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -2276,6 +2276,11 @@ static int tegra_pcie_dw_suspend_late(struct device *dev)
struct tegra_pcie_dw *pcie = dev_get_drvdata(dev);
u32 val;
+ if (pcie->mode == DW_PCIE_EP_TYPE) {
+ dev_err(dev, "Suspend is not supported in EP mode");
+ return -ENOTSUPP;
+ }
+
if (!pcie->link_state)
return 0;
--
2.17.1
Remove unused code from function tegra_pcie_config_ep.
Signed-off-by: Om Prakash Singh <[email protected]>
Reviewed-by: Bjorn Helgaas <[email protected]>
Acked-by: Vidya Sagar <[email protected]>
---
drivers/pci/controller/dwc/pcie-tegra194.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index ae4c0a29818d..e9d573c850dd 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -2045,13 +2045,6 @@ static int tegra_pcie_config_ep(struct tegra_pcie_dw *pcie,
return ret;
}
- name = devm_kasprintf(dev, GFP_KERNEL, "tegra_pcie_%u_ep_work",
- pcie->cid);
- if (!name) {
- dev_err(dev, "Failed to create PCIe EP work thread string\n");
- return -ENOMEM;
- }
-
pm_runtime_enable(dev);
ret = dw_pcie_ep_init(ep);
--
2.17.1
Hi Lorenzo,
Can you help review these patches.
Thanks,
Om
On 6/23/2021 3:35 PM, Om Prakash Singh wrote:
> External email: Use caution opening links or attachments
>
>
> Update pcie-tegra194 driver with bug fixing and cleanup
>
> Changes from V2->V3
> Updated subject line from "PCI: tegra:" to "PCI: tegra194:"
>
> Changes from V1->V2
> PCI: tegra: Fix handling BME_CHGED event
> - Update variable naming
> PCI: tegra: Fix MSI-X programming
> - No change
> PCI: tegra: Disable interrupts before entering L2
> - Rephrase the commit message
> PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode
> - Update return value to -ENOTSUPP.
> PCI: tegra: Cleanup unused code
> - No Change
>
> V1:
> http://patchwork.ozlabs.org/project/linux-pci/cover/[email protected]/
> V2:
> http://patchwork.ozlabs.org/project/linux-pci/cover/[email protected]/
>
> Om Prakash Singh (5):
> PCI: tegra: Fix handling BME_CHGED event
> PCI: tegra: Fix MSI-X programming
> PCI: tegra: Disable interrupts before entering L2
> PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode
> PCI: tegra: Cleanup unused code
>
> drivers/pci/controller/dwc/pcie-tegra194.c | 36 +++++++++++++---------
> 1 file changed, 22 insertions(+), 14 deletions(-)
>
> --
> 2.17.1
>
Hi Lorenzo,
Please consider these patches to review.
Thanks,
Om
On 6/23/2021 3:35 PM, Om Prakash Singh wrote:
> External email: Use caution opening links or attachments
>
>
> Update pcie-tegra194 driver with bug fixing and cleanup
>
> Changes from V2->V3
> Updated subject line from "PCI: tegra:" to "PCI: tegra194:"
>
> Changes from V1->V2
> PCI: tegra: Fix handling BME_CHGED event
> - Update variable naming
> PCI: tegra: Fix MSI-X programming
> - No change
> PCI: tegra: Disable interrupts before entering L2
> - Rephrase the commit message
> PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode
> - Update return value to -ENOTSUPP.
> PCI: tegra: Cleanup unused code
> - No Change
>
> V1:
> http://patchwork.ozlabs.org/project/linux-pci/cover/[email protected]/
> V2:
> http://patchwork.ozlabs.org/project/linux-pci/cover/[email protected]/
>
> Om Prakash Singh (5):
> PCI: tegra: Fix handling BME_CHGED event
> PCI: tegra: Fix MSI-X programming
> PCI: tegra: Disable interrupts before entering L2
> PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode
> PCI: tegra: Cleanup unused code
>
> drivers/pci/controller/dwc/pcie-tegra194.c | 36 +++++++++++++---------
> 1 file changed, 22 insertions(+), 14 deletions(-)
>
> --
> 2.17.1
>
On Wed, 23 Jun 2021 15:35:20 +0530, Om Prakash Singh wrote:
> Update pcie-tegra194 driver with bug fixing and cleanup
>
> Changes from V2->V3
> Updated subject line from "PCI: tegra:" to "PCI: tegra194:"
>
> Changes from V1->V2
> PCI: tegra: Fix handling BME_CHGED event
> - Update variable naming
> PCI: tegra: Fix MSI-X programming
> - No change
> PCI: tegra: Disable interrupts before entering L2
> - Rephrase the commit message
> PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode
> - Update return value to -ENOTSUPP.
> PCI: tegra: Cleanup unused code
> - No Change
>
> [...]
Applied to pci/tegra194, thanks!
[1/5] PCI: tegra194: Fix handling BME_CHGED event
https://git.kernel.org/lpieralisi/pci/c/ceb1412c1c
[2/5] PCI: tegra194: Fix MSI-X programming
https://git.kernel.org/lpieralisi/pci/c/43537cf7e3
[3/5] PCI: tegra194: Disable interrupts before entering L2
https://git.kernel.org/lpieralisi/pci/c/834c5cf2b5
[4/5] PCI: tegra194: Don't allow suspend when Tegra PCIe is in EP mode
https://git.kernel.org/lpieralisi/pci/c/de2bbf2b71
[5/5] PCI: tegra194: Cleanup unused code
https://git.kernel.org/lpieralisi/pci/c/f62750e691
Thanks,
Lorenzo