linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: linux-kernel@lists.codethink.co.uk
Cc: Ben Dooks <ben.dooks@codethink.co.uk>,
	Valentine Barshak <valentine.barshak@cogentembedded.com>,
	Simon Horman <horms@verge.net.au>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, linux-sh@vger.kernel.org
Subject: [PATCH 3/3] PCI: rcar: fix bridge logic abort
Date: Tue, 28 Jan 2014 09:47:48 +0000	[thread overview]
Message-ID: <1390902468-7753-4-git-send-email-ben.dooks@codethink.co.uk> (raw)
In-Reply-To: <1390902468-7753-1-git-send-email-ben.dooks@codethink.co.uk>

The bridge logic at slot 0 only supports reads up to 0x40 and the
rest of the PCI configuration space for this slot is marked as
reserved in the manual.

Trying a read from offset 0x100 is producing an error from the
bridge. With error interrupts enabled, the following is printed:

pci-rcar-gen2 ee0d0000.pci: error irq: status 00000014

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Valentine Barshak <valentine.barshak@cogentembedded.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
---
 drivers/pci/host/pci-rcar-gen2.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
index 01ba069..17ad857 100644
--- a/drivers/pci/host/pci-rcar-gen2.c
+++ b/drivers/pci/host/pci-rcar-gen2.c
@@ -119,6 +119,10 @@ static void __iomem *rcar_pci_cfg_base(struct pci_bus *bus, unsigned int devfn,
 	if (slot > 2)
 		return NULL;
 
+	/* bridge logic only has registers to 0x40 */
+	if (slot == 0x0 && where >= 0x40)
+		return NULL;
+
 	val = slot ? RCAR_AHBPCI_WIN1_DEVICE | RCAR_AHBPCI_WIN_CTR_CFG :
 		     RCAR_AHBPCI_WIN1_HOST | RCAR_AHBPCI_WIN_CTR_CFG;
 
@@ -134,6 +138,8 @@ static int rcar_pci_read_config(struct pci_bus *bus, unsigned int devfn,
 	if (!reg)
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
+	dev_info(&bus->dev, "fn %08x, read %08x, size %d\n", devfn, where, size);
+
 	switch (size) {
 	case 1:
 		*val = ioread8(reg);
@@ -157,6 +163,8 @@ static int rcar_pci_write_config(struct pci_bus *bus, unsigned int devfn,
 	if (!reg)
 		return PCIBIOS_DEVICE_NOT_FOUND;
 
+	dev_info(&bus->dev, "devfn %08x: write %08x to %08x, size %d\n", devfn, val, where, size);
+
 	switch (size) {
 	case 1:
 		iowrite8(val, reg);
-- 
1.8.5.2


  parent reply	other threads:[~2014-01-28  9:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1390902468-7753-1-git-send-email-ben.dooks@codethink.co.uk>
2014-01-28  9:47 ` [PATCH 1/3] PCI: rcar: check platform_get_irq() return code Ben Dooks
2014-01-28 16:11   ` Sergei Shtylyov
2014-01-28 15:34     ` Ben Dooks
2014-01-28  9:47 ` [PATCH 2/3] PCI: rcar: add error interrupt handling Ben Dooks
2014-02-05  8:50   ` Magnus Damm
2014-02-05  9:31     ` Ben Dooks
2014-02-05  9:40   ` Andrew Murray
2014-01-28  9:47 ` Ben Dooks [this message]
2014-01-28  9:50   ` [PATCH 3/3] PCI: rcar: fix bridge logic abort Ben Dooks

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=1390902468-7753-4-git-send-email-ben.dooks@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=bhelgaas@google.com \
    --cc=horms@verge.net.au \
    --cc=linux-kernel@lists.codethink.co.uk \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=valentine.barshak@cogentembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).