All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: "Luís Mendes" <luis.p.mendes@gmail.com>
Cc: Linux PCI <linux-pci@vger.kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Subject: Re: Regression with commit PCI: mvebu: Convert to PCI emulated bridge config space
Date: Tue, 8 Jan 2019 11:48:17 +0100	[thread overview]
Message-ID: <20190108114817.2bb15d5e@windsurf> (raw)
In-Reply-To: <CAEzXK1qKXikS4qd1q_kw7r-_ykBgYnKQzGFhV4TT_HXhq2v6Tw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

Hello Luis,

Sorry for the long delay, the Christmas/New Year vacation and some
personal issues got in the way.

On Tue, 18 Dec 2018 23:13:59 +0000, Luís Mendes wrote:

> The complete lspci outputs follow in attachments.
> 
> In the working case, region 5, is at e0200000 with size 256k and is
> immediately followed by the expansion rom at  e0240000 [disabled]
> [size=128K], however in the non-working case,
> region 5 has a completely different address, and regions are not contiguous.
> Another difference is at:
> Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
>         Address: 00000000f1020a04  Data: 0f12
> 
> vs
> 
>     Capabilities: [a0] MSI: Enable- Count=1/1 Maskable- 64bit+
>         Address: 0000000000000000  Data: 0000
> 
> So it looks like MSI is not being enabled with the new PCI management
> code and looks like the PCI rom maybe mapped to an invalid memory
> address, causing the ioremap to fail.

Could you apply the patches attached (one is meant to be used with 4.20
as-is, and the other meant to be used with 4.20 +
1f08673eef1236f7d02d93fcf596bb8531ef0d12 reverted), and post the
complete boot logs ?

You will most likely have to increase CONFIG_LOG_BUF_SHIFT to avoid
having dropped messages, as my additional debug messages are quite
verbose. I'm using CONFIG_LOG_BUF_SHIFT=16.

Having these boot lots will help me investigate the issue.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: 0001-PCI-mvebu-add-debug.patch --]
[-- Type: text/x-patch, Size: 2011 bytes --]

From 2bd51f2891150b524f73e58c55da5fe68a7d1457 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Tue, 8 Jan 2019 10:59:19 +0100
Subject: [PATCH] PCI: mvebu: add debug

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 drivers/pci/controller/pci-mvebu.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c
index fa0fc46edb0c..9715ba070263 100644
--- a/drivers/pci/controller/pci-mvebu.c
+++ b/drivers/pci/controller/pci-mvebu.c
@@ -624,9 +624,13 @@ static int mvebu_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
 	/* Access the emulated PCI-to-PCI bridge */
-	if (bus->number == 0)
+	if (bus->number == 0) {
+		dev_info(&pcie->pdev->dev,
+			 "%s: devfn=0x%x, where=0x%x, size=%d, val=0x%x\n",
+			 __func__, devfn, where, size, val);
 		return pci_bridge_emul_conf_write(&port->bridge, where,
 						  size, val);
+	}
 
 	if (!mvebu_pcie_link_up(port))
 		return PCIBIOS_DEVICE_NOT_FOUND;
@@ -653,9 +657,14 @@ static int mvebu_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
 	}
 
 	/* Access the emulated PCI-to-PCI bridge */
-	if (bus->number == 0)
-		return pci_bridge_emul_conf_read(&port->bridge, where,
-						 size, val);
+	if (bus->number == 0) {
+		ret = pci_bridge_emul_conf_read(&port->bridge, where,
+						size, val);
+		dev_info(&pcie->pdev->dev,
+			 "%s: devfn=0x%x, where=0x%x, size=%d, val=0x%x\n",
+			 __func__, devfn, where, size, *val);
+		return ret;
+	}
 
 	if (!mvebu_pcie_link_up(port)) {
 		*val = 0xffffffff;
@@ -986,6 +995,8 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie)
 	/* Get the PCIe IO aperture */
 	mvebu_mbus_get_pcie_io_aperture(&pcie->io);
 
+	dev_info(dev, "MEM: %pR, IO: %pR\n", &pcie->mem, &pcie->io);
+
 	if (resource_size(&pcie->io) != 0) {
 		pcie->realio.flags = pcie->io.flags;
 		pcie->realio.start = PCIBIOS_MIN_IO;
-- 
2.20.1


[-- Attachment #3: 0001-PCI-mvebu-add-debug-after-revert.patch --]
[-- Type: text/x-patch, Size: 1957 bytes --]

From ac0aa231c23390150dddfdf923400af2a4a4e86b Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Tue, 8 Jan 2019 10:59:19 +0100
Subject: [PATCH] PCI: mvebu: add debug

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 drivers/pci/controller/pci-mvebu.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c
index dacad51f19e7..94aa7e42c5e2 100644
--- a/drivers/pci/controller/pci-mvebu.c
+++ b/drivers/pci/controller/pci-mvebu.c
@@ -796,8 +796,12 @@ static int mvebu_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
 	/* Access the emulated PCI-to-PCI bridge */
-	if (bus->number == 0)
+	if (bus->number == 0) {
+		dev_info(&pcie->pdev->dev,
+			 "%s: devfn=0x%x, where=0x%x, size=%d, val=0x%x\n",
+			 __func__, devfn, where, size, val);
 		return mvebu_sw_pci_bridge_write(port, where, size, val);
+	}
 
 	if (!mvebu_pcie_link_up(port))
 		return PCIBIOS_DEVICE_NOT_FOUND;
@@ -824,8 +828,13 @@ static int mvebu_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
 	}
 
 	/* Access the emulated PCI-to-PCI bridge */
-	if (bus->number == 0)
-		return mvebu_sw_pci_bridge_read(port, where, size, val);
+	if (bus->number == 0) {
+		ret = mvebu_sw_pci_bridge_read(port, where, size, val);
+		dev_info(&pcie->pdev->dev,
+			 "%s: devfn=0x%x, where=0x%x, size=%d, val=0x%x\n",
+			 __func__, devfn, where, size, *val);
+		return ret;
+	}
 
 	if (!mvebu_pcie_link_up(port)) {
 		*val = 0xffffffff;
@@ -1156,6 +1165,8 @@ static int mvebu_pcie_parse_request_resources(struct mvebu_pcie *pcie)
 	/* Get the PCIe IO aperture */
 	mvebu_mbus_get_pcie_io_aperture(&pcie->io);
 
+	dev_info(dev, "MEM: %pR, IO: %pR\n", &pcie->mem, &pcie->io);
+
 	if (resource_size(&pcie->io) != 0) {
 		pcie->realio.flags = pcie->io.flags;
 		pcie->realio.start = PCIBIOS_MIN_IO;
-- 
2.20.1


  reply	other threads:[~2019-01-08 10:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAEzXK1o9L-bVRGBpAo+a_wYqXZh6_zuebF221Bd8=b-DTL1Q9g@mail.gmail.com>
     [not found] ` <CAEzXK1po4ik1oHdwVvVMWEqh8KMdAMY7sxv9OR2bYs54qV6EyA@mail.gmail.com>
2018-12-18 13:42   ` Fwd: Regression with commit PCI: mvebu: Convert to PCI emulated bridge config space Luís Mendes
2018-12-18 13:47 ` Thomas Petazzoni
2018-12-18 14:34   ` Thomas Petazzoni
2018-12-18 15:42     ` Luís Mendes
2018-12-18 20:37       ` Thomas Petazzoni
2018-12-18 23:13         ` Luís Mendes
2019-01-08 10:48           ` Thomas Petazzoni [this message]
     [not found]             ` <CAEzXK1oQd1YNZ5pyNXA76h-3CbBRxmTke=Z-SRusyfqL=Wd8eA@mail.gmail.com>
2019-01-09  8:15               ` Thomas Petazzoni
     [not found]                 ` <CAEzXK1oHqOb3pojfX7JqrirxjOFj=UZZfi6tNNO4y6yC3u9LAA@mail.gmail.com>
2019-02-04 11:09                   ` Luís Mendes
2019-02-12 13:41                     ` Thomas Petazzoni
2019-02-13 11:34                       ` Luís Mendes
2019-02-13 12:33                         ` Thomas Petazzoni
2019-02-13 13:24                           ` Luís Mendes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190108114817.2bb15d5e@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=luis.p.mendes@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.