]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge branch 'for-linus' of git://brick.kernel.dk/data/git/linux-2.6-block
authorLinus Torvalds <torvalds@g5.osdl.org>
Thu, 20 Apr 2006 15:17:04 +0000 (08:17 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 20 Apr 2006 15:17:04 +0000 (08:17 -0700)
* 'for-linus' of git://brick.kernel.dk/data/git/linux-2.6-block:
  [PATCH] block/elevator.c: remove unused exports
  [PATCH] splice: fix smaller sized splice reads
  [PATCH] Don't inherit ->splice_pipe across forks
  [patch] cleanup: use blk_queue_stopped
  [PATCH] Document online io scheduler switching

24 files changed:
Documentation/feature-removal-schedule.txt
MAINTAINERS
arch/i386/kernel/cpu/amd.c
arch/x86_64/kernel/process.c
arch/x86_64/kernel/setup.c
drivers/char/cs5535_gpio.c
drivers/char/sonypi.c
drivers/i2c/busses/i2c-i801.c
drivers/md/md.c
drivers/pci/quirks.c
drivers/video/pm2fb.c
include/asm-i386/cpufeature.h
include/asm-i386/i387.h
include/asm-sparc/unistd.h
include/asm-sparc64/unistd.h
include/asm-x86_64/cache.h
include/asm-x86_64/cpufeature.h
include/asm-x86_64/i387.h
include/asm-xtensa/ioctls.h
include/linux/memory_hotplug.h
kernel/kprobes.c
mm/mempolicy.c
sound/drivers/mpu401/mpu401_uart.c
sound/oss/Kconfig

index 293fed113dff3fe08dbffb4db235ca62612ea7fc..421bcfff6ad21be680fcf819243ca9d750fa8ab2 100644 (file)
@@ -25,8 +25,9 @@ Who:  Adrian Bunk <bunk@stusta.de>
 
 ---------------------------
 
-What:  drivers depending on OBSOLETE_OSS_DRIVER
-When:  January 2006
+What:  drivers that were depending on OBSOLETE_OSS_DRIVER
+        (config options already removed)
+When:  before 2.6.19
 Why:   OSS drivers with ALSA replacements
 Who:   Adrian Bunk <bunk@stusta.de>
 
index 78a2f5b4322e9b129da34f19d4c07985f2fc8f1c..61060e82fb0eb0f28b5c496f045e7b2b7845f6b1 100644 (file)
@@ -1458,6 +1458,13 @@ M:       support@pathscale.com
 L:     openib-general@openib.org
 S:     Supported
 
+IPMI SUBSYSTEM
+P:     Corey Minyard
+M:     minyard@acm.org
+L:     openipmi-developer@lists.sourceforge.net
+W:     http://openipmi.sourceforge.net/
+S:     Supported
+
 IPX NETWORK LAYER
 P:     Arnaldo Carvalho de Melo
 M:     acme@conectiva.com.br
index ff2b2154ac1b6c8a0e4bddec0d27319575f47933..786d1a57048b9156396a7f7d5739306097420c60 100644 (file)
@@ -207,6 +207,8 @@ static void __init init_amd(struct cpuinfo_x86 *c)
                set_bit(X86_FEATURE_K7, c->x86_capability); 
                break;
        }
+       if (c->x86 >= 6)
+               set_bit(X86_FEATURE_FXSAVE_LEAK, c->x86_capability);
 
        display_cacheinfo(c);
 
index 1c44b53cb15bb48391cf4300dbb93fd5fac34835..fb903e65e079a26034f76a30ef6f54b40613453d 100644 (file)
@@ -575,8 +575,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
        prev->userrsp = read_pda(oldrsp); 
        write_pda(oldrsp, next->userrsp); 
        write_pda(pcurrent, next_p); 
+
        /* This must be here to ensure both math_state_restore() and
-          kernel_fpu_begin() work consistently. */
+          kernel_fpu_begin() work consistently. 
+          And the AMD workaround requires it to be after DS reload. */
        unlazy_fpu(prev_p);
        write_pda(kernelstack,
                  task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET);
index c50b06765a80ddc16d0d17a59055a8cd42044cea..759070c827511bb482c3b770ff0f35407746936c 100644 (file)
@@ -930,6 +930,10 @@ static int __init init_amd(struct cpuinfo_x86 *c)
        if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58))
                set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability);
 
+       /* Enable workaround for FXSAVE leak */
+       if (c->x86 >= 6)
+               set_bit(X86_FEATURE_FXSAVE_LEAK, &c->x86_capability);
+
        r = get_model_name(c);
        if (!r) { 
                switch (c->x86) { 
index 5d72f50de1ac97c6e377fb6c5e0d0d4192016983..46d66037b917c5851222b56af77f4b158ce793aa 100644 (file)
@@ -241,9 +241,10 @@ static int __init cs5535_gpio_init(void)
 static void __exit cs5535_gpio_cleanup(void)
 {
        dev_t dev_id = MKDEV(major, 0);
+
+       cdev_del(&cs5535_gpio_cdev);
        unregister_chrdev_region(dev_id, CS5535_GPIO_COUNT);
-       if (gpio_base != 0)
-               release_region(gpio_base, CS5535_GPIO_SIZE);
+       release_region(gpio_base, CS5535_GPIO_SIZE);
 }
 
 module_init(cs5535_gpio_init);
index f8dd8527c6aa9d8e30d17a26b64ed5b5dcccb2f7..a90f5d97df35dc8c262145efe0187085a6bd2009 100644 (file)
@@ -1341,6 +1341,9 @@ static int __devinit sonypi_probe(struct platform_device *dev)
        else if ((pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
                                          PCI_DEVICE_ID_INTEL_ICH6_1, NULL)))
                sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE3;
+       else if ((pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
+                                         PCI_DEVICE_ID_INTEL_ICH7_1, NULL)))
+               sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE3;
        else
                sonypi_device.model = SONYPI_DEVICE_MODEL_TYPE2;
 
index 8e0f3158215f6bc191864ef5f0a87f49ecc67bbd..dfca74933625e0c1c629778f0af1f9f8f00351b3 100644 (file)
@@ -478,6 +478,11 @@ static s32 i801_access(struct i2c_adapter * adap, u16 addr,
                ret = i801_transaction();
        }
 
+       /* Some BIOSes don't like it when PEC is enabled at reboot or resume
+          time, so we forcibly disable it after every transaction. */
+       if (hwpec)
+               outb_p(0, SMBAUXCTL);
+
        if(block)
                return ret;
        if(ret)
index 434ca39d19c1d7b7dfb40c1163cb8281a52aeefb..d7316b829a62687a4c29372a893d2684121fb3a3 100644 (file)
@@ -279,11 +279,6 @@ static inline int mddev_lock(mddev_t * mddev)
        return mutex_lock_interruptible(&mddev->reconfig_mutex);
 }
 
-static inline void mddev_lock_uninterruptible(mddev_t * mddev)
-{
-       mutex_lock(&mddev->reconfig_mutex);
-}
-
 static inline int mddev_trylock(mddev_t * mddev)
 {
        return mutex_trylock(&mddev->reconfig_mutex);
@@ -2458,9 +2453,11 @@ md_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
 
        if (!entry->show)
                return -EIO;
-       mddev_lock(mddev);
-       rv = entry->show(mddev, page);
-       mddev_unlock(mddev);
+       rv = mddev_lock(mddev);
+       if (!rv) {
+               rv = entry->show(mddev, page);
+               mddev_unlock(mddev);
+       }
        return rv;
 }
 
@@ -2474,9 +2471,11 @@ md_attr_store(struct kobject *kobj, struct attribute *attr,
 
        if (!entry->store)
                return -EIO;
-       mddev_lock(mddev);
-       rv = entry->store(mddev, page, length);
-       mddev_unlock(mddev);
+       rv = mddev_lock(mddev);
+       if (!rv) {
+               rv = entry->store(mddev, page, length);
+               mddev_unlock(mddev);
+       }
        return rv;
 }
 
@@ -4341,8 +4340,9 @@ static int md_seq_show(struct seq_file *seq, void *v)
                return 0;
        }
 
-       if (mddev_lock(mddev)!=0) 
+       if (mddev_lock(mddev) < 0)
                return -EINTR;
+
        if (mddev->pers || mddev->raid_disks || !list_empty(&mddev->disks)) {
                seq_printf(seq, "%s : %sactive", mdname(mddev),
                                                mddev->pers ? "" : "in");
index 827550d25c9e3cfb058c8ef3d579fa09da1164d1..c42ae2cf8d64a262036381bd07ebb66b5d1b1cf8 100644 (file)
@@ -864,6 +864,35 @@ static void __init quirk_eisa_bridge(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_82375,      quirk_eisa_bridge );
 
+/*
+ * On the MSI-K8T-Neo2Fir Board, the internal Soundcard is disabled
+ * when a PCI-Soundcard is added. The BIOS only gives Options
+ * "Disabled" and "AUTO". This Quirk Sets the corresponding
+ * Register-Value to enable the Soundcard.
+ */
+static void __init k8t_sound_hostbridge(struct pci_dev *dev)
+{
+       unsigned char val;
+
+       printk(KERN_INFO "PCI: Quirk-MSI-K8T Soundcard On\n");
+       pci_read_config_byte(dev, 0x50, &val);
+       if (val == 0x88 || val == 0xc8) {
+               pci_write_config_byte(dev, 0x50, val & (~0x40));
+
+               /* Verify the Change for Status output */
+               pci_read_config_byte(dev, 0x50, &val);
+               if (val & 0x40)
+                       printk(KERN_INFO "PCI: MSI-K8T soundcard still off\n");
+               else
+                       printk(KERN_INFO "PCI: MSI-K8T soundcard on\n");
+       } else {
+               printk(KERN_INFO "PCI: Unexpected Value in PCI-Register: "
+                                       "no Change!\n");
+       }
+
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_hostbridge);
+
 /*
  * On ASUS P4B boards, the SMBus PCI Device within the ICH2/4 southbridge
  * is not activated. The myth is that Asus said that they do not want the
index 5fe197943deb4a1c1deea3fa3b71e716a93265b0..4e963930b50ae40ee358e19e999e12dc5b3db368 100644 (file)
@@ -73,8 +73,8 @@ static char *mode __devinitdata = NULL;
  * these flags allow the user to specify that requests for +ve sync
  * should be silently turned in -ve sync.
  */
-static int lowhsync __devinitdata = 0;
-static int lowvsync __devinitdata = 0;
+static int lowhsync;
+static int lowvsync;
 
 /*
  * The hardware state of the graphics card that isn't part of the
index 5c0b5876b9318cf7e41af251c367597776330569..b44bfc6239cb51debea374b173e58b5469f8ff1c 100644 (file)
@@ -71,6 +71,7 @@
 #define X86_FEATURE_P4         (3*32+ 7) /* P4 */
 #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */
 #define X86_FEATURE_UP         (3*32+ 9) /* smp kernel running on up */
+#define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */
 
 /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
 #define X86_FEATURE_XMM3       (4*32+ 0) /* Streaming SIMD Extensions-3 */
index 152d0baa576a675b39bfa408a6b69f670e8ad118..7b1f01191e7063df3ab056dfdb17e6de0bcd828f 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/sched.h>
 #include <linux/init.h>
+#include <linux/kernel_stat.h>
 #include <asm/processor.h>
 #include <asm/sigcontext.h>
 #include <asm/user.h>
@@ -38,17 +39,38 @@ extern void init_fpu(struct task_struct *);
 extern void kernel_fpu_begin(void);
 #define kernel_fpu_end() do { stts(); preempt_enable(); } while(0)
 
+/* We need a safe address that is cheap to find and that is already
+   in L1 during context switch. The best choices are unfortunately
+   different for UP and SMP */
+#ifdef CONFIG_SMP
+#define safe_address (__per_cpu_offset[0])
+#else
+#define safe_address (kstat_cpu(0).cpustat.user)
+#endif
+
 /*
  * These must be called with preempt disabled
  */
 static inline void __save_init_fpu( struct task_struct *tsk )
 {
+       /* Use more nops than strictly needed in case the compiler
+          varies code */
        alternative_input(
-               "fnsave %1 ; fwait ;" GENERIC_NOP2,
-               "fxsave %1 ; fnclex",
+               "fnsave %[fx] ;fwait;" GENERIC_NOP8 GENERIC_NOP4,
+               "fxsave %[fx]\n"
+               "bt $7,%[fsw] ; jc 1f ; fnclex\n1:",
                X86_FEATURE_FXSR,
-               "m" (tsk->thread.i387.fxsave)
-               :"memory");
+               [fx] "m" (tsk->thread.i387.fxsave),
+               [fsw] "m" (tsk->thread.i387.fxsave.swd) : "memory");
+       /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
+          is pending.  Clear the x87 state here by setting it to fixed
+          values. __per_cpu_offset[0] is a random variable that should be in L1 */
+       alternative_input(
+               GENERIC_NOP8 GENERIC_NOP2,
+               "emms\n\t"              /* clear stack tags */
+               "fildl %[addr]",        /* set F?P to defined value */
+               X86_FEATURE_FXSAVE_LEAK,
+               [addr] "m" (safe_address));
        task_thread_info(tsk)->status &= ~TS_USEDFPU;
 }
 
index 2a911aa4cae9f8578d2410a2d26fe07f8c868540..45feff893b8e0f9df1d5c60b6bd4ec423a150058 100644 (file)
 #define __NR_setfsgid           229 /* Linux Specific                              */
 #define __NR__newselect         230 /* Linux Specific                              */
 #define __NR_time               231 /* Linux Specific                              */
-#define __NR_sys_splice         232 /* Linux Specific                              */
+#define __NR_splice             232 /* Linux Specific                              */
 #define __NR_stime              233 /* Linux Specific                              */
 #define __NR_statfs64           234 /* Linux Specific                              */
 #define __NR_fstatfs64          235 /* Linux Specific                              */
index 6ada6a871cc8b60b3eaf4deb9b1ca158660c3894..597f6923a46eec7665cb887a0c2b7e9b51404f1c 100644 (file)
 #ifdef __KERNEL__
 #define __NR_time              231 /* Linux sparc32                               */
 #endif
-#define __NR_sys_splice         232 /* Linux Specific                              */
+#define __NR_splice             232 /* Linux Specific                              */
 #define __NR_stime              233 /* Linux Specific                              */
 #define __NR_statfs64           234 /* Linux Specific                              */
 #define __NR_fstatfs64          235 /* Linux Specific                              */
index c8043a16152e31fc52d3a48c32ae94ec2155eed9..f8dff1c67538b75381964b6c5c7b4dd3dcc9b37d 100644 (file)
@@ -20,8 +20,8 @@
        __attribute__((__section__(".data.page_aligned")))
 #endif
 
-#define __read_mostly __attribute__((__section__(".data.read_mostly")))
-
 #endif
 
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
 #endif
index 76bb6193ae9107a380ac6b754d5dd498869eef5f..662964b74e348f228fbb9c874567c574d6339175 100644 (file)
@@ -64,6 +64,7 @@
 #define X86_FEATURE_REP_GOOD   (3*32+ 4) /* rep microcode works well on this CPU */
 #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */
 #define X86_FEATURE_SYNC_RDTSC  (3*32+6)  /* RDTSC syncs CPU core */
+#define X86_FEATURE_FXSAVE_LEAK (3*32+7)  /* FIP/FOP/FDP leaks through FXSAVE */
 
 /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
 #define X86_FEATURE_XMM3       (4*32+ 0) /* Streaming SIMD Extensions-3 */
index 876eb9a2fe7868a7c7ce01ef694403b3150f4601..cba8a3b0cded5a77191d9528710b04c85bc13c5b 100644 (file)
@@ -72,6 +72,23 @@ extern int set_fpregs(struct task_struct *tsk,
 #define set_fpu_swd(t,val) ((t)->thread.i387.fxsave.swd = (val))
 #define set_fpu_fxsr_twd(t,val) ((t)->thread.i387.fxsave.twd = (val))
 
+#define X87_FSW_ES (1 << 7)    /* Exception Summary */
+
+/* AMD CPUs don't save/restore FDP/FIP/FOP unless an exception
+   is pending. Clear the x87 state here by setting it to fixed
+   values. The kernel data segment can be sometimes 0 and sometimes
+   new user value. Both should be ok.
+   Use the PDA as safe address because it should be already in L1. */
+static inline void clear_fpu_state(struct i387_fxsave_struct *fx)
+{
+       if (unlikely(fx->swd & X87_FSW_ES))
+                asm volatile("fnclex");
+       alternative_input(ASM_NOP8 ASM_NOP2,
+                    "    emms\n"               /* clear stack tags */
+                    "    fildl %%gs:0",        /* load to clear state */
+                    X86_FEATURE_FXSAVE_LEAK);
+}
+
 static inline int restore_fpu_checking(struct i387_fxsave_struct *fx) 
 { 
        int err;
@@ -119,6 +136,7 @@ static inline int save_i387_checking(struct i387_fxsave_struct __user *fx)
 #endif
        if (unlikely(err))
                __clear_user(fx, sizeof(struct i387_fxsave_struct));
+       /* No need to clear here because the caller clears USED_MATH */
        return err;
 } 
 
@@ -149,7 +167,7 @@ static inline void __fxsave_clear(struct task_struct *tsk)
                                "i" (offsetof(__typeof__(*tsk),
                                              thread.i387.fxsave)));
 #endif
-       __asm__ __volatile__("fnclex");
+       clear_fpu_state(&tsk->thread.i387.fxsave);
 }
 
 static inline void kernel_fpu_begin(void)
index 10c443435c117084abfbf10b204c7254eff26970..3b89a772d0a0b954e5cec7647cdf0890f0db68c5 100644 (file)
 #define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */
 
 #define TIOCMIWAIT     _IO('T', 92) /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT    _IOR('T', 93, struct async_icount) /* read serial port inline interrupt counts */
+#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
 
 #endif /* _XTENSA_IOCTLS_H */
index 4ca3e6ad03ec4c2b7838fec75386262dac583199..911206386171ccedc51397d9e36a7c424de9642c 100644 (file)
@@ -99,10 +99,7 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn,
        return -ENOSYS;
 }
 
-#if defined(CONFIG_MEMORY_HOTPLUG) || defined(CONFIG_ACPI_HOTPLUG_MEMORY) \
-       || defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)
 extern int add_memory(u64 start, u64 size);
 extern int remove_memory(u64 start, u64 size);
-#endif
 
 #endif /* __LINUX_MEMORY_HOTPLUG_H */
index 1156eb0977d04db06b1daeb926d776e87c34a5b7..1fbf466a29aab6ca0dfe1cf6e5d6ac16fba546d8 100644 (file)
@@ -585,6 +585,9 @@ int __kprobes register_kretprobe(struct kretprobe *rp)
        int i;
 
        rp->kp.pre_handler = pre_handler_kretprobe;
+       rp->kp.post_handler = NULL;
+       rp->kp.fault_handler = NULL;
+       rp->kp.break_handler = NULL;
 
        /* Pre-allocate memory for max kretprobe instances */
        if (rp->maxactive <= 0) {
index dec8249e972de3cdae046203b16ef32d25d1cda9..8778f58880c41c55cab9a2de035e960379b0cfe4 100644 (file)
@@ -1761,7 +1761,6 @@ static void gather_stats(struct page *page, void *private, int pte_dirty)
                md->mapcount_max = count;
 
        md->node[page_to_nid(page)]++;
-       cond_resched();
 }
 
 #ifdef CONFIG_HUGETLB_PAGE
index 8687ae3c66b8c54bf156e2424c0a9ecf6d8e4c9a..b49a45cbf67a09aa9faf39ae75671dd0f7cad1bf 100644 (file)
@@ -183,7 +183,8 @@ static void snd_mpu401_uart_remove_timer (struct snd_mpu401 *mpu, int input)
 
  */
 
-static void snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd, int ack)
+static int snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd,
+               int ack)
 {
        unsigned long flags;
        int timeout, ok;
@@ -218,9 +219,11 @@ static void snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd, int
                ok = 1;
        }
        spin_unlock_irqrestore(&mpu->input_lock, flags);
-       if (! ok)
+       if (!ok) {
                snd_printk("cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)\n", cmd, mpu->port, mpu->read(mpu, MPU401C(mpu)), mpu->read(mpu, MPU401D(mpu)));
-       // snd_printk("cmd: 0x%x at 0x%lx (status = 0x%x, data = 0x%x)\n", cmd, mpu->port, mpu->read(mpu, MPU401C(mpu)), mpu->read(mpu, MPU401D(mpu)));
+               return 1;
+       }
+       return 0;
 }
 
 /*
@@ -235,12 +238,19 @@ static int snd_mpu401_uart_input_open(struct snd_rawmidi_substream *substream)
        if (mpu->open_input && (err = mpu->open_input(mpu)) < 0)
                return err;
        if (! test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode)) {
-               snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1);
-               snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1);
+               if (snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1))
+                       goto error_out;
+               if (snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1))
+                       goto error_out;
        }
        mpu->substream_input = substream;
        set_bit(MPU401_MODE_BIT_INPUT, &mpu->mode);
        return 0;
+
+error_out:
+       if (mpu->open_input && mpu->close_input)
+               mpu->close_input(mpu);
+       return -EIO;
 }
 
 static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream)
@@ -252,39 +262,52 @@ static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream)
        if (mpu->open_output && (err = mpu->open_output(mpu)) < 0)
                return err;
        if (! test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) {
-               snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1);
-               snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1);
+               if (snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1))
+                       goto error_out;
+               if (snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1))
+                       goto error_out;
        }
        mpu->substream_output = substream;
        set_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode);
        return 0;
+
+error_out:
+       if (mpu->open_output && mpu->close_output)
+               mpu->close_output(mpu);
+       return -EIO;
 }
 
 static int snd_mpu401_uart_input_close(struct snd_rawmidi_substream *substream)
 {
        struct snd_mpu401 *mpu;
+       int err = 0;
 
        mpu = substream->rmidi->private_data;
        clear_bit(MPU401_MODE_BIT_INPUT, &mpu->mode);
        mpu->substream_input = NULL;
        if (! test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode))
-               snd_mpu401_uart_cmd(mpu, MPU401_RESET, 0);
+               err = snd_mpu401_uart_cmd(mpu, MPU401_RESET, 0);
        if (mpu->close_input)
                mpu->close_input(mpu);
+       if (err)
+               return -EIO;
        return 0;
 }
 
 static int snd_mpu401_uart_output_close(struct snd_rawmidi_substream *substream)
 {
        struct snd_mpu401 *mpu;
+       int err = 0;
 
        mpu = substream->rmidi->private_data;
        clear_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode);
        mpu->substream_output = NULL;
        if (! test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode))
-               snd_mpu401_uart_cmd(mpu, MPU401_RESET, 0);
+               err = snd_mpu401_uart_cmd(mpu, MPU401_RESET, 0);
        if (mpu->close_output)
                mpu->close_output(mpu);
+       if (err)
+               return -EIO;
        return 0;
 }
 
@@ -316,6 +339,7 @@ static void snd_mpu401_uart_input_trigger(struct snd_rawmidi_substream *substrea
                        snd_mpu401_uart_remove_timer(mpu, 1);
                clear_bit(MPU401_MODE_BIT_INPUT_TRIGGER, &mpu->mode);
        }
+
 }
 
 /*
index 88e52dc84c096b94514fd2e4ed76761edaceb42a..6275266dde2e754104badf084ce20003596a0d36 100644 (file)
@@ -5,23 +5,9 @@
 #
 # Prompt user for primary drivers.
 
-config OBSOLETE_OSS_DRIVER
-       bool "Obsolete OSS drivers"
-       depends on SOUND_PRIME
-       help
-         This option enables support for obsolete OSS drivers that
-         are scheduled for removal in the near future since there
-         are ALSA drivers for the same hardware.
-
-         Please contact Adrian Bunk <bunk@stusta.de> if you had to
-         say Y here because your soundcard is not properly supported
-         by ALSA.
-
-         If unsure, say N.
-
 config SOUND_BT878
        tristate "BT878 audio dma"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
+       depends on SOUND_PRIME && PCI
        ---help---
          Audio DMA support for bt878 based grabber boards.  As you might have
          already noticed, bt878 is listed with two functions in /proc/pci.
@@ -35,48 +21,9 @@ config SOUND_BT878
          To compile this driver as a module, choose M here: the module will
          be called btaudio.
 
-config SOUND_CMPCI
-       tristate "C-Media PCI (CMI8338/8738)"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
-       help
-         Say Y or M if you have a PCI sound card using the CMI8338
-         or the CMI8738 chipset.  Data on these chips are available at
-         <http://www.cmedia.com.tw/>.
-
-         A userspace utility to control some internal registers of these
-         chips is available at
-         <http://member.nifty.ne.jp/Breeze/softwares/unix/cmictl-e.html>.
-
-config SOUND_CMPCI_FM
-       bool "Enable legacy FM"
-       depends on SOUND_CMPCI && X86
-       help
-         Say Y here to enable the legacy FM (frequency-modulation) synthesizer
-         support on a card using the CMI8338 or CMI8378 chipset. Even it is
-         enabled, you need to set fmio as proper value to enable it.
-         Say N here if you don't need this.
-
-config SOUND_CMPCI_MIDI
-       bool "Enable legacy MPU-401"
-       depends on SOUND_CMPCI && X86
-       help
-         Say Y here to enable the legacy MPU401 MIDI synthesizer support on a
-         card using the CMI8338 or CMI8378 chipset. Even it is enabled,
-         you need to set mpuio as proper value to enable it.
-         Say N here if you don't need this.
-
-config SOUND_CMPCI_JOYSTICK
-       bool "Enable joystick"
-       depends on SOUND_CMPCI && X86 && (GAMEPORT=y || SOUND_CMPCI=GAMEPORT)
-       help
-         Say Y here in order to enable the joystick port on a sound card using
-         the CMI8338 or the CMI8738 chipset.  You need to config the
-         gameport support and set joystick parameter as 1 to use it.
-         Say N here if you don't need this.
-
 config SOUND_EMU10K1
        tristate "Creative SBLive! (EMU10K1)"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
+       depends on SOUND_PRIME && PCI
        ---help---
          Say Y or M if you have a PCI sound card using the EMU10K1 chipset,
          such as the Creative SBLive!, SB PCI512 or Emu-APS.
@@ -108,13 +55,6 @@ config SOUND_FUSION
          series) when wired as native sound drivers with AC97 codecs.  If
          this driver does not work try the CS4232 driver.
 
-config SOUND_CS4281
-       tristate "Crystal Sound CS4281"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
-       help
-         Picture and feature list at
-         <http://www.pcbroker.com/crystal4281.html>.
-
 config SOUND_BCM_CS4297A
        tristate "Crystal Sound CS4297a (for Swarm)"
        depends on SOUND_PRIME && SIBYTE_SWARM
@@ -125,22 +65,9 @@ config SOUND_BCM_CS4297A
          note that CONFIG_KGDB should not be enabled at the same
          time, since it also attempts to use this UART port.
 
-config SOUND_ES1370
-       tristate "Ensoniq AudioPCI (ES1370)"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
-       help
-         Say Y or M if you have a PCI sound card utilizing the Ensoniq
-         ES1370 chipset, such as Ensoniq's AudioPCI (non-97). To find
-         out if your sound card uses an ES1370 without removing your
-         computer's cover, use lspci -n and look for the PCI ID
-         1274:5000. Since Ensoniq was bought by Creative Labs,
-         Sound Blaster 64/PCI models are either ES1370 or ES1371 based.
-         This driver differs slightly from OSS/Free, so PLEASE READ
-         <file:Documentation/sound/oss/es1370>.
-
 config SOUND_ES1371
        tristate "Creative Ensoniq AudioPCI 97 (ES1371)"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
+       depends on SOUND_PRIME && PCI
        help
          Say Y or M if you have a PCI sound card utilizing the Ensoniq
          ES1371 chipset, such as Ensoniq's AudioPCI97. To find out if
@@ -151,33 +78,6 @@ config SOUND_ES1371
          slightly from OSS/Free, so PLEASE READ
          <file:Documentation/sound/oss/es1371>.
 
-config SOUND_ESSSOLO1
-       tristate "ESS Technology Solo1" 
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
-       help
-         Say Y or M if you have a PCI sound card utilizing the ESS Technology
-         Solo1 chip. To find out if your sound card uses a
-         Solo1 chip without removing your computer's cover, use
-         lspci -n and look for the PCI ID 125D:1969. This driver
-         differs slightly from OSS/Free, so PLEASE READ
-         <file:Documentation/sound/oss/solo1>.
-
-config SOUND_MAESTRO
-       tristate "ESS Maestro, Maestro2, Maestro2E driver"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
-       help
-         Say Y or M if you have a sound system driven by ESS's Maestro line
-         of PCI sound chips.  These include the Maestro 1, Maestro 2, and
-         Maestro 2E.  See <file:Documentation/sound/oss/Maestro> for more
-         details.
-
-config SOUND_MAESTRO3
-       tristate "ESS Maestro3/Allegro driver (EXPERIMENTAL)"
-       depends on SOUND_PRIME && PCI && EXPERIMENTAL && OBSOLETE_OSS_DRIVER
-       help
-         Say Y or M if you have a sound system driven by ESS's Maestro 3
-         PCI sound chip.
-
 config SOUND_ICH
        tristate "Intel ICH (i8xx) audio support"
        depends on SOUND_PRIME && PCI
@@ -185,24 +85,6 @@ config SOUND_ICH
          Support for integral audio in Intel's I/O Controller Hub (ICH)
          chipset, as used on the 810/820/840 motherboards.
 
-config SOUND_HARMONY
-       tristate "PA Harmony audio driver"
-       depends on GSC_LASI && SOUND_PRIME && OBSOLETE_OSS_DRIVER
-       help
-         Say 'Y' or 'M' to include support for Harmony soundchip
-         on HP 712, 715/new and many other GSC based machines.
-
-config SOUND_SONICVIBES
-       tristate "S3 SonicVibes"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
-       help
-         Say Y or M if you have a PCI sound card utilizing the S3
-         SonicVibes chipset. To find out if your sound card uses a
-         SonicVibes chip without removing your computer's cover, use
-         lspci -n and look for the PCI ID 5333:CA00. This driver
-         differs slightly from OSS/Free, so PLEASE READ
-         <file:Documentation/sound/oss/sonicvibes>.
-
 config SOUND_VWSND
        tristate "SGI Visual Workstation Sound"
        depends on SOUND_PRIME && X86_VISWS
@@ -231,10 +113,6 @@ config SOUND_VRC5477
          integrated, multi-function controller chip for MIPS CPUs.  Works
          with the AC97 codec.
 
-config SOUND_AU1000
-       tristate "Au1000 Sound"
-       depends on SOUND_PRIME && (SOC_AU1000 || SOC_AU1100 || SOC_AU1500) && OBSOLETE_OSS_DRIVER
-
 config SOUND_AU1550_AC97
        tristate "Au1550 AC97 Sound"
        depends on SOUND_PRIME && SOC_AU1550
@@ -507,7 +385,7 @@ config MSND_FIFOSIZE
 
 config SOUND_VIA82CXXX
        tristate "VIA 82C686 Audio Codec"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
+       depends on SOUND_PRIME && PCI
        help
          Say Y here to include support for the audio codec found on VIA
          82Cxxx-based chips. Typically these are built into a motherboard.
@@ -576,18 +454,6 @@ config SOUND_AD1889
          Say M here if you have a sound card based on the Analog Devices
          AD1889 chip.
 
-config SOUND_SGALAXY
-       tristate "Aztech Sound Galaxy (non-PnP) cards"
-       depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
-       help
-         This module initializes the older non Plug and Play sound galaxy
-         cards from Aztech. It supports the Waverider Pro 32 - 3D and the
-         Galaxy Washington 16.
-
-         If you compile the driver into the kernel, you have to add
-         "sgalaxy=<io>,<irq>,<dma>,<dma2>,<sgbase>" to the kernel command
-         line.
-
 config SOUND_ADLIB
        tristate "Adlib Cards"
        depends on SOUND_OSS
@@ -612,56 +478,6 @@ config SOUND_ACI_MIXER
 
          This driver is also available as a module and will be called aci.
 
-config SOUND_CS4232
-       tristate "Crystal CS4232 based (PnP) cards"
-       depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
-       help
-         Say Y here if you have a card based on the Crystal CS4232 chip set,
-         which uses its own Plug and Play protocol.
-
-         If you compile the driver into the kernel, you have to add
-         "cs4232=<io>,<irq>,<dma>,<dma2>,<mpuio>,<mpuirq>" to the kernel
-         command line.
-
-         See <file:Documentation/sound/oss/CS4232> for more information on
-         configuring this card.
-
-config SOUND_SSCAPE
-       tristate "Ensoniq SoundScape support"
-       depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
-       help
-         Answer Y if you have a sound card based on the Ensoniq SoundScape
-         chipset. Such cards are being manufactured at least by Ensoniq, Spea
-         and Reveal (Reveal makes also other cards).
-
-         If you compile the driver into the kernel, you have to add
-         "sscape=<io>,<irq>,<dma>,<mpuio>,<mpuirq>" to the kernel command
-         line.
-
-config SOUND_GUS
-       tristate "Gravis Ultrasound support"
-       depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
-       help
-         Say Y here for any type of Gravis Ultrasound card, including the GUS
-         or GUS MAX.  See also <file:Documentation/sound/oss/ultrasound> for more
-         information on configuring this card with modules.
-
-         If you compile the driver into the kernel, you have to add
-         "gus=<io>,<irq>,<dma>,<dma2>" to the kernel command line.
-
-config SOUND_GUS16
-       bool "16 bit sampling option of GUS (_NOT_ GUS MAX)"
-       depends on SOUND_GUS
-       help
-         Support for Gravis Ulstrasound (GUS) cards (other than the GUS),
-         sampling at 16-bit width.
-
-config SOUND_GUSMAX
-       bool "GUS MAX support"
-       depends on SOUND_GUS
-       help
-         Support for Gravis Ulstrasound MAX.
-
 config SOUND_VMIDI
        tristate "Loopback MIDI device support"
        depends on SOUND_OSS
@@ -742,7 +558,7 @@ config SOUND_MPU401
 
 config SOUND_NM256
        tristate "NM256AV/NM256ZX audio support"
-       depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
+       depends on SOUND_OSS
        help
          Say M here to include audio support for the NeoMagic 256AV/256ZX
          chipsets. These are the audio chipsets found in the Sony
@@ -752,35 +568,6 @@ config SOUND_NM256
 
          See <file:Documentation/sound/oss/NM256> for further information.
 
-config SOUND_MAD16
-       tristate "OPTi MAD16 and/or Mozart based cards"
-       depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
-       ---help---
-         Answer Y if your card has a Mozart (OAK OTI-601) or MAD16 (OPTi
-         82C928 or 82C929 or 82C931) audio interface chip. These chips are
-         quite common so it's possible that many no-name cards have one of
-         them. In addition the MAD16 chip is used in some cards made by known
-         manufacturers such as Turtle Beach (Tropez), Reveal (some models)
-         and Diamond (latest ones). Note however that the Tropez sound cards
-         have their own driver; if you have one of those, say N here and Y or
-         M to "Full support for Turtle Beach WaveFront", below.
-
-         If you compile the driver into the kernel, you have to add
-         "mad16=<io>,<irq>,<dma>,<dma2>,<mpuio>,<mpuirq>" to the
-         kernel command line.
-
-         See also <file:Documentation/sound/oss/Opti> and
-         <file:Documentation/sound/oss/MAD16> for more information on setting
-         these cards up as modules.
-
-config MAD16_OLDCARD
-       bool "Support MIDI in older MAD16 based cards (requires SB)"
-       depends on SOUND_MAD16
-       help
-         Answer Y (or M) if you have an older card based on the C928 or
-         Mozart chipset and you want to have MIDI support. If you enable this
-         option you also need to enable support for Sound Blaster.
-
 config SOUND_PAS
        tristate "ProAudioSpectrum 16 support"
        depends on SOUND_OSS
@@ -873,53 +660,9 @@ config SOUND_SB
          You can say M here to compile this driver as a module; the module is
          called sb.
 
-config SOUND_AWE32_SYNTH
-       tristate "AWE32 synth"
-       depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
-       help
-         Say Y here if you have a Sound Blaster SB32, AWE32-PnP, SB AWE64 or
-         similar sound card. See <file:Documentation/sound/oss/README.awe>,
-         <file:Documentation/sound/oss/AWE32> and the Soundblaster-AWE
-         mini-HOWTO, available from <http://www.tldp.org/docs.html#howto>
-         for more info.
-
-config SOUND_WAVEFRONT
-       tristate "Full support for Turtle Beach WaveFront (Tropez Plus, Tropez, Maui) synth/soundcards"
-       depends on SOUND_OSS && m && OBSOLETE_OSS_DRIVER
-       help
-         Answer Y or M if you have a Tropez Plus, Tropez or Maui sound card
-         and read the files <file:Documentation/sound/oss/Wavefront> and
-         <file:Documentation/sound/oss/Tropez+>.
-
-config SOUND_MAUI
-       tristate "Limited support for Turtle Beach Wave Front (Maui, Tropez) synthesizers"
-       depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
-       help
-         Say Y here if you have a Turtle Beach Wave Front, Maui, or Tropez
-         sound card.
-
-         If you compile the driver into the kernel, you have to add
-         "maui=<io>,<irq>" to the kernel command line.
-
-config MAUI_HAVE_BOOT
-       bool "Have OSWF.MOT firmware file"
-       depends on SOUND_MAUI=y && !STANDALONE
-       help
-         Turtle Beach Maui and Tropez sound cards have a microcontroller
-         which needs to be initialized prior to use. OSWF.MOT is a file
-         distributed with the card's DOS/Windows drivers. Answer Y if you
-         have this file.
-
-config MAUI_BOOT_FILE
-       string "Full pathname of OSWF.MOT firmware file"
-       depends on MAUI_HAVE_BOOT
-       default "/etc/sound/oswf.mot"
-       help
-         Enter the full pathname of your OSWF.MOT file, starting from /.
-
 config SOUND_YM3812
        tristate "Yamaha FM synthesizer (YM3812/OPL-3) support"
-       depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
+       depends on SOUND_OSS
        ---help---
          Answer Y if your card has a FM chip made by Yamaha (OPL2/OPL3/OPL4).
          Answering Y is usually a safe and recommended choice, however some
@@ -933,18 +676,6 @@ config SOUND_YM3812
 
          If unsure, say Y.
 
-config SOUND_OPL3SA1
-       tristate "Yamaha OPL3-SA1 audio controller"
-       depends on SOUND_OSS && OBSOLETE_OSS_DRIVER
-       help
-         Say Y or M if you have a Yamaha OPL3-SA1 sound chip, which is
-         usually built into motherboards. Read
-         <file:Documentation/sound/oss/OPL3-SA> for details.
-
-         If you compile the driver into the kernel, you have to add
-         "opl3sa=<io>,<irq>,<dma>,<dma2>,<mpuio>,<mpuirq>" to the kernel
-         command line.
-
 config SOUND_OPL3SA2
        tristate "Yamaha OPL3-SA2 and SA3 based PnP cards"
        depends on SOUND_OSS
@@ -959,19 +690,6 @@ config SOUND_OPL3SA2
          "opl3sa2=<io>,<irq>,<dma>,<dma2>,<mssio>,<mpuio>" to the kernel
          command line.
 
-config SOUND_YMFPCI
-       tristate "Yamaha YMF7xx PCI audio (native mode)"
-       depends on SOUND_OSS && PCI && OBSOLETE_OSS_DRIVER
-       help
-         Support for Yamaha cards including the YMF711, YMF715, YMF718,
-         YMF719, YMF724, Waveforce 192XG, and Waveforce 192 Digital.
-
-config SOUND_YMFPCI_LEGACY
-       bool "Yamaha PCI legacy ports support"
-       depends on SOUND_YMFPCI
-       help
-         Support for YMF7xx PCI cards emulating an MP401.
-
 config SOUND_UART6850
        tristate "6850 UART support"
        depends on SOUND_OSS
@@ -1101,30 +819,6 @@ config SOUND_KAHLUA
        tristate "XpressAudio Sound Blaster emulation"
        depends on SOUND_SB
 
-config SOUND_ALI5455
-       tristate "ALi5455 audio support"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
-
-config SOUND_FORTE
-       tristate "ForteMedia FM801 driver"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
-       help
-         Say Y or M if you want driver support for the ForteMedia FM801 PCI
-         audio controller (Abit AU10, Genius Sound Maker, HP Workstation
-         zx2000, and others).
-
-config SOUND_RME96XX
-       tristate "RME Hammerfall (RME96XX) support"
-       depends on SOUND_PRIME && PCI && OBSOLETE_OSS_DRIVER
-       help
-         Say Y or M if you have a Hammerfall or Hammerfall light
-         multichannel card from RME. If you want to access advanced
-         features of the card, read <file:Documentation/sound/oss/rme96xx>.
-
-config SOUND_AD1980
-       tristate "AD1980 front/back switch plugin"
-       depends on SOUND_PRIME && OBSOLETE_OSS_DRIVER
-
 config SOUND_SH_DAC_AUDIO
        tristate "SuperH DAC audio support"
        depends on SOUND_PRIME && CPU_SH3