diff --git a/[refs] b/[refs] index 404742db250c..580d96795acb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c896a2e0d80bbd5731f76609625a0cb7c9864a44 +refs/heads/master: a5912f6b3e20c137172460e6d4dd180866c00963 diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index bc693fffabe0..04e6c819b28a 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -418,14 +418,6 @@ When: 2.6.33 Why: Should be implemented in userspace, policy daemon. Who: Johannes Berg ---------------------------- - -What: CONFIG_INOTIFY -When: 2.6.33 -Why: last user (audit) will be converted to the newer more generic - and more easily maintained fsnotify subsystem -Who: Eric Paris - ---------------------------- What: lock_policy_rwsem_* and unlock_policy_rwsem_* will not be diff --git a/trunk/Documentation/hwmon/sysfs-interface b/trunk/Documentation/hwmon/sysfs-interface index 82def883361b..dcbd502c8792 100644 --- a/trunk/Documentation/hwmon/sysfs-interface +++ b/trunk/Documentation/hwmon/sysfs-interface @@ -353,20 +353,10 @@ power[1-*]_average Average power use Unit: microWatt RO -power[1-*]_average_interval Power use averaging interval. A poll - notification is sent to this file if the - hardware changes the averaging interval. +power[1-*]_average_interval Power use averaging interval Unit: milliseconds RW -power[1-*]_average_interval_max Maximum power use averaging interval - Unit: milliseconds - RO - -power[1-*]_average_interval_min Minimum power use averaging interval - Unit: milliseconds - RO - power[1-*]_average_highest Historical average maximum power use Unit: microWatt RO @@ -375,18 +365,6 @@ power[1-*]_average_lowest Historical average minimum power use Unit: microWatt RO -power[1-*]_average_max A poll notification is sent to - power[1-*]_average when power use - rises above this value. - Unit: microWatt - RW - -power[1-*]_average_min A poll notification is sent to - power[1-*]_average when power use - sinks below this value. - Unit: microWatt - RW - power[1-*]_input Instantaneous power use Unit: microWatt RO @@ -403,39 +381,6 @@ power[1-*]_reset_history Reset input_highest, input_lowest, average_highest and average_lowest. WO -power[1-*]_accuracy Accuracy of the power meter. - Unit: Percent - RO - -power[1-*]_alarm 1 if the system is drawing more power than the - cap allows; 0 otherwise. A poll notification is - sent to this file when the power use exceeds the - cap. This file only appears if the cap is known - to be enforced by hardware. - RO - -power[1-*]_cap If power use rises above this limit, the - system should take action to reduce power use. - A poll notification is sent to this file if the - cap is changed by the hardware. The *_cap - files only appear if the cap is known to be - enforced by hardware. - Unit: microWatt - RW - -power[1-*]_cap_hyst Margin of hysteresis built around capping and - notification. - Unit: microWatt - RW - -power[1-*]_cap_max Maximum cap that can be set. - Unit: microWatt - RO - -power[1-*]_cap_min Minimum cap that can be set. - Unit: microWatt - RO - ********** * Energy * ********** diff --git a/trunk/Documentation/lguest/lguest.c b/trunk/Documentation/lguest/lguest.c index 098de5bce00a..ba9373f82ab5 100644 --- a/trunk/Documentation/lguest/lguest.c +++ b/trunk/Documentation/lguest/lguest.c @@ -42,6 +42,7 @@ #include #include "linux/lguest_launcher.h" #include "linux/virtio_config.h" +#include #include "linux/virtio_net.h" #include "linux/virtio_blk.h" #include "linux/virtio_console.h" diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index ece9f60dc5d5..88241154f4ce 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -65,51 +65,43 @@ trivial patch so apply some common sense. 8. Happy hacking. -Descriptions of section entries: - - P: Person (obsolete) - M: Mail patches to: FullName - L: Mailing list that is relevant to this area - W: Web-page with status/info - T: SCM tree type and location. Type is one of: git, hg, quilt, stgit. - S: Status, one of the following: - Supported: Someone is actually paid to look after this. - Maintained: Someone actually looks after it. - Odd Fixes: It has a maintainer but they don't have time to do - much other than throw the odd patch in. See below.. - Orphan: No current maintainer [but maybe you could take the - role as you write your new code]. - Obsolete: Old code. Something tagged obsolete generally means - it has been replaced by a better system and you - should be using that. - F: Files and directories with wildcard patterns. - A trailing slash includes all files and subdirectory files. - F: drivers/net/ all files in and below drivers/net - F: drivers/net/* all files in drivers/net, but not below - F: */net/* all files in "any top level directory"/net - One pattern per line. Multiple F: lines acceptable. - X: Files and directories that are NOT maintained, same rules as F: - Files exclusions are tested before file matches. - Can be useful for excluding a specific subdirectory, for instance: - F: net/ - X: net/ipv6/ - matches all files in and below net excluding net/ipv6/ - K: Keyword perl extended regex pattern to match content in a - patch or file. For instance: - K: of_get_profile - matches patches or files that contain "of_get_profile" - K: \b(printk|pr_(info|err))\b - matches patches or files that contain one or more of the words - printk, pr_info or pr_err - One regex pattern per line. Multiple K: lines acceptable. + ----------------------------------- + +Maintainers List (try to look for most precise areas first) Note: For the hard of thinking, this list is meant to remain in alphabetical order. If you could add yourselves to it in alphabetical order that would be so much easier [Ed] -Maintainers List (try to look for most precise areas first) +P: Person (obsolete) +M: Mail patches to: FullName +L: Mailing list that is relevant to this area +W: Web-page with status/info +T: SCM tree type and location. Type is one of: git, hg, quilt, stgit. +S: Status, one of the following: - ----------------------------------- + Supported: Someone is actually paid to look after this. + Maintained: Someone actually looks after it. + Odd Fixes: It has a maintainer but they don't have time to do + much other than throw the odd patch in. See below.. + Orphan: No current maintainer [but maybe you could take the + role as you write your new code]. + Obsolete: Old code. Something tagged obsolete generally means + it has been replaced by a better system and you + should be using that. + +F: Files and directories with wildcard patterns. + A trailing slash includes all files and subdirectory files. + F: drivers/net/ all files in and below drivers/net + F: drivers/net/* all files in drivers/net, but not below + F: */net/* all files in "any top level directory"/net + One pattern per line. Multiple F: lines acceptable. +X: Files and directories that are NOT maintained, same rules as F: + Files exclusions are tested before file matches. + Can be useful for excluding a specific subdirectory, for instance: + F: net/ + X: net/ipv6/ + matches all files in and below net excluding net/ipv6/ 3C505 NETWORK DRIVER M: Philip Blundell @@ -1000,7 +992,7 @@ F: drivers/net/atlx/ ATM M: Chas Williams -L: linux-atm-general@lists.sourceforge.net (moderated for non-subscribers) +L: linux-atm-general@lists.sourceforge.net (subscribers-only) L: netdev@vger.kernel.org W: http://linux-atm.sourceforge.net S: Maintained @@ -2159,7 +2151,7 @@ S: Supported F: arch/powerpc/sysdev/qe_lib/ F: arch/powerpc/include/asm/*qe.h -FREESCALE USB PERIPHERAL DRIVERS +FREESCALE USB PERIPHERIAL DRIVERS M: Li Yang L: linux-usb@vger.kernel.org L: linuxppc-dev@ozlabs.org @@ -2210,6 +2202,18 @@ F: Documentation/filesystems/caching/ F: fs/fscache/ F: include/linux/fscache*.h +TRACING +M: Steven Rostedt +M: Frederic Weisbecker +M: Ingo Molnar +T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git tracing/core +S: Maintained +F: Documentation/trace/ftrace.txt +F: arch/*/*/*/ftrace.h +F: arch/*/kernel/ftrace.c +F: include/*/ftrace.h include/trace/ include/linux/trace*.h +F: kernel/trace/ + FUJITSU FR-V (FRV) PORT M: David Howells S: Maintained @@ -2268,8 +2272,9 @@ S: Maintained F: include/asm-generic GENERIC UIO DRIVER FOR PCI DEVICES -M: "Michael S. Tsirkin" +M: Michael S. Tsirkin L: kvm@vger.kernel.org +L: linux-kernel@vger.kernel.org S: Supported F: drivers/uio/uio_pci_generic.c @@ -2999,8 +3004,8 @@ F: scripts/Makefile.* KERNEL JANITORS L: kernel-janitors@vger.kernel.org -W: http://janitor.kernelnewbies.org/ -S: Odd Fixes +W: http://www.kerneljanitors.org/ +S: Maintained KERNEL NFSD, SUNRPC, AND LOCKD SERVERS M: "J. Bruce Fields" @@ -3780,7 +3785,7 @@ F: drivers/video/riva/ F: drivers/video/nvidia/ OMAP SUPPORT -M: Tony Lindgren +M: "Tony Lindgren " L: linux-omap@vger.kernel.org W: http://www.muru.com/linux/omap/ W: http://linux.omap.com/ @@ -3885,15 +3890,6 @@ S: Maintained F: Documentation/i2c/busses/i2c-ocores F: drivers/i2c/busses/i2c-ocores.c -OPEN FIRMWARE AND FLATTENED DEVICE TREE -M: Grant Likely -L: devicetree-discuss@lists.ozlabs.org -W: http://fdt.secretlab.ca -S: Maintained -F: drivers/of -F: include/linux/of*.h -K: of_get_property - OPROFILE M: Robert Richter L: oprofile-list@lists.sf.net @@ -4329,7 +4325,7 @@ F: drivers/video/aty/aty128fb.c RALINK RT2X00 WIRELESS LAN DRIVER P: rt2x00 project L: linux-wireless@vger.kernel.org -L: users@rt2x00.serialmonkey.com (moderated for non-subscribers) +L: users@rt2x00.serialmonkey.com W: http://rt2x00.serialmonkey.com/ S: Maintained T: git git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git @@ -4538,11 +4534,12 @@ F: kernel/sched* F: include/linux/sched.h SCORE ARCHITECTURE -M: Chen Liqin -M: Lennox Wu +P: Chen Liqin +M: liqin.chen@sunplusct.com +P: Lennox Wu +M: lennox.wu@gmail.com W: http://www.sunplusct.com S: Supported -F: arch/score/ SCSI CDROM DRIVER M: Jens Axboe @@ -4615,20 +4612,20 @@ S: Maintained F: drivers/mmc/host/sdricoh_cs.c SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER -S: Orphan -L: linux-mmc@vger.kernel.org -F: drivers/mmc/host/sdhci.* +S: Orphan +L: linux-mmc@vger.kernel.org +F: drivers/mmc/host/sdhci.* SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF) M: Anton Vorontsov L: linuxppc-dev@ozlabs.org -L: linux-mmc@vger.kernel.org +L: linux-mmc@vger.kernel.org S: Maintained -F: drivers/mmc/host/sdhci-of.* +F: drivers/mmc/host/sdhci-of.* SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) SAMSUNG DRIVER M: Ben Dooks -L: linux-mmc@vger.kernel.org +L: linux-mmc@vger.kernel.org S: Maintained F: drivers/mmc/host/sdhci-s3c.c @@ -4731,7 +4728,8 @@ F: drivers/usb/gadget/lh7a40* F: drivers/usb/host/ohci-lh7a40* SIMPLE FIRMWARE INTERFACE (SFI) -M: Len Brown +P: Len Brown +M: lenb@kernel.org L: sfi-devel@simplefirmware.org W: http://simplefirmware.org/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-sfi-2.6.git @@ -5179,20 +5177,6 @@ L: tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers) S: Maintained F: drivers/char/tpm/ -TRACING -M: Steven Rostedt -M: Frederic Weisbecker -M: Ingo Molnar -T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git tracing/core -S: Maintained -F: Documentation/trace/ftrace.txt -F: arch/*/*/*/ftrace.h -F: arch/*/kernel/ftrace.c -F: include/*/ftrace.h -F: include/linux/trace*.h -F: include/trace/ -F: kernel/trace/ - TRIVIAL PATCHES M: Jiri Kosina T: git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git @@ -5759,7 +5743,8 @@ S: Maintained F: drivers/scsi/wd7000.c WINBOND CIR DRIVER -M: David Härdeman +P: David Härdeman +M: david@hardeman.nu S: Maintained F: drivers/input/misc/winbond-cir.c @@ -5816,7 +5801,9 @@ F: drivers/input/touchscreen/*wm97* F: include/linux/wm97xx.h WOLFSON MICROELECTRONICS PMIC DRIVERS -M: Mark Brown +P: Mark Brown +M: broonie@opensource.wolfsonmicro.com +L: linux-kernel@vger.kernel.org T: git git://opensource.wolfsonmicro.com/linux-2.6-audioplus W: http://opensource.wolfsonmicro.com/node/8 S: Supported diff --git a/trunk/arch/frv/kernel/signal.c b/trunk/arch/frv/kernel/signal.c index 0974c0ecc594..6b0a2b6fed6a 100644 --- a/trunk/arch/frv/kernel/signal.c +++ b/trunk/arch/frv/kernel/signal.c @@ -527,7 +527,7 @@ static void do_signal(void) no_signal: /* Did we come from a system call? */ - if (__frame->syscallno != -1) { + if (__frame->syscallno >= 0) { /* Restart the system call - no handlers present */ switch (__frame->gr8) { case -ERESTARTNOHAND: diff --git a/trunk/arch/sh/Kconfig b/trunk/arch/sh/Kconfig index 0dc7e3cbeffa..b940424f8ccc 100644 --- a/trunk/arch/sh/Kconfig +++ b/trunk/arch/sh/Kconfig @@ -37,6 +37,7 @@ config SUPERH32 select HAVE_FTRACE_MCOUNT_RECORD select HAVE_DYNAMIC_FTRACE select HAVE_FUNCTION_TRACE_MCOUNT_TEST + select HAVE_FTRACE_SYSCALLS select HAVE_FUNCTION_GRAPH_TRACER select HAVE_ARCH_KGDB select ARCH_HIBERNATION_POSSIBLE if MMU diff --git a/trunk/arch/sh/boards/mach-landisk/gio.c b/trunk/arch/sh/boards/mach-landisk/gio.c index 528013188196..25cdf7358000 100644 --- a/trunk/arch/sh/boards/mach-landisk/gio.c +++ b/trunk/arch/sh/boards/mach-landisk/gio.c @@ -14,6 +14,7 @@ */ #include #include +#include #include #include #include @@ -34,7 +35,7 @@ static int gio_open(struct inode *inode, struct file *filp) int minor; int ret = -ENOENT; - preempt_disable(); + lock_kernel(); minor = MINOR(inode->i_rdev); if (minor < DEVCOUNT) { if (openCnt > 0) { @@ -44,7 +45,7 @@ static int gio_open(struct inode *inode, struct file *filp) ret = 0; } } - preempt_enable(); + unlock_kernel(); return ret; } @@ -59,7 +60,8 @@ static int gio_close(struct inode *inode, struct file *filp) return 0; } -static long gio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +static int gio_ioctl(struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg) { unsigned int data; static unsigned int addr = 0; @@ -127,7 +129,7 @@ static const struct file_operations gio_fops = { .owner = THIS_MODULE, .open = gio_open, /* open */ .release = gio_close, /* release */ - .unlocked_ioctl = gio_ioctl, + .ioctl = gio_ioctl, /* ioctl */ }; static int __init gio_init(void) diff --git a/trunk/arch/sh/mm/cache-sh4.c b/trunk/arch/sh/mm/cache-sh4.c index 519e2d16cd06..a98c7d8984fa 100644 --- a/trunk/arch/sh/mm/cache-sh4.c +++ b/trunk/arch/sh/mm/cache-sh4.c @@ -26,7 +26,7 @@ #define MAX_DCACHE_PAGES 64 /* XXX: Tune for ways */ #define MAX_ICACHE_PAGES 32 -static void __flush_cache_one(unsigned long addr, unsigned long phys, +static void __flush_cache_4096(unsigned long addr, unsigned long phys, unsigned long exec_offset); /* @@ -89,7 +89,8 @@ static void __uses_jump_to_uncached sh4_flush_icache_range(void *args) local_irq_restore(flags); } -static inline void flush_cache_one(unsigned long start, unsigned long phys) +static inline void flush_cache_4096(unsigned long start, + unsigned long phys) { unsigned long flags, exec_offset = 0; @@ -102,7 +103,8 @@ static inline void flush_cache_one(unsigned long start, unsigned long phys) exec_offset = 0x20000000; local_irq_save(flags); - __flush_cache_one(start | SH_CACHE_ASSOC, P1SEGADDR(phys), exec_offset); + __flush_cache_4096(start | SH_CACHE_ASSOC, + P1SEGADDR(phys), exec_offset); local_irq_restore(flags); } @@ -127,8 +129,8 @@ static void sh4_flush_dcache_page(void *arg) /* Loop all the D-cache */ n = boot_cpu_data.dcache.n_aliases; - for (i = 0; i < n; i++, addr += PAGE_SIZE) - flush_cache_one(addr, phys); + for (i = 0; i < n; i++, addr += 4096) + flush_cache_4096(addr, phys); } wmb(); @@ -316,11 +318,11 @@ static void sh4_flush_cache_page(void *args) /* We only need to flush D-cache when we have alias */ if ((address^phys) & alias_mask) { /* Loop 4K of the D-cache */ - flush_cache_one( + flush_cache_4096( CACHE_OC_ADDRESS_ARRAY | (address & alias_mask), phys); /* Loop another 4K of the D-cache */ - flush_cache_one( + flush_cache_4096( CACHE_OC_ADDRESS_ARRAY | (phys & alias_mask), phys); } @@ -335,7 +337,7 @@ static void sh4_flush_cache_page(void *args) * kernel has never executed the code through its identity * translation. */ - flush_cache_one( + flush_cache_4096( CACHE_IC_ADDRESS_ARRAY | (address & alias_mask), phys); } @@ -391,7 +393,7 @@ static void sh4_flush_cache_range(void *args) } /** - * __flush_cache_one + * __flush_cache_4096 * * @addr: address in memory mapped cache array * @phys: P1 address to flush (has to match tags if addr has 'A' bit @@ -404,7 +406,7 @@ static void sh4_flush_cache_range(void *args) * operation (purge/write-back) is selected by the lower 2 bits of * 'phys'. */ -static void __flush_cache_one(unsigned long addr, unsigned long phys, +static void __flush_cache_4096(unsigned long addr, unsigned long phys, unsigned long exec_offset) { int way_count; diff --git a/trunk/arch/sh/mm/cache.c b/trunk/arch/sh/mm/cache.c index a2dc7f9ecc51..5e1091be9dc4 100644 --- a/trunk/arch/sh/mm/cache.c +++ b/trunk/arch/sh/mm/cache.c @@ -265,8 +265,6 @@ static void __init emit_cache_params(void) void __init cpu_cache_init(void) { - unsigned int cache_disabled = !(__raw_readl(CCR) & CCR_CACHE_ENABLE); - compute_alias(&boot_cpu_data.icache); compute_alias(&boot_cpu_data.dcache); compute_alias(&boot_cpu_data.scache); @@ -275,13 +273,6 @@ void __init cpu_cache_init(void) __flush_purge_region = noop__flush_region; __flush_invalidate_region = noop__flush_region; - /* - * No flushing is necessary in the disabled cache case so we can - * just keep the noop functions in local_flush_..() and __flush_..() - */ - if (unlikely(cache_disabled)) - goto skip; - if (boot_cpu_data.family == CPU_FAMILY_SH2) { extern void __weak sh2_cache_init(void); @@ -321,6 +312,5 @@ void __init cpu_cache_init(void) sh5_cache_init(); } -skip: emit_cache_params(); } diff --git a/trunk/arch/x86/boot/setup.ld b/trunk/arch/x86/boot/setup.ld index 0f6ec455a2b1..03c0683636b6 100644 --- a/trunk/arch/x86/boot/setup.ld +++ b/trunk/arch/x86/boot/setup.ld @@ -53,6 +53,9 @@ SECTIONS /DISCARD/ : { *(.note*) } + /* + * The ASSERT() sink to . is intentional, for binutils 2.14 compatibility: + */ . = ASSERT(_end <= 0x8000, "Setup too big!"); . = ASSERT(hdr == 0x1f1, "The setup header has the wrong offset!"); /* Necessary for the very-old-loader check to work... */ diff --git a/trunk/arch/x86/crypto/aesni-intel_glue.c b/trunk/arch/x86/crypto/aesni-intel_glue.c index 49c552c060e9..585edebe12cf 100644 --- a/trunk/arch/x86/crypto/aesni-intel_glue.c +++ b/trunk/arch/x86/crypto/aesni-intel_glue.c @@ -82,7 +82,7 @@ static int aes_set_key_common(struct crypto_tfm *tfm, void *raw_ctx, return -EINVAL; } - if (!irq_fpu_usable()) + if (irq_fpu_usable()) err = crypto_aes_expand_key(ctx, in_key, key_len); else { kernel_fpu_begin(); @@ -103,7 +103,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); - if (!irq_fpu_usable()) + if (irq_fpu_usable()) crypto_aes_encrypt_x86(ctx, dst, src); else { kernel_fpu_begin(); @@ -116,7 +116,7 @@ static void aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct crypto_aes_ctx *ctx = aes_ctx(crypto_tfm_ctx(tfm)); - if (!irq_fpu_usable()) + if (irq_fpu_usable()) crypto_aes_decrypt_x86(ctx, dst, src); else { kernel_fpu_begin(); @@ -342,7 +342,7 @@ static int ablk_encrypt(struct ablkcipher_request *req) struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); struct async_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm); - if (!irq_fpu_usable()) { + if (irq_fpu_usable()) { struct ablkcipher_request *cryptd_req = ablkcipher_request_ctx(req); memcpy(cryptd_req, req, sizeof(*req)); @@ -363,7 +363,7 @@ static int ablk_decrypt(struct ablkcipher_request *req) struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); struct async_aes_ctx *ctx = crypto_ablkcipher_ctx(tfm); - if (!irq_fpu_usable()) { + if (irq_fpu_usable()) { struct ablkcipher_request *cryptd_req = ablkcipher_request_ctx(req); memcpy(cryptd_req, req, sizeof(*req)); diff --git a/trunk/arch/x86/kernel/acpi/realmode/wakeup.lds.S b/trunk/arch/x86/kernel/acpi/realmode/wakeup.lds.S index 7da00b799cda..060fff8f5c5b 100644 --- a/trunk/arch/x86/kernel/acpi/realmode/wakeup.lds.S +++ b/trunk/arch/x86/kernel/acpi/realmode/wakeup.lds.S @@ -57,5 +57,8 @@ SECTIONS *(.note*) } + /* + * The ASSERT() sink to . is intentional, for binutils 2.14 compatibility: + */ . = ASSERT(_end <= WAKEUP_SIZE, "Wakeup too big!"); } diff --git a/trunk/arch/x86/kernel/vmlinux.lds.S b/trunk/arch/x86/kernel/vmlinux.lds.S index 92929fb3f9fa..3c68fe2d46cf 100644 --- a/trunk/arch/x86/kernel/vmlinux.lds.S +++ b/trunk/arch/x86/kernel/vmlinux.lds.S @@ -305,6 +305,9 @@ SECTIONS #ifdef CONFIG_X86_32 +/* + * The ASSERT() sink to . is intentional, for binutils 2.14 compatibility: + */ . = ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE), "kernel image bigger than KERNEL_IMAGE_SIZE"); #else diff --git a/trunk/arch/x86/kvm/i8254.c b/trunk/arch/x86/kvm/i8254.c index 144e7f60b5e2..82ad523b4901 100644 --- a/trunk/arch/x86/kvm/i8254.c +++ b/trunk/arch/x86/kvm/i8254.c @@ -116,7 +116,7 @@ static s64 __kpit_elapsed(struct kvm *kvm) * itself with the initial count and continues counting * from there. */ - remaining = hrtimer_get_remaining(&ps->pit_timer.timer); + remaining = hrtimer_expires_remaining(&ps->pit_timer.timer); elapsed = ps->pit_timer.period - ktime_to_ns(remaining); elapsed = mod_64(elapsed, ps->pit_timer.period); diff --git a/trunk/arch/x86/kvm/lapic.c b/trunk/arch/x86/kvm/lapic.c index 23c217692ea9..7024224f0fc8 100644 --- a/trunk/arch/x86/kvm/lapic.c +++ b/trunk/arch/x86/kvm/lapic.c @@ -521,7 +521,7 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic) if (apic_get_reg(apic, APIC_TMICT) == 0) return 0; - remaining = hrtimer_get_remaining(&apic->lapic_timer.timer); + remaining = hrtimer_expires_remaining(&apic->lapic_timer.timer); if (ktime_to_ns(remaining) < 0) remaining = ktime_set(0, 0); diff --git a/trunk/arch/x86/kvm/mmu.c b/trunk/arch/x86/kvm/mmu.c index 818b92ad82cf..685a4ffac8e6 100644 --- a/trunk/arch/x86/kvm/mmu.c +++ b/trunk/arch/x86/kvm/mmu.c @@ -748,8 +748,7 @@ static int rmap_write_protect(struct kvm *kvm, u64 gfn) return write_protected; } -static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp, - unsigned long data) +static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data) { u64 *spte; int need_tlb_flush = 0; @@ -764,8 +763,7 @@ static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp, return need_tlb_flush; } -static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, - unsigned long data) +static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data) { int need_flush = 0; u64 *spte, new_spte; @@ -801,10 +799,9 @@ static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, return 0; } -static int kvm_handle_hva(struct kvm *kvm, unsigned long hva, - unsigned long data, +static int kvm_handle_hva(struct kvm *kvm, unsigned long hva, u64 data, int (*handler)(struct kvm *kvm, unsigned long *rmapp, - unsigned long data)) + u64 data)) { int i, j; int retval = 0; @@ -849,11 +846,10 @@ int kvm_unmap_hva(struct kvm *kvm, unsigned long hva) void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte) { - kvm_handle_hva(kvm, hva, (unsigned long)&pte, kvm_set_pte_rmapp); + kvm_handle_hva(kvm, hva, (u64)&pte, kvm_set_pte_rmapp); } -static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, - unsigned long data) +static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data) { u64 *spte; int young = 0; diff --git a/trunk/drivers/ata/ahci.c b/trunk/drivers/ata/ahci.c index a06f5d6375a8..b1a257746a19 100644 --- a/trunk/drivers/ata/ahci.c +++ b/trunk/drivers/ata/ahci.c @@ -575,7 +575,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(ATI, 0x4395), board_ahci_sb700 }, /* ATI SB700/800 */ /* AMD */ - { PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */ + { PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD SB900 */ /* AMD is using RAID class only for ahci controllers */ { PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci }, @@ -605,7 +605,6 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(NVIDIA, 0x0559), board_ahci_yesncq }, /* MCP67 */ { PCI_VDEVICE(NVIDIA, 0x055a), board_ahci_yesncq }, /* MCP67 */ { PCI_VDEVICE(NVIDIA, 0x055b), board_ahci_yesncq }, /* MCP67 */ - { PCI_VDEVICE(NVIDIA, 0x0580), board_ahci_yesncq }, /* Linux ID */ { PCI_VDEVICE(NVIDIA, 0x07f0), board_ahci_yesncq }, /* MCP73 */ { PCI_VDEVICE(NVIDIA, 0x07f1), board_ahci_yesncq }, /* MCP73 */ { PCI_VDEVICE(NVIDIA, 0x07f2), board_ahci_yesncq }, /* MCP73 */ diff --git a/trunk/drivers/ata/libata-core.c b/trunk/drivers/ata/libata-core.c index d7f0f1b1ae3e..b525a0981348 100644 --- a/trunk/drivers/ata/libata-core.c +++ b/trunk/drivers/ata/libata-core.c @@ -5028,14 +5028,12 @@ void ata_qc_complete(struct ata_queued_cmd *qc) qc->flags |= ATA_QCFLAG_FAILED; if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) { - /* always fill result TF for failed qc */ - fill_result_tf(qc); - - if (!ata_tag_internal(qc->tag)) + if (!ata_tag_internal(qc->tag)) { + /* always fill result TF for failed qc */ + fill_result_tf(qc); ata_qc_schedule_eh(qc); - else - __ata_qc_complete(qc); - return; + return; + } } WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN); diff --git a/trunk/drivers/ata/libata-eh.c b/trunk/drivers/ata/libata-eh.c index bba2ae5df1c2..0a97822da211 100644 --- a/trunk/drivers/ata/libata-eh.c +++ b/trunk/drivers/ata/libata-eh.c @@ -2981,14 +2981,12 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link, * device detection messages backwards. */ ata_for_each_dev(dev, link, ALL) { - if (!(new_mask & (1 << dev->devno))) + if (!(new_mask & (1 << dev->devno)) || + dev->class == ATA_DEV_PMP) continue; dev->class = ehc->classes[dev->devno]; - if (dev->class == ATA_DEV_PMP) - continue; - ehc->i.flags |= ATA_EHI_PRINTINFO; rc = ata_dev_configure(dev); ehc->i.flags &= ~ATA_EHI_PRINTINFO; diff --git a/trunk/drivers/ata/pata_atiixp.c b/trunk/drivers/ata/pata_atiixp.c index ae4454d4e955..aa4b3f6ae771 100644 --- a/trunk/drivers/ata/pata_atiixp.c +++ b/trunk/drivers/ata/pata_atiixp.c @@ -246,7 +246,7 @@ static const struct pci_device_id atiixp[] = { { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP400_IDE), }, { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP600_IDE), }, { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP700_IDE), }, - { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_HUDSON2_IDE), }, + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_SB900_IDE), }, { }, }; diff --git a/trunk/drivers/ata/pata_sc1200.c b/trunk/drivers/ata/pata_sc1200.c index 3bbed8322ecf..f49814d6fd2e 100644 --- a/trunk/drivers/ata/pata_sc1200.c +++ b/trunk/drivers/ata/pata_sc1200.c @@ -235,7 +235,8 @@ static int sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id) .udma_mask = ATA_UDMA2, .port_ops = &sc1200_port_ops }; - const struct ata_port_info *ppi[] = { &info, NULL }; + /* Can't enable port 2 yet, see top comments */ + const struct ata_port_info *ppi[] = { &info, }; return ata_pci_sff_init_one(dev, ppi, &sc1200_sht, NULL); } diff --git a/trunk/drivers/ata/pata_via.c b/trunk/drivers/ata/pata_via.c index 88984b803d6d..45657cacec43 100644 --- a/trunk/drivers/ata/pata_via.c +++ b/trunk/drivers/ata/pata_via.c @@ -111,7 +111,7 @@ static const struct via_isa_bridge { { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA }, { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES }, - { "vt6415", PCI_DEVICE_ID_VIA_6415, 0x00, 0xff, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES }, + { "vt6415", PCI_DEVICE_ID_VIA_6415, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES }, { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, diff --git a/trunk/drivers/ata/sata_mv.c b/trunk/drivers/ata/sata_mv.c index 6f5093b7c8c5..17f9ff9067a2 100644 --- a/trunk/drivers/ata/sata_mv.c +++ b/trunk/drivers/ata/sata_mv.c @@ -1382,25 +1382,6 @@ static int mv_qc_defer(struct ata_queued_cmd *qc) */ if (pp->pp_flags & MV_PP_FLAG_DELAYED_EH) return ATA_DEFER_PORT; - - /* PIO commands need exclusive link: no other commands [DMA or PIO] - * can run concurrently. - * set excl_link when we want to send a PIO command in DMA mode - * or a non-NCQ command in NCQ mode. - * When we receive a command from that link, and there are no - * outstanding commands, mark a flag to clear excl_link and let - * the command go through. - */ - if (unlikely(ap->excl_link)) { - if (link == ap->excl_link) { - if (ap->nr_active_links) - return ATA_DEFER_PORT; - qc->flags |= ATA_QCFLAG_CLEAR_EXCL; - return 0; - } else - return ATA_DEFER_PORT; - } - /* * If the port is completely idle, then allow the new qc. */ @@ -1414,14 +1395,8 @@ static int mv_qc_defer(struct ata_queued_cmd *qc) * doesn't allow it. */ if ((pp->pp_flags & MV_PP_FLAG_EDMA_EN) && - (pp->pp_flags & MV_PP_FLAG_NCQ_EN)) { - if (ata_is_ncq(qc->tf.protocol)) - return 0; - else { - ap->excl_link = link; - return ATA_DEFER_PORT; - } - } + (pp->pp_flags & MV_PP_FLAG_NCQ_EN) && ata_is_ncq(qc->tf.protocol)) + return 0; return ATA_DEFER_PORT; } diff --git a/trunk/drivers/ata/sata_nv.c b/trunk/drivers/ata/sata_nv.c index 1eb4e020eb5c..86a40582999c 100644 --- a/trunk/drivers/ata/sata_nv.c +++ b/trunk/drivers/ata/sata_nv.c @@ -1594,21 +1594,9 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class, !ata_dev_enabled(link->device)) sata_link_hardreset(link, sata_deb_timing_hotplug, deadline, NULL, NULL); - else { - const unsigned long *timing = sata_ehc_deb_timing(ehc); - int rc; - - if (!(ehc->i.flags & ATA_EHI_QUIET)) - ata_link_printk(link, KERN_INFO, "nv: skipping " - "hardreset on occupied port\n"); - - /* make sure the link is online */ - rc = sata_link_resume(link, timing, deadline); - /* whine about phy resume failure but proceed */ - if (rc && rc != -EOPNOTSUPP) - ata_link_printk(link, KERN_WARNING, "failed to resume " - "link (errno=%d)\n", rc); - } + else if (!(ehc->i.flags & ATA_EHI_QUIET)) + ata_link_printk(link, KERN_INFO, + "nv: skipping hardreset on occupied port\n"); /* device signature acquisition is unreliable */ return -EAGAIN; diff --git a/trunk/drivers/block/loop.c b/trunk/drivers/block/loop.c index bd112c8c7bcd..edda9ea7c626 100644 --- a/trunk/drivers/block/loop.c +++ b/trunk/drivers/block/loop.c @@ -949,7 +949,7 @@ static int loop_clr_fd(struct loop_device *lo, struct block_device *bdev) lo->lo_state = Lo_unbound; /* This is safe: open() is still holding a reference. */ module_put(THIS_MODULE); - if (max_part > 0 && bdev) + if (max_part > 0) ioctl_by_bdev(bdev, BLKRRPART, 0); mutex_unlock(&lo->lo_ctl_mutex); /* diff --git a/trunk/drivers/block/virtio_blk.c b/trunk/drivers/block/virtio_blk.c index 51042f0ba7e1..43f19389647a 100644 --- a/trunk/drivers/block/virtio_blk.c +++ b/trunk/drivers/block/virtio_blk.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -182,6 +183,34 @@ static void do_virtblk_request(struct request_queue *q) vblk->vq->vq_ops->kick(vblk->vq); } +/* return ATA identify data + */ +static int virtblk_identify(struct gendisk *disk, void *argp) +{ + struct virtio_blk *vblk = disk->private_data; + void *opaque; + int err = -ENOMEM; + + opaque = kmalloc(VIRTIO_BLK_ID_BYTES, GFP_KERNEL); + if (!opaque) + goto out; + + err = virtio_config_buf(vblk->vdev, VIRTIO_BLK_F_IDENTIFY, + offsetof(struct virtio_blk_config, identify), opaque, + VIRTIO_BLK_ID_BYTES); + + if (err) + goto out_kfree; + + if (copy_to_user(argp, opaque, VIRTIO_BLK_ID_BYTES)) + err = -EFAULT; + +out_kfree: + kfree(opaque); +out: + return err; +} + static void virtblk_prepare_flush(struct request_queue *q, struct request *req) { req->cmd_type = REQ_TYPE_LINUX_BLOCK; @@ -193,6 +222,10 @@ static int virtblk_ioctl(struct block_device *bdev, fmode_t mode, { struct gendisk *disk = bdev->bd_disk; struct virtio_blk *vblk = disk->private_data; + void __user *argp = (void __user *)data; + + if (cmd == HDIO_GET_IDENTITY) + return virtblk_identify(disk, argp); /* * Only allow the generic SCSI ioctls if the host can support it. @@ -200,8 +233,7 @@ static int virtblk_ioctl(struct block_device *bdev, fmode_t mode, if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_SCSI)) return -ENOTTY; - return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, - (void __user *)data); + return scsi_cmd_ioctl(disk->queue, disk, mode, cmd, argp); } /* We provide getgeo only to please some old bootloader/partitioning tools */ @@ -300,6 +332,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev) } vblk->disk->queue->queuedata = vblk; + queue_flag_set_unlocked(QUEUE_FLAG_VIRT, vblk->disk->queue); if (index < 26) { sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26); @@ -412,7 +445,7 @@ static struct virtio_device_id id_table[] = { static unsigned int features[] = { VIRTIO_BLK_F_BARRIER, VIRTIO_BLK_F_SEG_MAX, VIRTIO_BLK_F_SIZE_MAX, VIRTIO_BLK_F_GEOMETRY, VIRTIO_BLK_F_RO, VIRTIO_BLK_F_BLK_SIZE, - VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_FLUSH + VIRTIO_BLK_F_SCSI, VIRTIO_BLK_F_IDENTIFY, VIRTIO_BLK_F_FLUSH }; /* diff --git a/trunk/drivers/char/hw_random/virtio-rng.c b/trunk/drivers/char/hw_random/virtio-rng.c index 915157fcff98..962968f05b94 100644 --- a/trunk/drivers/char/hw_random/virtio-rng.c +++ b/trunk/drivers/char/hw_random/virtio-rng.c @@ -21,6 +21,7 @@ #include #include #include +#include #include /* The host will fill any buffer we give it with sweet, sweet randomness. We @@ -116,7 +117,7 @@ static int virtrng_probe(struct virtio_device *vdev) return 0; } -static void __devexit virtrng_remove(struct virtio_device *vdev) +static void virtrng_remove(struct virtio_device *vdev) { vdev->config->reset(vdev); hwrng_unregister(&virtio_hwrng); diff --git a/trunk/drivers/char/virtio_console.c b/trunk/drivers/char/virtio_console.c index a035ae39a359..0d328b59568d 100644 --- a/trunk/drivers/char/virtio_console.c +++ b/trunk/drivers/char/virtio_console.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include "hvc_console.h" diff --git a/trunk/drivers/cpuidle/cpuidle.c b/trunk/drivers/cpuidle/cpuidle.c index 12fdd3987a36..ad41f19b8e3f 100644 --- a/trunk/drivers/cpuidle/cpuidle.c +++ b/trunk/drivers/cpuidle/cpuidle.c @@ -76,11 +76,8 @@ static void cpuidle_idle_call(void) #endif /* ask the governor for the next state */ next_state = cpuidle_curr_governor->select(dev); - if (need_resched()) { - local_irq_enable(); + if (need_resched()) return; - } - target_state = &dev->states[next_state]; /* enter the state and update stats */ diff --git a/trunk/drivers/crypto/padlock-sha.c b/trunk/drivers/crypto/padlock-sha.c index 0af80577dc7b..76cb6b345e7b 100644 --- a/trunk/drivers/crypto/padlock-sha.c +++ b/trunk/drivers/crypto/padlock-sha.c @@ -24,12 +24,6 @@ #include #include "padlock.h" -#ifdef CONFIG_64BIT -#define STACK_ALIGN 16 -#else -#define STACK_ALIGN 4 -#endif - struct padlock_sha_desc { struct shash_desc fallback; }; @@ -70,9 +64,7 @@ static int padlock_sha1_finup(struct shash_desc *desc, const u8 *in, /* We can't store directly to *out as it may be unaligned. */ /* BTW Don't reduce the buffer size below 128 Bytes! * PadLock microcode needs it that big. */ - char buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN] __attribute__ - ((aligned(STACK_ALIGN))); - char *result = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT); + char result[128] __attribute__ ((aligned(PADLOCK_ALIGNMENT))); struct padlock_sha_desc *dctx = shash_desc_ctx(desc); struct sha1_state state; unsigned int space; @@ -136,9 +128,7 @@ static int padlock_sha256_finup(struct shash_desc *desc, const u8 *in, /* We can't store directly to *out as it may be unaligned. */ /* BTW Don't reduce the buffer size below 128 Bytes! * PadLock microcode needs it that big. */ - char buf[128 + PADLOCK_ALIGNMENT - STACK_ALIGN] __attribute__ - ((aligned(STACK_ALIGN))); - char *result = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT); + char result[128] __attribute__ ((aligned(PADLOCK_ALIGNMENT))); struct padlock_sha_desc *dctx = shash_desc_ctx(desc); struct sha256_state state; unsigned int space; diff --git a/trunk/drivers/edac/amd64_edac.c b/trunk/drivers/edac/amd64_edac.c index d4560d9d5a83..4f4ac82382f7 100644 --- a/trunk/drivers/edac/amd64_edac.c +++ b/trunk/drivers/edac/amd64_edac.c @@ -1122,7 +1122,7 @@ static void k8_read_dram_base_limit(struct amd64_pvt *pvt, int dram) debugf0("Reading K8_DRAM_BASE_LOW failed\n"); /* Extract parts into separate data entries */ - pvt->dram_base[dram] = ((u64) low & 0xFFFF0000) << 8; + pvt->dram_base[dram] = ((u64) low & 0xFFFF0000) << 24; pvt->dram_IntlvEn[dram] = (low >> 8) & 0x7; pvt->dram_rw_en[dram] = (low & 0x3); @@ -1135,7 +1135,7 @@ static void k8_read_dram_base_limit(struct amd64_pvt *pvt, int dram) * Extract parts into separate data entries. Limit is the HIGHEST memory * location of the region, so lower 24 bits need to be all ones */ - pvt->dram_limit[dram] = (((u64) low & 0xFFFF0000) << 8) | 0x00FFFFFF; + pvt->dram_limit[dram] = (((u64) low & 0xFFFF0000) << 24) | 0x00FFFFFF; pvt->dram_IntlvSel[dram] = (low >> 8) & 0x7; pvt->dram_DstNode[dram] = (low & 0x7); } @@ -1369,7 +1369,7 @@ static void f10_read_dram_base_limit(struct amd64_pvt *pvt, int dram) pvt->dram_IntlvEn[dram] = (low_base >> 8) & 0x7; pvt->dram_base[dram] = (((u64)high_base & 0x000000FF) << 40) | - (((u64)low_base & 0xFFFF0000) << 8); + (((u64)low_base & 0xFFFF0000) << 24); low_offset = K8_DRAM_LIMIT_LOW + (dram << 3); high_offset = F10_DRAM_LIMIT_HIGH + (dram << 3); @@ -1391,7 +1391,7 @@ static void f10_read_dram_base_limit(struct amd64_pvt *pvt, int dram) * memory location of the region, so low 24 bits need to be all ones. */ pvt->dram_limit[dram] = (((u64)high_limit & 0x000000FF) << 40) | - (((u64) low_limit & 0xFFFF0000) << 8) | + (((u64) low_limit & 0xFFFF0000) << 24) | 0x00FFFFFF; } diff --git a/trunk/drivers/edac/i5000_edac.c b/trunk/drivers/edac/i5000_edac.c index 77a9579d7167..d335086f4a26 100644 --- a/trunk/drivers/edac/i5000_edac.c +++ b/trunk/drivers/edac/i5000_edac.c @@ -1173,7 +1173,7 @@ static void i5000_get_mc_regs(struct mem_ctl_info *mci) pci_read_config_word(pvt->branch_1, where, &pvt->b1_mtr[slot_row]); debugf2("MTR%d where=0x%x B1 value=0x%x\n", slot_row, - where, pvt->b1_mtr[slot_row]); + where, pvt->b0_mtr[slot_row]); } else { pvt->b1_mtr[slot_row] = 0; } @@ -1232,7 +1232,7 @@ static int i5000_init_csrows(struct mem_ctl_info *mci) struct csrow_info *p_csrow; int empty, channel_count; int max_csrows; - int mtr, mtr1; + int mtr; int csrow_megs; int channel; int csrow; @@ -1251,10 +1251,9 @@ static int i5000_init_csrows(struct mem_ctl_info *mci) /* use branch 0 for the basis */ mtr = pvt->b0_mtr[csrow >> 1]; - mtr1 = pvt->b1_mtr[csrow >> 1]; /* if no DIMMS on this row, continue */ - if (!MTR_DIMMS_PRESENT(mtr) && !MTR_DIMMS_PRESENT(mtr1)) + if (!MTR_DIMMS_PRESENT(mtr)) continue; /* FAKE OUT VALUES, FIXME */ diff --git a/trunk/drivers/edac/i5400_edac.c b/trunk/drivers/edac/i5400_edac.c index f99d10655ed4..b08b6d8e2dc7 100644 --- a/trunk/drivers/edac/i5400_edac.c +++ b/trunk/drivers/edac/i5400_edac.c @@ -46,10 +46,9 @@ /* Limits for i5400 */ #define NUM_MTRS_PER_BRANCH 4 #define CHANNELS_PER_BRANCH 2 -#define MAX_DIMMS_PER_CHANNEL NUM_MTRS_PER_BRANCH #define MAX_CHANNELS 4 -/* max possible csrows per channel */ -#define MAX_CSROWS (MAX_DIMMS_PER_CHANNEL) +#define MAX_DIMMS (MAX_CHANNELS * 4) /* Up to 4 DIMM's per channel */ +#define MAX_CSROWS (MAX_DIMMS * 2) /* max possible csrows per channel */ /* Device 16, * Function 0: System Address @@ -332,6 +331,7 @@ static const struct i5400_dev_info i5400_devs[] = { struct i5400_dimm_info { int megabytes; /* size, 0 means not present */ + int dual_rank; }; /* driver private data structure */ @@ -849,9 +849,11 @@ static int determine_mtr(struct i5400_pvt *pvt, int csrow, int channel) int n; /* There is one MTR for each slot pair of FB-DIMMs, + Each slot may have one or two ranks (2 csrows), Each slot pair may be at branch 0 or branch 1. + So, csrow should be divided by eight */ - n = csrow; + n = csrow >> 3; if (n >= NUM_MTRS_PER_BRANCH) { debugf0("ERROR: trying to access an invalid csrow: %d\n", @@ -903,22 +905,25 @@ static void handle_channel(struct i5400_pvt *pvt, int csrow, int channel, amb_present_reg = determine_amb_present_reg(pvt, channel); /* Determine if there is a DIMM present in this DIMM slot */ - if (amb_present_reg & (1 << csrow)) { - /* Start with the number of bits for a Bank - * on the DRAM */ - addrBits = MTR_DRAM_BANKS_ADDR_BITS(mtr); - /* Add thenumber of ROW bits */ - addrBits += MTR_DIMM_ROWS_ADDR_BITS(mtr); - /* add the number of COLUMN bits */ - addrBits += MTR_DIMM_COLS_ADDR_BITS(mtr); - /* add the number of RANK bits */ - addrBits += MTR_DIMM_RANK(mtr); - - addrBits += 6; /* add 64 bits per DIMM */ - addrBits -= 20; /* divide by 2^^20 */ - addrBits -= 3; /* 8 bits per bytes */ - - dinfo->megabytes = 1 << addrBits; + if (amb_present_reg & (1 << (csrow >> 1))) { + dinfo->dual_rank = MTR_DIMM_RANK(mtr); + + if (!((dinfo->dual_rank == 0) && + ((csrow & 0x1) == 0x1))) { + /* Start with the number of bits for a Bank + * on the DRAM */ + addrBits = MTR_DRAM_BANKS_ADDR_BITS(mtr); + /* Add thenumber of ROW bits */ + addrBits += MTR_DIMM_ROWS_ADDR_BITS(mtr); + /* add the number of COLUMN bits */ + addrBits += MTR_DIMM_COLS_ADDR_BITS(mtr); + + addrBits += 6; /* add 64 bits per DIMM */ + addrBits -= 20; /* divide by 2^^20 */ + addrBits -= 3; /* 8 bits per bytes */ + + dinfo->megabytes = 1 << addrBits; + } } } } @@ -946,12 +951,12 @@ static void calculate_dimm_size(struct i5400_pvt *pvt) return; } - /* Scan all the actual CSROWS + /* Scan all the actual CSROWS (which is # of DIMMS * 2) * and calculate the information for each DIMM * Start with the highest csrow first, to display it first * and work toward the 0th csrow */ - max_csrows = pvt->maxdimmperch; + max_csrows = pvt->maxdimmperch * 2; for (csrow = max_csrows - 1; csrow >= 0; csrow--) { /* on an odd csrow, first output a 'boundary' marker, @@ -1059,7 +1064,7 @@ static void i5400_get_mc_regs(struct mem_ctl_info *mci) /* Get the set of MTR[0-3] regs by each branch */ for (slot_row = 0; slot_row < NUM_MTRS_PER_BRANCH; slot_row++) { - int where = MTR0 + (slot_row * sizeof(u16)); + int where = MTR0 + (slot_row * sizeof(u32)); /* Branch 0 set of MTR registers */ pci_read_config_word(pvt->branch_0, where, @@ -1141,7 +1146,7 @@ static int i5400_init_csrows(struct mem_ctl_info *mci) pvt = mci->pvt_info; channel_count = pvt->maxch; - max_csrows = pvt->maxdimmperch; + max_csrows = pvt->maxdimmperch * 2; empty = 1; /* Assume NO memory */ @@ -1209,6 +1214,28 @@ static void i5400_enable_error_reporting(struct mem_ctl_info *mci) fbd_error_mask); } +/* + * i5400_get_dimm_and_channel_counts(pdev, &num_csrows, &num_channels) + * + * ask the device how many channels are present and how many CSROWS + * as well + */ +static void i5400_get_dimm_and_channel_counts(struct pci_dev *pdev, + int *num_dimms_per_channel, + int *num_channels) +{ + u8 value; + + /* Need to retrieve just how many channels and dimms per channel are + * supported on this memory controller + */ + pci_read_config_byte(pdev, MAXDIMMPERCH, &value); + *num_dimms_per_channel = (int)value * 2; + + pci_read_config_byte(pdev, MAXCH, &value); + *num_channels = (int)value; +} + /* * i5400_probe1 Probe for ONE instance of device to see if it is * present. @@ -1236,16 +1263,22 @@ static int i5400_probe1(struct pci_dev *pdev, int dev_idx) if (PCI_FUNC(pdev->devfn) != 0) return -ENODEV; - /* As we don't have a motherboard identification routine to determine + /* Ask the devices for the number of CSROWS and CHANNELS so + * that we can calculate the memory resources, etc + * + * The Chipset will report what it can handle which will be greater + * or equal to what the motherboard manufacturer will implement. + * + * As we don't have a motherboard identification routine to determine * actual number of slots/dimms per channel, we thus utilize the * resource as specified by the chipset. Thus, we might have * have more DIMMs per channel than actually on the mobo, but this * allows the driver to support upto the chipset max, without * some fancy mobo determination. */ - num_dimms_per_channel = MAX_DIMMS_PER_CHANNEL; - num_channels = MAX_CHANNELS; - num_csrows = num_dimms_per_channel; + i5400_get_dimm_and_channel_counts(pdev, &num_dimms_per_channel, + &num_channels); + num_csrows = num_dimms_per_channel * 2; debugf0("MC: %s(): Number of - Channels= %d DIMMS= %d CSROWS= %d\n", __func__, num_channels, num_dimms_per_channel, num_csrows); diff --git a/trunk/drivers/edac/mpc85xx_edac.c b/trunk/drivers/edac/mpc85xx_edac.c index cf27402af97b..157f6504f25e 100644 --- a/trunk/drivers/edac/mpc85xx_edac.c +++ b/trunk/drivers/edac/mpc85xx_edac.c @@ -26,9 +26,7 @@ #include "mpc85xx_edac.h" static int edac_dev_idx; -#ifdef CONFIG_PCI static int edac_pci_idx; -#endif static int edac_mc_idx; static u32 orig_ddr_err_disable; diff --git a/trunk/drivers/gpio/twl4030-gpio.c b/trunk/drivers/gpio/twl4030-gpio.c index 49384a7c5492..afad14792141 100644 --- a/trunk/drivers/gpio/twl4030-gpio.c +++ b/trunk/drivers/gpio/twl4030-gpio.c @@ -460,8 +460,7 @@ static int __devinit gpio_twl4030_probe(struct platform_device *pdev) return ret; } -/* Cannot use __devexit as gpio_twl4030_probe() calls us */ -static int gpio_twl4030_remove(struct platform_device *pdev) +static int __devexit gpio_twl4030_remove(struct platform_device *pdev) { struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data; int status; @@ -494,7 +493,7 @@ static struct platform_driver gpio_twl4030_driver = { .driver.name = "twl4030_gpio", .driver.owner = THIS_MODULE, .probe = gpio_twl4030_probe, - .remove = gpio_twl4030_remove, + .remove = __devexit_p(gpio_twl4030_remove), }; static int __init gpio_twl4030_init(void) diff --git a/trunk/drivers/hwmon/hp_accel.c b/trunk/drivers/hwmon/hp_accel.c index be475e844c2a..6679854c85b0 100644 --- a/trunk/drivers/hwmon/hp_accel.c +++ b/trunk/drivers/hwmon/hp_accel.c @@ -197,13 +197,11 @@ static struct dmi_system_id lis3lv02d_dmi_ids[] = { AXIS_DMI_MATCH("HP2133", "HP 2133", xy_rotated_left), AXIS_DMI_MATCH("HP2140", "HP 2140", xy_swap_inverted), AXIS_DMI_MATCH("NC653x", "HP Compaq 653", xy_rotated_left_usd), - AXIS_DMI_MATCH("NC6730b", "HP Compaq 6730b", xy_rotated_left_usd), - AXIS_DMI_MATCH("NC6730s", "HP Compaq 6730s", xy_swap), + AXIS_DMI_MATCH("NC673x", "HP Compaq 673", xy_rotated_left_usd), AXIS_DMI_MATCH("NC651xx", "HP Compaq 651", xy_rotated_right), AXIS_DMI_MATCH("NC6710x", "HP Compaq 6710", xy_swap_yz_inverted), AXIS_DMI_MATCH("NC6715x", "HP Compaq 6715", y_inverted), AXIS_DMI_MATCH("NC693xx", "HP EliteBook 693", xy_rotated_right), - AXIS_DMI_MATCH("NC693xx", "HP EliteBook 853", xy_swap), /* Intel-based HP Pavilion dv5 */ AXIS_DMI_MATCH2("HPDV5_I", PRODUCT_NAME, "HP Pavilion dv5", @@ -216,7 +214,6 @@ static struct dmi_system_id lis3lv02d_dmi_ids[] = { y_inverted), AXIS_DMI_MATCH("DV7", "HP Pavilion dv7", x_inverted), AXIS_DMI_MATCH("HP8710", "HP Compaq 8710", y_inverted), - AXIS_DMI_MATCH("HDX18", "HP HDX 18", x_inverted), { NULL, } /* Laptop models without axis info (yet): * "NC6910" "HP Compaq 6910" diff --git a/trunk/drivers/ide/atiixp.c b/trunk/drivers/ide/atiixp.c index 837322b10a4c..6396c3ad3252 100644 --- a/trunk/drivers/ide/atiixp.c +++ b/trunk/drivers/ide/atiixp.c @@ -177,7 +177,7 @@ static const struct pci_device_id atiixp_pci_tbl[] = { { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP400_IDE), 0 }, { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP600_IDE), 1 }, { PCI_VDEVICE(ATI, PCI_DEVICE_ID_ATI_IXP700_IDE), 0 }, - { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_HUDSON2_IDE), 0 }, + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_SB900_IDE), 0 }, { 0, }, }; MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); diff --git a/trunk/drivers/input/input.c b/trunk/drivers/input/input.c index cc763c96fada..c6f88ebb40c7 100644 --- a/trunk/drivers/input/input.c +++ b/trunk/drivers/input/input.c @@ -782,29 +782,10 @@ static unsigned int input_proc_devices_poll(struct file *file, poll_table *wait) return 0; } -union input_seq_state { - struct { - unsigned short pos; - bool mutex_acquired; - }; - void *p; -}; - static void *input_devices_seq_start(struct seq_file *seq, loff_t *pos) { - union input_seq_state *state = (union input_seq_state *)&seq->private; - int error; - - /* We need to fit into seq->private pointer */ - BUILD_BUG_ON(sizeof(union input_seq_state) != sizeof(seq->private)); - - error = mutex_lock_interruptible(&input_mutex); - if (error) { - state->mutex_acquired = false; - return ERR_PTR(error); - } - - state->mutex_acquired = true; + if (mutex_lock_interruptible(&input_mutex)) + return NULL; return seq_list_start(&input_dev_list, *pos); } @@ -814,12 +795,9 @@ static void *input_devices_seq_next(struct seq_file *seq, void *v, loff_t *pos) return seq_list_next(v, &input_dev_list, pos); } -static void input_seq_stop(struct seq_file *seq, void *v) +static void input_devices_seq_stop(struct seq_file *seq, void *v) { - union input_seq_state *state = (union input_seq_state *)&seq->private; - - if (state->mutex_acquired) - mutex_unlock(&input_mutex); + mutex_unlock(&input_mutex); } static void input_seq_print_bitmap(struct seq_file *seq, const char *name, @@ -883,7 +861,7 @@ static int input_devices_seq_show(struct seq_file *seq, void *v) static const struct seq_operations input_devices_seq_ops = { .start = input_devices_seq_start, .next = input_devices_seq_next, - .stop = input_seq_stop, + .stop = input_devices_seq_stop, .show = input_devices_seq_show, }; @@ -903,49 +881,40 @@ static const struct file_operations input_devices_fileops = { static void *input_handlers_seq_start(struct seq_file *seq, loff_t *pos) { - union input_seq_state *state = (union input_seq_state *)&seq->private; - int error; - - /* We need to fit into seq->private pointer */ - BUILD_BUG_ON(sizeof(union input_seq_state) != sizeof(seq->private)); - - error = mutex_lock_interruptible(&input_mutex); - if (error) { - state->mutex_acquired = false; - return ERR_PTR(error); - } - - state->mutex_acquired = true; - state->pos = *pos; + if (mutex_lock_interruptible(&input_mutex)) + return NULL; + seq->private = (void *)(unsigned long)*pos; return seq_list_start(&input_handler_list, *pos); } static void *input_handlers_seq_next(struct seq_file *seq, void *v, loff_t *pos) { - union input_seq_state *state = (union input_seq_state *)&seq->private; - - state->pos = *pos + 1; + seq->private = (void *)(unsigned long)(*pos + 1); return seq_list_next(v, &input_handler_list, pos); } +static void input_handlers_seq_stop(struct seq_file *seq, void *v) +{ + mutex_unlock(&input_mutex); +} + static int input_handlers_seq_show(struct seq_file *seq, void *v) { struct input_handler *handler = container_of(v, struct input_handler, node); - union input_seq_state *state = (union input_seq_state *)&seq->private; - seq_printf(seq, "N: Number=%u Name=%s", state->pos, handler->name); + seq_printf(seq, "N: Number=%ld Name=%s", + (unsigned long)seq->private, handler->name); if (handler->fops) seq_printf(seq, " Minor=%d", handler->minor); seq_putc(seq, '\n'); return 0; } - static const struct seq_operations input_handlers_seq_ops = { .start = input_handlers_seq_start, .next = input_handlers_seq_next, - .stop = input_seq_stop, + .stop = input_handlers_seq_stop, .show = input_handlers_seq_show, }; diff --git a/trunk/drivers/input/keyboard/atkbd.c b/trunk/drivers/input/keyboard/atkbd.c index a6512372c7a3..4709e15af607 100644 --- a/trunk/drivers/input/keyboard/atkbd.c +++ b/trunk/drivers/input/keyboard/atkbd.c @@ -574,22 +574,11 @@ static void atkbd_event_work(struct work_struct *work) mutex_lock(&atkbd->event_mutex); - if (!atkbd->enabled) { - /* - * Serio ports are resumed asynchronously so while driver core - * thinks that device is already fully operational in reality - * it may not be ready yet. In this case we need to keep - * rescheduling till reconnect completes. - */ - schedule_delayed_work(&atkbd->event_work, - msecs_to_jiffies(100)); - } else { - if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) - atkbd_set_leds(atkbd); + if (test_and_clear_bit(ATKBD_LED_EVENT_BIT, &atkbd->event_mask)) + atkbd_set_leds(atkbd); - if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) - atkbd_set_repeat_rate(atkbd); - } + if (test_and_clear_bit(ATKBD_REP_EVENT_BIT, &atkbd->event_mask)) + atkbd_set_repeat_rate(atkbd); mutex_unlock(&atkbd->event_mutex); } @@ -781,30 +770,6 @@ static int atkbd_select_set(struct atkbd *atkbd, int target_set, int allow_extra return 3; } -static int atkbd_reset_state(struct atkbd *atkbd) -{ - struct ps2dev *ps2dev = &atkbd->ps2dev; - unsigned char param[1]; - -/* - * Set the LEDs to a predefined state (all off). - */ - - param[0] = 0; - if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS)) - return -1; - -/* - * Set autorepeat to fastest possible. - */ - - param[0] = 0; - if (ps2_command(ps2dev, param, ATKBD_CMD_SETREP)) - return -1; - - return 0; -} - static int atkbd_activate(struct atkbd *atkbd) { struct ps2dev *ps2dev = &atkbd->ps2dev; @@ -886,6 +851,29 @@ static unsigned int atkbd_hp_forced_release_keys[] = { 0x94, -1U }; +/* + * Inventec system with broken key release on volume keys + */ +static unsigned int atkbd_inventec_forced_release_keys[] = { + 0xae, 0xb0, -1U +}; + +/* + * Perform fixup for HP Pavilion ZV6100 laptop that doesn't generate release + * for its volume buttons + */ +static unsigned int atkbd_hp_zv6100_forced_release_keys[] = { + 0xae, 0xb0, -1U +}; + +/* + * Perform fixup for HP (Compaq) Presario R4000 R4100 R4200 that don't generate + * release for their volume buttons + */ +static unsigned int atkbd_hp_r4000_forced_release_keys[] = { + 0xae, 0xb0, -1U +}; + /* * Samsung NC10,NC20 with Fn+F? key release not working */ @@ -893,6 +881,14 @@ static unsigned int atkbd_samsung_forced_release_keys[] = { 0x82, 0x83, 0x84, 0x86, 0x88, 0x89, 0xb3, 0xf7, 0xf9, -1U }; +/* + * The volume up and volume down special keys on a Fujitsu Amilo PA 1510 laptop + * do not generate release events so we have to do it ourselves. + */ +static unsigned int atkbd_amilo_pa1510_forced_release_keys[] = { + 0xb0, 0xae, -1U +}; + /* * Amilo Pi 3525 key release for Fn+Volume keys not working */ @@ -914,14 +910,6 @@ static unsigned int atkdb_soltech_ta12_forced_release_keys[] = { 0xa0, 0xae, 0xb0, -1U }; -/* - * Many notebooks don't send key release event for volume up/down - * keys, with key list below common among them - */ -static unsigned int atkbd_volume_forced_release_keys[] = { - 0xae, 0xb0, -1U -}; - /* * atkbd_set_keycode_table() initializes keyboard's keycode table * according to the selected scancode set @@ -1099,7 +1087,6 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv) } atkbd->set = atkbd_select_set(atkbd, atkbd_set, atkbd_extra); - atkbd_reset_state(atkbd); atkbd_activate(atkbd); } else { @@ -1280,7 +1267,6 @@ static ssize_t atkbd_set_extra(struct atkbd *atkbd, const char *buf, size_t coun atkbd->dev = new_dev; atkbd->set = atkbd_select_set(atkbd, atkbd->set, value); - atkbd_reset_state(atkbd); atkbd_activate(atkbd); atkbd_set_keycode_table(atkbd); atkbd_set_device_attrs(atkbd); @@ -1562,7 +1548,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion ZV6100"), }, .callback = atkbd_setup_forced_release, - .driver_data = atkbd_volume_forced_release_keys, + .driver_data = atkbd_hp_zv6100_forced_release_keys, }, { .ident = "HP Presario R4000", @@ -1571,7 +1557,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4000"), }, .callback = atkbd_setup_forced_release, - .driver_data = atkbd_volume_forced_release_keys, + .driver_data = atkbd_hp_r4000_forced_release_keys, }, { .ident = "HP Presario R4100", @@ -1580,7 +1566,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4100"), }, .callback = atkbd_setup_forced_release, - .driver_data = atkbd_volume_forced_release_keys, + .driver_data = atkbd_hp_r4000_forced_release_keys, }, { .ident = "HP Presario R4200", @@ -1589,7 +1575,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { DMI_MATCH(DMI_PRODUCT_NAME, "Presario R4200"), }, .callback = atkbd_setup_forced_release, - .driver_data = atkbd_volume_forced_release_keys, + .driver_data = atkbd_hp_r4000_forced_release_keys, }, { .ident = "Inventec Symphony", @@ -1598,7 +1584,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"), }, .callback = atkbd_setup_forced_release, - .driver_data = atkbd_volume_forced_release_keys, + .driver_data = atkbd_inventec_forced_release_keys, }, { .ident = "Samsung NC10", @@ -1634,7 +1620,7 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 1510"), }, .callback = atkbd_setup_forced_release, - .driver_data = atkbd_volume_forced_release_keys, + .driver_data = atkbd_amilo_pa1510_forced_release_keys, }, { .ident = "Fujitsu Amilo Pi 3525", diff --git a/trunk/drivers/input/misc/hp_sdc_rtc.c b/trunk/drivers/input/misc/hp_sdc_rtc.c index ea821b546969..216a559f55ea 100644 --- a/trunk/drivers/input/misc/hp_sdc_rtc.c +++ b/trunk/drivers/input/misc/hp_sdc_rtc.c @@ -209,7 +209,7 @@ static inline int hp_sdc_rtc_read_rt(struct timeval *res) { /* Read the i8042 fast handshake timer */ static inline int hp_sdc_rtc_read_fhs(struct timeval *res) { - int64_t raw; + uint64_t raw; unsigned int tenms; raw = hp_sdc_rtc_read_i8042timer(HP_SDC_CMD_LOAD_FHS, 2); diff --git a/trunk/drivers/input/mouse/logips2pp.c b/trunk/drivers/input/mouse/logips2pp.c index ab5dc5f5fd83..de745d751162 100644 --- a/trunk/drivers/input/mouse/logips2pp.c +++ b/trunk/drivers/input/mouse/logips2pp.c @@ -219,7 +219,7 @@ static const struct ps2pp_info *get_model_info(unsigned char model) PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL }, { 72, PS2PP_KIND_TRACKMAN, 0 }, /* T-CH11: TrackMan Marble */ - { 73, PS2PP_KIND_TRACKMAN, PS2PP_SIDE_BTN }, /* TrackMan FX */ + { 73, 0, PS2PP_SIDE_BTN }, { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, { 79, PS2PP_KIND_TRACKMAN, PS2PP_WHEEL }, /* TrackMan with wheel */ diff --git a/trunk/drivers/input/mouse/synaptics.c b/trunk/drivers/input/mouse/synaptics.c index f4a61252bcc9..b66ff1ac7dea 100644 --- a/trunk/drivers/input/mouse/synaptics.c +++ b/trunk/drivers/input/mouse/synaptics.c @@ -652,16 +652,6 @@ static const struct dmi_system_id toshiba_dmi_table[] = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M300"), }, - - }, - { - .ident = "Toshiba Portege M300", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), - DMI_MATCH(DMI_PRODUCT_NAME, "Portable PC"), - DMI_MATCH(DMI_PRODUCT_VERSION, "Version 1.0"), - }, - }, { } }; diff --git a/trunk/drivers/input/serio/i8042-x86ia64io.h b/trunk/drivers/input/serio/i8042-x86ia64io.h index a537925f7651..a39bc4eb902b 100644 --- a/trunk/drivers/input/serio/i8042-x86ia64io.h +++ b/trunk/drivers/input/serio/i8042-x86ia64io.h @@ -326,17 +326,6 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"), }, }, - { - /* - * Reset and GET ID commands issued via KBD port are - * sometimes being delivered to AUX3. - */ - .ident = "Sony Vaio FZ-240E", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), - DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"), - }, - }, { .ident = "Amoi M636/A737", .matches = { @@ -672,7 +661,7 @@ static void i8042_pnp_exit(void) static int __init i8042_pnp_init(void) { char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 }; - bool pnp_data_busted = false; + int pnp_data_busted = false; int err; #ifdef CONFIG_X86 diff --git a/trunk/drivers/md/dm-exception-store.c b/trunk/drivers/md/dm-exception-store.c index 7dbe652efb5a..556acff3952f 100644 --- a/trunk/drivers/md/dm-exception-store.c +++ b/trunk/drivers/md/dm-exception-store.c @@ -138,6 +138,16 @@ int dm_exception_store_type_unregister(struct dm_exception_store_type *type) } EXPORT_SYMBOL(dm_exception_store_type_unregister); +/* + * Round a number up to the nearest 'size' boundary. size must + * be a power of 2. + */ +static ulong round_up(ulong n, ulong size) +{ + size--; + return (n + size) & ~size; +} + static int set_chunk_size(struct dm_exception_store *store, const char *chunk_size_arg, char **error) { @@ -145,8 +155,7 @@ static int set_chunk_size(struct dm_exception_store *store, char *value; chunk_size_ulong = simple_strtoul(chunk_size_arg, &value, 10); - if (*chunk_size_arg == '\0' || *value != '\0' || - chunk_size_ulong > UINT_MAX) { + if (*chunk_size_arg == '\0' || *value != '\0') { *error = "Invalid chunk size"; return -EINVAL; } @@ -156,35 +165,40 @@ static int set_chunk_size(struct dm_exception_store *store, return 0; } - return dm_exception_store_set_chunk_size(store, - (unsigned) chunk_size_ulong, + /* + * Chunk size must be multiple of page size. Silently + * round up if it's not. + */ + chunk_size_ulong = round_up(chunk_size_ulong, PAGE_SIZE >> 9); + + return dm_exception_store_set_chunk_size(store, chunk_size_ulong, error); } int dm_exception_store_set_chunk_size(struct dm_exception_store *store, - unsigned chunk_size, + unsigned long chunk_size_ulong, char **error) { /* Check chunk_size is a power of 2 */ - if (!is_power_of_2(chunk_size)) { + if (!is_power_of_2(chunk_size_ulong)) { *error = "Chunk size is not a power of 2"; return -EINVAL; } /* Validate the chunk size against the device block size */ - if (chunk_size % (bdev_logical_block_size(store->cow->bdev) >> 9)) { + if (chunk_size_ulong % (bdev_logical_block_size(store->cow->bdev) >> 9)) { *error = "Chunk size is not a multiple of device blocksize"; return -EINVAL; } - if (chunk_size > INT_MAX >> SECTOR_SHIFT) { + if (chunk_size_ulong > INT_MAX >> SECTOR_SHIFT) { *error = "Chunk size is too high"; return -EINVAL; } - store->chunk_size = chunk_size; - store->chunk_mask = chunk_size - 1; - store->chunk_shift = ffs(chunk_size) - 1; + store->chunk_size = chunk_size_ulong; + store->chunk_mask = chunk_size_ulong - 1; + store->chunk_shift = ffs(chunk_size_ulong) - 1; return 0; } @@ -237,7 +251,7 @@ int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, r = set_chunk_size(tmp_store, argv[2], &ti->error); if (r) - goto bad_ctr; + goto bad_cow; r = type->ctr(tmp_store, 0, NULL); if (r) { diff --git a/trunk/drivers/md/dm-exception-store.h b/trunk/drivers/md/dm-exception-store.h index 8a223a48802c..812c71872ba0 100644 --- a/trunk/drivers/md/dm-exception-store.h +++ b/trunk/drivers/md/dm-exception-store.h @@ -101,9 +101,9 @@ struct dm_exception_store { struct dm_dev *cow; /* Size of data blocks saved - must be a power of 2 */ - unsigned chunk_size; - unsigned chunk_mask; - unsigned chunk_shift; + chunk_t chunk_size; + chunk_t chunk_mask; + chunk_t chunk_shift; void *context; }; @@ -169,7 +169,7 @@ int dm_exception_store_type_register(struct dm_exception_store_type *type); int dm_exception_store_type_unregister(struct dm_exception_store_type *type); int dm_exception_store_set_chunk_size(struct dm_exception_store *store, - unsigned chunk_size, + unsigned long chunk_size_ulong, char **error); int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, diff --git a/trunk/drivers/md/dm-log-userspace-base.c b/trunk/drivers/md/dm-log-userspace-base.c index 7ac2c1450d10..652bd33109e3 100644 --- a/trunk/drivers/md/dm-log-userspace-base.c +++ b/trunk/drivers/md/dm-log-userspace-base.c @@ -156,7 +156,7 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti, } /* The ptr value is sufficient for local unique id */ - lc->luid = (unsigned long)lc; + lc->luid = (uint64_t)lc; lc->ti = ti; diff --git a/trunk/drivers/md/dm-snap-persistent.c b/trunk/drivers/md/dm-snap-persistent.c index 0c746420c008..d5b2e08750d5 100644 --- a/trunk/drivers/md/dm-snap-persistent.c +++ b/trunk/drivers/md/dm-snap-persistent.c @@ -284,13 +284,12 @@ static int read_header(struct pstore *ps, int *new_snapshot) { int r; struct disk_header *dh; - unsigned chunk_size; + chunk_t chunk_size; int chunk_size_supplied = 1; char *chunk_err; /* - * Use default chunk size (or logical_block_size, if larger) - * if none supplied + * Use default chunk size (or hardsect_size, if larger) if none supplied */ if (!ps->store->chunk_size) { ps->store->chunk_size = max(DM_CHUNK_SIZE_DEFAULT_SECTORS, @@ -335,9 +334,10 @@ static int read_header(struct pstore *ps, int *new_snapshot) return 0; if (chunk_size_supplied) - DMWARN("chunk size %u in device metadata overrides " - "table chunk size of %u.", - chunk_size, ps->store->chunk_size); + DMWARN("chunk size %llu in device metadata overrides " + "table chunk size of %llu.", + (unsigned long long)chunk_size, + (unsigned long long)ps->store->chunk_size); /* We had a bogus chunk_size. Fix stuff up. */ free_area(ps); @@ -345,8 +345,8 @@ static int read_header(struct pstore *ps, int *new_snapshot) r = dm_exception_store_set_chunk_size(ps->store, chunk_size, &chunk_err); if (r) { - DMERR("invalid on-disk chunk size %u: %s.", - chunk_size, chunk_err); + DMERR("invalid on-disk chunk size %llu: %s.", + (unsigned long long)chunk_size, chunk_err); return r; } diff --git a/trunk/drivers/md/dm-snap.c b/trunk/drivers/md/dm-snap.c index 3a3ba46e6d4b..57f1bf7f3b7a 100644 --- a/trunk/drivers/md/dm-snap.c +++ b/trunk/drivers/md/dm-snap.c @@ -296,7 +296,6 @@ static void __insert_origin(struct origin *o) */ static int register_snapshot(struct dm_snapshot *snap) { - struct dm_snapshot *l; struct origin *o, *new_o; struct block_device *bdev = snap->origin->bdev; @@ -320,11 +319,7 @@ static int register_snapshot(struct dm_snapshot *snap) __insert_origin(o); } - /* Sort the list according to chunk size, largest-first smallest-last */ - list_for_each_entry(l, &o->snapshots, list) - if (l->store->chunk_size < snap->store->chunk_size) - break; - list_add_tail(&snap->list, &l->list); + list_add_tail(&snap->list, &o->snapshots); up_write(&_origins_lock); return 0; @@ -673,11 +668,6 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) bio_list_init(&s->queued_bios); INIT_WORK(&s->queued_bios_work, flush_queued_bios); - if (!s->store->chunk_size) { - ti->error = "Chunk size not set"; - goto bad_load_and_register; - } - /* Add snapshot to the list of snapshots for this origin */ /* Exceptions aren't triggered till snapshot_resume() is called */ if (register_snapshot(s)) { @@ -961,7 +951,7 @@ static void start_copy(struct dm_snap_pending_exception *pe) src.bdev = bdev; src.sector = chunk_to_sector(s->store, pe->e.old_chunk); - src.count = min((sector_t)s->store->chunk_size, dev_size - src.sector); + src.count = min(s->store->chunk_size, dev_size - src.sector); dest.bdev = s->store->cow->bdev; dest.sector = chunk_to_sector(s->store, pe->e.new_chunk); @@ -1152,8 +1142,6 @@ static int snapshot_status(struct dm_target *ti, status_type_t type, unsigned sz = 0; struct dm_snapshot *snap = ti->private; - down_write(&snap->lock); - switch (type) { case STATUSTYPE_INFO: if (!snap->valid) @@ -1185,8 +1173,6 @@ static int snapshot_status(struct dm_target *ti, status_type_t type, break; } - up_write(&snap->lock); - return 0; } @@ -1402,7 +1388,7 @@ static void origin_resume(struct dm_target *ti) struct dm_dev *dev = ti->private; struct dm_snapshot *snap; struct origin *o; - unsigned chunk_size = 0; + chunk_t chunk_size = 0; down_read(&_origins_lock); o = __lookup_origin(dev->bdev); @@ -1479,7 +1465,7 @@ static int __init dm_snapshot_init(void) r = dm_register_target(&snapshot_target); if (r) { DMERR("snapshot target register failed %d", r); - goto bad_register_snapshot_target; + return r; } r = dm_register_target(&origin_target); @@ -1536,9 +1522,6 @@ static int __init dm_snapshot_init(void) dm_unregister_target(&origin_target); bad1: dm_unregister_target(&snapshot_target); - -bad_register_snapshot_target: - dm_exception_store_exit(); return r; } diff --git a/trunk/drivers/md/dm.c b/trunk/drivers/md/dm.c index 724efc63904d..376f1ab48a24 100644 --- a/trunk/drivers/md/dm.c +++ b/trunk/drivers/md/dm.c @@ -47,7 +47,6 @@ struct dm_io { atomic_t io_count; struct bio *bio; unsigned long start_time; - spinlock_t endio_lock; }; /* @@ -579,12 +578,8 @@ static void dec_pending(struct dm_io *io, int error) struct mapped_device *md = io->md; /* Push-back supersedes any I/O errors */ - if (unlikely(error)) { - spin_lock_irqsave(&io->endio_lock, flags); - if (!(io->error > 0 && __noflush_suspending(md))) - io->error = error; - spin_unlock_irqrestore(&io->endio_lock, flags); - } + if (error && !(io->error > 0 && __noflush_suspending(md))) + io->error = error; if (atomic_dec_and_test(&io->io_count)) { if (io->error == DM_ENDIO_REQUEUE) { @@ -1231,7 +1226,6 @@ static void __split_and_process_bio(struct mapped_device *md, struct bio *bio) atomic_set(&ci.io->io_count, 1); ci.io->bio = bio; ci.io->md = md; - spin_lock_init(&ci.io->endio_lock); ci.sector = bio->bi_sector; ci.sector_count = bio_sectors(bio); if (unlikely(bio_empty_barrier(bio))) @@ -1828,7 +1822,6 @@ static struct mapped_device *alloc_dev(int minor) bad_bdev: destroy_workqueue(md->wq); bad_thread: - del_gendisk(md->disk); put_disk(md->disk); bad_disk: blk_cleanup_queue(md->queue); diff --git a/trunk/drivers/mmc/host/at91_mci.c b/trunk/drivers/mmc/host/at91_mci.c index 63924e0c7ea9..e556d42cc45a 100644 --- a/trunk/drivers/mmc/host/at91_mci.c +++ b/trunk/drivers/mmc/host/at91_mci.c @@ -72,6 +72,7 @@ #include #include +#include #include #include #include diff --git a/trunk/drivers/mmc/host/omap_hsmmc.c b/trunk/drivers/mmc/host/omap_hsmmc.c index 0aecaaebef3d..4487cc097911 100644 --- a/trunk/drivers/mmc/host/omap_hsmmc.c +++ b/trunk/drivers/mmc/host/omap_hsmmc.c @@ -2013,7 +2013,7 @@ static struct platform_driver omap_hsmmc_driver = { static int __init omap_hsmmc_init(void) { /* Register the MMC driver */ - return platform_driver_probe(&omap_hsmmc_driver, omap_hsmmc_probe); + return platform_driver_register(&omap_hsmmc_driver); } static void __exit omap_hsmmc_cleanup(void) diff --git a/trunk/drivers/net/benet/be_cmds.c b/trunk/drivers/net/benet/be_cmds.c index 28a0eda92680..89876ade5e33 100644 --- a/trunk/drivers/net/benet/be_cmds.c +++ b/trunk/drivers/net/benet/be_cmds.c @@ -243,26 +243,15 @@ static int be_POST_stage_get(struct be_adapter *adapter, u16 *stage) int be_cmd_POST(struct be_adapter *adapter) { - u16 stage; - int status, timeout = 0; + u16 stage, error; - do { - status = be_POST_stage_get(adapter, &stage); - if (status) { - dev_err(&adapter->pdev->dev, "POST error; stage=0x%x\n", - stage); - return -1; - } else if (stage != POST_STAGE_ARMFW_RDY) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(2 * HZ); - timeout += 2; - } else { - return 0; - } - } while (timeout < 20); + error = be_POST_stage_get(adapter, &stage); + if (error || stage != POST_STAGE_ARMFW_RDY) { + dev_err(&adapter->pdev->dev, "POST failed.\n"); + return -1; + } - dev_err(&adapter->pdev->dev, "POST timeout; stage=0x%x\n", stage); - return -1; + return 0; } static inline void *embedded_payload(struct be_mcc_wrb *wrb) @@ -740,8 +729,8 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, /* Create an rx filtering policy configuration on an i/f * Uses mbox */ -int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags, - u8 *mac, bool pmac_invalid, u32 *if_handle, u32 *pmac_id) +int be_cmd_if_create(struct be_adapter *adapter, u32 flags, u8 *mac, + bool pmac_invalid, u32 *if_handle, u32 *pmac_id) { struct be_mcc_wrb *wrb; struct be_cmd_req_if_create *req; @@ -757,8 +746,8 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags, be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, OPCODE_COMMON_NTWK_INTERFACE_CREATE, sizeof(*req)); - req->capability_flags = cpu_to_le32(cap_flags); - req->enable_flags = cpu_to_le32(en_flags); + req->capability_flags = cpu_to_le32(flags); + req->enable_flags = cpu_to_le32(flags); req->pmac_invalid = pmac_invalid; if (!pmac_invalid) memcpy(req->mac_addr, mac, ETH_ALEN); diff --git a/trunk/drivers/net/benet/be_cmds.h b/trunk/drivers/net/benet/be_cmds.h index 49953787e41c..a86f917f85f4 100644 --- a/trunk/drivers/net/benet/be_cmds.h +++ b/trunk/drivers/net/benet/be_cmds.h @@ -720,9 +720,8 @@ extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, u32 if_id, u32 *pmac_id); extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id); -extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, - u32 en_flags, u8 *mac, bool pmac_invalid, - u32 *if_handle, u32 *pmac_id); +extern int be_cmd_if_create(struct be_adapter *adapter, u32 if_flags, u8 *mac, + bool pmac_invalid, u32 *if_handle, u32 *pmac_id); extern int be_cmd_if_destroy(struct be_adapter *adapter, u32 if_handle); extern int be_cmd_eq_create(struct be_adapter *adapter, struct be_queue_info *eq, int eq_delay); diff --git a/trunk/drivers/net/benet/be_main.c b/trunk/drivers/net/benet/be_main.c index 1f941f027718..6d5e81f7046f 100644 --- a/trunk/drivers/net/benet/be_main.c +++ b/trunk/drivers/net/benet/be_main.c @@ -1620,22 +1620,19 @@ static int be_open(struct net_device *netdev) static int be_setup(struct be_adapter *adapter) { struct net_device *netdev = adapter->netdev; - u32 cap_flags, en_flags; + u32 if_flags; int status; - cap_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST | - BE_IF_FLAGS_MCAST_PROMISCUOUS | - BE_IF_FLAGS_PROMISCUOUS | - BE_IF_FLAGS_PASS_L3L4_ERRORS; - en_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST | - BE_IF_FLAGS_PASS_L3L4_ERRORS; - - status = be_cmd_if_create(adapter, cap_flags, en_flags, - netdev->dev_addr, false/* pmac_invalid */, - &adapter->if_handle, &adapter->pmac_id); + if_flags = BE_IF_FLAGS_BROADCAST | BE_IF_FLAGS_PROMISCUOUS | + BE_IF_FLAGS_MCAST_PROMISCUOUS | BE_IF_FLAGS_UNTAGGED | + BE_IF_FLAGS_PASS_L3L4_ERRORS; + status = be_cmd_if_create(adapter, if_flags, netdev->dev_addr, + false/* pmac_invalid */, &adapter->if_handle, + &adapter->pmac_id); if (status != 0) goto do_none; + status = be_tx_queues_create(adapter); if (status != 0) goto if_destroy; @@ -2058,10 +2055,6 @@ static int be_hw_up(struct be_adapter *adapter) if (status) return status; - status = be_cmd_reset_function(adapter); - if (status) - return status; - status = be_cmd_get_fw_ver(adapter, adapter->fw_ver); if (status) return status; @@ -2115,6 +2108,10 @@ static int __devinit be_probe(struct pci_dev *pdev, if (status) goto free_netdev; + status = be_cmd_reset_function(adapter); + if (status) + goto ctrl_clean; + status = be_stats_init(adapter); if (status) goto ctrl_clean; diff --git a/trunk/drivers/net/ethoc.c b/trunk/drivers/net/ethoc.c index f7d9ac8324cb..9c950bb5e90c 100644 --- a/trunk/drivers/net/ethoc.c +++ b/trunk/drivers/net/ethoc.c @@ -223,25 +223,24 @@ struct ethoc_bd { u32 addr; }; -static inline u32 ethoc_read(struct ethoc *dev, loff_t offset) +static u32 ethoc_read(struct ethoc *dev, loff_t offset) { return ioread32(dev->iobase + offset); } -static inline void ethoc_write(struct ethoc *dev, loff_t offset, u32 data) +static void ethoc_write(struct ethoc *dev, loff_t offset, u32 data) { iowrite32(data, dev->iobase + offset); } -static inline void ethoc_read_bd(struct ethoc *dev, int index, - struct ethoc_bd *bd) +static void ethoc_read_bd(struct ethoc *dev, int index, struct ethoc_bd *bd) { loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); bd->stat = ethoc_read(dev, offset + 0); bd->addr = ethoc_read(dev, offset + 4); } -static inline void ethoc_write_bd(struct ethoc *dev, int index, +static void ethoc_write_bd(struct ethoc *dev, int index, const struct ethoc_bd *bd) { loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); @@ -249,33 +248,33 @@ static inline void ethoc_write_bd(struct ethoc *dev, int index, ethoc_write(dev, offset + 4, bd->addr); } -static inline void ethoc_enable_irq(struct ethoc *dev, u32 mask) +static void ethoc_enable_irq(struct ethoc *dev, u32 mask) { u32 imask = ethoc_read(dev, INT_MASK); imask |= mask; ethoc_write(dev, INT_MASK, imask); } -static inline void ethoc_disable_irq(struct ethoc *dev, u32 mask) +static void ethoc_disable_irq(struct ethoc *dev, u32 mask) { u32 imask = ethoc_read(dev, INT_MASK); imask &= ~mask; ethoc_write(dev, INT_MASK, imask); } -static inline void ethoc_ack_irq(struct ethoc *dev, u32 mask) +static void ethoc_ack_irq(struct ethoc *dev, u32 mask) { ethoc_write(dev, INT_SOURCE, mask); } -static inline void ethoc_enable_rx_and_tx(struct ethoc *dev) +static void ethoc_enable_rx_and_tx(struct ethoc *dev) { u32 mode = ethoc_read(dev, MODER); mode |= MODER_RXEN | MODER_TXEN; ethoc_write(dev, MODER, mode); } -static inline void ethoc_disable_rx_and_tx(struct ethoc *dev) +static void ethoc_disable_rx_and_tx(struct ethoc *dev) { u32 mode = ethoc_read(dev, MODER); mode &= ~(MODER_RXEN | MODER_TXEN); @@ -509,7 +508,7 @@ static irqreturn_t ethoc_interrupt(int irq, void *dev_id) return IRQ_NONE; } - ethoc_ack_irq(priv, pending); + ethoc_ack_irq(priv, INT_MASK_ALL); if (pending & INT_MASK_BUSY) { dev_err(&dev->dev, "packet dropped\n"); diff --git a/trunk/drivers/net/fec.c b/trunk/drivers/net/fec.c index 16a1d58419d9..29234380e6c6 100644 --- a/trunk/drivers/net/fec.c +++ b/trunk/drivers/net/fec.c @@ -1654,7 +1654,7 @@ static const struct net_device_ops fec_netdev_ops = { * * index is only used in legacy code */ -static int fec_enet_init(struct net_device *dev, int index) +int __init fec_enet_init(struct net_device *dev, int index) { struct fec_enet_private *fep = netdev_priv(dev); struct bufdesc *cbd_base; diff --git a/trunk/drivers/net/ks8851.c b/trunk/drivers/net/ks8851.c index a23f739d222f..237835864357 100644 --- a/trunk/drivers/net/ks8851.c +++ b/trunk/drivers/net/ks8851.c @@ -170,36 +170,6 @@ static void ks8851_wrreg16(struct ks8851_net *ks, unsigned reg, unsigned val) ks_err(ks, "spi_sync() failed\n"); } -/** - * ks8851_wrreg8 - write 8bit register value to chip - * @ks: The chip state - * @reg: The register address - * @val: The value to write - * - * Issue a write to put the value @val into the register specified in @reg. - */ -static void ks8851_wrreg8(struct ks8851_net *ks, unsigned reg, unsigned val) -{ - struct spi_transfer *xfer = &ks->spi_xfer1; - struct spi_message *msg = &ks->spi_msg1; - __le16 txb[2]; - int ret; - int bit; - - bit = 1 << (reg & 3); - - txb[0] = cpu_to_le16(MK_OP(bit, reg) | KS_SPIOP_WR); - txb[1] = val; - - xfer->tx_buf = txb; - xfer->rx_buf = NULL; - xfer->len = 3; - - ret = spi_sync(ks->spidev, msg); - if (ret < 0) - ks_err(ks, "spi_sync() failed\n"); -} - /** * ks8851_rx_1msg - select whether to use one or two messages for spi read * @ks: The device structure @@ -352,12 +322,13 @@ static void ks8851_soft_reset(struct ks8851_net *ks, unsigned op) static int ks8851_write_mac_addr(struct net_device *dev) { struct ks8851_net *ks = netdev_priv(dev); - int i; + u16 *mcp = (u16 *)dev->dev_addr; mutex_lock(&ks->lock); - for (i = 0; i < ETH_ALEN; i++) - ks8851_wrreg8(ks, KS_MAR(i), dev->dev_addr[i]); + ks8851_wrreg16(ks, KS_MARL, mcp[0]); + ks8851_wrreg16(ks, KS_MARM, mcp[1]); + ks8851_wrreg16(ks, KS_MARH, mcp[2]); mutex_unlock(&ks->lock); @@ -980,7 +951,7 @@ static void ks8851_set_rx_mode(struct net_device *dev) mcptr = mcptr->next; } - rxctrl.rxcr1 = RXCR1_RXME | RXCR1_RXPAFMA; + rxctrl.rxcr1 = RXCR1_RXME | RXCR1_RXAE | RXCR1_RXPAFMA; } else { /* just accept broadcast / unicast */ rxctrl.rxcr1 = RXCR1_RXPAFMA; @@ -1268,9 +1239,6 @@ static int __devinit ks8851_probe(struct spi_device *spi) ndev->netdev_ops = &ks8851_netdev_ops; ndev->irq = spi->irq; - /* issue a global soft reset to reset the device. */ - ks8851_soft_reset(ks, GRR_GSR); - /* simple check for a valid chip being connected to the bus */ if ((ks8851_rdreg16(ks, KS_CIDER) & ~CIDER_REV_MASK) != CIDER_ID) { diff --git a/trunk/drivers/net/ks8851.h b/trunk/drivers/net/ks8851.h index f52c312cc356..85abe147afbf 100644 --- a/trunk/drivers/net/ks8851.h +++ b/trunk/drivers/net/ks8851.h @@ -16,7 +16,6 @@ #define CCR_32PIN (1 << 0) /* MAC address registers */ -#define KS_MAR(_m) 0x15 - (_m) #define KS_MARL 0x10 #define KS_MARM 0x12 #define KS_MARH 0x14 diff --git a/trunk/drivers/net/niu.c b/trunk/drivers/net/niu.c index d6c7ac68f6ea..f9364d0678f2 100644 --- a/trunk/drivers/net/niu.c +++ b/trunk/drivers/net/niu.c @@ -3545,7 +3545,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np, rp->rcr_index = index; skb_reserve(skb, NET_IP_ALIGN); - __pskb_pull_tail(skb, min(len, VLAN_ETH_HLEN)); + __pskb_pull_tail(skb, min(len, NIU_RXPULL_MAX)); rp->rx_packets++; rp->rx_bytes += skb->len; diff --git a/trunk/drivers/net/virtio_net.c b/trunk/drivers/net/virtio_net.c index 3709d6af9abf..8d009760277c 100644 --- a/trunk/drivers/net/virtio_net.c +++ b/trunk/drivers/net/virtio_net.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -453,7 +454,7 @@ static unsigned int free_old_xmit_skbs(struct virtnet_info *vi) vi->dev->stats.tx_bytes += skb->len; vi->dev->stats.tx_packets++; tot_sgs += skb_vnet_hdr(skb)->num_sg; - dev_kfree_skb_any(skb); + kfree_skb(skb); } return tot_sgs; } diff --git a/trunk/drivers/net/vmxnet3/vmxnet3_drv.c b/trunk/drivers/net/vmxnet3/vmxnet3_drv.c index 004353a46af0..6a16f76f277e 100644 --- a/trunk/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/trunk/drivers/net/vmxnet3/vmxnet3_drv.c @@ -481,8 +481,7 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx, } rq->uncommitted[ring_idx] += num_allocated; - dev_dbg(&adapter->netdev->dev, - "alloc_rx_buf: %d allocated, next2fill %u, next2comp " + dprintk(KERN_ERR "alloc_rx_buf: %d allocated, next2fill %u, next2comp " "%u, uncommited %u\n", num_allocated, ring->next2fill, ring->next2comp, rq->uncommitted[ring_idx]); @@ -540,8 +539,7 @@ vmxnet3_map_pkt(struct sk_buff *skb, struct vmxnet3_tx_ctx *ctx, tbi = tq->buf_info + tq->tx_ring.next2fill; tbi->map_type = VMXNET3_MAP_NONE; - dev_dbg(&adapter->netdev->dev, - "txd[%u]: 0x%Lx 0x%x 0x%x\n", + dprintk(KERN_ERR "txd[%u]: 0x%Lx 0x%x 0x%x\n", tq->tx_ring.next2fill, ctx->sop_txd->txd.addr, ctx->sop_txd->dword[2], ctx->sop_txd->dword[3]); vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); @@ -574,8 +572,7 @@ vmxnet3_map_pkt(struct sk_buff *skb, struct vmxnet3_tx_ctx *ctx, gdesc->dword[2] = dw2 | buf_size; gdesc->dword[3] = 0; - dev_dbg(&adapter->netdev->dev, - "txd[%u]: 0x%Lx 0x%x 0x%x\n", + dprintk(KERN_ERR "txd[%u]: 0x%Lx 0x%x 0x%x\n", tq->tx_ring.next2fill, gdesc->txd.addr, gdesc->dword[2], gdesc->dword[3]); vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); @@ -603,8 +600,7 @@ vmxnet3_map_pkt(struct sk_buff *skb, struct vmxnet3_tx_ctx *ctx, gdesc->dword[2] = dw2 | frag->size; gdesc->dword[3] = 0; - dev_dbg(&adapter->netdev->dev, - "txd[%u]: 0x%llu %u %u\n", + dprintk(KERN_ERR "txd[%u]: 0x%llu %u %u\n", tq->tx_ring.next2fill, gdesc->txd.addr, gdesc->dword[2], gdesc->dword[3]); vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); @@ -701,8 +697,7 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, tdd = tq->data_ring.base + tq->tx_ring.next2fill; memcpy(tdd->data, skb->data, ctx->copy_size); - dev_dbg(&adapter->netdev->dev, - "copy %u bytes to dataRing[%u]\n", + dprintk(KERN_ERR "copy %u bytes to dataRing[%u]\n", ctx->copy_size, tq->tx_ring.next2fill); return 1; @@ -813,8 +808,7 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, if (count > vmxnet3_cmd_ring_desc_avail(&tq->tx_ring)) { tq->stats.tx_ring_full++; - dev_dbg(&adapter->netdev->dev, - "tx queue stopped on %s, next2comp %u" + dprintk(KERN_ERR "tx queue stopped on %s, next2comp %u" " next2fill %u\n", adapter->netdev->name, tq->tx_ring.next2comp, tq->tx_ring.next2fill); @@ -859,8 +853,7 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq, /* finally flips the GEN bit of the SOP desc */ gdesc->dword[2] ^= VMXNET3_TXD_GEN; - dev_dbg(&adapter->netdev->dev, - "txd[%u]: SOP 0x%Lx 0x%x 0x%x\n", + dprintk(KERN_ERR "txd[%u]: SOP 0x%Lx 0x%x 0x%x\n", (u32)((union Vmxnet3_GenericDesc *)ctx.sop_txd - tq->tx_ring.base), gdesc->txd.addr, gdesc->dword[2], gdesc->dword[3]); @@ -997,8 +990,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, if (unlikely(rcd->len == 0)) { /* Pretend the rx buffer is skipped. */ BUG_ON(!(rcd->sop && rcd->eop)); - dev_dbg(&adapter->netdev->dev, - "rxRing[%u][%u] 0 length\n", + dprintk(KERN_ERR "rxRing[%u][%u] 0 length\n", ring_idx, idx); goto rcd_done; } @@ -1691,8 +1683,7 @@ vmxnet3_activate_dev(struct vmxnet3_adapter *adapter) int err; u32 ret; - dev_dbg(&adapter->netdev->dev, - "%s: skb_buf_size %d, rx_buf_per_pkt %d, ring sizes" + dprintk(KERN_ERR "%s: skb_buf_size %d, rx_buf_per_pkt %d, ring sizes" " %u %u %u\n", adapter->netdev->name, adapter->skb_buf_size, adapter->rx_buf_per_pkt, adapter->tx_queue.tx_ring.size, adapter->rx_queue.rx_ring[0].size, diff --git a/trunk/drivers/net/vmxnet3/vmxnet3_int.h b/trunk/drivers/net/vmxnet3/vmxnet3_int.h index 3c0d70d58111..6bb91576e999 100644 --- a/trunk/drivers/net/vmxnet3/vmxnet3_int.h +++ b/trunk/drivers/net/vmxnet3/vmxnet3_int.h @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -60,6 +59,7 @@ #include #include #include +#include #include "vmxnet3_defs.h" diff --git a/trunk/drivers/pci/quirks.c b/trunk/drivers/pci/quirks.c index 245d2cdb4765..a790b1771f9f 100644 --- a/trunk/drivers/pci/quirks.c +++ b/trunk/drivers/pci/quirks.c @@ -1009,7 +1009,7 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, static void __devinit quirk_amd_ide_mode(struct pci_dev *pdev) { - /* set SBX00/Hudson-2 SATA in IDE mode to AHCI mode */ + /* set SBX00 SATA in IDE mode to AHCI mode */ u8 tmp; pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); @@ -1028,8 +1028,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_amd_ide_mode); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode); -DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE, quirk_amd_ide_mode); +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SB900_SATA_IDE, quirk_amd_ide_mode); +DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SB900_SATA_IDE, quirk_amd_ide_mode); /* * Serverworks CSB5 IDE does not fully support native mode diff --git a/trunk/drivers/serial/8250_pci.c b/trunk/drivers/serial/8250_pci.c index 42e8550cd2b6..e7108e75653d 100644 --- a/trunk/drivers/serial/8250_pci.c +++ b/trunk/drivers/serial/8250_pci.c @@ -1561,16 +1561,11 @@ enum pci_board_num_t { pbn_exar_XR17C152, pbn_exar_XR17C154, pbn_exar_XR17C158, - pbn_exar_ibm_saturn, pbn_pasemi_1682M, pbn_ni8430_2, pbn_ni8430_4, pbn_ni8430_8, pbn_ni8430_16, - pbn_ADDIDATA_PCIe_1_3906250, - pbn_ADDIDATA_PCIe_2_3906250, - pbn_ADDIDATA_PCIe_4_3906250, - pbn_ADDIDATA_PCIe_8_3906250, }; /* @@ -2151,13 +2146,6 @@ static struct pciserial_board pci_boards[] __devinitdata = { .base_baud = 921600, .uart_offset = 0x200, }, - [pbn_exar_ibm_saturn] = { - .flags = FL_BASE0, - .num_ports = 1, - .base_baud = 921600, - .uart_offset = 0x200, - }, - /* * PA Semi PWRficient PA6T-1682M on-chip UART */ @@ -2197,37 +2185,6 @@ static struct pciserial_board pci_boards[] __devinitdata = { .uart_offset = 0x10, .first_offset = 0x800, }, - /* - * ADDI-DATA GmbH PCI-Express communication cards - */ - [pbn_ADDIDATA_PCIe_1_3906250] = { - .flags = FL_BASE0, - .num_ports = 1, - .base_baud = 3906250, - .uart_offset = 0x200, - .first_offset = 0x1000, - }, - [pbn_ADDIDATA_PCIe_2_3906250] = { - .flags = FL_BASE0, - .num_ports = 2, - .base_baud = 3906250, - .uart_offset = 0x200, - .first_offset = 0x1000, - }, - [pbn_ADDIDATA_PCIe_4_3906250] = { - .flags = FL_BASE0, - .num_ports = 4, - .base_baud = 3906250, - .uart_offset = 0x200, - .first_offset = 0x1000, - }, - [pbn_ADDIDATA_PCIe_8_3906250] = { - .flags = FL_BASE0, - .num_ports = 8, - .base_baud = 3906250, - .uart_offset = 0x200, - .first_offset = 0x1000, - }, }; static const struct pci_device_id softmodem_blacklist[] = { @@ -2692,9 +2649,6 @@ static struct pci_device_id serial_pci_tbl[] = { PCI_SUBVENDOR_ID_CONNECT_TECH, PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485, 0, 0, pbn_b0_8_1843200_200 }, - { PCI_VENDOR_ID_EXAR, PCI_DEVICE_ID_EXAR_XR17C152, - PCI_VENDOR_ID_IBM, PCI_SUBDEVICE_ID_IBM_SATURN_SERIAL_ONE_PORT, - 0, 0, pbn_exar_ibm_saturn }, { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_U530, PCI_ANY_ID, PCI_ANY_ID, 0, 0, @@ -3602,38 +3556,6 @@ static struct pci_device_id serial_pci_tbl[] = { 0, pbn_b0_8_115200 }, - { PCI_VENDOR_ID_ADDIDATA, - PCI_DEVICE_ID_ADDIDATA_APCIe7500, - PCI_ANY_ID, - PCI_ANY_ID, - 0, - 0, - pbn_ADDIDATA_PCIe_4_3906250 }, - - { PCI_VENDOR_ID_ADDIDATA, - PCI_DEVICE_ID_ADDIDATA_APCIe7420, - PCI_ANY_ID, - PCI_ANY_ID, - 0, - 0, - pbn_ADDIDATA_PCIe_2_3906250 }, - - { PCI_VENDOR_ID_ADDIDATA, - PCI_DEVICE_ID_ADDIDATA_APCIe7300, - PCI_ANY_ID, - PCI_ANY_ID, - 0, - 0, - pbn_ADDIDATA_PCIe_1_3906250 }, - - { PCI_VENDOR_ID_ADDIDATA, - PCI_DEVICE_ID_ADDIDATA_APCIe7800, - PCI_ANY_ID, - PCI_ANY_ID, - 0, - 0, - pbn_ADDIDATA_PCIe_8_3906250 }, - { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835, PCI_VENDOR_ID_IBM, 0x0299, 0, 0, pbn_b0_bt_2_115200 }, diff --git a/trunk/drivers/serial/atmel_serial.c b/trunk/drivers/serial/atmel_serial.c index 9d948bccafaf..3551c5cb7094 100644 --- a/trunk/drivers/serial/atmel_serial.c +++ b/trunk/drivers/serial/atmel_serial.c @@ -1531,7 +1531,7 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev) void *data; int ret; - BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1)); + BUILD_BUG_ON(!is_power_of_2(ATMEL_SERIAL_RINGSIZE)); port = &atmel_ports[pdev->id]; port->backup_imr = 0; diff --git a/trunk/drivers/virtio/virtio_balloon.c b/trunk/drivers/virtio/virtio_balloon.c index 9dd588042880..200c22f55130 100644 --- a/trunk/drivers/virtio/virtio_balloon.c +++ b/trunk/drivers/virtio/virtio_balloon.c @@ -19,6 +19,7 @@ */ //#define DEBUG #include +#include #include #include #include @@ -247,7 +248,7 @@ static int virtballoon_probe(struct virtio_device *vdev) return err; } -static void __devexit virtballoon_remove(struct virtio_device *vdev) +static void virtballoon_remove(struct virtio_device *vdev) { struct virtio_balloon *vb = vdev->priv; diff --git a/trunk/fs/hfs/btree.c b/trunk/fs/hfs/btree.c index 052f214ea6f0..9b9d6395bad3 100644 --- a/trunk/fs/hfs/btree.c +++ b/trunk/fs/hfs/btree.c @@ -58,11 +58,6 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke } unlock_new_inode(tree->inode); - if (!HFS_I(tree->inode)->first_blocks) { - printk(KERN_ERR "hfs: invalid btree extent records (0 size).\n"); - goto free_inode; - } - mapping = tree->inode->i_mapping; page = read_mapping_page(mapping, 0, NULL); if (IS_ERR(page)) diff --git a/trunk/fs/hfsplus/wrapper.c b/trunk/fs/hfsplus/wrapper.c index bed78ac8f6d1..175d08eacc86 100644 --- a/trunk/fs/hfsplus/wrapper.c +++ b/trunk/fs/hfsplus/wrapper.c @@ -99,10 +99,6 @@ int hfsplus_read_wrapper(struct super_block *sb) if (hfsplus_get_last_session(sb, &part_start, &part_size)) return -EINVAL; - if ((u64)part_start + part_size > 0x100000000ULL) { - pr_err("hfs: volumes larger than 2TB are not supported yet\n"); - return -EINVAL; - } while (1) { bh = sb_bread512(sb, part_start + HFSPLUS_VOLHEAD_SECTOR, vhdr); if (!bh) diff --git a/trunk/fs/nfs/super.c b/trunk/fs/nfs/super.c index 90be551b80c1..a2c18acb8568 100644 --- a/trunk/fs/nfs/super.c +++ b/trunk/fs/nfs/super.c @@ -1253,7 +1253,6 @@ static int nfs_parse_mount_options(char *raw, default: dfprintk(MOUNT, "NFS: unrecognized " "transport protocol\n"); - kfree(string); return 0; } break; diff --git a/trunk/fs/notify/dnotify/dnotify.c b/trunk/fs/notify/dnotify/dnotify.c index 7e54e52964dd..828a889be909 100644 --- a/trunk/fs/notify/dnotify/dnotify.c +++ b/trunk/fs/notify/dnotify/dnotify.c @@ -91,7 +91,6 @@ static int dnotify_handle_event(struct fsnotify_group *group, struct dnotify_struct *dn; struct dnotify_struct **prev; struct fown_struct *fown; - __u32 test_mask = event->mask & ~FS_EVENT_ON_CHILD; to_tell = event->to_tell; @@ -107,7 +106,7 @@ static int dnotify_handle_event(struct fsnotify_group *group, spin_lock(&entry->lock); prev = &dnentry->dn; while ((dn = *prev) != NULL) { - if ((dn->dn_mask & test_mask) == 0) { + if ((dn->dn_mask & event->mask) == 0) { prev = &dn->dn_next; continue; } diff --git a/trunk/fs/notify/inode_mark.c b/trunk/fs/notify/inode_mark.c index 3165d85aada2..c8a07c65482b 100644 --- a/trunk/fs/notify/inode_mark.c +++ b/trunk/fs/notify/inode_mark.c @@ -324,11 +324,11 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry, spin_lock(&group->mark_lock); spin_lock(&inode->i_lock); + entry->group = group; + entry->inode = inode; + lentry = fsnotify_find_mark_entry(group, inode); if (!lentry) { - entry->group = group; - entry->inode = inode; - hlist_add_head(&entry->i_list, &inode->i_fsnotify_mark_entries); list_add(&entry->g_list, &group->mark_entries); diff --git a/trunk/fs/notify/notification.c b/trunk/fs/notify/notification.c index b8bf53b4c108..3816d5750dd5 100644 --- a/trunk/fs/notify/notification.c +++ b/trunk/fs/notify/notification.c @@ -143,7 +143,7 @@ static bool event_compare(struct fsnotify_event *old, struct fsnotify_event *new /* remember, after old was put on the wait_q we aren't * allowed to look at the inode any more, only thing * left to check was if the file_name is the same */ - if (!old->name_len || + if (old->name_len && !strcmp(old->file_name, new->file_name)) return true; break; diff --git a/trunk/fs/pipe.c b/trunk/fs/pipe.c index ae17d026aaa3..52c415114838 100644 --- a/trunk/fs/pipe.c +++ b/trunk/fs/pipe.c @@ -777,55 +777,36 @@ pipe_rdwr_release(struct inode *inode, struct file *filp) static int pipe_read_open(struct inode *inode, struct file *filp) { - int ret = -ENOENT; - + /* We could have perhaps used atomic_t, but this and friends + below are the only places. So it doesn't seem worthwhile. */ mutex_lock(&inode->i_mutex); - - if (inode->i_pipe) { - ret = 0; - inode->i_pipe->readers++; - } - + inode->i_pipe->readers++; mutex_unlock(&inode->i_mutex); - return ret; + return 0; } static int pipe_write_open(struct inode *inode, struct file *filp) { - int ret = -ENOENT; - mutex_lock(&inode->i_mutex); - - if (inode->i_pipe) { - ret = 0; - inode->i_pipe->writers++; - } - + inode->i_pipe->writers++; mutex_unlock(&inode->i_mutex); - return ret; + return 0; } static int pipe_rdwr_open(struct inode *inode, struct file *filp) { - int ret = -ENOENT; - mutex_lock(&inode->i_mutex); - - if (inode->i_pipe) { - ret = 0; - if (filp->f_mode & FMODE_READ) - inode->i_pipe->readers++; - if (filp->f_mode & FMODE_WRITE) - inode->i_pipe->writers++; - } - + if (filp->f_mode & FMODE_READ) + inode->i_pipe->readers++; + if (filp->f_mode & FMODE_WRITE) + inode->i_pipe->writers++; mutex_unlock(&inode->i_mutex); - return ret; + return 0; } /* diff --git a/trunk/fs/proc/meminfo.c b/trunk/fs/proc/meminfo.c index a65239cfd97e..c7bff4f603ff 100644 --- a/trunk/fs/proc/meminfo.c +++ b/trunk/fs/proc/meminfo.c @@ -99,7 +99,7 @@ static int meminfo_proc_show(struct seq_file *m, void *v) "VmallocUsed: %8lu kB\n" "VmallocChunk: %8lu kB\n" #ifdef CONFIG_MEMORY_FAILURE - "HardwareCorrupted: %5lu kB\n" + "HardwareCorrupted: %8lu kB\n" #endif , K(i.totalram), diff --git a/trunk/include/linux/Kbuild b/trunk/include/linux/Kbuild index 1feed71551c9..3f384d4b163a 100644 --- a/trunk/include/linux/Kbuild +++ b/trunk/include/linux/Kbuild @@ -364,7 +364,6 @@ unifdef-y += utsname.h unifdef-y += videodev2.h unifdef-y += videodev.h unifdef-y += virtio_config.h -unifdef-y += virtio_ids.h unifdef-y += virtio_blk.h unifdef-y += virtio_net.h unifdef-y += virtio_9p.h diff --git a/trunk/include/linux/cpufreq.h b/trunk/include/linux/cpufreq.h index 79a2340d83cd..44717eb47639 100644 --- a/trunk/include/linux/cpufreq.h +++ b/trunk/include/linux/cpufreq.h @@ -291,15 +291,8 @@ struct global_attr { int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); int cpufreq_update_policy(unsigned int cpu); -#ifdef CONFIG_CPU_FREQ /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ unsigned int cpufreq_get(unsigned int cpu); -#else -static inline unsigned int cpufreq_get(unsigned int cpu) -{ - return 0; -} -#endif /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ #ifdef CONFIG_CPU_FREQ diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h index b0f0f3851cd4..f490e7a7307a 100644 --- a/trunk/include/linux/pci_ids.h +++ b/trunk/include/linux/pci_ids.h @@ -379,6 +379,9 @@ #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c #define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 #define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c +/* AMD SB Chipset */ +#define PCI_DEVICE_ID_AMD_SB900_IDE 0x780c +#define PCI_DEVICE_ID_AMD_SB900_SATA_IDE 0x7800 #define PCI_VENDOR_ID_VLSI 0x1004 #define PCI_DEVICE_ID_VLSI_82C592 0x0005 @@ -482,9 +485,6 @@ #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361 #define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 -#define PCI_SUBVENDOR_ID_IBM 0x1014 -#define PCI_SUBDEVICE_ID_IBM_SATURN_SERIAL_ONE_PORT 0x03d4 - #define PCI_VENDOR_ID_UNISYS 0x1018 #define PCI_DEVICE_ID_UNISYS_DMA_DIRECTOR 0x001C @@ -553,10 +553,9 @@ #define PCI_DEVICE_ID_AMD_CS5536_UDC 0x2096 #define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097 #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A + #define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081 #define PCI_DEVICE_ID_AMD_LX_AES 0x2082 -#define PCI_DEVICE_ID_AMD_HUDSON2_IDE 0x780c -#define PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE 0x7800 #define PCI_VENDOR_ID_TRIDENT 0x1023 #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 @@ -2163,10 +2162,6 @@ #define PCI_DEVICE_ID_ADDIDATA_APCI7420_3 0x700D #define PCI_DEVICE_ID_ADDIDATA_APCI7300_3 0x700E #define PCI_DEVICE_ID_ADDIDATA_APCI7800_3 0x700F -#define PCI_DEVICE_ID_ADDIDATA_APCIe7300 0x7010 -#define PCI_DEVICE_ID_ADDIDATA_APCIe7420 0x7011 -#define PCI_DEVICE_ID_ADDIDATA_APCIe7500 0x7012 -#define PCI_DEVICE_ID_ADDIDATA_APCIe7800 0x7013 #define PCI_VENDOR_ID_PDC 0x15e9 diff --git a/trunk/include/linux/string.h b/trunk/include/linux/string.h index b8508868d5ad..489019ef1694 100644 --- a/trunk/include/linux/string.h +++ b/trunk/include/linux/string.h @@ -62,7 +62,7 @@ extern char * strnchr(const char *, size_t, int); #ifndef __HAVE_ARCH_STRRCHR extern char * strrchr(const char *,int); #endif -extern char * __must_check strstrip(char *); +extern char * strstrip(char *); #ifndef __HAVE_ARCH_STRSTR extern char * strstr(const char *,const char *); #endif diff --git a/trunk/include/linux/virtio_9p.h b/trunk/include/linux/virtio_9p.h index 095e10d148b4..ea7226a45acb 100644 --- a/trunk/include/linux/virtio_9p.h +++ b/trunk/include/linux/virtio_9p.h @@ -2,7 +2,6 @@ #define _LINUX_VIRTIO_9P_H /* This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. */ -#include #include /* Maximum number of virtio channels per partition (1 for now) */ diff --git a/trunk/include/linux/virtio_balloon.h b/trunk/include/linux/virtio_balloon.h index 1418f048cb34..09d730085060 100644 --- a/trunk/include/linux/virtio_balloon.h +++ b/trunk/include/linux/virtio_balloon.h @@ -2,7 +2,6 @@ #define _LINUX_VIRTIO_BALLOON_H /* This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. */ -#include #include /* The feature bitmap for virtio balloon */ diff --git a/trunk/include/linux/virtio_blk.h b/trunk/include/linux/virtio_blk.h index fd294c56d571..15cb666581d7 100644 --- a/trunk/include/linux/virtio_blk.h +++ b/trunk/include/linux/virtio_blk.h @@ -3,7 +3,6 @@ /* This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. */ #include -#include #include /* Feature bits */ @@ -14,8 +13,11 @@ #define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ +#define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */ #define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ +#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ + struct virtio_blk_config { /* The capacity (in 512-byte sectors). */ __u64 capacity; @@ -31,6 +33,7 @@ struct virtio_blk_config { } geometry; /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ __u32 blk_size; + __u8 identify[VIRTIO_BLK_ID_BYTES]; } __attribute__((packed)); /* diff --git a/trunk/include/linux/virtio_console.h b/trunk/include/linux/virtio_console.h index fe885174cc1f..b5f519806014 100644 --- a/trunk/include/linux/virtio_console.h +++ b/trunk/include/linux/virtio_console.h @@ -1,7 +1,6 @@ #ifndef _LINUX_VIRTIO_CONSOLE_H #define _LINUX_VIRTIO_CONSOLE_H #include -#include #include /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so * anyone can use the definitions to implement compatible drivers/servers. */ diff --git a/trunk/include/linux/virtio_net.h b/trunk/include/linux/virtio_net.h index 085e42298ce5..1f41734bbb77 100644 --- a/trunk/include/linux/virtio_net.h +++ b/trunk/include/linux/virtio_net.h @@ -3,7 +3,6 @@ /* This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. */ #include -#include #include #include diff --git a/trunk/include/linux/virtio_rng.h b/trunk/include/linux/virtio_rng.h index c4d5de896f0c..48121c3c434b 100644 --- a/trunk/include/linux/virtio_rng.h +++ b/trunk/include/linux/virtio_rng.h @@ -2,7 +2,6 @@ #define _LINUX_VIRTIO_RNG_H /* This header is BSD licensed so anyone can use the definitions to implement * compatible drivers/servers. */ -#include #include #endif /* _LINUX_VIRTIO_RNG_H */ diff --git a/trunk/include/net/inet_timewait_sock.h b/trunk/include/net/inet_timewait_sock.h index f93ad90a601b..b63b80fac567 100644 --- a/trunk/include/net/inet_timewait_sock.h +++ b/trunk/include/net/inet_timewait_sock.h @@ -130,11 +130,11 @@ struct inet_timewait_sock { __u16 tw_num; kmemcheck_bitfield_begin(flags); /* And these are ours. */ - unsigned int tw_ipv6only : 1, - tw_transparent : 1, - tw_pad : 14, /* 14 bits hole */ - tw_ipv6_offset : 16; + __u8 tw_ipv6only:1, + tw_transparent:1; + /* 14 bits hole, try to pack */ kmemcheck_bitfield_end(flags); + __u16 tw_ipv6_offset; unsigned long tw_ttd; struct inet_bind_bucket *tw_tb; struct hlist_node tw_death_node; diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index 0249f4be9b5c..ca83b73fba19 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -1710,13 +1710,14 @@ static ssize_t cgroup_write_X64(struct cgroup *cgrp, struct cftype *cft, return -EFAULT; buffer[nbytes] = 0; /* nul-terminate */ + strstrip(buffer); if (cft->write_u64) { - u64 val = simple_strtoull(strstrip(buffer), &end, 0); + u64 val = simple_strtoull(buffer, &end, 0); if (*end) return -EINVAL; retval = cft->write_u64(cgrp, cft, val); } else { - s64 val = simple_strtoll(strstrip(buffer), &end, 0); + s64 val = simple_strtoll(buffer, &end, 0); if (*end) return -EINVAL; retval = cft->write_s64(cgrp, cft, val); @@ -1752,7 +1753,8 @@ static ssize_t cgroup_write_string(struct cgroup *cgrp, struct cftype *cft, } buffer[nbytes] = 0; /* nul-terminate */ - retval = cft->write_string(cgrp, cft, strstrip(buffer)); + strstrip(buffer); + retval = cft->write_string(cgrp, cft, buffer); if (!retval) retval = nbytes; out: diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index f7864ac2ecc1..e61891f80123 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -359,8 +359,10 @@ void __set_special_pids(struct pid *pid) { struct task_struct *curr = current->group_leader; - if (task_session(curr) != pid) + if (task_session(curr) != pid) { change_pid(curr, PIDTYPE_SID, pid); + proc_sid_connector(curr); + } if (task_pgrp(curr) != pid) change_pid(curr, PIDTYPE_PGID, pid); diff --git a/trunk/kernel/power/suspend_test.c b/trunk/kernel/power/suspend_test.c index 25596e450ac7..17d8bb1acf9c 100644 --- a/trunk/kernel/power/suspend_test.c +++ b/trunk/kernel/power/suspend_test.c @@ -19,7 +19,7 @@ * The time it takes is system-specific though, so when we test this * during system bootup we allow a LOT of time. */ -#define TEST_SUSPEND_SECONDS 10 +#define TEST_SUSPEND_SECONDS 5 static unsigned long suspend_test_start_time; @@ -49,8 +49,7 @@ void suspend_test_finish(const char *label) * has some performance issues. The stack dump of a WARN_ON * is more likely to get the right attention than a printk... */ - WARN(msec > (TEST_SUSPEND_SECONDS * 1000), - "Component: %s, time: %u\n", label, msec); + WARN(msec > (TEST_SUSPEND_SECONDS * 1000), "Component: %s\n", label); } /* diff --git a/trunk/kernel/sys.c b/trunk/kernel/sys.c index 1828f8d10844..255475d163e0 100644 --- a/trunk/kernel/sys.c +++ b/trunk/kernel/sys.c @@ -1110,8 +1110,6 @@ SYSCALL_DEFINE0(setsid) err = session; out: write_unlock_irq(&tasklist_lock); - if (err > 0) - proc_sid_connector(group_leader); return err; } diff --git a/trunk/kernel/sysctl_check.c b/trunk/kernel/sysctl_check.c index b6e7aaea4604..b38423ca711a 100644 --- a/trunk/kernel/sysctl_check.c +++ b/trunk/kernel/sysctl_check.c @@ -1521,7 +1521,7 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) if (!table->ctl_name && table->strategy) set_fail(&fail, table, "Strategy without ctl_name"); #endif -#ifdef CONFIG_PROC_SYSCTL +#ifdef CONFIG_PROC_FS if (table->procname && !table->proc_handler) set_fail(&fail, table, "No proc_handler"); #endif diff --git a/trunk/mm/Kconfig b/trunk/mm/Kconfig index f791196cee8c..57963c6063d1 100644 --- a/trunk/mm/Kconfig +++ b/trunk/mm/Kconfig @@ -67,7 +67,7 @@ config DISCONTIGMEM config SPARSEMEM def_bool y - depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL + depends on SPARSEMEM_MANUAL config FLATMEM def_bool y diff --git a/trunk/mm/memory-failure.c b/trunk/mm/memory-failure.c index 7fc2130d2737..729d4b15b645 100644 --- a/trunk/mm/memory-failure.c +++ b/trunk/mm/memory-failure.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -662,7 +661,7 @@ static void hwpoison_user_mappings(struct page *p, unsigned long pfn, int i; int kill = 1; - if (PageReserved(p) || PageCompound(p) || PageSlab(p) || PageKsm(p)) + if (PageReserved(p) || PageCompound(p) || PageSlab(p)) return; if (!PageLRU(p)) diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c index 60ea601e03ea..7e91b5f9f690 100644 --- a/trunk/mm/memory.c +++ b/trunk/mm/memory.c @@ -641,7 +641,6 @@ static int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, pmd_t *dst_pmd, pmd_t *src_pmd, struct vm_area_struct *vma, unsigned long addr, unsigned long end) { - pte_t *orig_src_pte, *orig_dst_pte; pte_t *src_pte, *dst_pte; spinlock_t *src_ptl, *dst_ptl; int progress = 0; @@ -655,8 +654,6 @@ static int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, src_pte = pte_offset_map_nested(src_pmd, addr); src_ptl = pte_lockptr(src_mm, src_pmd); spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING); - orig_src_pte = src_pte; - orig_dst_pte = dst_pte; arch_enter_lazy_mmu_mode(); do { @@ -680,9 +677,9 @@ static int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, arch_leave_lazy_mmu_mode(); spin_unlock(src_ptl); - pte_unmap_nested(orig_src_pte); + pte_unmap_nested(src_pte - 1); add_mm_rss(dst_mm, rss[0], rss[1]); - pte_unmap_unlock(orig_dst_pte, dst_ptl); + pte_unmap_unlock(dst_pte - 1, dst_ptl); cond_resched(); if (addr != end) goto again; @@ -1823,10 +1820,10 @@ static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd, token = pmd_pgtable(*pmd); do { - err = fn(pte++, token, addr, data); + err = fn(pte, token, addr, data); if (err) break; - } while (addr += PAGE_SIZE, addr != end); + } while (pte++, addr += PAGE_SIZE, addr != end); arch_leave_lazy_mmu_mode(); diff --git a/trunk/mm/mempolicy.c b/trunk/mm/mempolicy.c index 4545d5944243..7dd9d9f80694 100644 --- a/trunk/mm/mempolicy.c +++ b/trunk/mm/mempolicy.c @@ -1024,7 +1024,7 @@ static long do_mbind(unsigned long start, unsigned long len, err = migrate_prep(); if (err) - goto mpol_out; + return err; } { NODEMASK_SCRATCH(scratch); @@ -1039,9 +1039,10 @@ static long do_mbind(unsigned long start, unsigned long len, err = -ENOMEM; NODEMASK_SCRATCH_FREE(scratch); } - if (err) - goto mpol_out; - + if (err) { + mpol_put(new); + return err; + } vma = check_range(mm, start, end, nmask, flags | MPOL_MF_INVERT, &pagelist); @@ -1057,11 +1058,9 @@ static long do_mbind(unsigned long start, unsigned long len, if (!err && nr_failed && (flags & MPOL_MF_STRICT)) err = -EIO; - } else - putback_lru_pages(&pagelist); + } up_write(&mm->mmap_sem); - mpol_out: mpol_put(new); return err; } diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index cdcedf661616..bf720550b44d 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -2183,7 +2183,7 @@ void show_free_areas(void) printk("active_anon:%lu inactive_anon:%lu isolated_anon:%lu\n" " active_file:%lu inactive_file:%lu isolated_file:%lu\n" " unevictable:%lu" - " dirty:%lu writeback:%lu unstable:%lu\n" + " dirty:%lu writeback:%lu unstable:%lu buffer:%lu\n" " free:%lu slab_reclaimable:%lu slab_unreclaimable:%lu\n" " mapped:%lu shmem:%lu pagetables:%lu bounce:%lu\n", global_page_state(NR_ACTIVE_ANON), @@ -2196,6 +2196,7 @@ void show_free_areas(void) global_page_state(NR_FILE_DIRTY), global_page_state(NR_WRITEBACK), global_page_state(NR_UNSTABLE_NFS), + nr_blockdev_pages(), global_page_state(NR_FREE_PAGES), global_page_state(NR_SLAB_RECLAIMABLE), global_page_state(NR_SLAB_UNRECLAIMABLE), diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index 777af57fd8c8..64e438898832 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -544,16 +544,6 @@ void putback_lru_page(struct page *page) */ lru = LRU_UNEVICTABLE; add_page_to_unevictable_list(page); - /* - * When racing with an mlock clearing (page is - * unlocked), make sure that if the other thread does - * not observe our setting of PG_lru and fails - * isolation, we see PG_mlocked cleared below and move - * the page back to the evictable list. - * - * The other side is TestClearPageMlocked(). - */ - smp_mb(); } /* @@ -1098,7 +1088,7 @@ static unsigned long shrink_inactive_list(unsigned long max_scan, int lumpy_reclaim = 0; while (unlikely(too_many_isolated(zone, file, sc))) { - congestion_wait(BLK_RW_ASYNC, HZ/10); + congestion_wait(WRITE, HZ/10); /* We are about to die and free our memory. Return now. */ if (fatal_signal_pending(current)) @@ -1366,7 +1356,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone, * IO, plus JVM can create lots of anon VM_EXEC pages, * so we ignore them here. */ - if ((vm_flags & VM_EXEC) && page_is_file_cache(page)) { + if ((vm_flags & VM_EXEC) && !PageAnon(page)) { list_add(&page->lru, &l_active); continue; } diff --git a/trunk/net/9p/trans_virtio.c b/trunk/net/9p/trans_virtio.c index ea1e3daabefe..b2e07f0dd298 100644 --- a/trunk/net/9p/trans_virtio.c +++ b/trunk/net/9p/trans_virtio.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #define VIRTQUEUE_NUM 128 diff --git a/trunk/net/bluetooth/hci_sysfs.c b/trunk/net/bluetooth/hci_sysfs.c index 2bc6f6a8de68..7f939ce29801 100644 --- a/trunk/net/bluetooth/hci_sysfs.c +++ b/trunk/net/bluetooth/hci_sysfs.c @@ -92,8 +92,6 @@ static void add_conn(struct work_struct *work) dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle); - dev_set_drvdata(&conn->dev, conn); - if (device_add(&conn->dev) < 0) { BT_ERR("Failed to register connection device"); return; @@ -146,6 +144,8 @@ void hci_conn_init_sysfs(struct hci_conn *conn) conn->dev.class = bt_class; conn->dev.parent = &hdev->dev; + dev_set_drvdata(&conn->dev, conn); + device_initialize(&conn->dev); INIT_WORK(&conn->work_add, add_conn); diff --git a/trunk/net/bluetooth/l2cap.c b/trunk/net/bluetooth/l2cap.c index 77e9fb130adb..555d9da1869b 100644 --- a/trunk/net/bluetooth/l2cap.c +++ b/trunk/net/bluetooth/l2cap.c @@ -555,12 +555,12 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status) conn->feat_mask = 0; - spin_lock_init(&conn->lock); - rwlock_init(&conn->chan_list.lock); - setup_timer(&conn->info_timer, l2cap_info_timeout, (unsigned long) conn); + spin_lock_init(&conn->lock); + rwlock_init(&conn->chan_list.lock); + conn->disc_reason = 0x13; return conn; @@ -783,9 +783,6 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent) /* Default config options */ pi->conf_len = 0; pi->flush_to = L2CAP_DEFAULT_FLUSH_TO; - skb_queue_head_init(TX_QUEUE(sk)); - skb_queue_head_init(SREJ_QUEUE(sk)); - INIT_LIST_HEAD(SREJ_LIST(sk)); } static struct proto l2cap_proto = { diff --git a/trunk/net/ipv4/inet_connection_sock.c b/trunk/net/ipv4/inet_connection_sock.c index 537731b3bcb3..4351ca2cf0b8 100644 --- a/trunk/net/ipv4/inet_connection_sock.c +++ b/trunk/net/ipv4/inet_connection_sock.c @@ -446,28 +446,6 @@ extern int sysctl_tcp_synack_retries; EXPORT_SYMBOL_GPL(inet_csk_reqsk_queue_hash_add); -/* Decide when to expire the request and when to resend SYN-ACK */ -static inline void syn_ack_recalc(struct request_sock *req, const int thresh, - const int max_retries, - const u8 rskq_defer_accept, - int *expire, int *resend) -{ - if (!rskq_defer_accept) { - *expire = req->retrans >= thresh; - *resend = 1; - return; - } - *expire = req->retrans >= thresh && - (!inet_rsk(req)->acked || req->retrans >= max_retries); - /* - * Do not resend while waiting for data after ACK, - * start to resend on end of deferring period to give - * last chance for data or ACK to create established socket. - */ - *resend = !inet_rsk(req)->acked || - req->retrans >= rskq_defer_accept - 1; -} - void inet_csk_reqsk_queue_prune(struct sock *parent, const unsigned long interval, const unsigned long timeout, @@ -523,15 +501,9 @@ void inet_csk_reqsk_queue_prune(struct sock *parent, reqp=&lopt->syn_table[i]; while ((req = *reqp) != NULL) { if (time_after_eq(now, req->expires)) { - int expire = 0, resend = 0; - - syn_ack_recalc(req, thresh, max_retries, - queue->rskq_defer_accept, - &expire, &resend); - if (!expire && - (!resend || - !req->rsk_ops->rtx_syn_ack(parent, req) || - inet_rsk(req)->acked)) { + if ((req->retrans < thresh || + (inet_rsk(req)->acked && req->retrans < max_retries)) + && !req->rsk_ops->rtx_syn_ack(parent, req)) { unsigned long timeo; if (req->retrans++ == 0) diff --git a/trunk/net/ipv4/ip_sockglue.c b/trunk/net/ipv4/ip_sockglue.c index e982b5c1ee17..0c0b6e363a20 100644 --- a/trunk/net/ipv4/ip_sockglue.c +++ b/trunk/net/ipv4/ip_sockglue.c @@ -634,16 +634,17 @@ static int do_ip_setsockopt(struct sock *sk, int level, break; } dev = ip_dev_find(sock_net(sk), mreq.imr_address.s_addr); - if (dev) + if (dev) { mreq.imr_ifindex = dev->ifindex; + dev_put(dev); + } } else - dev = dev_get_by_index(sock_net(sk), mreq.imr_ifindex); + dev = __dev_get_by_index(sock_net(sk), mreq.imr_ifindex); err = -EADDRNOTAVAIL; if (!dev) break; - dev_put(dev); err = -EINVAL; if (sk->sk_bound_dev_if && diff --git a/trunk/net/ipv4/tcp.c b/trunk/net/ipv4/tcp.c index 90b2e0649bfb..64d0af675823 100644 --- a/trunk/net/ipv4/tcp.c +++ b/trunk/net/ipv4/tcp.c @@ -326,43 +326,6 @@ void tcp_enter_memory_pressure(struct sock *sk) EXPORT_SYMBOL(tcp_enter_memory_pressure); -/* Convert seconds to retransmits based on initial and max timeout */ -static u8 secs_to_retrans(int seconds, int timeout, int rto_max) -{ - u8 res = 0; - - if (seconds > 0) { - int period = timeout; - - res = 1; - while (seconds > period && res < 255) { - res++; - timeout <<= 1; - if (timeout > rto_max) - timeout = rto_max; - period += timeout; - } - } - return res; -} - -/* Convert retransmits to seconds based on initial and max timeout */ -static int retrans_to_secs(u8 retrans, int timeout, int rto_max) -{ - int period = 0; - - if (retrans > 0) { - period = timeout; - while (--retrans) { - timeout <<= 1; - if (timeout > rto_max) - timeout = rto_max; - period += timeout; - } - } - return period; -} - /* * Wait for a TCP event. * @@ -1442,9 +1405,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, goto found_ok_skb; if (tcp_hdr(skb)->fin) goto found_fin_ok; - if (WARN_ON(!(flags & MSG_PEEK))) - printk(KERN_INFO "recvmsg bug 2: copied %X " - "seq %X\n", *seq, TCP_SKB_CB(skb)->seq); + WARN_ON(!(flags & MSG_PEEK)); } /* Well, if we have backlog, try to process it now yet. */ @@ -2202,10 +2163,16 @@ static int do_tcp_setsockopt(struct sock *sk, int level, break; case TCP_DEFER_ACCEPT: - /* Translate value in seconds to number of retransmits */ - icsk->icsk_accept_queue.rskq_defer_accept = - secs_to_retrans(val, TCP_TIMEOUT_INIT / HZ, - TCP_RTO_MAX / HZ); + icsk->icsk_accept_queue.rskq_defer_accept = 0; + if (val > 0) { + /* Translate value in seconds to number of + * retransmits */ + while (icsk->icsk_accept_queue.rskq_defer_accept < 32 && + val > ((TCP_TIMEOUT_INIT / HZ) << + icsk->icsk_accept_queue.rskq_defer_accept)) + icsk->icsk_accept_queue.rskq_defer_accept++; + icsk->icsk_accept_queue.rskq_defer_accept++; + } break; case TCP_WINDOW_CLAMP: @@ -2386,8 +2353,8 @@ static int do_tcp_getsockopt(struct sock *sk, int level, val = (val ? : sysctl_tcp_fin_timeout) / HZ; break; case TCP_DEFER_ACCEPT: - val = retrans_to_secs(icsk->icsk_accept_queue.rskq_defer_accept, - TCP_TIMEOUT_INIT / HZ, TCP_RTO_MAX / HZ); + val = !icsk->icsk_accept_queue.rskq_defer_accept ? 0 : + ((TCP_TIMEOUT_INIT / HZ) << (icsk->icsk_accept_queue.rskq_defer_accept - 1)); break; case TCP_WINDOW_CLAMP: val = tp->window_clamp; diff --git a/trunk/net/ipv4/tcp_minisocks.c b/trunk/net/ipv4/tcp_minisocks.c index 4c03598ed924..e320afea07fc 100644 --- a/trunk/net/ipv4/tcp_minisocks.c +++ b/trunk/net/ipv4/tcp_minisocks.c @@ -641,9 +641,10 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb, if (!(flg & TCP_FLAG_ACK)) return NULL; - /* While TCP_DEFER_ACCEPT is active, drop bare ACK. */ - if (req->retrans < inet_csk(sk)->icsk_accept_queue.rskq_defer_accept && + /* If TCP_DEFER_ACCEPT is set, drop bare ACK. */ + if (inet_csk(sk)->icsk_accept_queue.rskq_defer_accept && TCP_SKB_CB(skb)->end_seq == tcp_rsk(req)->rcv_isn + 1) { + inet_csk(sk)->icsk_accept_queue.rskq_defer_accept--; inet_rsk(req)->acked = 1; return NULL; } diff --git a/trunk/net/ipv6/ipv6_sockglue.c b/trunk/net/ipv6/ipv6_sockglue.c index 4f7aaf6996a3..14f54eb5a7fc 100644 --- a/trunk/net/ipv6/ipv6_sockglue.c +++ b/trunk/net/ipv6/ipv6_sockglue.c @@ -496,17 +496,13 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, goto e_inval; if (val) { - struct net_device *dev; - if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != val) goto e_inval; - dev = dev_get_by_index(net, val); - if (!dev) { + if (__dev_get_by_index(net, val) == NULL) { retv = -ENODEV; break; } - dev_put(dev); } np->mcast_oif = val; retv = 0; diff --git a/trunk/net/unix/af_unix.c b/trunk/net/unix/af_unix.c index fc820cd75453..51ab497115eb 100644 --- a/trunk/net/unix/af_unix.c +++ b/trunk/net/unix/af_unix.c @@ -1074,8 +1074,6 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr, err = -ECONNREFUSED; if (other->sk_state != TCP_LISTEN) goto out_unlock; - if (other->sk_shutdown & RCV_SHUTDOWN) - goto out_unlock; if (unix_recvq_full(other)) { err = -EAGAIN; diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index bc4114f1ab30..87bbb8bce9bf 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -2,7 +2,7 @@ # (c) 2001, Dave Jones. (the file handling bit) # (c) 2005, Joel Schopp (the ugly bit) # (c) 2007,2008, Andy Whitcroft (new conditions, test suite) -# (c) 2008,2009, Andy Whitcroft +# (c) 2008, Andy Whitcroft # Licensed under the terms of the GNU GPL License version 2 use strict; @@ -10,7 +10,7 @@ my $P = $0; $P =~ s@.*/@@g; -my $V = '0.30'; +my $V = '0.29'; use Getopt::Long qw(:config no_auto_abbrev); @@ -130,10 +130,7 @@ sub help { my $emitted_corrupt = 0; -our $Ident = qr{ - [A-Za-z_][A-Za-z\d_]* - (?:\s*\#\#\s*[A-Za-z_][A-Za-z\d_]*)* - }x; +our $Ident = qr{[A-Za-z_][A-Za-z\d_]*}; our $Storage = qr{extern|static|asmlinkage}; our $Sparse = qr{ __user| @@ -1000,25 +997,23 @@ sub annotate_values { sub possible { my ($possible, $line) = @_; - my $notPermitted = qr{(?: + + print "CHECK<$possible> ($line)\n" if ($dbg_possible > 2); + if ($possible !~ /(?: ^(?: $Modifier| $Storage| $Type| - DEFINE_\S+ - )$| - ^(?: + DEFINE_\S+| goto| return| case| else| asm|__asm__| do - )(?:\s|$)| + )$| ^(?:typedef|struct|enum)\b - )}x; - warn "CHECK<$possible> ($line)\n" if ($dbg_possible > 2); - if ($possible !~ $notPermitted) { + )/x) { # Check for modifiers. $possible =~ s/\s*$Storage\s*//g; $possible =~ s/\s*$Sparse\s*//g; @@ -1027,10 +1022,8 @@ sub possible { } elsif ($possible =~ /\s/) { $possible =~ s/\s*$Type\s*//g; for my $modifier (split(' ', $possible)) { - if ($modifier !~ $notPermitted) { - warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible); - push(@modifierList, $modifier); - } + warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible); + push(@modifierList, $modifier); } } else { @@ -1145,7 +1138,6 @@ sub process { # suppression flags my %suppress_ifbraces; my %suppress_whiletrailers; - my %suppress_export; # Pre-scan the patch sanitizing the lines. # Pre-scan the patch looking for any __setup documentation. @@ -1238,6 +1230,7 @@ sub process { $linenr++; my $rawline = $rawlines[$linenr - 1]; + my $hunk_line = ($realcnt != 0); #extract the line range in the file after the patch is applied if ($line=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { @@ -1254,7 +1247,6 @@ sub process { %suppress_ifbraces = (); %suppress_whiletrailers = (); - %suppress_export = (); next; # track the line number as we move through the hunk, note that @@ -1278,8 +1270,6 @@ sub process { $realcnt--; } - my $hunk_line = ($realcnt != 0); - #make up the handle for any error we report on this line $prefix = "$filename:$realline: " if ($emacs && $file); $prefix = "$filename:$linenr: " if ($emacs && !$file); @@ -1430,22 +1420,13 @@ sub process { } # Check for potential 'bare' types - my ($stat, $cond, $line_nr_next, $remain_next, $off_next, - $realline_next); + my ($stat, $cond, $line_nr_next, $remain_next, $off_next); if ($realcnt && $line =~ /.\s*\S/) { ($stat, $cond, $line_nr_next, $remain_next, $off_next) = ctx_statement_block($linenr, $realcnt, 0); $stat =~ s/\n./\n /g; $cond =~ s/\n./\n /g; - # Find the real next line. - $realline_next = $line_nr_next; - if (defined $realline_next && - (!defined $lines[$realline_next - 1] || - substr($lines[$realline_next - 1], $off_next) =~ /^\s*$/)) { - $realline_next++; - } - my $s = $stat; $s =~ s/{.*$//s; @@ -1680,8 +1661,8 @@ sub process { } # check for initialisation to aggregates open brace on the next line - if ($line =~ /^.\s*{/ && - $prevline =~ /(?:^|[^=])=\s*$/) { + if ($prevline =~ /$Declare\s*$Ident\s*=\s*$/ && + $line =~ /^.\s*{/) { ERROR("that open brace { should be on the previous line\n" . $hereprev); } @@ -1706,40 +1687,21 @@ sub process { $line =~ s@//.*@@; $opline =~ s@//.*@@; -# EXPORT_SYMBOL should immediately follow the thing it is exporting, consider -# the whole statement. -#print "APW <$lines[$realline_next - 1]>\n"; - if (defined $realline_next && - exists $lines[$realline_next - 1] && - !defined $suppress_export{$realline_next} && - ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/ || - $lines[$realline_next - 1] =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { +#EXPORT_SYMBOL should immediately follow its function closing }. + if (($line =~ /EXPORT_SYMBOL.*\((.*)\)/) || + ($line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { my $name = $1; - if ($stat !~ /(?: - \n.}\s*$| + if ($prevline !~ /(?: + ^.}| ^.DEFINE_$Ident\(\Q$name\E\)| ^.DECLARE_$Ident\(\Q$name\E\)| ^.LIST_HEAD\(\Q$name\E\)| - ^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(| - \b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\() + ^.$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(| + \b\Q$name\E(?:\s+$Attribute)?\s*(?:;|=|\[) )/x) { -#print "FOO A<$lines[$realline_next - 1]> stat<$stat> name<$name>\n"; - $suppress_export{$realline_next} = 2; - } else { - $suppress_export{$realline_next} = 1; + WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr); } } - if (!defined $suppress_export{$linenr} && - $prevline =~ /^.\s*$/ && - ($line =~ /EXPORT_SYMBOL.*\((.*)\)/ || - $line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { -#print "FOO B <$lines[$linenr - 1]>\n"; - $suppress_export{$linenr} = 2; - } - if (defined $suppress_export{$linenr} && - $suppress_export{$linenr} == 2) { - WARN("EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr); - } # check for external initialisers. if ($line =~ /^.$Type\s*$Ident\s*(?:\s+$Modifier)*\s*=\s*(0|NULL|false)\s*;/) { diff --git a/trunk/scripts/get_maintainer.pl b/trunk/scripts/get_maintainer.pl index 102b76608f35..cdb44b63342e 100755 --- a/trunk/scripts/get_maintainer.pl +++ b/trunk/scripts/get_maintainer.pl @@ -13,7 +13,7 @@ use strict; my $P = $0; -my $V = '0.21'; +my $V = '0.20'; use Getopt::Long qw(:config no_auto_abbrev); @@ -37,7 +37,6 @@ my $web = 0; my $subsystem = 0; my $status = 0; -my $keywords = 1; my $from_filename = 0; my $pattern_depth = 0; my $version = 0; @@ -85,7 +84,6 @@ 'scm!' => \$scm, 'web!' => \$web, 'pattern-depth=i' => \$pattern_depth, - 'k|keywords!' => \$keywords, 'f|file' => \$from_filename, 'v|version' => \$version, 'h|help' => \$help, @@ -134,8 +132,6 @@ ## Read MAINTAINERS for type/value pairs my @typevalue = (); -my %keyword_hash; - open(MAINT, "<${lk_path}MAINTAINERS") || die "$P: Can't open MAINTAINERS\n"; while () { my $line = $_; @@ -153,8 +149,6 @@ if ((-d $value)) { $value =~ s@([^/])$@$1/@; } - } elsif ($type eq "K") { - $keyword_hash{@typevalue} = $value; } push(@typevalue, "$type:$value"); } elsif (!/^(\s)*$/) { @@ -194,7 +188,6 @@ my @files = (); my @range = (); -my @keyword_tvi = (); foreach my $file (@ARGV) { ##if $file is a directory and it lacks a trailing slash, add one @@ -205,24 +198,11 @@ } if ($from_filename) { push(@files, $file); - if (-f $file && $keywords) { - open(FILE, "<$file") or die "$P: Can't open ${file}\n"; - while () { - my $patch_line = $_; - foreach my $line (keys %keyword_hash) { - if ($patch_line =~ m/^.*$keyword_hash{$line}/x) { - push(@keyword_tvi, $line); - } - } - } - close(FILE); - } } else { my $file_cnt = @files; my $lastfile; open(PATCH, "<$file") or die "$P: Can't open ${file}\n"; while () { - my $patch_line = $_; if (m/^\+\+\+\s+(\S+)/) { my $filename = $1; $filename =~ s@^[^/]*/@@; @@ -233,12 +213,6 @@ if ($email_git_blame) { push(@range, "$lastfile:$1:$2"); } - } elsif ($keywords) { - foreach my $line (keys %keyword_hash) { - if ($patch_line =~ m/^[+-].*$keyword_hash{$line}/x) { - push(@keyword_tvi, $line); - } - } } } close(PATCH); @@ -312,13 +286,6 @@ } } -if ($keywords) { - @keyword_tvi = sort_and_uniq(@keyword_tvi); - foreach my $line (@keyword_tvi) { - add_categories($line); - } -} - if ($email) { foreach my $chief (@penguin_chief) { if ($chief =~ m/^(.*):(.*)/) { @@ -417,7 +384,6 @@ sub usage { Other options: --pattern-depth => Number of pattern directory traversals (default: 0 (all)) - --keywords => scan patch for keywords (default: 1 (on)) --version => show version --help => show this help information @@ -520,6 +486,7 @@ sub format_email { } sub find_starting_index { + my ($index) = @_; while ($index > 0) { diff --git a/trunk/virt/kvm/kvm_main.c b/trunk/virt/kvm/kvm_main.c index 7495ce347344..b7c78a403dc2 100644 --- a/trunk/virt/kvm/kvm_main.c +++ b/trunk/virt/kvm/kvm_main.c @@ -2717,6 +2717,8 @@ int kvm_init(void *opaque, unsigned int vcpu_size, int r; int cpu; + kvm_init_debug(); + r = kvm_arch_init(opaque); if (r) goto out_fail; @@ -2783,8 +2785,6 @@ int kvm_init(void *opaque, unsigned int vcpu_size, kvm_preempt_ops.sched_in = kvm_sched_in; kvm_preempt_ops.sched_out = kvm_sched_out; - kvm_init_debug(); - return 0; out_free: @@ -2807,6 +2807,7 @@ int kvm_init(void *opaque, unsigned int vcpu_size, out: kvm_arch_exit(); out_fail: + kvm_exit_debug(); return r; } EXPORT_SYMBOL_GPL(kvm_init); @@ -2814,7 +2815,6 @@ EXPORT_SYMBOL_GPL(kvm_init); void kvm_exit(void) { tracepoint_synchronize_unregister(); - kvm_exit_debug(); misc_deregister(&kvm_dev); kmem_cache_destroy(kvm_vcpu_cache); sysdev_unregister(&kvm_sysdev); @@ -2824,6 +2824,7 @@ void kvm_exit(void) on_each_cpu(hardware_disable, NULL, 1); kvm_arch_hardware_unsetup(); kvm_arch_exit(); + kvm_exit_debug(); free_cpumask_var(cpus_hardware_enabled); __free_page(bad_page); }