]> err.no Git - linux-2.6/blobdiff - drivers/pcmcia/rsrc_nonstatic.c
[PATCH] largefile support for accounting
[linux-2.6] / drivers / pcmcia / rsrc_nonstatic.c
index c8f21796c59236d263f84d9461d738ee8574c725..c42455d20eb683c6d2c99de733966ad403c5941d 100644 (file)
@@ -372,6 +372,9 @@ static int do_mem_probe(u_long base, u_long num, struct pcmcia_socket *s)
           base, base+num-1);
     bad = fail = 0;
     step = (num < 0x20000) ? 0x2000 : ((num>>4) & ~0x1fff);
+    /* don't allow too large steps */
+    if (step > 0x800000)
+       step = 0x800000;
     /* cis_readable wants to map 2x map_size */
     if (step < 2 * s->map_size)
        step = 2 * s->map_size;
@@ -465,8 +468,7 @@ static void validate_mem(struct pcmcia_socket *s, unsigned int probe_mask)
 
        for (m = s_data->mem_db.next; m != &s_data->mem_db; m = mm.next) {
                mm = *m;
-               if (do_mem_probe(mm.base, mm.num, s))
-                       break;
+               do_mem_probe(mm.base, mm.num, s);
        }
 }
 
@@ -777,6 +779,17 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
        if (!s->cb_dev || !s->cb_dev->bus)
                return -ENODEV;
 
+#if defined(CONFIG_X86) || defined(CONFIG_X86_64)
+       /* If this is the root bus, the risk of hitting
+        * some strange system devices which aren't protected
+        * by either ACPI resource tables or properly requested
+        * resources is too big. Therefore, don't do auto-adding
+        * of resources at the moment.
+        */
+       if (s->cb_dev->bus->number == 0)
+               return -EINVAL;
+#endif
+
        for (i=0; i < PCI_BUS_NUM_RESOURCES; i++) {
                res = s->cb_dev->bus->resource[i];
                if (!res)