]> git.neil.brown.name Git - history.git/commitdiff
Import 2.3.11pre7 2.3.11pre7
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:26:16 +0000 (15:26 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:26:16 +0000 (15:26 -0500)
16 files changed:
arch/i386/kernel/setup.c
drivers/net/rcpci45.c
drivers/nubus/nubus.c
drivers/pci/oldproc.c
drivers/scsi/eata_dma.c
drivers/scsi/eata_pio.c
fs/buffer.c
fs/exec.c
include/linux/bios32.h [deleted file]
include/linux/mm.h
kernel/exit.c
kernel/fork.c
kernel/sched.c
mm/memory.c
mm/slab.c
mm/vmscan.c

index 89f8a3fd8ae7ec665201d1bcb9e344b7735f9ac4..8d6751b5dc62ecd3bcb0f137767670c9e631f1d0 100644 (file)
@@ -400,10 +400,6 @@ __initfunc(void setup_arch(char **cmdline_p,
        conswitchp = &dummy_con;
 #endif
 #endif
-       /*
-        *      Check the bugs that will bite us before we get booting
-        */
-
 }
 
 __initfunc(static int get_model_name(struct cpuinfo_x86 *c))
index 0aa979bc1648e43f395c79476265530750d8b6f8..da7f1667f829915720fcf2b3c408d71fda069ba0 100644 (file)
@@ -63,7 +63,6 @@ static char *version =
 #include <linux/malloc.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
-#include <linux/bios32.h>
 #include <linux/timer.h>
 #include <asm/irq.h>            /* For NR_IRQS only. */
 #include <asm/bitops.h>
@@ -211,9 +210,8 @@ static int RCscan(struct device *dev)
         int scan_status;
         int board_index = 0;
         unsigned char pci_irq_line;
-        unsigned short pci_command, vendor, device, class;
         unsigned int pci_ioaddr;
-
+       struct pci_dev *pdev;
 
         scan_status =  
             (pcibios_find_device (RC_PCI45_VENDOR_ID, 
@@ -224,75 +222,22 @@ static int RCscan(struct device *dev)
 #ifdef RCDEBUG
         printk("rc scan_status = 0x%X\n", scan_status);
 #endif
-        if (scan_status != PCIBIOS_SUCCESSFUL)
+        if (scan_status != PCIBIOS_SUCCESSFUL ||
+           !((pdev = pci_find_slot(pci_bus, pci_device_fn))))
             break;
-        pcibios_read_config_word(pci_bus, 
-                                 pci_device_fn, 
-                                 PCI_VENDOR_ID, &vendor);
-        pcibios_read_config_word(pci_bus, 
-                                 pci_device_fn,
-                                 PCI_DEVICE_ID, &device);
-        pcibios_read_config_byte(pci_bus, 
-                                 pci_device_fn,
-                                 PCI_INTERRUPT_LINE, &pci_irq_line);
-        pcibios_read_config_dword(pci_bus, 
-                                  pci_device_fn,
-                                  PCI_BASE_ADDRESS_0, &pci_ioaddr);
-        pcibios_read_config_word(pci_bus, 
-                                 pci_device_fn,
-                                 PCI_CLASS_DEVICE, &class);
-
-        pci_ioaddr &= ~0xf;
+       pci_irq_line = pdev->irq;
+       pci_ioaddr = pdev->base_address[0];
+        pci_ioaddr &= PCI_BASE_ADDRESS_MEM_MASK;
 
 #ifdef RCDEBUG
         printk("rc: Found RedCreek PCI adapter\n");
-        printk("rc: pci class = 0x%x  0x%x \n", class, class>>8);
         printk("rc: pci_bus = %d,  pci_device_fn = %d\n", pci_bus, pci_device_fn);
         printk("rc: pci_irq_line = 0x%x \n", pci_irq_line);
         printk("rc: pci_ioaddr = 0x%x\n", pci_ioaddr);
 #endif
 
-        if (check_region(pci_ioaddr, 2*32768))
-        {
-            printk("rc: check_region failed\n");
-            continue;
-        }
-#ifdef RCDEBUG
-        else
-        {
-            printk("rc: check_region passed\n");
-        }
-#endif
-           
-        /*
-         * Get and check the bus-master and latency values.
-         * Some PCI BIOSes fail to set the master-enable bit.
-         */
+       pci_set_master(pdev);
 
-        pcibios_read_config_word(pci_bus, 
-                                 pci_device_fn,
-                                 PCI_COMMAND, 
-                                 &pci_command);
-        if ( ! (pci_command & PCI_COMMAND_MASTER)) {
-            printk("rc: PCI Master Bit has not been set!\n");
-                        
-            pci_command |= PCI_COMMAND_MASTER;
-            pcibios_write_config_word(pci_bus, 
-                                      pci_device_fn,
-                                      PCI_COMMAND, 
-                                      pci_command);
-        }
-        if ( ! (pci_command & PCI_COMMAND_MEMORY)) {
-            /*
-             * If the BIOS did not set the memory enable bit, what else
-             * did it not initialize?  Skip this adapter.
-             */
-            printk("rc: Adapter %d, PCI Memory Bit has not been set!\n",
-                   cards_found);
-            printk("rc: Bios problem? \n");
-            continue;
-        }
-                
         if (!RCfound_device(dev, pci_ioaddr, pci_irq_line,
                           pci_bus, pci_device_fn,
                           board_index++, cards_found))
index 483d2f8968b600852f71052ed5fe0166e74877e3..a66bbda2e271f85385ef3af3919ffedcbd747be0 100644 (file)
@@ -6,7 +6,6 @@
 #include <linux/ptrace.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/bios32.h>
 #include <linux/pci.h>
 #include <linux/string.h>
 #include <linux/nubus.h>
index 6ff8a9d44d4ae9d9404d8703a1d5c6a65cdf69f3..e8cb7a88b21c33866c1b35699d252ffe343eb0a1 100644 (file)
@@ -903,11 +903,11 @@ static int sprint_dev_config(struct pci_dev *dev, char *buf, int size)
                               vendor, device);
        }
 
-       str = 0;        /* to keep gcc shut... */
        switch (status & PCI_STATUS_DEVSEL_MASK) {
              case PCI_STATUS_DEVSEL_FAST:   str = "Fast devsel.  "; break;
              case PCI_STATUS_DEVSEL_MEDIUM: str = "Medium devsel.  "; break;
              case PCI_STATUS_DEVSEL_SLOW:   str = "Slow devsel.  "; break;
+             default:                       str = "Unknown devsel.  ";
        }
        if (len + strlen(str) > size) {
                return -1;
index 4ec4c06c88127f69fdc0b0a7bdca74c2b20f0e5c..e11609336c67b0c7cea88a88807ddf157b18fc37 100644 (file)
@@ -70,7 +70,6 @@
 #include <linux/ioport.h>
 #include <linux/malloc.h>
 #include <linux/in.h>
-#include <linux/bios32.h>
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
 #include <linux/delay.h>
@@ -1404,116 +1403,64 @@ void find_ISA(struct get_conf *buf, Scsi_Host_Template * tpnt)
 
 void find_PCI(struct get_conf *buf, Scsi_Host_Template * tpnt)
 {
-
 #ifndef CONFIG_PCI
     printk("eata_dma: kernel PCI support not enabled. Skipping scan for PCI HBAs.\n");
 #else
-    
-    u8 pci_bus, pci_device_fn;
-    static s16 pci_index = 0;  /* Device index to PCI BIOS calls */
-    u32 base = 0;
-    u16 com_adr;
-    u16 rev_device;
-    u32 error, i, x;
+    struct pci_dev *dev; 
+    u32 base, x;
     u8 pal1, pal2, pal3;
 
-    if (pci_present()) {
-       for (i = 0; i <= MAXPCI; ++i, ++pci_index) {
-           if (pcibios_find_device(PCI_VENDOR_ID_DPT, PCI_DEVICE_ID_DPT, 
-                                   pci_index, &pci_bus, &pci_device_fn))
-               break;
+    for(dev=NULL; dev = pci_find_device(PCI_VENDOR_ID_DPT, PCI_DEVICE_ID_DPT, dev);) {
            DBG(DBG_PROBE && DBG_PCI, 
-               printk("eata_dma: find_PCI, HBA at bus %d, device %d,"
-                      " function %d, index %d\n", (s32)pci_bus, 
-                      (s32)((pci_device_fn & 0xf8) >> 3),
-                      (s32)(pci_device_fn & 7), pci_index));
-           
-           if (!(error = pcibios_read_config_word(pci_bus, pci_device_fn, 
-                                      PCI_CLASS_DEVICE, &rev_device))) {
-               if (rev_device == PCI_CLASS_STORAGE_SCSI) {
-                   if (!(error = pcibios_read_config_word(pci_bus, 
-                                              pci_device_fn, PCI_COMMAND, 
-                                              (u16 *) & com_adr))) {
-                       if (!((com_adr & PCI_COMMAND_IO) && 
-                             (com_adr & PCI_COMMAND_MASTER))) {
-                           printk("eata_dma: find_PCI, HBA has IO or"
-                                  " BUSMASTER mode disabled\n");
-                           continue;
-                       }
-                   } else
-                       printk("eata_dma: find_PCI, error %x while reading "
-                              "PCI_COMMAND\n", error);
-               } else
-                   printk("eata_dma: find_PCI, DEVICECLASSID %x didn't match\n", 
-                          rev_device);
-           } else {
-               printk("eata_dma: find_PCI, error %x while reading "
-                      "PCI_CLASS_BASE\n", 
-                      error);
+               printk("eata_dma: find_PCI, HBA at %s\n", dev->name));
+           pci_set_master(dev);
+           base = dev->base_address[0];
+           if (!(base & PCI_BASE_ADDRESS_SPACE_IO)) {
+               printk("eata_dma: invalid base address of device %s\n", dev->name);
                continue;
            }
-           
-           if (!(error = pcibios_read_config_dword(pci_bus, pci_device_fn,
-                                      PCI_BASE_ADDRESS_0, (int *) &base))){
-               
-               /* Check if the address is valid */
-               if (base & 0x01) {
-                   base &= 0xfffffffe;
-                    /* EISA tag there ? */
-                   pal1 = inb(base);
-                   pal2 = inb(base + 1);
-                   pal3 = inb(base + 2);
-                   if (((pal1 == DPT_ID1) && (pal2 == DPT_ID2)) ||
-                       ((pal1 == NEC_ID1) && (pal2 == NEC_ID2) && 
-                        (pal3 == NEC_ID3)) ||
-                       ((pal1 == ATT_ID1) && (pal2 == ATT_ID2) && 
-                        (pal3 == ATT_ID3)))
-                       base += 0x08;
-                   else
-                       base += 0x10;   /* Now, THIS is the real address */
-
-                   if (base != 0x1f8) {
-                       /* We didn't find it in the primary search */
-                       if (get_conf_PIO(base, buf) == TRUE) {
-
-                           /* OK. We made it till here, so we can go now  
-                            * and register it. We  only have to check and 
-                            * eventually remove it from the EISA and ISA list 
-                            */
-                           DBG(DBG_PCI, printk("Registering PCI HBA\n"));
-                           register_HBA(base, buf, tpnt, IS_PCI);
-                           
-                           if (base < 0x1000) {
-                               for (x = 0; x < MAXISA; ++x) {
-                                   if (ISAbases[x] == base) {
-                                       ISAbases[x] = 0;
-                                       break;
-                                   }
-                               }
-                           } else if ((base & 0x0fff) == 0x0c88) 
-                               EISAbases[(base >> 12) & 0x0f] = 0;
-                           continue;  /* break; */
-                       } 
-#if CHECK_BLINK
-                       else if (check_blink_state(base) == TRUE) {
-                           printk("eata_dma: HBA is in BLINK state.\n"
-                                  "Consult your HBAs manual to correct this.\n");
+           base &= PCI_BASE_ADDRESS_IO_MASK;
+            /* EISA tag there ? */
+           pal1 = inb(base);
+           pal2 = inb(base + 1);
+           pal3 = inb(base + 2);
+           if (((pal1 == DPT_ID1) && (pal2 == DPT_ID2)) ||
+               ((pal1 == NEC_ID1) && (pal2 == NEC_ID2) && 
+               (pal3 == NEC_ID3)) ||
+               ((pal1 == ATT_ID1) && (pal2 == ATT_ID2) && 
+               (pal3 == ATT_ID3)))
+               base += 0x08;
+           else
+               base += 0x10;   /* Now, THIS is the real address */
+           if (base != 0x1f8) {
+               /* We didn't find it in the primary search */
+               if (get_conf_PIO(base, buf) == TRUE) {
+                   /* OK. We made it till here, so we can go now  
+                    * and register it. We only have to check and 
+                    * eventually remove it from the EISA and ISA list 
+                    */
+                   DBG(DBG_PCI, printk("Registering PCI HBA\n"));
+                   register_HBA(base, buf, tpnt, IS_PCI);
+                   
+                   if (base < 0x1000) {
+                       for (x = 0; x < MAXISA; ++x) {
+                           if (ISAbases[x] == base) {
+                               ISAbases[x] = 0;
+                               break;
+                           }
                        }
-#endif
-                   }
+                   } else if ((base & 0x0fff) == 0x0c88) 
+                       EISAbases[(base >> 12) & 0x0f] = 0;
+               } 
+#if CHECK_BLINK
+               else if (check_blink_state(base) == TRUE) {
+                   printk("eata_dma: HBA is in BLINK state.\n"
+                          "Consult your HBAs manual to correct this.\n");
                }
-           } else {
-               printk("eata_dma: error %x while reading "
-                      "PCI_BASE_ADDRESS_0\n", error);
+#endif
            }
        }
-    } else {
-       printk("eata_dma: No BIOS32 extensions present. This driver release "
-              "still depends on it.\n"
-              "          Skipping scan for PCI HBAs. \n");
-    }
 #endif /* #ifndef CONFIG_PCI */
-    return;
 }
 
 int eata_detect(Scsi_Host_Template * tpnt)
index a706a8e7f2f19470dd0876321845b090f90d78e8..8c691c8ad9530303600346620919f222cba9f311 100644 (file)
@@ -45,7 +45,6 @@
 #include <linux/ioport.h>
 #include <linux/malloc.h>
 #include <linux/in.h>
-#include <linux/bios32.h>
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
 #include <asm/io.h>
@@ -881,100 +880,60 @@ void find_pio_EISA(struct get_conf *buf, Scsi_Host_Template * tpnt)
 
 void find_pio_PCI(struct get_conf *buf, Scsi_Host_Template * tpnt)
 {
-
 #ifndef CONFIG_PCI
-    printk(KERN_ERR "eata_pio: kernel PCI support not enabled. Skipping scan "
-           "for PCI HBAs.\n");
+    printk("eata_dma: kernel PCI support not enabled. Skipping scan for PCI HBAs.\n");
 #else
-    
-    u8 pci_bus, pci_device_fn;
-    static s16 pci_index = 0;   /* Device index to PCI BIOS calls */
-    u32 base = 0;
-    u16 com_adr;
-    u16 rev_device;
-    u32 error, i, x;
+    struct pci_dev *dev; 
+    u32 base, x;
 
-    if (pci_present()) {
-       for (i = 0; i <= MAXPCI; ++i, ++pci_index) {
-           if (pcibios_find_device(PCI_VENDOR_ID_DPT, PCI_DEVICE_ID_DPT, 
-                                   pci_index, &pci_bus, &pci_device_fn))
-               break;
+    for(dev=NULL; dev = pci_find_device(PCI_VENDOR_ID_DPT, PCI_DEVICE_ID_DPT, dev);) {
            DBG(DBG_PROBE && DBG_PCI, 
-               printk("eata_pio: HBA at bus %d, device %d,"
-                      " function %d, index %d\n", (s32)pci_bus, 
-                      (s32)((pci_device_fn & 0xf8) >> 3),
-                      (s32)(pci_device_fn & 7), pci_index));
-           
-           if (!(error = pcibios_read_config_word(pci_bus, pci_device_fn, 
-                                      PCI_CLASS_DEVICE, &rev_device))) {
-               if (rev_device == PCI_CLASS_STORAGE_SCSI) {
-                   if (!(error = pcibios_read_config_word(pci_bus, 
-                                              pci_device_fn, PCI_COMMAND, 
-                                              (u16 *) & com_adr))) {
-                       if (!((com_adr & PCI_COMMAND_IO) && 
-                             (com_adr & PCI_COMMAND_MASTER))) {
-                           printk("HBA has IO or BUSMASTER mode disabled\n");
-                           continue;
-                       }
-                   } else
-                       printk("eata_pio: error %x while reading "
-                              "PCI_COMMAND\n", error);
-               } else
-                   printk("DEVICECLASSID %x didn't match\n", rev_device);
-           } else {
-               printk("eata_pio: error %x while reading PCI_CLASS_BASE\n", 
-                      error);
+               printk("eata_pio: find_PCI, HBA at %s\n", dev->name));
+           pci_set_master(dev);
+           base = dev->base_address[0];
+           if (!(base & PCI_BASE_ADDRESS_SPACE_IO)) {
+               printk("eata_pio: invalid base address of device %s\n", dev->name);
                continue;
            }
-           
-           if (!(error = pcibios_read_config_dword(pci_bus, pci_device_fn,
-                                      PCI_BASE_ADDRESS_0, (int *) &base))){
-               
-               /* Check if the address is valid */
-               if (base & 0x01) {
-                   base &= 0xfffffffe;
-                   /* EISA tag there ? */
-                   if ((inb(base) == 0x12) && (inb(base + 1) == 0x14))
-                       continue;   /* Jep, it's forced, so move on  */
-                   base += 0x10;   /* Now, THIS is the real address */
-                   if (base != 0x1f8) {
-                       /* We didn't find it in the primary search */
-                       if (get_pio_conf_PIO(base, buf) == TRUE) {
-                           if (buf->FORCADR)   /* If the address is forced */
-                               continue;       /* we'll find it later      */
-                           
-                           /* OK. We made it till here, so we can go now  
-                            * and register it. We  only have to check and 
-                            * eventually remove it from the EISA and ISA list 
-                            */
-                           
-                           register_pio_HBA(base, buf, tpnt);
-                           
-                           if (base < 0x1000) {
-                               for (x = 0; x < MAXISA; ++x) {
-                                   if (ISAbases[x] == base) {
-                                       ISAbases[x] = 0;
-                                       break;
-                                   }
-                               }
-                           } else if ((base & 0x0fff) == 0x0c88) {
-                               x = (base >> 12) & 0x0f;
-                               EISAbases[x] = 0;
+           base &= PCI_BASE_ADDRESS_IO_MASK;
+            /* EISA tag there ? */
+           if ((inb(base) == 0x12) && (inb(base + 1) == 0x14))
+               continue;   /* Jep, it's forced, so move on  */
+           base += 0x10;   /* Now, THIS is the real address */
+           if (base != 0x1f8) {
+               /* We didn't find it in the primary search */
+               if (get_pio_conf_PIO(base, buf) == TRUE) {
+                   if (buf->FORCADR)   /* If the address is forced */
+                       continue;       /* we'll find it later      */
+                   
+                   /* OK. We made it till here, so we can go now  
+                    * and register it. We  only have to check and 
+                    * eventually remove it from the EISA and ISA list 
+                    */
+                   
+                   register_pio_HBA(base, buf, tpnt);
+                   
+                   if (base < 0x1000) {
+                       for (x = 0; x < MAXISA; ++x) {
+                           if (ISAbases[x] == base) {
+                               ISAbases[x] = 0;
+                               break;
                            }
-                           continue;  /* break; */
                        }
+                   } else if ((base & 0x0fff) == 0x0c88) {
+                       x = (base >> 12) & 0x0f;
+                       EISAbases[x] = 0;
                    }
+               } 
+#if CHECK_BLINK
+               else if (check_blink_state(base) == TRUE) {
+                   printk("eata_pio: HBA is in BLINK state.\n"
+                          "Consult your HBAs manual to correct this.\n");
                }
-           } else
-               printk("eata_pio: error %x while reading "
-                      "PCI_BASE_ADDRESS_0\n", error);
+#endif
+           }
        }
-    } else
-       printk("eata_pio: No BIOS32 extensions present. This driver release "
-              "still depends on it.\n"
-              "          Skipping scan for PCI HBAs.\n");
 #endif /* #ifndef CONFIG_PCI */
-    return;
 }
 
 
index d11fc40b2d25f0ae06535d79fe6181fc9159c16b..285183ab6c4b2067a00033938f337700fbb22095 100644 (file)
@@ -1969,7 +1969,6 @@ asmlinkage int sys_bdflush(int func, long data)
                goto out;
 
        if (func == 1) {
-#if 0
                struct mm_struct *user_mm;
                /*
                 * bdflush will spend all of it's time in kernel-space,
@@ -1980,15 +1979,13 @@ asmlinkage int sys_bdflush(int func, long data)
                user_mm = current->mm;
                mmget(user_mm);
                current->mm = NULL;
-#endif
+               /* active_mm is still 'user_mm' */
 
                error = sync_old_buffers();
 
-#if 0
                current->mm = user_mm;
                mmput(current->active_mm);
                current->active_mm = user_mm;
-#endif
 
                goto out;
        }
index d583614b4ff486e417afdc30809f7d9511c2d187..0409c1e46cf010039fd03acc5a5f24fe33116fc8 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -366,18 +366,24 @@ end_readexec:
 static int exec_mmap(void)
 {
        struct mm_struct * mm, * old_mm;
-       int retval;
 
-       if (current->mm && atomic_read(&current->mm->count) == 1) {
-               flush_cache_mm(current->mm);
+       /*
+        * NOTE: This works even if "old_mm" is a lazy
+        * memory state. If count == 1 at this point,
+        * we know that we're the only holders of that
+        * lazy mm, so we can turn it into a real mm.
+        */
+       old_mm = current->active_mm;
+       if (atomic_read(&old_mm->count) == 1) {
+               current->mm = old_mm;
+               flush_cache_mm(old_mm);
                mm_release();
-               release_segments(current->mm);
-               exit_mmap(current->mm);
-               flush_tlb_mm(current->mm);
+               release_segments(old_mm);
+               exit_mmap(old_mm);
+               flush_tlb_mm(old_mm);
                return 0;
        }
 
-       retval = -ENOMEM;
        mm = mm_alloc();
        if (!mm)
                goto fail_nomem;
@@ -385,36 +391,22 @@ static int exec_mmap(void)
        mm->cpu_vm_mask = (1UL << smp_processor_id());
        mm->total_vm = 0;
        mm->rss = 0;
+       mm->pgd = pgd_alloc();
+       if (!mm->pgd)
+               goto fail_free;
 
-       /*
-        * Make sure we have a private LDT if needed ...
-        */
-       if (current->mm)
-               copy_segments(current, mm);
-
-       old_mm = current->mm;
        current->mm = mm;
-       retval = new_page_tables(current);
-       if (retval)
-               goto fail_restore;
+       current->active_mm = mm;
+       SET_PAGE_DIR(current, mm->pgd);
        activate_context(current);
        mm_release();
-       if (old_mm)
-               mmput(old_mm);
+       mmput(old_mm);
        return 0;
 
-       /*
-        * Failure ... restore the prior mm_struct.
-        */
-fail_restore:
-       current->mm = old_mm;
-       /* restore the ldt for this task */
-       copy_segments(current, NULL);
-       release_segments(mm);
+fail_free:
        kmem_cache_free(mm_cachep, mm);
-
 fail_nomem:
-       return retval;
+       return -ENOMEM;
 }
 
 /*
diff --git a/include/linux/bios32.h b/include/linux/bios32.h
deleted file mode 100644 (file)
index 2f2c14b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *     This is only a stub file to make drivers not yet converted to the new
- *     PCI probing mechanism work. [mj]
- */
-
-#ifndef BIOS32_H
-#define BIOS32_H
-
-#include <linux/pci.h>
-
-#warning This driver uses the old PCI interface, please fix it (see Documentation/pci.txt)
-
-extern inline int __pcibios_read_irq(unsigned char bus, unsigned char dev_fn, unsigned char *to)
-{
-       struct pci_dev *pdev = pci_find_slot(bus, dev_fn);
-       if (!pdev) {
-               *to = 0;
-               return PCIBIOS_DEVICE_NOT_FOUND;
-       } else {
-               *to = pdev->irq;
-               return PCIBIOS_SUCCESSFUL;
-       }
-}
-
-extern inline int __pcibios_read_config_byte(unsigned char bus,
-       unsigned char dev_fn, unsigned char where, unsigned char *to)
-{
-       return pcibios_read_config_byte(bus, dev_fn, where, to);
-}
-
-#define pcibios_read_config_byte(b,d,w,p) \
-       (((w) == PCI_INTERRUPT_LINE) ? __pcibios_read_irq(b,d,p) : __pcibios_read_config_byte(b,d,w,p))
-
-#endif
index 751b1483d41440bee0deadd751c042e3dd7b5499..14ff5eab3f3dd834ad4e660824e6bf83a4588c8b 100644 (file)
@@ -306,7 +306,6 @@ extern unsigned long put_dirty_page(struct task_struct * tsk,unsigned long page,
 
 extern void free_page_tables(struct mm_struct * mm);
 extern void clear_page_tables(struct mm_struct *, unsigned long, int);
-extern int new_page_tables(struct task_struct * tsk);
 
 extern void zap_page_range(struct mm_struct *mm, unsigned long address, unsigned long size);
 extern int copy_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma);
index 363d3256200d71a7fd3bb20ed167271d64d51d38..db8a7016e7d9ac3fd64a614fabffac00fef051ee 100644 (file)
@@ -235,14 +235,8 @@ static inline void __exit_mm(struct task_struct * tsk)
 
        /* Lazy TLB process? */
        if (!mm) {
-               struct mm_struct *active_mm = tsk->active_mm;
-               mmget(&init_mm);
-               tsk->active_mm = &init_mm;
-               tsk->swappable = 0;
-               SET_PAGE_DIR(tsk, swapper_pg_dir);              
-               if (active_mm)
-                       mmput(active_mm);
-               return;
+               mm = tsk->active_mm;
+               goto drop_mm;
        }
 
        /* Set us up to use the kernel mm state */
@@ -253,8 +247,10 @@ static inline void __exit_mm(struct task_struct * tsk)
 
        /* This turns us into a task with no MM */
        tsk->mm = NULL;
-       tsk->active_mm = &init_mm;
+
+drop_mm:
        mmget(&init_mm);
+       tsk->active_mm = &init_mm;
        tsk->swappable = 0;
        SET_PAGE_DIR(tsk, swapper_pg_dir);
        mmput(mm);
index 8fd12d51824142f218a26d95c19e10e02233977c..731eb8d792eef52d33132484f2241ca54c603b82 100644 (file)
@@ -338,6 +338,7 @@ void mm_release(void)
 void mmput(struct mm_struct *mm)
 {
        if (atomic_dec_and_test(&mm->count)) {
+               if (mm == &init_mm) BUG();
                release_segments(mm);
                exit_mmap(mm);
                free_page_tables(mm);
@@ -354,24 +355,21 @@ static inline int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
        tsk->cmin_flt = tsk->cmaj_flt = 0;
        tsk->nswap = tsk->cnswap = 0;
 
+       tsk->mm = NULL;
+       tsk->active_mm = NULL;
+
        /*
         * Are we cloning a kernel thread?
+        *
+        * We need to steal a active VM for that..
         */
        mm = current->mm;
-       if (!mm) {
-               tsk->active_mm = NULL;
+       if (!mm)
                return 0;
-       }
 
        if (clone_flags & CLONE_VM) {
                mmget(mm);
-               /*
-                * No need to worry about the LDT descriptor for the
-                * cloned task, LDTs get magically loaded at
-                * __switch_to time if necessary.
-                */
-               SET_PAGE_DIR(tsk, mm->pgd);
-               return 0;
+               goto good_mm;
        }
 
        retval = -ENOMEM;
@@ -396,16 +394,17 @@ static inline int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
        up(&current->mm->mmap_sem);
        if (retval)
                goto free_pt;
+
+good_mm:
+       tsk->mm = mm;
+       tsk->active_mm = mm;
        SET_PAGE_DIR(tsk, mm->pgd);
        return 0;
 
 free_mm:
-       tsk->mm = NULL;
-       release_segments(mm);
        kmem_cache_free(mm_cachep, mm);
        return retval;
 free_pt:
-       tsk->mm = NULL;
        mmput(mm);
 fail_nomem:
        return retval;
index 3f793f20fd8388c3d7d069bc818cf228c00d155d..1e17837a43b80e9fd7a67836edfe5c7d52eb1962 100644 (file)
@@ -624,8 +624,10 @@ signed long schedule_timeout(signed long timeout)
  */
 static inline void __schedule_tail(struct task_struct *prev)
 {
+       struct mm_struct *mm = NULL;
+       if (!current->active_mm) BUG();
        if (!prev->mm) {
-               mmput(prev->active_mm);
+               mm = prev->active_mm;
                prev->active_mm = NULL;
        }
 #ifdef __SMP__
@@ -635,6 +637,16 @@ static inline void __schedule_tail(struct task_struct *prev)
        wmb();
        prev->has_cpu = 0;
 #endif /* __SMP__ */
+
+       reacquire_kernel_lock(current);
+       /*
+        * mmput can sleep. As such, we have to wait until
+        * after we released "prev" back into the scheduler
+        * pool and until we have re-aquired out locking
+        * state until we can actually do this.
+        */
+       if (mm)
+               mmput(mm);
 }
 
 void schedule_tail(struct task_struct *prev)
@@ -659,6 +671,7 @@ asmlinkage void schedule(void)
        struct list_head *tmp;
        int this_cpu, c;
 
+       if (!current->active_mm) BUG();
        if (tq_scheduler)
                goto handle_tq_scheduler;
 tq_scheduler_back:
@@ -799,9 +812,9 @@ still_running_back:
        get_mmu_context(next);
        switch_to(prev, next, prev);
        __schedule_tail(prev);
+       return;
 
 same_process:
-  
        reacquire_kernel_lock(current);
        return;
 
index f48a4d9066efac95f121a8b73cc7d2b536c4413b..9169186327022651e08e85cb2867f88111641535 100644 (file)
@@ -164,17 +164,6 @@ out_bad:
        return;
 }
 
-int new_page_tables(struct task_struct * tsk)
-{
-       pgd_t * new_pg;
-
-       if (!(new_pg = pgd_alloc()))
-               return -ENOMEM;
-       SET_PAGE_DIR(tsk, new_pg);
-       tsk->mm->pgd = new_pg;
-       return 0;
-}
-
 #define PTE_TABLE_MASK ((PTRS_PER_PTE-1) * sizeof(pte_t))
 #define PMD_TABLE_MASK ((PTRS_PER_PMD-1) * sizeof(pmd_t))
 
index 5c6075cb5357a32eb8900992026c2fd2a7dc9630..e46cae05e76788346bbc27cd33e4a7ce0cbfd277 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1577,7 +1577,7 @@ bad_slab:
 
 #if 1
 /* FORCE A KERNEL DUMP WHEN THIS HAPPENS. SPEAK IN ALL CAPS. GET THE CALL CHAIN. */
-*(int *) 0 = 0;
+       BUG();
 #endif
 
        return;
index e5c159560ac80bf5f64c5adbed16acd667df5f2d..ba9ac915eb8caf7f40bfede0dc5d9eaaa084e7ae 100644 (file)
@@ -352,7 +352,7 @@ static int swap_out(unsigned int priority, int gfp_mask)
                read_lock(&tasklist_lock);
                p = init_task.next_task;
                for (; p != &init_task; p = p->next_task) {
-                       if (!p->swappable)
+                       if (!p->swappable || !p->mm)
                                continue;
                        if (p->mm->rss <= 0)
                                continue;