Commit 509b0865 authored by Dominik Brodowski's avatar Dominik Brodowski

pcmcia: fix io_probe due to parent (PCI) resources

Similar to commit 7a96e87d, we need to be aware of any parent PCI
device when requesting IO regions, even only for testing
("probing").
Reported-by: default avatarKomuro <komurojun-mbn@nifty.com>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent d3e03f4e
...@@ -214,7 +214,7 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base, ...@@ -214,7 +214,7 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base,
return; return;
} }
for (i = base, most = 0; i < base+num; i += 8) { for (i = base, most = 0; i < base+num; i += 8) {
res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
if (!res) if (!res)
continue; continue;
hole = inb(i); hole = inb(i);
...@@ -231,9 +231,14 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base, ...@@ -231,9 +231,14 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base,
bad = any = 0; bad = any = 0;
for (i = base; i < base+num; i += 8) { for (i = base; i < base+num; i += 8) {
res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe");
if (!res) if (!res) {
if (!any)
printk(" excluding");
if (!bad)
bad = any = i;
continue; continue;
}
for (j = 0; j < 8; j++) for (j = 0; j < 8; j++)
if (inb(i+j) != most) if (inb(i+j) != most)
break; break;
...@@ -253,6 +258,7 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base, ...@@ -253,6 +258,7 @@ static void do_io_probe(struct pcmcia_socket *s, unsigned int base,
} }
if (bad) { if (bad) {
if ((num > 16) && (bad == base) && (i == base+num)) { if ((num > 16) && (bad == base) && (i == base+num)) {
sub_interval(&s_data->io_db, bad, i-bad);
printk(" nothing: probe failed.\n"); printk(" nothing: probe failed.\n");
return; return;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment