Merge commit master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa of HEAD
authorLinus Torvalds <torvalds@g5.osdl.org>
Wed, 12 Jul 2006 20:03:35 +0000 (13:03 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 12 Jul 2006 20:03:35 +0000 (13:03 -0700)
* HEAD:
  [ALSA] Fix undefined (missing) references in ISA MIRO sound driver
  [ALSA] make sound/isa/gus/gusextreme.c:devices static
  [ALSA] hda-codec - Fix missing array terminators in AD1988 codec support
  [ALSA] Fix a deadlock in snd-rtctimer
  [ALSA] Fix section mismatch errors in ALSA PCI drivers
  [ALSA] remove unused snd_minor.name field
  [ALSA] Fix no mpu401 interface can cause hard freeze
  [ALSA] wavefront: fix __init/__devinit confusion
  [ALSA] Fix workaround for AD1988A rev2 codec
  [ALSA] trivial: Code clean up of i2c/cs8427.c
  [ALSA] sound/i2c/cs8427.c: don't export a static function
  [ALSA] intel8x0 - Add ac97 quirk for Tyan Thunder K8WE board
  [ALSA] Reduce the string length of Terratec Aureon 7.1 Universe
  [ALSA] sound/pci/Kconfig - fix broken indenting for SND_FM801_TEA575X
  [ALSA] fix the SND_FM801_TEA575X dependencies
  [ALSA] Memory leak in sound/pcmcia/pdaudiocf/pdaudiocf.c

15 files changed:
drivers/char/rtc.c
drivers/ide/pci/generic.c
drivers/pci/msi.c
drivers/pci/quirks.c
fs/file.c
fs/proc/kcore.c
fs/sysfs/inode.c
include/asm-frv/processor.h
include/asm-h8300/processor.h
include/asm-m68knommu/processor.h
include/asm-sh/processor.h
include/asm-sh64/processor.h
include/asm-v850/processor.h
include/asm-xtensa/processor.h
kernel/sys.c

index 6ccc364..6e6a7c7 100644 (file)
@@ -1245,7 +1245,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file)
 
 void rtc_get_rtc_time(struct rtc_time *rtc_tm)
 {
-       unsigned long uip_watchdog = jiffies;
+       unsigned long uip_watchdog = jiffies, flags;
        unsigned char ctrl;
 #ifdef CONFIG_MACH_DECSTATION
        unsigned int real_year;
@@ -1272,7 +1272,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
         * RTC has RTC_DAY_OF_WEEK, we should usually ignore it, as it is
         * only updated by the RTC when initially set to a non-zero value.
         */
-       spin_lock_irq(&rtc_lock);
+       spin_lock_irqsave(&rtc_lock, flags);
        rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS);
        rtc_tm->tm_min = CMOS_READ(RTC_MINUTES);
        rtc_tm->tm_hour = CMOS_READ(RTC_HOURS);
@@ -1286,7 +1286,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
        real_year = CMOS_READ(RTC_DEC_YEAR);
 #endif
        ctrl = CMOS_READ(RTC_CONTROL);
-       spin_unlock_irq(&rtc_lock);
+       spin_unlock_irqrestore(&rtc_lock, flags);
 
        if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
        {
index f82e821..2f962cf 100644 (file)
@@ -212,6 +212,9 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi
            (!(PCI_FUNC(dev->devfn) & 1)))
                goto out;
 
+       if (dev->vendor == PCI_VENDOR_ID_JMICRON && PCI_FUNC(dev->devfn) != 1)
+               goto out;
+
        pci_read_config_word(dev, PCI_COMMAND, &command);
        if (!(command & PCI_COMMAND_IO)) {
                printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name);
@@ -239,6 +242,11 @@ static struct pci_device_id generic_pci_tbl[] = {
        { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
        { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13},
        { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION,          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18},
+       { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19},
        /* Must come last. If you add entries adjust this table appropriately and the init_one code */
        { PCI_ANY_ID,           PCI_ANY_ID,                        PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0},
        { 0, },
index 36bc7c4..a83c1f5 100644 (file)
@@ -47,13 +47,13 @@ msi_register(struct msi_ops *ops)
 
 static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags)
 {
-       memset(p, 0, NR_IRQS * sizeof(struct msi_desc));
+       memset(p, 0, sizeof(struct msi_desc));
 }
 
 static int msi_cache_init(void)
 {
        msi_cachep = kmem_cache_create("msi_cache",
-                       NR_IRQS * sizeof(struct msi_desc),
+                       sizeof(struct msi_desc),
                        0, SLAB_HWCACHE_ALIGN, msi_cache_ctor, NULL);
        if (!msi_cachep)
                return -ENOMEM;
index e9a57af..de3bbc8 100644 (file)
@@ -1175,6 +1175,55 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI,       PCI_DEVICE_ID_SI_962,           quirk_sis_96x_
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI,     PCI_DEVICE_ID_SI_963,           quirk_sis_96x_smbus );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI,     PCI_DEVICE_ID_SI_LPC,           quirk_sis_96x_smbus );
 
+#if defined(CONFIG_SCSI_SATA) || defined(CONFIG_SCSI_SATA_MODULE)
+
+/*
+ *     If we are using libata we can drive this chip properly but must
+ *     do this early on to make the additional device appear during
+ *     the PCI scanning.
+ */
+
+static void __devinit quirk_jmicron_dualfn(struct pci_dev *pdev)
+{
+       u32 conf;
+       u8 hdr;
+
+       /* Only poke fn 0 */
+       if (PCI_FUNC(pdev->devfn))
+               return;
+
+       switch(pdev->device) {
+               case PCI_DEVICE_ID_JMICRON_JMB365:
+               case PCI_DEVICE_ID_JMICRON_JMB366:
+                       /* Redirect IDE second PATA port to the right spot */
+                       pci_read_config_dword(pdev, 0x80, &conf);
+                       conf |= (1 << 24);
+                       /* Fall through */
+                       pci_write_config_dword(pdev, 0x80, conf);
+               case PCI_DEVICE_ID_JMICRON_JMB361:
+               case PCI_DEVICE_ID_JMICRON_JMB363:
+                       pci_read_config_dword(pdev, 0x40, &conf);
+                       /* Enable dual function mode, AHCI on fn 0, IDE fn1 */
+                       /* Set the class codes correctly and then direct IDE 0 */
+                       conf &= ~0x000F0200;    /* Clear bit 9 and 16-19 */
+                       conf |=  0x00C20002;    /* Set bit 1, 17, 22, 23 */
+                       pci_write_config_dword(pdev, 0x40, conf);
+
+                       /* Reconfigure so that the PCI scanner discovers the
+                          device is now multifunction */
+
+                       pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr);
+                       pdev->hdr_type = hdr & 0x7f;
+                       pdev->multifunction = !!(hdr & 0x80);
+
+                       break;
+       }
+}
+
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn);
+
+#endif
+
 #ifdef CONFIG_X86_IO_APIC
 static void __init quirk_alder_ioapic(struct pci_dev *pdev)
 {
index 3f35608..b3c6b82 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -240,7 +240,7 @@ static struct fdtable *alloc_fdtable(int nr)
        if (!fdt)
                goto out;
 
-       nfds = max_t(int, 8 * L1_CACHE_BYTES, roundup_pow_of_two(nfds));
+       nfds = max_t(int, 8 * L1_CACHE_BYTES, roundup_pow_of_two(nr + 1));
        if (nfds > NR_OPEN)
                nfds = NR_OPEN;
 
@@ -273,11 +273,13 @@ static struct fdtable *alloc_fdtable(int nr)
        } while (nfds <= nr);
        new_fds = alloc_fd_array(nfds);
        if (!new_fds)
-               goto out;
+               goto out2;
        fdt->fd = new_fds;
        fdt->max_fds = nfds;
        fdt->free_files = NULL;
        return fdt;
+out2:
+       nfds = fdt->max_fdset;
 out:
        if (new_openset)
                free_fdset(new_openset, nfds);
index 8d6d85d..6a984f6 100644 (file)
@@ -382,7 +382,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
                                 */
                                if (n) { 
                                        if (clear_user(buffer + tsz - n,
-                                                               tsz - n))
+                                                               n))
                                                return -EFAULT;
                                }
                        } else {
index 5e0e31c..9889e54 100644 (file)
@@ -109,6 +109,17 @@ static inline void set_inode_attr(struct inode * inode, struct iattr * iattr)
        inode->i_ctime = iattr->ia_ctime;
 }
 
+
+/*
+ * sysfs has a different i_mutex lock order behavior for i_mutex than other
+ * filesystems; sysfs i_mutex is called in many places with subsystem locks
+ * held. At the same time, many of the VFS locking rules do not apply to
+ * sysfs at all (cross directory rename for example). To untangle this mess
+ * (which gives false positives in lockdep), we're giving sysfs inodes their
+ * own class for i_mutex.
+ */
+static struct lock_class_key sysfs_inode_imutex_key;
+
 struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd)
 {
        struct inode * inode = new_inode(sysfs_sb);
@@ -118,6 +129,7 @@ struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent * sd)
                inode->i_mapping->a_ops = &sysfs_aops;
                inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info;
                inode->i_op = &sysfs_inode_operations;
+               lockdep_set_class(&inode->i_mutex, &sysfs_inode_imutex_key);
 
                if (sd->s_iattr) {
                        /* sysfs_dirent has non-default attributes
index 1c4dba1..3744f2e 100644 (file)
@@ -21,6 +21,7 @@
  */
 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
 
+#include <linux/compiler.h>
 #include <linux/linkage.h>
 #include <asm/sections.h>
 #include <asm/segment.h>
@@ -139,7 +140,7 @@ unsigned long get_wchan(struct task_struct *p);
 extern struct task_struct *alloc_task_struct(void);
 extern void free_task_struct(struct task_struct *p);
 
-#define cpu_relax()    do { } while (0)
+#define cpu_relax()    barrier()
 
 /* data cache prefetch */
 #define ARCH_HAS_PREFETCH
index c7e2f45..99b664a 100644 (file)
@@ -17,6 +17,7 @@
  */
 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
 
+#include <linux/compiler.h>
 #include <asm/segment.h>
 #include <asm/fpu.h>
 #include <asm/ptrace.h>
@@ -129,6 +130,6 @@ unsigned long get_wchan(struct task_struct *p);
        eip; })
 #define        KSTK_ESP(tsk)   ((tsk) == current ? rdusp() : (tsk)->thread.usp)
 
-#define cpu_relax()    do { } while (0)
+#define cpu_relax()    barrier()
 
 #endif
index 0ee158e..9d3a1bf 100644 (file)
@@ -13,6 +13,7 @@
  */
 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
 
+#include <linux/compiler.h>
 #include <linux/threads.h>
 #include <asm/types.h>
 #include <asm/segment.h>
@@ -137,6 +138,6 @@ unsigned long get_wchan(struct task_struct *p);
        eip; })
 #define        KSTK_ESP(tsk)   ((tsk) == current ? rdusp() : (tsk)->thread.usp)
 
-#define cpu_relax()    do { } while (0)
+#define cpu_relax()    barrier()
 
 #endif
index fa5bd2d..eeb0f48 100644 (file)
@@ -9,6 +9,7 @@
 #define __ASM_SH_PROCESSOR_H
 #ifdef __KERNEL__
 
+#include <linux/compiler.h>
 #include <asm/page.h>
 #include <asm/types.h>
 #include <asm/cache.h>
@@ -263,7 +264,7 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define KSTK_ESP(tsk)  ((tsk)->thread.sp)
 
 #define cpu_sleep()    __asm__ __volatile__ ("sleep" : : : "memory")
-#define cpu_relax()    do { } while (0)
+#define cpu_relax()    barrier()
 
 #endif /* __KERNEL__ */
 #endif /* __ASM_SH_PROCESSOR_H */
index 1bf252d..eb2bee4 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/cache.h>
 #include <asm/registers.h>
 #include <linux/threads.h>
+#include <linux/compiler.h>
 
 /*
  * Default implementation of macro that returns current
@@ -279,7 +280,7 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define KSTK_EIP(tsk)  ((tsk)->thread.pc)
 #define KSTK_ESP(tsk)  ((tsk)->thread.sp)
 
-#define cpu_relax()    do { } while (0)
+#define cpu_relax()    barrier()
 
 #endif /* __ASSEMBLY__ */
 #endif /* __ASM_SH64_PROCESSOR_H */
index 6965b66..979e346 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/thread_info.h>
 #endif
 
+#include <linux/compiler.h>
 #include <asm/ptrace.h>
 #include <asm/entry.h>
 
@@ -106,7 +107,7 @@ unsigned long get_wchan (struct task_struct *p);
 #define KSTK_ESP(task) task_sp (task)
 
 
-#define cpu_relax()    ((void)0)
+#define cpu_relax()    barrier()
 
 
 #else /* __ASSEMBLY__ */
index d1d72ad..8b96e77 100644 (file)
@@ -20,6 +20,7 @@
 #include <xtensa/config/tie.h>
 #include <xtensa/config/system.h>
 
+#include <linux/compiler.h>
 #include <asm/ptrace.h>
 #include <asm/types.h>
 #include <asm/coprocessor.h>
@@ -191,7 +192,7 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define KSTK_EIP(tsk)          (task_pt_regs(tsk)->pc)
 #define KSTK_ESP(tsk)          (task_pt_regs(tsk)->areg[1])
 
-#define cpu_relax()  do { } while (0)
+#define cpu_relax()  barrier()
 
 /* Special register access. */
 
index dbb3b9c..e236f98 100644 (file)
@@ -1983,7 +1983,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
                        error = current->mm->dumpable;
                        break;
                case PR_SET_DUMPABLE:
-                       if (arg2 < 0 || arg2 > 2) {
+                       if (arg2 < 0 || arg2 > 1) {
                                error = -EINVAL;
                                break;
                        }