From: Matthew Wilcox <matthew@wil.cx>
To: Guy Martin <gmsoft@tuxicoman.be>
Cc: parisc-linux@lists.parisc-linux.org
Subject: Re: [parisc-linux] LBA PCI : avoid crash when pluging a pcmcia bridge
Date: Fri, 17 Nov 2006 13:30:42 -0700 [thread overview]
Message-ID: <20061117203041.GD18567@parisc-linux.org> (raw)
In-Reply-To: <20061115190830.f8e99725.gmsoft@tuxicoman.be>
On Wed, Nov 15, 2006 at 07:08:30PM +0100, Guy Martin wrote:
> I've put the complete dmesg and lspci output (both numerical and not) here :
> https://www.tuxicoman.be/temp/c3600-pci-debug.logs
Thanks. Please try this patch (cribbed somewhat from jejb's patch for
Dino back in December 2003 ;-)
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index ad4a1a1..963f35c 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -1406,6 +1406,14 @@ lba_hw_init(struct lba_device *d)
return 0;
}
+/*
+ * Unfortunately, when firmware numbers busses, it doesn't take into account
+ * Cardbus bridges. So we have to renumber the busses to suit ourselves.
+ * Elroy/Mercury don't actually know what bus number they're attached to;
+ * we use bus 0 to indicate the directly attached bus and any other bus
+ * number will be taken care of by the PCI-PCI bridge.
+ */
+static unsigned int lba_next_bus = 0;
/*
@@ -1529,16 +1537,20 @@ lba_driver_probe(struct parisc_device *d
lba_legacy_resources(dev, lba_dev);
}
- /*
- ** Tell PCI support another PCI bus was found.
- ** Walks PCI bus for us too.
- */
+ if (lba_dev->hba.bus_num.start < lba_next_bus) {
+ DBG(KERN_DEBUG "Reassigning firmware bus %d as Linux bus %d\n",
+ lba_dev->hba.bus_num.start, lba_next_bus);
+ lba_dev->hba.bus_num.start = lba_next_bus;
+ }
+
dev->dev.platform_data = lba_dev;
lba_bus = lba_dev->hba.hba_bus =
pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start,
cfg_ops, NULL);
- if (lba_bus)
+ if (lba_bus) {
+ lba_next_bus = lba_bus->subordinate + 1;
pci_bus_add_devices(lba_bus);
+ }
/* This is in lieu of calling pci_assign_unassigned_resources() */
if (is_pdc_pat()) {
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
next prev parent reply other threads:[~2006-11-17 20:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-08 14:07 [parisc-linux] LBA PCI : avoid crash when pluging a pcmcia bridge Guy Martin
2006-11-09 6:40 ` Grant Grundler
2006-11-15 8:00 ` Grant Grundler
2006-11-15 11:25 ` Guy Martin
2006-11-15 12:23 ` Matthew Wilcox
2006-11-15 14:54 ` James Bottomley
2006-11-15 18:08 ` Guy Martin
2006-11-17 20:30 ` Matthew Wilcox [this message]
2006-11-18 11:21 ` Guy Martin
2006-11-18 13:56 ` Matthew Wilcox
2006-11-18 14:22 ` James Bottomley
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=20061117203041.GD18567@parisc-linux.org \
--to=matthew@wil.cx \
--cc=gmsoft@tuxicoman.be \
--cc=parisc-linux@lists.parisc-linux.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