Skip to content

Commit 4d6fe1d

Browse files
committed
Merge tag 'pci-v6.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
Pull PCI fixes from Bjorn Helgaas: - Remove ASPM L0s support for MSM8996 SoC since we now enable L0s when advertised, and it caused random hangs on this device (Manivannan Sadhasivam) - Fix meson-pcie to report that the link is up while in ASPM L0s or L1, since those are active states from the software point of view, and treating the link as down caused config access failures (Bjorn Helgaas) - Fix up sparc DTS BAR descriptions that are above 4GB but not marked as prefetchable, which caused resource assignment and driver probe failures after we converted from the SPARC pcibios_enable_device() to the generic version (Ilpo Järvinen) * tag 'pci-v6.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: sparc/PCI: Correct 64-bit non-pref -> pref BAR resources PCI: meson: Report that link is up while in ASPM L0s and L1 states PCI: qcom: Remove ASPM L0s support for MSM8996 SoC
2 parents 553410f + bdb3235 commit 4d6fe1d

3 files changed

Lines changed: 30 additions & 36 deletions

File tree

arch/sparc/kernel/pci.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,28 @@ static int __init ofpci_debug(char *str)
181181

182182
__setup("ofpci_debug=", ofpci_debug);
183183

184+
static void of_fixup_pci_pref(struct pci_dev *dev, int index,
185+
struct resource *res)
186+
{
187+
struct pci_bus_region region;
188+
189+
if (!(res->flags & IORESOURCE_MEM_64))
190+
return;
191+
192+
if (!resource_size(res))
193+
return;
194+
195+
pcibios_resource_to_bus(dev->bus, &region, res);
196+
if (region.end <= ~((u32)0))
197+
return;
198+
199+
if (!(res->flags & IORESOURCE_PREFETCH)) {
200+
res->flags |= IORESOURCE_PREFETCH;
201+
pci_info(dev, "reg 0x%x: fixup: pref added to 64-bit resource\n",
202+
index);
203+
}
204+
}
205+
184206
static unsigned long pci_parse_of_flags(u32 addr0)
185207
{
186208
unsigned long flags = 0;
@@ -244,6 +266,7 @@ static void pci_parse_of_addrs(struct platform_device *op,
244266
res->end = op_res->end;
245267
res->flags = flags;
246268
res->name = pci_name(dev);
269+
of_fixup_pci_pref(dev, i, res);
247270

248271
pci_info(dev, "reg 0x%x: %pR\n", i, res);
249272
}

drivers/pci/controller/dwc/pci-meson.c

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#define PCIE_CFG_STATUS17 0x44
3838
#define PM_CURRENT_STATE(x) (((x) >> 7) & 0x1)
3939

40-
#define WAIT_LINKUP_TIMEOUT 4000
4140
#define PORT_CLK_RATE 100000000UL
4241
#define MAX_PAYLOAD_SIZE 256
4342
#define MAX_READ_REQ_SIZE 256
@@ -350,40 +349,10 @@ static struct pci_ops meson_pci_ops = {
350349
static bool meson_pcie_link_up(struct dw_pcie *pci)
351350
{
352351
struct meson_pcie *mp = to_meson_pcie(pci);
353-
struct device *dev = pci->dev;
354-
u32 speed_okay = 0;
355-
u32 cnt = 0;
356-
u32 state12, state17, smlh_up, ltssm_up, rdlh_up;
357-
358-
do {
359-
state12 = meson_cfg_readl(mp, PCIE_CFG_STATUS12);
360-
state17 = meson_cfg_readl(mp, PCIE_CFG_STATUS17);
361-
smlh_up = IS_SMLH_LINK_UP(state12);
362-
rdlh_up = IS_RDLH_LINK_UP(state12);
363-
ltssm_up = IS_LTSSM_UP(state12);
364-
365-
if (PM_CURRENT_STATE(state17) < PCIE_GEN3)
366-
speed_okay = 1;
367-
368-
if (smlh_up)
369-
dev_dbg(dev, "smlh_link_up is on\n");
370-
if (rdlh_up)
371-
dev_dbg(dev, "rdlh_link_up is on\n");
372-
if (ltssm_up)
373-
dev_dbg(dev, "ltssm_up is on\n");
374-
if (speed_okay)
375-
dev_dbg(dev, "speed_okay\n");
376-
377-
if (smlh_up && rdlh_up && ltssm_up && speed_okay)
378-
return true;
379-
380-
cnt++;
381-
382-
udelay(10);
383-
} while (cnt < WAIT_LINKUP_TIMEOUT);
384-
385-
dev_err(dev, "error: wait linkup timeout\n");
386-
return false;
352+
u32 state12;
353+
354+
state12 = meson_cfg_readl(mp, PCIE_CFG_STATUS12);
355+
return IS_SMLH_LINK_UP(state12) && IS_RDLH_LINK_UP(state12);
387356
}
388357

389358
static int meson_pcie_host_init(struct dw_pcie_rp *pp)

drivers/pci/controller/dwc/pcie-qcom.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,6 @@ static int qcom_pcie_post_init_2_7_0(struct qcom_pcie *pcie)
10471047
writel(WR_NO_SNOOP_OVERRIDE_EN | RD_NO_SNOOP_OVERRIDE_EN,
10481048
pcie->parf + PARF_NO_SNOOP_OVERRIDE);
10491049

1050-
qcom_pcie_clear_aspm_l0s(pcie->pci);
10511050
qcom_pcie_clear_hpc(pcie->pci);
10521051

10531052
return 0;
@@ -1316,6 +1315,8 @@ static int qcom_pcie_host_init(struct dw_pcie_rp *pp)
13161315
goto err_disable_phy;
13171316
}
13181317

1318+
qcom_pcie_clear_aspm_l0s(pcie->pci);
1319+
13191320
qcom_ep_reset_deassert(pcie);
13201321

13211322
if (pcie->cfg->ops->config_sid) {
@@ -1464,6 +1465,7 @@ static const struct qcom_pcie_cfg cfg_2_1_0 = {
14641465

14651466
static const struct qcom_pcie_cfg cfg_2_3_2 = {
14661467
.ops = &ops_2_3_2,
1468+
.no_l0s = true,
14671469
};
14681470

14691471
static const struct qcom_pcie_cfg cfg_2_3_3 = {

0 commit comments

Comments
 (0)