From 35500f374961b121b69c3f342fad3c0e8a7b2fec Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 31 Oct 2008 19:50:41 +0000 Subject: [PATCH] --- yaml --- r: 118387 b: refs/heads/master c: c2c80529460095035752bf0ecc1af82c1e0f6e0f h: refs/heads/master i: 118385: 8c36f4fc6e05d1b8b5a74b95e524410f1f501280 118383: 1758958c556386588650d8a31af5b8395284c73b v: v3 --- [refs] | 2 +- trunk/Documentation/io-mapping.txt | 82 --------- trunk/arch/x86/Kconfig | 4 - trunk/arch/x86/include/asm/fixmap.h | 4 - trunk/arch/x86/include/asm/fixmap_32.h | 4 + trunk/arch/x86/include/asm/highmem.h | 5 +- trunk/arch/x86/mm/Makefile | 2 +- trunk/arch/x86/mm/init_32.c | 3 +- trunk/arch/x86/mm/iomap_32.c | 59 ------- trunk/drivers/gpu/drm/i915/Makefile | 3 +- trunk/drivers/gpu/drm/i915/i915_dma.c | 1 - trunk/drivers/gpu/drm/i915/i915_drv.h | 12 -- trunk/drivers/gpu/drm/i915/i915_gem.c | 196 +++++++++++----------- trunk/drivers/gpu/drm/radeon/radeon_cp.c | 15 +- trunk/drivers/gpu/drm/radeon/radeon_drv.h | 12 +- trunk/fs/proc/uptime.c | 38 ++--- trunk/include/asm-x86/iomap.h | 30 ---- trunk/include/drm/i915_drm.h | 13 -- trunk/include/linux/io-mapping.h | 125 -------------- trunk/kernel/trace/Kconfig | 2 +- trunk/kernel/trace/trace.c | 2 + trunk/sound/aoa/soundbus/core.c | 2 +- trunk/sound/core/rawmidi.c | 8 - trunk/sound/drivers/ml403-ac97cr.c | 4 +- trunk/sound/drivers/pcsp/pcsp_input.c | 4 +- trunk/sound/isa/ad1848/ad1848.c | 6 +- trunk/sound/isa/adlib.c | 12 +- trunk/sound/isa/cs423x/cs4231.c | 8 +- trunk/sound/isa/cs423x/cs4236.c | 8 +- trunk/sound/isa/es1688/es1688.c | 9 +- trunk/sound/isa/gus/gusclassic.c | 13 +- trunk/sound/isa/gus/gusextreme.c | 19 ++- trunk/sound/isa/sb/sb8.c | 4 +- trunk/sound/pci/emu10k1/emu10k1_main.c | 3 - trunk/sound/pci/hda/patch_realtek.c | 29 +--- trunk/sound/pci/hda/patch_sigmatel.c | 16 +- trunk/sound/soc/soc-core.c | 4 +- 37 files changed, 201 insertions(+), 562 deletions(-) delete mode 100644 trunk/Documentation/io-mapping.txt delete mode 100644 trunk/arch/x86/mm/iomap_32.c delete mode 100644 trunk/include/asm-x86/iomap.h delete mode 100644 trunk/include/linux/io-mapping.h diff --git a/[refs] b/[refs] index 8126289c08d9..0a14cdde5b12 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: da4a22cba7cb2d922691214aed6b1977f04efaff +refs/heads/master: c2c80529460095035752bf0ecc1af82c1e0f6e0f 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/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/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 b58f43bec363..33dbefd471e8 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 + select STACKTRACE if STACKTRACE_SUPPORT select TRACEPOINTS select NOP_TRACER diff --git a/trunk/kernel/trace/trace.c b/trunk/kernel/trace/trace.c index 8a499e2adaec..85bee775a03e 100644 --- a/trunk/kernel/trace/trace.c +++ b/trunk/kernel/trace/trace.c @@ -705,6 +705,7 @@ 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; @@ -730,6 +731,7 @@ 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, 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");