public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] pci: Arch hook to determine config space size
@ 2005-01-28 14:56 brking
  2005-01-28 18:52 ` Christoph Hellwig
  0 siblings, 1 reply; 22+ messages in thread
From: brking @ 2005-01-28 14:56 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel, linuxppc64-dev, brking


When working with a PCI-X Mode 2 adapter on a PCI-X Mode 1 PPC64
system, the current code used to determine the config space size
of a device results in a PCI Master abort and an EEH error, resulting
in the device being taken offline. This patch adds the ability for
arch specific code to override part of the config space size
determination to fix this.

Signed-off-by: Brian King <brking@us.ibm.com>
---

 linux-2.6.11-rc2-bk5-bjking1/drivers/pci/probe.c |    4 ++++
 1 files changed, 4 insertions(+)

diff -puN drivers/pci/probe.c~pci_arch_cfg_space_size drivers/pci/probe.c
--- linux-2.6.11-rc2-bk5/drivers/pci/probe.c~pci_arch_cfg_space_size	2005-01-27 16:56:46.000000000 -0600
+++ linux-2.6.11-rc2-bk5-bjking1/drivers/pci/probe.c	2005-01-27 16:56:46.000000000 -0600
@@ -627,6 +627,8 @@ static void pci_release_dev(struct devic
 	kfree(pci_dev);
 }
 
+int __attribute__ ((weak)) pcibios_exp_cfg_space(struct pci_dev *dev) { return 1; }
+
 /**
  * pci_cfg_space_size - get the configuration space size of the PCI device.
  *
@@ -653,6 +655,8 @@ static int pci_cfg_space_size(struct pci
 			goto fail;
 	}
 
+	if (!pcibios_exp_cfg_space(dev))
+		goto fail;
 	if (pci_read_config_dword(dev, 256, &status) != PCIBIOS_SUCCESSFUL)
 		goto fail;
 	if (status == 0xffffffff)
_

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: pci: Arch hook to determine config space size
@ 2005-01-31 23:22 arndb
  0 siblings, 0 replies; 22+ messages in thread
From: arndb @ 2005-01-31 23:22 UTC (permalink / raw)
  To: brking
  Cc: Arnd Bergmann, Matthew Wilcox, Greg KH, Christoph Hellwig,
	linux-kernel, linuxppc64-dev, linux-pci, linux-arch, paulus


Brian King <brking@us.ibm.com> schrieb am 31.01.2005, 23:43:30:

> > Isn't the config space size a property of the PCI device instead of the
> > host bridge? For a PCI device behind a PCIe host bridge, this could
> > still lead to an incorrect config space accesses.
> 
> It is a property of both. Accessing config space beyond the first 256 
> bytes will only work if both the PCI device and the host bridge support 
> it. The problem I ran into was generic pci code issuing a config read to 
> offset 256 after checking that the device supports it when the host 
> bridge did not support it.

If I interpret the spec correctly, the firmware should always store the
value we need in the property for every device node, which means that
you should look at the host bridge config-space-type attribute only
when you want to look at the bridge itself. If the device claims to
support a PCIe config space and the bridge doesn't, that sounds to
me like a firmware bug.

      Arnd <><

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2005-02-03  1:14 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-28 14:56 [PATCH 1/2] pci: Arch hook to determine config space size brking
2005-01-28 18:52 ` Christoph Hellwig
2005-01-29  4:06   ` Greg KH
2005-01-31 19:10     ` Brian King
2005-01-31 19:15       ` Greg KH
2005-01-31 19:29       ` Matthew Wilcox
2005-01-31 20:51         ` Arnd Bergmann
2005-01-31 21:35         ` Brian King
2005-01-31 21:56           ` Arnd Bergmann
2005-01-31 22:13             ` Greg KH
2005-01-31 22:43             ` Brian King
2005-02-01  3:15               ` Benjamin Herrenschmidt
2005-02-01  4:52                 ` Brian King
2005-02-01  4:57                   ` Benjamin Herrenschmidt
2005-02-02 10:05                     ` Arnd Bergmann
2005-02-03  0:23                       ` Benjamin Herrenschmidt
2005-02-01 12:32                   ` Matthew Wilcox
2005-02-01 20:16                     ` Brian King
2005-01-31 19:40       ` Brian King
2005-02-01  7:46         ` Grant Grundler
2005-02-01 15:23           ` Brian King
  -- strict thread matches above, loose matches on Subject: below --
2005-01-31 23:22 arndb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox