Changeset 19208


Ignore:
Timestamp:
05/05/12 13:05:50 (13 months ago)
Author:
BrainSlayer
Message:

update kernel

Location:
src/linux/universal/linux-3.3
Files:
89 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.3/Makefile

    r19156 r19208  
    11VERSION = 3 
    22PATCHLEVEL = 3 
    3 SUBLEVEL = 4 
    4 EXTRAVERSION = 
     3SUBLEVEL = 5 
     4EXTRAVERSION = -rc1 
    55NAME = Saber-toothed Squirrel 
    66 
  • src/linux/universal/linux-3.3/arch/arm/Kconfig

    r18805 r19208  
    11731173endif 
    11741174 
     1175config ARM_ERRATA_326103 
     1176        bool "ARM errata: FSR write bit incorrect on a SWP to read-only memory" 
     1177        depends on CPU_V6 
     1178        help 
     1179          Executing a SWP instruction to read-only memory does not set bit 11 
     1180          of the FSR on the ARM 1136 prior to r1p0. This causes the kernel to 
     1181          treat the access as a read, preventing a COW from occurring and 
     1182          causing the faulting task to livelock. 
     1183 
    11751184config ARM_ERRATA_411920 
    11761185        bool "ARM errata: Invalidation of the Instruction Cache operation can fail" 
  • src/linux/universal/linux-3.3/arch/arm/include/asm/tls.h

    r18778 r19208  
    88        .macro set_tls_v6k, tp, tmp1, tmp2 
    99        mcr     p15, 0, \tp, c13, c0, 3         @ set TLS register 
     10        mov     \tmp1, #0 
     11        mcr     p15, 0, \tmp1, c13, c0, 2       @ clear user r/w TLS register 
    1012        .endm 
    1113 
     
    1618        tst     \tmp1, #HWCAP_TLS               @ hardware TLS available? 
    1719        mcrne   p15, 0, \tp, c13, c0, 3         @ yes, set TLS register 
     20        movne   \tmp1, #0 
     21        mcrne   p15, 0, \tmp1, c13, c0, 2       @ clear user r/w TLS register 
    1822        streq   \tp, [\tmp2, #-15]              @ set TLS value at 0xffff0ff0 
    1923        .endm 
  • src/linux/universal/linux-3.3/arch/arm/kernel/irq.c

    r18778 r19208  
    157157 
    158158        c = irq_data_get_irq_chip(d); 
    159         if (c->irq_set_affinity) 
    160                 c->irq_set_affinity(d, affinity, true); 
    161         else 
     159        if (!c->irq_set_affinity) 
    162160                pr_debug("IRQ%u: unable to set affinity\n", d->irq); 
     161        else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret) 
     162                cpumask_copy(d->affinity, affinity); 
    163163 
    164164        return ret; 
  • src/linux/universal/linux-3.3/arch/arm/mm/abort-ev6.S

    r18778 r19208  
    2727        mrc     p15, 0, r0, c6, c0, 0           @ get FAR 
    2828/* 
    29  * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR (erratum 326103). 
    30  * The test below covers all the write situations, including Java bytecodes 
     29 * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR. 
    3130 */ 
     31#ifdef CONFIG_ARM_ERRATA_326103 
     32        ldr     ip, =0x4107b36 
     33        mrc     p15, 0, r3, c0, c0, 0           @ get processor id 
     34        teq     ip, r3, lsr #4                  @ r0 ARM1136? 
     35        bne     do_DataAbort 
     36        tst     r5, #PSR_J_BIT                  @ Java? 
     37        tsteq   r5, #PSR_T_BIT                  @ Thumb? 
     38        bne     do_DataAbort 
    3239        bic     r1, r1, #1 << 11                @ clear bit 11 of FSR 
    33         tst     r5, #PSR_J_BIT                  @ Java? 
    34         bne     do_DataAbort 
    35         do_thumb_abort fsr=r1, pc=r4, psr=r5, tmp=r3 
    36         ldreq   r3, [r4]                        @ read aborted ARM instruction 
     40        ldr     r3, [r4]                        @ read aborted ARM instruction 
    3741#ifdef CONFIG_CPU_ENDIAN_BE8 
    38         reveq   r3, r3 
     42        rev     r3, r3 
    3943#endif 
    4044        do_ldrd_abort tmp=ip, insn=r3 
    4145        tst     r3, #1 << 20                    @ L = 0 -> write 
    4246        orreq   r1, r1, #1 << 11                @ yes. 
     47#endif 
    4348        b       do_DataAbort 
  • src/linux/universal/linux-3.3/arch/mips/ath79/dev-wmac.c

    r18778 r19208  
    5959static int ar933x_wmac_reset(void) 
    6060{ 
     61        ath79_device_reset_set(AR933X_RESET_WMAC); 
    6162        ath79_device_reset_clear(AR933X_RESET_WMAC); 
    62         ath79_device_reset_set(AR933X_RESET_WMAC); 
    6363 
    6464        return 0; 
  • src/linux/universal/linux-3.3/arch/powerpc/platforms/85xx/common.c

    r18778 r19208  
    2222        { .compatible = "fsl,cpm2", }, 
    2323        { .compatible = "fsl,srio", }, 
     24        /* So that the DMA channel nodes can be probed individually: */ 
     25        { .compatible = "fsl,eloplus-dma", }, 
     26        /* For the PMC driver */ 
     27        { .compatible = "fsl,mpc8548-guts", }, 
     28        /* Probably unnecessary? */ 
     29        { .compatible = "gpio-leds", }, 
    2430        {}, 
    2531}; 
  • src/linux/universal/linux-3.3/arch/powerpc/platforms/85xx/mpc85xx_mds.c

    r18778 r19208  
    406406machine_arch_initcall(mpc8569_mds, board_fixups); 
    407407 
    408 static struct of_device_id mpc85xx_ids[] = { 
    409         { .compatible = "fsl,mpc8548-guts", }, 
    410         { .compatible = "gpio-leds", }, 
    411         {}, 
    412 }; 
    413  
    414408static int __init mpc85xx_publish_devices(void) 
    415409{ 
     
    419413                simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio"); 
    420414 
    421         mpc85xx_common_publish_devices(); 
    422         of_platform_bus_probe(NULL, mpc85xx_ids, NULL); 
    423  
    424         return 0; 
     415        return mpc85xx_common_publish_devices(); 
    425416} 
    426417 
  • src/linux/universal/linux-3.3/arch/powerpc/platforms/85xx/p1022_ds.c

    r18778 r19208  
    304304} 
    305305 
    306 static struct of_device_id __initdata p1022_ds_ids[] = { 
    307         /* So that the DMA channel nodes can be probed individually: */ 
    308         { .compatible = "fsl,eloplus-dma", }, 
    309         {}, 
    310 }; 
    311  
    312 static int __init p1022_ds_publish_devices(void) 
    313 { 
    314         mpc85xx_common_publish_devices(); 
    315         return of_platform_bus_probe(NULL, p1022_ds_ids, NULL); 
    316 } 
    317 machine_device_initcall(p1022_ds, p1022_ds_publish_devices); 
     306machine_device_initcall(p1022_ds, mpc85xx_common_publish_devices); 
    318307 
    319308machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier); 
  • src/linux/universal/linux-3.3/arch/x86/boot/Makefile

    r18778 r19208  
    3838hostprogs-y     := mkcpustr tools/build 
    3939 
    40 HOST_EXTRACFLAGS += $(LINUXINCLUDE) 
     40HOST_EXTRACFLAGS += -I$(srctree)/tools/include $(LINUXINCLUDE) \ 
     41                    -D__EXPORTED_HEADERS__ 
    4142 
    4243$(obj)/cpu.o: $(obj)/cpustr.h 
  • src/linux/universal/linux-3.3/arch/x86/boot/compressed/Makefile

    r18778 r19208  
    2323 
    2424hostprogs-y     := mkpiggy 
     25HOST_EXTRACFLAGS += -I$(srctree)/tools/include 
    2526 
    2627VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ 
  • src/linux/universal/linux-3.3/arch/x86/boot/compressed/eboot.c

    r18778 r19208  
    540540                efi_file_handle_t *h; 
    541541                efi_file_info_t *info; 
    542                 efi_char16_t filename[256]; 
     542                efi_char16_t filename_16[256]; 
    543543                unsigned long info_sz; 
    544544                efi_guid_t info_guid = EFI_FILE_INFO_ID; 
     
    553553 
    554554                initrd = &initrds[i]; 
    555                 p = filename; 
     555                p = filename_16; 
    556556 
    557557                /* Skip any leading slashes */ 
     
    560560 
    561561                while (*str && *str != ' ' && *str != '\n') { 
    562                         if (p >= filename + sizeof(filename)) 
     562                        if ((u8 *)p >= (u8 *)filename_16 + sizeof(filename_16)) 
    563563                                break; 
    564564 
     
    584584                } 
    585585 
    586                 status = efi_call_phys5(fh->open, fh, &h, filename, 
     586                status = efi_call_phys5(fh->open, fh, &h, filename_16, 
    587587                                        EFI_FILE_MODE_READ, (u64)0); 
    588588                if (status != EFI_SUCCESS) 
  • src/linux/universal/linux-3.3/arch/x86/boot/compressed/head_32.S

    r18778 r19208  
    3434ENTRY(startup_32) 
    3535#ifdef CONFIG_EFI_STUB 
     36        jmp     preferred_addr 
     37 
     38        .balign 0x10 
    3639        /* 
    3740         * We don't need the return address, so set up the stack so 
     
    4245        call    efi_main 
    4346        cmpl    $0, %eax 
    44         je      preferred_addr 
    4547        movl    %eax, %esi 
    46         call    1f 
     48        jne     2f 
    47491: 
     50        /* EFI init failed, so hang. */ 
     51        hlt 
     52        jmp     1b 
     532: 
     54        call    3f 
     553: 
    4856        popl    %eax 
    49         subl    $1b, %eax 
     57        subl    $3b, %eax 
    5058        subl    BP_pref_address(%esi), %eax 
    5159        add     BP_code32_start(%esi), %eax 
  • src/linux/universal/linux-3.3/arch/x86/boot/compressed/head_64.S

    r18778 r19208  
    201201         */ 
    202202#ifdef CONFIG_EFI_STUB 
    203         pushq   %rsi 
     203        /* 
     204         * The entry point for the PE/COFF executable is 0x210, so only 
     205         * legacy boot loaders will execute this jmp. 
     206         */ 
     207        jmp     preferred_addr 
     208 
     209        .org 0x210 
    204210        mov     %rcx, %rdi 
    205211        mov     %rdx, %rsi 
    206212        call    efi_main 
    207         popq    %rsi 
     213        movq    %rax,%rsi 
    208214        cmpq    $0,%rax 
    209         je      preferred_addr 
    210         movq    %rax,%rsi 
    211         call    1f 
     215        jne     2f 
    2122161: 
     217        /* EFI init failed, so hang. */ 
     218        hlt 
     219        jmp     1b 
     2202: 
     221        call    3f 
     2223: 
    213223        popq    %rax 
    214         subq    $1b, %rax 
     224        subq    $3b, %rax 
    215225        subq    BP_pref_address(%rsi), %rax 
    216226        add     BP_code32_start(%esi), %eax 
  • src/linux/universal/linux-3.3/arch/x86/boot/compressed/mkpiggy.c

    r18778 r19208  
    3030#include <string.h> 
    3131#include <inttypes.h> 
    32  
    33 static uint32_t getle32(const void *p) 
    34 { 
    35         const uint8_t *cp = p; 
    36  
    37         return (uint32_t)cp[0] + ((uint32_t)cp[1] << 8) + 
    38                 ((uint32_t)cp[2] << 16) + ((uint32_t)cp[3] << 24); 
    39 } 
     32#include <tools/le_byteshift.h> 
    4033 
    4134int main(int argc, char *argv[]) 
     
    7063 
    7164        ilen = ftell(f); 
    72         olen = getle32(&olen); 
     65        olen = get_unaligned_le32(&olen); 
    7366        fclose(f); 
    7467 
  • src/linux/universal/linux-3.3/arch/x86/boot/tools/build.c

    r18778 r19208  
    3535#include <sys/mman.h> 
    3636#include <asm/boot.h> 
     37#include <tools/le_byteshift.h> 
    3738 
    3839typedef unsigned char  u8; 
     
    4243#define DEFAULT_MAJOR_ROOT 0 
    4344#define DEFAULT_MINOR_ROOT 0 
     45#define DEFAULT_ROOT_DEV (DEFAULT_MAJOR_ROOT << 8 | DEFAULT_MINOR_ROOT) 
    4446 
    4547/* Minimal number of setup sectors */ 
     
    160162        if (c < 1024) 
    161163                die("The setup must be at least 1024 bytes"); 
    162         if (buf[510] != 0x55 || buf[511] != 0xaa) 
     164        if (get_unaligned_le16(&buf[510]) != 0xAA55) 
    163165                die("Boot block hasn't got boot flag (0xAA55)"); 
    164166        fclose(file); 
     
    172174 
    173175        /* Set the default root device */ 
    174         buf[508] = DEFAULT_MINOR_ROOT; 
    175         buf[509] = DEFAULT_MAJOR_ROOT; 
     176        put_unaligned_le16(DEFAULT_ROOT_DEV, &buf[508]); 
    176177 
    177178        fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i); 
     
    193194        /* Patch the setup code with the appropriate size parameters */ 
    194195        buf[0x1f1] = setup_sectors-1; 
    195         buf[0x1f4] = sys_size; 
    196         buf[0x1f5] = sys_size >> 8; 
    197         buf[0x1f6] = sys_size >> 16; 
    198         buf[0x1f7] = sys_size >> 24; 
     196        put_unaligned_le32(sys_size, &buf[0x1f4]); 
    199197 
    200198#ifdef CONFIG_EFI_STUB 
    201199        file_sz = sz + i + ((sys_size * 16) - sz); 
    202200 
    203         pe_header = *(unsigned int *)&buf[0x3c]; 
     201        pe_header = get_unaligned_le32(&buf[0x3c]); 
    204202 
    205203        /* Size of code */ 
    206         *(unsigned int *)&buf[pe_header + 0x1c] = file_sz; 
     204        put_unaligned_le32(file_sz, &buf[pe_header + 0x1c]); 
    207205 
    208206        /* Size of image */ 
    209         *(unsigned int *)&buf[pe_header + 0x50] = file_sz; 
     207        put_unaligned_le32(file_sz, &buf[pe_header + 0x50]); 
    210208 
    211209#ifdef CONFIG_X86_32 
    212         /* Address of entry point */ 
    213         *(unsigned int *)&buf[pe_header + 0x28] = i; 
     210        /* 
     211         * Address of entry point. 
     212         * 
     213         * The EFI stub entry point is +16 bytes from the start of 
     214         * the .text section. 
     215         */ 
     216        put_unaligned_le32(i + 16, &buf[pe_header + 0x28]); 
    214217 
    215218        /* .text size */ 
    216         *(unsigned int *)&buf[pe_header + 0xb0] = file_sz; 
     219        put_unaligned_le32(file_sz, &buf[pe_header + 0xb0]); 
    217220 
    218221        /* .text size of initialised data */ 
    219         *(unsigned int *)&buf[pe_header + 0xb8] = file_sz; 
     222        put_unaligned_le32(file_sz, &buf[pe_header + 0xb8]); 
    220223#else 
    221224        /* 
    222225         * Address of entry point. startup_32 is at the beginning and 
    223226         * the 64-bit entry point (startup_64) is always 512 bytes 
    224          * after. 
     227         * after. The EFI stub entry point is 16 bytes after that, as 
     228         * the first instruction allows legacy loaders to jump over 
     229         * the EFI stub initialisation 
    225230         */ 
    226         *(unsigned int *)&buf[pe_header + 0x28] = i + 512; 
     231        put_unaligned_le32(i + 528, &buf[pe_header + 0x28]); 
    227232 
    228233        /* .text size */ 
    229         *(unsigned int *)&buf[pe_header + 0xc0] = file_sz; 
     234        put_unaligned_le32(file_sz, &buf[pe_header + 0xc0]); 
    230235 
    231236        /* .text size of initialised data */ 
    232         *(unsigned int *)&buf[pe_header + 0xc8] = file_sz; 
     237        put_unaligned_le32(file_sz, &buf[pe_header + 0xc8]); 
     238 
    233239#endif /* CONFIG_X86_32 */ 
    234240#endif /* CONFIG_EFI_STUB */ 
  • src/linux/universal/linux-3.3/arch/x86/include/asm/x86_init.h

    r18778 r19208  
    190190extern void x86_init_noop(void); 
    191191extern void x86_init_uint_noop(unsigned int unused); 
    192 extern void x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node); 
    193192 
    194193#endif 
  • src/linux/universal/linux-3.3/arch/x86/kernel/apic/apic.c

    r18778 r19208  
    16331633 
    16341634        /* The BIOS may have set up the APIC at some other address */ 
    1635         rdmsr(MSR_IA32_APICBASE, l, h); 
    1636         if (l & MSR_IA32_APICBASE_ENABLE) 
    1637                 mp_lapic_addr = l & MSR_IA32_APICBASE_BASE; 
     1635        if (boot_cpu_data.x86 >= 6) { 
     1636                rdmsr(MSR_IA32_APICBASE, l, h); 
     1637                if (l & MSR_IA32_APICBASE_ENABLE) 
     1638                        mp_lapic_addr = l & MSR_IA32_APICBASE_BASE; 
     1639        } 
    16381640 
    16391641        pr_info("Found and enabled local APIC!\n"); 
     
    16531655         * and AMD K7 (Model > 1) or later. 
    16541656         */ 
    1655         rdmsr(MSR_IA32_APICBASE, l, h); 
    1656         if (!(l & MSR_IA32_APICBASE_ENABLE)) { 
    1657                 pr_info("Local APIC disabled by BIOS -- reenabling.\n"); 
    1658                 l &= ~MSR_IA32_APICBASE_BASE; 
    1659                 l |= MSR_IA32_APICBASE_ENABLE | addr; 
    1660                 wrmsr(MSR_IA32_APICBASE, l, h); 
    1661                 enabled_via_apicbase = 1; 
     1657        if (boot_cpu_data.x86 >= 6) { 
     1658                rdmsr(MSR_IA32_APICBASE, l, h); 
     1659                if (!(l & MSR_IA32_APICBASE_ENABLE)) { 
     1660                        pr_info("Local APIC disabled by BIOS -- reenabling.\n"); 
     1661                        l &= ~MSR_IA32_APICBASE_BASE; 
     1662                        l |= MSR_IA32_APICBASE_ENABLE | addr; 
     1663                        wrmsr(MSR_IA32_APICBASE, l, h); 
     1664                        enabled_via_apicbase = 1; 
     1665                } 
    16621666        } 
    16631667        return apic_verify(); 
     
    22052209                 * SMP! We'll need to do this as part of the CPU restore! 
    22062210                 */ 
    2207                 rdmsr(MSR_IA32_APICBASE, l, h); 
    2208                 l &= ~MSR_IA32_APICBASE_BASE; 
    2209                 l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr; 
    2210                 wrmsr(MSR_IA32_APICBASE, l, h); 
     2211                if (boot_cpu_data.x86 >= 6) { 
     2212                        rdmsr(MSR_IA32_APICBASE, l, h); 
     2213                        l &= ~MSR_IA32_APICBASE_BASE; 
     2214                        l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr; 
     2215                        wrmsr(MSR_IA32_APICBASE, l, h); 
     2216                } 
    22112217        } 
    22122218 
  • src/linux/universal/linux-3.3/arch/x86/kernel/apic/apic_numachip.c

    r18778 r19208  
    202202static void fixup_cpu_id(struct cpuinfo_x86 *c, int node) 
    203203{ 
    204         c->phys_proc_id = node; 
    205         per_cpu(cpu_llc_id, smp_processor_id()) = node; 
     204 
     205        if (c->phys_proc_id != node) { 
     206                c->phys_proc_id = node; 
     207                per_cpu(cpu_llc_id, smp_processor_id()) = node; 
     208        } 
    206209} 
    207210 
  • src/linux/universal/linux-3.3/arch/x86/kernel/cpu/amd.c

    r18778 r19208  
    353353 
    354354        /* 
    355          * If core numbers are inconsistent, it's likely a multi-fabric platform, 
    356          * so invoke platform-specific handler 
    357          */ 
    358         if (c->phys_proc_id != node) 
     355         * On multi-fabric platform (e.g. Numascale NumaChip) a 
     356         * platform-specific handler needs to be called to fixup some 
     357         * IDs of the CPU. 
     358         */ 
     359        if (x86_cpuinit.fixup_cpu_id) 
    359360                x86_cpuinit.fixup_cpu_id(c, node); 
    360361 
  • src/linux/universal/linux-3.3/arch/x86/kernel/cpu/common.c

    r18778 r19208  
    11641164 
    11651165/* 
    1166  * Prints an error where the NUMA and configured core-number mismatch and the 
    1167  * platform didn't override this to fix it up 
    1168  */ 
    1169 void __cpuinit x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node) 
    1170 { 
    1171         pr_err("NUMA core number %d differs from configured core number %d\n", node, c->phys_proc_id); 
    1172 } 
    1173  
    1174 /* 
    11751166 * cpu_init() initializes state that is per-CPU. Some data is already 
    11761167 * initialized (naturally) in the bootstrap process, such as the GDT 
  • src/linux/universal/linux-3.3/arch/x86/kernel/i387.c

    r18778 r19208  
    155155                if (HAVE_HWFP && tsk == current) 
    156156                        unlazy_fpu(tsk); 
     157                tsk->thread.fpu.last_cpu = ~0; 
    157158                return 0; 
    158159        } 
  • src/linux/universal/linux-3.3/arch/x86/kernel/microcode_amd.c

    r18778 r19208  
    8383        struct cpuinfo_x86 *c = &cpu_data(cpu); 
    8484 
    85         if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) { 
    86                 pr_warning("CPU%d: family %d not supported\n", cpu, c->x86); 
    87                 return -1; 
    88         } 
    89  
    9085        csig->rev = c->microcode; 
    9186        pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev); 
     
    381376struct microcode_ops * __init init_amd_microcode(void) 
    382377{ 
     378        struct cpuinfo_x86 *c = &cpu_data(0); 
     379 
     380        if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) { 
     381                pr_warning("AMD CPU family 0x%x not supported\n", c->x86); 
     382                return NULL; 
     383        } 
     384 
    383385        patch = (void *)get_zeroed_page(GFP_KERNEL); 
    384386        if (!patch) 
  • src/linux/universal/linux-3.3/arch/x86/kernel/microcode_core.c

    r18778 r19208  
    419419                return err; 
    420420 
    421         if (microcode_init_cpu(cpu) == UCODE_ERROR) { 
    422                 sysfs_remove_group(&dev->kobj, &mc_attr_group); 
     421        if (microcode_init_cpu(cpu) == UCODE_ERROR) 
    423422                return -EINVAL; 
    424         } 
    425423 
    426424        return err; 
     
    514512        else if (c->x86_vendor == X86_VENDOR_AMD) 
    515513                microcode_ops = init_amd_microcode(); 
    516  
    517         if (!microcode_ops) { 
     514        else 
    518515                pr_err("no support for this CPU vendor\n"); 
     516 
     517        if (!microcode_ops) 
    519518                return -ENODEV; 
    520         } 
    521519 
    522520        microcode_pdev = platform_device_register_simple("microcode", -1, 
  • src/linux/universal/linux-3.3/arch/x86/kernel/x86_init.c

    r18778 r19208  
    9393struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = { 
    9494        .setup_percpu_clockev           = setup_secondary_APIC_clock, 
    95         .fixup_cpu_id                   = x86_default_fixup_cpu_id, 
    9695}; 
    9796 
  • src/linux/universal/linux-3.3/arch/x86/xen/smp.c

    r18778 r19208  
    173173{ 
    174174        int i, rc; 
     175        unsigned int subtract = 0; 
    175176 
    176177        if (!xen_initial_domain()) 
     
    187188                        set_cpu_possible(i, false); 
    188189                        set_cpu_present(i, false); 
     190                        subtract++; 
    189191                } 
    190192        } 
     193#ifdef CONFIG_HOTPLUG_CPU 
     194        /* This is akin to using 'nr_cpus' on the Linux command line. 
     195         * Which is OK as when we use 'dom0_max_vcpus=X' we can only 
     196         * have up to X, while nr_cpu_ids is greater than X. This 
     197         * normally is not a problem, except when CPU hotplugging 
     198         * is involved and then there might be more than X CPUs 
     199         * in the guest - which will not work as there is no 
     200         * hypercall to expand the max number of VCPUs an already 
     201         * running guest has. So cap it up to X. */ 
     202        if (subtract) 
     203                nr_cpu_ids = nr_cpu_ids - subtract; 
     204#endif 
     205 
    191206} 
    192207 
  • src/linux/universal/linux-3.3/arch/x86/xen/xen-asm.S

    r18778 r19208  
    9797        /* check for unmasked and pending */ 
    9898        cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending 
    99         jz 1f 
     99        jnz 1f 
    1001002:      call check_events 
    1011011: 
  • src/linux/universal/linux-3.3/drivers/ata/libata-eh.c

    r18778 r19208  
    35013501        int *trials = void_arg; 
    35023502 
    3503         if (ent->timestamp < now - min(now, interval)) 
     3503        if ((ent->eflags & ATA_EFLAG_OLD_ER) || 
     3504            (ent->timestamp < now - min(now, interval))) 
    35043505                return -1; 
    35053506 
  • src/linux/universal/linux-3.3/drivers/crypto/talitos.c

    r18778 r19208  
    125125        int irq[2]; 
    126126 
     127        /* SEC global registers lock  */ 
     128        spinlock_t reg_lock ____cacheline_aligned; 
     129 
    127130        /* SEC version geometry (from device tree node) */ 
    128131        unsigned int num_channels; 
     
    413416        struct device *dev = (struct device *)data;                     \ 
    414417        struct talitos_private *priv = dev_get_drvdata(dev);            \ 
     418        unsigned long flags;                                            \ 
    415419                                                                        \ 
    416420        if (ch_done_mask & 1)                                           \ 
     
    428432        /* At this point, all completed channels have been processed */ \ 
    429433        /* Unmask done interrupts for channels completed later on. */   \ 
     434        spin_lock_irqsave(&priv->reg_lock, flags);                      \ 
    430435        setbits32(priv->reg + TALITOS_IMR, ch_done_mask);               \ 
    431436        setbits32(priv->reg + TALITOS_IMR_LO, TALITOS_IMR_LO_INIT);     \ 
     437        spin_unlock_irqrestore(&priv->reg_lock, flags);                 \ 
    432438} 
    433439DEF_TALITOS_DONE(4ch, TALITOS_ISR_4CHDONE) 
     
    620626        struct talitos_private *priv = dev_get_drvdata(dev);                   \ 
    621627        u32 isr, isr_lo;                                                       \ 
     628        unsigned long flags;                                                   \ 
    622629                                                                               \ 
     630        spin_lock_irqsave(&priv->reg_lock, flags);                             \ 
    623631        isr = in_be32(priv->reg + TALITOS_ISR);                                \ 
    624632        isr_lo = in_be32(priv->reg + TALITOS_ISR_LO);                          \ 
     
    627635        out_be32(priv->reg + TALITOS_ICR_LO, isr_lo);                          \ 
    628636                                                                               \ 
    629         if (unlikely((isr & ~TALITOS_ISR_4CHDONE) & ch_err_mask || isr_lo))    \ 
    630                 talitos_error(dev, isr, isr_lo);                               \ 
    631         else                                                                   \ 
     637        if (unlikely(isr & ch_err_mask || isr_lo)) {                           \ 
     638                spin_unlock_irqrestore(&priv->reg_lock, flags);                \ 
     639                talitos_error(dev, isr & ch_err_mask, isr_lo);                 \ 
     640        }                                                                      \ 
     641        else {                                                                 \ 
    632642                if (likely(isr & ch_done_mask)) {                              \ 
    633643                        /* mask further done interrupts. */                    \ 
     
    636646                        tasklet_schedule(&priv->done_task[tlet]);              \ 
    637647                }                                                              \ 
     648                spin_unlock_irqrestore(&priv->reg_lock, flags);                \ 
     649        }                                                                      \ 
    638650                                                                               \ 
    639651        return (isr & (ch_done_mask | ch_err_mask) || isr_lo) ? IRQ_HANDLED :  \ 
     
    27192731        priv->ofdev = ofdev; 
    27202732 
     2733        spin_lock_init(&priv->reg_lock); 
     2734 
    27212735        err = talitos_probe_irq(ofdev); 
    27222736        if (err) 
  • src/linux/universal/linux-3.3/drivers/dma/at_hdmac.c

    r18778 r19208  
    241241 
    242242        vdbg_dump_regs(atchan); 
    243  
    244         /* clear any pending interrupt */ 
    245         while (dma_readl(atdma, EBCISR)) 
    246                 cpu_relax(); 
    247243 
    248244        channel_writel(atchan, SADDR, 0); 
  • src/linux/universal/linux-3.3/drivers/firmware/efivars.c

    r18778 r19208  
    192192} 
    193193 
     194static bool 
     195validate_device_path(struct efi_variable *var, int match, u8 *buffer, 
     196                     unsigned long len) 
     197{ 
     198        struct efi_generic_dev_path *node; 
     199        int offset = 0; 
     200 
     201        node = (struct efi_generic_dev_path *)buffer; 
     202 
     203        if (len < sizeof(*node)) 
     204                return false; 
     205 
     206        while (offset <= len - sizeof(*node) && 
     207               node->length >= sizeof(*node) && 
     208                node->length <= len - offset) { 
     209                offset += node->length; 
     210 
     211                if ((node->type == EFI_DEV_END_PATH || 
     212                     node->type == EFI_DEV_END_PATH2) && 
     213                    node->sub_type == EFI_DEV_END_ENTIRE) 
     214                        return true; 
     215 
     216                node = (struct efi_generic_dev_path *)(buffer + offset); 
     217        } 
     218 
     219        /* 
     220         * If we're here then either node->length pointed past the end 
     221         * of the buffer or we reached the end of the buffer without 
     222         * finding a device path end node. 
     223         */ 
     224        return false; 
     225} 
     226 
     227static bool 
     228validate_boot_order(struct efi_variable *var, int match, u8 *buffer, 
     229                    unsigned long len) 
     230{ 
     231        /* An array of 16-bit integers */ 
     232        if ((len % 2) != 0) 
     233                return false; 
     234 
     235        return true; 
     236} 
     237 
     238static bool 
     239validate_load_option(struct efi_variable *var, int match, u8 *buffer, 
     240                     unsigned long len) 
     241{ 
     242        u16 filepathlength; 
     243        int i, desclength = 0, namelen; 
     244 
     245        namelen = utf16_strnlen(var->VariableName, sizeof(var->VariableName)); 
     246 
     247        /* Either "Boot" or "Driver" followed by four digits of hex */ 
     248        for (i = match; i < match+4; i++) { 
     249                if (var->VariableName[i] > 127 || 
     250                    hex_to_bin(var->VariableName[i] & 0xff) < 0) 
     251                        return true; 
     252        } 
     253 
     254        /* Reject it if there's 4 digits of hex and then further content */ 
     255        if (namelen > match + 4) 
     256                return false; 
     257 
     258        /* A valid entry must be at least 8 bytes */ 
     259        if (len < 8) 
     260                return false; 
     261 
     262        filepathlength = buffer[4] | buffer[5] << 8; 
     263 
     264        /* 
     265         * There's no stored length for the description, so it has to be 
     266         * found by hand 
     267         */ 
     268        desclength = utf16_strsize((efi_char16_t *)(buffer + 6), len - 6) + 2; 
     269 
     270        /* Each boot entry must have a descriptor */ 
     271        if (!desclength) 
     272                return false; 
     273 
     274        /* 
     275         * If the sum of the length of the description, the claimed filepath 
     276         * length and the original header are greater than the length of the 
     277         * variable, it's malformed 
     278         */ 
     279        if ((desclength + filepathlength + 6) > len) 
     280                return false; 
     281 
     282        /* 
     283         * And, finally, check the filepath 
     284         */ 
     285        return validate_device_path(var, match, buffer + desclength + 6, 
     286                                    filepathlength); 
     287} 
     288 
     289static bool 
     290validate_uint16(struct efi_variable *var, int match, u8 *buffer, 
     291                unsigned long len) 
     292{ 
     293        /* A single 16-bit integer */ 
     294        if (len != 2) 
     295                return false; 
     296 
     297        return true; 
     298} 
     299 
     300static bool 
     301validate_ascii_string(struct efi_variable *var, int match, u8 *buffer, 
     302                      unsigned long len) 
     303{ 
     304        int i; 
     305 
     306        for (i = 0; i < len; i++) { 
     307                if (buffer[i] > 127) 
     308                        return false; 
     309 
     310                if (buffer[i] == 0) 
     311                        return true; 
     312        } 
     313 
     314        return false; 
     315} 
     316 
     317struct variable_validate { 
     318        char *name; 
     319        bool (*validate)(struct efi_variable *var, int match, u8 *data, 
     320                         unsigned long len); 
     321}; 
     322 
     323static const struct variable_validate variable_validate[] = { 
     324        { "BootNext", validate_uint16 }, 
     325        { "BootOrder", validate_boot_order }, 
     326        { "DriverOrder", validate_boot_order }, 
     327        { "Boot*", validate_load_option }, 
     328        { "Driver*", validate_load_option }, 
     329        { "ConIn", validate_device_path }, 
     330        { "ConInDev", validate_device_path }, 
     331        { "ConOut", validate_device_path }, 
     332        { "ConOutDev", validate_device_path }, 
     333        { "ErrOut", validate_device_path }, 
     334        { "ErrOutDev", validate_device_path }, 
     335        { "Timeout", validate_uint16 }, 
     336        { "Lang", validate_ascii_string }, 
     337        { "PlatformLang", validate_ascii_string }, 
     338        { "", NULL }, 
     339}; 
     340 
     341static bool 
     342validate_var(struct efi_variable *var, u8 *data, unsigned long len) 
     343{ 
     344        int i; 
     345        u16 *unicode_name = var->VariableName; 
     346 
     347        for (i = 0; variable_validate[i].validate != NULL; i++) { 
     348                const char *name = variable_validate[i].name; 
     349                int match; 
     350 
     351                for (match = 0; ; match++) { 
     352                        char c = name[match]; 
     353                        u16 u = unicode_name[match]; 
     354 
     355                        /* All special variables are plain ascii */ 
     356                        if (u > 127) 
     357                                return true; 
     358 
     359                        /* Wildcard in the matching name means we've matched */ 
     360                        if (c == '*') 
     361                                return variable_validate[i].validate(var, 
     362                                                             match, data, len); 
     363 
     364                        /* Case sensitive match */ 
     365                        if (c != u) 
     366                                break; 
     367 
     368                        /* Reached the end of the string while matching */ 
     369                        if (!c) 
     370                                return variable_validate[i].validate(var, 
     371                                                             match, data, len); 
     372                } 
     373        } 
     374 
     375        return true; 
     376} 
     377 
    194378static efi_status_t 
    195379get_var_data_locked(struct efivars *efivars, struct efi_variable *var) 
     
    322506        if ((new_var->DataSize <= 0) || (new_var->Attributes == 0)){ 
    323507                printk(KERN_ERR "efivars: DataSize & Attributes must be valid!\n"); 
     508                return -EINVAL; 
     509        } 
     510 
     511        if ((new_var->Attributes & ~EFI_VARIABLE_MASK) != 0 || 
     512            validate_var(new_var, new_var->Data, new_var->DataSize) == false) { 
     513                printk(KERN_ERR "efivars: Malformed variable content\n"); 
    324514                return -EINVAL; 
    325515        } 
     
    627817                return -EACCES; 
    628818 
     819        if ((new_var->Attributes & ~EFI_VARIABLE_MASK) != 0 || 
     820            validate_var(new_var, new_var->Data, new_var->DataSize) == false) { 
     821                printk(KERN_ERR "efivars: Malformed variable content\n"); 
     822                return -EINVAL; 
     823        } 
     824 
    629825        spin_lock(&efivars->lock); 
    630826 
  • src/linux/universal/linux-3.3/drivers/gpu/drm/i915/i915_gem_execbuffer.c

    r18778 r19208  
    10831083                } 
    10841084 
     1085                if (args->num_cliprects > UINT_MAX / sizeof(*cliprects)) { 
     1086                        DRM_DEBUG("execbuf with %u cliprects\n", 
     1087                                  args->num_cliprects); 
     1088                        return -EINVAL; 
     1089                } 
    10851090                cliprects = kmalloc(args->num_cliprects * sizeof(*cliprects), 
    10861091                                    GFP_KERNEL); 
     
    13541359        int ret; 
    13551360 
    1356         if (args->buffer_count < 1) { 
     1361        if (args->buffer_count < 1 || 
     1362            args->buffer_count > UINT_MAX / sizeof(*exec2_list)) { 
    13571363                DRM_ERROR("execbuf2 with %d buffers\n", args->buffer_count); 
    13581364                return -EINVAL; 
  • src/linux/universal/linux-3.3/drivers/gpu/drm/i915/i915_reg.h

    r19019 r19208  
    524524#define   CM0_IZ_OPT_DISABLE      (1<<6) 
    525525#define   CM0_ZR_OPT_DISABLE      (1<<5) 
     526#define   CM0_STC_EVICT_DISABLE_LRA_SNB (1<<5) 
    526527#define   CM0_DEPTH_EVICT_DISABLE (1<<4) 
    527528#define   CM0_COLOR_EVICT_DISABLE (1<<3) 
  • src/linux/universal/linux-3.3/drivers/gpu/drm/i915/intel_ringbuffer.c

    r19073 r19208  
    418418                I915_WRITE(INSTPM, 
    419419                           INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING); 
     420 
     421                /* From the Sandybridge PRM, volume 1 part 3, page 24: 
     422                 * "If this bit is set, STCunit will have LRA as replacement 
     423                 *  policy. [...] This bit must be reset.  LRA replacement 
     424                 *  policy is not supported." 
     425                 */ 
     426                I915_WRITE(CACHE_MODE_0, 
     427                           CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT); 
    420428        } 
    421429 
  • src/linux/universal/linux-3.3/drivers/gpu/drm/i915/intel_sdvo.c

    r18778 r19208  
    732732        uint16_t h_blank_len, h_sync_len, v_blank_len, v_sync_len; 
    733733        uint16_t h_sync_offset, v_sync_offset; 
     734        int mode_clock; 
    734735 
    735736        width = mode->crtc_hdisplay; 
     
    746747        v_sync_offset = mode->crtc_vsync_start - mode->crtc_vblank_start; 
    747748 
    748         dtd->part1.clock = mode->clock / 10; 
     749        mode_clock = mode->clock; 
     750        mode_clock /= intel_mode_get_pixel_multiplier(mode) ?: 1; 
     751        mode_clock /= 10; 
     752        dtd->part1.clock = mode_clock; 
     753 
    749754        dtd->part1.h_active = width & 0xff; 
    750755        dtd->part1.h_blank = h_blank_len & 0xff; 
     
    9981003        u32 sdvox; 
    9991004        struct intel_sdvo_in_out_map in_out; 
    1000         struct intel_sdvo_dtd input_dtd; 
     1005        struct intel_sdvo_dtd input_dtd, output_dtd; 
    10011006        int pixel_multiplier = intel_mode_get_pixel_multiplier(adjusted_mode); 
    10021007        int rate; 
     
    10231028                return; 
    10241029 
    1025         /* We have tried to get input timing in mode_fixup, and filled into 
    1026          * adjusted_mode. 
    1027          */ 
    1028         if (intel_sdvo->is_tv || intel_sdvo->is_lvds) { 
    1029                 input_dtd = intel_sdvo->input_dtd; 
    1030         } else { 
    1031                 /* Set the output timing to the screen */ 
    1032                 if (!intel_sdvo_set_target_output(intel_sdvo, 
    1033                                                   intel_sdvo->attached_output)) 
    1034                         return; 
    1035  
    1036                 intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); 
    1037                 (void) intel_sdvo_set_output_timing(intel_sdvo, &input_dtd); 
    1038         } 
     1030        /* lvds has a special fixed output timing. */ 
     1031        if (intel_sdvo->is_lvds) 
     1032                intel_sdvo_get_dtd_from_mode(&output_dtd, 
     1033                                             intel_sdvo->sdvo_lvds_fixed_mode); 
     1034        else 
     1035                intel_sdvo_get_dtd_from_mode(&output_dtd, mode); 
     1036        (void) intel_sdvo_set_output_timing(intel_sdvo, &output_dtd); 
    10391037 
    10401038        /* Set the input timing to the screen. Assume always input 0. */ 
     
    10541052                return; 
    10551053 
     1054        /* We have tried to get input timing in mode_fixup, and filled into 
     1055         * adjusted_mode. 
     1056         */ 
     1057        intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); 
    10561058        (void) intel_sdvo_set_input_timing(intel_sdvo, &input_dtd); 
    10571059 
  • src/linux/universal/linux-3.3/drivers/gpu/drm/nouveau/nouveau_acpi.c

    r18778 r19208  
    271271        struct pci_dev *pdev = NULL; 
    272272        int has_dsm = 0; 
    273         int has_optimus; 
     273        int has_optimus = 0; 
    274274        int vga_count = 0; 
    275275        bool guid_valid; 
  • src/linux/universal/linux-3.3/drivers/gpu/drm/radeon/atombios_crtc.c

    r18879 r19208  
    913913        } 
    914914 
    915         if (radeon_encoder->active_device & 
    916             (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) { 
     915        if ((radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) || 
     916            (radeon_encoder_get_dp_bridge_encoder_id(encoder) != ENCODER_OBJECT_ID_NONE)) { 
    917917                struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; 
    918918                struct drm_connector *connector = 
  • src/linux/universal/linux-3.3/drivers/hwmon/coretemp.c

    r18778 r19208  
    5252 
    5353#define BASE_SYSFS_ATTR_NO      2       /* Sysfs Base attr no for coretemp */ 
    54 #define NUM_REAL_CORES          16      /* Number of Real cores per cpu */ 
     54#define NUM_REAL_CORES          32      /* Number of Real cores per cpu */ 
    5555#define CORETEMP_NAME_LENGTH    17      /* String Length of attrs */ 
    5656#define MAX_CORE_ATTRS          4       /* Maximum no of basic attrs */ 
     
    709709        indx = TO_ATTR_NO(cpu); 
    710710 
     711        /* The core id is too big, just return */ 
     712        if (indx > MAX_CORE_DATA - 1) 
     713                return; 
     714 
    711715        if (pdata->core_data[indx] && pdata->core_data[indx]->cpu == cpu) 
    712716                coretemp_remove_core(pdata, &pdev->dev, indx); 
  • src/linux/universal/linux-3.3/drivers/hwmon/fam15h_power.c

    r18879 r19208  
    123123} 
    124124 
     125/* 
     126 * Newer BKDG versions have an updated recommendation on how to properly 
     127 * initialize the running average range (was: 0xE, now: 0x9). This avoids 
     128 * counter saturations resulting in bogus power readings. 
     129 * We correct this value ourselves to cope with older BIOSes. 
     130 */ 
     131static DEFINE_PCI_DEVICE_TABLE(affected_device) = { 
     132        { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, 
     133        { 0 } 
     134}; 
     135 
     136static void __devinit tweak_runavg_range(struct pci_dev *pdev) 
     137{ 
     138        u32 val; 
     139 
     140        /* 
     141         * let this quirk apply only to the current version of the 
     142         * northbridge, since future versions may change the behavior 
     143         */ 
     144        if (!pci_match_id(affected_device, pdev)) 
     145                return; 
     146 
     147        pci_bus_read_config_dword(pdev->bus, 
     148                PCI_DEVFN(PCI_SLOT(pdev->devfn), 5), 
     149                REG_TDP_RUNNING_AVERAGE, &val); 
     150        if ((val & 0xf) != 0xe) 
     151                return; 
     152 
     153        val &= ~0xf; 
     154        val |=  0x9; 
     155        pci_bus_write_config_dword(pdev->bus, 
     156                PCI_DEVFN(PCI_SLOT(pdev->devfn), 5), 
     157                REG_TDP_RUNNING_AVERAGE, val); 
     158} 
     159 
    125160static void __devinit fam15h_power_init_data(struct pci_dev *f4, 
    126161                                             struct fam15h_power_data *data) 
     
    155190        struct device *dev; 
    156191        int err; 
     192 
     193        /* 
     194         * though we ignore every other northbridge, we still have to 
     195         * do the tweaking on _each_ node in MCM processors as the counters 
     196         * are working hand-in-hand 
     197         */ 
     198        tweak_runavg_range(pdev); 
    157199 
    158200        if (!fam15h_power_is_internal_node0(pdev)) { 
  • src/linux/universal/linux-3.3/drivers/i2c/busses/i2c-pnx.c

    r18778 r19208  
    547547        struct i2c_pnx_algo_data *alg_data = platform_get_drvdata(pdev); 
    548548 
    549         /* FIXME: shouldn't this be clk_disable? */ 
    550         clk_enable(alg_data->clk); 
     549        clk_disable(alg_data->clk); 
    551550 
    552551        return 0; 
  • src/linux/universal/linux-3.3/drivers/input/mouse/synaptics.c

    r18778 r19208  
    275275        struct synaptics_data *priv = psmouse->private; 
    276276 
    277         if (!SYN_CAP_ADV_GESTURE(priv->ext_cap_0c)) 
     277        if (!(SYN_CAP_ADV_GESTURE(priv->ext_cap_0c) || 
     278              SYN_CAP_IMAGE_SENSOR(priv->ext_cap_0c))) 
    278279                return 0; 
    279280 
  • src/linux/universal/linux-3.3/drivers/md/raid5.c

    r18778 r19208  
    32783278                 *     we must be recovering. 
    32793279                 * else if we are after recovery_cp, we must be syncing 
     3280                 * else if MD_RECOVERY_REQUESTED is set, we also are syncing. 
    32803281                 * else we can only be replacing 
    32813282                 * sync and recovery both need to read all devices, and so 
     
    32833284                 */ 
    32843285                if (do_recovery || 
    3285                     sh->sector >= conf->mddev->recovery_cp) 
     3286                    sh->sector >= conf->mddev->recovery_cp || 
     3287                    test_bit(MD_RECOVERY_REQUESTED, &(conf->mddev->recovery))) 
    32863288                        s->syncing = 1; 
    32873289                else 
  • src/linux/universal/linux-3.3/drivers/net/wireless/b43/main.c

    r18778 r19208  
    48424842        mutex_unlock(&wl->mutex); 
    48434843 
    4844         /* reload configuration */ 
    4845         b43_op_config(hw, ~0); 
     4844        /* 
     4845         * Configuration may have been overwritten during initialization. 
     4846         * Reload the configuration, but only if initialization was 
     4847         * successful. Reloading the configuration after a failed init 
     4848         * may hang the system. 
     4849         */ 
     4850        if (!err) 
     4851                b43_op_config(hw, ~0); 
    48464852 
    48474853        return err; 
  • src/linux/universal/linux-3.3/drivers/net/wireless/ipw2x00/ipw2200.c

    r18778 r19208  
    21922192        int rc = 0; 
    21932193        unsigned long flags; 
     2194        unsigned long now, end; 
    21942195 
    21952196        spin_lock_irqsave(&priv->lock, flags); 
     
    22332234        spin_unlock_irqrestore(&priv->lock, flags); 
    22342235 
     2236        now = jiffies; 
     2237        end = now + HOST_COMPLETE_TIMEOUT; 
     2238again: 
    22352239        rc = wait_event_interruptible_timeout(priv->wait_command_queue, 
    22362240                                              !(priv-> 
    22372241                                                status & STATUS_HCMD_ACTIVE), 
    2238                                               HOST_COMPLETE_TIMEOUT); 
     2242                                              end - now); 
     2243        if (rc < 0) { 
     2244                now = jiffies; 
     2245                if (time_before(now, end)) 
     2246                        goto again; 
     2247                rc = 0; 
     2248        } 
     2249 
    22392250        if (rc == 0) { 
    22402251                spin_lock_irqsave(&priv->lock, flags); 
  • src/linux/universal/linux-3.3/drivers/net/wireless/iwlwifi/iwl-1000.c

    r18778 r19208  
    4646 
    4747/* Highest firmware API version supported */ 
    48 #define IWL1000_UCODE_API_MAX 6 
    49 #define IWL100_UCODE_API_MAX 6 
     48#define IWL1000_UCODE_API_MAX 5 
     49#define IWL100_UCODE_API_MAX 5 
    5050 
    5151/* Oldest version we won't warn about */ 
     
    236236}; 
    237237 
    238 MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); 
    239 MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_MAX)); 
     238MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_OK)); 
     239MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_OK)); 
  • src/linux/universal/linux-3.3/drivers/net/wireless/iwlwifi/iwl-2000.c

    r18778 r19208  
    5252 
    5353/* Oldest version we won't warn about */ 
    54 #define IWL2030_UCODE_API_OK 5 
    55 #define IWL2000_UCODE_API_OK 5 
    56 #define IWL105_UCODE_API_OK 5 
    57 #define IWL135_UCODE_API_OK 5 
     54#define IWL2030_UCODE_API_OK 6 
     55#define IWL2000_UCODE_API_OK 6 
     56#define IWL105_UCODE_API_OK 6 
     57#define IWL135_UCODE_API_OK 6 
    5858 
    5959/* Lowest firmware API version supported */ 
     
    339339}; 
    340340 
    341 MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX)); 
    342 MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX)); 
    343 MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX)); 
    344 MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX)); 
     341MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK)); 
     342MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK)); 
     343MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK)); 
     344MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK)); 
  • src/linux/universal/linux-3.3/drivers/net/wireless/iwlwifi/iwl-5000.c

    r18778 r19208  
    5050#define IWL5000_UCODE_API_MAX 5 
    5151#define IWL5150_UCODE_API_MAX 2 
     52 
     53/* Oldest version we won't warn about */ 
     54#define IWL5000_UCODE_API_OK 5 
     55#define IWL5150_UCODE_API_OK 2 
    5256 
    5357/* Lowest firmware API version supported */ 
     
    360364        .fw_name_pre = IWL5000_FW_PRE,                          \ 
    361365        .ucode_api_max = IWL5000_UCODE_API_MAX,                 \ 
     366        .ucode_api_ok = IWL5000_UCODE_API_OK,                   \ 
    362367        .ucode_api_min = IWL5000_UCODE_API_MIN,                 \ 
    363368        .eeprom_ver = EEPROM_5000_EEPROM_VERSION,               \ 
     
    403408        .fw_name_pre = IWL5000_FW_PRE, 
    404409        .ucode_api_max = IWL5000_UCODE_API_MAX, 
     410        .ucode_api_ok = IWL5000_UCODE_API_OK, 
    405411        .ucode_api_min = IWL5000_UCODE_API_MIN, 
    406412        .eeprom_ver = EEPROM_5050_EEPROM_VERSION, 
     
    416422        .fw_name_pre = IWL5150_FW_PRE,                          \ 
    417423        .ucode_api_max = IWL5150_UCODE_API_MAX,                 \ 
     424        .ucode_api_ok = IWL5150_UCODE_API_OK,                   \ 
    418425        .ucode_api_min = IWL5150_UCODE_API_MIN,                 \ 
    419426        .eeprom_ver = EEPROM_5050_EEPROM_VERSION,               \ 
     
    437444}; 
    438445 
    439 MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); 
    440 MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX)); 
     446MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_OK)); 
     447MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_OK)); 
  • src/linux/universal/linux-3.3/drivers/net/wireless/iwlwifi/iwl-6000.c

    r18778 r19208  
    5454#define IWL6000_UCODE_API_OK 4 
    5555#define IWL6000G2_UCODE_API_OK 5 
     56#define IWL6050_UCODE_API_OK 5 
     57#define IWL6000G2B_UCODE_API_OK 6 
    5658 
    5759/* Lowest firmware API version supported */ 
     
    390392        .fw_name_pre = IWL6030_FW_PRE,                          \ 
    391393        .ucode_api_max = IWL6000G2_UCODE_API_MAX,               \ 
    392         .ucode_api_ok = IWL6000G2_UCODE_API_OK,                 \ 
     394        .ucode_api_ok = IWL6000G2B_UCODE_API_OK,                \ 
    393395        .ucode_api_min = IWL6000G2_UCODE_API_MIN,               \ 
    394396        .eeprom_ver = EEPROM_6030_EEPROM_VERSION,               \ 
     
    549551 
    550552MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK)); 
    551 MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX)); 
    552 MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX)); 
    553 MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX)); 
     553MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK)); 
     554MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK)); 
     555MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK)); 
  • src/linux/universal/linux-3.3/drivers/net/wireless/iwlwifi/iwl-agn.c

    r18778 r19208  
    14041404void iwlagn_prepare_restart(struct iwl_priv *priv) 
    14051405{ 
    1406         struct iwl_rxon_context *ctx; 
    14071406        bool bt_full_concurrent; 
    14081407        u8 bt_ci_compliance; 
     
    14131412        lockdep_assert_held(&priv->shrd->mutex); 
    14141413 
    1415         for_each_context(priv, ctx) 
    1416                 ctx->vif = NULL; 
    14171414        priv->is_open = 0; 
    14181415 
  • src/linux/universal/linux-3.3/drivers/net/wireless/iwlwifi/iwl-fh.h

    r18778 r19208  
    105105 * bytes from one another.  Each TFD circular buffer in DRAM must be 256-byte 
    106106 * aligned (address bits 0-7 must be 0). 
     107 * Later devices have 20 (5000 series) or 30 (higher) queues, but the registers 
     108 * for them are in different places. 
    107109 * 
    108110 * Bit fields in each pointer register: 
    109111 *  27-0: TFD CB physical base address [35:8], must be 256-byte aligned 
    110112 */ 
    111 #define FH_MEM_CBBC_LOWER_BOUND          (FH_MEM_LOWER_BOUND + 0x9D0) 
    112 #define FH_MEM_CBBC_UPPER_BOUND          (FH_MEM_LOWER_BOUND + 0xA10) 
    113  
    114 /* Find TFD CB base pointer for given queue (range 0-15). */ 
    115 #define FH_MEM_CBBC_QUEUE(x)  (FH_MEM_CBBC_LOWER_BOUND + (x) * 0x4) 
     113#define FH_MEM_CBBC_0_15_LOWER_BOUND            (FH_MEM_LOWER_BOUND + 0x9D0) 
     114#define FH_MEM_CBBC_0_15_UPPER_BOUND            (FH_MEM_LOWER_BOUND + 0xA10) 
     115#define FH_MEM_CBBC_16_19_LOWER_BOUND           (FH_MEM_LOWER_BOUND + 0xBF0) 
     116#define FH_MEM_CBBC_16_19_UPPER_BOUND           (FH_MEM_LOWER_BOUND + 0xC00) 
     117#define FH_MEM_CBBC_20_31_LOWER_BOUND           (FH_MEM_LOWER_BOUND + 0xB20) 
     118#define FH_MEM_CBBC_20_31_UPPER_BOUND           (FH_MEM_LOWER_BOUND + 0xB80) 
     119 
     120/* Find TFD CB base pointer for given queue */ 
     121static inline unsigned int FH_MEM_CBBC_QUEUE(unsigned int chnl) 
     122{ 
     123        if (chnl < 16) 
     124                return FH_MEM_CBBC_0_15_LOWER_BOUND + 4 * chnl; 
     125        if (chnl < 20) 
     126                return FH_MEM_CBBC_16_19_LOWER_BOUND + 4 * (chnl - 16); 
     127        WARN_ON_ONCE(chnl >= 32); 
     128        return FH_MEM_CBBC_20_31_LOWER_BOUND + 4 * (chnl - 20); 
     129} 
    116130 
    117131 
  • src/linux/universal/linux-3.3/drivers/net/wireless/iwlwifi/iwl-mac80211.c

    r18778 r19208  
    12271227        int err; 
    12281228        enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif); 
     1229        bool reset = false; 
    12291230 
    12301231        IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n", 
     
    12481249 
    12491250                if (tmp->vif) { 
     1251                        /* On reset we need to add the same interface again */ 
     1252                        if (tmp->vif == vif) { 
     1253                                reset = true; 
     1254                                ctx = tmp; 
     1255                                break; 
     1256                        } 
     1257 
    12501258                        /* check if this busy context is exclusive */ 
    12511259                        if (tmp->exclusive_interface_modes & 
     
    12741282 
    12751283        err = iwl_setup_interface(priv, ctx); 
    1276         if (!err) 
     1284        if (!err || reset) 
    12771285                goto out; 
    12781286 
  • src/linux/universal/linux-3.3/drivers/net/wireless/iwlwifi/iwl-prph.h

    r18778 r19208  
    228228#define SCD_TXFACT              (SCD_BASE + 0x10) 
    229229#define SCD_ACTIVE              (SCD_BASE + 0x14) 
    230 #define SCD_QUEUE_WRPTR(x)      (SCD_BASE + 0x18 + (x) * 4) 
    231 #define SCD_QUEUE_RDPTR(x)      (SCD_BASE + 0x68 + (x) * 4) 
    232230#define SCD_QUEUECHAIN_SEL      (SCD_BASE + 0xe8) 
    233231#define SCD_AGGR_SEL            (SCD_BASE + 0x248) 
    234232#define SCD_INTERRUPT_MASK      (SCD_BASE + 0x108) 
    235 #define SCD_QUEUE_STATUS_BITS(x)        (SCD_BASE + 0x10c + (x) * 4) 
     233 
     234static inline unsigned int SCD_QUEUE_WRPTR(unsigned int chnl) 
     235{ 
     236        if (chnl < 20) 
     237                return SCD_BASE + 0x18 + chnl * 4; 
     238        WARN_ON_ONCE(chnl >= 32); 
     239        return SCD_BASE + 0x284 + (chnl - 20) * 4; 
     240} 
     241 
     242static inline unsigned int SCD_QUEUE_RDPTR(unsigned int chnl) 
     243{ 
     244        if (chnl < 20) 
     245                return SCD_BASE + 0x68 + chnl * 4; 
     246        WARN_ON_ONCE(chnl >= 32); 
     247        return SCD_BASE + 0x2B4 + (chnl - 20) * 4; 
     248} 
     249 
     250static inline unsigned int SCD_QUEUE_STATUS_BITS(unsigned int chnl) 
     251{ 
     252        if (chnl < 20) 
     253                return SCD_BASE + 0x10c + chnl * 4; 
     254        WARN_ON_ONCE(chnl >= 32); 
     255        return SCD_BASE + 0x384 + (chnl - 20) * 4; 
     256} 
    236257 
    237258/*********************** END TX SCHEDULER *************************************/ 
  • src/linux/universal/linux-3.3/drivers/net/wireless/rtlwifi/pci.c

    r19073 r19208  
    19561956                rtlpriv->intf_ops->adapter_stop(hw); 
    19571957        } 
     1958        rtlpriv->cfg->ops->disable_interrupt(hw); 
    19581959 
    19591960        /*deinit rfkill */ 
  • src/linux/universal/linux-3.3/drivers/net/wireless/wl1251/main.c

    r18778 r19208  
    480480        cancel_work_sync(&wl->tx_work); 
    481481        cancel_work_sync(&wl->filter_work); 
     482        cancel_delayed_work_sync(&wl->elp_work); 
    482483 
    483484        mutex_lock(&wl->mutex); 
  • src/linux/universal/linux-3.3/drivers/net/wireless/wl1251/sdio.c

    r18778 r19208  
    316316        if (wl->irq) 
    317317                free_irq(wl->irq, wl); 
     318        wl1251_free_hw(wl); 
    318319        kfree(wl_sdio); 
    319         wl1251_free_hw(wl); 
    320320 
    321321        sdio_claim_host(func); 
  • src/linux/universal/linux-3.3/drivers/platform/x86/dell-laptop.c

    r19156 r19208  
    212212                .driver_data = &quirk_dell_vostro_v130, 
    213213        }, 
     214        { } 
    214215}; 
    215216 
  • src/linux/universal/linux-3.3/drivers/scsi/libsas/sas_expander.c

    r18778 r19208  
    193193        phy->attached_iproto = dr->iproto << 1; 
    194194        phy->attached_tproto = dr->tproto << 1; 
    195         memcpy(phy->attached_sas_addr, dr->attached_sas_addr, SAS_ADDR_SIZE); 
     195        /* help some expanders that fail to zero sas_address in the 'no 
     196         * device' case 
     197         */ 
     198        if (phy->attached_dev_type == NO_DEVICE || 
     199            phy->linkrate < SAS_LINK_RATE_1_5_GBPS) 
     200                memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); 
     201        else 
     202                memcpy(phy->attached_sas_addr, dr->attached_sas_addr, SAS_ADDR_SIZE); 
    196203        phy->attached_phy_id = dr->attached_phy_id; 
    197204        phy->phy_change_count = dr->change_count; 
     
    16441651 
    16451652                res = sas_get_phy_change_count(dev, i, &phy_change_count); 
    1646                 if (res) 
    1647                         goto out; 
    1648                 else if (phy_change_count != ex->ex_phy[i].phy_change_count) { 
     1653                switch (res) { 
     1654                case SMP_RESP_PHY_VACANT: 
     1655                case SMP_RESP_NO_PHY: 
     1656                        continue; 
     1657                case SMP_RESP_FUNC_ACC: 
     1658                        break; 
     1659                default: 
     1660                        return res; 
     1661                } 
     1662 
     1663                if (phy_change_count != ex->ex_phy[i].phy_change_count) { 
    16491664                        if (update) 
    16501665                                ex->ex_phy[i].phy_change_count = 
     
    16541669                } 
    16551670        } 
    1656 out: 
    1657         return res; 
     1671        return 0; 
    16581672} 
    16591673 
  • src/linux/universal/linux-3.3/drivers/usb/class/cdc-wdm.c

    r18879 r19208  
    109109        desc->werr = urb->status; 
    110110        spin_unlock(&desc->iuspin); 
     111        kfree(desc->outbuf); 
     112        desc->outbuf = NULL; 
    111113        clear_bit(WDM_IN_USE, &desc->flags); 
    112         kfree(desc->outbuf); 
    113114        wake_up(&desc->wait); 
    114115} 
     
    313314                return -EIO; 
    314315 
    315         desc->outbuf = buf = kmalloc(count, GFP_KERNEL); 
     316        buf = kmalloc(count, GFP_KERNEL); 
    316317        if (!buf) { 
    317318                rv = -ENOMEM; 
     
    377378        req->wLength = cpu_to_le16(count); 
    378379        set_bit(WDM_IN_USE, &desc->flags); 
     380        desc->outbuf = buf; 
    379381 
    380382        rv = usb_submit_urb(desc->command, GFP_KERNEL); 
    381383        if (rv < 0) { 
    382384                kfree(buf); 
     385                desc->outbuf = NULL; 
    383386                clear_bit(WDM_IN_USE, &desc->flags); 
    384387                dev_err(&desc->intf->dev, "Tx URB error: %d\n", rv); 
  • src/linux/universal/linux-3.3/drivers/usb/core/hcd-pci.c

    r18778 r19208  
    492492        pci_save_state(pci_dev); 
    493493 
     494        /* 
     495         * Some systems crash if an EHCI controller is in D3 during 
     496         * a sleep transition.  We have to leave such controllers in D0. 
     497         */ 
     498        if (hcd->broken_pci_sleep) { 
     499                dev_dbg(dev, "Staying in PCI D0\n"); 
     500                return retval; 
     501        } 
     502 
    494503        /* If the root hub is dead rather than suspended, disallow remote 
    495504         * wakeup.  usb_hc_died() should ensure that both hosts are marked as 
  • src/linux/universal/linux-3.3/drivers/usb/gadget/dummy_hcd.c

    r18778 r19208  
    925925        dum->driver = NULL; 
    926926 
    927         dummy_pullup(&dum->gadget, 0); 
    928927        return 0; 
    929928} 
  • src/linux/universal/linux-3.3/drivers/usb/gadget/f_mass_storage.c

    r18778 r19208  
    21912191                sprintf(unknown, "Unknown x%02x", common->cmnd[0]); 
    21922192                reply = check_command(common, common->cmnd_size, 
    2193                                       DATA_DIR_UNKNOWN, 0xff, 0, unknown); 
     2193                                      DATA_DIR_UNKNOWN, ~0, 0, unknown); 
    21942194                if (reply == 0) { 
    21952195                        common->curlun->sense_data = SS_INVALID_COMMAND; 
  • src/linux/universal/linux-3.3/drivers/usb/gadget/file_storage.c

    r18778 r19208  
    25802580                sprintf(unknown, "Unknown x%02x", fsg->cmnd[0]); 
    25812581                if ((reply = check_command(fsg, fsg->cmnd_size, 
    2582                                 DATA_DIR_UNKNOWN, 0xff, 0, unknown)) == 0) { 
     2582                                DATA_DIR_UNKNOWN, ~0, 0, unknown)) == 0) { 
    25832583                        fsg->curlun->sense_data = SS_INVALID_COMMAND; 
    25842584                        reply = -EINVAL; 
  • src/linux/universal/linux-3.3/drivers/usb/gadget/uvc.h

    r18778 r19208  
    2929struct uvc_request_data 
    3030{ 
    31         unsigned int length; 
     31        __s32 length; 
    3232        __u8 data[60]; 
    3333}; 
  • src/linux/universal/linux-3.3/drivers/usb/gadget/uvc_v4l2.c

    r18778 r19208  
    4040                return usb_ep_set_halt(cdev->gadget->ep0); 
    4141 
    42         req->length = min(uvc->event_length, data->length); 
     42        req->length = min_t(unsigned int, uvc->event_length, data->length); 
    4343        req->zero = data->length < uvc->event_length; 
    4444        req->dma = DMA_ADDR_INVALID; 
  • src/linux/universal/linux-3.3/drivers/usb/host/ehci-pci.c

    r18778 r19208  
    144144                        hcd->has_tt = 1; 
    145145                        tdi_reset(ehci); 
     146                } 
     147                if (pdev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK) { 
     148                        /* EHCI #1 or #2 on 6 Series/C200 Series chipset */ 
     149                        if (pdev->device == 0x1c26 || pdev->device == 0x1c2d) { 
     150                                ehci_info(ehci, "broken D3 during system sleep on ASUS\n"); 
     151                                hcd->broken_pci_sleep = 1; 
     152                                device_set_wakeup_capable(&pdev->dev, false); 
     153                        } 
    146154                } 
    147155                break; 
  • src/linux/universal/linux-3.3/drivers/usb/host/ehci-tegra.c

    r18778 r19208  
    602602                return err; 
    603603        } 
    604         gpio_set_value(gpio, 1); 
    605604 
    606605        return err; 
  • src/linux/universal/linux-3.3/fs/autofs4/autofs_i.h

    r18778 r19208  
    111111        int min_proto; 
    112112        int max_proto; 
    113         int compat_daemon; 
    114113        unsigned long exp_timeout; 
    115114        unsigned int type; 
     
    271270void autofs4_clean_ino(struct autofs_info *); 
    272271 
     272static inline int autofs_prepare_pipe(struct file *pipe) 
     273{ 
     274        if (!pipe->f_op || !pipe->f_op->write) 
     275                return -EINVAL; 
     276        if (!S_ISFIFO(pipe->f_dentry->d_inode->i_mode)) 
     277                return -EINVAL; 
     278        /* We want a packet pipe */ 
     279        pipe->f_flags |= O_DIRECT; 
     280        return 0; 
     281} 
     282 
    273283/* Queue management functions */ 
    274284 
  • src/linux/universal/linux-3.3/fs/autofs4/dev-ioctl.c

    r18778 r19208  
    377377                        goto out; 
    378378                } 
    379                 if (!pipe->f_op || !pipe->f_op->write) { 
     379                if (autofs_prepare_pipe(pipe) < 0) { 
    380380                        err = -EPIPE; 
    381381                        fput(pipe); 
     
    386386                sbi->pipe = pipe; 
    387387                sbi->catatonic = 0; 
    388                 sbi->compat_daemon = is_compat_task(); 
    389388        } 
    390389out: 
  • src/linux/universal/linux-3.3/fs/autofs4/inode.c

    r18778 r19208  
    2020#include <linux/bitops.h> 
    2121#include <linux/magic.h> 
    22 #include <linux/compat.h> 
    2322#include "autofs_i.h" 
    2423#include <linux/module.h> 
     
    226225        sbi->min_proto = 0; 
    227226        sbi->max_proto = 0; 
    228         sbi->compat_daemon = is_compat_task(); 
    229227        mutex_init(&sbi->wq_mutex); 
    230228        mutex_init(&sbi->pipe_mutex); 
     
    296294                goto fail_dput; 
    297295        } 
    298         if (!pipe->f_op || !pipe->f_op->write) 
     296        if (autofs_prepare_pipe(pipe) < 0) 
    299297                goto fail_fput; 
    300298        sbi->pipe = pipe; 
  • src/linux/universal/linux-3.3/fs/autofs4/waitq.c

    r18778 r19208  
    9393} 
    9494 
    95 /* 
    96  * The autofs_v5 packet was misdesigned. 
    97  * 
    98  * The packets are identical on x86-32 and x86-64, but have different 
    99  * alignment. Which means that 'sizeof()' will give different results. 
    100  * Fix it up for the case of running 32-bit user mode on a 64-bit kernel. 
    101  */ 
    102 static noinline size_t autofs_v5_packet_size(struct autofs_sb_info *sbi) 
    103 { 
    104         size_t pktsz = sizeof(struct autofs_v5_packet); 
    105 #if defined(CONFIG_X86_64) && defined(CONFIG_COMPAT) 
    106         if (sbi->compat_daemon > 0) 
    107                 pktsz -= 4; 
    108 #endif 
    109         return pktsz; 
    110 } 
    111  
    11295static void autofs4_notify_daemon(struct autofs_sb_info *sbi, 
    11396                                 struct autofs_wait_queue *wq, 
     
    173156                struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet; 
    174157 
    175                 pktsz = autofs_v5_packet_size(sbi); 
     158                pktsz = sizeof(*packet); 
     159 
    176160                packet->wait_queue_token = wq->wait_queue_token; 
    177161                packet->len = wq->name.len; 
  • src/linux/universal/linux-3.3/fs/exec.c

    r18778 r19208  
    976976 
    977977no_thread_group: 
     978        /* we have changed execution domain */ 
     979        tsk->exit_signal = SIGCHLD; 
     980 
    978981        if (current->mm) 
    979982                setmax_mm_hiwater_rss(&sig->maxrss, current->mm); 
  • src/linux/universal/linux-3.3/fs/nfs/nfs4proc.c

    r19019 r19208  
    44614461{ 
    44624462        struct nfs_server *server = NFS_SERVER(state->inode); 
    4463         struct nfs4_exception exception = { }; 
     4463        struct nfs4_exception exception = { 
     4464                .inode = state->inode, 
     4465        }; 
    44644466        int err; 
    44654467 
     
    44794481{ 
    44804482        struct nfs_server *server = NFS_SERVER(state->inode); 
    4481         struct nfs4_exception exception = { }; 
     4483        struct nfs4_exception exception = { 
     4484                .inode = state->inode, 
     4485        }; 
    44824486        int err; 
    44834487 
     
    45594563        struct nfs4_exception exception = { 
    45604564                .state = state, 
     4565                .inode = state->inode, 
    45614566        }; 
    45624567        int err; 
     
    46044609        if (state == NULL) 
    46054610                return -ENOLCK; 
     4611        /* 
     4612         * Don't rely on the VFS having checked the file open mode, 
     4613         * since it won't do this for flock() locks. 
     4614         */ 
     4615        switch (request->fl_type & (F_RDLCK|F_WRLCK|F_UNLCK)) { 
     4616        case F_RDLCK: 
     4617                if (!(filp->f_mode & FMODE_READ)) 
     4618                        return -EBADF; 
     4619                break; 
     4620        case F_WRLCK: 
     4621                if (!(filp->f_mode & FMODE_WRITE)) 
     4622                        return -EBADF; 
     4623        } 
     4624 
    46064625        do { 
    46074626                status = nfs4_proc_setlk(state, cmd, request); 
  • src/linux/universal/linux-3.3/fs/nfs/read.c

    r18778 r19208  
    325325                data = list_entry(res->next, struct nfs_read_data, list); 
    326326                list_del(&data->list); 
    327                 nfs_readdata_free(data); 
     327                nfs_readdata_release(data); 
    328328        } 
    329329        nfs_readpage_release(req); 
  • src/linux/universal/linux-3.3/fs/nfs/super.c

    r18778 r19208  
    27082708        size_t len; 
    27092709 
    2710         len = strlen(hostname) + 3; 
     2710        len = strlen(hostname) + 5; 
    27112711        root_devname = kmalloc(len, GFP_KERNEL); 
    27122712        if (root_devname == NULL) 
    27132713                return ERR_PTR(-ENOMEM); 
    2714         snprintf(root_devname, len, "%s:/", hostname); 
     2714        /* Does hostname needs to be enclosed in brackets? */ 
     2715        if (strchr(hostname, ':')) 
     2716                snprintf(root_devname, len, "[%s]:/", hostname); 
     2717        else 
     2718                snprintf(root_devname, len, "%s:/", hostname); 
    27152719        root_mnt = vfs_kern_mount(fs_type, flags, root_devname, data); 
    27162720        kfree(root_devname); 
  • src/linux/universal/linux-3.3/fs/nfs/write.c

    r18778 r19208  
    975975                data = list_entry(res->next, struct nfs_write_data, list); 
    976976                list_del(&data->list); 
    977                 nfs_writedata_free(data); 
     977                nfs_writedata_release(data); 
    978978        } 
    979979        nfs_redirty_request(req); 
  • src/linux/universal/linux-3.3/fs/pipe.c

    r18778 r19208  
    338338static const struct pipe_buf_operations anon_pipe_buf_ops = { 
    339339        .can_merge = 1, 
     340        .map = generic_pipe_buf_map, 
     341        .unmap = generic_pipe_buf_unmap, 
     342        .confirm = generic_pipe_buf_confirm, 
     343        .release = anon_pipe_buf_release, 
     344        .steal = generic_pipe_buf_steal, 
     345        .get = generic_pipe_buf_get, 
     346}; 
     347 
     348static const struct pipe_buf_operations packet_pipe_buf_ops = { 
     349        .can_merge = 0, 
    340350        .map = generic_pipe_buf_map, 
    341351        .unmap = generic_pipe_buf_unmap, 
     
    407417                        buf->offset += chars; 
    408418                        buf->len -= chars; 
     419 
     420                        /* Was it a packet buffer? Clean up and exit */ 
     421                        if (buf->flags & PIPE_BUF_FLAG_PACKET) { 
     422                                total_len = chars; 
     423                                buf->len = 0; 
     424                        } 
     425 
    409426                        if (!buf->len) { 
    410427                                buf->ops = NULL; 
     
    457474                file_accessed(filp); 
    458475        return ret; 
     476} 
     477 
     478static inline int is_packetized(struct file *file) 
     479{ 
     480        return (file->f_flags & O_DIRECT) != 0; 
    459481} 
    460482 
     
    593615                        buf->offset = 0; 
    594616                        buf->len = chars; 
     617                        buf->flags = 0; 
     618                        if (is_packetized(filp)) { 
     619                                buf->ops = &packet_pipe_buf_ops; 
     620                                buf->flags = PIPE_BUF_FLAG_PACKET; 
     621                        } 
    595622                        pipe->nrbufs = ++bufs; 
    596623                        pipe->tmp_page = NULL; 
     
    10131040        f->f_mapping = inode->i_mapping; 
    10141041 
    1015         f->f_flags = O_WRONLY | (flags & O_NONBLOCK); 
     1042        f->f_flags = O_WRONLY | (flags & (O_NONBLOCK | O_DIRECT)); 
    10161043        f->f_version = 0; 
    10171044 
     
    10571084        int fdw, fdr; 
    10581085 
    1059         if (flags & ~(O_CLOEXEC | O_NONBLOCK)) 
     1086        if (flags & ~(O_CLOEXEC | O_NONBLOCK | O_DIRECT)) 
    10601087                return -EINVAL; 
    10611088 
  • src/linux/universal/linux-3.3/include/linux/efi.h

    r18778 r19208  
    511511#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002 
    512512#define EFI_VARIABLE_RUNTIME_ACCESS     0x0000000000000004 
    513  
     513#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x0000000000000008 
     514#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x0000000000000010 
     515#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0000000000000020 
     516#define EFI_VARIABLE_APPEND_WRITE       0x0000000000000040 
     517 
     518#define EFI_VARIABLE_MASK       (EFI_VARIABLE_NON_VOLATILE | \ 
     519                                EFI_VARIABLE_BOOTSERVICE_ACCESS | \ 
     520                                EFI_VARIABLE_RUNTIME_ACCESS | \ 
     521                                EFI_VARIABLE_HARDWARE_ERROR_RECORD | \ 
     522                                EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS | \ 
     523                                EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | \ 
     524                                EFI_VARIABLE_APPEND_WRITE) 
    514525/* 
    515526 * The type of search to perform when calling boottime->locate_handle 
  • src/linux/universal/linux-3.3/include/linux/pipe_fs_i.h

    r18778 r19208  
    99#define PIPE_BUF_FLAG_ATOMIC    0x02    /* was atomically mapped */ 
    1010#define PIPE_BUF_FLAG_GIFT      0x04    /* page is a gift */ 
     11#define PIPE_BUF_FLAG_PACKET    0x08    /* read() as a packet */ 
    1112 
    1213/** 
  • src/linux/universal/linux-3.3/include/linux/usb/hcd.h

    r18778 r19208  
    127127        unsigned                authorized_default:1; 
    128128        unsigned                has_tt:1;       /* Integrated TT in root hub */ 
     129        unsigned                broken_pci_sleep:1;     /* Don't put the 
     130                        controller in PCI-D3 for system sleep */ 
    129131 
    130132        int                     irq;            /* irq allocated */ 
  • src/linux/universal/linux-3.3/kernel/exit.c

    r18778 r19208  
    821821                kill_orphaned_pgrp(tsk->group_leader, NULL); 
    822822 
    823         /* Let father know we died 
    824          * 
    825          * Thread signals are configurable, but you aren't going to use 
    826          * that to send signals to arbitrary processes. 
    827          * That stops right now. 
    828          * 
    829          * If the parent exec id doesn't match the exec id we saved 
    830          * when we started then we know the parent has changed security 
    831          * domain. 
    832          * 
    833          * If our self_exec id doesn't match our parent_exec_id then 
    834          * we have changed execution domain as these two values started 
    835          * the same after a fork. 
    836          */ 
    837         if (thread_group_leader(tsk) && tsk->exit_signal != SIGCHLD && 
    838             (tsk->parent_exec_id != tsk->real_parent->self_exec_id || 
    839              tsk->self_exec_id != tsk->parent_exec_id)) 
    840                 tsk->exit_signal = SIGCHLD; 
    841  
    842823        if (unlikely(tsk->ptrace)) { 
    843824                int sig = thread_group_leader(tsk) && 
  • src/linux/universal/linux-3.3/kernel/power/swap.c

    r18778 r19208  
    5252#define MAP_PAGE_ENTRIES        (PAGE_SIZE / sizeof(sector_t) - 1) 
    5353 
     54/* 
     55 * Number of free pages that are not high. 
     56 */ 
     57static inline unsigned long low_free_pages(void) 
     58{ 
     59        return nr_free_pages() - nr_free_highpages(); 
     60} 
     61 
     62/* 
     63 * Number of pages required to be kept free while writing the image. Always 
     64 * half of all available low pages before the writing starts. 
     65 */ 
     66static inline unsigned long reqd_free_pages(void) 
     67{ 
     68        return low_free_pages() / 2; 
     69} 
     70 
    5471struct swap_map_page { 
    5572        sector_t entries[MAP_PAGE_ENTRIES]; 
     
    7390        sector_t first_sector; 
    7491        unsigned int k; 
    75         unsigned long nr_free_pages, written; 
     92        unsigned long reqd_free_pages; 
    7693        u32 crc32; 
    7794}; 
     
    317334        } 
    318335        handle->k = 0; 
    319         handle->nr_free_pages = nr_free_pages() >> 1; 
    320         handle->written = 0; 
     336        handle->reqd_free_pages = reqd_free_pages(); 
    321337        handle->first_sector = handle->cur_swap; 
    322338        return 0; 
     
    353369                handle->k = 0; 
    354370        } 
    355         if (bio_chain && ++handle->written > handle->nr_free_pages) { 
     371        if (bio_chain && low_free_pages() <= handle->reqd_free_pages) { 
    356372                error = hib_wait_on_bio_chain(bio_chain); 
    357373                if (error) 
    358374                        goto out; 
    359                 handle->written = 0; 
     375                handle->reqd_free_pages = reqd_free_pages(); 
    360376        } 
    361377 out: 
     
    619635         * We don't want to run out of pages when writing. 
    620636         */ 
    621         handle->nr_free_pages = nr_free_pages() >> 1; 
     637        handle->reqd_free_pages = reqd_free_pages(); 
    622638 
    623639        /* 
  • src/linux/universal/linux-3.3/kernel/sched/core.c

    r18778 r19208  
    22672267 * weights adjusted to the number of cycles missed. 
    22682268 */ 
    2269 static void calc_global_nohz(unsigned long ticks) 
     2269static void calc_global_nohz(void) 
    22702270{ 
    22712271        long delta, active, n; 
    2272  
    2273         if (time_before(jiffies, calc_load_update)) 
    2274                 return; 
    22752272 
    22762273        /* 
     
    22852282 
    22862283        /* 
    2287          * If we were idle for multiple load cycles, apply them. 
     2284         * It could be the one fold was all it took, we done! 
    22882285         */ 
    2289         if (ticks >= LOAD_FREQ) { 
    2290                 n = ticks / LOAD_FREQ; 
    2291  
    2292                 active = atomic_long_read(&calc_load_tasks); 
    2293                 active = active > 0 ? active * FIXED_1 : 0; 
    2294  
    2295                 avenrun[0] = calc_load_n(avenrun[0], EXP_1, active, n); 
    2296                 avenrun[1] = calc_load_n(avenrun[1], EXP_5, active, n); 
    2297                 avenrun[2] = calc_load_n(avenrun[2], EXP_15, active, n); 
    2298  
    2299                 calc_load_update += n * LOAD_FREQ; 
    2300         } 
     2286        if (time_before(jiffies, calc_load_update + 10)) 
     2287                return; 
    23012288 
    23022289        /* 
    2303          * Its possible the remainder of the above division also crosses 
    2304          * a LOAD_FREQ period, the regular check in calc_global_load() 
    2305          * which comes after this will take care of that. 
    2306          * 
    2307          * Consider us being 11 ticks before a cycle completion, and us 
    2308          * sleeping for 4*LOAD_FREQ + 22 ticks, then the above code will 
    2309          * age us 4 cycles, and the test in calc_global_load() will 
    2310          * pick up the final one. 
     2290         * Catch-up, fold however many we are behind still 
    23112291         */ 
     2292        delta = jiffies - calc_load_update - 10; 
     2293        n = 1 + (delta / LOAD_FREQ); 
     2294 
     2295        active = atomic_long_read(&calc_load_tasks); 
     2296        active = active > 0 ? active * FIXED_1 : 0; 
     2297 
     2298        avenrun[0] = calc_load_n(avenrun[0], EXP_1, active, n); 
     2299        avenrun[1] = calc_load_n(avenrun[1], EXP_5, active, n); 
     2300        avenrun[2] = calc_load_n(avenrun[2], EXP_15, active, n); 
     2301 
     2302        calc_load_update += n * LOAD_FREQ; 
    23122303} 
    23132304#else 
     
    23212312} 
    23222313 
    2323 static void calc_global_nohz(unsigned long ticks) 
     2314static void calc_global_nohz(void) 
    23242315{ 
    23252316} 
     
    23492340        long active; 
    23502341 
    2351         calc_global_nohz(ticks); 
    2352  
    23532342        if (time_before(jiffies, calc_load_update + 10)) 
    23542343                return; 
     
    23622351 
    23632352        calc_load_update += LOAD_FREQ; 
     2353 
     2354        /* 
     2355         * Account one period with whatever state we found before 
     2356         * folding in the nohz state and ageing the entire idle period. 
     2357         * 
     2358         * This avoids loosing a sample when we go idle between 
     2359         * calc_load_account_active() (10 ticks ago) and now and thus 
     2360         * under-accounting. 
     2361         */ 
     2362        calc_global_nohz(); 
    23642363} 
    23652364 
     
    63376336 
    63386337                for_each_cpu(j, cpu_map) { 
    6339                         struct sched_domain *sd = *per_cpu_ptr(sdd->sd, j); 
    6340                         if (sd && (sd->flags & SD_OVERLAP)) 
    6341                                 free_sched_groups(sd->groups, 0); 
    6342                         kfree(*per_cpu_ptr(sdd->sd, j)); 
    6343                         kfree(*per_cpu_ptr(sdd->sg, j)); 
    6344                         kfree(*per_cpu_ptr(sdd->sgp, j)); 
     6338                        struct sched_domain *sd; 
     6339 
     6340                        if (sdd->sd) { 
     6341                                sd = *per_cpu_ptr(sdd->sd, j); 
     6342                                if (sd && (sd->flags & SD_OVERLAP)) 
     6343                                        free_sched_groups(sd->groups, 0); 
     6344                                kfree(*per_cpu_ptr(sdd->sd, j)); 
     6345                        } 
     6346 
     6347                        if (sdd->sg) 
     6348                                kfree(*per_cpu_ptr(sdd->sg, j)); 
     6349                        if (sdd->sgp) 
     6350                                kfree(*per_cpu_ptr(sdd->sgp, j)); 
    63456351                } 
    63466352                free_percpu(sdd->sd); 
     6353                sdd->sd = NULL; 
    63476354                free_percpu(sdd->sg); 
     6355                sdd->sg = NULL; 
    63486356                free_percpu(sdd->sgp); 
     6357                sdd->sgp = NULL; 
    63496358        } 
    63506359} 
  • src/linux/universal/linux-3.3/kernel/signal.c

    r18778 r19208  
    16431643        BUG_ON(!tsk->ptrace && 
    16441644               (tsk->group_leader != tsk || !thread_group_empty(tsk))); 
     1645 
     1646        if (sig != SIGCHLD) { 
     1647                /* 
     1648                 * This is only possible if parent == real_parent. 
     1649                 * Check if it has changed security domain. 
     1650                 */ 
     1651                if (tsk->parent_exec_id != tsk->parent->self_exec_id) 
     1652                        sig = SIGCHLD; 
     1653        } 
    16451654 
    16461655        info.si_signo = sig; 
  • src/linux/universal/linux-3.3/kernel/trace/trace_output.c

    r18778 r19208  
    651651        u64 next_ts; 
    652652        int ret; 
     653        /* trace_find_next_entry will reset ent_size */ 
     654        int ent_size = iter->ent_size; 
    653655        struct trace_seq *s = &iter->seq; 
    654656        struct trace_entry *entry = iter->ent, 
     
    658660        unsigned long abs_usecs = ns2usecs(iter->ts - iter->tr->time_start); 
    659661        unsigned long rel_usecs; 
     662 
     663        /* Restore the original ent_size */ 
     664        iter->ent_size = ent_size; 
    660665 
    661666        if (!next_entry) 
  • src/linux/universal/linux-3.3/net/mac80211/tx.c

    r18778 r19208  
    11451145                if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) 
    11461146                        return TX_DROP; 
    1147         } else if (info->flags & IEEE80211_TX_CTL_INJECTED) { 
     1147        } else if (info->flags & IEEE80211_TX_CTL_INJECTED || 
     1148                   tx->sdata->control_port_protocol == tx->skb->protocol) { 
    11481149                tx->sta = sta_info_get_bss(sdata, hdr->addr1); 
    11491150        } 
  • src/linux/universal/linux-3.3/net/wireless/nl80211.c

    r18778 r19208  
    12941294                } 
    12951295 
     1296                if (!netif_running(netdev)) { 
     1297                        result = -ENETDOWN; 
     1298                        goto bad_res; 
     1299                } 
     1300 
    12961301                nla_for_each_nested(nl_txq_params, 
    12971302                                    info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS], 
     
    62636268                .policy = nl80211_policy, 
    62646269                .flags = GENL_ADMIN_PERM, 
    6265                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6270                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    62666271                                  NL80211_FLAG_NEED_RTNL, 
    62676272        }, 
     
    62956300                .flags = GENL_ADMIN_PERM, 
    62966301                .doit = nl80211_addset_beacon, 
    6297                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6302                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    62986303                                  NL80211_FLAG_NEED_RTNL, 
    62996304        }, 
     
    63036308                .flags = GENL_ADMIN_PERM, 
    63046309                .doit = nl80211_addset_beacon, 
    6305                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6310                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    63066311                                  NL80211_FLAG_NEED_RTNL, 
    63076312        }, 
     
    63276332                .policy = nl80211_policy, 
    63286333                .flags = GENL_ADMIN_PERM, 
    6329                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6334                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    63306335                                  NL80211_FLAG_NEED_RTNL, 
    63316336        }, 
     
    63436348                .policy = nl80211_policy, 
    63446349                .flags = GENL_ADMIN_PERM, 
    6345                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6350                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    63466351                                  NL80211_FLAG_NEED_RTNL, 
    63476352        }, 
     
    63766381                .policy = nl80211_policy, 
    63776382                .flags = GENL_ADMIN_PERM, 
    6378                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6383                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    63796384                                  NL80211_FLAG_NEED_RTNL, 
    63806385        }, 
     
    63846389                .policy = nl80211_policy, 
    63856390                .flags = GENL_ADMIN_PERM, 
    6386                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6391                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    63876392                                  NL80211_FLAG_NEED_RTNL, 
    63886393        }, 
     
    64106415                .policy = nl80211_policy, 
    64116416                /* can be retrieved by unprivileged users */ 
    6412                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6417                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    64136418                                  NL80211_FLAG_NEED_RTNL, 
    64146419        }, 
     
    65436548                .policy = nl80211_policy, 
    65446549                .flags = GENL_ADMIN_PERM, 
    6545                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6550                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    65466551                                  NL80211_FLAG_NEED_RTNL, 
    65476552        }, 
     
    65516556                .policy = nl80211_policy, 
    65526557                .flags = GENL_ADMIN_PERM, 
    6553                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6558                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    65546559                                  NL80211_FLAG_NEED_RTNL, 
    65556560        }, 
     
    65596564                .policy = nl80211_policy, 
    65606565                .flags = GENL_ADMIN_PERM, 
    6561                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6566                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    65626567                                  NL80211_FLAG_NEED_RTNL, 
    65636568        }, 
     
    67196724                .policy = nl80211_policy, 
    67206725                .flags = GENL_ADMIN_PERM, 
    6721                 .internal_flags = NL80211_FLAG_NEED_NETDEV | 
     6726                .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | 
    67226727                                  NL80211_FLAG_NEED_RTNL, 
    67236728        }, 
  • src/linux/universal/linux-3.3/sound/pci/hda/patch_realtek.c

    r19073 r19208  
    54035403 
    54045404static const struct snd_pci_quirk alc269_fixup_tbl[] = { 
     5405        SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC), 
    54055406        SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 
    54065407        SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), 
  • src/linux/universal/linux-3.3/sound/soc/codecs/wm8994.c

    r19019 r19208  
    930930} 
    931931 
     932static int aif1clk_ev(struct snd_soc_dapm_widget *w, 
     933                      struct snd_kcontrol *kcontrol, int event) 
     934{ 
     935        struct snd_soc_codec *codec = w->codec; 
     936        struct wm8994 *control = codec->control_data; 
     937        int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA; 
     938        int dac; 
     939        int adc; 
     940        int val; 
     941 
     942        switch (control->type) { 
     943        case WM8994: 
     944        case WM8958: 
     945                mask |= WM8994_AIF1DAC2L_ENA | WM8994_AIF1DAC2R_ENA; 
     946                break; 
     947        default: 
     948                break; 
     949        } 
     950 
     951        switch (event) { 
     952        case SND_SOC_DAPM_PRE_PMU: 
     953                val = snd_soc_read(codec, WM8994_AIF1_CONTROL_1); 
     954                if ((val & WM8994_AIF1ADCL_SRC) && 
     955                    (val & WM8994_AIF1ADCR_SRC)) 
     956                        adc = WM8994_AIF1ADC1R_ENA | WM8994_AIF1ADC2R_ENA; 
     957                else if (!(val & WM8994_AIF1ADCL_SRC) && 
     958                         !(val & WM8994_AIF1ADCR_SRC)) 
     959                        adc = WM8994_AIF1ADC1L_ENA | WM8994_AIF1ADC2L_ENA; 
     960                else 
     961                        adc = WM8994_AIF1ADC1R_ENA | WM8994_AIF1ADC2R_ENA | 
     962                                WM8994_AIF1ADC1L_ENA | WM8994_AIF1ADC2L_ENA; 
     963 
     964                val = snd_soc_read(codec, WM8994_AIF1_CONTROL_2); 
     965                if ((val & WM8994_AIF1DACL_SRC) && 
     966                    (val & WM8994_AIF1DACR_SRC)) 
     967                        dac = WM8994_AIF1DAC1R_ENA | WM8994_AIF1DAC2R_ENA; 
     968                else if (!(val & WM8994_AIF1DACL_SRC) && 
     969                         !(val & WM8994_AIF1DACR_SRC)) 
     970                        dac = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC2L_ENA; 
     971                else 
     972                        dac = WM8994_AIF1DAC1R_ENA | WM8994_AIF1DAC2R_ENA | 
     973                                WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC2L_ENA; 
     974 
     975                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, 
     976                                    mask, adc); 
     977                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 
     978                                    mask, dac); 
     979                snd_soc_update_bits(codec, WM8994_CLOCKING_1, 
     980                                    WM8994_AIF1DSPCLK_ENA | 
     981                                    WM8994_SYSDSPCLK_ENA, 
     982                                    WM8994_AIF1DSPCLK_ENA | 
     983                                    WM8994_SYSDSPCLK_ENA); 
     984                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, mask, 
     985                                    WM8994_AIF1ADC1R_ENA | 
     986                                    WM8994_AIF1ADC1L_ENA | 
     987                                    WM8994_AIF1ADC2R_ENA | 
     988                                    WM8994_AIF1ADC2L_ENA); 
     989                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, mask, 
     990                                    WM8994_AIF1DAC1R_ENA | 
     991                                    WM8994_AIF1DAC1L_ENA | 
     992                                    WM8994_AIF1DAC2R_ENA | 
     993                                    WM8994_AIF1DAC2L_ENA); 
     994                break; 
     995 
     996        case SND_SOC_DAPM_PRE_PMD: 
     997        case SND_SOC_DAPM_POST_PMD: 
     998                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 
     999                                    mask, 0); 
     1000                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, 
     1001                                    mask, 0); 
     1002 
     1003                val = snd_soc_read(codec, WM8994_CLOCKING_1); 
     1004                if (val & WM8994_AIF2DSPCLK_ENA) 
     1005                        val = WM8994_SYSDSPCLK_ENA; 
     1006                else 
     1007                        val = 0; 
     1008                snd_soc_update_bits(codec, WM8994_CLOCKING_1, 
     1009                                    WM8994_SYSDSPCLK_ENA | 
     1010                                    WM8994_AIF1DSPCLK_ENA, val); 
     1011                break; 
     1012        } 
     1013 
     1014        return 0; 
     1015} 
     1016 
     1017static int aif2clk_ev(struct snd_soc_dapm_widget *w, 
     1018                      struct snd_kcontrol *kcontrol, int event) 
     1019{ 
     1020        struct snd_soc_codec *codec = w->codec; 
     1021        int dac; 
     1022        int adc; 
     1023        int val; 
     1024 
     1025        switch (event) { 
     1026        case SND_SOC_DAPM_PRE_PMU: 
     1027                val = snd_soc_read(codec, WM8994_AIF2_CONTROL_1); 
     1028                if ((val & WM8994_AIF2ADCL_SRC) && 
     1029                    (val & WM8994_AIF2ADCR_SRC)) 
     1030                        adc = WM8994_AIF2ADCR_ENA; 
     1031                else if (!(val & WM8994_AIF2ADCL_SRC) && 
     1032                         !(val & WM8994_AIF2ADCR_SRC)) 
     1033                        adc = WM8994_AIF2ADCL_ENA; 
     1034                else 
     1035                        adc = WM8994_AIF2ADCL_ENA | WM8994_AIF2ADCR_ENA; 
     1036 
     1037 
     1038                val = snd_soc_read(codec, WM8994_AIF2_CONTROL_2); 
     1039                if ((val & WM8994_AIF2DACL_SRC) && 
     1040                    (val & WM8994_AIF2DACR_SRC)) 
     1041                        dac = WM8994_AIF2DACR_ENA; 
     1042                else if (!(val & WM8994_AIF2DACL_SRC) && 
     1043                         !(val & WM8994_AIF2DACR_SRC)) 
     1044                        dac = WM8994_AIF2DACL_ENA; 
     1045                else 
     1046                        dac = WM8994_AIF2DACL_ENA | WM8994_AIF2DACR_ENA; 
     1047 
     1048                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, 
     1049                                    WM8994_AIF2ADCL_ENA | 
     1050                                    WM8994_AIF2ADCR_ENA, adc); 
     1051                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 
     1052                                    WM8994_AIF2DACL_ENA | 
     1053                                    WM8994_AIF2DACR_ENA, dac); 
     1054                snd_soc_update_bits(codec, WM8994_CLOCKING_1, 
     1055                                    WM8994_AIF2DSPCLK_ENA | 
     1056                                    WM8994_SYSDSPCLK_ENA, 
     1057                                    WM8994_AIF2DSPCLK_ENA | 
     1058                                    WM8994_SYSDSPCLK_ENA); 
     1059                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, 
     1060                                    WM8994_AIF2ADCL_ENA | 
     1061                                    WM8994_AIF2ADCR_ENA, 
     1062                                    WM8994_AIF2ADCL_ENA | 
     1063                                    WM8994_AIF2ADCR_ENA); 
     1064                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 
     1065                                    WM8994_AIF2DACL_ENA | 
     1066                                    WM8994_AIF2DACR_ENA, 
     1067                                    WM8994_AIF2DACL_ENA | 
     1068                                    WM8994_AIF2DACR_ENA); 
     1069                break; 
     1070 
     1071        case SND_SOC_DAPM_PRE_PMD: 
     1072        case SND_SOC_DAPM_POST_PMD: 
     1073                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 
     1074                                    WM8994_AIF2DACL_ENA | 
     1075                                    WM8994_AIF2DACR_ENA, 0); 
     1076                snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, 
     1077                                    WM8994_AIF2ADCL_ENA | 
     1078                                    WM8994_AIF2ADCR_ENA, 0); 
     1079 
     1080                val = snd_soc_read(codec, WM8994_CLOCKING_1); 
     1081                if (val & WM8994_AIF1DSPCLK_ENA) 
     1082                        val = WM8994_SYSDSPCLK_ENA; 
     1083                else 
     1084                        val = 0; 
     1085                snd_soc_update_bits(codec, WM8994_CLOCKING_1, 
     1086                                    WM8994_SYSDSPCLK_ENA | 
     1087                                    WM8994_AIF2DSPCLK_ENA, val); 
     1088                break; 
     1089        } 
     1090 
     1091        return 0; 
     1092} 
     1093 
     1094static int aif1clk_late_ev(struct snd_soc_dapm_widget *w, 
     1095                           struct snd_kcontrol *kcontrol, int event) 
     1096{ 
     1097        struct snd_soc_codec *codec = w->codec; 
     1098        struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 
     1099 
     1100        switch (event) { 
     1101        case SND_SOC_DAPM_PRE_PMU: 
     1102                wm8994->aif1clk_enable = 1; 
     1103                break; 
     1104        case SND_SOC_DAPM_POST_PMD: 
     1105                wm8994->aif1clk_disable = 1; 
     1106                break; 
     1107        } 
     1108 
     1109        return 0; 
     1110} 
     1111 
     1112static int aif2clk_late_ev(struct snd_soc_dapm_widget *w, 
     1113                           struct snd_kcontrol *kcontrol, int event) 
     1114{ 
     1115        struct snd_soc_codec *codec = w->codec; 
     1116        struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 
     1117 
     1118        switch (event) { 
     1119        case SND_SOC_DAPM_PRE_PMU: 
     1120                wm8994->aif2clk_enable = 1; 
     1121                break; 
     1122        case SND_SOC_DAPM_POST_PMD: 
     1123                wm8994->aif2clk_disable = 1; 
     1124                break; 
     1125        } 
     1126 
     1127        return 0; 
     1128} 
     1129 
    9321130static int late_enable_ev(struct snd_soc_dapm_widget *w, 
    9331131                          struct snd_kcontrol *kcontrol, int event) 
     
    9391137        case SND_SOC_DAPM_PRE_PMU: 
    9401138                if (wm8994->aif1clk_enable) { 
     1139                        aif1clk_ev(w, kcontrol, event); 
    9411140                        snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, 
    9421141                                            WM8994_AIF1CLK_ENA_MASK, 
     
    9451144                } 
    9461145                if (wm8994->aif2clk_enable) { 
     1146                        aif2clk_ev(w, kcontrol, event); 
    9471147                        snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, 
    9481148                                            WM8994_AIF2CLK_ENA_MASK, 
     
    9701170                        snd_soc_update_bits(codec, WM8994_AIF1_CLOCKING_1, 
    9711171                                            WM8994_AIF1CLK_ENA_MASK, 0); 
     1172                        aif1clk_ev(w, kcontrol, event); 
    9721173                        wm8994->aif1clk_disable = 0; 
    9731174                } 
     
    9751176                        snd_soc_update_bits(codec, WM8994_AIF2_CLOCKING_1, 
    9761177                                            WM8994_AIF2CLK_ENA_MASK, 0); 
     1178                        aif2clk_ev(w, kcontrol, event); 
    9771179                        wm8994->aif2clk_disable = 0; 
    9781180                } 
    979                 break; 
    980         } 
    981  
    982         return 0; 
    983 } 
    984  
    985 static int aif1clk_ev(struct snd_soc_dapm_widget *w, 
    986                       struct snd_kcontrol *kcontrol, int event) 
    987 { 
    988         struct snd_soc_codec *codec = w->codec; 
    989         struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 
    990  
    991         switch (event) { 
    992         case SND_SOC_DAPM_PRE_PMU: 
    993                 wm8994->aif1clk_enable = 1; 
    994                 break; 
    995         case SND_SOC_DAPM_POST_PMD: 
    996                 wm8994->aif1clk_disable = 1; 
    997                 break; 
    998         } 
    999  
    1000         return 0; 
    1001 } 
    1002  
    1003 static int aif2clk_ev(struct snd_soc_dapm_widget *w, 
    1004                       struct snd_kcontrol *kcontrol, int event) 
    1005 { 
    1006         struct snd_soc_codec *codec = w->codec; 
    1007         struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec); 
    1008  
    1009         switch (event) { 
    1010         case SND_SOC_DAPM_PRE_PMU: 
    1011                 wm8994->aif2clk_enable = 1; 
    1012                 break; 
    1013         case SND_SOC_DAPM_POST_PMD: 
    1014                 wm8994->aif2clk_disable = 1; 
    10151181                break; 
    10161182        } 
     
    13151481 
    13161482static const struct snd_soc_dapm_widget wm8994_lateclk_revd_widgets[] = { 
    1317 SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_ev, 
     1483SND_SOC_DAPM_SUPPLY("AIF1CLK", SND_SOC_NOPM, 0, 0, aif1clk_late_ev, 
    13181484        SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 
    1319 SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_ev, 
     1485SND_SOC_DAPM_SUPPLY("AIF2CLK", SND_SOC_NOPM, 0, 0, aif2clk_late_ev, 
    13201486        SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), 
    13211487 
     
    13461512 
    13471513static const struct snd_soc_dapm_widget wm8994_lateclk_widgets[] = { 
    1348 SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, NULL, 0), 
    1349 SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, NULL, 0), 
     1514SND_SOC_DAPM_SUPPLY("AIF1CLK", WM8994_AIF1_CLOCKING_1, 0, 0, aif1clk_ev, 
     1515                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD), 
     1516SND_SOC_DAPM_SUPPLY("AIF2CLK", WM8994_AIF2_CLOCKING_1, 0, 0, aif2clk_ev, 
     1517                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD), 
    13501518SND_SOC_DAPM_PGA("Direct Voice", SND_SOC_NOPM, 0, 0, NULL, 0), 
    13511519SND_SOC_DAPM_MIXER("SPKL", WM8994_POWER_MANAGEMENT_3, 8, 0, 
     
    14001568                    SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 
    14011569 
    1402 SND_SOC_DAPM_SUPPLY("DSP1CLK", WM8994_CLOCKING_1, 3, 0, NULL, 0), 
    1403 SND_SOC_DAPM_SUPPLY("DSP2CLK", WM8994_CLOCKING_1, 2, 0, NULL, 0), 
    1404 SND_SOC_DAPM_SUPPLY("DSPINTCLK", WM8994_CLOCKING_1, 1, 0, NULL, 0), 
     1570SND_SOC_DAPM_SUPPLY("DSP1CLK", SND_SOC_NOPM, 3, 0, NULL, 0), 
     1571SND_SOC_DAPM_SUPPLY("DSP2CLK", SND_SOC_NOPM, 2, 0, NULL, 0), 
     1572SND_SOC_DAPM_SUPPLY("DSPINTCLK", SND_SOC_NOPM, 1, 0, NULL, 0), 
    14051573 
    14061574SND_SOC_DAPM_AIF_OUT("AIF1ADC1L", NULL, 
    1407                      0, WM8994_POWER_MANAGEMENT_4, 9, 0), 
     1575                     0, SND_SOC_NOPM, 9, 0), 
    14081576SND_SOC_DAPM_AIF_OUT("AIF1ADC1R", NULL, 
    1409                      0, WM8994_POWER_MANAGEMENT_4, 8, 0), 
     1577                     0, SND_SOC_NOPM, 8, 0), 
    14101578SND_SOC_DAPM_AIF_IN_E("AIF1DAC1L", NULL, 0, 
    1411                       WM8994_POWER_MANAGEMENT_5, 9, 0, wm8958_aif_ev, 
     1579                      SND_SOC_NOPM, 9, 0, wm8958_aif_ev, 
    14121580                      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 
    14131581SND_SOC_DAPM_AIF_IN_E("AIF1DAC1R", NULL, 0, 
    1414                       WM8994_POWER_MANAGEMENT_5, 8, 0, wm8958_aif_ev, 
     1582                      SND_SOC_NOPM, 8, 0, wm8958_aif_ev, 
    14151583                      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 
    14161584 
    14171585SND_SOC_DAPM_AIF_OUT("AIF1ADC2L", NULL, 
    1418                      0, WM8994_POWER_MANAGEMENT_4, 11, 0), 
     1586                     0, SND_SOC_NOPM, 11, 0), 
    14191587SND_SOC_DAPM_AIF_OUT("AIF1ADC2R", NULL, 
    1420                      0, WM8994_POWER_MANAGEMENT_4, 10, 0), 
     1588                     0, SND_SOC_NOPM, 10, 0), 
    14211589SND_SOC_DAPM_AIF_IN_E("AIF1DAC2L", NULL, 0, 
    1422                       WM8994_POWER_MANAGEMENT_5, 11, 0, wm8958_aif_ev, 
     1590                      SND_SOC_NOPM, 11, 0, wm8958_aif_ev, 
    14231591                      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 
    14241592SND_SOC_DAPM_AIF_IN_E("AIF1DAC2R", NULL, 0, 
    1425                       WM8994_POWER_MANAGEMENT_5, 10, 0, wm8958_aif_ev, 
     1593                      SND_SOC_NOPM, 10, 0, wm8958_aif_ev, 
    14261594                      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), 
    14271595 
     
    14501618 
    14511619SND_SOC_DAPM_AIF_OUT("AIF2ADCL", NULL, 0, 
    1452                      WM8994_POWER_MANAGEMENT_4, 13, 0), 
     1620                     SND_SOC_NOPM, 13, 0), 
    14531621SND_SOC_DAPM_AIF_OUT("AIF2ADCR", NULL, 0, 
    1454                      WM8994_POWER_MANAGEMENT_4, 12, 0), 
     1622                     SND_SOC_NOPM, 12, 0), 
    14551623SND_SOC_DAPM_AIF_IN_E("AIF2DACL", NULL, 0, 
    1456                       WM8994_POWER_MANAGEMENT_5, 13, 0, wm8958_aif_ev, 
     1624                      SND_SOC_NOPM, 13, 0, wm8958_aif_ev, 
    14571625                      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 
    14581626SND_SOC_DAPM_AIF_IN_E("AIF2DACR", NULL, 0, 
    1459                       WM8994_POWER_MANAGEMENT_5, 12, 0, wm8958_aif_ev, 
     1627                      SND_SOC_NOPM, 12, 0, wm8958_aif_ev, 
    14601628                      SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), 
    14611629 
  • src/linux/universal/linux-3.3/sound/soc/soc-dapm.c

    r18778 r19208  
    7171        [snd_soc_dapm_hp] = 10, 
    7272        [snd_soc_dapm_spk] = 10, 
     73        [snd_soc_dapm_line] = 10, 
    7374        [snd_soc_dapm_post] = 11, 
    7475}; 
     
    7980        [snd_soc_dapm_hp] = 2, 
    8081        [snd_soc_dapm_spk] = 2, 
     82        [snd_soc_dapm_line] = 2, 
    8183        [snd_soc_dapm_out_drv] = 2, 
    8284        [snd_soc_dapm_pga] = 4, 
Note: See TracChangeset for help on using the changeset viewer.