2017-06-20 08:20:34

by Marc Gonzalez

[permalink] [raw]
Subject: [PATCH v9 0/3] Tango PCIe controller support

Marc Z pointed out that posting partial series is not ideal.
Collect last-minute fixups into a single patch series.

- Bump series to v9 to avoid any ambiguity
- Add Rob's Ack on patch 1

Marc Gonzalez (3):
PCI: Add DT binding for tango PCIe controller
PCI: Add tango PCIe host bridge support
PCI: Add tango MSI controller support

.../devicetree/bindings/pci/tango-pcie.txt | 29 ++
drivers/pci/host/Kconfig | 8 +
drivers/pci/host/Makefile | 1 +
drivers/pci/host/pcie-tango.c | 390 +++++++++++++++++++++
include/linux/pci_ids.h | 2 +
5 files changed, 430 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pci/tango-pcie.txt
create mode 100644 drivers/pci/host/pcie-tango.c

--
2.11.0


2017-06-20 08:21:11

by Marc Gonzalez

[permalink] [raw]
Subject: [PATCH v9 3/3] PCI: Add tango MSI controller support

The MSI controller in Tango supports 256 message-signaled interrupts,
and a single doorbell address.

Signed-off-by: Marc Gonzalez <[email protected]>
---
drivers/pci/host/pcie-tango.c | 226 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 226 insertions(+)

diff --git a/drivers/pci/host/pcie-tango.c b/drivers/pci/host/pcie-tango.c
index 67aaadcc1c5e..5c47a4cc03e3 100644
--- a/drivers/pci/host/pcie-tango.c
+++ b/drivers/pci/host/pcie-tango.c
@@ -1,16 +1,229 @@
+#include <linux/irqchip/chained_irq.h>
+#include <linux/irqdomain.h>
#include <linux/pci-ecam.h>
#include <linux/delay.h>
+#include <linux/msi.h>
#include <linux/of.h>

#define MSI_MAX 256

#define SMP8759_MUX 0x48
#define SMP8759_TEST_OUT 0x74
+#define SMP8759_STATUS 0x80
+#define SMP8759_ENABLE 0xa0
+#define SMP8759_DOORBELL 0xa002e07c

struct tango_pcie {
+ DECLARE_BITMAP(used_msi, MSI_MAX);
+ spinlock_t used_msi_lock;
void __iomem *mux;
+ void __iomem *msi_status;
+ void __iomem *msi_enable;
+ phys_addr_t msi_doorbell;
+ struct irq_domain *irq_dom;
+ struct irq_domain *msi_dom;
+ int irq;
};

+/*** MSI CONTROLLER SUPPORT ***/
+
+static void tango_msi_isr(struct irq_desc *desc)
+{
+ struct irq_chip *chip = irq_desc_get_chip(desc);
+ struct tango_pcie *pcie = irq_desc_get_handler_data(desc);
+ unsigned long status, base, virq, idx, pos = 0;
+
+ chained_irq_enter(chip, desc);
+ spin_lock(&pcie->used_msi_lock);
+
+ while ((pos = find_next_bit(pcie->used_msi, MSI_MAX, pos)) < MSI_MAX) {
+ base = round_down(pos, 32);
+ status = readl_relaxed(pcie->msi_status + base / 8);
+ for_each_set_bit(idx, &status, 32) {
+ virq = irq_find_mapping(pcie->irq_dom, base + idx);
+ generic_handle_irq(virq);
+ }
+ pos = base + 32;
+ }
+
+ spin_unlock(&pcie->used_msi_lock);
+ chained_irq_exit(chip, desc);
+}
+
+static void tango_ack(struct irq_data *d)
+{
+ struct tango_pcie *pcie = d->chip_data;
+ u32 offset = (d->hwirq / 32) * 4;
+ u32 bit = BIT(d->hwirq % 32);
+
+ writel_relaxed(bit, pcie->msi_status + offset);
+}
+
+static void update_msi_enable(struct irq_data *d, bool unmask)
+{
+ unsigned long flags;
+ struct tango_pcie *pcie = d->chip_data;
+ u32 offset = (d->hwirq / 32) * 4;
+ u32 bit = BIT(d->hwirq % 32);
+ u32 val;
+
+ spin_lock_irqsave(&pcie->used_msi_lock, flags);
+ val = readl_relaxed(pcie->msi_enable + offset);
+ val = unmask ? val | bit : val & ~bit;
+ writel_relaxed(val, pcie->msi_enable + offset);
+ spin_unlock_irqrestore(&pcie->used_msi_lock, flags);
+}
+
+static void tango_mask(struct irq_data *d)
+{
+ update_msi_enable(d, false);
+}
+
+static void tango_unmask(struct irq_data *d)
+{
+ update_msi_enable(d, true);
+}
+
+static int tango_set_affinity(struct irq_data *d,
+ const struct cpumask *mask, bool force)
+{
+ return -EINVAL;
+}
+
+static void tango_compose_msi_msg(struct irq_data *d, struct msi_msg *msg)
+{
+ struct tango_pcie *pcie = d->chip_data;
+ msg->address_lo = lower_32_bits(pcie->msi_doorbell);
+ msg->address_hi = upper_32_bits(pcie->msi_doorbell);
+ msg->data = d->hwirq;
+}
+
+static struct irq_chip tango_chip = {
+ .irq_ack = tango_ack,
+ .irq_mask = tango_mask,
+ .irq_unmask = tango_unmask,
+ .irq_set_affinity = tango_set_affinity,
+ .irq_compose_msi_msg = tango_compose_msi_msg,
+};
+
+static void msi_ack(struct irq_data *d)
+{
+ irq_chip_ack_parent(d);
+}
+
+static void msi_mask(struct irq_data *d)
+{
+ pci_msi_mask_irq(d);
+ irq_chip_mask_parent(d);
+}
+
+static void msi_unmask(struct irq_data *d)
+{
+ pci_msi_unmask_irq(d);
+ irq_chip_unmask_parent(d);
+}
+
+static struct irq_chip msi_chip = {
+ .name = "MSI",
+ .irq_ack = msi_ack,
+ .irq_mask = msi_mask,
+ .irq_unmask = msi_unmask,
+};
+
+static struct msi_domain_info msi_dom_info = {
+ .flags = MSI_FLAG_PCI_MSIX
+ | MSI_FLAG_USE_DEF_DOM_OPS
+ | MSI_FLAG_USE_DEF_CHIP_OPS,
+ .chip = &msi_chip,
+};
+
+static int tango_irq_domain_alloc(struct irq_domain *dom,
+ unsigned int virq, unsigned int nr_irqs, void *args)
+{
+ int pos;
+ unsigned long flags;
+ struct tango_pcie *pcie = dom->host_data;
+
+ spin_lock_irqsave(&pcie->used_msi_lock, flags);
+ pos = find_first_zero_bit(pcie->used_msi, MSI_MAX);
+ if (pos >= MSI_MAX) {
+ spin_unlock_irqrestore(&pcie->used_msi_lock, flags);
+ return -ENOSPC;
+ }
+ __set_bit(pos, pcie->used_msi);
+ spin_unlock_irqrestore(&pcie->used_msi_lock, flags);
+ irq_domain_set_info(dom, virq, pos, &tango_chip,
+ pcie, handle_edge_irq, NULL, NULL);
+
+ return 0;
+}
+
+static void tango_irq_domain_free(struct irq_domain *dom,
+ unsigned int virq, unsigned int nr_irqs)
+{
+ unsigned long flags;
+ struct irq_data *d = irq_domain_get_irq_data(dom, virq);
+ struct tango_pcie *pcie = d->chip_data;
+
+ spin_lock_irqsave(&pcie->used_msi_lock, flags);
+ __clear_bit(d->hwirq, pcie->used_msi);
+ spin_unlock_irqrestore(&pcie->used_msi_lock, flags);
+}
+
+static const struct irq_domain_ops irq_dom_ops = {
+ .alloc = tango_irq_domain_alloc,
+ .free = tango_irq_domain_free,
+};
+
+static int tango_msi_remove(struct platform_device *pdev)
+{
+ struct tango_pcie *pcie = platform_get_drvdata(pdev);
+
+ irq_set_chained_handler_and_data(pcie->irq, NULL, NULL);
+ irq_domain_remove(pcie->msi_dom);
+ irq_domain_remove(pcie->irq_dom);
+
+ return 0;
+}
+
+static int tango_msi_probe(struct platform_device *pdev, struct tango_pcie *pcie)
+{
+ int i, virq;
+ struct irq_domain *msi_dom, *irq_dom;
+ struct fwnode_handle *fwnode = of_node_to_fwnode(pdev->dev.of_node);
+
+ spin_lock_init(&pcie->used_msi_lock);
+ for (i = 0; i < MSI_MAX / 32; ++i)
+ writel_relaxed(0, pcie->msi_enable + i * 4);
+
+ virq = platform_get_irq(pdev, 1);
+ if (virq <= 0) {
+ pr_err("Failed to map IRQ\n");
+ return -ENXIO;
+ }
+
+ irq_dom = irq_domain_create_linear(fwnode, MSI_MAX, &irq_dom_ops, pcie);
+ if (!irq_dom) {
+ pr_err("Failed to create IRQ domain\n");
+ return -ENOMEM;
+ }
+
+ msi_dom = pci_msi_create_irq_domain(fwnode, &msi_dom_info, irq_dom);
+ if (!msi_dom) {
+ pr_err("Failed to create MSI domain\n");
+ irq_domain_remove(irq_dom);
+ return -ENOMEM;
+ }
+
+ pcie->irq_dom = irq_dom;
+ pcie->msi_dom = msi_dom;
+ pcie->irq = virq;
+
+ irq_set_chained_handler_and_data(virq, tango_msi_isr, pcie);
+
+ return 0;
+}
+
/*** HOST BRIDGE SUPPORT ***/

static int smp8759_config_read(struct pci_bus *bus,
@@ -88,6 +301,9 @@ static int tango_check_pcie_link(void __iomem *test_out)
static int smp8759_init(struct tango_pcie *pcie, void __iomem *base)
{
pcie->mux = base + SMP8759_MUX;
+ pcie->msi_status = base + SMP8759_STATUS;
+ pcie->msi_enable = base + SMP8759_ENABLE;
+ pcie->msi_doorbell = SMP8759_DOORBELL;

return tango_check_pcie_link(base + SMP8759_TEST_OUT);
}
@@ -121,11 +337,21 @@ static int tango_pcie_probe(struct platform_device *pdev)
if (ret)
return ret;

+ ret = tango_msi_probe(pdev, pcie);
+ if (ret)
+ return ret;
+
return pci_host_common_probe(pdev, &smp8759_ecam_ops);
}

+static int tango_pcie_remove(struct platform_device *pdev)
+{
+ return tango_msi_remove(pdev);
+}
+
static struct platform_driver tango_pcie_driver = {
.probe = tango_pcie_probe,
+ .remove = tango_pcie_remove,
.driver = {
.name = KBUILD_MODNAME,
.of_match_table = tango_pcie_ids,
--
2.11.0

2017-06-20 08:21:09

by Marc Gonzalez

[permalink] [raw]
Subject: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

This driver is required to work around several hardware bugs
in the PCIe controller.

NB: Revision 1 does not support legacy interrupts, or IO space.

Signed-off-by: Marc Gonzalez <[email protected]>
---
drivers/pci/host/Kconfig | 8 +++
drivers/pci/host/Makefile | 1 +
drivers/pci/host/pcie-tango.c | 164 ++++++++++++++++++++++++++++++++++++++++++
include/linux/pci_ids.h | 2 +
4 files changed, 175 insertions(+)
create mode 100644 drivers/pci/host/pcie-tango.c

diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
index d7e7c0a827c3..5183d9095c3a 100644
--- a/drivers/pci/host/Kconfig
+++ b/drivers/pci/host/Kconfig
@@ -285,6 +285,14 @@ config PCIE_ROCKCHIP
There is 1 internal PCIe port available to support GEN2 with
4 slots.

+config PCIE_TANGO
+ bool "Tango PCIe controller"
+ depends on ARCH_TANGO && PCI_MSI && OF
+ select PCI_HOST_COMMON
+ help
+ Say Y here to enable PCIe controller support for Sigma Designs
+ Tango systems, such as SMP8759 and later chips.
+
config VMD
depends on PCI_MSI && X86_64
tristate "Intel Volume Management Device Driver"
diff --git a/drivers/pci/host/Makefile b/drivers/pci/host/Makefile
index 084cb4983645..fc7ea90196f3 100644
--- a/drivers/pci/host/Makefile
+++ b/drivers/pci/host/Makefile
@@ -32,4 +32,5 @@ obj-$(CONFIG_PCI_HOST_THUNDER_PEM) += pci-thunder-pem.o
obj-$(CONFIG_PCIE_ARMADA_8K) += pcie-armada8k.o
obj-$(CONFIG_PCIE_ARTPEC6) += pcie-artpec6.o
obj-$(CONFIG_PCIE_ROCKCHIP) += pcie-rockchip.o
+obj-$(CONFIG_PCIE_TANGO) += pcie-tango.o
obj-$(CONFIG_VMD) += vmd.o
diff --git a/drivers/pci/host/pcie-tango.c b/drivers/pci/host/pcie-tango.c
new file mode 100644
index 000000000000..67aaadcc1c5e
--- /dev/null
+++ b/drivers/pci/host/pcie-tango.c
@@ -0,0 +1,164 @@
+#include <linux/pci-ecam.h>
+#include <linux/delay.h>
+#include <linux/of.h>
+
+#define MSI_MAX 256
+
+#define SMP8759_MUX 0x48
+#define SMP8759_TEST_OUT 0x74
+
+struct tango_pcie {
+ void __iomem *mux;
+};
+
+/*** HOST BRIDGE SUPPORT ***/
+
+static int smp8759_config_read(struct pci_bus *bus,
+ unsigned int devfn, int where, int size, u32 *val)
+{
+ int ret;
+ struct pci_config_window *cfg = bus->sysdata;
+ struct tango_pcie *pcie = dev_get_drvdata(cfg->parent);
+
+ /*
+ * QUIRK #1
+ * Reads in configuration space outside devfn 0 return garbage.
+ */
+ if (devfn != 0)
+ return PCIBIOS_FUNC_NOT_SUPPORTED;
+
+ /*
+ * QUIRK #2
+ * Unfortunately, config and mem spaces are muxed.
+ * Linux does not support such a setting, since drivers are free
+ * to access mem space directly, at any time.
+ * Therefore, we can only PRAY that config and mem space accesses
+ * NEVER occur concurrently.
+ */
+ writel_relaxed(1, pcie->mux);
+ ret = pci_generic_config_read(bus, devfn, where, size, val);
+ writel_relaxed(0, pcie->mux);
+
+ return ret;
+}
+
+static int smp8759_config_write(struct pci_bus *bus,
+ unsigned int devfn, int where, int size, u32 val)
+{
+ int ret;
+ struct pci_config_window *cfg = bus->sysdata;
+ struct tango_pcie *pcie = dev_get_drvdata(cfg->parent);
+
+ writel_relaxed(1, pcie->mux);
+ ret = pci_generic_config_write(bus, devfn, where, size, val);
+ writel_relaxed(0, pcie->mux);
+
+ return ret;
+}
+
+static struct pci_ecam_ops smp8759_ecam_ops = {
+ .bus_shift = 20,
+ .pci_ops = {
+ .map_bus = pci_ecam_map_bus,
+ .read = smp8759_config_read,
+ .write = smp8759_config_write,
+ }
+};
+
+static const struct of_device_id tango_pcie_ids[] = {
+ { .compatible = "sigma,smp8759-pcie" },
+ { /* sentinel */ },
+};
+
+static int tango_check_pcie_link(void __iomem *test_out)
+{
+ int i;
+
+ writel_relaxed(16, test_out);
+ for (i = 0; i < 10; ++i) {
+ u32 ltssm_state = readl_relaxed(test_out) >> 8;
+ if ((ltssm_state & 0x1f) == 0xf) /* L0 */
+ return 0;
+ usleep_range(3000, 4000);
+ }
+
+ return -ENODEV;
+}
+
+static int smp8759_init(struct tango_pcie *pcie, void __iomem *base)
+{
+ pcie->mux = base + SMP8759_MUX;
+
+ return tango_check_pcie_link(base + SMP8759_TEST_OUT);
+}
+
+static int tango_pcie_probe(struct platform_device *pdev)
+{
+ int ret = -EINVAL;
+ void __iomem *base;
+ struct resource *res;
+ struct tango_pcie *pcie;
+ struct device *dev = &pdev->dev;
+
+ pr_err("MAJOR ISSUE: PCIe config and mem spaces are muxed\n");
+ pr_err("Tainting kernel... Use driver at your own risk\n");
+ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
+
+ pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
+ if (!pcie)
+ return -ENOMEM;
+
+ platform_set_drvdata(pdev, pcie);
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
+ if (of_device_is_compatible(dev->of_node, "sigma,smp8759-pcie"))
+ ret = smp8759_init(pcie, base);
+
+ if (ret)
+ return ret;
+
+ return pci_host_common_probe(pdev, &smp8759_ecam_ops);
+}
+
+static struct platform_driver tango_pcie_driver = {
+ .probe = tango_pcie_probe,
+ .driver = {
+ .name = KBUILD_MODNAME,
+ .of_match_table = tango_pcie_ids,
+ },
+};
+
+builtin_platform_driver(tango_pcie_driver);
+
+/*
+ * QUIRK #3
+ * The root complex advertizes the wrong device class.
+ * Header Type 1 is for PCI-to-PCI bridges.
+ */
+static void tango_fixup_class(struct pci_dev *dev)
+{
+ dev->class = PCI_CLASS_BRIDGE_PCI << 8;
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIGMA, 0x24, tango_fixup_class);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIGMA, 0x28, tango_fixup_class);
+
+/*
+ * QUIRK #4
+ * The root complex exposes a "fake" BAR, which is used to filter
+ * bus-to-system accesses. Only accesses within the range defined
+ * by this BAR are forwarded to the host, others are ignored.
+ *
+ * By default, the DMA framework expects an identity mapping,
+ * and DRAM0 is mapped at 0x80000000.
+ */
+static void tango_fixup_bar(struct pci_dev *dev)
+{
+ dev->non_compliant_bars = true;
+ pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, 0x80000000);
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIGMA, 0x24, tango_fixup_bar);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIGMA, 0x28, tango_fixup_bar);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f020ab4079d3..b577dbe46f8f 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1369,6 +1369,8 @@
#define PCI_DEVICE_ID_TTI_HPT374 0x0008
#define PCI_DEVICE_ID_TTI_HPT372N 0x0009 /* apparently a 372N variant? */

+#define PCI_VENDOR_ID_SIGMA 0x1105
+
#define PCI_VENDOR_ID_VIA 0x1106
#define PCI_DEVICE_ID_VIA_8763_0 0x0198
#define PCI_DEVICE_ID_VIA_8380_0 0x0204
--
2.11.0

2017-06-20 08:20:50

by Marc Gonzalez

[permalink] [raw]
Subject: [PATCH v9 1/3] PCI: Add DT binding for tango PCIe controller

Binding for the Sigma Designs SMP8759 SoC.

Acked-by: Rob Herring <[email protected]>
Signed-off-by: Marc Gonzalez <[email protected]>
---
.../devicetree/bindings/pci/tango-pcie.txt | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pci/tango-pcie.txt

diff --git a/Documentation/devicetree/bindings/pci/tango-pcie.txt b/Documentation/devicetree/bindings/pci/tango-pcie.txt
new file mode 100644
index 000000000000..244683836a79
--- /dev/null
+++ b/Documentation/devicetree/bindings/pci/tango-pcie.txt
@@ -0,0 +1,29 @@
+Sigma Designs Tango PCIe controller
+
+Required properties:
+
+- compatible: "sigma,smp8759-pcie"
+- reg: address/size of PCI configuration space, address/size of register area
+- bus-range: defined by size of PCI configuration space
+- device_type: "pci"
+- #size-cells: <2>
+- #address-cells: <3>
+- msi-controller
+- ranges: translation from system to bus addresses
+- interrupts: spec for misc interrupts, spec for MSI
+
+Example:
+
+ pcie@2e000 {
+ compatible = "sigma,smp8759-pcie";
+ reg = <0x50000000 0x400000>, <0x2e000 0x100>;
+ bus-range = <0 3>;
+ device_type = "pci";
+ #size-cells = <2>;
+ #address-cells = <3>;
+ msi-controller;
+ ranges = <0x02000000 0x0 0x00400000 0x50400000 0x0 0x3c00000>;
+ interrupts =
+ <54 IRQ_TYPE_LEVEL_HIGH>, /* misc interrupts */
+ <55 IRQ_TYPE_LEVEL_HIGH>; /* MSI */
+ };
--
2.11.0

2017-07-02 23:18:16

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
> This driver is required to work around several hardware bugs
> in the PCIe controller.
>
> NB: Revision 1 does not support legacy interrupts, or IO space.

I had to apply these manually because of conflicts in Kconfig and
Makefile. What are these based on? Easiest for me is if you base
them on the current -rc1 tag.

> Signed-off-by: Marc Gonzalez <[email protected]>
> ---
> drivers/pci/host/Kconfig | 8 +++
> drivers/pci/host/Makefile | 1 +
> drivers/pci/host/pcie-tango.c | 164 ++++++++++++++++++++++++++++++++++++++++++
> include/linux/pci_ids.h | 2 +
> 4 files changed, 175 insertions(+)
> create mode 100644 drivers/pci/host/pcie-tango.c
>
> diff --git a/drivers/pci/host/Kconfig b/drivers/pci/host/Kconfig
> index d7e7c0a827c3..5183d9095c3a 100644
> --- a/drivers/pci/host/Kconfig
> +++ b/drivers/pci/host/Kconfig
> @@ -285,6 +285,14 @@ config PCIE_ROCKCHIP
> There is 1 internal PCIe port available to support GEN2 with
> 4 slots.
>
> +config PCIE_TANGO
> + bool "Tango PCIe controller"
> + depends on ARCH_TANGO && PCI_MSI && OF
> + select PCI_HOST_COMMON
> + help
> + Say Y here to enable PCIe controller support for Sigma Designs
> + Tango systems, such as SMP8759 and later chips.
> +
> config VMD
> depends on PCI_MSI && X86_64
> tristate "Intel Volume Management Device Driver"
> diff --git a/drivers/pci/host/Makefile b/drivers/pci/host/Makefile
> index 084cb4983645..fc7ea90196f3 100644
> --- a/drivers/pci/host/Makefile
> +++ b/drivers/pci/host/Makefile
> @@ -32,4 +32,5 @@ obj-$(CONFIG_PCI_HOST_THUNDER_PEM) += pci-thunder-pem.o
> obj-$(CONFIG_PCIE_ARMADA_8K) += pcie-armada8k.o
> obj-$(CONFIG_PCIE_ARTPEC6) += pcie-artpec6.o
> obj-$(CONFIG_PCIE_ROCKCHIP) += pcie-rockchip.o
> +obj-$(CONFIG_PCIE_TANGO) += pcie-tango.o
> obj-$(CONFIG_VMD) += vmd.o
> diff --git a/drivers/pci/host/pcie-tango.c b/drivers/pci/host/pcie-tango.c
> new file mode 100644
> index 000000000000..67aaadcc1c5e
> --- /dev/null
> +++ b/drivers/pci/host/pcie-tango.c
> @@ -0,0 +1,164 @@
> +#include <linux/pci-ecam.h>
> +#include <linux/delay.h>
> +#include <linux/of.h>
> +
> +#define MSI_MAX 256
> +
> +#define SMP8759_MUX 0x48
> +#define SMP8759_TEST_OUT 0x74
> +
> +struct tango_pcie {
> + void __iomem *mux;
> +};
> +
> +/*** HOST BRIDGE SUPPORT ***/
> +
> +static int smp8759_config_read(struct pci_bus *bus,
> + unsigned int devfn, int where, int size, u32 *val)

Wrap these with as much as possible on the first line, e.g.,

static int smp8759_config_read(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 *val)


> +{
> + int ret;
> + struct pci_config_window *cfg = bus->sysdata;
> + struct tango_pcie *pcie = dev_get_drvdata(cfg->parent);

Reorder as:

struct pci_config_window *cfg = bus->sysdata;
struct tango_pcie *pcie = dev_get_drvdata(cfg->parent);
int ret;

> +
> + /*
> + * QUIRK #1

Omit "QUIRK #1", "QUIRK #2", etc unless they're actual references to an errata
document.

> + * Reads in configuration space outside devfn 0 return garbage.
> + */
> + if (devfn != 0)
> + return PCIBIOS_FUNC_NOT_SUPPORTED;
> +
> + /*
> + * QUIRK #2
> + * Unfortunately, config and mem spaces are muxed.
> + * Linux does not support such a setting, since drivers are free
> + * to access mem space directly, at any time.
> + * Therefore, we can only PRAY that config and mem space accesses
> + * NEVER occur concurrently.
> + */
> + writel_relaxed(1, pcie->mux);
> + ret = pci_generic_config_read(bus, devfn, where, size, val);
> + writel_relaxed(0, pcie->mux);

I'm very hesitant about this. When people stress this, we're going to
get reports of data corruption. Even with the disclaimer below, I
don't feel good about this. Adding the driver is an implicit claim
that we support the device, but we know it can't be made reliable.

What is the benefit of adding this driver? How many units are in the
field? Are you hoping to have support in distros like RHEL? Are
these running self-built kernels straight from kernel.org? Is it
feasible for you to distribute this driver separately from the
upstream kernel?

> + return ret;
> +}
> +
> +static int smp8759_config_write(struct pci_bus *bus,
> + unsigned int devfn, int where, int size, u32 val)
> +{
> + int ret;
> + struct pci_config_window *cfg = bus->sysdata;
> + struct tango_pcie *pcie = dev_get_drvdata(cfg->parent);
> +
> + writel_relaxed(1, pcie->mux);
> + ret = pci_generic_config_write(bus, devfn, where, size, val);
> + writel_relaxed(0, pcie->mux);
> +
> + return ret;
> +}
> +
> +static struct pci_ecam_ops smp8759_ecam_ops = {
> + .bus_shift = 20,
> + .pci_ops = {
> + .map_bus = pci_ecam_map_bus,
> + .read = smp8759_config_read,
> + .write = smp8759_config_write,
> + }
> +};
> +
> +static const struct of_device_id tango_pcie_ids[] = {
> + { .compatible = "sigma,smp8759-pcie" },
> + { /* sentinel */ },
> +};

Move table down to point where it's needed.

> +static int tango_check_pcie_link(void __iomem *test_out)

I think this is checking for link up. Rename to tango_pcie_link_up()
to follow the convention of other drivers. Take a struct tango_pcie *
instead of an address, if possible.

> +{
> + int i;
> +
> + writel_relaxed(16, test_out);
> + for (i = 0; i < 10; ++i) {
> + u32 ltssm_state = readl_relaxed(test_out) >> 8;
> + if ((ltssm_state & 0x1f) == 0xf) /* L0 */
> + return 0;
> + usleep_range(3000, 4000);
> + }
> +
> + return -ENODEV;
> +}
> +
> +static int smp8759_init(struct tango_pcie *pcie, void __iomem *base)
> +{
> + pcie->mux = base + SMP8759_MUX;
> +
> + return tango_check_pcie_link(base + SMP8759_TEST_OUT);
> +}
> +
> +static int tango_pcie_probe(struct platform_device *pdev)
> +{
> + int ret = -EINVAL;
> + void __iomem *base;
> + struct resource *res;
> + struct tango_pcie *pcie;
> + struct device *dev = &pdev->dev;

Reverse declaration order. Then they'll be declared in order of use.

> + pr_err("MAJOR ISSUE: PCIe config and mem spaces are muxed\n");
> + pr_err("Tainting kernel... Use driver at your own risk\n");

These should be dev_err().

> + add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
> +
> + pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
> + if (!pcie)
> + return -ENOMEM;
> +
> + platform_set_drvdata(pdev, pcie);

Minor style: move this down to the end, so we're not associating an
uninitialized drvdata structure with the pdev. Better to wait until
it's fully initialized.

> + res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + base = devm_ioremap_resource(&pdev->dev, res);

Use "dev", not "&pdev->dev".

> + if (IS_ERR(base))
> + return PTR_ERR(base);
> +
> + if (of_device_is_compatible(dev->of_node, "sigma,smp8759-pcie"))

Not necessary, since tango_pcie_ids[] only contains
"sigma,smp8759-pcie". If/when you need different init for different
versions, you can add something like this back, and it will be obvious
why it's needed. Right now, there's no need for this, so it looks out
of place.

> + ret = smp8759_init(pcie, base);
> +
> + if (ret)
> + return ret;
> +
> + return pci_host_common_probe(pdev, &smp8759_ecam_ops);
> +}
> +
> +static struct platform_driver tango_pcie_driver = {
> + .probe = tango_pcie_probe,
> + .driver = {
> + .name = KBUILD_MODNAME,
> + .of_match_table = tango_pcie_ids,

I think you need ".suppress_bind_attrs = true" here to prevent issues
when unbinding driver. See
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a5f40e8098fe

> + },
> +};
> +

Remove blank line.

> +builtin_platform_driver(tango_pcie_driver);
> +
> +/*
> + * QUIRK #3
> + * The root complex advertizes the wrong device class.

s/advertizes/advertises/

> + * Header Type 1 is for PCI-to-PCI bridges.
> + */
> +static void tango_fixup_class(struct pci_dev *dev)
> +{
> + dev->class = PCI_CLASS_BRIDGE_PCI << 8;
> +}
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIGMA, 0x24, tango_fixup_class);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIGMA, 0x28, tango_fixup_class);
> +
> +/*
> + * QUIRK #4
> + * The root complex exposes a "fake" BAR, which is used to filter
> + * bus-to-system accesses. Only accesses within the range defined
> + * by this BAR are forwarded to the host, others are ignored.
> + *
> + * By default, the DMA framework expects an identity mapping,
> + * and DRAM0 is mapped at 0x80000000.
> + */
> +static void tango_fixup_bar(struct pci_dev *dev)
> +{
> + dev->non_compliant_bars = true;
> + pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, 0x80000000);
> +}
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIGMA, 0x24, tango_fixup_bar);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SIGMA, 0x28, tango_fixup_bar);
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index f020ab4079d3..b577dbe46f8f 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -1369,6 +1369,8 @@
> #define PCI_DEVICE_ID_TTI_HPT374 0x0008
> #define PCI_DEVICE_ID_TTI_HPT372N 0x0009 /* apparently a 372N variant? */
>
> +#define PCI_VENDOR_ID_SIGMA 0x1105
> +
> #define PCI_VENDOR_ID_VIA 0x1106
> #define PCI_DEVICE_ID_VIA_8763_0 0x0198
> #define PCI_DEVICE_ID_VIA_8380_0 0x0204
> --
> 2.11.0
>

2017-07-03 09:35:56

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On 3 July 2017 at 00:18, Bjorn Helgaas <[email protected]> wrote:
> On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
>> This driver is required to work around several hardware bugs
>> in the PCIe controller.
>>
>> NB: Revision 1 does not support legacy interrupts, or IO space.
>
> I had to apply these manually because of conflicts in Kconfig and
> Makefile. What are these based on? Easiest for me is if you base
> them on the current -rc1 tag.
>
>> Signed-off-by: Marc Gonzalez <[email protected]>
>> ---
>> drivers/pci/host/Kconfig | 8 +++
>> drivers/pci/host/Makefile | 1 +
>> drivers/pci/host/pcie-tango.c | 164 ++++++++++++++++++++++++++++++++++++++++++
>> include/linux/pci_ids.h | 2 +
>> 4 files changed, 175 insertions(+)
>> create mode 100644 drivers/pci/host/pcie-tango.c
>>
[..]
>> + /*
>> + * QUIRK #2
>> + * Unfortunately, config and mem spaces are muxed.
>> + * Linux does not support such a setting, since drivers are free
>> + * to access mem space directly, at any time.
>> + * Therefore, we can only PRAY that config and mem space accesses
>> + * NEVER occur concurrently.
>> + */
>> + writel_relaxed(1, pcie->mux);
>> + ret = pci_generic_config_read(bus, devfn, where, size, val);
>> + writel_relaxed(0, pcie->mux);
>
> I'm very hesitant about this. When people stress this, we're going to
> get reports of data corruption. Even with the disclaimer below, I
> don't feel good about this. Adding the driver is an implicit claim
> that we support the device, but we know it can't be made reliable.
>

I noticed that the Synopsys driver suffers from a similar issue: in
dw_pcie_rd_other_conf(), it happily reprograms the outbound I/O window
to perform a config space access, and switches it back to I/O space
afterwards (unless it has more than 2 viewports, in which case it uses
dedicated windows for I/O space and config space)

2017-07-03 09:54:41

by Marc Gonzalez

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

Hello Bjorn,

On 03/07/2017 01:18, Bjorn Helgaas wrote:

> On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
>
>> This driver is required to work around several hardware bugs
>> in the PCIe controller.
>
> [ Snip style issues ]

I wish you had pointed these out in your May 23 review, or in
my March 29 version (or even just alluded to them). I would
have fixed them in time for 2.13.


>> + /*
>> + * QUIRK #2
>> + * Unfortunately, config and mem spaces are muxed.
>> + * Linux does not support such a setting, since drivers are free
>> + * to access mem space directly, at any time.
>> + * Therefore, we can only PRAY that config and mem space accesses
>> + * NEVER occur concurrently.
>> + */
>> + writel_relaxed(1, pcie->mux);
>> + ret = pci_generic_config_read(bus, devfn, where, size, val);
>> + writel_relaxed(0, pcie->mux);
>
> I'm very hesitant about this. When people stress this, we're going to
> get reports of data corruption. Even with the disclaimer below, I
> don't feel good about this. Adding the driver is an implicit claim
> that we support the device, but we know it can't be made reliable.

I can't say I didn't see this coming (I had taken your long silence
as a sign of your reluctance) but back in May, I thought you implied
that a warning + tainting the kernel would be sufficient.

Mark Rutland points out stop_machine. I will test this solution.
Would you find that acceptable?


> What is the benefit of adding this driver? How many units are in the
> field? Are you hoping to have support in distros like RHEL? Are
> these running self-built kernels straight from kernel.org? Is it
> feasible for you to distribute this driver separately from the
> upstream kernel?

The benefit of upstreaming (for me) is making kernel maintainers
aware that one is using specific internal APIs. Then one may be
notified when these APIs are about to change.

I'm told we have sold ~100k units. Though I don't know how many
are in the field and using PCIe.

There are no plans to use "full-blown" distros, we use embedded
oriented distros, such as buildroot.

Maintaining out-of-tree drivers is what we've been doing for
~15 years, and there are many pain-points involved. Ask Greg
what he thinks of OOT drivers.


>> +static int tango_check_pcie_link(void __iomem *test_out)
>
> I think this is checking for link up. Rename to tango_pcie_link_up()
> to follow the convention of other drivers. Take a struct tango_pcie *
> instead of an address, if possible.

Anything's possible. NB: if I pass the struct, then I have to store
the address in the struct, which isn't the case now, since I never
need the address later. If you don't mind adding an unnecessary
field to the struct, I can do it. What do you say?


>> +static struct platform_driver tango_pcie_driver = {
>> + .probe = tango_pcie_probe,
>> + .driver = {
>> + .name = KBUILD_MODNAME,
>> + .of_match_table = tango_pcie_ids,
>
> I think you need ".suppress_bind_attrs = true" here to prevent issues
> when unbinding driver. See
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a5f40e8098fe

Will do. In that case, I can drop tango_pcie_remove() right?

Regards.

2017-07-03 13:13:53

by Marc Gonzalez

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On 03/07/2017 11:54, Marc Gonzalez wrote:

> Mark Rutland points out stop_machine. I will test this solution.

I must be misunderstanding some of the requirements for
calling stop_machine() because my kernel panics, after
many warnings.

I made the following changes, which call stop_machine() at
the end of smp8759_config_read() to do nothing on cpu 0.

Looking at drivers/char/hw_random/intel-rng.c, they don't
seem to do anything special in the callback...


diff --git a/drivers/pci/host/pcie-tango.c b/drivers/pci/host/pcie-tango.c
index aa1484f6520e..c252215e408a 100644
--- a/drivers/pci/host/pcie-tango.c
+++ b/drivers/pci/host/pcie-tango.c
@@ -233,6 +233,13 @@ static int tango_msi_probe(struct platform_device *pdev, struct tango_pcie *pcie

/*** HOST BRIDGE SUPPORT ***/

+#include <linux/stop_machine.h>
+
+static int do_nothing(void *arg)
+{
+ return 0;
+}
+
static int smp8759_config_read(struct pci_bus *bus,
unsigned int devfn, int where, int size, u32 *val)
{
@@ -259,6 +266,8 @@ static int smp8759_config_read(struct pci_bus *bus,
ret = pci_generic_config_read(bus, devfn, where, size, val);
writel_relaxed(0, pcie->mux);

+ stop_machine(do_nothing, NULL, NULL);
+
return ret;
}


My boot log:

[ 0.718913] OF: PCI: host bridge /soc/pcie@2e000 ranges:
[ 0.724269] OF: PCI: No bus range found for /soc/pcie@2e000, using [bus 00-ff]
[ 0.731725] OF: PCI: MEM 0x50400000..0x53ffffff -> 0x00400000
[ 0.737702] pcie_tango 50000000.pcie: ECAM area [mem 0x50000000-0x503fffff] can only accommodate [bus 00-03] (reduced from [bus 00-ff] desired)
[ 0.750709] pcie_tango 50000000.pcie: ECAM at [mem 0x50000000-0x503fffff] for [bus 00-03]
[ 0.759034] pcie_tango 50000000.pcie: PCI host bridge to bus 0000:00
[ 0.765434] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 0.770957] pci_bus 0000:00: root bus resource [mem 0x50400000-0x53ffffff] (bus address [0x00400000-0x03ffffff])
[ 0.781206] BUG: scheduling while atomic: swapper/0/1/0x00000002
[ 0.787248] Modules linked in:
[ 0.790324] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.23-1-rc4 #16
[ 0.796881] Hardware name: Sigma Tango DT
[ 0.800934] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 0.808719] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 0.815980] [<c02cc13c>] (dump_stack) from [<c0137ee8>] (__schedule_bug+0x64/0x84)
[ 0.823593] [<c0137ee8>] (__schedule_bug) from [<c04bb1d0>] (__schedule+0x364/0x454)
[ 0.831376] [<c04bb1d0>] (__schedule) from [<c04bb310>] (schedule+0x50/0xb4)
[ 0.838463] [<c04bb310>] (schedule) from [<c04be0dc>] (schedule_timeout+0x1c8/0x210)
[ 0.846246] [<c04be0dc>] (schedule_timeout) from [<c04bbdd8>] (wait_for_common+0x8c/0x13c)
[ 0.854554] [<c04bbdd8>] (wait_for_common) from [<c0185084>] (__stop_cpus+0x50/0x64)
[ 0.862336] [<c0185084>] (__stop_cpus) from [<c0185484>] (stop_cpus+0x2c/0x44)
[ 0.869593] [<c0185484>] (stop_cpus) from [<c0185550>] (stop_machine+0xb4/0xf8)
[ 0.876941] [<c0185550>] (stop_machine) from [<c0310e30>] (smp8759_config_read+0x68/0x74)
[ 0.885164] [<c0310e30>] (smp8759_config_read) from [<c02f5dd8>] (pci_bus_read_config_dword+0x6c/0x94)
[ 0.894521] [<c02f5dd8>] (pci_bus_read_config_dword) from [<c02f7c84>] (pci_bus_read_dev_vendor_id+0x24/0xe8)
[ 0.904488] [<c02f7c84>] (pci_bus_read_dev_vendor_id) from [<c02f9488>] (pci_scan_single_device+0x40/0xb0)
[ 0.914193] [<c02f9488>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 0.922849] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 0.931069] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 0.939987] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 0.948817] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 0.957740] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 0.966660] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 0.974967] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 0.982836] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 0.991055] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 0.999361] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 1.007405] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 1.015627] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 1.024370] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 1.032590] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 1.040356] pci 0000:00:00.0: [1105:0024] type 01 class 0x048000
[ 1.046827] pci 0000:00:00.0: supports D1 D2
[ 1.051124] pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot
[ 1.057376] ------------[ cut here ]------------
[ 1.062033] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 1.069906] Modules linked in:
[ 1.072978] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 1.080756] Hardware name: Sigma Tango DT
[ 1.084789] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 1.092573] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 1.099835] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 1.106832] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 1.114440] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 1.122576] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 1.131058] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 1.139714] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 1.147934] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 1.156852] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 1.165683] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 1.174604] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 1.183522] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 1.191829] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 1.199698] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 1.207916] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 1.216222] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 1.224266] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 1.232486] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 1.241232] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 1.249451] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 1.257071] ---[ end trace 4ee1a301cee5ee66 ]---
[ 1.261712] ------------[ cut here ]------------
[ 1.266357] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 1.274227] Modules linked in:
[ 1.277298] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 1.285076] Hardware name: Sigma Tango DT
[ 1.289104] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 1.296886] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 1.304145] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 1.311141] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 1.318749] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 1.326882] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 1.335363] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 1.344019] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 1.352239] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 1.361157] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 1.369988] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 1.378907] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 1.387825] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 1.396131] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 1.404001] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 1.412219] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 1.420525] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 1.428569] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 1.436788] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 1.445531] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 1.453750] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 1.461362] ---[ end trace 4ee1a301cee5ee67 ]---
[ 1.466002] ------------[ cut here ]------------
[ 1.470645] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 1.478515] Modules linked in:
[ 1.481585] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 1.489363] Hardware name: Sigma Tango DT
[ 1.493391] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 1.501174] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 1.508432] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 1.515428] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 1.523036] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 1.531168] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 1.539650] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 1.548306] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 1.556525] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 1.565443] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 1.574274] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 1.583193] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 1.592111] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 1.600417] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 1.608286] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 1.616505] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 1.624811] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 1.632854] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 1.641073] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 1.649817] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 1.658036] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 1.665647] ---[ end trace 4ee1a301cee5ee68 ]---
[ 1.670287] ------------[ cut here ]------------
[ 1.674930] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 1.682801] Modules linked in:
[ 1.685872] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 1.693650] Hardware name: Sigma Tango DT
[ 1.697678] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 1.705460] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 1.712719] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 1.719716] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 1.727323] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 1.735457] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 1.743938] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 1.752594] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 1.760814] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 1.769732] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 1.778563] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 1.787481] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 1.796400] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 1.804706] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 1.812575] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 1.820794] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 1.829100] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 1.837144] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 1.845362] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 1.854105] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 1.862325] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 1.869937] ---[ end trace 4ee1a301cee5ee69 ]---
[ 1.874576] ------------[ cut here ]------------
[ 1.879220] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 1.887090] Modules linked in:
[ 1.890160] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 1.897938] Hardware name: Sigma Tango DT
[ 1.901967] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 1.909749] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 1.917007] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 1.924003] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 1.931611] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 1.939744] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 1.948225] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 1.956881] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 1.965101] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 1.974019] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 1.982850] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 1.991769] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 2.000687] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 2.008994] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 2.016863] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 2.025082] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 2.033388] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 2.041432] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
0] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 2.058394] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 2.066613] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 2.074225] ---[ end trace 4ee1a301cee5ee6a ]---
[ 2.078865] ------------[ cut here ]------------
[ 2.083509] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 2.091380] Modules linked in:
[ 2.094449] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 2.102228] Hardware name: Sigma Tango DT
[ 2.106256] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 2.114038] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 2.121296] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 2.128292] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 2.135900] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 2.144034] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 2.152515] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 2.161171] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 2.169390] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 2.178308] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 2.187139] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 2.196059] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 2.204977] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 2.213283] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 2.221152] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 2.229371] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 2.237677] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 2.245721] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 2.253939] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 2.262682] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 2.270901] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 2.278513] ---[ end trace 4ee1a301cee5ee6b ]---
[ 2.283153] ------------[ cut here ]------------
[ 2.287796] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 2.295666] Modules linked in:
[ 2.298731] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 2.306509] Hardware name: Sigma Tango DT
[ 2.310537] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 2.318319] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 2.325578] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 2.332574] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 2.340182] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 2.348315] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 2.356796] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 2.365452] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 2.373671] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 2.382590] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 2.391420] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 2.400339] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 2.409257] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 2.417563] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 2.425432] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 2.433651] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 2.441957] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 2.450001] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 2.458220] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 2.466963] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 2.475183] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 2.482794] ---[ end trace 4ee1a301cee5ee6c ]---
[ 2.487435] ------------[ cut here ]------------
[ 2.492080] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 2.499951] Modules linked in:
[ 2.503021] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 2.510800] Hardware name: Sigma Tango DT
[ 2.514828] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 2.522610] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 2.529869] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 2.536865] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 2.544473] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 2.552606] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 2.561087] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 2.569743] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 2.577963] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 2.586881] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 2.595712] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 2.604631] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 2.613550] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 2.621856] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 2.629725] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 2.637944] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 2.646250] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 2.654294] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 2.662513] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 2.671256] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 2.679475] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 2.687088] ---[ end trace 4ee1a301cee5ee6d ]---
[ 2.691728] ------------[ cut here ]------------
[ 2.696371] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 2.704242] Modules linked in:
[ 2.707312] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 2.715090] Hardware name: Sigma Tango DT
[ 2.719119] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 2.726901] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 2.734159] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 2.741155] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 2.748763] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 2.756896] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 2.765377] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 2.774033] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 2.782252] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 2.791171] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 2.800002] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 2.808921] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 2.817838] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 2.826145] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 2.834014] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 2.842233] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 2.850539] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 2.858583] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 2.866801] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 2.875545] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 2.883764] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 2.891375] ---[ end trace 4ee1a301cee5ee6e ]---
[ 2.896015] ------------[ cut here ]------------
[ 2.900658] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 2.908528] Modules linked in:
[ 2.911598] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 2.919376] Hardware name: Sigma Tango DT
[ 2.923404] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 2.931186] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 2.938444] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 2.945441] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 2.953049] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 2.961181] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 2.969663] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 2.978319] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 2.986538] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 2.995456] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 3.004287] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 3.013206] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 3.022124] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 3.030430] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 3.038300] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 3.046518] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 3.054825] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 3.062869] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 3.071088] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 3.079832] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 3.088051] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 3.095663] ---[ end trace 4ee1a301cee5ee6f ]---
[ 3.100302] ------------[ cut here ]------------
[ 3.104945] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 3.112816] Modules linked in:
[ 3.115885] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 3.123663] Hardware name: Sigma Tango DT
[ 3.127691] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 3.135474] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 3.142732] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 3.149728] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 3.157336] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 3.165469] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 3.173951] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 3.182607] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 3.190826] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 3.199744] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 3.208575] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 3.217494] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 3.226413] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 3.234719] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 3.242588] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 3.250806] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 3.259112] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 3.267156] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 3.275374] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 3.284118] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 3.292337] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 3.299948] ---[ end trace 4ee1a301cee5ee70 ]---
[ 3.304588] ------------[ cut here ]------------
[ 3.309231] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 3.317102] Modules linked in:
[ 3.320172] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 3.327950] Hardware name: Sigma Tango DT
[ 3.331979] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 3.339761] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 3.347019] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 3.354016] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 3.361624] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 3.369756] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 3.378237] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 3.386894] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 3.395113] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 3.404031] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 3.412862] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 3.421781] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 3.430699] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 3.439005] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 3.446874] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 3.455093] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 3.463399] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 3.471443] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 3.479661] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 3.488405] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 3.496624] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 3.504235] ---[ end trace 4ee1a301cee5ee71 ]---
[ 3.508875] ------------[ cut here ]------------
[ 3.513519] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 3.521390] Modules linked in:
[ 3.524459] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 3.532237] Hardware name: Sigma Tango DT
[ 3.536265] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 3.544048] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 3.551306] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 3.558303] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 3.565911] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 3.574044] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 3.582526] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 3.591182] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 3.599401] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 3.608319] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 3.617150] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 3.626069] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 3.634987] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 3.643293] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 3.651163] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 3.659381] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 3.667688] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 3.675732] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 3.683950] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 3.692694] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 3.700913] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 3.708525] ---[ end trace 4ee1a301cee5ee72 ]---
[ 3.713165] ------------[ cut here ]------------
[ 3.717808] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 3.725679] Modules linked in:
[ 3.728743] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 3.736521] Hardware name: Sigma Tango DT
[ 3.740549] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 3.748331] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 3.755590] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 3.762586] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 3.770193] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 3.778326] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 3.786808] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 3.795464] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 3.803683] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 3.812601] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 3.821432] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 3.830351] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 3.839269] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 3.847575] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 3.855445] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 3.863664] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 3.871970] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 3.880014] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 3.888233] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 3.896976] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 3.905195] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 3.912806] ---[ end trace 4ee1a301cee5ee73 ]---
[ 3.917445] ------------[ cut here ]------------
[ 3.922089] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 3.929960] Modules linked in:
[ 3.933029] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 3.940807] Hardware name: Sigma Tango DT
[ 3.944836] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 3.952618] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 3.959876] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 3.966872] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 3.974480] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 3.982613] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 3.991094] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 3.999750] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 4.007970] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 4.016888] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 4.025719] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 4.034638] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 4.043556] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 4.051863] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 4.059732] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 4.067951] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 4.076257] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 4.084300] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 4.092519] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 4.101262] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 4.109481] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 4.117092] ---[ end trace 4ee1a301cee5ee74 ]---
[ 4.121732] ------------[ cut here ]------------
[ 4.126376] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 4.134246] Modules linked in:
[ 4.137316] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 4.145094] Hardware name: Sigma Tango DT
[ 4.149122] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 4.156904] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 4.164163] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 4.171159] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 4.178766] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 4.186899] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 4.195381] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 4.204036] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 4.212256] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 4.221174] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 4.230005] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 4.238924] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 4.247842] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 4.256148] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 4.264017] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 4.272236] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 4.280543] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 4.288587] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 4.296805] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 4.305549] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 4.313768] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 4.321380] ---[ end trace 4ee1a301cee5ee75 ]---
[ 4.326020] ------------[ cut here ]------------
[ 4.330663] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 4.338533] Modules linked in:
[ 4.341603] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 4.349381] Hardware name: Sigma Tango DT
[ 4.353409] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 4.361191] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 4.368450] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 4.375446] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 4.383053] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 4.391186] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 4.399667] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 4.408324] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 4.416543] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 4.425461] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 4.434292] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 4.443211] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 4.452129] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 4.460435] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 4.468304] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 4.476523] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 4.484830] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 4.492874] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 4.501092] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 4.509836] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 4.518055] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 4.525665] ---[ end trace 4ee1a301cee5ee76 ]---
[ 4.530305] ------------[ cut here ]------------
[ 4.534948] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 4.542819] Modules linked in:
[ 4.545889] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 4.553667] Hardware name: Sigma Tango DT
[ 4.557695] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 4.565478] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 4.572736] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 4.579732] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 4.587340] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 4.595473] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 4.603954] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 4.612610] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 4.620829] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 4.629748] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 4.638579] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 4.647497] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 4.656415] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 4.664721] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 4.672591] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 4.680809] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 4.689116] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 4.697160] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 4.705378] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 4.714122] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 4.722341] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 4.729953] ---[ end trace 4ee1a301cee5ee77 ]---
[ 4.734592] ------------[ cut here ]------------
[ 4.739237] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 4.747107] Modules linked in:
[ 4.750178] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 4.757956] Hardware name: Sigma Tango DT
[ 4.761984] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 4.769767] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 4.777025] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 4.784021] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 4.791629] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 4.799761] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 4.808243] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 4.816899] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 4.825118] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 4.834036] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 4.842867] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 4.851787] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 4.860705] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 4.869011] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 4.876881] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 4.885100] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 4.893406] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 4.901450] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 4.909668] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 4.918412] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 4.926632] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 4.934243] ---[ end trace 4ee1a301cee5ee78 ]---
[ 4.938883] ------------[ cut here ]------------
[ 4.943526] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 4.951396] Modules linked in:
[ 4.954467] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 4.962245] Hardware name: Sigma Tango DT
[ 4.966273] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 4.974056] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 4.981314] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 4.988310] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 4.995918] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 5.004051] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 5.012533] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 5.021189] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 5.029408] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 5.038326] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 5.047157] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 5.056076] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 5.064994] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 5.073300] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 5.081170] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 5.089388] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 5.097694] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 5.105738] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 5.113957] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 5.122700] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 5.130919] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 5.138531] ---[ end trace 4ee1a301cee5ee79 ]---
[ 5.143171] ------------[ cut here ]------------
[ 5.147814] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 5.155684] Modules linked in:
[ 5.158749] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 5.166527] Hardware name: Sigma Tango DT
[ 5.170555] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 5.178338] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 5.185596] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 5.192592] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 5.200200] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 5.208333] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 5.216815] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 5.225471] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 5.233690] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 5.242609] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 5.251440] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 5.260358] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 5.269276] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 5.277582] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 5.285452] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 5.293670] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 5.301976] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 5.310020] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 5.318238] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 5.326982] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 5.335201] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 5.342813] ---[ end trace 4ee1a301cee5ee7a ]---
[ 5.347452] ------------[ cut here ]------------
[ 5.352095] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 5.359965] Modules linked in:
[ 5.363035] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 5.370813] Hardware name: Sigma Tango DT
[ 5.374841] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 5.382623] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 5.389881] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 5.396878] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 5.404485] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 5.412618] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 5.421099] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 5.429755] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 5.437975] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 5.446893] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 5.455724] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 5.464643] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 5.473561] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 5.481867] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 5.489737] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 5.497955] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 5.506261] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 5.514305] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 5.522524] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 5.531267] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 5.539487] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 5.547098] ---[ end trace 4ee1a301cee5ee7b ]---
[ 5.551738] ------------[ cut here ]------------
[ 5.556381] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 5.564252] Modules linked in:
[ 5.567321] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 5.575099] Hardware name: Sigma Tango DT
[ 5.579127] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 5.586909] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 5.594167] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 5.601163] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 5.608771] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 5.616904] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 5.625385] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 5.634041] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 5.642261] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 5.651179] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 5.660010] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 5.668929] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 5.677847] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 5.686153] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 5.694022] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 5.702241] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 5.710547] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 5.718591] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 5.726809] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 5.735552] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 5.743771] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 5.751383] ---[ end trace 4ee1a301cee5ee7c ]---
[ 5.756022] ------------[ cut here ]------------
[ 5.760665] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 5.768536] Modules linked in:
[ 5.771606] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 5.779384] Hardware name: Sigma Tango DT
[ 5.783412] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 5.791194] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 5.798452] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 5.805448] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 5.813056] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 5.821189] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 5.829671] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 5.838327] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 5.846546] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 5.855465] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 5.864296] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 5.873215] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 5.882133] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 5.890439] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 5.898308] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 5.906527] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 5.914833] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 5.922877] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 5.931096] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 5.939840] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 5.948060] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 5.955670] ---[ end trace 4ee1a301cee5ee7d ]---
[ 5.960309] ------------[ cut here ]------------
[ 5.964953] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 5.972823] Modules linked in:
[ 5.975893] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 5.983671] Hardware name: Sigma Tango DT
[ 5.987699] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 5.995481] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 6.002739] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 6.009736] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 6.017343] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 6.025476] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 6.033958] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 6.042614] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 6.050833] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 6.059751] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 6.068582] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 6.077500] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 6.086418] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 6.094724] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 6.102594] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 6.110813] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 6.119119] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 6.127163] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 6.135381] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 6.144125] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 6.152344] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 6.159956] ---[ end trace 4ee1a301cee5ee7e ]---
[ 6.164595] ------------[ cut here ]------------
[ 6.169239] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 6.177109] Modules linked in:
[ 6.180179] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 6.187957] Hardware name: Sigma Tango DT
[ 6.191985] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 6.199767] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 6.207025] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 6.214021] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 6.221629] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 6.229762] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 6.238243] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 6.246899] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 6.255118] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 6.264036] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 6.272867] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 6.281786] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 6.290704] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 6.299010] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 6.306879] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 6.315097] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 6.323403] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 6.331447] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 6.339666] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 6.348410] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 6.356628] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 6.364239] ---[ end trace 4ee1a301cee5ee7f ]---
[ 6.368879] ------------[ cut here ]------------
[ 6.373522] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 6.381393] Modules linked in:
[ 6.384462] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 6.392241] Hardware name: Sigma Tango DT
[ 6.396269] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 6.404051] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 6.411309] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 6.418305] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 6.425912] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 6.434045] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 6.442527] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 6.451183] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 6.459402] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 6.468320] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 6.477151] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 6.486071] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 6.494989] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 6.503295] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 6.511165] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 6.519383] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 6.527689] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 6.535733] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 6.543952] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 6.552696] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 6.560915] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 6.568526] ---[ end trace 4ee1a301cee5ee80 ]---
[ 6.573166] ------------[ cut here ]------------
[ 6.577809] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 6.585680] Modules linked in:
[ 6.588745] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 6.596523] Hardware name: Sigma Tango DT
[ 6.600551] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 6.608334] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 6.615592] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 6.622588] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 6.630196] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 6.638329] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 6.646811] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 6.655467] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 6.663687] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 6.672605] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 6.681436] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 6.690354] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 6.699272] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 6.707579] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 6.715448] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 6.723667] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 6.731973] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 6.740017] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 6.748236] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 6.756979] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 6.765198] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 6.772810] ---[ end trace 4ee1a301cee5ee81 ]---
[ 6.777449] ------------[ cut here ]------------
[ 6.782093] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 6.789963] Modules linked in:
[ 6.793033] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 6.800811] Hardware name: Sigma Tango DT
[ 6.804839] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 6.812622] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 6.819880] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 6.826876] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 6.834484] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 6.842617] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 6.851099] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 6.859755] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 6.867974] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 6.876892] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 6.885723] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 6.894642] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 6.903560] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 6.911866] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 6.919736] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 6.927954] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 6.936260] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 6.944304] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 6.952522] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 6.961266] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 6.969485] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 6.977096] ---[ end trace 4ee1a301cee5ee82 ]---
[ 6.981735] ------------[ cut here ]------------
[ 6.986378] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 6.994249] Modules linked in:
[ 6.997318] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 7.005097] Hardware name: Sigma Tango DT
[ 7.009125] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 7.016907] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 7.024165] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 7.031161] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 7.038769] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 7.046901] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 7.055383] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 7.064039] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 7.072258] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 7.081177] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 7.090008] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 7.098927] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 7.107844] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 7.116151] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 7.124020] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 7.132238] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 7.140544] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 7.148588] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 7.156806] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 7.165550] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 7.173769] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 7.181380] ---[ end trace 4ee1a301cee5ee83 ]---
[ 7.186020] ------------[ cut here ]------------
[ 7.190663] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 7.198534] Modules linked in:
[ 7.201603] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 7.209382] Hardware name: Sigma Tango DT
[ 7.213410] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 7.221192] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 7.228450] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 7.235446] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 7.243054] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 7.251187] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 7.259668] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 7.268324] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 7.276544] [<c02fa468>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 7.285462] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 7.294293] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 7.303211] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 7.312129] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 7.320435] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 7.328305] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 7.336523] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 7.344829] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 7.352873] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 7.361091] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 7.369834] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 7.378054] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 7.385664] ---[ end trace 4ee1a301cee5ee84 ]---
[ 7.390361] PCI: bus0: Fast back to back transfers disabled
[ 7.395983] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[ 7.404079] ------------[ cut here ]------------
[ 7.408725] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:165 pci_find_next_bus+0x80/0x84
[ 7.417033] Modules linked in:
[ 7.420104] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 7.427882] Hardware name: Sigma Tango DT
[ 7.431911] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 7.439693] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 7.446952] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 7.453949] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 7.461556] [<c0118498>] (warn_slowpath_null) from [<c0300ba8>] (pci_find_next_bus+0x80/0x84)
[ 7.470125] [<c0300ba8>] (pci_find_next_bus) from [<c0300bc4>] (pci_find_bus+0x18/0x48)
[ 7.478171] [<c0300bc4>] (pci_find_bus) from [<c02fa164>] (pci_scan_bridge+0x270/0x554)
[ 7.486215] [<c02fa164>] (pci_scan_bridge) from [<c02fa4c4>] (pci_scan_child_bus+0x7c/0xf8)
[ 7.494609] [<c02fa4c4>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 7.503528] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 7.512358] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 7.521277] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 7.530196] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 7.538502] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 7.546372] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 7.554590] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 7.562896] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 7.570940] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 7.579159] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 7.587902] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 7.596122] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 7.603734] ---[ end trace 4ee1a301cee5ee85 ]---
[ 7.608374] ------------[ cut here ]------------
[ 7.613018] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:165 pci_find_next_bus+0x80/0x84
[ 7.621325] Modules linked in:
[ 7.624395] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 7.632173] Hardware name: Sigma Tango DT
[ 7.636202] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 7.643984] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 7.651242] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 7.658238] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 7.665846] [<c0118498>] (warn_slowpath_null) from [<c0300ba8>] (pci_find_next_bus+0x80/0x84)
[ 7.674415] [<c0300ba8>] (pci_find_next_bus) from [<c0300bc4>] (pci_find_bus+0x18/0x48)
[ 7.682460] [<c0300bc4>] (pci_find_bus) from [<c02fa164>] (pci_scan_bridge+0x270/0x554)
[ 7.690505] [<c02fa164>] (pci_scan_bridge) from [<c02fa4c4>] (pci_scan_child_bus+0x7c/0xf8)
[ 7.698899] [<c02fa4c4>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 7.707817] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 7.716648] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 7.725567] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 7.734485] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 7.742791] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 7.750661] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 7.758879] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 7.767185] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 7.775229] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 7.783448] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 7.792192] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 7.800411] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 7.808022] ---[ end trace 4ee1a301cee5ee86 ]---
[ 7.812900] ------------[ cut here ]------------
[ 7.817553] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:193 pci_get_slot+0xb0/0xb4
[ 7.825425] Modules linked in:
[ 7.828496] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 7.836275] Hardware name: Sigma Tango DT
[ 7.840305] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 7.848088] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 7.855348] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 7.862345] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 7.869953] [<c0118498>] (warn_slowpath_null) from [<c0300ca4>] (pci_get_slot+0xb0/0xb4)
[ 7.878087] [<c0300ca4>] (pci_get_slot) from [<c02f945c>] (pci_scan_single_device+0x14/0xb0)
[ 7.886569] [<c02f945c>] (pci_scan_single_device) from [<c02f9550>] (pci_scan_slot+0x58/0x100)
[ 7.895225] [<c02f9550>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 7.903444] [<c02fa468>] (pci_scan_child_bus) from [<c02fa1b8>] (pci_scan_bridge+0x2c4/0x554)
[ 7.912013] [<c02fa1b8>] (pci_scan_bridge) from [<c02fa4c4>] (pci_scan_child_bus+0x7c/0xf8)
[ 7.920407] [<c02fa4c4>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 7.929325] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 7.938156] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 7.947076] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 7.955995] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 7.964301] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 7.972170] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 7.980389] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 7.988695] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 7.996739] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 8.004958] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 8.013703] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 8.021923] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 8.029537] ---[ end trace 4ee1a301cee5ee87 ]---
[ 8.034324] pci 0000:01:00.0: [1912:0014] type 00 class 0x0c0330
[ 8.040492] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00001fff 64bit]
[ 8.047960] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[ 8.054409] BUG: scheduling while atomic: swapper/0/1/0x00000000
[ 8.060547] Modules linked in:
[ 8.063626] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 8.071406] Hardware name: Sigma Tango DT
[ 8.075440] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 8.083224] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 8.090483] [<c02cc13c>] (dump_stack) from [<c0137ee8>] (__schedule_bug+0x64/0x84)
[ 8.098094] [<c0137ee8>] (__schedule_bug) from [<c04bb1d0>] (__schedule+0x364/0x454)
[ 8.105877] [<c04bb1d0>] (__schedule) from [<c04bb310>] (schedule+0x50/0xb4)
[ 8.112962] [<c04bb310>] (schedule) from [<c04be048>] (schedule_timeout+0x134/0x210)
[ 8.120750] [<c04be048>] (schedule_timeout) from [<c0168c74>] (msleep+0x2c/0x38)
[ 8.128191] [<c0168c74>] (msleep) from [<c030bb04>] (pcie_aspm_init_link_state+0x440/0x76c)
[ 8.136589] [<c030bb04>] (pcie_aspm_init_link_state) from [<c02f95f0>] (pci_scan_slot+0xf8/0x100)
[ 8.145509] [<c02f95f0>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 8.153728] [<c02fa468>] (pci_scan_child_bus) from [<c02fa1b8>] (pci_scan_bridge+0x2c4/0x554)
[ 8.162296] [<c02fa1b8>] (pci_scan_bridge) from [<c02fa4c4>] (pci_scan_child_bus+0x7c/0xf8)
[ 8.170690] [<c02fa4c4>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 8.179608] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 8.188439] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 8.197361] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 8.206280] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 8.214586] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 8.222456] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 8.230674] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 8.238981] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 8.247025] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 8.255245] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 8.263989] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 8.272209] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 8.279860] BUG: scheduling while atomic: swapper/0/1/0x00000002
[ 8.285905] Modules linked in:
[ 8.288979] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 8.296758] Hardware name: Sigma Tango DT
[ 8.300788] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 8.308570] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 8.315828] [<c02cc13c>] (dump_stack) from [<c0137ee8>] (__schedule_bug+0x64/0x84)
[ 8.323436] [<c0137ee8>] (__schedule_bug) from [<c04bb1d0>] (__schedule+0x364/0x454)
[ 8.331218] [<c04bb1d0>] (__schedule) from [<c04bb310>] (schedule+0x50/0xb4)
[ 8.338302] [<c04bb310>] (schedule) from [<c04be0dc>] (schedule_timeout+0x1c8/0x210)
[ 8.346085] [<c04be0dc>] (schedule_timeout) from [<c04bbdd8>] (wait_for_common+0x8c/0x13c)
[ 8.354392] [<c04bbdd8>] (wait_for_common) from [<c0185084>] (__stop_cpus+0x50/0x64)
[ 8.362174] [<c0185084>] (__stop_cpus) from [<c0185484>] (stop_cpus+0x2c/0x44)
[ 8.369431] [<c0185484>] (stop_cpus) from [<c0185550>] (stop_machine+0xb4/0xf8)
[ 8.376776] [<c0185550>] (stop_machine) from [<c0310e30>] (smp8759_config_read+0x68/0x74)
[ 8.384997] [<c0310e30>] (smp8759_config_read) from [<c02f5d44>] (pci_bus_read_config_word+0x6c/0x94)
[ 8.394265] [<c02f5d44>] (pci_bus_read_config_word) from [<c02f7220>] (pcie_capability_read_word+0x4c/0x88)
[ 8.404059] [<c02f7220>] (pcie_capability_read_word) from [<c030bb14>] (pcie_aspm_init_link_state+0x450/0x76c)
[ 8.414114] [<c030bb14>] (pcie_aspm_init_link_state) from [<c02f95f0>] (pci_scan_slot+0xf8/0x100)
[ 8.423032] [<c02f95f0>] (pci_scan_slot) from [<c02fa468>] (pci_scan_child_bus+0x20/0xf8)
[ 8.431251] [<c02fa468>] (pci_scan_child_bus) from [<c02fa1b8>] (pci_scan_bridge+0x2c4/0x554)
[ 8.439820] [<c02fa1b8>] (pci_scan_bridge) from [<c02fa4c4>] (pci_scan_child_bus+0x7c/0xf8)
[ 8.448214] [<c02fa4c4>] (pci_scan_child_bus) from [<c02fa738>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 8.457132] [<c02fa738>] (pci_scan_root_bus_msi) from [<c02fa75c>] (pci_scan_root_bus+0x18/0x20)
[ 8.465963] [<c02fa75c>] (pci_scan_root_bus) from [<c0310a48>] (pci_host_common_probe+0xc8/0x314)
[ 8.474882] [<c0310a48>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 8.483800] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 8.492106] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 8.499976] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 8.508194] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 8.516500] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 8.524544] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 8.532762] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 8.541506] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 8.549725] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 8.557464] PCI: bus1: Fast back to back transfers disabled
[ 8.563077] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[ 8.569730] ------------[ cut here ]------------
[ 8.574376] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:271 pci_get_dev_by_id+0x84/0x8c
[ 8.582684] Modules linked in:
[ 8.585754] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 8.593532] Hardware name: Sigma Tango DT
[ 8.597561] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 8.605344] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 8.612605] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 8.619603] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 8.627211] [<c0118498>] (warn_slowpath_null) from [<c0300d2c>] (pci_get_dev_by_id+0x84/0x8c)
[ 8.635780] [<c0300d2c>] (pci_get_dev_by_id) from [<c0300da0>] (pci_get_device+0x34/0x3c)
[ 8.644000] [<c0300da0>] (pci_get_device) from [<c03100c0>] (pci_fixup_irqs+0x60/0xac)
[ 8.651957] [<c03100c0>] (pci_fixup_irqs) from [<c0310a64>] (pci_host_common_probe+0xe4/0x314)
[ 8.660614] [<c0310a64>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 8.669532] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 8.677839] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 8.685708] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 8.693926] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 8.702233] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 8.710277] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 8.718497] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 8.727241] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 8.735460] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 8.743073] ---[ end trace 4ee1a301cee5ee88 ]---
[ 8.747729] ------------[ cut here ]------------
[ 8.752375] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:271 pci_get_dev_by_id+0x84/0x8c
[ 8.760683] Modules linked in:
[ 8.763754] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 8.771532] Hardware name: Sigma Tango DT
[ 8.775560] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 8.783343] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 8.790601] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 8.797598] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 8.805206] [<c0118498>] (warn_slowpath_null) from [<c0300d2c>] (pci_get_dev_by_id+0x84/0x8c)
[ 8.813774] [<c0300d2c>] (pci_get_dev_by_id) from [<c0300da0>] (pci_get_device+0x34/0x3c)
[ 8.821993] [<c0300da0>] (pci_get_device) from [<c03100c0>] (pci_fixup_irqs+0x60/0xac)
[ 8.829950] [<c03100c0>] (pci_fixup_irqs) from [<c0310a64>] (pci_host_common_probe+0xe4/0x314)
[ 8.838606] [<c0310a64>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 8.847525] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 8.855831] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 8.863700] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 8.871918] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 8.880224] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 8.888269] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 8.896488] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 8.905231] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 8.913451] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 8.921063] ---[ end trace 4ee1a301cee5ee89 ]---
[ 8.925752] ------------[ cut here ]------------
[ 8.930399] WARNING: CPU: 0 PID: 1 at drivers/pci/search.c:271 pci_get_dev_by_id+0x84/0x8c
[ 8.938707] Modules linked in:
[ 8.941778] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 8.949556] Hardware name: Sigma Tango DT
[ 8.953585] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 8.961368] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 8.968626] [<c02cc13c>] (dump_stack) from [<c01183d0>] (__warn+0xe8/0x100)
[ 8.975622] [<c01183d0>] (__warn) from [<c0118498>] (warn_slowpath_null+0x20/0x28)
[ 8.983230] [<c0118498>] (warn_slowpath_null) from [<c0300d2c>] (pci_get_dev_by_id+0x84/0x8c)
[ 8.991799] [<c0300d2c>] (pci_get_dev_by_id) from [<c0300da0>] (pci_get_device+0x34/0x3c)
[ 9.000018] [<c0300da0>] (pci_get_device) from [<c03100c0>] (pci_fixup_irqs+0x60/0xac)
[ 9.007974] [<c03100c0>] (pci_fixup_irqs) from [<c0310a64>] (pci_host_common_probe+0xe4/0x314)
[ 9.016631] [<c0310a64>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 9.025550] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 9.033856] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 9.041725] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 9.049944] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 9.058250] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 9.066294] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 9.074513] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 9.083257] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 9.091476] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 9.099088] ---[ end trace 4ee1a301cee5ee8a ]---
[ 9.103790] pci 0000:00:00.0: BAR 8: assigned [mem 0x50400000-0x504fffff]
[ 9.110623] pci 0000:01:00.0: BAR 0: assigned [mem 0x50400000-0x50401fff 64bit]
[ 9.118015] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 9.123010] pci 0000:00:00.0: bridge window [mem 0x50400000-0x504fffff]
[ 9.129908] pcieport 0000:00:00.0: enabling device (0140 -> 0142)
[ 9.136488] aer 0000:00:00.0:pcie002: service driver aer loaded
[ 9.142878] pci 0000:01:00.0: enabling device (0140 -> 0142)
[ 9.148630] ------------[ cut here ]------------
[ 9.153266] kernel BUG at mm/vmalloc.c:1361!
[ 9.157551] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[ 9.163407] Modules linked in:
[ 9.166472] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #16
[ 9.174250] Hardware name: Sigma Tango DT
[ 9.178273] task: df4229c0 task.stack: df43a000
[ 9.182827] PC is at __get_vm_area_node+0x148/0x14c
[ 9.187724] LR is at 0xffffffff
[ 9.190875] pc : [<c01bacb0>] lr : [<ffffffff>] psr: 20070013
[ 9.190875] sp : df43bd20 ip : 001fff00 fp : df56cc10
[ 9.202411] r10: 00000000 r9 : 00000000 r8 : 024000c0
[ 9.207656] r7 : 00050400 r6 : 50400000 r5 : 00000000 r4 : ffffffff
[ 9.214211] r3 : e0800000 r2 : 00000001 r1 : 00000001 r0 : 00002000
[ 9.220769] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 9.227936] Control: 10c5387d Table: 9f70004a DAC: 00000051
[ 9.233706] Process swapper/0 (pid: 1, stack limit = 0xdf43a210)
[ 9.239738] Stack: (0xdf43bd20 to 0xdf43c000)
[ 9.244113] bd20: 00000005 00000002 c0310dc8 ffffffff 00000000 50400000 00050400 c05ada44
[ 9.252332] bd40: 00000000 c01bae34 ff800000 ffffffff 024000c0 c039f260 00002000 c0111b1c
[ 9.260550] bd60: df601000 000c0300 00002000 0000ffff c0e2ee20 df56cc00 00000000 c0111c88
[ 9.268768] bd80: c039f260 01420300 c05b4580 c039f260 c0e61324 00000001 00000000 c0e0fe20
[ 9.276985] bda0: 00000000 c05b4570 df601000 c05b4580 0000ffff c0e2ee20 df56cc00 00000000
[ 9.285203] bdc0: df56cc10 c0309260 df601468 df60149c df601000 df625c14 df625c00 df43be30
[ 9.293421] bde0: 00000000 c02f797c df601000 df625c14 df625c00 c02f7a30 df559014 df601400
[ 9.301639] be00: df559000 c02f7a64 df55900c df55900c df559000 c0310a80 df43be30 00000000
[ 9.309856] be20: c0e10078 df59b1c0 df56cc00 c058e744 df43be30 df43be30 50000000 503fffff
[ 9.318074] be40: dfbf7524 00000200 00000000 00000000 00000000 00000000 df6df1c0 df56cc10
[ 9.326292] be60: c0e0ff88 df56cc44 c0e0ff88 00000000 00000007 00000000 dfffee80 c03508d8
[ 9.334510] be80: c0e61324 df56cc10 df56cc44 c034f388 df56cc10 c0e0ff88 df56cc44 00000000
[ 9.342728] bea0: 00000076 c034f4d8 00000000 c0e0ff88 c034f414 c034d8d0 df40565c df5423b4
[ 9.350946] bec0: c0e0ff88 df4a1480 c0e17728 c034e960 c058e81c ffffe000 c0633b8c c0e0ff88
[ 9.359164] bee0: ffffe000 c0633b8c c0628834 c034fa3c c0616a64 ffffe000 c0633b8c c010175c
[ 9.367381] bf00: c0e0a3c8 00000000 00000000 c021c834 c05a5c00 df48df80 00000000 c0e09240
[ 9.375599] bf20: c05e1a98 c050f824 00000076 c01329f8 c059efa4 c05e1160 00000000 00000006
[ 9.383817] bf40: 00000006 c0574760 c0e09228 c0e2ee00 c0e2ee00 c0e2ee00 c0633b8c c0628834
[ 9.392035] bf60: 00000076 00000007 c062883c c0600dbc 00000006 00000006 00000000 c06005ac
[ 9.400253] bf80: b89dae88 00000000 c04ba494 00000000 00000000 00000000 00000000 00000000
[ 9.408470] bfa0: 00000000 c04ba49c 00000000 c0107678 00000000 00000000 00000000 00000000
[ 9.416687] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 9.424904] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 aa7350b3 5db57fca
[ 9.433127] [<c01bacb0>] (__get_vm_area_node) from [<c01bae34>] (get_vm_area_caller+0x48/0x50)
[ 9.441788] [<c01bae34>] (get_vm_area_caller) from [<c0111b1c>] (__arm_ioremap_pfn_caller+0x94/0x1b4)
[ 9.451057] [<c0111b1c>] (__arm_ioremap_pfn_caller) from [<c0111c88>] (__arm_ioremap_caller+0x4c/0x54)
[ 9.460419] [<c0111c88>] (__arm_ioremap_caller) from [<c039f260>] (quirk_usb_early_handoff+0x2f0/0x790)
[ 9.469866] [<c039f260>] (quirk_usb_early_handoff) from [<c0309260>] (pci_do_fixups+0x94/0xc8)
[ 9.478526] [<c0309260>] (pci_do_fixups) from [<c02f797c>] (pci_bus_add_device+0x18/0x90)
[ 9.486745] [<c02f797c>] (pci_bus_add_device) from [<c02f7a30>] (pci_bus_add_devices+0x3c/0x80)
[ 9.495489] [<c02f7a30>] (pci_bus_add_devices) from [<c02f7a64>] (pci_bus_add_devices+0x70/0x80)
[ 9.504320] [<c02f7a64>] (pci_bus_add_devices) from [<c0310a80>] (pci_host_common_probe+0x100/0x314)
[ 9.513502] [<c0310a80>] (pci_host_common_probe) from [<c03508d8>] (platform_drv_probe+0x34/0x6c)
[ 9.522420] [<c03508d8>] (platform_drv_probe) from [<c034f388>] (really_probe+0x1c4/0x250)
[ 9.530727] [<c034f388>] (really_probe) from [<c034f4d8>] (__driver_attach+0xc4/0xc8)
[ 9.538596] [<c034f4d8>] (__driver_attach) from [<c034d8d0>] (bus_for_each_dev+0x68/0x9c)
[ 9.546815] [<c034d8d0>] (bus_for_each_dev) from [<c034e960>] (bus_add_driver+0x108/0x214)
[ 9.555121] [<c034e960>] (bus_add_driver) from [<c034fa3c>] (driver_register+0x78/0xf4)
[ 9.563165] [<c034fa3c>] (driver_register) from [<c010175c>] (do_one_initcall+0x44/0x170)
[ 9.571386] [<c010175c>] (do_one_initcall) from [<c0600dbc>] (kernel_init_freeable+0x154/0x1e0)
[ 9.580131] [<c0600dbc>] (kernel_init_freeable) from [<c04ba49c>] (kernel_init+0x8/0x10c)
[ 9.588352] [<c04ba49c>] (kernel_init) from [<c0107678>] (ret_from_fork+0x14/0x3c)
[ 9.595959] Code: eb001776 e3a00000 e28dd00c e8bd83f0 (e7f001f2)
[ 9.602080] ---[ end trace 4ee1a301cee5ee8b ]---
[ 9.606716] Kernel panic - not syncing: Fatal exception in interrupt
[ 9.613101] CPU1: stopping
[ 9.615818] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D W 4.9.23-1-rc4 #16
[ 9.623597] Hardware name: Sigma Tango DT
[ 9.627630] [<c010ec94>] (unwind_backtrace) from [<c010ace4>] (show_stack+0x10/0x14)
[ 9.635414] [<c010ace4>] (show_stack) from [<c02cc13c>] (dump_stack+0x84/0x98)
[ 9.642672] [<c02cc13c>] (dump_stack) from [<c010dad4>] (handle_IPI+0x168/0x17c)
[ 9.650105] [<c010dad4>] (handle_IPI) from [<c0101480>] (gic_handle_irq+0x88/0x8c)
[ 9.657712] [<c0101480>] (gic_handle_irq) from [<c010b7cc>] (__irq_svc+0x6c/0xa8)
[ 9.665229] Exception stack(0xdf45bf98 to 0xdf45bfe0)
[ 9.670300] bf80: 00000000 00004c80
[ 9.678518] bfa0: dfbe6270 c0114400 df45a000 c0e02fe4 00000002 c0e03034 c0e0b80c 413fc090
[ 9.686736] bfc0: 00000000 00000000 60000013 df45bfe8 c01080c0 c01080c4 60000013 ffffffff
[ 9.694956] [<c010b7cc>] (__irq_svc) from [<c01080c4>] (arch_cpu_idle+0x38/0x3c)
[ 9.702393] [<c01080c4>] (arch_cpu_idle) from [<c0151174>] (cpu_startup_entry+0xcc/0x144)
[ 9.710612] [<c0151174>] (cpu_startup_entry) from [<8010152c>] (0x8010152c)
[ 9.717607] ---[ end Kernel panic - not syncing: Fatal exception in interrupt

2017-07-03 13:27:09

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

[+cc Jingoo, Joao]

On Mon, Jul 03, 2017 at 10:35:50AM +0100, Ard Biesheuvel wrote:
> On 3 July 2017 at 00:18, Bjorn Helgaas <[email protected]> wrote:
> > On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
> >> This driver is required to work around several hardware bugs
> >> in the PCIe controller.
> >>
> >> NB: Revision 1 does not support legacy interrupts, or IO space.
> >
> > I had to apply these manually because of conflicts in Kconfig and
> > Makefile. What are these based on? Easiest for me is if you base
> > them on the current -rc1 tag.
> >
> >> Signed-off-by: Marc Gonzalez <[email protected]>
> >> ---
> >> drivers/pci/host/Kconfig | 8 +++
> >> drivers/pci/host/Makefile | 1 +
> >> drivers/pci/host/pcie-tango.c | 164 ++++++++++++++++++++++++++++++++++++++++++
> >> include/linux/pci_ids.h | 2 +
> >> 4 files changed, 175 insertions(+)
> >> create mode 100644 drivers/pci/host/pcie-tango.c
> >>
> [..]
> >> + /*
> >> + * QUIRK #2
> >> + * Unfortunately, config and mem spaces are muxed.
> >> + * Linux does not support such a setting, since drivers are free
> >> + * to access mem space directly, at any time.
> >> + * Therefore, we can only PRAY that config and mem space accesses
> >> + * NEVER occur concurrently.
> >> + */
> >> + writel_relaxed(1, pcie->mux);
> >> + ret = pci_generic_config_read(bus, devfn, where, size, val);
> >> + writel_relaxed(0, pcie->mux);
> >
> > I'm very hesitant about this. When people stress this, we're going to
> > get reports of data corruption. Even with the disclaimer below, I
> > don't feel good about this. Adding the driver is an implicit claim
> > that we support the device, but we know it can't be made reliable.
>
> I noticed that the Synopsys driver suffers from a similar issue: in
> dw_pcie_rd_other_conf(), it happily reprograms the outbound I/O window
> to perform a config space access, and switches it back to I/O space
> afterwards (unless it has more than 2 viewports, in which case it uses
> dedicated windows for I/O space and config space)

That doesn't sound good. Jingoo, Joao? I remember some discussion
about this, but not the details.

I/O accesses use wrappers (inb(), etc), so there's at least the
possibility of a mutex to serialize them with respect to config
accesses.

Bjorn

2017-07-03 13:40:46

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Mon, Jul 03, 2017 at 11:54:20AM +0200, Marc Gonzalez wrote:
> Hello Bjorn,
>
> On 03/07/2017 01:18, Bjorn Helgaas wrote:
>
> > On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
> >
> >> This driver is required to work around several hardware bugs
> >> in the PCIe controller.
> >
> > [ Snip style issues ]
>
> I wish you had pointed these out in your May 23 review, or in
> my March 29 version (or even just alluded to them). I would
> have fixed them in time for 2.13.

They're trivial, and if they were the only issues I would have just
done them myself while merging.

> >> + /*
> >> + * QUIRK #2
> >> + * Unfortunately, config and mem spaces are muxed.
> >> + * Linux does not support such a setting, since drivers are free
> >> + * to access mem space directly, at any time.
> >> + * Therefore, we can only PRAY that config and mem space accesses
> >> + * NEVER occur concurrently.
> >> + */
> >> + writel_relaxed(1, pcie->mux);
> >> + ret = pci_generic_config_read(bus, devfn, where, size, val);
> >> + writel_relaxed(0, pcie->mux);
> >
> > I'm very hesitant about this. When people stress this, we're going to
> > get reports of data corruption. Even with the disclaimer below, I
> > don't feel good about this. Adding the driver is an implicit claim
> > that we support the device, but we know it can't be made reliable.
>
> I can't say I didn't see this coming (I had taken your long silence
> as a sign of your reluctance) but back in May, I thought you implied
> that a warning + tainting the kernel would be sufficient.
>
> Mark Rutland points out stop_machine. I will test this solution.
> Would you find that acceptable?

Sounds possible, though I can't say for sure without seeing the code.

The problem is serializing vs. memory accesses, since they don't use
any wrappers. However, they are ioremapped(), so it's at least
conceivable that another solution would be to use VM to trap those
accesses. I'm not a VM person, so I don't know whether that's
feasible in Linux.

> > What is the benefit of adding this driver? How many units are in the
> > field? Are you hoping to have support in distros like RHEL? Are
> > these running self-built kernels straight from kernel.org? Is it
> > feasible for you to distribute this driver separately from the
> > upstream kernel?
>
> The benefit of upstreaming (for me) is making kernel maintainers
> aware that one is using specific internal APIs. Then one may be
> notified when these APIs are about to change.
>
> I'm told we have sold ~100k units. Though I don't know how many
> are in the field and using PCIe.
>
> There are no plans to use "full-blown" distros, we use embedded
> oriented distros, such as buildroot.
>
> Maintaining out-of-tree drivers is what we've been doing for
> ~15 years, and there are many pain-points involved. Ask Greg
> what he thinks of OOT drivers.
>
>
> >> +static int tango_check_pcie_link(void __iomem *test_out)
> >
> > I think this is checking for link up. Rename to tango_pcie_link_up()
> > to follow the convention of other drivers. Take a struct tango_pcie *
> > instead of an address, if possible.
>
> Anything's possible. NB: if I pass the struct, then I have to store
> the address in the struct, which isn't the case now, since I never
> need the address later. If you don't mind adding an unnecessary
> field to the struct, I can do it. What do you say?

The benefit of following the same formula as other drivers is pretty
large. Most drivers save the equivalent of "base" in the struct. If
you did that, you wouldn't need an extra pointer; you would just use
"base + SMP8759_MUX" in the config accessors and "base +
SMP8759_TEST_OUT" in tango_pcie_link_up().

> >> +static struct platform_driver tango_pcie_driver = {
> >> + .probe = tango_pcie_probe,
> >> + .driver = {
> >> + .name = KBUILD_MODNAME,
> >> + .of_match_table = tango_pcie_ids,
> >
> > I think you need ".suppress_bind_attrs = true" here to prevent issues
> > when unbinding driver. See
> > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a5f40e8098fe
>
> Will do. In that case, I can drop tango_pcie_remove() right?

I think so; I don't think there would be any way to remove the driver.

Bjorn

2017-07-03 14:35:15

by Marc Gonzalez

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

Bjorn Helgaas wrote:

> Marc Gonzalez wrote:
>
>> On 03/07/2017 01:18, Bjorn Helgaas wrote:
>>
>>> On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
>>>
>>>> +static int tango_check_pcie_link(void __iomem *test_out)
>>>
>>> I think this is checking for link up. Rename to tango_pcie_link_up()
>>> to follow the convention of other drivers. Take a struct tango_pcie *
>>> instead of an address, if possible.
>>
>> Anything's possible. NB: if I pass the struct, then I have to store
>> the address in the struct, which isn't the case now, since I never
>> need the address later. If you don't mind adding an unnecessary
>> field to the struct, I can do it. What do you say?
>
> The benefit of following the same formula as other drivers is pretty
> large. Most drivers save the equivalent of "base" in the struct. If
> you did that, you wouldn't need an extra pointer; you would just use
> "base + SMP8759_MUX" in the config accessors and "base + SMP8759_TEST_OUT"
> in tango_pcie_link_up().

The problem is that TEST_OUT is at 0x74 on SMP8759, but at 0x138
on my other chip. In fact, all registers have been "reshuffled",
and none have the same offsets on the two chips.

My solution was to define specific registers in the struct.

In my [RFC PATCH v0.2] posted March 23, I tried illustrating
the issue:

+static const struct of_device_id tango_pcie_ids[] = {
+ { .compatible = "sigma,smp8759-pcie" },
+ { .compatible = "sigma,rev2-pcie" },
+ { /* sentinel */ },
+};
+
+static void smp8759_init(struct tango_pcie *pcie, void __iomem *base)
+{
+ pcie->mux = base + 0x48;
+ pcie->msi_status = base + 0x80;
+ pcie->msi_mask = base + 0xa0;
+ pcie->msi_doorbell = 0xa0000000 + 0x2e07c;
+}
+
+static void rev2_init(struct tango_pcie *pcie, void __iomem *base)
+{
+ void __iomem *misc_irq = base + 0x40;
+ void __iomem *doorbell = base + 0x8c;
+
+ pcie->mux = base + 0x2c;
+ pcie->msi_status = base + 0x4c;
+ pcie->msi_mask = base + 0x6c;
+ pcie->msi_doorbell = 0x80000000;
+
+ writel(lower_32_bits(pcie->msi_doorbell), doorbell + 0);
+ writel(upper_32_bits(pcie->msi_doorbell), doorbell + 4);
+
+ /* Enable legacy PCI interrupts */
+ writel(BIT(15), misc_irq);
+ writel(0xf << 4, misc_irq + 4);
+}


Do you agree that the 'base + OFFSET' idiom does not work in
this specific situation? Would you handle it differently?

Regards.

2017-07-03 15:30:41

by Marc Gonzalez

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On 03/07/2017 15:13, Marc Gonzalez wrote:

> On 03/07/2017 11:54, Marc Gonzalez wrote:
>
>> Mark Rutland points out stop_machine. I will test this solution.
>
> I must be misunderstanding some of the requirements for
> calling stop_machine() because my kernel panics, after
> many warnings.

Enabling several kernel debugging features:

+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_RT_MUTEXES=y
+CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
+CONFIG_PROVE_LOCKING=y

And at the end of smp8759_config_read:

printk("in_atomic_preempt_off = %d\n", in_atomic_preempt_off());
stop_machine(do_nothing, NULL, NULL);
panic("STOP HERE FOR NOW\n");

The kernel outputs:

[ 1.022725] in_atomic_preempt_off = 0
[ 1.026568] BUG: scheduling while atomic: swapper/0/1/0x00000002
[ 1.032625] 5 locks held by swapper/0/1:
[ 1.036575] #0: (&dev->mutex){......}, at: [<c038c684>] __driver_attach+0x50/0xd0
[ 1.044319] #1: (&dev->mutex){......}, at: [<c038c694>] __driver_attach+0x60/0xd0
[ 1.052050] #2: (pci_lock){+.+...}, at: [<c03309d8>] pci_bus_read_config_dword+0x44/0x94
[ 1.060398] #3: (cpu_hotplug.dep_map){++++++}, at: [<c0119db0>] get_online_cpus+0x2c/0xa0
[ 1.068843] #4: (stop_cpus_mutex){+.+...}, at: [<c01a1184>] stop_cpus+0x20/0x48
[ 1.076404] Modules linked in:
[ 1.079483] Preemption disabled at:[ 1.082820] [< (null)>] (null)
[ 1.086165] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.23-1-rc4 #13
[ 1.092723] Hardware name: Sigma Tango DT
[ 1.096765] [<c010f600>] (unwind_backtrace) from [<c010b568>] (show_stack+0x10/0x14)
[ 1.104558] [<c010b568>] (show_stack) from [<c0304830>] (dump_stack+0x98/0xc4)
[ 1.111823] [<c0304830>] (dump_stack) from [<c013eee0>] (__schedule_bug+0x94/0xec)
[ 1.119436] [<c013eee0>] (__schedule_bug) from [<c0516364>] (__schedule+0x4a4/0x5f0)
[ 1.127220] [<c0516364>] (__schedule) from [<c05164fc>] (schedule+0x4c/0xac)
[ 1.134308] [<c05164fc>] (schedule) from [<c051b010>] (schedule_timeout+0x1f4/0x30c)
[ 1.142093] [<c051b010>] (schedule_timeout) from [<c051702c>] (wait_for_common+0x8c/0x13c)
[ 1.150401] [<c051702c>] (wait_for_common) from [<c05170ec>] (wait_for_completion+0x10/0x14)
[ 1.158886] [<c05170ec>] (wait_for_completion) from [<c01a0d74>] (__stop_cpus+0x50/0x64)
[ 1.167021] [<c01a0d74>] (__stop_cpus) from [<c01a1194>] (stop_cpus+0x30/0x48)
[ 1.174282] [<c01a1194>] (stop_cpus) from [<c01a1230>] (stop_machine+0x84/0x118)
[ 1.181719] [<c01a1230>] (stop_machine) from [<c034c070>] (smp8759_config_read+0x84/0x90)
[ 1.189942] [<c034c070>] (smp8759_config_read) from [<c0330a00>] (pci_bus_read_config_dword+0x6c/0x94)
[ 1.199301] [<c0330a00>] (pci_bus_read_config_dword) from [<c0332920>] (pci_bus_read_dev_vendor_id+0x24/0xe8)
[ 1.209270] [<c0332920>] (pci_bus_read_dev_vendor_id) from [<c033413c>] (pci_scan_single_device+0x40/0xb0)
[ 1.218977] [<c033413c>] (pci_scan_single_device) from [<c0334204>] (pci_scan_slot+0x58/0x100)
[ 1.227636] [<c0334204>] (pci_scan_slot) from [<c033511c>] (pci_scan_child_bus+0x20/0xf8)
[ 1.235858] [<c033511c>] (pci_scan_child_bus) from [<c03353ec>] (pci_scan_root_bus_msi+0xcc/0xd8)
[ 1.244779] [<c03353ec>] (pci_scan_root_bus_msi) from [<c0335410>] (pci_scan_root_bus+0x18/0x20)
[ 1.253612] [<c0335410>] (pci_scan_root_bus) from [<c034bc5c>] (pci_host_common_probe+0xc8/0x314)
[ 1.262533] [<c034bc5c>] (pci_host_common_probe) from [<c034c444>] (tango_pcie_probe+0x148/0x350)
[ 1.271455] [<c034c444>] (tango_pcie_probe) from [<c038dbc8>] (platform_drv_probe+0x34/0x6c)
[ 1.279939] [<c038dbc8>] (platform_drv_probe) from [<c038c5a8>] (really_probe+0x1c4/0x250)
[ 1.288248] [<c038c5a8>] (really_probe) from [<c038c700>] (__driver_attach+0xcc/0xd0)
[ 1.296121] [<c038c700>] (__driver_attach) from [<c038aa50>] (bus_for_each_dev+0x68/0x9c)
[ 1.304342] [<c038aa50>] (bus_for_each_dev) from [<c038bfac>] (driver_attach+0x1c/0x20)
[ 1.312389] [<c038bfac>] (driver_attach) from [<c038bb5c>] (bus_add_driver+0x108/0x214)
[ 1.320436] [<c038bb5c>] (bus_add_driver) from [<c038ccb0>] (driver_register+0x78/0xf4)
[ 1.328483] [<c038ccb0>] (driver_register) from [<c038db8c>] (__platform_driver_register+0x40/0x48)
[ 1.337583] [<c038db8c>] (__platform_driver_register) from [<c0816fc4>] (tango_pcie_driver_init+0x14/0x18)
[ 1.347291] [<c0816fc4>] (tango_pcie_driver_init) from [<c01017dc>] (do_one_initcall+0x44/0x174)
[ 1.356128] [<c01017dc>] (do_one_initcall) from [<c0800dcc>] (kernel_init_freeable+0x154/0x1e0)
[ 1.364875] [<c0800dcc>] (kernel_init_freeable) from [<c0515544>] (kernel_init+0x8/0x10c)
[ 1.373097] [<c0515544>] (kernel_init) from [<c01077d0>] (ret_from_fork+0x14/0x24)
[ 1.380799] Kernel panic - not syncing: STOP HERE FOR NOW
[ 1.380799]
[ 1.387714] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.9.23-1-rc4 #13
[ 1.395495] Hardware name: Sigma Tango DT
[ 1.399529] [<c010f600>] (unwind_backtrace) from [<c010b568>] (show_stack+0x10/0x14)
[ 1.407317] [<c010b568>] (show_stack) from [<c0304830>] (dump_stack+0x98/0xc4)
[ 1.414582] [<c0304830>] (dump_stack) from [<c01a3bac>] (panic+0xe0/0x258)
[ 1.421494] [<c01a3bac>] (panic) from [<c034c07c>] (tango_check_pcie_link+0x0/0x48)
[ 1.429192] [<c034c07c>] (tango_check_pcie_link) from [<c034bfec>] (smp8759_config_read+0x0/0x90)
[ 1.438114] [<c034bfec>] (smp8759_config_read) from [<00241105>] (0x241105)
[ 1.445191] CPU1: stopping
[ 1.447910] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G W 4.9.23-1-rc4 #13
[ 1.455690] Hardware name: Sigma Tango DT
[ 1.459724] [<c010f600>] (unwind_backtrace) from [<c010b568>] (show_stack+0x10/0x14)
[ 1.467512] [<c010b568>] (show_stack) from [<c0304830>] (dump_stack+0x98/0xc4)
[ 1.474774] [<c0304830>] (dump_stack) from [<c010e410>] (handle_IPI+0x19c/0x1b0)
[ 1.482210] [<c010e410>] (handle_IPI) from [<c010151c>] (gic_handle_irq+0x88/0x8c)
[ 1.489819] [<c010151c>] (gic_handle_irq) from [<c010c0b0>] (__irq_svc+0x70/0xb0)
[ 1.497339] Exception stack(0xdf46ff80 to 0xdf46ffc8)
[ 1.502415] ff80: 00000001 00000001 00000000 df468180 df46e000 c1004be4 c1004c48 00000002
[ 1.510636] ffa0: c100f990 413fc090 00000000 00000000 00000000 df46ffd0 c0165ee0 c0108240
[ 1.518853] ffc0: 20000113 ffffffff
[ 1.522358] [<c010c0b0>] (__irq_svc) from [<c0108240>] (arch_cpu_idle+0x24/0x3c)
[ 1.529795] [<c0108240>] (arch_cpu_idle) from [<c051b540>] (default_idle_call+0x20/0x30)
[ 1.537934] [<c051b540>] (default_idle_call) from [<c015d6cc>] (cpu_startup_entry+0xd0/0x150)
[ 1.546504] [<c015d6cc>] (cpu_startup_entry) from [<c010e048>] (secondary_start_kernel+0x158/0x164)
[ 1.555599] [<c010e048>] (secondary_start_kernel) from [<801015ac>] (0x801015ac)
[ 1.563063] ---[ end Kernel panic - not syncing: STOP HERE FOR NOW


The panic call stack looks suspicious.

smp8759_config_read() never calls tango_check_pcie_link().

(I compile with -fno-optimize-sibling-calls to get more accurate
call stacks.)

in_atomic_preempt_off is false before calling stop_machine()

I suppose I'm doing something wrong, but I'm not sure what yet.

Regards.

2017-07-03 18:11:48

by Russell King (Oracle)

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Mon, Jul 03, 2017 at 08:40:31AM -0500, Bjorn Helgaas wrote:
> The problem is serializing vs. memory accesses, since they don't use
> any wrappers. However, they are ioremapped(), so it's at least
> conceivable that another solution would be to use VM to trap those
> accesses. I'm not a VM person, so I don't know whether that's
> feasible in Linux.

Bjorn,

You're forgetting that MMIO (iow, memory returned by ioremap()) must
be accessed through the appropriate accessors, and must not be
directly dereferenced in C. (We do have buggy drivers that do that
but they are buggy, and in many cases are getting attention to fix
that.)

However, adding a spinlock into them is really not nice, because it
adds extra overhead that's only necessary for rare cases like Sigma
Designs - especially when you consider that these accessors are used
for all MMIO accesses, not just PCI. It would effectively mean that
we end up serialising all MMIO accesses throughout the kernel when
Sigma Designs SoCs are enabled, destroying some of the SMP benefit.

I don't think we can sanely use the MMU to trap those accesses either,
that would mean sending IPIs to tell other CPUs to do something, and
waiting for them to respond - which can deadlock if we're already in
an IRQ-protected region (iirc, config accesses are made with IRQs
off.)

I don't think there's an easy solution to this problem - and I'm not
sure that stop_machine() can be made to work in this path (which
needs a process context). I have a suspicion that the Sigma Designs
PCI implementation is just soo insane that it's never going to work
reliably in a multi-SoC kernel without introducing severe performance
issues for everyone else.

--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

2017-07-03 18:44:36

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On 3 July 2017 at 19:11, Russell King - ARM Linux <[email protected]> wrote:
> On Mon, Jul 03, 2017 at 08:40:31AM -0500, Bjorn Helgaas wrote:
>> The problem is serializing vs. memory accesses, since they don't use
>> any wrappers. However, they are ioremapped(), so it's at least
>> conceivable that another solution would be to use VM to trap those
>> accesses. I'm not a VM person, so I don't know whether that's
>> feasible in Linux.
>
> Bjorn,
>
> You're forgetting that MMIO (iow, memory returned by ioremap()) must
> be accessed through the appropriate accessors, and must not be
> directly dereferenced in C. (We do have buggy drivers that do that
> but they are buggy, and in many cases are getting attention to fix
> that.)
>
> However, adding a spinlock into them is really not nice, because it
> adds extra overhead that's only necessary for rare cases like Sigma
> Designs - especially when you consider that these accessors are used
> for all MMIO accesses, not just PCI. It would effectively mean that
> we end up serialising all MMIO accesses throughout the kernel when
> Sigma Designs SoCs are enabled, destroying some of the SMP benefit.
>
> I don't think we can sanely use the MMU to trap those accesses either,
> that would mean sending IPIs to tell other CPUs to do something, and
> waiting for them to respond - which can deadlock if we're already in
> an IRQ-protected region (iirc, config accesses are made with IRQs
> off.)
>
> I don't think there's an easy solution to this problem - and I'm not
> sure that stop_machine() can be made to work in this path (which
> needs a process context). I have a suspicion that the Sigma Designs
> PCI implementation is just soo insane that it's never going to work
> reliably in a multi-SoC kernel without introducing severe performance
> issues for everyone else.
>

I suppose we could perhaps use per-cpu spinlocks? That would put the
complexity in the Sigma config space accessors, i.e., to take each
lock before proceeding with reprogramming the outbound window, and
other implementations wouldn't have to care. However, I do agree with
Russell that having this complexity in the first place is hard to
justify if the only implementation that requires it is a wacky design
that needs lots of other quirks to operate somewhat sanely to begin
with.

2017-07-04 07:04:04

by Jisheng Zhang

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Mon, 3 Jul 2017 08:27:04 -0500 wrote:

> [+cc Jingoo, Joao]
>
> On Mon, Jul 03, 2017 at 10:35:50AM +0100, Ard Biesheuvel wrote:
> > On 3 July 2017 at 00:18, Bjorn Helgaas <[email protected]> wrote:
> > > On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
> > >> This driver is required to work around several hardware bugs
> > >> in the PCIe controller.
> > >>
> > >> NB: Revision 1 does not support legacy interrupts, or IO space.
> > >
> > > I had to apply these manually because of conflicts in Kconfig and
> > > Makefile. What are these based on? Easiest for me is if you base
> > > them on the current -rc1 tag.
> > >
> > >> Signed-off-by: Marc Gonzalez <[email protected]>
> > >> ---
> > >> drivers/pci/host/Kconfig | 8 +++
> > >> drivers/pci/host/Makefile | 1 +
> > >> drivers/pci/host/pcie-tango.c | 164 ++++++++++++++++++++++++++++++++++++++++++
> > >> include/linux/pci_ids.h | 2 +
> > >> 4 files changed, 175 insertions(+)
> > >> create mode 100644 drivers/pci/host/pcie-tango.c
> > >>
> > [..]
> > >> + /*
> > >> + * QUIRK #2
> > >> + * Unfortunately, config and mem spaces are muxed.
> > >> + * Linux does not support such a setting, since drivers are free
> > >> + * to access mem space directly, at any time.
> > >> + * Therefore, we can only PRAY that config and mem space accesses
> > >> + * NEVER occur concurrently.
> > >> + */
> > >> + writel_relaxed(1, pcie->mux);
> > >> + ret = pci_generic_config_read(bus, devfn, where, size, val);
> > >> + writel_relaxed(0, pcie->mux);
> > >
> > > I'm very hesitant about this. When people stress this, we're going to
> > > get reports of data corruption. Even with the disclaimer below, I
> > > don't feel good about this. Adding the driver is an implicit claim
> > > that we support the device, but we know it can't be made reliable.
> >
> > I noticed that the Synopsys driver suffers from a similar issue: in
> > dw_pcie_rd_other_conf(), it happily reprograms the outbound I/O window
> > to perform a config space access, and switches it back to I/O space
> > afterwards (unless it has more than 2 viewports, in which case it uses
> > dedicated windows for I/O space and config space)
>
> That doesn't sound good. Jingoo, Joao? I remember some discussion
> about this, but not the details.
>
> I/O accesses use wrappers (inb(), etc), so there's at least the
> possibility of a mutex to serialize them with respect to config
> accesses.
>

IIRC, for 2 viewports, we don't need to worry about the config space
access, because config space access is serialized by pci_lock; We
do have race between config space and io space. But the accessing config
space and io space at the same time is rare. And the PCIe EPs which
has io space are rare too, supporting these EPs are not the potential
target of those platforms with 2 viewports.

Thanks,
Jisheng

2017-07-04 07:10:19

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Mon, Jul 03, 2017 at 05:30:28PM +0200, Marc Gonzalez wrote:

> And at the end of smp8759_config_read:
>
> printk("in_atomic_preempt_off = %d\n", in_atomic_preempt_off());

That's confused...

> stop_machine(do_nothing, NULL, NULL);
> panic("STOP HERE FOR NOW\n");
>
> The kernel outputs:
>
> [ 1.022725] in_atomic_preempt_off = 0
> [ 1.026568] BUG: scheduling while atomic: swapper/0/1/0x00000002
> [ 1.032625] 5 locks held by swapper/0/1:
> [ 1.036575] #0: (&dev->mutex){......}, at: [<c038c684>] __driver_attach+0x50/0xd0
> [ 1.044319] #1: (&dev->mutex){......}, at: [<c038c694>] __driver_attach+0x60/0xd0
> [ 1.052050] #2: (pci_lock){+.+...}, at: [<c03309d8>] pci_bus_read_config_dword+0x44/0x94

This is a raw_spinlock_t, that disables preemption

> [ 1.060398] #3: (cpu_hotplug.dep_map){++++++}, at: [<c0119db0>] get_online_cpus+0x2c/0xa0
> [ 1.068843] #4: (stop_cpus_mutex){+.+...}, at: [<c01a1184>] stop_cpus+0x20/0x48

> [ 1.076404] Modules linked in:
> [ 1.079483] Preemption disabled at:[ 1.082820] [< (null)>] (null)
> [ 1.086165] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.23-1-rc4 #13
> [ 1.092723] Hardware name: Sigma Tango DT
> [ 1.096765] [<c010f600>] (unwind_backtrace) from [<c010b568>] (show_stack+0x10/0x14)
> [ 1.104558] [<c010b568>] (show_stack) from [<c0304830>] (dump_stack+0x98/0xc4)
> [ 1.111823] [<c0304830>] (dump_stack) from [<c013eee0>] (__schedule_bug+0x94/0xec)
> [ 1.119436] [<c013eee0>] (__schedule_bug) from [<c0516364>] (__schedule+0x4a4/0x5f0)
> [ 1.127220] [<c0516364>] (__schedule) from [<c05164fc>] (schedule+0x4c/0xac)


And here you try and schedule with preemption disabled.

> [ 1.134308] [<c05164fc>] (schedule) from [<c051b010>] (schedule_timeout+0x1f4/0x30c)
> [ 1.142093] [<c051b010>] (schedule_timeout) from [<c051702c>] (wait_for_common+0x8c/0x13c)
> [ 1.150401] [<c051702c>] (wait_for_common) from [<c05170ec>] (wait_for_completion+0x10/0x14)
> [ 1.158886] [<c05170ec>] (wait_for_completion) from [<c01a0d74>] (__stop_cpus+0x50/0x64)
> [ 1.167021] [<c01a0d74>] (__stop_cpus) from [<c01a1194>] (stop_cpus+0x30/0x48)
> [ 1.174282] [<c01a1194>] (stop_cpus) from [<c01a1230>] (stop_machine+0x84/0x118)
> [ 1.181719] [<c01a1230>] (stop_machine) from [<c034c070>] (smp8759_config_read+0x84/0x90)
> [ 1.189942] [<c034c070>] (smp8759_config_read) from [<c0330a00>] (pci_bus_read_config_dword+0x6c/0x94)
> [ 1.199301] [<c0330a00>] (pci_bus_read_config_dword) from [<c0332920>] (pci_bus_read_dev_vendor_id+0x24/0xe8)
> [ 1.209270] [<c0332920>] (pci_bus_read_dev_vendor_id) from [<c033413c>] (pci_scan_single_device+0x40/0xb0)
> [ 1.218977] [<c033413c>] (pci_scan_single_device) from [<c0334204>] (pci_scan_slot+0x58/0x100)
> [ 1.227636] [<c0334204>] (pci_scan_slot) from [<c033511c>] (pci_scan_child_bus+0x20/0xf8)
> [ 1.235858] [<c033511c>] (pci_scan_child_bus) from [<c03353ec>] (pci_scan_root_bus_msi+0xcc/0xd8)
> [ 1.244779] [<c03353ec>] (pci_scan_root_bus_msi) from [<c0335410>] (pci_scan_root_bus+0x18/0x20)
> [ 1.253612] [<c0335410>] (pci_scan_root_bus) from [<c034bc5c>] (pci_host_common_probe+0xc8/0x314)
> [ 1.262533] [<c034bc5c>] (pci_host_common_probe) from [<c034c444>] (tango_pcie_probe+0x148/0x350)
> [ 1.271455] [<c034c444>] (tango_pcie_probe) from [<c038dbc8>] (platform_drv_probe+0x34/0x6c)

> The panic call stack looks suspicious.
>
> smp8759_config_read() never calls tango_check_pcie_link().
>
> (I compile with -fno-optimize-sibling-calls to get more accurate
> call stacks.)
>
> in_atomic_preempt_off is false before calling stop_machine()

Yes, but that's a pointless statement.

> I suppose I'm doing something wrong, but I'm not sure what yet.

Using stop_machine() is per definition doing it wrong ;-) But see above.

2017-07-04 07:22:00

by Jisheng Zhang

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Tue, 4 Jul 2017 14:58:40 +0800 Jisheng Zhang wrote:

> On Mon, 3 Jul 2017 08:27:04 -0500 wrote:
>
> > [+cc Jingoo, Joao]
> >
> > On Mon, Jul 03, 2017 at 10:35:50AM +0100, Ard Biesheuvel wrote:
> > > On 3 July 2017 at 00:18, Bjorn Helgaas <[email protected]> wrote:
> > > > On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
> > > >> This driver is required to work around several hardware bugs
> > > >> in the PCIe controller.
> > > >>
> > > >> NB: Revision 1 does not support legacy interrupts, or IO space.
> > > >
> > > > I had to apply these manually because of conflicts in Kconfig and
> > > > Makefile. What are these based on? Easiest for me is if you base
> > > > them on the current -rc1 tag.
> > > >
> > > >> Signed-off-by: Marc Gonzalez <[email protected]>
> > > >> ---
> > > >> drivers/pci/host/Kconfig | 8 +++
> > > >> drivers/pci/host/Makefile | 1 +
> > > >> drivers/pci/host/pcie-tango.c | 164 ++++++++++++++++++++++++++++++++++++++++++
> > > >> include/linux/pci_ids.h | 2 +
> > > >> 4 files changed, 175 insertions(+)
> > > >> create mode 100644 drivers/pci/host/pcie-tango.c
> > > >>
> > > [..]
> > > >> + /*
> > > >> + * QUIRK #2
> > > >> + * Unfortunately, config and mem spaces are muxed.
> > > >> + * Linux does not support such a setting, since drivers are free
> > > >> + * to access mem space directly, at any time.
> > > >> + * Therefore, we can only PRAY that config and mem space accesses
> > > >> + * NEVER occur concurrently.
> > > >> + */
> > > >> + writel_relaxed(1, pcie->mux);
> > > >> + ret = pci_generic_config_read(bus, devfn, where, size, val);
> > > >> + writel_relaxed(0, pcie->mux);
> > > >
> > > > I'm very hesitant about this. When people stress this, we're going to
> > > > get reports of data corruption. Even with the disclaimer below, I
> > > > don't feel good about this. Adding the driver is an implicit claim
> > > > that we support the device, but we know it can't be made reliable.
> > >
> > > I noticed that the Synopsys driver suffers from a similar issue: in
> > > dw_pcie_rd_other_conf(), it happily reprograms the outbound I/O window
> > > to perform a config space access, and switches it back to I/O space
> > > afterwards (unless it has more than 2 viewports, in which case it uses
> > > dedicated windows for I/O space and config space)
> >
> > That doesn't sound good. Jingoo, Joao? I remember some discussion
> > about this, but not the details.
> >
> > I/O accesses use wrappers (inb(), etc), so there's at least the
> > possibility of a mutex to serialize them with respect to config
> > accesses.
> >
>
> IIRC, for 2 viewports, we don't need to worry about the config space
> access, because config space access is serialized by pci_lock; We
> do have race between config space and io space. But the accessing config
> space and io space at the same time is rare. And the PCIe EPs which
> has io space are rare too, supporting these EPs are not the potential
> target of those platforms with 2 viewports.
>

PS: I think most platforms choose 2 pcie designware viewports just because
it's the default setting. And I have send a feature request to ASIC people
to increase the viewports to 3 for future marvell berlin SoCs.

2017-07-04 08:02:10

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On 4 July 2017 at 07:58, Jisheng Zhang <[email protected]> wrote:
> On Mon, 3 Jul 2017 08:27:04 -0500 wrote:
>
>> [+cc Jingoo, Joao]
>>
>> On Mon, Jul 03, 2017 at 10:35:50AM +0100, Ard Biesheuvel wrote:
>> > On 3 July 2017 at 00:18, Bjorn Helgaas <[email protected]> wrote:
>> > > On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
>> > >> This driver is required to work around several hardware bugs
>> > >> in the PCIe controller.
>> > >>
>> > >> NB: Revision 1 does not support legacy interrupts, or IO space.
>> > >
>> > > I had to apply these manually because of conflicts in Kconfig and
>> > > Makefile. What are these based on? Easiest for me is if you base
>> > > them on the current -rc1 tag.
>> > >
>> > >> Signed-off-by: Marc Gonzalez <[email protected]>
>> > >> ---
>> > >> drivers/pci/host/Kconfig | 8 +++
>> > >> drivers/pci/host/Makefile | 1 +
>> > >> drivers/pci/host/pcie-tango.c | 164 ++++++++++++++++++++++++++++++++++++++++++
>> > >> include/linux/pci_ids.h | 2 +
>> > >> 4 files changed, 175 insertions(+)
>> > >> create mode 100644 drivers/pci/host/pcie-tango.c
>> > >>
>> > [..]
>> > >> + /*
>> > >> + * QUIRK #2
>> > >> + * Unfortunately, config and mem spaces are muxed.
>> > >> + * Linux does not support such a setting, since drivers are free
>> > >> + * to access mem space directly, at any time.
>> > >> + * Therefore, we can only PRAY that config and mem space accesses
>> > >> + * NEVER occur concurrently.
>> > >> + */
>> > >> + writel_relaxed(1, pcie->mux);
>> > >> + ret = pci_generic_config_read(bus, devfn, where, size, val);
>> > >> + writel_relaxed(0, pcie->mux);
>> > >
>> > > I'm very hesitant about this. When people stress this, we're going to
>> > > get reports of data corruption. Even with the disclaimer below, I
>> > > don't feel good about this. Adding the driver is an implicit claim
>> > > that we support the device, but we know it can't be made reliable.
>> >
>> > I noticed that the Synopsys driver suffers from a similar issue: in
>> > dw_pcie_rd_other_conf(), it happily reprograms the outbound I/O window
>> > to perform a config space access, and switches it back to I/O space
>> > afterwards (unless it has more than 2 viewports, in which case it uses
>> > dedicated windows for I/O space and config space)
>>
>> That doesn't sound good. Jingoo, Joao? I remember some discussion
>> about this, but not the details.
>>
>> I/O accesses use wrappers (inb(), etc), so there's at least the
>> possibility of a mutex to serialize them with respect to config
>> accesses.
>>
>
> IIRC, for 2 viewports, we don't need to worry about the config space
> access, because config space access is serialized by pci_lock; We
> do have race between config space and io space. But the accessing config
> space and io space at the same time is rare.

Being 'rare' is not sufficient, unfortunately. In the current
situation, I/O space accesses may occur when the outbound window is
directed to the config space of a potentially completely unrelated
device. This is bad.

> And the PCIe EPs which
> has io space are rare too, supporting these EPs are not the potential
> target of those platforms with 2 viewports.
>

I am not sure EP mode is relevant here. What I do know is that boards
like the Marvell 8040 based MacchiatoBin uses this IP in RC mode, and
exposes config, MMIO and IO space windows using only 2 viewports. Note
that this is essentially a bug in the DT description, given that its
version of the IP supports 8 viewports. But the driver needs to be
fixed as well.

2017-07-04 08:25:06

by Jisheng Zhang

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Tue, 4 Jul 2017 09:02:06 +0100 Ard Biesheuvel wrote:

> On 4 July 2017 at 07:58, Jisheng Zhang <[email protected]> wrote:
> > On Mon, 3 Jul 2017 08:27:04 -0500 wrote:
> >
> >> [+cc Jingoo, Joao]
> >>
> >> On Mon, Jul 03, 2017 at 10:35:50AM +0100, Ard Biesheuvel wrote:
> >> > On 3 July 2017 at 00:18, Bjorn Helgaas <[email protected]> wrote:
> >> > > On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
> >> > >> This driver is required to work around several hardware bugs
> >> > >> in the PCIe controller.
> >> > >>
> >> > >> NB: Revision 1 does not support legacy interrupts, or IO space.
> >> > >
> >> > > I had to apply these manually because of conflicts in Kconfig and
> >> > > Makefile. What are these based on? Easiest for me is if you base
> >> > > them on the current -rc1 tag.
> >> > >
> >> > >> Signed-off-by: Marc Gonzalez <[email protected]>
> >> > >> ---
> >> > >> drivers/pci/host/Kconfig | 8 +++
> >> > >> drivers/pci/host/Makefile | 1 +
> >> > >> drivers/pci/host/pcie-tango.c | 164 ++++++++++++++++++++++++++++++++++++++++++
> >> > >> include/linux/pci_ids.h | 2 +
> >> > >> 4 files changed, 175 insertions(+)
> >> > >> create mode 100644 drivers/pci/host/pcie-tango.c
> >> > >>
> >> > [..]
> >> > >> + /*
> >> > >> + * QUIRK #2
> >> > >> + * Unfortunately, config and mem spaces are muxed.
> >> > >> + * Linux does not support such a setting, since drivers are free
> >> > >> + * to access mem space directly, at any time.
> >> > >> + * Therefore, we can only PRAY that config and mem space accesses
> >> > >> + * NEVER occur concurrently.
> >> > >> + */
> >> > >> + writel_relaxed(1, pcie->mux);
> >> > >> + ret = pci_generic_config_read(bus, devfn, where, size, val);
> >> > >> + writel_relaxed(0, pcie->mux);
> >> > >
> >> > > I'm very hesitant about this. When people stress this, we're going to
> >> > > get reports of data corruption. Even with the disclaimer below, I
> >> > > don't feel good about this. Adding the driver is an implicit claim
> >> > > that we support the device, but we know it can't be made reliable.
> >> >
> >> > I noticed that the Synopsys driver suffers from a similar issue: in
> >> > dw_pcie_rd_other_conf(), it happily reprograms the outbound I/O window
> >> > to perform a config space access, and switches it back to I/O space
> >> > afterwards (unless it has more than 2 viewports, in which case it uses
> >> > dedicated windows for I/O space and config space)
> >>
> >> That doesn't sound good. Jingoo, Joao? I remember some discussion
> >> about this, but not the details.
> >>
> >> I/O accesses use wrappers (inb(), etc), so there's at least the
> >> possibility of a mutex to serialize them with respect to config
> >> accesses.
> >>
> >
> > IIRC, for 2 viewports, we don't need to worry about the config space
> > access, because config space access is serialized by pci_lock; We
> > do have race between config space and io space. But the accessing config
> > space and io space at the same time is rare.
>
> Being 'rare' is not sufficient, unfortunately. In the current
> situation, I/O space accesses may occur when the outbound window is
> directed to the config space of a potentially completely unrelated
> device. This is bad.

Yep, I agree with you.

>
> > And the PCIe EPs which
> > has io space are rare too, supporting these EPs are not the potential
> > target of those platforms with 2 viewports.
> >
>
> I am not sure EP mode is relevant here. What I do know is that boards

I mean those PCIe EP cards which have IO space, but that doesn't matter.

> like the Marvell 8040 based MacchiatoBin uses this IP in RC mode, and
> exposes config, MMIO and IO space windows using only 2 viewports. Note
> that this is essentially a bug in the DT description, given that its
> version of the IP supports 8 viewports. But the driver needs to be
> fixed as well.

To fix for 2 viewports situation, we need to serialize access of the io
and config space. In internal repo, we can achieve it by modifying the
io access helper functions such as inl/outl, but this won't be accepted
by the mainline IMHO. Except fixing the HW, any elegant solution?

Suggestions are appreciated.

Thanks,
Jisheng

2017-07-04 09:38:34

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On 4 July 2017 at 09:19, Jisheng Zhang <[email protected]> wrote:
> On Tue, 4 Jul 2017 09:02:06 +0100 Ard Biesheuvel wrote:
>
>> On 4 July 2017 at 07:58, Jisheng Zhang <[email protected]> wrote:
>> > On Mon, 3 Jul 2017 08:27:04 -0500 wrote:
>> >
>> >> [+cc Jingoo, Joao]
>> >>
>> >> On Mon, Jul 03, 2017 at 10:35:50AM +0100, Ard Biesheuvel wrote:
>> >> > On 3 July 2017 at 00:18, Bjorn Helgaas <[email protected]> wrote:
>> >> > > On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
>> >> > >> This driver is required to work around several hardware bugs
>> >> > >> in the PCIe controller.
>> >> > >>
>> >> > >> NB: Revision 1 does not support legacy interrupts, or IO space.
>> >> > >
>> >> > > I had to apply these manually because of conflicts in Kconfig and
>> >> > > Makefile. What are these based on? Easiest for me is if you base
>> >> > > them on the current -rc1 tag.
>> >> > >
>> >> > >> Signed-off-by: Marc Gonzalez <[email protected]>
>> >> > >> ---
>> >> > >> drivers/pci/host/Kconfig | 8 +++
>> >> > >> drivers/pci/host/Makefile | 1 +
>> >> > >> drivers/pci/host/pcie-tango.c | 164 ++++++++++++++++++++++++++++++++++++++++++
>> >> > >> include/linux/pci_ids.h | 2 +
>> >> > >> 4 files changed, 175 insertions(+)
>> >> > >> create mode 100644 drivers/pci/host/pcie-tango.c
>> >> > >>
>> >> > [..]
>> >> > >> + /*
>> >> > >> + * QUIRK #2
>> >> > >> + * Unfortunately, config and mem spaces are muxed.
>> >> > >> + * Linux does not support such a setting, since drivers are free
>> >> > >> + * to access mem space directly, at any time.
>> >> > >> + * Therefore, we can only PRAY that config and mem space accesses
>> >> > >> + * NEVER occur concurrently.
>> >> > >> + */
>> >> > >> + writel_relaxed(1, pcie->mux);
>> >> > >> + ret = pci_generic_config_read(bus, devfn, where, size, val);
>> >> > >> + writel_relaxed(0, pcie->mux);
>> >> > >
>> >> > > I'm very hesitant about this. When people stress this, we're going to
>> >> > > get reports of data corruption. Even with the disclaimer below, I
>> >> > > don't feel good about this. Adding the driver is an implicit claim
>> >> > > that we support the device, but we know it can't be made reliable.
>> >> >
>> >> > I noticed that the Synopsys driver suffers from a similar issue: in
>> >> > dw_pcie_rd_other_conf(), it happily reprograms the outbound I/O window
>> >> > to perform a config space access, and switches it back to I/O space
>> >> > afterwards (unless it has more than 2 viewports, in which case it uses
>> >> > dedicated windows for I/O space and config space)
>> >>
>> >> That doesn't sound good. Jingoo, Joao? I remember some discussion
>> >> about this, but not the details.
>> >>
>> >> I/O accesses use wrappers (inb(), etc), so there's at least the
>> >> possibility of a mutex to serialize them with respect to config
>> >> accesses.
>> >>
>> >
>> > IIRC, for 2 viewports, we don't need to worry about the config space
>> > access, because config space access is serialized by pci_lock; We
>> > do have race between config space and io space. But the accessing config
>> > space and io space at the same time is rare.
>>
>> Being 'rare' is not sufficient, unfortunately. In the current
>> situation, I/O space accesses may occur when the outbound window is
>> directed to the config space of a potentially completely unrelated
>> device. This is bad.
>
> Yep, I agree with you.
>
>>
>> > And the PCIe EPs which
>> > has io space are rare too, supporting these EPs are not the potential
>> > target of those platforms with 2 viewports.
>> >
>>
>> I am not sure EP mode is relevant here. What I do know is that boards
>
> I mean those PCIe EP cards which have IO space, but that doesn't matter.
>

Ah, ok. But if such EP cards are so rare, why expose I/O space at all
if we cannot do it safely?

>> like the Marvell 8040 based MacchiatoBin uses this IP in RC mode, and
>> exposes config, MMIO and IO space windows using only 2 viewports. Note
>> that this is essentially a bug in the DT description, given that its
>> version of the IP supports 8 viewports. But the driver needs to be
>> fixed as well.
>
> To fix for 2 viewports situation, we need to serialize access of the io
> and config space. In internal repo, we can achieve it by modifying the
> io access helper functions such as inl/outl, but this won't be accepted
> by the mainline IMHO. Except fixing the HW, any elegant solution?
>
> Suggestions are appreciated.
>

I think the safe and upstreamable approach is to disable the I/O
window completely if num-viewports <= 2.

2017-07-04 13:09:17

by Mason

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On 04/07/2017 09:09, Peter Zijlstra wrote:

> On Mon, Jul 03, 2017 at 05:30:28PM +0200, Marc Gonzalez wrote:
>
>> And at the end of smp8759_config_read:
>>
>> printk("in_atomic_preempt_off = %d\n", in_atomic_preempt_off());
>
> That's confused...

That much is certain. I am indeed grasping at straws.

I grepped "scheduling while atomic", found __schedule_bug()
in kernel/sched/core.c and saw

if (IS_ENABLED(CONFIG_DEBUG_PREEMPT) && in_atomic_preempt_off()) {
pr_err("Preemption disabled at:");
print_ip_sym(preempt_disable_ip);
pr_cont("\n");
}

I thought printing the value of in_atomic_preempt_off()
in the callback would indicate whether preemption had
already been turned off at that point.

It doesn't work like that?

BTW, why didn't print_ip_sym(preempt_disable_ip); say
where preemption had been disabled?


>> [ 1.026568] BUG: scheduling while atomic: swapper/0/1/0x00000002
>> [ 1.032625] 5 locks held by swapper/0/1:
>> [ 1.036575] #0: (&dev->mutex){......}, at: [<c038c684>] __driver_attach+0x50/0xd0
>> [ 1.044319] #1: (&dev->mutex){......}, at: [<c038c694>] __driver_attach+0x60/0xd0
>> [ 1.052050] #2: (pci_lock){+.+...}, at: [<c03309d8>] pci_bus_read_config_dword+0x44/0x94
>
> This is a raw_spinlock_t, that disables preemption

drivers/pci/access.c

/*
* This interrupt-safe spinlock protects all accesses to PCI
* configuration space.
*/
DEFINE_RAW_SPINLOCK(pci_lock);


raw_spin_lock_irqsave(&pci_lock, flags);
res = bus->ops->read(bus, devfn, pos, len, &data);


IIUC, it's not possible to call stop_machine() while holding
a raw spinlock? What about regular spinlocks? IIUC, in RT,
regular spinlocks may sleep?

I didn't find "preempt" or "schedul" in the spinlock doc.
https://www.kernel.org/doc/Documentation/locking/spinlocks.txt


> Using stop_machine() is per definition doing it wrong ;-)

Here's the high-level view. My HW is borked and muxes
config space and mem space. So I need a way to freeze
the entire system, make the config space access, and
then return the system to normal. (AFAICT, config space
accesses are rare, so if I kill performance for these
accesses, the system might remain usable.)

Is there a way to do this? Mark suggested stop_machine
but it seems using it in my situation is not quite
straight-forward.

Regards.

2017-07-04 14:28:21

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Tue, Jul 04, 2017 at 03:08:43PM +0200, Mason wrote:
> On 04/07/2017 09:09, Peter Zijlstra wrote:
>
> > On Mon, Jul 03, 2017 at 05:30:28PM +0200, Marc Gonzalez wrote:
> >
> >> And at the end of smp8759_config_read:
> >>
> >> printk("in_atomic_preempt_off = %d\n", in_atomic_preempt_off());
> >
> > That's confused...
>
> That much is certain. I am indeed grasping at straws.
>
> I grepped "scheduling while atomic", found __schedule_bug()
> in kernel/sched/core.c and saw
>
> if (IS_ENABLED(CONFIG_DEBUG_PREEMPT) && in_atomic_preempt_off()) {
> pr_err("Preemption disabled at:");
> print_ip_sym(preempt_disable_ip);
> pr_cont("\n");
> }
>
> I thought printing the value of in_atomic_preempt_off()
> in the callback would indicate whether preemption had
> already been turned off at that point.

in_atomic_preempt_off() is a 'weird' construct. It basically checks to
see if preempt_count != 1. So calling it while holding a single preempt,
will return false (like in your case).

> It doesn't work like that?

Not really, you want to just print preempt_count.

> BTW, why didn't print_ip_sym(preempt_disable_ip); say
> where preemption had been disabled?

It does, but it might be non-obvious. We only store the first 0->!0
transition IP in there.

So if you have chains like:

preempt_disable(); // 0 -> 1
spin_lock(); // 1 -> 2
preempt_enable(); // 2 -> 1
preempt_disable(); // 1 -> 2
spin_unlock(); // 2 -> 1

mutex_lock();
might_sleep(); *SPLAT* report the IP of 0 -> 1

preempt_enable(): // 1 -> 0


That IP might not even be part of the current callchain.

> >> [ 1.026568] BUG: scheduling while atomic: swapper/0/1/0x00000002
> >> [ 1.032625] 5 locks held by swapper/0/1:
> >> [ 1.036575] #0: (&dev->mutex){......}, at: [<c038c684>] __driver_attach+0x50/0xd0
> >> [ 1.044319] #1: (&dev->mutex){......}, at: [<c038c694>] __driver_attach+0x60/0xd0
> >> [ 1.052050] #2: (pci_lock){+.+...}, at: [<c03309d8>] pci_bus_read_config_dword+0x44/0x94
> >
> > This is a raw_spinlock_t, that disables preemption
>
> drivers/pci/access.c
>
> /*
> * This interrupt-safe spinlock protects all accesses to PCI
> * configuration space.
> */
> DEFINE_RAW_SPINLOCK(pci_lock);
>
>
> raw_spin_lock_irqsave(&pci_lock, flags);
> res = bus->ops->read(bus, devfn, pos, len, &data);
>
>
> IIUC, it's not possible to call stop_machine() while holding
> a raw spinlock?

Correct. You cannot call blocking primitives while holding a spinlock.

> What about regular spinlocks? IIUC, in RT,
> regular spinlocks may sleep?

Still not, your code should not depend on CONFIG_PREEMPT*.

> I didn't find "preempt" or "schedul" in the spinlock doc.
> https://www.kernel.org/doc/Documentation/locking/spinlocks.txt

Correct... as per usual the documentation is somewhat terse.

But once you think about it, its 'obvious' a spinlock needs to disable
preemption. If you don't you get into heaps of trouble (one of the
reasons userspace spinlocks are an absolute trainwreck).

> > Using stop_machine() is per definition doing it wrong ;-)
>
> Here's the high-level view. My HW is borked and muxes
> config space and mem space. So I need a way to freeze
> the entire system, make the config space access, and
> then return the system to normal. (AFAICT, config space
> accesses are rare, so if I kill performance for these
> accesses, the system might remain usable.)
>
> Is there a way to do this? Mark suggested stop_machine
> but it seems using it in my situation is not quite
> straight-forward.

*groan*... so yeah, broken hardware demands crazy stuff... stop machine
is tricky here because I'm not sure we can demand all PCI accessors to
allow sleeping.

And given that PCI lock is irqsave, we can't even assume IRQs are
enabled.

Does your platform have NMIs? If so, you can do yuck things like the
kgdb sync. NMI IPI all other CPUs and have them spin-wait on your state.

Then be careful not to deadlock when two CPUs do that concurrently.

2017-07-04 15:15:07

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Mon, Jul 03, 2017 at 07:11:28PM +0100, Russell King - ARM Linux wrote:
> On Mon, Jul 03, 2017 at 08:40:31AM -0500, Bjorn Helgaas wrote:
> > The problem is serializing vs. memory accesses, since they don't use
> > any wrappers. However, they are ioremapped(), so it's at least
> > conceivable that another solution would be to use VM to trap those
> > accesses. I'm not a VM person, so I don't know whether that's
> > feasible in Linux.
>
> Bjorn,
>
> You're forgetting that MMIO (iow, memory returned by ioremap()) must
> be accessed through the appropriate accessors, and must not be
> directly dereferenced in C. (We do have buggy drivers that do that
> but they are buggy, and in many cases are getting attention to fix
> that.)

Oh, you're right, thank you! I guess you're referring to readb()
and friends. I haven't found an actual prohibition on directly
dereferencing addresses returned from ioremap(), but
Documentation/driver-api/device-io.rst is clear that they're
suitable for passing to readb(), etc.

I recently told someone else my mistaken idea that ioremap() must
return a valid virtual address. I wish I remembered who it was, so I
could correct that. Documentation/DMA-API-HOWTO.txt also suggests
that ioremap() returns a virtual address -- I think I wrote that, and
maybe that virtual address reference should be tweaked a bit.

Another wrinkle is that the pci_mmap_resource() interface is exposed
via sysfs and allows direct userspace mmap of PCI MMIO resources. In
that case, there is no accessor available. I wonder if we need some
way to disable this mmap when readb() is non-trivial.

Bjorn

2017-07-04 15:19:10

by Mason

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On 04/07/2017 16:27, Peter Zijlstra wrote:

> Mason wrote:
>
>> if (IS_ENABLED(CONFIG_DEBUG_PREEMPT) && in_atomic_preempt_off()) {
>> pr_err("Preemption disabled at:");
>> print_ip_sym(preempt_disable_ip);
>> pr_cont("\n");
>> }
>>
>> BTW, why didn't print_ip_sym(preempt_disable_ip); say
>> where preemption had been disabled?
>
> It does, but it might be non-obvious. We only store the first 0->!0
> transition IP in there.

The output was:

[ 1.079483] Preemption disabled at:[ 1.082820] [< (null)>] (null)

so preempt_disable_ip was NULL, right?

Has it been already clobbered?


>> Here's the high-level view. My HW is borked and muxes
>> config space and mem space. So I need a way to freeze
>> the entire system, make the config space access, and
>> then return the system to normal. (AFAICT, config space
>> accesses are rare, so if I kill performance for these
>> accesses, the system might remain usable.)
>>
>> Is there a way to do this? Mark suggested stop_machine
>> but it seems using it in my situation is not quite
>> straight-forward.
>
> *groan*... so yeah, broken hardware demands crazy stuff... stop machine
> is tricky here because I'm not sure we can demand all PCI accessors to
> allow sleeping.
>
> And given that PCI lock is irqsave, we can't even assume IRQs are
> enabled.
>
> Does your platform have NMIs? If so, you can do yuck things like the
> kgdb sync. NMI IPI all other CPUs and have them spin-wait on your state.
>
> Then be careful not to deadlock when two CPUs do that concurrently.

My platform is arch/arm/mach-tango (Cortex A9, ARMv7-A)

This looks similar to what you described:
https://www.linaro.org/blog/core-dump/debugging-arm-kernels-using-nmifiq/
(I CCed Daniel Thompson)

Quote article:

> Note: On ARMv7-A devices that have security extensions (TrustZone)
> FIQ can only be used by the kernel if it is possible to run Linux in
> secure mode. It is therefore not possible to exploit FIQ for
> debugging and run a secure monitor simultaneously. At the end of this
> blog post we will discuss potential future work to mitigate this
> problem.

On my platform, Linux runs in non-secure mode...

Sounds like I don't have many options left for this driver :-(

Regards.

2017-07-04 15:58:59

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Mon, Jul 03, 2017 at 04:34:29PM +0200, Marc Gonzalez wrote:
> Bjorn Helgaas wrote:
>
> > Marc Gonzalez wrote:
> >
> >> On 03/07/2017 01:18, Bjorn Helgaas wrote:
> >>
> >>> On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
> >>>
> >>>> +static int tango_check_pcie_link(void __iomem *test_out)
> >>>
> >>> I think this is checking for link up. Rename to tango_pcie_link_up()
> >>> to follow the convention of other drivers. Take a struct tango_pcie *
> >>> instead of an address, if possible.
> >>
> >> Anything's possible. NB: if I pass the struct, then I have to store
> >> the address in the struct, which isn't the case now, since I never
> >> need the address later. If you don't mind adding an unnecessary
> >> field to the struct, I can do it. What do you say?
> >
> > The benefit of following the same formula as other drivers is pretty
> > large. Most drivers save the equivalent of "base" in the struct. If
> > you did that, you wouldn't need an extra pointer; you would just use
> > "base + SMP8759_MUX" in the config accessors and "base + SMP8759_TEST_OUT"
> > in tango_pcie_link_up().
>
> The problem is that TEST_OUT is at 0x74 on SMP8759, but at 0x138
> on my other chip. In fact, all registers have been "reshuffled",
> and none have the same offsets on the two chips.
>
> My solution was to define specific registers in the struct.
>
> In my [RFC PATCH v0.2] posted March 23, I tried illustrating
> the issue:
>
> +static const struct of_device_id tango_pcie_ids[] = {
> + { .compatible = "sigma,smp8759-pcie" },
> + { .compatible = "sigma,rev2-pcie" },
> + { /* sentinel */ },
> +};
> +
> +static void smp8759_init(struct tango_pcie *pcie, void __iomem *base)
> +{
> + pcie->mux = base + 0x48;
> + pcie->msi_status = base + 0x80;
> + pcie->msi_mask = base + 0xa0;
> + pcie->msi_doorbell = 0xa0000000 + 0x2e07c;
> +}
> +
> +static void rev2_init(struct tango_pcie *pcie, void __iomem *base)
> +{
> + void __iomem *misc_irq = base + 0x40;
> + void __iomem *doorbell = base + 0x8c;
> +
> + pcie->mux = base + 0x2c;
> + pcie->msi_status = base + 0x4c;
> + pcie->msi_mask = base + 0x6c;
> + pcie->msi_doorbell = 0x80000000;
> +
> + writel(lower_32_bits(pcie->msi_doorbell), doorbell + 0);
> + writel(upper_32_bits(pcie->msi_doorbell), doorbell + 4);
> +
> + /* Enable legacy PCI interrupts */
> + writel(BIT(15), misc_irq);
> + writel(0xf << 4, misc_irq + 4);
> +}
>
>
> Do you agree that the 'base + OFFSET' idiom does not work in
> this specific situation? Would you handle it differently?

It's definitely a hassle to support chips with different register
layouts. Your hardware guys are really making your life hard :)

drivers/pci/host/pcie-iproc.c is one strategy. It has
iproc_pcie_reg_paxb[] and iproc_pcie_reg_paxb_v2[] with register
offsets for different chip versions.

It saves a table of register offsets per controller, which is similar
to saving a set of pointers per controller. Saving the pointers as
you suggest above is marginally more storage but probably easier to
read.

If the chips are fundamentally different, i.e., if they *operate*
differently in addition to having a different register layout, you
could make two separate drivers.

Bjorn

2017-07-04 18:17:55

by Russell King (Oracle)

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Tue, Jul 04, 2017 at 10:15:02AM -0500, Bjorn Helgaas wrote:
> On Mon, Jul 03, 2017 at 07:11:28PM +0100, Russell King - ARM Linux wrote:
> > On Mon, Jul 03, 2017 at 08:40:31AM -0500, Bjorn Helgaas wrote:
> > > The problem is serializing vs. memory accesses, since they don't use
> > > any wrappers. However, they are ioremapped(), so it's at least
> > > conceivable that another solution would be to use VM to trap those
> > > accesses. I'm not a VM person, so I don't know whether that's
> > > feasible in Linux.
> >
> > Bjorn,
> >
> > You're forgetting that MMIO (iow, memory returned by ioremap()) must
> > be accessed through the appropriate accessors, and must not be
> > directly dereferenced in C. (We do have buggy drivers that do that
> > but they are buggy, and in many cases are getting attention to fix
> > that.)
>
> Oh, you're right, thank you! I guess you're referring to readb()
> and friends. I haven't found an actual prohibition on directly
> dereferencing addresses returned from ioremap(), but
> Documentation/driver-api/device-io.rst is clear that they're
> suitable for passing to readb(), etc.

There was a strong suggestion years ago that what is returned from
ioremap() is a cookie that must not be dereferenced by drivers, and
that there was a suggestion that having ioremap() return the virtual
address with an offset (which read*() and friends would undo) would
be a good idea. However, even back then, we had some cases where
drivers would directly dereference the pointer. We have sparse today
which helps point these places out (provided drivers stay away from
__force, but unfortunately, I think we've ended up with people who
think that silencing sparse warnings with __force is more preferable
than leaving them there to point out where things are actually wrong.)

So, imho, unfortunately sparse has lost its usefulness in this regard.

> I recently told someone else my mistaken idea that ioremap() must
> return a valid virtual address. I wish I remembered who it was, so I
> could correct that. Documentation/DMA-API-HOWTO.txt also suggests
> that ioremap() returns a virtual address -- I think I wrote that, and
> maybe that virtual address reference should be tweaked a bit.

For most implementations, ioremap() does indeed return a virtual address,
but that was never how the API was defined in the first place - it was
always referred to as returning a cookie.

> Another wrinkle is that the pci_mmap_resource() interface is exposed
> via sysfs and allows direct userspace mmap of PCI MMIO resources. In
> that case, there is no accessor available. I wonder if we need some
> way to disable this mmap when readb() is non-trivial.

Hmm, no comment, except that while the PCI MMIO space is available to
userspace, and userspace is capable of running that thread on any CPU,
PCI MMIO space can't be switched to config space.

That's another nail in this coffin...

--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

2017-07-04 20:24:17

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v9 0/3] Tango PCIe controller support

On Tue, Jun 20, 2017 at 10:12:57AM +0200, Marc Gonzalez wrote:
> Marc Z pointed out that posting partial series is not ideal.
> Collect last-minute fixups into a single patch series.
>
> - Bump series to v9 to avoid any ambiguity
> - Add Rob's Ack on patch 1
>
> Marc Gonzalez (3):
> PCI: Add DT binding for tango PCIe controller
> PCI: Add tango PCIe host bridge support
> PCI: Add tango MSI controller support
>
> .../devicetree/bindings/pci/tango-pcie.txt | 29 ++
> drivers/pci/host/Kconfig | 8 +
> drivers/pci/host/Makefile | 1 +
> drivers/pci/host/pcie-tango.c | 390 +++++++++++++++++++++
> include/linux/pci_ids.h | 2 +
> 5 files changed, 430 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/pci/tango-pcie.txt
> create mode 100644 drivers/pci/host/pcie-tango.c

I made the trivial changes I mentioned, added a dependency on
CONFIG_BROKEN (for the config/MMIO muxing issue), and put these on
pci/host-tango. I can't build or test this, so I probably broke
something in the process. I think the combination of the boot-time
warning, the taint, and CONFIG_BROKEN is a reasonable amount of
warning that a user should expect issues.

Can you take a look and see if it works for you?

https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-tango

Bjorn

2017-07-04 22:56:03

by Mason

[permalink] [raw]
Subject: Re: [PATCH v9 0/3] Tango PCIe controller support

On 04/07/2017 22:24, Bjorn Helgaas wrote:

> On Tue, Jun 20, 2017 at 10:12:57AM +0200, Marc Gonzalez wrote:
>
>> Marc Z pointed out that posting partial series is not ideal.
>> Collect last-minute fixups into a single patch series.
>>
>> - Bump series to v9 to avoid any ambiguity
>> - Add Rob's Ack on patch 1
>>
>> Marc Gonzalez (3):
>> PCI: Add DT binding for tango PCIe controller
>> PCI: Add tango PCIe host bridge support
>> PCI: Add tango MSI controller support
>>
>> .../devicetree/bindings/pci/tango-pcie.txt | 29 ++
>> drivers/pci/host/Kconfig | 8 +
>> drivers/pci/host/Makefile | 1 +
>> drivers/pci/host/pcie-tango.c | 390 +++++++++++++++++++++
>> include/linux/pci_ids.h | 2 +
>> 5 files changed, 430 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/pci/tango-pcie.txt
>> create mode 100644 drivers/pci/host/pcie-tango.c
>
> I made the trivial changes I mentioned, added a dependency on
> CONFIG_BROKEN (for the config/MMIO muxing issue), and put these on
> pci/host-tango. I can't build or test this, so I probably broke
> something in the process. I think the combination of the boot-time
> warning, the taint, and CONFIG_BROKEN is a reasonable amount of
> warning that a user should expect issues.
>
> Can you take a look and see if it works for you?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-tango

Thanks. I'll take it for a spin ASAP.

TAINT_CRAP... Smirk. I didn't see that one in the docs:
https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html

Oh wait... TAINT_CRAP is "C" => a staging driver has been loaded

The one issue I anticipate with "depends on BROKEN" is
when I add support for revision 2, which isn't broken.

Regards.

2017-07-04 23:43:17

by Mason

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On 04/07/2017 17:58, Bjorn Helgaas wrote:

> It's definitely a hassle to support chips with different register
> layouts. Your hardware guys are really making your life hard :)

Now where did I put my foam bat...

> If the chips are fundamentally different, i.e., if they *operate*
> differently in addition to having a different register layout, you
> could make two separate drivers.

It's the exact same underlying IP. Revision 2 is only a
bug fix rev. IIUC, some of the fixes lead to adding a
register here, removing a register there... and I don't
think the HW dev ever considered the pain of supporting
both revs within a single driver.

This dual support explains some of the peculiarities
you noted in my submission.

Regards.

2017-07-05 00:00:27

by Mason

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On 03/07/2017 20:11, Russell King - ARM Linux wrote:

> I don't think there's an easy solution to this problem - and I'm not
> sure that stop_machine() can be made to work in this path (which
> needs a process context). I have a suspicion that the Sigma Designs
> PCI implementation is just soo insane that it's never going to work
> reliably in a multi-SoC kernel without introducing severe performance
> issues for everyone else.

If I remember correctly, this is the second HW block from
tango that has been deemed "too insane for Linux".

The first one was the DMA engine, which doesn't interrupt
when a transfer is done, but when a new transfer may be
programmed. (Though there is a simple work-around for
this one, if we give up command pipelining.)

Do larger SoC vendors have HW devs working closely with
Linux devs, to avoid these design bloopers?

Regards.

2017-07-05 05:21:52

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Wed, Jul 05, 2017 at 01:59:55AM +0200, Mason wrote:
> Do larger SoC vendors have HW devs working closely with
> Linux devs, to avoid these design bloopers?

Yes they generally do, as they have learned from their prior mistakes :)

good luck!

greg k-h

2017-07-05 12:33:36

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

On Wed, Jul 05, 2017 at 01:59:55AM +0200, Mason wrote:

> Do larger SoC vendors have HW devs working closely with
> Linux devs, to avoid these design bloopers?

Yes, or just internal software teams in general - hardware designs tend
to be a lot more usable if there's good dialogue with users about what's
useful and what isn't. It's going to happen at some point anyway when
people can't get the chip working well.


Attachments:
(No filename) (417.00 B)
signature.asc (488.00 B)
Download all attachments

2017-07-05 13:53:25

by Joao Pinto

[permalink] [raw]
Subject: Re: [PATCH v9 2/3] PCI: Add tango PCIe host bridge support

Hi to all,

Às 10:38 AM de 7/4/2017, Ard Biesheuvel escreveu:
> On 4 July 2017 at 09:19, Jisheng Zhang <[email protected]> wrote:
>> On Tue, 4 Jul 2017 09:02:06 +0100 Ard Biesheuvel wrote:
>>
>>> On 4 July 2017 at 07:58, Jisheng Zhang <[email protected]> wrote:
>>>> On Mon, 3 Jul 2017 08:27:04 -0500 wrote:
>>>>
>>>>> [+cc Jingoo, Joao]
>>>>>
>>>>> On Mon, Jul 03, 2017 at 10:35:50AM +0100, Ard Biesheuvel wrote:
>>>>>> On 3 July 2017 at 00:18, Bjorn Helgaas <[email protected]> wrote:
>>>>>>> On Tue, Jun 20, 2017 at 10:17:40AM +0200, Marc Gonzalez wrote:
>>>>>>>> This driver is required to work around several hardware bugs
>>>>>>>> in the PCIe controller.
>>>>>>>>
>>>>>>>> NB: Revision 1 does not support legacy interrupts, or IO space.
>>>>>>>
>>>>>>> I had to apply these manually because of conflicts in Kconfig and
>>>>>>> Makefile. What are these based on? Easiest for me is if you base
>>>>>>> them on the current -rc1 tag.
>>>>>>>
>>>>>>>> Signed-off-by: Marc Gonzalez <[email protected]>
>>>>>>>> ---
>>>>>>>> drivers/pci/host/Kconfig | 8 +++
>>>>>>>> drivers/pci/host/Makefile | 1 +
>>>>>>>> drivers/pci/host/pcie-tango.c | 164 ++++++++++++++++++++++++++++++++++++++++++
>>>>>>>> include/linux/pci_ids.h | 2 +
>>>>>>>> 4 files changed, 175 insertions(+)
>>>>>>>> create mode 100644 drivers/pci/host/pcie-tango.c
>>>>>>>>
>>>>>> [..]
>>>>>>>> + /*
>>>>>>>> + * QUIRK #2
>>>>>>>> + * Unfortunately, config and mem spaces are muxed.
>>>>>>>> + * Linux does not support such a setting, since drivers are free
>>>>>>>> + * to access mem space directly, at any time.
>>>>>>>> + * Therefore, we can only PRAY that config and mem space accesses
>>>>>>>> + * NEVER occur concurrently.
>>>>>>>> + */
>>>>>>>> + writel_relaxed(1, pcie->mux);
>>>>>>>> + ret = pci_generic_config_read(bus, devfn, where, size, val);
>>>>>>>> + writel_relaxed(0, pcie->mux);
>>>>>>>
>>>>>>> I'm very hesitant about this. When people stress this, we're going to
>>>>>>> get reports of data corruption. Even with the disclaimer below, I
>>>>>>> don't feel good about this. Adding the driver is an implicit claim
>>>>>>> that we support the device, but we know it can't be made reliable.
>>>>>>
>>>>>> I noticed that the Synopsys driver suffers from a similar issue: in
>>>>>> dw_pcie_rd_other_conf(), it happily reprograms the outbound I/O window
>>>>>> to perform a config space access, and switches it back to I/O space
>>>>>> afterwards (unless it has more than 2 viewports, in which case it uses
>>>>>> dedicated windows for I/O space and config space)
>>>>>
>>>>> That doesn't sound good. Jingoo, Joao? I remember some discussion
>>>>> about this, but not the details.
>>>>>
>>>>> I/O accesses use wrappers (inb(), etc), so there's at least the
>>>>> possibility of a mutex to serialize them with respect to config
>>>>> accesses.
>>>>>
>>>>
>>>> IIRC, for 2 viewports, we don't need to worry about the config space
>>>> access, because config space access is serialized by pci_lock; We
>>>> do have race between config space and io space. But the accessing config
>>>> space and io space at the same time is rare.
>>>
>>> Being 'rare' is not sufficient, unfortunately. In the current
>>> situation, I/O space accesses may occur when the outbound window is
>>> directed to the config space of a potentially completely unrelated
>>> device. This is bad.
>>
>> Yep, I agree with you.
>>
>>>
>>>> And the PCIe EPs which
>>>> has io space are rare too, supporting these EPs are not the potential
>>>> target of those platforms with 2 viewports.
>>>>
>>>
>>> I am not sure EP mode is relevant here. What I do know is that boards
>>
>> I mean those PCIe EP cards which have IO space, but that doesn't matter.
>>
>
> Ah, ok. But if such EP cards are so rare, why expose I/O space at all
> if we cannot do it safely?
>
>>> like the Marvell 8040 based MacchiatoBin uses this IP in RC mode, and
>>> exposes config, MMIO and IO space windows using only 2 viewports. Note
>>> that this is essentially a bug in the DT description, given that its
>>> version of the IP supports 8 viewports. But the driver needs to be
>>> fixed as well.
>>
>> To fix for 2 viewports situation, we need to serialize access of the io
>> and config space. In internal repo, we can achieve it by modifying the
>> io access helper functions such as inl/outl, but this won't be accepted
>> by the mainline IMHO. Except fixing the HW, any elegant solution?
>>
>> Suggestions are appreciated.
>>
>
> I think the safe and upstreamable approach is to disable the I/O
> window completely if num-viewports <= 2.
>

I think that the critical case is when we are using a single ATU region, and
that has to managed by software. The hardware is not capable of managing racing
conditions, like programming the ATU while still transfering data, so problems
can ocurre for sure. In this case we should be able to add to the driver a
simple lock to signal that the ATU is being used. If the ATU was being used we
could make a spinlock for example. Would this acceptable in your opinion? The
problem is when we are transfering data. Are we able to know that data is being
processed?

When using a single region, when we access the config mem, we have to stop all
data transfers, reprogram the ATU to handle the config access, do the config
read/write, put the region "back" and restart the data transfer.

When using 2 or more regions, we can separate the scopes and the data transfers
does not need to be stopped. The race problem is harder to ocurre.

Thanks,
Joao

2017-07-05 18:04:06

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v9 0/3] Tango PCIe controller support

On Wed, Jul 05, 2017 at 12:55:37AM +0200, Mason wrote:
> On 04/07/2017 22:24, Bjorn Helgaas wrote:
>
> > On Tue, Jun 20, 2017 at 10:12:57AM +0200, Marc Gonzalez wrote:
> >
> >> Marc Z pointed out that posting partial series is not ideal.
> >> Collect last-minute fixups into a single patch series.
> >>
> >> - Bump series to v9 to avoid any ambiguity
> >> - Add Rob's Ack on patch 1
> >>
> >> Marc Gonzalez (3):
> >> PCI: Add DT binding for tango PCIe controller
> >> PCI: Add tango PCIe host bridge support
> >> PCI: Add tango MSI controller support
> >>
> >> .../devicetree/bindings/pci/tango-pcie.txt | 29 ++
> >> drivers/pci/host/Kconfig | 8 +
> >> drivers/pci/host/Makefile | 1 +
> >> drivers/pci/host/pcie-tango.c | 390 +++++++++++++++++++++
> >> include/linux/pci_ids.h | 2 +
> >> 5 files changed, 430 insertions(+)
> >> create mode 100644 Documentation/devicetree/bindings/pci/tango-pcie.txt
> >> create mode 100644 drivers/pci/host/pcie-tango.c
> >
> > I made the trivial changes I mentioned, added a dependency on
> > CONFIG_BROKEN (for the config/MMIO muxing issue), and put these on
> > pci/host-tango. I can't build or test this, so I probably broke
> > something in the process. I think the combination of the boot-time
> > warning, the taint, and CONFIG_BROKEN is a reasonable amount of
> > warning that a user should expect issues.
> >
> > Can you take a look and see if it works for you?
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-tango
>
> Thanks. I'll take it for a spin ASAP.
>
> TAINT_CRAP... Smirk. I didn't see that one in the docs:
> https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html
>
> Oh wait... TAINT_CRAP is "C" => a staging driver has been loaded

I wish it had a less pejorative, more descriptive name. But it seems like
the closest to this situation.

> The one issue I anticipate with "depends on BROKEN" is
> when I add support for revision 2, which isn't broken.

How about this:

- Rename PCIE_TANGO to PCIE_TANGO_REV1
- PCIE_TANGO_REV1 depends on BROKEN
- Add rev2 support later, enabled by PCIE_TANGO
- PCIE_TANGO_REV1 depends on PCIE_TANGO && BROKEN

I updated pci/host-tango along these lines (without rev2 support,
obviously).

I forgot to ask for a MAINTAINERS update. Can you send that, too,
please?

Which reminds me -- are these two addreses

Marc Gonzalez <[email protected]>
Mason <[email protected]>

different names for the same person? Conversations are easier for me
if I can keep who's who straight :)

Bjorn

2017-07-05 20:39:49

by Mason

[permalink] [raw]
Subject: Re: [PATCH v9 0/3] Tango PCIe controller support

On 05/07/2017 20:03, Bjorn Helgaas wrote:

> On Wed, Jul 05, 2017 at 12:55:37AM +0200, Mason wrote:
>
>> On 04/07/2017 22:24, Bjorn Helgaas wrote:
>>
>>> I made the trivial changes I mentioned, added a dependency on
>>> CONFIG_BROKEN (for the config/MMIO muxing issue), and put these on
>>> pci/host-tango. I can't build or test this, so I probably broke
>>> something in the process. I think the combination of the boot-time
>>> warning, the taint, and CONFIG_BROKEN is a reasonable amount of
>>> warning that a user should expect issues.
>>>
>>> Can you take a look and see if it works for you?
>>>
>>> https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-tango
>>
>> Thanks. I'll take it for a spin ASAP.
>>
>> TAINT_CRAP... Smirk. I didn't see that one in the docs:
>> https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html
>>
>> Oh wait... TAINT_CRAP is "C" => a staging driver has been loaded
>
> I wish it had a less pejorative, more descriptive name. But it seems like
> the closest to this situation.

Maybe it is not too late to submit a patch to Linus
renaming TAINT_CRAP?

Here are a few candidates, off the top of my head:

TAINT_STAGING
TAINT_STAGING_DRIVER
TAINT_BROKEN_HW
TAINT_BROKEN_HARDWARE
TAINT_USE_AT_YOUR_OWN_RISK

>> The one issue I anticipate with "depends on BROKEN" is
>> when I add support for revision 2, which isn't broken.
>
> How about this:
>
> - Rename PCIE_TANGO to PCIE_TANGO_REV1
> - PCIE_TANGO_REV1 depends on BROKEN
> - Add rev2 support later, enabled by PCIE_TANGO
> - PCIE_TANGO_REV1 depends on PCIE_TANGO && BROKEN
>
> I updated pci/host-tango along these lines (without rev2 support,
> obviously).

And support for REV1 wouldn't be compiled in, unless
BROKEN is selected? Yes, I think that could fly.

Don't you think the naming should follow the DT
convention of using the first SoC embedding the
IP (for the compatible string) ?

PCIE_TANGO_REV1 vs PCIE_TANGO_SMP8759

> I forgot to ask for a MAINTAINERS update. Can you send that, too,
> please?

There's a "catch-all" rule for everything tango-related:

ARM/TANGO ARCHITECTURE
M: Marc Gonzalez <[email protected]>
L: [email protected]
S: Maintained
N: tango

Is that enough?

> Which reminds me -- are these two addreses
>
> Marc Gonzalez <[email protected]>
> Mason <[email protected]>
>
> different names for the same person? Conversations are easier for me
> if I can keep who's who straight :)

Well, there are many voices inside my head, but yes,
respectively professional and personal addresses.

Regards.

2017-07-05 21:34:24

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v9 0/3] Tango PCIe controller support

On Wed, Jul 05, 2017 at 10:39:19PM +0200, Mason wrote:
> On 05/07/2017 20:03, Bjorn Helgaas wrote:
>
> > On Wed, Jul 05, 2017 at 12:55:37AM +0200, Mason wrote:
> >
> >> On 04/07/2017 22:24, Bjorn Helgaas wrote:
> >>
> >>> I made the trivial changes I mentioned, added a dependency on
> >>> CONFIG_BROKEN (for the config/MMIO muxing issue), and put these on
> >>> pci/host-tango. I can't build or test this, so I probably broke
> >>> something in the process. I think the combination of the boot-time
> >>> warning, the taint, and CONFIG_BROKEN is a reasonable amount of
> >>> warning that a user should expect issues.
> >>>
> >>> Can you take a look and see if it works for you?
> >>>
> >>> https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-tango
> >>
> >> Thanks. I'll take it for a spin ASAP.
> >>
> >> TAINT_CRAP... Smirk. I didn't see that one in the docs:
> >> https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html
> >>
> >> Oh wait... TAINT_CRAP is "C" => a staging driver has been loaded
> >
> > I wish it had a less pejorative, more descriptive name. But it seems like
> > the closest to this situation.
>
> Maybe it is not too late to submit a patch to Linus
> renaming TAINT_CRAP?
>
> Here are a few candidates, off the top of my head:
>
> TAINT_STAGING
> TAINT_STAGING_DRIVER
> TAINT_BROKEN_HW
> TAINT_BROKEN_HARDWARE
> TAINT_USE_AT_YOUR_OWN_RISK

I personally wouldn't object, but it's not a PCI thing so that can all
be separate from this driver.

> >> The one issue I anticipate with "depends on BROKEN" is
> >> when I add support for revision 2, which isn't broken.
> >
> > How about this:
> >
> > - Rename PCIE_TANGO to PCIE_TANGO_REV1
> > - PCIE_TANGO_REV1 depends on BROKEN
> > - Add rev2 support later, enabled by PCIE_TANGO
> > - PCIE_TANGO_REV1 depends on PCIE_TANGO && BROKEN
> >
> > I updated pci/host-tango along these lines (without rev2 support,
> > obviously).
>
> And support for REV1 wouldn't be compiled in, unless
> BROKEN is selected? Yes, I think that could fly.

Right.

> Don't you think the naming should follow the DT
> convention of using the first SoC embedding the
> IP (for the compatible string) ?
>
> PCIE_TANGO_REV1 vs PCIE_TANGO_SMP8759

Sounds reasonable. So v2 will be something other than SMP8759?
I renamed it to CONFIG_PCIE_TANGO_SMP8759.

> > I forgot to ask for a MAINTAINERS update. Can you send that, too,
> > please?
>
> There's a "catch-all" rule for everything tango-related:
>
> ARM/TANGO ARCHITECTURE
> M: Marc Gonzalez <[email protected]>
> L: [email protected]
> S: Maintained
> N: tango
>
> Is that enough?

Yep, sorry I didn't notice that. That's enough for
scripts/get_maintainer.pl to work, which is what I'm looking for.

If you confirm that
https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/host-tango&id=d752a8b29345
works for you, I'll include it in my v4.13 pull request.

Bjorn

2017-07-05 22:00:02

by Mason

[permalink] [raw]
Subject: Re: [PATCH v9 0/3] Tango PCIe controller support

On 05/07/2017 23:34, Bjorn Helgaas wrote:

> On Wed, Jul 05, 2017 at 10:39:19PM +0200, Mason wrote:
>
>> On 05/07/2017 20:03, Bjorn Helgaas wrote:
>>
>>> On Wed, Jul 05, 2017 at 12:55:37AM +0200, Mason wrote:
>>>
>>>> On 04/07/2017 22:24, Bjorn Helgaas wrote:
>>>>
>>>>> I made the trivial changes I mentioned, added a dependency on
>>>>> CONFIG_BROKEN (for the config/MMIO muxing issue), and put these on
>>>>> pci/host-tango. I can't build or test this, so I probably broke
>>>>> something in the process. I think the combination of the boot-time
>>>>> warning, the taint, and CONFIG_BROKEN is a reasonable amount of
>>>>> warning that a user should expect issues.
>>>>>
>>>>> Can you take a look and see if it works for you?
>>>>>
>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/log/?h=pci/host-tango
>>>>
>>>> Thanks. I'll take it for a spin ASAP.
>>>>
>>>> TAINT_CRAP... Smirk. I didn't see that one in the docs:
>>>> https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html
>>>>
>>>> Oh wait... TAINT_CRAP is "C" => a staging driver has been loaded
>>>
>>> I wish it had a less pejorative, more descriptive name. But it seems like
>>> the closest to this situation.
>>
>> Maybe it is not too late to submit a patch to Linus
>> renaming TAINT_CRAP?
>>
>> Here are a few candidates, off the top of my head:
>>
>> TAINT_STAGING
>> TAINT_STAGING_DRIVER
>> TAINT_BROKEN_HW
>> TAINT_BROKEN_HARDWARE
>> TAINT_USE_AT_YOUR_OWN_RISK
>
> I personally wouldn't object, but it's not a PCI thing so that can all
> be separate from this driver.

Yes, of course. I was just asking for your (and anyone's)
opinion, as a Linux dev.

>>>> The one issue I anticipate with "depends on BROKEN" is
>>>> when I add support for revision 2, which isn't broken.
>>>
>>> How about this:
>>>
>>> - Rename PCIE_TANGO to PCIE_TANGO_REV1
>>> - PCIE_TANGO_REV1 depends on BROKEN
>>> - Add rev2 support later, enabled by PCIE_TANGO
>>> - PCIE_TANGO_REV1 depends on PCIE_TANGO && BROKEN
>>>
>>> I updated pci/host-tango along these lines (without rev2 support,
>>> obviously).
>>
>> And support for REV1 wouldn't be compiled in, unless
>> BROKEN is selected? Yes, I think that could fly.
>
> Right.
>
>> Don't you think the naming should follow the DT
>> convention of using the first SoC embedding the
>> IP (for the compatible string) ?
>>
>> PCIE_TANGO_REV1 vs PCIE_TANGO_SMP8759
>
> Sounds reasonable. So v2 will be something other than SMP8759?
> I renamed it to CONFIG_PCIE_TANGO_SMP8759.

Right, HW bugs are fixed in newer chips. Old chips rarely
get bug fixes, apparently.

> If you confirm that
> https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/host-tango&id=d752a8b29345
> works for you, I'll include it in my v4.13 pull request.

There were a few nits I wanted to address:

- Since we added suppress_bind_attrs = true, probe()
can only be called at init, so I wanted to mark __init
all the probe functions, to save space.

- I left the definition of MSI_MAX in the wrong patch

- You put a pointer to the pdev in the struct tango_pcie.
I think this is redundant, since the pdev already has a
pointer to the struct, as drvdata.
So I wanted to change tango_msi_probe() to take a pdev
as argument (to make it more like an actual probe function)
and derive pcie from pdev, instead of the other way around.

Can I send you a patch series with these changes on Friday?

Regards.

2017-07-06 03:39:50

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v9 0/3] Tango PCIe controller support

On Wed, Jul 05, 2017 at 11:59:33PM +0200, Mason wrote:
> On 05/07/2017 23:34, Bjorn Helgaas wrote:
>
> > On Wed, Jul 05, 2017 at 10:39:19PM +0200, Mason wrote:
> >
> >> On 05/07/2017 20:03, Bjorn Helgaas wrote:

> > If you confirm that
> > https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git/commit/?h=pci/host-tango&id=d752a8b29345
> > works for you, I'll include it in my v4.13 pull request.
>
> There were a few nits I wanted to address:
>
> - Since we added suppress_bind_attrs = true, probe()
> can only be called at init, so I wanted to mark __init
> all the probe functions, to save space.
>
> - I left the definition of MSI_MAX in the wrong patch
>
> - You put a pointer to the pdev in the struct tango_pcie.
> I think this is redundant, since the pdev already has a
> pointer to the struct, as drvdata.
> So I wanted to change tango_msi_probe() to take a pdev
> as argument (to make it more like an actual probe function)
> and derive pcie from pdev, instead of the other way around.

I don't think tango_msi_probe() is really a "probe" function. It's
all part of the tango driver, and it's not claiming a separate piece
of hardware. So I would keep the name and structure similar to these:

advk_pcie_init_msi_irq_domain()
nwl_pcie_init_msi_irq_domain()

BTW, those functions use irq_domain_add_linear(), while you are one of
the very few callers of irq_domain_create_linear(). Why the difference?
If your code does basically the same thing, it's very helpful to me if
it *looks* basically the same.

> Can I send you a patch series with these changes on Friday?

I was planning to ask Linus to pull my branch tomorrow or Friday
because I'm going on vacation next week and I don't want to leave
right after he pulls it. So the sooner the better.

Bjorn

2017-07-06 12:27:25

by Mason

[permalink] [raw]
Subject: Re: [PATCH v9 0/3] Tango PCIe controller support

On 06/07/2017 05:39, Bjorn Helgaas wrote:

> On Wed, Jul 05, 2017 at 11:59:33PM +0200, Mason wrote:
>
>> There were a few nits I wanted to address:
>>
>> - Since we added suppress_bind_attrs = true, probe()
>> can only be called at init, so I wanted to mark __init
>> all the probe functions, to save space.
>>
>> - I left the definition of MSI_MAX in the wrong patch
>>
>> - You put a pointer to the pdev in the struct tango_pcie.
>> I think this is redundant, since the pdev already has a
>> pointer to the struct, as drvdata.
>> So I wanted to change tango_msi_probe() to take a pdev
>> as argument (to make it more like an actual probe function)
>> and derive pcie from pdev, instead of the other way around.
>
> I don't think tango_msi_probe() is really a "probe" function. It's
> all part of the tango driver, and it's not claiming a separate piece
> of hardware.

I agree that tango_msi_probe() is not a probe function;
it is merely a piece of the actual probe function (static
with single call site). I split the probe function in two,
because it seemed to make sense at the time.

Perhaps it's better to inline tango_msi_probe? That would
avoid the issues of that function's name and parameters.

If you think it's better to keep the two pieces separate,
I can rename the MSI part to tango_msi_init() or some such.
But I'd like to avoid adding unnecessary fields to the struct.

> So I would keep the name and structure similar to these:
>
> advk_pcie_init_msi_irq_domain()
> nwl_pcie_init_msi_irq_domain()
>
> BTW, those functions use irq_domain_add_linear(), while you are one of
> the very few callers of irq_domain_create_linear(). Why the difference?
> If your code does basically the same thing, it's very helpful to me if
> it *looks* basically the same.

It was a suggestion from Marc Z on 2017-03-23.

<QUOTE>
+ irq_dom = irq_domain_add_linear(NULL, MSI_COUNT, &msi_domain_ops, pcie);

Use irq_domain_create_linear, pass the same fwnode.
</QUOTE>

It seems odd to pass NULL as the first argument.
(As I had first done, when copying the Altera driver.)

>> Can I send you a patch series with these changes on Friday?
>
> I was planning to ask Linus to pull my branch tomorrow or Friday
> because I'm going on vacation next week and I don't want to leave
> right after he pulls it. So the sooner the better.

I'm not at the office today, but I'll do it first thing
tomorrow. If it works out, great. If I'm too late, well
there's 4.14 to look forward to.

Regards.

2017-07-06 12:40:42

by Marc Zyngier

[permalink] [raw]
Subject: Re: [PATCH v9 0/3] Tango PCIe controller support

On 06/07/17 13:26, Mason wrote:
> On 06/07/2017 05:39, Bjorn Helgaas wrote:
>
>> On Wed, Jul 05, 2017 at 11:59:33PM +0200, Mason wrote:
>>
>>> There were a few nits I wanted to address:
>>>
>>> - Since we added suppress_bind_attrs = true, probe()
>>> can only be called at init, so I wanted to mark __init
>>> all the probe functions, to save space.
>>>
>>> - I left the definition of MSI_MAX in the wrong patch
>>>
>>> - You put a pointer to the pdev in the struct tango_pcie.
>>> I think this is redundant, since the pdev already has a
>>> pointer to the struct, as drvdata.
>>> So I wanted to change tango_msi_probe() to take a pdev
>>> as argument (to make it more like an actual probe function)
>>> and derive pcie from pdev, instead of the other way around.
>>
>> I don't think tango_msi_probe() is really a "probe" function. It's
>> all part of the tango driver, and it's not claiming a separate piece
>> of hardware.
>
> I agree that tango_msi_probe() is not a probe function;
> it is merely a piece of the actual probe function (static
> with single call site). I split the probe function in two,
> because it seemed to make sense at the time.
>
> Perhaps it's better to inline tango_msi_probe? That would
> avoid the issues of that function's name and parameters.
>
> If you think it's better to keep the two pieces separate,
> I can rename the MSI part to tango_msi_init() or some such.
> But I'd like to avoid adding unnecessary fields to the struct.
>
>> So I would keep the name and structure similar to these:
>>
>> advk_pcie_init_msi_irq_domain()
>> nwl_pcie_init_msi_irq_domain()
>>
>> BTW, those functions use irq_domain_add_linear(), while you are one of
>> the very few callers of irq_domain_create_linear(). Why the difference?
>> If your code does basically the same thing, it's very helpful to me if
>> it *looks* basically the same.

irq_domain_add_linear() can only take an of_node as the identifier for
the domain, while the _create_ variants use a fwnode. Given that an
of+node is also a fwnode, the former is now deprecated in favour of the
latter.

>
> It was a suggestion from Marc Z on 2017-03-23.
>
> <QUOTE>
> + irq_dom = irq_domain_add_linear(NULL, MSI_COUNT, &msi_domain_ops, pcie);
>
> Use irq_domain_create_linear, pass the same fwnode.
> </QUOTE>
>
> It seems odd to pass NULL as the first argument.
> (As I had first done, when copying the Altera driver.)

Indeed, as it creates a "default" domain, which is almost always wrong.

Thanks,

M.
--
Jazz is not dead. It just smells funny...

2017-07-06 19:46:32

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH v9 0/3] Tango PCIe controller support

On Thu, Jul 06, 2017 at 02:26:44PM +0200, Mason wrote:
> On 06/07/2017 05:39, Bjorn Helgaas wrote:
>
> > On Wed, Jul 05, 2017 at 11:59:33PM +0200, Mason wrote:
> >
> >> There were a few nits I wanted to address:
> >>
> >> - Since we added suppress_bind_attrs = true, probe()
> >> can only be called at init, so I wanted to mark __init
> >> all the probe functions, to save space.
> >>
> >> - I left the definition of MSI_MAX in the wrong patch

I moved this.

> >> - You put a pointer to the pdev in the struct tango_pcie.
> >> I think this is redundant, since the pdev already has a
> >> pointer to the struct, as drvdata.
> >> So I wanted to change tango_msi_probe() to take a pdev
> >> as argument (to make it more like an actual probe function)
> >> and derive pcie from pdev, instead of the other way around.
> >
> > I don't think tango_msi_probe() is really a "probe" function. It's
> > all part of the tango driver, and it's not claiming a separate piece
> > of hardware.
>
> I agree that tango_msi_probe() is not a probe function;
> it is merely a piece of the actual probe function (static
> with single call site). I split the probe function in two,
> because it seemed to make sense at the time.
>
> Perhaps it's better to inline tango_msi_probe? That would
> avoid the issues of that function's name and parameters.
>
> If you think it's better to keep the two pieces separate,
> I can rename the MSI part to tango_msi_init() or some such.
> But I'd like to avoid adding unnecessary fields to the struct.

I think it's better to follow the structure of existing drivers unless
your hardware dictates a different model. Same with adding fields to
the struct. If you have a better way of doing it that works for all
the drivers, great -- but please change all the drivers to do it that
way. If it's a matter of saving one pointer per system, by making the
code look different than other drivers, that's not so great.

> > So I would keep the name and structure similar to these:
> >
> > advk_pcie_init_msi_irq_domain()
> > nwl_pcie_init_msi_irq_domain()
> >
> > BTW, those functions use irq_domain_add_linear(), while you are one of
> > the very few callers of irq_domain_create_linear(). Why the difference?
> > If your code does basically the same thing, it's very helpful to me if
> > it *looks* basically the same.
>
> It was a suggestion from Marc Z on 2017-03-23.
>
> <QUOTE>
> + irq_dom = irq_domain_add_linear(NULL, MSI_COUNT, &msi_domain_ops, pcie);
>
> Use irq_domain_create_linear, pass the same fwnode.
> </QUOTE>
>
> It seems odd to pass NULL as the first argument.
> (As I had first done, when copying the Altera driver.)

I'm a little queasy about the MSI stuff. It doesn't feel very settled
yet, and I don't want to keep tweaking it at this stage.

How about we merge the base patch for v4.13 and deal with MSIs for
v4.14? I need confirmation that the base patch works ASAP. Or if
it's not really useful by itself, we can defer it all until v4.14.

For v4.14, I'd really like to see some unification of naming and
structure across the drivers in how they handle IRQ domains, and
then have tango follow whatever pattern that ends up being.

Right now we don't have much consistency in the names of legacy and
MSI IRQ domains, what device_node they're associated with, how we
handle the 0-3 vs 1-4 legacy numbering, pci_msi_create_irq_domain()
usage, etc. Some of this may be dictated by different hardware
requirements, but I doubt all of it is.

Bjorn


P.S. Notes about current IRQ domain usage below, just for reference
about where I'm seeing inconsistencies.

advk_pcie_probe # "marvell,armada-3700-pcie"
advk_pcie_init_irq_domain
pcie_intc_node = of_get_next_child(node, NULL)
irq_domain_add_linear(pcie_intc_node, ...)
advk_pcie_init_msi_irq_domain
pcie->msi_inner_domain = irq_domain_add_linear(NULL, ...)
pcie->msi_domain = pci_msi_create_irq_domain(...)

altera_pcie_probe # "altr,pcie-root-port-1.0"
altera_pcie_init_irq_domain
pcie->irq_domain = irq_domain_add_linear(node, ...)
altera_msi_probe # "altr,msi-1.0"
altera_allocate_domains
msi->inner_domain = irq_domain_add_linear(NULL, ...)
msi->msi_domain = pci_msi_create_irq_domain(fwnode, ...)

iproc_pcie_pltfm_probe # "brcm,iproc-pcie", etc
iproc_pcie_setup
iproc_pcie_msi_enable
iproc_msi_init
iproc_msi_alloc_domains
msi->inner_domain = irq_domain_add_linear(NULL, ...)
msi->msi_domain = pci_msi_create_irq_domain(...)

rcar_pcie_probe # "renesas,pcie-r8a7779", etc
rcar_pcie_enable_msi
msi->domain = irq_domain_add_linear(dev->of_node, ...)

rockchip_pcie_probe # "rockchip,rk3399-pcie"
rockchip_pcie_init_irq_domain
intc = of_get_next_child(dev->of_node, NULL)
rockchip->irq_domain = irq_domain_add_linear(intc, ...)

xilinx_pcie_probe # "xlnx,axi-pcie-host-1.00.a"
xilinx_pcie_init_irq_domain
pcie_intc_node = of_get_next_child(node, NULL)
port->leg_domain = irq_domain_add_linear(pcie_intc_node, ...)
port->msi_domain = irq_domain_add_linear(node, ...)

nwl_pcie_probe # "xlnx,nwl-pcie-2.11"
nwl_pcie_init_irq_domain
legacy_intc_node = of_get_next_child(node, NULL)
pcie->legacy_irq_domain = irq_domain_add_linear(legacy_intc_node, ...)
nwl_pcie_init_msi_irq_domain
msi->dev_domain = irq_domain_add_linear(NULL, ...)
msi->msi_domain = pci_msi_create_irq_domain(fwnode, ...)

faraday_pci_probe # "faraday,ftpci100", etc
faraday_pci_setup_cascaded_irq
intc = of_get_next_child(p->dev->of_node, NULL)
p->irqdomain = irq_domain_add_linear(intc, ...)

hv_pci_probe
hv_pcie_init_irq_domain
hbus->irq_domain = pci_msi_create_irq_domain(...)

tegra_pcie_probe # "nvidia,tegra210-pcie", etc
tegra_pcie_enable_msi
msi->domain = irq_domain_add_linear(dev->of_node, ...)

xgene_pcie_probe_bridge # "apm,xgene-pcie"
xgene_msi_probe # "apm,xgene1-msi"
xgene_allocate_domains
msi->inner_domain = irq_domain_add_linear(NULL, ...)
msi->msi_domain = pci_msi_create_irq_domain(...)

vmd_probe # [8086:201d]
vmd_enable_domain
vmd->irq_domain = pci_msi_create_irq_domain(NULL, ...)

dra7xx_pcie_probe # "ti,dra7-pcie", etc
dra7xx_add_pcie_port
dra7xx_pcie_init_irq_domain
pcie_intc_node = of_get_next_child(node, NULL)
dra7xx->irq_domain = irq_domain_add_linear(pcie_intc_node, ...)

dw_pcie_host_init
pp->ops->msi_host_init
ks_dw_pcie_msi_host_init # .msi_host_init
pp->irq_domain = irq_domain_add_linear(ks_pcie->msi_intc_np, ...)

ks_pcie_probe # "ti,keystone-pcie"
ks_add_pcie_port
ks_dw_pcie_host_init
ks_pcie->legacy_irq_domain = irq_domain_add_linear(ks_pcie->legacy_intc_np, ...)

*_add_pcie_port
dw_pcie_host_init
pp->irq_domain = irq_domain_add_linear(dev->of_node, ...) # generic