public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2.6.13-rc2] yet another fix for setup-bus.c/x86 merge
@ 2005-07-06 23:07 Ivan Kokshaysky
  2005-07-06 23:13 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Kokshaysky @ 2005-07-06 23:07 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Greg KH, Rafael J. Wysocki, linux-kernel

There is a slight disagreement between setup-bus.c code and traditional
x86 PCI setup wrt which recourses are invalid vs resources that are
free for further allocations.
Precisely, in the setup-bus.c, if we failed to allocate some resource,
we nullify "start" and "flags" fields, but *not* the "end" one.
But x86 pcibios_enable_resources() does the following check:
if (!r->start && r->end) {
	printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
	return -EINVAL;
which means that the device owning the offending resource cannot be
enabled.
In particular, this breaks cardbus behind the normal decode p2p bridge -
the cardbus code from setup-bus.c requests rather large IO and MEM windows,
and if it fails, the socket is completely unavailable. Which is wrong, as
the yenta code is capable to allocate smaller windows.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>

--- 2.6.13-rc2/drivers/pci/setup-bus.c	Thu Jul  7 01:30:58 2005
+++ linux/drivers/pci/setup-bus.c	Thu Jul  7 01:32:43 2005
@@ -74,6 +74,7 @@ pbus_assign_resources_sorted(struct pci_
 		idx = res - &list->dev->resource[0];
 		if (pci_assign_resource(list->dev, idx)) {
 			res->start = 0;
+			res->end = 0;
 			res->flags = 0;
 		}
 		tmp = list;

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

* Re: [patch 2.6.13-rc2] yet another fix for setup-bus.c/x86 merge
  2005-07-06 23:07 [patch 2.6.13-rc2] yet another fix for setup-bus.c/x86 merge Ivan Kokshaysky
@ 2005-07-06 23:13 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2005-07-06 23:13 UTC (permalink / raw)
  To: Ivan Kokshaysky; +Cc: Linus Torvalds, Rafael J. Wysocki, linux-kernel

On Thu, Jul 07, 2005 at 03:07:56AM +0400, Ivan Kokshaysky wrote:
> There is a slight disagreement between setup-bus.c code and traditional
> x86 PCI setup wrt which recourses are invalid vs resources that are
> free for further allocations.
> Precisely, in the setup-bus.c, if we failed to allocate some resource,
> we nullify "start" and "flags" fields, but *not* the "end" one.
> But x86 pcibios_enable_resources() does the following check:
> if (!r->start && r->end) {
> 	printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
> 	return -EINVAL;
> which means that the device owning the offending resource cannot be
> enabled.
> In particular, this breaks cardbus behind the normal decode p2p bridge -
> the cardbus code from setup-bus.c requests rather large IO and MEM windows,
> and if it fails, the socket is completely unavailable. Which is wrong, as
> the yenta code is capable to allocate smaller windows.
> 
> Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>

Thanks Ivan for finding this so quickly.

greg k-h

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

end of thread, other threads:[~2005-07-06 23:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-06 23:07 [patch 2.6.13-rc2] yet another fix for setup-bus.c/x86 merge Ivan Kokshaysky
2005-07-06 23:13 ` Greg KH

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