mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 14:13:16 +00:00
36a96a4493
In current state there's huge regression on ipq806x target that causes the device to transmit broken/malformed frames that are not corrected/detected by error control mechanisms and other less severe issues. https://bugs.lede-project.org/index.php?do=details&task_id=1197 This finally had been narrowed down to patch 0071-pcie-qcom-fixes.patch Meanwhile QSDK contains a handful of commits that add support for ipq806x to upstream qcom pcie driver https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/log/drivers/pci/host/pcie-qcom.c?h=eggplant Unfortunately qca developers do not bother to push it upstream. Using those commits instead of lede 0071 patch fixes mentioned issue and probably many others as it seems that corrupted data has been originating within pcie misconfiguration. Fixes: FS#1197 and probably others Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
69 lines
2.1 KiB
Diff
69 lines
2.1 KiB
Diff
From e833cdb5c792912d459773cc23153e5d78875d34 Mon Sep 17 00:00:00 2001
|
|
From: Sham Muthayyan <smuthayy@codeaurora.org>
|
|
Date: Tue, 19 Jul 2016 20:05:25 +0530
|
|
Subject: PCIE: designware: Fixed PCI host init
|
|
|
|
Change-Id: I949b302d77199fc09342acf26b7bb45a7ec467ee
|
|
Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
|
|
---
|
|
drivers/pci/host/pcie-designware.c | 9 +++++++--
|
|
drivers/pci/host/pcie-designware.h | 2 +-
|
|
drivers/pci/host/pcie-qcom.c | 5 +++--
|
|
3 files changed, 11 insertions(+), 5 deletions(-)
|
|
|
|
--- a/drivers/pci/host/pcie-designware.c
|
|
+++ b/drivers/pci/host/pcie-designware.c
|
|
@@ -637,8 +637,13 @@ int dw_pcie_host_init(struct pcie_port *
|
|
}
|
|
}
|
|
|
|
- if (pp->ops->host_init)
|
|
- pp->ops->host_init(pp);
|
|
+ if (pp->ops->host_init) {
|
|
+ ret = pp->ops->host_init(pp);
|
|
+ if (ret) {
|
|
+ dev_err(pp->dev, "hostinit failed\n");
|
|
+ return 0;
|
|
+ }
|
|
+ }
|
|
|
|
pp->root_bus_nr = pp->busn->start;
|
|
if (IS_ENABLED(CONFIG_PCI_MSI)) {
|
|
--- a/drivers/pci/host/pcie-designware.h
|
|
+++ b/drivers/pci/host/pcie-designware.h
|
|
@@ -63,7 +63,7 @@ struct pcie_host_ops {
|
|
int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
|
|
unsigned int devfn, int where, int size, u32 val);
|
|
int (*link_up)(struct pcie_port *pp);
|
|
- void (*host_init)(struct pcie_port *pp);
|
|
+ int (*host_init)(struct pcie_port *pp);
|
|
void (*msi_set_irq)(struct pcie_port *pp, int irq);
|
|
void (*msi_clear_irq)(struct pcie_port *pp, int irq);
|
|
phys_addr_t (*get_msi_addr)(struct pcie_port *pp);
|
|
--- a/drivers/pci/host/pcie-qcom.c
|
|
+++ b/drivers/pci/host/pcie-qcom.c
|
|
@@ -515,7 +515,7 @@ static int qcom_pcie_link_up(struct pcie
|
|
return !!(val & PCI_EXP_LNKSTA_DLLLA);
|
|
}
|
|
|
|
-static void qcom_pcie_host_init(struct pcie_port *pp)
|
|
+static int qcom_pcie_host_init(struct pcie_port *pp)
|
|
{
|
|
struct qcom_pcie *pcie = to_qcom_pcie(pp);
|
|
int ret;
|
|
@@ -541,12 +541,13 @@ static void qcom_pcie_host_init(struct p
|
|
if (ret)
|
|
goto err;
|
|
|
|
- return;
|
|
+ return 0;
|
|
err:
|
|
qcom_ep_reset_assert(pcie);
|
|
phy_power_off(pcie->phy);
|
|
err_deinit:
|
|
pcie->ops->deinit(pcie);
|
|
+ return ret;
|
|
}
|
|
|
|
static int qcom_pcie_rd_own_conf(struct pcie_port *pp, int where, int size,
|