Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Sep 2008 17:45:01 +0000 (10:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Sep 2008 17:45:01 +0000 (10:45 -0700)
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  block: restore original behavior of /proc/partition when there's no partition
  remove blk_register_filter and blk_unregister_filter in gendisk

13 files changed:
arch/sparc/include/asm/smp_32.h
arch/sparc/kernel/of_device.c
arch/sparc/kernel/sun4d_smp.c
arch/sparc/kernel/sun4m_smp.c
arch/sparc64/kernel/of_device.c
arch/sparc64/mm/init.c
arch/x86/pci/i386.c
include/linux/ioport.h
kernel/resource.c
kernel/softlockup.c
sound/pci/hda/patch_realtek.c
sound/pci/oxygen/hifier.c
sound/pci/oxygen/oxygen.c

index 7201752cf93418fba65af3dbcdaef246f8a627a7..a8180e546a48f87a6d5b9a7123d9ed91a3b51a56 100644 (file)
@@ -50,27 +50,24 @@ struct seq_file;
 void smp_bogo(struct seq_file *);
 void smp_info(struct seq_file *);
 
-BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)
+BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, cpumask_t, unsigned long, unsigned long, unsigned long, unsigned long)
 BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void)
 BTFIXUPDEF_BLACKBOX(hard_smp_processor_id)
 BTFIXUPDEF_BLACKBOX(load_current)
 
-#define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5)
+#define smp_cross_call(func,mask,arg1,arg2,arg3,arg4) BTFIXUP_CALL(smp_cross_call)(func,mask,arg1,arg2,arg3,arg4)
 
-static inline void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); }
+static inline void xc0(smpfunc_t func) { smp_cross_call(func, cpu_online_map, 0, 0, 0, 0); }
 static inline void xc1(smpfunc_t func, unsigned long arg1)
-{ smp_cross_call(func, arg1, 0, 0, 0, 0); }
+{ smp_cross_call(func, cpu_online_map, arg1, 0, 0, 0); }
 static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2)
-{ smp_cross_call(func, arg1, arg2, 0, 0, 0); }
+{ smp_cross_call(func, cpu_online_map, arg1, arg2, 0, 0); }
 static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2,
                           unsigned long arg3)
-{ smp_cross_call(func, arg1, arg2, arg3, 0, 0); }
+{ smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, 0); }
 static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2,
                           unsigned long arg3, unsigned long arg4)
-{ smp_cross_call(func, arg1, arg2, arg3, arg4, 0); }
-static inline void xc5(smpfunc_t func, unsigned long arg1, unsigned long arg2,
-                          unsigned long arg3, unsigned long arg4, unsigned long arg5)
-{ smp_cross_call(func, arg1, arg2, arg3, arg4, arg5); }
+{ smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, arg4); }
 
 static inline int smp_call_function(void (*func)(void *info), void *info, int wait)
 {
@@ -78,6 +75,14 @@ static inline int smp_call_function(void (*func)(void *info), void *info, int wa
        return 0;
 }
 
+static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
+                                          void *info, int wait)
+{
+       smp_cross_call((smpfunc_t)func, cpumask_of_cpu(cpuid),
+                      (unsigned long) info, 0, 0, 0);
+       return 0;
+}
+
 static inline int cpu_logical_map(int cpu)
 {
        return cpu;
index cc4c235c4f592e5e193429bfb346656287c8092f..c481d45f97b748a3748c8fcc813be7d7965555e6 100644 (file)
@@ -70,7 +70,7 @@ struct of_bus {
                                       int *addrc, int *sizec);
        int             (*map)(u32 *addr, const u32 *range,
                               int na, int ns, int pna);
-       unsigned int    (*get_flags)(const u32 *addr);
+       unsigned long   (*get_flags)(const u32 *addr, unsigned long);
 };
 
 /*
@@ -130,8 +130,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range,
        return 0;
 }
 
-static unsigned int of_bus_default_get_flags(const u32 *addr)
+static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags)
 {
+       if (flags)
+               return flags;
        return IORESOURCE_MEM;
 }
 
@@ -194,17 +196,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
        return 0;
 }
 
-static unsigned int of_bus_pci_get_flags(const u32 *addr)
+static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
 {
-       unsigned int flags = 0;
        u32 w = addr[0];
 
+       /* For PCI, we override whatever child busses may have used.  */
+       flags = 0;
        switch((w >> 24) & 0x03) {
        case 0x01:
                flags |= IORESOURCE_IO;
+               break;
+
        case 0x02: /* 32 bits */
        case 0x03: /* 64 bits */
                flags |= IORESOURCE_MEM;
+               break;
        }
        if (w & 0x40000000)
                flags |= IORESOURCE_PREFETCH;
@@ -362,10 +368,11 @@ static void __init build_device_resources(struct of_device *op,
                int pna, pns;
 
                size = of_read_addr(reg + na, ns);
-               flags = bus->get_flags(reg);
 
                memcpy(addr, reg, na * 4);
 
+               flags = bus->get_flags(reg, 0);
+
                /* If the immediate parent has no ranges property to apply,
                 * just use a 1<->1 mapping.
                 */
@@ -393,6 +400,8 @@ static void __init build_device_resources(struct of_device *op,
                                               dna, dns, pna))
                                break;
 
+                       flags = pbus->get_flags(addr, flags);
+
                        dna = pna;
                        dns = pns;
                        dbus = pbus;
index dfde77ff084870810b3a8e94e40f089b796418be..69596402a500092c562b3ec97e7269efcc8981ec 100644 (file)
@@ -262,8 +262,9 @@ static struct smp_funcall {
 static DEFINE_SPINLOCK(cross_call_lock);
 
 /* Cross calls must be serialized, at least currently. */
-void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
-                   unsigned long arg3, unsigned long arg4, unsigned long arg5)
+static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
+                            unsigned long arg2, unsigned long arg3,
+                            unsigned long arg4)
 {
        if(smp_processors_ready) {
                register int high = smp_highest_cpu;
@@ -278,7 +279,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
                        register unsigned long a2 asm("i2") = arg2;
                        register unsigned long a3 asm("i3") = arg3;
                        register unsigned long a4 asm("i4") = arg4;
-                       register unsigned long a5 asm("i5") = arg5;
+                       register unsigned long a5 asm("i5") = 0;
 
                        __asm__ __volatile__(
                                "std %0, [%6]\n\t"
@@ -290,11 +291,10 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
 
                /* Init receive/complete mapping, plus fire the IPI's off. */
                {
-                       cpumask_t mask;
                        register int i;
 
-                       mask = cpumask_of_cpu(hard_smp4d_processor_id());
-                       cpus_andnot(mask, cpu_online_map, mask);
+                       cpu_clear(smp_processor_id(), mask);
+                       cpus_and(mask, cpu_online_map, mask);
                        for(i = 0; i <= high; i++) {
                                if (cpu_isset(i, mask)) {
                                        ccall_info.processors_in[i] = 0;
@@ -309,12 +309,16 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
 
                        i = 0;
                        do {
+                               if (!cpu_isset(i, mask))
+                                       continue;
                                while(!ccall_info.processors_in[i])
                                        barrier();
                        } while(++i <= high);
 
                        i = 0;
                        do {
+                               if (!cpu_isset(i, mask))
+                                       continue;
                                while(!ccall_info.processors_out[i])
                                        barrier();
                        } while(++i <= high);
index 406ac1abc83a8645f559b435690b5f12594f6e5a..a14a76ac7f36464642ea95f397326c29d3967002 100644 (file)
@@ -244,9 +244,9 @@ static struct smp_funcall {
 static DEFINE_SPINLOCK(cross_call_lock);
 
 /* Cross calls must be serialized, at least currently. */
-static void smp4m_cross_call(smpfunc_t func, unsigned long arg1,
+static void smp4m_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
                             unsigned long arg2, unsigned long arg3,
-                            unsigned long arg4, unsigned long arg5)
+                            unsigned long arg4)
 {
                register int ncpus = SUN4M_NCPUS;
                unsigned long flags;
@@ -259,14 +259,14 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1,
                ccall_info.arg2 = arg2;
                ccall_info.arg3 = arg3;
                ccall_info.arg4 = arg4;
-               ccall_info.arg5 = arg5;
+               ccall_info.arg5 = 0;
 
                /* Init receive/complete mapping, plus fire the IPI's off. */
                {
-                       cpumask_t mask = cpu_online_map;
                        register int i;
 
                        cpu_clear(smp_processor_id(), mask);
+                       cpus_and(mask, cpu_online_map, mask);
                        for(i = 0; i < ncpus; i++) {
                                if (cpu_isset(i, mask)) {
                                        ccall_info.processors_in[i] = 0;
@@ -284,12 +284,16 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1,
 
                        i = 0;
                        do {
+                               if (!cpu_isset(i, mask))
+                                       continue;
                                while(!ccall_info.processors_in[i])
                                        barrier();
                        } while(++i < ncpus);
 
                        i = 0;
                        do {
+                               if (!cpu_isset(i, mask))
+                                       continue;
                                while(!ccall_info.processors_out[i])
                                        barrier();
                        } while(++i < ncpus);
index f8b50cbf4bf711658ef3ad742270da424cbf4294..f845f150f565b26a019dea86afa7a6b9d2970ce7 100644 (file)
@@ -96,7 +96,7 @@ struct of_bus {
                                       int *addrc, int *sizec);
        int             (*map)(u32 *addr, const u32 *range,
                               int na, int ns, int pna);
-       unsigned int    (*get_flags)(const u32 *addr);
+       unsigned long   (*get_flags)(const u32 *addr, unsigned long);
 };
 
 /*
@@ -156,8 +156,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range,
        return 0;
 }
 
-static unsigned int of_bus_default_get_flags(const u32 *addr)
+static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags)
 {
+       if (flags)
+               return flags;
        return IORESOURCE_MEM;
 }
 
@@ -249,17 +251,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
        return 0;
 }
 
-static unsigned int of_bus_pci_get_flags(const u32 *addr)
+static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
 {
-       unsigned int flags = 0;
        u32 w = addr[0];
 
+       /* For PCI, we override whatever child busses may have used.  */
+       flags = 0;
        switch((w >> 24) & 0x03) {
        case 0x01:
                flags |= IORESOURCE_IO;
+               break;
+
        case 0x02: /* 32 bits */
        case 0x03: /* 64 bits */
                flags |= IORESOURCE_MEM;
+               break;
        }
        if (w & 0x40000000)
                flags |= IORESOURCE_PREFETCH;
@@ -478,10 +484,10 @@ static void __init build_device_resources(struct of_device *op,
                int pna, pns;
 
                size = of_read_addr(reg + na, ns);
-               flags = bus->get_flags(reg);
-
                memcpy(addr, reg, na * 4);
 
+               flags = bus->get_flags(addr, 0);
+
                if (use_1to1_mapping(pp)) {
                        result = of_read_addr(addr, na);
                        goto build_res;
@@ -506,6 +512,8 @@ static void __init build_device_resources(struct of_device *op,
                                               dna, dns, pna))
                                break;
 
+                       flags = pbus->get_flags(addr, flags);
+
                        dna = pna;
                        dns = pns;
                        dbus = pbus;
index b4aeb0f696dc4330e837d7e5b085ba0d2fbf4a7f..a41df7bef0356eef702e247f7ef2bb05a8679acb 100644 (file)
@@ -1843,7 +1843,7 @@ static int pavail_rescan_ents __initdata;
  * memory list again, and make sure it provides at least as much
  * memory as 'pavail' does.
  */
-static void setup_valid_addr_bitmap_from_pavail(void)
+static void __init setup_valid_addr_bitmap_from_pavail(void)
 {
        int i;
 
index d765da9138428209207718d169d81e539237b0d6..8791fc55e7154484700cbd2253de3026053b96ae 100644 (file)
 #include <linux/ioport.h>
 #include <linux/errno.h>
 #include <linux/bootmem.h>
-#include <linux/acpi.h>
 
 #include <asm/pat.h>
-#include <asm/hpet.h>
-#include <asm/io_apic.h>
 
 #include "pci.h"
 
@@ -80,77 +77,6 @@ pcibios_align_resource(void *data, struct resource *res,
 }
 EXPORT_SYMBOL(pcibios_align_resource);
 
-static int check_res_with_valid(struct pci_dev *dev, struct resource *res)
-{
-       unsigned long base;
-       unsigned long size;
-       int i;
-
-       base = res->start;
-       size = (res->start == 0 && res->end == res->start) ? 0 :
-                (res->end - res->start + 1);
-
-       if (!base || !size)
-               return 0;
-
-#ifdef CONFIG_HPET_TIMER
-       /* for hpet */
-       if (base == hpet_address && (res->flags & IORESOURCE_MEM)) {
-               dev_info(&dev->dev, "BAR has HPET at %08lx-%08lx\n",
-                                base, base + size - 1);
-               return 1;
-       }
-#endif
-
-#ifdef CONFIG_X86_IO_APIC
-       for (i = 0; i < nr_ioapics; i++) {
-               unsigned long ioapic_phys = mp_ioapics[i].mp_apicaddr;
-
-               if (base == ioapic_phys && (res->flags & IORESOURCE_MEM)) {
-                       dev_info(&dev->dev, "BAR has ioapic at %08lx-%08lx\n",
-                                        base, base + size - 1);
-                       return 1;
-               }
-       }
-#endif
-
-#ifdef CONFIG_PCI_MMCONFIG
-       for (i = 0; i < pci_mmcfg_config_num; i++) {
-               unsigned long addr;
-
-               addr = pci_mmcfg_config[i].address;
-               if (base == addr && (res->flags & IORESOURCE_MEM)) {
-                       dev_info(&dev->dev, "BAR has MMCONFIG at %08lx-%08lx\n",
-                                        base, base + size - 1);
-                       return 1;
-               }
-       }
-#endif
-
-       return 0;
-}
-
-static int check_platform(struct pci_dev *dev, struct resource *res)
-{
-       struct resource *root = NULL;
-
-       /*
-        * forcibly insert it into the
-        * resource tree
-        */
-       if (res->flags & IORESOURCE_MEM)
-               root = &iomem_resource;
-       else if (res->flags & IORESOURCE_IO)
-               root = &ioport_resource;
-
-       if (root && check_res_with_valid(dev, res)) {
-               insert_resource(root, res);
-
-               return 1;
-       }
-
-       return 0;
-}
 /*
  *  Handle resources of PCI devices.  If the world were perfect, we could
  *  just allocate all the resource regions and do nothing more.  It isn't.
@@ -202,10 +128,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
                                pr = pci_find_parent_resource(dev, r);
                                if (!r->start || !pr ||
                                    request_resource(pr, r) < 0) {
-                                       if (check_platform(dev, r))
-                                               continue;
-                                       dev_err(&dev->dev, "BAR %d: can't "
-                                               "allocate resource\n", idx);
+                                       dev_err(&dev->dev, "BAR %d: can't allocate resource\n", idx);
                                        /*
                                         * Something is wrong with the region.
                                         * Invalidate the resource to prevent
@@ -240,17 +163,13 @@ static void __init pcibios_allocate_resources(int pass)
                        else
                                disabled = !(command & PCI_COMMAND_MEMORY);
                        if (pass == disabled) {
-                               dev_dbg(&dev->dev, "resource %#08llx-%#08llx "
-                                       "(f=%lx, d=%d, p=%d)\n",
+                               dev_dbg(&dev->dev, "resource %#08llx-%#08llx (f=%lx, d=%d, p=%d)\n",
                                        (unsigned long long) r->start,
                                        (unsigned long long) r->end,
                                        r->flags, disabled, pass);
                                pr = pci_find_parent_resource(dev, r);
                                if (!pr || request_resource(pr, r) < 0) {
-                                       if (check_platform(dev, r))
-                                               continue;
-                                       dev_err(&dev->dev, "BAR %d: can't "
-                                               "allocate resource\n", idx);
+                                       dev_err(&dev->dev, "BAR %d: can't allocate resource\n", idx);
                                        /* We'll assign a new address later */
                                        r->end -= r->start;
                                        r->start = 0;
index 22d2115458c67fe1e6e499996a9218af36fb772a..8d3b7a9afd1780b4624dd28dbd9126db8df738d8 100644 (file)
@@ -109,6 +109,7 @@ extern struct resource iomem_resource;
 extern int request_resource(struct resource *root, struct resource *new);
 extern int release_resource(struct resource *new);
 extern int insert_resource(struct resource *parent, struct resource *new);
+extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new);
 extern int allocate_resource(struct resource *root, struct resource *new,
                             resource_size_t size, resource_size_t min,
                             resource_size_t max, resource_size_t align,
index f5b518eabefec5cfe880c230fe07ce7b8615f732..cf0a178c751345f0c8358b066fa937d379adc777 100644 (file)
@@ -362,35 +362,21 @@ int allocate_resource(struct resource *root, struct resource *new,
 
 EXPORT_SYMBOL(allocate_resource);
 
-/**
- * insert_resource - Inserts a resource in the resource tree
- * @parent: parent of the new resource
- * @new: new resource to insert
- *
- * Returns 0 on success, -EBUSY if the resource can't be inserted.
- *
- * This function is equivalent to request_resource when no conflict
- * happens. If a conflict happens, and the conflicting resources
- * entirely fit within the range of the new resource, then the new
- * resource is inserted and the conflicting resources become children of
- * the new resource.
+/*
+ * Insert a resource into the resource tree. If successful, return NULL,
+ * otherwise return the conflicting resource (compare to __request_resource())
  */
-int insert_resource(struct resource *parent, struct resource *new)
+static struct resource * __insert_resource(struct resource *parent, struct resource *new)
 {
-       int result;
        struct resource *first, *next;
 
-       write_lock(&resource_lock);
-
        for (;; parent = first) {
-               result = 0;
                first = __request_resource(parent, new);
                if (!first)
-                       goto out;
+                       return first;
 
-               result = -EBUSY;
                if (first == parent)
-                       goto out;
+                       return first;
 
                if ((first->start > new->start) || (first->end < new->end))
                        break;
@@ -401,15 +387,13 @@ int insert_resource(struct resource *parent, struct resource *new)
        for (next = first; ; next = next->sibling) {
                /* Partial overlap? Bad, and unfixable */
                if (next->start < new->start || next->end > new->end)
-                       goto out;
+                       return next;
                if (!next->sibling)
                        break;
                if (next->sibling->start > new->end)
                        break;
        }
 
-       result = 0;
-
        new->parent = parent;
        new->sibling = next->sibling;
        new->child = first;
@@ -426,10 +410,64 @@ int insert_resource(struct resource *parent, struct resource *new)
                        next = next->sibling;
                next->sibling = new;
        }
+       return NULL;
+}
 
- out:
+/**
+ * insert_resource - Inserts a resource in the resource tree
+ * @parent: parent of the new resource
+ * @new: new resource to insert
+ *
+ * Returns 0 on success, -EBUSY if the resource can't be inserted.
+ *
+ * This function is equivalent to request_resource when no conflict
+ * happens. If a conflict happens, and the conflicting resources
+ * entirely fit within the range of the new resource, then the new
+ * resource is inserted and the conflicting resources become children of
+ * the new resource.
+ */
+int insert_resource(struct resource *parent, struct resource *new)
+{
+       struct resource *conflict;
+
+       write_lock(&resource_lock);
+       conflict = __insert_resource(parent, new);
+       write_unlock(&resource_lock);
+       return conflict ? -EBUSY : 0;
+}
+
+/**
+ * insert_resource_expand_to_fit - Insert a resource into the resource tree
+ * @parent: parent of the new resource
+ * @new: new resource to insert
+ *
+ * Insert a resource into the resource tree, possibly expanding it in order
+ * to make it encompass any conflicting resources.
+ */
+void insert_resource_expand_to_fit(struct resource *root, struct resource *new)
+{
+       if (new->parent)
+               return;
+
+       write_lock(&resource_lock);
+       for (;;) {
+               struct resource *conflict;
+
+               conflict = __insert_resource(root, new);
+               if (!conflict)
+                       break;
+               if (conflict == root)
+                       break;
+
+               /* Ok, expand resource to cover the conflict, then try again .. */
+               if (conflict->start < new->start)
+                       new->start = conflict->start;
+               if (conflict->end > new->end)
+                       new->end = conflict->end;
+
+               printk("Expanded resource %s due to conflict with %s\n", new->name, conflict->name);
+       }
        write_unlock(&resource_lock);
-       return result;
 }
 
 /**
index b75b492fbfcff63770bc099df2a7769fc1e26f09..1a07f8ca4b923e99c76824a1d585da26a0c53d7d 100644 (file)
@@ -180,6 +180,10 @@ static void check_hung_task(struct task_struct *t, unsigned long now)
        if (t->flags & PF_FROZEN)
                return;
 
+       /* Don't check for tasks waiting on network file systems like NFS */
+       if (t->state & TASK_KILLABLE)
+               return;
+
        if (switch_count != t->last_switch_count || !t->last_switch_timestamp) {
                t->last_switch_count = switch_count;
                t->last_switch_timestamp = now;
index 909f1c101c95af5e0a1c2db614a946de1cd570be..d6ec9eef291080502513d9b1fbf0faeac1e1e33a 100644 (file)
@@ -6197,7 +6197,6 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
        SND_PCI_QUIRK(0x1043, 0x817f, "Asus P5LD2", ALC882_6ST_DIG),
        SND_PCI_QUIRK(0x1043, 0x81d8, "Asus P5WD", ALC882_6ST_DIG),
        SND_PCI_QUIRK(0x105b, 0x6668, "Foxconn", ALC882_6ST_DIG),
-       SND_PCI_QUIRK(0x106b, 0x00a0, "Apple iMac 24''", ALC885_IMAC24),
        SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG),
        SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8  */
        SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
index 7442460583dde0c68f92f40c965afe8cbb461272..dad393ae040a2dc474f638ff8e95817bed95ed57 100644 (file)
@@ -17,6 +17,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#include <linux/delay.h>
 #include <linux/pci.h>
 #include <sound/control.h>
 #include <sound/core.h>
@@ -107,6 +108,9 @@ static void set_ak4396_params(struct oxygen *chip,
        else
                value |= AK4396_DFS_QUAD;
        data->ak4396_ctl2 = value;
+
+       msleep(1); /* wait for the new MCLK to become stable */
+
        ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB);
        ak4396_write(chip, AK4396_CONTROL_2, value);
        ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN);
index 7c8ae31eb4685b857488e931a55efcd8f4e1826e..c5829d30ef8640519becefaa8a2f2ca130523297 100644 (file)
@@ -28,6 +28,7 @@
  * GPIO 1 -> DFS1 of AK5385
  */
 
+#include <linux/delay.h>
 #include <linux/mutex.h>
 #include <linux/pci.h>
 #include <sound/ac97_codec.h>
@@ -213,6 +214,9 @@ static void set_ak4396_params(struct oxygen *chip,
        else
                value |= AK4396_DFS_QUAD;
        data->ak4396_ctl2 = value;
+
+       msleep(1); /* wait for the new MCLK to become stable */
+
        for (i = 0; i < 4; ++i) {
                ak4396_write(chip, i,
                             AK4396_CONTROL_1, AK4396_DIF_24_MSB);