From a3ac300c16ba504d61fceb723b0e7a3953e033ad Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 30 Jun 2009 14:02:00 -0700 Subject: [PATCH] --- yaml --- r: 154608 b: refs/heads/master c: 2be8412c6cef97b01dfaae71c04bf585d3d93a3b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/cgroups/cpusets.txt | 12 -- trunk/Documentation/gcov.txt | 25 ++-- trunk/Documentation/spi/spidev_test.c | 10 +- trunk/MAINTAINERS | 8 +- trunk/arch/alpha/include/asm/percpu.h | 6 +- trunk/arch/frv/include/asm/unistd.h | 4 +- trunk/arch/frv/kernel/entry.S | 2 - trunk/arch/ia64/sn/kernel/io_common.c | 3 +- trunk/arch/mn10300/include/asm/unistd.h | 4 +- trunk/arch/mn10300/kernel/entry.S | 2 - trunk/arch/x86/mm/init_64.c | 2 - trunk/drivers/block/floppy.c | 5 +- trunk/drivers/edac/edac_core.h | 4 - trunk/drivers/edac/edac_mc_sysfs.c | 4 +- trunk/drivers/edac/mpc85xx_edac.c | 6 - trunk/drivers/edac/mpc85xx_edac.h | 1 - trunk/drivers/gpio/pl061.c | 20 +-- trunk/drivers/lguest/lg.h | 2 +- trunk/drivers/lguest/lguest_user.c | 4 +- trunk/drivers/mmc/host/mmc_spi.c | 6 - trunk/drivers/parport/parport_pc.c | 5 +- trunk/drivers/rtc/rtc-bfin.c | 30 ++--- trunk/drivers/serial/8250_pci.c | 6 - trunk/drivers/spi/omap_uwire.c | 2 - trunk/drivers/spi/spi_bitbang.c | 24 ++-- trunk/drivers/spi/spidev.c | 17 +-- trunk/drivers/video/atafb.c | 7 +- trunk/drivers/video/atmel_lcdfb.c | 2 - trunk/drivers/video/aty/atyfb.h | 3 - trunk/drivers/video/aty/atyfb_base.c | 141 +++----------------- trunk/drivers/video/aty/mach64_accel.c | 7 +- trunk/drivers/video/fbmem.c | 13 +- trunk/drivers/video/fsl-diu-fb.c | 14 +- trunk/drivers/video/i810/i810_main.c | 2 - trunk/drivers/video/matrox/matroxfb_base.c | 3 - trunk/drivers/video/matrox/matroxfb_crtc2.c | 5 +- trunk/drivers/video/mx3fb.c | 17 +-- trunk/drivers/video/omap/omapfb_main.c | 4 - trunk/drivers/video/platinumfb.c | 2 - trunk/drivers/video/pxafb.c | 2 - trunk/drivers/video/sh7760fb.c | 19 ++- trunk/drivers/video/sis/sis_main.c | 2 - trunk/drivers/video/sm501fb.c | 21 ++- trunk/drivers/video/w100fb.c | 2 - trunk/fs/afs/flock.c | 1 + trunk/fs/aio.c | 24 +++- trunk/fs/binfmt_elf.c | 5 +- trunk/fs/eventfd.c | 122 ++--------------- trunk/fs/ext2/namei.c | 12 +- trunk/fs/hostfs/hostfs_kern.c | 1 - trunk/include/asm-generic/percpu.h | 4 - trunk/include/asm-generic/vmlinux.lds.h | 3 +- trunk/include/linux/aio.h | 4 +- trunk/include/linux/eventfd.h | 35 ++--- trunk/include/linux/fb.h | 1 - trunk/include/linux/pci_ids.h | 1 - trunk/include/linux/percpu-defs.h | 3 +- trunk/include/linux/sched.h | 16 +-- trunk/include/linux/spi/spi.h | 6 - trunk/include/linux/spi/spidev.h | 2 - trunk/kernel/acct.c | 6 +- trunk/kernel/resource.c | 2 +- trunk/mm/dmapool.c | 2 - trunk/mm/page-writeback.c | 5 +- trunk/mm/page_alloc.c | 13 +- trunk/scripts/pnmtologo.c | 4 +- 67 files changed, 187 insertions(+), 567 deletions(-) diff --git a/[refs] b/[refs] index 06401a27ee7b..f127c83ec448 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6086071005674eb982d898c75269c931240154cf +refs/heads/master: 2be8412c6cef97b01dfaae71c04bf585d3d93a3b diff --git a/trunk/Documentation/cgroups/cpusets.txt b/trunk/Documentation/cgroups/cpusets.txt index 1d7e9784439a..f9ca389dddf4 100644 --- a/trunk/Documentation/cgroups/cpusets.txt +++ b/trunk/Documentation/cgroups/cpusets.txt @@ -777,18 +777,6 @@ in cpuset directories: # /bin/echo 1-4 > cpus -> set cpus list to cpus 1,2,3,4 # /bin/echo 1,2,3,4 > cpus -> set cpus list to cpus 1,2,3,4 -To add a CPU to a cpuset, write the new list of CPUs including the -CPU to be added. To add 6 to the above cpuset: - -# /bin/echo 1-4,6 > cpus -> set cpus list to cpus 1,2,3,4,6 - -Similarly to remove a CPU from a cpuset, write the new list of CPUs -without the CPU to be removed. - -To remove all the CPUs: - -# /bin/echo "" > cpus -> clear cpus list - 2.3 Setting flags ----------------- diff --git a/trunk/Documentation/gcov.txt b/trunk/Documentation/gcov.txt index 40ec63352760..e716aadb3a33 100644 --- a/trunk/Documentation/gcov.txt +++ b/trunk/Documentation/gcov.txt @@ -188,18 +188,13 @@ Solution: Exclude affected source files from profiling by specifying GCOV_PROFILE := n or GCOV_PROFILE_basename.o := n in the corresponding Makefile. -Problem: Files copied from sysfs appear empty or incomplete. -Cause: Due to the way seq_file works, some tools such as cp or tar - may not correctly copy files from sysfs. -Solution: Use 'cat' to read .gcda files and 'cp -d' to copy links. - Alternatively use the mechanism shown in Appendix B. - Appendix A: gather_on_build.sh ============================== Sample script to gather coverage meta files on the build machine (see 6a): + #!/bin/bash KSRC=$1 @@ -231,7 +226,7 @@ Appendix B: gather_on_test.sh Sample script to gather coverage data files on the test machine (see 6b): -#!/bin/bash -e +#!/bin/bash DEST=$1 GCDA=/sys/kernel/debug/gcov @@ -241,13 +236,11 @@ if [ -z "$DEST" ] ; then exit 1 fi -TEMPDIR=$(mktemp -d) -echo Collecting data.. -find $GCDA -type d -exec mkdir -p $TEMPDIR/\{\} \; -find $GCDA -name '*.gcda' -exec sh -c 'cat < $0 > '$TEMPDIR'/$0' {} \; -find $GCDA -name '*.gcno' -exec sh -c 'cp -d $0 '$TEMPDIR'/$0' {} \; -tar czf $DEST -C $TEMPDIR sys -rm -rf $TEMPDIR +find $GCDA -name '*.gcno' -o -name '*.gcda' | tar cfz $DEST -T - -echo "$DEST successfully created, copy to build system and unpack with:" -echo " tar xfz $DEST" +if [ $? -eq 0 ] ; then + echo "$DEST successfully created, copy to build system and unpack with:" + echo " tar xfz $DEST" +else + echo "Could not create file $DEST" +fi diff --git a/trunk/Documentation/spi/spidev_test.c b/trunk/Documentation/spi/spidev_test.c index c1a5aad3c75a..cf0e3ce0d526 100644 --- a/trunk/Documentation/spi/spidev_test.c +++ b/trunk/Documentation/spi/spidev_test.c @@ -99,13 +99,11 @@ void parse_opts(int argc, char *argv[]) { "lsb", 0, 0, 'L' }, { "cs-high", 0, 0, 'C' }, { "3wire", 0, 0, '3' }, - { "no-cs", 0, 0, 'N' }, - { "ready", 0, 0, 'R' }, { NULL, 0, 0, 0 }, }; int c; - c = getopt_long(argc, argv, "D:s:d:b:lHOLC3NR", lopts, NULL); + c = getopt_long(argc, argv, "D:s:d:b:lHOLC3", lopts, NULL); if (c == -1) break; @@ -141,12 +139,6 @@ void parse_opts(int argc, char *argv[]) case '3': mode |= SPI_3WIRE; break; - case 'N': - mode |= SPI_NO_CS; - break; - case 'R': - mode |= SPI_READY; - break; default: print_usage(argv[0]); break; diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 6a89e312a7b4..05a9a563042f 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -2130,9 +2130,9 @@ F: drivers/edac/i5400_edac.c EDAC-I82975X P: Ranganathan Desikan -M: ravi@jetztechnologies.com +M: rdesikan@jetzbroadband.com P: Arvind R. -M: arvind@jetztechnologies.com +M: arvind@acarlab.com L: bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers) W: bluesmoke.sourceforge.net S: Maintained @@ -5576,8 +5576,8 @@ F: drivers/staging/ STARFIRE/DURALAN NETWORK DRIVER P: Ion Badulescu -M: ionut@badula.org -S: Odd Fixes +M: ionut@cs.columbia.edu +S: Maintained F: drivers/net/starfire* STARMODE RADIO IP (STRIP) PROTOCOL DRIVER diff --git a/trunk/arch/alpha/include/asm/percpu.h b/trunk/arch/alpha/include/asm/percpu.h index b663f1f10b6a..06c5c7a4afd3 100644 --- a/trunk/arch/alpha/include/asm/percpu.h +++ b/trunk/arch/alpha/include/asm/percpu.h @@ -30,7 +30,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; #ifndef MODULE #define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset)) -#define PER_CPU_DEF_ATTRIBUTES +#define PER_CPU_ATTRIBUTES #else /* * To calculate addresses of locally defined variables, GCC uses 32-bit @@ -49,7 +49,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; : "=&r"(__ptr), "=&r"(tmp_gp)); \ (typeof(&per_cpu_var(var)))(__ptr + (offset)); }) -#define PER_CPU_DEF_ATTRIBUTES __used +#define PER_CPU_ATTRIBUTES __used #endif /* MODULE */ @@ -71,7 +71,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; #define __get_cpu_var(var) per_cpu_var(var) #define __raw_get_cpu_var(var) per_cpu_var(var) -#define PER_CPU_DEF_ATTRIBUTES +#define PER_CPU_ATTRIBUTES #endif /* SMP */ diff --git a/trunk/arch/frv/include/asm/unistd.h b/trunk/arch/frv/include/asm/unistd.h index 4a8fb427ce0a..96d78d5d2c41 100644 --- a/trunk/arch/frv/include/asm/unistd.h +++ b/trunk/arch/frv/include/asm/unistd.h @@ -341,12 +341,10 @@ #define __NR_inotify_init1 332 #define __NR_preadv 333 #define __NR_pwritev 334 -#define __NR_rt_tgsigqueueinfo 335 -#define __NR_perf_counter_open 336 #ifdef __KERNEL__ -#define NR_syscalls 337 +#define NR_syscalls 335 #define __ARCH_WANT_IPC_PARSE_VERSION /* #define __ARCH_WANT_OLD_READDIR */ diff --git a/trunk/arch/frv/kernel/entry.S b/trunk/arch/frv/kernel/entry.S index fde1e446b440..356e0e327a89 100644 --- a/trunk/arch/frv/kernel/entry.S +++ b/trunk/arch/frv/kernel/entry.S @@ -1524,7 +1524,5 @@ sys_call_table: .long sys_inotify_init1 .long sys_preadv .long sys_pwritev - .long sys_rt_tgsigqueueinfo /* 335 */ - .long sys_perf_counter_open syscall_table_size = (. - sys_call_table) diff --git a/trunk/arch/ia64/sn/kernel/io_common.c b/trunk/arch/ia64/sn/kernel/io_common.c index 76645cf6ac5d..25831c47c579 100644 --- a/trunk/arch/ia64/sn/kernel/io_common.c +++ b/trunk/arch/ia64/sn/kernel/io_common.c @@ -435,7 +435,8 @@ void sn_generate_path(struct pci_bus *pci_bus, char *address) bricktype = MODULE_GET_BTYPE(moduleid); if ((bricktype == L1_BRICKTYPE_191010) || (bricktype == L1_BRICKTYPE_1932)) - sprintf(address, "%s^%d", address, geo_slot(geoid)); + sprintf(address + strlen(address), "^%d", + geo_slot(geoid)); } void __devinit diff --git a/trunk/arch/mn10300/include/asm/unistd.h b/trunk/arch/mn10300/include/asm/unistd.h index fad68616af32..fef5b434dadc 100644 --- a/trunk/arch/mn10300/include/asm/unistd.h +++ b/trunk/arch/mn10300/include/asm/unistd.h @@ -346,12 +346,10 @@ #define __NR_inotify_init1 333 #define __NR_preadv 334 #define __NR_pwritev 335 -#define __NR_rt_tgsigqueueinfo 336 -#define __NR_perf_counter_open 337 #ifdef __KERNEL__ -#define NR_syscalls 338 +#define NR_syscalls 326 /* * specify the deprecated syscalls we want to support on this arch diff --git a/trunk/arch/mn10300/kernel/entry.S b/trunk/arch/mn10300/kernel/entry.S index e0d2563af4f2..7408a27199f3 100644 --- a/trunk/arch/mn10300/kernel/entry.S +++ b/trunk/arch/mn10300/kernel/entry.S @@ -722,8 +722,6 @@ ENTRY(sys_call_table) .long sys_inotify_init1 .long sys_preadv .long sys_pwritev /* 335 */ - .long sys_rt_tgsigqueueinfo - .long sys_perf_counter_open nr_syscalls=(.-sys_call_table)/4 diff --git a/trunk/arch/x86/mm/init_64.c b/trunk/arch/x86/mm/init_64.c index b177652251a4..c4378f4fd4a5 100644 --- a/trunk/arch/x86/mm/init_64.c +++ b/trunk/arch/x86/mm/init_64.c @@ -598,8 +598,6 @@ void __init paging_init(void) sparse_memory_present_with_active_regions(MAX_NUMNODES); sparse_init(); - /* clear the default setting with node 0 */ - nodes_clear(node_states[N_NORMAL_MEMORY]); free_area_init_nodes(max_zone_pfns); } diff --git a/trunk/drivers/block/floppy.c b/trunk/drivers/block/floppy.c index 91b753013780..862b40c90181 100644 --- a/trunk/drivers/block/floppy.c +++ b/trunk/drivers/block/floppy.c @@ -3327,10 +3327,7 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g, if (!capable(CAP_SYS_ADMIN)) return -EPERM; mutex_lock(&open_lock); - if (lock_fdc(drive, 1)) { - mutex_unlock(&open_lock); - return -EINTR; - } + LOCK_FDC(drive, 1); floppy_type[type] = *g; floppy_type[type].name = "user format"; for (cnt = type << 2; cnt < (type << 2) + 4; cnt++) diff --git a/trunk/drivers/edac/edac_core.h b/trunk/drivers/edac/edac_core.h index 871c13b4c148..3493c6bdb820 100644 --- a/trunk/drivers/edac/edac_core.h +++ b/trunk/drivers/edac/edac_core.h @@ -150,8 +150,6 @@ enum mem_type { MEM_FB_DDR2, /* fully buffered DDR2 */ MEM_RDDR2, /* Registered DDR2 RAM */ MEM_XDR, /* Rambus XDR */ - MEM_DDR3, /* DDR3 RAM */ - MEM_RDDR3, /* Registered DDR3 RAM */ }; #define MEM_FLAG_EMPTY BIT(MEM_EMPTY) @@ -169,8 +167,6 @@ enum mem_type { #define MEM_FLAG_FB_DDR2 BIT(MEM_FB_DDR2) #define MEM_FLAG_RDDR2 BIT(MEM_RDDR2) #define MEM_FLAG_XDR BIT(MEM_XDR) -#define MEM_FLAG_DDR3 BIT(MEM_DDR3) -#define MEM_FLAG_RDDR3 BIT(MEM_RDDR3) /* chipset Error Detection and Correction capabilities and mode */ enum edac_type { diff --git a/trunk/drivers/edac/edac_mc_sysfs.c b/trunk/drivers/edac/edac_mc_sysfs.c index e1d4ce083481..ad218fe4942d 100644 --- a/trunk/drivers/edac/edac_mc_sysfs.c +++ b/trunk/drivers/edac/edac_mc_sysfs.c @@ -94,9 +94,7 @@ static const char *mem_types[] = { [MEM_DDR2] = "Unbuffered-DDR2", [MEM_FB_DDR2] = "FullyBuffered-DDR2", [MEM_RDDR2] = "Registered-DDR2", - [MEM_XDR] = "XDR", - [MEM_DDR3] = "Unbuffered-DDR3", - [MEM_RDDR3] = "Registered-DDR3" + [MEM_XDR] = "XDR" }; static const char *dev_types[] = { diff --git a/trunk/drivers/edac/mpc85xx_edac.c b/trunk/drivers/edac/mpc85xx_edac.c index 3f2ccfc6407c..7c8c2d72916f 100644 --- a/trunk/drivers/edac/mpc85xx_edac.c +++ b/trunk/drivers/edac/mpc85xx_edac.c @@ -757,9 +757,6 @@ static void __devinit mpc85xx_init_csrows(struct mem_ctl_info *mci) case DSC_SDTYPE_DDR2: mtype = MEM_RDDR2; break; - case DSC_SDTYPE_DDR3: - mtype = MEM_RDDR3; - break; default: mtype = MEM_UNKNOWN; break; @@ -772,9 +769,6 @@ static void __devinit mpc85xx_init_csrows(struct mem_ctl_info *mci) case DSC_SDTYPE_DDR2: mtype = MEM_DDR2; break; - case DSC_SDTYPE_DDR3: - mtype = MEM_DDR3; - break; default: mtype = MEM_UNKNOWN; break; diff --git a/trunk/drivers/edac/mpc85xx_edac.h b/trunk/drivers/edac/mpc85xx_edac.h index 52432ee7c4b9..135b3539a030 100644 --- a/trunk/drivers/edac/mpc85xx_edac.h +++ b/trunk/drivers/edac/mpc85xx_edac.h @@ -53,7 +53,6 @@ #define DSC_SDTYPE_DDR 0x02000000 #define DSC_SDTYPE_DDR2 0x03000000 -#define DSC_SDTYPE_DDR3 0x07000000 #define DSC_X32_EN 0x00000020 /* Err_Int_En */ diff --git a/trunk/drivers/gpio/pl061.c b/trunk/drivers/gpio/pl061.c index 4ee4c8367a3f..aa8e7cb020d9 100644 --- a/trunk/drivers/gpio/pl061.c +++ b/trunk/drivers/gpio/pl061.c @@ -109,16 +109,6 @@ static void pl061_set_value(struct gpio_chip *gc, unsigned offset, int value) writeb(!!value << offset, chip->base + (1 << (offset + 2))); } -static int pl061_to_irq(struct gpio_chip *gc, unsigned offset) -{ - struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc); - - if (chip->irq_base == (unsigned) -1) - return -EINVAL; - - return chip->irq_base + offset; -} - /* * PL061 GPIO IRQ */ @@ -210,7 +200,7 @@ static void pl061_irq_handler(unsigned irq, struct irq_desc *desc) desc->chip->ack(irq); list_for_each(ptr, chip_list) { unsigned long pending; - int offset; + int gpio; chip = list_entry(ptr, struct pl061_gpio, list); pending = readb(chip->base + GPIOMIS); @@ -219,8 +209,8 @@ static void pl061_irq_handler(unsigned irq, struct irq_desc *desc) if (pending == 0) continue; - for_each_bit(offset, &pending, PL061_GPIO_NR) - generic_handle_irq(pl061_to_irq(&chip->gc, offset)); + for_each_bit(gpio, &pending, PL061_GPIO_NR) + generic_handle_irq(gpio_to_irq(gpio)); } desc->chip->unmask(irq); } @@ -231,7 +221,7 @@ static int __init pl061_probe(struct amba_device *dev, struct amba_id *id) struct pl061_gpio *chip; struct list_head *chip_list; int ret, irq, i; - static DECLARE_BITMAP(init_irq, NR_IRQS); + static unsigned long init_irq[BITS_TO_LONGS(NR_IRQS)]; pdata = dev->dev.platform_data; if (pdata == NULL) @@ -261,7 +251,6 @@ static int __init pl061_probe(struct amba_device *dev, struct amba_id *id) chip->gc.direction_output = pl061_direction_output; chip->gc.get = pl061_get_value; chip->gc.set = pl061_set_value; - chip->gc.to_irq = pl061_to_irq; chip->gc.base = pdata->gpio_base; chip->gc.ngpio = PL061_GPIO_NR; chip->gc.label = dev_name(&dev->dev); @@ -291,7 +280,6 @@ static int __init pl061_probe(struct amba_device *dev, struct amba_id *id) if (!test_and_set_bit(irq, init_irq)) { /* list initialized? */ chip_list = kmalloc(sizeof(*chip_list), GFP_KERNEL); if (chip_list == NULL) { - clear_bit(irq, init_irq); ret = -ENOMEM; goto iounmap; } diff --git a/trunk/drivers/lguest/lg.h b/trunk/drivers/lguest/lg.h index 9c3138265f8e..d4e8979735cb 100644 --- a/trunk/drivers/lguest/lg.h +++ b/trunk/drivers/lguest/lg.h @@ -82,7 +82,7 @@ struct lg_cpu { struct lg_eventfd { unsigned long addr; - struct eventfd_ctx *event; + struct file *event; }; struct lg_eventfd_map { diff --git a/trunk/drivers/lguest/lguest_user.c b/trunk/drivers/lguest/lguest_user.c index 9f9a2953b383..32e297121058 100644 --- a/trunk/drivers/lguest/lguest_user.c +++ b/trunk/drivers/lguest/lguest_user.c @@ -50,7 +50,7 @@ static int add_eventfd(struct lguest *lg, unsigned long addr, int fd) /* Now append new entry. */ new->map[new->num].addr = addr; - new->map[new->num].event = eventfd_ctx_fdget(fd); + new->map[new->num].event = eventfd_fget(fd); if (IS_ERR(new->map[new->num].event)) { kfree(new); return PTR_ERR(new->map[new->num].event); @@ -357,7 +357,7 @@ static int close(struct inode *inode, struct file *file) /* Release any eventfds they registered. */ for (i = 0; i < lg->eventfds->num; i++) - eventfd_ctx_put(lg->eventfds->map[i].event); + fput(lg->eventfds->map[i].event); kfree(lg->eventfds); /* If lg->dead doesn't contain an error code it will be NULL or a diff --git a/trunk/drivers/mmc/host/mmc_spi.c b/trunk/drivers/mmc/host/mmc_spi.c index a461017ce5ce..240608cc7ae9 100644 --- a/trunk/drivers/mmc/host/mmc_spi.c +++ b/trunk/drivers/mmc/host/mmc_spi.c @@ -1313,12 +1313,6 @@ static int mmc_spi_probe(struct spi_device *spi) struct mmc_spi_host *host; int status; - /* We rely on full duplex transfers, mostly to reduce - * per-transfer overheads (by making fewer transfers). - */ - if (spi->master->flags & SPI_MASTER_HALF_DUPLEX) - return -EINVAL; - /* MMC and SD specs only seem to care that sampling is on the * rising edge ... meaning SPI modes 0 or 3. So either SPI mode * should be legit. We'll use mode 0 since the steady state is 0, diff --git a/trunk/drivers/parport/parport_pc.c b/trunk/drivers/parport/parport_pc.c index 2597145a066e..1032d5fdbd42 100644 --- a/trunk/drivers/parport/parport_pc.c +++ b/trunk/drivers/parport/parport_pc.c @@ -2907,7 +2907,6 @@ enum parport_pc_pci_cards { netmos_9755, netmos_9805, netmos_9815, - netmos_9901, quatech_sppxp100, }; @@ -2988,7 +2987,7 @@ static struct parport_pc_pci { /* netmos_9755 */ { 2, { { 0, 1 }, { 2, 3 },} }, /* netmos_9805 */ { 1, { { 0, -1 }, } }, /* netmos_9815 */ { 2, { { 0, -1 }, { 2, -1 }, } }, - /* netmos_9901 */ { 1, { { 0, -1 }, } }, + /* quatech_sppxp100 */ { 1, { { 0, 1 }, } }, }; @@ -3090,8 +3089,6 @@ static const struct pci_device_id parport_pc_pci_tbl[] = { PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9805 }, { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9815, PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9815 }, - { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901, - 0xA000, 0x2000, 0, 0, netmos_9901 }, /* Quatech SPPXP-100 Parallel port PCI ExpressCard */ { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SPPXP_100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 }, diff --git a/trunk/drivers/rtc/rtc-bfin.c b/trunk/drivers/rtc/rtc-bfin.c index a118eb0f1e67..aafd3e6ebb0d 100644 --- a/trunk/drivers/rtc/rtc-bfin.c +++ b/trunk/drivers/rtc/rtc-bfin.c @@ -1,8 +1,8 @@ /* * Blackfin On-Chip Real Time Clock Driver - * Supports BF51x/BF52x/BF53[123]/BF53[467]/BF54x + * Supports BF52[257]/BF53[123]/BF53[467]/BF54[24789] * - * Copyright 2004-2009 Analog Devices Inc. + * Copyright 2004-2008 Analog Devices Inc. * * Enter bugs at http://blackfin.uclinux.org/ * @@ -363,7 +363,7 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev) struct bfin_rtc *rtc; struct device *dev = &pdev->dev; int ret = 0; - unsigned long timeout = jiffies + HZ; + unsigned long timeout; dev_dbg_stamp(dev); @@ -374,32 +374,32 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, rtc); device_init_wakeup(dev, 1); - /* Register our RTC with the RTC framework */ - rtc->rtc_dev = rtc_device_register(pdev->name, dev, &bfin_rtc_ops, - THIS_MODULE); - if (unlikely(IS_ERR(rtc->rtc_dev))) { - ret = PTR_ERR(rtc->rtc_dev); - goto err; - } - /* Grab the IRQ and init the hardware */ ret = request_irq(IRQ_RTC, bfin_rtc_interrupt, IRQF_SHARED, pdev->name, dev); if (unlikely(ret)) - goto err_reg; + goto err; /* sometimes the bootloader touched things, but the write complete was not * enabled, so let's just do a quick timeout here since the IRQ will not fire ... */ + timeout = jiffies + HZ; while (bfin_read_RTC_ISTAT() & RTC_ISTAT_WRITE_PENDING) if (time_after(jiffies, timeout)) break; bfin_rtc_reset(dev, RTC_ISTAT_WRITE_COMPLETE); bfin_write_RTC_SWCNT(0); + /* Register our RTC with the RTC framework */ + rtc->rtc_dev = rtc_device_register(pdev->name, dev, &bfin_rtc_ops, THIS_MODULE); + if (unlikely(IS_ERR(rtc->rtc_dev))) { + ret = PTR_ERR(rtc->rtc_dev); + goto err_irq; + } + return 0; -err_reg: - rtc_device_unregister(rtc->rtc_dev); -err: + err_irq: + free_irq(IRQ_RTC, dev); + err: kfree(rtc); return ret; } diff --git a/trunk/drivers/serial/8250_pci.c b/trunk/drivers/serial/8250_pci.c index 6160e03f410c..a07015d646dd 100644 --- a/trunk/drivers/serial/8250_pci.c +++ b/trunk/drivers/serial/8250_pci.c @@ -759,8 +759,6 @@ static int pci_netmos_init(struct pci_dev *dev) /* subdevice 0x00PS means

parallel, serial */ unsigned int num_serial = dev->subsystem_device & 0xf; - if (dev->device == PCI_DEVICE_ID_NETMOS_9901) - return 0; if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM && dev->subsystem_device == 0x0299) return 0; @@ -3559,10 +3557,6 @@ static struct pci_device_id serial_pci_tbl[] = { PCI_VENDOR_ID_IBM, 0x0299, 0, 0, pbn_b0_bt_2_115200 }, - { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901, - 0xA000, 0x1000, - 0, 0, pbn_b0_1_115200 }, - /* * These entries match devices with class COMMUNICATION_SERIAL, * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL diff --git a/trunk/drivers/spi/omap_uwire.c b/trunk/drivers/spi/omap_uwire.c index 8980a5640bd9..aa90ddb37066 100644 --- a/trunk/drivers/spi/omap_uwire.c +++ b/trunk/drivers/spi/omap_uwire.c @@ -514,8 +514,6 @@ static int __init uwire_probe(struct platform_device *pdev) /* the spi->mode bits understood by this driver: */ master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; - master->flags = SPI_MASTER_HALF_DUPLEX; - master->bus_num = 2; /* "official" */ master->num_chipselect = 4; master->setup = uwire_setup; diff --git a/trunk/drivers/spi/spi_bitbang.c b/trunk/drivers/spi/spi_bitbang.c index f1db395dd889..2a5abc08e857 100644 --- a/trunk/drivers/spi/spi_bitbang.c +++ b/trunk/drivers/spi/spi_bitbang.c @@ -258,11 +258,6 @@ static void bitbang_work(struct work_struct *work) struct spi_bitbang *bitbang = container_of(work, struct spi_bitbang, work); unsigned long flags; - int do_setup = -1; - int (*setup_transfer)(struct spi_device *, - struct spi_transfer *); - - setup_transfer = bitbang->setup_transfer; spin_lock_irqsave(&bitbang->lock, flags); bitbang->busy = 1; @@ -274,6 +269,8 @@ static void bitbang_work(struct work_struct *work) unsigned tmp; unsigned cs_change; int status; + int (*setup_transfer)(struct spi_device *, + struct spi_transfer *); m = container_of(bitbang->queue.next, struct spi_message, queue); @@ -290,19 +287,19 @@ static void bitbang_work(struct work_struct *work) tmp = 0; cs_change = 1; status = 0; + setup_transfer = NULL; list_for_each_entry (t, &m->transfers, transfer_list) { - /* override speed or wordsize? */ - if (t->speed_hz || t->bits_per_word) - do_setup = 1; - - /* init (-1) or override (1) transfer params */ - if (do_setup != 0) { + /* override or restore speed and wordsize */ + if (t->speed_hz || t->bits_per_word) { + setup_transfer = bitbang->setup_transfer; if (!setup_transfer) { status = -ENOPROTOOPT; break; } + } + if (setup_transfer) { status = setup_transfer(spi, t); if (status < 0) break; @@ -366,10 +363,9 @@ static void bitbang_work(struct work_struct *work) m->status = status; m->complete(m->context); - /* restore speed and wordsize if it was overridden */ - if (do_setup == 1) + /* restore speed and wordsize */ + if (setup_transfer) setup_transfer(spi, NULL); - do_setup = 0; /* normally deactivate chipselect ... unless no error and * cs_change has hinted that the next message will probably diff --git a/trunk/drivers/spi/spidev.c b/trunk/drivers/spi/spidev.c index 606e7a40a8da..5d869c4d3eb2 100644 --- a/trunk/drivers/spi/spidev.c +++ b/trunk/drivers/spi/spidev.c @@ -58,20 +58,15 @@ static unsigned long minors[N_SPI_MINORS / BITS_PER_LONG]; /* Bit masks for spi_device.mode management. Note that incorrect - * settings for some settings can cause *lots* of trouble for other - * devices on a shared bus: + * settings for CS_HIGH and 3WIRE can cause *lots* of trouble for other + * devices on a shared bus: CS_HIGH, because this device will be + * active when it shouldn't be; 3WIRE, because when active it won't + * behave as it should. * - * - CS_HIGH ... this device will be active when it shouldn't be - * - 3WIRE ... when active, it won't behave as it should - * - NO_CS ... there will be no explicit message boundaries; this - * is completely incompatible with the shared bus model - * - READY ... transfers may proceed when they shouldn't. - * - * REVISIT should changing those flags be privileged? + * REVISIT should changing those two modes be privileged? */ #define SPI_MODE_MASK (SPI_CPHA | SPI_CPOL | SPI_CS_HIGH \ - | SPI_LSB_FIRST | SPI_3WIRE | SPI_LOOP \ - | SPI_NO_CS | SPI_READY) + | SPI_LSB_FIRST | SPI_3WIRE | SPI_LOOP) struct spidev_data { dev_t devt; diff --git a/trunk/drivers/video/atafb.c b/trunk/drivers/video/atafb.c index 497ff8af03ed..018850c116c6 100644 --- a/trunk/drivers/video/atafb.c +++ b/trunk/drivers/video/atafb.c @@ -2414,10 +2414,7 @@ static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) if (err) return err; memset(fix, 0, sizeof(struct fb_fix_screeninfo)); - mutex_lock(&info->mm_lock); - err = fbhw->encode_fix(fix, &par); - mutex_unlock(&info->mm_lock); - return err; + return fbhw->encode_fix(fix, &par); } static int atafb_get_var(struct fb_var_screeninfo *var, struct fb_info *info) @@ -2746,9 +2743,7 @@ static int atafb_set_par(struct fb_info *info) /* Decode wanted screen parameters */ fbhw->decode_var(&info->var, par); - mutex_lock(&info->mm_lock); fbhw->encode_fix(&info->fix, par); - mutex_unlock(&info->mm_lock); /* Set new videomode */ ata_set_par(par); diff --git a/trunk/drivers/video/atmel_lcdfb.c b/trunk/drivers/video/atmel_lcdfb.c index cb88394ba995..5afd64482f55 100644 --- a/trunk/drivers/video/atmel_lcdfb.c +++ b/trunk/drivers/video/atmel_lcdfb.c @@ -270,9 +270,7 @@ static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo) smem_len = (var->xres_virtual * var->yres_virtual * ((var->bits_per_pixel + 7) / 8)); - mutex_lock(&info->mm_lock); info->fix.smem_len = max(smem_len, sinfo->smem_len); - mutex_unlock(&info->mm_lock); info->screen_base = dma_alloc_writecombine(info->device, info->fix.smem_len, (dma_addr_t *)&info->fix.smem_start, GFP_KERNEL); diff --git a/trunk/drivers/video/aty/atyfb.h b/trunk/drivers/video/aty/atyfb.h index 1f39a62f899b..7691e73823d3 100644 --- a/trunk/drivers/video/aty/atyfb.h +++ b/trunk/drivers/video/aty/atyfb.h @@ -187,8 +187,6 @@ struct atyfb_par { int mtrr_reg; #endif u32 mem_cntl; - struct crtc saved_crtc; - union aty_pll saved_pll; }; /* @@ -219,7 +217,6 @@ struct atyfb_par { #define M64F_XL_DLL 0x00080000 #define M64F_MFB_FORCE_4 0x00100000 #define M64F_HW_TRIPLE 0x00200000 -#define M64F_XL_MEM 0x00400000 /* * Register access */ diff --git a/trunk/drivers/video/aty/atyfb_base.c b/trunk/drivers/video/aty/atyfb_base.c index 63d3739d43a8..1207c208a30b 100644 --- a/trunk/drivers/video/aty/atyfb_base.c +++ b/trunk/drivers/video/aty/atyfb_base.c @@ -66,8 +66,6 @@ #include #include #include -#include -#include #include #include @@ -251,6 +249,8 @@ static int aty_init(struct fb_info *info); static int store_video_par(char *videopar, unsigned char m64_num); #endif +static struct crtc saved_crtc; +static union aty_pll saved_pll; static void aty_get_crtc(const struct atyfb_par *par, struct crtc *crtc); static void aty_set_crtc(const struct atyfb_par *par, const struct crtc *crtc); @@ -261,8 +261,6 @@ static void set_off_pitch(struct atyfb_par *par, const struct fb_info *info); static int read_aty_sense(const struct atyfb_par *par); #endif -static DEFINE_MUTEX(reboot_lock); -static struct fb_info *reboot_info; /* * Interface used by the world @@ -363,8 +361,8 @@ static unsigned long phys_guiregbase[FB_MAX] __devinitdata = { 0, }; #define ATI_CHIP_264GTPRO (ATI_MODERN_SET | M64F_SDRAM_MAGIC_PLL | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D) #define ATI_CHIP_264LTPRO (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D) -#define ATI_CHIP_264XL (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D | M64F_XL_DLL | M64F_MFB_FORCE_4 | M64F_XL_MEM) -#define ATI_CHIP_MOBILITY (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D | M64F_XL_DLL | M64F_MFB_FORCE_4 | M64F_XL_MEM | M64F_MOBIL_BUS) +#define ATI_CHIP_264XL (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D | M64F_XL_DLL | M64F_MFB_FORCE_4) +#define ATI_CHIP_MOBILITY (ATI_MODERN_SET | M64F_HW_TRIPLE | M64F_FIFO_32 | M64F_RESET_3D | M64F_XL_DLL | M64F_MFB_FORCE_4 | M64F_MOBIL_BUS) static struct { u16 pci_id; @@ -541,7 +539,6 @@ static char ram_edo[] __devinitdata = "EDO"; static char ram_sdram[] __devinitdata = "SDRAM (1:1)"; static char ram_sgram[] __devinitdata = "SGRAM (1:1)"; static char ram_sdram32[] __devinitdata = "SDRAM (2:1) (32-bit)"; -static char ram_wram[] __devinitdata = "WRAM"; static char ram_off[] __devinitdata = "OFF"; #endif /* CONFIG_FB_ATY_CT */ @@ -555,10 +552,6 @@ static char *aty_gx_ram[8] __devinitdata = { #ifdef CONFIG_FB_ATY_CT static char *aty_ct_ram[8] __devinitdata = { - ram_off, ram_dram, ram_edo, ram_edo, - ram_sdram, ram_sgram, ram_wram, ram_resv -}; -static char *aty_xl_ram[8] __devinitdata = { ram_off, ram_dram, ram_edo, ram_edo, ram_sdram, ram_sgram, ram_sdram32, ram_resv }; @@ -767,17 +760,6 @@ static void aty_set_crtc(const struct atyfb_par *par, const struct crtc *crtc) #endif /* CONFIG_FB_ATY_GENERIC_LCD */ } -static u32 calc_line_length(struct atyfb_par *par, u32 vxres, u32 bpp) -{ - u32 line_length = vxres * bpp / 8; - - if (par->ram_type == SGRAM || - (!M64_HAS(XL_MEM) && par->ram_type == WRAM)) - line_length = (line_length + 63) & ~63; - - return line_length; -} - static int aty_var_to_crtc(const struct fb_info *info, const struct fb_var_screeninfo *var, struct crtc *crtc) { @@ -787,14 +769,13 @@ static int aty_var_to_crtc(const struct fb_info *info, u32 h_total, h_disp, h_sync_strt, h_sync_end, h_sync_dly, h_sync_wid, h_sync_pol; u32 v_total, v_disp, v_sync_strt, v_sync_end, v_sync_wid, v_sync_pol, c_sync; u32 pix_width, dp_pix_width, dp_chain_mask; - u32 line_length; /* input */ - xres = (var->xres + 7) & ~7; + xres = var->xres; yres = var->yres; - vxres = (var->xres_virtual + 7) & ~7; + vxres = var->xres_virtual; vyres = var->yres_virtual; - xoffset = (var->xoffset + 7) & ~7; + xoffset = var->xoffset; yoffset = var->yoffset; bpp = var->bits_per_pixel; if (bpp == 16) @@ -846,9 +827,7 @@ static int aty_var_to_crtc(const struct fb_info *info, } else FAIL("invalid bpp"); - line_length = calc_line_length(par, vxres, bpp); - - if (vyres * line_length > info->fix.smem_len) + if (vxres * vyres * bpp / 8 > info->fix.smem_len) FAIL("not enough video RAM"); h_sync_pol = sync & FB_SYNC_HOR_HIGH_ACT ? 0 : 1; @@ -990,9 +969,7 @@ static int aty_var_to_crtc(const struct fb_info *info, crtc->xoffset = xoffset; crtc->yoffset = yoffset; crtc->bpp = bpp; - crtc->off_pitch = - ((yoffset * line_length + xoffset * bpp / 8) / 8) | - ((line_length / bpp) << 22); + crtc->off_pitch = ((yoffset*vxres+xoffset)*bpp/64) | (vxres<<19); crtc->vline_crnt_vline = 0; crtc->h_tot_disp = h_total | (h_disp<<16); @@ -1417,9 +1394,7 @@ static int atyfb_set_par(struct fb_info *info) } aty_st_8(DAC_MASK, 0xff, par); - info->fix.line_length = calc_line_length(par, var->xres_virtual, - var->bits_per_pixel); - + info->fix.line_length = var->xres_virtual * var->bits_per_pixel/8; info->fix.visual = var->bits_per_pixel <= 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; @@ -1530,12 +1505,10 @@ static void set_off_pitch(struct atyfb_par *par, const struct fb_info *info) { u32 xoffset = info->var.xoffset; u32 yoffset = info->var.yoffset; - u32 line_length = info->fix.line_length; + u32 vxres = par->crtc.vxres; u32 bpp = info->var.bits_per_pixel; - par->crtc.off_pitch = - ((yoffset * line_length + xoffset * bpp / 8) / 8) | - ((line_length / bpp) << 22); + par->crtc.off_pitch = ((yoffset * vxres + xoffset) * bpp / 64) | (vxres << 19); } @@ -2228,7 +2201,7 @@ static void __devinit aty_calc_mem_refresh(struct atyfb_par *par, int xclk) const int *refresh_tbl; int i, size; - if (M64_HAS(XL_MEM)) { + if (IS_XL(par->pci_id) || IS_MOBILITY(par->pci_id)) { refresh_tbl = ragexl_tbl; size = ARRAY_SIZE(ragexl_tbl); } else { @@ -2362,10 +2335,7 @@ static int __devinit aty_init(struct fb_info *info) par->pll_ops = &aty_pll_ct; par->bus_type = PCI; par->ram_type = (aty_ld_le32(CNFG_STAT0, par) & 0x07); - if (M64_HAS(XL_MEM)) - ramname = aty_xl_ram[par->ram_type]; - else - ramname = aty_ct_ram[par->ram_type]; + ramname = aty_ct_ram[par->ram_type]; /* for many chips, the mclk is 67 MHz for SDRAM, 63 MHz otherwise */ if (par->pll_limits.mclk == 67 && par->ram_type < SDRAM) par->pll_limits.mclk = 63; @@ -2420,9 +2390,9 @@ static int __devinit aty_init(struct fb_info *info) #endif /* CONFIG_FB_ATY_CT */ /* save previous video mode */ - aty_get_crtc(par, &par->saved_crtc); + aty_get_crtc(par, &saved_crtc); if(par->pll_ops->get_pll) - par->pll_ops->get_pll(info, &par->saved_pll); + par->pll_ops->get_pll(info, &saved_pll); par->mem_cntl = aty_ld_le32(MEM_CNTL, par); gtb_memsize = M64_HAS(GTB_DSP); @@ -2697,8 +2667,8 @@ static int __devinit aty_init(struct fb_info *info) aty_init_exit: /* restore video mode */ - aty_set_crtc(par, &par->saved_crtc); - par->pll_ops->set_pll(info, &par->saved_pll); + aty_set_crtc(par, &saved_crtc); + par->pll_ops->set_pll(info, &saved_pll); #ifdef CONFIG_MTRR if (par->mtrr_reg >= 0) { @@ -3532,11 +3502,6 @@ static int __devinit atyfb_pci_probe(struct pci_dev *pdev, const struct pci_devi par->mmap_map[1].prot_flag = _PAGE_E; #endif /* __sparc__ */ - mutex_lock(&reboot_lock); - if (!reboot_info) - reboot_info = info; - mutex_unlock(&reboot_lock); - return 0; err_release_io: @@ -3649,8 +3614,8 @@ static void __devexit atyfb_remove(struct fb_info *info) struct atyfb_par *par = (struct atyfb_par *) info->par; /* restore video mode */ - aty_set_crtc(par, &par->saved_crtc); - par->pll_ops->set_pll(info, &par->saved_pll); + aty_set_crtc(par, &saved_crtc); + par->pll_ops->set_pll(info, &saved_pll); unregister_framebuffer(info); @@ -3696,11 +3661,6 @@ static void __devexit atyfb_pci_remove(struct pci_dev *pdev) { struct fb_info *info = pci_get_drvdata(pdev); - mutex_lock(&reboot_lock); - if (reboot_info == info) - reboot_info = NULL; - mutex_unlock(&reboot_lock); - atyfb_remove(info); } @@ -3848,56 +3808,6 @@ static int __init atyfb_setup(char *options) } #endif /* MODULE */ -static int atyfb_reboot_notify(struct notifier_block *nb, - unsigned long code, void *unused) -{ - struct atyfb_par *par; - - if (code != SYS_RESTART) - return NOTIFY_DONE; - - mutex_lock(&reboot_lock); - - if (!reboot_info) - goto out; - - if (!lock_fb_info(reboot_info)) - goto out; - - par = reboot_info->par; - - /* - * HP OmniBook 500's BIOS doesn't like the state of the - * hardware after atyfb has been used. Restore the hardware - * to the original state to allow successful reboots. - */ - aty_set_crtc(par, &par->saved_crtc); - par->pll_ops->set_pll(reboot_info, &par->saved_pll); - - unlock_fb_info(reboot_info); - out: - mutex_unlock(&reboot_lock); - - return NOTIFY_DONE; -} - -static struct notifier_block atyfb_reboot_notifier = { - .notifier_call = atyfb_reboot_notify, -}; - -static const struct dmi_system_id atyfb_reboot_ids[] = { - { - .ident = "HP OmniBook 500", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), - DMI_MATCH(DMI_PRODUCT_NAME, "HP OmniBook PC"), - DMI_MATCH(DMI_PRODUCT_VERSION, "HP OmniBook 500 FA"), - }, - }, - - { } -}; - static int __init atyfb_init(void) { int err1 = 1, err2 = 1; @@ -3916,20 +3826,11 @@ static int __init atyfb_init(void) err2 = atyfb_atari_probe(); #endif - if (err1 && err2) - return -ENODEV; - - if (dmi_check_system(atyfb_reboot_ids)) - register_reboot_notifier(&atyfb_reboot_notifier); - - return 0; + return (err1 && err2) ? -ENODEV : 0; } static void __exit atyfb_exit(void) { - if (dmi_check_system(atyfb_reboot_ids)) - unregister_reboot_notifier(&atyfb_reboot_notifier); - #ifdef CONFIG_PCI pci_unregister_driver(&atyfb_driver); #endif diff --git a/trunk/drivers/video/aty/mach64_accel.c b/trunk/drivers/video/aty/mach64_accel.c index 51fcc0a2c94a..0cc9724e61a2 100644 --- a/trunk/drivers/video/aty/mach64_accel.c +++ b/trunk/drivers/video/aty/mach64_accel.c @@ -63,17 +63,14 @@ static void reset_GTC_3D_engine(const struct atyfb_par *par) void aty_init_engine(struct atyfb_par *par, struct fb_info *info) { u32 pitch_value; - u32 vxres; /* determine modal information from global mode structure */ - pitch_value = info->fix.line_length / (info->var.bits_per_pixel / 8); - vxres = info->var.xres_virtual; + pitch_value = info->var.xres_virtual; if (info->var.bits_per_pixel == 24) { /* In 24 bpp, the engine is in 8 bpp - this requires that all */ /* horizontal coordinates and widths must be adjusted */ pitch_value *= 3; - vxres *= 3; } /* On GTC (RagePro), we need to reset the 3D engine before */ @@ -136,7 +133,7 @@ void aty_init_engine(struct atyfb_par *par, struct fb_info *info) aty_st_le32(SC_LEFT, 0, par); aty_st_le32(SC_TOP, 0, par); aty_st_le32(SC_BOTTOM, par->crtc.vyres - 1, par); - aty_st_le32(SC_RIGHT, vxres - 1, par); + aty_st_le32(SC_RIGHT, pitch_value - 1, par); /* set background color to minimum value (usually BLACK) */ aty_st_le32(DP_BKGD_CLR, 0, par); diff --git a/trunk/drivers/video/fbmem.c b/trunk/drivers/video/fbmem.c index 53ea05645ff8..f8a09bf8d0cd 100644 --- a/trunk/drivers/video/fbmem.c +++ b/trunk/drivers/video/fbmem.c @@ -1310,6 +1310,8 @@ static long fb_compat_ioctl(struct file *file, unsigned int cmd, static int fb_mmap(struct file *file, struct vm_area_struct * vma) +__acquires(&info->lock) +__releases(&info->lock) { int fbidx = iminor(file->f_path.dentry->d_inode); struct fb_info *info = registered_fb[fbidx]; @@ -1323,14 +1325,16 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) off = vma->vm_pgoff << PAGE_SHIFT; if (!fb) return -ENODEV; - mutex_lock(&info->mm_lock); if (fb->fb_mmap) { int res; + mutex_lock(&info->lock); res = fb->fb_mmap(info, vma); - mutex_unlock(&info->mm_lock); + mutex_unlock(&info->lock); return res; } + mutex_lock(&info->lock); + /* frame buffer memory */ start = info->fix.smem_start; len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len); @@ -1338,13 +1342,13 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) /* memory mapped io */ off -= len; if (info->var.accel_flags) { - mutex_unlock(&info->mm_lock); + mutex_unlock(&info->lock); return -EINVAL; } start = info->fix.mmio_start; len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len); } - mutex_unlock(&info->mm_lock); + mutex_unlock(&info->lock); start &= PAGE_MASK; if ((vma->vm_end - vma->vm_start + off) > len) return -EINVAL; @@ -1514,7 +1518,6 @@ register_framebuffer(struct fb_info *fb_info) break; fb_info->node = i; mutex_init(&fb_info->lock); - mutex_init(&fb_info->mm_lock); fb_info->dev = device_create(fb_class, fb_info->device, MKDEV(FB_MAJOR, i), NULL, "fb%d", i); diff --git a/trunk/drivers/video/fsl-diu-fb.c b/trunk/drivers/video/fsl-diu-fb.c index 0bf2190928d0..f153c581cbd7 100644 --- a/trunk/drivers/video/fsl-diu-fb.c +++ b/trunk/drivers/video/fsl-diu-fb.c @@ -750,26 +750,24 @@ static void update_lcdc(struct fb_info *info) static int map_video_memory(struct fb_info *info) { phys_addr_t phys; - u32 smem_len = info->fix.line_length * info->var.yres_virtual; pr_debug("info->var.xres_virtual = %d\n", info->var.xres_virtual); pr_debug("info->var.yres_virtual = %d\n", info->var.yres_virtual); pr_debug("info->fix.line_length = %d\n", info->fix.line_length); - pr_debug("MAP_VIDEO_MEMORY: smem_len = %u\n", smem_len); - info->screen_base = fsl_diu_alloc(smem_len, &phys); + info->fix.smem_len = info->fix.line_length * info->var.yres_virtual; + pr_debug("MAP_VIDEO_MEMORY: smem_len = %d\n", info->fix.smem_len); + info->screen_base = fsl_diu_alloc(info->fix.smem_len, &phys); if (info->screen_base == NULL) { printk(KERN_ERR "Unable to allocate fb memory\n"); return -ENOMEM; } - mutex_lock(&info->mm_lock); info->fix.smem_start = (unsigned long) phys; - info->fix.smem_len = smem_len; - mutex_unlock(&info->mm_lock); info->screen_size = info->fix.smem_len; pr_debug("Allocated fb @ paddr=0x%08lx, size=%d.\n", - info->fix.smem_start, info->fix.smem_len); + info->fix.smem_start, + info->fix.smem_len); pr_debug("screen base %p\n", info->screen_base); return 0; @@ -778,11 +776,9 @@ static int map_video_memory(struct fb_info *info) static void unmap_video_memory(struct fb_info *info) { fsl_diu_free(info->screen_base, info->fix.smem_len); - mutex_lock(&info->mm_lock); info->screen_base = NULL; info->fix.smem_start = 0; info->fix.smem_len = 0; - mutex_unlock(&info->mm_lock); } /* diff --git a/trunk/drivers/video/i810/i810_main.c b/trunk/drivers/video/i810/i810_main.c index 71960672d721..2e940199fc89 100644 --- a/trunk/drivers/video/i810/i810_main.c +++ b/trunk/drivers/video/i810/i810_main.c @@ -1090,10 +1090,8 @@ static int encode_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) memset(fix, 0, sizeof(struct fb_fix_screeninfo)); strcpy(fix->id, "I810"); - mutex_lock(&info->mm_lock); fix->smem_start = par->fb.physical; fix->smem_len = par->fb.size; - mutex_unlock(&info->mm_lock); fix->type = FB_TYPE_PACKED_PIXELS; fix->type_aux = 0; fix->xpanstep = 8; diff --git a/trunk/drivers/video/matrox/matroxfb_base.c b/trunk/drivers/video/matrox/matroxfb_base.c index 59c3a2e14913..8e7a275df50c 100644 --- a/trunk/drivers/video/matrox/matroxfb_base.c +++ b/trunk/drivers/video/matrox/matroxfb_base.c @@ -724,10 +724,8 @@ static void matroxfb_update_fix(WPMINFO2) struct fb_fix_screeninfo *fix = &ACCESS_FBINFO(fbcon).fix; DBG(__func__) - mutex_lock(&ACCESS_FBINFO(fbcon).mm_lock); fix->smem_start = ACCESS_FBINFO(video.base) + ACCESS_FBINFO(curr.ydstorg.bytes); fix->smem_len = ACCESS_FBINFO(video.len_usable) - ACCESS_FBINFO(curr.ydstorg.bytes); - mutex_unlock(&ACCESS_FBINFO(fbcon).mm_lock); } static int matroxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) @@ -2083,7 +2081,6 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm spin_lock_init(&ACCESS_FBINFO(lock.accel)); init_rwsem(&ACCESS_FBINFO(crtc2.lock)); init_rwsem(&ACCESS_FBINFO(altout.lock)); - mutex_init(&ACCESS_FBINFO(fbcon).mm_lock); ACCESS_FBINFO(irq_flags) = 0; init_waitqueue_head(&ACCESS_FBINFO(crtc1.vsync.wait)); init_waitqueue_head(&ACCESS_FBINFO(crtc2.vsync.wait)); diff --git a/trunk/drivers/video/matrox/matroxfb_crtc2.c b/trunk/drivers/video/matrox/matroxfb_crtc2.c index 909e10a11898..7ac4c5f6145d 100644 --- a/trunk/drivers/video/matrox/matroxfb_crtc2.c +++ b/trunk/drivers/video/matrox/matroxfb_crtc2.c @@ -289,16 +289,13 @@ static int matroxfb_dh_release(struct fb_info* info, int user) { #undef m2info } -static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info) -{ +static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info) { struct fb_fix_screeninfo *fix = &m2info->fbcon.fix; strcpy(fix->id, "MATROX DH"); - mutex_lock(&m2info->fbcon.mm_lock); fix->smem_start = m2info->video.base; fix->smem_len = m2info->video.len_usable; - mutex_unlock(&m2info->fbcon.mm_lock); fix->ypanstep = 1; fix->ywrapstep = 0; fix->xpanstep = 8; /* TBD */ diff --git a/trunk/drivers/video/mx3fb.c b/trunk/drivers/video/mx3fb.c index 567fb944bd2a..b7af5256e887 100644 --- a/trunk/drivers/video/mx3fb.c +++ b/trunk/drivers/video/mx3fb.c @@ -669,7 +669,7 @@ static uint32_t bpp_to_pixfmt(int bpp) } static int mx3fb_blank(int blank, struct fb_info *fbi); -static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len); +static int mx3fb_map_video_memory(struct fb_info *fbi); static int mx3fb_unmap_video_memory(struct fb_info *fbi); /** @@ -742,7 +742,8 @@ static int mx3fb_set_par(struct fb_info *fbi) if (fbi->fix.smem_start) mx3fb_unmap_video_memory(fbi); - if (mx3fb_map_video_memory(fbi, mem_len) < 0) { + fbi->fix.smem_len = mem_len; + if (mx3fb_map_video_memory(fbi) < 0) { mutex_unlock(&mx3_fbi->mutex); return -ENOMEM; } @@ -1197,7 +1198,6 @@ static int mx3fb_resume(struct platform_device *pdev) /** * mx3fb_map_video_memory() - allocates the DRAM memory for the frame buffer. * @fbi: framebuffer information pointer - * @mem_len: length of mapped memory * @return: Error code indicating success or failure * * This buffer is remapped into a non-cached, non-buffered, memory region to @@ -1205,26 +1205,23 @@ static int mx3fb_resume(struct platform_device *pdev) * area is remapped, all virtual memory access to the video memory should occur * at the new region. */ -static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len) +static int mx3fb_map_video_memory(struct fb_info *fbi) { int retval = 0; dma_addr_t addr; fbi->screen_base = dma_alloc_writecombine(fbi->device, - mem_len, + fbi->fix.smem_len, &addr, GFP_DMA); if (!fbi->screen_base) { dev_err(fbi->device, "Cannot allocate %u bytes framebuffer memory\n", - mem_len); + fbi->fix.smem_len); retval = -EBUSY; goto err0; } - mutex_lock(&fbi->mm_lock); fbi->fix.smem_start = addr; - fbi->fix.smem_len = mem_len; - mutex_unlock(&fbi->mm_lock); dev_dbg(fbi->device, "allocated fb @ p=0x%08x, v=0x%p, size=%d.\n", (uint32_t) fbi->fix.smem_start, fbi->screen_base, fbi->fix.smem_len); @@ -1254,10 +1251,8 @@ static int mx3fb_unmap_video_memory(struct fb_info *fbi) fbi->screen_base, fbi->fix.smem_start); fbi->screen_base = 0; - mutex_lock(&fbi->mm_lock); fbi->fix.smem_start = 0; fbi->fix.smem_len = 0; - mutex_unlock(&fbi->mm_lock); return 0; } diff --git a/trunk/drivers/video/omap/omapfb_main.c b/trunk/drivers/video/omap/omapfb_main.c index 4ea99bfc37b4..060d72fe57cb 100644 --- a/trunk/drivers/video/omap/omapfb_main.c +++ b/trunk/drivers/video/omap/omapfb_main.c @@ -393,10 +393,8 @@ static void set_fb_fix(struct fb_info *fbi) rg = &plane->fbdev->mem_desc.region[plane->idx]; fbi->screen_base = rg->vaddr; - mutex_lock(&fbi->mm_lock); fix->smem_start = rg->paddr; fix->smem_len = rg->size; - mutex_unlock(&fbi->mm_lock); fix->type = FB_TYPE_PACKED_PIXELS; bpp = var->bits_per_pixel; @@ -888,10 +886,8 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi) * plane memory is dealloce'd, the other * screen parameters in var / fix are invalid. */ - mutex_lock(&fbi->mm_lock); fbi->fix.smem_start = 0; fbi->fix.smem_len = 0; - mutex_unlock(&fbi->mm_lock); } } } diff --git a/trunk/drivers/video/platinumfb.c b/trunk/drivers/video/platinumfb.c index bacfabd9ce16..03b3670130a0 100644 --- a/trunk/drivers/video/platinumfb.c +++ b/trunk/drivers/video/platinumfb.c @@ -141,9 +141,7 @@ static int platinumfb_set_par (struct fb_info *info) offset = 0x10; info->screen_base = pinfo->frame_buffer + init->fb_offset + offset; - mutex_lock(&info->mm_lock); info->fix.smem_start = (pinfo->frame_buffer_phys) + init->fb_offset + offset; - mutex_unlock(&info->mm_lock); info->fix.visual = (pinfo->cmode == CMODE_8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; info->fix.line_length = vmode_attrs[pinfo->vmode-1].hres * (1<cmode) diff --git a/trunk/drivers/video/pxafb.c b/trunk/drivers/video/pxafb.c index 6506117c134b..0889d50c3288 100644 --- a/trunk/drivers/video/pxafb.c +++ b/trunk/drivers/video/pxafb.c @@ -815,10 +815,8 @@ static int overlayfb_map_video_memory(struct pxafb_layer *ofb) ofb->video_mem_phys = virt_to_phys(ofb->video_mem); ofb->video_mem_size = size; - mutex_lock(&ofb->fb.mm_lock); ofb->fb.fix.smem_start = ofb->video_mem_phys; ofb->fb.fix.smem_len = ofb->fb.fix.line_length * var->yres_virtual; - mutex_unlock(&ofb->fb.mm_lock); ofb->fb.screen_base = ofb->video_mem; return 0; } diff --git a/trunk/drivers/video/sh7760fb.c b/trunk/drivers/video/sh7760fb.c index 9f6d6e61f0cc..653bdfee3057 100644 --- a/trunk/drivers/video/sh7760fb.c +++ b/trunk/drivers/video/sh7760fb.c @@ -120,6 +120,18 @@ static int sh7760_setcolreg (u_int regno, return 0; } +static void encode_fix(struct fb_fix_screeninfo *fix, struct fb_info *info, + unsigned long stride) +{ + memset(fix, 0, sizeof(struct fb_fix_screeninfo)); + strcpy(fix->id, "sh7760-lcdc"); + + fix->smem_start = (unsigned long)info->screen_base; + fix->smem_len = info->screen_size; + + fix->line_length = stride; +} + static int sh7760fb_get_color_info(struct device *dev, u16 lddfr, int *bpp, int *gray) { @@ -322,8 +334,7 @@ static int sh7760fb_set_par(struct fb_info *info) iowrite32(ldsarl, par->base + LDSARL); /* mem for lower half of DSTN */ - info->fix.line_length = stride; - + encode_fix(&info->fix, info, stride); sh7760fb_check_var(&info->var, info); sh7760fb_blank(FB_BLANK_UNBLANK, info); /* panel on! */ @@ -424,8 +435,6 @@ static int sh7760fb_alloc_mem(struct fb_info *info) info->screen_base = fbmem; info->screen_size = vram; - info->fix.smem_start = (unsigned long)info->screen_base; - info->fix.smem_len = info->screen_size; return 0; } @@ -511,8 +520,6 @@ static int __devinit sh7760fb_probe(struct platform_device *pdev) info->var.transp.length = 0; info->var.transp.msb_right = 0; - strcpy(info->fix.id, "sh7760-lcdc"); - /* set the DON2 bit now, before cmap allocation, as it will randomize * palette memory. */ diff --git a/trunk/drivers/video/sis/sis_main.c b/trunk/drivers/video/sis/sis_main.c index fd33455389b8..7072d19080d5 100644 --- a/trunk/drivers/video/sis/sis_main.c +++ b/trunk/drivers/video/sis/sis_main.c @@ -1847,10 +1847,8 @@ sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info) strcpy(fix->id, ivideo->myid); - mutex_lock(&info->mm_lock); fix->smem_start = ivideo->video_base + ivideo->video_offset; fix->smem_len = ivideo->sisfb_mem; - mutex_unlock(&info->mm_lock); fix->type = FB_TYPE_PACKED_PIXELS; fix->type_aux = 0; fix->visual = (ivideo->video_bpp == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; diff --git a/trunk/drivers/video/sm501fb.c b/trunk/drivers/video/sm501fb.c index 98f24f0ec00d..eb5d73a06702 100644 --- a/trunk/drivers/video/sm501fb.c +++ b/trunk/drivers/video/sm501fb.c @@ -145,7 +145,7 @@ static inline void sm501fb_sync_regs(struct sm501fb_info *info) #define SM501_MEMF_ACCEL (8) static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem, - unsigned int why, size_t size, u32 smem_len) + unsigned int why, size_t size) { struct sm501fb_par *par; struct fb_info *fbi; @@ -172,7 +172,7 @@ static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem, if (ptr > 0) ptr &= ~(PAGE_SIZE - 1); - if (fbi && ptr < smem_len) + if (fbi && ptr < fbi->fix.smem_len) return -ENOMEM; break; @@ -197,7 +197,7 @@ static int sm501_alloc_mem(struct sm501fb_info *inf, struct sm501_mem *mem, case SM501_MEMF_ACCEL: fbi = inf->fb[HEAD_CRT]; - ptr = fbi ? smem_len : 0; + ptr = fbi ? fbi->fix.smem_len : 0; fbi = inf->fb[HEAD_PANEL]; if (fbi) { @@ -413,7 +413,6 @@ static int sm501fb_set_par_common(struct fb_info *info, unsigned int mem_type; unsigned int clock_type; unsigned int head_addr; - unsigned int smem_len; dev_dbg(fbi->dev, "%s: %dx%d, bpp = %d, virtual %dx%d\n", __func__, var->xres, var->yres, var->bits_per_pixel, @@ -454,20 +453,18 @@ static int sm501fb_set_par_common(struct fb_info *info, /* allocate fb memory within 501 */ info->fix.line_length = (var->xres_virtual * var->bits_per_pixel)/8; - smem_len = info->fix.line_length * var->yres_virtual; + info->fix.smem_len = info->fix.line_length * var->yres_virtual; dev_dbg(fbi->dev, "%s: line length = %u\n", __func__, info->fix.line_length); - if (sm501_alloc_mem(fbi, &par->screen, mem_type, smem_len, smem_len)) { + if (sm501_alloc_mem(fbi, &par->screen, mem_type, + info->fix.smem_len)) { dev_err(fbi->dev, "no memory available\n"); return -ENOMEM; } - mutex_lock(&info->mm_lock); info->fix.smem_start = fbi->fbmem_res->start + par->screen.sm_addr; - info->fix.smem_len = smem_len; - mutex_unlock(&info->mm_lock); info->screen_base = fbi->fbmem + par->screen.sm_addr; info->screen_size = info->fix.smem_len; @@ -640,8 +637,7 @@ static int sm501fb_set_par_crt(struct fb_info *info) if ((control & SM501_DC_CRT_CONTROL_SEL) == 0) { /* the head is displaying panel data... */ - sm501_alloc_mem(fbi, &par->screen, SM501_MEMF_CRT, 0, - info->fix.smem_len); + sm501_alloc_mem(fbi, &par->screen, SM501_MEMF_CRT, 0); goto out_update; } @@ -1293,8 +1289,7 @@ static int sm501_init_cursor(struct fb_info *fbi, unsigned int reg_base) par->cursor_regs = info->regs + reg_base; - ret = sm501_alloc_mem(info, &par->cursor, SM501_MEMF_CURSOR, 1024, - fbi->fix.smem_len); + ret = sm501_alloc_mem(info, &par->cursor, SM501_MEMF_CURSOR, 1024); if (ret < 0) return ret; diff --git a/trunk/drivers/video/w100fb.c b/trunk/drivers/video/w100fb.c index 8a141c2c637b..d0674f1e3f10 100644 --- a/trunk/drivers/video/w100fb.c +++ b/trunk/drivers/video/w100fb.c @@ -523,7 +523,6 @@ static int w100fb_set_par(struct fb_info *info) info->fix.ywrapstep = 0; info->fix.line_length = par->xres * BITS_PER_PIXEL / 8; - mutex_lock(&info->mm_lock); if ((par->xres*par->yres*BITS_PER_PIXEL/8) > (MEM_INT_SIZE+1)) { par->extmem_active = 1; info->fix.smem_len = par->mach->mem->size+1; @@ -531,7 +530,6 @@ static int w100fb_set_par(struct fb_info *info) par->extmem_active = 0; info->fix.smem_len = MEM_INT_SIZE+1; } - mutex_unlock(&info->mm_lock); w100fb_activate_var(par); } diff --git a/trunk/fs/afs/flock.c b/trunk/fs/afs/flock.c index 3ff8bdd18fb3..210acafe4a9b 100644 --- a/trunk/fs/afs/flock.c +++ b/trunk/fs/afs/flock.c @@ -432,6 +432,7 @@ static int afs_do_setlk(struct file *file, struct file_lock *fl) list_del_init(&fl->fl_u.afs.link); if (list_empty(&vnode->granted_locks)) afs_defer_unlock(vnode, key); + spin_unlock(&vnode->lock); goto abort_attempt; } diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index d065b2c3273e..76da12537956 100644 --- a/trunk/fs/aio.c +++ b/trunk/fs/aio.c @@ -485,8 +485,6 @@ static inline void really_put_req(struct kioctx *ctx, struct kiocb *req) { assert_spin_locked(&ctx->ctx_lock); - if (req->ki_eventfd != NULL) - eventfd_ctx_put(req->ki_eventfd); if (req->ki_dtor) req->ki_dtor(req); if (req->ki_iovec != &req->ki_inline_vec) @@ -511,6 +509,8 @@ static void aio_fput_routine(struct work_struct *data) /* Complete the fput(s) */ if (req->ki_filp != NULL) __fput(req->ki_filp); + if (req->ki_eventfd != NULL) + __fput(req->ki_eventfd); /* Link the iocb into the context's free list */ spin_lock_irq(&ctx->ctx_lock); @@ -528,6 +528,8 @@ static void aio_fput_routine(struct work_struct *data) */ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req) { + int schedule_putreq = 0; + dprintk(KERN_DEBUG "aio_put(%p): f_count=%ld\n", req, atomic_long_read(&req->ki_filp->f_count)); @@ -547,16 +549,24 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req) * we would not be holding the last reference to the file*, so * this function will be executed w/out any aio kthread wakeup. */ - if (unlikely(atomic_long_dec_and_test(&req->ki_filp->f_count))) { + if (unlikely(atomic_long_dec_and_test(&req->ki_filp->f_count))) + schedule_putreq++; + else + req->ki_filp = NULL; + if (req->ki_eventfd != NULL) { + if (unlikely(atomic_long_dec_and_test(&req->ki_eventfd->f_count))) + schedule_putreq++; + else + req->ki_eventfd = NULL; + } + if (unlikely(schedule_putreq)) { get_ioctx(ctx); spin_lock(&fput_lock); list_add(&req->ki_list, &fput_head); spin_unlock(&fput_lock); queue_work(aio_wq, &fput_work); - } else { - req->ki_filp = NULL; + } else really_put_req(ctx, req); - } return 1; } @@ -1612,7 +1622,7 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, * an eventfd() fd, and will be signaled for each completed * event using the eventfd_signal() function. */ - req->ki_eventfd = eventfd_ctx_fdget((int) iocb->aio_resfd); + req->ki_eventfd = eventfd_fget((int) iocb->aio_resfd); if (IS_ERR(req->ki_eventfd)) { ret = PTR_ERR(req->ki_eventfd); req->ki_eventfd = NULL; diff --git a/trunk/fs/binfmt_elf.c b/trunk/fs/binfmt_elf.c index f1867900e459..9fa212b014a5 100644 --- a/trunk/fs/binfmt_elf.c +++ b/trunk/fs/binfmt_elf.c @@ -1929,10 +1929,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, un elf = kmalloc(sizeof(*elf), GFP_KERNEL); if (!elf) goto out; - /* - * The number of segs are recored into ELF header as 16bit value. - * Please check DEFAULT_MAX_MAP_COUNT definition when you modify here. - */ + segs = current->mm->map_count; #ifdef ELF_CORE_EXTRA_PHDRS segs += ELF_CORE_EXTRA_PHDRS; diff --git a/trunk/fs/eventfd.c b/trunk/fs/eventfd.c index 31d12de83a2a..3f0e1974abdc 100644 --- a/trunk/fs/eventfd.c +++ b/trunk/fs/eventfd.c @@ -14,44 +14,35 @@ #include #include #include +#include #include #include -#include -#include struct eventfd_ctx { - struct kref kref; wait_queue_head_t wqh; /* * Every time that a write(2) is performed on an eventfd, the * value of the __u64 being written is added to "count" and a * wakeup is performed on "wqh". A read(2) will return the "count" * value to userspace, and will reset "count" to zero. The kernel - * side eventfd_signal() also, adds to the "count" counter and + * size eventfd_signal() also, adds to the "count" counter and * issue a wakeup. */ __u64 count; unsigned int flags; }; -/** - * eventfd_signal - Adds @n to the eventfd counter. - * @ctx: [in] Pointer to the eventfd context. - * @n: [in] Value of the counter to be added to the eventfd internal counter. - * The value cannot be negative. - * - * This function is supposed to be called by the kernel in paths that do not - * allow sleeping. In this function we allow the counter to reach the ULLONG_MAX - * value, and we signal this as overflow condition by returining a POLLERR - * to poll(2). - * - * Returns @n in case of success, a non-negative number lower than @n in case - * of overflow, or the following error codes: - * - * -EINVAL : The value of @n is negative. +/* + * Adds "n" to the eventfd counter "count". Returns "n" in case of + * success, or a value lower then "n" in case of coutner overflow. + * This function is supposed to be called by the kernel in paths + * that do not allow sleeping. In this function we allow the counter + * to reach the ULLONG_MAX value, and we signal this as overflow + * condition by returining a POLLERR to poll(2). */ -int eventfd_signal(struct eventfd_ctx *ctx, int n) +int eventfd_signal(struct file *file, int n) { + struct eventfd_ctx *ctx = file->private_data; unsigned long flags; if (n < 0) @@ -68,45 +59,9 @@ int eventfd_signal(struct eventfd_ctx *ctx, int n) } EXPORT_SYMBOL_GPL(eventfd_signal); -static void eventfd_free(struct kref *kref) -{ - struct eventfd_ctx *ctx = container_of(kref, struct eventfd_ctx, kref); - - kfree(ctx); -} - -/** - * eventfd_ctx_get - Acquires a reference to the internal eventfd context. - * @ctx: [in] Pointer to the eventfd context. - * - * Returns: In case of success, returns a pointer to the eventfd context. - */ -struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx) -{ - kref_get(&ctx->kref); - return ctx; -} -EXPORT_SYMBOL_GPL(eventfd_ctx_get); - -/** - * eventfd_ctx_put - Releases a reference to the internal eventfd context. - * @ctx: [in] Pointer to eventfd context. - * - * The eventfd context reference must have been previously acquired either - * with eventfd_ctx_get() or eventfd_ctx_fdget()). - */ -void eventfd_ctx_put(struct eventfd_ctx *ctx) -{ - kref_put(&ctx->kref, eventfd_free); -} -EXPORT_SYMBOL_GPL(eventfd_ctx_put); - static int eventfd_release(struct inode *inode, struct file *file) { - struct eventfd_ctx *ctx = file->private_data; - - wake_up_poll(&ctx->wqh, POLLHUP); - eventfd_ctx_put(ctx); + kfree(file->private_data); return 0; } @@ -230,16 +185,6 @@ static const struct file_operations eventfd_fops = { .write = eventfd_write, }; -/** - * eventfd_fget - Acquire a reference of an eventfd file descriptor. - * @fd: [in] Eventfd file descriptor. - * - * Returns a pointer to the eventfd file structure in case of success, or the - * following error pointer: - * - * -EBADF : Invalid @fd file descriptor. - * -EINVAL : The @fd file descriptor is not an eventfd file. - */ struct file *eventfd_fget(int fd) { struct file *file; @@ -256,48 +201,6 @@ struct file *eventfd_fget(int fd) } EXPORT_SYMBOL_GPL(eventfd_fget); -/** - * eventfd_ctx_fdget - Acquires a reference to the internal eventfd context. - * @fd: [in] Eventfd file descriptor. - * - * Returns a pointer to the internal eventfd context, otherwise the error - * pointers returned by the following functions: - * - * eventfd_fget - */ -struct eventfd_ctx *eventfd_ctx_fdget(int fd) -{ - struct file *file; - struct eventfd_ctx *ctx; - - file = eventfd_fget(fd); - if (IS_ERR(file)) - return (struct eventfd_ctx *) file; - ctx = eventfd_ctx_get(file->private_data); - fput(file); - - return ctx; -} -EXPORT_SYMBOL_GPL(eventfd_ctx_fdget); - -/** - * eventfd_ctx_fileget - Acquires a reference to the internal eventfd context. - * @file: [in] Eventfd file pointer. - * - * Returns a pointer to the internal eventfd context, otherwise the error - * pointer: - * - * -EINVAL : The @fd file descriptor is not an eventfd file. - */ -struct eventfd_ctx *eventfd_ctx_fileget(struct file *file) -{ - if (file->f_op != &eventfd_fops) - return ERR_PTR(-EINVAL); - - return eventfd_ctx_get(file->private_data); -} -EXPORT_SYMBOL_GPL(eventfd_ctx_fileget); - SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) { int fd; @@ -314,7 +217,6 @@ SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) if (!ctx) return -ENOMEM; - kref_init(&ctx->kref); init_waitqueue_head(&ctx->wqh); ctx->count = count; ctx->flags = flags; diff --git a/trunk/fs/ext2/namei.c b/trunk/fs/ext2/namei.c index e1dedb0f7873..6524ecaebb7a 100644 --- a/trunk/fs/ext2/namei.c +++ b/trunk/fs/ext2/namei.c @@ -66,16 +66,8 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, str inode = NULL; if (ino) { inode = ext2_iget(dir->i_sb, ino); - if (unlikely(IS_ERR(inode))) { - if (PTR_ERR(inode) == -ESTALE) { - ext2_error(dir->i_sb, __func__, - "deleted inode referenced: %lu", - ino); - return ERR_PTR(-EIO); - } else { - return ERR_CAST(inode); - } - } + if (IS_ERR(inode)) + return ERR_CAST(inode); } return d_splice_alias(inode, dentry); } diff --git a/trunk/fs/hostfs/hostfs_kern.c b/trunk/fs/hostfs/hostfs_kern.c index 032604e5ef2c..fe02ad4740e7 100644 --- a/trunk/fs/hostfs/hostfs_kern.c +++ b/trunk/fs/hostfs/hostfs_kern.c @@ -972,7 +972,6 @@ static int hostfs_fill_sb_common(struct super_block *sb, void *d, int silent) sb->s_blocksize_bits = 10; sb->s_magic = HOSTFS_SUPER_MAGIC; sb->s_op = &hostfs_sbops; - sb->s_maxbytes = MAX_LFS_FILESIZE; /* NULL is printed as by sprintf: avoid that. */ if (req_root == NULL) diff --git a/trunk/include/asm-generic/percpu.h b/trunk/include/asm-generic/percpu.h index aa00800adacc..d7d50d7ee51e 100644 --- a/trunk/include/asm-generic/percpu.h +++ b/trunk/include/asm-generic/percpu.h @@ -97,8 +97,4 @@ extern void setup_per_cpu_areas(void); #define PER_CPU_ATTRIBUTES #endif -#ifndef PER_CPU_DEF_ATTRIBUTES -#define PER_CPU_DEF_ATTRIBUTES -#endif - #endif /* _ASM_GENERIC_PERCPU_H_ */ diff --git a/trunk/include/asm-generic/vmlinux.lds.h b/trunk/include/asm-generic/vmlinux.lds.h index dccdbed05848..92b73b6140ff 100644 --- a/trunk/include/asm-generic/vmlinux.lds.h +++ b/trunk/include/asm-generic/vmlinux.lds.h @@ -441,8 +441,7 @@ } #ifdef CONFIG_CONSTRUCTORS -#define KERNEL_CTORS() . = ALIGN(8); \ - VMLINUX_SYMBOL(__ctors_start) = .; \ +#define KERNEL_CTORS() VMLINUX_SYMBOL(__ctors_start) = .; \ *(.ctors) \ VMLINUX_SYMBOL(__ctors_end) = .; #else diff --git a/trunk/include/linux/aio.h b/trunk/include/linux/aio.h index 47f7d932a01d..b16a957030f8 100644 --- a/trunk/include/linux/aio.h +++ b/trunk/include/linux/aio.h @@ -121,9 +121,9 @@ struct kiocb { /* * If the aio_resfd field of the userspace iocb is not zero, - * this is the underlying eventfd context to deliver events to. + * this is the underlying file* to deliver event to. */ - struct eventfd_ctx *ki_eventfd; + struct file *ki_eventfd; }; #define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY) diff --git a/trunk/include/linux/eventfd.h b/trunk/include/linux/eventfd.h index 3b85ba6479f4..f45a8ae5f828 100644 --- a/trunk/include/linux/eventfd.h +++ b/trunk/include/linux/eventfd.h @@ -8,8 +8,10 @@ #ifndef _LINUX_EVENTFD_H #define _LINUX_EVENTFD_H +#ifdef CONFIG_EVENTFD + +/* For O_CLOEXEC and O_NONBLOCK */ #include -#include /* * CAREFUL: Check include/asm-generic/fcntl.h when defining @@ -25,37 +27,16 @@ #define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK) #define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE) -#ifdef CONFIG_EVENTFD - -struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx); -void eventfd_ctx_put(struct eventfd_ctx *ctx); struct file *eventfd_fget(int fd); -struct eventfd_ctx *eventfd_ctx_fdget(int fd); -struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); -int eventfd_signal(struct eventfd_ctx *ctx, int n); +int eventfd_signal(struct file *file, int n); #else /* CONFIG_EVENTFD */ -/* - * Ugly ugly ugly error layer to support modules that uses eventfd but - * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO. - */ -static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd) -{ - return ERR_PTR(-ENOSYS); -} - -static inline int eventfd_signal(struct eventfd_ctx *ctx, int n) -{ - return -ENOSYS; -} - -static inline void eventfd_ctx_put(struct eventfd_ctx *ctx) -{ - -} +#define eventfd_fget(fd) ERR_PTR(-ENOSYS) +static inline int eventfd_signal(struct file *file, int n) +{ return 0; } -#endif +#endif /* CONFIG_EVENTFD */ #endif /* _LINUX_EVENTFD_H */ diff --git a/trunk/include/linux/fb.h b/trunk/include/linux/fb.h index f847df9e99b6..dd68358996b7 100644 --- a/trunk/include/linux/fb.h +++ b/trunk/include/linux/fb.h @@ -819,7 +819,6 @@ struct fb_info { int node; int flags; struct mutex lock; /* Lock for open/release/ioctl funcs */ - struct mutex mm_lock; /* Lock for fb_mmap and smem_* fields */ struct fb_var_screeninfo var; /* Current var */ struct fb_fix_screeninfo fix; /* Current fix */ struct fb_monspecs monspecs; /* Current Monitor specs */ diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h index 73b46b6b904f..a3b000365795 100644 --- a/trunk/include/linux/pci_ids.h +++ b/trunk/include/linux/pci_ids.h @@ -2645,7 +2645,6 @@ #define PCI_DEVICE_ID_NETMOS_9835 0x9835 #define PCI_DEVICE_ID_NETMOS_9845 0x9845 #define PCI_DEVICE_ID_NETMOS_9855 0x9855 -#define PCI_DEVICE_ID_NETMOS_9901 0x9901 #define PCI_VENDOR_ID_3COM_2 0xa727 diff --git a/trunk/include/linux/percpu-defs.h b/trunk/include/linux/percpu-defs.h index 68438e18fff4..8f921d74f49f 100644 --- a/trunk/include/linux/percpu-defs.h +++ b/trunk/include/linux/percpu-defs.h @@ -24,8 +24,7 @@ #define DEFINE_PER_CPU_SECTION(type, name, section) \ __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ - PER_CPU_ATTRIBUTES PER_CPU_DEF_ATTRIBUTES \ - __typeof__(type) per_cpu__##name + PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name /* * Variant on the per-CPU variable declaration/definition theme used for diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 0085d758d645..4d0754269884 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -349,20 +349,8 @@ extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); struct nsproxy; struct user_namespace; -/* - * Default maximum number of active map areas, this limits the number of vmas - * per mm struct. Users can overwrite this number by sysctl but there is a - * problem. - * - * When a program's coredump is generated as ELF format, a section is created - * per a vma. In ELF, the number of sections is represented in unsigned short. - * This means the number of sections should be smaller than 65535 at coredump. - * Because the kernel adds some informative sections to a image of program at - * generating coredump, we need some margin. The number of extra sections is - * 1-3 now and depends on arch. We use "5" as safe margin, here. - */ -#define MAPCOUNT_ELF_CORE_MARGIN (5) -#define DEFAULT_MAX_MAP_COUNT (USHORT_MAX - MAPCOUNT_ELF_CORE_MARGIN) +/* Maximum number of active map areas.. This is a random (large) number */ +#define DEFAULT_MAX_MAP_COUNT 65536 extern int sysctl_max_map_count; diff --git a/trunk/include/linux/spi/spi.h b/trunk/include/linux/spi/spi.h index c47c4b4da97e..9c4cd27f4685 100644 --- a/trunk/include/linux/spi/spi.h +++ b/trunk/include/linux/spi/spi.h @@ -80,8 +80,6 @@ struct spi_device { #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ #define SPI_3WIRE 0x10 /* SI/SO signals shared */ #define SPI_LOOP 0x20 /* loopback mode */ -#define SPI_NO_CS 0x40 /* 1 dev/bus, no chipselect */ -#define SPI_READY 0x80 /* slave pulls low to pause */ u8 bits_per_word; int irq; void *controller_state; @@ -250,10 +248,6 @@ struct spi_master { /* spi_device.mode flags understood by this controller driver */ u16 mode_bits; - /* other constraints relevant to this driver */ - u16 flags; -#define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ - /* Setup mode and clock, etc (spi driver may call many times). * * IMPORTANT: this may be called when transfers to another diff --git a/trunk/include/linux/spi/spidev.h b/trunk/include/linux/spi/spidev.h index bf0570a84f7a..95251ccd5a07 100644 --- a/trunk/include/linux/spi/spidev.h +++ b/trunk/include/linux/spi/spidev.h @@ -40,8 +40,6 @@ #define SPI_LSB_FIRST 0x08 #define SPI_3WIRE 0x10 #define SPI_LOOP 0x20 -#define SPI_NO_CS 0x40 -#define SPI_READY 0x80 /*---------------------------------------------------------------------------*/ diff --git a/trunk/kernel/acct.c b/trunk/kernel/acct.c index 9f3391090b3e..7afa31564162 100644 --- a/trunk/kernel/acct.c +++ b/trunk/kernel/acct.c @@ -215,7 +215,6 @@ static void acct_file_reopen(struct bsd_acct_struct *acct, struct file *file, static int acct_on(char *name) { struct file *file; - struct vfsmount *mnt; int error; struct pid_namespace *ns; struct bsd_acct_struct *acct = NULL; @@ -257,12 +256,11 @@ static int acct_on(char *name) acct = NULL; } - mnt = file->f_path.mnt; - mnt_pin(mnt); + mnt_pin(file->f_path.mnt); acct_file_reopen(ns->bacct, file, ns); spin_unlock(&acct_lock); - mntput(mnt); /* it's pinned, now give up active reference */ + mntput(file->f_path.mnt); /* it's pinned, now give up active reference */ kfree(acct); return 0; diff --git a/trunk/kernel/resource.c b/trunk/kernel/resource.c index 78b087221c15..ac5f3a36923f 100644 --- a/trunk/kernel/resource.c +++ b/trunk/kernel/resource.c @@ -787,7 +787,7 @@ static int __init reserve_setup(char *str) static struct resource reserve[MAXRESERVE]; for (;;) { - unsigned int io_start, io_num; + int io_start, io_num; int x = reserved; if (get_option (&str, &io_start) != 2) diff --git a/trunk/mm/dmapool.c b/trunk/mm/dmapool.c index 3df063706f53..b1f0885dda22 100644 --- a/trunk/mm/dmapool.c +++ b/trunk/mm/dmapool.c @@ -86,12 +86,10 @@ show_pools(struct device *dev, struct device_attribute *attr, char *buf) unsigned pages = 0; unsigned blocks = 0; - spin_lock_irq(&pool->lock); list_for_each_entry(page, &pool->page_list, page_list) { pages++; blocks += page->in_use; } - spin_unlock_irq(&pool->lock); /* per-pool info, no real statistics yet */ temp = scnprintf(next, size, "%-16s %4u %4Zu %4Zu %2u\n", diff --git a/trunk/mm/page-writeback.c b/trunk/mm/page-writeback.c index 7687879253b9..7b0dcea4935b 100644 --- a/trunk/mm/page-writeback.c +++ b/trunk/mm/page-writeback.c @@ -541,11 +541,8 @@ static void balance_dirty_pages(struct address_space *mapping) * filesystems (i.e. NFS) in which data may have been * written to the server's write cache, but has not yet * been flushed to permanent storage. - * Only move pages to writeback if this bdi is over its - * threshold otherwise wait until the disk writes catch - * up. */ - if (bdi_nr_reclaimable > bdi_thresh) { + if (bdi_nr_reclaimable) { writeback_inodes(&wbc); pages_written += write_chunk - wbc.nr_to_write; get_dirty_limits(&background_thresh, &dirty_thresh, diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index e0f2cdf9d8b1..5d714f8fb303 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -4032,8 +4032,6 @@ static void __init find_zone_movable_pfns_for_nodes(unsigned long *movable_pfn) int i, nid; unsigned long usable_startpfn; unsigned long kernelcore_node, kernelcore_remaining; - /* save the state before borrow the nodemask */ - nodemask_t saved_node_state = node_states[N_HIGH_MEMORY]; unsigned long totalpages = early_calculate_totalpages(); int usable_nodes = nodes_weight(node_states[N_HIGH_MEMORY]); @@ -4061,7 +4059,7 @@ static void __init find_zone_movable_pfns_for_nodes(unsigned long *movable_pfn) /* If kernelcore was not specified, there is no ZONE_MOVABLE */ if (!required_kernelcore) - goto out; + return; /* usable_startpfn is the lowest possible pfn ZONE_MOVABLE can be at */ find_usable_zone_for_movable(); @@ -4160,10 +4158,6 @@ static void __init find_zone_movable_pfns_for_nodes(unsigned long *movable_pfn) for (nid = 0; nid < MAX_NUMNODES; nid++) zone_movable_pfn[nid] = roundup(zone_movable_pfn[nid], MAX_ORDER_NR_PAGES); - -out: - /* restore the node_state */ - node_states[N_HIGH_MEMORY] = saved_node_state; } /* Any regular memory on that node ? */ @@ -4248,6 +4242,11 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn) early_node_map[i].start_pfn, early_node_map[i].end_pfn); + /* + * find_zone_movable_pfns_for_nodes/early_calculate_totalpages init + * that node_mask, clear it at first + */ + nodes_clear(node_states[N_HIGH_MEMORY]); /* Initialise every node */ mminit_verify_pageflags_layout(); setup_nr_node_ids(); diff --git a/trunk/scripts/pnmtologo.c b/trunk/scripts/pnmtologo.c index 5c113123ed9f..64f5ddb09ea6 100644 --- a/trunk/scripts/pnmtologo.c +++ b/trunk/scripts/pnmtologo.c @@ -237,7 +237,7 @@ static void write_header(void) fprintf(out, " * Linux logo %s\n", logoname); fputs(" */\n\n", out); fputs("#include \n\n", out); - fprintf(out, "static unsigned char %s_data[] __initdata = {\n", + fprintf(out, "static const unsigned char %s_data[] __initconst = {\n", logoname); } @@ -374,7 +374,7 @@ static void write_logo_clut224(void) fputs("\n};\n\n", out); /* write logo clut */ - fprintf(out, "static unsigned char %s_clut[] __initdata = {\n", + fprintf(out, "static const unsigned char %s_clut[] __initconst = {\n", logoname); write_hex_cnt = 0; for (i = 0; i < logo_clutsize; i++) {