diff options
author | Ivan Kokshaysky <ink@jurassic.park.msu.ru> | 2005-06-27 19:28:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-27 21:03:05 -0400 |
commit | 7925407aa02653ba462b1d8b0b1229b99aee5411 (patch) | |
tree | 450fbfe7570b65ae978cb036bc1cc689dde30e69 | |
parent | 3c803e8e2f15d02c5ad0a3888eea2bbd31dc59c5 (diff) |
[PATCH] pci: yenta cardbus fix
On Mon, Jun 20, 2005 at 07:15:34PM +1000, Grant Coady wrote:
> Yenta: CardBus bridge found at 0000:00:0b.0 [1179:0001]
> yenta 0000:00:0b.0: Preassigned resource 0 busy, reconfiguring...
In -mm1 the cardbus resources might be assigned in
pci_assign_unassigned_resources() pass. From your dmesg:
PCI: Bus 2, cardbus bridge: 0000:00:0b.0
IO window: 00002000-00002fff
IO window: 00003000-00003fff
PREFETCH window: 12000000-13ffffff
MEM window: 14000000-15ffffff
Then yenta_allocate_res() tries to assign these resources again and,
naturally, fails.
This adds check for already assigned cardbus resources.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index bee05362fd24..02b23abc2df1 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -549,6 +549,11 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
549 | unsigned offset; | 549 | unsigned offset; |
550 | unsigned mask; | 550 | unsigned mask; |
551 | 551 | ||
552 | res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; | ||
553 | /* Already allocated? */ | ||
554 | if (res->parent) | ||
555 | return 0; | ||
556 | |||
552 | /* The granularity of the memory limit is 4kB, on IO it's 4 bytes */ | 557 | /* The granularity of the memory limit is 4kB, on IO it's 4 bytes */ |
553 | mask = ~0xfff; | 558 | mask = ~0xfff; |
554 | if (type & IORESOURCE_IO) | 559 | if (type & IORESOURCE_IO) |
@@ -556,7 +561,6 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
556 | 561 | ||
557 | offset = 0x1c + 8*nr; | 562 | offset = 0x1c + 8*nr; |
558 | bus = socket->dev->subordinate; | 563 | bus = socket->dev->subordinate; |
559 | res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; | ||
560 | res->name = bus->name; | 564 | res->name = bus->name; |
561 | res->flags = type; | 565 | res->flags = type; |
562 | res->start = 0; | 566 | res->start = 0; |