linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hao <haokexin@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>
Subject: [PATCH v2 0/3] fix the pci device malfunction if a wrong bus address is assigned by firmware
Date: Sat, 25 May 2013 19:36:24 +0800	[thread overview]
Message-ID: <1369481787-21500-1-git-send-email-haokexin@gmail.com> (raw)

v2:
 * Use the method suggested by Bjorn to check if we have a wrong bus address
   set in the PCI BAR register.
 * Split the "move the pcibios_bus_to_resource() call out of the if/else wrap"
   change into a new patch.
 * A minor new patch is introduced to add 0x prefix for the PCI BAR register
   position.

v1:
On a fsl p2020rdb-pc board, the onboard pci device is assigned the bus address
0xa0000000 by firmware. But the kernel allocate the cpu address 0xa0000000 ~ 0xbfffffff
to this PCIe controller and use 0xe0000000 ~ 0xdfffffff as its bus address.
In this case the kernel would think that the bus address in this pci device
is correct and leave it unchanged. Then causes this device not work.

Even though this looks like a mismatch of the address space between firmware
and kernel. I think we should detect this kind of error and fix it automatically
if we don't want just to probe only (PCI_PROBE_ONLY is not set).

---
Kevin Hao (3):
  PCI: add 0x prefix when printing the BAR registers position in    
    __pci_read_base
  PCI: converge the unnecessary sprinkling of pcibios_bus_to_resource in
        __pci_read_base
  PCI: unset the resource if a wrong bus address is assigned by firmware

 drivers/pci/probe.c | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

-- 
1.8.1.4


             reply	other threads:[~2013-05-25 11:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-25 11:36 Kevin Hao [this message]
2013-05-25 11:36 ` [PATCH 1/3] PCI: add 0x prefix when printing the BAR registers position in __pci_read_base Kevin Hao
2013-05-25 16:30   ` Liu Jiang
2013-05-25 23:47     ` Bjorn Helgaas
2013-05-26  0:16       ` Kevin Hao
2013-05-25 11:36 ` [PATCH 2/3] PCI: converge the unnecessary sprinkling of pcibios_bus_to_resource " Kevin Hao
2013-05-25 11:36 ` [PATCH 3/3] PCI: unset the resource if a wrong bus address is assigned by firmware Kevin Hao
2013-05-25 23:46 ` [PATCH v2 0/3] fix the pci device malfunction " Bjorn Helgaas

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=1369481787-21500-1-git-send-email-haokexin@gmail.com \
    --to=haokexin@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    /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).