]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
authorLinus Torvalds <torvalds@g5.osdl.org>
Mon, 13 Nov 2006 16:03:32 +0000 (08:03 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 13 Nov 2006 16:03:32 +0000 (08:03 -0800)
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  [PATCH] drivers cris: return on NULL dev_alloc_skb()
  [PATCH] com20020 build fix
  [PATCH] bonding: lockdep annotation
  [PATCH] bcm43xx: Add error checking in bcm43xx_sprom_write()
  [PATCH] bcm43xx: Drain TX status before starting IRQs

18 files changed:
.gitignore
arch/ia64/Kconfig
drivers/char/Kconfig
drivers/char/ipmi/ipmi_msghandler.c
drivers/char/mspec.c
drivers/pci/pci-sysfs.c
drivers/scsi/scsi_scan.c
drivers/video/nvidia/nv_hw.c
drivers/video/nvidia/nv_setup.c
drivers/video/nvidia/nv_type.h
drivers/video/nvidia/nvidia.c
include/asm-ia64/sn/addrs.h
include/linux/personality.h
include/linux/vmalloc.h
kernel/fork.c
kernel/irq/spurious.c
mm/vmalloc.c
scripts/kconfig/.gitignore

index e1d5c17c12c22663d9df80925e4b7872bd53d6aa..9eb4b77114994877b247c1d165f3920f680cc7e6 100644 (file)
@@ -20,6 +20,7 @@
 # Top-level generic files
 #
 tags
+TAGS
 vmlinux*
 System.map
 Module.symvers
index 14682396f7f7341594647b2d60d96ed9eccff8ad..683b12c6f76cafd6930787bb8663c5face2bb5a2 100644 (file)
@@ -484,6 +484,15 @@ source "net/Kconfig"
 
 source "drivers/Kconfig"
 
+config MSPEC
+       tristate "Memory special operations driver"
+       depends on IA64
+       select IA64_UNCACHED_ALLOCATOR
+       help
+         If you have an ia64 and you want to enable memory special
+         operations support (formerly known as fetchop), say Y here,
+         otherwise say N.
+
 source "fs/Kconfig"
 
 source "lib/Kconfig"
index 39a9f8cc6412a0faa1ed80df4ff12fbf56693f91..2af12fc4511585d4f7aab36b863378eff152764a 100644 (file)
@@ -409,14 +409,6 @@ config SGI_MBCS
          If you have an SGI Altix with an attached SABrick
          say Y or M here, otherwise say N.
 
-config MSPEC
-       tristate "Memory special operations driver"
-       depends on IA64
-       help
-         If you have an ia64 and you want to enable memory special
-         operations support (formerly known as fetchop), say Y here,
-         otherwise say N.
-
 source "drivers/serial/Kconfig"
 
 config UNIX98_PTYS
index 0b07ca1b71fa8450adab289e849b41e33c4bfba0..a41b8df240730f8a2fd89219fcc6b3c6100119b1 100644 (file)
@@ -1854,7 +1854,7 @@ static ssize_t provides_dev_sdrs_show(struct device *dev,
        struct bmc_device *bmc = dev_get_drvdata(dev);
 
        return snprintf(buf, 10, "%u\n",
-                       bmc->id.device_revision && 0x80 >> 7);
+                       (bmc->id.device_revision & 0x80) >> 7);
 }
 
 static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
@@ -1863,7 +1863,7 @@ static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
        struct bmc_device *bmc = dev_get_drvdata(dev);
 
        return snprintf(buf, 20, "%u\n",
-                       bmc->id.device_revision && 0x0F);
+                       bmc->id.device_revision & 0x0F);
 }
 
 static ssize_t firmware_rev_show(struct device *dev,
index 5c0dec39cf6c66998cdd9b65205a78882587b0a0..235e892261124d81c7c131e06f30bc4b713ad558 100644 (file)
@@ -72,7 +72,11 @@ enum {
        MSPEC_UNCACHED
 };
 
+#ifdef CONFIG_SGI_SN
 static int is_sn2;
+#else
+#define is_sn2         0
+#endif
 
 /*
  * One of these structures is allocated when an mspec region is mmaped. The
@@ -211,7 +215,7 @@ mspec_nopfn(struct vm_area_struct *vma, unsigned long address)
        if (vdata->type == MSPEC_FETCHOP)
                paddr = TO_AMO(maddr);
        else
-               paddr = __pa(TO_CAC(maddr));
+               paddr = maddr & ~__IA64_UNCACHED_OFFSET;
 
        pfn = paddr >> PAGE_SHIFT;
 
@@ -335,6 +339,7 @@ mspec_init(void)
         * The fetchop device only works on SN2 hardware, uncached and cached
         * memory drivers should both be valid on all ia64 hardware
         */
+#ifdef CONFIG_SGI_SN
        if (ia64_platform_is("sn2")) {
                is_sn2 = 1;
                if (is_shub2()) {
@@ -363,6 +368,7 @@ mspec_init(void)
                        goto free_scratch_pages;
                }
        }
+#endif
        ret = misc_register(&cached_miscdev);
        if (ret) {
                printk(KERN_ERR "%s: failed to register device %i\n",
index a1d2e979b17fdd1e431297b78c88fbf926da99ac..f952bfea48a6f972e0a1de9cc8bfc4a33920bfb7 100644 (file)
@@ -642,6 +642,9 @@ err:
  */
 void pci_remove_sysfs_dev_files(struct pci_dev *pdev)
 {
+       if (!sysfs_initialized)
+               return;
+
        if (pdev->cfg_size < 4096)
                sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
        else
index fd9e281c3bfeed4fef893cb705e7c8331011c7bd..94a274645f6f36819c29aadb3aeff7b5290581e8 100644 (file)
@@ -631,12 +631,22 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
         * scanning run at their own risk, or supply a user level program
         * that can correctly scan.
         */
-       sdev->inquiry = kmalloc(sdev->inquiry_len, GFP_ATOMIC);
-       if (sdev->inquiry == NULL) {
+
+       /*
+        * Copy at least 36 bytes of INQUIRY data, so that we don't
+        * dereference unallocated memory when accessing the Vendor,
+        * Product, and Revision strings.  Badly behaved devices may set
+        * the INQUIRY Additional Length byte to a small value, indicating
+        * these strings are invalid, but often they contain plausible data
+        * nonetheless.  It doesn't matter if the device sent < 36 bytes
+        * total, since scsi_probe_lun() initializes inq_result with 0s.
+        */
+       sdev->inquiry = kmemdup(inq_result,
+                               max_t(size_t, sdev->inquiry_len, 36),
+                               GFP_ATOMIC);
+       if (sdev->inquiry == NULL)
                return SCSI_SCAN_NO_RESPONSE;
-       }
 
-       memcpy(sdev->inquiry, inq_result, sdev->inquiry_len);
        sdev->vendor = (char *) (sdev->inquiry + 8);
        sdev->model = (char *) (sdev->inquiry + 16);
        sdev->rev = (char *) (sdev->inquiry + 32);
index 9ed640d357285505f8fcceb633444bc20b66898a..ea426115c6f952ed3a83198cf8ce30adebadf80e 100644 (file)
@@ -145,12 +145,18 @@ static void nvGetClocks(struct nvidia_par *par, unsigned int *MClk,
 
        if (par->Architecture >= NV_ARCH_40) {
                pll = NV_RD32(par->PMC, 0x4020);
-               P = (pll >> 16) & 0x03;
+               P = (pll >> 16) & 0x07;
                pll = NV_RD32(par->PMC, 0x4024);
                M = pll & 0xFF;
                N = (pll >> 8) & 0xFF;
-               MB = (pll >> 16) & 0xFF;
-               NB = (pll >> 24) & 0xFF;
+               if (((par->Chipset & 0xfff0) == 0x0290) ||
+                               ((par->Chipset & 0xfff0) == 0x0390)) {
+                       MB = 1;
+                       NB = 1;
+               } else {
+                       MB = (pll >> 16) & 0xFF;
+                       NB = (pll >> 24) & 0xFF;
+               }
                *MClk = ((N * NB * par->CrystalFreqKHz) / (M * MB)) >> P;
 
                pll = NV_RD32(par->PMC, 0x4000);
index a18a9aebf05fb2f7ea9c428ee7171068b9bfd5c5..61dc46fecf2bab1ad060fa8e392278678ac3bee3 100644 (file)
@@ -359,6 +359,7 @@ int NVCommonSetup(struct fb_info *info)
        case 0x0186:
        case 0x0187:
        case 0x018D:
+       case 0x0228:
        case 0x0286:
        case 0x028C:
        case 0x0316:
@@ -382,6 +383,10 @@ int NVCommonSetup(struct fb_info *info)
        case 0x034C:
        case 0x0160:
        case 0x0166:
+       case 0x0169:
+       case 0x016B:
+       case 0x016C:
+       case 0x016D:
        case 0x00C8:
        case 0x00CC:
        case 0x0144:
@@ -639,12 +644,23 @@ int NVCommonSetup(struct fb_info *info)
                par->fpHeight = NV_RD32(par->PRAMDAC, 0x0800) + 1;
                par->fpSyncs = NV_RD32(par->PRAMDAC, 0x0848) & 0x30000033;
 
-               printk("Panel size is %i x %i\n", par->fpWidth, par->fpHeight);
+               printk("nvidiafb: Panel size is %i x %i\n", par->fpWidth, par->fpHeight);
        }
 
        if (monA)
                info->monspecs = *monA;
 
+       if (!par->FlatPanel || !par->twoHeads)
+               par->FPDither = 0;
+
+       par->LVDS = 0;
+       if (par->FlatPanel && par->twoHeads) {
+               NV_WR32(par->PRAMDAC0, 0x08B0, 0x00010004);
+               if (par->PRAMDAC0[0x08b4] & 1)
+                       par->LVDS = 1;
+               printk("nvidiafb: Panel is %s\n", par->LVDS ? "LVDS" : "TMDS");
+       }
+
        kfree(edidA);
        kfree(edidB);
 done:
index acdc26693402bb4486476bb9c8926ffed579eba9..86e65dea60d3a9b2aebf2136d7a2a93526a0b6f5 100644 (file)
@@ -129,6 +129,7 @@ struct nvidia_par {
        int fpHeight;
        int PanelTweak;
        int paneltweak;
+       int LVDS;
        int pm_state;
        u32 crtcSync_read;
        u32 fpSyncs;
index eb24107bcc81f539a4a7e92b87fb5efb0523f9d1..538e947610e19374dfa71c66d310f444262ac636 100644 (file)
@@ -1160,20 +1160,20 @@ static u32 __devinit nvidia_get_arch(struct fb_info *info)
        case 0x0340:            /* GeForceFX 5700 */
                arch = NV_ARCH_30;
                break;
-       case 0x0040:
-       case 0x00C0:
-       case 0x0120:
+       case 0x0040:            /* GeForce 6800 */
+       case 0x00C0:            /* GeForce 6800 */
+       case 0x0120:            /* GeForce 6800 */
        case 0x0130:
-       case 0x0140:
-       case 0x0160:
-       case 0x01D0:
-       case 0x0090:
-       case 0x0210:
-       case 0x0220:
+       case 0x0140:            /* GeForce 6600 */
+       case 0x0160:            /* GeForce 6200 */
+       case 0x01D0:            /* GeForce 7200, 7300, 7400 */
+       case 0x0090:            /* GeForce 7800 */
+       case 0x0210:            /* GeForce 6800 */
+       case 0x0220:            /* GeForce 6200 */
        case 0x0230:
-       case 0x0240:
-       case 0x0290:
-       case 0x0390:
+       case 0x0240:            /* GeForce 6100 */
+       case 0x0290:            /* GeForce 7900 */
+       case 0x0390:            /* GeForce 7600 */
                arch = NV_ARCH_40;
                break;
        case 0x0020:            /* TNT, TNT2 */
index 1d9efe541662927819dc2c70220da507ea6f98dd..e715c794b1865d0216cc9697b8b716e139f89c93 100644 (file)
  */
 #define TO_PHYS(x)             (TO_PHYS_MASK & (x))
 #define TO_CAC(x)              (CAC_BASE     | TO_PHYS(x))
+#ifdef CONFIG_SGI_SN
 #define TO_AMO(x)              (AMO_BASE     | TO_PHYS(x))
 #define TO_GET(x)              (GET_BASE     | TO_PHYS(x))
-
+#else
+#define TO_AMO(x)              ({ BUG(); x; })
+#define TO_GET(x)              ({ BUG(); x; })
+#endif
 
 /*
  * Covert from processor physical address to II/TIO physical address:
index bf4cf2080e5cb1c0ba57abf88b7a85951fd0d7fb..012cd558189b443e6f3856426313cd783c6a36ce 100644 (file)
@@ -114,7 +114,7 @@ struct exec_domain {
  * Change personality of the currently running process.
  */
 #define set_personality(pers) \
-       ((current->personality == pers) ? 0 : __set_personality(pers))
+       ((current->personality == (pers)) ? 0 : __set_personality(pers))
 
 #endif /* __KERNEL__ */
 
index dc9a29d84abc85d1d79ae25a0bb976d527958a94..924e502905d40a27cdd6e7afe5d37e9d88b526b4 100644 (file)
@@ -23,13 +23,14 @@ struct vm_area_struct;
 #endif
 
 struct vm_struct {
+       /* keep next,addr,size together to speedup lookups */
+       struct vm_struct        *next;
        void                    *addr;
        unsigned long           size;
        unsigned long           flags;
        struct page             **pages;
        unsigned int            nr_pages;
        unsigned long           phys_addr;
-       struct vm_struct        *next;
 };
 
 /*
index 3da978eec791216dd796cd704aed67b263713fa1..4b4eab2a316136fc3bd44bdb7e55eeee509b1030 100644 (file)
@@ -687,6 +687,7 @@ static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
                 * the latest pointer.
                 */
                spin_lock(&oldf->file_lock);
+               open_files = count_open_files(old_fdt);
                old_fdt = files_fdtable(oldf);
        }
 
index 543ea2e5ad9301944ab520303bd7fe84e4e92f88..9c7e2e4c1fe717ef0f309eed0163a2d28a6cd5a7 100644 (file)
@@ -147,7 +147,11 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
        if (unlikely(irqfixup)) {
                /* Don't punish working computers */
                if ((irqfixup == 2 && irq == 0) || action_ret == IRQ_NONE) {
-                       int ok = misrouted_irq(irq);
+                       int ok;
+
+                       spin_unlock(&desc->lock);
+                       ok = misrouted_irq(irq);
+                       spin_lock(&desc->lock);
                        if (action_ret == IRQ_NONE)
                                desc->irqs_unhandled -= ok;
                }
index 46606c133e824ea4a12f8ae7ca818c333a938628..7dc6aa745166cf680092103195e725619c4ce633 100644 (file)
@@ -186,10 +186,8 @@ static struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long fl
        if (unlikely(!area))
                return NULL;
 
-       if (unlikely(!size)) {
-               kfree (area);
+       if (unlikely(!size))
                return NULL;
-       }
 
        /*
         * We always allocate a guard page.
@@ -532,11 +530,12 @@ void *vmalloc_user(unsigned long size)
        void *ret;
 
        ret = __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL);
-       write_lock(&vmlist_lock);
-       area = __find_vm_area(ret);
-       area->flags |= VM_USERMAP;
-       write_unlock(&vmlist_lock);
-
+       if (ret) {
+               write_lock(&vmlist_lock);
+               area = __find_vm_area(ret);
+               area->flags |= VM_USERMAP;
+               write_unlock(&vmlist_lock);
+       }
        return ret;
 }
 EXPORT_SYMBOL(vmalloc_user);
@@ -605,11 +604,12 @@ void *vmalloc_32_user(unsigned long size)
        void *ret;
 
        ret = __vmalloc(size, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);
-       write_lock(&vmlist_lock);
-       area = __find_vm_area(ret);
-       area->flags |= VM_USERMAP;
-       write_unlock(&vmlist_lock);
-
+       if (ret) {
+               write_lock(&vmlist_lock);
+               area = __find_vm_area(ret);
+               area->flags |= VM_USERMAP;
+               write_unlock(&vmlist_lock);
+       }
        return ret;
 }
 EXPORT_SYMBOL(vmalloc_32_user);
index e8ad1f6b3da4891f5996735afa64603ae018f916..b49584c932cc21bf371d29cb0cafd0361d64061f 100644 (file)
@@ -6,6 +6,8 @@ lex.*.c
 *.tab.c
 *.tab.h
 zconf.hash.c
+*.moc
+lkc_defs.h
 
 #
 # configuration programs