diff --git a/[refs] b/[refs] index d397d10003b3..56f9755b5635 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 259886a7c4e4eb0089181e800d1f477cb3786875 +refs/heads/master: 938e2ac0b7ac72d264783b0b548eb6078c295294 diff --git a/trunk/Documentation/sysrq.txt b/trunk/Documentation/sysrq.txt index 61613166981b..e0188a23fd5e 100644 --- a/trunk/Documentation/sysrq.txt +++ b/trunk/Documentation/sysrq.txt @@ -1,6 +1,6 @@ Linux Magic System Request Key Hacks -Documentation for sysrq.c -Last update: 2007-JAN-06 +Documentation for sysrq.c version 1.15 +Last update: $Date: 2001/01/28 10:15:59 $ * What is the magic SysRq key? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -35,7 +35,7 @@ You can set the value in the file by the following command: Note that the value of /proc/sys/kernel/sysrq influences only the invocation via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always -allowed (by a user with admin privileges). +allowed. * How do I use the magic SysRq key? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -58,7 +58,7 @@ On PowerPC - Press 'ALT - Print Screen (or F13) - , On other - If you know of the key combos for other architectures, please let me know so I can add them to this section. -On all - write a character to /proc/sysrq-trigger. e.g.: +On all - write a character to /proc/sysrq-trigger. eg: echo t > /proc/sysrq-trigger @@ -74,8 +74,6 @@ On all - write a character to /proc/sysrq-trigger. e.g.: 'c' - Will perform a kexec reboot in order to take a crashdump. -'d' - Shows all locks that are held. - 'o' - Will shut your system off (if configured and supported). 's' - Will attempt to sync all mounted filesystems. @@ -89,43 +87,38 @@ On all - write a character to /proc/sysrq-trigger. e.g.: 'm' - Will dump current memory info to your console. -'n' - Used to make RT tasks nice-able - 'v' - Dumps Voyager SMP processor info to your console. -'w' - Dumps tasks that are in uninterruptable (blocked) state. - -'x' - Used by xmon interface on ppc/powerpc platforms. - '0'-'9' - Sets the console log level, controlling which kernel messages will be printed to your console. ('0', for example would make it so that only emergency messages like PANICs or OOPSes would make it to your console.) -'f' - Will call oom_kill to kill a memory hog process. +'f' - Will call oom_kill to kill a memory hog process 'e' - Send a SIGTERM to all processes, except for init. -'g' - Used by kgdb on ppc platforms. - 'i' - Send a SIGKILL to all processes, except for init. -'h' - Will display help (actually any other key than those listed +'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system + will be non-functional after this.) + +'h' - Will display help ( actually any other key than those listed above will display help. but 'h' is easy to remember :-) * Okay, so what can I use them for? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Well, un'R'aw is very handy when your X server or a svgalib program crashes. -sa'K' (Secure Access Key) is useful when you want to be sure there is no -trojan program running at console which could grab your password -when you would try to login. It will kill all programs on given console, -thus letting you make sure that the login prompt you see is actually +sa'K' (Secure Access Key) is useful when you want to be sure there are no +trojan program is running at console and which could grab your password +when you would try to login. It will kill all programs on given console +and thus letting you make sure that the login prompt you see is actually the one from init, not some trojan program. IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT IMPORTANT: c2 compliant system, and it should not be mistaken as :IMPORTANT IMPORTANT: such. :IMPORTANT - It seems others find it useful as (System Attention Key) which is + It seems other find it useful as (System Attention Key) which is useful when you want to exit a program that will not let you switch consoles. (For example, X or a svgalib program.) @@ -146,8 +139,8 @@ OK or Done message...) Again, the unmount (remount read-only) hasn't taken place until you see the "OK" and "Done" message appear on the screen. -The loglevels '0'-'9' are useful when your console is being flooded with -kernel messages you do not want to see. Selecting '0' will prevent all but +The loglevel'0'-'9' is useful when your console is being flooded with +kernel messages you do not want to see. Setting '0' will prevent all but the most urgent kernel messages from reaching your console. (They will still be logged if syslogd/klogd are alive, though.) @@ -159,7 +152,7 @@ processes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ That happens to me, also. I've found that tapping shift, alt, and control on both sides of the keyboard, and hitting an invalid sysrq sequence again -will fix the problem. (i.e., something like alt-sysrq-z). Switching to another +will fix the problem. (ie, something like alt-sysrq-z). Switching to another virtual console (ALT+Fn) and then back again should also help. * I hit SysRq, but nothing seems to happen, what's wrong? @@ -181,11 +174,11 @@ handler function you will use, B) a help_msg string, that will print when SysRQ prints help, and C) an action_msg string, that will print right before your handler is called. Your handler must conform to the prototype in 'sysrq.h'. -After the sysrq_key_op is created, you can call the kernel function -register_sysrq_key(int key, struct sysrq_key_op *op_p); this will -register the operation pointed to by 'op_p' at table key 'key', -if that slot in the table is blank. At module unload time, you must call -the function unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which +After the sysrq_key_op is created, you can call the macro +register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in +sysrq.h, this will register the operation pointed to by 'op_p' at table +key 'key', if that slot in the table is blank. At module unload time, you must +call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which will remove the key op pointed to by 'op_p' from the key 'key', if and only if it is currently registered in that slot. This is in case the slot has been overwritten since you registered it. @@ -193,12 +186,15 @@ overwritten since you registered it. The Magic SysRQ system works by registering key operations against a key op lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has a number of operations registered into it at compile time, but is mutable, -and 2 functions are exported for interface to it: - register_sysrq_key and unregister_sysrq_key. -Of course, never ever leave an invalid pointer in the table. I.e., when -your module that called register_sysrq_key() exits, it must call -unregister_sysrq_key() to clean up the sysrq key table entry that it used. -Null pointers in the table are always safe. :) +and 4 functions are exported for interface to it: __sysrq_lock_table, +__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The +functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined +in the header itself, and the REGISTER and UNREGISTER macros are built from +these. More complex (and dangerous!) manipulations of the table are possible +using these functions, but you must be careful to always lock the table before +you read or write from it, and to unlock it again when you are done. (And of +course, to never ever leave an invalid pointer in the table). Null pointers in +the table are always safe :) If for some reason you feel the need to call the handle_sysrq function from within a function called by handle_sysrq, you must be aware that you are in diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 0ad8803a0c75..f0596e452c5c 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -598,6 +598,8 @@ W: http://linux-atm.sourceforge.net S: Maintained ATMEL MACB ETHERNET DRIVER +P: Atmel AVR32 Support Team +M: avr32@atmel.com P: Haavard Skinnemoen M: hskinnemoen@atmel.com S: Supported @@ -618,6 +620,8 @@ T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git S: Maintained AVR32 ARCHITECTURE +P: Atmel AVR32 Support Team +M: avr32@atmel.com P: Haavard Skinnemoen M: hskinnemoen@atmel.com W: http://www.atmel.com/products/AVR32/ @@ -626,6 +630,8 @@ W: http://avrfreaks.net/ S: Supported AVR32/AT32AP MACHINE SUPPORT +P: Atmel AVR32 Support Team +M: avr32@atmel.com P: Haavard Skinnemoen M: hskinnemoen@atmel.com S: Supported @@ -1592,11 +1598,12 @@ M: ipslinux@adaptec.com W: http://www.developer.ibm.com/welcome/netfinity/serveraid.html S: Supported -IDE SUBSYSTEM +IDE DRIVER [GENERAL] P: Bartlomiej Zolnierkiewicz -M: bzolnier@gmail.com +M: B.Zolnierkiewicz@elka.pw.edu.pl +L: linux-kernel@vger.kernel.org L: linux-ide@vger.kernel.org -T: quilt kernel.org/pub/linux/kernel/people/bart/pata-2.6/ +T: git kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git S: Maintained IDE/ATAPI CDROM DRIVER @@ -2282,7 +2289,7 @@ P: Jozsef Kadlecsik P: Patrick McHardy M: kaber@trash.net L: netfilter-devel@lists.netfilter.org -L: netfilter@lists.netfilter.org (subscribers-only) +L: netfilter@lists.netfilter.org L: coreteam@netfilter.org W: http://www.netfilter.org/ W: http://www.iptables.org/ @@ -3593,12 +3600,6 @@ M: ysato@users.sourceforge.jp W: http://uclinux-h8.sourceforge.jp/ S: Supported -UFS FILESYSTEM -P: Evgeniy Dushistov -M: dushistov@mail.ru -L: linux-kernel@vger.kernel.org -S: Maintained - USB DIAMOND RIO500 DRIVER P: Cesar Miquel M: miquel@df.uba.ar diff --git a/trunk/Makefile b/trunk/Makefile index 75adfb539977..9e1adac8aa28 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 20 -EXTRAVERSION =-rc7 +EXTRAVERSION =-rc6 NAME = Homicidal Dwarf Hamster # *DOCUMENTATION* @@ -1116,15 +1116,15 @@ help: @echo ' cscope - Generate cscope index' @echo ' kernelrelease - Output the release version string' @echo ' kernelversion - Output the version stored in Makefile' - @if [ -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \ + @if [ -r include/asm-$(ARCH)/Kbuild ]; then \ echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ - echo ' (default: $(INSTALL_HDR_PATH))'; \ fi + @echo ' (default: $(INSTALL_HDR_PATH))' @echo '' @echo 'Static analysers' @echo ' checkstack - Generate a list of stack hogs' @echo ' namespacecheck - Name space analysis on compiled kernel' - @if [ -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \ + @if [ -r include/asm-$(ARCH)/Kbuild ]; then \ echo ' headers_check - Sanity check on exported headers'; \ fi @echo '' diff --git a/trunk/arch/alpha/kernel/process.c b/trunk/arch/alpha/kernel/process.c index c15186390693..3370e6faeae0 100644 --- a/trunk/arch/alpha/kernel/process.c +++ b/trunk/arch/alpha/kernel/process.c @@ -47,7 +47,6 @@ * Power off function, if any */ void (*pm_power_off)(void) = machine_power_off; -EXPORT_SYMBOL(pm_power_off); void cpu_idle(void) diff --git a/trunk/arch/arm/configs/at91sam9260ek_defconfig b/trunk/arch/arm/configs/at91sam9260ek_defconfig index 46b0c734aeb9..79049206dfa5 100644 --- a/trunk/arch/arm/configs/at91sam9260ek_defconfig +++ b/trunk/arch/arm/configs/at91sam9260ek_defconfig @@ -923,6 +923,7 @@ CONFIG_FORCED_INLINING=y # CONFIG_HEADERS_CHECK is not set # CONFIG_RCU_TORTURE_TEST is not set CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_WAITQ is not set # CONFIG_DEBUG_ERRORS is not set CONFIG_DEBUG_LL=y # CONFIG_DEBUG_ICEDCC is not set diff --git a/trunk/arch/arm/configs/at91sam9261ek_defconfig b/trunk/arch/arm/configs/at91sam9261ek_defconfig index fcd8fa091e9d..784ad7c0186d 100644 --- a/trunk/arch/arm/configs/at91sam9261ek_defconfig +++ b/trunk/arch/arm/configs/at91sam9261ek_defconfig @@ -1079,6 +1079,7 @@ CONFIG_FORCED_INLINING=y # CONFIG_HEADERS_CHECK is not set # CONFIG_RCU_TORTURE_TEST is not set CONFIG_DEBUG_USER=y +# CONFIG_DEBUG_WAITQ is not set # CONFIG_DEBUG_ERRORS is not set CONFIG_DEBUG_LL=y # CONFIG_DEBUG_ICEDCC is not set diff --git a/trunk/arch/arm/kernel/head.S b/trunk/arch/arm/kernel/head.S index cf495a3084b3..d994561816a1 100644 --- a/trunk/arch/arm/kernel/head.S +++ b/trunk/arch/arm/kernel/head.S @@ -22,10 +22,6 @@ #include #include -#if (PHYS_OFFSET & 0x001fffff) -#error "PHYS_OFFSET must be at an even 2MiB boundary!" -#endif - #define KERNEL_RAM_VADDR (PAGE_OFFSET + TEXT_OFFSET) #define KERNEL_RAM_PADDR (PHYS_OFFSET + TEXT_OFFSET) @@ -255,8 +251,7 @@ __create_page_tables: * Then map first 1MB of ram in case it contains our boot params. */ add r0, r4, #PAGE_OFFSET >> 18 - orr r6, r7, #(PHYS_OFFSET & 0xff000000) - orr r6, r6, #(PHYS_OFFSET & 0x00e00000) + orr r6, r7, #PHYS_OFFSET str r6, [r0] #ifdef CONFIG_XIP_KERNEL diff --git a/trunk/arch/arm/mach-at91rm9200/at91rm9200_devices.c b/trunk/arch/arm/mach-at91rm9200/at91rm9200_devices.c index 57fac7203fe4..4641b99db0ee 100644 --- a/trunk/arch/arm/mach-at91rm9200/at91rm9200_devices.c +++ b/trunk/arch/arm/mach-at91rm9200/at91rm9200_devices.c @@ -272,7 +272,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data) at91_set_A_periph(AT91_PIN_PC12, 0); /* NCS6/CFCE2 */ /* nWAIT is _not_ a default setting */ - at91_set_A_periph(AT91_PIN_PC6, 1); /* nWAIT */ + at91_set_A_periph(AT91_PIN_PC6, 1); /* nWAIT */ cf_data = *data; platform_device_register(&at91rm9200_cf_device); diff --git a/trunk/arch/arm/mach-at91rm9200/at91sam9260.c b/trunk/arch/arm/mach-at91rm9200/at91sam9260.c index b14871adc300..203f073a53e6 100644 --- a/trunk/arch/arm/mach-at91rm9200/at91sam9260.c +++ b/trunk/arch/arm/mach-at91rm9200/at91sam9260.c @@ -16,7 +16,6 @@ #include #include #include -#include #include "generic.h" #include "clock.h" @@ -213,7 +212,7 @@ static struct at91_gpio_bank at91sam9260_gpio[] = { static void at91sam9260_reset(void) { - at91_sys_write(AT91_RSTC_CR, (0xA5 << 24) | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); +#warning "Implement CPU reset" } diff --git a/trunk/arch/arm/mach-at91rm9200/at91sam9261.c b/trunk/arch/arm/mach-at91rm9200/at91sam9261.c index d242bb885c6d..5a82f35da2e9 100644 --- a/trunk/arch/arm/mach-at91rm9200/at91sam9261.c +++ b/trunk/arch/arm/mach-at91rm9200/at91sam9261.c @@ -16,7 +16,6 @@ #include #include #include -#include #include "generic.h" #include "clock.h" @@ -208,7 +207,7 @@ static struct at91_gpio_bank at91sam9261_gpio[] = { static void at91sam9261_reset(void) { - at91_sys_write(AT91_RSTC_CR, (0xA5 << 24) | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); +#warning "Implement CPU reset" } diff --git a/trunk/arch/arm/mach-at91rm9200/gpio.c b/trunk/arch/arm/mach-at91rm9200/gpio.c index af22659c8a28..3f188508c391 100644 --- a/trunk/arch/arm/mach-at91rm9200/gpio.c +++ b/trunk/arch/arm/mach-at91rm9200/gpio.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "generic.h" @@ -223,17 +224,17 @@ static u32 backups[MAX_GPIO_BANKS]; static int gpio_irq_set_wake(unsigned pin, unsigned state) { unsigned mask = pin_to_mask(pin); - unsigned bank = (pin - PIN_BASE) / 32; - if (unlikely(bank >= MAX_GPIO_BANKS)) + pin -= PIN_BASE; + pin /= 32; + + if (unlikely(pin >= MAX_GPIO_BANKS)) return -EINVAL; if (state) - wakeups[bank] |= mask; + wakeups[pin] |= mask; else - wakeups[bank] &= ~mask; - - set_irq_wake(gpio[bank].id, state); + wakeups[pin] &= ~mask; return 0; } @@ -245,15 +246,29 @@ void at91_gpio_suspend(void) for (i = 0; i < gpio_banks; i++) { u32 pio = gpio[i].offset; + /* + * Note: drivers should have disabled GPIO interrupts that + * aren't supposed to be wakeup sources. + * But that is not much good on ARM..... disable_irq() does + * not update the hardware immediately, so the hardware mask + * (IMR) has the wrong value (not current, too much is + * permitted). + * + * Our workaround is to disable all non-wakeup IRQs ... + * which is exactly what correct drivers asked for in the + * first place! + */ backups[i] = at91_sys_read(pio + PIO_IMR); at91_sys_write(pio + PIO_IDR, backups[i]); at91_sys_write(pio + PIO_IER, wakeups[i]); - if (!wakeups[i]) - clk_disable(gpio[i].clock); - else { + if (!wakeups[i]) { + disable_irq_wake(gpio[i].id); + at91_sys_write(AT91_PMC_PCDR, 1 << gpio[i].id); + } else { + enable_irq_wake(gpio[i].id); #ifdef CONFIG_PM_DEBUG - printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", 'A'+i, wakeups[i]); + printk(KERN_DEBUG "GPIO-%c may wake for %08x\n", "ABCD"[i], wakeups[i]); #endif } } @@ -266,11 +281,9 @@ void at91_gpio_resume(void) for (i = 0; i < gpio_banks; i++) { u32 pio = gpio[i].offset; - if (!wakeups[i]) - clk_enable(gpio[i].clock); - at91_sys_write(pio + PIO_IDR, wakeups[i]); at91_sys_write(pio + PIO_IER, backups[i]); + at91_sys_write(AT91_PMC_PCER, 1 << gpio[i].id); } } diff --git a/trunk/arch/arm/mach-imx/cpufreq.c b/trunk/arch/arm/mach-imx/cpufreq.c index 4f66e90db74f..ac5f99895660 100644 --- a/trunk/arch/arm/mach-imx/cpufreq.c +++ b/trunk/arch/arm/mach-imx/cpufreq.c @@ -184,17 +184,6 @@ static int imx_set_target(struct cpufreq_policy *policy, long sysclk; unsigned int bclk_div = 1; - /* - * Some governors do not respects CPU and policy lower limits - * which leads to bad things (division by zero etc), ensure - * that such things do not happen. - */ - if(target_freq < policy->cpuinfo.min_freq) - target_freq = policy->cpuinfo.min_freq; - - if(target_freq < policy->min) - target_freq = policy->min; - freq = target_freq * 1000; pr_debug(KERN_DEBUG "imx: requested frequency %ld Hz, mpctl0 at boot 0x%08x\n", @@ -269,8 +258,7 @@ static int __init imx_cpufreq_driver_init(struct cpufreq_policy *policy) policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->cpuinfo.min_freq = 8000; policy->cpuinfo.max_freq = 200000; - /* Manual states, that PLL stabilizes in two CLK32 periods */ - policy->cpuinfo.transition_latency = 4 * 1000000000LL / CLK32; + policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; return 0; } diff --git a/trunk/arch/arm/mach-s3c2410/gpio.c b/trunk/arch/arm/mach-s3c2410/gpio.c index f6fb215bb48c..ba346546150b 100644 --- a/trunk/arch/arm/mach-s3c2410/gpio.c +++ b/trunk/arch/arm/mach-s3c2410/gpio.c @@ -57,7 +57,6 @@ void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function) case S3C2410_GPIO_SFN2: case S3C2410_GPIO_SFN3: if (pin < S3C2410_GPIO_BANKB) { - function -= 1; function &= 1; function <<= S3C2410_GPIO_OFFSET(pin); } else { @@ -84,18 +83,15 @@ EXPORT_SYMBOL(s3c2410_gpio_cfgpin); unsigned int s3c2410_gpio_getcfg(unsigned int pin) { void __iomem *base = S3C24XX_GPIO_BASE(pin); - unsigned long val = __raw_readl(base); + unsigned long mask; if (pin < S3C2410_GPIO_BANKB) { - val >>= S3C2410_GPIO_OFFSET(pin); - val &= 1; - val += 1; + mask = 1 << S3C2410_GPIO_OFFSET(pin); } else { - val >>= S3C2410_GPIO_OFFSET(pin)*2; - val &= 3; + mask = 3 << S3C2410_GPIO_OFFSET(pin)*2; } - return val | S3C2410_GPIO_INPUT; + return __raw_readl(base) & mask; } EXPORT_SYMBOL(s3c2410_gpio_getcfg); diff --git a/trunk/arch/arm/mach-s3c2410/pm.c b/trunk/arch/arm/mach-s3c2410/pm.c index ebf294dd31da..00834097eb82 100644 --- a/trunk/arch/arm/mach-s3c2410/pm.c +++ b/trunk/arch/arm/mach-s3c2410/pm.c @@ -451,14 +451,15 @@ static void s3c2410_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs) irqstate = s3c_irqwake_eintmask & (1L<>= S3C2410_GPIO_OFFSET(pin)*2; if (!irqstate) { - if (pinstate == S3C2410_GPIO_IRQ) + if (pinstate == 0x02) DBG("Leaving IRQ %d (pin %d) enabled\n", irq, pin); } else { - if (pinstate == S3C2410_GPIO_IRQ) { + if (pinstate == 0x02) { DBG("Disabling IRQ %d (pin %d)\n", irq, pin); - s3c2410_gpio_cfgpin(pin, S3C2410_GPIO_INPUT); + s3c2410_gpio_cfgpin(pin, 0x00); } } } diff --git a/trunk/arch/arm/mach-s3c2410/s3c2412-dma.c b/trunk/arch/arm/mach-s3c2410/s3c2412-dma.c index 138f726ac6bf..fe71a8fdb87c 100644 --- a/trunk/arch/arm/mach-s3c2410/s3c2412-dma.c +++ b/trunk/arch/arm/mach-s3c2410/s3c2412-dma.c @@ -133,8 +133,8 @@ static struct s3c24xx_dma_map __initdata s3c2412_dma_mappings[] = { static void s3c2412_dma_select(struct s3c2410_dma_chan *chan, struct s3c24xx_dma_map *map) { - writel(map->channels[0] | S3C2412_DMAREQSEL_HW, - chan->regs + S3C2412_DMA_DMAREQSEL); + writel(chan->regs + S3C2412_DMA_DMAREQSEL, + map->channels[0] | S3C2412_DMAREQSEL_HW); } static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = { diff --git a/trunk/arch/arm/mm/init.c b/trunk/arch/arm/mm/init.c index 7760193e74cc..b5814b4b6f35 100644 --- a/trunk/arch/arm/mm/init.c +++ b/trunk/arch/arm/mm/init.c @@ -52,18 +52,15 @@ void show_mem(void) printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); for_each_online_node(node) { - pg_data_t *n = NODE_DATA(node); - struct page *map = n->node_mem_map - n->node_start_pfn; - for_each_nodebank (i,mi,node) { unsigned int pfn1, pfn2; struct page *page, *end; - pfn1 = __phys_to_pfn(mi->bank[i].start); - pfn2 = __phys_to_pfn(mi->bank[i].size + mi->bank[i].start); + pfn1 = mi->bank[i].start >> PAGE_SHIFT; + pfn2 = (mi->bank[i].size + mi->bank[i].start) >> PAGE_SHIFT; - page = map + pfn1; - end = map + pfn2; + page = NODE_MEM_MAP(node) + pfn1; + end = NODE_MEM_MAP(node) + pfn2; do { total++; diff --git a/trunk/arch/arm/mm/ioremap.c b/trunk/arch/arm/mm/ioremap.c index 0ac615c0f798..251685fe73a8 100644 --- a/trunk/arch/arm/mm/ioremap.c +++ b/trunk/arch/arm/mm/ioremap.c @@ -300,8 +300,7 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size, addr = (unsigned long)area->addr; #ifndef CONFIG_SMP - if (DOMAIN_IO == 0 && - (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) || + if ((((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) || cpu_is_xsc3()) && !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) { area->flags |= VM_ARM_SECTION_MAPPING; diff --git a/trunk/arch/arm/mm/proc-xscale.S b/trunk/arch/arm/mm/proc-xscale.S index d29fe927ee9e..490e11b34231 100644 --- a/trunk/arch/arm/mm/proc-xscale.S +++ b/trunk/arch/arm/mm/proc-xscale.S @@ -708,7 +708,7 @@ __8032x_proc_info: .type __8033x_proc_info,#object __8033x_proc_info: .long 0x69054010 - .long 0xfffffd30 + .long 0xffffff30 .long PMD_TYPE_SECT | \ PMD_SECT_BUFFERABLE | \ PMD_SECT_CACHEABLE | \ diff --git a/trunk/arch/arm/tools/mach-types b/trunk/arch/arm/tools/mach-types index bd78058b7178..8bcb838e5444 100644 --- a/trunk/arch/arm/tools/mach-types +++ b/trunk/arch/arm/tools/mach-types @@ -12,7 +12,7 @@ # # http://www.arm.linux.org.uk/developer/machines/?action=new # -# Last update: Tue Jan 16 16:52:56 2007 +# Last update: Thu Dec 7 17:19:20 2006 # # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number # @@ -1219,26 +1219,3 @@ zevio_1020 MACH_ZEVIO_1020 ZEVIO_1020 1207 hitrack MACH_HITRACK HITRACK 1208 syme1 MACH_SYME1 SYME1 1209 syhl1 MACH_SYHL1 SYHL1 1210 -empca400 MACH_EMPCA400 EMPCA400 1211 -em7210 MACH_EM7210 EM7210 1212 -htchermes MACH_HTCHERMES HTCHERMES 1213 -eti_c1 MACH_ETI_C1 ETI_C1 1214 -mach_dep2410 MACH_MACH_DEP2410 MACH_DEP2410 1215 -ac100 MACH_AC100 AC100 1216 -sneetch MACH_SNEETCH SNEETCH 1217 -studentmate MACH_STUDENTMATE STUDENTMATE 1218 -zir2410 MACH_ZIR2410 ZIR2410 1219 -zir2413 MACH_ZIR2413 ZIR2413 1220 -dlonip3 MACH_DLONIP3 DLONIP3 1221 -instream MACH_INSTREAM INSTREAM 1222 -ambarella MACH_AMBARELLA AMBARELLA 1223 -nevis MACH_NEVIS NEVIS 1224 -htc_trinity MACH_HTC_TRINITY HTC_TRINITY 1225 -ql202b MACH_QL202B QL202B 1226 -vpac270 MACH_VPAC270 VPAC270 1227 -rd129 MACH_RD129 RD129 1228 -htcwizard MACH_HTCWIZARD HTCWIZARD 1229 -xscale_treo680 MACH_XSCALE_TREO680 XSCALE_TREO680 1230 -tecon_tmezon MACH_TECON_TMEZON TECON_TMEZON 1231 -zylonite MACH_ZYLONITE ZYLONITE 1233 -gene1270 MACH_GENE1270 GENE1270 1234 diff --git a/trunk/arch/arm/vfp/entry.S b/trunk/arch/arm/vfp/entry.S index ca2a5ad19ea6..7b595547c1c8 100644 --- a/trunk/arch/arm/vfp/entry.S +++ b/trunk/arch/arm/vfp/entry.S @@ -25,7 +25,6 @@ do_vfp: enable_irq ldr r4, .LCvfp - ldr r11, [r10, #TI_CPU] @ CPU number add r10, r10, #TI_VFPSTATE @ r10 = workspace ldr pc, [r4] @ call VFP entry point diff --git a/trunk/arch/arm/vfp/vfp.h b/trunk/arch/arm/vfp/vfp.h index 54a2ad6d9ca2..f2797896e6d5 100644 --- a/trunk/arch/arm/vfp/vfp.h +++ b/trunk/arch/arm/vfp/vfp.h @@ -370,7 +370,3 @@ struct op { u32 (* const fn)(int dd, int dn, int dm, u32 fpscr); u32 flags; }; - -#ifdef CONFIG_SMP -extern void vfp_save_state(void *location, u32 fpexc); -#endif diff --git a/trunk/arch/arm/vfp/vfphw.S b/trunk/arch/arm/vfp/vfphw.S index d4b7b229631d..e51e6679c402 100644 --- a/trunk/arch/arm/vfp/vfphw.S +++ b/trunk/arch/arm/vfp/vfphw.S @@ -65,7 +65,6 @@ @ r2 = faulted PC+4 @ r9 = successful return @ r10 = vfp_state union -@ r11 = CPU number @ lr = failure return .globl vfp_support_entry @@ -80,7 +79,7 @@ vfp_support_entry: DBGSTR1 "enable %x", r10 ldr r3, last_VFP_context_address orr r1, r1, #FPEXC_ENABLE @ user FPEXC has the enable bit set - ldr r4, [r3, r11, lsl #2] @ last_VFP_context pointer + ldr r4, [r3] @ last_VFP_context pointer bic r5, r1, #FPEXC_EXCEPTION @ make sure exceptions are disabled cmp r4, r10 beq check_for_exception @ we are returning to the same @@ -92,9 +91,7 @@ vfp_support_entry: @ exceptions, so we can get at the @ rest of it -#ifndef CONFIG_SMP @ Save out the current registers to the old thread state - @ No need for SMP since this is not done lazily DBGSTR1 "save old state %p", r4 cmp r4, #0 @@ -108,11 +105,10 @@ vfp_support_entry: stmia r4, {r1, r5, r6, r8} @ save FPEXC, FPSCR, FPINST, FPINST2 @ and point r4 at the word at the @ start of the register dump -#endif no_old_VFP_process: DBGSTR1 "load state %p", r10 - str r10, [r3, r11, lsl #2] @ update the last_VFP_context pointer + str r10, [r3] @ update the last_VFP_context pointer @ Load the saved state back into the VFP VFPFLDMIA r10 @ reload the working registers while @ FPEXC is in a safe state @@ -166,24 +162,6 @@ process_exception: @ required. If not, the user code will @ retry the faulted instruction -#ifdef CONFIG_SMP - .globl vfp_save_state - .type vfp_save_state, %function -vfp_save_state: - @ Save the current VFP state - @ r0 - save location - @ r1 - FPEXC - DBGSTR1 "save VFP state %p", r0 - VFPFMRX r2, FPSCR @ current status - VFPFMRX r3, FPINST @ FPINST (always there, rev0 onwards) - tst r1, #FPEXC_FPV2 @ is there an FPINST2 to read? - VFPFMRX r12, FPINST2, NE @ FPINST2 if needed - avoids reading - @ nonexistant reg on rev0 - VFPFSTMIA r0 @ save the working registers - stmia r0, {r1, r2, r3, r12} @ save FPEXC, FPSCR, FPINST, FPINST2 - mov pc, lr -#endif - last_VFP_context_address: .word last_VFP_context diff --git a/trunk/arch/arm/vfp/vfpmodule.c b/trunk/arch/arm/vfp/vfpmodule.c index f1e5951dc721..490d9d18a7d1 100644 --- a/trunk/arch/arm/vfp/vfpmodule.c +++ b/trunk/arch/arm/vfp/vfpmodule.c @@ -28,7 +28,7 @@ void vfp_testing_entry(void); void vfp_support_entry(void); void (*vfp_vector)(void) = vfp_testing_entry; -union vfp_state *last_VFP_context[NR_CPUS]; +union vfp_state *last_VFP_context; /* * Dual-use variable. @@ -41,35 +41,13 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v) { struct thread_info *thread = v; union vfp_state *vfp; - __u32 cpu = thread->cpu; if (likely(cmd == THREAD_NOTIFY_SWITCH)) { - u32 fpexc = fmrx(FPEXC); - -#ifdef CONFIG_SMP - /* - * On SMP, if VFP is enabled, save the old state in - * case the thread migrates to a different CPU. The - * restoring is done lazily. - */ - if ((fpexc & FPEXC_ENABLE) && last_VFP_context[cpu]) { - vfp_save_state(last_VFP_context[cpu], fpexc); - last_VFP_context[cpu]->hard.cpu = cpu; - } - /* - * Thread migration, just force the reloading of the - * state on the new CPU in case the VFP registers - * contain stale data. - */ - if (thread->vfpstate.hard.cpu != cpu) - last_VFP_context[cpu] = NULL; -#endif - /* * Always disable VFP so we can lazily save/restore the * old state. */ - fmxr(FPEXC, fpexc & ~FPEXC_ENABLE); + fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_ENABLE); return NOTIFY_DONE; } @@ -90,8 +68,8 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v) } /* flush and release case: Per-thread VFP cleanup. */ - if (last_VFP_context[cpu] == vfp) - last_VFP_context[cpu] = NULL; + if (last_VFP_context == vfp) + last_VFP_context = NULL; return NOTIFY_DONE; } diff --git a/trunk/arch/i386/boot/compressed/relocs.c b/trunk/arch/i386/boot/compressed/relocs.c index 881951ca03e1..468da89153c4 100644 --- a/trunk/arch/i386/boot/compressed/relocs.c +++ b/trunk/arch/i386/boot/compressed/relocs.c @@ -43,8 +43,6 @@ static int is_safe_abs_reloc(const char* sym_name) /* Match found */ return 1; } - if (strncmp(sym_name, "__crc_", 6) == 0) - return 1; return 0; } diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/trunk/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c index 4786fedca6eb..bec50170b75a 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c @@ -51,6 +51,7 @@ enum { static int has_N44_O17_errata[NR_CPUS]; +static int has_N60_errata[NR_CPUS]; static unsigned int stock_freq; static struct cpufreq_driver p4clockmod_driver; static unsigned int cpufreq_p4_get(unsigned int cpu); @@ -223,6 +224,12 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) case 0x0f12: has_N44_O17_errata[policy->cpu] = 1; dprintk("has errata -- disabling low frequencies\n"); + break; + + case 0x0f29: + has_N60_errata[policy->cpu] = 1; + dprintk("has errata -- disabling frequencies lower than 2ghz\n"); + break; } /* get max frequency */ @@ -234,6 +241,8 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) for (i=1; (p4clockmod_table[i].frequency != CPUFREQ_TABLE_END); i++) { if ((i<2) && (has_N44_O17_errata[policy->cpu])) p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; + else if (has_N60_errata[policy->cpu] && ((stock_freq * i)/8) < 2000000) + p4clockmod_table[i].frequency = CPUFREQ_ENTRY_INVALID; else p4clockmod_table[i].frequency = (stock_freq * i)/8; } diff --git a/trunk/arch/i386/kernel/cpu/cyrix.c b/trunk/arch/i386/kernel/cpu/cyrix.c index c0c3b59de32c..abcff92f994c 100644 --- a/trunk/arch/i386/kernel/cpu/cyrix.c +++ b/trunk/arch/i386/kernel/cpu/cyrix.c @@ -173,7 +173,7 @@ static void __cpuinit geode_configure(void) ccr4 = getCx86(CX86_CCR4); ccr4 |= 0x38; /* FPU fast, DTE cache, Mem bypass */ - setCx86(CX86_CCR3, ccr3); + setCx86(CX86_CCR4, ccr4); set_cx86_memwb(); set_cx86_reorder(); diff --git a/trunk/arch/i386/kernel/io_apic.c b/trunk/arch/i386/kernel/io_apic.c index 6a3875f81a0a..2424cc9c7b3d 100644 --- a/trunk/arch/i386/kernel/io_apic.c +++ b/trunk/arch/i386/kernel/io_apic.c @@ -1227,32 +1227,26 @@ static u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_DEVICE_VECTOR , 0 } static int __assign_irq_vector(int irq) { - static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0; - int vector, offset, i; + static int current_vector = FIRST_DEVICE_VECTOR, offset = 0; + int vector; BUG_ON((unsigned)irq >= NR_IRQ_VECTORS); if (irq_vector[irq] > 0) return irq_vector[irq]; + current_vector += 8; + if (current_vector == SYSCALL_VECTOR) + current_vector += 8; + + if (current_vector >= FIRST_SYSTEM_VECTOR) { + offset++; + if (!(offset % 8)) + return -ENOSPC; + current_vector = FIRST_DEVICE_VECTOR + offset; + } + vector = current_vector; - offset = current_offset; -next: - vector += 8; - if (vector >= FIRST_SYSTEM_VECTOR) { - offset = (offset + 1) % 8; - vector = FIRST_DEVICE_VECTOR + offset; - } - if (vector == current_vector) - return -ENOSPC; - if (vector == SYSCALL_VECTOR) - goto next; - for (i = 0; i < NR_IRQ_VECTORS; i++) - if (irq_vector[i] == vector) - goto next; - - current_vector = vector; - current_offset = offset; irq_vector[irq] = vector; return vector; diff --git a/trunk/arch/i386/mach-default/setup.c b/trunk/arch/i386/mach-default/setup.c index cc2f519b2f7f..c511705c386c 100644 --- a/trunk/arch/i386/mach-default/setup.c +++ b/trunk/arch/i386/mach-default/setup.c @@ -102,7 +102,7 @@ void __init time_init_hook(void) * along the MCA bus. Use this to hook into that chain if you will need * it. **/ -void mca_nmi_hook(void) +void __init mca_nmi_hook(void) { /* If I recall correctly, there's a whole bunch of other things that * we can do to check for NMI problems, but that's all I know about diff --git a/trunk/arch/ia64/kernel/acpi.c b/trunk/arch/ia64/kernel/acpi.c index 29f05d4b68cd..ef2fe474f107 100644 --- a/trunk/arch/ia64/kernel/acpi.c +++ b/trunk/arch/ia64/kernel/acpi.c @@ -609,9 +609,6 @@ EXPORT_SYMBOL(acpi_register_gsi); void acpi_unregister_gsi(u32 gsi) { - if (acpi_irq_model == ACPI_IRQ_MODEL_PLATFORM) - return; - iosapic_unregister_intr(gsi); } diff --git a/trunk/arch/ia64/kernel/irq.c b/trunk/arch/ia64/kernel/irq.c index ce49c85c928f..54d55e4d64f7 100644 --- a/trunk/arch/ia64/kernel/irq.c +++ b/trunk/arch/ia64/kernel/irq.c @@ -122,9 +122,6 @@ static void migrate_irqs(void) for (irq=0; irq < NR_IRQS; irq++) { desc = irq_desc + irq; - if (desc->status == IRQ_DISABLED) - continue; - /* * No handling for now. * TBD: Implement a disable function so we can now diff --git a/trunk/arch/mips/mips-boards/malta/Makefile b/trunk/arch/mips/mips-boards/malta/Makefile index cb7f349b0514..b662c75fb28e 100644 --- a/trunk/arch/mips/mips-boards/malta/Makefile +++ b/trunk/arch/mips/mips-boards/malta/Makefile @@ -19,6 +19,5 @@ # under Linux. # -obj-y := malta_int.o malta_setup.o -obj-$(CONFIG_MTD) += malta_mtd.o +obj-y := malta_int.o malta_mtd.o malta_setup.o obj-$(CONFIG_SMP) += malta_smp.o diff --git a/trunk/arch/mips/mips-boards/sim/sim_setup.c b/trunk/arch/mips/mips-boards/sim/sim_setup.c index ea2066c3a1f7..2659c1c3b78d 100644 --- a/trunk/arch/mips/mips-boards/sim/sim_setup.c +++ b/trunk/arch/mips/mips-boards/sim/sim_setup.c @@ -57,7 +57,7 @@ void __init plat_mem_setup(void) board_time_init = sim_time_init; prom_printf("Linux started...\n"); -#ifdef CONFIG_MIPS_MT_SMP +#ifdef CONFIG_MT_SMP sanitize_tlb_entries(); #endif } diff --git a/trunk/arch/mips/momentum/ocelot_g/prom.c b/trunk/arch/mips/momentum/ocelot_g/prom.c index 2f75c6b91ec5..6509a9c9863c 100644 --- a/trunk/arch/mips/momentum/ocelot_g/prom.c +++ b/trunk/arch/mips/momentum/ocelot_g/prom.c @@ -28,7 +28,7 @@ struct callvectors* debug_vectors; extern unsigned long marvell_base; extern unsigned long bus_clock; -#ifdef CONFIG_GALILEO_GT64240_ETH +#ifdef CONFIG_GALILLEO_GT64240_ETH extern unsigned char prom_mac_addr_base[6]; #endif @@ -61,7 +61,7 @@ void __init prom_init(void) mips_machgroup = MACH_GROUP_MOMENCO; mips_machtype = MACH_MOMENCO_OCELOT_G; -#ifdef CONFIG_GALILEO_GT64240_ETH +#ifdef CONFIG_GALILLEO_GT64240_ETH /* get the base MAC address for on-board ethernet ports */ memcpy(prom_mac_addr_base, (void*)0xfc807cf2, 6); #endif diff --git a/trunk/arch/mips/momentum/ocelot_g/setup.c b/trunk/arch/mips/momentum/ocelot_g/setup.c index 9db638a7982c..d288f7b01842 100644 --- a/trunk/arch/mips/momentum/ocelot_g/setup.c +++ b/trunk/arch/mips/momentum/ocelot_g/setup.c @@ -64,7 +64,7 @@ #include "ocelot_pld.h" -#ifdef CONFIG_GALILEO_GT64240_ETH +#ifdef CONFIG_GALILLEO_GT64240_ETH extern unsigned char prom_mac_addr_base[6]; #endif @@ -185,7 +185,7 @@ void __init plat_mem_setup(void) /* do handoff reconfiguration */ PMON_v2_setup(); -#ifdef CONFIG_GALILEO_GT64240_ETH +#ifdef CONFIG_GALILLEO_GT64240_ETH /* get the mac addr */ memcpy(prom_mac_addr_base, (void*)0xfc807cf2, 6); #endif diff --git a/trunk/arch/powerpc/Kconfig b/trunk/arch/powerpc/Kconfig index d6abe495c6b0..b268c417c0bf 100644 --- a/trunk/arch/powerpc/Kconfig +++ b/trunk/arch/powerpc/Kconfig @@ -526,15 +526,12 @@ config PPC_IBM_CELL_BLADE select UDBG_RTAS_CONSOLE config PPC_PS3 - bool "Sony PS3 (incomplete)" + bool "Sony PS3" depends on PPC_MULTIPLATFORM && PPC64 select PPC_CELL help This option enables support for the Sony PS3 game console and other platforms using the PS3 hypervisor. - Support for this platform is not yet complete, so - enabling this will not result in a bootable kernel on a - PS3 system. config PPC_NATIVE bool diff --git a/trunk/arch/powerpc/kernel/pci_64.c b/trunk/arch/powerpc/kernel/pci_64.c index 01f18c683407..73c59ec49120 100644 --- a/trunk/arch/powerpc/kernel/pci_64.c +++ b/trunk/arch/powerpc/kernel/pci_64.c @@ -1430,7 +1430,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus, for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) { bus = pci_bus_b(ln); - if (in_bus >= bus->number && in_bus <= bus->subordinate) + if (in_bus >= bus->number && in_bus < (bus->number + bus->subordinate)) break; bus = NULL; } diff --git a/trunk/arch/powerpc/platforms/ps3/Makefile b/trunk/arch/powerpc/platforms/ps3/Makefile index 1994904f580f..3757cfabc8ce 100644 --- a/trunk/arch/powerpc/platforms/ps3/Makefile +++ b/trunk/arch/powerpc/platforms/ps3/Makefile @@ -1,5 +1,4 @@ -obj-y += setup.o mm.o time.o hvcall.o htab.o repository.o +obj-y += setup.o mm.o smp.o time.o hvcall.o htab.o repository.o obj-y += interrupt.o exports.o os-area.o -obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_SPU_BASE) += spu.o diff --git a/trunk/arch/powerpc/platforms/ps3/interrupt.c b/trunk/arch/powerpc/platforms/ps3/interrupt.c index 6f5de438b980..056c1e4141ba 100644 --- a/trunk/arch/powerpc/platforms/ps3/interrupt.c +++ b/trunk/arch/powerpc/platforms/ps3/interrupt.c @@ -71,7 +71,7 @@ int ps3_free_io_irq(unsigned int virq) result = lv1_destruct_io_irq_outlet(virq_to_hw(virq)); - if (result) + if (!result) pr_debug("%s:%d: lv1_destruct_io_irq_outlet failed: %s\n", __func__, __LINE__, ps3_result(result)); diff --git a/trunk/arch/sparc/kernel/process.c b/trunk/arch/sparc/kernel/process.c index 113bd48a89bd..89a28cc018c9 100644 --- a/trunk/arch/sparc/kernel/process.c +++ b/trunk/arch/sparc/kernel/process.c @@ -54,7 +54,6 @@ void (*pm_idle)(void); * handler when auxio is not present-- unused for now... */ void (*pm_power_off)(void) = machine_power_off; -EXPORT_SYMBOL(pm_power_off); /* * sysctl - toggle power-off restriction for serial console diff --git a/trunk/arch/sparc/kernel/smp.c b/trunk/arch/sparc/kernel/smp.c index 6b5f26b0fb75..276f22881d0f 100644 --- a/trunk/arch/sparc/kernel/smp.c +++ b/trunk/arch/sparc/kernel/smp.c @@ -292,8 +292,8 @@ int setup_profiling_timer(unsigned int multiplier) void __init smp_prepare_cpus(unsigned int max_cpus) { - extern void __init smp4m_boot_cpus(void); - extern void __init smp4d_boot_cpus(void); + extern void smp4m_boot_cpus(void); + extern void smp4d_boot_cpus(void); int i, cpuid, extra; printk("Entering SMP Mode...\n"); @@ -375,8 +375,8 @@ void __init smp_prepare_boot_cpu(void) int __cpuinit __cpu_up(unsigned int cpu) { - extern int __cpuinit smp4m_boot_one_cpu(int); - extern int __cpuinit smp4d_boot_one_cpu(int); + extern int smp4m_boot_one_cpu(int); + extern int smp4d_boot_one_cpu(int); int ret=0; switch(sparc_cpu_model) { diff --git a/trunk/arch/sparc/kernel/sun4d_smp.c b/trunk/arch/sparc/kernel/sun4d_smp.c index c69de5d4863d..c80ea61e8ba0 100644 --- a/trunk/arch/sparc/kernel/sun4d_smp.c +++ b/trunk/arch/sparc/kernel/sun4d_smp.c @@ -164,7 +164,7 @@ void __init smp4d_boot_cpus(void) local_flush_cache_all(); } -int __cpuinit smp4d_boot_one_cpu(int i) +int smp4d_boot_one_cpu(int i) { extern unsigned long sun4d_cpu_startup; unsigned long *entry = &sun4d_cpu_startup; diff --git a/trunk/arch/um/Kconfig.i386 b/trunk/arch/um/Kconfig.i386 index d6cffb27fff8..77558a88a2fe 100644 --- a/trunk/arch/um/Kconfig.i386 +++ b/trunk/arch/um/Kconfig.i386 @@ -36,14 +36,14 @@ choice So, if you do not know what to do here, say 'Default split'. -config HOST_VMSPLIT_3G - bool "Default split (3G/1G user/kernel host split)" -config HOST_VMSPLIT_3G_OPT - bool "3G/1G user/kernel host split (for full 1G low memory)" -config HOST_VMSPLIT_2G - bool "2G/2G user/kernel host split" -config HOST_VMSPLIT_1G - bool "1G/3G user/kernel host split" + config HOST_VMSPLIT_3G + bool "Default split (3G/1G user/kernel host split)" + config HOST_VMSPLIT_3G_OPT + bool "3G/1G user/kernel host split (for full 1G low memory)" + config HOST_VMSPLIT_2G + bool "2G/2G user/kernel host split" + config HOST_VMSPLIT_1G + bool "1G/3G user/kernel host split" endchoice config TOP_ADDR diff --git a/trunk/arch/um/sys-i386/signal.c b/trunk/arch/um/sys-i386/signal.c index 3f6acd667717..0709fc6670c2 100644 --- a/trunk/arch/um/sys-i386/signal.c +++ b/trunk/arch/um/sys-i386/signal.c @@ -219,8 +219,7 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig, unsigned long save_sp = PT_REGS_SP(regs); int err = 0; - /* This is the same calculation as i386 - ((sp + 4) & 15) == 0 */ - stack_top = ((stack_top + 4) & -16UL) - 4; + stack_top &= -8UL; frame = (struct sigframe __user *) stack_top - 1; if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) return 1; diff --git a/trunk/arch/um/sys-x86_64/signal.c b/trunk/arch/um/sys-x86_64/signal.c index af2f017617b4..9edf114faf79 100644 --- a/trunk/arch/um/sys-x86_64/signal.c +++ b/trunk/arch/um/sys-x86_64/signal.c @@ -191,9 +191,8 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, struct task_struct *me = current; frame = (struct rt_sigframe __user *) - round_down(stack_top - sizeof(struct rt_sigframe), 16); - /* Subtract 128 for a red zone and 8 for proper alignment */ - frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128 - 8); + round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; + frame = (struct rt_sigframe __user *) ((unsigned long) frame - 128); if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) goto out; diff --git a/trunk/block/scsi_ioctl.c b/trunk/block/scsi_ioctl.c index 65c6a3cba6d6..2528a0c0dec8 100644 --- a/trunk/block/scsi_ioctl.c +++ b/trunk/block/scsi_ioctl.c @@ -223,7 +223,7 @@ static int verify_command(struct file *file, unsigned char *cmd) static int sg_io(struct file *file, request_queue_t *q, struct gendisk *bd_disk, struct sg_io_hdr *hdr) { - unsigned long start_time, timeout; + unsigned long start_time; int writing = 0, ret = 0; struct request *rq; char sense[SCSI_SENSE_BUFFERSIZE]; @@ -271,8 +271,7 @@ static int sg_io(struct file *file, request_queue_t *q, rq->cmd_type = REQ_TYPE_BLOCK_PC; - timeout = msecs_to_jiffies(hdr->timeout); - rq->timeout = (timeout < INT_MAX) ? timeout : INT_MAX; + rq->timeout = jiffies_to_msecs(hdr->timeout); if (!rq->timeout) rq->timeout = q->sg_timeout; if (!rq->timeout) diff --git a/trunk/drivers/ata/ahci.c b/trunk/drivers/ata/ahci.c index 48616c6fee9d..28a82e3403f1 100644 --- a/trunk/drivers/ata/ahci.c +++ b/trunk/drivers/ata/ahci.c @@ -1282,7 +1282,7 @@ static void ahci_thaw(struct ata_port *ap) /* clear IRQ */ tmp = readl(port_mmio + PORT_IRQ_STAT); writel(tmp, port_mmio + PORT_IRQ_STAT); - writel(1 << ap->port_no, mmio + HOST_IRQ_STAT); + writel(1 << ap->id, mmio + HOST_IRQ_STAT); /* turn IRQ back on */ writel(DEF_PORT_IRQ, port_mmio + PORT_IRQ_MASK); diff --git a/trunk/drivers/ata/libata-core.c b/trunk/drivers/ata/libata-core.c index 667acd283364..a388a8df0043 100644 --- a/trunk/drivers/ata/libata-core.c +++ b/trunk/drivers/ata/libata-core.c @@ -1037,7 +1037,7 @@ static unsigned int ata_id_xfermask(const u16 *id) * the PIO timing number for the maximum. Turn it into * a mask. */ - u8 mode = (id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF; + u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF; if (mode < 5) /* Valid PIO range */ pio_mask = (2 << mode) - 1; else @@ -1250,7 +1250,6 @@ unsigned ata_exec_internal_sg(struct ata_device *dev, ata_sg_init(qc, sg, n_elem); qc->nsect = buflen / ATA_SECT_SIZE; - qc->nbytes = buflen; } qc->private_data = &wait; diff --git a/trunk/drivers/ata/libata-eh.c b/trunk/drivers/ata/libata-eh.c index 748435807d68..56cf59b60ec4 100644 --- a/trunk/drivers/ata/libata-eh.c +++ b/trunk/drivers/ata/libata-eh.c @@ -1796,7 +1796,7 @@ static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev) *r_failed_dev = dev; DPRINTK("EXIT\n"); - return rc; + return 0; } /** diff --git a/trunk/drivers/ata/libata-scsi.c b/trunk/drivers/ata/libata-scsi.c index 73902d335767..7cc5a4a910a4 100644 --- a/trunk/drivers/ata/libata-scsi.c +++ b/trunk/drivers/ata/libata-scsi.c @@ -273,8 +273,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) { int rc = 0; u8 scsi_cmd[MAX_COMMAND_SIZE]; - u8 args[7], *sensebuf = NULL; - int cmd_result; + u8 args[7]; + struct scsi_sense_hdr sshdr; if (arg == NULL) return -EINVAL; @@ -282,14 +282,10 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) if (copy_from_user(args, arg, sizeof(args))) return -EFAULT; - sensebuf = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_NOIO); - if (!sensebuf) - return -ENOMEM; - memset(scsi_cmd, 0, sizeof(scsi_cmd)); scsi_cmd[0] = ATA_16; scsi_cmd[1] = (3 << 1); /* Non-data */ - scsi_cmd[2] = 0x20; /* cc but no off.line or data xfer */ + /* scsi_cmd[2] is already 0 -- no off.line, cc, or data xfer */ scsi_cmd[4] = args[1]; scsi_cmd[6] = args[2]; scsi_cmd[8] = args[3]; @@ -299,46 +295,11 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) /* Good values for timeout and retries? Values below from scsi_ioctl_send_command() for default case... */ - cmd_result = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0, - sensebuf, (10*HZ), 5, 0); - - if (driver_byte(cmd_result) == DRIVER_SENSE) {/* sense data available */ - u8 *desc = sensebuf + 8; - cmd_result &= ~(0xFF<<24); /* DRIVER_SENSE is not an error */ - - /* If we set cc then ATA pass-through will cause a - * check condition even if no error. Filter that. */ - if (cmd_result & SAM_STAT_CHECK_CONDITION) { - struct scsi_sense_hdr sshdr; - scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, - &sshdr); - if (sshdr.sense_key==0 && - sshdr.asc==0 && sshdr.ascq==0) - cmd_result &= ~SAM_STAT_CHECK_CONDITION; - } - - /* Send userspace ATA registers */ - if (sensebuf[0] == 0x72 && /* format is "descriptor" */ - desc[0] == 0x09) {/* code is "ATA Descriptor" */ - args[0] = desc[13]; /* status */ - args[1] = desc[3]; /* error */ - args[2] = desc[5]; /* sector count (0:7) */ - args[3] = desc[7]; /* lbal */ - args[4] = desc[9]; /* lbam */ - args[5] = desc[11]; /* lbah */ - args[6] = desc[12]; /* select */ - if (copy_to_user(arg, args, sizeof(args))) - rc = -EFAULT; - } - } - - if (cmd_result) { + if (scsi_execute_req(scsidev, scsi_cmd, DMA_NONE, NULL, 0, &sshdr, + (10*HZ), 5)) rc = -EIO; - goto error; - } - error: - kfree(sensebuf); + /* Need code to retrieve data from check condition? */ return rc; } @@ -1022,10 +983,11 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc) } tf->command = ATA_CMD_VERIFY; /* READ VERIFY */ - } else - /* Issue ATA STANDBY IMMEDIATE command */ - tf->command = ATA_CMD_STANDBYNOW1; - + } else { + tf->nsect = 0; /* time period value (0 implies now) */ + tf->command = ATA_CMD_STANDBY; + /* Consider: ATA STANDBY IMMEDIATE command */ + } /* * Standby and Idle condition timers could be implemented but that * would require libata to implement the Power condition mode page diff --git a/trunk/drivers/ata/pata_atiixp.c b/trunk/drivers/ata/pata_atiixp.c index 504e1dbfffd7..6f6672c55131 100644 --- a/trunk/drivers/ata/pata_atiixp.c +++ b/trunk/drivers/ata/pata_atiixp.c @@ -36,22 +36,15 @@ enum { static int atiixp_pre_reset(struct ata_port *ap) { struct pci_dev *pdev = to_pci_dev(ap->host->dev); - static const struct pci_bits atiixp_enable_bits[] = { + static struct pci_bits atiixp_enable_bits[] = { { 0x48, 1, 0x01, 0x00 }, { 0x48, 1, 0x08, 0x00 } }; - u8 udma; if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->port_no])) return -ENOENT; - /* Hack from drivers/ide/pci. Really we want to know how to do the - raw detection not play follow the bios mode guess */ - pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ap->port_no, &udma); - if ((udma & 0x07) >= 0x04 || (udma & 0x70) >= 0x40) - ap->cbl = ATA_CBL_PATA80; - else - ap->cbl = ATA_CBL_PATA40; + ap->cbl = ATA_CBL_PATA80; return ata_std_prereset(ap); } diff --git a/trunk/drivers/ata/pata_jmicron.c b/trunk/drivers/ata/pata_jmicron.c index d50264af2848..2d661cb4df3c 100644 --- a/trunk/drivers/ata/pata_jmicron.c +++ b/trunk/drivers/ata/pata_jmicron.c @@ -204,12 +204,20 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i u32 reg; - /* PATA controller is fn 1, AHCI is fn 0 */ - if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1) - return -ENODEV; + if (id->driver_data != 368) { + /* Put the controller into AHCI mode in case the AHCI driver + has not yet been loaded. This can be done with either + function present */ - /* The 365/66 have two PATA channels, redirect the second */ - if (id->driver_data == 365 || id->driver_data == 366) { + /* FIXME: We may want a way to override this in future */ + pci_write_config_byte(pdev, 0x41, 0xa1); + + /* PATA controller is fn 1, AHCI is fn 0 */ + if (PCI_FUNC(pdev->devfn) != 1) + return -ENODEV; + } + if ( id->driver_data == 365 || id->driver_data == 366) { + /* The 365/66 have two PATA channels, redirect the second */ pci_read_config_dword(pdev, 0x80, ®); reg |= (1 << 24); /* IDE1 to PATA IDE secondary */ pci_write_config_dword(pdev, 0x80, reg); diff --git a/trunk/drivers/ata/pata_platform.c b/trunk/drivers/ata/pata_platform.c index 40ae11cbfda4..443b1d85c6c4 100644 --- a/trunk/drivers/ata/pata_platform.c +++ b/trunk/drivers/ata/pata_platform.c @@ -30,7 +30,7 @@ static int pio_mask = 1; * Provide our own set_mode() as we don't want to change anything that has * already been configured.. */ -static int pata_platform_set_mode(struct ata_port *ap, struct ata_device **unused) +static void pata_platform_set_mode(struct ata_port *ap) { int i; @@ -44,7 +44,6 @@ static int pata_platform_set_mode(struct ata_port *ap, struct ata_device **unuse dev->flags |= ATA_DFLAG_PIO; } } - return 0; } static void pata_platform_host_stop(struct ata_host *host) diff --git a/trunk/drivers/ata/pata_sil680.c b/trunk/drivers/ata/pata_sil680.c index e8dfd8fc3ff7..32cf0bfa8921 100644 --- a/trunk/drivers/ata/pata_sil680.c +++ b/trunk/drivers/ata/pata_sil680.c @@ -135,7 +135,7 @@ static void sil680_error_handler(struct ata_port *ap) static void sil680_set_piomode(struct ata_port *ap, struct ata_device *adev) { static u16 speed_p[5] = { 0x328A, 0x2283, 0x1104, 0x10C3, 0x10C1 }; - static u16 speed_t[5] = { 0x328A, 0x2283, 0x1281, 0x10C3, 0x10C1 }; + static u16 speed_t[5] = { 0x328A, 0x1281, 0x1281, 0x10C3, 0x10C1 }; unsigned long tfaddr = sil680_selreg(ap, 0x02); unsigned long addr = sil680_seldev(ap, adev, 0x04); diff --git a/trunk/drivers/ata/pata_via.c b/trunk/drivers/ata/pata_via.c index f0b6c3b71429..f0d4f7e9ed31 100644 --- a/trunk/drivers/ata/pata_via.c +++ b/trunk/drivers/ata/pata_via.c @@ -23,7 +23,6 @@ * VIA VT8233c - UDMA100 * VIA VT8235 - UDMA133 * VIA VT8237 - UDMA133 - * VIA VT8237S - UDMA133 * VIA VT8251 - UDMA133 * * Most registers remain compatible across chips. Others start reserved @@ -62,7 +61,7 @@ #include #define DRV_NAME "pata_via" -#define DRV_VERSION "0.2.1" +#define DRV_VERSION "0.2.0" /* * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx @@ -96,7 +95,6 @@ static const struct via_isa_bridge { u8 rev_max; u16 flags; } via_isa_bridges[] = { - { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "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 }, { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES}, diff --git a/trunk/drivers/char/agp/amd-k7-agp.c b/trunk/drivers/char/agp/amd-k7-agp.c index c85c8cadb6df..51d0d562d01e 100644 --- a/trunk/drivers/char/agp/amd-k7-agp.c +++ b/trunk/drivers/char/agp/amd-k7-agp.c @@ -101,11 +101,6 @@ static int amd_create_gatt_pages(int nr_tables) for (i = 0; i < nr_tables; i++) { entry = kzalloc(sizeof(struct amd_page_map), GFP_KERNEL); if (entry == NULL) { - while (i > 0) { - kfree(tables[i-1]); - i--; - } - kfree(tables); retval = -ENOMEM; break; } diff --git a/trunk/drivers/char/agp/amd64-agp.c b/trunk/drivers/char/agp/amd64-agp.c index 93d2209fee4c..979300405c0e 100644 --- a/trunk/drivers/char/agp/amd64-agp.c +++ b/trunk/drivers/char/agp/amd64-agp.c @@ -655,7 +655,7 @@ static struct pci_device_id agp_amd64_pci_table[] = { .class = (PCI_CLASS_BRIDGE_HOST << 8), .class_mask = ~0, .vendor = PCI_VENDOR_ID_VIA, - .device = PCI_DEVICE_ID_VIA_VT3336, + .device = PCI_DEVICE_ID_VIA_K8M890CE, .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, }, diff --git a/trunk/drivers/char/agp/ati-agp.c b/trunk/drivers/char/agp/ati-agp.c index 9987dc2e0c3f..f244c6682738 100644 --- a/trunk/drivers/char/agp/ati-agp.c +++ b/trunk/drivers/char/agp/ati-agp.c @@ -41,18 +41,18 @@ static struct gatt_mask ati_generic_masks[] = }; -struct ati_page_map { +typedef struct _ati_page_map { unsigned long *real; unsigned long __iomem *remapped; -}; +} ati_page_map; static struct _ati_generic_private { volatile u8 __iomem *registers; - struct ati_page_map **gatt_pages; + ati_page_map **gatt_pages; int num_tables; } ati_generic_private; -static int ati_create_page_map(struct ati_page_map *page_map) +static int ati_create_page_map(ati_page_map *page_map) { int i, err = 0; @@ -82,7 +82,7 @@ static int ati_create_page_map(struct ati_page_map *page_map) } -static void ati_free_page_map(struct ati_page_map *page_map) +static void ati_free_page_map(ati_page_map *page_map) { unmap_page_from_agp(virt_to_page(page_map->real)); iounmap(page_map->remapped); @@ -94,8 +94,8 @@ static void ati_free_page_map(struct ati_page_map *page_map) static void ati_free_gatt_pages(void) { int i; - struct ati_page_map **tables; - struct ati_page_map *entry; + ati_page_map **tables; + ati_page_map *entry; tables = ati_generic_private.gatt_pages; for (i = 0; i < ati_generic_private.num_tables; i++) { @@ -112,30 +112,30 @@ static void ati_free_gatt_pages(void) static int ati_create_gatt_pages(int nr_tables) { - struct ati_page_map **tables; - struct ati_page_map *entry; + ati_page_map **tables; + ati_page_map *entry; int retval = 0; int i; - tables = kzalloc((nr_tables + 1) * sizeof(struct ati_page_map *),GFP_KERNEL); + tables = kzalloc((nr_tables + 1) * sizeof(ati_page_map *),GFP_KERNEL); if (tables == NULL) return -ENOMEM; for (i = 0; i < nr_tables; i++) { - entry = kzalloc(sizeof(struct ati_page_map), GFP_KERNEL); + entry = kzalloc(sizeof(ati_page_map), GFP_KERNEL); if (entry == NULL) { - while (i > 0) { - kfree(tables[i-1]); + while (i>0) { + kfree (tables[i-1]); i--; } - kfree(tables); + kfree (tables); + tables = NULL; retval = -ENOMEM; break; } tables[i] = entry; retval = ati_create_page_map(entry); - if (retval != 0) - break; + if (retval != 0) break; } ati_generic_private.num_tables = nr_tables; ati_generic_private.gatt_pages = tables; @@ -340,7 +340,7 @@ static int ati_remove_memory(struct agp_memory * mem, off_t pg_start, static int ati_create_gatt_table(struct agp_bridge_data *bridge) { struct aper_size_info_lvl2 *value; - struct ati_page_map page_dir; + ati_page_map page_dir; unsigned long addr; int retval; u32 temp; @@ -400,7 +400,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge) static int ati_free_gatt_table(struct agp_bridge_data *bridge) { - struct ati_page_map page_dir; + ati_page_map page_dir; page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table; diff --git a/trunk/drivers/char/agp/intel-agp.c b/trunk/drivers/char/agp/intel-agp.c index a3011de51f7c..ab0a9c0ad7c0 100644 --- a/trunk/drivers/char/agp/intel-agp.c +++ b/trunk/drivers/char/agp/intel-agp.c @@ -1955,15 +1955,6 @@ static int agp_intel_resume(struct pci_dev *pdev) pci_restore_state(pdev); - /* We should restore our graphics device's config space, - * as host bridge (00:00) resumes before graphics device (02:00), - * then our access to its pci space can work right. - */ - if (intel_i810_private.i810_dev) - pci_restore_state(intel_i810_private.i810_dev); - if (intel_i830_private.i830_dev) - pci_restore_state(intel_i830_private.i830_dev); - if (bridge->driver == &intel_generic_driver) intel_configure(); else if (bridge->driver == &intel_850_driver) diff --git a/trunk/drivers/char/agp/via-agp.c b/trunk/drivers/char/agp/via-agp.c index 2ded7a280d7f..c149ac9ce9a7 100644 --- a/trunk/drivers/char/agp/via-agp.c +++ b/trunk/drivers/char/agp/via-agp.c @@ -380,23 +380,9 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata = /* P4M800CE */ { .device_id = PCI_DEVICE_ID_VIA_P4M800CE, - .chipset_name = "VT3314", - }, - /* CX700 */ - { - .device_id = PCI_DEVICE_ID_VIA_CX700, - .chipset_name = "CX700", - }, - /* VT3336 */ - { - .device_id = PCI_DEVICE_ID_VIA_VT3336, - .chipset_name = "VT3336", - }, - /* P4M890 */ - { - .device_id = PCI_DEVICE_ID_VIA_P4M890, - .chipset_name = "P4M890", + .chipset_name = "P4M800CE", }, + { }, /* dummy final entry, always present */ }; @@ -538,9 +524,6 @@ static const struct pci_device_id agp_via_pci_table[] = { ID(PCI_DEVICE_ID_VIA_83_87XX_1), ID(PCI_DEVICE_ID_VIA_3296_0), ID(PCI_DEVICE_ID_VIA_P4M800CE), - ID(PCI_DEVICE_ID_VIA_CX700), - ID(PCI_DEVICE_ID_VIA_VT3336), - ID(PCI_DEVICE_ID_VIA_P4M890), { } }; diff --git a/trunk/drivers/char/ipmi/ipmi_msghandler.c b/trunk/drivers/char/ipmi/ipmi_msghandler.c index 53582b53da95..4e4691a53890 100644 --- a/trunk/drivers/char/ipmi/ipmi_msghandler.c +++ b/trunk/drivers/char/ipmi/ipmi_msghandler.c @@ -3649,6 +3649,8 @@ static void ipmi_timeout_handler(long timeout_period) unsigned long flags; int i; + INIT_LIST_HEAD(&timeouts); + rcu_read_lock(); list_for_each_entry_rcu(intf, &ipmi_interfaces, link) { /* See if any waiting messages need to be processed. */ @@ -3669,7 +3671,6 @@ static void ipmi_timeout_handler(long timeout_period) /* Go through the seq table and find any messages that have timed out, putting them in the timeouts list. */ - INIT_LIST_HEAD(&timeouts); spin_lock_irqsave(&intf->seq_lock, flags); for (i = 0; i < IPMI_IPMB_NUM_SEQ; i++) check_msg_timeout(intf, &(intf->seq_table[i]), diff --git a/trunk/drivers/char/sysrq.c b/trunk/drivers/char/sysrq.c index 7fd3cd5ddf21..13935235e066 100644 --- a/trunk/drivers/char/sysrq.c +++ b/trunk/drivers/char/sysrq.c @@ -215,7 +215,7 @@ static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty) } static struct sysrq_key_op sysrq_showstate_blocked_op = { .handler = sysrq_handle_showstate_blocked, - .help_msg = "shoW-blocked-tasks", + .help_msg = "showBlockedTasks", .action_msg = "Show Blocked State", .enable_mask = SYSRQ_ENABLE_DUMP, }; @@ -315,16 +315,15 @@ static struct sysrq_key_op *sysrq_key_table[36] = { &sysrq_loglevel_op, /* 9 */ /* - * a: Don't use for system provided sysrqs, it is handled specially on - * sparc and will never arrive. + * Don't use for system provided sysrqs, it is handled specially on + * sparc and will never arrive */ NULL, /* a */ &sysrq_reboot_op, /* b */ - &sysrq_crashdump_op, /* c & ibm_emac driver debug */ + &sysrq_crashdump_op, /* c */ &sysrq_showlocks_op, /* d */ &sysrq_term_op, /* e */ &sysrq_moom_op, /* f */ - /* g: May be registered by ppc for kgdb */ NULL, /* g */ NULL, /* h */ &sysrq_kill_op, /* i */ @@ -333,19 +332,18 @@ static struct sysrq_key_op *sysrq_key_table[36] = { NULL, /* l */ &sysrq_showmem_op, /* m */ &sysrq_unrt_op, /* n */ - /* o: This will often be registered as 'Off' at init time */ + /* This will often be registered as 'Off' at init time */ NULL, /* o */ &sysrq_showregs_op, /* p */ NULL, /* q */ - &sysrq_unraw_op, /* r */ + &sysrq_unraw_op, /* r */ &sysrq_sync_op, /* s */ &sysrq_showstate_op, /* t */ &sysrq_mountro_op, /* u */ - /* v: May be registered at init time by SMP VOYAGER */ + /* May be assigned at init time by SMP VOYAGER */ NULL, /* v */ - &sysrq_showstate_blocked_op, /* w */ - /* x: May be registered on ppc/powerpc for xmon */ - NULL, /* x */ + NULL, /* w */ + &sysrq_showstate_blocked_op, /* x */ NULL, /* y */ NULL /* z */ }; diff --git a/trunk/drivers/cpufreq/cpufreq.c b/trunk/drivers/cpufreq/cpufreq.c index a45cc89e387a..d91330432ba2 100644 --- a/trunk/drivers/cpufreq/cpufreq.c +++ b/trunk/drivers/cpufreq/cpufreq.c @@ -722,13 +722,8 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) spin_unlock_irqrestore(&cpufreq_driver_lock, flags); dprintk("CPU already managed, adding link\n"); - ret = sysfs_create_link(&sys_dev->kobj, - &managed_policy->kobj, - "cpufreq"); - if (ret) { - mutex_unlock(&policy->lock); - goto err_out_driver_exit; - } + sysfs_create_link(&sys_dev->kobj, + &managed_policy->kobj, "cpufreq"); cpufreq_debug_enable_ratelimit(); mutex_unlock(&policy->lock); @@ -775,12 +770,8 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) dprintk("CPU %u already managed, adding link\n", j); cpufreq_cpu_get(cpu); cpu_sys_dev = get_cpu_sysdev(j); - ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, - "cpufreq"); - if (ret) { - mutex_unlock(&policy->lock); - goto err_out_unregister; - } + sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, + "cpufreq"); } policy->governor = NULL; /* to assure that the starting sequence is diff --git a/trunk/drivers/hid/hid-core.c b/trunk/drivers/hid/hid-core.c index 49f18f5b2514..b8cf50fcd64d 100644 --- a/trunk/drivers/hid/hid-core.c +++ b/trunk/drivers/hid/hid-core.c @@ -543,7 +543,6 @@ void hid_free_device(struct hid_device *device) } kfree(device->rdesc); - kfree(device->collection); kfree(device); } EXPORT_SYMBOL_GPL(hid_free_device); diff --git a/trunk/drivers/hid/hid-input.c b/trunk/drivers/hid/hid-input.c index c7a6833f6821..9cf591a1bda3 100644 --- a/trunk/drivers/hid/hid-input.c +++ b/trunk/drivers/hid/hid-input.c @@ -35,11 +35,6 @@ #include -static int hid_pb_fnmode = 1; -module_param_named(pb_fnmode, hid_pb_fnmode, int, 0644); -MODULE_PARM_DESC(pb_fnmode, - "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)"); - #define unk KEY_UNKNOWN static const unsigned char hid_keyboard[256] = { @@ -159,7 +154,7 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, return 1; } - if (hid_pb_fnmode) { + if (hid->pb_fnmode) { int do_translate; trans = find_translation(powerbook_fn_keys, usage->code); @@ -168,8 +163,8 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, do_translate = 1; else if (trans->flags & POWERBOOK_FLAG_FKEY) do_translate = - (hid_pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) || - (hid_pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)); + (hid->pb_fnmode == 2 && (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)) || + (hid->pb_fnmode == 1 && !(hid->quirks & HID_QUIRK_POWERBOOK_FN_ON)); else do_translate = (hid->quirks & HID_QUIRK_POWERBOOK_FN_ON); @@ -436,7 +431,6 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x040: map_key_clear(KEY_MENU); break; case 0x045: map_key_clear(KEY_RADIO); break; - case 0x083: map_key_clear(KEY_LAST); break; case 0x088: map_key_clear(KEY_PC); break; case 0x089: map_key_clear(KEY_TV); break; case 0x08a: map_key_clear(KEY_WWW); break; @@ -454,7 +448,6 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x096: map_key_clear(KEY_TAPE); break; case 0x097: map_key_clear(KEY_TV2); break; case 0x098: map_key_clear(KEY_SAT); break; - case 0x09a: map_key_clear(KEY_PVR); break; case 0x09c: map_key_clear(KEY_CHANNELUP); break; case 0x09d: map_key_clear(KEY_CHANNELDOWN); break; diff --git a/trunk/drivers/ide/ide-pnp.c b/trunk/drivers/ide/ide-pnp.c index 98410ca044cf..df7d1504f84e 100644 --- a/trunk/drivers/ide/ide-pnp.c +++ b/trunk/drivers/ide/ide-pnp.c @@ -73,8 +73,3 @@ void __init pnpide_init(void) { pnp_register_driver(&idepnp_driver); } - -void __exit pnpide_exit(void) -{ - pnp_unregister_driver(&idepnp_driver); -} diff --git a/trunk/drivers/ide/ide.c b/trunk/drivers/ide/ide.c index 6c9bd5165bdb..16890769dca6 100644 --- a/trunk/drivers/ide/ide.c +++ b/trunk/drivers/ide/ide.c @@ -1781,9 +1781,8 @@ static int __init ide_setup(char *s) return 1; } -extern void __init pnpide_init(void); -extern void __exit pnpide_exit(void); -extern void __init h8300_ide_init(void); +extern void pnpide_init(void); +extern void h8300_ide_init(void); /* * probe_for_hwifs() finds/initializes "known" IDE interfaces @@ -2088,17 +2087,13 @@ int __init init_module (void) return ide_init(); } -void __exit cleanup_module (void) +void cleanup_module (void) { int index; for (index = 0; index < MAX_HWIFS; ++index) ide_unregister(index); -#ifdef CONFIG_BLK_DEV_IDEPNP - pnpide_exit(); -#endif - #ifdef CONFIG_PROC_FS proc_ide_destroy(); #endif diff --git a/trunk/drivers/ide/pci/aec62xx.c b/trunk/drivers/ide/pci/aec62xx.c index d261bfbad222..f286079d233f 100644 --- a/trunk/drivers/ide/pci/aec62xx.c +++ b/trunk/drivers/ide/pci/aec62xx.c @@ -441,7 +441,7 @@ static struct pci_driver driver = { .probe = aec62xx_init_one, }; -static int __init aec62xx_ide_init(void) +static int aec62xx_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/alim15x3.c b/trunk/drivers/ide/pci/alim15x3.c index 68df77ec502b..89109be5162c 100644 --- a/trunk/drivers/ide/pci/alim15x3.c +++ b/trunk/drivers/ide/pci/alim15x3.c @@ -907,7 +907,7 @@ static struct pci_driver driver = { .probe = alim15x3_init_one, }; -static int __init ali15x3_ide_init(void) +static int ali15x3_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/amd74xx.c b/trunk/drivers/ide/pci/amd74xx.c index a4336995a410..753fe0e21456 100644 --- a/trunk/drivers/ide/pci/amd74xx.c +++ b/trunk/drivers/ide/pci/amd74xx.c @@ -544,7 +544,7 @@ static struct pci_driver driver = { .probe = amd74xx_probe, }; -static int __init amd74xx_ide_init(void) +static int amd74xx_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/atiixp.c b/trunk/drivers/ide/pci/atiixp.c index 982ac31fa995..524e65de4398 100644 --- a/trunk/drivers/ide/pci/atiixp.c +++ b/trunk/drivers/ide/pci/atiixp.c @@ -291,12 +291,8 @@ static int atiixp_dma_check(ide_drive_t *drive) static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) { - u8 udma_mode = 0; - u8 ch = hwif->channel; - struct pci_dev *pdev = hwif->pci_dev; - if (!hwif->irq) - hwif->irq = ch ? 15 : 14; + hwif->irq = hwif->channel ? 15 : 14; hwif->autodma = 0; hwif->tuneproc = &atiixp_tuneproc; @@ -312,12 +308,8 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) hwif->mwdma_mask = 0x06; hwif->swdma_mask = 0x04; - pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, &udma_mode); - if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40) - hwif->udma_four = 1; - else - hwif->udma_four = 0; - + /* FIXME: proper cable detection needed */ + hwif->udma_four = 1; hwif->ide_dma_host_on = &atiixp_ide_dma_host_on; hwif->ide_dma_host_off = &atiixp_ide_dma_host_off; hwif->ide_dma_check = &atiixp_dma_check; @@ -328,6 +320,19 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif) hwif->drives[0].autodma = hwif->autodma; } +static void __devinit init_hwif_sb600_legacy(ide_hwif_t *hwif) +{ + + hwif->atapi_dma = 1; + hwif->ultra_mask = 0x7f; + hwif->mwdma_mask = 0x07; + hwif->swdma_mask = 0x07; + + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->autodma; + hwif->drives[1].autodma = hwif->autodma; +} static ide_pci_device_t atiixp_pci_info[] __devinitdata = { { /* 0 */ @@ -338,13 +343,12 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = { .enablebits = {{0x48,0x01,0x00}, {0x48,0x08,0x00}}, .bootable = ON_BOARD, },{ /* 1 */ - .name = "SB600_PATA", - .init_hwif = init_hwif_atiixp, - .channels = 1, + .name = "ATI SB600 SATA Legacy IDE", + .init_hwif = init_hwif_sb600_legacy, + .channels = 2, .autodma = AUTODMA, - .enablebits = {{0x48,0x01,0x00}, {0x00,0x00,0x00}}, - .bootable = ON_BOARD, - }, + .bootable = ON_BOARD, + } }; /** @@ -365,7 +369,7 @@ static struct pci_device_id atiixp_pci_tbl[] = { { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP200_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, + { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { 0, }, }; MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); @@ -376,7 +380,7 @@ static struct pci_driver driver = { .probe = atiixp_init_one, }; -static int __init atiixp_ide_init(void) +static int atiixp_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/cmd64x.c b/trunk/drivers/ide/pci/cmd64x.c index aee947e8fc38..20c32716bbc4 100644 --- a/trunk/drivers/ide/pci/cmd64x.c +++ b/trunk/drivers/ide/pci/cmd64x.c @@ -793,7 +793,7 @@ static struct pci_driver driver = { .probe = cmd64x_init_one, }; -static int __init cmd64x_ide_init(void) +static int cmd64x_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/cs5520.c b/trunk/drivers/ide/pci/cs5520.c index ba6786aabf3b..079f7c86726b 100644 --- a/trunk/drivers/ide/pci/cs5520.c +++ b/trunk/drivers/ide/pci/cs5520.c @@ -260,7 +260,7 @@ static struct pci_driver driver = { .probe = cs5520_init_one, }; -static int __init cs5520_ide_init(void) +static int cs5520_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/cs5530.c b/trunk/drivers/ide/pci/cs5530.c index 9bf5fdfc5b1f..ae405fa32236 100644 --- a/trunk/drivers/ide/pci/cs5530.c +++ b/trunk/drivers/ide/pci/cs5530.c @@ -374,7 +374,7 @@ static struct pci_driver driver = { .probe = cs5530_init_one, }; -static int __init cs5530_ide_init(void) +static int cs5530_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/cy82c693.c b/trunk/drivers/ide/pci/cy82c693.c index 9eafcbf444f4..64330c459bd4 100644 --- a/trunk/drivers/ide/pci/cy82c693.c +++ b/trunk/drivers/ide/pci/cy82c693.c @@ -519,7 +519,7 @@ static struct pci_driver driver = { .probe = cy82c693_init_one, }; -static int __init cy82c693_ide_init(void) +static int cy82c693_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/generic.c b/trunk/drivers/ide/pci/generic.c index b408c6c517ea..9f306880491a 100644 --- a/trunk/drivers/ide/pci/generic.c +++ b/trunk/drivers/ide/pci/generic.c @@ -185,6 +185,36 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = { .channels = 2, .autodma = AUTODMA, .bootable = OFF_BOARD, + },{ /* 15 */ + .name = "JMB361", + .init_hwif = init_hwif_generic, + .channels = 2, + .autodma = AUTODMA, + .bootable = OFF_BOARD, + },{ /* 16 */ + .name = "JMB363", + .init_hwif = init_hwif_generic, + .channels = 2, + .autodma = AUTODMA, + .bootable = OFF_BOARD, + },{ /* 17 */ + .name = "JMB365", + .init_hwif = init_hwif_generic, + .channels = 2, + .autodma = AUTODMA, + .bootable = OFF_BOARD, + },{ /* 18 */ + .name = "JMB366", + .init_hwif = init_hwif_generic, + .channels = 2, + .autodma = AUTODMA, + .bootable = OFF_BOARD, + },{ /* 19 */ + .name = "JMB368", + .init_hwif = init_hwif_generic, + .channels = 2, + .autodma = AUTODMA, + .bootable = OFF_BOARD, } }; @@ -251,6 +281,11 @@ static struct pci_device_id generic_pci_tbl[] = { { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12}, { PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13}, { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14}, + { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15}, + { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16}, + { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17}, + { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18}, + { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19}, /* Must come last. If you add entries adjust this table appropriately and the init_one code */ { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0}, { 0, }, @@ -263,7 +298,7 @@ static struct pci_driver driver = { .probe = generic_init_one, }; -static int __init generic_ide_init(void) +static int generic_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/hpt34x.c b/trunk/drivers/ide/pci/hpt34x.c index ce7b08f08a09..b46cb042290a 100644 --- a/trunk/drivers/ide/pci/hpt34x.c +++ b/trunk/drivers/ide/pci/hpt34x.c @@ -265,7 +265,7 @@ static struct pci_driver driver = { .probe = hpt34x_init_one, }; -static int __init hpt34x_ide_init(void) +static int hpt34x_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/hpt366.c b/trunk/drivers/ide/pci/hpt366.c index b486442dd5d7..08119da06d54 100644 --- a/trunk/drivers/ide/pci/hpt366.c +++ b/trunk/drivers/ide/pci/hpt366.c @@ -1613,7 +1613,7 @@ static struct pci_driver driver = { .probe = hpt366_init_one, }; -static int __init hpt366_ide_init(void) +static int hpt366_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/jmicron.c b/trunk/drivers/ide/pci/jmicron.c index f07bbbed1778..c1cec236ecf0 100644 --- a/trunk/drivers/ide/pci/jmicron.c +++ b/trunk/drivers/ide/pci/jmicron.c @@ -86,16 +86,15 @@ static int __devinit ata66_jmicron(ide_hwif_t *hwif) { case PORT_PATA0: if (control & (1 << 3)) /* 40/80 pin primary */ - return 0; - return 1; + return 1; + return 0; case PORT_PATA1: if (control5 & (1 << 19)) /* 40/80 pin secondary */ return 0; return 1; case PORT_SATA: - break; + return 1; } - return 1; /* Avoid bogus "control reaches end of non-void function" */ } static void jmicron_tuneproc (ide_drive_t *drive, byte mode_wanted) @@ -241,11 +240,11 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devi } static struct pci_device_id jmicron_pci_tbl[] = { - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, - { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, + { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361), 0}, + { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363), 1}, + { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365), 2}, + { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366), 3}, + { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368), 4}, { 0, }, }; diff --git a/trunk/drivers/ide/pci/ns87415.c b/trunk/drivers/ide/pci/ns87415.c index 8aaea4ea5549..d95714bcee4e 100644 --- a/trunk/drivers/ide/pci/ns87415.c +++ b/trunk/drivers/ide/pci/ns87415.c @@ -302,7 +302,7 @@ static struct pci_driver driver = { .probe = ns87415_init_one, }; -static int __init ns87415_ide_init(void) +static int ns87415_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/opti621.c b/trunk/drivers/ide/pci/opti621.c index 22bbf613f948..7a7c2ef78ac2 100644 --- a/trunk/drivers/ide/pci/opti621.c +++ b/trunk/drivers/ide/pci/opti621.c @@ -382,7 +382,7 @@ static struct pci_driver driver = { .probe = opti621_init_one, }; -static int __init opti621_ide_init(void) +static int opti621_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/pdc202xx_new.c b/trunk/drivers/ide/pci/pdc202xx_new.c index 77a9aaa7dab9..7cb48576e479 100644 --- a/trunk/drivers/ide/pci/pdc202xx_new.c +++ b/trunk/drivers/ide/pci/pdc202xx_new.c @@ -756,7 +756,7 @@ static struct pci_driver driver = { .probe = pdc202new_init_one, }; -static int __init pdc202new_ide_init(void) +static int pdc202new_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/pdc202xx_old.c b/trunk/drivers/ide/pci/pdc202xx_old.c index 143239c093d5..184cdacddeb6 100644 --- a/trunk/drivers/ide/pci/pdc202xx_old.c +++ b/trunk/drivers/ide/pci/pdc202xx_old.c @@ -719,7 +719,7 @@ static struct pci_driver driver = { .probe = pdc202xx_init_one, }; -static int __init pdc202xx_ide_init(void) +static int pdc202xx_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/rz1000.c b/trunk/drivers/ide/pci/rz1000.c index c1855311052b..5f6950c2d1d1 100644 --- a/trunk/drivers/ide/pci/rz1000.c +++ b/trunk/drivers/ide/pci/rz1000.c @@ -77,7 +77,7 @@ static struct pci_driver driver = { .probe = rz1000_init_one, }; -static int __init rz1000_ide_init(void) +static int rz1000_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/sc1200.c b/trunk/drivers/ide/pci/sc1200.c index 8d762d323f8b..ff80937d94dd 100644 --- a/trunk/drivers/ide/pci/sc1200.c +++ b/trunk/drivers/ide/pci/sc1200.c @@ -507,7 +507,7 @@ static struct pci_driver driver = { #endif }; -static int __init sc1200_ide_init(void) +static int sc1200_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/serverworks.c b/trunk/drivers/ide/pci/serverworks.c index ea9a28a45853..057548d07205 100644 --- a/trunk/drivers/ide/pci/serverworks.c +++ b/trunk/drivers/ide/pci/serverworks.c @@ -666,7 +666,7 @@ static struct pci_driver driver = { .probe = svwks_init_one, }; -static int __init svwks_ide_init(void) +static int svwks_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/sgiioc4.c b/trunk/drivers/ide/pci/sgiioc4.c index b0bf01809279..cfad09accf52 100644 --- a/trunk/drivers/ide/pci/sgiioc4.c +++ b/trunk/drivers/ide/pci/sgiioc4.c @@ -762,7 +762,8 @@ static struct ioc4_submodule ioc4_ide_submodule = { /* .is_remove = ioc4_ide_remove_one, */ }; -static int __init ioc4_ide_init(void) +static int __devinit +ioc4_ide_init(void) { return ioc4_register_submodule(&ioc4_ide_submodule); } diff --git a/trunk/drivers/ide/pci/siimage.c b/trunk/drivers/ide/pci/siimage.c index 4ff89c7d990a..697f566fb90a 100644 --- a/trunk/drivers/ide/pci/siimage.c +++ b/trunk/drivers/ide/pci/siimage.c @@ -1096,7 +1096,7 @@ static struct pci_driver driver = { .probe = siimage_init_one, }; -static int __init siimage_ide_init(void) +static int siimage_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/sis5513.c b/trunk/drivers/ide/pci/sis5513.c index 1afff659ab55..6b313139b5e4 100644 --- a/trunk/drivers/ide/pci/sis5513.c +++ b/trunk/drivers/ide/pci/sis5513.c @@ -968,7 +968,7 @@ static struct pci_driver driver = { .probe = sis5513_init_one, }; -static int __init sis5513_ide_init(void) +static int sis5513_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/sl82c105.c b/trunk/drivers/ide/pci/sl82c105.c index 170a26199050..5afefe8692fe 100644 --- a/trunk/drivers/ide/pci/sl82c105.c +++ b/trunk/drivers/ide/pci/sl82c105.c @@ -492,7 +492,7 @@ static struct pci_driver driver = { .probe = sl82c105_init_one, }; -static int __init sl82c105_ide_init(void) +static int sl82c105_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/slc90e66.c b/trunk/drivers/ide/pci/slc90e66.c index 90e79c0844d2..9be7e49cba0e 100644 --- a/trunk/drivers/ide/pci/slc90e66.c +++ b/trunk/drivers/ide/pci/slc90e66.c @@ -253,7 +253,7 @@ static struct pci_driver driver = { .probe = slc90e66_init_one, }; -static int __init slc90e66_ide_init(void) +static int slc90e66_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/triflex.c b/trunk/drivers/ide/pci/triflex.c index b13cce1fd1a6..56d84931d6de 100644 --- a/trunk/drivers/ide/pci/triflex.c +++ b/trunk/drivers/ide/pci/triflex.c @@ -173,7 +173,7 @@ static struct pci_driver driver = { .probe = triflex_init_one, }; -static int __init triflex_ide_init(void) +static int triflex_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/trm290.c b/trunk/drivers/ide/pci/trm290.c index 174b88c4780e..2a282529bfc1 100644 --- a/trunk/drivers/ide/pci/trm290.c +++ b/trunk/drivers/ide/pci/trm290.c @@ -355,7 +355,7 @@ static struct pci_driver driver = { .probe = trm290_init_one, }; -static int __init trm290_ide_init(void) +static int trm290_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/ide/pci/via82cxxx.c b/trunk/drivers/ide/pci/via82cxxx.c index 6fb6e50b8231..381cc6f101ce 100644 --- a/trunk/drivers/ide/pci/via82cxxx.c +++ b/trunk/drivers/ide/pci/via82cxxx.c @@ -78,8 +78,6 @@ static struct via_isa_bridge { u8 rev_max; u16 flags; } via_isa_bridges[] = { - { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, - { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, @@ -506,7 +504,6 @@ static struct pci_device_id via_pci_tbl[] = { { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_6410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, - { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_SATA_EIDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, { 0, }, }; MODULE_DEVICE_TABLE(pci, via_pci_tbl); @@ -517,7 +514,7 @@ static struct pci_driver driver = { .probe = via_init_one, }; -static int __init via_ide_init(void) +static int via_ide_init(void) { return ide_pci_register_driver(&driver); } diff --git a/trunk/drivers/kvm/svm.c b/trunk/drivers/kvm/svm.c index c79df79307ed..9c70ff65e6b7 100644 --- a/trunk/drivers/kvm/svm.c +++ b/trunk/drivers/kvm/svm.c @@ -1163,7 +1163,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) case MSR_K6_STAR: vcpu->svm->vmcb->save.star = data; break; -#ifdef CONFIG_X86_64 +#ifdef CONFIG_X86_64_ case MSR_LSTAR: vcpu->svm->vmcb->save.lstar = data; break; diff --git a/trunk/drivers/kvm/vmx.c b/trunk/drivers/kvm/vmx.c index 54c35c0b3181..27f2751c3baa 100644 --- a/trunk/drivers/kvm/vmx.c +++ b/trunk/drivers/kvm/vmx.c @@ -1116,8 +1116,6 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu) if (rdmsr_safe(index, &data_low, &data_high) < 0) continue; - if (wrmsr_safe(index, data_low, data_high) < 0) - continue; data = data_low | ((u64)data_high << 32); vcpu->host_msrs[j].index = index; vcpu->host_msrs[j].reserved = 0; diff --git a/trunk/drivers/mtd/nand/cafe.c b/trunk/drivers/mtd/nand/cafe.c index 65f9bd3ceebf..b8d9b64cccc0 100644 --- a/trunk/drivers/mtd/nand/cafe.c +++ b/trunk/drivers/mtd/nand/cafe.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #define CAFE_NAND_CTRL1 0x00 diff --git a/trunk/drivers/net/82596.c b/trunk/drivers/net/82596.c index 640d7ca2ebcf..8236f26ffd46 100644 --- a/trunk/drivers/net/82596.c +++ b/trunk/drivers/net/82596.c @@ -1066,8 +1066,8 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev) short length = skb->len; dev->trans_start = jiffies; - DEB(DEB_STARTTX,printk(KERN_DEBUG "%s: i596_start_xmit(%x,%p) called\n", - dev->name, skb->len, skb->data)); + DEB(DEB_STARTTX,printk(KERN_DEBUG "%s: i596_start_xmit(%x,%x) called\n", dev->name, + skb->len, (unsigned int)skb->data)); if (skb->len < ETH_ZLEN) { if (skb_padto(skb, ETH_ZLEN)) @@ -1246,8 +1246,7 @@ struct net_device * __init i82596_probe(int unit) dev->priv = (void *)(dev->mem_start); lp = dev->priv; - DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%zd bytes), " - "lp->scb at 0x%08lx\n", + DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%d bytes), lp->scb at 0x%08lx\n", dev->name, (unsigned long)lp, sizeof(struct i596_private), (unsigned long)&lp->scb)); memset((void *) lp, 0, sizeof(struct i596_private)); diff --git a/trunk/drivers/net/b44.c b/trunk/drivers/net/b44.c index 303a8d94ad4b..5eb2ec68393f 100644 --- a/trunk/drivers/net/b44.c +++ b/trunk/drivers/net/b44.c @@ -110,11 +110,6 @@ MODULE_DEVICE_TABLE(pci, b44_pci_tbl); static void b44_halt(struct b44 *); static void b44_init_rings(struct b44 *); - -#define B44_FULL_RESET 1 -#define B44_FULL_RESET_SKIP_PHY 2 -#define B44_PARTIAL_RESET 3 - static void b44_init_hw(struct b44 *, int); static int dma_desc_align_mask; @@ -757,7 +752,7 @@ static void b44_recycle_rx(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) dest_idx * sizeof(dest_desc), DMA_BIDIRECTIONAL); - pci_dma_sync_single_for_device(bp->pdev, le32_to_cpu(src_desc->addr), + pci_dma_sync_single_for_device(bp->pdev, src_desc->addr, RX_PKT_BUF_SZ, PCI_DMA_FROMDEVICE); } @@ -889,7 +884,7 @@ static int b44_poll(struct net_device *netdev, int *budget) spin_lock_irqsave(&bp->lock, flags); b44_halt(bp); b44_init_rings(bp); - b44_init_hw(bp, B44_FULL_RESET_SKIP_PHY); + b44_init_hw(bp, 1); netif_wake_queue(bp->dev); spin_unlock_irqrestore(&bp->lock, flags); done = 1; @@ -959,7 +954,7 @@ static void b44_tx_timeout(struct net_device *dev) b44_halt(bp); b44_init_rings(bp); - b44_init_hw(bp, B44_FULL_RESET); + b44_init_hw(bp, 1); spin_unlock_irq(&bp->lock); @@ -1076,7 +1071,7 @@ static int b44_change_mtu(struct net_device *dev, int new_mtu) b44_halt(bp); dev->mtu = new_mtu; b44_init_rings(bp); - b44_init_hw(bp, B44_FULL_RESET); + b44_init_hw(bp, 1); spin_unlock_irq(&bp->lock); b44_enable_ints(bp); @@ -1373,12 +1368,12 @@ static int b44_set_mac_addr(struct net_device *dev, void *p) * packet processing. Invoked with bp->lock held. */ static void __b44_set_rx_mode(struct net_device *); -static void b44_init_hw(struct b44 *bp, int reset_kind) +static void b44_init_hw(struct b44 *bp, int full_reset) { u32 val; b44_chip_reset(bp); - if (reset_kind == B44_FULL_RESET) { + if (full_reset) { b44_phy_reset(bp); b44_setup_phy(bp); } @@ -1395,10 +1390,7 @@ static void b44_init_hw(struct b44 *bp, int reset_kind) bw32(bp, B44_TXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN); bw32(bp, B44_TX_WMARK, 56); /* XXX magic */ - if (reset_kind == B44_PARTIAL_RESET) { - bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE | - (bp->rx_offset << DMARX_CTRL_ROSHIFT))); - } else { + if (full_reset) { bw32(bp, B44_DMATX_CTRL, DMATX_CTRL_ENABLE); bw32(bp, B44_DMATX_ADDR, bp->tx_ring_dma + bp->dma_offset); bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE | @@ -1409,6 +1401,9 @@ static void b44_init_hw(struct b44 *bp, int reset_kind) bp->rx_prod = bp->rx_pending; bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ); + } else { + bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE | + (bp->rx_offset << DMARX_CTRL_ROSHIFT))); } val = br32(bp, B44_ENET_CTRL); @@ -1425,7 +1420,7 @@ static int b44_open(struct net_device *dev) goto out; b44_init_rings(bp); - b44_init_hw(bp, B44_FULL_RESET); + b44_init_hw(bp, 1); b44_check_phy(bp); @@ -1634,7 +1629,7 @@ static int b44_close(struct net_device *dev) netif_poll_enable(dev); if (bp->flags & B44_FLAG_WOL_ENABLE) { - b44_init_hw(bp, B44_PARTIAL_RESET); + b44_init_hw(bp, 0); b44_setup_wol(bp); } @@ -1910,7 +1905,7 @@ static int b44_set_ringparam(struct net_device *dev, b44_halt(bp); b44_init_rings(bp); - b44_init_hw(bp, B44_FULL_RESET); + b44_init_hw(bp, 1); netif_wake_queue(bp->dev); spin_unlock_irq(&bp->lock); @@ -1953,7 +1948,7 @@ static int b44_set_pauseparam(struct net_device *dev, if (bp->flags & B44_FLAG_PAUSE_AUTO) { b44_halt(bp); b44_init_rings(bp); - b44_init_hw(bp, B44_FULL_RESET); + b44_init_hw(bp, 1); } else { __b44_set_flow_ctrl(bp, bp->flags); } @@ -2309,7 +2304,7 @@ static int b44_suspend(struct pci_dev *pdev, pm_message_t state) free_irq(dev->irq, dev); if (bp->flags & B44_FLAG_WOL_ENABLE) { - b44_init_hw(bp, B44_PARTIAL_RESET); + b44_init_hw(bp, 0); b44_setup_wol(bp); } pci_disable_device(pdev); @@ -2320,32 +2315,21 @@ static int b44_resume(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); struct b44 *bp = netdev_priv(dev); - int rc = 0; pci_restore_state(pdev); - rc = pci_enable_device(pdev); - if (rc) { - printk(KERN_ERR PFX "%s: pci_enable_device failed\n", - dev->name); - return rc; - } - + pci_enable_device(pdev); pci_set_master(pdev); if (!netif_running(dev)) return 0; - rc = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev); - if (rc) { + if (request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev)) printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name); - pci_disable_device(pdev); - return rc; - } spin_lock_irq(&bp->lock); b44_init_rings(bp); - b44_init_hw(bp, B44_FULL_RESET); + b44_init_hw(bp, 1); netif_device_attach(bp->dev); spin_unlock_irq(&bp->lock); diff --git a/trunk/drivers/net/bnx2.c b/trunk/drivers/net/bnx2.c index ee7b75b976b5..953808efe551 100644 --- a/trunk/drivers/net/bnx2.c +++ b/trunk/drivers/net/bnx2.c @@ -57,8 +57,8 @@ #define DRV_MODULE_NAME "bnx2" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "1.5.5" -#define DRV_MODULE_RELDATE "February 1, 2007" +#define DRV_MODULE_VERSION "1.5.4" +#define DRV_MODULE_RELDATE "January 24, 2007" #define RUN_AT(x) (jiffies + (x)) @@ -1356,14 +1356,6 @@ bnx2_init_copper_phy(struct bnx2 *bp) bnx2_write_phy(bp, 0x18, 0x0400); } - if (bp->phy_flags & PHY_DIS_EARLY_DAC_FLAG) { - bnx2_write_phy(bp, MII_BNX2_DSP_ADDRESS, - MII_BNX2_DSP_EXPAND_REG | 0x8); - bnx2_read_phy(bp, MII_BNX2_DSP_RW_PORT, &val); - val &= ~(1 << 8); - bnx2_write_phy(bp, MII_BNX2_DSP_RW_PORT, val); - } - if (bp->dev->mtu > 1500) { /* Set extended packet length bit */ bnx2_write_phy(bp, 0x18, 0x7); @@ -5926,8 +5918,6 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) } else if (CHIP_NUM(bp) == CHIP_NUM_5706 || CHIP_NUM(bp) == CHIP_NUM_5708) bp->phy_flags |= PHY_CRC_FIX_FLAG; - else if (CHIP_ID(bp) == CHIP_ID_5709_A0) - bp->phy_flags |= PHY_DIS_EARLY_DAC_FLAG; if ((CHIP_ID(bp) == CHIP_ID_5708_A0) || (CHIP_ID(bp) == CHIP_ID_5708_B0) || diff --git a/trunk/drivers/net/bnx2.h b/trunk/drivers/net/bnx2.h index ccbdf81c6599..13b6f9b11e01 100644 --- a/trunk/drivers/net/bnx2.h +++ b/trunk/drivers/net/bnx2.h @@ -6288,10 +6288,6 @@ struct l2_fhdr { #define BCM5708S_TX_ACTL3 0x17 -#define MII_BNX2_DSP_RW_PORT 0x15 -#define MII_BNX2_DSP_ADDRESS 0x17 -#define MII_BNX2_DSP_EXPAND_REG 0x0f00 - #define MIN_ETHERNET_PACKET_SIZE 60 #define MAX_ETHERNET_PACKET_SIZE 1514 #define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014 @@ -6493,7 +6489,6 @@ struct bnx2 { #define PHY_INT_MODE_MASK_FLAG 0x300 #define PHY_INT_MODE_AUTO_POLLING_FLAG 0x100 #define PHY_INT_MODE_LINK_READY_FLAG 0x200 -#define PHY_DIS_EARLY_DAC_FLAG 0x400 u32 chip_id; /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */ @@ -6517,7 +6512,6 @@ struct bnx2 { #define CHIP_ID_5708_A0 0x57080000 #define CHIP_ID_5708_B0 0x57081000 #define CHIP_ID_5708_B1 0x57081010 -#define CHIP_ID_5709_A0 0x57090000 #define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf) diff --git a/trunk/drivers/net/bonding/bonding.h b/trunk/drivers/net/bonding/bonding.h index 0978c9ac6d2b..dc434fb6da85 100644 --- a/trunk/drivers/net/bonding/bonding.h +++ b/trunk/drivers/net/bonding/bonding.h @@ -151,8 +151,8 @@ struct slave { struct slave *next; struct slave *prev; int delay; - unsigned long jiffies; - unsigned long last_arp_rx; + u32 jiffies; + u32 last_arp_rx; s8 link; /* one of BOND_LINK_XXXX */ s8 state; /* one of BOND_STATE_XXXX */ u32 original_flags; @@ -242,8 +242,7 @@ extern inline int slave_do_arp_validate(struct bonding *bond, struct slave *slav return bond->params.arp_validate & (1 << slave->state); } -extern inline unsigned long slave_last_rx(struct bonding *bond, - struct slave *slave) +extern inline u32 slave_last_rx(struct bonding *bond, struct slave *slave) { if (slave_do_arp_validate(bond, slave)) return slave->last_arp_rx; diff --git a/trunk/drivers/net/e100.c b/trunk/drivers/net/e100.c index 0cefef5e3f06..c2ae2a24629b 100644 --- a/trunk/drivers/net/e100.c +++ b/trunk/drivers/net/e100.c @@ -2718,11 +2718,12 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) struct net_device *netdev = pci_get_drvdata(pdev); struct nic *nic = netdev_priv(netdev); +#ifdef CONFIG_E100_NAPI if (netif_running(netdev)) netif_poll_disable(nic->netdev); +#endif del_timer_sync(&nic->watchdog); netif_carrier_off(nic->netdev); - netif_device_detach(netdev); pci_save_state(pdev); @@ -2735,7 +2736,6 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state) } pci_disable_device(pdev); - free_irq(pdev->irq, netdev); pci_set_power_state(pdev, PCI_D3hot); return 0; @@ -2759,13 +2759,16 @@ static int e100_resume(struct pci_dev *pdev) } #endif /* CONFIG_PM */ + static void e100_shutdown(struct pci_dev *pdev) { struct net_device *netdev = pci_get_drvdata(pdev); struct nic *nic = netdev_priv(netdev); +#ifdef CONFIG_E100_NAPI if (netif_running(netdev)) netif_poll_disable(nic->netdev); +#endif del_timer_sync(&nic->watchdog); netif_carrier_off(nic->netdev); diff --git a/trunk/drivers/net/ehea/ehea.h b/trunk/drivers/net/ehea/ehea.h index 272e1ec51aa2..be10a3a26b5b 100644 --- a/trunk/drivers/net/ehea/ehea.h +++ b/trunk/drivers/net/ehea/ehea.h @@ -39,7 +39,7 @@ #include #define DRV_NAME "ehea" -#define DRV_VERSION "EHEA_0045" +#define DRV_VERSION "EHEA_0044" #define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) diff --git a/trunk/drivers/net/ehea/ehea_main.c b/trunk/drivers/net/ehea/ehea_main.c index 9de2d38a5321..1072e69ef85d 100644 --- a/trunk/drivers/net/ehea/ehea_main.c +++ b/trunk/drivers/net/ehea/ehea_main.c @@ -2316,7 +2316,6 @@ static int ehea_setup_single_port(struct ehea_port *port, struct ehea_adapter *adapter = port->adapter; struct hcp_ehea_port_cb4 *cb4; u32 *dn_log_port_id; - int jumbo = 0; sema_init(&port->port_lock, 1); port->state = EHEA_PORT_DOWN; @@ -2358,25 +2357,13 @@ static int ehea_setup_single_port(struct ehea_port *port, if (!cb4) { ehea_error("no mem for cb4"); } else { - hret = ehea_h_query_ehea_port(adapter->handle, - port->logical_port_id, - H_PORT_CB4, - H_PORT_CB4_JUMBO, cb4); - - if (hret == H_SUCCESS) { - if (cb4->jumbo_frame) - jumbo = 1; - else { - cb4->jumbo_frame = 1; - hret = ehea_h_modify_ehea_port(adapter->handle, - port-> - logical_port_id, - H_PORT_CB4, - H_PORT_CB4_JUMBO, - cb4); - if (hret == H_SUCCESS) - jumbo = 1; - } + cb4->jumbo_frame = 1; + hret = ehea_h_modify_ehea_port(adapter->handle, + port->logical_port_id, + H_PORT_CB4, H_PORT_CB4_JUMBO, + cb4); + if (hret != H_SUCCESS) { + ehea_info("Jumbo frames not activated"); } kfree(cb4); } @@ -2415,9 +2402,6 @@ static int ehea_setup_single_port(struct ehea_port *port, goto out_free; } - ehea_info("%s: Jumbo frames are %sabled", dev->name, - jumbo == 1 ? "en" : "dis"); - port->netdev = dev; ret = 0; goto out; @@ -2598,7 +2582,6 @@ static int __devexit ehea_remove(struct ibmebus_dev *dev) destroy_workqueue(adapter->ehea_wq); ibmebus_free_irq(NULL, adapter->neq->attr.ist1, adapter); - tasklet_kill(&adapter->neq_tasklet); ehea_destroy_eq(adapter->neq); diff --git a/trunk/drivers/net/fs_enet/mac-fec.c b/trunk/drivers/net/fs_enet/mac-fec.c index ff6839477306..c2c5fd419bd0 100644 --- a/trunk/drivers/net/fs_enet/mac-fec.c +++ b/trunk/drivers/net/fs_enet/mac-fec.c @@ -104,9 +104,9 @@ static int do_pd_setup(struct fs_enet_private *fep) fep->interrupt = platform_get_irq_byname(pdev,"interrupt"); if (fep->interrupt < 0) return -EINVAL; - + r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); - fep->fec.fecp = ioremap(r->start, r->end - r->start + 1); + fep->fec.fecp =(void*)r->start; if(fep->fec.fecp == NULL) return -EINVAL; @@ -319,14 +319,11 @@ static void restart(struct net_device *dev) * Clear any outstanding interrupt. */ FW(fecp, ievent, 0xffc0); -#ifndef CONFIG_PPC_MERGE FW(fecp, ivec, (fep->interrupt / 2) << 29); -#else - FW(fecp, ivec, (virq_to_hw(fep->interrupt) / 2) << 29); -#endif + /* - * adjust to speed (only for DUET & RMII) + * adjust to speed (only for DUET & RMII) */ #ifdef CONFIG_DUET if (fpi->use_rmii) { @@ -421,7 +418,6 @@ static void stop(struct net_device *dev) static void pre_request_irq(struct net_device *dev, int irq) { -#ifndef CONFIG_PPC_MERGE immap_t *immap = fs_enet_immap; u32 siel; @@ -435,7 +431,6 @@ static void pre_request_irq(struct net_device *dev, int irq) siel &= ~(0x80000000 >> (irq & ~1)); out_be32(&immap->im_siu_conf.sc_siel, siel); } -#endif } static void post_free_irq(struct net_device *dev, int irq) diff --git a/trunk/drivers/net/fs_enet/mac-scc.c b/trunk/drivers/net/fs_enet/mac-scc.c index afd7fca7c6c4..95ec5872c507 100644 --- a/trunk/drivers/net/fs_enet/mac-scc.c +++ b/trunk/drivers/net/fs_enet/mac-scc.c @@ -121,13 +121,13 @@ static int do_pd_setup(struct fs_enet_private *fep) return -EINVAL; r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); - fep->scc.sccp = ioremap(r->start, r->end - r->start + 1); + fep->scc.sccp = (void *)r->start; if (fep->scc.sccp == NULL) return -EINVAL; r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram"); - fep->scc.ep = ioremap(r->start, r->end - r->start + 1); + fep->scc.ep = (void *)r->start; if (fep->scc.ep == NULL) return -EINVAL; @@ -397,7 +397,6 @@ static void stop(struct net_device *dev) static void pre_request_irq(struct net_device *dev, int irq) { -#ifndef CONFIG_PPC_MERGE immap_t *immap = fs_enet_immap; u32 siel; @@ -411,7 +410,6 @@ static void pre_request_irq(struct net_device *dev, int irq) siel &= ~(0x80000000 >> (irq & ~1)); out_be32(&immap->im_siu_conf.sc_siel, siel); } -#endif } static void post_free_irq(struct net_device *dev, int irq) diff --git a/trunk/drivers/net/hamradio/Kconfig b/trunk/drivers/net/hamradio/Kconfig index feb0ada7a025..896aa02000d7 100644 --- a/trunk/drivers/net/hamradio/Kconfig +++ b/trunk/drivers/net/hamradio/Kconfig @@ -113,7 +113,7 @@ config SCC_TRXECHO config BAYCOM_SER_FDX tristate "BAYCOM ser12 fullduplex driver for AX.25" - depends on AX25 && !S390 + depends on AX25 select CRC_CCITT ---help--- This is one of two drivers for Baycom style simple amateur radio @@ -133,7 +133,7 @@ config BAYCOM_SER_FDX config BAYCOM_SER_HDX tristate "BAYCOM ser12 halfduplex driver for AX.25" - depends on AX25 && !S390 + depends on AX25 select CRC_CCITT ---help--- This is one of two drivers for Baycom style simple amateur radio @@ -181,7 +181,7 @@ config BAYCOM_EPP config YAM tristate "YAM driver for AX.25" - depends on AX25 && !S390 + depends on AX25 help The YAM is a modem for packet radio which connects to the serial port and includes some of the functions of a Terminal Node diff --git a/trunk/drivers/net/netxen/netxen_nic.h b/trunk/drivers/net/netxen/netxen_nic.h index e8598b809228..59324b1693d6 100644 --- a/trunk/drivers/net/netxen/netxen_nic.h +++ b/trunk/drivers/net/netxen/netxen_nic.h @@ -239,39 +239,49 @@ extern unsigned long long netxen_dma_mask; typedef u32 netxen_ctx_msg; +#define _netxen_set_bits(config_word, start, bits, val) {\ + unsigned long long mask = (((1ULL << (bits)) - 1) << (start)); \ + unsigned long long value = (val); \ + (config_word) &= ~mask; \ + (config_word) |= (((value) << (start)) & mask); \ +} + #define netxen_set_msg_peg_id(config_word, val) \ - ((config_word) &= ~3, (config_word) |= val & 3) + _netxen_set_bits(config_word, 0, 2, val) #define netxen_set_msg_privid(config_word) \ - ((config_word) |= 1 << 2) + set_bit(2, (unsigned long*)&config_word) #define netxen_set_msg_count(config_word, val) \ - ((config_word) &= ~(0x7fff<<3), (config_word) |= (val & 0x7fff) << 3) + _netxen_set_bits(config_word, 3, 15, val) #define netxen_set_msg_ctxid(config_word, val) \ - ((config_word) &= ~(0x3ff<<18), (config_word) |= (val & 0x3ff) << 18) + _netxen_set_bits(config_word, 18, 10, val) #define netxen_set_msg_opcode(config_word, val) \ - ((config_word) &= ~(0xf<<24), (config_word) |= (val & 0xf) << 24) + _netxen_set_bits(config_word, 28, 4, val) struct netxen_rcv_context { - __le64 rcv_ring_addr; - __le32 rcv_ring_size; - __le32 rsrvd; + u32 rcv_ring_addr_lo; + u32 rcv_ring_addr_hi; + u32 rcv_ring_size; + u32 rsrvd; }; struct netxen_ring_ctx { /* one command ring */ - __le64 cmd_consumer_offset; - __le64 cmd_ring_addr; - __le32 cmd_ring_size; - __le32 rsrvd; + u64 cmd_consumer_offset; + u32 cmd_ring_addr_lo; + u32 cmd_ring_addr_hi; + u32 cmd_ring_size; + u32 rsrvd; /* three receive rings */ struct netxen_rcv_context rcv_ctx[3]; /* one status ring */ - __le64 sts_ring_addr; - __le32 sts_ring_size; + u32 sts_ring_addr_lo; + u32 sts_ring_addr_hi; + u32 sts_ring_size; - __le32 ctx_id; + u32 ctx_id; } __attribute__ ((aligned(64))); /* @@ -295,85 +305,81 @@ struct netxen_ring_ctx { ((cmd_desc)->port_ctxid |= ((var) & 0x0F)) #define netxen_set_cmd_desc_flags(cmd_desc, val) \ - ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x7f), \ - (cmd_desc)->flags_opcode |= cpu_to_le16((val) & 0x7f)) + _netxen_set_bits((cmd_desc)->flags_opcode, 0, 7, val) #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ - ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x3f<<7), \ - (cmd_desc)->flags_opcode |= cpu_to_le16((val) & (0x3f<<7))) + _netxen_set_bits((cmd_desc)->flags_opcode, 7, 6, val) #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ - ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \ - (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff)) + _netxen_set_bits((cmd_desc)->num_of_buffers_total_length, 0, 8, val); #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ - ((cmd_desc)->num_of_buffers_total_length &= cpu_to_le32(0xff), \ - (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 24)) + _netxen_set_bits((cmd_desc)->num_of_buffers_total_length, 8, 24, val); #define netxen_get_cmd_desc_opcode(cmd_desc) \ - ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F) + (((cmd_desc)->flags_opcode >> 7) & 0x003F) #define netxen_get_cmd_desc_totallength(cmd_desc) \ - (le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) + (((cmd_desc)->num_of_buffers_total_length >> 8) & 0x0FFFFFF) struct cmd_desc_type0 { u8 tcp_hdr_offset; /* For LSO only */ u8 ip_hdr_offset; /* For LSO only */ /* Bit pattern: 0-6 flags, 7-12 opcode, 13-15 unused */ - __le16 flags_opcode; + u16 flags_opcode; /* Bit pattern: 0-7 total number of segments, 8-31 Total size of the packet */ - __le32 num_of_buffers_total_length; + u32 num_of_buffers_total_length; union { struct { - __le32 addr_low_part2; - __le32 addr_high_part2; + u32 addr_low_part2; + u32 addr_high_part2; }; - __le64 addr_buffer2; + u64 addr_buffer2; }; - __le16 reference_handle; /* changed to u16 to add mss */ - __le16 mss; /* passed by NDIS_PACKET for LSO */ + u16 reference_handle; /* changed to u16 to add mss */ + u16 mss; /* passed by NDIS_PACKET for LSO */ /* Bit pattern 0-3 port, 0-3 ctx id */ u8 port_ctxid; u8 total_hdr_length; /* LSO only : MAC+IP+TCP Hdr size */ - __le16 conn_id; /* IPSec offoad only */ + u16 conn_id; /* IPSec offoad only */ union { struct { - __le32 addr_low_part3; - __le32 addr_high_part3; + u32 addr_low_part3; + u32 addr_high_part3; }; - __le64 addr_buffer3; + u64 addr_buffer3; }; union { struct { - __le32 addr_low_part1; - __le32 addr_high_part1; + u32 addr_low_part1; + u32 addr_high_part1; }; - __le64 addr_buffer1; + u64 addr_buffer1; }; - __le16 buffer1_length; - __le16 buffer2_length; - __le16 buffer3_length; - __le16 buffer4_length; + u16 buffer1_length; + u16 buffer2_length; + u16 buffer3_length; + u16 buffer4_length; union { struct { - __le32 addr_low_part4; - __le32 addr_high_part4; + u32 addr_low_part4; + u32 addr_high_part4; }; - __le64 addr_buffer4; + u64 addr_buffer4; }; - __le64 unused; + u64 unused; } __attribute__ ((aligned(64))); /* Note: sizeof(rcv_desc) should always be a mutliple of 2 */ struct rcv_desc { - __le16 reference_handle; - __le16 reserved; - __le32 buffer_length; /* allocated buffer length (usually 2K) */ - __le64 addr_buffer; + u16 reference_handle; + u16 reserved; + u32 buffer_length; /* allocated buffer length (usually 2K) */ + u64 addr_buffer; }; /* opcode field in status_desc */ @@ -399,36 +405,36 @@ struct rcv_desc { (((status_desc)->lro & 0x80) >> 7) #define netxen_get_sts_port(status_desc) \ - (le64_to_cpu((status_desc)->status_desc_data) & 0x0F) + ((status_desc)->status_desc_data & 0x0F) #define netxen_get_sts_status(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 4) & 0x0F) + (((status_desc)->status_desc_data >> 4) & 0x0F) #define netxen_get_sts_type(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 8) & 0x0F) + (((status_desc)->status_desc_data >> 8) & 0x0F) #define netxen_get_sts_totallength(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 12) & 0xFFFF) + (((status_desc)->status_desc_data >> 12) & 0xFFFF) #define netxen_get_sts_refhandle(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 28) & 0xFFFF) + (((status_desc)->status_desc_data >> 28) & 0xFFFF) #define netxen_get_sts_prot(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 44) & 0x0F) + (((status_desc)->status_desc_data >> 44) & 0x0F) #define netxen_get_sts_owner(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 56) & 0x03) + (((status_desc)->status_desc_data >> 56) & 0x03) #define netxen_get_sts_opcode(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 58) & 0x03F) + (((status_desc)->status_desc_data >> 58) & 0x03F) #define netxen_clear_sts_owner(status_desc) \ ((status_desc)->status_desc_data &= \ - ~cpu_to_le64(((unsigned long long)3) << 56 )) + ~(((unsigned long long)3) << 56 )) #define netxen_set_sts_owner(status_desc, val) \ ((status_desc)->status_desc_data |= \ - cpu_to_le64(((unsigned long long)((val) & 0x3)) << 56 )) + (((unsigned long long)((val) & 0x3)) << 56 )) struct status_desc { /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length 28-43 reference_handle, 44-47 protocol, 48-52 unused 53-55 desc_cnt, 56-57 owner, 58-63 opcode */ - __le64 status_desc_data; - __le32 hash_value; + u64 status_desc_data; + u32 hash_value; u8 hash_type; u8 msg_type; u8 unused; @@ -999,9 +1005,9 @@ void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, int port, void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, int port, long enable); int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, long reg, - __u32 * readval); + __le32 * readval); int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long phy, - long reg, __u32 val); + long reg, __le32 val); /* Functions available from netxen_nic_hw.c */ int netxen_nic_set_mtu_xgb(struct netxen_port *port, int new_mtu); diff --git a/trunk/drivers/net/netxen/netxen_nic_ethtool.c b/trunk/drivers/net/netxen/netxen_nic_ethtool.c index c381d77a7336..34044616b3c8 100644 --- a/trunk/drivers/net/netxen/netxen_nic_ethtool.c +++ b/trunk/drivers/net/netxen/netxen_nic_ethtool.c @@ -218,7 +218,7 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) { struct netxen_port *port = netdev_priv(dev); struct netxen_adapter *adapter = port->adapter; - __u32 status; + __le32 status; /* read which mode */ if (adapter->ahw.board_type == NETXEN_NIC_GBE) { @@ -226,7 +226,7 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) if (adapter->phy_write && adapter->phy_write(adapter, port->portnum, NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, - ecmd->autoneg) != 0) + (__le32) ecmd->autoneg) != 0) return -EIO; else port->link_autoneg = ecmd->autoneg; @@ -279,7 +279,7 @@ static int netxen_nic_get_regs_len(struct net_device *dev) } struct netxen_niu_regs { - __u32 reg[NETXEN_NIC_REGS_COUNT]; + __le32 reg[NETXEN_NIC_REGS_COUNT]; }; static struct netxen_niu_regs niu_registers[] = { @@ -372,7 +372,7 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p) { struct netxen_port *port = netdev_priv(dev); struct netxen_adapter *adapter = port->adapter; - __u32 mode, *regs_buff = p; + __le32 mode, *regs_buff = p; void __iomem *addr; int i, window; @@ -415,7 +415,7 @@ static u32 netxen_nic_get_link(struct net_device *dev) { struct netxen_port *port = netdev_priv(dev); struct netxen_adapter *adapter = port->adapter; - __u32 status; + __le32 status; /* read which mode */ if (adapter->ahw.board_type == NETXEN_NIC_GBE) { @@ -482,13 +482,13 @@ netxen_nic_get_pauseparam(struct net_device *dev, { struct netxen_port *port = netdev_priv(dev); struct netxen_adapter *adapter = port->adapter; - __u32 val; + __le32 val; if (adapter->ahw.board_type == NETXEN_NIC_GBE) { /* get flow control settings */ netxen_nic_read_w0(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), - &val); + (u32 *) & val); pause->rx_pause = netxen_gb_get_rx_flowctl(val); pause->tx_pause = netxen_gb_get_tx_flowctl(val); /* get autoneg settings */ @@ -502,7 +502,7 @@ netxen_nic_set_pauseparam(struct net_device *dev, { struct netxen_port *port = netdev_priv(dev); struct netxen_adapter *adapter = port->adapter; - __u32 val; + __le32 val; unsigned int autoneg; /* read mode */ @@ -522,13 +522,13 @@ netxen_nic_set_pauseparam(struct net_device *dev, netxen_nic_write_w0(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), - *&val); + *(u32 *) (&val)); /* set autoneg */ autoneg = pause->autoneg; if (adapter->phy_write && adapter->phy_write(adapter, port->portnum, NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, - autoneg) != 0) + (__le32) autoneg) != 0) return -EIO; else { port->link_autoneg = pause->autoneg; @@ -543,7 +543,7 @@ static int netxen_nic_reg_test(struct net_device *dev) struct netxen_port *port = netdev_priv(dev); struct netxen_adapter *adapter = port->adapter; u32 data_read, data_written, save; - __u32 mode; + __le32 mode; /* * first test the "Read Only" registers by writing which mode diff --git a/trunk/drivers/net/netxen/netxen_nic_hw.c b/trunk/drivers/net/netxen/netxen_nic_hw.c index f263232f499f..191e2336e323 100644 --- a/trunk/drivers/net/netxen/netxen_nic_hw.c +++ b/trunk/drivers/net/netxen/netxen_nic_hw.c @@ -95,7 +95,7 @@ void netxen_nic_set_multi(struct net_device *netdev) struct netxen_port *port = netdev_priv(netdev); struct netxen_adapter *adapter = port->adapter; struct dev_mc_list *mc_ptr; - __u32 netxen_mac_addr_cntl_data = 0; + __le32 netxen_mac_addr_cntl_data = 0; mc_ptr = netdev->mc_list; if (netdev->flags & IFF_PROMISC) { @@ -236,9 +236,8 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) } memset(addr, 0, sizeof(struct netxen_ring_ctx)); adapter->ctx_desc = (struct netxen_ring_ctx *)addr; - adapter->ctx_desc->cmd_consumer_offset = - cpu_to_le64(adapter->ctx_desc_phys_addr + - sizeof(struct netxen_ring_ctx)); + adapter->ctx_desc->cmd_consumer_offset = adapter->ctx_desc_phys_addr + + sizeof(struct netxen_ring_ctx); adapter->cmd_consumer = (uint32_t *) (((char *)addr) + sizeof(struct netxen_ring_ctx)); @@ -254,10 +253,11 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) return -ENOMEM; } - adapter->ctx_desc->cmd_ring_addr = - cpu_to_le64(hw->cmd_desc_phys_addr); - adapter->ctx_desc->cmd_ring_size = - cpu_to_le32(adapter->max_tx_desc_count); + adapter->ctx_desc->cmd_ring_addr_lo = + hw->cmd_desc_phys_addr & 0xffffffffUL; + adapter->ctx_desc->cmd_ring_addr_hi = + ((u64) hw->cmd_desc_phys_addr >> 32); + adapter->ctx_desc->cmd_ring_size = adapter->max_tx_desc_count; hw->cmd_desc_head = (struct cmd_desc_type0 *)addr; @@ -278,10 +278,12 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) return err; } rcv_desc->desc_head = (struct rcv_desc *)addr; - adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr = - cpu_to_le64(rcv_desc->phys_addr); + adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_lo = + rcv_desc->phys_addr & 0xffffffffUL; + adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_hi = + ((u64) rcv_desc->phys_addr >> 32); adapter->ctx_desc->rcv_ctx[ring].rcv_ring_size = - cpu_to_le32(rcv_desc->max_rx_desc_count); + rcv_desc->max_rx_desc_count; } addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE, @@ -295,10 +297,11 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) return err; } recv_ctx->rcv_status_desc_head = (struct status_desc *)addr; - adapter->ctx_desc->sts_ring_addr = - cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr); - adapter->ctx_desc->sts_ring_size = - cpu_to_le32(adapter->max_rx_desc_count); + adapter->ctx_desc->sts_ring_addr_lo = + recv_ctx->rcv_status_desc_phys_addr & 0xffffffffUL; + adapter->ctx_desc->sts_ring_addr_hi = + ((u64) recv_ctx->rcv_status_desc_phys_addr >> 32); + adapter->ctx_desc->sts_ring_size = adapter->max_rx_desc_count; } /* Window = 1 */ @@ -384,6 +387,10 @@ void netxen_tso_check(struct netxen_adapter *adapter, } adapter->stats.xmitcsummed++; desc->tcp_hdr_offset = skb->h.raw - skb->data; + netxen_set_cmd_desc_totallength(desc, + cpu_to_le32 + (netxen_get_cmd_desc_totallength + (desc))); desc->ip_hdr_offset = skb->nh.raw - skb->data; } @@ -860,9 +867,9 @@ netxen_crb_writelit_adapter(struct netxen_adapter *adapter, unsigned long off, void netxen_nic_set_link_parameters(struct netxen_port *port) { struct netxen_adapter *adapter = port->adapter; - __u32 status; - __u32 autoneg; - __u32 mode; + __le32 status; + __le32 autoneg; + __le32 mode; netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ diff --git a/trunk/drivers/net/netxen/netxen_nic_hw.h b/trunk/drivers/net/netxen/netxen_nic_hw.h index ab1112eb1b0d..0685633a9c1e 100644 --- a/trunk/drivers/net/netxen/netxen_nic_hw.h +++ b/trunk/drivers/net/netxen/netxen_nic_hw.h @@ -124,28 +124,28 @@ typedef enum { */ #define netxen_gb_enable_tx(config_word) \ - ((config_word) |= 1 << 0) + set_bit(0, (unsigned long*)(&config_word)) #define netxen_gb_enable_rx(config_word) \ - ((config_word) |= 1 << 2) + set_bit(2, (unsigned long*)(&config_word)) #define netxen_gb_tx_flowctl(config_word) \ - ((config_word) |= 1 << 4) + set_bit(4, (unsigned long*)(&config_word)) #define netxen_gb_rx_flowctl(config_word) \ - ((config_word) |= 1 << 5) + set_bit(5, (unsigned long*)(&config_word)) #define netxen_gb_tx_reset_pb(config_word) \ - ((config_word) |= 1 << 16) + set_bit(16, (unsigned long*)(&config_word)) #define netxen_gb_rx_reset_pb(config_word) \ - ((config_word) |= 1 << 17) + set_bit(17, (unsigned long*)(&config_word)) #define netxen_gb_tx_reset_mac(config_word) \ - ((config_word) |= 1 << 18) + set_bit(18, (unsigned long*)(&config_word)) #define netxen_gb_rx_reset_mac(config_word) \ - ((config_word) |= 1 << 19) + set_bit(19, (unsigned long*)(&config_word)) #define netxen_gb_soft_reset(config_word) \ - ((config_word) |= 1 << 31) + set_bit(31, (unsigned long*)(&config_word)) #define netxen_gb_unset_tx_flowctl(config_word) \ - ((config_word) &= ~(1 << 4)) + clear_bit(4, (unsigned long *)(&config_word)) #define netxen_gb_unset_rx_flowctl(config_word) \ - ((config_word) &= ~(1 << 5)) + clear_bit(5, (unsigned long*)(&config_word)) #define netxen_gb_get_tx_synced(config_word) \ _netxen_crb_get_bit((config_word), 1) @@ -171,15 +171,15 @@ typedef enum { */ #define netxen_gb_set_duplex(config_word) \ - ((config_word) |= 1 << 0) + set_bit(0, (unsigned long*)&config_word) #define netxen_gb_set_crc_enable(config_word) \ - ((config_word) |= 1 << 1) + set_bit(1, (unsigned long*)&config_word) #define netxen_gb_set_padshort(config_word) \ - ((config_word) |= 1 << 2) + set_bit(2, (unsigned long*)&config_word) #define netxen_gb_set_checklength(config_word) \ - ((config_word) |= 1 << 4) + set_bit(4, (unsigned long*)&config_word) #define netxen_gb_set_hugeframes(config_word) \ - ((config_word) |= 1 << 5) + set_bit(5, (unsigned long*)&config_word) #define netxen_gb_set_preamblelen(config_word, val) \ ((config_word) |= ((val) << 12) & 0xF000) #define netxen_gb_set_intfmode(config_word, val) \ @@ -190,9 +190,9 @@ typedef enum { #define netxen_gb_set_mii_mgmt_clockselect(config_word, val) \ ((config_word) |= ((val) & 0x07)) #define netxen_gb_mii_mgmt_reset(config_word) \ - ((config_word) |= 1 << 31) + set_bit(31, (unsigned long*)&config_word) #define netxen_gb_mii_mgmt_unset(config_word) \ - ((config_word) &= ~(1 << 31)) + clear_bit(31, (unsigned long*)&config_word) /* * NIU GB MII Mgmt Command Register (applies to GB0, GB1, GB2, GB3) @@ -201,7 +201,7 @@ typedef enum { */ #define netxen_gb_mii_mgmt_set_read_cycle(config_word) \ - ((config_word) |= 1 << 0) + set_bit(0, (unsigned long*)&config_word) #define netxen_gb_mii_mgmt_reg_addr(config_word, val) \ ((config_word) |= ((val) & 0x1F)) #define netxen_gb_mii_mgmt_phy_addr(config_word, val) \ @@ -274,9 +274,9 @@ typedef enum { #define netxen_set_phy_speed(config_word, val) \ ((config_word) |= ((val & 0x03) << 14)) #define netxen_set_phy_duplex(config_word) \ - ((config_word) |= 1 << 13) + set_bit(13, (unsigned long*)&config_word) #define netxen_clear_phy_duplex(config_word) \ - ((config_word) &= ~(1 << 13)) + clear_bit(13, (unsigned long*)&config_word) #define netxen_get_phy_jabber(config_word) \ _netxen_crb_get_bit(config_word, 0) @@ -350,11 +350,11 @@ typedef enum { _netxen_crb_get_bit(config_word, 15) #define netxen_set_phy_int_link_status_changed(config_word) \ - ((config_word) |= 1 << 10) + set_bit(10, (unsigned long*)&config_word) #define netxen_set_phy_int_autoneg_completed(config_word) \ - ((config_word) |= 1 << 11) + set_bit(11, (unsigned long*)&config_word) #define netxen_set_phy_int_speed_changed(config_word) \ - ((config_word) |= 1 << 14) + set_bit(14, (unsigned long*)&config_word) /* * NIU Mode Register. @@ -382,22 +382,22 @@ typedef enum { */ #define netxen_set_gb_drop_gb0(config_word) \ - ((config_word) |= 1 << 0) + set_bit(0, (unsigned long*)&config_word) #define netxen_set_gb_drop_gb1(config_word) \ - ((config_word) |= 1 << 1) + set_bit(1, (unsigned long*)&config_word) #define netxen_set_gb_drop_gb2(config_word) \ - ((config_word) |= 1 << 2) + set_bit(2, (unsigned long*)&config_word) #define netxen_set_gb_drop_gb3(config_word) \ - ((config_word) |= 1 << 3) + set_bit(3, (unsigned long*)&config_word) #define netxen_clear_gb_drop_gb0(config_word) \ - ((config_word) &= ~(1 << 0)) + clear_bit(0, (unsigned long*)&config_word) #define netxen_clear_gb_drop_gb1(config_word) \ - ((config_word) &= ~(1 << 1)) + clear_bit(1, (unsigned long*)&config_word) #define netxen_clear_gb_drop_gb2(config_word) \ - ((config_word) &= ~(1 << 2)) + clear_bit(2, (unsigned long*)&config_word) #define netxen_clear_gb_drop_gb3(config_word) \ - ((config_word) &= ~(1 << 3)) + clear_bit(3, (unsigned long*)&config_word) /* * NIU XG MAC Config Register @@ -413,7 +413,7 @@ typedef enum { */ #define netxen_xg_soft_reset(config_word) \ - ((config_word) |= 1 << 4) + set_bit(4, (unsigned long*)&config_word) /* * MAC Control Register @@ -433,19 +433,19 @@ typedef enum { #define netxen_nic_mcr_set_id_pool0(config, val) \ ((config) |= ((val) &0x03)) #define netxen_nic_mcr_set_enable_xtnd0(config) \ - ((config) |= 1 << 3) + (set_bit(3, (unsigned long *)&(config))) #define netxen_nic_mcr_set_id_pool1(config, val) \ ((config) |= (((val) & 0x03) << 4)) #define netxen_nic_mcr_set_enable_xtnd1(config) \ - ((config) |= 1 << 6) + (set_bit(6, (unsigned long *)&(config))) #define netxen_nic_mcr_set_id_pool2(config, val) \ ((config) |= (((val) & 0x03) << 8)) #define netxen_nic_mcr_set_enable_xtnd2(config) \ - ((config) |= 1 << 10) + (set_bit(10, (unsigned long *)&(config))) #define netxen_nic_mcr_set_id_pool3(config, val) \ ((config) |= (((val) & 0x03) << 12)) #define netxen_nic_mcr_set_enable_xtnd3(config) \ - ((config) |= 1 << 14) + (set_bit(14, (unsigned long *)&(config))) #define netxen_nic_mcr_set_mode_select(config, val) \ ((config) |= (((val) & 0x03) << 24)) #define netxen_nic_mcr_set_enable_pool(config, val) \ diff --git a/trunk/drivers/net/netxen/netxen_nic_init.c b/trunk/drivers/net/netxen/netxen_nic_init.c index 973af96337a9..c3e41f368554 100644 --- a/trunk/drivers/net/netxen/netxen_nic_init.c +++ b/trunk/drivers/net/netxen/netxen_nic_init.c @@ -690,7 +690,8 @@ int netxen_nic_rx_has_work(struct netxen_adapter *adapter) desc_head = recv_ctx->rcv_status_desc_head; desc = &desc_head[consumer]; - if (netxen_get_sts_owner(desc) & STATUS_OWNER_HOST) + if (((le16_to_cpu(netxen_get_sts_owner(desc))) + & STATUS_OWNER_HOST)) return 1; } @@ -786,11 +787,11 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, struct netxen_port *port = adapter->port[netxen_get_sts_port(desc)]; struct pci_dev *pdev = port->pdev; struct net_device *netdev = port->netdev; - int index = netxen_get_sts_refhandle(desc); + int index = le16_to_cpu(netxen_get_sts_refhandle(desc)); struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]); struct netxen_rx_buffer *buffer; struct sk_buff *skb; - u32 length = netxen_get_sts_totallength(desc); + u32 length = le16_to_cpu(netxen_get_sts_totallength(desc)); u32 desc_ctx; struct netxen_rcv_desc_ctx *rcv_desc; int ret; @@ -917,14 +918,16 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max) */ while (count < max) { desc = &desc_head[consumer]; - if (!(netxen_get_sts_owner(desc) & STATUS_OWNER_HOST)) { + if (! + (le16_to_cpu(netxen_get_sts_owner(desc)) & + STATUS_OWNER_HOST)) { DPRINTK(ERR, "desc %p ownedby %x\n", desc, netxen_get_sts_owner(desc)); break; } netxen_process_rcv(adapter, ctxid, desc); netxen_clear_sts_owner(desc); - netxen_set_sts_owner(desc, STATUS_OWNER_PHANTOM); + netxen_set_sts_owner(desc, cpu_to_le16(STATUS_OWNER_PHANTOM)); consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); count++; } @@ -1229,7 +1232,7 @@ void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, uint32_t ctx, /* make a rcv descriptor */ pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); - pdesc->buffer_length = cpu_to_le32(rcv_desc->dma_size); + pdesc->buffer_length = cpu_to_le16(rcv_desc->dma_size); pdesc->addr_buffer = cpu_to_le64(buffer->dma); DPRINTK(INFO, "done writing descripter\n"); producer = diff --git a/trunk/drivers/net/netxen/netxen_nic_isr.c b/trunk/drivers/net/netxen/netxen_nic_isr.c index be366e48007c..06847d4252c3 100644 --- a/trunk/drivers/net/netxen/netxen_nic_isr.c +++ b/trunk/drivers/net/netxen/netxen_nic_isr.c @@ -79,7 +79,7 @@ void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 portno, void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno, u32 enable) { - __u32 int_src; + __le32 int_src; struct netxen_port *port; /* This should clear the interrupt source */ @@ -110,7 +110,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno, /* write it down later.. */ if ((netxen_get_phy_int_speed_changed(int_src)) || (netxen_get_phy_int_link_status_changed(int_src))) { - __u32 status; + __le32 status; DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n"); diff --git a/trunk/drivers/net/netxen/netxen_nic_main.c b/trunk/drivers/net/netxen/netxen_nic_main.c index 69c1b9d23a1a..96e1bee19ba0 100644 --- a/trunk/drivers/net/netxen/netxen_nic_main.c +++ b/trunk/drivers/net/netxen/netxen_nic_main.c @@ -117,7 +117,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) void __iomem *mem_ptr1 = NULL; void __iomem *mem_ptr2 = NULL; - u8 __iomem *db_ptr = NULL; + u8 *db_ptr = NULL; unsigned long mem_base, mem_len, db_base, db_len; int pci_using_dac, i, err; int ring; @@ -191,7 +191,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) db_len); db_ptr = ioremap(db_base, NETXEN_DB_MAPSIZE_BYTES); - if (!db_ptr) { + if (db_ptr == 0UL) { printk(KERN_ERR "%s: Failed to allocate doorbell map.", netxen_nic_driver_name); err = -EIO; @@ -818,7 +818,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) /* Take skb->data itself */ pbuf = &adapter->cmd_buf_arr[producer]; if ((netdev->features & NETIF_F_TSO) && skb_shinfo(skb)->gso_size > 0) { - pbuf->mss = skb_shinfo(skb)->gso_size; + pbuf->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); } else { pbuf->mss = 0; @@ -882,7 +882,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) hwdesc->addr_buffer3 = cpu_to_le64(temp_dma); break; case 3: - hwdesc->buffer4_length = cpu_to_le16(temp_len); + hwdesc->buffer4_length = temp_len; hwdesc->addr_buffer4 = cpu_to_le64(temp_dma); break; } diff --git a/trunk/drivers/net/netxen/netxen_nic_niu.c b/trunk/drivers/net/netxen/netxen_nic_niu.c index 40d7003a371c..4987dc765d99 100644 --- a/trunk/drivers/net/netxen/netxen_nic_niu.c +++ b/trunk/drivers/net/netxen/netxen_nic_niu.c @@ -89,15 +89,15 @@ static inline int phy_unlock(struct netxen_adapter *adapter) * */ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, - long reg, __u32 * readval) + long reg, __le32 * readval) { long timeout = 0; long result = 0; long restore = 0; - __u32 address; - __u32 command; - __u32 status; - __u32 mac_cfg0; + __le32 address; + __le32 command; + __le32 status; + __le32 mac_cfg0; if (phy_lock(adapter) != 0) { return -1; @@ -112,7 +112,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, &mac_cfg0, 4)) return -EIO; if (netxen_gb_get_soft_reset(mac_cfg0)) { - __u32 temp; + __le32 temp; temp = 0; netxen_gb_tx_reset_pb(temp); netxen_gb_rx_reset_pb(temp); @@ -184,15 +184,15 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, * */ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, - long phy, long reg, __u32 val) + long phy, long reg, __le32 val) { long timeout = 0; long result = 0; long restore = 0; - __u32 address; - __u32 command; - __u32 status; - __u32 mac_cfg0; + __le32 address; + __le32 command; + __le32 status; + __le32 mac_cfg0; /* * MII mgmt all goes through port 0 MAC interface, so it @@ -203,7 +203,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, &mac_cfg0, 4)) return -EIO; if (netxen_gb_get_soft_reset(mac_cfg0)) { - __u32 temp; + __le32 temp; temp = 0; netxen_gb_tx_reset_pb(temp); netxen_gb_rx_reset_pb(temp); @@ -269,7 +269,7 @@ int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter, int port) { int result = 0; - __u32 enable = 0; + __le32 enable = 0; netxen_set_phy_int_link_status_changed(enable); netxen_set_phy_int_autoneg_completed(enable); netxen_set_phy_int_speed_changed(enable); @@ -402,7 +402,7 @@ void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) { int result = 0; - __u32 status; + __le32 status; if (adapter->disable_phy_interrupts) adapter->disable_phy_interrupts(adapter, port); mdelay(2); @@ -410,7 +410,7 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) if (0 == netxen_niu_gbe_phy_read(adapter, port, NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, - &status)) { + (__le32 *) & status)) { if (netxen_get_phy_link(status)) { if (netxen_get_phy_speed(status) == 2) { netxen_niu_gbe_set_gmii_mode(adapter, port, 1); @@ -489,7 +489,7 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, int port, long enable) { int result = 0; - __u32 int_src; + __le32 int_src; printk(KERN_INFO PFX "NETXEN: Handling PHY interrupt on port %d" " (device enable = %d)\n", (int)port, (int)enable); @@ -530,7 +530,7 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, printk(KERN_INFO PFX "autoneg_error "); if ((netxen_get_phy_int_speed_changed(int_src)) || (netxen_get_phy_int_link_status_changed(int_src))) { - __u32 status; + __le32 status; printk(KERN_INFO PFX "speed_changed or link status changed"); @@ -583,9 +583,9 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter, int netxen_niu_macaddr_get(struct netxen_adapter *adapter, int phy, netxen_ethernet_macaddr_t * addr) { - u32 stationhigh; - u32 stationlow; - u8 val[8]; + u64 result = 0; + __le32 stationhigh; + __le32 stationlow; if (addr == NULL) return -EINVAL; @@ -598,10 +598,10 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter, if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &stationlow, 4)) return -EIO; - ((__le32 *)val)[1] = cpu_to_le32(stationhigh); - ((__le32 *)val)[0] = cpu_to_le32(stationlow); - memcpy(addr, val + 2, 6); + result = (u64) netxen_gb_get_stationaddress_low(stationlow); + result |= (u64) stationhigh << 16; + memcpy(*addr, &result, sizeof(netxen_ethernet_macaddr_t)); return 0; } @@ -613,25 +613,24 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter, int netxen_niu_macaddr_set(struct netxen_port *port, netxen_ethernet_macaddr_t addr) { - u8 temp[4]; - u32 val; + __le32 temp = 0; struct netxen_adapter *adapter = port->adapter; int phy = port->portnum; unsigned char mac_addr[6]; int i; for (i = 0; i < 10; i++) { - temp[0] = temp[1] = 0; - memcpy(temp + 2, addr, 2); - val = le32_to_cpu(*(__le32 *)temp); + memcpy(&temp, addr, 2); + temp <<= 16; if (netxen_nic_hw_write_wx - (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &val, 4)) + (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &temp, 4)) return -EIO; - memcpy(temp, ((u8 *) addr) + 2, sizeof(__le32)); - val = le32_to_cpu(*(__le32 *)temp); + temp = 0; + + memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); if (netxen_nic_hw_write_wx - (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4)) + (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &temp, 4)) return -2; netxen_niu_macaddr_get(adapter, phy, @@ -660,9 +659,9 @@ int netxen_niu_macaddr_set(struct netxen_port *port, int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, int port, netxen_niu_gbe_ifmode_t mode) { - __u32 mac_cfg0; - __u32 mac_cfg1; - __u32 mii_cfg; + __le32 mac_cfg0; + __le32 mac_cfg1; + __le32 mii_cfg; if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) return -EINVAL; @@ -737,7 +736,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, /* Disable a GbE interface */ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) { - __u32 mac_cfg0; + __le32 mac_cfg0; if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) return -EINVAL; @@ -753,7 +752,7 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) /* Disable an XG interface */ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port) { - __u32 mac_cfg; + __le32 mac_cfg; if (port != 0) return -EINVAL; @@ -770,7 +769,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port) int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, netxen_niu_prom_mode_t mode) { - __u32 reg; + __le32 reg; if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) return -EINVAL; @@ -827,21 +826,22 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, int netxen_niu_xg_macaddr_set(struct netxen_port *port, netxen_ethernet_macaddr_t addr) { - u8 temp[4]; - u32 val; + __le32 temp = 0; struct netxen_adapter *adapter = port->adapter; - temp[0] = temp[1] = 0; - memcpy(temp + 2, addr, 2); - val = le32_to_cpu(*(__le32 *)temp); + memcpy(&temp, addr, 2); + temp = cpu_to_le32(temp); + temp <<= 16; if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, - &val, 4)) + &temp, 4)) return -EIO; + temp = 0; + memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); - val = le32_to_cpu(*(__le32 *)temp); + temp = cpu_to_le32(temp); if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, - &val, 4)) + &temp, 4)) return -EIO; return 0; @@ -854,9 +854,9 @@ int netxen_niu_xg_macaddr_set(struct netxen_port *port, int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, netxen_ethernet_macaddr_t * addr) { - u32 stationhigh; - u32 stationlow; - u8 val[8]; + __le32 stationhigh; + __le32 stationlow; + u64 result; if (addr == NULL) return -EINVAL; @@ -869,10 +869,10 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, &stationlow, 4)) return -EIO; - ((__le32 *)val)[1] = cpu_to_le32(stationhigh); - ((__le32 *)val)[0] = cpu_to_le32(stationlow); - memcpy(addr, val + 2, 6); + result = ((u64) stationlow) >> 16; + result |= (u64) stationhigh << 16; + memcpy(*addr, &result, sizeof(netxen_ethernet_macaddr_t)); return 0; } @@ -880,7 +880,7 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, int port, netxen_niu_prom_mode_t mode) { - __u32 reg; + __le32 reg; if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) return -EINVAL; diff --git a/trunk/drivers/net/phy/fixed.c b/trunk/drivers/net/phy/fixed.c index 86135397f430..096d4a100bf2 100644 --- a/trunk/drivers/net/phy/fixed.c +++ b/trunk/drivers/net/phy/fixed.c @@ -349,7 +349,7 @@ static int __init fixed_init(void) fixed_mdio_register_device(0, 100, 1); #endif -#ifdef CONFIG_FIXED_MII_10_FDX +#ifdef CONFIX_FIXED_MII_10_FDX fixed_mdio_register_device(0, 10, 1); #endif return 0; diff --git a/trunk/drivers/net/sky2.c b/trunk/drivers/net/sky2.c index 822dd0b13133..a2e804ddca6c 100644 --- a/trunk/drivers/net/sky2.c +++ b/trunk/drivers/net/sky2.c @@ -3639,6 +3639,29 @@ static int sky2_resume(struct pci_dev *pdev) out: return err; } + +/* BIOS resume runs after device (it's a bug in PM) + * as a temporary workaround on suspend/resume leave MSI disabled + */ +static int sky2_suspend_late(struct pci_dev *pdev, pm_message_t state) +{ + struct sky2_hw *hw = pci_get_drvdata(pdev); + + free_irq(pdev->irq, hw); + if (hw->msi) { + pci_disable_msi(pdev); + hw->msi = 0; + } + return 0; +} + +static int sky2_resume_early(struct pci_dev *pdev) +{ + struct sky2_hw *hw = pci_get_drvdata(pdev); + struct net_device *dev = hw->dev[0]; + + return request_irq(pdev->irq, sky2_intr, IRQF_SHARED, dev->name, hw); +} #endif static struct pci_driver sky2_driver = { @@ -3649,6 +3672,8 @@ static struct pci_driver sky2_driver = { #ifdef CONFIG_PM .suspend = sky2_suspend, .resume = sky2_resume, + .suspend_late = sky2_suspend_late, + .resume_early = sky2_resume_early, #endif }; diff --git a/trunk/drivers/net/smc911x.c b/trunk/drivers/net/smc911x.c index 43af61438449..880d9fdd7c67 100644 --- a/trunk/drivers/net/smc911x.c +++ b/trunk/drivers/net/smc911x.c @@ -968,11 +968,11 @@ static void smc911x_phy_configure(struct work_struct *work) * We should not be called if phy_type is zero. */ if (lp->phy_type == 0) - goto smc911x_phy_configure_exit_nolock; + goto smc911x_phy_configure_exit; if (smc911x_phy_reset(dev, phyaddr)) { printk("%s: PHY reset timed out\n", dev->name); - goto smc911x_phy_configure_exit_nolock; + goto smc911x_phy_configure_exit; } spin_lock_irqsave(&lp->lock, flags); @@ -1041,7 +1041,6 @@ static void smc911x_phy_configure(struct work_struct *work) smc911x_phy_configure_exit: spin_unlock_irqrestore(&lp->lock, flags); -smc911x_phy_configure_exit_nolock: lp->work_pending = 0; } diff --git a/trunk/drivers/net/spider_net.c b/trunk/drivers/net/spider_net.c index 8ea2fc1b96cb..ebb6aa39f9c7 100644 --- a/trunk/drivers/net/spider_net.c +++ b/trunk/drivers/net/spider_net.c @@ -1925,8 +1925,6 @@ spider_net_stop(struct net_device *netdev) /* release chains */ spider_net_release_tx_chain(card, 1); - spider_net_free_rx_chain_contents(card); - spider_net_free_chain(card, &card->tx_chain); spider_net_free_chain(card, &card->rx_chain); diff --git a/trunk/drivers/pci/quirks.c b/trunk/drivers/pci/quirks.c index c913ea4e545c..ef882a8a094e 100644 --- a/trunk/drivers/pci/quirks.c +++ b/trunk/drivers/pci/quirks.c @@ -654,42 +654,19 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vi * VIA bridges which have VLink */ -static int via_vlink_dev_lo = -1, via_vlink_dev_hi = 18; - -static void quirk_via_bridge(struct pci_dev *dev) -{ - /* See what bridge we have and find the device ranges */ - switch (dev->device) { - case PCI_DEVICE_ID_VIA_82C686: - /* The VT82C686 is special, it attaches to PCI and can have - any device number. All its subdevices are functions of - that single device. */ - via_vlink_dev_lo = PCI_SLOT(dev->devfn); - via_vlink_dev_hi = PCI_SLOT(dev->devfn); - break; - case PCI_DEVICE_ID_VIA_8237: - case PCI_DEVICE_ID_VIA_8237A: - via_vlink_dev_lo = 15; - break; - case PCI_DEVICE_ID_VIA_8235: - via_vlink_dev_lo = 16; - break; - case PCI_DEVICE_ID_VIA_8231: - case PCI_DEVICE_ID_VIA_8233_0: - case PCI_DEVICE_ID_VIA_8233A: - case PCI_DEVICE_ID_VIA_8233C_0: - via_vlink_dev_lo = 17; - break; - } -} -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_bridge); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, quirk_via_bridge); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233_0, quirk_via_bridge); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233A, quirk_via_bridge); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233C_0, quirk_via_bridge); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_via_bridge); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_bridge); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237A, quirk_via_bridge); +static const struct pci_device_id via_vlink_fixup_tbl[] = { + /* Internal devices need IRQ line routing, pre VLink */ + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C686), 0 }, + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8231), 17 }, + /* Devices with VLink */ + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233_0), 17}, + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233A), 17 }, + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8233C_0), 17 }, + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8235), 16 }, + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237), 15 }, + { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237A), 15 }, + { 0, }, +}; /** * quirk_via_vlink - VIA VLink IRQ number update @@ -698,20 +675,35 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237A, quirk_via_b * If the device we are dealing with is on a PIC IRQ we need to * ensure that the IRQ line register which usually is not relevant * for PCI cards, is actually written so that interrupts get sent - * to the right place. - * We only do this on systems where a VIA south bridge was detected, - * and only for VIA devices on the motherboard (see quirk_via_bridge - * above). + * to the right place */ static void quirk_via_vlink(struct pci_dev *dev) { + const struct pci_device_id *via_vlink_fixup; + static int dev_lo = -1, dev_hi = 18; u8 irq, new_irq; - /* Check if we have VLink at all */ - if (via_vlink_dev_lo == -1) + /* Check if we have VLink and cache the result */ + + /* Checked already - no */ + if (dev_lo == -2) return; + /* Not checked - see what bridge we have and find the device + ranges */ + + if (dev_lo == -1) { + via_vlink_fixup = pci_find_present(via_vlink_fixup_tbl); + if (via_vlink_fixup == NULL) { + dev_lo = -2; + return; + } + dev_lo = via_vlink_fixup->driver_data; + /* 82C686 is special - 0/0 */ + if (dev_lo == 0) + dev_hi = 0; + } new_irq = dev->irq; /* Don't quirk interrupts outside the legacy IRQ range */ @@ -719,8 +711,8 @@ static void quirk_via_vlink(struct pci_dev *dev) return; /* Internal device ? */ - if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) > via_vlink_dev_hi || - PCI_SLOT(dev->devfn) < via_vlink_dev_lo) + if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) > dev_hi || + PCI_SLOT(dev->devfn) < dev_lo) return; /* This is an internal VLink device on a PIC interrupt. The BIOS @@ -1262,8 +1254,8 @@ static void quirk_jmicron_dualfn(struct pci_dev *pdev) pci_read_config_dword(pdev, 0x40, &conf); /* Enable dual function mode, AHCI on fn 0, IDE fn1 */ /* Set the class codes correctly and then direct IDE 0 */ - conf &= ~0x000FF200; /* Clear bit 9 and 12-19 */ - conf |= 0x00C2A102; /* Set 1, 8, 13, 15, 17, 22, 23 */ + conf &= ~0x000F0200; /* Clear bit 9 and 16-19 */ + conf |= 0x00C20002; /* Set bit 1, 17, 22, 23 */ pci_write_config_dword(pdev, 0x40, conf); /* Reconfigure so that the PCI scanner discovers the diff --git a/trunk/drivers/pci/search.c b/trunk/drivers/pci/search.c index b2653c4afe9e..fab381ed853c 100644 --- a/trunk/drivers/pci/search.c +++ b/trunk/drivers/pci/search.c @@ -200,8 +200,11 @@ static struct pci_dev * pci_find_subsys(unsigned int vendor, * can cause some machines to crash. So here we detect and flag that * situation and bail out early. */ - if (unlikely(list_empty(&pci_devices))) + if (unlikely(list_empty(&pci_devices))) { + printk(KERN_INFO "pci_find_subsys() called while pci_devices " + "is still empty\n"); return NULL; + } down_read(&pci_bus_sem); n = from ? from->global_list.next : pci_devices.next; @@ -275,8 +278,11 @@ pci_get_subsys(unsigned int vendor, unsigned int device, * can cause some machines to crash. So here we detect and flag that * situation and bail out early. */ - if (unlikely(list_empty(&pci_devices))) + if (unlikely(list_empty(&pci_devices))) { + printk(KERN_NOTICE "pci_get_subsys() called while pci_devices " + "is still empty\n"); return NULL; + } down_read(&pci_bus_sem); n = from ? from->global_list.next : pci_devices.next; diff --git a/trunk/drivers/scsi/pcmcia/sym53c500_cs.c b/trunk/drivers/scsi/pcmcia/sym53c500_cs.c index 5b458d2478f7..9fb0ea5c1fb9 100644 --- a/trunk/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/trunk/drivers/scsi/pcmcia/sym53c500_cs.c @@ -545,6 +545,8 @@ SYM53C500_release(struct pcmcia_device *link) */ if (shost->irq) free_irq(shost->irq, shost); + if (shost->dma_channel != 0xff) + free_dma(shost->dma_channel); if (shost->io_port && shost->n_io_port) release_region(shost->io_port, shost->n_io_port); diff --git a/trunk/drivers/scsi/scsi_scan.c b/trunk/drivers/scsi/scsi_scan.c index b83d03c4deef..96b7cbd746a8 100644 --- a/trunk/drivers/scsi/scsi_scan.c +++ b/trunk/drivers/scsi/scsi_scan.c @@ -1453,6 +1453,12 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, struct device *parent = &shost->shost_gendev; struct scsi_target *starget; + if (strncmp(scsi_scan_type, "none", 4) == 0) + return ERR_PTR(-ENODEV); + + if (!shost->async_scan) + scsi_complete_async_scans(); + starget = scsi_alloc_target(parent, channel, id); if (!starget) return ERR_PTR(-ENOMEM); diff --git a/trunk/drivers/serial/amba-pl010.c b/trunk/drivers/serial/amba-pl010.c index f69bd097166e..61db6973755a 100644 --- a/trunk/drivers/serial/amba-pl010.c +++ b/trunk/drivers/serial/amba-pl010.c @@ -589,8 +589,6 @@ static int __init pl010_console_setup(struct console *co, char *options) */ if (co->index >= UART_NR) co->index = 0; - if (!amba_ports[co->index]) - return -ENODEV; port = &amba_ports[co->index]->port; if (options) diff --git a/trunk/drivers/serial/amba-pl011.c b/trunk/drivers/serial/amba-pl011.c index 44639e71372a..9a3b374b2a08 100644 --- a/trunk/drivers/serial/amba-pl011.c +++ b/trunk/drivers/serial/amba-pl011.c @@ -661,8 +661,6 @@ static int __init pl011_console_setup(struct console *co, char *options) if (co->index >= UART_NR) co->index = 0; uap = amba_ports[co->index]; - if (!uap) - return -ENODEV; uap->port.uartclk = clk_get_rate(uap->clk); diff --git a/trunk/drivers/serial/atmel_serial.c b/trunk/drivers/serial/atmel_serial.c index 881f886b91c6..ed7f7209ea59 100644 --- a/trunk/drivers/serial/atmel_serial.c +++ b/trunk/drivers/serial/atmel_serial.c @@ -689,9 +689,9 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port, struct struct atmel_uart_data *data = pdev->dev.platform_data; port->iotype = UPIO_MEM; - port->flags = UPF_BOOT_AUTOCONF; + port->flags = UPF_BOOT_AUTOCONF; port->ops = &atmel_pops; - port->fifosize = 1; + port->fifosize = 1; port->line = pdev->id; port->dev = &pdev->dev; @@ -890,6 +890,7 @@ static int atmel_serial_suspend(struct platform_device *pdev, pm_message_t state if (device_may_wakeup(&pdev->dev) && !at91_suspend_entering_slow_clock()) enable_irq_wake(port->irq); else { + disable_irq_wake(port->irq); uart_suspend_port(&atmel_uart, port); atmel_port->suspended = 1; } @@ -906,8 +907,6 @@ static int atmel_serial_resume(struct platform_device *pdev) uart_resume_port(&atmel_uart, port); atmel_port->suspended = 0; } - else - disable_irq_wake(port->irq); return 0; } diff --git a/trunk/drivers/serial/atmel_serial.h b/trunk/drivers/serial/atmel_serial.h index 11b44360e108..fe1763b2a6d5 100644 --- a/trunk/drivers/serial/atmel_serial.h +++ b/trunk/drivers/serial/atmel_serial.h @@ -106,7 +106,7 @@ #define ATMEL_US_CSR 0x14 /* Channel Status Register */ #define ATMEL_US_RHR 0x18 /* Receiver Holding Register */ #define ATMEL_US_THR 0x1c /* Transmitter Holding Register */ -#define ATMEL_US_SYNH (1 << 15) /* Transmit/Receive Sync [AT91SAM9261 only] */ +#define ATMEL_US_SYNH (1 << 15) /* Transmit/Receive Sync [SAM9 only] */ #define ATMEL_US_BRGR 0x20 /* Baud Rate Generator Register */ #define ATMEL_US_CD (0xffff << 0) /* Clock Divider */ diff --git a/trunk/drivers/usb/input/hid-core.c b/trunk/drivers/usb/input/hid-core.c index c6c9e72e5fd9..ea3636d96e1b 100644 --- a/trunk/drivers/usb/input/hid-core.c +++ b/trunk/drivers/usb/input/hid-core.c @@ -56,6 +56,11 @@ static unsigned int hid_mousepoll_interval; module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); +static int usbhid_pb_fnmode = 1; +module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644); +MODULE_PARM_DESC(pb_fnmode, + "Mode of fn key on PowerBooks (0 = disabled, 1 = fkeyslast, 2 = fkeysfirst)"); + /* * Input submission and I/O error handler. */ @@ -577,6 +582,7 @@ void usbhid_init_reports(struct hid_device *hid) } #define USB_VENDOR_ID_GTCO 0x078c +#define USB_VENDOR_ID_GTCO_IPANEL_1 0x08ca #define USB_VENDOR_ID_GTCO_IPANEL_2 0x5543 #define USB_DEVICE_ID_GTCO_90 0x0090 #define USB_DEVICE_ID_GTCO_100 0x0100 @@ -623,6 +629,7 @@ void usbhid_init_reports(struct hid_device *hid) #define USB_DEVICE_ID_GTCO_1004 0x1004 #define USB_DEVICE_ID_GTCO_1005 0x1005 #define USB_DEVICE_ID_GTCO_1006 0x1006 +#define USB_DEVICE_ID_GTCO_10 0x0010 #define USB_DEVICE_ID_GTCO_8 0x0008 #define USB_DEVICE_ID_GTCO_d 0x000d @@ -876,6 +883,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_GTCO_IPANEL_1, USB_DEVICE_ID_GTCO_10, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA, HID_QUIRK_IGNORE }, @@ -1241,6 +1249,10 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) hid->hiddev_hid_event = hiddev_hid_event; hid->hiddev_report_event = hiddev_report_event; #endif +#ifdef CONFIG_USB_HIDINPUT_POWERBOOK + hid->pb_fnmode = usbhid_pb_fnmode; +#endif + return hid; fail: diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index 55991e4132a7..ee20fc4240e0 100644 --- a/trunk/fs/aio.c +++ b/trunk/fs/aio.c @@ -298,23 +298,17 @@ static void wait_for_all_aios(struct kioctx *ctx) struct task_struct *tsk = current; DECLARE_WAITQUEUE(wait, tsk); - spin_lock_irq(&ctx->ctx_lock); if (!ctx->reqs_active) - goto out; + return; add_wait_queue(&ctx->wait, &wait); set_task_state(tsk, TASK_UNINTERRUPTIBLE); while (ctx->reqs_active) { - spin_unlock_irq(&ctx->ctx_lock); schedule(); set_task_state(tsk, TASK_UNINTERRUPTIBLE); - spin_lock_irq(&ctx->ctx_lock); } __set_task_state(tsk, TASK_RUNNING); remove_wait_queue(&ctx->wait, &wait); - -out: - spin_unlock_irq(&ctx->ctx_lock); } /* wait_on_sync_kiocb: @@ -430,6 +424,7 @@ static struct kiocb fastcall *__aio_get_req(struct kioctx *ctx) ring = kmap_atomic(ctx->ring_info.ring_pages[0], KM_USER0); if (ctx->reqs_active < aio_ring_avail(&ctx->ring_info, ring)) { list_add(&req->ki_list, &ctx->active_reqs); + get_ioctx(ctx); ctx->reqs_active++; okay = 1; } @@ -541,6 +536,8 @@ int fastcall aio_put_req(struct kiocb *req) spin_lock_irq(&ctx->ctx_lock); ret = __aio_put_req(ctx, req); spin_unlock_irq(&ctx->ctx_lock); + if (ret) + put_ioctx(ctx); return ret; } @@ -782,7 +779,8 @@ static int __aio_run_iocbs(struct kioctx *ctx) */ iocb->ki_users++; /* grab extra reference */ aio_run_iocb(iocb); - __aio_put_req(ctx, iocb); + if (__aio_put_req(ctx, iocb)) /* drop extra ref */ + put_ioctx(ctx); } if (!list_empty(&ctx->run_list)) return 1; @@ -999,10 +997,14 @@ int fastcall aio_complete(struct kiocb *iocb, long res, long res2) /* everything turned out well, dispose of the aiocb. */ ret = __aio_put_req(ctx, iocb); + spin_unlock_irqrestore(&ctx->ctx_lock, flags); + if (waitqueue_active(&ctx->wait)) wake_up(&ctx->wait); - spin_unlock_irqrestore(&ctx->ctx_lock, flags); + if (ret) + put_ioctx(ctx); + return ret; } diff --git a/trunk/fs/block_dev.c b/trunk/fs/block_dev.c index fc7028b685f2..d9bdf2b3ade2 100644 --- a/trunk/fs/block_dev.c +++ b/trunk/fs/block_dev.c @@ -129,46 +129,6 @@ blkdev_get_block(struct inode *inode, sector_t iblock, return 0; } -static int -blkdev_get_blocks(struct inode *inode, sector_t iblock, - struct buffer_head *bh, int create) -{ - sector_t end_block = max_block(I_BDEV(inode)); - unsigned long max_blocks = bh->b_size >> inode->i_blkbits; - - if ((iblock + max_blocks) > end_block) { - max_blocks = end_block - iblock; - if ((long)max_blocks <= 0) { - if (create) - return -EIO; /* write fully beyond EOF */ - /* - * It is a read which is fully beyond EOF. We return - * a !buffer_mapped buffer - */ - max_blocks = 0; - } - } - - bh->b_bdev = I_BDEV(inode); - bh->b_blocknr = iblock; - bh->b_size = max_blocks << inode->i_blkbits; - if (max_blocks) - set_buffer_mapped(bh); - return 0; -} - -static ssize_t -blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, - loff_t offset, unsigned long nr_segs) -{ - struct file *file = iocb->ki_filp; - struct inode *inode = file->f_mapping->host; - - return blockdev_direct_IO_no_locking(rw, iocb, inode, I_BDEV(inode), - iov, offset, nr_segs, blkdev_get_blocks, NULL); -} - -#if 0 static int blk_end_aio(struct bio *bio, unsigned int bytes_done, int error) { struct kiocb *iocb = bio->bi_private; @@ -363,7 +323,6 @@ blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, return PTR_ERR(page); goto completion; } -#endif static int blkdev_writepage(struct page *page, struct writeback_control *wbc) { diff --git a/trunk/fs/buffer.c b/trunk/fs/buffer.c index 1ad674fd348c..460f1c43238e 100644 --- a/trunk/fs/buffer.c +++ b/trunk/fs/buffer.c @@ -2844,6 +2844,7 @@ int try_to_free_buffers(struct page *page) spin_lock(&mapping->private_lock); ret = drop_buffers(page, &buffers_to_free); + spin_unlock(&mapping->private_lock); /* * If the filesystem writes its buffers by hand (eg ext3) @@ -2854,14 +2855,9 @@ int try_to_free_buffers(struct page *page) * Also, during truncate, discard_buffer will have marked all * the page's buffers clean. We discover that here and clean * the page also. - * - * private_lock must be held over this entire operation in order - * to synchronise against __set_page_dirty_buffers and prevent the - * dirty bit from being lost. */ if (ret) cancel_dirty_page(page, PAGE_CACHE_SIZE); - spin_unlock(&mapping->private_lock); out: if (buffers_to_free) { struct buffer_head *bh = buffers_to_free; diff --git a/trunk/fs/fuse/control.c b/trunk/fs/fuse/control.c index 1794305f9ed8..8c58bd453993 100644 --- a/trunk/fs/fuse/control.c +++ b/trunk/fs/fuse/control.c @@ -193,12 +193,8 @@ static int fuse_ctl_get_sb(struct file_system_type *fs_type, int flags, static void fuse_ctl_kill_sb(struct super_block *sb) { - struct fuse_conn *fc; - mutex_lock(&fuse_mutex); fuse_control_sb = NULL; - list_for_each_entry(fc, &fuse_conn_list, entry) - fc->ctl_ndents = 0; mutex_unlock(&fuse_mutex); kill_litter_super(sb); diff --git a/trunk/fs/hostfs/hostfs.h b/trunk/fs/hostfs/hostfs.h index 70543b17e4c7..cca3fb693f99 100644 --- a/trunk/fs/hostfs/hostfs.h +++ b/trunk/fs/hostfs/hostfs.h @@ -76,7 +76,7 @@ extern int make_symlink(const char *from, const char *to); extern int unlink_file(const char *file); extern int do_mkdir(const char *file, int mode); extern int do_rmdir(const char *file); -extern int do_mknod(const char *file, int mode, unsigned int major, unsigned int minor); +extern int do_mknod(const char *file, int mode, int dev); extern int link_file(const char *from, const char *to); extern int do_readlink(char *file, char *buf, int size); extern int rename_file(char *from, char *to); diff --git a/trunk/fs/hostfs/hostfs_kern.c b/trunk/fs/hostfs/hostfs_kern.c index 69a376f35a68..1e6fc3799876 100644 --- a/trunk/fs/hostfs/hostfs_kern.c +++ b/trunk/fs/hostfs/hostfs_kern.c @@ -755,7 +755,7 @@ int hostfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) goto out_put; init_special_inode(inode, mode, dev); - err = do_mknod(name, mode, MAJOR(dev), MINOR(dev)); + err = do_mknod(name, mode, dev); if(err) goto out_free; diff --git a/trunk/fs/hostfs/hostfs_user.c b/trunk/fs/hostfs/hostfs_user.c index 1ed5ea389f15..23b7cee72123 100644 --- a/trunk/fs/hostfs/hostfs_user.c +++ b/trunk/fs/hostfs/hostfs_user.c @@ -295,11 +295,11 @@ int do_rmdir(const char *file) return(0); } -int do_mknod(const char *file, int mode, unsigned int major, unsigned int minor) +int do_mknod(const char *file, int mode, int dev) { int err; - err = mknod(file, mode, makedev(major, minor)); + err = mknod(file, mode, dev); if(err) return(-errno); return(0); } diff --git a/trunk/fs/lockd/clntlock.c b/trunk/fs/lockd/clntlock.c index f4d45d4d835b..062707745162 100644 --- a/trunk/fs/lockd/clntlock.c +++ b/trunk/fs/lockd/clntlock.c @@ -176,7 +176,7 @@ reclaimer(void *ptr) lock_kernel(); lockd_up(0); /* note: this cannot fail as lockd is already running */ - dprintk("lockd: reclaiming locks for host %s\n", host->h_name); + dprintk("lockd: reclaiming locks for host %s", host->h_name); restart: nsmstate = host->h_nsmstate; @@ -206,7 +206,7 @@ reclaimer(void *ptr) host->h_reclaiming = 0; up_write(&host->h_rwsem); - dprintk("NLM: done reclaiming locks for host %s\n", host->h_name); + dprintk("NLM: done reclaiming locks for host %s", host->h_name); /* Now, wake up all processes that sleep on a blocked lock */ list_for_each_entry(block, &nlm_blocked, b_list) { diff --git a/trunk/fs/nfs/file.c b/trunk/fs/nfs/file.c index 9e4a2b70995a..fab20d06d936 100644 --- a/trunk/fs/nfs/file.c +++ b/trunk/fs/nfs/file.c @@ -434,9 +434,8 @@ static int do_vfs_lock(struct file *file, struct file_lock *fl) BUG(); } if (res < 0) - dprintk(KERN_WARNING "%s: VFS is out of sync with lock manager" - " - error %d!\n", - __FUNCTION__, res); + printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", + __FUNCTION__); return res; } diff --git a/trunk/fs/nfsd/export.c b/trunk/fs/nfsd/export.c index 49c310b84923..248dd92e6a56 100644 --- a/trunk/fs/nfsd/export.c +++ b/trunk/fs/nfsd/export.c @@ -35,6 +35,7 @@ #include #define NFSDDBG_FACILITY NFSDDBG_EXPORT +#define NFSD_PARANOIA 1 typedef struct auth_domain svc_client; typedef struct svc_export svc_export; diff --git a/trunk/fs/nfsd/nfsfh.c b/trunk/fs/nfsd/nfsfh.c index c59d6fbb7a6b..b06bf9f70efc 100644 --- a/trunk/fs/nfsd/nfsfh.c +++ b/trunk/fs/nfsd/nfsfh.c @@ -24,6 +24,8 @@ #include #define NFSDDBG_FACILITY NFSDDBG_FH +#define NFSD_PARANOIA 1 +/* #define NFSD_DEBUG_VERBOSE 1 */ static int nfsd_nr_verified; @@ -228,12 +230,13 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) error = nfserrno(PTR_ERR(dentry)); goto out; } - +#ifdef NFSD_PARANOIA if (S_ISDIR(dentry->d_inode->i_mode) && (dentry->d_flags & DCACHE_DISCONNECTED)) { printk("nfsd: find_fh_dentry returned a DISCONNECTED directory: %s/%s\n", dentry->d_parent->d_name.name, dentry->d_name.name); } +#endif fhp->fh_dentry = dentry; fhp->fh_export = exp; @@ -264,13 +267,12 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) /* Finally, check access permissions. */ error = nfsd_permission(exp, dentry, access); +#ifdef NFSD_PARANOIA_EXTREME if (error) { - dprintk("fh_verify: %s/%s permission failure, " - "acc=%x, error=%d\n", - dentry->d_parent->d_name.name, - dentry->d_name.name, - access, ntohl(error)); + printk("fh_verify: %s/%s permission failure, acc=%x, error=%d\n", + dentry->d_parent->d_name.name, dentry->d_name.name, access, (error >> 24)); } +#endif out: if (exp && !IS_ERR(exp)) exp_put(exp); diff --git a/trunk/fs/nfsd/vfs.c b/trunk/fs/nfsd/vfs.c index 8283236c6a0f..5d32e5fa697e 100644 --- a/trunk/fs/nfsd/vfs.c +++ b/trunk/fs/nfsd/vfs.c @@ -59,6 +59,7 @@ #include #define NFSDDBG_FACILITY NFSDDBG_FILEOP +#define NFSD_PARANOIA /* We must ignore files (but only files) which might have mandatory diff --git a/trunk/fs/ntfs/aops.c b/trunk/fs/ntfs/aops.c index 629e7abdd840..7b2c8f4f6a6f 100644 --- a/trunk/fs/ntfs/aops.c +++ b/trunk/fs/ntfs/aops.c @@ -92,12 +92,10 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) ofs = 0; if (file_ofs < init_size) ofs = init_size - file_ofs; - local_irq_save(flags); kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ); memset(kaddr + bh_offset(bh) + ofs, 0, bh->b_size - ofs); kunmap_atomic(kaddr, KM_BIO_SRC_IRQ); - local_irq_restore(flags); flush_dcache_page(page); } } else { @@ -145,13 +143,11 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) recs = PAGE_CACHE_SIZE / rec_size; /* Should have been verified before we got here... */ BUG_ON(!recs); - local_irq_save(flags); kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ); for (i = 0; i < recs; i++) post_read_mst_fixup((NTFS_RECORD*)(kaddr + i * rec_size), rec_size); kunmap_atomic(kaddr, KM_BIO_SRC_IRQ); - local_irq_restore(flags); flush_dcache_page(page); if (likely(page_uptodate && !PageError(page))) SetPageUptodate(page); diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c index 1a979ea3b379..ff7a66850602 100644 --- a/trunk/fs/proc/base.c +++ b/trunk/fs/proc/base.c @@ -2328,23 +2328,13 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi { struct dentry *dentry = filp->f_path.dentry; struct inode *inode = dentry->d_inode; - struct task_struct *leader = NULL; + struct task_struct *leader = get_proc_task(inode); struct task_struct *task; int retval = -ENOENT; ino_t ino; int tid; unsigned long pos = filp->f_pos; /* avoiding "long long" filp->f_pos */ - task = get_proc_task(inode); - if (!task) - goto out_no_task; - rcu_read_lock(); - if (pid_alive(task)) { - leader = task->group_leader; - get_task_struct(leader); - } - rcu_read_unlock(); - put_task_struct(task); if (!leader) goto out_no_task; retval = 0; diff --git a/trunk/fs/ufs/balloc.c b/trunk/fs/ufs/balloc.c index 638f4c585e89..2e0021e8f366 100644 --- a/trunk/fs/ufs/balloc.c +++ b/trunk/fs/ufs/balloc.c @@ -227,27 +227,24 @@ void ufs_free_blocks(struct inode *inode, unsigned fragment, unsigned count) * We can come here from ufs_writepage or ufs_prepare_write, * locked_page is argument of these functions, so we already lock it. */ -static void ufs_change_blocknr(struct inode *inode, unsigned int beg, +static void ufs_change_blocknr(struct inode *inode, unsigned int baseblk, unsigned int count, unsigned int oldb, unsigned int newb, struct page *locked_page) { - const unsigned mask = (1 << (PAGE_CACHE_SHIFT - inode->i_blkbits)) - 1; - struct address_space * const mapping = inode->i_mapping; - pgoff_t index, cur_index; - unsigned end, pos, j; + unsigned int blk_per_page = 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits); + struct address_space *mapping = inode->i_mapping; + pgoff_t index, cur_index = locked_page->index; + unsigned int i, j; struct page *page; struct buffer_head *head, *bh; UFSD("ENTER, ino %lu, count %u, oldb %u, newb %u\n", inode->i_ino, count, oldb, newb); - BUG_ON(!locked_page); BUG_ON(!PageLocked(locked_page)); - cur_index = locked_page->index; - - for (end = count + beg; beg < end; beg = (beg | mask) + 1) { - index = beg >> (PAGE_CACHE_SHIFT - inode->i_blkbits); + for (i = 0; i < count; i += blk_per_page) { + index = (baseblk+i) >> (PAGE_CACHE_SHIFT - inode->i_blkbits); if (likely(cur_index != index)) { page = ufs_get_locked_page(mapping, index); @@ -256,32 +253,21 @@ static void ufs_change_blocknr(struct inode *inode, unsigned int beg, } else page = locked_page; + j = i; head = page_buffers(page); bh = head; - pos = beg & mask; - for (j = 0; j < pos; ++j) - bh = bh->b_this_page; - j = 0; do { - if (buffer_mapped(bh)) { - pos = bh->b_blocknr - oldb; - if (pos < count) { - UFSD(" change from %llu to %llu\n", - (unsigned long long)pos + oldb, - (unsigned long long)pos + newb); - bh->b_blocknr = newb + pos; - unmap_underlying_metadata(bh->b_bdev, - bh->b_blocknr); - mark_buffer_dirty(bh); - ++j; - } + if (likely(bh->b_blocknr == j + oldb && j < count)) { + unmap_underlying_metadata(bh->b_bdev, + bh->b_blocknr); + bh->b_blocknr = newb + j++; + mark_buffer_dirty(bh); } bh = bh->b_this_page; } while (bh != head); - if (j) - set_page_dirty(page); + set_page_dirty(page); if (likely(cur_index != index)) ufs_put_locked_page(page); @@ -429,14 +415,14 @@ unsigned ufs_new_fragments(struct inode * inode, __fs32 * p, unsigned fragment, } result = ufs_alloc_fragments (inode, cgno, goal, request, err); if (result) { - ufs_clear_frags(inode, result + oldcount, newcount - oldcount, - locked_page != NULL); ufs_change_blocknr(inode, fragment - oldcount, oldcount, tmp, result, locked_page); *p = cpu_to_fs32(sb, result); *err = 0; UFS_I(inode)->i_lastfrag = max_t(u32, UFS_I(inode)->i_lastfrag, fragment + count); + ufs_clear_frags(inode, result + oldcount, newcount - oldcount, + locked_page != NULL); unlock_super(sb); if (newcount < request) ufs_free_fragments (inode, result + newcount, request - newcount); diff --git a/trunk/fs/ufs/inode.c b/trunk/fs/ufs/inode.c index 4295ca91cf85..2fbab0aab688 100644 --- a/trunk/fs/ufs/inode.c +++ b/trunk/fs/ufs/inode.c @@ -242,8 +242,7 @@ ufs_inode_getfrag(struct inode *inode, unsigned int fragment, goal = tmp + uspi->s_fpb; tmp = ufs_new_fragments (inode, p, fragment - blockoff, goal, required + blockoff, - err, - phys != NULL ? locked_page : NULL); + err, locked_page); } /* * We will extend last allocated block @@ -251,7 +250,7 @@ ufs_inode_getfrag(struct inode *inode, unsigned int fragment, else if (lastblock == block) { tmp = ufs_new_fragments(inode, p, fragment - (blockoff - lastblockoff), fs32_to_cpu(sb, *p), required + (blockoff - lastblockoff), - err, phys != NULL ? locked_page : NULL); + err, locked_page); } else /* (lastblock > block) */ { /* * We will allocate new block before last allocated block @@ -262,8 +261,7 @@ ufs_inode_getfrag(struct inode *inode, unsigned int fragment, goal = tmp + uspi->s_fpb; } tmp = ufs_new_fragments(inode, p, fragment - blockoff, - goal, uspi->s_fpb, err, - phys != NULL ? locked_page : NULL); + goal, uspi->s_fpb, err, locked_page); } if (!tmp) { if ((!blockoff && *p) || @@ -440,11 +438,9 @@ int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buffer_head * it much more readable: */ #define GET_INODE_DATABLOCK(x) \ - ufs_inode_getfrag(inode, x, fragment, 1, &err, &phys, &new,\ - bh_result->b_page) + ufs_inode_getfrag(inode, x, fragment, 1, &err, &phys, &new, bh_result->b_page) #define GET_INODE_PTR(x) \ - ufs_inode_getfrag(inode, x, fragment, uspi->s_fpb, &err, NULL, NULL,\ - bh_result->b_page) + ufs_inode_getfrag(inode, x, fragment, uspi->s_fpb, &err, NULL, NULL, NULL) #define GET_INDIRECT_DATABLOCK(x) \ ufs_inode_getblock(inode, bh, x, fragment, \ &err, &phys, &new, bh_result->b_page) diff --git a/trunk/fs/ufs/truncate.c b/trunk/fs/ufs/truncate.c index 0437b0a6fe97..ea11d04c41a0 100644 --- a/trunk/fs/ufs/truncate.c +++ b/trunk/fs/ufs/truncate.c @@ -109,10 +109,10 @@ static int ufs_trunc_direct (struct inode * inode) tmp = fs32_to_cpu(sb, *p); if (!tmp ) ufs_panic (sb, "ufs_trunc_direct", "internal error"); - frag2 -= frag1; frag1 = ufs_fragnum (frag1); + frag2 = ufs_fragnum (frag2); - ufs_free_fragments(inode, tmp + frag1, frag2); + ufs_free_fragments (inode, tmp + frag1, frag2 - frag1); mark_inode_dirty(inode); frag_to_free = tmp + frag1; diff --git a/trunk/include/asm-alpha/dma-mapping.h b/trunk/include/asm-alpha/dma-mapping.h index 75a1aff5b57b..57e09f5e3424 100644 --- a/trunk/include/asm-alpha/dma-mapping.h +++ b/trunk/include/asm-alpha/dma-mapping.h @@ -41,9 +41,9 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, #define dma_map_single(dev, va, size, dir) virt_to_phys(va) #define dma_map_page(dev, page, off, size, dir) (page_to_pa(page) + off) -#define dma_unmap_single(dev, addr, size, dir) ((void)0) -#define dma_unmap_page(dev, addr, size, dir) ((void)0) -#define dma_unmap_sg(dev, sg, nents, dir) ((void)0) +#define dma_unmap_single(dev, addr, size, dir) do { } while (0) +#define dma_unmap_page(dev, addr, size, dir) do { } while (0) +#define dma_unmap_sg(dev, sg, nents, dir) do { } while (0) #define dma_mapping_error(addr) (0) @@ -55,14 +55,12 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dma_set_mask(struct device *dev, u64 mask); -#define dma_sync_single_for_cpu(dev, addr, size, dir) ((void)0) -#define dma_sync_single_for_device(dev, addr, size, dir) ((void)0) -#define dma_sync_single_range(dev, addr, off, size, dir) ((void)0) -#define dma_sync_sg_for_cpu(dev, sg, nents, dir) ((void)0) -#define dma_sync_sg_for_device(dev, sg, nents, dir) ((void)0) -#define dma_cache_sync(dev, va, size, dir) ((void)0) -#define dma_sync_single_range_for_cpu(dev, addr, offset, size, dir) ((void)0) -#define dma_sync_single_range_for_device(dev, addr, offset, size, dir) ((void)0) +#define dma_sync_single_for_cpu(dev, addr, size, dir) do { } while (0) +#define dma_sync_single_for_device(dev, addr, size, dir) do { } while (0) +#define dma_sync_single_range(dev, addr, off, size, dir) do { } while (0) +#define dma_sync_sg_for_cpu(dev, sg, nents, dir) do { } while (0) +#define dma_sync_sg_for_device(dev, sg, nents, dir) do { } while (0) +#define dma_cache_sync(dev, va, size, dir) do { } while (0) #define dma_get_cache_alignment() L1_CACHE_BYTES diff --git a/trunk/include/asm-alpha/unistd.h b/trunk/include/asm-alpha/unistd.h index e58a427012dd..84313d14e780 100644 --- a/trunk/include/asm-alpha/unistd.h +++ b/trunk/include/asm-alpha/unistd.h @@ -342,14 +342,9 @@ #define __NR_io_cancel 402 #define __NR_exit_group 405 #define __NR_lookup_dcookie 406 -#define __NR_epoll_create 407 -#define __NR_epoll_ctl 408 -#define __NR_epoll_wait 409 -/* Feb 2007: These three sys_epoll defines shouldn't be here but culling - * them would break userspace apps ... we'll kill them off in 2010 :) */ -#define __NR_sys_epoll_create __NR_epoll_create -#define __NR_sys_epoll_ctl __NR_epoll_ctl -#define __NR_sys_epoll_wait __NR_epoll_wait +#define __NR_sys_epoll_create 407 +#define __NR_sys_epoll_ctl 408 +#define __NR_sys_epoll_wait 409 #define __NR_remap_file_pages 410 #define __NR_set_tid_address 411 #define __NR_restart_syscall 412 diff --git a/trunk/include/asm-arm/arch-at91rm9200/at91_ecc.h b/trunk/include/asm-arm/arch-at91rm9200/at91_ecc.h index 5c564ede5c5d..fddf256a98d3 100644 --- a/trunk/include/asm-arm/arch-at91rm9200/at91_ecc.h +++ b/trunk/include/asm-arm/arch-at91rm9200/at91_ecc.h @@ -14,7 +14,7 @@ #define AT91_ECC_H #define AT91_ECC_CR (AT91_ECC + 0x00) /* Control register */ -#define AT91_ECC_RST (1 << 0) /* Reset parity */ +#define AT91_ECC_RST (1 << 0) /* Reset parity */ #define AT91_ECC_MR (AT91_ECC + 0x04) /* Mode register */ #define AT91_ECC_PAGESIZE (3 << 0) /* Page Size */ @@ -23,16 +23,16 @@ #define AT91_ECC_PAGESIZE_2112 (2) #define AT91_ECC_PAGESIZE_4224 (3) -#define AT91_ECC_SR (AT91_ECC + 0x08) /* Status register */ +#define AT91_ECC_SR (AT91_ECC + 0x08) /* Status register */ #define AT91_ECC_RECERR (1 << 0) /* Recoverable Error */ #define AT91_ECC_ECCERR (1 << 1) /* ECC Single Bit Error */ #define AT91_ECC_MULERR (1 << 2) /* Multiple Errors */ -#define AT91_ECC_PR (AT91_ECC + 0x0c) /* Parity register */ +#define AT91_ECC_PR (AT91_ECC + 0x0c) /* Parity register */ #define AT91_ECC_BITADDR (0xf << 0) /* Bit Error Address */ #define AT91_ECC_WORDADDR (0xfff << 4) /* Word Error Address */ -#define AT91_ECC_NPR (AT91_ECC + 0x10) /* NParity register */ +#define AT91_ECC_NPR (AT91_ECC + 0x10) /* NParity register */ #define AT91_ECC_NPARITY (0xffff << 0) /* NParity */ #endif diff --git a/trunk/include/asm-arm/arch-at91rm9200/at91_pmc.h b/trunk/include/asm-arm/arch-at91rm9200/at91_pmc.h index c3b489d09b6c..de8c3da74a01 100644 --- a/trunk/include/asm-arm/arch-at91rm9200/at91_pmc.h +++ b/trunk/include/asm-arm/arch-at91rm9200/at91_pmc.h @@ -61,7 +61,7 @@ #define AT91_PMC_CSS_PLLA (2 << 0) #define AT91_PMC_CSS_PLLB (3 << 0) #define AT91_PMC_PRES (7 << 2) /* Master Clock Prescaler */ -#define AT91_PMC_PRES_1 (0 << 2) +#define AT91_PMC_PRES_1 (0 << 2) #define AT91_PMC_PRES_2 (1 << 2) #define AT91_PMC_PRES_4 (2 << 2) #define AT91_PMC_PRES_8 (3 << 2) diff --git a/trunk/include/asm-arm/arch-at91rm9200/at91_rstc.h b/trunk/include/asm-arm/arch-at91rm9200/at91_rstc.h index 237d3c40b318..ccdc52da973d 100644 --- a/trunk/include/asm-arm/arch-at91rm9200/at91_rstc.h +++ b/trunk/include/asm-arm/arch-at91rm9200/at91_rstc.h @@ -17,7 +17,7 @@ #define AT91_RSTC_PROCRST (1 << 0) /* Processor Reset */ #define AT91_RSTC_PERRST (1 << 2) /* Peripheral Reset */ #define AT91_RSTC_EXTRST (1 << 3) /* External Reset */ -#define AT91_RSTC_KEY (0xff << 24) /* KEY Password */ +#define AT01_RSTC_KEY (0xff << 24) /* KEY Password */ #define AT91_RSTC_SR (AT91_RSTC + 0x04) /* Reset Controller Status Register */ #define AT91_RSTC_URSTS (1 << 0) /* User Reset Status */ diff --git a/trunk/include/asm-arm/arch-at91rm9200/at91_rtc.h b/trunk/include/asm-arm/arch-at91rm9200/at91_rtc.h index 095fe0883102..6e5065d56260 100644 --- a/trunk/include/asm-arm/arch-at91rm9200/at91_rtc.h +++ b/trunk/include/asm-arm/arch-at91rm9200/at91_rtc.h @@ -21,21 +21,21 @@ #define AT91_RTC_UPDCAL (1 << 1) /* Update Request Calendar Register */ #define AT91_RTC_TIMEVSEL (3 << 8) /* Time Event Selection */ #define AT91_RTC_TIMEVSEL_MINUTE (0 << 8) -#define AT91_RTC_TIMEVSEL_HOUR (1 << 8) -#define AT91_RTC_TIMEVSEL_DAY24 (2 << 8) -#define AT91_RTC_TIMEVSEL_DAY12 (3 << 8) +#define AT91_RTC_TIMEVSEL_HOUR (1 << 8) +#define AT91_RTC_TIMEVSEL_DAY24 (2 << 8) +#define AT91_RTC_TIMEVSEL_DAY12 (3 << 8) #define AT91_RTC_CALEVSEL (3 << 16) /* Calendar Event Selection */ -#define AT91_RTC_CALEVSEL_WEEK (0 << 16) -#define AT91_RTC_CALEVSEL_MONTH (1 << 16) -#define AT91_RTC_CALEVSEL_YEAR (2 << 16) +#define AT91_RTC_CALEVSEL_WEEK (0 << 16) +#define AT91_RTC_CALEVSEL_MONTH (1 << 16) +#define AT91_RTC_CALEVSEL_YEAR (2 << 16) #define AT91_RTC_MR (AT91_RTC + 0x04) /* Mode Register */ -#define AT91_RTC_HRMOD (1 << 0) /* 12/24 Hour Mode */ +#define AT91_RTC_HRMOD (1 << 0) /* 12/24 Hour Mode */ #define AT91_RTC_TIMR (AT91_RTC + 0x08) /* Time Register */ #define AT91_RTC_SEC (0x7f << 0) /* Current Second */ #define AT91_RTC_MIN (0x7f << 8) /* Current Minute */ -#define AT91_RTC_HOUR (0x3f << 16) /* Current Hour */ +#define AT91_RTC_HOUR (0x3f << 16) /* Current Hour */ #define AT91_RTC_AMPM (1 << 22) /* Ante Meridiem Post Meridiem Indicator */ #define AT91_RTC_CALR (AT91_RTC + 0x0c) /* Calendar Register */ diff --git a/trunk/include/asm-arm/arch-at91rm9200/at91rm9200.h b/trunk/include/asm-arm/arch-at91rm9200/at91rm9200.h index c569b6a21a42..4d51177efddd 100644 --- a/trunk/include/asm-arm/arch-at91rm9200/at91rm9200.h +++ b/trunk/include/asm-arm/arch-at91rm9200/at91rm9200.h @@ -274,7 +274,7 @@ #define AT91_PD19_TPK7 (1 << 19) /* B: ETM Trace Packet Port 7 */ #define AT91_PD20_NPCS3 (1 << 20) /* A: SPI Peripheral Chip Select 3 */ #define AT91_PD20_TPK8 (1 << 20) /* B: ETM Trace Packet Port 8 */ -#define AT91_PD21_RTS0 (1 << 21) /* A: USART Ready To Send 0 */ +#define AT91_PD21_RTS0 (1 << 21) /* A: USART Ready To Send 0 */ #define AT91_PD21_TPK9 (1 << 21) /* B: ETM Trace Packet Port 9 */ #define AT91_PD22_RTS1 (1 << 22) /* A: USART Ready To Send 1 */ #define AT91_PD22_TPK10 (1 << 22) /* B: ETM Trace Packet Port 10 */ diff --git a/trunk/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h b/trunk/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h index 78f6b4917b8b..746d973705bf 100644 --- a/trunk/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h +++ b/trunk/include/asm-arm/arch-at91rm9200/at91sam9260_matrix.h @@ -58,7 +58,7 @@ #define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x11C) /* EBI Chip Select Assignment Register */ -#define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ +#define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ #define AT91_MATRIX_CS1A_SMC (0 << 1) #define AT91_MATRIX_CS1A_SDRAMC (1 << 1) #define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */ diff --git a/trunk/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h b/trunk/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h index ec88efabbe6c..270a5dcdf1cd 100644 --- a/trunk/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h +++ b/trunk/include/asm-arm/arch-at91rm9200/at91sam9261_matrix.h @@ -15,7 +15,7 @@ #define AT91_MATRIX_MCFG (AT91_MATRIX + 0x00) /* Master Configuration Register */ #define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */ -#define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ +#define AT01_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */ #define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x04) /* Slave Configuration Register 0 */ #define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x08) /* Slave Configuration Register 1 */ @@ -43,8 +43,8 @@ #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x30) /* EBI Chip Select Assignment Register */ #define AT91_MATRIX_CS1A (1 << 1) /* Chip Select 1 Assignment */ -#define AT91_MATRIX_CS1A_SMC (0 << 1) -#define AT91_MATRIX_CS1A_SDRAMC (1 << 1) +#define AT91_MATRIX_CS1A_SMC (0 << 1) +#define AT91_MATRIX_CS1A_SDRAMC (1 << 1) #define AT91_MATRIX_CS3A (1 << 3) /* Chip Select 3 Assignment */ #define AT91_MATRIX_CS3A_SMC (0 << 3) #define AT91_MATRIX_CS3A_SMC_SMARTMEDIA (1 << 3) diff --git a/trunk/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h b/trunk/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h index 972e7531c7f4..7d94968b5d57 100644 --- a/trunk/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h +++ b/trunk/include/asm-arm/arch-at91rm9200/at91sam926x_mc.h @@ -33,14 +33,14 @@ #define AT91_SDRAMC_NC_9 (1 << 0) #define AT91_SDRAMC_NC_10 (2 << 0) #define AT91_SDRAMC_NC_11 (3 << 0) -#define AT91_SDRAMC_NR (3 << 2) /* Number of Row Bits */ +#define AT91_SDRAMC_NR (3 << 2) /* Number of Row Bits */ #define AT91_SDRAMC_NR_11 (0 << 2) #define AT91_SDRAMC_NR_12 (1 << 2) #define AT91_SDRAMC_NR_13 (2 << 2) -#define AT91_SDRAMC_NB (1 << 4) /* Number of Banks */ +#define AT91_SDRAMC_NB (1 << 4) /* Number of Banks */ #define AT91_SDRAMC_NB_2 (0 << 4) -#define AT91_SDRAMC_NB_4 (1 << 4) -#define AT91_SDRAMC_CAS (3 << 5) /* CAS Latency */ +#define AT91_SDRAMC_NB_4 (1 << 4) +#define AT91_SDRAMC_CAS (3 << 5) /* CAS Latency */ #define AT91_SDRAMC_CAS_1 (1 << 5) #define AT91_SDRAMC_CAS_2 (2 << 5) #define AT91_SDRAMC_CAS_3 (3 << 5) @@ -110,10 +110,10 @@ #define AT91_SMC_MODE(n) (AT91_SMC + 0x0c + ((n)*0x10)) /* Mode Register for CS n */ #define AT91_SMC_READMODE (1 << 0) /* Read Mode */ #define AT91_SMC_WRITEMODE (1 << 1) /* Write Mode */ -#define AT91_SMC_EXNWMODE (3 << 4) /* NWAIT Mode */ -#define AT91_SMC_EXNWMODE_DISABLE (0 << 4) -#define AT91_SMC_EXNWMODE_FROZEN (2 << 4) -#define AT91_SMC_EXNWMODE_READY (3 << 4) +#define AT91_SMC_EXNWMODE (3 << 5) /* NWAIT Mode */ +#define AT91_SMC_EXNWMODE_DISABLE (0 << 5) +#define AT91_SMC_EXNWMODE_FROZEN (2 << 5) +#define AT91_SMC_EXNWMODE_READY (3 << 5) #define AT91_SMC_BAT (1 << 8) /* Byte Access Type */ #define AT91_SMC_BAT_SELECT (0 << 8) #define AT91_SMC_BAT_WRITE (1 << 8) diff --git a/trunk/include/asm-arm/arch-s3c2410/regs-gpio.h b/trunk/include/asm-arm/arch-s3c2410/regs-gpio.h index eae91694edcd..b2893e32a236 100644 --- a/trunk/include/asm-arm/arch-s3c2410/regs-gpio.h +++ b/trunk/include/asm-arm/arch-s3c2410/regs-gpio.h @@ -52,10 +52,10 @@ /* general configuration options */ #define S3C2410_GPIO_LEAVE (0xFFFFFFFF) -#define S3C2410_GPIO_INPUT (0xFFFFFFF0) /* not available on A */ +#define S3C2410_GPIO_INPUT (0xFFFFFFF0) #define S3C2410_GPIO_OUTPUT (0xFFFFFFF1) #define S3C2410_GPIO_IRQ (0xFFFFFFF2) /* not available for all */ -#define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* bank A => addr/cs/nand */ +#define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */ #define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */ /* register address for the GPIO registers. diff --git a/trunk/include/asm-arm/arch-s3c2410/regs-mem.h b/trunk/include/asm-arm/arch-s3c2410/regs-mem.h index e4d82341f7ba..375dca50364e 100644 --- a/trunk/include/asm-arm/arch-s3c2410/regs-mem.h +++ b/trunk/include/asm-arm/arch-s3c2410/regs-mem.h @@ -133,10 +133,10 @@ #define S3C2410_BANKCON_SDRAM (0x3 << 15) /* next bits only for EDO DRAM in 6,7 */ -#define S3C2400_BANKCON_EDO_Trcd1 (0x00 << 4) -#define S3C2400_BANKCON_EDO_Trcd2 (0x01 << 4) -#define S3C2400_BANKCON_EDO_Trcd3 (0x02 << 4) -#define S3C2400_BANKCON_EDO_Trcd4 (0x03 << 4) +#define S3C2400_BANKCON_EDO_Trdc1 (0x00 << 4) +#define S3C2400_BANKCON_EDO_Trdc2 (0x01 << 4) +#define S3C2400_BANKCON_EDO_Trdc3 (0x02 << 4) +#define S3C2400_BANKCON_EDO_Trdc4 (0x03 << 4) /* CAS pulse width */ #define S3C2400_BANKCON_EDO_PULSE1 (0x00 << 3) @@ -153,9 +153,9 @@ #define S3C2400_BANKCON_EDO_SCANb11 (0x03 << 0) /* next bits only for SDRAM in 6,7 */ -#define S3C2410_BANKCON_Trcd2 (0x00 << 2) -#define S3C2410_BANKCON_Trcd3 (0x01 << 2) -#define S3C2410_BANKCON_Trcd4 (0x02 << 2) +#define S3C2410_BANKCON_Trdc2 (0x00 << 2) +#define S3C2410_BANKCON_Trdc3 (0x01 << 2) +#define S3C2410_BANKCON_Trdc4 (0x02 << 2) /* control column address select */ #define S3C2410_BANKCON_SCANb8 (0x00 << 0) diff --git a/trunk/include/asm-arm/fpstate.h b/trunk/include/asm-arm/fpstate.h index f31cda5a55ee..6af4e6bd1290 100644 --- a/trunk/include/asm-arm/fpstate.h +++ b/trunk/include/asm-arm/fpstate.h @@ -35,9 +35,6 @@ struct vfp_hard_struct { */ __u32 fpinst; __u32 fpinst2; -#ifdef CONFIG_SMP - __u32 cpu; -#endif }; union vfp_state { diff --git a/trunk/include/asm-frv/Kbuild b/trunk/include/asm-frv/Kbuild index 966a9836d556..c68e1680da01 100644 --- a/trunk/include/asm-frv/Kbuild +++ b/trunk/include/asm-frv/Kbuild @@ -1,7 +1 @@ include include/asm-generic/Kbuild.asm - -header-y += registers.h - -unifdef-y += termios.h -unifdef-y += ptrace.h -unifdef-y += page.h diff --git a/trunk/include/asm-frv/page.h b/trunk/include/asm-frv/page.h index 213d92fd652a..134cc0cdf6c2 100644 --- a/trunk/include/asm-frv/page.h +++ b/trunk/include/asm-frv/page.h @@ -76,6 +76,8 @@ extern unsigned long max_pfn; #endif /* __ASSEMBLY__ */ +#endif /* __KERNEL__ */ + #ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC #define WANT_PAGE_VIRTUAL 1 #endif @@ -83,6 +85,4 @@ extern unsigned long max_pfn; #include #include -#endif /* __KERNEL__ */ - #endif /* _ASM_PAGE_H */ diff --git a/trunk/include/asm-frv/ptrace.h b/trunk/include/asm-frv/ptrace.h index cf6934012b64..9a2241b8eb1e 100644 --- a/trunk/include/asm-frv/ptrace.h +++ b/trunk/include/asm-frv/ptrace.h @@ -12,11 +12,9 @@ #define _ASM_PTRACE_H #include -#ifdef __KERNEL__ #include #define in_syscall(regs) (((regs)->tbr & TBR_TT) == TBR_TT_TRAP0) -#endif #define PT_PSR 0 @@ -62,7 +60,6 @@ #define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */ #define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */ -#ifdef __KERNEL__ #ifndef __ASSEMBLY__ /* @@ -77,7 +74,6 @@ register struct pt_regs *__frame asm("gr28"); extern unsigned long user_stack(const struct pt_regs *); extern void show_regs(struct pt_regs *); #define profile_pc(regs) ((regs)->pc) -#endif #endif /* !__ASSEMBLY__ */ #endif /* _ASM_PTRACE_H */ diff --git a/trunk/include/asm-frv/termios.h b/trunk/include/asm-frv/termios.h index 8840cf95e8dd..b4a664e7f55c 100644 --- a/trunk/include/asm-frv/termios.h +++ b/trunk/include/asm-frv/termios.h @@ -69,8 +69,6 @@ struct termio { #define N_SYNC_PPP 14 #define N_HCI 15 /* Bluetooth HCI UART */ -#ifdef __KERNEL__ #include -#endif #endif /* _ASM_TERMIOS_H */ diff --git a/trunk/include/asm-ia64/pci.h b/trunk/include/asm-ia64/pci.h index 5160233bbfac..556f53fa44cb 100644 --- a/trunk/include/asm-ia64/pci.h +++ b/trunk/include/asm-ia64/pci.h @@ -167,10 +167,4 @@ pcibios_select_root(struct pci_dev *pdev, struct resource *res) #define pcibios_scan_all_fns(a, b) 0 -#define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ -static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) -{ - return channel ? 15 : 14; -} - #endif /* _ASM_IA64_PCI_H */ diff --git a/trunk/include/asm-m68k/uaccess.h b/trunk/include/asm-m68k/uaccess.h index 6a4cf2081512..e4c9f080ff20 100644 --- a/trunk/include/asm-m68k/uaccess.h +++ b/trunk/include/asm-m68k/uaccess.h @@ -7,7 +7,6 @@ #include #include #include -#include #include #define VERIFY_READ 0 diff --git a/trunk/include/asm-mips/pgtable.h b/trunk/include/asm-mips/pgtable.h index 3fcfd7979de5..f2e1325fec6c 100644 --- a/trunk/include/asm-mips/pgtable.h +++ b/trunk/include/asm-mips/pgtable.h @@ -69,6 +69,16 @@ extern unsigned long zero_page_mask; #define ZERO_PAGE(vaddr) \ (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))) +#define __HAVE_ARCH_MOVE_PTE +#define move_pte(pte, prot, old_addr, new_addr) \ +({ \ + pte_t newpte = (pte); \ + if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \ + pte_page(pte) == ZERO_PAGE(old_addr)) \ + newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \ + newpte; \ +}) + extern void paging_init(void); /* diff --git a/trunk/include/asm-powerpc/dma-mapping.h b/trunk/include/asm-powerpc/dma-mapping.h index a19a6f1a1cf1..7c7de87bd8ae 100644 --- a/trunk/include/asm-powerpc/dma-mapping.h +++ b/trunk/include/asm-powerpc/dma-mapping.h @@ -37,9 +37,9 @@ extern void __dma_sync_page(struct page *page, unsigned long offset, */ #define __dma_alloc_coherent(gfp, size, handle) NULL -#define __dma_free_coherent(size, addr) ((void)0) -#define __dma_sync(addr, size, rw) ((void)0) -#define __dma_sync_page(pg, off, sz, rw) ((void)0) +#define __dma_free_coherent(size, addr) do { } while (0) +#define __dma_sync(addr, size, rw) do { } while (0) +#define __dma_sync_page(pg, off, sz, rw) do { } while (0) #endif /* ! CONFIG_NOT_COHERENT_CACHE */ @@ -251,7 +251,7 @@ dma_map_single(struct device *dev, void *ptr, size_t size, } /* We do nothing. */ -#define dma_unmap_single(dev, addr, size, dir) ((void)0) +#define dma_unmap_single(dev, addr, size, dir) do { } while (0) static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, @@ -266,7 +266,7 @@ dma_map_page(struct device *dev, struct page *page, } /* We do nothing. */ -#define dma_unmap_page(dev, handle, size, dir) ((void)0) +#define dma_unmap_page(dev, handle, size, dir) do { } while (0) static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, @@ -286,7 +286,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, } /* We don't do anything here. */ -#define dma_unmap_sg(dev, sg, nents, dir) ((void)0) +#define dma_unmap_sg(dev, sg, nents, dir) do { } while (0) #endif /* CONFIG_PPC64 */ diff --git a/trunk/include/asm-sparc/checksum.h b/trunk/include/asm-sparc/checksum.h index 34518ea7bf1b..267e631e9bbc 100644 --- a/trunk/include/asm-sparc/checksum.h +++ b/trunk/include/asm-sparc/checksum.h @@ -151,7 +151,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) "xnor\t%%g0, %0, %0" : "=r" (sum), "=&r" (iph) : "r" (ihl), "1" (iph) - : "g2", "g3", "g4", "cc", "memory"); + : "g2", "g3", "g4", "cc"); return sum; } diff --git a/trunk/include/asm-um/pgtable.h b/trunk/include/asm-um/pgtable.h index e57ff136ee51..188f72621776 100644 --- a/trunk/include/asm-um/pgtable.h +++ b/trunk/include/asm-um/pgtable.h @@ -408,15 +408,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) #include -#ifdef CONFIG_HIGHMEM -/* Clear a kernel PTE and flush it from the TLB */ -#define kpte_clear_flush(ptep, vaddr) \ -do { \ - pte_clear(&init_mm, vaddr, ptep); \ - __flush_tlb_one(vaddr); \ -} while (0) -#endif - #endif #endif diff --git a/trunk/include/asm-x86_64/dma-mapping.h b/trunk/include/asm-x86_64/dma-mapping.h index 49dbab09ef2b..be9ec6890723 100644 --- a/trunk/include/asm-x86_64/dma-mapping.h +++ b/trunk/include/asm-x86_64/dma-mapping.h @@ -63,9 +63,6 @@ static inline int dma_mapping_error(dma_addr_t dma_addr) return (dma_addr == bad_dma_address); } -#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) -#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) - extern void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp); extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr, diff --git a/trunk/include/linux/cdev.h b/trunk/include/linux/cdev.h index 1e29b13d0062..f309b00e986e 100644 --- a/trunk/include/linux/cdev.h +++ b/trunk/include/linux/cdev.h @@ -6,10 +6,6 @@ #include #include -struct file_operations; -struct inode; -struct module; - struct cdev { struct kobject kobj; struct module *owner; diff --git a/trunk/include/linux/efi.h b/trunk/include/linux/efi.h index f8ebd7c1ddb3..df1c91855f0e 100644 --- a/trunk/include/linux/efi.h +++ b/trunk/include/linux/efi.h @@ -301,7 +301,7 @@ extern int __init efi_uart_console_only (void); extern void efi_initialize_iomem_resources(struct resource *code_resource, struct resource *data_resource); extern unsigned long efi_get_time(void); -extern int efi_set_rtc_mmss(unsigned long nowtime); +extern int __init efi_set_rtc_mmss(unsigned long nowtime); extern int is_available_memory(efi_memory_desc_t * md); extern struct efi_memory_map memmap; diff --git a/trunk/include/linux/hdreg.h b/trunk/include/linux/hdreg.h index 818c6afc1091..2b54eac738ea 100644 --- a/trunk/include/linux/hdreg.h +++ b/trunk/include/linux/hdreg.h @@ -60,15 +60,13 @@ #define TAG_MASK 0xf8 #endif /* __KERNEL__ */ -#include - /* * Command Header sizes for IOCTL commands */ -#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(__u8)) -#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(__u8)) -#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(__u8)) +#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(u8)) +#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(u8)) +#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(u8)) #define IDE_DRIVE_TASK_INVALID -1 #define IDE_DRIVE_TASK_NO_DATA 0 diff --git a/trunk/include/linux/hid.h b/trunk/include/linux/hid.h index 342b4e639acb..770120add15a 100644 --- a/trunk/include/linux/hid.h +++ b/trunk/include/linux/hid.h @@ -438,6 +438,7 @@ struct hid_device { /* device report descriptor */ struct hid_usage *, __s32); void (*hiddev_report_event) (struct hid_device *, struct hid_report *); #ifdef CONFIG_USB_HIDINPUT_POWERBOOK + unsigned int pb_fnmode; unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; #endif diff --git a/trunk/include/linux/i2o-dev.h b/trunk/include/linux/i2o-dev.h index a0b23dd45239..c2519df1b6dc 100644 --- a/trunk/include/linux/i2o-dev.h +++ b/trunk/include/linux/i2o-dev.h @@ -24,13 +24,12 @@ #define MAX_I2O_CONTROLLERS 32 #include -#include /* * I2O Control IOCTLs and structures */ #define I2O_MAGIC_NUMBER 'i' -#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,__u8[MAX_I2O_CONTROLLERS]) +#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,u8[MAX_I2O_CONTROLLERS]) #define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct) #define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct) #define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget) @@ -38,7 +37,7 @@ #define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer) #define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer) #define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer) -#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,__u32) +#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,u32) #define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html) #define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id) #define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info) diff --git a/trunk/include/linux/libata.h b/trunk/include/linux/libata.h index 91bb8ceef0b5..22aa69e20905 100644 --- a/trunk/include/linux/libata.h +++ b/trunk/include/linux/libata.h @@ -1054,8 +1054,6 @@ static inline void ata_pause(struct ata_port *ap) /** * ata_busy_wait - Wait for a port status register * @ap: Port to wait for. - * @bits: bits that must be clear - * @max: number of 10uS waits to perform * * Waits up to max*10 microseconds for the selected bits in the port's * status register to be cleared. diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h index 3d1d21035dec..f7a416c52edc 100644 --- a/trunk/include/linux/pci_ids.h +++ b/trunk/include/linux/pci_ids.h @@ -1277,13 +1277,13 @@ #define PCI_DEVICE_ID_VIA_3296_0 0x0296 #define PCI_DEVICE_ID_VIA_8363_0 0x0305 #define PCI_DEVICE_ID_VIA_P4M800CE 0x0314 -#define PCI_DEVICE_ID_VIA_P4M890 0x0327 -#define PCI_DEVICE_ID_VIA_VT3336 0x0336 +#define PCI_DEVICE_ID_VIA_K8M890CE 0x0336 #define PCI_DEVICE_ID_VIA_8371_0 0x0391 #define PCI_DEVICE_ID_VIA_8501_0 0x0501 #define PCI_DEVICE_ID_VIA_82C561 0x0561 #define PCI_DEVICE_ID_VIA_82C586_1 0x0571 #define PCI_DEVICE_ID_VIA_82C576 0x0576 +#define PCI_DEVICE_ID_VIA_SATA_EIDE 0x0581 #define PCI_DEVICE_ID_VIA_82C586_0 0x0586 #define PCI_DEVICE_ID_VIA_82C596 0x0596 #define PCI_DEVICE_ID_VIA_82C597_0 0x0597 @@ -1326,8 +1326,6 @@ #define PCI_DEVICE_ID_VIA_8237 0x3227 #define PCI_DEVICE_ID_VIA_8251 0x3287 #define PCI_DEVICE_ID_VIA_8237A 0x3337 -#define PCI_DEVICE_ID_VIA_8237S 0x3372 -#define PCI_DEVICE_ID_VIA_SATA_EIDE 0x5324 #define PCI_DEVICE_ID_VIA_8231 0x8231 #define PCI_DEVICE_ID_VIA_8231_4 0x8235 #define PCI_DEVICE_ID_VIA_8365_1 0x8305 diff --git a/trunk/include/linux/pid_namespace.h b/trunk/include/linux/pid_namespace.h index 2833806d42c6..d2a9d419f01f 100644 --- a/trunk/include/linux/pid_namespace.h +++ b/trunk/include/linux/pid_namespace.h @@ -39,7 +39,7 @@ static inline void put_pid_ns(struct pid_namespace *ns) static inline struct task_struct *child_reaper(struct task_struct *tsk) { - return init_pid_ns.child_reaper; + return tsk->nsproxy->pid_ns->child_reaper; } #endif /* _LINUX_PID_NS_H */ diff --git a/trunk/include/sound/core.h b/trunk/include/sound/core.h index 521f036cce99..a994bea09cd6 100644 --- a/trunk/include/sound/core.h +++ b/trunk/include/sound/core.h @@ -132,10 +132,8 @@ struct snd_card { int shutdown; /* this card is going down */ int free_on_last_close; /* free in context of file_release */ wait_queue_head_t shutdown_sleep; - struct device *dev; /* device assigned to this card */ -#ifndef CONFIG_SYSFS_DEPRECATED - struct device *card_dev; /* cardX object for sysfs */ -#endif + struct device *parent; + struct device *dev; #ifdef CONFIG_PM unsigned int power_state; /* power state */ @@ -193,16 +191,6 @@ struct snd_minor { struct device *dev; /* device for sysfs */ }; -/* return a device pointer linked to each sound device as a parent */ -static inline struct device *snd_card_get_device_link(struct snd_card *card) -{ -#ifdef CONFIG_SYSFS_DEPRECATED - return card ? card->dev : NULL; -#else - return card ? card->card_dev : NULL; -#endif -} - /* sound.c */ extern int snd_major; @@ -269,7 +257,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file); int snd_card_file_remove(struct snd_card *card, struct file *file); #ifndef snd_card_set_dev -#define snd_card_set_dev(card,devptr) ((card)->dev = (devptr)) +#define snd_card_set_dev(card,devptr) ((card)->parent = (devptr)) #endif /* device.c */ diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index fec12eb12471..35401720635b 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -938,8 +938,8 @@ fastcall NORET_TYPE void do_exit(long code) tsk->exit_code = code; proc_exit_connector(tsk); - exit_task_namespaces(tsk); exit_notify(tsk); + exit_task_namespaces(tsk); #ifdef CONFIG_NUMA mpol_free(tsk->mempolicy); tsk->mempolicy = NULL; diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index d57118da73ff..fc723e595cd5 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -1313,7 +1313,7 @@ noinline struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_re return regs; } -struct task_struct * __cpuinit fork_idle(int cpu) +struct task_struct * __devinit fork_idle(int cpu) { struct task_struct *task; struct pt_regs regs; diff --git a/trunk/kernel/kprobes.c b/trunk/kernel/kprobes.c index 6fcf8dd148d0..17ec4afb0994 100644 --- a/trunk/kernel/kprobes.c +++ b/trunk/kernel/kprobes.c @@ -87,12 +87,6 @@ struct kprobe_insn_page { int ngarbage; }; -enum kprobe_slot_state { - SLOT_CLEAN = 0, - SLOT_DIRTY = 1, - SLOT_USED = 2, -}; - static struct hlist_head kprobe_insn_pages; static int kprobe_garbage_slots; static int collect_garbage_slots(void); @@ -136,8 +130,8 @@ kprobe_opcode_t __kprobes *get_insn_slot(void) if (kip->nused < INSNS_PER_PAGE) { int i; for (i = 0; i < INSNS_PER_PAGE; i++) { - if (kip->slot_used[i] == SLOT_CLEAN) { - kip->slot_used[i] = SLOT_USED; + if (!kip->slot_used[i]) { + kip->slot_used[i] = 1; kip->nused++; return kip->insns + (i * MAX_INSN_SIZE); } @@ -169,8 +163,8 @@ kprobe_opcode_t __kprobes *get_insn_slot(void) } INIT_HLIST_NODE(&kip->hlist); hlist_add_head(&kip->hlist, &kprobe_insn_pages); - memset(kip->slot_used, SLOT_CLEAN, INSNS_PER_PAGE); - kip->slot_used[0] = SLOT_USED; + memset(kip->slot_used, 0, INSNS_PER_PAGE); + kip->slot_used[0] = 1; kip->nused = 1; kip->ngarbage = 0; return kip->insns; @@ -179,7 +173,7 @@ kprobe_opcode_t __kprobes *get_insn_slot(void) /* Return 1 if all garbages are collected, otherwise 0. */ static int __kprobes collect_one_slot(struct kprobe_insn_page *kip, int idx) { - kip->slot_used[idx] = SLOT_CLEAN; + kip->slot_used[idx] = 0; kip->nused--; if (kip->nused == 0) { /* @@ -218,7 +212,7 @@ static int __kprobes collect_garbage_slots(void) continue; kip->ngarbage = 0; /* we will collect all garbages */ for (i = 0; i < INSNS_PER_PAGE; i++) { - if (kip->slot_used[i] == SLOT_DIRTY && + if (kip->slot_used[i] == -1 && collect_one_slot(kip, i)) break; } @@ -238,7 +232,7 @@ void __kprobes free_insn_slot(kprobe_opcode_t * slot, int dirty) slot < kip->insns + (INSNS_PER_PAGE * MAX_INSN_SIZE)) { int i = (slot - kip->insns) / MAX_INSN_SIZE; if (dirty) { - kip->slot_used[i] = SLOT_DIRTY; + kip->slot_used[i] = -1; kip->ngarbage++; } else { collect_one_slot(kip, i); diff --git a/trunk/kernel/pid.c b/trunk/kernel/pid.c index 78f2aee90f54..2efe9d8d367b 100644 --- a/trunk/kernel/pid.c +++ b/trunk/kernel/pid.c @@ -197,7 +197,7 @@ fastcall void free_pid(struct pid *pid) hlist_del_rcu(&pid->pid_chain); spin_unlock_irqrestore(&pidmap_lock, flags); - free_pidmap(&init_pid_ns, pid->nr); + free_pidmap(current->nsproxy->pid_ns, pid->nr); call_rcu(&pid->rcu, delayed_put_pid); } diff --git a/trunk/mm/filemap_xip.c b/trunk/mm/filemap_xip.c index 9dd9fbb75139..45b3553865cf 100644 --- a/trunk/mm/filemap_xip.c +++ b/trunk/mm/filemap_xip.c @@ -183,7 +183,7 @@ __xip_unmap (struct address_space * mapping, address = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT); BUG_ON(address < vma->vm_start || address >= vma->vm_end); - page = ZERO_PAGE(0); + page = ZERO_PAGE(address); pte = page_check_address(page, mm, address, &ptl); if (pte) { /* Nuke the page table entry. */ @@ -246,7 +246,7 @@ xip_file_nopage(struct vm_area_struct * area, __xip_unmap(mapping, pgoff); } else { /* not shared and writable, use ZERO_PAGE() */ - page = ZERO_PAGE(0); + page = ZERO_PAGE(address); } out: diff --git a/trunk/mm/mmap.c b/trunk/mm/mmap.c index cc3a20819457..9717337293c3 100644 --- a/trunk/mm/mmap.c +++ b/trunk/mm/mmap.c @@ -1477,7 +1477,6 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un { struct mm_struct *mm = vma->vm_mm; struct rlimit *rlim = current->signal->rlim; - unsigned long new_start; /* address space limit tests */ if (!may_expand_vm(mm, grow)) @@ -1497,12 +1496,6 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un return -ENOMEM; } - /* Check to ensure the stack will not grow into a hugetlb-only region */ - new_start = (vma->vm_flags & VM_GROWSUP) ? vma->vm_start : - vma->vm_end - size; - if (is_hugepage_only_range(vma->vm_mm, new_start, size)) - return -EFAULT; - /* * Overcommit.. This must be the final test, as it will * update security statistics. diff --git a/trunk/mm/mremap.c b/trunk/mm/mremap.c index 5d4bd4f95b8e..9c769fa29f32 100644 --- a/trunk/mm/mremap.c +++ b/trunk/mm/mremap.c @@ -105,6 +105,7 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, if (pte_none(*old_pte)) continue; pte = ptep_clear_flush(vma, old_addr, old_pte); + /* ZERO_PAGE can be dependant on virtual addr */ pte = move_pte(pte, new_vma->vm_page_prot, old_addr, new_addr); set_pte_at(mm, new_addr, new_pte, pte); } diff --git a/trunk/mm/page-writeback.c b/trunk/mm/page-writeback.c index be0efbde4994..1d2fc89ca56d 100644 --- a/trunk/mm/page-writeback.c +++ b/trunk/mm/page-writeback.c @@ -133,9 +133,11 @@ get_dirty_limits(long *pbackground, long *pdirty, #ifdef CONFIG_HIGHMEM /* - * We always exclude high memory from our count. + * If this mapping can only allocate from low memory, + * we exclude high memory from our count. */ - available_memory -= totalhigh_pages; + if (mapping && !(mapping_gfp_mask(mapping) & __GFP_HIGHMEM)) + available_memory -= totalhigh_pages; #endif @@ -524,25 +526,28 @@ static struct notifier_block __cpuinitdata ratelimit_nb = { }; /* - * Called early on to tune the page writeback dirty limits. - * - * We used to scale dirty pages according to how total memory - * related to pages that could be allocated for buffers (by - * comparing nr_free_buffer_pages() to vm_total_pages. - * - * However, that was when we used "dirty_ratio" to scale with - * all memory, and we don't do that any more. "dirty_ratio" - * is now applied to total non-HIGHPAGE memory (by subtracting - * totalhigh_pages from vm_total_pages), and as such we can't - * get into the old insane situation any more where we had - * large amounts of dirty pages compared to a small amount of - * non-HIGHMEM memory. - * - * But we might still want to scale the dirty_ratio by how - * much memory the box has.. + * If the machine has a large highmem:lowmem ratio then scale back the default + * dirty memory thresholds: allowing too much dirty highmem pins an excessive + * number of buffer_heads. */ void __init page_writeback_init(void) { + long buffer_pages = nr_free_buffer_pages(); + long correction; + + correction = (100 * 4 * buffer_pages) / vm_total_pages; + + if (correction < 100) { + dirty_background_ratio *= correction; + dirty_background_ratio /= 100; + vm_dirty_ratio *= correction; + vm_dirty_ratio /= 100; + + if (dirty_background_ratio <= 0) + dirty_background_ratio = 1; + if (vm_dirty_ratio <= 0) + vm_dirty_ratio = 1; + } mod_timer(&wb_timer, jiffies + dirty_writeback_interval); writeback_set_ratelimit(); register_cpu_notifier(&ratelimit_nb); diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index 2c606cc922a5..fc5b5442e942 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -989,7 +989,8 @@ int zone_watermark_ok(struct zone *z, int order, unsigned long mark, int classzone_idx, int alloc_flags) { /* free_pages my go negative - that's OK */ - long min = mark, free_pages = z->free_pages - (1 << order) + 1; + unsigned long min = mark; + long free_pages = z->free_pages - (1 << order) + 1; int o; if (alloc_flags & ALLOC_HIGH) diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c b/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c index 7f70b0886b83..6f31fad9be13 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_netlink.c @@ -374,11 +374,9 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, && ctnetlink_dump_helpinfo(skb, ct) < 0) goto nfattr_failure; -#ifdef CONFIG_IP_NF_CONNTRACK_MARK if ((events & IPCT_MARK || ct->mark) && ctnetlink_dump_mark(skb, ct) < 0) goto nfattr_failure; -#endif if (events & IPCT_COUNTER_FILLING && (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 || diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_sip.c b/trunk/net/ipv4/netfilter/ip_conntrack_sip.c index 11c588a10e6b..3a26d63eed88 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_sip.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_sip.c @@ -283,16 +283,10 @@ static int skp_epaddr_len(const char *dptr, const char *limit, int *shift) { int s = *shift; - /* Search for @, but stop at the end of the line. - * We are inside a sip: URI, so we don't need to worry about - * continuation lines. */ - while (dptr <= limit && - *dptr != '@' && *dptr != '\r' && *dptr != '\n') { + for (; dptr <= limit && *dptr != '@'; dptr++) (*shift)++; - dptr++; - } - if (dptr <= limit && *dptr == '@') { + if (*dptr == '@') { dptr++; (*shift)++; } else diff --git a/trunk/net/ipv6/addrconf.c b/trunk/net/ipv6/addrconf.c index e3854696988d..2a7e4618f526 100644 --- a/trunk/net/ipv6/addrconf.c +++ b/trunk/net/ipv6/addrconf.c @@ -3393,7 +3393,7 @@ static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, #ifdef CONFIG_IPV6_ROUTER_PREF array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref; array[DEVCONF_RTR_PROBE_INTERVAL] = cnf->rtr_probe_interval; -#ifdef CONFIG_IPV6_ROUTE_INFO +#ifdef CONFIV_IPV6_ROUTE_INFO array[DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = cnf->accept_ra_rt_info_max_plen; #endif #endif @@ -3898,7 +3898,7 @@ static struct addrconf_sysctl_table .proc_handler = &proc_dointvec_jiffies, .strategy = &sysctl_jiffies, }, -#ifdef CONFIG_IPV6_ROUTE_INFO +#ifdef CONFIV_IPV6_ROUTE_INFO { .ctl_name = NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, .procname = "accept_ra_rt_info_max_plen", diff --git a/trunk/net/ipv6/ndisc.c b/trunk/net/ipv6/ndisc.c index 39bb658f3c44..6a9f616de37d 100644 --- a/trunk/net/ipv6/ndisc.c +++ b/trunk/net/ipv6/ndisc.c @@ -1413,13 +1413,6 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, return; } - if (!ipv6_addr_equal(&skb->nh.ipv6h->daddr, target) && - !(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) { - ND_PRINTK2(KERN_WARNING - "ICMPv6 Redirect: target address is not link-local.\n"); - return; - } - ndisc_flow_init(&fl, NDISC_REDIRECT, &saddr_buf, &skb->nh.ipv6h->saddr, dev->ifindex); diff --git a/trunk/net/netfilter/Kconfig b/trunk/net/netfilter/Kconfig index 80107d4909c5..cd10e44db015 100644 --- a/trunk/net/netfilter/Kconfig +++ b/trunk/net/netfilter/Kconfig @@ -165,7 +165,7 @@ config NF_CONNTRACK_FTP config NF_CONNTRACK_H323 tristate "H.323 protocol support (EXPERIMENTAL)" - depends on EXPERIMENTAL && NF_CONNTRACK && (IPV6 || IPV6=n) + depends on EXPERIMENTAL && NF_CONNTRACK help H.323 is a VoIP signalling protocol from ITU-T. As one of the most important VoIP protocols, it is widely used by voice hardware and @@ -628,7 +628,7 @@ config NETFILTER_XT_MATCH_TCPMSS config NETFILTER_XT_MATCH_HASHLIMIT tristate '"hashlimit" match support' - depends on NETFILTER_XTABLES && (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n) + depends on NETFILTER_XTABLES help This option adds a `hashlimit' match. diff --git a/trunk/net/netfilter/nf_conntrack_netlink.c b/trunk/net/netfilter/nf_conntrack_netlink.c index c64f029f7052..811e3e782f0f 100644 --- a/trunk/net/netfilter/nf_conntrack_netlink.c +++ b/trunk/net/netfilter/nf_conntrack_netlink.c @@ -389,11 +389,9 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, && ctnetlink_dump_helpinfo(skb, ct) < 0) goto nfattr_failure; -#ifdef CONFIG_NF_CONNTRACK_MARK if ((events & IPCT_MARK || ct->mark) && ctnetlink_dump_mark(skb, ct) < 0) goto nfattr_failure; -#endif if (events & IPCT_COUNTER_FILLING && (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 || diff --git a/trunk/net/netfilter/nf_conntrack_sip.c b/trunk/net/netfilter/nf_conntrack_sip.c index 9dec11534678..eb2a2411f97b 100644 --- a/trunk/net/netfilter/nf_conntrack_sip.c +++ b/trunk/net/netfilter/nf_conntrack_sip.c @@ -303,16 +303,10 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr, { int s = *shift; - /* Search for @, but stop at the end of the line. - * We are inside a sip: URI, so we don't need to worry about - * continuation lines. */ - while (dptr <= limit && - *dptr != '@' && *dptr != '\r' && *dptr != '\n') { + for (; dptr <= limit && *dptr != '@'; dptr++) (*shift)++; - dptr++; - } - if (dptr <= limit && *dptr == '@') { + if (*dptr == '@') { dptr++; (*shift)++; } else diff --git a/trunk/net/netfilter/xt_connbytes.c b/trunk/net/netfilter/xt_connbytes.c index 5e32dfa2668b..d93cb096a675 100644 --- a/trunk/net/netfilter/xt_connbytes.c +++ b/trunk/net/netfilter/xt_connbytes.c @@ -52,8 +52,6 @@ match(const struct sk_buff *skb, { const struct xt_connbytes_info *sinfo = matchinfo; u_int64_t what = 0; /* initialize to make gcc happy */ - u_int64_t bytes = 0; - u_int64_t pkts = 0; const struct ip_conntrack_counter *counters; if (!(counters = nf_ct_get_counters(skb))) @@ -91,22 +89,29 @@ match(const struct sk_buff *skb, case XT_CONNBYTES_AVGPKT: switch (sinfo->direction) { case XT_CONNBYTES_DIR_ORIGINAL: - bytes = counters[IP_CT_DIR_ORIGINAL].bytes; - pkts = counters[IP_CT_DIR_ORIGINAL].packets; + what = div64_64(counters[IP_CT_DIR_ORIGINAL].bytes, + counters[IP_CT_DIR_ORIGINAL].packets); break; case XT_CONNBYTES_DIR_REPLY: - bytes = counters[IP_CT_DIR_REPLY].bytes; - pkts = counters[IP_CT_DIR_REPLY].packets; + what = div64_64(counters[IP_CT_DIR_REPLY].bytes, + counters[IP_CT_DIR_REPLY].packets); break; case XT_CONNBYTES_DIR_BOTH: - bytes = counters[IP_CT_DIR_ORIGINAL].bytes + - counters[IP_CT_DIR_REPLY].bytes; - pkts = counters[IP_CT_DIR_ORIGINAL].packets + - counters[IP_CT_DIR_REPLY].packets; + { + u_int64_t bytes; + u_int64_t pkts; + bytes = counters[IP_CT_DIR_ORIGINAL].bytes + + counters[IP_CT_DIR_REPLY].bytes; + pkts = counters[IP_CT_DIR_ORIGINAL].packets+ + counters[IP_CT_DIR_REPLY].packets; + + /* FIXME_THEORETICAL: what to do if sum + * overflows ? */ + + what = div64_64(bytes, pkts); + } break; } - if (pkts != 0) - what = div64_64(bytes, pkts); break; } diff --git a/trunk/net/sched/act_ipt.c b/trunk/net/sched/act_ipt.c index 01e69138578d..a9608064a4c3 100644 --- a/trunk/net/sched/act_ipt.c +++ b/trunk/net/sched/act_ipt.c @@ -55,8 +55,7 @@ static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int struct ipt_target *target; int ret = 0; - target = xt_request_find_target(AF_INET, t->u.user.name, - t->u.user.revision); + target = xt_find_target(AF_INET, t->u.user.name, t->u.user.revision); if (!target) return -ENOENT; @@ -64,10 +63,9 @@ static int ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int ret = xt_check_target(target, AF_INET, t->u.target_size - sizeof(*t), table, hook, 0, 0); - if (ret) { - module_put(t->u.kernel.target->me); + if (ret) return ret; - } + if (t->u.kernel.target->checkentry && !t->u.kernel.target->checkentry(table, NULL, t->u.kernel.target, t->data, diff --git a/trunk/net/sctp/sm_sideeffect.c b/trunk/net/sctp/sm_sideeffect.c index 6db77d1329f7..8bd30976cdee 100644 --- a/trunk/net/sctp/sm_sideeffect.c +++ b/trunk/net/sctp/sm_sideeffect.c @@ -621,13 +621,7 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds, /* The receiver of the HEARTBEAT ACK should also perform an * RTT measurement for that destination transport address * using the time value carried in the HEARTBEAT ACK chunk. - * If the transport's rto_pending variable has been cleared, - * it was most likely due to a retransmit. However, we want - * to re-enable it to properly update the rto. */ - if (t->rto_pending == 0) - t->rto_pending = 1; - hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data; sctp_transport_update_rto(t, (jiffies - hbinfo->sent_at)); diff --git a/trunk/net/sunrpc/svc.c b/trunk/net/sunrpc/svc.c index 4c1611211119..bf21a2047010 100644 --- a/trunk/net/sunrpc/svc.c +++ b/trunk/net/sunrpc/svc.c @@ -26,6 +26,7 @@ #include #define RPCDBG_FACILITY RPCDBG_SVCDSP +#define RPC_PARANOIA 1 /* * Mode for mapping cpus to pools. @@ -871,15 +872,15 @@ svc_process(struct svc_rqst *rqstp) return 0; err_short_len: - if (net_ratelimit()) - printk("svc: short len %Zd, dropping request\n", argv->iov_len); - +#ifdef RPC_PARANOIA + printk("svc: short len %Zd, dropping request\n", argv->iov_len); +#endif goto dropit; /* drop request */ err_bad_dir: - if (net_ratelimit()) - printk("svc: bad direction %d, dropping request\n", dir); - +#ifdef RPC_PARANOIA + printk("svc: bad direction %d, dropping request\n", dir); +#endif serv->sv_stats->rpcbadfmt++; goto dropit; /* drop request */ @@ -908,10 +909,10 @@ svc_process(struct svc_rqst *rqstp) goto sendit; err_bad_vers: - if (net_ratelimit()) - printk("svc: unknown version (%d for prog %d, %s)\n", - vers, prog, progp->pg_name); - +#ifdef RPC_PARANOIA + printk("svc: unknown version (%d for prog %d, %s)\n", + vers, prog, progp->pg_name); +#endif serv->sv_stats->rpcbadfmt++; svc_putnl(resv, RPC_PROG_MISMATCH); svc_putnl(resv, progp->pg_lovers); @@ -919,17 +920,17 @@ svc_process(struct svc_rqst *rqstp) goto sendit; err_bad_proc: - if (net_ratelimit()) - printk("svc: unknown procedure (%d)\n", proc); - +#ifdef RPC_PARANOIA + printk("svc: unknown procedure (%d)\n", proc); +#endif serv->sv_stats->rpcbadfmt++; svc_putnl(resv, RPC_PROC_UNAVAIL); goto sendit; err_garbage: - if (net_ratelimit()) - printk("svc: failed to decode args\n"); - +#ifdef RPC_PARANOIA + printk("svc: failed to decode args\n"); +#endif rpc_stat = rpc_garbage_args; err_bad: serv->sv_stats->rpcbadfmt++; diff --git a/trunk/net/sunrpc/svcsock.c b/trunk/net/sunrpc/svcsock.c index ff1f8bf680aa..45120f268d03 100644 --- a/trunk/net/sunrpc/svcsock.c +++ b/trunk/net/sunrpc/svcsock.c @@ -1062,19 +1062,15 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp) * bit set in the fragment length header. * But apparently no known nfs clients send fragmented * records. */ - if (net_ratelimit()) - printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx" - " (non-terminal)\n", - (unsigned long) svsk->sk_reclen); + printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx (non-terminal)\n", + (unsigned long) svsk->sk_reclen); goto err_delete; } svsk->sk_reclen &= 0x7fffffff; dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen); if (svsk->sk_reclen > serv->sv_max_mesg) { - if (net_ratelimit()) - printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx" - " (large)\n", - (unsigned long) svsk->sk_reclen); + printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx (large)\n", + (unsigned long) svsk->sk_reclen); goto err_delete; } } diff --git a/trunk/scripts/Makefile.headersinst b/trunk/scripts/Makefile.headersinst index f7b6705fd6a3..4241e0dfeeaf 100644 --- a/trunk/scripts/Makefile.headersinst +++ b/trunk/scripts/Makefile.headersinst @@ -109,7 +109,7 @@ quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) quiet_cmd_gen = GEN $(patsubst $(INSTALL_HDR_PATH)/%,%,$@) cmd_gen = \ FNAME=$(patsubst $(INSTALL_HDR_PATH)/$(_dst)/%,%,$@) \ -STUBDEF=__ASM_STUB_`echo $$FNAME | tr a-z.- A-Z__`; \ +STUBDEF=__ASM_STUB_`echo $$FNAME | tr a-z. A-Z_`; \ (echo "/* File autogenerated by 'make headers_install' */" ; \ echo "\#ifndef $$STUBDEF" ; \ echo "\#define $$STUBDEF" ; \ diff --git a/trunk/sound/core/init.c b/trunk/sound/core/init.c index a4cc6b155ae9..6152a7554dfd 100644 --- a/trunk/sound/core/init.c +++ b/trunk/sound/core/init.c @@ -361,10 +361,8 @@ static int snd_card_do_free(struct snd_card *card) snd_printk(KERN_WARNING "unable to free card info\n"); /* Not fatal error */ } -#ifndef CONFIG_SYSFS_DEPRECATED - if (card->card_dev) - device_unregister(card->card_dev); -#endif + if (card->dev) + device_unregister(card->dev); kfree(card); return 0; } @@ -499,14 +497,12 @@ int snd_card_register(struct snd_card *card) int err; snd_assert(card != NULL, return -EINVAL); -#ifndef CONFIG_SYSFS_DEPRECATED - if (!card->card_dev) { - card->card_dev = device_create(sound_class, card->dev, 0, - "card%i", card->number); - if (IS_ERR(card->card_dev)) - card->card_dev = NULL; + if (!card->dev) { + card->dev = device_create(sound_class, card->parent, 0, + "card%i", card->number); + if (IS_ERR(card->dev)) + card->dev = NULL; } -#endif if ((err = snd_device_register_all(card)) < 0) return err; mutex_lock(&snd_card_mutex); diff --git a/trunk/sound/core/sound.c b/trunk/sound/core/sound.c index 82a61c67cf3a..282742022de6 100644 --- a/trunk/sound/core/sound.c +++ b/trunk/sound/core/sound.c @@ -238,7 +238,7 @@ int snd_register_device(int type, struct snd_card *card, int dev, { int minor; struct snd_minor *preg; - struct device *device = snd_card_get_device_link(card); + struct device *device = NULL; snd_assert(name, return -EINVAL); preg = kmalloc(sizeof *preg, GFP_KERNEL); @@ -263,6 +263,8 @@ int snd_register_device(int type, struct snd_card *card, int dev, return minor; } snd_minors[minor] = preg; + if (card) + device = card->dev; preg->dev = device_create(sound_class, device, MKDEV(major, minor), "%s", name); if (preg->dev) diff --git a/trunk/sound/core/sound_oss.c b/trunk/sound/core/sound_oss.c index 4566df41912a..b2fc40aa520b 100644 --- a/trunk/sound/core/sound_oss.c +++ b/trunk/sound/core/sound_oss.c @@ -106,7 +106,7 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev, int cidx = SNDRV_MINOR_OSS_CARD(minor); int track2 = -1; int register1 = -1, register2 = -1; - struct device *carddev = snd_card_get_device_link(card); + struct device *carddev = NULL; if (card && card->number >= 8) return 0; /* ignore silently */ @@ -134,6 +134,8 @@ int snd_register_oss_device(int type, struct snd_card *card, int dev, track2 = SNDRV_MINOR_OSS(cidx, SNDRV_MINOR_OSS_DMMIDI1); break; } + if (card) + carddev = card->dev; register1 = register_sound_special_device(f_ops, minor, carddev); if (register1 != minor) goto __end;