linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]PCI:disable resource decode in PCI BAR detection
@ 2007-09-13  6:21 Shaohua Li
  2007-09-13  7:31 ` Matthew Wilcox
  0 siblings, 1 reply; 34+ messages in thread
From: Shaohua Li @ 2007-09-13  6:21 UTC (permalink / raw)
  To: lkml, linux-pci; +Cc: Andrew Morton, Greg KH

http://bugzilla.kernel.org/show_bug.cgi?id=8833
We write 0xffffffff to BARs to detect BAR size, this will change BAR
base to 0xfxxxxxx depends on BAR size. In the bug, PCI MCFG base address
is 0xf4000000. One PCI device (gfx) has a 256M BAR, the detection code
will temprarily change it to 0xf0000000, so conflict with MCFG decode
range. Later memory based config space read/write address is decoded by
both MCH and gfx and cause a hang. This patch disables resource decode
in BAR size detection to avoid resource conflict. 

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
---
 drivers/pci/probe.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux/drivers/pci/probe.c
===================================================================
--- linux.orig/drivers/pci/probe.c	2007-09-12 10:44:19.000000000 +0800
+++ linux/drivers/pci/probe.c	2007-09-13 12:58:18.000000000 +0800
@@ -185,6 +185,11 @@ static void pci_read_bases(struct pci_de
 	unsigned int pos, reg, next;
 	u32 l, sz;
 	struct resource *res;
+	u16 command;
+
+	pci_read_config_word(dev, PCI_COMMAND, &command);
+	pci_write_config_word(dev, PCI_COMMAND,
+		command & (~(PCI_COMMAND_MEMORY|PCI_COMMAND_IO)));
 
 	for(pos=0; pos<howmany; pos = next) {
 		u64 l64;
@@ -283,6 +288,7 @@ static void pci_read_bases(struct pci_de
 			}
 		}
 	}
+	pci_write_config_word(dev, PCI_COMMAND, command);
 }
 
 void pci_read_bridge_bases(struct pci_bus *child)

^ permalink raw reply	[flat|nested] 34+ messages in thread
[parent not found: <fa.ggBqx6W3i6hfs6jdfg64oXKSxW8@ifi.uio.no>]
[parent not found: <fa.+WRenB38novq157RnGPLoU4q2XI@ifi.uio.no>]

end of thread, other threads:[~2007-09-27  2:14 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-13  6:21 [PATCH]PCI:disable resource decode in PCI BAR detection Shaohua Li
2007-09-13  7:31 ` Matthew Wilcox
2007-09-13  7:24   ` Shaohua Li
2007-09-13  7:55     ` Matthew Wilcox
2007-09-13  9:53       ` Greg KH
2007-09-13 11:16         ` Ivan Kokshaysky
2007-09-13 12:00           ` Greg KH
2007-09-16 20:01           ` Benjamin Herrenschmidt
2007-09-17 10:22             ` Ivan Kokshaysky
2007-09-17 20:30               ` Benjamin Herrenschmidt
2007-09-18  9:54                 ` Ivan Kokshaysky
     [not found] <fa.ggBqx6W3i6hfs6jdfg64oXKSxW8@ifi.uio.no>
     [not found] ` <fa.o5cJ0O7pLVWRzUiVPDEZL6nKqA8@ifi.uio.no>
     [not found]   ` <fa.tyYt4GOpTOmJTUbzsxpiCAObJPQ@ifi.uio.no>
     [not found]     ` <fa.13eJumylqINOxOaoEj9cthw0d0M@ifi.uio.no>
     [not found]       ` <fa.tAIuIM02CoL+ixB11n9Fmcqyz9M@ifi.uio.no>
     [not found]         ` <fa.pxFYhTaUz2NVN7Vux7b5xVRrKTw@ifi.uio.no>
2007-09-14  3:32           ` Robert Hancock
2007-09-14 11:14             ` Ivan Kokshaysky
2007-09-14 11:33               ` Ivan Kokshaysky
2007-09-14 14:30               ` Robert Hancock
2007-09-14 15:29                 ` Ivan Kokshaysky
2007-09-14 23:53                   ` Robert Hancock
2007-09-15  5:55                     ` Yinghai Lu
2007-09-16 11:13                     ` Ivan Kokshaysky
2007-09-16 17:34                       ` Robert Hancock
2007-09-17  9:20                         ` Ivan Kokshaysky
2007-09-16 19:52                       ` Matthew Wilcox
2007-09-17  9:31                         ` Ivan Kokshaysky
2007-09-17 14:30                           ` Robert Hancock
2007-09-17  1:21                       ` Shaohua Li
2007-09-18  9:53                         ` Ivan Kokshaysky
2007-09-19 21:34                           ` Jesse Barnes
2007-09-16 20:06             ` Benjamin Herrenschmidt
2007-09-16 23:37               ` Robert Hancock
2007-09-17  0:21                 ` Benjamin Herrenschmidt
     [not found]           ` <fa.0Edi0qLTdvqVnuoDAebaTVz1jEM@ifi.uio.no>
     [not found]             ` <fa.sq+NimBnzGB2syLmvcIGOvDkixI@ifi.uio.no>
     [not found]               ` <fa.G9DPndNUxuPi5LrUTOL4uPFshnc@ifi.uio.no>
2007-09-26 23:01                 ` Robert Hancock
2007-09-27  0:40                   ` Benjamin Herrenschmidt
2007-09-27  2:14                     ` Matthew Wilcox
     [not found] <fa.+WRenB38novq157RnGPLoU4q2XI@ifi.uio.no>
     [not found] ` <fa.mM7Va6Nlsaduo/AF4MkeurSBTbs@ifi.uio.no>
     [not found]   ` <fa.Ff0IMhMYWp7NYEdjO0AftHzVOh4@ifi.uio.no>
     [not found]     ` <fa.d9zBdhHd9gKcJbtwrYguusbECo4@ifi.uio.no>
     [not found]       ` <fa.TLO57rS9iV7zhomQxJbV9gjbxx8@ifi.uio.no>
     [not found]         ` <fa.lPg6OSzX+f6jdXK1ZF0rlIhZok4@ifi.uio.no>
2007-09-15 20:24           ` Robert Hancock

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).