diff --git a/[refs] b/[refs] index 12ab406158e2..25a6c126777e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b1cce6b1b2785fd61454b47ceacb461815407662 +refs/heads/master: c7cf72dcadbe39c2077b32460f86c9f8167be3be diff --git a/trunk/Documentation/io-mapping.txt b/trunk/Documentation/io-mapping.txt deleted file mode 100644 index 473e43b2d588..000000000000 --- a/trunk/Documentation/io-mapping.txt +++ /dev/null @@ -1,82 +0,0 @@ -The io_mapping functions in linux/io-mapping.h provide an abstraction for -efficiently mapping small regions of an I/O device to the CPU. The initial -usage is to support the large graphics aperture on 32-bit processors where -ioremap_wc cannot be used to statically map the entire aperture to the CPU -as it would consume too much of the kernel address space. - -A mapping object is created during driver initialization using - - struct io_mapping *io_mapping_create_wc(unsigned long base, - unsigned long size) - - 'base' is the bus address of the region to be made - mappable, while 'size' indicates how large a mapping region to - enable. Both are in bytes. - - This _wc variant provides a mapping which may only be used - with the io_mapping_map_atomic_wc or io_mapping_map_wc. - -With this mapping object, individual pages can be mapped either atomically -or not, depending on the necessary scheduling environment. Of course, atomic -maps are more efficient: - - void *io_mapping_map_atomic_wc(struct io_mapping *mapping, - unsigned long offset) - - 'offset' is the offset within the defined mapping region. - Accessing addresses beyond the region specified in the - creation function yields undefined results. Using an offset - which is not page aligned yields an undefined result. The - return value points to a single page in CPU address space. - - This _wc variant returns a write-combining map to the - page and may only be used with mappings created by - io_mapping_create_wc - - Note that the task may not sleep while holding this page - mapped. - - void io_mapping_unmap_atomic(void *vaddr) - - 'vaddr' must be the the value returned by the last - io_mapping_map_atomic_wc call. This unmaps the specified - page and allows the task to sleep once again. - -If you need to sleep while holding the lock, you can use the non-atomic -variant, although they may be significantly slower. - - void *io_mapping_map_wc(struct io_mapping *mapping, - unsigned long offset) - - This works like io_mapping_map_atomic_wc except it allows - the task to sleep while holding the page mapped. - - void io_mapping_unmap(void *vaddr) - - This works like io_mapping_unmap_atomic, except it is used - for pages mapped with io_mapping_map_wc. - -At driver close time, the io_mapping object must be freed: - - void io_mapping_free(struct io_mapping *mapping) - -Current Implementation: - -The initial implementation of these functions uses existing mapping -mechanisms and so provides only an abstraction layer and no new -functionality. - -On 64-bit processors, io_mapping_create_wc calls ioremap_wc for the whole -range, creating a permanent kernel-visible mapping to the resource. The -map_atomic and map functions add the requested offset to the base of the -virtual address returned by ioremap_wc. - -On 32-bit processors with HIGHMEM defined, io_mapping_map_atomic_wc uses -kmap_atomic_pfn to map the specified page in an atomic fashion; -kmap_atomic_pfn isn't really supposed to be used with device pages, but it -provides an efficient mapping for this usage. - -On 32-bit processors without HIGHMEM defined, io_mapping_map_atomic_wc and -io_mapping_map_wc both use ioremap_wc, a terribly inefficient function which -performs an IPI to inform all processors about the new mapping. This results -in a significant performance penalty. diff --git a/trunk/arch/arm/include/asm/memory.h b/trunk/arch/arm/include/asm/memory.h index 77764301844b..809ff9ab853a 100644 --- a/trunk/arch/arm/include/asm/memory.h +++ b/trunk/arch/arm/include/asm/memory.h @@ -44,10 +44,10 @@ * The module space lives between the addresses given by TASK_SIZE * and PAGE_OFFSET - it must be within 32MB of the kernel text. */ -#define MODULES_END (PAGE_OFFSET) -#define MODULES_VADDR (MODULES_END - 16*1048576) +#define MODULE_END (PAGE_OFFSET) +#define MODULE_START (MODULE_END - 16*1048576) -#if TASK_SIZE > MODULES_VADDR +#if TASK_SIZE > MODULE_START #error Top of user space clashes with start of module space #endif @@ -56,7 +56,7 @@ * Since we use sections to map it, this macro replaces the physical address * with its virtual address while keeping offset from the base section. */ -#define XIP_VIRT_ADDR(physaddr) (MODULES_VADDR + ((physaddr) & 0x000fffff)) +#define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff)) /* * Allow 16MB-aligned ioremap pages @@ -94,8 +94,8 @@ /* * The module can be at any place in ram in nommu mode. */ -#define MODULES_END (END_MEM) -#define MODULES_VADDR (PHYS_OFFSET) +#define MODULE_END (END_MEM) +#define MODULE_START (PHYS_OFFSET) #endif /* !CONFIG_MMU */ diff --git a/trunk/arch/arm/include/asm/system.h b/trunk/arch/arm/include/asm/system.h index 568020b34e3e..7aad78420f18 100644 --- a/trunk/arch/arm/include/asm/system.h +++ b/trunk/arch/arm/include/asm/system.h @@ -42,10 +42,6 @@ #define CR_U (1 << 22) /* Unaligned access operation */ #define CR_XP (1 << 23) /* Extended page tables */ #define CR_VE (1 << 24) /* Vectored interrupts */ -#define CR_EE (1 << 25) /* Exception (Big) Endian */ -#define CR_TRE (1 << 28) /* TEX remap enable */ -#define CR_AFE (1 << 29) /* Access flag enable */ -#define CR_TE (1 << 30) /* Thumb exception enable */ /* * This is used to ensure the compiler did actually allocate the register we diff --git a/trunk/arch/arm/kernel/elf.c b/trunk/arch/arm/kernel/elf.c index 84849098c8e8..513f332f040d 100644 --- a/trunk/arch/arm/kernel/elf.c +++ b/trunk/arch/arm/kernel/elf.c @@ -21,16 +21,12 @@ int elf_check_arch(const struct elf32_hdr *x) eflags = x->e_flags; if ((eflags & EF_ARM_EABI_MASK) == EF_ARM_EABI_UNKNOWN) { - unsigned int flt_fmt; - /* APCS26 is only allowed if the CPU supports it */ if ((eflags & EF_ARM_APCS_26) && !(elf_hwcap & HWCAP_26BIT)) return 0; - flt_fmt = eflags & (EF_ARM_VFP_FLOAT | EF_ARM_SOFT_FLOAT); - /* VFP requires the supporting code */ - if (flt_fmt == EF_ARM_VFP_FLOAT && !(elf_hwcap & HWCAP_VFP)) + if ((eflags & EF_ARM_VFP_FLOAT) && !(elf_hwcap & HWCAP_VFP)) return 0; } return 1; diff --git a/trunk/arch/arm/kernel/module.c b/trunk/arch/arm/kernel/module.c index b8d965dcd6fd..9203ba7d58ee 100644 --- a/trunk/arch/arm/kernel/module.c +++ b/trunk/arch/arm/kernel/module.c @@ -26,12 +26,12 @@ /* * The XIP kernel text is mapped in the module area for modules and * some other stuff to work without any indirect relocations. - * MODULES_VADDR is redefined here and not in asm/memory.h to avoid + * MODULE_START is redefined here and not in asm/memory.h to avoid * recompiling the whole kernel when CONFIG_XIP_KERNEL is turned on/off. */ extern void _etext; -#undef MODULES_VADDR -#define MODULES_VADDR (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK) +#undef MODULE_START +#define MODULE_START (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK) #endif #ifdef CONFIG_MMU @@ -43,7 +43,7 @@ void *module_alloc(unsigned long size) if (!size) return NULL; - area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END); + area = __get_vm_area(size, VM_ALLOC, MODULE_START, MODULE_END); if (!area) return NULL; diff --git a/trunk/arch/arm/mm/cache-xsc3l2.c b/trunk/arch/arm/mm/cache-xsc3l2.c index 10b1bae1a258..464de893a988 100644 --- a/trunk/arch/arm/mm/cache-xsc3l2.c +++ b/trunk/arch/arm/mm/cache-xsc3l2.c @@ -98,7 +98,7 @@ static void xsc3_l2_inv_range(unsigned long start, unsigned long end) /* * Clean and invalidate partial last cache line. */ - if (end & (CACHE_LINE_SIZE - 1)) { + if (start < end && (end & (CACHE_LINE_SIZE - 1))) { xsc3_l2_clean_pa(end & ~(CACHE_LINE_SIZE - 1)); xsc3_l2_inv_pa(end & ~(CACHE_LINE_SIZE - 1)); end &= ~(CACHE_LINE_SIZE - 1); @@ -107,7 +107,7 @@ static void xsc3_l2_inv_range(unsigned long start, unsigned long end) /* * Invalidate all full cache lines between 'start' and 'end'. */ - while (start != end) { + while (start < end) { xsc3_l2_inv_pa(start); start += CACHE_LINE_SIZE; } diff --git a/trunk/arch/arm/mm/mmu.c b/trunk/arch/arm/mm/mmu.c index e63db11f16a8..8ba754064559 100644 --- a/trunk/arch/arm/mm/mmu.c +++ b/trunk/arch/arm/mm/mmu.c @@ -180,20 +180,20 @@ void adjust_cr(unsigned long mask, unsigned long set) #endif #define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_WRITE -#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE +#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_XN|PMD_SECT_AP_WRITE static struct mem_type mem_types[] = { [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */ .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED | L_PTE_SHARED, .prot_l1 = PMD_TYPE_TABLE, - .prot_sect = PROT_SECT_DEVICE | PMD_SECT_S, + .prot_sect = PROT_SECT_DEVICE | PMD_SECT_UNCACHED, .domain = DOMAIN_IO, }, [MT_DEVICE_NONSHARED] = { /* ARMv6 non-shared device */ .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_NONSHARED, .prot_l1 = PMD_TYPE_TABLE, - .prot_sect = PROT_SECT_DEVICE, + .prot_sect = PROT_SECT_DEVICE | PMD_SECT_TEX(2), .domain = DOMAIN_IO, }, [MT_DEVICE_CACHED] = { /* ioremap_cached */ @@ -205,7 +205,7 @@ static struct mem_type mem_types[] = { [MT_DEVICE_WC] = { /* ioremap_wc */ .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_WC, .prot_l1 = PMD_TYPE_TABLE, - .prot_sect = PROT_SECT_DEVICE, + .prot_sect = PROT_SECT_DEVICE | PMD_SECT_BUFFERABLE, .domain = DOMAIN_IO, }, [MT_CACHECLEAN] = { @@ -273,23 +273,22 @@ static void __init build_mem_type_table(void) #endif /* - * Strip out features not present on earlier architectures. - * Pre-ARMv5 CPUs don't have TEX bits. Pre-ARMv6 CPUs or those - * without extended page tables don't have the 'Shared' bit. + * On non-Xscale3 ARMv5-and-older systems, use CB=01 + * (Uncached/Buffered) for ioremap_wc() mappings. On XScale3 + * and ARMv6+, use TEXCB=00100 mappings (Inner/Outer Uncacheable + * in xsc3 parlance, Uncached Normal in ARMv6 parlance). */ - if (cpu_arch < CPU_ARCH_ARMv5) - for (i = 0; i < ARRAY_SIZE(mem_types); i++) - mem_types[i].prot_sect &= ~PMD_SECT_TEX(7); - if ((cpu_arch < CPU_ARCH_ARMv6 || !(cr & CR_XP)) && !cpu_is_xsc3()) - for (i = 0; i < ARRAY_SIZE(mem_types); i++) - mem_types[i].prot_sect &= ~PMD_SECT_S; + if (cpu_is_xsc3() || cpu_arch >= CPU_ARCH_ARMv6) { + mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_TEX(1); + mem_types[MT_DEVICE_WC].prot_sect &= ~PMD_SECT_BUFFERABLE; + } /* - * ARMv5 and lower, bit 4 must be set for page tables (was: cache - * "update-able on write" bit on ARM610). However, Xscale and - * Xscale3 require this bit to be cleared. + * ARMv5 and lower, bit 4 must be set for page tables. + * (was: cache "update-able on write" bit on ARM610) + * However, Xscale cores require this bit to be cleared. */ - if (cpu_is_xscale() || cpu_is_xsc3()) { + if (cpu_is_xscale()) { for (i = 0; i < ARRAY_SIZE(mem_types); i++) { mem_types[i].prot_sect &= ~PMD_BIT4; mem_types[i].prot_l1 &= ~PMD_BIT4; @@ -303,64 +302,6 @@ static void __init build_mem_type_table(void) } } - /* - * Mark the device areas according to the CPU/architecture. - */ - if (cpu_is_xsc3() || (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP))) { - if (!cpu_is_xsc3()) { - /* - * Mark device regions on ARMv6+ as execute-never - * to prevent speculative instruction fetches. - */ - mem_types[MT_DEVICE].prot_sect |= PMD_SECT_XN; - mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_XN; - mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_XN; - mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_XN; - } - if (cpu_arch >= CPU_ARCH_ARMv7 && (cr & CR_TRE)) { - /* - * For ARMv7 with TEX remapping, - * - shared device is SXCB=1100 - * - nonshared device is SXCB=0100 - * - write combine device mem is SXCB=0001 - * (Uncached Normal memory) - */ - mem_types[MT_DEVICE].prot_sect |= PMD_SECT_TEX(1); - mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_TEX(1); - mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_BUFFERABLE; - } else if (cpu_is_xsc3()) { - /* - * For Xscale3, - * - shared device is TEXCB=00101 - * - nonshared device is TEXCB=01000 - * - write combine device mem is TEXCB=00100 - * (Inner/Outer Uncacheable in xsc3 parlance) - */ - mem_types[MT_DEVICE].prot_sect |= PMD_SECT_TEX(1) | PMD_SECT_BUFFERED; - mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_TEX(2); - mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_TEX(1); - } else { - /* - * For ARMv6 and ARMv7 without TEX remapping, - * - shared device is TEXCB=00001 - * - nonshared device is TEXCB=01000 - * - write combine device mem is TEXCB=00100 - * (Uncached Normal in ARMv6 parlance). - */ - mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED; - mem_types[MT_DEVICE_NONSHARED].prot_sect |= PMD_SECT_TEX(2); - mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_TEX(1); - } - } else { - /* - * On others, write combining is "Uncached/Buffered" - */ - mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_BUFFERABLE; - } - - /* - * Now deal with the memory-type mappings - */ cp = &cache_policies[cachepolicy]; vecs_pgprot = kern_pgprot = user_pgprot = cp->pte; @@ -376,8 +317,12 @@ static void __init build_mem_type_table(void) * Enable CPU-specific coherency if supported. * (Only available on XSC3 at the moment.) */ - if (arch_is_coherent() && cpu_is_xsc3()) - mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; + if (arch_is_coherent()) { + if (cpu_is_xsc3()) { + mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; + mem_types[MT_MEMORY].prot_pte |= L_PTE_SHARED; + } + } /* * ARMv6 and above have extended page tables. @@ -391,6 +336,11 @@ static void __init build_mem_type_table(void) mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; + /* + * Mark the device area as "shared device" + */ + mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED; + #ifdef CONFIG_SMP /* * Mark memory with the "shared" attribute for SMP systems @@ -410,6 +360,9 @@ static void __init build_mem_type_table(void) mem_types[MT_LOW_VECTORS].prot_pte |= vecs_pgprot; mem_types[MT_HIGH_VECTORS].prot_pte |= vecs_pgprot; + if (cpu_arch < CPU_ARCH_ARMv5) + mem_types[MT_MINICLEAN].prot_sect &= ~PMD_SECT_TEX(1); + pgprot_user = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | user_pgprot); pgprot_kernel = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_WRITE | @@ -701,7 +654,7 @@ static inline void prepare_page_table(struct meminfo *mi) /* * Clear out all the mappings below the kernel image. */ - for (addr = 0; addr < MODULES_VADDR; addr += PGDIR_SIZE) + for (addr = 0; addr < MODULE_START; addr += PGDIR_SIZE) pmd_clear(pmd_off_k(addr)); #ifdef CONFIG_XIP_KERNEL @@ -813,7 +766,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc) */ #ifdef CONFIG_XIP_KERNEL map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & SECTION_MASK); - map.virtual = MODULES_VADDR; + map.virtual = MODULE_START; map.length = ((unsigned long)&_etext - map.virtual + ~SECTION_MASK) & SECTION_MASK; map.type = MT_ROM; create_mapping(&map); diff --git a/trunk/arch/arm/mm/proc-v7.S b/trunk/arch/arm/mm/proc-v7.S index 4d3c0a73e7fb..07f82db70945 100644 --- a/trunk/arch/arm/mm/proc-v7.S +++ b/trunk/arch/arm/mm/proc-v7.S @@ -115,7 +115,7 @@ ENTRY(cpu_v7_set_pte_ext) orr r3, r3, r2 orr r3, r3, #PTE_EXT_AP0 | 2 - tst r1, #1 << 4 + tst r2, #1 << 4 orrne r3, r3, #PTE_EXT_TEX(1) tst r1, #L_PTE_WRITE @@ -192,11 +192,11 @@ __v7_setup: mov pc, lr @ return to head.S:__ret ENDPROC(__v7_setup) - /* AT - * TFR EV X F I D LR - * .EEE ..EE PUI. .T.T 4RVI ZFRS BLDP WCAM - * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced - * 1 0 110 0011 1.00 .111 1101 < we want + /* + * V X F I D LR + * .... ...E PUI. .T.T 4RVI ZFRS BLDP WCAM + * rrrr rrrx xxx0 0101 xxxx xxxx x111 xxxx < forced + * 0 110 0011 1.00 .111 1101 < we want */ .type v7_crval, #object v7_crval: diff --git a/trunk/arch/x86/Kconfig b/trunk/arch/x86/Kconfig index e60c59b81bdd..6f20718d3156 100644 --- a/trunk/arch/x86/Kconfig +++ b/trunk/arch/x86/Kconfig @@ -1894,10 +1894,6 @@ config SYSVIPC_COMPAT endmenu -config HAVE_ATOMIC_IOMAP - def_bool y - depends on X86_32 - source "net/Kconfig" source "drivers/Kconfig" diff --git a/trunk/arch/x86/include/asm/fixmap.h b/trunk/arch/x86/include/asm/fixmap.h index 23696d44a0af..8668a94f850e 100644 --- a/trunk/arch/x86/include/asm/fixmap.h +++ b/trunk/arch/x86/include/asm/fixmap.h @@ -9,10 +9,6 @@ extern int fixmaps_set; -extern pte_t *kmap_pte; -extern pgprot_t kmap_prot; -extern pte_t *pkmap_page_table; - void __native_set_fixmap(enum fixed_addresses idx, pte_t pte); void native_set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t flags); diff --git a/trunk/arch/x86/include/asm/fixmap_32.h b/trunk/arch/x86/include/asm/fixmap_32.h index c7115c1d7217..09f29ab5c139 100644 --- a/trunk/arch/x86/include/asm/fixmap_32.h +++ b/trunk/arch/x86/include/asm/fixmap_32.h @@ -28,8 +28,10 @@ extern unsigned long __FIXADDR_TOP; #include #include #include +#ifdef CONFIG_HIGHMEM #include #include +#endif /* * Here we define all the compile-time 'special' virtual @@ -73,8 +75,10 @@ enum fixed_addresses { #ifdef CONFIG_X86_CYCLONE_TIMER FIX_CYCLONE_TIMER, /*cyclone timer register*/ #endif +#ifdef CONFIG_HIGHMEM FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, +#endif #ifdef CONFIG_PCI_MMCONFIG FIX_PCIE_MCFG, #endif diff --git a/trunk/arch/x86/include/asm/highmem.h b/trunk/arch/x86/include/asm/highmem.h index bf9276bea660..a3b3b7c3027b 100644 --- a/trunk/arch/x86/include/asm/highmem.h +++ b/trunk/arch/x86/include/asm/highmem.h @@ -25,11 +25,14 @@ #include #include #include -#include /* declarations for highmem.c */ extern unsigned long highstart_pfn, highend_pfn; +extern pte_t *kmap_pte; +extern pgprot_t kmap_prot; +extern pte_t *pkmap_page_table; + /* * Right now we initialize only a single pte table. It can be extended * easily, subsequent pte tables have to be allocated in one physical diff --git a/trunk/arch/x86/mm/Makefile b/trunk/arch/x86/mm/Makefile index fea4565ff576..59f89b434b45 100644 --- a/trunk/arch/x86/mm/Makefile +++ b/trunk/arch/x86/mm/Makefile @@ -1,7 +1,7 @@ obj-y := init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ pat.o pgtable.o gup.o -obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o +obj-$(CONFIG_X86_32) += pgtable_32.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_X86_PTDUMP) += dump_pagetables.o diff --git a/trunk/arch/x86/mm/init_32.c b/trunk/arch/x86/mm/init_32.c index c483f4242079..8396868e82c5 100644 --- a/trunk/arch/x86/mm/init_32.c +++ b/trunk/arch/x86/mm/init_32.c @@ -334,6 +334,7 @@ int devmem_is_allowed(unsigned long pagenr) return 0; } +#ifdef CONFIG_HIGHMEM pte_t *kmap_pte; pgprot_t kmap_prot; @@ -356,7 +357,6 @@ static void __init kmap_init(void) kmap_prot = PAGE_KERNEL; } -#ifdef CONFIG_HIGHMEM static void __init permanent_kmaps_init(pgd_t *pgd_base) { unsigned long vaddr; @@ -436,6 +436,7 @@ static void __init set_highmem_pages_init(void) #endif /* !CONFIG_NUMA */ #else +# define kmap_init() do { } while (0) # define permanent_kmaps_init(pgd_base) do { } while (0) # define set_highmem_pages_init() do { } while (0) #endif /* CONFIG_HIGHMEM */ diff --git a/trunk/arch/x86/mm/iomap_32.c b/trunk/arch/x86/mm/iomap_32.c deleted file mode 100644 index d0151d8ce452..000000000000 --- a/trunk/arch/x86/mm/iomap_32.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright © 2008 Ingo Molnar - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -#include -#include - -/* Map 'pfn' using fixed map 'type' and protections 'prot' - */ -void * -iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) -{ - enum fixed_addresses idx; - unsigned long vaddr; - - pagefault_disable(); - - idx = type + KM_TYPE_NR*smp_processor_id(); - vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); - set_pte(kmap_pte-idx, pfn_pte(pfn, prot)); - arch_flush_lazy_mmu_mode(); - - return (void*) vaddr; -} -EXPORT_SYMBOL_GPL(iomap_atomic_prot_pfn); - -void -iounmap_atomic(void *kvaddr, enum km_type type) -{ - unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; - enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); - - /* - * Force other mappings to Oops if they'll try to access this pte - * without first remap it. Keeping stale mappings around is a bad idea - * also, in case the page changes cacheability attributes or becomes - * a protected page in a hypervisor. - */ - if (vaddr == __fix_to_virt(FIX_KMAP_BEGIN+idx)) - kpte_clear_flush(kmap_pte-idx, vaddr); - - arch_flush_lazy_mmu_mode(); - pagefault_enable(); -} -EXPORT_SYMBOL_GPL(iounmap_atomic); diff --git a/trunk/drivers/gpu/drm/i915/Makefile b/trunk/drivers/gpu/drm/i915/Makefile index d8fb5d8ee7ea..5ba78e4fd2b5 100644 --- a/trunk/drivers/gpu/drm/i915/Makefile +++ b/trunk/drivers/gpu/drm/i915/Makefile @@ -3,14 +3,13 @@ # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. ccflags-y := -Iinclude/drm -i915-y := i915_drv.o i915_dma.o i915_irq.o i915_mem.o \ +i915-y := i915_drv.o i915_dma.o i915_irq.o i915_mem.o i915_opregion.o \ i915_suspend.o \ i915_gem.o \ i915_gem_debug.o \ i915_gem_proc.o \ i915_gem_tiling.o -i915-$(CONFIG_ACPI) += i915_opregion.o i915-$(CONFIG_COMPAT) += i915_ioc32.o obj-$(CONFIG_DRM_I915) += i915.o diff --git a/trunk/drivers/gpu/drm/i915/i915_dma.c b/trunk/drivers/gpu/drm/i915/i915_dma.c index 256e22963ae4..01de536e0211 100644 --- a/trunk/drivers/gpu/drm/i915/i915_dma.c +++ b/trunk/drivers/gpu/drm/i915/i915_dma.c @@ -960,7 +960,6 @@ struct drm_ioctl_desc i915_ioctls[] = { DRM_IOCTL_DEF(DRM_I915_GEM_SW_FINISH, i915_gem_sw_finish_ioctl, 0), DRM_IOCTL_DEF(DRM_I915_GEM_SET_TILING, i915_gem_set_tiling, 0), DRM_IOCTL_DEF(DRM_I915_GEM_GET_TILING, i915_gem_get_tiling, 0), - DRM_IOCTL_DEF(DRM_I915_GEM_GET_APERTURE, i915_gem_get_aperture_ioctl, 0), }; int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); diff --git a/trunk/drivers/gpu/drm/i915/i915_drv.h b/trunk/drivers/gpu/drm/i915/i915_drv.h index 572dcd0e3e0d..f20ffe17df71 100644 --- a/trunk/drivers/gpu/drm/i915/i915_drv.h +++ b/trunk/drivers/gpu/drm/i915/i915_drv.h @@ -31,7 +31,6 @@ #define _I915_DRV_H_ #include "i915_reg.h" -#include /* General customization: */ @@ -247,8 +246,6 @@ typedef struct drm_i915_private { struct { struct drm_mm gtt_space; - struct io_mapping *gtt_mapping; - /** * List of objects currently involved in rendering from the * ringbuffer. @@ -505,8 +502,6 @@ int i915_gem_set_tiling(struct drm_device *dev, void *data, struct drm_file *file_priv); int i915_gem_get_tiling(struct drm_device *dev, void *data, struct drm_file *file_priv); -int i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, - struct drm_file *file_priv); void i915_gem_load(struct drm_device *dev); int i915_gem_proc_init(struct drm_minor *minor); void i915_gem_proc_cleanup(struct drm_minor *minor); @@ -544,18 +539,11 @@ extern int i915_restore_state(struct drm_device *dev); extern int i915_save_state(struct drm_device *dev); extern int i915_restore_state(struct drm_device *dev); -#ifdef CONFIG_ACPI /* i915_opregion.c */ extern int intel_opregion_init(struct drm_device *dev); extern void intel_opregion_free(struct drm_device *dev); extern void opregion_asle_intr(struct drm_device *dev); extern void opregion_enable_asle(struct drm_device *dev); -#else -static inline int intel_opregion_init(struct drm_device *dev) { return 0; } -static inline void intel_opregion_free(struct drm_device *dev) { return; } -static inline void opregion_asle_intr(struct drm_device *dev) { return; } -static inline void opregion_enable_asle(struct drm_device *dev) { return; } -#endif /** * Lock test for when it's just for synchronization of ring access. diff --git a/trunk/drivers/gpu/drm/i915/i915_gem.c b/trunk/drivers/gpu/drm/i915/i915_gem.c index b0ec73fa6a93..17ae330ff269 100644 --- a/trunk/drivers/gpu/drm/i915/i915_gem.c +++ b/trunk/drivers/gpu/drm/i915/i915_gem.c @@ -79,28 +79,6 @@ i915_gem_init_ioctl(struct drm_device *dev, void *data, return 0; } -int -i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data, - struct drm_file *file_priv) -{ - drm_i915_private_t *dev_priv = dev->dev_private; - struct drm_i915_gem_get_aperture *args = data; - struct drm_i915_gem_object *obj_priv; - - if (!(dev->driver->driver_features & DRIVER_GEM)) - return -ENODEV; - - args->aper_size = dev->gtt_total; - args->aper_available_size = args->aper_size; - - list_for_each_entry(obj_priv, &dev_priv->mm.active_list, list) { - if (obj_priv->pin_count > 0) - args->aper_available_size -= obj_priv->obj->size; - } - - return 0; -} - /** * Creates a new mm object and returns a handle to it. @@ -193,50 +171,35 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data, return 0; } -/* This is the fast write path which cannot handle - * page faults in the source data - */ - -static inline int -fast_user_write(struct io_mapping *mapping, - loff_t page_base, int page_offset, - char __user *user_data, - int length) -{ - char *vaddr_atomic; - unsigned long unwritten; - - vaddr_atomic = io_mapping_map_atomic_wc(mapping, page_base); - unwritten = __copy_from_user_inatomic_nocache(vaddr_atomic + page_offset, - user_data, length); - io_mapping_unmap_atomic(vaddr_atomic); - if (unwritten) - return -EFAULT; - return 0; -} - -/* Here's the write path which can sleep for - * page faults +/* + * Try to write quickly with an atomic kmap. Return true on success. + * + * If this fails (which includes a partial write), we'll redo the whole + * thing with the slow version. + * + * This is a workaround for the low performance of iounmap (approximate + * 10% cpu cost on normal 3D workloads). kmap_atomic on HIGHMEM kernels + * happens to let us map card memory without taking IPIs. When the vmap + * rework lands we should be able to dump this hack. */ - -static inline int -slow_user_write(struct io_mapping *mapping, - loff_t page_base, int page_offset, - char __user *user_data, - int length) +static inline int fast_user_write(unsigned long pfn, char __user *user_data, + int l, int o) { - char __iomem *vaddr; +#ifdef CONFIG_HIGHMEM unsigned long unwritten; + char *vaddr_atomic; - vaddr = io_mapping_map_wc(mapping, page_base); - if (vaddr == NULL) - return -EFAULT; - unwritten = __copy_from_user(vaddr + page_offset, - user_data, length); - io_mapping_unmap(vaddr); - if (unwritten) - return -EFAULT; + vaddr_atomic = kmap_atomic_pfn(pfn, KM_USER0); +#if WATCH_PWRITE + DRM_INFO("pwrite i %d o %d l %d pfn %ld vaddr %p\n", + i, o, l, pfn, vaddr_atomic); +#endif + unwritten = __copy_from_user_inatomic_nocache(vaddr_atomic + o, user_data, l); + kunmap_atomic(vaddr_atomic, KM_USER0); + return !unwritten; +#else return 0; +#endif } static int @@ -245,12 +208,10 @@ i915_gem_gtt_pwrite(struct drm_device *dev, struct drm_gem_object *obj, struct drm_file *file_priv) { struct drm_i915_gem_object *obj_priv = obj->driver_private; - drm_i915_private_t *dev_priv = dev->dev_private; ssize_t remain; - loff_t offset, page_base; + loff_t offset; char __user *user_data; - int page_offset, page_length; - int ret; + int ret = 0; user_data = (char __user *) (uintptr_t) args->data_ptr; remain = args->size; @@ -274,37 +235,57 @@ i915_gem_gtt_pwrite(struct drm_device *dev, struct drm_gem_object *obj, obj_priv->dirty = 1; while (remain > 0) { + unsigned long pfn; + int i, o, l; + /* Operation in this page * - * page_base = page offset within aperture - * page_offset = offset within page - * page_length = bytes to copy for this page - */ - page_base = (offset & ~(PAGE_SIZE-1)); - page_offset = offset & (PAGE_SIZE-1); - page_length = remain; - if ((page_offset + remain) > PAGE_SIZE) - page_length = PAGE_SIZE - page_offset; - - ret = fast_user_write (dev_priv->mm.gtt_mapping, page_base, - page_offset, user_data, page_length); - - /* If we get a fault while copying data, then (presumably) our - * source page isn't available. In this case, use the - * non-atomic function + * i = page number + * o = offset within page + * l = bytes to copy */ - if (ret) { - ret = slow_user_write (dev_priv->mm.gtt_mapping, - page_base, page_offset, - user_data, page_length); - if (ret) + i = offset >> PAGE_SHIFT; + o = offset & (PAGE_SIZE-1); + l = remain; + if ((o + l) > PAGE_SIZE) + l = PAGE_SIZE - o; + + pfn = (dev->agp->base >> PAGE_SHIFT) + i; + + if (!fast_user_write(pfn, user_data, l, o)) { + unsigned long unwritten; + char __iomem *vaddr; + + vaddr = ioremap_wc(pfn << PAGE_SHIFT, PAGE_SIZE); +#if WATCH_PWRITE + DRM_INFO("pwrite slow i %d o %d l %d " + "pfn %ld vaddr %p\n", + i, o, l, pfn, vaddr); +#endif + if (vaddr == NULL) { + ret = -EFAULT; + goto fail; + } + unwritten = __copy_from_user(vaddr + o, user_data, l); +#if WATCH_PWRITE + DRM_INFO("unwritten %ld\n", unwritten); +#endif + iounmap(vaddr); + if (unwritten) { + ret = -EFAULT; goto fail; + } } - remain -= page_length; - user_data += page_length; - offset += page_length; + remain -= l; + user_data += l; + offset += l; } +#if WATCH_PWRITE && 1 + i915_gem_clflush_object(obj); + i915_gem_dump_object(obj, args->offset + args->size, __func__, ~0); + i915_gem_clflush_object(obj); +#endif fail: i915_gem_object_unpin(obj); @@ -1522,12 +1503,12 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, struct drm_i915_gem_exec_object *entry) { struct drm_device *dev = obj->dev; - drm_i915_private_t *dev_priv = dev->dev_private; struct drm_i915_gem_relocation_entry reloc; struct drm_i915_gem_relocation_entry __user *relocs; struct drm_i915_gem_object *obj_priv = obj->driver_private; int i, ret; - void __iomem *reloc_page; + uint32_t last_reloc_offset = -1; + void __iomem *reloc_page = NULL; /* Choose the GTT offset for our buffer and put it there. */ ret = i915_gem_object_pin(obj, (uint32_t) entry->alignment); @@ -1650,11 +1631,26 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, * perform. */ reloc_offset = obj_priv->gtt_offset + reloc.offset; - reloc_page = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping, - (reloc_offset & - ~(PAGE_SIZE - 1))); + if (reloc_page == NULL || + (last_reloc_offset & ~(PAGE_SIZE - 1)) != + (reloc_offset & ~(PAGE_SIZE - 1))) { + if (reloc_page != NULL) + iounmap(reloc_page); + + reloc_page = ioremap_wc(dev->agp->base + + (reloc_offset & + ~(PAGE_SIZE - 1)), + PAGE_SIZE); + last_reloc_offset = reloc_offset; + if (reloc_page == NULL) { + drm_gem_object_unreference(target_obj); + i915_gem_object_unpin(obj); + return -ENOMEM; + } + } + reloc_entry = (uint32_t __iomem *)(reloc_page + - (reloc_offset & (PAGE_SIZE - 1))); + (reloc_offset & (PAGE_SIZE - 1))); reloc_val = target_obj_priv->gtt_offset + reloc.delta; #if WATCH_BUF @@ -1663,7 +1659,6 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, readl(reloc_entry), reloc_val); #endif writel(reloc_val, reloc_entry); - io_mapping_unmap_atomic(reloc_page); /* Write the updated presumed offset for this entry back out * to the user. @@ -1679,6 +1674,9 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj, drm_gem_object_unreference(target_obj); } + if (reloc_page != NULL) + iounmap(reloc_page); + #if WATCH_BUF if (0) i915_gem_dump_object(obj, 128, __func__, ~0); @@ -2520,10 +2518,6 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data, if (ret != 0) return ret; - dev_priv->mm.gtt_mapping = io_mapping_create_wc(dev->agp->base, - dev->agp->agp_info.aper_size - * 1024 * 1024); - mutex_lock(&dev->struct_mutex); BUG_ON(!list_empty(&dev_priv->mm.active_list)); BUG_ON(!list_empty(&dev_priv->mm.flushing_list)); @@ -2541,13 +2535,11 @@ int i915_gem_leavevt_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_i915_private_t *dev_priv = dev->dev_private; int ret; ret = i915_gem_idle(dev); drm_irq_uninstall(dev); - io_mapping_free(dev_priv->mm.gtt_mapping); return ret; } diff --git a/trunk/drivers/gpu/drm/radeon/radeon_cp.c b/trunk/drivers/gpu/drm/radeon/radeon_cp.c index 073894824e6b..59a2132a8f57 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon_cp.c +++ b/trunk/drivers/gpu/drm/radeon/radeon_cp.c @@ -653,16 +653,15 @@ static void radeon_cp_init_ring_buffer(struct drm_device * dev, RADEON_WRITE(RADEON_SCRATCH_UMSK, 0x7); /* Turn on bus mastering */ - if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) || + if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS400) || + ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) || ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS740)) { - /* rs600/rs690/rs740 */ - tmp = RADEON_READ(RADEON_BUS_CNTL) & ~RS600_BUS_MASTER_DIS; + /* rs400, rs690/rs740 */ + tmp = RADEON_READ(RADEON_BUS_CNTL) & ~RS400_BUS_MASTER_DIS; RADEON_WRITE(RADEON_BUS_CNTL, tmp); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV350) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R420) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS400) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS480)) { - /* r1xx, r2xx, r300, r(v)350, r420/r481, rs400/rs480 */ + } else if (!(((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV380) || + ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R423))) { + /* r1xx, r2xx, r300, r(v)350, r420/r481, rs480 */ tmp = RADEON_READ(RADEON_BUS_CNTL) & ~RADEON_BUS_MASTER_DIS; RADEON_WRITE(RADEON_BUS_CNTL, tmp); } /* PCIE cards appears to not need this */ diff --git a/trunk/drivers/gpu/drm/radeon/radeon_drv.h b/trunk/drivers/gpu/drm/radeon/radeon_drv.h index 02f5575ba395..4dbb813910c3 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon_drv.h +++ b/trunk/drivers/gpu/drm/radeon/radeon_drv.h @@ -447,12 +447,12 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, * handling, not bus mastering itself. */ #define RADEON_BUS_CNTL 0x0030 -/* r1xx, r2xx, r300, r(v)350, r420/r481, rs400/rs480 */ +/* r1xx, r2xx, r300, r(v)350, r420/r481, rs480 */ # define RADEON_BUS_MASTER_DIS (1 << 6) -/* rs600/rs690/rs740 */ -# define RS600_BUS_MASTER_DIS (1 << 14) -# define RS600_MSI_REARM (1 << 20) -/* see RS400_MSI_REARM in AIC_CNTL for rs480 */ +/* rs400, rs690/rs740 */ +# define RS400_BUS_MASTER_DIS (1 << 14) +# define RS400_MSI_REARM (1 << 20) +/* see RS480_MSI_REARM in AIC_CNTL for rs480 */ #define RADEON_BUS_CNTL1 0x0034 # define RADEON_PMI_BM_DIS (1 << 2) @@ -937,7 +937,7 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RADEON_AIC_CNTL 0x01d0 # define RADEON_PCIGART_TRANSLATE_EN (1 << 0) -# define RS400_MSI_REARM (1 << 3) +# define RS480_MSI_REARM (1 << 3) #define RADEON_AIC_STAT 0x01d4 #define RADEON_AIC_PT_BASE 0x01d8 #define RADEON_AIC_LO_ADDR 0x01dc diff --git a/trunk/fs/cifs/CHANGES b/trunk/fs/cifs/CHANGES index 8855331b2fba..8f528ea24c48 100644 --- a/trunk/fs/cifs/CHANGES +++ b/trunk/fs/cifs/CHANGES @@ -4,11 +4,7 @@ Various fixes to make delete of open files behavior more predictable (when delete of an open file fails we mark the file as "delete-on-close" in a way that more servers accept, but only if we can first rename the file to a temporary name). Add experimental support for more safely -handling fcntl(F_SETLEASE). Convert cifs to using blocking tcp -sends, and also let tcp autotune the socket send and receive buffers. -This reduces the number of EAGAIN errors returned by TCP/IP in -high stress workloads (and the number of retries on socket writes -when sending large SMBWriteX requests). +handling fcntl(F_SETLEASE). Version 1.54 ------------ diff --git a/trunk/fs/cifs/cifsglob.h b/trunk/fs/cifs/cifsglob.h index 1cb1189f24e0..c791e5b5a914 100644 --- a/trunk/fs/cifs/cifsglob.h +++ b/trunk/fs/cifs/cifsglob.h @@ -141,8 +141,6 @@ struct TCP_Server_Info { char versionMajor; char versionMinor; bool svlocal:1; /* local server or remote */ - bool noblocksnd; /* use blocking sendmsg */ - bool noautotune; /* do not autotune send buf sizes */ atomic_t socketUseCount; /* number of open cifs sessions on socket */ atomic_t inFlight; /* number of requests on the wire to server */ #ifdef CONFIG_CIFS_STATS2 diff --git a/trunk/fs/cifs/cifsproto.h b/trunk/fs/cifs/cifsproto.h index 6f21ecb85ce5..0cff7fe986e8 100644 --- a/trunk/fs/cifs/cifsproto.h +++ b/trunk/fs/cifs/cifsproto.h @@ -36,7 +36,7 @@ extern void cifs_buf_release(void *); extern struct smb_hdr *cifs_small_buf_get(void); extern void cifs_small_buf_release(void *); extern int smb_send(struct socket *, struct smb_hdr *, - unsigned int /* length */ , struct sockaddr *, bool); + unsigned int /* length */ , struct sockaddr *); extern unsigned int _GetXid(void); extern void _FreeXid(unsigned int); #define GetXid() (int)_GetXid(); cFYI(1,("CIFS VFS: in %s as Xid: %d with uid: %d",__func__, xid,current->fsuid)); diff --git a/trunk/fs/cifs/cifssmb.c b/trunk/fs/cifs/cifssmb.c index d5eac48fc415..843a85fb8b9a 100644 --- a/trunk/fs/cifs/cifssmb.c +++ b/trunk/fs/cifs/cifssmb.c @@ -1536,7 +1536,7 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, __u32 bytes_sent; __u16 byte_count; - /* cFYI(1, ("write at %lld %d bytes", offset, count));*/ + /* cFYI(1,("write at %lld %d bytes",offset,count));*/ if (tcon->ses == NULL) return -ECONNABORTED; diff --git a/trunk/fs/cifs/connect.c b/trunk/fs/cifs/connect.c index e9f9248cb3fe..71b7661e2260 100644 --- a/trunk/fs/cifs/connect.c +++ b/trunk/fs/cifs/connect.c @@ -92,8 +92,6 @@ struct smb_vol { bool seal:1; /* request transport encryption on share */ bool nodfs:1; /* Do not request DFS, even if available */ bool local_lease:1; /* check leases only on local system, not remote */ - bool noblocksnd:1; - bool noautotune:1; unsigned int rsize; unsigned int wsize; unsigned int sockopt; @@ -104,11 +102,9 @@ struct smb_vol { static int ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket, char *netb_name, - char *server_netb_name, - bool noblocksnd, - bool nosndbuf); /* ipv6 never set sndbuf size */ + char *server_netb_name); static int ipv6_connect(struct sockaddr_in6 *psin_server, - struct socket **csocket, bool noblocksnd); + struct socket **csocket); /* @@ -195,13 +191,12 @@ cifs_reconnect(struct TCP_Server_Info *server) try_to_freeze(); if (server->protocolType == IPV6) { rc = ipv6_connect(&server->addr.sockAddr6, - &server->ssocket, server->noautotune); + &server->ssocket); } else { rc = ipv4_connect(&server->addr.sockAddr, &server->ssocket, server->workstation_RFC1001_name, - server->server_RFC1001_name, - server->noblocksnd, server->noautotune); + server->server_RFC1001_name); } if (rc) { cFYI(1, ("reconnect error %d", rc)); @@ -1197,10 +1192,6 @@ cifs_parse_mount_options(char *options, const char *devname, /* ignore */ } else if (strnicmp(data, "rw", 2) == 0) { vol->rw = true; - } else if (strnicmp(data, "noblocksend", 11) == 0) { - vol->noblocksnd = 1; - } else if (strnicmp(data, "noautotune", 10) == 0) { - vol->noautotune = 1; } else if ((strnicmp(data, "suid", 4) == 0) || (strnicmp(data, "nosuid", 6) == 0) || (strnicmp(data, "exec", 4) == 0) || @@ -1527,8 +1518,7 @@ static void rfc1002mangle(char *target, char *source, unsigned int length) static int ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket, - char *netbios_name, char *target_name, - bool noblocksnd, bool noautotune) + char *netbios_name, char *target_name) { int rc = 0; int connected = 0; @@ -1600,16 +1590,11 @@ ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket, (*csocket)->sk->sk_sndbuf, (*csocket)->sk->sk_rcvbuf, (*csocket)->sk->sk_rcvtimeo)); (*csocket)->sk->sk_rcvtimeo = 7 * HZ; - if (!noblocksnd) - (*csocket)->sk->sk_sndtimeo = 3 * HZ; - /* make the bufsizes depend on wsize/rsize and max requests */ - if (noautotune) { - if ((*csocket)->sk->sk_sndbuf < (200 * 1024)) - (*csocket)->sk->sk_sndbuf = 200 * 1024; - if ((*csocket)->sk->sk_rcvbuf < (140 * 1024)) - (*csocket)->sk->sk_rcvbuf = 140 * 1024; - } + if ((*csocket)->sk->sk_sndbuf < (200 * 1024)) + (*csocket)->sk->sk_sndbuf = 200 * 1024; + if ((*csocket)->sk->sk_rcvbuf < (140 * 1024)) + (*csocket)->sk->sk_rcvbuf = 140 * 1024; /* send RFC1001 sessinit */ if (psin_server->sin_port == htons(RFC1001_PORT)) { @@ -1646,7 +1631,7 @@ ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket, /* sizeof RFC1002_SESSION_REQUEST with no scope */ smb_buf->smb_buf_length = 0x81000044; rc = smb_send(*csocket, smb_buf, 0x44, - (struct sockaddr *)psin_server, noblocksnd); + (struct sockaddr *)psin_server); kfree(ses_init_buf); msleep(1); /* RFC1001 layer in at least one server requires very short break before negprot @@ -1666,8 +1651,7 @@ ipv4_connect(struct sockaddr_in *psin_server, struct socket **csocket, } static int -ipv6_connect(struct sockaddr_in6 *psin_server, struct socket **csocket, - bool noblocksnd) +ipv6_connect(struct sockaddr_in6 *psin_server, struct socket **csocket) { int rc = 0; int connected = 0; @@ -1736,9 +1720,6 @@ ipv6_connect(struct sockaddr_in6 *psin_server, struct socket **csocket, the default. sock_setsockopt not used because it expects user space buffer */ (*csocket)->sk->sk_rcvtimeo = 7 * HZ; - if (!noblocksnd) - (*csocket)->sk->sk_sndtimeo = 3 * HZ; - return rc; } @@ -2002,14 +1983,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, cFYI(1, ("attempting ipv6 connect")); /* BB should we allow ipv6 on port 139? */ /* other OS never observed in Wild doing 139 with v6 */ - rc = ipv6_connect(&sin_server6, &csocket, - volume_info.noblocksnd); + rc = ipv6_connect(&sin_server6, &csocket); } else rc = ipv4_connect(&sin_server, &csocket, volume_info.source_rfc1001_name, - volume_info.target_rfc1001_name, - volume_info.noblocksnd, - volume_info.noautotune); + volume_info.target_rfc1001_name); if (rc < 0) { cERROR(1, ("Error connecting to IPv4 socket. " "Aborting operation")); @@ -2024,8 +2002,6 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, sock_release(csocket); goto out; } else { - srvTcp->noblocksnd = volume_info.noblocksnd; - srvTcp->noautotune = volume_info.noautotune; memcpy(&srvTcp->addr.sockAddr, &sin_server, sizeof(struct sockaddr_in)); atomic_set(&srvTcp->inFlight, 0); diff --git a/trunk/fs/cifs/file.c b/trunk/fs/cifs/file.c index ead1a3bb0256..62d8bd8f14c0 100644 --- a/trunk/fs/cifs/file.c +++ b/trunk/fs/cifs/file.c @@ -1824,7 +1824,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, pTcon = cifs_sb->tcon; pagevec_init(&lru_pvec, 0); - cFYI(DBG2, ("rpages: num pages %d", num_pages)); + cFYI(DBG2, ("rpages: num pages %d", num_pages)); for (i = 0; i < num_pages; ) { unsigned contig_pages; struct page *tmp_page; diff --git a/trunk/fs/cifs/inode.c b/trunk/fs/cifs/inode.c index ff8c68de4a92..d54fa8aeaea9 100644 --- a/trunk/fs/cifs/inode.c +++ b/trunk/fs/cifs/inode.c @@ -1361,11 +1361,9 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry, CIFS_MOUNT_MAP_SPECIAL_CHR); if (tmprc == 0 && (info_buf_source->UniqueId == - info_buf_target->UniqueId)) { + info_buf_target->UniqueId)) /* same file, POSIX says that this is a noop */ - rc = 0; goto cifs_rename_exit; - } } /* else ... BB we could add the same check for Windows by checking the UniqueId via FILE_INTERNAL_INFO */ diff --git a/trunk/fs/cifs/transport.c b/trunk/fs/cifs/transport.c index ff8243a8fe3e..bf0e6d8e382a 100644 --- a/trunk/fs/cifs/transport.c +++ b/trunk/fs/cifs/transport.c @@ -161,7 +161,7 @@ void DeleteTconOplockQEntries(struct cifsTconInfo *tcon) int smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer, - unsigned int smb_buf_length, struct sockaddr *sin, bool noblocksnd) + unsigned int smb_buf_length, struct sockaddr *sin) { int rc = 0; int i = 0; @@ -178,10 +178,7 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer, smb_msg.msg_namelen = sizeof(struct sockaddr); smb_msg.msg_control = NULL; smb_msg.msg_controllen = 0; - if (noblocksnd) - smb_msg.msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL; - else - smb_msg.msg_flags = MSG_NOSIGNAL; + smb_msg.msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL; /* BB add more flags?*/ /* smb header is converted in header_assemble. bcc and rest of SMB word area, and byte area if necessary, is converted to littleendian in @@ -232,8 +229,8 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer, } static int -smb_send2(struct TCP_Server_Info *server, struct kvec *iov, int n_vec, - struct sockaddr *sin, bool noblocksnd) +smb_send2(struct socket *ssocket, struct kvec *iov, int n_vec, + struct sockaddr *sin) { int rc = 0; int i = 0; @@ -243,7 +240,6 @@ smb_send2(struct TCP_Server_Info *server, struct kvec *iov, int n_vec, unsigned int total_len; int first_vec = 0; unsigned int smb_buf_length = smb_buffer->smb_buf_length; - struct socket *ssocket = server->ssocket; if (ssocket == NULL) return -ENOTSOCK; /* BB eventually add reconnect code here */ @@ -252,10 +248,7 @@ smb_send2(struct TCP_Server_Info *server, struct kvec *iov, int n_vec, smb_msg.msg_namelen = sizeof(struct sockaddr); smb_msg.msg_control = NULL; smb_msg.msg_controllen = 0; - if (noblocksnd) - smb_msg.msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL; - else - smb_msg.msg_flags = MSG_NOSIGNAL; + smb_msg.msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL; /* BB add more flags?*/ /* smb header is converted in header_assemble. bcc and rest of SMB word area, and byte area if necessary, is converted to littleendian in @@ -290,11 +283,8 @@ smb_send2(struct TCP_Server_Info *server, struct kvec *iov, int n_vec, if (rc < 0) break; - if (rc == total_len) { - total_len = 0; - break; - } else if (rc > total_len) { - cERROR(1, ("sent %d requested %d", rc, total_len)); + if (rc >= total_len) { + WARN_ON(rc > total_len); break; } if (rc == 0) { @@ -322,16 +312,6 @@ smb_send2(struct TCP_Server_Info *server, struct kvec *iov, int n_vec, i = 0; /* in case we get ENOSPC on the next send */ } - if ((total_len > 0) && (total_len != smb_buf_length + 4)) { - cFYI(1, ("partial send (%d remaining), terminating session", - total_len)); - /* If we have only sent part of an SMB then the next SMB - could be taken as the remainder of this one. We need - to kill the socket so the server throws away the partial - SMB */ - server->tcpStatus = CifsNeedReconnect; - } - if (rc < 0) { cERROR(1, ("Error %d sending data on socket to server", rc)); } else @@ -538,9 +518,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, #ifdef CONFIG_CIFS_STATS2 atomic_inc(&ses->server->inSend); #endif - rc = smb_send2(ses->server, iov, n_vec, - (struct sockaddr *) &(ses->server->addr.sockAddr), - ses->server->noblocksnd); + rc = smb_send2(ses->server->ssocket, iov, n_vec, + (struct sockaddr *) &(ses->server->addr.sockAddr)); #ifdef CONFIG_CIFS_STATS2 atomic_dec(&ses->server->inSend); midQ->when_sent = jiffies; @@ -732,8 +711,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, atomic_inc(&ses->server->inSend); #endif rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length, - (struct sockaddr *) &(ses->server->addr.sockAddr), - ses->server->noblocksnd); + (struct sockaddr *) &(ses->server->addr.sockAddr)); #ifdef CONFIG_CIFS_STATS2 atomic_dec(&ses->server->inSend); midQ->when_sent = jiffies; @@ -873,8 +851,7 @@ send_nt_cancel(struct cifsTconInfo *tcon, struct smb_hdr *in_buf, return rc; } rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length, - (struct sockaddr *) &(ses->server->addr.sockAddr), - ses->server->noblocksnd); + (struct sockaddr *) &(ses->server->addr.sockAddr)); up(&ses->server->tcpSem); return rc; } @@ -964,8 +941,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon, atomic_inc(&ses->server->inSend); #endif rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length, - (struct sockaddr *) &(ses->server->addr.sockAddr), - ses->server->noblocksnd); + (struct sockaddr *) &(ses->server->addr.sockAddr)); #ifdef CONFIG_CIFS_STATS2 atomic_dec(&ses->server->inSend); midQ->when_sent = jiffies; diff --git a/trunk/fs/proc/uptime.c b/trunk/fs/proc/uptime.c index df26aa88fa47..0c10a0b3f146 100644 --- a/trunk/fs/proc/uptime.c +++ b/trunk/fs/proc/uptime.c @@ -1,45 +1,43 @@ +#include #include #include #include +#include #include #include -static int proc_calc_metrics(char *page, char **start, off_t off, - int count, int *eof, int len) -{ - if (len <= off + count) - *eof = 1; - *start = page + off; - len -= off; - if (len > count) - len = count; - if (len < 0) - len = 0; - return len; -} - -static int uptime_read_proc(char *page, char **start, off_t off, int count, - int *eof, void *data) +static int uptime_proc_show(struct seq_file *m, void *v) { struct timespec uptime; struct timespec idle; - int len; cputime_t idletime = cputime_add(init_task.utime, init_task.stime); do_posix_clock_monotonic_gettime(&uptime); monotonic_to_bootbased(&uptime); cputime_to_timespec(idletime, &idle); - len = sprintf(page, "%lu.%02lu %lu.%02lu\n", + seq_printf(m, "%lu.%02lu %lu.%02lu\n", (unsigned long) uptime.tv_sec, (uptime.tv_nsec / (NSEC_PER_SEC / 100)), (unsigned long) idle.tv_sec, (idle.tv_nsec / (NSEC_PER_SEC / 100))); - return proc_calc_metrics(page, start, off, count, eof, len); + return 0; } +static int uptime_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, uptime_proc_show, NULL); +} + +static const struct file_operations uptime_proc_fops = { + .open = uptime_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + static int __init proc_uptime_init(void) { - create_proc_read_entry("uptime", 0, NULL, uptime_read_proc, NULL); + proc_create("uptime", 0, NULL, &uptime_proc_fops); return 0; } module_init(proc_uptime_init); diff --git a/trunk/include/asm-x86/iomap.h b/trunk/include/asm-x86/iomap.h deleted file mode 100644 index c1f06289b14b..000000000000 --- a/trunk/include/asm-x86/iomap.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright © 2008 Ingo Molnar - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - */ - -#include -#include -#include -#include -#include -#include - -void * -iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); - -void -iounmap_atomic(void *kvaddr, enum km_type type); diff --git a/trunk/include/drm/i915_drm.h b/trunk/include/drm/i915_drm.h index 152b34da927c..eb4b35031a55 100644 --- a/trunk/include/drm/i915_drm.h +++ b/trunk/include/drm/i915_drm.h @@ -159,7 +159,6 @@ typedef struct _drm_i915_sarea { #define DRM_I915_GEM_SW_FINISH 0x20 #define DRM_I915_GEM_SET_TILING 0x21 #define DRM_I915_GEM_GET_TILING 0x22 -#define DRM_I915_GEM_GET_APERTURE 0x23 #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) @@ -191,7 +190,6 @@ typedef struct _drm_i915_sarea { #define DRM_IOCTL_I915_GEM_SW_FINISH DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_SW_FINISH, struct drm_i915_gem_sw_finish) #define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) -#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) /* Allow drivers to submit batchbuffers directly to hardware, relying * on the security mechanisms provided by hardware. @@ -602,15 +600,4 @@ struct drm_i915_gem_get_tiling { uint32_t swizzle_mode; }; -struct drm_i915_gem_get_aperture { - /** Total size of the aperture used by i915_gem_execbuffer, in bytes */ - uint64_t aper_size; - - /** - * Available space in the aperture used by i915_gem_execbuffer, in - * bytes - */ - uint64_t aper_available_size; -}; - #endif /* _I915_DRM_H_ */ diff --git a/trunk/include/linux/io-mapping.h b/trunk/include/linux/io-mapping.h deleted file mode 100644 index 82df31726a54..000000000000 --- a/trunk/include/linux/io-mapping.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright © 2008 Keith Packard - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef _LINUX_IO_MAPPING_H -#define _LINUX_IO_MAPPING_H - -#include -#include -#include -#include - -/* - * The io_mapping mechanism provides an abstraction for mapping - * individual pages from an io device to the CPU in an efficient fashion. - * - * See Documentation/io_mapping.txt - */ - -/* this struct isn't actually defined anywhere */ -struct io_mapping; - -#ifdef CONFIG_HAVE_ATOMIC_IOMAP - -/* - * For small address space machines, mapping large objects - * into the kernel virtual space isn't practical. Where - * available, use fixmap support to dynamically map pages - * of the object at run time. - */ - -static inline struct io_mapping * -io_mapping_create_wc(unsigned long base, unsigned long size) -{ - return (struct io_mapping *) base; -} - -static inline void -io_mapping_free(struct io_mapping *mapping) -{ -} - -/* Atomic map/unmap */ -static inline void * -io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) -{ - offset += (unsigned long) mapping; - return iomap_atomic_prot_pfn(offset >> PAGE_SHIFT, KM_USER0, - __pgprot(__PAGE_KERNEL_WC)); -} - -static inline void -io_mapping_unmap_atomic(void *vaddr) -{ - iounmap_atomic(vaddr, KM_USER0); -} - -static inline void * -io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) -{ - offset += (unsigned long) mapping; - return ioremap_wc(offset, PAGE_SIZE); -} - -static inline void -io_mapping_unmap(void *vaddr) -{ - iounmap(vaddr); -} - -#else - -/* Create the io_mapping object*/ -static inline struct io_mapping * -io_mapping_create_wc(unsigned long base, unsigned long size) -{ - return (struct io_mapping *) ioremap_wc(base, size); -} - -static inline void -io_mapping_free(struct io_mapping *mapping) -{ - iounmap(mapping); -} - -/* Atomic map/unmap */ -static inline void * -io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) -{ - return ((char *) mapping) + offset; -} - -static inline void -io_mapping_unmap_atomic(void *vaddr) -{ -} - -/* Non-atomic map/unmap */ -static inline void * -io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) -{ - return ((char *) mapping) + offset; -} - -static inline void -io_mapping_unmap(void *vaddr) -{ -} - -#endif /* HAVE_ATOMIC_IOMAP */ - -#endif /* _LINUX_IO_MAPPING_H */ diff --git a/trunk/kernel/trace/Kconfig b/trunk/kernel/trace/Kconfig index 33dbefd471e8..b58f43bec363 100644 --- a/trunk/kernel/trace/Kconfig +++ b/trunk/kernel/trace/Kconfig @@ -25,7 +25,7 @@ config TRACING bool select DEBUG_FS select RING_BUFFER - select STACKTRACE if STACKTRACE_SUPPORT + select STACKTRACE select TRACEPOINTS select NOP_TRACER diff --git a/trunk/kernel/trace/ring_buffer.c b/trunk/kernel/trace/ring_buffer.c index 3f3380638646..cedf4e268285 100644 --- a/trunk/kernel/trace/ring_buffer.c +++ b/trunk/kernel/trace/ring_buffer.c @@ -1022,23 +1022,8 @@ rb_reserve_next_event(struct ring_buffer_per_cpu *cpu_buffer, struct ring_buffer_event *event; u64 ts, delta; int commit = 0; - int nr_loops = 0; again: - /* - * We allow for interrupts to reenter here and do a trace. - * If one does, it will cause this original code to loop - * back here. Even with heavy interrupts happening, this - * should only happen a few times in a row. If this happens - * 1000 times in a row, there must be either an interrupt - * storm or we have something buggy. - * Bail! - */ - if (unlikely(++nr_loops > 1000)) { - RB_WARN_ON(cpu_buffer, 1); - return NULL; - } - ts = ring_buffer_time_stamp(cpu_buffer->cpu); /* @@ -1547,23 +1532,10 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer) { struct buffer_page *reader = NULL; unsigned long flags; - int nr_loops = 0; spin_lock_irqsave(&cpu_buffer->lock, flags); again: - /* - * This should normally only loop twice. But because the - * start of the reader inserts an empty page, it causes - * a case where we will loop three times. There should be no - * reason to loop four times (that I know of). - */ - if (unlikely(++nr_loops > 3)) { - RB_WARN_ON(cpu_buffer, 1); - reader = NULL; - goto out; - } - reader = cpu_buffer->reader_page; /* If there's more to read, return this page */ @@ -1693,7 +1665,6 @@ ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts) struct ring_buffer_per_cpu *cpu_buffer; struct ring_buffer_event *event; struct buffer_page *reader; - int nr_loops = 0; if (!cpu_isset(cpu, buffer->cpumask)) return NULL; @@ -1701,19 +1672,6 @@ ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts) cpu_buffer = buffer->buffers[cpu]; again: - /* - * We repeat when a timestamp is encountered. It is possible - * to get multiple timestamps from an interrupt entering just - * as one timestamp is about to be written. The max times - * that this can happen is the number of nested interrupts we - * can have. Nesting 10 deep of interrupts is clearly - * an anomaly. - */ - if (unlikely(++nr_loops > 10)) { - RB_WARN_ON(cpu_buffer, 1); - return NULL; - } - reader = rb_get_reader_page(cpu_buffer); if (!reader) return NULL; @@ -1764,7 +1722,6 @@ ring_buffer_iter_peek(struct ring_buffer_iter *iter, u64 *ts) struct ring_buffer *buffer; struct ring_buffer_per_cpu *cpu_buffer; struct ring_buffer_event *event; - int nr_loops = 0; if (ring_buffer_iter_empty(iter)) return NULL; @@ -1773,19 +1730,6 @@ ring_buffer_iter_peek(struct ring_buffer_iter *iter, u64 *ts) buffer = cpu_buffer->buffer; again: - /* - * We repeat when a timestamp is encountered. It is possible - * to get multiple timestamps from an interrupt entering just - * as one timestamp is about to be written. The max times - * that this can happen is the number of nested interrupts we - * can have. Nesting 10 deep of interrupts is clearly - * an anomaly. - */ - if (unlikely(++nr_loops > 10)) { - RB_WARN_ON(cpu_buffer, 1); - return NULL; - } - if (rb_per_cpu_empty(cpu_buffer)) return NULL; diff --git a/trunk/kernel/trace/trace.c b/trunk/kernel/trace/trace.c index 9f3b478f9171..8a499e2adaec 100644 --- a/trunk/kernel/trace/trace.c +++ b/trunk/kernel/trace/trace.c @@ -705,7 +705,6 @@ static void ftrace_trace_stack(struct trace_array *tr, unsigned long flags, int skip, int pc) { -#ifdef CONFIG_STACKTRACE struct ring_buffer_event *event; struct stack_entry *entry; struct stack_trace trace; @@ -731,7 +730,6 @@ static void ftrace_trace_stack(struct trace_array *tr, save_stack_trace(&trace); ring_buffer_unlock_commit(tr->buffer, event, irq_flags); -#endif } void __trace_stack(struct trace_array *tr, @@ -1088,20 +1086,17 @@ static void s_stop(struct seq_file *m, void *p) mutex_unlock(&trace_types_lock); } +#define KRETPROBE_MSG "[unknown/kretprobe'd]" + #ifdef CONFIG_KRETPROBES -static inline const char *kretprobed(const char *name) +static inline int kretprobed(unsigned long addr) { - static const char tramp_name[] = "kretprobe_trampoline"; - int size = sizeof(tramp_name); - - if (strncmp(tramp_name, name, size) == 0) - return "[unknown/kretprobe'd]"; - return name; + return addr == (unsigned long)kretprobe_trampoline; } #else -static inline const char *kretprobed(const char *name) +static inline int kretprobed(unsigned long addr) { - return name; + return 0; } #endif /* CONFIG_KRETPROBES */ @@ -1110,13 +1105,10 @@ seq_print_sym_short(struct trace_seq *s, const char *fmt, unsigned long address) { #ifdef CONFIG_KALLSYMS char str[KSYM_SYMBOL_LEN]; - const char *name; kallsyms_lookup(address, NULL, NULL, NULL, str); - name = kretprobed(str); - - return trace_seq_printf(s, fmt, name); + return trace_seq_printf(s, fmt, str); #endif return 1; } @@ -1127,12 +1119,9 @@ seq_print_sym_offset(struct trace_seq *s, const char *fmt, { #ifdef CONFIG_KALLSYMS char str[KSYM_SYMBOL_LEN]; - const char *name; sprint_symbol(str, address); - name = kretprobed(str); - - return trace_seq_printf(s, fmt, name); + return trace_seq_printf(s, fmt, str); #endif return 1; } @@ -1386,7 +1375,10 @@ print_lat_fmt(struct trace_iterator *iter, unsigned int trace_idx, int cpu) seq_print_ip_sym(s, field->ip, sym_flags); trace_seq_puts(s, " ("); - seq_print_ip_sym(s, field->parent_ip, sym_flags); + if (kretprobed(field->parent_ip)) + trace_seq_puts(s, KRETPROBE_MSG); + else + seq_print_ip_sym(s, field->parent_ip, sym_flags); trace_seq_puts(s, ")\n"); break; } @@ -1502,9 +1494,12 @@ static enum print_line_t print_trace_fmt(struct trace_iterator *iter) ret = trace_seq_printf(s, " <-"); if (!ret) return TRACE_TYPE_PARTIAL_LINE; - ret = seq_print_ip_sym(s, - field->parent_ip, - sym_flags); + if (kretprobed(field->parent_ip)) + ret = trace_seq_puts(s, KRETPROBE_MSG); + else + ret = seq_print_ip_sym(s, + field->parent_ip, + sym_flags); if (!ret) return TRACE_TYPE_PARTIAL_LINE; } diff --git a/trunk/mm/vmalloc.c b/trunk/mm/vmalloc.c index 66fad3fc02b1..f1cc03bbf6ac 100644 --- a/trunk/mm/vmalloc.c +++ b/trunk/mm/vmalloc.c @@ -178,7 +178,7 @@ static int vmap_page_range(unsigned long addr, unsigned long end, static inline int is_vmalloc_or_module_addr(const void *x) { /* - * ARM, x86-64 and sparc64 put modules in a special place, + * x86-64 and sparc64 put modules in a special place, * and fall back on vmalloc() if that fails. Others * just put it in the vmalloc space. */ diff --git a/trunk/sound/aoa/soundbus/core.c b/trunk/sound/aoa/soundbus/core.c index fa8ab2815a98..f84f3e505788 100644 --- a/trunk/sound/aoa/soundbus/core.c +++ b/trunk/sound/aoa/soundbus/core.c @@ -176,7 +176,7 @@ int soundbus_add_one(struct soundbus_dev *dev) return -EINVAL; } - dev_set_name(&dev->ofdev.dev, "soundbus:%x", ++devcount); + snprintf(dev->ofdev.dev.bus_id, BUS_ID_SIZE, "soundbus:%x", ++devcount); dev->ofdev.dev.bus = &soundbus_bus_type; return of_device_register(&dev->ofdev); } diff --git a/trunk/sound/core/rawmidi.c b/trunk/sound/core/rawmidi.c index 39672f68ce5d..c4995c9f5730 100644 --- a/trunk/sound/core/rawmidi.c +++ b/trunk/sound/core/rawmidi.c @@ -148,8 +148,6 @@ static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream) static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up) { - if (!substream->opened) - return; if (up) { tasklet_hi_schedule(&substream->runtime->tasklet); } else { @@ -160,8 +158,6 @@ static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *subs static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up) { - if (!substream->opened) - return; substream->ops->trigger(substream, up); if (!up && substream->runtime->event) tasklet_kill(&substream->runtime->tasklet); @@ -861,8 +857,6 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream, int result = 0, count1; struct snd_rawmidi_runtime *runtime = substream->runtime; - if (!substream->opened) - return -EBADFD; if (runtime->buffer == NULL) { snd_printd("snd_rawmidi_receive: input is not active!!!\n"); return -EINVAL; @@ -1132,8 +1126,6 @@ int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count) int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, unsigned char *buffer, int count) { - if (!substream->opened) - return -EBADFD; count = snd_rawmidi_transmit_peek(substream, buffer, count); if (count < 0) return count; diff --git a/trunk/sound/drivers/ml403-ac97cr.c b/trunk/sound/drivers/ml403-ac97cr.c index 7783843ca9ae..ecdbeb6d3603 100644 --- a/trunk/sound/drivers/ml403-ac97cr.c +++ b/trunk/sound/drivers/ml403-ac97cr.c @@ -1153,7 +1153,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev, /* get irq */ irq = platform_get_irq(pfdev, 0); if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED, - dev_name(&pfdev->dev), (void *)ml403_ac97cr)) { + pfdev->dev.bus_id, (void *)ml403_ac97cr)) { snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": " "unable to grab IRQ %d\n", irq); @@ -1166,7 +1166,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev, ml403_ac97cr->irq); irq = platform_get_irq(pfdev, 1); if (request_irq(irq, snd_ml403_ac97cr_irq, IRQF_DISABLED, - dev_name(&pfdev->dev), (void *)ml403_ac97cr)) { + pfdev->dev.bus_id, (void *)ml403_ac97cr)) { snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": " "unable to grab IRQ %d\n", irq); diff --git a/trunk/sound/drivers/pcsp/pcsp_input.c b/trunk/sound/drivers/pcsp/pcsp_input.c index 0444cdeb4bec..cd9b83e7f7d1 100644 --- a/trunk/sound/drivers/pcsp/pcsp_input.c +++ b/trunk/sound/drivers/pcsp/pcsp_input.c @@ -24,13 +24,13 @@ static void pcspkr_do_sound(unsigned int count) spin_lock_irqsave(&i8253_lock, flags); if (count) { + /* enable counter 2 */ + outb_p(inb_p(0x61) | 3, 0x61); /* set command for counter 2, 2 byte write */ outb_p(0xB6, 0x43); /* select desired HZ */ outb_p(count & 0xff, 0x42); outb((count >> 8) & 0xff, 0x42); - /* enable counter 2 */ - outb_p(inb_p(0x61) | 3, 0x61); } else { /* disable counter 2 */ outb(inb_p(0x61) & 0xFC, 0x61); diff --git a/trunk/sound/isa/ad1848/ad1848.c b/trunk/sound/isa/ad1848/ad1848.c index 223a6c038819..b68d20edc20f 100644 --- a/trunk/sound/isa/ad1848/ad1848.c +++ b/trunk/sound/isa/ad1848/ad1848.c @@ -70,15 +70,15 @@ static int __devinit snd_ad1848_match(struct device *dev, unsigned int n) return 0; if (port[n] == SNDRV_AUTO_PORT) { - dev_err(dev, "please specify port\n"); + snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id); return 0; } if (irq[n] == SNDRV_AUTO_IRQ) { - dev_err(dev, "please specify irq\n"); + snd_printk(KERN_ERR "%s: please specify irq\n", dev->bus_id); return 0; } if (dma1[n] == SNDRV_AUTO_DMA) { - dev_err(dev, "please specify dma1\n"); + snd_printk(KERN_ERR "%s: please specify dma1\n", dev->bus_id); return 0; } return 1; diff --git a/trunk/sound/isa/adlib.c b/trunk/sound/isa/adlib.c index 374b7177e111..efa8c80d05b6 100644 --- a/trunk/sound/isa/adlib.c +++ b/trunk/sound/isa/adlib.c @@ -36,7 +36,7 @@ static int __devinit snd_adlib_match(struct device *dev, unsigned int n) return 0; if (port[n] == SNDRV_AUTO_PORT) { - dev_err(dev, "please specify port\n"); + snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id); return 0; } return 1; @@ -55,13 +55,13 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n) card = snd_card_new(index[n], id[n], THIS_MODULE, 0); if (!card) { - dev_err(dev, "could not create card\n"); + snd_printk(KERN_ERR "%s: could not create card\n", dev->bus_id); return -EINVAL; } card->private_data = request_region(port[n], 4, CRD_NAME); if (!card->private_data) { - dev_err(dev, "could not grab ports\n"); + snd_printk(KERN_ERR "%s: could not grab ports\n", dev->bus_id); error = -EBUSY; goto out; } @@ -73,13 +73,13 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n) error = snd_opl3_create(card, port[n], port[n] + 2, OPL3_HW_AUTO, 1, &opl3); if (error < 0) { - dev_err(dev, "could not create OPL\n"); + snd_printk(KERN_ERR "%s: could not create OPL\n", dev->bus_id); goto out; } error = snd_opl3_hwdep_new(opl3, 0, 0, NULL); if (error < 0) { - dev_err(dev, "could not create FM\n"); + snd_printk(KERN_ERR "%s: could not create FM\n", dev->bus_id); goto out; } @@ -87,7 +87,7 @@ static int __devinit snd_adlib_probe(struct device *dev, unsigned int n) error = snd_card_register(card); if (error < 0) { - dev_err(dev, "could not register card\n"); + snd_printk(KERN_ERR "%s: could not register card\n", dev->bus_id); goto out; } diff --git a/trunk/sound/isa/cs423x/cs4231.c b/trunk/sound/isa/cs423x/cs4231.c index f019d449e2d6..ddd289120aa8 100644 --- a/trunk/sound/isa/cs423x/cs4231.c +++ b/trunk/sound/isa/cs423x/cs4231.c @@ -74,15 +74,15 @@ static int __devinit snd_cs4231_match(struct device *dev, unsigned int n) return 0; if (port[n] == SNDRV_AUTO_PORT) { - dev_err(dev, "please specify port\n"); + snd_printk(KERN_ERR "%s: please specify port\n", dev->bus_id); return 0; } if (irq[n] == SNDRV_AUTO_IRQ) { - dev_err(dev, "please specify irq\n"); + snd_printk(KERN_ERR "%s: please specify irq\n", dev->bus_id); return 0; } if (dma1[n] == SNDRV_AUTO_DMA) { - dev_err(dev, "please specify dma1\n"); + snd_printk(KERN_ERR "%s: please specify dma1\n", dev->bus_id); return 0; } return 1; @@ -133,7 +133,7 @@ static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n) mpu_port[n], 0, mpu_irq[n], mpu_irq[n] >= 0 ? IRQF_DISABLED : 0, NULL) < 0) - dev_warn(dev, "MPU401 not detected\n"); + printk(KERN_WARNING "%s: MPU401 not detected\n", dev->bus_id); } snd_card_set_dev(card, dev); diff --git a/trunk/sound/isa/cs423x/cs4236.c b/trunk/sound/isa/cs423x/cs4236.c index 019c9401663e..91f9c15d3e30 100644 --- a/trunk/sound/isa/cs423x/cs4236.c +++ b/trunk/sound/isa/cs423x/cs4236.c @@ -488,19 +488,19 @@ static int __devinit snd_cs423x_isa_match(struct device *pdev, return 0; if (port[dev] == SNDRV_AUTO_PORT) { - dev_err(pdev, "please specify port\n"); + snd_printk(KERN_ERR "%s: please specify port\n", pdev->bus_id); return 0; } if (cport[dev] == SNDRV_AUTO_PORT) { - dev_err(pdev, "please specify cport\n"); + snd_printk(KERN_ERR "%s: please specify cport\n", pdev->bus_id); return 0; } if (irq[dev] == SNDRV_AUTO_IRQ) { - dev_err(pdev, "please specify irq\n"); + snd_printk(KERN_ERR "%s: please specify irq\n", pdev->bus_id); return 0; } if (dma1[dev] == SNDRV_AUTO_DMA) { - dev_err(pdev, "please specify dma1\n"); + snd_printk(KERN_ERR "%s: please specify dma1\n", pdev->bus_id); return 0; } return 1; diff --git a/trunk/sound/isa/es1688/es1688.c b/trunk/sound/isa/es1688/es1688.c index b46377139cf8..f88639ea64b2 100644 --- a/trunk/sound/isa/es1688/es1688.c +++ b/trunk/sound/isa/es1688/es1688.c @@ -88,14 +88,16 @@ static int __devinit snd_es1688_legacy_create(struct snd_card *card, if (irq[n] == SNDRV_AUTO_IRQ) { irq[n] = snd_legacy_find_free_irq(possible_irqs); if (irq[n] < 0) { - dev_err(dev, "unable to find a free IRQ\n"); + snd_printk(KERN_ERR "%s: unable to find a free IRQ\n", + dev->bus_id); return -EBUSY; } } if (dma8[n] == SNDRV_AUTO_DMA) { dma8[n] = snd_legacy_find_free_dma(possible_dmas); if (dma8[n] < 0) { - dev_err(dev, "unable to find a free DMA\n"); + snd_printk(KERN_ERR "%s: unable to find a free DMA\n", + dev->bus_id); return -EBUSY; } } @@ -145,7 +147,8 @@ static int __devinit snd_es1688_probe(struct device *dev, unsigned int n) if (snd_opl3_create(card, chip->port, chip->port + 2, OPL3_HW_OPL3, 0, &opl3) < 0) - dev_warn(dev, "opl3 not detected at 0x%lx\n", chip->port); + printk(KERN_WARNING "%s: opl3 not detected at 0x%lx\n", + dev->bus_id, chip->port); else { error = snd_opl3_hwdep_new(opl3, 0, 1, NULL); if (error < 0) diff --git a/trunk/sound/isa/gus/gusclassic.c b/trunk/sound/isa/gus/gusclassic.c index 426532a4d730..8f914b37bf89 100644 --- a/trunk/sound/isa/gus/gusclassic.c +++ b/trunk/sound/isa/gus/gusclassic.c @@ -90,21 +90,24 @@ static int __devinit snd_gusclassic_create(struct snd_card *card, if (irq[n] == SNDRV_AUTO_IRQ) { irq[n] = snd_legacy_find_free_irq(possible_irqs); if (irq[n] < 0) { - dev_err(dev, "unable to find a free IRQ\n"); + snd_printk(KERN_ERR "%s: unable to find a free IRQ\n", + dev->bus_id); return -EBUSY; } } if (dma1[n] == SNDRV_AUTO_DMA) { dma1[n] = snd_legacy_find_free_dma(possible_dmas); if (dma1[n] < 0) { - dev_err(dev, "unable to find a free DMA1\n"); + snd_printk(KERN_ERR "%s: unable to find a free DMA1\n", + dev->bus_id); return -EBUSY; } } if (dma2[n] == SNDRV_AUTO_DMA) { dma2[n] = snd_legacy_find_free_dma(possible_dmas); if (dma2[n] < 0) { - dev_err(dev, "unable to find a free DMA2\n"); + snd_printk(KERN_ERR "%s: unable to find a free DMA2\n", + dev->bus_id); return -EBUSY; } } @@ -171,8 +174,8 @@ static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n) error = -ENODEV; if (gus->max_flag || gus->ess_flag) { - dev_err(dev, "GUS Classic or ACE soundcard was " - "not detected at 0x%lx\n", gus->gf1.port); + snd_printk(KERN_ERR "%s: GUS Classic or ACE soundcard was " + "not detected at 0x%lx\n", dev->bus_id, gus->gf1.port); goto out; } diff --git a/trunk/sound/isa/gus/gusextreme.c b/trunk/sound/isa/gus/gusextreme.c index 7ad4c3b41a84..da13185eb0a0 100644 --- a/trunk/sound/isa/gus/gusextreme.c +++ b/trunk/sound/isa/gus/gusextreme.c @@ -106,14 +106,16 @@ static int __devinit snd_gusextreme_es1688_create(struct snd_card *card, if (irq[n] == SNDRV_AUTO_IRQ) { irq[n] = snd_legacy_find_free_irq(possible_irqs); if (irq[n] < 0) { - dev_err(dev, "unable to find a free IRQ for ES1688\n"); + snd_printk(KERN_ERR "%s: unable to find a free IRQ " + "for ES1688\n", dev->bus_id); return -EBUSY; } } if (dma8[n] == SNDRV_AUTO_DMA) { dma8[n] = snd_legacy_find_free_dma(possible_dmas); if (dma8[n] < 0) { - dev_err(dev, "unable to find a free DMA for ES1688\n"); + snd_printk(KERN_ERR "%s: unable to find a free DMA " + "for ES1688\n", dev->bus_id); return -EBUSY; } } @@ -141,14 +143,16 @@ static int __devinit snd_gusextreme_gus_card_create(struct snd_card *card, if (gf1_irq[n] == SNDRV_AUTO_IRQ) { gf1_irq[n] = snd_legacy_find_free_irq(possible_irqs); if (gf1_irq[n] < 0) { - dev_err(dev, "unable to find a free IRQ for GF1\n"); + snd_printk(KERN_ERR "%s: unable to find a free IRQ " + "for GF1\n", dev->bus_id); return -EBUSY; } } if (dma1[n] == SNDRV_AUTO_DMA) { dma1[n] = snd_legacy_find_free_dma(possible_dmas); if (dma1[n] < 0) { - dev_err(dev, "unable to find a free DMA for GF1\n"); + snd_printk(KERN_ERR "%s: unable to find a free DMA " + "for GF1\n", dev->bus_id); return -EBUSY; } } @@ -274,8 +278,8 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n) error = -ENODEV; if (!gus->ess_flag) { - dev_err(dev, "GUS Extreme soundcard was not " - "detected at 0x%lx\n", gus->gf1.port); + snd_printk(KERN_ERR "%s: GUS Extreme soundcard was not " + "detected at 0x%lx\n", dev->bus_id, gus->gf1.port); goto out; } gus->codec_flag = 1; @@ -306,7 +310,8 @@ static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n) if (snd_opl3_create(card, es1688->port, es1688->port + 2, OPL3_HW_OPL3, 0, &opl3) < 0) - dev_warn(dev, "opl3 not detected at 0x%lx\n", es1688->port); + printk(KERN_ERR "%s: opl3 not detected at 0x%lx\n", + dev->bus_id, es1688->port); else { error = snd_opl3_hwdep_new(opl3, 0, 2, NULL); if (error < 0) diff --git a/trunk/sound/isa/sb/sb8.c b/trunk/sound/isa/sb/sb8.c index 667eccc676a4..336a34277907 100644 --- a/trunk/sound/isa/sb/sb8.c +++ b/trunk/sound/isa/sb/sb8.c @@ -85,11 +85,11 @@ static int __devinit snd_sb8_match(struct device *pdev, unsigned int dev) if (!enable[dev]) return 0; if (irq[dev] == SNDRV_AUTO_IRQ) { - dev_err(pdev, "please specify irq\n"); + snd_printk(KERN_ERR "%s: please specify irq\n", pdev->bus_id); return 0; } if (dma8[dev] == SNDRV_AUTO_DMA) { - dev_err(pdev, "please specify dma8\n"); + snd_printk(KERN_ERR "%s: please specify dma8\n", pdev->bus_id); return 0; } return 1; diff --git a/trunk/sound/pci/emu10k1/emu10k1_main.c b/trunk/sound/pci/emu10k1/emu10k1_main.c index de5ee8f097f6..2f283ea6ad9a 100644 --- a/trunk/sound/pci/emu10k1/emu10k1_main.c +++ b/trunk/sound/pci/emu10k1/emu10k1_main.c @@ -1464,7 +1464,6 @@ static struct snd_emu_chip_details emu_chip_details[] = { .ca0151_chip = 1, .spk71 = 1, .spdif_bug = 1, - .invert_shared_spdif = 1, /* digital/analog switch swapped */ .ac97_chip = 1} , {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102, .driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]", @@ -1474,7 +1473,6 @@ static struct snd_emu_chip_details emu_chip_details[] = { .ca0151_chip = 1, .spk71 = 1, .spdif_bug = 1, - .invert_shared_spdif = 1, /* digital/analog switch swapped */ .ac97_chip = 1} , {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102, .driver = "Audigy2", .name = "Audigy 2 ZS [2001]", @@ -1484,7 +1482,6 @@ static struct snd_emu_chip_details emu_chip_details[] = { .ca0151_chip = 1, .spk71 = 1, .spdif_bug = 1, - .invert_shared_spdif = 1, /* digital/analog switch swapped */ .ac97_chip = 1} , /* Audigy 2 */ /* Tested by James@superbug.co.uk 3rd July 2005 */ diff --git a/trunk/sound/pci/hda/patch_realtek.c b/trunk/sound/pci/hda/patch_realtek.c index a4666c96a44f..4eceab9bd109 100644 --- a/trunk/sound/pci/hda/patch_realtek.c +++ b/trunk/sound/pci/hda/patch_realtek.c @@ -829,7 +829,6 @@ static void alc_sku_automute(struct hda_codec *codec) spec->jack_present ? 0 : PIN_OUT); } -#if 0 /* it's broken in some acses -- temporarily disabled */ static void alc_mic_automute(struct hda_codec *codec) { struct alc_spec *spec = codec->spec; @@ -850,9 +849,6 @@ static void alc_mic_automute(struct hda_codec *codec) snd_hda_codec_amp_stereo(codec, 0x0b, HDA_INPUT, capsrc_idx_fmic, HDA_AMP_MUTE, present ? HDA_AMP_MUTE : 0); } -#else -#define alc_mic_automute(codec) /* NOP */ -#endif /* disabled */ /* unsolicited event for HP jack sensing */ static void alc_sku_unsol_event(struct hda_codec *codec, unsigned int res) @@ -1062,14 +1058,12 @@ static void alc_subsystem_id(struct hda_codec *codec, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT); -#if 0 /* it's broken in some acses -- temporarily disabled */ if (spec->autocfg.input_pins[AUTO_PIN_MIC] && spec->autocfg.input_pins[AUTO_PIN_FRONT_MIC]) snd_hda_codec_write(codec, spec->autocfg.input_pins[AUTO_PIN_MIC], 0, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_MIC_EVENT); -#endif /* disabled */ spec->unsol_event = alc_sku_unsol_event; } @@ -8414,7 +8408,6 @@ static const char *alc883_models[ALC883_MODEL_LAST] = { static struct snd_pci_quirk alc883_cfg_tbl[] = { SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG), SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE), - SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE), SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE), SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE), SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE), @@ -12245,26 +12238,8 @@ static int alc269_auto_create_multi_out_ctls(struct alc_spec *spec, return 0; } -static int alc269_auto_create_analog_input_ctls(struct alc_spec *spec, - const struct auto_pin_cfg *cfg) -{ - int err; - - err = alc880_auto_create_analog_input_ctls(spec, cfg); - if (err < 0) - return err; - /* digital-mic input pin is excluded in alc880_auto_create..() - * because it's under 0x18 - */ - if (cfg->input_pins[AUTO_PIN_MIC] == 0x12 || - cfg->input_pins[AUTO_PIN_FRONT_MIC] == 0x12) { - struct hda_input_mux *imux = &spec->private_imux; - imux->items[imux->num_items].label = "Int Mic"; - imux->items[imux->num_items].index = 0x05; - imux->num_items++; - } - return 0; -} +#define alc269_auto_create_analog_input_ctls \ + alc880_auto_create_analog_input_ctls #ifdef CONFIG_SND_HDA_POWER_SAVE #define alc269_loopbacks alc880_loopbacks diff --git a/trunk/sound/pci/hda/patch_sigmatel.c b/trunk/sound/pci/hda/patch_sigmatel.c index e6085915d86d..df9b0bc7f878 100644 --- a/trunk/sound/pci/hda/patch_sigmatel.c +++ b/trunk/sound/pci/hda/patch_sigmatel.c @@ -69,7 +69,6 @@ enum { enum { STAC_92HD73XX_REF, STAC_DELL_M6, - STAC_DELL_EQ, STAC_92HD73XX_MODELS }; @@ -774,7 +773,9 @@ static struct hda_verb dell_eq_core_init[] = { }; static struct hda_verb dell_m6_core_init[] = { - { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, + /* set master volume to max value without distortion + * and direct control */ + { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec}, /* setup audio connections */ { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00}, { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01}, @@ -1599,13 +1600,11 @@ static unsigned int dell_m6_pin_configs[13] = { static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = { [STAC_92HD73XX_REF] = ref92hd73xx_pin_configs, [STAC_DELL_M6] = dell_m6_pin_configs, - [STAC_DELL_EQ] = dell_m6_pin_configs, }; static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { [STAC_92HD73XX_REF] = "ref", [STAC_DELL_M6] = "dell-m6", - [STAC_DELL_EQ] = "dell-eq", }; static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { @@ -4132,17 +4131,12 @@ static int patch_stac92hd73xx(struct hda_codec *codec) sizeof(stac92hd73xx_dmux)); switch (spec->board_config) { - case STAC_DELL_EQ: - spec->init = dell_eq_core_init; - /* fallthru */ case STAC_DELL_M6: + spec->init = dell_eq_core_init; spec->num_smuxes = 0; spec->mixer = &stac92hd73xx_6ch_mixer[DELL_M6_MIXER]; spec->amp_nids = &stac92hd73xx_amp_nids[DELL_M6_AMP]; spec->num_amps = 1; - - if (!spec->init) - spec->init = dell_m6_core_init; switch (codec->subsystem_id) { case 0x1028025e: /* Analog Mics */ case 0x1028025f: @@ -4152,6 +4146,8 @@ static int patch_stac92hd73xx(struct hda_codec *codec) break; case 0x10280271: /* Digital Mics */ case 0x10280272: + spec->init = dell_m6_core_init; + /* fall-through */ case 0x10280254: case 0x10280255: stac92xx_set_config_reg(codec, 0x13, 0x90A60160); diff --git a/trunk/sound/soc/soc-core.c b/trunk/sound/soc/soc-core.c index 16c7453f4946..a3adbf06b1e5 100644 --- a/trunk/sound/soc/soc-core.c +++ b/trunk/sound/soc/soc-core.c @@ -95,8 +95,8 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec) codec->ac97->dev.parent = NULL; codec->ac97->dev.release = soc_ac97_device_release; - dev_set_name(&codec->ac97->dev, "%d-%d:%s", - codec->card->number, 0, codec->name); + snprintf(codec->ac97->dev.bus_id, BUS_ID_SIZE, "%d-%d:%s", + codec->card->number, 0, codec->name); err = device_register(&codec->ac97->dev); if (err < 0) { snd_printk(KERN_ERR "Can't register ac97 bus\n");