diff options
206 files changed, 2148 insertions, 1131 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index b959659c5df4..b3f35e5f9c95 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -603,3 +603,19 @@ Why: The adm9240, w83792d and w83793 hardware monitoring drivers have | |||
603 | Who: Jean Delvare <khali@linux-fr.org> | 603 | Who: Jean Delvare <khali@linux-fr.org> |
604 | 604 | ||
605 | ---------------------------- | 605 | ---------------------------- |
606 | |||
607 | What: noswapaccount kernel command line parameter | ||
608 | When: 2.6.40 | ||
609 | Why: The original implementation of memsw feature enabled by | ||
610 | CONFIG_CGROUP_MEM_RES_CTLR_SWAP could be disabled by the noswapaccount | ||
611 | kernel parameter (introduced in 2.6.29-rc1). Later on, this decision | ||
612 | turned out to be not ideal because we cannot have the feature compiled | ||
613 | in and disabled by default and let only interested to enable it | ||
614 | (e.g. general distribution kernels might need it). Therefore we have | ||
615 | added swapaccount[=0|1] parameter (introduced in 2.6.37) which provides | ||
616 | the both possibilities. If we remove noswapaccount we will have | ||
617 | less command line parameters with the same functionality and we | ||
618 | can also cleanup the parameter handling a bit (). | ||
619 | Who: Michal Hocko <mhocko@suse.cz> | ||
620 | |||
621 | ---------------------------- | ||
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt index d99940dcfc44..ac3b4a726a1a 100644 --- a/Documentation/networking/ip-sysctl.txt +++ b/Documentation/networking/ip-sysctl.txt | |||
@@ -187,7 +187,7 @@ tcp_cookie_size - INTEGER | |||
187 | tcp_dsack - BOOLEAN | 187 | tcp_dsack - BOOLEAN |
188 | Allows TCP to send "duplicate" SACKs. | 188 | Allows TCP to send "duplicate" SACKs. |
189 | 189 | ||
190 | tcp_ecn - BOOLEAN | 190 | tcp_ecn - INTEGER |
191 | Enable Explicit Congestion Notification (ECN) in TCP. ECN is only | 191 | Enable Explicit Congestion Notification (ECN) in TCP. ECN is only |
192 | used when both ends of the TCP flow support it. It is useful to | 192 | used when both ends of the TCP flow support it. It is useful to |
193 | avoid losses due to congestion (when the bottleneck router supports | 193 | avoid losses due to congestion (when the bottleneck router supports |
diff --git a/Documentation/scheduler/sched-stats.txt b/Documentation/scheduler/sched-stats.txt index 01e69404ee5e..1cd5d51bc761 100644 --- a/Documentation/scheduler/sched-stats.txt +++ b/Documentation/scheduler/sched-stats.txt | |||
@@ -1,3 +1,7 @@ | |||
1 | Version 15 of schedstats dropped counters for some sched_yield: | ||
2 | yld_exp_empty, yld_act_empty and yld_both_empty. Otherwise, it is | ||
3 | identical to version 14. | ||
4 | |||
1 | Version 14 of schedstats includes support for sched_domains, which hit the | 5 | Version 14 of schedstats includes support for sched_domains, which hit the |
2 | mainline kernel in 2.6.20 although it is identical to the stats from version | 6 | mainline kernel in 2.6.20 although it is identical to the stats from version |
3 | 12 which was in the kernel from 2.6.13-2.6.19 (version 13 never saw a kernel | 7 | 12 which was in the kernel from 2.6.13-2.6.19 (version 13 never saw a kernel |
@@ -28,32 +32,25 @@ to write their own scripts, the fields are described here. | |||
28 | 32 | ||
29 | CPU statistics | 33 | CPU statistics |
30 | -------------- | 34 | -------------- |
31 | cpu<N> 1 2 3 4 5 6 7 8 9 10 11 12 | 35 | cpu<N> 1 2 3 4 5 6 7 8 9 |
32 | |||
33 | NOTE: In the sched_yield() statistics, the active queue is considered empty | ||
34 | if it has only one process in it, since obviously the process calling | ||
35 | sched_yield() is that process. | ||
36 | 36 | ||
37 | First four fields are sched_yield() statistics: | 37 | First field is a sched_yield() statistic: |
38 | 1) # of times both the active and the expired queue were empty | 38 | 1) # of times sched_yield() was called |
39 | 2) # of times just the active queue was empty | ||
40 | 3) # of times just the expired queue was empty | ||
41 | 4) # of times sched_yield() was called | ||
42 | 39 | ||
43 | Next three are schedule() statistics: | 40 | Next three are schedule() statistics: |
44 | 5) # of times we switched to the expired queue and reused it | 41 | 2) # of times we switched to the expired queue and reused it |
45 | 6) # of times schedule() was called | 42 | 3) # of times schedule() was called |
46 | 7) # of times schedule() left the processor idle | 43 | 4) # of times schedule() left the processor idle |
47 | 44 | ||
48 | Next two are try_to_wake_up() statistics: | 45 | Next two are try_to_wake_up() statistics: |
49 | 8) # of times try_to_wake_up() was called | 46 | 5) # of times try_to_wake_up() was called |
50 | 9) # of times try_to_wake_up() was called to wake up the local cpu | 47 | 6) # of times try_to_wake_up() was called to wake up the local cpu |
51 | 48 | ||
52 | Next three are statistics describing scheduling latency: | 49 | Next three are statistics describing scheduling latency: |
53 | 10) sum of all time spent running by tasks on this processor (in jiffies) | 50 | 7) sum of all time spent running by tasks on this processor (in jiffies) |
54 | 11) sum of all time spent waiting to run by tasks on this processor (in | 51 | 8) sum of all time spent waiting to run by tasks on this processor (in |
55 | jiffies) | 52 | jiffies) |
56 | 12) # of timeslices run on this cpu | 53 | 9) # of timeslices run on this cpu |
57 | 54 | ||
58 | 55 | ||
59 | Domain statistics | 56 | Domain statistics |
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index 16ae4300c747..0caf77e59be4 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt | |||
@@ -296,6 +296,7 @@ Conexant 5066 | |||
296 | ============= | 296 | ============= |
297 | laptop Basic Laptop config (default) | 297 | laptop Basic Laptop config (default) |
298 | hp-laptop HP laptops, e g G60 | 298 | hp-laptop HP laptops, e g G60 |
299 | asus Asus K52JU, Lenovo G560 | ||
299 | dell-laptop Dell laptops | 300 | dell-laptop Dell laptops |
300 | dell-vostro Dell Vostro | 301 | dell-vostro Dell Vostro |
301 | olpc-xo-1_5 OLPC XO 1.5 | 302 | olpc-xo-1_5 OLPC XO 1.5 |
diff --git a/MAINTAINERS b/MAINTAINERS index 445537d46e7a..531c5cf150ba 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -978,6 +978,8 @@ S: Maintained | |||
978 | F: arch/arm/plat-samsung/ | 978 | F: arch/arm/plat-samsung/ |
979 | F: arch/arm/plat-s3c24xx/ | 979 | F: arch/arm/plat-s3c24xx/ |
980 | F: arch/arm/plat-s5p/ | 980 | F: arch/arm/plat-s5p/ |
981 | F: drivers/*/*s3c2410* | ||
982 | F: drivers/*/*/*s3c2410* | ||
981 | 983 | ||
982 | ARM/S3C2410 ARM ARCHITECTURE | 984 | ARM/S3C2410 ARM ARCHITECTURE |
983 | M: Ben Dooks <ben-linux@fluff.org> | 985 | M: Ben Dooks <ben-linux@fluff.org> |
@@ -5549,12 +5551,11 @@ S: Supported | |||
5549 | F: drivers/scsi/be2iscsi/ | 5551 | F: drivers/scsi/be2iscsi/ |
5550 | 5552 | ||
5551 | SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER | 5553 | SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER |
5552 | M: Sathya Perla <sathyap@serverengines.com> | 5554 | M: Sathya Perla <sathya.perla@emulex.com> |
5553 | M: Subbu Seetharaman <subbus@serverengines.com> | 5555 | M: Subbu Seetharaman <subbu.seetharaman@emulex.com> |
5554 | M: Sarveshwar Bandi <sarveshwarb@serverengines.com> | 5556 | M: Ajit Khaparde <ajit.khaparde@emulex.com> |
5555 | M: Ajit Khaparde <ajitk@serverengines.com> | ||
5556 | L: netdev@vger.kernel.org | 5557 | L: netdev@vger.kernel.org |
5557 | W: http://www.serverengines.com | 5558 | W: http://www.emulex.com |
5558 | S: Supported | 5559 | S: Supported |
5559 | F: drivers/net/benet/ | 5560 | F: drivers/net/benet/ |
5560 | 5561 | ||
@@ -5614,18 +5615,20 @@ F: include/linux/sfi*.h | |||
5614 | 5615 | ||
5615 | SIMTEC EB110ATX (Chalice CATS) | 5616 | SIMTEC EB110ATX (Chalice CATS) |
5616 | P: Ben Dooks | 5617 | P: Ben Dooks |
5617 | M: Vincent Sanders <support@simtec.co.uk> | 5618 | P: Vincent Sanders <vince@simtec.co.uk> |
5619 | M: Simtec Linux Team <linux@simtec.co.uk> | ||
5618 | W: http://www.simtec.co.uk/products/EB110ATX/ | 5620 | W: http://www.simtec.co.uk/products/EB110ATX/ |
5619 | S: Supported | 5621 | S: Supported |
5620 | 5622 | ||
5621 | SIMTEC EB2410ITX (BAST) | 5623 | SIMTEC EB2410ITX (BAST) |
5622 | P: Ben Dooks | 5624 | P: Ben Dooks |
5623 | M: Vincent Sanders <support@simtec.co.uk> | 5625 | P: Vincent Sanders <vince@simtec.co.uk> |
5626 | M: Simtec Linux Team <linux@simtec.co.uk> | ||
5624 | W: http://www.simtec.co.uk/products/EB2410ITX/ | 5627 | W: http://www.simtec.co.uk/products/EB2410ITX/ |
5625 | S: Supported | 5628 | S: Supported |
5626 | F: arch/arm/mach-s3c2410/ | 5629 | F: arch/arm/mach-s3c2410/mach-bast.c |
5627 | F: drivers/*/*s3c2410* | 5630 | F: arch/arm/mach-s3c2410/bast-ide.c |
5628 | F: drivers/*/*/*s3c2410* | 5631 | F: arch/arm/mach-s3c2410/bast-irq.c |
5629 | 5632 | ||
5630 | TI DAVINCI MACHINE SUPPORT | 5633 | TI DAVINCI MACHINE SUPPORT |
5631 | M: Kevin Hilman <khilman@deeprootsystems.com> | 5634 | M: Kevin Hilman <khilman@deeprootsystems.com> |
@@ -6783,12 +6786,12 @@ S: Maintained | |||
6783 | F: drivers/net/wireless/wl1251/* | 6786 | F: drivers/net/wireless/wl1251/* |
6784 | 6787 | ||
6785 | WL1271 WIRELESS DRIVER | 6788 | WL1271 WIRELESS DRIVER |
6786 | M: Luciano Coelho <luciano.coelho@nokia.com> | 6789 | M: Luciano Coelho <coelho@ti.com> |
6787 | L: linux-wireless@vger.kernel.org | 6790 | L: linux-wireless@vger.kernel.org |
6788 | W: http://wireless.kernel.org | 6791 | W: http://wireless.kernel.org/en/users/Drivers/wl12xx |
6789 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git | 6792 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git |
6790 | S: Maintained | 6793 | S: Maintained |
6791 | F: drivers/net/wireless/wl12xx/wl1271* | 6794 | F: drivers/net/wireless/wl12xx/ |
6792 | F: include/linux/wl12xx.h | 6795 | F: include/linux/wl12xx.h |
6793 | 6796 | ||
6794 | WL3501 WIRELESS PCMCIA CARD DRIVER | 6797 | WL3501 WIRELESS PCMCIA CARD DRIVER |
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 4dc68d6bb6be..9fd894271d5d 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -432,7 +432,7 @@ static struct clocksource clocksource_ixp4xx = { | |||
432 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 432 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
433 | }; | 433 | }; |
434 | 434 | ||
435 | unsigned long ixp4xx_timer_freq = FREQ; | 435 | unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ; |
436 | EXPORT_SYMBOL(ixp4xx_timer_freq); | 436 | EXPORT_SYMBOL(ixp4xx_timer_freq); |
437 | static void __init ixp4xx_clocksource_init(void) | 437 | static void __init ixp4xx_clocksource_init(void) |
438 | { | 438 | { |
@@ -496,7 +496,7 @@ static struct clock_event_device clockevent_ixp4xx = { | |||
496 | 496 | ||
497 | static void __init ixp4xx_clockevent_init(void) | 497 | static void __init ixp4xx_clockevent_init(void) |
498 | { | 498 | { |
499 | clockevent_ixp4xx.mult = div_sc(FREQ, NSEC_PER_SEC, | 499 | clockevent_ixp4xx.mult = div_sc(IXP4XX_TIMER_FREQ, NSEC_PER_SEC, |
500 | clockevent_ixp4xx.shift); | 500 | clockevent_ixp4xx.shift); |
501 | clockevent_ixp4xx.max_delta_ns = | 501 | clockevent_ixp4xx.max_delta_ns = |
502 | clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx); | 502 | clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx); |
diff --git a/arch/arm/mach-ixp4xx/include/mach/timex.h b/arch/arm/mach-ixp4xx/include/mach/timex.h index 2c3f93c3eb79..c9e930f29339 100644 --- a/arch/arm/mach-ixp4xx/include/mach/timex.h +++ b/arch/arm/mach-ixp4xx/include/mach/timex.h | |||
@@ -10,6 +10,7 @@ | |||
10 | * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the | 10 | * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the |
11 | * timer register ignores the bottom 2 bits of the LATCH value. | 11 | * timer register ignores the bottom 2 bits of the LATCH value. |
12 | */ | 12 | */ |
13 | #define FREQ 66666000 | 13 | #define IXP4XX_TIMER_FREQ 66666000 |
14 | #define CLOCK_TICK_RATE (((FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) | 14 | #define CLOCK_TICK_RATE \ |
15 | (((IXP4XX_TIMER_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) | ||
15 | 16 | ||
diff --git a/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c b/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c index bfdbe4b5a3cc..852f7c9f87d0 100644 --- a/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c +++ b/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c | |||
@@ -265,6 +265,11 @@ void qmgr_release_queue(unsigned int queue) | |||
265 | qmgr_queue_descs[queue], queue); | 265 | qmgr_queue_descs[queue], queue); |
266 | qmgr_queue_descs[queue][0] = '\x0'; | 266 | qmgr_queue_descs[queue][0] = '\x0'; |
267 | #endif | 267 | #endif |
268 | |||
269 | while ((addr = qmgr_get_entry(queue))) | ||
270 | printk(KERN_ERR "qmgr: released queue %i not empty: 0x%08X\n", | ||
271 | queue, addr); | ||
272 | |||
268 | __raw_writel(0, &qmgr_regs->sram[queue]); | 273 | __raw_writel(0, &qmgr_regs->sram[queue]); |
269 | 274 | ||
270 | used_sram_bitmap[0] &= ~mask[0]; | 275 | used_sram_bitmap[0] &= ~mask[0]; |
@@ -275,10 +280,6 @@ void qmgr_release_queue(unsigned int queue) | |||
275 | spin_unlock_irq(&qmgr_lock); | 280 | spin_unlock_irq(&qmgr_lock); |
276 | 281 | ||
277 | module_put(THIS_MODULE); | 282 | module_put(THIS_MODULE); |
278 | |||
279 | while ((addr = qmgr_get_entry(queue))) | ||
280 | printk(KERN_ERR "qmgr: released queue %i not empty: 0x%08X\n", | ||
281 | queue, addr); | ||
282 | } | 283 | } |
283 | 284 | ||
284 | static int qmgr_init(void) | 285 | static int qmgr_init(void) |
diff --git a/arch/m32r/kernel/irq.c b/arch/m32r/kernel/irq.c index f745c1287f3a..76eaf3883fbd 100644 --- a/arch/m32r/kernel/irq.c +++ b/arch/m32r/kernel/irq.c | |||
@@ -80,7 +80,7 @@ asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs) | |||
80 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | 80 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
81 | /* FIXME M32R */ | 81 | /* FIXME M32R */ |
82 | #endif | 82 | #endif |
83 | __do_IRQ(irq); | 83 | generic_handle_irq(irq); |
84 | irq_exit(); | 84 | irq_exit(); |
85 | set_irq_regs(old_regs); | 85 | set_irq_regs(old_regs); |
86 | 86 | ||
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S index 42434008209e..0db20b5abb54 100644 --- a/arch/microblaze/kernel/head.S +++ b/arch/microblaze/kernel/head.S | |||
@@ -77,8 +77,18 @@ real_start: | |||
77 | We ensure r7 points to a valid FDT, just in case the bootloader | 77 | We ensure r7 points to a valid FDT, just in case the bootloader |
78 | is broken or non-existent */ | 78 | is broken or non-existent */ |
79 | beqi r7, no_fdt_arg /* NULL pointer? don't copy */ | 79 | beqi r7, no_fdt_arg /* NULL pointer? don't copy */ |
80 | lw r11, r0, r7 /* Does r7 point to a */ | 80 | /* Does r7 point to a valid FDT? Load HEADER magic number */ |
81 | rsubi r11, r11, OF_DT_HEADER /* valid FDT? */ | 81 | /* Run time Big/Little endian platform */ |
82 | /* Save 1 as word and load byte - 0 - BIG, 1 - LITTLE */ | ||
83 | addik r11, r0, 0x1 /* BIG/LITTLE checking value */ | ||
84 | /* __bss_start will be zeroed later - it is just temp location */ | ||
85 | swi r11, r0, TOPHYS(__bss_start) | ||
86 | lbui r11, r0, TOPHYS(__bss_start) | ||
87 | beqid r11, big_endian /* DO NOT break delay stop dependency */ | ||
88 | lw r11, r0, r7 /* Big endian load in delay slot */ | ||
89 | lwr r11, r0, r7 /* Little endian load */ | ||
90 | big_endian: | ||
91 | rsubi r11, r11, OF_DT_HEADER /* Check FDT header */ | ||
82 | beqi r11, _prepare_copy_fdt | 92 | beqi r11, _prepare_copy_fdt |
83 | or r7, r0, r0 /* clear R7 when not valid DTB */ | 93 | or r7, r0, r0 /* clear R7 when not valid DTB */ |
84 | bnei r11, no_fdt_arg /* No - get out of here */ | 94 | bnei r11, no_fdt_arg /* No - get out of here */ |
diff --git a/arch/microblaze/kernel/hw_exception_handler.S b/arch/microblaze/kernel/hw_exception_handler.S index 25f6e07d8de8..782680de3121 100644 --- a/arch/microblaze/kernel/hw_exception_handler.S +++ b/arch/microblaze/kernel/hw_exception_handler.S | |||
@@ -147,10 +147,6 @@ | |||
147 | #if CONFIG_XILINX_MICROBLAZE0_USE_BARREL > 0 | 147 | #if CONFIG_XILINX_MICROBLAZE0_USE_BARREL > 0 |
148 | #define BSRLI(rD, rA, imm) \ | 148 | #define BSRLI(rD, rA, imm) \ |
149 | bsrli rD, rA, imm | 149 | bsrli rD, rA, imm |
150 | #elif CONFIG_XILINX_MICROBLAZE0_USE_DIV > 0 | ||
151 | #define BSRLI(rD, rA, imm) \ | ||
152 | ori rD, r0, (1 << imm); \ | ||
153 | idivu rD, rD, rA | ||
154 | #else | 150 | #else |
155 | #define BSRLI(rD, rA, imm) BSRLI ## imm (rD, rA) | 151 | #define BSRLI(rD, rA, imm) BSRLI ## imm (rD, rA) |
156 | /* Only the used shift constants defined here - add more if needed */ | 152 | /* Only the used shift constants defined here - add more if needed */ |
diff --git a/arch/microblaze/lib/fastcopy.S b/arch/microblaze/lib/fastcopy.S index fdc48bb065d8..62021d7e249e 100644 --- a/arch/microblaze/lib/fastcopy.S +++ b/arch/microblaze/lib/fastcopy.S | |||
@@ -29,6 +29,10 @@ | |||
29 | * between mem locations with size of xfer spec'd in bytes | 29 | * between mem locations with size of xfer spec'd in bytes |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifdef __MICROBLAZEEL__ | ||
33 | #error Microblaze LE not support ASM optimized lib func. Disable OPT_LIB_ASM. | ||
34 | #endif | ||
35 | |||
32 | #include <linux/linkage.h> | 36 | #include <linux/linkage.h> |
33 | .text | 37 | .text |
34 | .globl memcpy | 38 | .globl memcpy |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index ff19efdf6fef..636bcb81d068 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -406,7 +406,7 @@ config QDIO | |||
406 | If unsure, say Y. | 406 | If unsure, say Y. |
407 | 407 | ||
408 | config CHSC_SCH | 408 | config CHSC_SCH |
409 | def_tristate y | 409 | def_tristate m |
410 | prompt "Support for CHSC subchannels" | 410 | prompt "Support for CHSC subchannels" |
411 | help | 411 | help |
412 | This driver allows usage of CHSC subchannels. A CHSC subchannel | 412 | This driver allows usage of CHSC subchannels. A CHSC subchannel |
diff --git a/arch/s390/include/asm/cacheflush.h b/arch/s390/include/asm/cacheflush.h index 405cc97c6249..7e1f77620624 100644 --- a/arch/s390/include/asm/cacheflush.h +++ b/arch/s390/include/asm/cacheflush.h | |||
@@ -1,29 +1,8 @@ | |||
1 | #ifndef _S390_CACHEFLUSH_H | 1 | #ifndef _S390_CACHEFLUSH_H |
2 | #define _S390_CACHEFLUSH_H | 2 | #define _S390_CACHEFLUSH_H |
3 | 3 | ||
4 | /* Keep includes the same across arches. */ | ||
5 | #include <linux/mm.h> | ||
6 | |||
7 | /* Caches aren't brain-dead on the s390. */ | 4 | /* Caches aren't brain-dead on the s390. */ |
8 | #define flush_cache_all() do { } while (0) | 5 | #include <asm-generic/cacheflush.h> |
9 | #define flush_cache_mm(mm) do { } while (0) | ||
10 | #define flush_cache_dup_mm(mm) do { } while (0) | ||
11 | #define flush_cache_range(vma, start, end) do { } while (0) | ||
12 | #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) | ||
13 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 | ||
14 | #define flush_dcache_page(page) do { } while (0) | ||
15 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | ||
16 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | ||
17 | #define flush_icache_range(start, end) do { } while (0) | ||
18 | #define flush_icache_page(vma,pg) do { } while (0) | ||
19 | #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) | ||
20 | #define flush_cache_vmap(start, end) do { } while (0) | ||
21 | #define flush_cache_vunmap(start, end) do { } while (0) | ||
22 | |||
23 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | ||
24 | memcpy(dst, src, len) | ||
25 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | ||
26 | memcpy(dst, src, len) | ||
27 | 6 | ||
28 | #ifdef CONFIG_DEBUG_PAGEALLOC | 7 | #ifdef CONFIG_DEBUG_PAGEALLOC |
29 | void kernel_map_pages(struct page *page, int numpages, int enable); | 8 | void kernel_map_pages(struct page *page, int numpages, int enable); |
diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h index f1f644f2240a..9074a54c4d10 100644 --- a/arch/s390/include/asm/tlb.h +++ b/arch/s390/include/asm/tlb.h | |||
@@ -22,6 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/mm.h> | 24 | #include <linux/mm.h> |
25 | #include <linux/pagemap.h> | ||
25 | #include <linux/swap.h> | 26 | #include <linux/swap.h> |
26 | #include <asm/processor.h> | 27 | #include <asm/processor.h> |
27 | #include <asm/pgalloc.h> | 28 | #include <asm/pgalloc.h> |
diff --git a/arch/s390/lib/uaccess_std.c b/arch/s390/lib/uaccess_std.c index 07deaeee14c8..a6c4f7ed24a4 100644 --- a/arch/s390/lib/uaccess_std.c +++ b/arch/s390/lib/uaccess_std.c | |||
@@ -125,9 +125,9 @@ static size_t copy_in_user_std(size_t size, void __user *to, | |||
125 | unsigned long tmp1; | 125 | unsigned long tmp1; |
126 | 126 | ||
127 | asm volatile( | 127 | asm volatile( |
128 | " sacf 256\n" | ||
128 | " "AHI" %0,-1\n" | 129 | " "AHI" %0,-1\n" |
129 | " jo 5f\n" | 130 | " jo 5f\n" |
130 | " sacf 256\n" | ||
131 | " bras %3,3f\n" | 131 | " bras %3,3f\n" |
132 | "0:"AHI" %0,257\n" | 132 | "0:"AHI" %0,257\n" |
133 | "1: mvc 0(1,%1),0(%2)\n" | 133 | "1: mvc 0(1,%1),0(%2)\n" |
@@ -142,9 +142,8 @@ static size_t copy_in_user_std(size_t size, void __user *to, | |||
142 | "3:"AHI" %0,-256\n" | 142 | "3:"AHI" %0,-256\n" |
143 | " jnm 2b\n" | 143 | " jnm 2b\n" |
144 | "4: ex %0,1b-0b(%3)\n" | 144 | "4: ex %0,1b-0b(%3)\n" |
145 | " sacf 0\n" | ||
146 | "5: "SLR" %0,%0\n" | 145 | "5: "SLR" %0,%0\n" |
147 | "6:\n" | 146 | "6: sacf 0\n" |
148 | EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b) | 147 | EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b) |
149 | : "+a" (size), "+a" (to), "+a" (from), "=a" (tmp1) | 148 | : "+a" (size), "+a" (to), "+a" (from), "=a" (tmp1) |
150 | : : "cc", "memory"); | 149 | : : "cc", "memory"); |
@@ -156,9 +155,9 @@ static size_t clear_user_std(size_t size, void __user *to) | |||
156 | unsigned long tmp1, tmp2; | 155 | unsigned long tmp1, tmp2; |
157 | 156 | ||
158 | asm volatile( | 157 | asm volatile( |
158 | " sacf 256\n" | ||
159 | " "AHI" %0,-1\n" | 159 | " "AHI" %0,-1\n" |
160 | " jo 5f\n" | 160 | " jo 5f\n" |
161 | " sacf 256\n" | ||
162 | " bras %3,3f\n" | 161 | " bras %3,3f\n" |
163 | " xc 0(1,%1),0(%1)\n" | 162 | " xc 0(1,%1),0(%1)\n" |
164 | "0:"AHI" %0,257\n" | 163 | "0:"AHI" %0,257\n" |
@@ -178,9 +177,8 @@ static size_t clear_user_std(size_t size, void __user *to) | |||
178 | "3:"AHI" %0,-256\n" | 177 | "3:"AHI" %0,-256\n" |
179 | " jnm 2b\n" | 178 | " jnm 2b\n" |
180 | "4: ex %0,0(%3)\n" | 179 | "4: ex %0,0(%3)\n" |
181 | " sacf 0\n" | ||
182 | "5: "SLR" %0,%0\n" | 180 | "5: "SLR" %0,%0\n" |
183 | "6:\n" | 181 | "6: sacf 0\n" |
184 | EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b) | 182 | EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b) |
185 | : "+a" (size), "+a" (to), "=a" (tmp1), "=a" (tmp2) | 183 | : "+a" (size), "+a" (to), "=a" (tmp1), "=a" (tmp2) |
186 | : : "cc", "memory"); | 184 | : : "cc", "memory"); |
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 0c719c61972e..e1850c28cd68 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -336,7 +336,8 @@ void page_table_free(struct mm_struct *mm, unsigned long *table) | |||
336 | page->flags ^= bits; | 336 | page->flags ^= bits; |
337 | if (page->flags & FRAG_MASK) { | 337 | if (page->flags & FRAG_MASK) { |
338 | /* Page now has some free pgtable fragments. */ | 338 | /* Page now has some free pgtable fragments. */ |
339 | list_move(&page->lru, &mm->context.pgtable_list); | 339 | if (!list_empty(&page->lru)) |
340 | list_move(&page->lru, &mm->context.pgtable_list); | ||
340 | page = NULL; | 341 | page = NULL; |
341 | } else | 342 | } else |
342 | /* All fragments of the 4K page have been freed. */ | 343 | /* All fragments of the 4K page have been freed. */ |
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h index 4a2d4e0c18d9..8b5393ec1080 100644 --- a/arch/x86/include/asm/mmu_context.h +++ b/arch/x86/include/asm/mmu_context.h | |||
@@ -36,8 +36,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
36 | unsigned cpu = smp_processor_id(); | 36 | unsigned cpu = smp_processor_id(); |
37 | 37 | ||
38 | if (likely(prev != next)) { | 38 | if (likely(prev != next)) { |
39 | /* stop flush ipis for the previous mm */ | ||
40 | cpumask_clear_cpu(cpu, mm_cpumask(prev)); | ||
41 | #ifdef CONFIG_SMP | 39 | #ifdef CONFIG_SMP |
42 | percpu_write(cpu_tlbstate.state, TLBSTATE_OK); | 40 | percpu_write(cpu_tlbstate.state, TLBSTATE_OK); |
43 | percpu_write(cpu_tlbstate.active_mm, next); | 41 | percpu_write(cpu_tlbstate.active_mm, next); |
@@ -47,6 +45,9 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
47 | /* Re-load page tables */ | 45 | /* Re-load page tables */ |
48 | load_cr3(next->pgd); | 46 | load_cr3(next->pgd); |
49 | 47 | ||
48 | /* stop flush ipis for the previous mm */ | ||
49 | cpumask_clear_cpu(cpu, mm_cpumask(prev)); | ||
50 | |||
50 | /* | 51 | /* |
51 | * load the LDT, if the LDT is different: | 52 | * load the LDT, if the LDT is different: |
52 | */ | 53 | */ |
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 4c2f63c7fc1b..1f4695136776 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h | |||
@@ -40,10 +40,7 @@ DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); | |||
40 | DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); | 40 | DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); |
41 | 41 | ||
42 | /* Static state in head.S used to set up a CPU */ | 42 | /* Static state in head.S used to set up a CPU */ |
43 | extern struct { | 43 | extern unsigned long stack_start; /* Initial stack pointer address */ |
44 | void *sp; | ||
45 | unsigned short ss; | ||
46 | } stack_start; | ||
47 | 44 | ||
48 | struct smp_ops { | 45 | struct smp_ops { |
49 | void (*smp_prepare_boot_cpu)(void); | 46 | void (*smp_prepare_boot_cpu)(void); |
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 69fd72aa5594..4d9ebbab2230 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -100,7 +100,7 @@ int acpi_save_state_mem(void) | |||
100 | #else /* CONFIG_64BIT */ | 100 | #else /* CONFIG_64BIT */ |
101 | header->trampoline_segment = setup_trampoline() >> 4; | 101 | header->trampoline_segment = setup_trampoline() >> 4; |
102 | #ifdef CONFIG_SMP | 102 | #ifdef CONFIG_SMP |
103 | stack_start.sp = temp_stack + sizeof(temp_stack); | 103 | stack_start = (unsigned long)temp_stack + sizeof(temp_stack); |
104 | early_gdt_descr.address = | 104 | early_gdt_descr.address = |
105 | (unsigned long)get_cpu_gdt_table(smp_processor_id()); | 105 | (unsigned long)get_cpu_gdt_table(smp_processor_id()); |
106 | initial_gs = per_cpu_offset(smp_processor_id()); | 106 | initial_gs = per_cpu_offset(smp_processor_id()); |
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index 01c0f3ee6cc3..bebabec5b448 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c | |||
@@ -793,13 +793,21 @@ void set_mtrr_aps_delayed_init(void) | |||
793 | } | 793 | } |
794 | 794 | ||
795 | /* | 795 | /* |
796 | * MTRR initialization for all AP's | 796 | * Delayed MTRR initialization for all AP's |
797 | */ | 797 | */ |
798 | void mtrr_aps_init(void) | 798 | void mtrr_aps_init(void) |
799 | { | 799 | { |
800 | if (!use_intel()) | 800 | if (!use_intel()) |
801 | return; | 801 | return; |
802 | 802 | ||
803 | /* | ||
804 | * Check if someone has requested the delay of AP MTRR initialization, | ||
805 | * by doing set_mtrr_aps_delayed_init(), prior to this point. If not, | ||
806 | * then we are done. | ||
807 | */ | ||
808 | if (!mtrr_aps_delayed_init) | ||
809 | return; | ||
810 | |||
803 | set_mtrr(~0U, 0, 0, 0); | 811 | set_mtrr(~0U, 0, 0, 0); |
804 | mtrr_aps_delayed_init = false; | 812 | mtrr_aps_delayed_init = false; |
805 | } | 813 | } |
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index e56b9bfbabd1..f7a0993c1e7c 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -682,7 +682,7 @@ static int p4_validate_raw_event(struct perf_event *event) | |||
682 | * if an event is shared accross the logical threads | 682 | * if an event is shared accross the logical threads |
683 | * the user needs special permissions to be able to use it | 683 | * the user needs special permissions to be able to use it |
684 | */ | 684 | */ |
685 | if (p4_event_bind_map[v].shared) { | 685 | if (p4_ht_active() && p4_event_bind_map[v].shared) { |
686 | if (perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN)) | 686 | if (perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN)) |
687 | return -EACCES; | 687 | return -EACCES; |
688 | } | 688 | } |
@@ -727,7 +727,8 @@ static int p4_hw_config(struct perf_event *event) | |||
727 | event->hw.config = p4_set_ht_bit(event->hw.config); | 727 | event->hw.config = p4_set_ht_bit(event->hw.config); |
728 | 728 | ||
729 | if (event->attr.type == PERF_TYPE_RAW) { | 729 | if (event->attr.type == PERF_TYPE_RAW) { |
730 | 730 | struct p4_event_bind *bind; | |
731 | unsigned int esel; | ||
731 | /* | 732 | /* |
732 | * Clear bits we reserve to be managed by kernel itself | 733 | * Clear bits we reserve to be managed by kernel itself |
733 | * and never allowed from a user space | 734 | * and never allowed from a user space |
@@ -743,6 +744,13 @@ static int p4_hw_config(struct perf_event *event) | |||
743 | * bits since we keep additional info here (for cache events and etc) | 744 | * bits since we keep additional info here (for cache events and etc) |
744 | */ | 745 | */ |
745 | event->hw.config |= event->attr.config; | 746 | event->hw.config |= event->attr.config; |
747 | bind = p4_config_get_bind(event->attr.config); | ||
748 | if (!bind) { | ||
749 | rc = -EINVAL; | ||
750 | goto out; | ||
751 | } | ||
752 | esel = P4_OPCODE_ESEL(bind->opcode); | ||
753 | event->hw.config |= p4_config_pack_cccr(P4_CCCR_ESEL(esel)); | ||
746 | } | 754 | } |
747 | 755 | ||
748 | rc = x86_setup_perfctr(event); | 756 | rc = x86_setup_perfctr(event); |
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index fc293dc8dc35..767d6c43de37 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
@@ -85,6 +85,8 @@ RESERVE_BRK(pagetables, INIT_MAP_SIZE) | |||
85 | */ | 85 | */ |
86 | __HEAD | 86 | __HEAD |
87 | ENTRY(startup_32) | 87 | ENTRY(startup_32) |
88 | movl pa(stack_start),%ecx | ||
89 | |||
88 | /* test KEEP_SEGMENTS flag to see if the bootloader is asking | 90 | /* test KEEP_SEGMENTS flag to see if the bootloader is asking |
89 | us to not reload segments */ | 91 | us to not reload segments */ |
90 | testb $(1<<6), BP_loadflags(%esi) | 92 | testb $(1<<6), BP_loadflags(%esi) |
@@ -99,7 +101,9 @@ ENTRY(startup_32) | |||
99 | movl %eax,%es | 101 | movl %eax,%es |
100 | movl %eax,%fs | 102 | movl %eax,%fs |
101 | movl %eax,%gs | 103 | movl %eax,%gs |
104 | movl %eax,%ss | ||
102 | 2: | 105 | 2: |
106 | leal -__PAGE_OFFSET(%ecx),%esp | ||
103 | 107 | ||
104 | /* | 108 | /* |
105 | * Clear BSS first so that there are no surprises... | 109 | * Clear BSS first so that there are no surprises... |
@@ -145,8 +149,6 @@ ENTRY(startup_32) | |||
145 | * _brk_end is set up to point to the first "safe" location. | 149 | * _brk_end is set up to point to the first "safe" location. |
146 | * Mappings are created both at virtual address 0 (identity mapping) | 150 | * Mappings are created both at virtual address 0 (identity mapping) |
147 | * and PAGE_OFFSET for up to _end. | 151 | * and PAGE_OFFSET for up to _end. |
148 | * | ||
149 | * Note that the stack is not yet set up! | ||
150 | */ | 152 | */ |
151 | #ifdef CONFIG_X86_PAE | 153 | #ifdef CONFIG_X86_PAE |
152 | 154 | ||
@@ -282,6 +284,9 @@ ENTRY(startup_32_smp) | |||
282 | movl %eax,%es | 284 | movl %eax,%es |
283 | movl %eax,%fs | 285 | movl %eax,%fs |
284 | movl %eax,%gs | 286 | movl %eax,%gs |
287 | movl pa(stack_start),%ecx | ||
288 | movl %eax,%ss | ||
289 | leal -__PAGE_OFFSET(%ecx),%esp | ||
285 | #endif /* CONFIG_SMP */ | 290 | #endif /* CONFIG_SMP */ |
286 | default_entry: | 291 | default_entry: |
287 | 292 | ||
@@ -347,8 +352,8 @@ default_entry: | |||
347 | movl %eax,%cr0 /* ..and set paging (PG) bit */ | 352 | movl %eax,%cr0 /* ..and set paging (PG) bit */ |
348 | ljmp $__BOOT_CS,$1f /* Clear prefetch and normalize %eip */ | 353 | ljmp $__BOOT_CS,$1f /* Clear prefetch and normalize %eip */ |
349 | 1: | 354 | 1: |
350 | /* Set up the stack pointer */ | 355 | /* Shift the stack pointer to a virtual address */ |
351 | lss stack_start,%esp | 356 | addl $__PAGE_OFFSET, %esp |
352 | 357 | ||
353 | /* | 358 | /* |
354 | * Initialize eflags. Some BIOS's leave bits like NT set. This would | 359 | * Initialize eflags. Some BIOS's leave bits like NT set. This would |
@@ -360,9 +365,7 @@ default_entry: | |||
360 | 365 | ||
361 | #ifdef CONFIG_SMP | 366 | #ifdef CONFIG_SMP |
362 | cmpb $0, ready | 367 | cmpb $0, ready |
363 | jz 1f /* Initial CPU cleans BSS */ | 368 | jnz checkCPUtype |
364 | jmp checkCPUtype | ||
365 | 1: | ||
366 | #endif /* CONFIG_SMP */ | 369 | #endif /* CONFIG_SMP */ |
367 | 370 | ||
368 | /* | 371 | /* |
@@ -470,14 +473,7 @@ is386: movl $2,%ecx # set MP | |||
470 | 473 | ||
471 | cld # gcc2 wants the direction flag cleared at all times | 474 | cld # gcc2 wants the direction flag cleared at all times |
472 | pushl $0 # fake return address for unwinder | 475 | pushl $0 # fake return address for unwinder |
473 | #ifdef CONFIG_SMP | ||
474 | movb ready, %cl | ||
475 | movb $1, ready | 476 | movb $1, ready |
476 | cmpb $0,%cl # the first CPU calls start_kernel | ||
477 | je 1f | ||
478 | movl (stack_start), %esp | ||
479 | 1: | ||
480 | #endif /* CONFIG_SMP */ | ||
481 | jmp *(initial_code) | 477 | jmp *(initial_code) |
482 | 478 | ||
483 | /* | 479 | /* |
@@ -670,15 +666,15 @@ ENTRY(initial_page_table) | |||
670 | #endif | 666 | #endif |
671 | 667 | ||
672 | .data | 668 | .data |
669 | .balign 4 | ||
673 | ENTRY(stack_start) | 670 | ENTRY(stack_start) |
674 | .long init_thread_union+THREAD_SIZE | 671 | .long init_thread_union+THREAD_SIZE |
675 | .long __BOOT_DS | ||
676 | |||
677 | ready: .byte 0 | ||
678 | 672 | ||
679 | early_recursion_flag: | 673 | early_recursion_flag: |
680 | .long 0 | 674 | .long 0 |
681 | 675 | ||
676 | ready: .byte 0 | ||
677 | |||
682 | int_msg: | 678 | int_msg: |
683 | .asciz "Unknown interrupt or fault at: %p %p %p\n" | 679 | .asciz "Unknown interrupt or fault at: %p %p %p\n" |
684 | 680 | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 0cbe8c0b35ed..03273b6c272c 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -638,7 +638,7 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) | |||
638 | * target processor state. | 638 | * target processor state. |
639 | */ | 639 | */ |
640 | startup_ipi_hook(phys_apicid, (unsigned long) start_secondary, | 640 | startup_ipi_hook(phys_apicid, (unsigned long) start_secondary, |
641 | (unsigned long)stack_start.sp); | 641 | stack_start); |
642 | 642 | ||
643 | /* | 643 | /* |
644 | * Run STARTUP IPI loop. | 644 | * Run STARTUP IPI loop. |
@@ -785,7 +785,7 @@ do_rest: | |||
785 | #endif | 785 | #endif |
786 | early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu); | 786 | early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu); |
787 | initial_code = (unsigned long)start_secondary; | 787 | initial_code = (unsigned long)start_secondary; |
788 | stack_start.sp = (void *) c_idle.idle->thread.sp; | 788 | stack_start = c_idle.idle->thread.sp; |
789 | 789 | ||
790 | /* start_ip had better be page-aligned! */ | 790 | /* start_ip had better be page-aligned! */ |
791 | start_ip = setup_trampoline(); | 791 | start_ip = setup_trampoline(); |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 8b830ca14ac4..d343b3c81f3c 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -256,7 +256,6 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address, | |||
256 | unsigned long pfn) | 256 | unsigned long pfn) |
257 | { | 257 | { |
258 | pgprot_t forbidden = __pgprot(0); | 258 | pgprot_t forbidden = __pgprot(0); |
259 | pgprot_t required = __pgprot(0); | ||
260 | 259 | ||
261 | /* | 260 | /* |
262 | * The BIOS area between 640k and 1Mb needs to be executable for | 261 | * The BIOS area between 640k and 1Mb needs to be executable for |
@@ -282,12 +281,6 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address, | |||
282 | if (within(pfn, __pa((unsigned long)__start_rodata) >> PAGE_SHIFT, | 281 | if (within(pfn, __pa((unsigned long)__start_rodata) >> PAGE_SHIFT, |
283 | __pa((unsigned long)__end_rodata) >> PAGE_SHIFT)) | 282 | __pa((unsigned long)__end_rodata) >> PAGE_SHIFT)) |
284 | pgprot_val(forbidden) |= _PAGE_RW; | 283 | pgprot_val(forbidden) |= _PAGE_RW; |
285 | /* | ||
286 | * .data and .bss should always be writable. | ||
287 | */ | ||
288 | if (within(address, (unsigned long)_sdata, (unsigned long)_edata) || | ||
289 | within(address, (unsigned long)__bss_start, (unsigned long)__bss_stop)) | ||
290 | pgprot_val(required) |= _PAGE_RW; | ||
291 | 284 | ||
292 | #if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA) | 285 | #if defined(CONFIG_X86_64) && defined(CONFIG_DEBUG_RODATA) |
293 | /* | 286 | /* |
@@ -327,7 +320,6 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address, | |||
327 | #endif | 320 | #endif |
328 | 321 | ||
329 | prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden)); | 322 | prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden)); |
330 | prot = __pgprot(pgprot_val(prot) | pgprot_val(required)); | ||
331 | 323 | ||
332 | return prot; | 324 | return prot; |
333 | } | 325 | } |
diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig index fcd867d923ba..d8b1b576556c 100644 --- a/drivers/char/agp/Kconfig +++ b/drivers/char/agp/Kconfig | |||
@@ -50,7 +50,7 @@ config AGP_ATI | |||
50 | 50 | ||
51 | config AGP_AMD | 51 | config AGP_AMD |
52 | tristate "AMD Irongate, 761, and 762 chipset support" | 52 | tristate "AMD Irongate, 761, and 762 chipset support" |
53 | depends on AGP && (X86_32 || ALPHA) | 53 | depends on AGP && X86_32 |
54 | help | 54 | help |
55 | This option gives you AGP support for the GLX component of | 55 | This option gives you AGP support for the GLX component of |
56 | X on AMD Irongate, 761, and 762 chipsets. | 56 | X on AMD Irongate, 761, and 762 chipsets. |
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index b1b4362bc648..45681c0ff3b6 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c | |||
@@ -41,22 +41,8 @@ static int amd_create_page_map(struct amd_page_map *page_map) | |||
41 | if (page_map->real == NULL) | 41 | if (page_map->real == NULL) |
42 | return -ENOMEM; | 42 | return -ENOMEM; |
43 | 43 | ||
44 | #ifndef CONFIG_X86 | ||
45 | SetPageReserved(virt_to_page(page_map->real)); | ||
46 | global_cache_flush(); | ||
47 | page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), | ||
48 | PAGE_SIZE); | ||
49 | if (page_map->remapped == NULL) { | ||
50 | ClearPageReserved(virt_to_page(page_map->real)); | ||
51 | free_page((unsigned long) page_map->real); | ||
52 | page_map->real = NULL; | ||
53 | return -ENOMEM; | ||
54 | } | ||
55 | global_cache_flush(); | ||
56 | #else | ||
57 | set_memory_uc((unsigned long)page_map->real, 1); | 44 | set_memory_uc((unsigned long)page_map->real, 1); |
58 | page_map->remapped = page_map->real; | 45 | page_map->remapped = page_map->real; |
59 | #endif | ||
60 | 46 | ||
61 | for (i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) { | 47 | for (i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) { |
62 | writel(agp_bridge->scratch_page, page_map->remapped+i); | 48 | writel(agp_bridge->scratch_page, page_map->remapped+i); |
@@ -68,12 +54,7 @@ static int amd_create_page_map(struct amd_page_map *page_map) | |||
68 | 54 | ||
69 | static void amd_free_page_map(struct amd_page_map *page_map) | 55 | static void amd_free_page_map(struct amd_page_map *page_map) |
70 | { | 56 | { |
71 | #ifndef CONFIG_X86 | ||
72 | iounmap(page_map->remapped); | ||
73 | ClearPageReserved(virt_to_page(page_map->real)); | ||
74 | #else | ||
75 | set_memory_wb((unsigned long)page_map->real, 1); | 57 | set_memory_wb((unsigned long)page_map->real, 1); |
76 | #endif | ||
77 | free_page((unsigned long) page_map->real); | 58 | free_page((unsigned long) page_map->real); |
78 | } | 59 | } |
79 | 60 | ||
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 857df10c0428..b0a0dccc98c1 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -774,20 +774,14 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, | |||
774 | dev_info(&pdev->dev, "Intel %s Chipset\n", intel_agp_chipsets[i].name); | 774 | dev_info(&pdev->dev, "Intel %s Chipset\n", intel_agp_chipsets[i].name); |
775 | 775 | ||
776 | /* | 776 | /* |
777 | * If the device has not been properly setup, the following will catch | ||
778 | * the problem and should stop the system from crashing. | ||
779 | * 20030610 - hamish@zot.org | ||
780 | */ | ||
781 | if (pci_enable_device(pdev)) { | ||
782 | dev_err(&pdev->dev, "can't enable PCI device\n"); | ||
783 | agp_put_bridge(bridge); | ||
784 | return -ENODEV; | ||
785 | } | ||
786 | |||
787 | /* | ||
788 | * The following fixes the case where the BIOS has "forgotten" to | 777 | * The following fixes the case where the BIOS has "forgotten" to |
789 | * provide an address range for the GART. | 778 | * provide an address range for the GART. |
790 | * 20030610 - hamish@zot.org | 779 | * 20030610 - hamish@zot.org |
780 | * This happens before pci_enable_device() intentionally; | ||
781 | * calling pci_enable_device() before assigning the resource | ||
782 | * will result in the GART being disabled on machines with such | ||
783 | * BIOSs (the GART ends up with a BAR starting at 0, which | ||
784 | * conflicts a lot of other devices). | ||
791 | */ | 785 | */ |
792 | r = &pdev->resource[0]; | 786 | r = &pdev->resource[0]; |
793 | if (!r->start && r->end) { | 787 | if (!r->start && r->end) { |
@@ -798,6 +792,17 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev, | |||
798 | } | 792 | } |
799 | } | 793 | } |
800 | 794 | ||
795 | /* | ||
796 | * If the device has not been properly setup, the following will catch | ||
797 | * the problem and should stop the system from crashing. | ||
798 | * 20030610 - hamish@zot.org | ||
799 | */ | ||
800 | if (pci_enable_device(pdev)) { | ||
801 | dev_err(&pdev->dev, "can't enable PCI device\n"); | ||
802 | agp_put_bridge(bridge); | ||
803 | return -ENODEV; | ||
804 | } | ||
805 | |||
801 | /* Fill in the mode register */ | 806 | /* Fill in the mode register */ |
802 | if (cap_ptr) { | 807 | if (cap_ptr) { |
803 | pci_read_config_dword(pdev, | 808 | pci_read_config_dword(pdev, |
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 2baa6708e44c..654faa803dcb 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -2674,3 +2674,23 @@ out: | |||
2674 | mutex_unlock(&dev->mode_config.mutex); | 2674 | mutex_unlock(&dev->mode_config.mutex); |
2675 | return ret; | 2675 | return ret; |
2676 | } | 2676 | } |
2677 | |||
2678 | void drm_mode_config_reset(struct drm_device *dev) | ||
2679 | { | ||
2680 | struct drm_crtc *crtc; | ||
2681 | struct drm_encoder *encoder; | ||
2682 | struct drm_connector *connector; | ||
2683 | |||
2684 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) | ||
2685 | if (crtc->funcs->reset) | ||
2686 | crtc->funcs->reset(crtc); | ||
2687 | |||
2688 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) | ||
2689 | if (encoder->funcs->reset) | ||
2690 | encoder->funcs->reset(encoder); | ||
2691 | |||
2692 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) | ||
2693 | if (connector->funcs->reset) | ||
2694 | connector->funcs->reset(connector); | ||
2695 | } | ||
2696 | EXPORT_SYMBOL(drm_mode_config_reset); | ||
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 952b3d4fb2a6..92369655dca3 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -343,13 +343,12 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
343 | struct drm_encoder *encoder; | 343 | struct drm_encoder *encoder; |
344 | bool ret = true; | 344 | bool ret = true; |
345 | 345 | ||
346 | adjusted_mode = drm_mode_duplicate(dev, mode); | ||
347 | |||
348 | crtc->enabled = drm_helper_crtc_in_use(crtc); | 346 | crtc->enabled = drm_helper_crtc_in_use(crtc); |
349 | |||
350 | if (!crtc->enabled) | 347 | if (!crtc->enabled) |
351 | return true; | 348 | return true; |
352 | 349 | ||
350 | adjusted_mode = drm_mode_duplicate(dev, mode); | ||
351 | |||
353 | saved_hwmode = crtc->hwmode; | 352 | saved_hwmode = crtc->hwmode; |
354 | saved_mode = crtc->mode; | 353 | saved_mode = crtc->mode; |
355 | saved_x = crtc->x; | 354 | saved_x = crtc->x; |
@@ -437,10 +436,9 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
437 | */ | 436 | */ |
438 | drm_calc_timestamping_constants(crtc); | 437 | drm_calc_timestamping_constants(crtc); |
439 | 438 | ||
440 | /* XXX free adjustedmode */ | ||
441 | drm_mode_destroy(dev, adjusted_mode); | ||
442 | /* FIXME: add subpixel order */ | 439 | /* FIXME: add subpixel order */ |
443 | done: | 440 | done: |
441 | drm_mode_destroy(dev, adjusted_mode); | ||
444 | if (!ret) { | 442 | if (!ret) { |
445 | crtc->hwmode = saved_hwmode; | 443 | crtc->hwmode = saved_hwmode; |
446 | crtc->mode = saved_mode; | 444 | crtc->mode = saved_mode; |
@@ -497,14 +495,17 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
497 | 495 | ||
498 | crtc_funcs = set->crtc->helper_private; | 496 | crtc_funcs = set->crtc->helper_private; |
499 | 497 | ||
498 | if (!set->mode) | ||
499 | set->fb = NULL; | ||
500 | |||
500 | if (set->fb) { | 501 | if (set->fb) { |
501 | DRM_DEBUG_KMS("[CRTC:%d] [FB:%d] #connectors=%d (x y) (%i %i)\n", | 502 | DRM_DEBUG_KMS("[CRTC:%d] [FB:%d] #connectors=%d (x y) (%i %i)\n", |
502 | set->crtc->base.id, set->fb->base.id, | 503 | set->crtc->base.id, set->fb->base.id, |
503 | (int)set->num_connectors, set->x, set->y); | 504 | (int)set->num_connectors, set->x, set->y); |
504 | } else { | 505 | } else { |
505 | DRM_DEBUG_KMS("[CRTC:%d] [NOFB] #connectors=%d (x y) (%i %i)\n", | 506 | DRM_DEBUG_KMS("[CRTC:%d] [NOFB]\n", set->crtc->base.id); |
506 | set->crtc->base.id, (int)set->num_connectors, | 507 | set->mode = NULL; |
507 | set->x, set->y); | 508 | set->num_connectors = 0; |
508 | } | 509 | } |
509 | 510 | ||
510 | dev = set->crtc->dev; | 511 | dev = set->crtc->dev; |
@@ -649,8 +650,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
649 | mode_changed = true; | 650 | mode_changed = true; |
650 | 651 | ||
651 | if (mode_changed) { | 652 | if (mode_changed) { |
652 | set->crtc->enabled = (set->mode != NULL); | 653 | set->crtc->enabled = drm_helper_crtc_in_use(set->crtc); |
653 | if (set->mode != NULL) { | 654 | if (set->crtc->enabled) { |
654 | DRM_DEBUG_KMS("attempting to set mode from" | 655 | DRM_DEBUG_KMS("attempting to set mode from" |
655 | " userspace\n"); | 656 | " userspace\n"); |
656 | drm_mode_debug_printmodeline(set->mode); | 657 | drm_mode_debug_printmodeline(set->mode); |
@@ -665,6 +666,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
665 | ret = -EINVAL; | 666 | ret = -EINVAL; |
666 | goto fail; | 667 | goto fail; |
667 | } | 668 | } |
669 | DRM_DEBUG_KMS("Setting connector DPMS state to on\n"); | ||
670 | for (i = 0; i < set->num_connectors; i++) { | ||
671 | DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id, | ||
672 | drm_get_connector_name(set->connectors[i])); | ||
673 | set->connectors[i]->dpms = DRM_MODE_DPMS_ON; | ||
674 | } | ||
668 | } | 675 | } |
669 | drm_helper_disable_unused_functions(dev); | 676 | drm_helper_disable_unused_functions(dev); |
670 | } else if (fb_changed) { | 677 | } else if (fb_changed) { |
@@ -681,12 +688,6 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
681 | goto fail; | 688 | goto fail; |
682 | } | 689 | } |
683 | } | 690 | } |
684 | DRM_DEBUG_KMS("Setting connector DPMS state to on\n"); | ||
685 | for (i = 0; i < set->num_connectors; i++) { | ||
686 | DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id, | ||
687 | drm_get_connector_name(set->connectors[i])); | ||
688 | set->connectors[i]->dpms = DRM_MODE_DPMS_ON; | ||
689 | } | ||
690 | 691 | ||
691 | kfree(save_connectors); | 692 | kfree(save_connectors); |
692 | kfree(save_encoders); | 693 | kfree(save_encoders); |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 0054e957203f..3dadfa2a8528 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -1250,7 +1250,7 @@ void drm_handle_vblank_events(struct drm_device *dev, int crtc) | |||
1250 | * Drivers should call this routine in their vblank interrupt handlers to | 1250 | * Drivers should call this routine in their vblank interrupt handlers to |
1251 | * update the vblank counter and send any signals that may be pending. | 1251 | * update the vblank counter and send any signals that may be pending. |
1252 | */ | 1252 | */ |
1253 | void drm_handle_vblank(struct drm_device *dev, int crtc) | 1253 | bool drm_handle_vblank(struct drm_device *dev, int crtc) |
1254 | { | 1254 | { |
1255 | u32 vblcount; | 1255 | u32 vblcount; |
1256 | s64 diff_ns; | 1256 | s64 diff_ns; |
@@ -1258,7 +1258,7 @@ void drm_handle_vblank(struct drm_device *dev, int crtc) | |||
1258 | unsigned long irqflags; | 1258 | unsigned long irqflags; |
1259 | 1259 | ||
1260 | if (!dev->num_crtcs) | 1260 | if (!dev->num_crtcs) |
1261 | return; | 1261 | return false; |
1262 | 1262 | ||
1263 | /* Need timestamp lock to prevent concurrent execution with | 1263 | /* Need timestamp lock to prevent concurrent execution with |
1264 | * vblank enable/disable, as this would cause inconsistent | 1264 | * vblank enable/disable, as this would cause inconsistent |
@@ -1269,7 +1269,7 @@ void drm_handle_vblank(struct drm_device *dev, int crtc) | |||
1269 | /* Vblank irq handling disabled. Nothing to do. */ | 1269 | /* Vblank irq handling disabled. Nothing to do. */ |
1270 | if (!dev->vblank_enabled[crtc]) { | 1270 | if (!dev->vblank_enabled[crtc]) { |
1271 | spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); | 1271 | spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); |
1272 | return; | 1272 | return false; |
1273 | } | 1273 | } |
1274 | 1274 | ||
1275 | /* Fetch corresponding timestamp for this vblank interval from | 1275 | /* Fetch corresponding timestamp for this vblank interval from |
@@ -1311,5 +1311,6 @@ void drm_handle_vblank(struct drm_device *dev, int crtc) | |||
1311 | drm_handle_vblank_events(dev, crtc); | 1311 | drm_handle_vblank_events(dev, crtc); |
1312 | 1312 | ||
1313 | spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); | 1313 | spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); |
1314 | return true; | ||
1314 | } | 1315 | } |
1315 | EXPORT_SYMBOL(drm_handle_vblank); | 1316 | EXPORT_SYMBOL(drm_handle_vblank); |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 66796bb82d3e..cfb56d0ff367 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -354,6 +354,7 @@ static int i915_drm_thaw(struct drm_device *dev) | |||
354 | error = i915_gem_init_ringbuffer(dev); | 354 | error = i915_gem_init_ringbuffer(dev); |
355 | mutex_unlock(&dev->struct_mutex); | 355 | mutex_unlock(&dev->struct_mutex); |
356 | 356 | ||
357 | drm_mode_config_reset(dev); | ||
357 | drm_irq_install(dev); | 358 | drm_irq_install(dev); |
358 | 359 | ||
359 | /* Resume the modeset for every activated CRTC */ | 360 | /* Resume the modeset for every activated CRTC */ |
@@ -542,6 +543,7 @@ int i915_reset(struct drm_device *dev, u8 flags) | |||
542 | 543 | ||
543 | mutex_unlock(&dev->struct_mutex); | 544 | mutex_unlock(&dev->struct_mutex); |
544 | drm_irq_uninstall(dev); | 545 | drm_irq_uninstall(dev); |
546 | drm_mode_config_reset(dev); | ||
545 | drm_irq_install(dev); | 547 | drm_irq_install(dev); |
546 | mutex_lock(&dev->struct_mutex); | 548 | mutex_lock(&dev->struct_mutex); |
547 | } | 549 | } |
@@ -566,6 +568,14 @@ int i915_reset(struct drm_device *dev, u8 flags) | |||
566 | static int __devinit | 568 | static int __devinit |
567 | i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 569 | i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
568 | { | 570 | { |
571 | /* Only bind to function 0 of the device. Early generations | ||
572 | * used function 1 as a placeholder for multi-head. This causes | ||
573 | * us confusion instead, especially on the systems where both | ||
574 | * functions have the same PCI-ID! | ||
575 | */ | ||
576 | if (PCI_FUNC(pdev->devfn)) | ||
577 | return -ENODEV; | ||
578 | |||
569 | return drm_get_pci_dev(pdev, ent, &driver); | 579 | return drm_get_pci_dev(pdev, ent, &driver); |
570 | } | 580 | } |
571 | 581 | ||
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 062f353497e6..97f946dcc1aa 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -1196,18 +1196,18 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | |||
1196 | intel_finish_page_flip_plane(dev, 1); | 1196 | intel_finish_page_flip_plane(dev, 1); |
1197 | } | 1197 | } |
1198 | 1198 | ||
1199 | if (pipea_stats & vblank_status) { | 1199 | if (pipea_stats & vblank_status && |
1200 | drm_handle_vblank(dev, 0)) { | ||
1200 | vblank++; | 1201 | vblank++; |
1201 | drm_handle_vblank(dev, 0); | ||
1202 | if (!dev_priv->flip_pending_is_done) { | 1202 | if (!dev_priv->flip_pending_is_done) { |
1203 | i915_pageflip_stall_check(dev, 0); | 1203 | i915_pageflip_stall_check(dev, 0); |
1204 | intel_finish_page_flip(dev, 0); | 1204 | intel_finish_page_flip(dev, 0); |
1205 | } | 1205 | } |
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | if (pipeb_stats & vblank_status) { | 1208 | if (pipeb_stats & vblank_status && |
1209 | drm_handle_vblank(dev, 1)) { | ||
1209 | vblank++; | 1210 | vblank++; |
1210 | drm_handle_vblank(dev, 1); | ||
1211 | if (!dev_priv->flip_pending_is_done) { | 1211 | if (!dev_priv->flip_pending_is_done) { |
1212 | i915_pageflip_stall_check(dev, 1); | 1212 | i915_pageflip_stall_check(dev, 1); |
1213 | intel_finish_page_flip(dev, 1); | 1213 | intel_finish_page_flip(dev, 1); |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 17035b87ee46..8a77ff4a7237 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
@@ -535,6 +535,15 @@ static int intel_crt_set_property(struct drm_connector *connector, | |||
535 | return 0; | 535 | return 0; |
536 | } | 536 | } |
537 | 537 | ||
538 | static void intel_crt_reset(struct drm_connector *connector) | ||
539 | { | ||
540 | struct drm_device *dev = connector->dev; | ||
541 | struct intel_crt *crt = intel_attached_crt(connector); | ||
542 | |||
543 | if (HAS_PCH_SPLIT(dev)) | ||
544 | crt->force_hotplug_required = 1; | ||
545 | } | ||
546 | |||
538 | /* | 547 | /* |
539 | * Routines for controlling stuff on the analog port | 548 | * Routines for controlling stuff on the analog port |
540 | */ | 549 | */ |
@@ -548,6 +557,7 @@ static const struct drm_encoder_helper_funcs intel_crt_helper_funcs = { | |||
548 | }; | 557 | }; |
549 | 558 | ||
550 | static const struct drm_connector_funcs intel_crt_connector_funcs = { | 559 | static const struct drm_connector_funcs intel_crt_connector_funcs = { |
560 | .reset = intel_crt_reset, | ||
551 | .dpms = drm_helper_connector_dpms, | 561 | .dpms = drm_helper_connector_dpms, |
552 | .detect = intel_crt_detect, | 562 | .detect = intel_crt_detect, |
553 | .fill_modes = drm_helper_probe_single_connector_modes, | 563 | .fill_modes = drm_helper_probe_single_connector_modes, |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index d7f237deaaf0..7e42aa586504 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -5551,6 +5551,18 @@ cleanup_work: | |||
5551 | return ret; | 5551 | return ret; |
5552 | } | 5552 | } |
5553 | 5553 | ||
5554 | static void intel_crtc_reset(struct drm_crtc *crtc) | ||
5555 | { | ||
5556 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
5557 | |||
5558 | /* Reset flags back to the 'unknown' status so that they | ||
5559 | * will be correctly set on the initial modeset. | ||
5560 | */ | ||
5561 | intel_crtc->cursor_addr = 0; | ||
5562 | intel_crtc->dpms_mode = -1; | ||
5563 | intel_crtc->active = true; /* force the pipe off on setup_init_config */ | ||
5564 | } | ||
5565 | |||
5554 | static struct drm_crtc_helper_funcs intel_helper_funcs = { | 5566 | static struct drm_crtc_helper_funcs intel_helper_funcs = { |
5555 | .dpms = intel_crtc_dpms, | 5567 | .dpms = intel_crtc_dpms, |
5556 | .mode_fixup = intel_crtc_mode_fixup, | 5568 | .mode_fixup = intel_crtc_mode_fixup, |
@@ -5562,6 +5574,7 @@ static struct drm_crtc_helper_funcs intel_helper_funcs = { | |||
5562 | }; | 5574 | }; |
5563 | 5575 | ||
5564 | static const struct drm_crtc_funcs intel_crtc_funcs = { | 5576 | static const struct drm_crtc_funcs intel_crtc_funcs = { |
5577 | .reset = intel_crtc_reset, | ||
5565 | .cursor_set = intel_crtc_cursor_set, | 5578 | .cursor_set = intel_crtc_cursor_set, |
5566 | .cursor_move = intel_crtc_cursor_move, | 5579 | .cursor_move = intel_crtc_cursor_move, |
5567 | .gamma_set = intel_crtc_gamma_set, | 5580 | .gamma_set = intel_crtc_gamma_set, |
@@ -5652,9 +5665,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) | |||
5652 | dev_priv->plane_to_crtc_mapping[intel_crtc->plane] = &intel_crtc->base; | 5665 | dev_priv->plane_to_crtc_mapping[intel_crtc->plane] = &intel_crtc->base; |
5653 | dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = &intel_crtc->base; | 5666 | dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = &intel_crtc->base; |
5654 | 5667 | ||
5655 | intel_crtc->cursor_addr = 0; | 5668 | intel_crtc_reset(&intel_crtc->base); |
5656 | intel_crtc->dpms_mode = -1; | ||
5657 | intel_crtc->active = true; /* force the pipe off on setup_init_config */ | ||
5658 | 5669 | ||
5659 | if (HAS_PCH_SPLIT(dev)) { | 5670 | if (HAS_PCH_SPLIT(dev)) { |
5660 | intel_helper_funcs.prepare = ironlake_crtc_prepare; | 5671 | intel_helper_funcs.prepare = ironlake_crtc_prepare; |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 45cd37652a37..6a09c1413d60 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -473,20 +473,6 @@ static bool intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, | |||
473 | return false; | 473 | return false; |
474 | } | 474 | } |
475 | 475 | ||
476 | i = 3; | ||
477 | while (status == SDVO_CMD_STATUS_PENDING && i--) { | ||
478 | if (!intel_sdvo_read_byte(intel_sdvo, | ||
479 | SDVO_I2C_CMD_STATUS, | ||
480 | &status)) | ||
481 | return false; | ||
482 | } | ||
483 | if (status != SDVO_CMD_STATUS_SUCCESS) { | ||
484 | DRM_DEBUG_KMS("command returns response %s [%d]\n", | ||
485 | status <= SDVO_CMD_STATUS_SCALING_NOT_SUPP ? cmd_status_names[status] : "???", | ||
486 | status); | ||
487 | return false; | ||
488 | } | ||
489 | |||
490 | return true; | 476 | return true; |
491 | } | 477 | } |
492 | 478 | ||
@@ -497,6 +483,8 @@ static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, | |||
497 | u8 status; | 483 | u8 status; |
498 | int i; | 484 | int i; |
499 | 485 | ||
486 | DRM_DEBUG_KMS("%s: R: ", SDVO_NAME(intel_sdvo)); | ||
487 | |||
500 | /* | 488 | /* |
501 | * The documentation states that all commands will be | 489 | * The documentation states that all commands will be |
502 | * processed within 15µs, and that we need only poll | 490 | * processed within 15µs, and that we need only poll |
@@ -505,14 +493,19 @@ static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, | |||
505 | * | 493 | * |
506 | * Check 5 times in case the hardware failed to read the docs. | 494 | * Check 5 times in case the hardware failed to read the docs. |
507 | */ | 495 | */ |
508 | do { | 496 | if (!intel_sdvo_read_byte(intel_sdvo, |
497 | SDVO_I2C_CMD_STATUS, | ||
498 | &status)) | ||
499 | goto log_fail; | ||
500 | |||
501 | while (status == SDVO_CMD_STATUS_PENDING && retry--) { | ||
502 | udelay(15); | ||
509 | if (!intel_sdvo_read_byte(intel_sdvo, | 503 | if (!intel_sdvo_read_byte(intel_sdvo, |
510 | SDVO_I2C_CMD_STATUS, | 504 | SDVO_I2C_CMD_STATUS, |
511 | &status)) | 505 | &status)) |
512 | return false; | 506 | goto log_fail; |
513 | } while (status == SDVO_CMD_STATUS_PENDING && --retry); | 507 | } |
514 | 508 | ||
515 | DRM_DEBUG_KMS("%s: R: ", SDVO_NAME(intel_sdvo)); | ||
516 | if (status <= SDVO_CMD_STATUS_SCALING_NOT_SUPP) | 509 | if (status <= SDVO_CMD_STATUS_SCALING_NOT_SUPP) |
517 | DRM_LOG_KMS("(%s)", cmd_status_names[status]); | 510 | DRM_LOG_KMS("(%s)", cmd_status_names[status]); |
518 | else | 511 | else |
@@ -533,7 +526,7 @@ static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, | |||
533 | return true; | 526 | return true; |
534 | 527 | ||
535 | log_fail: | 528 | log_fail: |
536 | DRM_LOG_KMS("\n"); | 529 | DRM_LOG_KMS("... failed\n"); |
537 | return false; | 530 | return false; |
538 | } | 531 | } |
539 | 532 | ||
@@ -550,6 +543,7 @@ static int intel_sdvo_get_pixel_multiplier(struct drm_display_mode *mode) | |||
550 | static bool intel_sdvo_set_control_bus_switch(struct intel_sdvo *intel_sdvo, | 543 | static bool intel_sdvo_set_control_bus_switch(struct intel_sdvo *intel_sdvo, |
551 | u8 ddc_bus) | 544 | u8 ddc_bus) |
552 | { | 545 | { |
546 | /* This must be the immediately preceding write before the i2c xfer */ | ||
553 | return intel_sdvo_write_cmd(intel_sdvo, | 547 | return intel_sdvo_write_cmd(intel_sdvo, |
554 | SDVO_CMD_SET_CONTROL_BUS_SWITCH, | 548 | SDVO_CMD_SET_CONTROL_BUS_SWITCH, |
555 | &ddc_bus, 1); | 549 | &ddc_bus, 1); |
@@ -557,7 +551,10 @@ static bool intel_sdvo_set_control_bus_switch(struct intel_sdvo *intel_sdvo, | |||
557 | 551 | ||
558 | static bool intel_sdvo_set_value(struct intel_sdvo *intel_sdvo, u8 cmd, const void *data, int len) | 552 | static bool intel_sdvo_set_value(struct intel_sdvo *intel_sdvo, u8 cmd, const void *data, int len) |
559 | { | 553 | { |
560 | return intel_sdvo_write_cmd(intel_sdvo, cmd, data, len); | 554 | if (!intel_sdvo_write_cmd(intel_sdvo, cmd, data, len)) |
555 | return false; | ||
556 | |||
557 | return intel_sdvo_read_response(intel_sdvo, NULL, 0); | ||
561 | } | 558 | } |
562 | 559 | ||
563 | static bool | 560 | static bool |
@@ -859,18 +856,21 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo) | |||
859 | 856 | ||
860 | intel_dip_infoframe_csum(&avi_if); | 857 | intel_dip_infoframe_csum(&avi_if); |
861 | 858 | ||
862 | if (!intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_HBUF_INDEX, | 859 | if (!intel_sdvo_set_value(intel_sdvo, |
860 | SDVO_CMD_SET_HBUF_INDEX, | ||
863 | set_buf_index, 2)) | 861 | set_buf_index, 2)) |
864 | return false; | 862 | return false; |
865 | 863 | ||
866 | for (i = 0; i < sizeof(avi_if); i += 8) { | 864 | for (i = 0; i < sizeof(avi_if); i += 8) { |
867 | if (!intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_HBUF_DATA, | 865 | if (!intel_sdvo_set_value(intel_sdvo, |
866 | SDVO_CMD_SET_HBUF_DATA, | ||
868 | data, 8)) | 867 | data, 8)) |
869 | return false; | 868 | return false; |
870 | data++; | 869 | data++; |
871 | } | 870 | } |
872 | 871 | ||
873 | return intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_HBUF_TXRATE, | 872 | return intel_sdvo_set_value(intel_sdvo, |
873 | SDVO_CMD_SET_HBUF_TXRATE, | ||
874 | &tx_rate, 1); | 874 | &tx_rate, 1); |
875 | } | 875 | } |
876 | 876 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c index fb846a3fef15..f05c0cddfeca 100644 --- a/drivers/gpu/drm/nouveau/nouveau_pm.c +++ b/drivers/gpu/drm/nouveau/nouveau_pm.c | |||
@@ -443,7 +443,7 @@ nouveau_hwmon_fini(struct drm_device *dev) | |||
443 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; | 443 | struct nouveau_pm_engine *pm = &dev_priv->engine.pm; |
444 | 444 | ||
445 | if (pm->hwmon) { | 445 | if (pm->hwmon) { |
446 | sysfs_remove_group(&pm->hwmon->kobj, &hwmon_attrgroup); | 446 | sysfs_remove_group(&dev->pdev->dev.kobj, &hwmon_attrgroup); |
447 | hwmon_device_unregister(pm->hwmon); | 447 | hwmon_device_unregister(pm->hwmon); |
448 | } | 448 | } |
449 | #endif | 449 | #endif |
diff --git a/drivers/gpu/drm/nouveau/nv50_evo.c b/drivers/gpu/drm/nouveau/nv50_evo.c index 14e24e906ee8..0ea090f4244a 100644 --- a/drivers/gpu/drm/nouveau/nv50_evo.c +++ b/drivers/gpu/drm/nouveau/nv50_evo.c | |||
@@ -283,8 +283,7 @@ nv50_evo_create(struct drm_device *dev) | |||
283 | nv50_evo_channel_del(&dev_priv->evo); | 283 | nv50_evo_channel_del(&dev_priv->evo); |
284 | return ret; | 284 | return ret; |
285 | } | 285 | } |
286 | } else | 286 | } else { |
287 | if (dev_priv->chipset != 0x50) { | ||
288 | ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoFB16, 0x70, 0x19, | 287 | ret = nv50_evo_dmaobj_new(evo, 0x3d, NvEvoFB16, 0x70, 0x19, |
289 | 0, 0xffffffff, 0x00010000); | 288 | 0, 0xffffffff, 0x00010000); |
290 | if (ret) { | 289 | if (ret) { |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 842954fe74c5..b1537000a104 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -555,6 +555,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
555 | dp_clock = dig_connector->dp_clock; | 555 | dp_clock = dig_connector->dp_clock; |
556 | } | 556 | } |
557 | } | 557 | } |
558 | /* this might work properly with the new pll algo */ | ||
558 | #if 0 /* doesn't work properly on some laptops */ | 559 | #if 0 /* doesn't work properly on some laptops */ |
559 | /* use recommended ref_div for ss */ | 560 | /* use recommended ref_div for ss */ |
560 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { | 561 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { |
@@ -572,6 +573,11 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
572 | adjusted_clock = mode->clock * 2; | 573 | adjusted_clock = mode->clock * 2; |
573 | if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) | 574 | if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) |
574 | pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER; | 575 | pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER; |
576 | /* rv515 needs more testing with this option */ | ||
577 | if (rdev->family != CHIP_RV515) { | ||
578 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) | ||
579 | pll->flags |= RADEON_PLL_IS_LCD; | ||
580 | } | ||
575 | } else { | 581 | } else { |
576 | if (encoder->encoder_type != DRM_MODE_ENCODER_DAC) | 582 | if (encoder->encoder_type != DRM_MODE_ENCODER_DAC) |
577 | pll->flags |= RADEON_PLL_NO_ODD_POST_DIV; | 583 | pll->flags |= RADEON_PLL_NO_ODD_POST_DIV; |
@@ -951,8 +957,16 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode | |||
951 | /* adjust pixel clock as needed */ | 957 | /* adjust pixel clock as needed */ |
952 | adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss); | 958 | adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss); |
953 | 959 | ||
954 | radeon_compute_pll(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, | 960 | /* rv515 seems happier with the old algo */ |
955 | &ref_div, &post_div); | 961 | if (rdev->family == CHIP_RV515) |
962 | radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, | ||
963 | &ref_div, &post_div); | ||
964 | else if (ASIC_IS_AVIVO(rdev)) | ||
965 | radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, | ||
966 | &ref_div, &post_div); | ||
967 | else | ||
968 | radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, | ||
969 | &ref_div, &post_div); | ||
956 | 970 | ||
957 | atombios_crtc_program_ss(crtc, ATOM_DISABLE, radeon_crtc->pll_id, &ss); | 971 | atombios_crtc_program_ss(crtc, ATOM_DISABLE, radeon_crtc->pll_id, &ss); |
958 | 972 | ||
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 677af91b555c..ffdc8332b76e 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -97,26 +97,29 @@ u32 evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) | |||
97 | } | 97 | } |
98 | 98 | ||
99 | /* get temperature in millidegrees */ | 99 | /* get temperature in millidegrees */ |
100 | u32 evergreen_get_temp(struct radeon_device *rdev) | 100 | int evergreen_get_temp(struct radeon_device *rdev) |
101 | { | 101 | { |
102 | u32 temp = (RREG32(CG_MULT_THERMAL_STATUS) & ASIC_T_MASK) >> | 102 | u32 temp = (RREG32(CG_MULT_THERMAL_STATUS) & ASIC_T_MASK) >> |
103 | ASIC_T_SHIFT; | 103 | ASIC_T_SHIFT; |
104 | u32 actual_temp = 0; | 104 | u32 actual_temp = 0; |
105 | 105 | ||
106 | if ((temp >> 10) & 1) | 106 | if (temp & 0x400) |
107 | actual_temp = 0; | 107 | actual_temp = -256; |
108 | else if ((temp >> 9) & 1) | 108 | else if (temp & 0x200) |
109 | actual_temp = 255; | 109 | actual_temp = 255; |
110 | else | 110 | else if (temp & 0x100) { |
111 | actual_temp = (temp >> 1) & 0xff; | 111 | actual_temp = temp & 0x1ff; |
112 | actual_temp |= ~0x1ff; | ||
113 | } else | ||
114 | actual_temp = temp & 0xff; | ||
112 | 115 | ||
113 | return actual_temp * 1000; | 116 | return (actual_temp * 1000) / 2; |
114 | } | 117 | } |
115 | 118 | ||
116 | u32 sumo_get_temp(struct radeon_device *rdev) | 119 | int sumo_get_temp(struct radeon_device *rdev) |
117 | { | 120 | { |
118 | u32 temp = RREG32(CG_THERMAL_STATUS) & 0xff; | 121 | u32 temp = RREG32(CG_THERMAL_STATUS) & 0xff; |
119 | u32 actual_temp = (temp >> 1) & 0xff; | 122 | int actual_temp = temp - 49; |
120 | 123 | ||
121 | return actual_temp * 1000; | 124 | return actual_temp * 1000; |
122 | } | 125 | } |
@@ -1182,6 +1185,18 @@ static void evergreen_mc_program(struct radeon_device *rdev) | |||
1182 | /* | 1185 | /* |
1183 | * CP. | 1186 | * CP. |
1184 | */ | 1187 | */ |
1188 | void evergreen_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) | ||
1189 | { | ||
1190 | /* set to DX10/11 mode */ | ||
1191 | radeon_ring_write(rdev, PACKET3(PACKET3_MODE_CONTROL, 0)); | ||
1192 | radeon_ring_write(rdev, 1); | ||
1193 | /* FIXME: implement */ | ||
1194 | radeon_ring_write(rdev, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); | ||
1195 | radeon_ring_write(rdev, ib->gpu_addr & 0xFFFFFFFC); | ||
1196 | radeon_ring_write(rdev, upper_32_bits(ib->gpu_addr) & 0xFF); | ||
1197 | radeon_ring_write(rdev, ib->length_dw); | ||
1198 | } | ||
1199 | |||
1185 | 1200 | ||
1186 | static int evergreen_cp_load_microcode(struct radeon_device *rdev) | 1201 | static int evergreen_cp_load_microcode(struct radeon_device *rdev) |
1187 | { | 1202 | { |
@@ -1233,7 +1248,7 @@ static int evergreen_cp_start(struct radeon_device *rdev) | |||
1233 | cp_me = 0xff; | 1248 | cp_me = 0xff; |
1234 | WREG32(CP_ME_CNTL, cp_me); | 1249 | WREG32(CP_ME_CNTL, cp_me); |
1235 | 1250 | ||
1236 | r = radeon_ring_lock(rdev, evergreen_default_size + 15); | 1251 | r = radeon_ring_lock(rdev, evergreen_default_size + 19); |
1237 | if (r) { | 1252 | if (r) { |
1238 | DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r); | 1253 | DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r); |
1239 | return r; | 1254 | return r; |
@@ -1266,6 +1281,11 @@ static int evergreen_cp_start(struct radeon_device *rdev) | |||
1266 | radeon_ring_write(rdev, 0xffffffff); | 1281 | radeon_ring_write(rdev, 0xffffffff); |
1267 | radeon_ring_write(rdev, 0xffffffff); | 1282 | radeon_ring_write(rdev, 0xffffffff); |
1268 | 1283 | ||
1284 | radeon_ring_write(rdev, 0xc0026900); | ||
1285 | radeon_ring_write(rdev, 0x00000316); | ||
1286 | radeon_ring_write(rdev, 0x0000000e); /* VGT_VERTEX_REUSE_BLOCK_CNTL */ | ||
1287 | radeon_ring_write(rdev, 0x00000010); /* */ | ||
1288 | |||
1269 | radeon_ring_unlock_commit(rdev); | 1289 | radeon_ring_unlock_commit(rdev); |
1270 | 1290 | ||
1271 | return 0; | 1291 | return 0; |
@@ -2072,6 +2092,7 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
2072 | WREG32(VGT_CACHE_INVALIDATION, vgt_cache_invalidation); | 2092 | WREG32(VGT_CACHE_INVALIDATION, vgt_cache_invalidation); |
2073 | 2093 | ||
2074 | WREG32(VGT_GS_VERTEX_REUSE, 16); | 2094 | WREG32(VGT_GS_VERTEX_REUSE, 16); |
2095 | WREG32(PA_SU_LINE_STIPPLE_VALUE, 0); | ||
2075 | WREG32(PA_SC_LINE_STIPPLE_STATE, 0); | 2096 | WREG32(PA_SC_LINE_STIPPLE_STATE, 0); |
2076 | 2097 | ||
2077 | WREG32(VGT_VERTEX_REUSE_BLOCK_CNTL, 14); | 2098 | WREG32(VGT_VERTEX_REUSE_BLOCK_CNTL, 14); |
diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c index d4d4db49a8b8..a1ba4b3053d0 100644 --- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c +++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c | |||
@@ -232,7 +232,7 @@ draw_auto(struct radeon_device *rdev) | |||
232 | 232 | ||
233 | } | 233 | } |
234 | 234 | ||
235 | /* emits 34 */ | 235 | /* emits 36 */ |
236 | static void | 236 | static void |
237 | set_default_state(struct radeon_device *rdev) | 237 | set_default_state(struct radeon_device *rdev) |
238 | { | 238 | { |
@@ -499,6 +499,10 @@ set_default_state(struct radeon_device *rdev) | |||
499 | radeon_ring_write(rdev, 0x00000000); | 499 | radeon_ring_write(rdev, 0x00000000); |
500 | radeon_ring_write(rdev, 0x00000000); | 500 | radeon_ring_write(rdev, 0x00000000); |
501 | 501 | ||
502 | /* set to DX10/11 mode */ | ||
503 | radeon_ring_write(rdev, PACKET3(PACKET3_MODE_CONTROL, 0)); | ||
504 | radeon_ring_write(rdev, 1); | ||
505 | |||
502 | /* emit an IB pointing at default state */ | 506 | /* emit an IB pointing at default state */ |
503 | dwords = ALIGN(rdev->r600_blit.state_len, 0x10); | 507 | dwords = ALIGN(rdev->r600_blit.state_len, 0x10); |
504 | gpu_addr = rdev->r600_blit.shader_gpu_addr + rdev->r600_blit.state_offset; | 508 | gpu_addr = rdev->r600_blit.shader_gpu_addr + rdev->r600_blit.state_offset; |
@@ -679,7 +683,7 @@ int evergreen_blit_prepare_copy(struct radeon_device *rdev, int size_bytes) | |||
679 | /* calculate number of loops correctly */ | 683 | /* calculate number of loops correctly */ |
680 | ring_size = num_loops * dwords_per_loop; | 684 | ring_size = num_loops * dwords_per_loop; |
681 | /* set default + shaders */ | 685 | /* set default + shaders */ |
682 | ring_size += 50; /* shaders + def state */ | 686 | ring_size += 52; /* shaders + def state */ |
683 | ring_size += 10; /* fence emit for VB IB */ | 687 | ring_size += 10; /* fence emit for VB IB */ |
684 | ring_size += 5; /* done copy */ | 688 | ring_size += 5; /* done copy */ |
685 | ring_size += 10; /* fence emit for done copy */ | 689 | ring_size += 10; /* fence emit for done copy */ |
@@ -687,7 +691,7 @@ int evergreen_blit_prepare_copy(struct radeon_device *rdev, int size_bytes) | |||
687 | if (r) | 691 | if (r) |
688 | return r; | 692 | return r; |
689 | 693 | ||
690 | set_default_state(rdev); /* 34 */ | 694 | set_default_state(rdev); /* 36 */ |
691 | set_shaders(rdev); /* 16 */ | 695 | set_shaders(rdev); /* 16 */ |
692 | return 0; | 696 | return 0; |
693 | } | 697 | } |
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h index 36d32d83d866..afec1aca2a73 100644 --- a/drivers/gpu/drm/radeon/evergreend.h +++ b/drivers/gpu/drm/radeon/evergreend.h | |||
@@ -240,6 +240,7 @@ | |||
240 | #define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0) | 240 | #define FORCE_EOV_MAX_CLK_CNT(x) ((x) << 0) |
241 | #define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16) | 241 | #define FORCE_EOV_MAX_REZ_CNT(x) ((x) << 16) |
242 | #define PA_SC_LINE_STIPPLE 0x28A0C | 242 | #define PA_SC_LINE_STIPPLE 0x28A0C |
243 | #define PA_SU_LINE_STIPPLE_VALUE 0x8A60 | ||
243 | #define PA_SC_LINE_STIPPLE_STATE 0x8B10 | 244 | #define PA_SC_LINE_STIPPLE_STATE 0x8B10 |
244 | 245 | ||
245 | #define SCRATCH_REG0 0x8500 | 246 | #define SCRATCH_REG0 0x8500 |
@@ -652,6 +653,7 @@ | |||
652 | #define PACKET3_DISPATCH_DIRECT 0x15 | 653 | #define PACKET3_DISPATCH_DIRECT 0x15 |
653 | #define PACKET3_DISPATCH_INDIRECT 0x16 | 654 | #define PACKET3_DISPATCH_INDIRECT 0x16 |
654 | #define PACKET3_INDIRECT_BUFFER_END 0x17 | 655 | #define PACKET3_INDIRECT_BUFFER_END 0x17 |
656 | #define PACKET3_MODE_CONTROL 0x18 | ||
655 | #define PACKET3_SET_PREDICATION 0x20 | 657 | #define PACKET3_SET_PREDICATION 0x20 |
656 | #define PACKET3_REG_RMW 0x21 | 658 | #define PACKET3_REG_RMW 0x21 |
657 | #define PACKET3_COND_EXEC 0x22 | 659 | #define PACKET3_COND_EXEC 0x22 |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 1e10e3e2ba2a..650672a0f5ad 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -97,12 +97,16 @@ void r600_irq_disable(struct radeon_device *rdev); | |||
97 | static void r600_pcie_gen2_enable(struct radeon_device *rdev); | 97 | static void r600_pcie_gen2_enable(struct radeon_device *rdev); |
98 | 98 | ||
99 | /* get temperature in millidegrees */ | 99 | /* get temperature in millidegrees */ |
100 | u32 rv6xx_get_temp(struct radeon_device *rdev) | 100 | int rv6xx_get_temp(struct radeon_device *rdev) |
101 | { | 101 | { |
102 | u32 temp = (RREG32(CG_THERMAL_STATUS) & ASIC_T_MASK) >> | 102 | u32 temp = (RREG32(CG_THERMAL_STATUS) & ASIC_T_MASK) >> |
103 | ASIC_T_SHIFT; | 103 | ASIC_T_SHIFT; |
104 | int actual_temp = temp & 0xff; | ||
104 | 105 | ||
105 | return temp * 1000; | 106 | if (temp & 0x100) |
107 | actual_temp -= 256; | ||
108 | |||
109 | return actual_temp * 1000; | ||
106 | } | 110 | } |
107 | 111 | ||
108 | void r600_pm_get_dynpm_state(struct radeon_device *rdev) | 112 | void r600_pm_get_dynpm_state(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 71d2a554bbe6..56c48b67ef3d 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -179,10 +179,10 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev); | |||
179 | void radeon_atombios_get_power_modes(struct radeon_device *rdev); | 179 | void radeon_atombios_get_power_modes(struct radeon_device *rdev); |
180 | void radeon_atom_set_voltage(struct radeon_device *rdev, u16 level); | 180 | void radeon_atom_set_voltage(struct radeon_device *rdev, u16 level); |
181 | void rs690_pm_info(struct radeon_device *rdev); | 181 | void rs690_pm_info(struct radeon_device *rdev); |
182 | extern u32 rv6xx_get_temp(struct radeon_device *rdev); | 182 | extern int rv6xx_get_temp(struct radeon_device *rdev); |
183 | extern u32 rv770_get_temp(struct radeon_device *rdev); | 183 | extern int rv770_get_temp(struct radeon_device *rdev); |
184 | extern u32 evergreen_get_temp(struct radeon_device *rdev); | 184 | extern int evergreen_get_temp(struct radeon_device *rdev); |
185 | extern u32 sumo_get_temp(struct radeon_device *rdev); | 185 | extern int sumo_get_temp(struct radeon_device *rdev); |
186 | 186 | ||
187 | /* | 187 | /* |
188 | * Fences. | 188 | * Fences. |
@@ -812,8 +812,7 @@ struct radeon_pm { | |||
812 | fixed20_12 sclk; | 812 | fixed20_12 sclk; |
813 | fixed20_12 mclk; | 813 | fixed20_12 mclk; |
814 | fixed20_12 needed_bandwidth; | 814 | fixed20_12 needed_bandwidth; |
815 | /* XXX: use a define for num power modes */ | 815 | struct radeon_power_state *power_state; |
816 | struct radeon_power_state power_state[8]; | ||
817 | /* number of valid power states */ | 816 | /* number of valid power states */ |
818 | int num_power_states; | 817 | int num_power_states; |
819 | int current_power_state_index; | 818 | int current_power_state_index; |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index 3a1b16186224..e75d63b8e21d 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
@@ -759,7 +759,7 @@ static struct radeon_asic evergreen_asic = { | |||
759 | .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush, | 759 | .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush, |
760 | .gart_set_page = &rs600_gart_set_page, | 760 | .gart_set_page = &rs600_gart_set_page, |
761 | .ring_test = &r600_ring_test, | 761 | .ring_test = &r600_ring_test, |
762 | .ring_ib_execute = &r600_ring_ib_execute, | 762 | .ring_ib_execute = &evergreen_ring_ib_execute, |
763 | .irq_set = &evergreen_irq_set, | 763 | .irq_set = &evergreen_irq_set, |
764 | .irq_process = &evergreen_irq_process, | 764 | .irq_process = &evergreen_irq_process, |
765 | .get_vblank_counter = &evergreen_get_vblank_counter, | 765 | .get_vblank_counter = &evergreen_get_vblank_counter, |
@@ -805,7 +805,7 @@ static struct radeon_asic sumo_asic = { | |||
805 | .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush, | 805 | .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush, |
806 | .gart_set_page = &rs600_gart_set_page, | 806 | .gart_set_page = &rs600_gart_set_page, |
807 | .ring_test = &r600_ring_test, | 807 | .ring_test = &r600_ring_test, |
808 | .ring_ib_execute = &r600_ring_ib_execute, | 808 | .ring_ib_execute = &evergreen_ring_ib_execute, |
809 | .irq_set = &evergreen_irq_set, | 809 | .irq_set = &evergreen_irq_set, |
810 | .irq_process = &evergreen_irq_process, | 810 | .irq_process = &evergreen_irq_process, |
811 | .get_vblank_counter = &evergreen_get_vblank_counter, | 811 | .get_vblank_counter = &evergreen_get_vblank_counter, |
@@ -848,7 +848,7 @@ static struct radeon_asic btc_asic = { | |||
848 | .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush, | 848 | .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush, |
849 | .gart_set_page = &rs600_gart_set_page, | 849 | .gart_set_page = &rs600_gart_set_page, |
850 | .ring_test = &r600_ring_test, | 850 | .ring_test = &r600_ring_test, |
851 | .ring_ib_execute = &r600_ring_ib_execute, | 851 | .ring_ib_execute = &evergreen_ring_ib_execute, |
852 | .irq_set = &evergreen_irq_set, | 852 | .irq_set = &evergreen_irq_set, |
853 | .irq_process = &evergreen_irq_process, | 853 | .irq_process = &evergreen_irq_process, |
854 | .get_vblank_counter = &evergreen_get_vblank_counter, | 854 | .get_vblank_counter = &evergreen_get_vblank_counter, |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index e01f07718539..c59bd98a2029 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h | |||
@@ -355,6 +355,7 @@ int evergreen_resume(struct radeon_device *rdev); | |||
355 | bool evergreen_gpu_is_lockup(struct radeon_device *rdev); | 355 | bool evergreen_gpu_is_lockup(struct radeon_device *rdev); |
356 | int evergreen_asic_reset(struct radeon_device *rdev); | 356 | int evergreen_asic_reset(struct radeon_device *rdev); |
357 | void evergreen_bandwidth_update(struct radeon_device *rdev); | 357 | void evergreen_bandwidth_update(struct radeon_device *rdev); |
358 | void evergreen_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); | ||
358 | int evergreen_copy_blit(struct radeon_device *rdev, | 359 | int evergreen_copy_blit(struct radeon_device *rdev, |
359 | uint64_t src_offset, uint64_t dst_offset, | 360 | uint64_t src_offset, uint64_t dst_offset, |
360 | unsigned num_pages, struct radeon_fence *fence); | 361 | unsigned num_pages, struct radeon_fence *fence); |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 52777902bbcc..5c1cc7ad9a15 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -1163,16 +1163,6 @@ bool radeon_atom_get_clock_info(struct drm_device *dev) | |||
1163 | p1pll->pll_out_min = 64800; | 1163 | p1pll->pll_out_min = 64800; |
1164 | else | 1164 | else |
1165 | p1pll->pll_out_min = 20000; | 1165 | p1pll->pll_out_min = 20000; |
1166 | } else if (p1pll->pll_out_min > 64800) { | ||
1167 | /* Limiting the pll output range is a good thing generally as | ||
1168 | * it limits the number of possible pll combinations for a given | ||
1169 | * frequency presumably to the ones that work best on each card. | ||
1170 | * However, certain duallink DVI monitors seem to like | ||
1171 | * pll combinations that would be limited by this at least on | ||
1172 | * pre-DCE 3.0 r6xx hardware. This might need to be adjusted per | ||
1173 | * family. | ||
1174 | */ | ||
1175 | p1pll->pll_out_min = 64800; | ||
1176 | } | 1166 | } |
1177 | 1167 | ||
1178 | p1pll->pll_in_min = | 1168 | p1pll->pll_in_min = |
@@ -1987,6 +1977,9 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev) | |||
1987 | num_modes = power_info->info.ucNumOfPowerModeEntries; | 1977 | num_modes = power_info->info.ucNumOfPowerModeEntries; |
1988 | if (num_modes > ATOM_MAX_NUMBEROF_POWER_BLOCK) | 1978 | if (num_modes > ATOM_MAX_NUMBEROF_POWER_BLOCK) |
1989 | num_modes = ATOM_MAX_NUMBEROF_POWER_BLOCK; | 1979 | num_modes = ATOM_MAX_NUMBEROF_POWER_BLOCK; |
1980 | rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state) * num_modes, GFP_KERNEL); | ||
1981 | if (!rdev->pm.power_state) | ||
1982 | return state_index; | ||
1990 | /* last mode is usually default, array is low to high */ | 1983 | /* last mode is usually default, array is low to high */ |
1991 | for (i = 0; i < num_modes; i++) { | 1984 | for (i = 0; i < num_modes; i++) { |
1992 | rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE; | 1985 | rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE; |
@@ -2338,6 +2331,10 @@ static int radeon_atombios_parse_power_table_4_5(struct radeon_device *rdev) | |||
2338 | power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); | 2331 | power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); |
2339 | 2332 | ||
2340 | radeon_atombios_add_pplib_thermal_controller(rdev, &power_info->pplib.sThermalController); | 2333 | radeon_atombios_add_pplib_thermal_controller(rdev, &power_info->pplib.sThermalController); |
2334 | rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state) * | ||
2335 | power_info->pplib.ucNumStates, GFP_KERNEL); | ||
2336 | if (!rdev->pm.power_state) | ||
2337 | return state_index; | ||
2341 | /* first mode is usually default, followed by low to high */ | 2338 | /* first mode is usually default, followed by low to high */ |
2342 | for (i = 0; i < power_info->pplib.ucNumStates; i++) { | 2339 | for (i = 0; i < power_info->pplib.ucNumStates; i++) { |
2343 | mode_index = 0; | 2340 | mode_index = 0; |
@@ -2418,6 +2415,10 @@ static int radeon_atombios_parse_power_table_6(struct radeon_device *rdev) | |||
2418 | non_clock_info_array = (struct NonClockInfoArray *) | 2415 | non_clock_info_array = (struct NonClockInfoArray *) |
2419 | (mode_info->atom_context->bios + data_offset + | 2416 | (mode_info->atom_context->bios + data_offset + |
2420 | power_info->pplib.usNonClockInfoArrayOffset); | 2417 | power_info->pplib.usNonClockInfoArrayOffset); |
2418 | rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state) * | ||
2419 | state_array->ucNumEntries, GFP_KERNEL); | ||
2420 | if (!rdev->pm.power_state) | ||
2421 | return state_index; | ||
2421 | for (i = 0; i < state_array->ucNumEntries; i++) { | 2422 | for (i = 0; i < state_array->ucNumEntries; i++) { |
2422 | mode_index = 0; | 2423 | mode_index = 0; |
2423 | power_state = (union pplib_power_state *)&state_array->states[i]; | 2424 | power_state = (union pplib_power_state *)&state_array->states[i]; |
@@ -2491,19 +2492,22 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev) | |||
2491 | break; | 2492 | break; |
2492 | } | 2493 | } |
2493 | } else { | 2494 | } else { |
2494 | /* add the default mode */ | 2495 | rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state), GFP_KERNEL); |
2495 | rdev->pm.power_state[state_index].type = | 2496 | if (rdev->pm.power_state) { |
2496 | POWER_STATE_TYPE_DEFAULT; | 2497 | /* add the default mode */ |
2497 | rdev->pm.power_state[state_index].num_clock_modes = 1; | 2498 | rdev->pm.power_state[state_index].type = |
2498 | rdev->pm.power_state[state_index].clock_info[0].mclk = rdev->clock.default_mclk; | 2499 | POWER_STATE_TYPE_DEFAULT; |
2499 | rdev->pm.power_state[state_index].clock_info[0].sclk = rdev->clock.default_sclk; | 2500 | rdev->pm.power_state[state_index].num_clock_modes = 1; |
2500 | rdev->pm.power_state[state_index].default_clock_mode = | 2501 | rdev->pm.power_state[state_index].clock_info[0].mclk = rdev->clock.default_mclk; |
2501 | &rdev->pm.power_state[state_index].clock_info[0]; | 2502 | rdev->pm.power_state[state_index].clock_info[0].sclk = rdev->clock.default_sclk; |
2502 | rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE; | 2503 | rdev->pm.power_state[state_index].default_clock_mode = |
2503 | rdev->pm.power_state[state_index].pcie_lanes = 16; | 2504 | &rdev->pm.power_state[state_index].clock_info[0]; |
2504 | rdev->pm.default_power_state_index = state_index; | 2505 | rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE; |
2505 | rdev->pm.power_state[state_index].flags = 0; | 2506 | rdev->pm.power_state[state_index].pcie_lanes = 16; |
2506 | state_index++; | 2507 | rdev->pm.default_power_state_index = state_index; |
2508 | rdev->pm.power_state[state_index].flags = 0; | ||
2509 | state_index++; | ||
2510 | } | ||
2507 | } | 2511 | } |
2508 | 2512 | ||
2509 | rdev->pm.num_power_states = state_index; | 2513 | rdev->pm.num_power_states = state_index; |
@@ -2619,7 +2623,7 @@ void radeon_atom_initialize_bios_scratch_regs(struct drm_device *dev) | |||
2619 | bios_2_scratch &= ~ATOM_S2_VRI_BRIGHT_ENABLE; | 2623 | bios_2_scratch &= ~ATOM_S2_VRI_BRIGHT_ENABLE; |
2620 | 2624 | ||
2621 | /* tell the bios not to handle mode switching */ | 2625 | /* tell the bios not to handle mode switching */ |
2622 | bios_6_scratch |= (ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH | ATOM_S6_ACC_MODE); | 2626 | bios_6_scratch |= ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH; |
2623 | 2627 | ||
2624 | if (rdev->family >= CHIP_R600) { | 2628 | if (rdev->family >= CHIP_R600) { |
2625 | WREG32(R600_BIOS_2_SCRATCH, bios_2_scratch); | 2629 | WREG32(R600_BIOS_2_SCRATCH, bios_2_scratch); |
@@ -2670,10 +2674,13 @@ void radeon_atom_output_lock(struct drm_encoder *encoder, bool lock) | |||
2670 | else | 2674 | else |
2671 | bios_6_scratch = RREG32(RADEON_BIOS_6_SCRATCH); | 2675 | bios_6_scratch = RREG32(RADEON_BIOS_6_SCRATCH); |
2672 | 2676 | ||
2673 | if (lock) | 2677 | if (lock) { |
2674 | bios_6_scratch |= ATOM_S6_CRITICAL_STATE; | 2678 | bios_6_scratch |= ATOM_S6_CRITICAL_STATE; |
2675 | else | 2679 | bios_6_scratch &= ~ATOM_S6_ACC_MODE; |
2680 | } else { | ||
2676 | bios_6_scratch &= ~ATOM_S6_CRITICAL_STATE; | 2681 | bios_6_scratch &= ~ATOM_S6_CRITICAL_STATE; |
2682 | bios_6_scratch |= ATOM_S6_ACC_MODE; | ||
2683 | } | ||
2677 | 2684 | ||
2678 | if (rdev->family >= CHIP_R600) | 2685 | if (rdev->family >= CHIP_R600) |
2679 | WREG32(R600_BIOS_6_SCRATCH, bios_6_scratch); | 2686 | WREG32(R600_BIOS_6_SCRATCH, bios_6_scratch); |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 591fcae8f224..d27ef74590cd 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -2442,6 +2442,17 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev) | |||
2442 | 2442 | ||
2443 | rdev->pm.default_power_state_index = -1; | 2443 | rdev->pm.default_power_state_index = -1; |
2444 | 2444 | ||
2445 | /* allocate 2 power states */ | ||
2446 | rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state) * 2, GFP_KERNEL); | ||
2447 | if (!rdev->pm.power_state) { | ||
2448 | rdev->pm.default_power_state_index = state_index; | ||
2449 | rdev->pm.num_power_states = 0; | ||
2450 | |||
2451 | rdev->pm.current_power_state_index = rdev->pm.default_power_state_index; | ||
2452 | rdev->pm.current_clock_mode_index = 0; | ||
2453 | return; | ||
2454 | } | ||
2455 | |||
2445 | if (rdev->flags & RADEON_IS_MOBILITY) { | 2456 | if (rdev->flags & RADEON_IS_MOBILITY) { |
2446 | offset = combios_get_table_offset(dev, COMBIOS_POWERPLAY_INFO_TABLE); | 2457 | offset = combios_get_table_offset(dev, COMBIOS_POWERPLAY_INFO_TABLE); |
2447 | if (offset) { | 2458 | if (offset) { |
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index d26dabf878d9..2eff98cfd728 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -780,6 +780,115 @@ static int radeon_ddc_dump(struct drm_connector *connector) | |||
780 | return ret; | 780 | return ret; |
781 | } | 781 | } |
782 | 782 | ||
783 | /* avivo */ | ||
784 | static void avivo_get_fb_div(struct radeon_pll *pll, | ||
785 | u32 target_clock, | ||
786 | u32 post_div, | ||
787 | u32 ref_div, | ||
788 | u32 *fb_div, | ||
789 | u32 *frac_fb_div) | ||
790 | { | ||
791 | u32 tmp = post_div * ref_div; | ||
792 | |||
793 | tmp *= target_clock; | ||
794 | *fb_div = tmp / pll->reference_freq; | ||
795 | *frac_fb_div = tmp % pll->reference_freq; | ||
796 | } | ||
797 | |||
798 | static u32 avivo_get_post_div(struct radeon_pll *pll, | ||
799 | u32 target_clock) | ||
800 | { | ||
801 | u32 vco, post_div, tmp; | ||
802 | |||
803 | if (pll->flags & RADEON_PLL_USE_POST_DIV) | ||
804 | return pll->post_div; | ||
805 | |||
806 | if (pll->flags & RADEON_PLL_PREFER_MINM_OVER_MAXP) { | ||
807 | if (pll->flags & RADEON_PLL_IS_LCD) | ||
808 | vco = pll->lcd_pll_out_min; | ||
809 | else | ||
810 | vco = pll->pll_out_min; | ||
811 | } else { | ||
812 | if (pll->flags & RADEON_PLL_IS_LCD) | ||
813 | vco = pll->lcd_pll_out_max; | ||
814 | else | ||
815 | vco = pll->pll_out_max; | ||
816 | } | ||
817 | |||
818 | post_div = vco / target_clock; | ||
819 | tmp = vco % target_clock; | ||
820 | |||
821 | if (pll->flags & RADEON_PLL_PREFER_MINM_OVER_MAXP) { | ||
822 | if (tmp) | ||
823 | post_div++; | ||
824 | } else { | ||
825 | if (!tmp) | ||
826 | post_div--; | ||
827 | } | ||
828 | |||
829 | return post_div; | ||
830 | } | ||
831 | |||
832 | #define MAX_TOLERANCE 10 | ||
833 | |||
834 | void radeon_compute_pll_avivo(struct radeon_pll *pll, | ||
835 | u32 freq, | ||
836 | u32 *dot_clock_p, | ||
837 | u32 *fb_div_p, | ||
838 | u32 *frac_fb_div_p, | ||
839 | u32 *ref_div_p, | ||
840 | u32 *post_div_p) | ||
841 | { | ||
842 | u32 target_clock = freq / 10; | ||
843 | u32 post_div = avivo_get_post_div(pll, target_clock); | ||
844 | u32 ref_div = pll->min_ref_div; | ||
845 | u32 fb_div = 0, frac_fb_div = 0, tmp; | ||
846 | |||
847 | if (pll->flags & RADEON_PLL_USE_REF_DIV) | ||
848 | ref_div = pll->reference_div; | ||
849 | |||
850 | if (pll->flags & RADEON_PLL_USE_FRAC_FB_DIV) { | ||
851 | avivo_get_fb_div(pll, target_clock, post_div, ref_div, &fb_div, &frac_fb_div); | ||
852 | frac_fb_div = (100 * frac_fb_div) / pll->reference_freq; | ||
853 | if (frac_fb_div >= 5) { | ||
854 | frac_fb_div -= 5; | ||
855 | frac_fb_div = frac_fb_div / 10; | ||
856 | frac_fb_div++; | ||
857 | } | ||
858 | if (frac_fb_div >= 10) { | ||
859 | fb_div++; | ||
860 | frac_fb_div = 0; | ||
861 | } | ||
862 | } else { | ||
863 | while (ref_div <= pll->max_ref_div) { | ||
864 | avivo_get_fb_div(pll, target_clock, post_div, ref_div, | ||
865 | &fb_div, &frac_fb_div); | ||
866 | if (frac_fb_div >= (pll->reference_freq / 2)) | ||
867 | fb_div++; | ||
868 | frac_fb_div = 0; | ||
869 | tmp = (pll->reference_freq * fb_div) / (post_div * ref_div); | ||
870 | tmp = (tmp * 10000) / target_clock; | ||
871 | |||
872 | if (tmp > (10000 + MAX_TOLERANCE)) | ||
873 | ref_div++; | ||
874 | else if (tmp >= (10000 - MAX_TOLERANCE)) | ||
875 | break; | ||
876 | else | ||
877 | ref_div++; | ||
878 | } | ||
879 | } | ||
880 | |||
881 | *dot_clock_p = ((pll->reference_freq * fb_div * 10) + (pll->reference_freq * frac_fb_div)) / | ||
882 | (ref_div * post_div * 10); | ||
883 | *fb_div_p = fb_div; | ||
884 | *frac_fb_div_p = frac_fb_div; | ||
885 | *ref_div_p = ref_div; | ||
886 | *post_div_p = post_div; | ||
887 | DRM_DEBUG_KMS("%d, pll dividers - fb: %d.%d ref: %d, post %d\n", | ||
888 | *dot_clock_p, fb_div, frac_fb_div, ref_div, post_div); | ||
889 | } | ||
890 | |||
891 | /* pre-avivo */ | ||
783 | static inline uint32_t radeon_div(uint64_t n, uint32_t d) | 892 | static inline uint32_t radeon_div(uint64_t n, uint32_t d) |
784 | { | 893 | { |
785 | uint64_t mod; | 894 | uint64_t mod; |
@@ -790,13 +899,13 @@ static inline uint32_t radeon_div(uint64_t n, uint32_t d) | |||
790 | return n; | 899 | return n; |
791 | } | 900 | } |
792 | 901 | ||
793 | void radeon_compute_pll(struct radeon_pll *pll, | 902 | void radeon_compute_pll_legacy(struct radeon_pll *pll, |
794 | uint64_t freq, | 903 | uint64_t freq, |
795 | uint32_t *dot_clock_p, | 904 | uint32_t *dot_clock_p, |
796 | uint32_t *fb_div_p, | 905 | uint32_t *fb_div_p, |
797 | uint32_t *frac_fb_div_p, | 906 | uint32_t *frac_fb_div_p, |
798 | uint32_t *ref_div_p, | 907 | uint32_t *ref_div_p, |
799 | uint32_t *post_div_p) | 908 | uint32_t *post_div_p) |
800 | { | 909 | { |
801 | uint32_t min_ref_div = pll->min_ref_div; | 910 | uint32_t min_ref_div = pll->min_ref_div; |
802 | uint32_t max_ref_div = pll->max_ref_div; | 911 | uint32_t max_ref_div = pll->max_ref_div; |
@@ -826,6 +935,9 @@ void radeon_compute_pll(struct radeon_pll *pll, | |||
826 | pll_out_max = pll->pll_out_max; | 935 | pll_out_max = pll->pll_out_max; |
827 | } | 936 | } |
828 | 937 | ||
938 | if (pll_out_min > 64800) | ||
939 | pll_out_min = 64800; | ||
940 | |||
829 | if (pll->flags & RADEON_PLL_USE_REF_DIV) | 941 | if (pll->flags & RADEON_PLL_USE_REF_DIV) |
830 | min_ref_div = max_ref_div = pll->reference_div; | 942 | min_ref_div = max_ref_div = pll->reference_div; |
831 | else { | 943 | else { |
@@ -849,7 +961,7 @@ void radeon_compute_pll(struct radeon_pll *pll, | |||
849 | max_fractional_feed_div = pll->max_frac_feedback_div; | 961 | max_fractional_feed_div = pll->max_frac_feedback_div; |
850 | } | 962 | } |
851 | 963 | ||
852 | for (post_div = max_post_div; post_div >= min_post_div; --post_div) { | 964 | for (post_div = min_post_div; post_div <= max_post_div; ++post_div) { |
853 | uint32_t ref_div; | 965 | uint32_t ref_div; |
854 | 966 | ||
855 | if ((pll->flags & RADEON_PLL_NO_ODD_POST_DIV) && (post_div & 1)) | 967 | if ((pll->flags & RADEON_PLL_NO_ODD_POST_DIV) && (post_div & 1)) |
@@ -965,6 +1077,10 @@ void radeon_compute_pll(struct radeon_pll *pll, | |||
965 | *frac_fb_div_p = best_frac_feedback_div; | 1077 | *frac_fb_div_p = best_frac_feedback_div; |
966 | *ref_div_p = best_ref_div; | 1078 | *ref_div_p = best_ref_div; |
967 | *post_div_p = best_post_div; | 1079 | *post_div_p = best_post_div; |
1080 | DRM_DEBUG_KMS("%d %d, pll dividers - fb: %d.%d ref: %d, post %d\n", | ||
1081 | freq, best_freq / 1000, best_feedback_div, best_frac_feedback_div, | ||
1082 | best_ref_div, best_post_div); | ||
1083 | |||
968 | } | 1084 | } |
969 | 1085 | ||
970 | static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb) | 1086 | static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb) |
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 5e90984d5ad2..d4a542247618 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
@@ -1063,7 +1063,7 @@ atombios_set_edp_panel_power(struct drm_connector *connector, int action) | |||
1063 | if (!ASIC_IS_DCE4(rdev)) | 1063 | if (!ASIC_IS_DCE4(rdev)) |
1064 | return; | 1064 | return; |
1065 | 1065 | ||
1066 | if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) || | 1066 | if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) && |
1067 | (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) | 1067 | (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) |
1068 | return; | 1068 | return; |
1069 | 1069 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c index ace2e6384d40..cf0638c3b7c7 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c | |||
@@ -778,9 +778,9 @@ static void radeon_set_pll(struct drm_crtc *crtc, struct drm_display_mode *mode) | |||
778 | DRM_DEBUG_KMS("\n"); | 778 | DRM_DEBUG_KMS("\n"); |
779 | 779 | ||
780 | if (!use_bios_divs) { | 780 | if (!use_bios_divs) { |
781 | radeon_compute_pll(pll, mode->clock, | 781 | radeon_compute_pll_legacy(pll, mode->clock, |
782 | &freq, &feedback_div, &frac_fb_div, | 782 | &freq, &feedback_div, &frac_fb_div, |
783 | &reference_div, &post_divider); | 783 | &reference_div, &post_divider); |
784 | 784 | ||
785 | for (post_div = &post_divs[0]; post_div->divider; ++post_div) { | 785 | for (post_div = &post_divs[0]; post_div->divider; ++post_div) { |
786 | if (post_div->divider == post_divider) | 786 | if (post_div->divider == post_divider) |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index 12bdeab91c86..6794cdf91f28 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -149,6 +149,7 @@ struct radeon_tmds_pll { | |||
149 | #define RADEON_PLL_PREFER_CLOSEST_LOWER (1 << 11) | 149 | #define RADEON_PLL_PREFER_CLOSEST_LOWER (1 << 11) |
150 | #define RADEON_PLL_USE_POST_DIV (1 << 12) | 150 | #define RADEON_PLL_USE_POST_DIV (1 << 12) |
151 | #define RADEON_PLL_IS_LCD (1 << 13) | 151 | #define RADEON_PLL_IS_LCD (1 << 13) |
152 | #define RADEON_PLL_PREFER_MINM_OVER_MAXP (1 << 14) | ||
152 | 153 | ||
153 | struct radeon_pll { | 154 | struct radeon_pll { |
154 | /* reference frequency */ | 155 | /* reference frequency */ |
@@ -510,13 +511,21 @@ extern bool radeon_atombios_get_asic_ss_info(struct radeon_device *rdev, | |||
510 | struct radeon_atom_ss *ss, | 511 | struct radeon_atom_ss *ss, |
511 | int id, u32 clock); | 512 | int id, u32 clock); |
512 | 513 | ||
513 | extern void radeon_compute_pll(struct radeon_pll *pll, | 514 | extern void radeon_compute_pll_legacy(struct radeon_pll *pll, |
514 | uint64_t freq, | 515 | uint64_t freq, |
515 | uint32_t *dot_clock_p, | 516 | uint32_t *dot_clock_p, |
516 | uint32_t *fb_div_p, | 517 | uint32_t *fb_div_p, |
517 | uint32_t *frac_fb_div_p, | 518 | uint32_t *frac_fb_div_p, |
518 | uint32_t *ref_div_p, | 519 | uint32_t *ref_div_p, |
519 | uint32_t *post_div_p); | 520 | uint32_t *post_div_p); |
521 | |||
522 | extern void radeon_compute_pll_avivo(struct radeon_pll *pll, | ||
523 | u32 freq, | ||
524 | u32 *dot_clock_p, | ||
525 | u32 *fb_div_p, | ||
526 | u32 *frac_fb_div_p, | ||
527 | u32 *ref_div_p, | ||
528 | u32 *post_div_p); | ||
520 | 529 | ||
521 | extern void radeon_setup_encoder_clones(struct drm_device *dev); | 530 | extern void radeon_setup_encoder_clones(struct drm_device *dev); |
522 | 531 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 3b1b2bf9cdd5..2aed03bde4b2 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -430,7 +430,7 @@ static ssize_t radeon_hwmon_show_temp(struct device *dev, | |||
430 | { | 430 | { |
431 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); | 431 | struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev)); |
432 | struct radeon_device *rdev = ddev->dev_private; | 432 | struct radeon_device *rdev = ddev->dev_private; |
433 | u32 temp; | 433 | int temp; |
434 | 434 | ||
435 | switch (rdev->pm.int_thermal_type) { | 435 | switch (rdev->pm.int_thermal_type) { |
436 | case THERMAL_TYPE_RV6XX: | 436 | case THERMAL_TYPE_RV6XX: |
@@ -646,6 +646,9 @@ void radeon_pm_fini(struct radeon_device *rdev) | |||
646 | #endif | 646 | #endif |
647 | } | 647 | } |
648 | 648 | ||
649 | if (rdev->pm.power_state) | ||
650 | kfree(rdev->pm.power_state); | ||
651 | |||
649 | radeon_hwmon_fini(rdev); | 652 | radeon_hwmon_fini(rdev); |
650 | } | 653 | } |
651 | 654 | ||
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 491dc9000655..2211a323db41 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -78,18 +78,23 @@ u32 rv770_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) | |||
78 | } | 78 | } |
79 | 79 | ||
80 | /* get temperature in millidegrees */ | 80 | /* get temperature in millidegrees */ |
81 | u32 rv770_get_temp(struct radeon_device *rdev) | 81 | int rv770_get_temp(struct radeon_device *rdev) |
82 | { | 82 | { |
83 | u32 temp = (RREG32(CG_MULT_THERMAL_STATUS) & ASIC_T_MASK) >> | 83 | u32 temp = (RREG32(CG_MULT_THERMAL_STATUS) & ASIC_T_MASK) >> |
84 | ASIC_T_SHIFT; | 84 | ASIC_T_SHIFT; |
85 | u32 actual_temp = 0; | 85 | int actual_temp; |
86 | 86 | ||
87 | if ((temp >> 9) & 1) | 87 | if (temp & 0x400) |
88 | actual_temp = 0; | 88 | actual_temp = -256; |
89 | else | 89 | else if (temp & 0x200) |
90 | actual_temp = (temp >> 1) & 0xff; | 90 | actual_temp = 255; |
91 | 91 | else if (temp & 0x100) { | |
92 | return actual_temp * 1000; | 92 | actual_temp = temp & 0x1ff; |
93 | actual_temp |= ~0x1ff; | ||
94 | } else | ||
95 | actual_temp = temp & 0xff; | ||
96 | |||
97 | return (actual_temp * 1000) / 2; | ||
93 | } | 98 | } |
94 | 99 | ||
95 | void rv770_pm_misc(struct radeon_device *rdev) | 100 | void rv770_pm_misc(struct radeon_device *rdev) |
diff --git a/drivers/gpu/stub/Kconfig b/drivers/gpu/stub/Kconfig index 09aea5f1556d..70e60a4bb678 100644 --- a/drivers/gpu/stub/Kconfig +++ b/drivers/gpu/stub/Kconfig | |||
@@ -1,11 +1,13 @@ | |||
1 | config STUB_POULSBO | 1 | config STUB_POULSBO |
2 | tristate "Intel GMA500 Stub Driver" | 2 | tristate "Intel GMA500 Stub Driver" |
3 | depends on PCI | 3 | depends on PCI |
4 | depends on NET # for THERMAL | ||
4 | # Poulsbo stub depends on ACPI_VIDEO when ACPI is enabled | 5 | # Poulsbo stub depends on ACPI_VIDEO when ACPI is enabled |
5 | # but for select to work, need to select ACPI_VIDEO's dependencies, ick | 6 | # but for select to work, need to select ACPI_VIDEO's dependencies, ick |
6 | select BACKLIGHT_CLASS_DEVICE if ACPI | 7 | select BACKLIGHT_CLASS_DEVICE if ACPI |
7 | select INPUT if ACPI | 8 | select INPUT if ACPI |
8 | select ACPI_VIDEO if ACPI | 9 | select ACPI_VIDEO if ACPI |
10 | select THERMAL if ACPI | ||
9 | help | 11 | help |
10 | Choose this option if you have a system that has Intel GMA500 | 12 | Choose this option if you have a system that has Intel GMA500 |
11 | (Poulsbo) integrated graphics. If M is selected, the module will | 13 | (Poulsbo) integrated graphics. If M is selected, the module will |
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index e38be1bcc01c..fbbfa24cf572 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c | |||
@@ -1079,7 +1079,7 @@ static void ib_sa_remove_one(struct ib_device *device) | |||
1079 | 1079 | ||
1080 | ib_unregister_event_handler(&sa_dev->event_handler); | 1080 | ib_unregister_event_handler(&sa_dev->event_handler); |
1081 | 1081 | ||
1082 | flush_scheduled_work(); | 1082 | flush_workqueue(ib_wq); |
1083 | 1083 | ||
1084 | for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) { | 1084 | for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) { |
1085 | if (rdma_port_get_link_layer(device, i + 1) == IB_LINK_LAYER_INFINIBAND) { | 1085 | if (rdma_port_get_link_layer(device, i + 1) == IB_LINK_LAYER_INFINIBAND) { |
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index ca12acf38379..ec1e9da1488b 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
@@ -636,6 +636,16 @@ static void ucma_copy_iboe_route(struct rdma_ucm_query_route_resp *resp, | |||
636 | } | 636 | } |
637 | } | 637 | } |
638 | 638 | ||
639 | static void ucma_copy_iw_route(struct rdma_ucm_query_route_resp *resp, | ||
640 | struct rdma_route *route) | ||
641 | { | ||
642 | struct rdma_dev_addr *dev_addr; | ||
643 | |||
644 | dev_addr = &route->addr.dev_addr; | ||
645 | rdma_addr_get_dgid(dev_addr, (union ib_gid *) &resp->ib_route[0].dgid); | ||
646 | rdma_addr_get_sgid(dev_addr, (union ib_gid *) &resp->ib_route[0].sgid); | ||
647 | } | ||
648 | |||
639 | static ssize_t ucma_query_route(struct ucma_file *file, | 649 | static ssize_t ucma_query_route(struct ucma_file *file, |
640 | const char __user *inbuf, | 650 | const char __user *inbuf, |
641 | int in_len, int out_len) | 651 | int in_len, int out_len) |
@@ -670,8 +680,10 @@ static ssize_t ucma_query_route(struct ucma_file *file, | |||
670 | 680 | ||
671 | resp.node_guid = (__force __u64) ctx->cm_id->device->node_guid; | 681 | resp.node_guid = (__force __u64) ctx->cm_id->device->node_guid; |
672 | resp.port_num = ctx->cm_id->port_num; | 682 | resp.port_num = ctx->cm_id->port_num; |
673 | if (rdma_node_get_transport(ctx->cm_id->device->node_type) == RDMA_TRANSPORT_IB) { | 683 | switch (rdma_node_get_transport(ctx->cm_id->device->node_type)) { |
674 | switch (rdma_port_get_link_layer(ctx->cm_id->device, ctx->cm_id->port_num)) { | 684 | case RDMA_TRANSPORT_IB: |
685 | switch (rdma_port_get_link_layer(ctx->cm_id->device, | ||
686 | ctx->cm_id->port_num)) { | ||
675 | case IB_LINK_LAYER_INFINIBAND: | 687 | case IB_LINK_LAYER_INFINIBAND: |
676 | ucma_copy_ib_route(&resp, &ctx->cm_id->route); | 688 | ucma_copy_ib_route(&resp, &ctx->cm_id->route); |
677 | break; | 689 | break; |
@@ -681,6 +693,12 @@ static ssize_t ucma_query_route(struct ucma_file *file, | |||
681 | default: | 693 | default: |
682 | break; | 694 | break; |
683 | } | 695 | } |
696 | break; | ||
697 | case RDMA_TRANSPORT_IWARP: | ||
698 | ucma_copy_iw_route(&resp, &ctx->cm_id->route); | ||
699 | break; | ||
700 | default: | ||
701 | break; | ||
684 | } | 702 | } |
685 | 703 | ||
686 | out: | 704 | out: |
diff --git a/drivers/infiniband/hw/amso1100/c2_vq.c b/drivers/infiniband/hw/amso1100/c2_vq.c index 9ce7819b7b2e..2ec716fb2edb 100644 --- a/drivers/infiniband/hw/amso1100/c2_vq.c +++ b/drivers/infiniband/hw/amso1100/c2_vq.c | |||
@@ -107,7 +107,7 @@ struct c2_vq_req *vq_req_alloc(struct c2_dev *c2dev) | |||
107 | r = kmalloc(sizeof(struct c2_vq_req), GFP_KERNEL); | 107 | r = kmalloc(sizeof(struct c2_vq_req), GFP_KERNEL); |
108 | if (r) { | 108 | if (r) { |
109 | init_waitqueue_head(&r->wait_object); | 109 | init_waitqueue_head(&r->wait_object); |
110 | r->reply_msg = (u64) NULL; | 110 | r->reply_msg = 0; |
111 | r->event = 0; | 111 | r->event = 0; |
112 | r->cm_id = NULL; | 112 | r->cm_id = NULL; |
113 | r->qp = NULL; | 113 | r->qp = NULL; |
@@ -123,7 +123,7 @@ struct c2_vq_req *vq_req_alloc(struct c2_dev *c2dev) | |||
123 | */ | 123 | */ |
124 | void vq_req_free(struct c2_dev *c2dev, struct c2_vq_req *r) | 124 | void vq_req_free(struct c2_dev *c2dev, struct c2_vq_req *r) |
125 | { | 125 | { |
126 | r->reply_msg = (u64) NULL; | 126 | r->reply_msg = 0; |
127 | if (atomic_dec_and_test(&r->refcnt)) { | 127 | if (atomic_dec_and_test(&r->refcnt)) { |
128 | kfree(r); | 128 | kfree(r); |
129 | } | 129 | } |
@@ -151,7 +151,7 @@ void vq_req_get(struct c2_dev *c2dev, struct c2_vq_req *r) | |||
151 | void vq_req_put(struct c2_dev *c2dev, struct c2_vq_req *r) | 151 | void vq_req_put(struct c2_dev *c2dev, struct c2_vq_req *r) |
152 | { | 152 | { |
153 | if (atomic_dec_and_test(&r->refcnt)) { | 153 | if (atomic_dec_and_test(&r->refcnt)) { |
154 | if (r->reply_msg != (u64) NULL) | 154 | if (r->reply_msg != 0) |
155 | vq_repbuf_free(c2dev, | 155 | vq_repbuf_free(c2dev, |
156 | (void *) (unsigned long) r->reply_msg); | 156 | (void *) (unsigned long) r->reply_msg); |
157 | kfree(r); | 157 | kfree(r); |
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 0dc62b1438be..8b00e6c46f01 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
@@ -380,7 +380,7 @@ static void send_flowc(struct c4iw_ep *ep, struct sk_buff *skb) | |||
380 | 16)) | FW_WR_FLOWID(ep->hwtid)); | 380 | 16)) | FW_WR_FLOWID(ep->hwtid)); |
381 | 381 | ||
382 | flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; | 382 | flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; |
383 | flowc->mnemval[0].val = cpu_to_be32(0); | 383 | flowc->mnemval[0].val = cpu_to_be32(PCI_FUNC(ep->com.dev->rdev.lldi.pdev->devfn) << 8); |
384 | flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; | 384 | flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; |
385 | flowc->mnemval[1].val = cpu_to_be32(ep->tx_chan); | 385 | flowc->mnemval[1].val = cpu_to_be32(ep->tx_chan); |
386 | flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; | 386 | flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT; |
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c index 20800900ef3f..4f0be25cab1a 100644 --- a/drivers/infiniband/hw/cxgb4/qp.c +++ b/drivers/infiniband/hw/cxgb4/qp.c | |||
@@ -220,7 +220,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, | |||
220 | V_FW_RI_RES_WR_DCAEN(0) | | 220 | V_FW_RI_RES_WR_DCAEN(0) | |
221 | V_FW_RI_RES_WR_DCACPU(0) | | 221 | V_FW_RI_RES_WR_DCACPU(0) | |
222 | V_FW_RI_RES_WR_FBMIN(2) | | 222 | V_FW_RI_RES_WR_FBMIN(2) | |
223 | V_FW_RI_RES_WR_FBMAX(3) | | 223 | V_FW_RI_RES_WR_FBMAX(2) | |
224 | V_FW_RI_RES_WR_CIDXFTHRESHO(0) | | 224 | V_FW_RI_RES_WR_CIDXFTHRESHO(0) | |
225 | V_FW_RI_RES_WR_CIDXFTHRESH(0) | | 225 | V_FW_RI_RES_WR_CIDXFTHRESH(0) | |
226 | V_FW_RI_RES_WR_EQSIZE(eqsize)); | 226 | V_FW_RI_RES_WR_EQSIZE(eqsize)); |
@@ -243,7 +243,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, | |||
243 | V_FW_RI_RES_WR_DCAEN(0) | | 243 | V_FW_RI_RES_WR_DCAEN(0) | |
244 | V_FW_RI_RES_WR_DCACPU(0) | | 244 | V_FW_RI_RES_WR_DCACPU(0) | |
245 | V_FW_RI_RES_WR_FBMIN(2) | | 245 | V_FW_RI_RES_WR_FBMIN(2) | |
246 | V_FW_RI_RES_WR_FBMAX(3) | | 246 | V_FW_RI_RES_WR_FBMAX(2) | |
247 | V_FW_RI_RES_WR_CIDXFTHRESHO(0) | | 247 | V_FW_RI_RES_WR_CIDXFTHRESHO(0) | |
248 | V_FW_RI_RES_WR_CIDXFTHRESH(0) | | 248 | V_FW_RI_RES_WR_CIDXFTHRESH(0) | |
249 | V_FW_RI_RES_WR_EQSIZE(eqsize)); | 249 | V_FW_RI_RES_WR_EQSIZE(eqsize)); |
diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c index 50cceb3ab885..b01809a82cb0 100644 --- a/drivers/infiniband/hw/qib/qib_iba7322.c +++ b/drivers/infiniband/hw/qib/qib_iba7322.c | |||
@@ -623,7 +623,6 @@ struct qib_chippport_specific { | |||
623 | u8 ibmalfusesnap; | 623 | u8 ibmalfusesnap; |
624 | struct qib_qsfp_data qsfp_data; | 624 | struct qib_qsfp_data qsfp_data; |
625 | char epmsgbuf[192]; /* for port error interrupt msg buffer */ | 625 | char epmsgbuf[192]; /* for port error interrupt msg buffer */ |
626 | u8 bounced; | ||
627 | }; | 626 | }; |
628 | 627 | ||
629 | static struct { | 628 | static struct { |
@@ -1881,23 +1880,7 @@ static noinline void handle_7322_p_errors(struct qib_pportdata *ppd) | |||
1881 | IB_PHYSPORTSTATE_DISABLED) | 1880 | IB_PHYSPORTSTATE_DISABLED) |
1882 | qib_set_ib_7322_lstate(ppd, 0, | 1881 | qib_set_ib_7322_lstate(ppd, 0, |
1883 | QLOGIC_IB_IBCC_LINKINITCMD_DISABLE); | 1882 | QLOGIC_IB_IBCC_LINKINITCMD_DISABLE); |
1884 | else { | 1883 | else |
1885 | u32 lstate; | ||
1886 | /* | ||
1887 | * We need the current logical link state before | ||
1888 | * lflags are set in handle_e_ibstatuschanged. | ||
1889 | */ | ||
1890 | lstate = qib_7322_iblink_state(ibcs); | ||
1891 | |||
1892 | if (IS_QMH(dd) && !ppd->cpspec->bounced && | ||
1893 | ltstate == IB_PHYSPORTSTATE_LINKUP && | ||
1894 | (lstate >= IB_PORT_INIT && | ||
1895 | lstate <= IB_PORT_ACTIVE)) { | ||
1896 | ppd->cpspec->bounced = 1; | ||
1897 | qib_7322_set_ib_cfg(ppd, QIB_IB_CFG_LSTATE, | ||
1898 | IB_LINKCMD_DOWN | IB_LINKINITCMD_POLL); | ||
1899 | } | ||
1900 | |||
1901 | /* | 1884 | /* |
1902 | * Since going into a recovery state causes the link | 1885 | * Since going into a recovery state causes the link |
1903 | * state to go down and since recovery is transitory, | 1886 | * state to go down and since recovery is transitory, |
@@ -1911,7 +1894,6 @@ static noinline void handle_7322_p_errors(struct qib_pportdata *ppd) | |||
1911 | ltstate != IB_PHYSPORTSTATE_RECOVERY_WAITRMT && | 1894 | ltstate != IB_PHYSPORTSTATE_RECOVERY_WAITRMT && |
1912 | ltstate != IB_PHYSPORTSTATE_RECOVERY_IDLE) | 1895 | ltstate != IB_PHYSPORTSTATE_RECOVERY_IDLE) |
1913 | qib_handle_e_ibstatuschanged(ppd, ibcs); | 1896 | qib_handle_e_ibstatuschanged(ppd, ibcs); |
1914 | } | ||
1915 | } | 1897 | } |
1916 | if (*msg && iserr) | 1898 | if (*msg && iserr) |
1917 | qib_dev_porterr(dd, ppd->port, "%s error\n", msg); | 1899 | qib_dev_porterr(dd, ppd->port, "%s error\n", msg); |
@@ -2381,6 +2363,11 @@ static int qib_7322_bringup_serdes(struct qib_pportdata *ppd) | |||
2381 | qib_write_kreg_port(ppd, krp_rcvctrl, ppd->p_rcvctrl); | 2363 | qib_write_kreg_port(ppd, krp_rcvctrl, ppd->p_rcvctrl); |
2382 | spin_unlock_irqrestore(&dd->cspec->rcvmod_lock, flags); | 2364 | spin_unlock_irqrestore(&dd->cspec->rcvmod_lock, flags); |
2383 | 2365 | ||
2366 | /* Hold the link state machine for mezz boards */ | ||
2367 | if (IS_QMH(dd) || IS_QME(dd)) | ||
2368 | qib_set_ib_7322_lstate(ppd, 0, | ||
2369 | QLOGIC_IB_IBCC_LINKINITCMD_DISABLE); | ||
2370 | |||
2384 | /* Also enable IBSTATUSCHG interrupt. */ | 2371 | /* Also enable IBSTATUSCHG interrupt. */ |
2385 | val = qib_read_kreg_port(ppd, krp_errmask); | 2372 | val = qib_read_kreg_port(ppd, krp_errmask); |
2386 | qib_write_kreg_port(ppd, krp_errmask, | 2373 | qib_write_kreg_port(ppd, krp_errmask, |
@@ -5702,6 +5689,11 @@ static void set_no_qsfp_atten(struct qib_devdata *dd, int change) | |||
5702 | ppd->cpspec->h1_val = h1; | 5689 | ppd->cpspec->h1_val = h1; |
5703 | /* now change the IBC and serdes, overriding generic */ | 5690 | /* now change the IBC and serdes, overriding generic */ |
5704 | init_txdds_table(ppd, 1); | 5691 | init_txdds_table(ppd, 1); |
5692 | /* Re-enable the physical state machine on mezz boards | ||
5693 | * now that the correct settings have been set. */ | ||
5694 | if (IS_QMH(dd) || IS_QME(dd)) | ||
5695 | qib_set_ib_7322_lstate(ppd, 0, | ||
5696 | QLOGIC_IB_IBCC_LINKINITCMD_SLEEP); | ||
5705 | any++; | 5697 | any++; |
5706 | } | 5698 | } |
5707 | if (*nxt == '\n') | 5699 | if (*nxt == '\n') |
diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c index 9dfd6e5f786f..1f38302a5951 100644 --- a/drivers/input/misc/ixp4xx-beeper.c +++ b/drivers/input/misc/ixp4xx-beeper.c | |||
@@ -69,11 +69,7 @@ static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned | |||
69 | } | 69 | } |
70 | 70 | ||
71 | if (value > 20 && value < 32767) | 71 | if (value > 20 && value < 32767) |
72 | #ifndef FREQ | 72 | count = (IXP4XX_TIMER_FREQ / (value * 4)) - 1; |
73 | count = (ixp4xx_get_board_tick_rate() / (value * 4)) - 1; | ||
74 | #else | ||
75 | count = (FREQ / (value * 4)) - 1; | ||
76 | #endif | ||
77 | 73 | ||
78 | ixp4xx_spkr_control(pin, count); | 74 | ixp4xx_spkr_control(pin, count); |
79 | 75 | ||
diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c index f2b5bab5e6a1..1f355bb85e54 100644 --- a/drivers/isdn/icn/icn.c +++ b/drivers/isdn/icn/icn.c | |||
@@ -1627,7 +1627,7 @@ __setup("icn=", icn_setup); | |||
1627 | static int __init icn_init(void) | 1627 | static int __init icn_init(void) |
1628 | { | 1628 | { |
1629 | char *p; | 1629 | char *p; |
1630 | char rev[20]; | 1630 | char rev[21]; |
1631 | 1631 | ||
1632 | memset(&dev, 0, sizeof(icn_dev)); | 1632 | memset(&dev, 0, sizeof(icn_dev)); |
1633 | dev.memaddr = (membase & 0x0ffc000); | 1633 | dev.memaddr = (membase & 0x0ffc000); |
@@ -1638,6 +1638,7 @@ static int __init icn_init(void) | |||
1638 | 1638 | ||
1639 | if ((p = strchr(revision, ':'))) { | 1639 | if ((p = strchr(revision, ':'))) { |
1640 | strncpy(rev, p + 1, 20); | 1640 | strncpy(rev, p + 1, 20); |
1641 | rev[20] = '\0'; | ||
1641 | p = strchr(rev, '$'); | 1642 | p = strchr(rev, '$'); |
1642 | if (p) | 1643 | if (p) |
1643 | *p = 0; | 1644 | *p = 0; |
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c index f011c5d9dea1..1c5cc65ea1e1 100644 --- a/drivers/media/rc/ir-lirc-codec.c +++ b/drivers/media/rc/ir-lirc-codec.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* ir-lirc-codec.c - ir-core to classic lirc interface bridge | 1 | /* ir-lirc-codec.c - rc-core to classic lirc interface bridge |
2 | * | 2 | * |
3 | * Copyright (C) 2010 by Jarod Wilson <jarod@redhat.com> | 3 | * Copyright (C) 2010 by Jarod Wilson <jarod@redhat.com> |
4 | * | 4 | * |
@@ -47,6 +47,7 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
47 | /* Carrier reports */ | 47 | /* Carrier reports */ |
48 | if (ev.carrier_report) { | 48 | if (ev.carrier_report) { |
49 | sample = LIRC_FREQUENCY(ev.carrier); | 49 | sample = LIRC_FREQUENCY(ev.carrier); |
50 | IR_dprintk(2, "carrier report (freq: %d)\n", sample); | ||
50 | 51 | ||
51 | /* Packet end */ | 52 | /* Packet end */ |
52 | } else if (ev.timeout) { | 53 | } else if (ev.timeout) { |
@@ -62,6 +63,7 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
62 | return 0; | 63 | return 0; |
63 | 64 | ||
64 | sample = LIRC_TIMEOUT(ev.duration / 1000); | 65 | sample = LIRC_TIMEOUT(ev.duration / 1000); |
66 | IR_dprintk(2, "timeout report (duration: %d)\n", sample); | ||
65 | 67 | ||
66 | /* Normal sample */ | 68 | /* Normal sample */ |
67 | } else { | 69 | } else { |
@@ -85,6 +87,8 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
85 | 87 | ||
86 | sample = ev.pulse ? LIRC_PULSE(ev.duration / 1000) : | 88 | sample = ev.pulse ? LIRC_PULSE(ev.duration / 1000) : |
87 | LIRC_SPACE(ev.duration / 1000); | 89 | LIRC_SPACE(ev.duration / 1000); |
90 | IR_dprintk(2, "delivering %uus %s to lirc_dev\n", | ||
91 | TO_US(ev.duration), TO_STR(ev.pulse)); | ||
88 | } | 92 | } |
89 | 93 | ||
90 | lirc_buffer_write(dev->raw->lirc.drv->rbuf, | 94 | lirc_buffer_write(dev->raw->lirc.drv->rbuf, |
diff --git a/drivers/media/rc/keymaps/rc-rc6-mce.c b/drivers/media/rc/keymaps/rc-rc6-mce.c index 3bf3337875d1..2f5dc0622b94 100644 --- a/drivers/media/rc/keymaps/rc-rc6-mce.c +++ b/drivers/media/rc/keymaps/rc-rc6-mce.c | |||
@@ -3,6 +3,9 @@ | |||
3 | * | 3 | * |
4 | * Copyright (c) 2010 by Jarod Wilson <jarod@redhat.com> | 4 | * Copyright (c) 2010 by Jarod Wilson <jarod@redhat.com> |
5 | * | 5 | * |
6 | * See http://mediacenterguides.com/book/export/html/31 for details on | ||
7 | * key mappings. | ||
8 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2 of the License, or | 11 | * the Free Software Foundation; either version 2 of the License, or |
@@ -60,6 +63,9 @@ static struct rc_map_table rc6_mce[] = { | |||
60 | { 0x800f0426, KEY_EPG }, /* Guide */ | 63 | { 0x800f0426, KEY_EPG }, /* Guide */ |
61 | { 0x800f0427, KEY_ZOOM }, /* Aspect */ | 64 | { 0x800f0427, KEY_ZOOM }, /* Aspect */ |
62 | 65 | ||
66 | { 0x800f0432, KEY_MODE }, /* Visualization */ | ||
67 | { 0x800f0433, KEY_PRESENTATION }, /* Slide Show */ | ||
68 | { 0x800f0434, KEY_EJECTCD }, | ||
63 | { 0x800f043a, KEY_BRIGHTNESSUP }, | 69 | { 0x800f043a, KEY_BRIGHTNESSUP }, |
64 | 70 | ||
65 | { 0x800f0446, KEY_TV }, | 71 | { 0x800f0446, KEY_TV }, |
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 079353e5d558..6df0a4980645 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c | |||
@@ -816,7 +816,7 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index) | |||
816 | switch (ir->buf_in[index]) { | 816 | switch (ir->buf_in[index]) { |
817 | /* 2-byte return value commands */ | 817 | /* 2-byte return value commands */ |
818 | case MCE_CMD_S_TIMEOUT: | 818 | case MCE_CMD_S_TIMEOUT: |
819 | ir->rc->timeout = MS_TO_NS((hi << 8 | lo) / 2); | 819 | ir->rc->timeout = US_TO_NS((hi << 8 | lo) / 2); |
820 | break; | 820 | break; |
821 | 821 | ||
822 | /* 1-byte return value commands */ | 822 | /* 1-byte return value commands */ |
@@ -855,9 +855,10 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) | |||
855 | break; | 855 | break; |
856 | case PARSE_IRDATA: | 856 | case PARSE_IRDATA: |
857 | ir->rem--; | 857 | ir->rem--; |
858 | init_ir_raw_event(&rawir); | ||
858 | rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0); | 859 | rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0); |
859 | rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK) | 860 | rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK) |
860 | * MS_TO_US(MCE_TIME_UNIT); | 861 | * US_TO_NS(MCE_TIME_UNIT); |
861 | 862 | ||
862 | dev_dbg(ir->dev, "Storing %s with duration %d\n", | 863 | dev_dbg(ir->dev, "Storing %s with duration %d\n", |
863 | rawir.pulse ? "pulse" : "space", | 864 | rawir.pulse ? "pulse" : "space", |
@@ -883,6 +884,8 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) | |||
883 | i, ir->rem + 1, false); | 884 | i, ir->rem + 1, false); |
884 | if (ir->rem) | 885 | if (ir->rem) |
885 | ir->parser_state = PARSE_IRDATA; | 886 | ir->parser_state = PARSE_IRDATA; |
887 | else | ||
888 | ir_raw_event_reset(ir->rc); | ||
886 | break; | 889 | break; |
887 | } | 890 | } |
888 | 891 | ||
@@ -1060,7 +1063,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir) | |||
1060 | rc->priv = ir; | 1063 | rc->priv = ir; |
1061 | rc->driver_type = RC_DRIVER_IR_RAW; | 1064 | rc->driver_type = RC_DRIVER_IR_RAW; |
1062 | rc->allowed_protos = RC_TYPE_ALL; | 1065 | rc->allowed_protos = RC_TYPE_ALL; |
1063 | rc->timeout = MS_TO_NS(1000); | 1066 | rc->timeout = US_TO_NS(1000); |
1064 | if (!ir->flags.no_tx) { | 1067 | if (!ir->flags.no_tx) { |
1065 | rc->s_tx_mask = mceusb_set_tx_mask; | 1068 | rc->s_tx_mask = mceusb_set_tx_mask; |
1066 | rc->s_tx_carrier = mceusb_set_tx_carrier; | 1069 | rc->s_tx_carrier = mceusb_set_tx_carrier; |
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index dd4caf8ef80b..273d9d674792 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c | |||
@@ -460,7 +460,7 @@ static u32 nvt_rx_carrier_detect(struct nvt_dev *nvt) | |||
460 | return 0; | 460 | return 0; |
461 | } | 461 | } |
462 | 462 | ||
463 | carrier = (count * 1000000) / duration; | 463 | carrier = MS_TO_NS(count) / duration; |
464 | 464 | ||
465 | if ((carrier > MAX_CARRIER) || (carrier < MIN_CARRIER)) | 465 | if ((carrier > MAX_CARRIER) || (carrier < MIN_CARRIER)) |
466 | nvt_dbg("WTF? Carrier frequency out of range!"); | 466 | nvt_dbg("WTF? Carrier frequency out of range!"); |
@@ -612,8 +612,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) | |||
612 | sample = nvt->buf[i]; | 612 | sample = nvt->buf[i]; |
613 | 613 | ||
614 | rawir.pulse = ((sample & BUF_PULSE_BIT) != 0); | 614 | rawir.pulse = ((sample & BUF_PULSE_BIT) != 0); |
615 | rawir.duration = (sample & BUF_LEN_MASK) | 615 | rawir.duration = US_TO_NS((sample & BUF_LEN_MASK) |
616 | * SAMPLE_PERIOD * 1000; | 616 | * SAMPLE_PERIOD); |
617 | 617 | ||
618 | if ((sample & BUF_LEN_MASK) == BUF_LEN_MASK) { | 618 | if ((sample & BUF_LEN_MASK) == BUF_LEN_MASK) { |
619 | if (nvt->rawir.pulse == rawir.pulse) | 619 | if (nvt->rawir.pulse == rawir.pulse) |
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index 6e2911c2abfb..e435d94c0776 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c | |||
@@ -164,7 +164,7 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, | |||
164 | sz->signal_start.tv_usec - | 164 | sz->signal_start.tv_usec - |
165 | sz->signal_last.tv_usec); | 165 | sz->signal_last.tv_usec); |
166 | rawir.duration -= sz->sum; | 166 | rawir.duration -= sz->sum; |
167 | rawir.duration *= 1000; | 167 | rawir.duration = US_TO_NS(rawir.duration); |
168 | rawir.duration &= IR_MAX_DURATION; | 168 | rawir.duration &= IR_MAX_DURATION; |
169 | } | 169 | } |
170 | sz_push(sz, rawir); | 170 | sz_push(sz, rawir); |
@@ -177,7 +177,7 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, | |||
177 | rawir.duration = ((int) value) * SZ_RESOLUTION; | 177 | rawir.duration = ((int) value) * SZ_RESOLUTION; |
178 | rawir.duration += SZ_RESOLUTION / 2; | 178 | rawir.duration += SZ_RESOLUTION / 2; |
179 | sz->sum += rawir.duration; | 179 | sz->sum += rawir.duration; |
180 | rawir.duration *= 1000; | 180 | rawir.duration = US_TO_NS(rawir.duration); |
181 | rawir.duration &= IR_MAX_DURATION; | 181 | rawir.duration &= IR_MAX_DURATION; |
182 | sz_push(sz, rawir); | 182 | sz_push(sz, rawir); |
183 | } | 183 | } |
@@ -197,7 +197,7 @@ static void sz_push_full_space(struct streamzap_ir *sz, | |||
197 | rawir.duration = ((int) value) * SZ_RESOLUTION; | 197 | rawir.duration = ((int) value) * SZ_RESOLUTION; |
198 | rawir.duration += SZ_RESOLUTION / 2; | 198 | rawir.duration += SZ_RESOLUTION / 2; |
199 | sz->sum += rawir.duration; | 199 | sz->sum += rawir.duration; |
200 | rawir.duration *= 1000; | 200 | rawir.duration = US_TO_NS(rawir.duration); |
201 | sz_push(sz, rawir); | 201 | sz_push(sz, rawir); |
202 | } | 202 | } |
203 | 203 | ||
@@ -273,6 +273,7 @@ static void streamzap_callback(struct urb *urb) | |||
273 | if (sz->timeout_enabled) | 273 | if (sz->timeout_enabled) |
274 | sz_push(sz, rawir); | 274 | sz_push(sz, rawir); |
275 | ir_raw_event_handle(sz->rdev); | 275 | ir_raw_event_handle(sz->rdev); |
276 | ir_raw_event_reset(sz->rdev); | ||
276 | } else { | 277 | } else { |
277 | sz_push_full_space(sz, sz->buf_in[i]); | 278 | sz_push_full_space(sz, sz->buf_in[i]); |
278 | } | 279 | } |
@@ -290,6 +291,7 @@ static void streamzap_callback(struct urb *urb) | |||
290 | } | 291 | } |
291 | } | 292 | } |
292 | 293 | ||
294 | ir_raw_event_handle(sz->rdev); | ||
293 | usb_submit_urb(urb, GFP_ATOMIC); | 295 | usb_submit_urb(urb, GFP_ATOMIC); |
294 | 296 | ||
295 | return; | 297 | return; |
@@ -430,13 +432,13 @@ static int __devinit streamzap_probe(struct usb_interface *intf, | |||
430 | sz->decoder_state = PulseSpace; | 432 | sz->decoder_state = PulseSpace; |
431 | /* FIXME: don't yet have a way to set this */ | 433 | /* FIXME: don't yet have a way to set this */ |
432 | sz->timeout_enabled = true; | 434 | sz->timeout_enabled = true; |
433 | sz->rdev->timeout = (((SZ_TIMEOUT * SZ_RESOLUTION * 1000) & | 435 | sz->rdev->timeout = ((US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION) & |
434 | IR_MAX_DURATION) | 0x03000000); | 436 | IR_MAX_DURATION) | 0x03000000); |
435 | #if 0 | 437 | #if 0 |
436 | /* not yet supported, depends on patches from maxim */ | 438 | /* not yet supported, depends on patches from maxim */ |
437 | /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */ | 439 | /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */ |
438 | sz->min_timeout = SZ_TIMEOUT * SZ_RESOLUTION * 1000; | 440 | sz->min_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION); |
439 | sz->max_timeout = SZ_TIMEOUT * SZ_RESOLUTION * 1000; | 441 | sz->max_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION); |
440 | #endif | 442 | #endif |
441 | 443 | ||
442 | do_gettimeofday(&sz->signal_start); | 444 | do_gettimeofday(&sz->signal_start); |
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index 865216e9362c..47236a58bf33 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -5793,7 +5793,7 @@ static void usb_exchange(struct gspca_dev *gspca_dev, | |||
5793 | break; | 5793 | break; |
5794 | default: | 5794 | default: |
5795 | /* case 0xdd: * delay */ | 5795 | /* case 0xdd: * delay */ |
5796 | msleep(action->val / 64 + 10); | 5796 | msleep(action->idx); |
5797 | break; | 5797 | break; |
5798 | } | 5798 | } |
5799 | action++; | 5799 | action++; |
@@ -5830,7 +5830,7 @@ static void setmatrix(struct gspca_dev *gspca_dev) | |||
5830 | [SENSOR_GC0305] = gc0305_matrix, | 5830 | [SENSOR_GC0305] = gc0305_matrix, |
5831 | [SENSOR_HDCS2020b] = NULL, | 5831 | [SENSOR_HDCS2020b] = NULL, |
5832 | [SENSOR_HV7131B] = NULL, | 5832 | [SENSOR_HV7131B] = NULL, |
5833 | [SENSOR_HV7131R] = NULL, | 5833 | [SENSOR_HV7131R] = po2030_matrix, |
5834 | [SENSOR_ICM105A] = po2030_matrix, | 5834 | [SENSOR_ICM105A] = po2030_matrix, |
5835 | [SENSOR_MC501CB] = NULL, | 5835 | [SENSOR_MC501CB] = NULL, |
5836 | [SENSOR_MT9V111_1] = gc0305_matrix, | 5836 | [SENSOR_MT9V111_1] = gc0305_matrix, |
@@ -5936,6 +5936,7 @@ static void setquality(struct gspca_dev *gspca_dev) | |||
5936 | case SENSOR_ADCM2700: | 5936 | case SENSOR_ADCM2700: |
5937 | case SENSOR_GC0305: | 5937 | case SENSOR_GC0305: |
5938 | case SENSOR_HV7131B: | 5938 | case SENSOR_HV7131B: |
5939 | case SENSOR_HV7131R: | ||
5939 | case SENSOR_OV7620: | 5940 | case SENSOR_OV7620: |
5940 | case SENSOR_PAS202B: | 5941 | case SENSOR_PAS202B: |
5941 | case SENSOR_PO2030: | 5942 | case SENSOR_PO2030: |
@@ -6108,11 +6109,13 @@ static void send_unknown(struct gspca_dev *gspca_dev, int sensor) | |||
6108 | reg_w(gspca_dev, 0x02, 0x003b); | 6109 | reg_w(gspca_dev, 0x02, 0x003b); |
6109 | reg_w(gspca_dev, 0x00, 0x0038); | 6110 | reg_w(gspca_dev, 0x00, 0x0038); |
6110 | break; | 6111 | break; |
6112 | case SENSOR_HV7131R: | ||
6111 | case SENSOR_PAS202B: | 6113 | case SENSOR_PAS202B: |
6112 | reg_w(gspca_dev, 0x03, 0x003b); | 6114 | reg_w(gspca_dev, 0x03, 0x003b); |
6113 | reg_w(gspca_dev, 0x0c, 0x003a); | 6115 | reg_w(gspca_dev, 0x0c, 0x003a); |
6114 | reg_w(gspca_dev, 0x0b, 0x0039); | 6116 | reg_w(gspca_dev, 0x0b, 0x0039); |
6115 | reg_w(gspca_dev, 0x0b, 0x0038); | 6117 | if (sensor == SENSOR_PAS202B) |
6118 | reg_w(gspca_dev, 0x0b, 0x0038); | ||
6116 | break; | 6119 | break; |
6117 | } | 6120 | } |
6118 | } | 6121 | } |
@@ -6704,10 +6707,13 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
6704 | reg_w(gspca_dev, 0x02, 0x003b); | 6707 | reg_w(gspca_dev, 0x02, 0x003b); |
6705 | reg_w(gspca_dev, 0x00, 0x0038); | 6708 | reg_w(gspca_dev, 0x00, 0x0038); |
6706 | break; | 6709 | break; |
6710 | case SENSOR_HV7131R: | ||
6707 | case SENSOR_PAS202B: | 6711 | case SENSOR_PAS202B: |
6708 | reg_w(gspca_dev, 0x03, 0x003b); | 6712 | reg_w(gspca_dev, 0x03, 0x003b); |
6709 | reg_w(gspca_dev, 0x0c, 0x003a); | 6713 | reg_w(gspca_dev, 0x0c, 0x003a); |
6710 | reg_w(gspca_dev, 0x0b, 0x0039); | 6714 | reg_w(gspca_dev, 0x0b, 0x0039); |
6715 | if (sd->sensor == SENSOR_HV7131R) | ||
6716 | reg_w(gspca_dev, 0x50, ZC3XX_R11D_GLOBALGAIN); | ||
6711 | break; | 6717 | break; |
6712 | } | 6718 | } |
6713 | 6719 | ||
@@ -6720,6 +6726,7 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
6720 | break; | 6726 | break; |
6721 | case SENSOR_PAS202B: | 6727 | case SENSOR_PAS202B: |
6722 | case SENSOR_GC0305: | 6728 | case SENSOR_GC0305: |
6729 | case SENSOR_HV7131R: | ||
6723 | case SENSOR_TAS5130C: | 6730 | case SENSOR_TAS5130C: |
6724 | reg_r(gspca_dev, 0x0008); | 6731 | reg_r(gspca_dev, 0x0008); |
6725 | /* fall thru */ | 6732 | /* fall thru */ |
@@ -6760,6 +6767,12 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
6760 | /* ms-win + */ | 6767 | /* ms-win + */ |
6761 | reg_w(gspca_dev, 0x40, 0x0117); | 6768 | reg_w(gspca_dev, 0x40, 0x0117); |
6762 | break; | 6769 | break; |
6770 | case SENSOR_HV7131R: | ||
6771 | i2c_write(gspca_dev, 0x25, 0x04, 0x00); /* exposure */ | ||
6772 | i2c_write(gspca_dev, 0x26, 0x93, 0x00); | ||
6773 | i2c_write(gspca_dev, 0x27, 0xe0, 0x00); | ||
6774 | reg_w(gspca_dev, 0x00, ZC3XX_R1A7_CALCGLOBALMEAN); | ||
6775 | break; | ||
6763 | case SENSOR_GC0305: | 6776 | case SENSOR_GC0305: |
6764 | case SENSOR_TAS5130C: | 6777 | case SENSOR_TAS5130C: |
6765 | reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */ | 6778 | reg_w(gspca_dev, 0x09, 0x01ad); /* (from win traces) */ |
@@ -6808,9 +6821,17 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
6808 | { | 6821 | { |
6809 | struct sd *sd = (struct sd *) gspca_dev; | 6822 | struct sd *sd = (struct sd *) gspca_dev; |
6810 | 6823 | ||
6811 | if (data[0] == 0xff && data[1] == 0xd8) { /* start of frame */ | 6824 | /* check the JPEG end of frame */ |
6825 | if (len >= 3 | ||
6826 | && data[len - 3] == 0xff && data[len - 2] == 0xd9) { | ||
6827 | /*fixme: what does the last byte mean?*/ | ||
6812 | gspca_frame_add(gspca_dev, LAST_PACKET, | 6828 | gspca_frame_add(gspca_dev, LAST_PACKET, |
6813 | NULL, 0); | 6829 | data, len - 1); |
6830 | return; | ||
6831 | } | ||
6832 | |||
6833 | /* check the JPEG start of a frame */ | ||
6834 | if (data[0] == 0xff && data[1] == 0xd8) { | ||
6814 | /* put the JPEG header in the new frame */ | 6835 | /* put the JPEG header in the new frame */ |
6815 | gspca_frame_add(gspca_dev, FIRST_PACKET, | 6836 | gspca_frame_add(gspca_dev, FIRST_PACKET, |
6816 | sd->jpeg_hdr, JPEG_HDR_SZ); | 6837 | sd->jpeg_hdr, JPEG_HDR_SZ); |
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c index a6572e5ae369..a27d93b503a5 100644 --- a/drivers/media/video/hdpvr/hdpvr-core.c +++ b/drivers/media/video/hdpvr/hdpvr-core.c | |||
@@ -283,6 +283,7 @@ static int hdpvr_probe(struct usb_interface *interface, | |||
283 | struct hdpvr_device *dev; | 283 | struct hdpvr_device *dev; |
284 | struct usb_host_interface *iface_desc; | 284 | struct usb_host_interface *iface_desc; |
285 | struct usb_endpoint_descriptor *endpoint; | 285 | struct usb_endpoint_descriptor *endpoint; |
286 | struct i2c_client *client; | ||
286 | size_t buffer_size; | 287 | size_t buffer_size; |
287 | int i; | 288 | int i; |
288 | int retval = -ENOMEM; | 289 | int retval = -ENOMEM; |
@@ -381,13 +382,21 @@ static int hdpvr_probe(struct usb_interface *interface, | |||
381 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | 382 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) |
382 | retval = hdpvr_register_i2c_adapter(dev); | 383 | retval = hdpvr_register_i2c_adapter(dev); |
383 | if (retval < 0) { | 384 | if (retval < 0) { |
384 | v4l2_err(&dev->v4l2_dev, "registering i2c adapter failed\n"); | 385 | v4l2_err(&dev->v4l2_dev, "i2c adapter register failed\n"); |
385 | goto error; | 386 | goto error; |
386 | } | 387 | } |
387 | 388 | ||
388 | retval = hdpvr_register_i2c_ir(dev); | 389 | client = hdpvr_register_ir_rx_i2c(dev); |
389 | if (retval < 0) | 390 | if (!client) { |
390 | v4l2_err(&dev->v4l2_dev, "registering i2c IR devices failed\n"); | 391 | v4l2_err(&dev->v4l2_dev, "i2c IR RX device register failed\n"); |
392 | goto reg_fail; | ||
393 | } | ||
394 | |||
395 | client = hdpvr_register_ir_tx_i2c(dev); | ||
396 | if (!client) { | ||
397 | v4l2_err(&dev->v4l2_dev, "i2c IR TX device register failed\n"); | ||
398 | goto reg_fail; | ||
399 | } | ||
391 | #endif | 400 | #endif |
392 | 401 | ||
393 | /* let the user know what node this device is now attached to */ | 402 | /* let the user know what node this device is now attached to */ |
@@ -395,6 +404,10 @@ static int hdpvr_probe(struct usb_interface *interface, | |||
395 | video_device_node_name(dev->video_dev)); | 404 | video_device_node_name(dev->video_dev)); |
396 | return 0; | 405 | return 0; |
397 | 406 | ||
407 | reg_fail: | ||
408 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
409 | i2c_del_adapter(&dev->i2c_adapter); | ||
410 | #endif | ||
398 | error: | 411 | error: |
399 | if (dev) { | 412 | if (dev) { |
400 | /* Destroy single thread */ | 413 | /* Destroy single thread */ |
@@ -424,6 +437,9 @@ static void hdpvr_disconnect(struct usb_interface *interface) | |||
424 | mutex_lock(&dev->io_mutex); | 437 | mutex_lock(&dev->io_mutex); |
425 | hdpvr_cancel_queue(dev); | 438 | hdpvr_cancel_queue(dev); |
426 | mutex_unlock(&dev->io_mutex); | 439 | mutex_unlock(&dev->io_mutex); |
440 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
441 | i2c_del_adapter(&dev->i2c_adapter); | ||
442 | #endif | ||
427 | video_unregister_device(dev->video_dev); | 443 | video_unregister_device(dev->video_dev); |
428 | atomic_dec(&dev_nr); | 444 | atomic_dec(&dev_nr); |
429 | } | 445 | } |
diff --git a/drivers/media/video/hdpvr/hdpvr-i2c.c b/drivers/media/video/hdpvr/hdpvr-i2c.c index 89b71faeaac2..e53fa55d56a1 100644 --- a/drivers/media/video/hdpvr/hdpvr-i2c.c +++ b/drivers/media/video/hdpvr/hdpvr-i2c.c | |||
@@ -31,26 +31,34 @@ | |||
31 | #define Z8F0811_IR_RX_I2C_ADDR 0x71 | 31 | #define Z8F0811_IR_RX_I2C_ADDR 0x71 |
32 | 32 | ||
33 | 33 | ||
34 | static struct i2c_board_info hdpvr_i2c_board_info = { | 34 | struct i2c_client *hdpvr_register_ir_tx_i2c(struct hdpvr_device *dev) |
35 | I2C_BOARD_INFO("ir_tx_z8f0811_hdpvr", Z8F0811_IR_TX_I2C_ADDR), | 35 | { |
36 | I2C_BOARD_INFO("ir_rx_z8f0811_hdpvr", Z8F0811_IR_RX_I2C_ADDR), | 36 | struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data; |
37 | }; | 37 | struct i2c_board_info hdpvr_ir_tx_i2c_board_info = { |
38 | I2C_BOARD_INFO("ir_tx_z8f0811_hdpvr", Z8F0811_IR_TX_I2C_ADDR), | ||
39 | }; | ||
40 | |||
41 | init_data->name = "HD-PVR"; | ||
42 | hdpvr_ir_tx_i2c_board_info.platform_data = init_data; | ||
38 | 43 | ||
39 | int hdpvr_register_i2c_ir(struct hdpvr_device *dev) | 44 | return i2c_new_device(&dev->i2c_adapter, &hdpvr_ir_tx_i2c_board_info); |
45 | } | ||
46 | |||
47 | struct i2c_client *hdpvr_register_ir_rx_i2c(struct hdpvr_device *dev) | ||
40 | { | 48 | { |
41 | struct i2c_client *c; | ||
42 | struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data; | 49 | struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data; |
50 | struct i2c_board_info hdpvr_ir_rx_i2c_board_info = { | ||
51 | I2C_BOARD_INFO("ir_rx_z8f0811_hdpvr", Z8F0811_IR_RX_I2C_ADDR), | ||
52 | }; | ||
43 | 53 | ||
44 | /* Our default information for ir-kbd-i2c.c to use */ | 54 | /* Our default information for ir-kbd-i2c.c to use */ |
45 | init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW; | 55 | init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW; |
46 | init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; | 56 | init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; |
47 | init_data->type = RC_TYPE_RC5; | 57 | init_data->type = RC_TYPE_RC5; |
48 | init_data->name = "HD PVR"; | 58 | init_data->name = "HD-PVR"; |
49 | hdpvr_i2c_board_info.platform_data = init_data; | 59 | hdpvr_ir_rx_i2c_board_info.platform_data = init_data; |
50 | |||
51 | c = i2c_new_device(&dev->i2c_adapter, &hdpvr_i2c_board_info); | ||
52 | 60 | ||
53 | return (c == NULL) ? -ENODEV : 0; | 61 | return i2c_new_device(&dev->i2c_adapter, &hdpvr_ir_rx_i2c_board_info); |
54 | } | 62 | } |
55 | 63 | ||
56 | static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus, | 64 | static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus, |
diff --git a/drivers/media/video/hdpvr/hdpvr.h b/drivers/media/video/hdpvr/hdpvr.h index ee74e3be9a6a..072f23c570f3 100644 --- a/drivers/media/video/hdpvr/hdpvr.h +++ b/drivers/media/video/hdpvr/hdpvr.h | |||
@@ -313,7 +313,8 @@ int hdpvr_cancel_queue(struct hdpvr_device *dev); | |||
313 | /* i2c adapter registration */ | 313 | /* i2c adapter registration */ |
314 | int hdpvr_register_i2c_adapter(struct hdpvr_device *dev); | 314 | int hdpvr_register_i2c_adapter(struct hdpvr_device *dev); |
315 | 315 | ||
316 | int hdpvr_register_i2c_ir(struct hdpvr_device *dev); | 316 | struct i2c_client *hdpvr_register_ir_rx_i2c(struct hdpvr_device *dev); |
317 | struct i2c_client *hdpvr_register_ir_tx_i2c(struct hdpvr_device *dev); | ||
317 | 318 | ||
318 | /*========================================================================*/ | 319 | /*========================================================================*/ |
319 | /* buffer management */ | 320 | /* buffer management */ |
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index d2b20ad383a3..a221ad68b330 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c | |||
@@ -128,6 +128,19 @@ static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | |||
128 | 128 | ||
129 | static int get_key_haup_xvr(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | 129 | static int get_key_haup_xvr(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) |
130 | { | 130 | { |
131 | int ret; | ||
132 | unsigned char buf[1] = { 0 }; | ||
133 | |||
134 | /* | ||
135 | * This is the same apparent "are you ready?" poll command observed | ||
136 | * watching Windows driver traffic and implemented in lirc_zilog. With | ||
137 | * this added, we get far saner remote behavior with z8 chips on usb | ||
138 | * connected devices, even with the default polling interval of 100ms. | ||
139 | */ | ||
140 | ret = i2c_master_send(ir->c, buf, 1); | ||
141 | if (ret != 1) | ||
142 | return (ret < 0) ? ret : -EINVAL; | ||
143 | |||
131 | return get_key_haup_common (ir, ir_key, ir_raw, 6, 3); | 144 | return get_key_haup_common (ir, ir_key, ir_raw, 6, 3); |
132 | } | 145 | } |
133 | 146 | ||
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index ccc884948f34..451ecd485f97 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | |||
@@ -597,7 +597,6 @@ static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw) | |||
597 | init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; | 597 | init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; |
598 | init_data->type = RC_TYPE_RC5; | 598 | init_data->type = RC_TYPE_RC5; |
599 | init_data->name = hdw->hdw_desc->description; | 599 | init_data->name = hdw->hdw_desc->description; |
600 | init_data->polling_interval = 260; /* ms From lirc_zilog */ | ||
601 | /* IR Receiver */ | 600 | /* IR Receiver */ |
602 | info.addr = 0x71; | 601 | info.addr = 0x71; |
603 | info.platform_data = init_data; | 602 | info.platform_data = init_data; |
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index f35459d1f42f..0db90922ee93 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -1565,7 +1565,7 @@ static int saa711x_probe(struct i2c_client *client, | |||
1565 | chip_id = name[5]; | 1565 | chip_id = name[5]; |
1566 | 1566 | ||
1567 | /* Check whether this chip is part of the saa711x series */ | 1567 | /* Check whether this chip is part of the saa711x series */ |
1568 | if (memcmp(name, "1f711", 5)) { | 1568 | if (memcmp(name + 1, "f711", 4)) { |
1569 | v4l_dbg(1, debug, client, "chip found @ 0x%x (ID %s) does not match a known saa711x chip.\n", | 1569 | v4l_dbg(1, debug, client, "chip found @ 0x%x (ID %s) does not match a known saa711x chip.\n", |
1570 | client->addr << 1, name); | 1570 | client->addr << 1, name); |
1571 | return -ENODEV; | 1571 | return -ENODEV; |
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c index a699bbf20eb5..3824382faecc 100644 --- a/drivers/net/atl1c/atl1c_main.c +++ b/drivers/net/atl1c/atl1c_main.c | |||
@@ -48,6 +48,7 @@ static DEFINE_PCI_DEVICE_TABLE(atl1c_pci_tbl) = { | |||
48 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B)}, | 48 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B)}, |
49 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B2)}, | 49 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L2C_B2)}, |
50 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L1D)}, | 50 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L1D)}, |
51 | {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATHEROS_L1D_2_0)}, | ||
51 | /* required last entry */ | 52 | /* required last entry */ |
52 | { 0 } | 53 | { 0 } |
53 | }; | 54 | }; |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index de40d3b7152f..28a32a6c8bf1 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -312,11 +312,9 @@ void be_link_status_update(struct be_adapter *adapter, bool link_up) | |||
312 | if (adapter->link_up != link_up) { | 312 | if (adapter->link_up != link_up) { |
313 | adapter->link_speed = -1; | 313 | adapter->link_speed = -1; |
314 | if (link_up) { | 314 | if (link_up) { |
315 | netif_start_queue(netdev); | ||
316 | netif_carrier_on(netdev); | 315 | netif_carrier_on(netdev); |
317 | printk(KERN_INFO "%s: Link up\n", netdev->name); | 316 | printk(KERN_INFO "%s: Link up\n", netdev->name); |
318 | } else { | 317 | } else { |
319 | netif_stop_queue(netdev); | ||
320 | netif_carrier_off(netdev); | 318 | netif_carrier_off(netdev); |
321 | printk(KERN_INFO "%s: Link down\n", netdev->name); | 319 | printk(KERN_INFO "%s: Link down\n", netdev->name); |
322 | } | 320 | } |
@@ -2628,8 +2626,6 @@ static void be_netdev_init(struct net_device *netdev) | |||
2628 | 2626 | ||
2629 | netif_napi_add(netdev, &adapter->tx_eq.napi, be_poll_tx_mcc, | 2627 | netif_napi_add(netdev, &adapter->tx_eq.napi, be_poll_tx_mcc, |
2630 | BE_NAPI_WEIGHT); | 2628 | BE_NAPI_WEIGHT); |
2631 | |||
2632 | netif_stop_queue(netdev); | ||
2633 | } | 2629 | } |
2634 | 2630 | ||
2635 | static void be_unmap_pci_bars(struct be_adapter *adapter) | 2631 | static void be_unmap_pci_bars(struct be_adapter *adapter) |
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index 8e4183717d91..653c62475cb6 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h | |||
@@ -22,8 +22,8 @@ | |||
22 | * (you will need to reboot afterwards) */ | 22 | * (you will need to reboot afterwards) */ |
23 | /* #define BNX2X_STOP_ON_ERROR */ | 23 | /* #define BNX2X_STOP_ON_ERROR */ |
24 | 24 | ||
25 | #define DRV_MODULE_VERSION "1.62.00-4" | 25 | #define DRV_MODULE_VERSION "1.62.00-5" |
26 | #define DRV_MODULE_RELDATE "2011/01/18" | 26 | #define DRV_MODULE_RELDATE "2011/01/30" |
27 | #define BNX2X_BC_VER 0x040200 | 27 | #define BNX2X_BC_VER 0x040200 |
28 | 28 | ||
29 | #define BNX2X_MULTI_QUEUE | 29 | #define BNX2X_MULTI_QUEUE |
diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c index 7160ec51093e..dd1210fddfff 100644 --- a/drivers/net/bnx2x/bnx2x_link.c +++ b/drivers/net/bnx2x/bnx2x_link.c | |||
@@ -3948,48 +3948,6 @@ static u8 bnx2x_8073_8727_external_rom_boot(struct bnx2x *bp, | |||
3948 | return rc; | 3948 | return rc; |
3949 | } | 3949 | } |
3950 | 3950 | ||
3951 | static void bnx2x_8073_set_xaui_low_power_mode(struct bnx2x *bp, | ||
3952 | struct bnx2x_phy *phy) | ||
3953 | { | ||
3954 | u16 val; | ||
3955 | bnx2x_cl45_read(bp, phy, | ||
3956 | MDIO_PMA_DEVAD, MDIO_PMA_REG_8073_CHIP_REV, &val); | ||
3957 | |||
3958 | if (val == 0) { | ||
3959 | /* Mustn't set low power mode in 8073 A0 */ | ||
3960 | return; | ||
3961 | } | ||
3962 | |||
3963 | /* Disable PLL sequencer (use read-modify-write to clear bit 13) */ | ||
3964 | bnx2x_cl45_read(bp, phy, | ||
3965 | MDIO_XS_DEVAD, MDIO_XS_PLL_SEQUENCER, &val); | ||
3966 | val &= ~(1<<13); | ||
3967 | bnx2x_cl45_write(bp, phy, | ||
3968 | MDIO_XS_DEVAD, MDIO_XS_PLL_SEQUENCER, val); | ||
3969 | |||
3970 | /* PLL controls */ | ||
3971 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x805E, 0x1077); | ||
3972 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x805D, 0x0000); | ||
3973 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x805C, 0x030B); | ||
3974 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x805B, 0x1240); | ||
3975 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x805A, 0x2490); | ||
3976 | |||
3977 | /* Tx Controls */ | ||
3978 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80A7, 0x0C74); | ||
3979 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80A6, 0x9041); | ||
3980 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80A5, 0x4640); | ||
3981 | |||
3982 | /* Rx Controls */ | ||
3983 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80FE, 0x01C4); | ||
3984 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80FD, 0x9249); | ||
3985 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, 0x80FC, 0x2015); | ||
3986 | |||
3987 | /* Enable PLL sequencer (use read-modify-write to set bit 13) */ | ||
3988 | bnx2x_cl45_read(bp, phy, MDIO_XS_DEVAD, MDIO_XS_PLL_SEQUENCER, &val); | ||
3989 | val |= (1<<13); | ||
3990 | bnx2x_cl45_write(bp, phy, MDIO_XS_DEVAD, MDIO_XS_PLL_SEQUENCER, val); | ||
3991 | } | ||
3992 | |||
3993 | /******************************************************************/ | 3951 | /******************************************************************/ |
3994 | /* BCM8073 PHY SECTION */ | 3952 | /* BCM8073 PHY SECTION */ |
3995 | /******************************************************************/ | 3953 | /******************************************************************/ |
@@ -4148,8 +4106,6 @@ static u8 bnx2x_8073_config_init(struct bnx2x_phy *phy, | |||
4148 | 4106 | ||
4149 | bnx2x_8073_set_pause_cl37(params, phy, vars); | 4107 | bnx2x_8073_set_pause_cl37(params, phy, vars); |
4150 | 4108 | ||
4151 | bnx2x_8073_set_xaui_low_power_mode(bp, phy); | ||
4152 | |||
4153 | bnx2x_cl45_read(bp, phy, | 4109 | bnx2x_cl45_read(bp, phy, |
4154 | MDIO_PMA_DEVAD, MDIO_PMA_REG_M8051_MSGOUT_REG, &tmp1); | 4110 | MDIO_PMA_DEVAD, MDIO_PMA_REG_M8051_MSGOUT_REG, &tmp1); |
4155 | 4111 | ||
@@ -6519,6 +6475,18 @@ static void bnx2x_848xx_set_link_led(struct bnx2x_phy *phy, | |||
6519 | MDIO_PMA_DEVAD, | 6475 | MDIO_PMA_DEVAD, |
6520 | MDIO_PMA_REG_8481_LED1_MASK, | 6476 | MDIO_PMA_REG_8481_LED1_MASK, |
6521 | 0x80); | 6477 | 0x80); |
6478 | |||
6479 | /* Tell LED3 to blink on source */ | ||
6480 | bnx2x_cl45_read(bp, phy, | ||
6481 | MDIO_PMA_DEVAD, | ||
6482 | MDIO_PMA_REG_8481_LINK_SIGNAL, | ||
6483 | &val); | ||
6484 | val &= ~(7<<6); | ||
6485 | val |= (1<<6); /* A83B[8:6]= 1 */ | ||
6486 | bnx2x_cl45_write(bp, phy, | ||
6487 | MDIO_PMA_DEVAD, | ||
6488 | MDIO_PMA_REG_8481_LINK_SIGNAL, | ||
6489 | val); | ||
6522 | } | 6490 | } |
6523 | break; | 6491 | break; |
6524 | } | 6492 | } |
@@ -7720,10 +7688,13 @@ static u8 bnx2x_8073_common_init_phy(struct bnx2x *bp, | |||
7720 | struct bnx2x_phy phy[PORT_MAX]; | 7688 | struct bnx2x_phy phy[PORT_MAX]; |
7721 | struct bnx2x_phy *phy_blk[PORT_MAX]; | 7689 | struct bnx2x_phy *phy_blk[PORT_MAX]; |
7722 | u16 val; | 7690 | u16 val; |
7723 | s8 port; | 7691 | s8 port = 0; |
7724 | s8 port_of_path = 0; | 7692 | s8 port_of_path = 0; |
7725 | 7693 | u32 swap_val, swap_override; | |
7726 | bnx2x_ext_phy_hw_reset(bp, 0); | 7694 | swap_val = REG_RD(bp, NIG_REG_PORT_SWAP); |
7695 | swap_override = REG_RD(bp, NIG_REG_STRAP_OVERRIDE); | ||
7696 | port ^= (swap_val && swap_override); | ||
7697 | bnx2x_ext_phy_hw_reset(bp, port); | ||
7727 | /* PART1 - Reset both phys */ | 7698 | /* PART1 - Reset both phys */ |
7728 | for (port = PORT_MAX - 1; port >= PORT_0; port--) { | 7699 | for (port = PORT_MAX - 1; port >= PORT_0; port--) { |
7729 | u32 shmem_base, shmem2_base; | 7700 | u32 shmem_base, shmem2_base; |
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index 8cdcf5b39d1e..f40740e68ea5 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -2301,15 +2301,10 @@ static void bnx2x_rxq_set_mac_filters(struct bnx2x *bp, u16 cl_id, u32 filters) | |||
2301 | /* accept matched ucast */ | 2301 | /* accept matched ucast */ |
2302 | drop_all_ucast = 0; | 2302 | drop_all_ucast = 0; |
2303 | } | 2303 | } |
2304 | if (filters & BNX2X_ACCEPT_MULTICAST) { | 2304 | if (filters & BNX2X_ACCEPT_MULTICAST) |
2305 | /* accept matched mcast */ | 2305 | /* accept matched mcast */ |
2306 | drop_all_mcast = 0; | 2306 | drop_all_mcast = 0; |
2307 | if (IS_MF_SI(bp)) | 2307 | |
2308 | /* since mcast addresses won't arrive with ovlan, | ||
2309 | * fw needs to accept all of them in | ||
2310 | * switch-independent mode */ | ||
2311 | accp_all_mcast = 1; | ||
2312 | } | ||
2313 | if (filters & BNX2X_ACCEPT_ALL_UNICAST) { | 2308 | if (filters & BNX2X_ACCEPT_ALL_UNICAST) { |
2314 | /* accept all mcast */ | 2309 | /* accept all mcast */ |
2315 | drop_all_ucast = 0; | 2310 | drop_all_ucast = 0; |
@@ -5296,10 +5291,6 @@ static int bnx2x_init_hw_common(struct bnx2x *bp, u32 load_code) | |||
5296 | } | 5291 | } |
5297 | } | 5292 | } |
5298 | 5293 | ||
5299 | bp->port.need_hw_lock = bnx2x_hw_lock_required(bp, | ||
5300 | bp->common.shmem_base, | ||
5301 | bp->common.shmem2_base); | ||
5302 | |||
5303 | bnx2x_setup_fan_failure_detection(bp); | 5294 | bnx2x_setup_fan_failure_detection(bp); |
5304 | 5295 | ||
5305 | /* clear PXP2 attentions */ | 5296 | /* clear PXP2 attentions */ |
@@ -5503,9 +5494,6 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) | |||
5503 | 5494 | ||
5504 | bnx2x_init_block(bp, MCP_BLOCK, init_stage); | 5495 | bnx2x_init_block(bp, MCP_BLOCK, init_stage); |
5505 | bnx2x_init_block(bp, DMAE_BLOCK, init_stage); | 5496 | bnx2x_init_block(bp, DMAE_BLOCK, init_stage); |
5506 | bp->port.need_hw_lock = bnx2x_hw_lock_required(bp, | ||
5507 | bp->common.shmem_base, | ||
5508 | bp->common.shmem2_base); | ||
5509 | if (bnx2x_fan_failure_det_req(bp, bp->common.shmem_base, | 5497 | if (bnx2x_fan_failure_det_req(bp, bp->common.shmem_base, |
5510 | bp->common.shmem2_base, port)) { | 5498 | bp->common.shmem2_base, port)) { |
5511 | u32 reg_addr = (port ? MISC_REG_AEU_ENABLE1_FUNC_1_OUT_0 : | 5499 | u32 reg_addr = (port ? MISC_REG_AEU_ENABLE1_FUNC_1_OUT_0 : |
@@ -8379,6 +8367,17 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) | |||
8379 | (ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) | 8367 | (ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) |
8380 | bp->mdio.prtad = | 8368 | bp->mdio.prtad = |
8381 | XGXS_EXT_PHY_ADDR(ext_phy_config); | 8369 | XGXS_EXT_PHY_ADDR(ext_phy_config); |
8370 | |||
8371 | /* | ||
8372 | * Check if hw lock is required to access MDC/MDIO bus to the PHY(s) | ||
8373 | * In MF mode, it is set to cover self test cases | ||
8374 | */ | ||
8375 | if (IS_MF(bp)) | ||
8376 | bp->port.need_hw_lock = 1; | ||
8377 | else | ||
8378 | bp->port.need_hw_lock = bnx2x_hw_lock_required(bp, | ||
8379 | bp->common.shmem_base, | ||
8380 | bp->common.shmem2_base); | ||
8382 | } | 8381 | } |
8383 | 8382 | ||
8384 | static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp) | 8383 | static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp) |
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index 986195eaa57c..5dec456fd4a4 100644 --- a/drivers/net/can/Kconfig +++ b/drivers/net/can/Kconfig | |||
@@ -23,7 +23,7 @@ config CAN_SLCAN | |||
23 | 23 | ||
24 | As only the sending and receiving of CAN frames is implemented, this | 24 | As only the sending and receiving of CAN frames is implemented, this |
25 | driver should work with the (serial/USB) CAN hardware from: | 25 | driver should work with the (serial/USB) CAN hardware from: |
26 | www.canusb.com / www.can232.com / www.mictronic.com / www.canhack.de | 26 | www.canusb.com / www.can232.com / www.mictronics.de / www.canhack.de |
27 | 27 | ||
28 | Userspace tools to attach the SLCAN line discipline (slcan_attach, | 28 | Userspace tools to attach the SLCAN line discipline (slcan_attach, |
29 | slcand) can be found in the can-utils at the SocketCAN SVN, see | 29 | slcand) can be found in the can-utils at the SocketCAN SVN, see |
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index 2532b9631538..57d2ffbbb433 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c | |||
@@ -1109,7 +1109,7 @@ static ssize_t at91_sysfs_set_mb0_id(struct device *dev, | |||
1109 | return ret; | 1109 | return ret; |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | static DEVICE_ATTR(mb0_id, S_IWUGO | S_IRUGO, | 1112 | static DEVICE_ATTR(mb0_id, S_IWUSR | S_IRUGO, |
1113 | at91_sysfs_show_mb0_id, at91_sysfs_set_mb0_id); | 1113 | at91_sysfs_show_mb0_id, at91_sysfs_set_mb0_id); |
1114 | 1114 | ||
1115 | static struct attribute *at91_sysfs_attrs[] = { | 1115 | static struct attribute *at91_sysfs_attrs[] = { |
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c index b9a6d7a5a739..366f5cc050ae 100644 --- a/drivers/net/can/janz-ican3.c +++ b/drivers/net/can/janz-ican3.c | |||
@@ -1618,7 +1618,7 @@ static ssize_t ican3_sysfs_set_term(struct device *dev, | |||
1618 | return count; | 1618 | return count; |
1619 | } | 1619 | } |
1620 | 1620 | ||
1621 | static DEVICE_ATTR(termination, S_IWUGO | S_IRUGO, ican3_sysfs_show_term, | 1621 | static DEVICE_ATTR(termination, S_IWUSR | S_IRUGO, ican3_sysfs_show_term, |
1622 | ican3_sysfs_set_term); | 1622 | ican3_sysfs_set_term); |
1623 | 1623 | ||
1624 | static struct attribute *ican3_sysfs_attrs[] = { | 1624 | static struct attribute *ican3_sysfs_attrs[] = { |
diff --git a/drivers/net/can/softing/Kconfig b/drivers/net/can/softing/Kconfig index 92bd6bdde5e3..8ba81b3ddd90 100644 --- a/drivers/net/can/softing/Kconfig +++ b/drivers/net/can/softing/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config CAN_SOFTING | 1 | config CAN_SOFTING |
2 | tristate "Softing Gmbh CAN generic support" | 2 | tristate "Softing Gmbh CAN generic support" |
3 | depends on CAN_DEV | 3 | depends on CAN_DEV && HAS_IOMEM |
4 | ---help--- | 4 | ---help--- |
5 | Support for CAN cards from Softing Gmbh & some cards | 5 | Support for CAN cards from Softing Gmbh & some cards |
6 | from Vector Gmbh. | 6 | from Vector Gmbh. |
diff --git a/drivers/net/depca.c b/drivers/net/depca.c index 1b48b68ad4fd..8b0084d17c8c 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c | |||
@@ -1094,7 +1094,7 @@ static int depca_rx(struct net_device *dev) | |||
1094 | } | 1094 | } |
1095 | } | 1095 | } |
1096 | /* Change buffer ownership for this last frame, back to the adapter */ | 1096 | /* Change buffer ownership for this last frame, back to the adapter */ |
1097 | for (; lp->rx_old != entry; lp->rx_old = (++lp->rx_old) & lp->rxRingMask) { | 1097 | for (; lp->rx_old != entry; lp->rx_old = (lp->rx_old + 1) & lp->rxRingMask) { |
1098 | writel(readl(&lp->rx_ring[lp->rx_old].base) | R_OWN, &lp->rx_ring[lp->rx_old].base); | 1098 | writel(readl(&lp->rx_ring[lp->rx_old].base) | R_OWN, &lp->rx_ring[lp->rx_old].base); |
1099 | } | 1099 | } |
1100 | writel(readl(&lp->rx_ring[entry].base) | R_OWN, &lp->rx_ring[entry].base); | 1100 | writel(readl(&lp->rx_ring[entry].base) | R_OWN, &lp->rx_ring[entry].base); |
@@ -1103,7 +1103,7 @@ static int depca_rx(struct net_device *dev) | |||
1103 | /* | 1103 | /* |
1104 | ** Update entry information | 1104 | ** Update entry information |
1105 | */ | 1105 | */ |
1106 | lp->rx_new = (++lp->rx_new) & lp->rxRingMask; | 1106 | lp->rx_new = (lp->rx_new + 1) & lp->rxRingMask; |
1107 | } | 1107 | } |
1108 | 1108 | ||
1109 | return 0; | 1109 | return 0; |
@@ -1148,7 +1148,7 @@ static int depca_tx(struct net_device *dev) | |||
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | /* Update all the pointers */ | 1150 | /* Update all the pointers */ |
1151 | lp->tx_old = (++lp->tx_old) & lp->txRingMask; | 1151 | lp->tx_old = (lp->tx_old + 1) & lp->txRingMask; |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | return 0; | 1154 | return 0; |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index e1a8216ff692..c05db6046050 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -1753,8 +1753,6 @@ rio_close (struct net_device *dev) | |||
1753 | 1753 | ||
1754 | /* Free all the skbuffs in the queue. */ | 1754 | /* Free all the skbuffs in the queue. */ |
1755 | for (i = 0; i < RX_RING_SIZE; i++) { | 1755 | for (i = 0; i < RX_RING_SIZE; i++) { |
1756 | np->rx_ring[i].status = 0; | ||
1757 | np->rx_ring[i].fraginfo = 0; | ||
1758 | skb = np->rx_skbuff[i]; | 1756 | skb = np->rx_skbuff[i]; |
1759 | if (skb) { | 1757 | if (skb) { |
1760 | pci_unmap_single(np->pdev, | 1758 | pci_unmap_single(np->pdev, |
@@ -1763,6 +1761,8 @@ rio_close (struct net_device *dev) | |||
1763 | dev_kfree_skb (skb); | 1761 | dev_kfree_skb (skb); |
1764 | np->rx_skbuff[i] = NULL; | 1762 | np->rx_skbuff[i] = NULL; |
1765 | } | 1763 | } |
1764 | np->rx_ring[i].status = 0; | ||
1765 | np->rx_ring[i].fraginfo = 0; | ||
1766 | } | 1766 | } |
1767 | for (i = 0; i < TX_RING_SIZE; i++) { | 1767 | for (i = 0; i < TX_RING_SIZE; i++) { |
1768 | skb = np->tx_skbuff[i]; | 1768 | skb = np->tx_skbuff[i]; |
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 112c5aa9af7f..907b05a1c659 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c | |||
@@ -812,7 +812,7 @@ static void enc28j60_read_tsv(struct enc28j60_net *priv, u8 tsv[TSV_SIZE]) | |||
812 | if (netif_msg_hw(priv)) | 812 | if (netif_msg_hw(priv)) |
813 | printk(KERN_DEBUG DRV_NAME ": reading TSV at addr:0x%04x\n", | 813 | printk(KERN_DEBUG DRV_NAME ": reading TSV at addr:0x%04x\n", |
814 | endptr + 1); | 814 | endptr + 1); |
815 | enc28j60_mem_read(priv, endptr + 1, sizeof(tsv), tsv); | 815 | enc28j60_mem_read(priv, endptr + 1, TSV_SIZE, tsv); |
816 | } | 816 | } |
817 | 817 | ||
818 | static void enc28j60_dump_tsv(struct enc28j60_net *priv, const char *msg, | 818 | static void enc28j60_dump_tsv(struct enc28j60_net *priv, const char *msg, |
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 4ffdc18fcb8a..2765a3ce9c24 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
@@ -1286,6 +1286,21 @@ static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = { | |||
1286 | { PCI_VDEVICE(MELLANOX, 0x6764) }, /* MT26468 ConnectX EN 10GigE PCIe gen2*/ | 1286 | { PCI_VDEVICE(MELLANOX, 0x6764) }, /* MT26468 ConnectX EN 10GigE PCIe gen2*/ |
1287 | { PCI_VDEVICE(MELLANOX, 0x6746) }, /* MT26438 ConnectX EN 40GigE PCIe gen2 5GT/s */ | 1287 | { PCI_VDEVICE(MELLANOX, 0x6746) }, /* MT26438 ConnectX EN 40GigE PCIe gen2 5GT/s */ |
1288 | { PCI_VDEVICE(MELLANOX, 0x676e) }, /* MT26478 ConnectX2 40GigE PCIe gen2 */ | 1288 | { PCI_VDEVICE(MELLANOX, 0x676e) }, /* MT26478 ConnectX2 40GigE PCIe gen2 */ |
1289 | { PCI_VDEVICE(MELLANOX, 0x1002) }, /* MT25400 Family [ConnectX-2 Virtual Function] */ | ||
1290 | { PCI_VDEVICE(MELLANOX, 0x1003) }, /* MT27500 Family [ConnectX-3] */ | ||
1291 | { PCI_VDEVICE(MELLANOX, 0x1004) }, /* MT27500 Family [ConnectX-3 Virtual Function] */ | ||
1292 | { PCI_VDEVICE(MELLANOX, 0x1005) }, /* MT27510 Family */ | ||
1293 | { PCI_VDEVICE(MELLANOX, 0x1006) }, /* MT27511 Family */ | ||
1294 | { PCI_VDEVICE(MELLANOX, 0x1007) }, /* MT27520 Family */ | ||
1295 | { PCI_VDEVICE(MELLANOX, 0x1008) }, /* MT27521 Family */ | ||
1296 | { PCI_VDEVICE(MELLANOX, 0x1009) }, /* MT27530 Family */ | ||
1297 | { PCI_VDEVICE(MELLANOX, 0x100a) }, /* MT27531 Family */ | ||
1298 | { PCI_VDEVICE(MELLANOX, 0x100b) }, /* MT27540 Family */ | ||
1299 | { PCI_VDEVICE(MELLANOX, 0x100c) }, /* MT27541 Family */ | ||
1300 | { PCI_VDEVICE(MELLANOX, 0x100d) }, /* MT27550 Family */ | ||
1301 | { PCI_VDEVICE(MELLANOX, 0x100e) }, /* MT27551 Family */ | ||
1302 | { PCI_VDEVICE(MELLANOX, 0x100f) }, /* MT27560 Family */ | ||
1303 | { PCI_VDEVICE(MELLANOX, 0x1010) }, /* MT27561 Family */ | ||
1289 | { 0, } | 1304 | { 0, } |
1290 | }; | 1305 | }; |
1291 | 1306 | ||
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 2541321bad82..9fb59d3f9c92 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -4489,6 +4489,9 @@ static int niu_alloc_channels(struct niu *np) | |||
4489 | { | 4489 | { |
4490 | struct niu_parent *parent = np->parent; | 4490 | struct niu_parent *parent = np->parent; |
4491 | int first_rx_channel, first_tx_channel; | 4491 | int first_rx_channel, first_tx_channel; |
4492 | int num_rx_rings, num_tx_rings; | ||
4493 | struct rx_ring_info *rx_rings; | ||
4494 | struct tx_ring_info *tx_rings; | ||
4492 | int i, port, err; | 4495 | int i, port, err; |
4493 | 4496 | ||
4494 | port = np->port; | 4497 | port = np->port; |
@@ -4498,18 +4501,21 @@ static int niu_alloc_channels(struct niu *np) | |||
4498 | first_tx_channel += parent->txchan_per_port[i]; | 4501 | first_tx_channel += parent->txchan_per_port[i]; |
4499 | } | 4502 | } |
4500 | 4503 | ||
4501 | np->num_rx_rings = parent->rxchan_per_port[port]; | 4504 | num_rx_rings = parent->rxchan_per_port[port]; |
4502 | np->num_tx_rings = parent->txchan_per_port[port]; | 4505 | num_tx_rings = parent->txchan_per_port[port]; |
4503 | 4506 | ||
4504 | netif_set_real_num_rx_queues(np->dev, np->num_rx_rings); | 4507 | rx_rings = kcalloc(num_rx_rings, sizeof(struct rx_ring_info), |
4505 | netif_set_real_num_tx_queues(np->dev, np->num_tx_rings); | 4508 | GFP_KERNEL); |
4506 | |||
4507 | np->rx_rings = kcalloc(np->num_rx_rings, sizeof(struct rx_ring_info), | ||
4508 | GFP_KERNEL); | ||
4509 | err = -ENOMEM; | 4509 | err = -ENOMEM; |
4510 | if (!np->rx_rings) | 4510 | if (!rx_rings) |
4511 | goto out_err; | 4511 | goto out_err; |
4512 | 4512 | ||
4513 | np->num_rx_rings = num_rx_rings; | ||
4514 | smp_wmb(); | ||
4515 | np->rx_rings = rx_rings; | ||
4516 | |||
4517 | netif_set_real_num_rx_queues(np->dev, num_rx_rings); | ||
4518 | |||
4513 | for (i = 0; i < np->num_rx_rings; i++) { | 4519 | for (i = 0; i < np->num_rx_rings; i++) { |
4514 | struct rx_ring_info *rp = &np->rx_rings[i]; | 4520 | struct rx_ring_info *rp = &np->rx_rings[i]; |
4515 | 4521 | ||
@@ -4538,12 +4544,18 @@ static int niu_alloc_channels(struct niu *np) | |||
4538 | return err; | 4544 | return err; |
4539 | } | 4545 | } |
4540 | 4546 | ||
4541 | np->tx_rings = kcalloc(np->num_tx_rings, sizeof(struct tx_ring_info), | 4547 | tx_rings = kcalloc(num_tx_rings, sizeof(struct tx_ring_info), |
4542 | GFP_KERNEL); | 4548 | GFP_KERNEL); |
4543 | err = -ENOMEM; | 4549 | err = -ENOMEM; |
4544 | if (!np->tx_rings) | 4550 | if (!tx_rings) |
4545 | goto out_err; | 4551 | goto out_err; |
4546 | 4552 | ||
4553 | np->num_tx_rings = num_tx_rings; | ||
4554 | smp_wmb(); | ||
4555 | np->tx_rings = tx_rings; | ||
4556 | |||
4557 | netif_set_real_num_tx_queues(np->dev, num_tx_rings); | ||
4558 | |||
4547 | for (i = 0; i < np->num_tx_rings; i++) { | 4559 | for (i = 0; i < np->num_tx_rings; i++) { |
4548 | struct tx_ring_info *rp = &np->tx_rings[i]; | 4560 | struct tx_ring_info *rp = &np->tx_rings[i]; |
4549 | 4561 | ||
@@ -6246,11 +6258,17 @@ static void niu_sync_mac_stats(struct niu *np) | |||
6246 | static void niu_get_rx_stats(struct niu *np) | 6258 | static void niu_get_rx_stats(struct niu *np) |
6247 | { | 6259 | { |
6248 | unsigned long pkts, dropped, errors, bytes; | 6260 | unsigned long pkts, dropped, errors, bytes; |
6261 | struct rx_ring_info *rx_rings; | ||
6249 | int i; | 6262 | int i; |
6250 | 6263 | ||
6251 | pkts = dropped = errors = bytes = 0; | 6264 | pkts = dropped = errors = bytes = 0; |
6265 | |||
6266 | rx_rings = ACCESS_ONCE(np->rx_rings); | ||
6267 | if (!rx_rings) | ||
6268 | goto no_rings; | ||
6269 | |||
6252 | for (i = 0; i < np->num_rx_rings; i++) { | 6270 | for (i = 0; i < np->num_rx_rings; i++) { |
6253 | struct rx_ring_info *rp = &np->rx_rings[i]; | 6271 | struct rx_ring_info *rp = &rx_rings[i]; |
6254 | 6272 | ||
6255 | niu_sync_rx_discard_stats(np, rp, 0); | 6273 | niu_sync_rx_discard_stats(np, rp, 0); |
6256 | 6274 | ||
@@ -6259,6 +6277,8 @@ static void niu_get_rx_stats(struct niu *np) | |||
6259 | dropped += rp->rx_dropped; | 6277 | dropped += rp->rx_dropped; |
6260 | errors += rp->rx_errors; | 6278 | errors += rp->rx_errors; |
6261 | } | 6279 | } |
6280 | |||
6281 | no_rings: | ||
6262 | np->dev->stats.rx_packets = pkts; | 6282 | np->dev->stats.rx_packets = pkts; |
6263 | np->dev->stats.rx_bytes = bytes; | 6283 | np->dev->stats.rx_bytes = bytes; |
6264 | np->dev->stats.rx_dropped = dropped; | 6284 | np->dev->stats.rx_dropped = dropped; |
@@ -6268,16 +6288,24 @@ static void niu_get_rx_stats(struct niu *np) | |||
6268 | static void niu_get_tx_stats(struct niu *np) | 6288 | static void niu_get_tx_stats(struct niu *np) |
6269 | { | 6289 | { |
6270 | unsigned long pkts, errors, bytes; | 6290 | unsigned long pkts, errors, bytes; |
6291 | struct tx_ring_info *tx_rings; | ||
6271 | int i; | 6292 | int i; |
6272 | 6293 | ||
6273 | pkts = errors = bytes = 0; | 6294 | pkts = errors = bytes = 0; |
6295 | |||
6296 | tx_rings = ACCESS_ONCE(np->tx_rings); | ||
6297 | if (!tx_rings) | ||
6298 | goto no_rings; | ||
6299 | |||
6274 | for (i = 0; i < np->num_tx_rings; i++) { | 6300 | for (i = 0; i < np->num_tx_rings; i++) { |
6275 | struct tx_ring_info *rp = &np->tx_rings[i]; | 6301 | struct tx_ring_info *rp = &tx_rings[i]; |
6276 | 6302 | ||
6277 | pkts += rp->tx_packets; | 6303 | pkts += rp->tx_packets; |
6278 | bytes += rp->tx_bytes; | 6304 | bytes += rp->tx_bytes; |
6279 | errors += rp->tx_errors; | 6305 | errors += rp->tx_errors; |
6280 | } | 6306 | } |
6307 | |||
6308 | no_rings: | ||
6281 | np->dev->stats.tx_packets = pkts; | 6309 | np->dev->stats.tx_packets = pkts; |
6282 | np->dev->stats.tx_bytes = bytes; | 6310 | np->dev->stats.tx_bytes = bytes; |
6283 | np->dev->stats.tx_errors = errors; | 6311 | np->dev->stats.tx_errors = errors; |
@@ -6287,9 +6315,10 @@ static struct net_device_stats *niu_get_stats(struct net_device *dev) | |||
6287 | { | 6315 | { |
6288 | struct niu *np = netdev_priv(dev); | 6316 | struct niu *np = netdev_priv(dev); |
6289 | 6317 | ||
6290 | niu_get_rx_stats(np); | 6318 | if (netif_running(dev)) { |
6291 | niu_get_tx_stats(np); | 6319 | niu_get_rx_stats(np); |
6292 | 6320 | niu_get_tx_stats(np); | |
6321 | } | ||
6293 | return &dev->stats; | 6322 | return &dev->stats; |
6294 | } | 6323 | } |
6295 | 6324 | ||
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 1f42f6ac8551..d3cb77205863 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1488,12 +1488,10 @@ static void ei_rx_overrun(struct net_device *dev) | |||
1488 | 1488 | ||
1489 | /* | 1489 | /* |
1490 | * Wait a full Tx time (1.2ms) + some guard time, NS says 1.6ms total. | 1490 | * Wait a full Tx time (1.2ms) + some guard time, NS says 1.6ms total. |
1491 | * Early datasheets said to poll the reset bit, but now they say that | 1491 | * We wait at least 2ms. |
1492 | * it "is not a reliable indicator and subsequently should be ignored." | ||
1493 | * We wait at least 10ms. | ||
1494 | */ | 1492 | */ |
1495 | 1493 | ||
1496 | mdelay(10); | 1494 | mdelay(2); |
1497 | 1495 | ||
1498 | /* | 1496 | /* |
1499 | * Reset RBCR[01] back to zero as per magic incantation. | 1497 | * Reset RBCR[01] back to zero as per magic incantation. |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index bde7d61f1930..59ccf0c5c610 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -973,7 +973,8 @@ static void __rtl8169_check_link_status(struct net_device *dev, | |||
973 | if (pm) | 973 | if (pm) |
974 | pm_request_resume(&tp->pci_dev->dev); | 974 | pm_request_resume(&tp->pci_dev->dev); |
975 | netif_carrier_on(dev); | 975 | netif_carrier_on(dev); |
976 | netif_info(tp, ifup, dev, "link up\n"); | 976 | if (net_ratelimit()) |
977 | netif_info(tp, ifup, dev, "link up\n"); | ||
977 | } else { | 978 | } else { |
978 | netif_carrier_off(dev); | 979 | netif_carrier_off(dev); |
979 | netif_info(tp, ifdown, dev, "link down\n"); | 980 | netif_info(tp, ifdown, dev, "link down\n"); |
@@ -3757,7 +3758,8 @@ static void rtl_hw_start_8168(struct net_device *dev) | |||
3757 | RTL_W16(IntrMitigate, 0x5151); | 3758 | RTL_W16(IntrMitigate, 0x5151); |
3758 | 3759 | ||
3759 | /* Work around for RxFIFO overflow. */ | 3760 | /* Work around for RxFIFO overflow. */ |
3760 | if (tp->mac_version == RTL_GIGA_MAC_VER_11) { | 3761 | if (tp->mac_version == RTL_GIGA_MAC_VER_11 || |
3762 | tp->mac_version == RTL_GIGA_MAC_VER_22) { | ||
3761 | tp->intr_event |= RxFIFOOver | PCSTimeout; | 3763 | tp->intr_event |= RxFIFOOver | PCSTimeout; |
3762 | tp->intr_event &= ~RxOverflow; | 3764 | tp->intr_event &= ~RxOverflow; |
3763 | } | 3765 | } |
@@ -4639,12 +4641,33 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
4639 | break; | 4641 | break; |
4640 | } | 4642 | } |
4641 | 4643 | ||
4642 | /* Work around for rx fifo overflow */ | 4644 | if (unlikely(status & RxFIFOOver)) { |
4643 | if (unlikely(status & RxFIFOOver) && | 4645 | switch (tp->mac_version) { |
4644 | (tp->mac_version == RTL_GIGA_MAC_VER_11)) { | 4646 | /* Work around for rx fifo overflow */ |
4645 | netif_stop_queue(dev); | 4647 | case RTL_GIGA_MAC_VER_11: |
4646 | rtl8169_tx_timeout(dev); | 4648 | case RTL_GIGA_MAC_VER_22: |
4647 | break; | 4649 | case RTL_GIGA_MAC_VER_26: |
4650 | netif_stop_queue(dev); | ||
4651 | rtl8169_tx_timeout(dev); | ||
4652 | goto done; | ||
4653 | /* Testers needed. */ | ||
4654 | case RTL_GIGA_MAC_VER_17: | ||
4655 | case RTL_GIGA_MAC_VER_19: | ||
4656 | case RTL_GIGA_MAC_VER_20: | ||
4657 | case RTL_GIGA_MAC_VER_21: | ||
4658 | case RTL_GIGA_MAC_VER_23: | ||
4659 | case RTL_GIGA_MAC_VER_24: | ||
4660 | case RTL_GIGA_MAC_VER_27: | ||
4661 | case RTL_GIGA_MAC_VER_28: | ||
4662 | /* Experimental science. Pktgen proof. */ | ||
4663 | case RTL_GIGA_MAC_VER_12: | ||
4664 | case RTL_GIGA_MAC_VER_25: | ||
4665 | if (status == RxFIFOOver) | ||
4666 | goto done; | ||
4667 | break; | ||
4668 | default: | ||
4669 | break; | ||
4670 | } | ||
4648 | } | 4671 | } |
4649 | 4672 | ||
4650 | if (unlikely(status & SYSErr)) { | 4673 | if (unlikely(status & SYSErr)) { |
@@ -4680,7 +4703,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
4680 | (status & RxFIFOOver) ? (status | RxOverflow) : status); | 4703 | (status & RxFIFOOver) ? (status | RxOverflow) : status); |
4681 | status = RTL_R16(IntrStatus); | 4704 | status = RTL_R16(IntrStatus); |
4682 | } | 4705 | } |
4683 | 4706 | done: | |
4684 | return IRQ_RETVAL(handled); | 4707 | return IRQ_RETVAL(handled); |
4685 | } | 4708 | } |
4686 | 4709 | ||
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c index 01c05f53e2f9..228d4f7a58af 100644 --- a/drivers/net/vxge/vxge-config.c +++ b/drivers/net/vxge/vxge-config.c | |||
@@ -3690,7 +3690,7 @@ __vxge_hw_vpath_rts_table_get(struct __vxge_hw_vpath_handle *vp, | |||
3690 | if (status != VXGE_HW_OK) | 3690 | if (status != VXGE_HW_OK) |
3691 | goto exit; | 3691 | goto exit; |
3692 | 3692 | ||
3693 | if ((rts_table != VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_DA) || | 3693 | if ((rts_table != VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_DA) && |
3694 | (rts_table != | 3694 | (rts_table != |
3695 | VXGE_HW_RTS_ACS_STEER_CTRL_DATA_STRUCT_SEL_RTH_MULTI_IT)) | 3695 | VXGE_HW_RTS_ACS_STEER_CTRL_DATA_STRUCT_SEL_RTH_MULTI_IT)) |
3696 | *data1 = 0; | 3696 | *data1 = 0; |
diff --git a/drivers/net/wireless/ath/ath5k/dma.c b/drivers/net/wireless/ath/ath5k/dma.c index 0064be7ce5c9..21091c26a9a5 100644 --- a/drivers/net/wireless/ath/ath5k/dma.c +++ b/drivers/net/wireless/ath/ath5k/dma.c | |||
@@ -838,9 +838,9 @@ int ath5k_hw_dma_stop(struct ath5k_hw *ah) | |||
838 | for (i = 0; i < qmax; i++) { | 838 | for (i = 0; i < qmax; i++) { |
839 | err = ath5k_hw_stop_tx_dma(ah, i); | 839 | err = ath5k_hw_stop_tx_dma(ah, i); |
840 | /* -EINVAL -> queue inactive */ | 840 | /* -EINVAL -> queue inactive */ |
841 | if (err != -EINVAL) | 841 | if (err && err != -EINVAL) |
842 | return err; | 842 | return err; |
843 | } | 843 | } |
844 | 844 | ||
845 | return err; | 845 | return 0; |
846 | } | 846 | } |
diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c index e5f2b96a4c63..a702817daf72 100644 --- a/drivers/net/wireless/ath/ath5k/pcu.c +++ b/drivers/net/wireless/ath/ath5k/pcu.c | |||
@@ -86,7 +86,7 @@ int ath5k_hw_get_frame_duration(struct ath5k_hw *ah, | |||
86 | if (!ah->ah_bwmode) { | 86 | if (!ah->ah_bwmode) { |
87 | dur = ieee80211_generic_frame_duration(sc->hw, | 87 | dur = ieee80211_generic_frame_duration(sc->hw, |
88 | NULL, len, rate); | 88 | NULL, len, rate); |
89 | return dur; | 89 | return le16_to_cpu(dur); |
90 | } | 90 | } |
91 | 91 | ||
92 | bitrate = rate->bitrate; | 92 | bitrate = rate->bitrate; |
@@ -265,8 +265,6 @@ static inline void ath5k_hw_write_rate_duration(struct ath5k_hw *ah) | |||
265 | * what rate we should choose to TX ACKs. */ | 265 | * what rate we should choose to TX ACKs. */ |
266 | tx_time = ath5k_hw_get_frame_duration(ah, 10, rate); | 266 | tx_time = ath5k_hw_get_frame_duration(ah, 10, rate); |
267 | 267 | ||
268 | tx_time = le16_to_cpu(tx_time); | ||
269 | |||
270 | ath5k_hw_reg_write(ah, tx_time, reg); | 268 | ath5k_hw_reg_write(ah, tx_time, reg); |
271 | 269 | ||
272 | if (!(rate->flags & IEEE80211_RATE_SHORT_PREAMBLE)) | 270 | if (!(rate->flags & IEEE80211_RATE_SHORT_PREAMBLE)) |
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c index f8a7771faee2..f44c84ab5dce 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c | |||
@@ -426,9 +426,8 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah, | |||
426 | } | 426 | } |
427 | 427 | ||
428 | /* WAR for ASPM system hang */ | 428 | /* WAR for ASPM system hang */ |
429 | if (AR_SREV_9280(ah) || AR_SREV_9285(ah) || AR_SREV_9287(ah)) { | 429 | if (AR_SREV_9285(ah) || AR_SREV_9287(ah)) |
430 | val |= (AR_WA_BIT6 | AR_WA_BIT7); | 430 | val |= (AR_WA_BIT6 | AR_WA_BIT7); |
431 | } | ||
432 | 431 | ||
433 | if (AR_SREV_9285E_20(ah)) | 432 | if (AR_SREV_9285E_20(ah)) |
434 | val |= AR_WA_BIT23; | 433 | val |= AR_WA_BIT23; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 38433f9bfe59..0352f0994caa 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -142,9 +142,6 @@ static void ath9k_deinit_priv(struct ath9k_htc_priv *priv) | |||
142 | { | 142 | { |
143 | ath9k_htc_exit_debug(priv->ah); | 143 | ath9k_htc_exit_debug(priv->ah); |
144 | ath9k_hw_deinit(priv->ah); | 144 | ath9k_hw_deinit(priv->ah); |
145 | tasklet_kill(&priv->swba_tasklet); | ||
146 | tasklet_kill(&priv->rx_tasklet); | ||
147 | tasklet_kill(&priv->tx_tasklet); | ||
148 | kfree(priv->ah); | 145 | kfree(priv->ah); |
149 | priv->ah = NULL; | 146 | priv->ah = NULL; |
150 | } | 147 | } |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index f4d576bc3ccd..6bb59958f71e 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -1025,12 +1025,6 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) | |||
1025 | int ret = 0; | 1025 | int ret = 0; |
1026 | u8 cmd_rsp; | 1026 | u8 cmd_rsp; |
1027 | 1027 | ||
1028 | /* Cancel all the running timers/work .. */ | ||
1029 | cancel_work_sync(&priv->fatal_work); | ||
1030 | cancel_work_sync(&priv->ps_work); | ||
1031 | cancel_delayed_work_sync(&priv->ath9k_led_blink_work); | ||
1032 | ath9k_led_stop_brightness(priv); | ||
1033 | |||
1034 | mutex_lock(&priv->mutex); | 1028 | mutex_lock(&priv->mutex); |
1035 | 1029 | ||
1036 | if (priv->op_flags & OP_INVALID) { | 1030 | if (priv->op_flags & OP_INVALID) { |
@@ -1044,8 +1038,23 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw) | |||
1044 | WMI_CMD(WMI_DISABLE_INTR_CMDID); | 1038 | WMI_CMD(WMI_DISABLE_INTR_CMDID); |
1045 | WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID); | 1039 | WMI_CMD(WMI_DRAIN_TXQ_ALL_CMDID); |
1046 | WMI_CMD(WMI_STOP_RECV_CMDID); | 1040 | WMI_CMD(WMI_STOP_RECV_CMDID); |
1041 | |||
1042 | tasklet_kill(&priv->swba_tasklet); | ||
1043 | tasklet_kill(&priv->rx_tasklet); | ||
1044 | tasklet_kill(&priv->tx_tasklet); | ||
1045 | |||
1047 | skb_queue_purge(&priv->tx_queue); | 1046 | skb_queue_purge(&priv->tx_queue); |
1048 | 1047 | ||
1048 | mutex_unlock(&priv->mutex); | ||
1049 | |||
1050 | /* Cancel all the running timers/work .. */ | ||
1051 | cancel_work_sync(&priv->fatal_work); | ||
1052 | cancel_work_sync(&priv->ps_work); | ||
1053 | cancel_delayed_work_sync(&priv->ath9k_led_blink_work); | ||
1054 | ath9k_led_stop_brightness(priv); | ||
1055 | |||
1056 | mutex_lock(&priv->mutex); | ||
1057 | |||
1049 | /* Remove monitor interface here */ | 1058 | /* Remove monitor interface here */ |
1050 | if (ah->opmode == NL80211_IFTYPE_MONITOR) { | 1059 | if (ah->opmode == NL80211_IFTYPE_MONITOR) { |
1051 | if (ath9k_htc_remove_monitor_interface(priv)) | 1060 | if (ath9k_htc_remove_monitor_interface(priv)) |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 767d8b86f1e1..087a6a95edd5 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -598,8 +598,6 @@ err_btcoex: | |||
598 | err_queues: | 598 | err_queues: |
599 | ath9k_hw_deinit(ah); | 599 | ath9k_hw_deinit(ah); |
600 | err_hw: | 600 | err_hw: |
601 | tasklet_kill(&sc->intr_tq); | ||
602 | tasklet_kill(&sc->bcon_tasklet); | ||
603 | 601 | ||
604 | kfree(ah); | 602 | kfree(ah); |
605 | sc->sc_ah = NULL; | 603 | sc->sc_ah = NULL; |
@@ -807,9 +805,6 @@ static void ath9k_deinit_softc(struct ath_softc *sc) | |||
807 | 805 | ||
808 | ath9k_hw_deinit(sc->sc_ah); | 806 | ath9k_hw_deinit(sc->sc_ah); |
809 | 807 | ||
810 | tasklet_kill(&sc->intr_tq); | ||
811 | tasklet_kill(&sc->bcon_tasklet); | ||
812 | |||
813 | kfree(sc->sc_ah); | 808 | kfree(sc->sc_ah); |
814 | sc->sc_ah = NULL; | 809 | sc->sc_ah = NULL; |
815 | } | 810 | } |
@@ -824,6 +819,8 @@ void ath9k_deinit_device(struct ath_softc *sc) | |||
824 | wiphy_rfkill_stop_polling(sc->hw->wiphy); | 819 | wiphy_rfkill_stop_polling(sc->hw->wiphy); |
825 | ath_deinit_leds(sc); | 820 | ath_deinit_leds(sc); |
826 | 821 | ||
822 | ath9k_ps_restore(sc); | ||
823 | |||
827 | for (i = 0; i < sc->num_sec_wiphy; i++) { | 824 | for (i = 0; i < sc->num_sec_wiphy; i++) { |
828 | struct ath_wiphy *aphy = sc->sec_wiphy[i]; | 825 | struct ath_wiphy *aphy = sc->sec_wiphy[i]; |
829 | if (aphy == NULL) | 826 | if (aphy == NULL) |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index c79c97be6cd4..9040c2ff1909 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -325,6 +325,8 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int | |||
325 | { | 325 | { |
326 | struct ieee80211_hw *hw = sc->hw; | 326 | struct ieee80211_hw *hw = sc->hw; |
327 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 327 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
328 | struct ath_hw *ah = sc->sc_ah; | ||
329 | struct ath_common *common = ath9k_hw_common(ah); | ||
328 | struct ath_tx_control txctl; | 330 | struct ath_tx_control txctl; |
329 | int time_left; | 331 | int time_left; |
330 | 332 | ||
@@ -342,8 +344,12 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int | |||
342 | init_completion(&sc->paprd_complete); | 344 | init_completion(&sc->paprd_complete); |
343 | sc->paprd_pending = true; | 345 | sc->paprd_pending = true; |
344 | txctl.paprd = BIT(chain); | 346 | txctl.paprd = BIT(chain); |
345 | if (ath_tx_start(hw, skb, &txctl) != 0) | 347 | |
348 | if (ath_tx_start(hw, skb, &txctl) != 0) { | ||
349 | ath_dbg(common, ATH_DBG_XMIT, "PAPRD TX failed\n"); | ||
350 | dev_kfree_skb_any(skb); | ||
346 | return false; | 351 | return false; |
352 | } | ||
347 | 353 | ||
348 | time_left = wait_for_completion_timeout(&sc->paprd_complete, | 354 | time_left = wait_for_completion_timeout(&sc->paprd_complete, |
349 | msecs_to_jiffies(ATH_PAPRD_TIMEOUT)); | 355 | msecs_to_jiffies(ATH_PAPRD_TIMEOUT)); |
@@ -953,8 +959,6 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
953 | 959 | ||
954 | spin_unlock_bh(&sc->sc_pcu_lock); | 960 | spin_unlock_bh(&sc->sc_pcu_lock); |
955 | ath9k_ps_restore(sc); | 961 | ath9k_ps_restore(sc); |
956 | |||
957 | ath9k_setpower(sc, ATH9K_PM_FULL_SLEEP); | ||
958 | } | 962 | } |
959 | 963 | ||
960 | int ath_reset(struct ath_softc *sc, bool retry_tx) | 964 | int ath_reset(struct ath_softc *sc, bool retry_tx) |
@@ -1309,6 +1313,9 @@ static void ath9k_stop(struct ieee80211_hw *hw) | |||
1309 | 1313 | ||
1310 | spin_lock_bh(&sc->sc_pcu_lock); | 1314 | spin_lock_bh(&sc->sc_pcu_lock); |
1311 | 1315 | ||
1316 | /* prevent tasklets to enable interrupts once we disable them */ | ||
1317 | ah->imask &= ~ATH9K_INT_GLOBAL; | ||
1318 | |||
1312 | /* make sure h/w will not generate any interrupt | 1319 | /* make sure h/w will not generate any interrupt |
1313 | * before setting the invalid flag. */ | 1320 | * before setting the invalid flag. */ |
1314 | ath9k_hw_disable_interrupts(ah); | 1321 | ath9k_hw_disable_interrupts(ah); |
@@ -1326,6 +1333,12 @@ static void ath9k_stop(struct ieee80211_hw *hw) | |||
1326 | 1333 | ||
1327 | spin_unlock_bh(&sc->sc_pcu_lock); | 1334 | spin_unlock_bh(&sc->sc_pcu_lock); |
1328 | 1335 | ||
1336 | /* we can now sync irq and kill any running tasklets, since we already | ||
1337 | * disabled interrupts and not holding a spin lock */ | ||
1338 | synchronize_irq(sc->irq); | ||
1339 | tasklet_kill(&sc->intr_tq); | ||
1340 | tasklet_kill(&sc->bcon_tasklet); | ||
1341 | |||
1329 | ath9k_ps_restore(sc); | 1342 | ath9k_ps_restore(sc); |
1330 | 1343 | ||
1331 | sc->ps_idle = true; | 1344 | sc->ps_idle = true; |
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c index b8433f3a9bc2..62876cd5c41a 100644 --- a/drivers/net/wireless/rtlwifi/efuse.c +++ b/drivers/net/wireless/rtlwifi/efuse.c | |||
@@ -726,9 +726,9 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data) | |||
726 | } | 726 | } |
727 | 727 | ||
728 | static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | 728 | static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, |
729 | u8 efuse_data, u8 offset, int *bcontinual, | 729 | u8 efuse_data, u8 offset, int *bcontinual, |
730 | u8 *write_state, struct pgpkt_struct target_pkt, | 730 | u8 *write_state, struct pgpkt_struct *target_pkt, |
731 | int *repeat_times, int *bresult, u8 word_en) | 731 | int *repeat_times, int *bresult, u8 word_en) |
732 | { | 732 | { |
733 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 733 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
734 | struct pgpkt_struct tmp_pkt; | 734 | struct pgpkt_struct tmp_pkt; |
@@ -744,8 +744,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
744 | tmp_pkt.word_en = tmp_header & 0x0F; | 744 | tmp_pkt.word_en = tmp_header & 0x0F; |
745 | tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en); | 745 | tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en); |
746 | 746 | ||
747 | if (tmp_pkt.offset != target_pkt.offset) { | 747 | if (tmp_pkt.offset != target_pkt->offset) { |
748 | efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; | 748 | *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1; |
749 | *write_state = PG_STATE_HEADER; | 749 | *write_state = PG_STATE_HEADER; |
750 | } else { | 750 | } else { |
751 | for (tmpindex = 0; tmpindex < (tmp_word_cnts * 2); tmpindex++) { | 751 | for (tmpindex = 0; tmpindex < (tmp_word_cnts * 2); tmpindex++) { |
@@ -756,23 +756,23 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
756 | } | 756 | } |
757 | 757 | ||
758 | if (bdataempty == false) { | 758 | if (bdataempty == false) { |
759 | efuse_addr = efuse_addr + (tmp_word_cnts * 2) + 1; | 759 | *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1; |
760 | *write_state = PG_STATE_HEADER; | 760 | *write_state = PG_STATE_HEADER; |
761 | } else { | 761 | } else { |
762 | match_word_en = 0x0F; | 762 | match_word_en = 0x0F; |
763 | if (!((target_pkt.word_en & BIT(0)) | | 763 | if (!((target_pkt->word_en & BIT(0)) | |
764 | (tmp_pkt.word_en & BIT(0)))) | 764 | (tmp_pkt.word_en & BIT(0)))) |
765 | match_word_en &= (~BIT(0)); | 765 | match_word_en &= (~BIT(0)); |
766 | 766 | ||
767 | if (!((target_pkt.word_en & BIT(1)) | | 767 | if (!((target_pkt->word_en & BIT(1)) | |
768 | (tmp_pkt.word_en & BIT(1)))) | 768 | (tmp_pkt.word_en & BIT(1)))) |
769 | match_word_en &= (~BIT(1)); | 769 | match_word_en &= (~BIT(1)); |
770 | 770 | ||
771 | if (!((target_pkt.word_en & BIT(2)) | | 771 | if (!((target_pkt->word_en & BIT(2)) | |
772 | (tmp_pkt.word_en & BIT(2)))) | 772 | (tmp_pkt.word_en & BIT(2)))) |
773 | match_word_en &= (~BIT(2)); | 773 | match_word_en &= (~BIT(2)); |
774 | 774 | ||
775 | if (!((target_pkt.word_en & BIT(3)) | | 775 | if (!((target_pkt->word_en & BIT(3)) | |
776 | (tmp_pkt.word_en & BIT(3)))) | 776 | (tmp_pkt.word_en & BIT(3)))) |
777 | match_word_en &= (~BIT(3)); | 777 | match_word_en &= (~BIT(3)); |
778 | 778 | ||
@@ -780,7 +780,7 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
780 | badworden = efuse_word_enable_data_write( | 780 | badworden = efuse_word_enable_data_write( |
781 | hw, *efuse_addr + 1, | 781 | hw, *efuse_addr + 1, |
782 | tmp_pkt.word_en, | 782 | tmp_pkt.word_en, |
783 | target_pkt.data); | 783 | target_pkt->data); |
784 | 784 | ||
785 | if (0x0F != (badworden & 0x0F)) { | 785 | if (0x0F != (badworden & 0x0F)) { |
786 | u8 reorg_offset = offset; | 786 | u8 reorg_offset = offset; |
@@ -791,26 +791,26 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
791 | } | 791 | } |
792 | 792 | ||
793 | tmp_word_en = 0x0F; | 793 | tmp_word_en = 0x0F; |
794 | if ((target_pkt.word_en & BIT(0)) ^ | 794 | if ((target_pkt->word_en & BIT(0)) ^ |
795 | (match_word_en & BIT(0))) | 795 | (match_word_en & BIT(0))) |
796 | tmp_word_en &= (~BIT(0)); | 796 | tmp_word_en &= (~BIT(0)); |
797 | 797 | ||
798 | if ((target_pkt.word_en & BIT(1)) ^ | 798 | if ((target_pkt->word_en & BIT(1)) ^ |
799 | (match_word_en & BIT(1))) | 799 | (match_word_en & BIT(1))) |
800 | tmp_word_en &= (~BIT(1)); | 800 | tmp_word_en &= (~BIT(1)); |
801 | 801 | ||
802 | if ((target_pkt.word_en & BIT(2)) ^ | 802 | if ((target_pkt->word_en & BIT(2)) ^ |
803 | (match_word_en & BIT(2))) | 803 | (match_word_en & BIT(2))) |
804 | tmp_word_en &= (~BIT(2)); | 804 | tmp_word_en &= (~BIT(2)); |
805 | 805 | ||
806 | if ((target_pkt.word_en & BIT(3)) ^ | 806 | if ((target_pkt->word_en & BIT(3)) ^ |
807 | (match_word_en & BIT(3))) | 807 | (match_word_en & BIT(3))) |
808 | tmp_word_en &= (~BIT(3)); | 808 | tmp_word_en &= (~BIT(3)); |
809 | 809 | ||
810 | if ((tmp_word_en & 0x0F) != 0x0F) { | 810 | if ((tmp_word_en & 0x0F) != 0x0F) { |
811 | *efuse_addr = efuse_get_current_size(hw); | 811 | *efuse_addr = efuse_get_current_size(hw); |
812 | target_pkt.offset = offset; | 812 | target_pkt->offset = offset; |
813 | target_pkt.word_en = tmp_word_en; | 813 | target_pkt->word_en = tmp_word_en; |
814 | } else | 814 | } else |
815 | *bcontinual = false; | 815 | *bcontinual = false; |
816 | *write_state = PG_STATE_HEADER; | 816 | *write_state = PG_STATE_HEADER; |
@@ -821,8 +821,8 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
821 | } | 821 | } |
822 | } else { | 822 | } else { |
823 | *efuse_addr += (2 * tmp_word_cnts) + 1; | 823 | *efuse_addr += (2 * tmp_word_cnts) + 1; |
824 | target_pkt.offset = offset; | 824 | target_pkt->offset = offset; |
825 | target_pkt.word_en = word_en; | 825 | target_pkt->word_en = word_en; |
826 | *write_state = PG_STATE_HEADER; | 826 | *write_state = PG_STATE_HEADER; |
827 | } | 827 | } |
828 | } | 828 | } |
@@ -938,7 +938,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw, | |||
938 | efuse_write_data_case1(hw, &efuse_addr, | 938 | efuse_write_data_case1(hw, &efuse_addr, |
939 | efuse_data, offset, | 939 | efuse_data, offset, |
940 | &bcontinual, | 940 | &bcontinual, |
941 | &write_state, target_pkt, | 941 | &write_state, &target_pkt, |
942 | &repeat_times, &bresult, | 942 | &repeat_times, &bresult, |
943 | word_en); | 943 | word_en); |
944 | else | 944 | else |
diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c index 46714910f98c..7145ea543783 100644 --- a/drivers/net/wireless/wl12xx/spi.c +++ b/drivers/net/wireless/wl12xx/spi.c | |||
@@ -110,9 +110,8 @@ static void wl1271_spi_reset(struct wl1271 *wl) | |||
110 | spi_message_add_tail(&t, &m); | 110 | spi_message_add_tail(&t, &m); |
111 | 111 | ||
112 | spi_sync(wl_to_spi(wl), &m); | 112 | spi_sync(wl_to_spi(wl), &m); |
113 | kfree(cmd); | ||
114 | |||
115 | wl1271_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); | 113 | wl1271_dump(DEBUG_SPI, "spi reset -> ", cmd, WSPI_INIT_CMD_LEN); |
114 | kfree(cmd); | ||
116 | } | 115 | } |
117 | 116 | ||
118 | static void wl1271_spi_init(struct wl1271 *wl) | 117 | static void wl1271_spi_init(struct wl1271 *wl) |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 546de5749824..da1f12120346 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -120,6 +120,9 @@ struct netfront_info { | |||
120 | unsigned long rx_pfn_array[NET_RX_RING_SIZE]; | 120 | unsigned long rx_pfn_array[NET_RX_RING_SIZE]; |
121 | struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1]; | 121 | struct multicall_entry rx_mcl[NET_RX_RING_SIZE+1]; |
122 | struct mmu_update rx_mmu[NET_RX_RING_SIZE]; | 122 | struct mmu_update rx_mmu[NET_RX_RING_SIZE]; |
123 | |||
124 | /* Statistics */ | ||
125 | int rx_gso_checksum_fixup; | ||
123 | }; | 126 | }; |
124 | 127 | ||
125 | struct netfront_rx_info { | 128 | struct netfront_rx_info { |
@@ -770,11 +773,29 @@ static RING_IDX xennet_fill_frags(struct netfront_info *np, | |||
770 | return cons; | 773 | return cons; |
771 | } | 774 | } |
772 | 775 | ||
773 | static int skb_checksum_setup(struct sk_buff *skb) | 776 | static int checksum_setup(struct net_device *dev, struct sk_buff *skb) |
774 | { | 777 | { |
775 | struct iphdr *iph; | 778 | struct iphdr *iph; |
776 | unsigned char *th; | 779 | unsigned char *th; |
777 | int err = -EPROTO; | 780 | int err = -EPROTO; |
781 | int recalculate_partial_csum = 0; | ||
782 | |||
783 | /* | ||
784 | * A GSO SKB must be CHECKSUM_PARTIAL. However some buggy | ||
785 | * peers can fail to set NETRXF_csum_blank when sending a GSO | ||
786 | * frame. In this case force the SKB to CHECKSUM_PARTIAL and | ||
787 | * recalculate the partial checksum. | ||
788 | */ | ||
789 | if (skb->ip_summed != CHECKSUM_PARTIAL && skb_is_gso(skb)) { | ||
790 | struct netfront_info *np = netdev_priv(dev); | ||
791 | np->rx_gso_checksum_fixup++; | ||
792 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
793 | recalculate_partial_csum = 1; | ||
794 | } | ||
795 | |||
796 | /* A non-CHECKSUM_PARTIAL SKB does not require setup. */ | ||
797 | if (skb->ip_summed != CHECKSUM_PARTIAL) | ||
798 | return 0; | ||
778 | 799 | ||
779 | if (skb->protocol != htons(ETH_P_IP)) | 800 | if (skb->protocol != htons(ETH_P_IP)) |
780 | goto out; | 801 | goto out; |
@@ -788,9 +809,23 @@ static int skb_checksum_setup(struct sk_buff *skb) | |||
788 | switch (iph->protocol) { | 809 | switch (iph->protocol) { |
789 | case IPPROTO_TCP: | 810 | case IPPROTO_TCP: |
790 | skb->csum_offset = offsetof(struct tcphdr, check); | 811 | skb->csum_offset = offsetof(struct tcphdr, check); |
812 | |||
813 | if (recalculate_partial_csum) { | ||
814 | struct tcphdr *tcph = (struct tcphdr *)th; | ||
815 | tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, | ||
816 | skb->len - iph->ihl*4, | ||
817 | IPPROTO_TCP, 0); | ||
818 | } | ||
791 | break; | 819 | break; |
792 | case IPPROTO_UDP: | 820 | case IPPROTO_UDP: |
793 | skb->csum_offset = offsetof(struct udphdr, check); | 821 | skb->csum_offset = offsetof(struct udphdr, check); |
822 | |||
823 | if (recalculate_partial_csum) { | ||
824 | struct udphdr *udph = (struct udphdr *)th; | ||
825 | udph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, | ||
826 | skb->len - iph->ihl*4, | ||
827 | IPPROTO_UDP, 0); | ||
828 | } | ||
794 | break; | 829 | break; |
795 | default: | 830 | default: |
796 | if (net_ratelimit()) | 831 | if (net_ratelimit()) |
@@ -829,13 +864,11 @@ static int handle_incoming_queue(struct net_device *dev, | |||
829 | /* Ethernet work: Delayed to here as it peeks the header. */ | 864 | /* Ethernet work: Delayed to here as it peeks the header. */ |
830 | skb->protocol = eth_type_trans(skb, dev); | 865 | skb->protocol = eth_type_trans(skb, dev); |
831 | 866 | ||
832 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 867 | if (checksum_setup(dev, skb)) { |
833 | if (skb_checksum_setup(skb)) { | 868 | kfree_skb(skb); |
834 | kfree_skb(skb); | 869 | packets_dropped++; |
835 | packets_dropped++; | 870 | dev->stats.rx_errors++; |
836 | dev->stats.rx_errors++; | 871 | continue; |
837 | continue; | ||
838 | } | ||
839 | } | 872 | } |
840 | 873 | ||
841 | dev->stats.rx_packets++; | 874 | dev->stats.rx_packets++; |
@@ -1632,12 +1665,59 @@ static void netback_changed(struct xenbus_device *dev, | |||
1632 | } | 1665 | } |
1633 | } | 1666 | } |
1634 | 1667 | ||
1668 | static const struct xennet_stat { | ||
1669 | char name[ETH_GSTRING_LEN]; | ||
1670 | u16 offset; | ||
1671 | } xennet_stats[] = { | ||
1672 | { | ||
1673 | "rx_gso_checksum_fixup", | ||
1674 | offsetof(struct netfront_info, rx_gso_checksum_fixup) | ||
1675 | }, | ||
1676 | }; | ||
1677 | |||
1678 | static int xennet_get_sset_count(struct net_device *dev, int string_set) | ||
1679 | { | ||
1680 | switch (string_set) { | ||
1681 | case ETH_SS_STATS: | ||
1682 | return ARRAY_SIZE(xennet_stats); | ||
1683 | default: | ||
1684 | return -EINVAL; | ||
1685 | } | ||
1686 | } | ||
1687 | |||
1688 | static void xennet_get_ethtool_stats(struct net_device *dev, | ||
1689 | struct ethtool_stats *stats, u64 * data) | ||
1690 | { | ||
1691 | void *np = netdev_priv(dev); | ||
1692 | int i; | ||
1693 | |||
1694 | for (i = 0; i < ARRAY_SIZE(xennet_stats); i++) | ||
1695 | data[i] = *(int *)(np + xennet_stats[i].offset); | ||
1696 | } | ||
1697 | |||
1698 | static void xennet_get_strings(struct net_device *dev, u32 stringset, u8 * data) | ||
1699 | { | ||
1700 | int i; | ||
1701 | |||
1702 | switch (stringset) { | ||
1703 | case ETH_SS_STATS: | ||
1704 | for (i = 0; i < ARRAY_SIZE(xennet_stats); i++) | ||
1705 | memcpy(data + i * ETH_GSTRING_LEN, | ||
1706 | xennet_stats[i].name, ETH_GSTRING_LEN); | ||
1707 | break; | ||
1708 | } | ||
1709 | } | ||
1710 | |||
1635 | static const struct ethtool_ops xennet_ethtool_ops = | 1711 | static const struct ethtool_ops xennet_ethtool_ops = |
1636 | { | 1712 | { |
1637 | .set_tx_csum = ethtool_op_set_tx_csum, | 1713 | .set_tx_csum = ethtool_op_set_tx_csum, |
1638 | .set_sg = xennet_set_sg, | 1714 | .set_sg = xennet_set_sg, |
1639 | .set_tso = xennet_set_tso, | 1715 | .set_tso = xennet_set_tso, |
1640 | .get_link = ethtool_op_get_link, | 1716 | .get_link = ethtool_op_get_link, |
1717 | |||
1718 | .get_sset_count = xennet_get_sset_count, | ||
1719 | .get_ethtool_stats = xennet_get_ethtool_stats, | ||
1720 | .get_strings = xennet_get_strings, | ||
1641 | }; | 1721 | }; |
1642 | 1722 | ||
1643 | #ifdef CONFIG_SYSFS | 1723 | #ifdef CONFIG_SYSFS |
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 9583cbcc6b79..c404b61386bf 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
@@ -143,6 +143,7 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev, | |||
143 | rtc->id = id; | 143 | rtc->id = id; |
144 | rtc->ops = ops; | 144 | rtc->ops = ops; |
145 | rtc->owner = owner; | 145 | rtc->owner = owner; |
146 | rtc->irq_freq = 1; | ||
146 | rtc->max_user_freq = 64; | 147 | rtc->max_user_freq = 64; |
147 | rtc->dev.parent = dev; | 148 | rtc->dev.parent = dev; |
148 | rtc->dev.class = rtc_class; | 149 | rtc->dev.class = rtc_class; |
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 925006d33109..a0c01967244d 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c | |||
@@ -464,6 +464,9 @@ int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq) | |||
464 | int err = 0; | 464 | int err = 0; |
465 | unsigned long flags; | 465 | unsigned long flags; |
466 | 466 | ||
467 | if (freq <= 0) | ||
468 | return -EINVAL; | ||
469 | |||
467 | spin_lock_irqsave(&rtc->irq_task_lock, flags); | 470 | spin_lock_irqsave(&rtc->irq_task_lock, flags); |
468 | if (rtc->irq_task != NULL && task == NULL) | 471 | if (rtc->irq_task != NULL && task == NULL) |
469 | err = -EBUSY; | 472 | err = -EBUSY; |
diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c index 4155805dcdff..2b771f18d1ad 100644 --- a/drivers/s390/block/dasd_alias.c +++ b/drivers/s390/block/dasd_alias.c | |||
@@ -319,6 +319,9 @@ void dasd_alias_disconnect_device_from_lcu(struct dasd_device *device) | |||
319 | 319 | ||
320 | private = (struct dasd_eckd_private *) device->private; | 320 | private = (struct dasd_eckd_private *) device->private; |
321 | lcu = private->lcu; | 321 | lcu = private->lcu; |
322 | /* nothing to do if already disconnected */ | ||
323 | if (!lcu) | ||
324 | return; | ||
322 | device->discipline->get_uid(device, &uid); | 325 | device->discipline->get_uid(device, &uid); |
323 | spin_lock_irqsave(&lcu->lock, flags); | 326 | spin_lock_irqsave(&lcu->lock, flags); |
324 | list_del_init(&device->alias_list); | 327 | list_del_init(&device->alias_list); |
@@ -680,6 +683,9 @@ int dasd_alias_remove_device(struct dasd_device *device) | |||
680 | 683 | ||
681 | private = (struct dasd_eckd_private *) device->private; | 684 | private = (struct dasd_eckd_private *) device->private; |
682 | lcu = private->lcu; | 685 | lcu = private->lcu; |
686 | /* nothing to do if already removed */ | ||
687 | if (!lcu) | ||
688 | return 0; | ||
683 | spin_lock_irqsave(&lcu->lock, flags); | 689 | spin_lock_irqsave(&lcu->lock, flags); |
684 | _remove_device_from_lcu(lcu, device); | 690 | _remove_device_from_lcu(lcu, device); |
685 | spin_unlock_irqrestore(&lcu->lock, flags); | 691 | spin_unlock_irqrestore(&lcu->lock, flags); |
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index e9fff2b9bce2..5640c89cd9de 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -476,7 +476,7 @@ static inline void inbound_primed(struct qdio_q *q, int count) | |||
476 | static int get_inbound_buffer_frontier(struct qdio_q *q) | 476 | static int get_inbound_buffer_frontier(struct qdio_q *q) |
477 | { | 477 | { |
478 | int count, stop; | 478 | int count, stop; |
479 | unsigned char state; | 479 | unsigned char state = 0; |
480 | 480 | ||
481 | /* | 481 | /* |
482 | * Don't check 128 buffers, as otherwise qdio_inbound_q_moved | 482 | * Don't check 128 buffers, as otherwise qdio_inbound_q_moved |
@@ -643,7 +643,7 @@ void qdio_inbound_processing(unsigned long data) | |||
643 | static int get_outbound_buffer_frontier(struct qdio_q *q) | 643 | static int get_outbound_buffer_frontier(struct qdio_q *q) |
644 | { | 644 | { |
645 | int count, stop; | 645 | int count, stop; |
646 | unsigned char state; | 646 | unsigned char state = 0; |
647 | 647 | ||
648 | if (need_siga_sync(q)) | 648 | if (need_siga_sync(q)) |
649 | if (((queue_type(q) != QDIO_IQDIO_QFMT) && | 649 | if (((queue_type(q) != QDIO_IQDIO_QFMT) && |
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 65ebee0a3266..b6a6356d09b3 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c | |||
@@ -565,7 +565,7 @@ static int netiucv_callback_connreq(struct iucv_path *path, | |||
565 | struct iucv_event ev; | 565 | struct iucv_event ev; |
566 | int rc; | 566 | int rc; |
567 | 567 | ||
568 | if (memcmp(iucvMagic, ipuser, sizeof(ipuser))) | 568 | if (memcmp(iucvMagic, ipuser, 16)) |
569 | /* ipuser must match iucvMagic. */ | 569 | /* ipuser must match iucvMagic. */ |
570 | return -EINVAL; | 570 | return -EINVAL; |
571 | rc = -EINVAL; | 571 | rc = -EINVAL; |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 29f848bfc12f..019ae58ab913 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -988,16 +988,30 @@ static void qeth_get_channel_path_desc(struct qeth_card *card) | |||
988 | chp_dsc = (struct channelPath_dsc *)ccw_device_get_chp_desc(ccwdev, 0); | 988 | chp_dsc = (struct channelPath_dsc *)ccw_device_get_chp_desc(ccwdev, 0); |
989 | if (chp_dsc != NULL) { | 989 | if (chp_dsc != NULL) { |
990 | /* CHPP field bit 6 == 1 -> single queue */ | 990 | /* CHPP field bit 6 == 1 -> single queue */ |
991 | if ((chp_dsc->chpp & 0x02) == 0x02) | 991 | if ((chp_dsc->chpp & 0x02) == 0x02) { |
992 | if ((atomic_read(&card->qdio.state) != | ||
993 | QETH_QDIO_UNINITIALIZED) && | ||
994 | (card->qdio.no_out_queues == 4)) | ||
995 | /* change from 4 to 1 outbound queues */ | ||
996 | qeth_free_qdio_buffers(card); | ||
992 | card->qdio.no_out_queues = 1; | 997 | card->qdio.no_out_queues = 1; |
998 | if (card->qdio.default_out_queue != 0) | ||
999 | dev_info(&card->gdev->dev, | ||
1000 | "Priority Queueing not supported\n"); | ||
1001 | card->qdio.default_out_queue = 0; | ||
1002 | } else { | ||
1003 | if ((atomic_read(&card->qdio.state) != | ||
1004 | QETH_QDIO_UNINITIALIZED) && | ||
1005 | (card->qdio.no_out_queues == 1)) { | ||
1006 | /* change from 1 to 4 outbound queues */ | ||
1007 | qeth_free_qdio_buffers(card); | ||
1008 | card->qdio.default_out_queue = 2; | ||
1009 | } | ||
1010 | card->qdio.no_out_queues = 4; | ||
1011 | } | ||
993 | card->info.func_level = 0x4100 + chp_dsc->desc; | 1012 | card->info.func_level = 0x4100 + chp_dsc->desc; |
994 | kfree(chp_dsc); | 1013 | kfree(chp_dsc); |
995 | } | 1014 | } |
996 | if (card->qdio.no_out_queues == 1) { | ||
997 | card->qdio.default_out_queue = 0; | ||
998 | dev_info(&card->gdev->dev, | ||
999 | "Priority Queueing not supported\n"); | ||
1000 | } | ||
1001 | QETH_DBF_TEXT_(SETUP, 2, "nr:%x", card->qdio.no_out_queues); | 1015 | QETH_DBF_TEXT_(SETUP, 2, "nr:%x", card->qdio.no_out_queues); |
1002 | QETH_DBF_TEXT_(SETUP, 2, "lvl:%02x", card->info.func_level); | 1016 | QETH_DBF_TEXT_(SETUP, 2, "lvl:%02x", card->info.func_level); |
1003 | return; | 1017 | return; |
@@ -1832,33 +1846,6 @@ static inline int qeth_get_initial_mtu_for_card(struct qeth_card *card) | |||
1832 | } | 1846 | } |
1833 | } | 1847 | } |
1834 | 1848 | ||
1835 | static inline int qeth_get_max_mtu_for_card(int cardtype) | ||
1836 | { | ||
1837 | switch (cardtype) { | ||
1838 | |||
1839 | case QETH_CARD_TYPE_UNKNOWN: | ||
1840 | case QETH_CARD_TYPE_OSD: | ||
1841 | case QETH_CARD_TYPE_OSN: | ||
1842 | case QETH_CARD_TYPE_OSM: | ||
1843 | case QETH_CARD_TYPE_OSX: | ||
1844 | return 61440; | ||
1845 | case QETH_CARD_TYPE_IQD: | ||
1846 | return 57344; | ||
1847 | default: | ||
1848 | return 1500; | ||
1849 | } | ||
1850 | } | ||
1851 | |||
1852 | static inline int qeth_get_mtu_out_of_mpc(int cardtype) | ||
1853 | { | ||
1854 | switch (cardtype) { | ||
1855 | case QETH_CARD_TYPE_IQD: | ||
1856 | return 1; | ||
1857 | default: | ||
1858 | return 0; | ||
1859 | } | ||
1860 | } | ||
1861 | |||
1862 | static inline int qeth_get_mtu_outof_framesize(int framesize) | 1849 | static inline int qeth_get_mtu_outof_framesize(int framesize) |
1863 | { | 1850 | { |
1864 | switch (framesize) { | 1851 | switch (framesize) { |
@@ -1881,10 +1868,9 @@ static inline int qeth_mtu_is_valid(struct qeth_card *card, int mtu) | |||
1881 | case QETH_CARD_TYPE_OSD: | 1868 | case QETH_CARD_TYPE_OSD: |
1882 | case QETH_CARD_TYPE_OSM: | 1869 | case QETH_CARD_TYPE_OSM: |
1883 | case QETH_CARD_TYPE_OSX: | 1870 | case QETH_CARD_TYPE_OSX: |
1884 | return ((mtu >= 576) && (mtu <= 61440)); | ||
1885 | case QETH_CARD_TYPE_IQD: | 1871 | case QETH_CARD_TYPE_IQD: |
1886 | return ((mtu >= 576) && | 1872 | return ((mtu >= 576) && |
1887 | (mtu <= card->info.max_mtu + 4096 - 32)); | 1873 | (mtu <= card->info.max_mtu)); |
1888 | case QETH_CARD_TYPE_OSN: | 1874 | case QETH_CARD_TYPE_OSN: |
1889 | case QETH_CARD_TYPE_UNKNOWN: | 1875 | case QETH_CARD_TYPE_UNKNOWN: |
1890 | default: | 1876 | default: |
@@ -1907,7 +1893,7 @@ static int qeth_ulp_enable_cb(struct qeth_card *card, struct qeth_reply *reply, | |||
1907 | memcpy(&card->token.ulp_filter_r, | 1893 | memcpy(&card->token.ulp_filter_r, |
1908 | QETH_ULP_ENABLE_RESP_FILTER_TOKEN(iob->data), | 1894 | QETH_ULP_ENABLE_RESP_FILTER_TOKEN(iob->data), |
1909 | QETH_MPC_TOKEN_LENGTH); | 1895 | QETH_MPC_TOKEN_LENGTH); |
1910 | if (qeth_get_mtu_out_of_mpc(card->info.type)) { | 1896 | if (card->info.type == QETH_CARD_TYPE_IQD) { |
1911 | memcpy(&framesize, QETH_ULP_ENABLE_RESP_MAX_MTU(iob->data), 2); | 1897 | memcpy(&framesize, QETH_ULP_ENABLE_RESP_MAX_MTU(iob->data), 2); |
1912 | mtu = qeth_get_mtu_outof_framesize(framesize); | 1898 | mtu = qeth_get_mtu_outof_framesize(framesize); |
1913 | if (!mtu) { | 1899 | if (!mtu) { |
@@ -1915,12 +1901,21 @@ static int qeth_ulp_enable_cb(struct qeth_card *card, struct qeth_reply *reply, | |||
1915 | QETH_DBF_TEXT_(SETUP, 2, " rc%d", iob->rc); | 1901 | QETH_DBF_TEXT_(SETUP, 2, " rc%d", iob->rc); |
1916 | return 0; | 1902 | return 0; |
1917 | } | 1903 | } |
1918 | card->info.max_mtu = mtu; | 1904 | if (card->info.initial_mtu && (card->info.initial_mtu != mtu)) { |
1905 | /* frame size has changed */ | ||
1906 | if (card->dev && | ||
1907 | ((card->dev->mtu == card->info.initial_mtu) || | ||
1908 | (card->dev->mtu > mtu))) | ||
1909 | card->dev->mtu = mtu; | ||
1910 | qeth_free_qdio_buffers(card); | ||
1911 | } | ||
1919 | card->info.initial_mtu = mtu; | 1912 | card->info.initial_mtu = mtu; |
1913 | card->info.max_mtu = mtu; | ||
1920 | card->qdio.in_buf_size = mtu + 2 * PAGE_SIZE; | 1914 | card->qdio.in_buf_size = mtu + 2 * PAGE_SIZE; |
1921 | } else { | 1915 | } else { |
1922 | card->info.initial_mtu = qeth_get_initial_mtu_for_card(card); | 1916 | card->info.initial_mtu = qeth_get_initial_mtu_for_card(card); |
1923 | card->info.max_mtu = qeth_get_max_mtu_for_card(card->info.type); | 1917 | card->info.max_mtu = *(__u16 *)QETH_ULP_ENABLE_RESP_MAX_MTU( |
1918 | iob->data); | ||
1924 | card->qdio.in_buf_size = QETH_IN_BUF_SIZE_DEFAULT; | 1919 | card->qdio.in_buf_size = QETH_IN_BUF_SIZE_DEFAULT; |
1925 | } | 1920 | } |
1926 | 1921 | ||
@@ -3775,6 +3770,47 @@ static inline int qeth_get_qdio_q_format(struct qeth_card *card) | |||
3775 | } | 3770 | } |
3776 | } | 3771 | } |
3777 | 3772 | ||
3773 | static void qeth_determine_capabilities(struct qeth_card *card) | ||
3774 | { | ||
3775 | int rc; | ||
3776 | int length; | ||
3777 | char *prcd; | ||
3778 | struct ccw_device *ddev; | ||
3779 | int ddev_offline = 0; | ||
3780 | |||
3781 | QETH_DBF_TEXT(SETUP, 2, "detcapab"); | ||
3782 | ddev = CARD_DDEV(card); | ||
3783 | if (!ddev->online) { | ||
3784 | ddev_offline = 1; | ||
3785 | rc = ccw_device_set_online(ddev); | ||
3786 | if (rc) { | ||
3787 | QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc); | ||
3788 | goto out; | ||
3789 | } | ||
3790 | } | ||
3791 | |||
3792 | rc = qeth_read_conf_data(card, (void **) &prcd, &length); | ||
3793 | if (rc) { | ||
3794 | QETH_DBF_MESSAGE(2, "%s qeth_read_conf_data returned %i\n", | ||
3795 | dev_name(&card->gdev->dev), rc); | ||
3796 | QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc); | ||
3797 | goto out_offline; | ||
3798 | } | ||
3799 | qeth_configure_unitaddr(card, prcd); | ||
3800 | qeth_configure_blkt_default(card, prcd); | ||
3801 | kfree(prcd); | ||
3802 | |||
3803 | rc = qdio_get_ssqd_desc(ddev, &card->ssqd); | ||
3804 | if (rc) | ||
3805 | QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc); | ||
3806 | |||
3807 | out_offline: | ||
3808 | if (ddev_offline == 1) | ||
3809 | ccw_device_set_offline(ddev); | ||
3810 | out: | ||
3811 | return; | ||
3812 | } | ||
3813 | |||
3778 | static int qeth_qdio_establish(struct qeth_card *card) | 3814 | static int qeth_qdio_establish(struct qeth_card *card) |
3779 | { | 3815 | { |
3780 | struct qdio_initialize init_data; | 3816 | struct qdio_initialize init_data; |
@@ -3905,6 +3941,7 @@ int qeth_core_hardsetup_card(struct qeth_card *card) | |||
3905 | 3941 | ||
3906 | QETH_DBF_TEXT(SETUP, 2, "hrdsetup"); | 3942 | QETH_DBF_TEXT(SETUP, 2, "hrdsetup"); |
3907 | atomic_set(&card->force_alloc_skb, 0); | 3943 | atomic_set(&card->force_alloc_skb, 0); |
3944 | qeth_get_channel_path_desc(card); | ||
3908 | retry: | 3945 | retry: |
3909 | if (retries) | 3946 | if (retries) |
3910 | QETH_DBF_MESSAGE(2, "%s Retrying to do IDX activates.\n", | 3947 | QETH_DBF_MESSAGE(2, "%s Retrying to do IDX activates.\n", |
@@ -3933,6 +3970,7 @@ retriable: | |||
3933 | else | 3970 | else |
3934 | goto retry; | 3971 | goto retry; |
3935 | } | 3972 | } |
3973 | qeth_determine_capabilities(card); | ||
3936 | qeth_init_tokens(card); | 3974 | qeth_init_tokens(card); |
3937 | qeth_init_func_level(card); | 3975 | qeth_init_func_level(card); |
3938 | rc = qeth_idx_activate_channel(&card->read, qeth_idx_read_cb); | 3976 | rc = qeth_idx_activate_channel(&card->read, qeth_idx_read_cb); |
@@ -4202,41 +4240,6 @@ void qeth_core_free_discipline(struct qeth_card *card) | |||
4202 | card->discipline.ccwgdriver = NULL; | 4240 | card->discipline.ccwgdriver = NULL; |
4203 | } | 4241 | } |
4204 | 4242 | ||
4205 | static void qeth_determine_capabilities(struct qeth_card *card) | ||
4206 | { | ||
4207 | int rc; | ||
4208 | int length; | ||
4209 | char *prcd; | ||
4210 | |||
4211 | QETH_DBF_TEXT(SETUP, 2, "detcapab"); | ||
4212 | rc = ccw_device_set_online(CARD_DDEV(card)); | ||
4213 | if (rc) { | ||
4214 | QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc); | ||
4215 | goto out; | ||
4216 | } | ||
4217 | |||
4218 | |||
4219 | rc = qeth_read_conf_data(card, (void **) &prcd, &length); | ||
4220 | if (rc) { | ||
4221 | QETH_DBF_MESSAGE(2, "%s qeth_read_conf_data returned %i\n", | ||
4222 | dev_name(&card->gdev->dev), rc); | ||
4223 | QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc); | ||
4224 | goto out_offline; | ||
4225 | } | ||
4226 | qeth_configure_unitaddr(card, prcd); | ||
4227 | qeth_configure_blkt_default(card, prcd); | ||
4228 | kfree(prcd); | ||
4229 | |||
4230 | rc = qdio_get_ssqd_desc(CARD_DDEV(card), &card->ssqd); | ||
4231 | if (rc) | ||
4232 | QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc); | ||
4233 | |||
4234 | out_offline: | ||
4235 | ccw_device_set_offline(CARD_DDEV(card)); | ||
4236 | out: | ||
4237 | return; | ||
4238 | } | ||
4239 | |||
4240 | static int qeth_core_probe_device(struct ccwgroup_device *gdev) | 4243 | static int qeth_core_probe_device(struct ccwgroup_device *gdev) |
4241 | { | 4244 | { |
4242 | struct qeth_card *card; | 4245 | struct qeth_card *card; |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 2ac8f6aff5a4..ada0fe782373 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -573,13 +573,13 @@ static int qeth_l2_send_setmac_cb(struct qeth_card *card, | |||
573 | case IPA_RC_L2_DUP_LAYER3_MAC: | 573 | case IPA_RC_L2_DUP_LAYER3_MAC: |
574 | dev_warn(&card->gdev->dev, | 574 | dev_warn(&card->gdev->dev, |
575 | "MAC address %pM already exists\n", | 575 | "MAC address %pM already exists\n", |
576 | card->dev->dev_addr); | 576 | cmd->data.setdelmac.mac); |
577 | break; | 577 | break; |
578 | case IPA_RC_L2_MAC_NOT_AUTH_BY_HYP: | 578 | case IPA_RC_L2_MAC_NOT_AUTH_BY_HYP: |
579 | case IPA_RC_L2_MAC_NOT_AUTH_BY_ADP: | 579 | case IPA_RC_L2_MAC_NOT_AUTH_BY_ADP: |
580 | dev_warn(&card->gdev->dev, | 580 | dev_warn(&card->gdev->dev, |
581 | "MAC address %pM is not authorized\n", | 581 | "MAC address %pM is not authorized\n", |
582 | card->dev->dev_addr); | 582 | cmd->data.setdelmac.mac); |
583 | break; | 583 | break; |
584 | default: | 584 | default: |
585 | break; | 585 | break; |
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index 65e1cf104943..207b7d742443 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c | |||
@@ -60,7 +60,7 @@ static struct iucv_handler smsg_handler = { | |||
60 | static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8], | 60 | static int smsg_path_pending(struct iucv_path *path, u8 ipvmid[8], |
61 | u8 ipuser[16]) | 61 | u8 ipuser[16]) |
62 | { | 62 | { |
63 | if (strncmp(ipvmid, "*MSG ", sizeof(ipvmid)) != 0) | 63 | if (strncmp(ipvmid, "*MSG ", 8) != 0) |
64 | return -EINVAL; | 64 | return -EINVAL; |
65 | /* Path pending from *MSG. */ | 65 | /* Path pending from *MSG. */ |
66 | return iucv_path_accept(path, &smsg_handler, "SMSGIUCV ", NULL); | 66 | return iucv_path_accept(path, &smsg_handler, "SMSGIUCV ", NULL); |
diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h index 475c31ae985c..77b26f5b9c33 100644 --- a/drivers/scsi/arcmsr/arcmsr.h +++ b/drivers/scsi/arcmsr/arcmsr.h | |||
@@ -2,7 +2,7 @@ | |||
2 | ******************************************************************************* | 2 | ******************************************************************************* |
3 | ** O.S : Linux | 3 | ** O.S : Linux |
4 | ** FILE NAME : arcmsr.h | 4 | ** FILE NAME : arcmsr.h |
5 | ** BY : Erich Chen | 5 | ** BY : Nick Cheng |
6 | ** Description: SCSI RAID Device Driver for | 6 | ** Description: SCSI RAID Device Driver for |
7 | ** ARECA RAID Host adapter | 7 | ** ARECA RAID Host adapter |
8 | ******************************************************************************* | 8 | ******************************************************************************* |
@@ -46,8 +46,12 @@ | |||
46 | struct device_attribute; | 46 | struct device_attribute; |
47 | /*The limit of outstanding scsi command that firmware can handle*/ | 47 | /*The limit of outstanding scsi command that firmware can handle*/ |
48 | #define ARCMSR_MAX_OUTSTANDING_CMD 256 | 48 | #define ARCMSR_MAX_OUTSTANDING_CMD 256 |
49 | #define ARCMSR_MAX_FREECCB_NUM 320 | 49 | #ifdef CONFIG_XEN |
50 | #define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2010/02/02" | 50 | #define ARCMSR_MAX_FREECCB_NUM 160 |
51 | #else | ||
52 | #define ARCMSR_MAX_FREECCB_NUM 320 | ||
53 | #endif | ||
54 | #define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2010/08/05" | ||
51 | #define ARCMSR_SCSI_INITIATOR_ID 255 | 55 | #define ARCMSR_SCSI_INITIATOR_ID 255 |
52 | #define ARCMSR_MAX_XFER_SECTORS 512 | 56 | #define ARCMSR_MAX_XFER_SECTORS 512 |
53 | #define ARCMSR_MAX_XFER_SECTORS_B 4096 | 57 | #define ARCMSR_MAX_XFER_SECTORS_B 4096 |
@@ -60,7 +64,6 @@ struct device_attribute; | |||
60 | #define ARCMSR_MAX_HBB_POSTQUEUE 264 | 64 | #define ARCMSR_MAX_HBB_POSTQUEUE 264 |
61 | #define ARCMSR_MAX_XFER_LEN 0x26000 /* 152K */ | 65 | #define ARCMSR_MAX_XFER_LEN 0x26000 /* 152K */ |
62 | #define ARCMSR_CDB_SG_PAGE_LENGTH 256 | 66 | #define ARCMSR_CDB_SG_PAGE_LENGTH 256 |
63 | #define SCSI_CMD_ARECA_SPECIFIC 0xE1 | ||
64 | #ifndef PCI_DEVICE_ID_ARECA_1880 | 67 | #ifndef PCI_DEVICE_ID_ARECA_1880 |
65 | #define PCI_DEVICE_ID_ARECA_1880 0x1880 | 68 | #define PCI_DEVICE_ID_ARECA_1880 0x1880 |
66 | #endif | 69 | #endif |
diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c b/drivers/scsi/arcmsr/arcmsr_attr.c index a4e04c50c436..acdae33de521 100644 --- a/drivers/scsi/arcmsr/arcmsr_attr.c +++ b/drivers/scsi/arcmsr/arcmsr_attr.c | |||
@@ -2,7 +2,7 @@ | |||
2 | ******************************************************************************* | 2 | ******************************************************************************* |
3 | ** O.S : Linux | 3 | ** O.S : Linux |
4 | ** FILE NAME : arcmsr_attr.c | 4 | ** FILE NAME : arcmsr_attr.c |
5 | ** BY : Erich Chen | 5 | ** BY : Nick Cheng |
6 | ** Description: attributes exported to sysfs and device host | 6 | ** Description: attributes exported to sysfs and device host |
7 | ******************************************************************************* | 7 | ******************************************************************************* |
8 | ** Copyright (C) 2002 - 2005, Areca Technology Corporation All rights reserved | 8 | ** Copyright (C) 2002 - 2005, Areca Technology Corporation All rights reserved |
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index 1cadcd6b7da6..984bd527c6c9 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c | |||
@@ -2,7 +2,7 @@ | |||
2 | ******************************************************************************* | 2 | ******************************************************************************* |
3 | ** O.S : Linux | 3 | ** O.S : Linux |
4 | ** FILE NAME : arcmsr_hba.c | 4 | ** FILE NAME : arcmsr_hba.c |
5 | ** BY : Erich Chen | 5 | ** BY : Nick Cheng |
6 | ** Description: SCSI RAID Device Driver for | 6 | ** Description: SCSI RAID Device Driver for |
7 | ** ARECA RAID Host adapter | 7 | ** ARECA RAID Host adapter |
8 | ******************************************************************************* | 8 | ******************************************************************************* |
@@ -76,7 +76,7 @@ MODULE_DESCRIPTION("ARECA (ARC11xx/12xx/16xx/1880) SATA/SAS RAID Host Bus Adapte | |||
76 | MODULE_LICENSE("Dual BSD/GPL"); | 76 | MODULE_LICENSE("Dual BSD/GPL"); |
77 | MODULE_VERSION(ARCMSR_DRIVER_VERSION); | 77 | MODULE_VERSION(ARCMSR_DRIVER_VERSION); |
78 | static int sleeptime = 10; | 78 | static int sleeptime = 10; |
79 | static int retrycount = 30; | 79 | static int retrycount = 12; |
80 | wait_queue_head_t wait_q; | 80 | wait_queue_head_t wait_q; |
81 | static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, | 81 | static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, |
82 | struct scsi_cmnd *cmd); | 82 | struct scsi_cmnd *cmd); |
@@ -187,7 +187,6 @@ int arcmsr_sleep_for_bus_reset(struct scsi_cmnd *cmd) | |||
187 | if (isleep > 0) { | 187 | if (isleep > 0) { |
188 | msleep(isleep*1000); | 188 | msleep(isleep*1000); |
189 | } | 189 | } |
190 | printk(KERN_NOTICE "wake-up\n"); | ||
191 | return 0; | 190 | return 0; |
192 | } | 191 | } |
193 | 192 | ||
@@ -921,7 +920,6 @@ static void arcmsr_report_ccb_state(struct AdapterControlBlock *acb, | |||
921 | } | 920 | } |
922 | 921 | ||
923 | static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, struct CommandControlBlock *pCCB, bool error) | 922 | static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, struct CommandControlBlock *pCCB, bool error) |
924 | |||
925 | { | 923 | { |
926 | int id, lun; | 924 | int id, lun; |
927 | if ((pCCB->acb != acb) || (pCCB->startdone != ARCMSR_CCB_START)) { | 925 | if ((pCCB->acb != acb) || (pCCB->startdone != ARCMSR_CCB_START)) { |
@@ -948,7 +946,7 @@ static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, struct Comma | |||
948 | , pCCB->startdone | 946 | , pCCB->startdone |
949 | , atomic_read(&acb->ccboutstandingcount)); | 947 | , atomic_read(&acb->ccboutstandingcount)); |
950 | return; | 948 | return; |
951 | } | 949 | } |
952 | arcmsr_report_ccb_state(acb, pCCB, error); | 950 | arcmsr_report_ccb_state(acb, pCCB, error); |
953 | } | 951 | } |
954 | 952 | ||
@@ -981,7 +979,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) | |||
981 | case ACB_ADAPTER_TYPE_B: { | 979 | case ACB_ADAPTER_TYPE_B: { |
982 | struct MessageUnit_B *reg = acb->pmuB; | 980 | struct MessageUnit_B *reg = acb->pmuB; |
983 | /*clear all outbound posted Q*/ | 981 | /*clear all outbound posted Q*/ |
984 | writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, ®->iop2drv_doorbell); /* clear doorbell interrupt */ | 982 | writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); /* clear doorbell interrupt */ |
985 | for (i = 0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) { | 983 | for (i = 0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) { |
986 | if ((flag_ccb = readl(®->done_qbuffer[i])) != 0) { | 984 | if ((flag_ccb = readl(®->done_qbuffer[i])) != 0) { |
987 | writel(0, ®->done_qbuffer[i]); | 985 | writel(0, ®->done_qbuffer[i]); |
@@ -1511,7 +1509,6 @@ static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb) | |||
1511 | arcmsr_drain_donequeue(acb, pCCB, error); | 1509 | arcmsr_drain_donequeue(acb, pCCB, error); |
1512 | } | 1510 | } |
1513 | } | 1511 | } |
1514 | |||
1515 | static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb) | 1512 | static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb) |
1516 | { | 1513 | { |
1517 | uint32_t index; | 1514 | uint32_t index; |
@@ -2106,10 +2103,6 @@ static int arcmsr_queue_command_lck(struct scsi_cmnd *cmd, | |||
2106 | if (atomic_read(&acb->ccboutstandingcount) >= | 2103 | if (atomic_read(&acb->ccboutstandingcount) >= |
2107 | ARCMSR_MAX_OUTSTANDING_CMD) | 2104 | ARCMSR_MAX_OUTSTANDING_CMD) |
2108 | return SCSI_MLQUEUE_HOST_BUSY; | 2105 | return SCSI_MLQUEUE_HOST_BUSY; |
2109 | if ((scsicmd == SCSI_CMD_ARECA_SPECIFIC)) { | ||
2110 | printk(KERN_NOTICE "Receiveing SCSI_CMD_ARECA_SPECIFIC command..\n"); | ||
2111 | return 0; | ||
2112 | } | ||
2113 | ccb = arcmsr_get_freeccb(acb); | 2106 | ccb = arcmsr_get_freeccb(acb); |
2114 | if (!ccb) | 2107 | if (!ccb) |
2115 | return SCSI_MLQUEUE_HOST_BUSY; | 2108 | return SCSI_MLQUEUE_HOST_BUSY; |
@@ -2393,6 +2386,7 @@ static int arcmsr_polling_hbb_ccbdone(struct AdapterControlBlock *acb, | |||
2393 | int index, rtn; | 2386 | int index, rtn; |
2394 | bool error; | 2387 | bool error; |
2395 | polling_hbb_ccb_retry: | 2388 | polling_hbb_ccb_retry: |
2389 | |||
2396 | poll_count++; | 2390 | poll_count++; |
2397 | /* clear doorbell interrupt */ | 2391 | /* clear doorbell interrupt */ |
2398 | writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); | 2392 | writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); |
@@ -2663,6 +2657,7 @@ static void arcmsr_request_hba_device_map(struct AdapterControlBlock *acb) | |||
2663 | { | 2657 | { |
2664 | struct MessageUnit_A __iomem *reg = acb->pmuA; | 2658 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
2665 | if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0 ) || ((acb->acb_flags & ACB_F_ABORT) != 0 )){ | 2659 | if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0 ) || ((acb->acb_flags & ACB_F_ABORT) != 0 )){ |
2660 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); | ||
2666 | return; | 2661 | return; |
2667 | } else { | 2662 | } else { |
2668 | acb->fw_flag = FW_NORMAL; | 2663 | acb->fw_flag = FW_NORMAL; |
@@ -2670,8 +2665,10 @@ static void arcmsr_request_hba_device_map(struct AdapterControlBlock *acb) | |||
2670 | atomic_set(&acb->rq_map_token, 16); | 2665 | atomic_set(&acb->rq_map_token, 16); |
2671 | } | 2666 | } |
2672 | atomic_set(&acb->ante_token_value, atomic_read(&acb->rq_map_token)); | 2667 | atomic_set(&acb->ante_token_value, atomic_read(&acb->rq_map_token)); |
2673 | if (atomic_dec_and_test(&acb->rq_map_token)) | 2668 | if (atomic_dec_and_test(&acb->rq_map_token)) { |
2669 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); | ||
2674 | return; | 2670 | return; |
2671 | } | ||
2675 | writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ®->inbound_msgaddr0); | 2672 | writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ®->inbound_msgaddr0); |
2676 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); | 2673 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); |
2677 | } | 2674 | } |
@@ -2682,15 +2679,18 @@ static void arcmsr_request_hbb_device_map(struct AdapterControlBlock *acb) | |||
2682 | { | 2679 | { |
2683 | struct MessageUnit_B __iomem *reg = acb->pmuB; | 2680 | struct MessageUnit_B __iomem *reg = acb->pmuB; |
2684 | if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0 ) || ((acb->acb_flags & ACB_F_ABORT) != 0 )){ | 2681 | if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0 ) || ((acb->acb_flags & ACB_F_ABORT) != 0 )){ |
2682 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); | ||
2685 | return; | 2683 | return; |
2686 | } else { | 2684 | } else { |
2687 | acb->fw_flag = FW_NORMAL; | 2685 | acb->fw_flag = FW_NORMAL; |
2688 | if (atomic_read(&acb->ante_token_value) == atomic_read(&acb->rq_map_token)) { | 2686 | if (atomic_read(&acb->ante_token_value) == atomic_read(&acb->rq_map_token)) { |
2689 | atomic_set(&acb->rq_map_token,16); | 2687 | atomic_set(&acb->rq_map_token, 16); |
2690 | } | 2688 | } |
2691 | atomic_set(&acb->ante_token_value, atomic_read(&acb->rq_map_token)); | 2689 | atomic_set(&acb->ante_token_value, atomic_read(&acb->rq_map_token)); |
2692 | if(atomic_dec_and_test(&acb->rq_map_token)) | 2690 | if (atomic_dec_and_test(&acb->rq_map_token)) { |
2691 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); | ||
2693 | return; | 2692 | return; |
2693 | } | ||
2694 | writel(ARCMSR_MESSAGE_GET_CONFIG, reg->drv2iop_doorbell); | 2694 | writel(ARCMSR_MESSAGE_GET_CONFIG, reg->drv2iop_doorbell); |
2695 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); | 2695 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); |
2696 | } | 2696 | } |
@@ -2701,6 +2701,7 @@ static void arcmsr_request_hbc_device_map(struct AdapterControlBlock *acb) | |||
2701 | { | 2701 | { |
2702 | struct MessageUnit_C __iomem *reg = acb->pmuC; | 2702 | struct MessageUnit_C __iomem *reg = acb->pmuC; |
2703 | if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0) || ((acb->acb_flags & ACB_F_ABORT) != 0)) { | 2703 | if (unlikely(atomic_read(&acb->rq_map_token) == 0) || ((acb->acb_flags & ACB_F_BUS_RESET) != 0) || ((acb->acb_flags & ACB_F_ABORT) != 0)) { |
2704 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); | ||
2704 | return; | 2705 | return; |
2705 | } else { | 2706 | } else { |
2706 | acb->fw_flag = FW_NORMAL; | 2707 | acb->fw_flag = FW_NORMAL; |
@@ -2708,8 +2709,10 @@ static void arcmsr_request_hbc_device_map(struct AdapterControlBlock *acb) | |||
2708 | atomic_set(&acb->rq_map_token, 16); | 2709 | atomic_set(&acb->rq_map_token, 16); |
2709 | } | 2710 | } |
2710 | atomic_set(&acb->ante_token_value, atomic_read(&acb->rq_map_token)); | 2711 | atomic_set(&acb->ante_token_value, atomic_read(&acb->rq_map_token)); |
2711 | if (atomic_dec_and_test(&acb->rq_map_token)) | 2712 | if (atomic_dec_and_test(&acb->rq_map_token)) { |
2713 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); | ||
2712 | return; | 2714 | return; |
2715 | } | ||
2713 | writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ®->inbound_msgaddr0); | 2716 | writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ®->inbound_msgaddr0); |
2714 | writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, ®->inbound_doorbell); | 2717 | writel(ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE, ®->inbound_doorbell); |
2715 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); | 2718 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); |
@@ -2897,6 +2900,8 @@ static uint8_t arcmsr_iop_reset(struct AdapterControlBlock *acb) | |||
2897 | uint32_t intmask_org; | 2900 | uint32_t intmask_org; |
2898 | uint8_t rtnval = 0x00; | 2901 | uint8_t rtnval = 0x00; |
2899 | int i = 0; | 2902 | int i = 0; |
2903 | unsigned long flags; | ||
2904 | |||
2900 | if (atomic_read(&acb->ccboutstandingcount) != 0) { | 2905 | if (atomic_read(&acb->ccboutstandingcount) != 0) { |
2901 | /* disable all outbound interrupt */ | 2906 | /* disable all outbound interrupt */ |
2902 | intmask_org = arcmsr_disable_outbound_ints(acb); | 2907 | intmask_org = arcmsr_disable_outbound_ints(acb); |
@@ -2907,7 +2912,12 @@ static uint8_t arcmsr_iop_reset(struct AdapterControlBlock *acb) | |||
2907 | for (i = 0; i < ARCMSR_MAX_FREECCB_NUM; i++) { | 2912 | for (i = 0; i < ARCMSR_MAX_FREECCB_NUM; i++) { |
2908 | ccb = acb->pccb_pool[i]; | 2913 | ccb = acb->pccb_pool[i]; |
2909 | if (ccb->startdone == ARCMSR_CCB_START) { | 2914 | if (ccb->startdone == ARCMSR_CCB_START) { |
2910 | arcmsr_ccb_complete(ccb); | 2915 | scsi_dma_unmap(ccb->pcmd); |
2916 | ccb->startdone = ARCMSR_CCB_DONE; | ||
2917 | ccb->ccb_flags = 0; | ||
2918 | spin_lock_irqsave(&acb->ccblist_lock, flags); | ||
2919 | list_add_tail(&ccb->list, &acb->ccb_free_list); | ||
2920 | spin_unlock_irqrestore(&acb->ccblist_lock, flags); | ||
2911 | } | 2921 | } |
2912 | } | 2922 | } |
2913 | atomic_set(&acb->ccboutstandingcount, 0); | 2923 | atomic_set(&acb->ccboutstandingcount, 0); |
@@ -2920,8 +2930,7 @@ static uint8_t arcmsr_iop_reset(struct AdapterControlBlock *acb) | |||
2920 | 2930 | ||
2921 | static int arcmsr_bus_reset(struct scsi_cmnd *cmd) | 2931 | static int arcmsr_bus_reset(struct scsi_cmnd *cmd) |
2922 | { | 2932 | { |
2923 | struct AdapterControlBlock *acb = | 2933 | struct AdapterControlBlock *acb; |
2924 | (struct AdapterControlBlock *)cmd->device->host->hostdata; | ||
2925 | uint32_t intmask_org, outbound_doorbell; | 2934 | uint32_t intmask_org, outbound_doorbell; |
2926 | int retry_count = 0; | 2935 | int retry_count = 0; |
2927 | int rtn = FAILED; | 2936 | int rtn = FAILED; |
@@ -2971,31 +2980,16 @@ sleep_again: | |||
2971 | atomic_set(&acb->rq_map_token, 16); | 2980 | atomic_set(&acb->rq_map_token, 16); |
2972 | atomic_set(&acb->ante_token_value, 16); | 2981 | atomic_set(&acb->ante_token_value, 16); |
2973 | acb->fw_flag = FW_NORMAL; | 2982 | acb->fw_flag = FW_NORMAL; |
2974 | init_timer(&acb->eternal_timer); | 2983 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); |
2975 | acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6*HZ); | ||
2976 | acb->eternal_timer.data = (unsigned long) acb; | ||
2977 | acb->eternal_timer.function = &arcmsr_request_device_map; | ||
2978 | add_timer(&acb->eternal_timer); | ||
2979 | acb->acb_flags &= ~ACB_F_BUS_RESET; | 2984 | acb->acb_flags &= ~ACB_F_BUS_RESET; |
2980 | rtn = SUCCESS; | 2985 | rtn = SUCCESS; |
2981 | printk(KERN_ERR "arcmsr: scsi bus reset eh returns with success\n"); | 2986 | printk(KERN_ERR "arcmsr: scsi bus reset eh returns with success\n"); |
2982 | } else { | 2987 | } else { |
2983 | acb->acb_flags &= ~ACB_F_BUS_RESET; | 2988 | acb->acb_flags &= ~ACB_F_BUS_RESET; |
2984 | if (atomic_read(&acb->rq_map_token) == 0) { | 2989 | atomic_set(&acb->rq_map_token, 16); |
2985 | atomic_set(&acb->rq_map_token, 16); | 2990 | atomic_set(&acb->ante_token_value, 16); |
2986 | atomic_set(&acb->ante_token_value, 16); | 2991 | acb->fw_flag = FW_NORMAL; |
2987 | acb->fw_flag = FW_NORMAL; | 2992 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6*HZ)); |
2988 | init_timer(&acb->eternal_timer); | ||
2989 | acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6*HZ); | ||
2990 | acb->eternal_timer.data = (unsigned long) acb; | ||
2991 | acb->eternal_timer.function = &arcmsr_request_device_map; | ||
2992 | add_timer(&acb->eternal_timer); | ||
2993 | } else { | ||
2994 | atomic_set(&acb->rq_map_token, 16); | ||
2995 | atomic_set(&acb->ante_token_value, 16); | ||
2996 | acb->fw_flag = FW_NORMAL; | ||
2997 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6*HZ)); | ||
2998 | } | ||
2999 | rtn = SUCCESS; | 2993 | rtn = SUCCESS; |
3000 | } | 2994 | } |
3001 | break; | 2995 | break; |
@@ -3007,21 +3001,10 @@ sleep_again: | |||
3007 | rtn = FAILED; | 3001 | rtn = FAILED; |
3008 | } else { | 3002 | } else { |
3009 | acb->acb_flags &= ~ACB_F_BUS_RESET; | 3003 | acb->acb_flags &= ~ACB_F_BUS_RESET; |
3010 | if (atomic_read(&acb->rq_map_token) == 0) { | 3004 | atomic_set(&acb->rq_map_token, 16); |
3011 | atomic_set(&acb->rq_map_token, 16); | 3005 | atomic_set(&acb->ante_token_value, 16); |
3012 | atomic_set(&acb->ante_token_value, 16); | 3006 | acb->fw_flag = FW_NORMAL; |
3013 | acb->fw_flag = FW_NORMAL; | 3007 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); |
3014 | init_timer(&acb->eternal_timer); | ||
3015 | acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6*HZ); | ||
3016 | acb->eternal_timer.data = (unsigned long) acb; | ||
3017 | acb->eternal_timer.function = &arcmsr_request_device_map; | ||
3018 | add_timer(&acb->eternal_timer); | ||
3019 | } else { | ||
3020 | atomic_set(&acb->rq_map_token, 16); | ||
3021 | atomic_set(&acb->ante_token_value, 16); | ||
3022 | acb->fw_flag = FW_NORMAL; | ||
3023 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6*HZ)); | ||
3024 | } | ||
3025 | rtn = SUCCESS; | 3008 | rtn = SUCCESS; |
3026 | } | 3009 | } |
3027 | break; | 3010 | break; |
@@ -3067,31 +3050,16 @@ sleep: | |||
3067 | atomic_set(&acb->rq_map_token, 16); | 3050 | atomic_set(&acb->rq_map_token, 16); |
3068 | atomic_set(&acb->ante_token_value, 16); | 3051 | atomic_set(&acb->ante_token_value, 16); |
3069 | acb->fw_flag = FW_NORMAL; | 3052 | acb->fw_flag = FW_NORMAL; |
3070 | init_timer(&acb->eternal_timer); | 3053 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6 * HZ)); |
3071 | acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6 * HZ); | ||
3072 | acb->eternal_timer.data = (unsigned long) acb; | ||
3073 | acb->eternal_timer.function = &arcmsr_request_device_map; | ||
3074 | add_timer(&acb->eternal_timer); | ||
3075 | acb->acb_flags &= ~ACB_F_BUS_RESET; | 3054 | acb->acb_flags &= ~ACB_F_BUS_RESET; |
3076 | rtn = SUCCESS; | 3055 | rtn = SUCCESS; |
3077 | printk(KERN_ERR "arcmsr: scsi bus reset eh returns with success\n"); | 3056 | printk(KERN_ERR "arcmsr: scsi bus reset eh returns with success\n"); |
3078 | } else { | 3057 | } else { |
3079 | acb->acb_flags &= ~ACB_F_BUS_RESET; | 3058 | acb->acb_flags &= ~ACB_F_BUS_RESET; |
3080 | if (atomic_read(&acb->rq_map_token) == 0) { | 3059 | atomic_set(&acb->rq_map_token, 16); |
3081 | atomic_set(&acb->rq_map_token, 16); | 3060 | atomic_set(&acb->ante_token_value, 16); |
3082 | atomic_set(&acb->ante_token_value, 16); | 3061 | acb->fw_flag = FW_NORMAL; |
3083 | acb->fw_flag = FW_NORMAL; | 3062 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6*HZ)); |
3084 | init_timer(&acb->eternal_timer); | ||
3085 | acb->eternal_timer.expires = jiffies + msecs_to_jiffies(6*HZ); | ||
3086 | acb->eternal_timer.data = (unsigned long) acb; | ||
3087 | acb->eternal_timer.function = &arcmsr_request_device_map; | ||
3088 | add_timer(&acb->eternal_timer); | ||
3089 | } else { | ||
3090 | atomic_set(&acb->rq_map_token, 16); | ||
3091 | atomic_set(&acb->ante_token_value, 16); | ||
3092 | acb->fw_flag = FW_NORMAL; | ||
3093 | mod_timer(&acb->eternal_timer, jiffies + msecs_to_jiffies(6*HZ)); | ||
3094 | } | ||
3095 | rtn = SUCCESS; | 3063 | rtn = SUCCESS; |
3096 | } | 3064 | } |
3097 | break; | 3065 | break; |
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 5815cbeb27a6..9a7aaf5f1311 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c | |||
@@ -646,6 +646,7 @@ void sas_scsi_recover_host(struct Scsi_Host *shost) | |||
646 | 646 | ||
647 | spin_lock_irqsave(shost->host_lock, flags); | 647 | spin_lock_irqsave(shost->host_lock, flags); |
648 | list_splice_init(&shost->eh_cmd_q, &eh_work_q); | 648 | list_splice_init(&shost->eh_cmd_q, &eh_work_q); |
649 | shost->host_eh_scheduled = 0; | ||
649 | spin_unlock_irqrestore(shost->host_lock, flags); | 650 | spin_unlock_irqrestore(shost->host_lock, flags); |
650 | 651 | ||
651 | SAS_DPRINTK("Enter %s\n", __func__); | 652 | SAS_DPRINTK("Enter %s\n", __func__); |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index b2a817055b8b..9ead0399808a 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -2176,9 +2176,9 @@ _base_allocate_memory_pools(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) | |||
2176 | /* adjust hba_queue_depth, reply_free_queue_depth, | 2176 | /* adjust hba_queue_depth, reply_free_queue_depth, |
2177 | * and queue_size | 2177 | * and queue_size |
2178 | */ | 2178 | */ |
2179 | ioc->hba_queue_depth -= queue_diff; | 2179 | ioc->hba_queue_depth -= (queue_diff / 2); |
2180 | ioc->reply_free_queue_depth -= queue_diff; | 2180 | ioc->reply_free_queue_depth -= (queue_diff / 2); |
2181 | queue_size -= queue_diff; | 2181 | queue_size = facts->MaxReplyDescriptorPostQueueDepth; |
2182 | } | 2182 | } |
2183 | ioc->reply_post_queue_depth = queue_size; | 2183 | ioc->reply_post_queue_depth = queue_size; |
2184 | 2184 | ||
@@ -3941,6 +3941,8 @@ mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc) | |||
3941 | static void | 3941 | static void |
3942 | _base_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase) | 3942 | _base_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase) |
3943 | { | 3943 | { |
3944 | mpt2sas_scsih_reset_handler(ioc, reset_phase); | ||
3945 | mpt2sas_ctl_reset_handler(ioc, reset_phase); | ||
3944 | switch (reset_phase) { | 3946 | switch (reset_phase) { |
3945 | case MPT2_IOC_PRE_RESET: | 3947 | case MPT2_IOC_PRE_RESET: |
3946 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: " | 3948 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: " |
@@ -3971,8 +3973,6 @@ _base_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase) | |||
3971 | "MPT2_IOC_DONE_RESET\n", ioc->name, __func__)); | 3973 | "MPT2_IOC_DONE_RESET\n", ioc->name, __func__)); |
3972 | break; | 3974 | break; |
3973 | } | 3975 | } |
3974 | mpt2sas_scsih_reset_handler(ioc, reset_phase); | ||
3975 | mpt2sas_ctl_reset_handler(ioc, reset_phase); | ||
3976 | } | 3976 | } |
3977 | 3977 | ||
3978 | /** | 3978 | /** |
@@ -4026,6 +4026,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
4026 | { | 4026 | { |
4027 | int r; | 4027 | int r; |
4028 | unsigned long flags; | 4028 | unsigned long flags; |
4029 | u8 pe_complete = ioc->wait_for_port_enable_to_complete; | ||
4029 | 4030 | ||
4030 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: enter\n", ioc->name, | 4031 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: enter\n", ioc->name, |
4031 | __func__)); | 4032 | __func__)); |
@@ -4068,6 +4069,14 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
4068 | if (r) | 4069 | if (r) |
4069 | goto out; | 4070 | goto out; |
4070 | _base_reset_handler(ioc, MPT2_IOC_AFTER_RESET); | 4071 | _base_reset_handler(ioc, MPT2_IOC_AFTER_RESET); |
4072 | |||
4073 | /* If this hard reset is called while port enable is active, then | ||
4074 | * there is no reason to call make_ioc_operational | ||
4075 | */ | ||
4076 | if (pe_complete) { | ||
4077 | r = -EFAULT; | ||
4078 | goto out; | ||
4079 | } | ||
4071 | r = _base_make_ioc_operational(ioc, sleep_flag); | 4080 | r = _base_make_ioc_operational(ioc, sleep_flag); |
4072 | if (!r) | 4081 | if (!r) |
4073 | _base_reset_handler(ioc, MPT2_IOC_DONE_RESET); | 4082 | _base_reset_handler(ioc, MPT2_IOC_DONE_RESET); |
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index eda347c57979..5ded3db6e316 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -819,7 +819,7 @@ _scsih_is_end_device(u32 device_info) | |||
819 | } | 819 | } |
820 | 820 | ||
821 | /** | 821 | /** |
822 | * mptscsih_get_scsi_lookup - returns scmd entry | 822 | * _scsih_scsi_lookup_get - returns scmd entry |
823 | * @ioc: per adapter object | 823 | * @ioc: per adapter object |
824 | * @smid: system request message index | 824 | * @smid: system request message index |
825 | * | 825 | * |
@@ -832,6 +832,28 @@ _scsih_scsi_lookup_get(struct MPT2SAS_ADAPTER *ioc, u16 smid) | |||
832 | } | 832 | } |
833 | 833 | ||
834 | /** | 834 | /** |
835 | * _scsih_scsi_lookup_get_clear - returns scmd entry | ||
836 | * @ioc: per adapter object | ||
837 | * @smid: system request message index | ||
838 | * | ||
839 | * Returns the smid stored scmd pointer. | ||
840 | * Then will derefrence the stored scmd pointer. | ||
841 | */ | ||
842 | static inline struct scsi_cmnd * | ||
843 | _scsih_scsi_lookup_get_clear(struct MPT2SAS_ADAPTER *ioc, u16 smid) | ||
844 | { | ||
845 | unsigned long flags; | ||
846 | struct scsi_cmnd *scmd; | ||
847 | |||
848 | spin_lock_irqsave(&ioc->scsi_lookup_lock, flags); | ||
849 | scmd = ioc->scsi_lookup[smid - 1].scmd; | ||
850 | ioc->scsi_lookup[smid - 1].scmd = NULL; | ||
851 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); | ||
852 | |||
853 | return scmd; | ||
854 | } | ||
855 | |||
856 | /** | ||
835 | * _scsih_scsi_lookup_find_by_scmd - scmd lookup | 857 | * _scsih_scsi_lookup_find_by_scmd - scmd lookup |
836 | * @ioc: per adapter object | 858 | * @ioc: per adapter object |
837 | * @smid: system request message index | 859 | * @smid: system request message index |
@@ -2981,9 +3003,6 @@ _scsih_check_topo_delete_events(struct MPT2SAS_ADAPTER *ioc, | |||
2981 | u16 handle; | 3003 | u16 handle; |
2982 | 3004 | ||
2983 | for (i = 0 ; i < event_data->NumEntries; i++) { | 3005 | for (i = 0 ; i < event_data->NumEntries; i++) { |
2984 | if (event_data->PHY[i].PhyStatus & | ||
2985 | MPI2_EVENT_SAS_TOPO_PHYSTATUS_VACANT) | ||
2986 | continue; | ||
2987 | handle = le16_to_cpu(event_data->PHY[i].AttachedDevHandle); | 3006 | handle = le16_to_cpu(event_data->PHY[i].AttachedDevHandle); |
2988 | if (!handle) | 3007 | if (!handle) |
2989 | continue; | 3008 | continue; |
@@ -3210,7 +3229,7 @@ _scsih_flush_running_cmds(struct MPT2SAS_ADAPTER *ioc) | |||
3210 | u16 count = 0; | 3229 | u16 count = 0; |
3211 | 3230 | ||
3212 | for (smid = 1; smid <= ioc->scsiio_depth; smid++) { | 3231 | for (smid = 1; smid <= ioc->scsiio_depth; smid++) { |
3213 | scmd = _scsih_scsi_lookup_get(ioc, smid); | 3232 | scmd = _scsih_scsi_lookup_get_clear(ioc, smid); |
3214 | if (!scmd) | 3233 | if (!scmd) |
3215 | continue; | 3234 | continue; |
3216 | count++; | 3235 | count++; |
@@ -3804,7 +3823,7 @@ _scsih_io_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) | |||
3804 | u32 response_code = 0; | 3823 | u32 response_code = 0; |
3805 | 3824 | ||
3806 | mpi_reply = mpt2sas_base_get_reply_virt_addr(ioc, reply); | 3825 | mpi_reply = mpt2sas_base_get_reply_virt_addr(ioc, reply); |
3807 | scmd = _scsih_scsi_lookup_get(ioc, smid); | 3826 | scmd = _scsih_scsi_lookup_get_clear(ioc, smid); |
3808 | if (scmd == NULL) | 3827 | if (scmd == NULL) |
3809 | return 1; | 3828 | return 1; |
3810 | 3829 | ||
@@ -5005,6 +5024,12 @@ _scsih_sas_device_status_change_event(struct MPT2SAS_ADAPTER *ioc, | |||
5005 | event_data); | 5024 | event_data); |
5006 | #endif | 5025 | #endif |
5007 | 5026 | ||
5027 | /* In MPI Revision K (0xC), the internal device reset complete was | ||
5028 | * implemented, so avoid setting tm_busy flag for older firmware. | ||
5029 | */ | ||
5030 | if ((ioc->facts.HeaderVersion >> 8) < 0xC) | ||
5031 | return; | ||
5032 | |||
5008 | if (event_data->ReasonCode != | 5033 | if (event_data->ReasonCode != |
5009 | MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET && | 5034 | MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET && |
5010 | event_data->ReasonCode != | 5035 | event_data->ReasonCode != |
@@ -5099,6 +5124,7 @@ _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, | |||
5099 | struct fw_event_work *fw_event) | 5124 | struct fw_event_work *fw_event) |
5100 | { | 5125 | { |
5101 | struct scsi_cmnd *scmd; | 5126 | struct scsi_cmnd *scmd; |
5127 | struct scsi_device *sdev; | ||
5102 | u16 smid, handle; | 5128 | u16 smid, handle; |
5103 | u32 lun; | 5129 | u32 lun; |
5104 | struct MPT2SAS_DEVICE *sas_device_priv_data; | 5130 | struct MPT2SAS_DEVICE *sas_device_priv_data; |
@@ -5109,12 +5135,17 @@ _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, | |||
5109 | Mpi2EventDataSasBroadcastPrimitive_t *event_data = fw_event->event_data; | 5135 | Mpi2EventDataSasBroadcastPrimitive_t *event_data = fw_event->event_data; |
5110 | #endif | 5136 | #endif |
5111 | u16 ioc_status; | 5137 | u16 ioc_status; |
5138 | unsigned long flags; | ||
5139 | int r; | ||
5140 | |||
5112 | dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "broadcast primative: " | 5141 | dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "broadcast primative: " |
5113 | "phy number(%d), width(%d)\n", ioc->name, event_data->PhyNum, | 5142 | "phy number(%d), width(%d)\n", ioc->name, event_data->PhyNum, |
5114 | event_data->PortWidth)); | 5143 | event_data->PortWidth)); |
5115 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: enter\n", ioc->name, | 5144 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: enter\n", ioc->name, |
5116 | __func__)); | 5145 | __func__)); |
5117 | 5146 | ||
5147 | spin_lock_irqsave(&ioc->scsi_lookup_lock, flags); | ||
5148 | ioc->broadcast_aen_busy = 0; | ||
5118 | termination_count = 0; | 5149 | termination_count = 0; |
5119 | query_count = 0; | 5150 | query_count = 0; |
5120 | mpi_reply = ioc->tm_cmds.reply; | 5151 | mpi_reply = ioc->tm_cmds.reply; |
@@ -5122,7 +5153,8 @@ _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, | |||
5122 | scmd = _scsih_scsi_lookup_get(ioc, smid); | 5153 | scmd = _scsih_scsi_lookup_get(ioc, smid); |
5123 | if (!scmd) | 5154 | if (!scmd) |
5124 | continue; | 5155 | continue; |
5125 | sas_device_priv_data = scmd->device->hostdata; | 5156 | sdev = scmd->device; |
5157 | sas_device_priv_data = sdev->hostdata; | ||
5126 | if (!sas_device_priv_data || !sas_device_priv_data->sas_target) | 5158 | if (!sas_device_priv_data || !sas_device_priv_data->sas_target) |
5127 | continue; | 5159 | continue; |
5128 | /* skip hidden raid components */ | 5160 | /* skip hidden raid components */ |
@@ -5138,6 +5170,7 @@ _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, | |||
5138 | lun = sas_device_priv_data->lun; | 5170 | lun = sas_device_priv_data->lun; |
5139 | query_count++; | 5171 | query_count++; |
5140 | 5172 | ||
5173 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); | ||
5141 | mpt2sas_scsih_issue_tm(ioc, handle, 0, 0, lun, | 5174 | mpt2sas_scsih_issue_tm(ioc, handle, 0, 0, lun, |
5142 | MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK, smid, 30, NULL); | 5175 | MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK, smid, 30, NULL); |
5143 | ioc->tm_cmds.status = MPT2_CMD_NOT_USED; | 5176 | ioc->tm_cmds.status = MPT2_CMD_NOT_USED; |
@@ -5147,14 +5180,20 @@ _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, | |||
5147 | (mpi_reply->ResponseCode == | 5180 | (mpi_reply->ResponseCode == |
5148 | MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED || | 5181 | MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED || |
5149 | mpi_reply->ResponseCode == | 5182 | mpi_reply->ResponseCode == |
5150 | MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC)) | 5183 | MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC)) { |
5184 | spin_lock_irqsave(&ioc->scsi_lookup_lock, flags); | ||
5151 | continue; | 5185 | continue; |
5152 | 5186 | } | |
5153 | mpt2sas_scsih_issue_tm(ioc, handle, 0, 0, lun, | 5187 | r = mpt2sas_scsih_issue_tm(ioc, handle, sdev->channel, sdev->id, |
5154 | MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET, 0, 30, NULL); | 5188 | sdev->lun, MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK, smid, 30, |
5189 | scmd); | ||
5190 | if (r == FAILED) | ||
5191 | sdev_printk(KERN_WARNING, sdev, "task abort: FAILED " | ||
5192 | "scmd(%p)\n", scmd); | ||
5155 | termination_count += le32_to_cpu(mpi_reply->TerminationCount); | 5193 | termination_count += le32_to_cpu(mpi_reply->TerminationCount); |
5194 | spin_lock_irqsave(&ioc->scsi_lookup_lock, flags); | ||
5156 | } | 5195 | } |
5157 | ioc->broadcast_aen_busy = 0; | 5196 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); |
5158 | 5197 | ||
5159 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT | 5198 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT |
5160 | "%s - exit, query_count = %d termination_count = %d\n", | 5199 | "%s - exit, query_count = %d termination_count = %d\n", |
@@ -6626,6 +6665,7 @@ _scsih_remove(struct pci_dev *pdev) | |||
6626 | destroy_workqueue(wq); | 6665 | destroy_workqueue(wq); |
6627 | 6666 | ||
6628 | /* release all the volumes */ | 6667 | /* release all the volumes */ |
6668 | _scsih_ir_shutdown(ioc); | ||
6629 | list_for_each_entry_safe(raid_device, next, &ioc->raid_device_list, | 6669 | list_for_each_entry_safe(raid_device, next, &ioc->raid_device_list, |
6630 | list) { | 6670 | list) { |
6631 | if (raid_device->starget) { | 6671 | if (raid_device->starget) { |
diff --git a/drivers/staging/lirc/lirc_zilog.c b/drivers/staging/lirc/lirc_zilog.c index 3fe5f4160194..0aad0d7a74a3 100644 --- a/drivers/staging/lirc/lirc_zilog.c +++ b/drivers/staging/lirc/lirc_zilog.c | |||
@@ -495,7 +495,7 @@ static int send_data_block(struct IR_tx *tx, unsigned char *data_block) | |||
495 | /* send boot data to the IR TX device */ | 495 | /* send boot data to the IR TX device */ |
496 | static int send_boot_data(struct IR_tx *tx) | 496 | static int send_boot_data(struct IR_tx *tx) |
497 | { | 497 | { |
498 | int ret; | 498 | int ret, i; |
499 | unsigned char buf[4]; | 499 | unsigned char buf[4]; |
500 | 500 | ||
501 | /* send the boot block */ | 501 | /* send the boot block */ |
@@ -503,7 +503,7 @@ static int send_boot_data(struct IR_tx *tx) | |||
503 | if (ret != 0) | 503 | if (ret != 0) |
504 | return ret; | 504 | return ret; |
505 | 505 | ||
506 | /* kick it off? */ | 506 | /* Hit the go button to activate the new boot data */ |
507 | buf[0] = 0x00; | 507 | buf[0] = 0x00; |
508 | buf[1] = 0x20; | 508 | buf[1] = 0x20; |
509 | ret = i2c_master_send(tx->c, buf, 2); | 509 | ret = i2c_master_send(tx->c, buf, 2); |
@@ -511,7 +511,19 @@ static int send_boot_data(struct IR_tx *tx) | |||
511 | zilog_error("i2c_master_send failed with %d\n", ret); | 511 | zilog_error("i2c_master_send failed with %d\n", ret); |
512 | return ret < 0 ? ret : -EFAULT; | 512 | return ret < 0 ? ret : -EFAULT; |
513 | } | 513 | } |
514 | ret = i2c_master_send(tx->c, buf, 1); | 514 | |
515 | /* | ||
516 | * Wait for zilog to settle after hitting go post boot block upload. | ||
517 | * Without this delay, the HD-PVR and HVR-1950 both return an -EIO | ||
518 | * upon attempting to get firmware revision, and tx probe thus fails. | ||
519 | */ | ||
520 | for (i = 0; i < 10; i++) { | ||
521 | ret = i2c_master_send(tx->c, buf, 1); | ||
522 | if (ret == 1) | ||
523 | break; | ||
524 | udelay(100); | ||
525 | } | ||
526 | |||
515 | if (ret != 1) { | 527 | if (ret != 1) { |
516 | zilog_error("i2c_master_send failed with %d\n", ret); | 528 | zilog_error("i2c_master_send failed with %d\n", ret); |
517 | return ret < 0 ? ret : -EFAULT; | 529 | return ret < 0 ? ret : -EFAULT; |
@@ -523,8 +535,8 @@ static int send_boot_data(struct IR_tx *tx) | |||
523 | zilog_error("i2c_master_recv failed with %d\n", ret); | 535 | zilog_error("i2c_master_recv failed with %d\n", ret); |
524 | return 0; | 536 | return 0; |
525 | } | 537 | } |
526 | if (buf[0] != 0x80) { | 538 | if ((buf[0] != 0x80) && (buf[0] != 0xa0)) { |
527 | zilog_error("unexpected IR TX response: %02x\n", buf[0]); | 539 | zilog_error("unexpected IR TX init response: %02x\n", buf[0]); |
528 | return 0; | 540 | return 0; |
529 | } | 541 | } |
530 | zilog_notify("Zilog/Hauppauge IR blaster firmware version " | 542 | zilog_notify("Zilog/Hauppauge IR blaster firmware version " |
@@ -827,7 +839,15 @@ static int send_code(struct IR_tx *tx, unsigned int code, unsigned int key) | |||
827 | zilog_error("i2c_master_send failed with %d\n", ret); | 839 | zilog_error("i2c_master_send failed with %d\n", ret); |
828 | return ret < 0 ? ret : -EFAULT; | 840 | return ret < 0 ? ret : -EFAULT; |
829 | } | 841 | } |
830 | ret = i2c_master_send(tx->c, buf, 1); | 842 | |
843 | /* Give the z8 a moment to process data block */ | ||
844 | for (i = 0; i < 10; i++) { | ||
845 | ret = i2c_master_send(tx->c, buf, 1); | ||
846 | if (ret == 1) | ||
847 | break; | ||
848 | udelay(100); | ||
849 | } | ||
850 | |||
831 | if (ret != 1) { | 851 | if (ret != 1) { |
832 | zilog_error("i2c_master_send failed with %d\n", ret); | 852 | zilog_error("i2c_master_send failed with %d\n", ret); |
833 | return ret < 0 ? ret : -EFAULT; | 853 | return ret < 0 ? ret : -EFAULT; |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 9b3ca103135f..f616cefc95ba 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -128,8 +128,7 @@ static void handle_tx(struct vhost_net *net) | |||
128 | size_t hdr_size; | 128 | size_t hdr_size; |
129 | struct socket *sock; | 129 | struct socket *sock; |
130 | 130 | ||
131 | /* TODO: check that we are running from vhost_worker? | 131 | /* TODO: check that we are running from vhost_worker? */ |
132 | * Not sure it's worth it, it's straight-forward enough. */ | ||
133 | sock = rcu_dereference_check(vq->private_data, 1); | 132 | sock = rcu_dereference_check(vq->private_data, 1); |
134 | if (!sock) | 133 | if (!sock) |
135 | return; | 134 | return; |
@@ -306,7 +305,8 @@ static void handle_rx_big(struct vhost_net *net) | |||
306 | size_t len, total_len = 0; | 305 | size_t len, total_len = 0; |
307 | int err; | 306 | int err; |
308 | size_t hdr_size; | 307 | size_t hdr_size; |
309 | struct socket *sock = rcu_dereference(vq->private_data); | 308 | /* TODO: check that we are running from vhost_worker? */ |
309 | struct socket *sock = rcu_dereference_check(vq->private_data, 1); | ||
310 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) | 310 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) |
311 | return; | 311 | return; |
312 | 312 | ||
@@ -415,7 +415,8 @@ static void handle_rx_mergeable(struct vhost_net *net) | |||
415 | int err, headcount; | 415 | int err, headcount; |
416 | size_t vhost_hlen, sock_hlen; | 416 | size_t vhost_hlen, sock_hlen; |
417 | size_t vhost_len, sock_len; | 417 | size_t vhost_len, sock_len; |
418 | struct socket *sock = rcu_dereference(vq->private_data); | 418 | /* TODO: check that we are running from vhost_worker? */ |
419 | struct socket *sock = rcu_dereference_check(vq->private_data, 1); | ||
419 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) | 420 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) |
420 | return; | 421 | return; |
421 | 422 | ||
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 2af44b7b1f3f..b3363ae38518 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h | |||
@@ -173,9 +173,9 @@ static inline int vhost_has_feature(struct vhost_dev *dev, int bit) | |||
173 | { | 173 | { |
174 | unsigned acked_features; | 174 | unsigned acked_features; |
175 | 175 | ||
176 | acked_features = | 176 | /* TODO: check that we are running from vhost_worker or dev mutex is |
177 | rcu_dereference_index_check(dev->acked_features, | 177 | * held? */ |
178 | lockdep_is_held(&dev->mutex)); | 178 | acked_features = rcu_dereference_index_check(dev->acked_features, 1); |
179 | return acked_features & (1 << bit); | 179 | return acked_features & (1 << bit); |
180 | } | 180 | } |
181 | 181 | ||
diff --git a/fs/cifs/Kconfig b/fs/cifs/Kconfig index ee45648b0d1a..7cb0f7f847e4 100644 --- a/fs/cifs/Kconfig +++ b/fs/cifs/Kconfig | |||
@@ -3,6 +3,7 @@ config CIFS | |||
3 | depends on INET | 3 | depends on INET |
4 | select NLS | 4 | select NLS |
5 | select CRYPTO | 5 | select CRYPTO |
6 | select CRYPTO_MD4 | ||
6 | select CRYPTO_MD5 | 7 | select CRYPTO_MD5 |
7 | select CRYPTO_HMAC | 8 | select CRYPTO_HMAC |
8 | select CRYPTO_ARC4 | 9 | select CRYPTO_ARC4 |
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c index f1c68629f277..0a265ad9e426 100644 --- a/fs/cifs/cifs_dfs_ref.c +++ b/fs/cifs/cifs_dfs_ref.c | |||
@@ -282,8 +282,6 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt) | |||
282 | cFYI(1, "in %s", __func__); | 282 | cFYI(1, "in %s", __func__); |
283 | BUG_ON(IS_ROOT(mntpt)); | 283 | BUG_ON(IS_ROOT(mntpt)); |
284 | 284 | ||
285 | xid = GetXid(); | ||
286 | |||
287 | /* | 285 | /* |
288 | * The MSDFS spec states that paths in DFS referral requests and | 286 | * The MSDFS spec states that paths in DFS referral requests and |
289 | * responses must be prefixed by a single '\' character instead of | 287 | * responses must be prefixed by a single '\' character instead of |
@@ -293,7 +291,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt) | |||
293 | mnt = ERR_PTR(-ENOMEM); | 291 | mnt = ERR_PTR(-ENOMEM); |
294 | full_path = build_path_from_dentry(mntpt); | 292 | full_path = build_path_from_dentry(mntpt); |
295 | if (full_path == NULL) | 293 | if (full_path == NULL) |
296 | goto free_xid; | 294 | goto cdda_exit; |
297 | 295 | ||
298 | cifs_sb = CIFS_SB(mntpt->d_inode->i_sb); | 296 | cifs_sb = CIFS_SB(mntpt->d_inode->i_sb); |
299 | tlink = cifs_sb_tlink(cifs_sb); | 297 | tlink = cifs_sb_tlink(cifs_sb); |
@@ -303,9 +301,11 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt) | |||
303 | } | 301 | } |
304 | ses = tlink_tcon(tlink)->ses; | 302 | ses = tlink_tcon(tlink)->ses; |
305 | 303 | ||
304 | xid = GetXid(); | ||
306 | rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls, | 305 | rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls, |
307 | &num_referrals, &referrals, | 306 | &num_referrals, &referrals, |
308 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 307 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
308 | FreeXid(xid); | ||
309 | 309 | ||
310 | cifs_put_tlink(tlink); | 310 | cifs_put_tlink(tlink); |
311 | 311 | ||
@@ -338,8 +338,7 @@ success: | |||
338 | free_dfs_info_array(referrals, num_referrals); | 338 | free_dfs_info_array(referrals, num_referrals); |
339 | free_full_path: | 339 | free_full_path: |
340 | kfree(full_path); | 340 | kfree(full_path); |
341 | free_xid: | 341 | cdda_exit: |
342 | FreeXid(xid); | ||
343 | cFYI(1, "leaving %s" , __func__); | 342 | cFYI(1, "leaving %s" , __func__); |
344 | return mnt; | 343 | return mnt; |
345 | } | 344 | } |
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 0db5f1de0227..a51585f9852b 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c | |||
@@ -657,9 +657,10 @@ calc_seckey(struct cifsSesInfo *ses) | |||
657 | get_random_bytes(sec_key, CIFS_SESS_KEY_SIZE); | 657 | get_random_bytes(sec_key, CIFS_SESS_KEY_SIZE); |
658 | 658 | ||
659 | tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); | 659 | tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); |
660 | if (!tfm_arc4 || IS_ERR(tfm_arc4)) { | 660 | if (IS_ERR(tfm_arc4)) { |
661 | rc = PTR_ERR(tfm_arc4); | ||
661 | cERROR(1, "could not allocate crypto API arc4\n"); | 662 | cERROR(1, "could not allocate crypto API arc4\n"); |
662 | return PTR_ERR(tfm_arc4); | 663 | return rc; |
663 | } | 664 | } |
664 | 665 | ||
665 | desc.tfm = tfm_arc4; | 666 | desc.tfm = tfm_arc4; |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 14789a97304e..4a3330235d55 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
@@ -127,5 +127,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); | |||
127 | extern const struct export_operations cifs_export_ops; | 127 | extern const struct export_operations cifs_export_ops; |
128 | #endif /* EXPERIMENTAL */ | 128 | #endif /* EXPERIMENTAL */ |
129 | 129 | ||
130 | #define CIFS_VERSION "1.69" | 130 | #define CIFS_VERSION "1.70" |
131 | #endif /* _CIFSFS_H */ | 131 | #endif /* _CIFSFS_H */ |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 3106f5e5c633..46c66ed01af4 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -4914,7 +4914,6 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size, | |||
4914 | __u16 fid, __u32 pid_of_opener, bool SetAllocation) | 4914 | __u16 fid, __u32 pid_of_opener, bool SetAllocation) |
4915 | { | 4915 | { |
4916 | struct smb_com_transaction2_sfi_req *pSMB = NULL; | 4916 | struct smb_com_transaction2_sfi_req *pSMB = NULL; |
4917 | char *data_offset; | ||
4918 | struct file_end_of_file_info *parm_data; | 4917 | struct file_end_of_file_info *parm_data; |
4919 | int rc = 0; | 4918 | int rc = 0; |
4920 | __u16 params, param_offset, offset, byte_count, count; | 4919 | __u16 params, param_offset, offset, byte_count, count; |
@@ -4938,8 +4937,6 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size, | |||
4938 | param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4; | 4937 | param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4; |
4939 | offset = param_offset + params; | 4938 | offset = param_offset + params; |
4940 | 4939 | ||
4941 | data_offset = (char *) (&pSMB->hdr.Protocol) + offset; | ||
4942 | |||
4943 | count = sizeof(struct file_end_of_file_info); | 4940 | count = sizeof(struct file_end_of_file_info); |
4944 | pSMB->MaxParameterCount = cpu_to_le16(2); | 4941 | pSMB->MaxParameterCount = cpu_to_le16(2); |
4945 | /* BB find exact max SMB PDU from sess structure BB */ | 4942 | /* BB find exact max SMB PDU from sess structure BB */ |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 0de17c1db608..74c0a282d012 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -346,7 +346,6 @@ int cifs_open(struct inode *inode, struct file *file) | |||
346 | struct cifsTconInfo *tcon; | 346 | struct cifsTconInfo *tcon; |
347 | struct tcon_link *tlink; | 347 | struct tcon_link *tlink; |
348 | struct cifsFileInfo *pCifsFile = NULL; | 348 | struct cifsFileInfo *pCifsFile = NULL; |
349 | struct cifsInodeInfo *pCifsInode; | ||
350 | char *full_path = NULL; | 349 | char *full_path = NULL; |
351 | bool posix_open_ok = false; | 350 | bool posix_open_ok = false; |
352 | __u16 netfid; | 351 | __u16 netfid; |
@@ -361,8 +360,6 @@ int cifs_open(struct inode *inode, struct file *file) | |||
361 | } | 360 | } |
362 | tcon = tlink_tcon(tlink); | 361 | tcon = tlink_tcon(tlink); |
363 | 362 | ||
364 | pCifsInode = CIFS_I(file->f_path.dentry->d_inode); | ||
365 | |||
366 | full_path = build_path_from_dentry(file->f_path.dentry); | 363 | full_path = build_path_from_dentry(file->f_path.dentry); |
367 | if (full_path == NULL) { | 364 | if (full_path == NULL) { |
368 | rc = -ENOMEM; | 365 | rc = -ENOMEM; |
@@ -1146,7 +1143,6 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) | |||
1146 | char *write_data; | 1143 | char *write_data; |
1147 | int rc = -EFAULT; | 1144 | int rc = -EFAULT; |
1148 | int bytes_written = 0; | 1145 | int bytes_written = 0; |
1149 | struct cifs_sb_info *cifs_sb; | ||
1150 | struct inode *inode; | 1146 | struct inode *inode; |
1151 | struct cifsFileInfo *open_file; | 1147 | struct cifsFileInfo *open_file; |
1152 | 1148 | ||
@@ -1154,7 +1150,6 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) | |||
1154 | return -EFAULT; | 1150 | return -EFAULT; |
1155 | 1151 | ||
1156 | inode = page->mapping->host; | 1152 | inode = page->mapping->host; |
1157 | cifs_sb = CIFS_SB(inode->i_sb); | ||
1158 | 1153 | ||
1159 | offset += (loff_t)from; | 1154 | offset += (loff_t)from; |
1160 | write_data = kmap(page); | 1155 | write_data = kmap(page); |
@@ -1667,7 +1662,8 @@ static ssize_t | |||
1667 | cifs_iovec_write(struct file *file, const struct iovec *iov, | 1662 | cifs_iovec_write(struct file *file, const struct iovec *iov, |
1668 | unsigned long nr_segs, loff_t *poffset) | 1663 | unsigned long nr_segs, loff_t *poffset) |
1669 | { | 1664 | { |
1670 | size_t total_written = 0, written = 0; | 1665 | size_t total_written = 0; |
1666 | unsigned int written = 0; | ||
1671 | unsigned long num_pages, npages; | 1667 | unsigned long num_pages, npages; |
1672 | size_t copied, len, cur_len, i; | 1668 | size_t copied, len, cur_len, i; |
1673 | struct kvec *to_send; | 1669 | struct kvec *to_send; |
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 02cd60aefbff..e8804d373404 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
@@ -55,8 +55,9 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash) | |||
55 | 55 | ||
56 | md5 = crypto_alloc_shash("md5", 0, 0); | 56 | md5 = crypto_alloc_shash("md5", 0, 0); |
57 | if (IS_ERR(md5)) { | 57 | if (IS_ERR(md5)) { |
58 | rc = PTR_ERR(md5); | ||
58 | cERROR(1, "%s: Crypto md5 allocation error %d\n", __func__, rc); | 59 | cERROR(1, "%s: Crypto md5 allocation error %d\n", __func__, rc); |
59 | return PTR_ERR(md5); | 60 | return rc; |
60 | } | 61 | } |
61 | size = sizeof(struct shash_desc) + crypto_shash_descsize(md5); | 62 | size = sizeof(struct shash_desc) + crypto_shash_descsize(md5); |
62 | sdescmd5 = kmalloc(size, GFP_KERNEL); | 63 | sdescmd5 = kmalloc(size, GFP_KERNEL); |
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index a09e077ba925..2a930a752a78 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
@@ -236,10 +236,7 @@ __u16 GetNextMid(struct TCP_Server_Info *server) | |||
236 | { | 236 | { |
237 | __u16 mid = 0; | 237 | __u16 mid = 0; |
238 | __u16 last_mid; | 238 | __u16 last_mid; |
239 | int collision; | 239 | bool collision; |
240 | |||
241 | if (server == NULL) | ||
242 | return mid; | ||
243 | 240 | ||
244 | spin_lock(&GlobalMid_Lock); | 241 | spin_lock(&GlobalMid_Lock); |
245 | last_mid = server->CurrentMid; /* we do not want to loop forever */ | 242 | last_mid = server->CurrentMid; /* we do not want to loop forever */ |
@@ -252,24 +249,38 @@ __u16 GetNextMid(struct TCP_Server_Info *server) | |||
252 | (and it would also have to have been a request that | 249 | (and it would also have to have been a request that |
253 | did not time out) */ | 250 | did not time out) */ |
254 | while (server->CurrentMid != last_mid) { | 251 | while (server->CurrentMid != last_mid) { |
255 | struct list_head *tmp; | ||
256 | struct mid_q_entry *mid_entry; | 252 | struct mid_q_entry *mid_entry; |
253 | unsigned int num_mids; | ||
257 | 254 | ||
258 | collision = 0; | 255 | collision = false; |
259 | if (server->CurrentMid == 0) | 256 | if (server->CurrentMid == 0) |
260 | server->CurrentMid++; | 257 | server->CurrentMid++; |
261 | 258 | ||
262 | list_for_each(tmp, &server->pending_mid_q) { | 259 | num_mids = 0; |
263 | mid_entry = list_entry(tmp, struct mid_q_entry, qhead); | 260 | list_for_each_entry(mid_entry, &server->pending_mid_q, qhead) { |
264 | 261 | ++num_mids; | |
265 | if ((mid_entry->mid == server->CurrentMid) && | 262 | if (mid_entry->mid == server->CurrentMid && |
266 | (mid_entry->midState == MID_REQUEST_SUBMITTED)) { | 263 | mid_entry->midState == MID_REQUEST_SUBMITTED) { |
267 | /* This mid is in use, try a different one */ | 264 | /* This mid is in use, try a different one */ |
268 | collision = 1; | 265 | collision = true; |
269 | break; | 266 | break; |
270 | } | 267 | } |
271 | } | 268 | } |
272 | if (collision == 0) { | 269 | |
270 | /* | ||
271 | * if we have more than 32k mids in the list, then something | ||
272 | * is very wrong. Possibly a local user is trying to DoS the | ||
273 | * box by issuing long-running calls and SIGKILL'ing them. If | ||
274 | * we get to 2^16 mids then we're in big trouble as this | ||
275 | * function could loop forever. | ||
276 | * | ||
277 | * Go ahead and assign out the mid in this situation, but force | ||
278 | * an eventual reconnect to clean out the pending_mid_q. | ||
279 | */ | ||
280 | if (num_mids > 32768) | ||
281 | server->tcpStatus = CifsNeedReconnect; | ||
282 | |||
283 | if (!collision) { | ||
273 | mid = server->CurrentMid; | 284 | mid = server->CurrentMid; |
274 | break; | 285 | break; |
275 | } | 286 | } |
@@ -381,29 +392,31 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ , | |||
381 | } | 392 | } |
382 | 393 | ||
383 | static int | 394 | static int |
384 | checkSMBhdr(struct smb_hdr *smb, __u16 mid) | 395 | check_smb_hdr(struct smb_hdr *smb, __u16 mid) |
385 | { | 396 | { |
386 | /* Make sure that this really is an SMB, that it is a response, | 397 | /* does it have the right SMB "signature" ? */ |
387 | and that the message ids match */ | 398 | if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) { |
388 | if ((*(__le32 *) smb->Protocol == cpu_to_le32(0x424d53ff)) && | 399 | cERROR(1, "Bad protocol string signature header 0x%x", |
389 | (mid == smb->Mid)) { | 400 | *(unsigned int *)smb->Protocol); |
390 | if (smb->Flags & SMBFLG_RESPONSE) | 401 | return 1; |
391 | return 0; | 402 | } |
392 | else { | 403 | |
393 | /* only one valid case where server sends us request */ | 404 | /* Make sure that message ids match */ |
394 | if (smb->Command == SMB_COM_LOCKING_ANDX) | 405 | if (mid != smb->Mid) { |
395 | return 0; | 406 | cERROR(1, "Mids do not match. received=%u expected=%u", |
396 | else | 407 | smb->Mid, mid); |
397 | cERROR(1, "Received Request not response"); | 408 | return 1; |
398 | } | ||
399 | } else { /* bad signature or mid */ | ||
400 | if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff)) | ||
401 | cERROR(1, "Bad protocol string signature header %x", | ||
402 | *(unsigned int *) smb->Protocol); | ||
403 | if (mid != smb->Mid) | ||
404 | cERROR(1, "Mids do not match"); | ||
405 | } | 409 | } |
406 | cERROR(1, "bad smb detected. The Mid=%d", smb->Mid); | 410 | |
411 | /* if it's a response then accept */ | ||
412 | if (smb->Flags & SMBFLG_RESPONSE) | ||
413 | return 0; | ||
414 | |||
415 | /* only one valid case where server sends us request */ | ||
416 | if (smb->Command == SMB_COM_LOCKING_ANDX) | ||
417 | return 0; | ||
418 | |||
419 | cERROR(1, "Server sent request, not response. mid=%u", smb->Mid); | ||
407 | return 1; | 420 | return 1; |
408 | } | 421 | } |
409 | 422 | ||
@@ -448,7 +461,7 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length) | |||
448 | return 1; | 461 | return 1; |
449 | } | 462 | } |
450 | 463 | ||
451 | if (checkSMBhdr(smb, mid)) | 464 | if (check_smb_hdr(smb, mid)) |
452 | return 1; | 465 | return 1; |
453 | clc_len = smbCalcSize_LE(smb); | 466 | clc_len = smbCalcSize_LE(smb); |
454 | 467 | ||
@@ -465,25 +478,26 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length) | |||
465 | if (((4 + len) & 0xFFFF) == (clc_len & 0xFFFF)) | 478 | if (((4 + len) & 0xFFFF) == (clc_len & 0xFFFF)) |
466 | return 0; /* bcc wrapped */ | 479 | return 0; /* bcc wrapped */ |
467 | } | 480 | } |
468 | cFYI(1, "Calculated size %d vs length %d mismatch for mid %d", | 481 | cFYI(1, "Calculated size %u vs length %u mismatch for mid=%u", |
469 | clc_len, 4 + len, smb->Mid); | 482 | clc_len, 4 + len, smb->Mid); |
470 | /* Windows XP can return a few bytes too much, presumably | 483 | |
471 | an illegal pad, at the end of byte range lock responses | 484 | if (4 + len < clc_len) { |
472 | so we allow for that three byte pad, as long as actual | 485 | cERROR(1, "RFC1001 size %u smaller than SMB for mid=%u", |
473 | received length is as long or longer than calculated length */ | ||
474 | /* We have now had to extend this more, since there is a | ||
475 | case in which it needs to be bigger still to handle a | ||
476 | malformed response to transact2 findfirst from WinXP when | ||
477 | access denied is returned and thus bcc and wct are zero | ||
478 | but server says length is 0x21 bytes too long as if the server | ||
479 | forget to reset the smb rfc1001 length when it reset the | ||
480 | wct and bcc to minimum size and drop the t2 parms and data */ | ||
481 | if ((4+len > clc_len) && (len <= clc_len + 512)) | ||
482 | return 0; | ||
483 | else { | ||
484 | cERROR(1, "RFC1001 size %d bigger than SMB for Mid=%d", | ||
485 | len, smb->Mid); | 486 | len, smb->Mid); |
486 | return 1; | 487 | return 1; |
488 | } else if (len > clc_len + 512) { | ||
489 | /* | ||
490 | * Some servers (Windows XP in particular) send more | ||
491 | * data than the lengths in the SMB packet would | ||
492 | * indicate on certain calls (byte range locks and | ||
493 | * trans2 find first calls in particular). While the | ||
494 | * client can handle such a frame by ignoring the | ||
495 | * trailing data, we choose limit the amount of extra | ||
496 | * data to 512 bytes. | ||
497 | */ | ||
498 | cERROR(1, "RFC1001 size %u more than 512 bytes larger " | ||
499 | "than SMB for mid=%u", len, smb->Mid); | ||
500 | return 1; | ||
487 | } | 501 | } |
488 | } | 502 | } |
489 | return 0; | 503 | return 0; |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 7f25cc3d2256..f8e4cd2a7912 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -764,7 +764,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) | |||
764 | { | 764 | { |
765 | int rc = 0; | 765 | int rc = 0; |
766 | int xid, i; | 766 | int xid, i; |
767 | struct cifs_sb_info *cifs_sb; | ||
768 | struct cifsTconInfo *pTcon; | 767 | struct cifsTconInfo *pTcon; |
769 | struct cifsFileInfo *cifsFile = NULL; | 768 | struct cifsFileInfo *cifsFile = NULL; |
770 | char *current_entry; | 769 | char *current_entry; |
@@ -775,8 +774,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) | |||
775 | 774 | ||
776 | xid = GetXid(); | 775 | xid = GetXid(); |
777 | 776 | ||
778 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | ||
779 | |||
780 | /* | 777 | /* |
781 | * Ensure FindFirst doesn't fail before doing filldir() for '.' and | 778 | * Ensure FindFirst doesn't fail before doing filldir() for '.' and |
782 | * '..'. Otherwise we won't be able to notify VFS in case of failure. | 779 | * '..'. Otherwise we won't be able to notify VFS in case of failure. |
diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c index b5450e9f40c0..b5041c849981 100644 --- a/fs/cifs/smbencrypt.c +++ b/fs/cifs/smbencrypt.c | |||
@@ -58,8 +58,9 @@ mdfour(unsigned char *md4_hash, unsigned char *link_str, int link_len) | |||
58 | 58 | ||
59 | md4 = crypto_alloc_shash("md4", 0, 0); | 59 | md4 = crypto_alloc_shash("md4", 0, 0); |
60 | if (IS_ERR(md4)) { | 60 | if (IS_ERR(md4)) { |
61 | rc = PTR_ERR(md4); | ||
61 | cERROR(1, "%s: Crypto md4 allocation error %d\n", __func__, rc); | 62 | cERROR(1, "%s: Crypto md4 allocation error %d\n", __func__, rc); |
62 | return PTR_ERR(md4); | 63 | return rc; |
63 | } | 64 | } |
64 | size = sizeof(struct shash_desc) + crypto_shash_descsize(md4); | 65 | size = sizeof(struct shash_desc) + crypto_shash_descsize(md4); |
65 | sdescmd4 = kmalloc(size, GFP_KERNEL); | 66 | sdescmd4 = kmalloc(size, GFP_KERNEL); |
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index c1ccca1a933f..b8c5e2eb43d0 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -236,9 +236,9 @@ smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec) | |||
236 | server->tcpStatus = CifsNeedReconnect; | 236 | server->tcpStatus = CifsNeedReconnect; |
237 | } | 237 | } |
238 | 238 | ||
239 | if (rc < 0) { | 239 | if (rc < 0 && rc != -EINTR) |
240 | cERROR(1, "Error %d sending data on socket to server", rc); | 240 | cERROR(1, "Error %d sending data on socket to server", rc); |
241 | } else | 241 | else |
242 | rc = 0; | 242 | rc = 0; |
243 | 243 | ||
244 | /* Don't want to modify the buffer as a | 244 | /* Don't want to modify the buffer as a |
@@ -570,17 +570,33 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, | |||
570 | #endif | 570 | #endif |
571 | 571 | ||
572 | mutex_unlock(&ses->server->srv_mutex); | 572 | mutex_unlock(&ses->server->srv_mutex); |
573 | cifs_small_buf_release(in_buf); | ||
574 | 573 | ||
575 | if (rc < 0) | 574 | if (rc < 0) { |
575 | cifs_small_buf_release(in_buf); | ||
576 | goto out; | 576 | goto out; |
577 | } | ||
577 | 578 | ||
578 | if (long_op == CIFS_ASYNC_OP) | 579 | if (long_op == CIFS_ASYNC_OP) { |
580 | cifs_small_buf_release(in_buf); | ||
579 | goto out; | 581 | goto out; |
582 | } | ||
580 | 583 | ||
581 | rc = wait_for_response(ses->server, midQ); | 584 | rc = wait_for_response(ses->server, midQ); |
582 | if (rc != 0) | 585 | if (rc != 0) { |
583 | goto out; | 586 | send_nt_cancel(ses->server, in_buf, midQ); |
587 | spin_lock(&GlobalMid_Lock); | ||
588 | if (midQ->midState == MID_REQUEST_SUBMITTED) { | ||
589 | midQ->callback = DeleteMidQEntry; | ||
590 | spin_unlock(&GlobalMid_Lock); | ||
591 | cifs_small_buf_release(in_buf); | ||
592 | atomic_dec(&ses->server->inFlight); | ||
593 | wake_up(&ses->server->request_q); | ||
594 | return rc; | ||
595 | } | ||
596 | spin_unlock(&GlobalMid_Lock); | ||
597 | } | ||
598 | |||
599 | cifs_small_buf_release(in_buf); | ||
584 | 600 | ||
585 | rc = sync_mid_result(midQ, ses->server); | 601 | rc = sync_mid_result(midQ, ses->server); |
586 | if (rc != 0) { | 602 | if (rc != 0) { |
@@ -724,8 +740,19 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, | |||
724 | goto out; | 740 | goto out; |
725 | 741 | ||
726 | rc = wait_for_response(ses->server, midQ); | 742 | rc = wait_for_response(ses->server, midQ); |
727 | if (rc != 0) | 743 | if (rc != 0) { |
728 | goto out; | 744 | send_nt_cancel(ses->server, in_buf, midQ); |
745 | spin_lock(&GlobalMid_Lock); | ||
746 | if (midQ->midState == MID_REQUEST_SUBMITTED) { | ||
747 | /* no longer considered to be "in-flight" */ | ||
748 | midQ->callback = DeleteMidQEntry; | ||
749 | spin_unlock(&GlobalMid_Lock); | ||
750 | atomic_dec(&ses->server->inFlight); | ||
751 | wake_up(&ses->server->request_q); | ||
752 | return rc; | ||
753 | } | ||
754 | spin_unlock(&GlobalMid_Lock); | ||
755 | } | ||
729 | 756 | ||
730 | rc = sync_mid_result(midQ, ses->server); | 757 | rc = sync_mid_result(midQ, ses->server); |
731 | if (rc != 0) { | 758 | if (rc != 0) { |
@@ -922,10 +949,21 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifsTconInfo *tcon, | |||
922 | } | 949 | } |
923 | } | 950 | } |
924 | 951 | ||
925 | if (wait_for_response(ses->server, midQ) == 0) { | 952 | rc = wait_for_response(ses->server, midQ); |
926 | /* We got the response - restart system call. */ | 953 | if (rc) { |
927 | rstart = 1; | 954 | send_nt_cancel(ses->server, in_buf, midQ); |
955 | spin_lock(&GlobalMid_Lock); | ||
956 | if (midQ->midState == MID_REQUEST_SUBMITTED) { | ||
957 | /* no longer considered to be "in-flight" */ | ||
958 | midQ->callback = DeleteMidQEntry; | ||
959 | spin_unlock(&GlobalMid_Lock); | ||
960 | return rc; | ||
961 | } | ||
962 | spin_unlock(&GlobalMid_Lock); | ||
928 | } | 963 | } |
964 | |||
965 | /* We got the response - restart system call. */ | ||
966 | rstart = 1; | ||
929 | } | 967 | } |
930 | 968 | ||
931 | rc = sync_mid_result(midQ, ses->server); | 969 | rc = sync_mid_result(midQ, ses->server); |
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index cc8a9b7d6064..267d0ada4541 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -1114,6 +1114,17 @@ static int ep_send_events(struct eventpoll *ep, | |||
1114 | return ep_scan_ready_list(ep, ep_send_events_proc, &esed); | 1114 | return ep_scan_ready_list(ep, ep_send_events_proc, &esed); |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | static inline struct timespec ep_set_mstimeout(long ms) | ||
1118 | { | ||
1119 | struct timespec now, ts = { | ||
1120 | .tv_sec = ms / MSEC_PER_SEC, | ||
1121 | .tv_nsec = NSEC_PER_MSEC * (ms % MSEC_PER_SEC), | ||
1122 | }; | ||
1123 | |||
1124 | ktime_get_ts(&now); | ||
1125 | return timespec_add_safe(now, ts); | ||
1126 | } | ||
1127 | |||
1117 | static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, | 1128 | static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, |
1118 | int maxevents, long timeout) | 1129 | int maxevents, long timeout) |
1119 | { | 1130 | { |
@@ -1121,12 +1132,11 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, | |||
1121 | unsigned long flags; | 1132 | unsigned long flags; |
1122 | long slack; | 1133 | long slack; |
1123 | wait_queue_t wait; | 1134 | wait_queue_t wait; |
1124 | struct timespec end_time; | ||
1125 | ktime_t expires, *to = NULL; | 1135 | ktime_t expires, *to = NULL; |
1126 | 1136 | ||
1127 | if (timeout > 0) { | 1137 | if (timeout > 0) { |
1128 | ktime_get_ts(&end_time); | 1138 | struct timespec end_time = ep_set_mstimeout(timeout); |
1129 | timespec_add_ns(&end_time, (u64)timeout * NSEC_PER_MSEC); | 1139 | |
1130 | slack = select_estimate_accuracy(&end_time); | 1140 | slack = select_estimate_accuracy(&end_time); |
1131 | to = &expires; | 1141 | to = &expires; |
1132 | *to = timespec_to_ktime(end_time); | 1142 | *to = timespec_to_ktime(end_time); |
@@ -120,7 +120,7 @@ SYSCALL_DEFINE1(uselib, const char __user *, library) | |||
120 | goto out; | 120 | goto out; |
121 | 121 | ||
122 | file = do_filp_open(AT_FDCWD, tmp, | 122 | file = do_filp_open(AT_FDCWD, tmp, |
123 | O_LARGEFILE | O_RDONLY | FMODE_EXEC, 0, | 123 | O_LARGEFILE | O_RDONLY | __FMODE_EXEC, 0, |
124 | MAY_READ | MAY_EXEC | MAY_OPEN); | 124 | MAY_READ | MAY_EXEC | MAY_OPEN); |
125 | putname(tmp); | 125 | putname(tmp); |
126 | error = PTR_ERR(file); | 126 | error = PTR_ERR(file); |
@@ -723,7 +723,7 @@ struct file *open_exec(const char *name) | |||
723 | int err; | 723 | int err; |
724 | 724 | ||
725 | file = do_filp_open(AT_FDCWD, name, | 725 | file = do_filp_open(AT_FDCWD, name, |
726 | O_LARGEFILE | O_RDONLY | FMODE_EXEC, 0, | 726 | O_LARGEFILE | O_RDONLY | __FMODE_EXEC, 0, |
727 | MAY_EXEC | MAY_OPEN); | 727 | MAY_EXEC | MAY_OPEN); |
728 | if (IS_ERR(file)) | 728 | if (IS_ERR(file)) |
729 | goto out; | 729 | goto out; |
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index 42685424817b..a7555238c41a 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c | |||
@@ -1030,7 +1030,6 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino) | |||
1030 | memcpy(oi->i_data, fcb.i_data, sizeof(fcb.i_data)); | 1030 | memcpy(oi->i_data, fcb.i_data, sizeof(fcb.i_data)); |
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | inode->i_mapping->backing_dev_info = sb->s_bdi; | ||
1034 | if (S_ISREG(inode->i_mode)) { | 1033 | if (S_ISREG(inode->i_mode)) { |
1035 | inode->i_op = &exofs_file_inode_operations; | 1034 | inode->i_op = &exofs_file_inode_operations; |
1036 | inode->i_fop = &exofs_file_operations; | 1035 | inode->i_fop = &exofs_file_operations; |
@@ -1131,7 +1130,6 @@ struct inode *exofs_new_inode(struct inode *dir, int mode) | |||
1131 | 1130 | ||
1132 | sbi = sb->s_fs_info; | 1131 | sbi = sb->s_fs_info; |
1133 | 1132 | ||
1134 | inode->i_mapping->backing_dev_info = sb->s_bdi; | ||
1135 | sb->s_dirt = 1; | 1133 | sb->s_dirt = 1; |
1136 | inode_init_owner(inode, dir, mode); | 1134 | inode_init_owner(inode, dir, mode); |
1137 | inode->i_ino = sbi->s_nextid++; | 1135 | inode->i_ino = sbi->s_nextid++; |
diff --git a/fs/fcntl.c b/fs/fcntl.c index ecc8b3954ed6..cb1026181bdc 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c | |||
@@ -815,7 +815,7 @@ static int __init fcntl_init(void) | |||
815 | __O_SYNC | O_DSYNC | FASYNC | | 815 | __O_SYNC | O_DSYNC | FASYNC | |
816 | O_DIRECT | O_LARGEFILE | O_DIRECTORY | | 816 | O_DIRECT | O_LARGEFILE | O_DIRECTORY | |
817 | O_NOFOLLOW | O_NOATIME | O_CLOEXEC | | 817 | O_NOFOLLOW | O_NOATIME | O_CLOEXEC | |
818 | FMODE_EXEC | 818 | __FMODE_EXEC |
819 | )); | 819 | )); |
820 | 820 | ||
821 | fasync_cache = kmem_cache_create("fasync_cache", | 821 | fasync_cache = kmem_cache_create("fasync_cache", |
diff --git a/fs/file_table.c b/fs/file_table.c index c3e89adf53c0..eb36b6b17e26 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
@@ -125,13 +125,13 @@ struct file *get_empty_filp(void) | |||
125 | goto fail; | 125 | goto fail; |
126 | 126 | ||
127 | percpu_counter_inc(&nr_files); | 127 | percpu_counter_inc(&nr_files); |
128 | f->f_cred = get_cred(cred); | ||
128 | if (security_file_alloc(f)) | 129 | if (security_file_alloc(f)) |
129 | goto fail_sec; | 130 | goto fail_sec; |
130 | 131 | ||
131 | INIT_LIST_HEAD(&f->f_u.fu_list); | 132 | INIT_LIST_HEAD(&f->f_u.fu_list); |
132 | atomic_long_set(&f->f_count, 1); | 133 | atomic_long_set(&f->f_count, 1); |
133 | rwlock_init(&f->f_owner.lock); | 134 | rwlock_init(&f->f_owner.lock); |
134 | f->f_cred = get_cred(cred); | ||
135 | spin_lock_init(&f->f_lock); | 135 | spin_lock_init(&f->f_lock); |
136 | eventpoll_init_file(f); | 136 | eventpoll_init_file(f); |
137 | /* f->f_version: 0 */ | 137 | /* f->f_version: 0 */ |
diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c index 52a0bcaa7b6d..b1991a2a08e0 100644 --- a/fs/hfsplus/extents.c +++ b/fs/hfsplus/extents.c | |||
@@ -397,8 +397,8 @@ int hfsplus_file_extend(struct inode *inode) | |||
397 | u32 start, len, goal; | 397 | u32 start, len, goal; |
398 | int res; | 398 | int res; |
399 | 399 | ||
400 | if (sbi->total_blocks - sbi->free_blocks + 8 > | 400 | if (sbi->alloc_file->i_size * 8 < |
401 | sbi->alloc_file->i_size * 8) { | 401 | sbi->total_blocks - sbi->free_blocks + 8) { |
402 | /* extend alloc file */ | 402 | /* extend alloc file */ |
403 | printk(KERN_ERR "hfs: extend alloc file! " | 403 | printk(KERN_ERR "hfs: extend alloc file! " |
404 | "(%llu,%u,%u)\n", | 404 | "(%llu,%u,%u)\n", |
diff --git a/fs/hfsplus/part_tbl.c b/fs/hfsplus/part_tbl.c index d66ad113b1cc..40ad88c12c64 100644 --- a/fs/hfsplus/part_tbl.c +++ b/fs/hfsplus/part_tbl.c | |||
@@ -134,7 +134,7 @@ int hfs_part_find(struct super_block *sb, | |||
134 | res = hfsplus_submit_bio(sb->s_bdev, *part_start + HFS_PMAP_BLK, | 134 | res = hfsplus_submit_bio(sb->s_bdev, *part_start + HFS_PMAP_BLK, |
135 | data, READ); | 135 | data, READ); |
136 | if (res) | 136 | if (res) |
137 | return res; | 137 | goto out; |
138 | 138 | ||
139 | switch (be16_to_cpu(*((__be16 *)data))) { | 139 | switch (be16_to_cpu(*((__be16 *)data))) { |
140 | case HFS_OLD_PMAP_MAGIC: | 140 | case HFS_OLD_PMAP_MAGIC: |
@@ -147,7 +147,7 @@ int hfs_part_find(struct super_block *sb, | |||
147 | res = -ENOENT; | 147 | res = -ENOENT; |
148 | break; | 148 | break; |
149 | } | 149 | } |
150 | 150 | out: | |
151 | kfree(data); | 151 | kfree(data); |
152 | return res; | 152 | return res; |
153 | } | 153 | } |
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 9a3b4795f43c..b49b55584c84 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c | |||
@@ -338,20 +338,22 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
338 | struct inode *root, *inode; | 338 | struct inode *root, *inode; |
339 | struct qstr str; | 339 | struct qstr str; |
340 | struct nls_table *nls = NULL; | 340 | struct nls_table *nls = NULL; |
341 | int err = -EINVAL; | 341 | int err; |
342 | 342 | ||
343 | err = -EINVAL; | ||
343 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); | 344 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); |
344 | if (!sbi) | 345 | if (!sbi) |
345 | return -ENOMEM; | 346 | goto out; |
346 | 347 | ||
347 | sb->s_fs_info = sbi; | 348 | sb->s_fs_info = sbi; |
348 | mutex_init(&sbi->alloc_mutex); | 349 | mutex_init(&sbi->alloc_mutex); |
349 | mutex_init(&sbi->vh_mutex); | 350 | mutex_init(&sbi->vh_mutex); |
350 | hfsplus_fill_defaults(sbi); | 351 | hfsplus_fill_defaults(sbi); |
352 | |||
353 | err = -EINVAL; | ||
351 | if (!hfsplus_parse_options(data, sbi)) { | 354 | if (!hfsplus_parse_options(data, sbi)) { |
352 | printk(KERN_ERR "hfs: unable to parse mount options\n"); | 355 | printk(KERN_ERR "hfs: unable to parse mount options\n"); |
353 | err = -EINVAL; | 356 | goto out_unload_nls; |
354 | goto cleanup; | ||
355 | } | 357 | } |
356 | 358 | ||
357 | /* temporarily use utf8 to correctly find the hidden dir below */ | 359 | /* temporarily use utf8 to correctly find the hidden dir below */ |
@@ -359,16 +361,14 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
359 | sbi->nls = load_nls("utf8"); | 361 | sbi->nls = load_nls("utf8"); |
360 | if (!sbi->nls) { | 362 | if (!sbi->nls) { |
361 | printk(KERN_ERR "hfs: unable to load nls for utf8\n"); | 363 | printk(KERN_ERR "hfs: unable to load nls for utf8\n"); |
362 | err = -EINVAL; | 364 | goto out_unload_nls; |
363 | goto cleanup; | ||
364 | } | 365 | } |
365 | 366 | ||
366 | /* Grab the volume header */ | 367 | /* Grab the volume header */ |
367 | if (hfsplus_read_wrapper(sb)) { | 368 | if (hfsplus_read_wrapper(sb)) { |
368 | if (!silent) | 369 | if (!silent) |
369 | printk(KERN_WARNING "hfs: unable to find HFS+ superblock\n"); | 370 | printk(KERN_WARNING "hfs: unable to find HFS+ superblock\n"); |
370 | err = -EINVAL; | 371 | goto out_unload_nls; |
371 | goto cleanup; | ||
372 | } | 372 | } |
373 | vhdr = sbi->s_vhdr; | 373 | vhdr = sbi->s_vhdr; |
374 | 374 | ||
@@ -377,7 +377,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
377 | if (be16_to_cpu(vhdr->version) < HFSPLUS_MIN_VERSION || | 377 | if (be16_to_cpu(vhdr->version) < HFSPLUS_MIN_VERSION || |
378 | be16_to_cpu(vhdr->version) > HFSPLUS_CURRENT_VERSION) { | 378 | be16_to_cpu(vhdr->version) > HFSPLUS_CURRENT_VERSION) { |
379 | printk(KERN_ERR "hfs: wrong filesystem version\n"); | 379 | printk(KERN_ERR "hfs: wrong filesystem version\n"); |
380 | goto cleanup; | 380 | goto out_free_vhdr; |
381 | } | 381 | } |
382 | sbi->total_blocks = be32_to_cpu(vhdr->total_blocks); | 382 | sbi->total_blocks = be32_to_cpu(vhdr->total_blocks); |
383 | sbi->free_blocks = be32_to_cpu(vhdr->free_blocks); | 383 | sbi->free_blocks = be32_to_cpu(vhdr->free_blocks); |
@@ -421,19 +421,19 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
421 | sbi->ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); | 421 | sbi->ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); |
422 | if (!sbi->ext_tree) { | 422 | if (!sbi->ext_tree) { |
423 | printk(KERN_ERR "hfs: failed to load extents file\n"); | 423 | printk(KERN_ERR "hfs: failed to load extents file\n"); |
424 | goto cleanup; | 424 | goto out_free_vhdr; |
425 | } | 425 | } |
426 | sbi->cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID); | 426 | sbi->cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID); |
427 | if (!sbi->cat_tree) { | 427 | if (!sbi->cat_tree) { |
428 | printk(KERN_ERR "hfs: failed to load catalog file\n"); | 428 | printk(KERN_ERR "hfs: failed to load catalog file\n"); |
429 | goto cleanup; | 429 | goto out_close_ext_tree; |
430 | } | 430 | } |
431 | 431 | ||
432 | inode = hfsplus_iget(sb, HFSPLUS_ALLOC_CNID); | 432 | inode = hfsplus_iget(sb, HFSPLUS_ALLOC_CNID); |
433 | if (IS_ERR(inode)) { | 433 | if (IS_ERR(inode)) { |
434 | printk(KERN_ERR "hfs: failed to load allocation file\n"); | 434 | printk(KERN_ERR "hfs: failed to load allocation file\n"); |
435 | err = PTR_ERR(inode); | 435 | err = PTR_ERR(inode); |
436 | goto cleanup; | 436 | goto out_close_cat_tree; |
437 | } | 437 | } |
438 | sbi->alloc_file = inode; | 438 | sbi->alloc_file = inode; |
439 | 439 | ||
@@ -442,14 +442,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
442 | if (IS_ERR(root)) { | 442 | if (IS_ERR(root)) { |
443 | printk(KERN_ERR "hfs: failed to load root directory\n"); | 443 | printk(KERN_ERR "hfs: failed to load root directory\n"); |
444 | err = PTR_ERR(root); | 444 | err = PTR_ERR(root); |
445 | goto cleanup; | 445 | goto out_put_alloc_file; |
446 | } | ||
447 | sb->s_d_op = &hfsplus_dentry_operations; | ||
448 | sb->s_root = d_alloc_root(root); | ||
449 | if (!sb->s_root) { | ||
450 | iput(root); | ||
451 | err = -ENOMEM; | ||
452 | goto cleanup; | ||
453 | } | 446 | } |
454 | 447 | ||
455 | str.len = sizeof(HFSP_HIDDENDIR_NAME) - 1; | 448 | str.len = sizeof(HFSP_HIDDENDIR_NAME) - 1; |
@@ -459,46 +452,69 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
459 | if (!hfs_brec_read(&fd, &entry, sizeof(entry))) { | 452 | if (!hfs_brec_read(&fd, &entry, sizeof(entry))) { |
460 | hfs_find_exit(&fd); | 453 | hfs_find_exit(&fd); |
461 | if (entry.type != cpu_to_be16(HFSPLUS_FOLDER)) | 454 | if (entry.type != cpu_to_be16(HFSPLUS_FOLDER)) |
462 | goto cleanup; | 455 | goto out_put_root; |
463 | inode = hfsplus_iget(sb, be32_to_cpu(entry.folder.id)); | 456 | inode = hfsplus_iget(sb, be32_to_cpu(entry.folder.id)); |
464 | if (IS_ERR(inode)) { | 457 | if (IS_ERR(inode)) { |
465 | err = PTR_ERR(inode); | 458 | err = PTR_ERR(inode); |
466 | goto cleanup; | 459 | goto out_put_root; |
467 | } | 460 | } |
468 | sbi->hidden_dir = inode; | 461 | sbi->hidden_dir = inode; |
469 | } else | 462 | } else |
470 | hfs_find_exit(&fd); | 463 | hfs_find_exit(&fd); |
471 | 464 | ||
472 | if (sb->s_flags & MS_RDONLY) | 465 | if (!(sb->s_flags & MS_RDONLY)) { |
473 | goto out; | 466 | /* |
467 | * H+LX == hfsplusutils, H+Lx == this driver, H+lx is unused | ||
468 | * all three are registered with Apple for our use | ||
469 | */ | ||
470 | vhdr->last_mount_vers = cpu_to_be32(HFSP_MOUNT_VERSION); | ||
471 | vhdr->modify_date = hfsp_now2mt(); | ||
472 | be32_add_cpu(&vhdr->write_count, 1); | ||
473 | vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_UNMNT); | ||
474 | vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_INCNSTNT); | ||
475 | hfsplus_sync_fs(sb, 1); | ||
474 | 476 | ||
475 | /* H+LX == hfsplusutils, H+Lx == this driver, H+lx is unused | 477 | if (!sbi->hidden_dir) { |
476 | * all three are registered with Apple for our use | 478 | mutex_lock(&sbi->vh_mutex); |
477 | */ | 479 | sbi->hidden_dir = hfsplus_new_inode(sb, S_IFDIR); |
478 | vhdr->last_mount_vers = cpu_to_be32(HFSP_MOUNT_VERSION); | 480 | hfsplus_create_cat(sbi->hidden_dir->i_ino, root, &str, |
479 | vhdr->modify_date = hfsp_now2mt(); | 481 | sbi->hidden_dir); |
480 | be32_add_cpu(&vhdr->write_count, 1); | 482 | mutex_unlock(&sbi->vh_mutex); |
481 | vhdr->attributes &= cpu_to_be32(~HFSPLUS_VOL_UNMNT); | 483 | |
482 | vhdr->attributes |= cpu_to_be32(HFSPLUS_VOL_INCNSTNT); | 484 | hfsplus_mark_inode_dirty(sbi->hidden_dir, |
483 | hfsplus_sync_fs(sb, 1); | 485 | HFSPLUS_I_CAT_DIRTY); |
484 | 486 | } | |
485 | if (!sbi->hidden_dir) { | ||
486 | mutex_lock(&sbi->vh_mutex); | ||
487 | sbi->hidden_dir = hfsplus_new_inode(sb, S_IFDIR); | ||
488 | hfsplus_create_cat(sbi->hidden_dir->i_ino, sb->s_root->d_inode, | ||
489 | &str, sbi->hidden_dir); | ||
490 | mutex_unlock(&sbi->vh_mutex); | ||
491 | |||
492 | hfsplus_mark_inode_dirty(sbi->hidden_dir, HFSPLUS_I_CAT_DIRTY); | ||
493 | } | 487 | } |
494 | out: | 488 | |
489 | sb->s_d_op = &hfsplus_dentry_operations; | ||
490 | sb->s_root = d_alloc_root(root); | ||
491 | if (!sb->s_root) { | ||
492 | err = -ENOMEM; | ||
493 | goto out_put_hidden_dir; | ||
494 | } | ||
495 | |||
495 | unload_nls(sbi->nls); | 496 | unload_nls(sbi->nls); |
496 | sbi->nls = nls; | 497 | sbi->nls = nls; |
497 | return 0; | 498 | return 0; |
498 | 499 | ||
499 | cleanup: | 500 | out_put_hidden_dir: |
500 | hfsplus_put_super(sb); | 501 | iput(sbi->hidden_dir); |
502 | out_put_root: | ||
503 | iput(sbi->alloc_file); | ||
504 | out_put_alloc_file: | ||
505 | iput(sbi->alloc_file); | ||
506 | out_close_cat_tree: | ||
507 | hfs_btree_close(sbi->cat_tree); | ||
508 | out_close_ext_tree: | ||
509 | hfs_btree_close(sbi->ext_tree); | ||
510 | out_free_vhdr: | ||
511 | kfree(sbi->s_vhdr); | ||
512 | kfree(sbi->s_backup_vhdr); | ||
513 | out_unload_nls: | ||
514 | unload_nls(sbi->nls); | ||
501 | unload_nls(nls); | 515 | unload_nls(nls); |
516 | kfree(sbi); | ||
517 | out: | ||
502 | return err; | 518 | return err; |
503 | } | 519 | } |
504 | 520 | ||
diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index 196231794f64..3031d81f5f0f 100644 --- a/fs/hfsplus/wrapper.c +++ b/fs/hfsplus/wrapper.c | |||
@@ -167,7 +167,7 @@ reread: | |||
167 | break; | 167 | break; |
168 | case cpu_to_be16(HFSP_WRAP_MAGIC): | 168 | case cpu_to_be16(HFSP_WRAP_MAGIC): |
169 | if (!hfsplus_read_mdb(sbi->s_vhdr, &wd)) | 169 | if (!hfsplus_read_mdb(sbi->s_vhdr, &wd)) |
170 | goto out; | 170 | goto out_free_backup_vhdr; |
171 | wd.ablk_size >>= HFSPLUS_SECTOR_SHIFT; | 171 | wd.ablk_size >>= HFSPLUS_SECTOR_SHIFT; |
172 | part_start += wd.ablk_start + wd.embed_start * wd.ablk_size; | 172 | part_start += wd.ablk_start + wd.embed_start * wd.ablk_size; |
173 | part_size = wd.embed_count * wd.ablk_size; | 173 | part_size = wd.embed_count * wd.ablk_size; |
@@ -179,7 +179,7 @@ reread: | |||
179 | * (should do this only for cdrom/loop though) | 179 | * (should do this only for cdrom/loop though) |
180 | */ | 180 | */ |
181 | if (hfs_part_find(sb, &part_start, &part_size)) | 181 | if (hfs_part_find(sb, &part_start, &part_size)) |
182 | goto out; | 182 | goto out_free_backup_vhdr; |
183 | goto reread; | 183 | goto reread; |
184 | } | 184 | } |
185 | 185 | ||
diff --git a/fs/ioctl.c b/fs/ioctl.c index a59635e295fa..1eebeb72b202 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c | |||
@@ -273,6 +273,13 @@ int __generic_block_fiemap(struct inode *inode, | |||
273 | len = isize; | 273 | len = isize; |
274 | } | 274 | } |
275 | 275 | ||
276 | /* | ||
277 | * Some filesystems can't deal with being asked to map less than | ||
278 | * blocksize, so make sure our len is at least block length. | ||
279 | */ | ||
280 | if (logical_to_blk(inode, len) == 0) | ||
281 | len = blk_to_logical(inode, 1); | ||
282 | |||
276 | start_blk = logical_to_blk(inode, start); | 283 | start_blk = logical_to_blk(inode, start); |
277 | last_blk = logical_to_blk(inode, start + len - 1); | 284 | last_blk = logical_to_blk(inode, start + len - 1); |
278 | 285 | ||
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 6ebb81030d2d..fe77e3395b40 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -124,7 +124,8 @@ | |||
124 | #endif | 124 | #endif |
125 | 125 | ||
126 | #ifdef CONFIG_EVENT_TRACING | 126 | #ifdef CONFIG_EVENT_TRACING |
127 | #define FTRACE_EVENTS() VMLINUX_SYMBOL(__start_ftrace_events) = .; \ | 127 | #define FTRACE_EVENTS() . = ALIGN(8); \ |
128 | VMLINUX_SYMBOL(__start_ftrace_events) = .; \ | ||
128 | *(_ftrace_events) \ | 129 | *(_ftrace_events) \ |
129 | VMLINUX_SYMBOL(__stop_ftrace_events) = .; | 130 | VMLINUX_SYMBOL(__stop_ftrace_events) = .; |
130 | #else | 131 | #else |
@@ -140,7 +141,8 @@ | |||
140 | #endif | 141 | #endif |
141 | 142 | ||
142 | #ifdef CONFIG_FTRACE_SYSCALLS | 143 | #ifdef CONFIG_FTRACE_SYSCALLS |
143 | #define TRACE_SYSCALLS() VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \ | 144 | #define TRACE_SYSCALLS() . = ALIGN(8); \ |
145 | VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \ | ||
144 | *(__syscalls_metadata) \ | 146 | *(__syscalls_metadata) \ |
145 | VMLINUX_SYMBOL(__stop_syscalls_metadata) = .; | 147 | VMLINUX_SYMBOL(__stop_syscalls_metadata) = .; |
146 | #else | 148 | #else |
@@ -165,10 +167,8 @@ | |||
165 | CPU_KEEP(exit.data) \ | 167 | CPU_KEEP(exit.data) \ |
166 | MEM_KEEP(init.data) \ | 168 | MEM_KEEP(init.data) \ |
167 | MEM_KEEP(exit.data) \ | 169 | MEM_KEEP(exit.data) \ |
168 | . = ALIGN(32); \ | 170 | STRUCT_ALIGN(); \ |
169 | VMLINUX_SYMBOL(__start___tracepoints) = .; \ | ||
170 | *(__tracepoints) \ | 171 | *(__tracepoints) \ |
171 | VMLINUX_SYMBOL(__stop___tracepoints) = .; \ | ||
172 | /* implement dynamic printk debug */ \ | 172 | /* implement dynamic printk debug */ \ |
173 | . = ALIGN(8); \ | 173 | . = ALIGN(8); \ |
174 | VMLINUX_SYMBOL(__start___verbose) = .; \ | 174 | VMLINUX_SYMBOL(__start___verbose) = .; \ |
@@ -176,13 +176,7 @@ | |||
176 | VMLINUX_SYMBOL(__stop___verbose) = .; \ | 176 | VMLINUX_SYMBOL(__stop___verbose) = .; \ |
177 | LIKELY_PROFILE() \ | 177 | LIKELY_PROFILE() \ |
178 | BRANCH_PROFILE() \ | 178 | BRANCH_PROFILE() \ |
179 | TRACE_PRINTKS() \ | 179 | TRACE_PRINTKS() |
180 | \ | ||
181 | STRUCT_ALIGN(); \ | ||
182 | FTRACE_EVENTS() \ | ||
183 | \ | ||
184 | STRUCT_ALIGN(); \ | ||
185 | TRACE_SYSCALLS() | ||
186 | 180 | ||
187 | /* | 181 | /* |
188 | * Data section helpers | 182 | * Data section helpers |
@@ -220,6 +214,10 @@ | |||
220 | VMLINUX_SYMBOL(__start_rodata) = .; \ | 214 | VMLINUX_SYMBOL(__start_rodata) = .; \ |
221 | *(.rodata) *(.rodata.*) \ | 215 | *(.rodata) *(.rodata.*) \ |
222 | *(__vermagic) /* Kernel version magic */ \ | 216 | *(__vermagic) /* Kernel version magic */ \ |
217 | . = ALIGN(8); \ | ||
218 | VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \ | ||
219 | *(__tracepoints_ptrs) /* Tracepoints: pointer array */\ | ||
220 | VMLINUX_SYMBOL(__stop___tracepoints_ptrs) = .; \ | ||
223 | *(__markers_strings) /* Markers: strings */ \ | 221 | *(__markers_strings) /* Markers: strings */ \ |
224 | *(__tracepoints_strings)/* Tracepoints: strings */ \ | 222 | *(__tracepoints_strings)/* Tracepoints: strings */ \ |
225 | } \ | 223 | } \ |
@@ -482,6 +480,8 @@ | |||
482 | KERNEL_CTORS() \ | 480 | KERNEL_CTORS() \ |
483 | *(.init.rodata) \ | 481 | *(.init.rodata) \ |
484 | MCOUNT_REC() \ | 482 | MCOUNT_REC() \ |
483 | FTRACE_EVENTS() \ | ||
484 | TRACE_SYSCALLS() \ | ||
485 | DEV_DISCARD(init.rodata) \ | 485 | DEV_DISCARD(init.rodata) \ |
486 | CPU_DISCARD(init.rodata) \ | 486 | CPU_DISCARD(init.rodata) \ |
487 | MEM_DISCARD(init.rodata) \ | 487 | MEM_DISCARD(init.rodata) \ |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index a4694c610330..fe29aadb129d 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -1367,7 +1367,7 @@ extern int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq); | |||
1367 | extern u32 drm_vblank_count(struct drm_device *dev, int crtc); | 1367 | extern u32 drm_vblank_count(struct drm_device *dev, int crtc); |
1368 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, | 1368 | extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, |
1369 | struct timeval *vblanktime); | 1369 | struct timeval *vblanktime); |
1370 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); | 1370 | extern bool drm_handle_vblank(struct drm_device *dev, int crtc); |
1371 | extern int drm_vblank_get(struct drm_device *dev, int crtc); | 1371 | extern int drm_vblank_get(struct drm_device *dev, int crtc); |
1372 | extern void drm_vblank_put(struct drm_device *dev, int crtc); | 1372 | extern void drm_vblank_put(struct drm_device *dev, int crtc); |
1373 | extern void drm_vblank_off(struct drm_device *dev, int crtc); | 1373 | extern void drm_vblank_off(struct drm_device *dev, int crtc); |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index acd7fade160d..801be59f4f15 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -275,6 +275,7 @@ struct drm_pending_vblank_event; | |||
275 | 275 | ||
276 | /** | 276 | /** |
277 | * drm_crtc_funcs - control CRTCs for a given device | 277 | * drm_crtc_funcs - control CRTCs for a given device |
278 | * @reset: reset CRTC after state has been invalidate (e.g. resume) | ||
278 | * @dpms: control display power levels | 279 | * @dpms: control display power levels |
279 | * @save: save CRTC state | 280 | * @save: save CRTC state |
280 | * @resore: restore CRTC state | 281 | * @resore: restore CRTC state |
@@ -302,6 +303,8 @@ struct drm_crtc_funcs { | |||
302 | void (*save)(struct drm_crtc *crtc); /* suspend? */ | 303 | void (*save)(struct drm_crtc *crtc); /* suspend? */ |
303 | /* Restore CRTC state */ | 304 | /* Restore CRTC state */ |
304 | void (*restore)(struct drm_crtc *crtc); /* resume? */ | 305 | void (*restore)(struct drm_crtc *crtc); /* resume? */ |
306 | /* Reset CRTC state */ | ||
307 | void (*reset)(struct drm_crtc *crtc); | ||
305 | 308 | ||
306 | /* cursor controls */ | 309 | /* cursor controls */ |
307 | int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv, | 310 | int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv, |
@@ -379,6 +382,7 @@ struct drm_crtc { | |||
379 | * @dpms: set power state (see drm_crtc_funcs above) | 382 | * @dpms: set power state (see drm_crtc_funcs above) |
380 | * @save: save connector state | 383 | * @save: save connector state |
381 | * @restore: restore connector state | 384 | * @restore: restore connector state |
385 | * @reset: reset connector after state has been invalidate (e.g. resume) | ||
382 | * @mode_valid: is this mode valid on the given connector? | 386 | * @mode_valid: is this mode valid on the given connector? |
383 | * @mode_fixup: try to fixup proposed mode for this connector | 387 | * @mode_fixup: try to fixup proposed mode for this connector |
384 | * @mode_set: set this mode | 388 | * @mode_set: set this mode |
@@ -396,6 +400,7 @@ struct drm_connector_funcs { | |||
396 | void (*dpms)(struct drm_connector *connector, int mode); | 400 | void (*dpms)(struct drm_connector *connector, int mode); |
397 | void (*save)(struct drm_connector *connector); | 401 | void (*save)(struct drm_connector *connector); |
398 | void (*restore)(struct drm_connector *connector); | 402 | void (*restore)(struct drm_connector *connector); |
403 | void (*reset)(struct drm_connector *connector); | ||
399 | 404 | ||
400 | /* Check to see if anything is attached to the connector. | 405 | /* Check to see if anything is attached to the connector. |
401 | * @force is set to false whilst polling, true when checking the | 406 | * @force is set to false whilst polling, true when checking the |
@@ -413,6 +418,7 @@ struct drm_connector_funcs { | |||
413 | }; | 418 | }; |
414 | 419 | ||
415 | struct drm_encoder_funcs { | 420 | struct drm_encoder_funcs { |
421 | void (*reset)(struct drm_encoder *encoder); | ||
416 | void (*destroy)(struct drm_encoder *encoder); | 422 | void (*destroy)(struct drm_encoder *encoder); |
417 | }; | 423 | }; |
418 | 424 | ||
@@ -656,6 +662,7 @@ extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev, | |||
656 | struct drm_display_mode *mode); | 662 | struct drm_display_mode *mode); |
657 | extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode); | 663 | extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode); |
658 | extern void drm_mode_config_init(struct drm_device *dev); | 664 | extern void drm_mode_config_init(struct drm_device *dev); |
665 | extern void drm_mode_config_reset(struct drm_device *dev); | ||
659 | extern void drm_mode_config_cleanup(struct drm_device *dev); | 666 | extern void drm_mode_config_cleanup(struct drm_device *dev); |
660 | extern void drm_mode_set_name(struct drm_display_mode *mode); | 667 | extern void drm_mode_set_name(struct drm_display_mode *mode); |
661 | extern bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_mode *mode2); | 668 | extern bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_mode *mode2); |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index fe29ae328bd9..5ff1194dc2ea 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -28,7 +28,6 @@ | |||
28 | {0x1002, 0x4156, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \ | 28 | {0x1002, 0x4156, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \ |
29 | {0x1002, 0x4237, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP}, \ | 29 | {0x1002, 0x4237, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP}, \ |
30 | {0x1002, 0x4242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ | 30 | {0x1002, 0x4242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ |
31 | {0x1002, 0x4243, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \ | ||
32 | {0x1002, 0x4336, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ | 31 | {0x1002, 0x4336, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ |
33 | {0x1002, 0x4337, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ | 32 | {0x1002, 0x4337, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ |
34 | {0x1002, 0x4437, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ | 33 | {0x1002, 0x4437, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 2296d8b1931f..b0ada6f37dd6 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -1,5 +1,6 @@ | |||
1 | header-y += byteorder/ | 1 | header-y += byteorder/ |
2 | header-y += can/ | 2 | header-y += can/ |
3 | header-y += caif/ | ||
3 | header-y += dvb/ | 4 | header-y += dvb/ |
4 | header-y += hdlc/ | 5 | header-y += hdlc/ |
5 | header-y += isdn/ | 6 | header-y += isdn/ |
diff --git a/include/linux/caif/Kbuild b/include/linux/caif/Kbuild new file mode 100644 index 000000000000..a9cf250689dc --- /dev/null +++ b/include/linux/caif/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | header-y += caif_socket.h | ||
2 | header-y += if_caif.h | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 32b38cd829d3..bd3215940c37 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2555,9 +2555,12 @@ int proc_nr_inodes(struct ctl_table *table, int write, | |||
2555 | void __user *buffer, size_t *lenp, loff_t *ppos); | 2555 | void __user *buffer, size_t *lenp, loff_t *ppos); |
2556 | int __init get_filesystem_list(char *buf); | 2556 | int __init get_filesystem_list(char *buf); |
2557 | 2557 | ||
2558 | #define __FMODE_EXEC ((__force int) FMODE_EXEC) | ||
2559 | #define __FMODE_NONOTIFY ((__force int) FMODE_NONOTIFY) | ||
2560 | |||
2558 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) | 2561 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) |
2559 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ | 2562 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ |
2560 | (flag & FMODE_NONOTIFY))) | 2563 | (flag & __FMODE_NONOTIFY))) |
2561 | 2564 | ||
2562 | #endif /* __KERNEL__ */ | 2565 | #endif /* __KERNEL__ */ |
2563 | #endif /* _LINUX_FS_H */ | 2566 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index abde2527c699..80fcb53057bc 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -74,7 +74,8 @@ typedef void (*irq_flow_handler_t)(unsigned int irq, | |||
74 | 74 | ||
75 | #define IRQF_MODIFY_MASK \ | 75 | #define IRQF_MODIFY_MASK \ |
76 | (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ | 76 | (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ |
77 | IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL) | 77 | IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ |
78 | IRQ_PER_CPU) | ||
78 | 79 | ||
79 | #ifdef CONFIG_IRQ_PER_CPU | 80 | #ifdef CONFIG_IRQ_PER_CPU |
80 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) | 81 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) |
diff --git a/include/linux/module.h b/include/linux/module.h index e7c6385c6683..9bdf27c7615b 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -377,7 +377,7 @@ struct module | |||
377 | keeping pointers to this stuff */ | 377 | keeping pointers to this stuff */ |
378 | char *args; | 378 | char *args; |
379 | #ifdef CONFIG_TRACEPOINTS | 379 | #ifdef CONFIG_TRACEPOINTS |
380 | struct tracepoint *tracepoints; | 380 | struct tracepoint * const *tracepoints_ptrs; |
381 | unsigned int num_tracepoints; | 381 | unsigned int num_tracepoints; |
382 | #endif | 382 | #endif |
383 | #ifdef HAVE_JUMP_LABEL | 383 | #ifdef HAVE_JUMP_LABEL |
@@ -389,7 +389,7 @@ struct module | |||
389 | unsigned int num_trace_bprintk_fmt; | 389 | unsigned int num_trace_bprintk_fmt; |
390 | #endif | 390 | #endif |
391 | #ifdef CONFIG_EVENT_TRACING | 391 | #ifdef CONFIG_EVENT_TRACING |
392 | struct ftrace_event_call *trace_events; | 392 | struct ftrace_event_call **trace_events; |
393 | unsigned int num_trace_events; | 393 | unsigned int num_trace_events; |
394 | #endif | 394 | #endif |
395 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 395 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 0fa7a3a874c8..b21d567692b2 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -150,6 +150,7 @@ static inline int ip_mroute_opt(int opt) | |||
150 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, unsigned int); | 150 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, unsigned int); |
151 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 151 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
152 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); | 152 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); |
153 | extern int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); | ||
153 | extern int ip_mr_init(void); | 154 | extern int ip_mr_init(void); |
154 | #else | 155 | #else |
155 | static inline | 156 | static inline |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 6091ab77f388..9d2deb200f54 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -136,6 +136,7 @@ extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, unsigned int | |||
136 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 136 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
137 | extern int ip6_mr_input(struct sk_buff *skb); | 137 | extern int ip6_mr_input(struct sk_buff *skb); |
138 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); | 138 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); |
139 | extern int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); | ||
139 | extern int ip6_mr_init(void); | 140 | extern int ip6_mr_init(void); |
140 | extern void ip6_mr_cleanup(void); | 141 | extern void ip6_mr_cleanup(void); |
141 | #else | 142 | #else |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index fcb9884df618..a5930cb66145 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -182,6 +182,26 @@ static inline bool res_counter_check_under_limit(struct res_counter *cnt) | |||
182 | return ret; | 182 | return ret; |
183 | } | 183 | } |
184 | 184 | ||
185 | /** | ||
186 | * res_counter_check_margin - check if the counter allows charging | ||
187 | * @cnt: the resource counter to check | ||
188 | * @bytes: the number of bytes to check the remaining space against | ||
189 | * | ||
190 | * Returns a boolean value on whether the counter can be charged | ||
191 | * @bytes or whether this would exceed the limit. | ||
192 | */ | ||
193 | static inline bool res_counter_check_margin(struct res_counter *cnt, | ||
194 | unsigned long bytes) | ||
195 | { | ||
196 | bool ret; | ||
197 | unsigned long flags; | ||
198 | |||
199 | spin_lock_irqsave(&cnt->lock, flags); | ||
200 | ret = cnt->limit - cnt->usage >= bytes; | ||
201 | spin_unlock_irqrestore(&cnt->lock, flags); | ||
202 | return ret; | ||
203 | } | ||
204 | |||
185 | static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt) | 205 | static inline bool res_counter_check_under_soft_limit(struct res_counter *cnt) |
186 | { | 206 | { |
187 | bool ret; | 207 | bool ret; |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 18cd0684fc4e..98664db1be47 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -125,39 +125,37 @@ extern struct trace_event_functions enter_syscall_print_funcs; | |||
125 | extern struct trace_event_functions exit_syscall_print_funcs; | 125 | extern struct trace_event_functions exit_syscall_print_funcs; |
126 | 126 | ||
127 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 127 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
128 | static struct syscall_metadata \ | 128 | static struct syscall_metadata __syscall_meta_##sname; \ |
129 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ | ||
130 | static struct ftrace_event_call __used \ | 129 | static struct ftrace_event_call __used \ |
131 | __attribute__((__aligned__(4))) \ | ||
132 | __attribute__((section("_ftrace_events"))) \ | ||
133 | event_enter_##sname = { \ | 130 | event_enter_##sname = { \ |
134 | .name = "sys_enter"#sname, \ | 131 | .name = "sys_enter"#sname, \ |
135 | .class = &event_class_syscall_enter, \ | 132 | .class = &event_class_syscall_enter, \ |
136 | .event.funcs = &enter_syscall_print_funcs, \ | 133 | .event.funcs = &enter_syscall_print_funcs, \ |
137 | .data = (void *)&__syscall_meta_##sname,\ | 134 | .data = (void *)&__syscall_meta_##sname,\ |
138 | }; \ | 135 | }; \ |
136 | static struct ftrace_event_call __used \ | ||
137 | __attribute__((section("_ftrace_events"))) \ | ||
138 | *__event_enter_##sname = &event_enter_##sname; \ | ||
139 | __TRACE_EVENT_FLAGS(enter_##sname, TRACE_EVENT_FL_CAP_ANY) | 139 | __TRACE_EVENT_FLAGS(enter_##sname, TRACE_EVENT_FL_CAP_ANY) |
140 | 140 | ||
141 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 141 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
142 | static struct syscall_metadata \ | 142 | static struct syscall_metadata __syscall_meta_##sname; \ |
143 | __attribute__((__aligned__(4))) __syscall_meta_##sname; \ | ||
144 | static struct ftrace_event_call __used \ | 143 | static struct ftrace_event_call __used \ |
145 | __attribute__((__aligned__(4))) \ | ||
146 | __attribute__((section("_ftrace_events"))) \ | ||
147 | event_exit_##sname = { \ | 144 | event_exit_##sname = { \ |
148 | .name = "sys_exit"#sname, \ | 145 | .name = "sys_exit"#sname, \ |
149 | .class = &event_class_syscall_exit, \ | 146 | .class = &event_class_syscall_exit, \ |
150 | .event.funcs = &exit_syscall_print_funcs, \ | 147 | .event.funcs = &exit_syscall_print_funcs, \ |
151 | .data = (void *)&__syscall_meta_##sname,\ | 148 | .data = (void *)&__syscall_meta_##sname,\ |
152 | }; \ | 149 | }; \ |
150 | static struct ftrace_event_call __used \ | ||
151 | __attribute__((section("_ftrace_events"))) \ | ||
152 | *__event_exit_##sname = &event_exit_##sname; \ | ||
153 | __TRACE_EVENT_FLAGS(exit_##sname, TRACE_EVENT_FL_CAP_ANY) | 153 | __TRACE_EVENT_FLAGS(exit_##sname, TRACE_EVENT_FL_CAP_ANY) |
154 | 154 | ||
155 | #define SYSCALL_METADATA(sname, nb) \ | 155 | #define SYSCALL_METADATA(sname, nb) \ |
156 | SYSCALL_TRACE_ENTER_EVENT(sname); \ | 156 | SYSCALL_TRACE_ENTER_EVENT(sname); \ |
157 | SYSCALL_TRACE_EXIT_EVENT(sname); \ | 157 | SYSCALL_TRACE_EXIT_EVENT(sname); \ |
158 | static struct syscall_metadata __used \ | 158 | static struct syscall_metadata __used \ |
159 | __attribute__((__aligned__(4))) \ | ||
160 | __attribute__((section("__syscalls_metadata"))) \ | ||
161 | __syscall_meta_##sname = { \ | 159 | __syscall_meta_##sname = { \ |
162 | .name = "sys"#sname, \ | 160 | .name = "sys"#sname, \ |
163 | .nb_args = nb, \ | 161 | .nb_args = nb, \ |
@@ -166,14 +164,15 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
166 | .enter_event = &event_enter_##sname, \ | 164 | .enter_event = &event_enter_##sname, \ |
167 | .exit_event = &event_exit_##sname, \ | 165 | .exit_event = &event_exit_##sname, \ |
168 | .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ | 166 | .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ |
169 | }; | 167 | }; \ |
168 | static struct syscall_metadata __used \ | ||
169 | __attribute__((section("__syscalls_metadata"))) \ | ||
170 | *__p_syscall_meta_##sname = &__syscall_meta_##sname; | ||
170 | 171 | ||
171 | #define SYSCALL_DEFINE0(sname) \ | 172 | #define SYSCALL_DEFINE0(sname) \ |
172 | SYSCALL_TRACE_ENTER_EVENT(_##sname); \ | 173 | SYSCALL_TRACE_ENTER_EVENT(_##sname); \ |
173 | SYSCALL_TRACE_EXIT_EVENT(_##sname); \ | 174 | SYSCALL_TRACE_EXIT_EVENT(_##sname); \ |
174 | static struct syscall_metadata __used \ | 175 | static struct syscall_metadata __used \ |
175 | __attribute__((__aligned__(4))) \ | ||
176 | __attribute__((section("__syscalls_metadata"))) \ | ||
177 | __syscall_meta__##sname = { \ | 176 | __syscall_meta__##sname = { \ |
178 | .name = "sys_"#sname, \ | 177 | .name = "sys_"#sname, \ |
179 | .nb_args = 0, \ | 178 | .nb_args = 0, \ |
@@ -181,6 +180,9 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
181 | .exit_event = &event_exit__##sname, \ | 180 | .exit_event = &event_exit__##sname, \ |
182 | .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ | 181 | .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ |
183 | }; \ | 182 | }; \ |
183 | static struct syscall_metadata __used \ | ||
184 | __attribute__((section("__syscalls_metadata"))) \ | ||
185 | *__p_syscall_meta_##sname = &__syscall_meta__##sname; \ | ||
184 | asmlinkage long sys_##sname(void) | 186 | asmlinkage long sys_##sname(void) |
185 | #else | 187 | #else |
186 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) | 188 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index c6814616653b..97c84a58efb8 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -33,12 +33,7 @@ struct tracepoint { | |||
33 | void (*regfunc)(void); | 33 | void (*regfunc)(void); |
34 | void (*unregfunc)(void); | 34 | void (*unregfunc)(void); |
35 | struct tracepoint_func __rcu *funcs; | 35 | struct tracepoint_func __rcu *funcs; |
36 | } __attribute__((aligned(32))); /* | 36 | }; |
37 | * Aligned on 32 bytes because it is | ||
38 | * globally visible and gcc happily | ||
39 | * align these on the structure size. | ||
40 | * Keep in sync with vmlinux.lds.h. | ||
41 | */ | ||
42 | 37 | ||
43 | /* | 38 | /* |
44 | * Connect a probe to a tracepoint. | 39 | * Connect a probe to a tracepoint. |
@@ -61,15 +56,15 @@ extern void tracepoint_probe_update_all(void); | |||
61 | 56 | ||
62 | struct tracepoint_iter { | 57 | struct tracepoint_iter { |
63 | struct module *module; | 58 | struct module *module; |
64 | struct tracepoint *tracepoint; | 59 | struct tracepoint * const *tracepoint; |
65 | }; | 60 | }; |
66 | 61 | ||
67 | extern void tracepoint_iter_start(struct tracepoint_iter *iter); | 62 | extern void tracepoint_iter_start(struct tracepoint_iter *iter); |
68 | extern void tracepoint_iter_next(struct tracepoint_iter *iter); | 63 | extern void tracepoint_iter_next(struct tracepoint_iter *iter); |
69 | extern void tracepoint_iter_stop(struct tracepoint_iter *iter); | 64 | extern void tracepoint_iter_stop(struct tracepoint_iter *iter); |
70 | extern void tracepoint_iter_reset(struct tracepoint_iter *iter); | 65 | extern void tracepoint_iter_reset(struct tracepoint_iter *iter); |
71 | extern int tracepoint_get_iter_range(struct tracepoint **tracepoint, | 66 | extern int tracepoint_get_iter_range(struct tracepoint * const **tracepoint, |
72 | struct tracepoint *begin, struct tracepoint *end); | 67 | struct tracepoint * const *begin, struct tracepoint * const *end); |
73 | 68 | ||
74 | /* | 69 | /* |
75 | * tracepoint_synchronize_unregister must be called between the last tracepoint | 70 | * tracepoint_synchronize_unregister must be called between the last tracepoint |
@@ -84,11 +79,13 @@ static inline void tracepoint_synchronize_unregister(void) | |||
84 | #define PARAMS(args...) args | 79 | #define PARAMS(args...) args |
85 | 80 | ||
86 | #ifdef CONFIG_TRACEPOINTS | 81 | #ifdef CONFIG_TRACEPOINTS |
87 | extern void tracepoint_update_probe_range(struct tracepoint *begin, | 82 | extern |
88 | struct tracepoint *end); | 83 | void tracepoint_update_probe_range(struct tracepoint * const *begin, |
84 | struct tracepoint * const *end); | ||
89 | #else | 85 | #else |
90 | static inline void tracepoint_update_probe_range(struct tracepoint *begin, | 86 | static inline |
91 | struct tracepoint *end) | 87 | void tracepoint_update_probe_range(struct tracepoint * const *begin, |
88 | struct tracepoint * const *end) | ||
92 | { } | 89 | { } |
93 | #endif /* CONFIG_TRACEPOINTS */ | 90 | #endif /* CONFIG_TRACEPOINTS */ |
94 | 91 | ||
@@ -174,12 +171,20 @@ do_trace: \ | |||
174 | { \ | 171 | { \ |
175 | } | 172 | } |
176 | 173 | ||
174 | /* | ||
175 | * We have no guarantee that gcc and the linker won't up-align the tracepoint | ||
176 | * structures, so we create an array of pointers that will be used for iteration | ||
177 | * on the tracepoints. | ||
178 | */ | ||
177 | #define DEFINE_TRACE_FN(name, reg, unreg) \ | 179 | #define DEFINE_TRACE_FN(name, reg, unreg) \ |
178 | static const char __tpstrtab_##name[] \ | 180 | static const char __tpstrtab_##name[] \ |
179 | __attribute__((section("__tracepoints_strings"))) = #name; \ | 181 | __attribute__((section("__tracepoints_strings"))) = #name; \ |
180 | struct tracepoint __tracepoint_##name \ | 182 | struct tracepoint __tracepoint_##name \ |
181 | __attribute__((section("__tracepoints"), aligned(32))) = \ | 183 | __attribute__((section("__tracepoints"))) = \ |
182 | { __tpstrtab_##name, 0, reg, unreg, NULL } | 184 | { __tpstrtab_##name, 0, reg, unreg, NULL }; \ |
185 | static struct tracepoint * const __tracepoint_ptr_##name __used \ | ||
186 | __attribute__((section("__tracepoints_ptrs"))) = \ | ||
187 | &__tracepoint_##name; | ||
183 | 188 | ||
184 | #define DEFINE_TRACE(name) \ | 189 | #define DEFINE_TRACE(name) \ |
185 | DEFINE_TRACE_FN(name, NULL, NULL); | 190 | DEFINE_TRACE_FN(name, NULL, NULL); |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 8a64b811a39a..b4c7c1cbcf40 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -195,7 +195,8 @@ static inline int genlmsg_end(struct sk_buff *skb, void *hdr) | |||
195 | */ | 195 | */ |
196 | static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr) | 196 | static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr) |
197 | { | 197 | { |
198 | nlmsg_cancel(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN); | 198 | if (hdr) |
199 | nlmsg_cancel(skb, hdr - GENL_HDRLEN - NLMSG_HDRLEN); | ||
199 | } | 200 | } |
200 | 201 | ||
201 | /** | 202 | /** |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 96ba5f7dcab6..349cefedc9f3 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -77,9 +77,6 @@ nf_conntrack_event_cache(enum ip_conntrack_events event, struct nf_conn *ct) | |||
77 | if (e == NULL) | 77 | if (e == NULL) |
78 | return; | 78 | return; |
79 | 79 | ||
80 | if (!(e->ctmask & (1 << event))) | ||
81 | return; | ||
82 | |||
83 | set_bit(event, &e->cache); | 80 | set_bit(event, &e->cache); |
84 | } | 81 | } |
85 | 82 | ||
diff --git a/include/net/sock.h b/include/net/sock.h index d884d268c704..bc1cf7d88ccb 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -753,6 +753,8 @@ struct proto { | |||
753 | int level, | 753 | int level, |
754 | int optname, char __user *optval, | 754 | int optname, char __user *optval, |
755 | int __user *option); | 755 | int __user *option); |
756 | int (*compat_ioctl)(struct sock *sk, | ||
757 | unsigned int cmd, unsigned long arg); | ||
756 | #endif | 758 | #endif |
757 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, | 759 | int (*sendmsg)(struct kiocb *iocb, struct sock *sk, |
758 | struct msghdr *msg, size_t len); | 760 | struct msghdr *msg, size_t len); |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 648d23358038..b76d4006e36d 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #define _SCSI_SCSI_H | 9 | #define _SCSI_SCSI_H |
10 | 10 | ||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/scatterlist.h> | ||
12 | 13 | ||
13 | struct scsi_cmnd; | 14 | struct scsi_cmnd; |
14 | 15 | ||
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index e16610c208c9..3e68366d485a 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -446,14 +446,16 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
446 | * .reg = ftrace_event_reg, | 446 | * .reg = ftrace_event_reg, |
447 | * }; | 447 | * }; |
448 | * | 448 | * |
449 | * static struct ftrace_event_call __used | 449 | * static struct ftrace_event_call event_<call> = { |
450 | * __attribute__((__aligned__(4))) | ||
451 | * __attribute__((section("_ftrace_events"))) event_<call> = { | ||
452 | * .name = "<call>", | 450 | * .name = "<call>", |
453 | * .class = event_class_<template>, | 451 | * .class = event_class_<template>, |
454 | * .event = &ftrace_event_type_<call>, | 452 | * .event = &ftrace_event_type_<call>, |
455 | * .print_fmt = print_fmt_<call>, | 453 | * .print_fmt = print_fmt_<call>, |
456 | * }; | 454 | * }; |
455 | * // its only safe to use pointers when doing linker tricks to | ||
456 | * // create an array. | ||
457 | * static struct ftrace_event_call __used | ||
458 | * __attribute__((section("_ftrace_events"))) *__event_<call> = &event_<call>; | ||
457 | * | 459 | * |
458 | */ | 460 | */ |
459 | 461 | ||
@@ -579,28 +581,28 @@ static struct ftrace_event_class __used event_class_##call = { \ | |||
579 | #undef DEFINE_EVENT | 581 | #undef DEFINE_EVENT |
580 | #define DEFINE_EVENT(template, call, proto, args) \ | 582 | #define DEFINE_EVENT(template, call, proto, args) \ |
581 | \ | 583 | \ |
582 | static struct ftrace_event_call __used \ | 584 | static struct ftrace_event_call __used event_##call = { \ |
583 | __attribute__((__aligned__(4))) \ | ||
584 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
585 | .name = #call, \ | 585 | .name = #call, \ |
586 | .class = &event_class_##template, \ | 586 | .class = &event_class_##template, \ |
587 | .event.funcs = &ftrace_event_type_funcs_##template, \ | 587 | .event.funcs = &ftrace_event_type_funcs_##template, \ |
588 | .print_fmt = print_fmt_##template, \ | 588 | .print_fmt = print_fmt_##template, \ |
589 | }; | 589 | }; \ |
590 | static struct ftrace_event_call __used \ | ||
591 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call | ||
590 | 592 | ||
591 | #undef DEFINE_EVENT_PRINT | 593 | #undef DEFINE_EVENT_PRINT |
592 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | 594 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ |
593 | \ | 595 | \ |
594 | static const char print_fmt_##call[] = print; \ | 596 | static const char print_fmt_##call[] = print; \ |
595 | \ | 597 | \ |
596 | static struct ftrace_event_call __used \ | 598 | static struct ftrace_event_call __used event_##call = { \ |
597 | __attribute__((__aligned__(4))) \ | ||
598 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
599 | .name = #call, \ | 599 | .name = #call, \ |
600 | .class = &event_class_##template, \ | 600 | .class = &event_class_##template, \ |
601 | .event.funcs = &ftrace_event_type_funcs_##call, \ | 601 | .event.funcs = &ftrace_event_type_funcs_##call, \ |
602 | .print_fmt = print_fmt_##call, \ | 602 | .print_fmt = print_fmt_##call, \ |
603 | } | 603 | }; \ |
604 | static struct ftrace_event_call __used \ | ||
605 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call | ||
604 | 606 | ||
605 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 607 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
606 | 608 | ||
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c index 1d2541940480..441fd629ff04 100644 --- a/kernel/irq/migration.c +++ b/kernel/irq/migration.c | |||
@@ -56,6 +56,7 @@ void move_masked_irq(int irq) | |||
56 | void move_native_irq(int irq) | 56 | void move_native_irq(int irq) |
57 | { | 57 | { |
58 | struct irq_desc *desc = irq_to_desc(irq); | 58 | struct irq_desc *desc = irq_to_desc(irq); |
59 | bool masked; | ||
59 | 60 | ||
60 | if (likely(!(desc->status & IRQ_MOVE_PENDING))) | 61 | if (likely(!(desc->status & IRQ_MOVE_PENDING))) |
61 | return; | 62 | return; |
@@ -63,8 +64,15 @@ void move_native_irq(int irq) | |||
63 | if (unlikely(desc->status & IRQ_DISABLED)) | 64 | if (unlikely(desc->status & IRQ_DISABLED)) |
64 | return; | 65 | return; |
65 | 66 | ||
66 | desc->irq_data.chip->irq_mask(&desc->irq_data); | 67 | /* |
68 | * Be careful vs. already masked interrupts. If this is a | ||
69 | * threaded interrupt with ONESHOT set, we can end up with an | ||
70 | * interrupt storm. | ||
71 | */ | ||
72 | masked = desc->status & IRQ_MASKED; | ||
73 | if (!masked) | ||
74 | desc->irq_data.chip->irq_mask(&desc->irq_data); | ||
67 | move_masked_irq(irq); | 75 | move_masked_irq(irq); |
68 | desc->irq_data.chip->irq_unmask(&desc->irq_data); | 76 | if (!masked) |
77 | desc->irq_data.chip->irq_unmask(&desc->irq_data); | ||
69 | } | 78 | } |
70 | |||
diff --git a/kernel/module.c b/kernel/module.c index 34e00b708fad..efa290ea94bf 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2460,9 +2460,9 @@ static void find_module_sections(struct module *mod, struct load_info *info) | |||
2460 | #endif | 2460 | #endif |
2461 | 2461 | ||
2462 | #ifdef CONFIG_TRACEPOINTS | 2462 | #ifdef CONFIG_TRACEPOINTS |
2463 | mod->tracepoints = section_objs(info, "__tracepoints", | 2463 | mod->tracepoints_ptrs = section_objs(info, "__tracepoints_ptrs", |
2464 | sizeof(*mod->tracepoints), | 2464 | sizeof(*mod->tracepoints_ptrs), |
2465 | &mod->num_tracepoints); | 2465 | &mod->num_tracepoints); |
2466 | #endif | 2466 | #endif |
2467 | #ifdef HAVE_JUMP_LABEL | 2467 | #ifdef HAVE_JUMP_LABEL |
2468 | mod->jump_entries = section_objs(info, "__jump_table", | 2468 | mod->jump_entries = section_objs(info, "__jump_table", |
@@ -3393,7 +3393,7 @@ void module_layout(struct module *mod, | |||
3393 | struct modversion_info *ver, | 3393 | struct modversion_info *ver, |
3394 | struct kernel_param *kp, | 3394 | struct kernel_param *kp, |
3395 | struct kernel_symbol *ks, | 3395 | struct kernel_symbol *ks, |
3396 | struct tracepoint *tp) | 3396 | struct tracepoint * const *tp) |
3397 | { | 3397 | { |
3398 | } | 3398 | } |
3399 | EXPORT_SYMBOL(module_layout); | 3399 | EXPORT_SYMBOL(module_layout); |
@@ -3407,8 +3407,8 @@ void module_update_tracepoints(void) | |||
3407 | mutex_lock(&module_mutex); | 3407 | mutex_lock(&module_mutex); |
3408 | list_for_each_entry(mod, &modules, list) | 3408 | list_for_each_entry(mod, &modules, list) |
3409 | if (!mod->taints) | 3409 | if (!mod->taints) |
3410 | tracepoint_update_probe_range(mod->tracepoints, | 3410 | tracepoint_update_probe_range(mod->tracepoints_ptrs, |
3411 | mod->tracepoints + mod->num_tracepoints); | 3411 | mod->tracepoints_ptrs + mod->num_tracepoints); |
3412 | mutex_unlock(&module_mutex); | 3412 | mutex_unlock(&module_mutex); |
3413 | } | 3413 | } |
3414 | 3414 | ||
@@ -3432,8 +3432,8 @@ int module_get_iter_tracepoints(struct tracepoint_iter *iter) | |||
3432 | else if (iter_mod > iter->module) | 3432 | else if (iter_mod > iter->module) |
3433 | iter->tracepoint = NULL; | 3433 | iter->tracepoint = NULL; |
3434 | found = tracepoint_get_iter_range(&iter->tracepoint, | 3434 | found = tracepoint_get_iter_range(&iter->tracepoint, |
3435 | iter_mod->tracepoints, | 3435 | iter_mod->tracepoints_ptrs, |
3436 | iter_mod->tracepoints | 3436 | iter_mod->tracepoints_ptrs |
3437 | + iter_mod->num_tracepoints); | 3437 | + iter_mod->num_tracepoints); |
3438 | if (found) { | 3438 | if (found) { |
3439 | iter->module = iter_mod; | 3439 | iter->module = iter_mod; |
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 7d3faa25e136..a353a4d6d00d 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -1966,11 +1966,12 @@ static void __perf_event_read(void *info) | |||
1966 | return; | 1966 | return; |
1967 | 1967 | ||
1968 | raw_spin_lock(&ctx->lock); | 1968 | raw_spin_lock(&ctx->lock); |
1969 | update_context_time(ctx); | 1969 | if (ctx->is_active) |
1970 | update_context_time(ctx); | ||
1970 | update_event_times(event); | 1971 | update_event_times(event); |
1972 | if (event->state == PERF_EVENT_STATE_ACTIVE) | ||
1973 | event->pmu->read(event); | ||
1971 | raw_spin_unlock(&ctx->lock); | 1974 | raw_spin_unlock(&ctx->lock); |
1972 | |||
1973 | event->pmu->read(event); | ||
1974 | } | 1975 | } |
1975 | 1976 | ||
1976 | static inline u64 perf_event_count(struct perf_event *event) | 1977 | static inline u64 perf_event_count(struct perf_event *event) |
@@ -2064,8 +2065,7 @@ static int alloc_callchain_buffers(void) | |||
2064 | * accessed from NMI. Use a temporary manual per cpu allocation | 2065 | * accessed from NMI. Use a temporary manual per cpu allocation |
2065 | * until that gets sorted out. | 2066 | * until that gets sorted out. |
2066 | */ | 2067 | */ |
2067 | size = sizeof(*entries) + sizeof(struct perf_callchain_entry *) * | 2068 | size = offsetof(struct callchain_cpus_entries, cpu_entries[nr_cpu_ids]); |
2068 | num_possible_cpus(); | ||
2069 | 2069 | ||
2070 | entries = kzalloc(size, GFP_KERNEL); | 2070 | entries = kzalloc(size, GFP_KERNEL); |
2071 | if (!entries) | 2071 | if (!entries) |
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index c914ec747ca6..ad6267714c84 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -625,7 +625,7 @@ static void update_curr_rt(struct rq *rq) | |||
625 | struct rt_rq *rt_rq = rt_rq_of_se(rt_se); | 625 | struct rt_rq *rt_rq = rt_rq_of_se(rt_se); |
626 | u64 delta_exec; | 626 | u64 delta_exec; |
627 | 627 | ||
628 | if (!task_has_rt_policy(curr)) | 628 | if (curr->sched_class != &rt_sched_class) |
629 | return; | 629 | return; |
630 | 630 | ||
631 | delta_exec = rq->clock_task - curr->se.exec_start; | 631 | delta_exec = rq->clock_task - curr->se.exec_start; |
diff --git a/kernel/timer.c b/kernel/timer.c index 43ca9936f2d0..d53ce66daea0 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -969,10 +969,14 @@ EXPORT_SYMBOL(try_to_del_timer_sync); | |||
969 | int del_timer_sync(struct timer_list *timer) | 969 | int del_timer_sync(struct timer_list *timer) |
970 | { | 970 | { |
971 | #ifdef CONFIG_LOCKDEP | 971 | #ifdef CONFIG_LOCKDEP |
972 | unsigned long flags; | ||
973 | |||
974 | raw_local_irq_save(flags); | ||
972 | local_bh_disable(); | 975 | local_bh_disable(); |
973 | lock_map_acquire(&timer->lockdep_map); | 976 | lock_map_acquire(&timer->lockdep_map); |
974 | lock_map_release(&timer->lockdep_map); | 977 | lock_map_release(&timer->lockdep_map); |
975 | local_bh_enable(); | 978 | _local_bh_enable(); |
979 | raw_local_irq_restore(flags); | ||
976 | #endif | 980 | #endif |
977 | /* | 981 | /* |
978 | * don't use it in hardirq context, because it | 982 | * don't use it in hardirq context, because it |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 35fde09b81de..5f499e0438a4 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -1284,7 +1284,7 @@ trace_create_file_ops(struct module *mod) | |||
1284 | static void trace_module_add_events(struct module *mod) | 1284 | static void trace_module_add_events(struct module *mod) |
1285 | { | 1285 | { |
1286 | struct ftrace_module_file_ops *file_ops = NULL; | 1286 | struct ftrace_module_file_ops *file_ops = NULL; |
1287 | struct ftrace_event_call *call, *start, *end; | 1287 | struct ftrace_event_call **call, **start, **end; |
1288 | 1288 | ||
1289 | start = mod->trace_events; | 1289 | start = mod->trace_events; |
1290 | end = mod->trace_events + mod->num_trace_events; | 1290 | end = mod->trace_events + mod->num_trace_events; |
@@ -1297,7 +1297,7 @@ static void trace_module_add_events(struct module *mod) | |||
1297 | return; | 1297 | return; |
1298 | 1298 | ||
1299 | for_each_event(call, start, end) { | 1299 | for_each_event(call, start, end) { |
1300 | __trace_add_event_call(call, mod, | 1300 | __trace_add_event_call(*call, mod, |
1301 | &file_ops->id, &file_ops->enable, | 1301 | &file_ops->id, &file_ops->enable, |
1302 | &file_ops->filter, &file_ops->format); | 1302 | &file_ops->filter, &file_ops->format); |
1303 | } | 1303 | } |
@@ -1367,8 +1367,8 @@ static struct notifier_block trace_module_nb = { | |||
1367 | .priority = 0, | 1367 | .priority = 0, |
1368 | }; | 1368 | }; |
1369 | 1369 | ||
1370 | extern struct ftrace_event_call __start_ftrace_events[]; | 1370 | extern struct ftrace_event_call *__start_ftrace_events[]; |
1371 | extern struct ftrace_event_call __stop_ftrace_events[]; | 1371 | extern struct ftrace_event_call *__stop_ftrace_events[]; |
1372 | 1372 | ||
1373 | static char bootup_event_buf[COMMAND_LINE_SIZE] __initdata; | 1373 | static char bootup_event_buf[COMMAND_LINE_SIZE] __initdata; |
1374 | 1374 | ||
@@ -1384,7 +1384,7 @@ __setup("trace_event=", setup_trace_event); | |||
1384 | 1384 | ||
1385 | static __init int event_trace_init(void) | 1385 | static __init int event_trace_init(void) |
1386 | { | 1386 | { |
1387 | struct ftrace_event_call *call; | 1387 | struct ftrace_event_call **call; |
1388 | struct dentry *d_tracer; | 1388 | struct dentry *d_tracer; |
1389 | struct dentry *entry; | 1389 | struct dentry *entry; |
1390 | struct dentry *d_events; | 1390 | struct dentry *d_events; |
@@ -1430,7 +1430,7 @@ static __init int event_trace_init(void) | |||
1430 | pr_warning("tracing: Failed to allocate common fields"); | 1430 | pr_warning("tracing: Failed to allocate common fields"); |
1431 | 1431 | ||
1432 | for_each_event(call, __start_ftrace_events, __stop_ftrace_events) { | 1432 | for_each_event(call, __start_ftrace_events, __stop_ftrace_events) { |
1433 | __trace_add_event_call(call, NULL, &ftrace_event_id_fops, | 1433 | __trace_add_event_call(*call, NULL, &ftrace_event_id_fops, |
1434 | &ftrace_enable_fops, | 1434 | &ftrace_enable_fops, |
1435 | &ftrace_event_filter_fops, | 1435 | &ftrace_event_filter_fops, |
1436 | &ftrace_event_format_fops); | 1436 | &ftrace_event_format_fops); |
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 4b74d71705c0..bbeec31e0ae3 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
@@ -161,13 +161,13 @@ struct ftrace_event_class event_class_ftrace_##call = { \ | |||
161 | .fields = LIST_HEAD_INIT(event_class_ftrace_##call.fields),\ | 161 | .fields = LIST_HEAD_INIT(event_class_ftrace_##call.fields),\ |
162 | }; \ | 162 | }; \ |
163 | \ | 163 | \ |
164 | struct ftrace_event_call __used \ | 164 | struct ftrace_event_call __used event_##call = { \ |
165 | __attribute__((__aligned__(4))) \ | ||
166 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
167 | .name = #call, \ | 165 | .name = #call, \ |
168 | .event.type = etype, \ | 166 | .event.type = etype, \ |
169 | .class = &event_class_ftrace_##call, \ | 167 | .class = &event_class_ftrace_##call, \ |
170 | .print_fmt = print, \ | 168 | .print_fmt = print, \ |
171 | }; \ | 169 | }; \ |
170 | struct ftrace_event_call __used \ | ||
171 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call; | ||
172 | 172 | ||
173 | #include "trace_entries.h" | 173 | #include "trace_entries.h" |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index b706529b4fc7..5c9fe08d2093 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -55,20 +55,21 @@ struct ftrace_event_class event_class_syscall_exit = { | |||
55 | .raw_init = init_syscall_trace, | 55 | .raw_init = init_syscall_trace, |
56 | }; | 56 | }; |
57 | 57 | ||
58 | extern unsigned long __start_syscalls_metadata[]; | 58 | extern struct syscall_metadata *__start_syscalls_metadata[]; |
59 | extern unsigned long __stop_syscalls_metadata[]; | 59 | extern struct syscall_metadata *__stop_syscalls_metadata[]; |
60 | 60 | ||
61 | static struct syscall_metadata **syscalls_metadata; | 61 | static struct syscall_metadata **syscalls_metadata; |
62 | 62 | ||
63 | static struct syscall_metadata *find_syscall_meta(unsigned long syscall) | 63 | static __init struct syscall_metadata * |
64 | find_syscall_meta(unsigned long syscall) | ||
64 | { | 65 | { |
65 | struct syscall_metadata *start; | 66 | struct syscall_metadata **start; |
66 | struct syscall_metadata *stop; | 67 | struct syscall_metadata **stop; |
67 | char str[KSYM_SYMBOL_LEN]; | 68 | char str[KSYM_SYMBOL_LEN]; |
68 | 69 | ||
69 | 70 | ||
70 | start = (struct syscall_metadata *)__start_syscalls_metadata; | 71 | start = __start_syscalls_metadata; |
71 | stop = (struct syscall_metadata *)__stop_syscalls_metadata; | 72 | stop = __stop_syscalls_metadata; |
72 | kallsyms_lookup(syscall, NULL, NULL, NULL, str); | 73 | kallsyms_lookup(syscall, NULL, NULL, NULL, str); |
73 | 74 | ||
74 | for ( ; start < stop; start++) { | 75 | for ( ; start < stop; start++) { |
@@ -78,8 +79,8 @@ static struct syscall_metadata *find_syscall_meta(unsigned long syscall) | |||
78 | * with "SyS" instead of "sys", leading to an unwanted | 79 | * with "SyS" instead of "sys", leading to an unwanted |
79 | * mismatch. | 80 | * mismatch. |
80 | */ | 81 | */ |
81 | if (start->name && !strcmp(start->name + 3, str + 3)) | 82 | if ((*start)->name && !strcmp((*start)->name + 3, str + 3)) |
82 | return start; | 83 | return *start; |
83 | } | 84 | } |
84 | return NULL; | 85 | return NULL; |
85 | } | 86 | } |
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index e95ee7f31d43..68187af4889e 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c | |||
@@ -27,8 +27,8 @@ | |||
27 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
28 | #include <linux/jump_label.h> | 28 | #include <linux/jump_label.h> |
29 | 29 | ||
30 | extern struct tracepoint __start___tracepoints[]; | 30 | extern struct tracepoint * const __start___tracepoints_ptrs[]; |
31 | extern struct tracepoint __stop___tracepoints[]; | 31 | extern struct tracepoint * const __stop___tracepoints_ptrs[]; |
32 | 32 | ||
33 | /* Set to 1 to enable tracepoint debug output */ | 33 | /* Set to 1 to enable tracepoint debug output */ |
34 | static const int tracepoint_debug; | 34 | static const int tracepoint_debug; |
@@ -298,10 +298,10 @@ static void disable_tracepoint(struct tracepoint *elem) | |||
298 | * | 298 | * |
299 | * Updates the probe callback corresponding to a range of tracepoints. | 299 | * Updates the probe callback corresponding to a range of tracepoints. |
300 | */ | 300 | */ |
301 | void | 301 | void tracepoint_update_probe_range(struct tracepoint * const *begin, |
302 | tracepoint_update_probe_range(struct tracepoint *begin, struct tracepoint *end) | 302 | struct tracepoint * const *end) |
303 | { | 303 | { |
304 | struct tracepoint *iter; | 304 | struct tracepoint * const *iter; |
305 | struct tracepoint_entry *mark_entry; | 305 | struct tracepoint_entry *mark_entry; |
306 | 306 | ||
307 | if (!begin) | 307 | if (!begin) |
@@ -309,12 +309,12 @@ tracepoint_update_probe_range(struct tracepoint *begin, struct tracepoint *end) | |||
309 | 309 | ||
310 | mutex_lock(&tracepoints_mutex); | 310 | mutex_lock(&tracepoints_mutex); |
311 | for (iter = begin; iter < end; iter++) { | 311 | for (iter = begin; iter < end; iter++) { |
312 | mark_entry = get_tracepoint(iter->name); | 312 | mark_entry = get_tracepoint((*iter)->name); |
313 | if (mark_entry) { | 313 | if (mark_entry) { |
314 | set_tracepoint(&mark_entry, iter, | 314 | set_tracepoint(&mark_entry, *iter, |
315 | !!mark_entry->refcount); | 315 | !!mark_entry->refcount); |
316 | } else { | 316 | } else { |
317 | disable_tracepoint(iter); | 317 | disable_tracepoint(*iter); |
318 | } | 318 | } |
319 | } | 319 | } |
320 | mutex_unlock(&tracepoints_mutex); | 320 | mutex_unlock(&tracepoints_mutex); |
@@ -326,8 +326,8 @@ tracepoint_update_probe_range(struct tracepoint *begin, struct tracepoint *end) | |||
326 | static void tracepoint_update_probes(void) | 326 | static void tracepoint_update_probes(void) |
327 | { | 327 | { |
328 | /* Core kernel tracepoints */ | 328 | /* Core kernel tracepoints */ |
329 | tracepoint_update_probe_range(__start___tracepoints, | 329 | tracepoint_update_probe_range(__start___tracepoints_ptrs, |
330 | __stop___tracepoints); | 330 | __stop___tracepoints_ptrs); |
331 | /* tracepoints in modules. */ | 331 | /* tracepoints in modules. */ |
332 | module_update_tracepoints(); | 332 | module_update_tracepoints(); |
333 | } | 333 | } |
@@ -514,8 +514,8 @@ EXPORT_SYMBOL_GPL(tracepoint_probe_update_all); | |||
514 | * Will return the first tracepoint in the range if the input tracepoint is | 514 | * Will return the first tracepoint in the range if the input tracepoint is |
515 | * NULL. | 515 | * NULL. |
516 | */ | 516 | */ |
517 | int tracepoint_get_iter_range(struct tracepoint **tracepoint, | 517 | int tracepoint_get_iter_range(struct tracepoint * const **tracepoint, |
518 | struct tracepoint *begin, struct tracepoint *end) | 518 | struct tracepoint * const *begin, struct tracepoint * const *end) |
519 | { | 519 | { |
520 | if (!*tracepoint && begin != end) { | 520 | if (!*tracepoint && begin != end) { |
521 | *tracepoint = begin; | 521 | *tracepoint = begin; |
@@ -534,7 +534,8 @@ static void tracepoint_get_iter(struct tracepoint_iter *iter) | |||
534 | /* Core kernel tracepoints */ | 534 | /* Core kernel tracepoints */ |
535 | if (!iter->module) { | 535 | if (!iter->module) { |
536 | found = tracepoint_get_iter_range(&iter->tracepoint, | 536 | found = tracepoint_get_iter_range(&iter->tracepoint, |
537 | __start___tracepoints, __stop___tracepoints); | 537 | __start___tracepoints_ptrs, |
538 | __stop___tracepoints_ptrs); | ||
538 | if (found) | 539 | if (found) |
539 | goto end; | 540 | goto end; |
540 | } | 541 | } |
@@ -585,8 +586,8 @@ int tracepoint_module_notify(struct notifier_block *self, | |||
585 | switch (val) { | 586 | switch (val) { |
586 | case MODULE_STATE_COMING: | 587 | case MODULE_STATE_COMING: |
587 | case MODULE_STATE_GOING: | 588 | case MODULE_STATE_GOING: |
588 | tracepoint_update_probe_range(mod->tracepoints, | 589 | tracepoint_update_probe_range(mod->tracepoints_ptrs, |
589 | mod->tracepoints + mod->num_tracepoints); | 590 | mod->tracepoints_ptrs + mod->num_tracepoints); |
590 | break; | 591 | break; |
591 | } | 592 | } |
592 | return 0; | 593 | return 0; |
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index d7ebdf4cea98..f37f974aa81b 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <asm/irq_regs.h> | 27 | #include <asm/irq_regs.h> |
28 | #include <linux/perf_event.h> | 28 | #include <linux/perf_event.h> |
29 | 29 | ||
30 | int watchdog_enabled; | 30 | int watchdog_enabled = 1; |
31 | int __read_mostly softlockup_thresh = 60; | 31 | int __read_mostly softlockup_thresh = 60; |
32 | 32 | ||
33 | static DEFINE_PER_CPU(unsigned long, watchdog_touch_ts); | 33 | static DEFINE_PER_CPU(unsigned long, watchdog_touch_ts); |
@@ -43,9 +43,6 @@ static DEFINE_PER_CPU(unsigned long, hrtimer_interrupts_saved); | |||
43 | static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); | 43 | static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | static int no_watchdog; | ||
47 | |||
48 | |||
49 | /* boot commands */ | 46 | /* boot commands */ |
50 | /* | 47 | /* |
51 | * Should we panic when a soft-lockup or hard-lockup occurs: | 48 | * Should we panic when a soft-lockup or hard-lockup occurs: |
@@ -58,7 +55,7 @@ static int __init hardlockup_panic_setup(char *str) | |||
58 | if (!strncmp(str, "panic", 5)) | 55 | if (!strncmp(str, "panic", 5)) |
59 | hardlockup_panic = 1; | 56 | hardlockup_panic = 1; |
60 | else if (!strncmp(str, "0", 1)) | 57 | else if (!strncmp(str, "0", 1)) |
61 | no_watchdog = 1; | 58 | watchdog_enabled = 0; |
62 | return 1; | 59 | return 1; |
63 | } | 60 | } |
64 | __setup("nmi_watchdog=", hardlockup_panic_setup); | 61 | __setup("nmi_watchdog=", hardlockup_panic_setup); |
@@ -77,7 +74,7 @@ __setup("softlockup_panic=", softlockup_panic_setup); | |||
77 | 74 | ||
78 | static int __init nowatchdog_setup(char *str) | 75 | static int __init nowatchdog_setup(char *str) |
79 | { | 76 | { |
80 | no_watchdog = 1; | 77 | watchdog_enabled = 0; |
81 | return 1; | 78 | return 1; |
82 | } | 79 | } |
83 | __setup("nowatchdog", nowatchdog_setup); | 80 | __setup("nowatchdog", nowatchdog_setup); |
@@ -85,7 +82,7 @@ __setup("nowatchdog", nowatchdog_setup); | |||
85 | /* deprecated */ | 82 | /* deprecated */ |
86 | static int __init nosoftlockup_setup(char *str) | 83 | static int __init nosoftlockup_setup(char *str) |
87 | { | 84 | { |
88 | no_watchdog = 1; | 85 | watchdog_enabled = 0; |
89 | return 1; | 86 | return 1; |
90 | } | 87 | } |
91 | __setup("nosoftlockup", nosoftlockup_setup); | 88 | __setup("nosoftlockup", nosoftlockup_setup); |
@@ -432,9 +429,6 @@ static int watchdog_enable(int cpu) | |||
432 | wake_up_process(p); | 429 | wake_up_process(p); |
433 | } | 430 | } |
434 | 431 | ||
435 | /* if any cpu succeeds, watchdog is considered enabled for the system */ | ||
436 | watchdog_enabled = 1; | ||
437 | |||
438 | return 0; | 432 | return 0; |
439 | } | 433 | } |
440 | 434 | ||
@@ -462,12 +456,16 @@ static void watchdog_disable(int cpu) | |||
462 | static void watchdog_enable_all_cpus(void) | 456 | static void watchdog_enable_all_cpus(void) |
463 | { | 457 | { |
464 | int cpu; | 458 | int cpu; |
465 | int result = 0; | 459 | |
460 | watchdog_enabled = 0; | ||
466 | 461 | ||
467 | for_each_online_cpu(cpu) | 462 | for_each_online_cpu(cpu) |
468 | result += watchdog_enable(cpu); | 463 | if (!watchdog_enable(cpu)) |
464 | /* if any cpu succeeds, watchdog is considered | ||
465 | enabled for the system */ | ||
466 | watchdog_enabled = 1; | ||
469 | 467 | ||
470 | if (result) | 468 | if (!watchdog_enabled) |
471 | printk(KERN_ERR "watchdog: failed to be enabled on some cpus\n"); | 469 | printk(KERN_ERR "watchdog: failed to be enabled on some cpus\n"); |
472 | 470 | ||
473 | } | 471 | } |
@@ -476,9 +474,6 @@ static void watchdog_disable_all_cpus(void) | |||
476 | { | 474 | { |
477 | int cpu; | 475 | int cpu; |
478 | 476 | ||
479 | if (no_watchdog) | ||
480 | return; | ||
481 | |||
482 | for_each_online_cpu(cpu) | 477 | for_each_online_cpu(cpu) |
483 | watchdog_disable(cpu); | 478 | watchdog_disable(cpu); |
484 | 479 | ||
@@ -498,10 +493,12 @@ int proc_dowatchdog_enabled(struct ctl_table *table, int write, | |||
498 | { | 493 | { |
499 | proc_dointvec(table, write, buffer, length, ppos); | 494 | proc_dointvec(table, write, buffer, length, ppos); |
500 | 495 | ||
501 | if (watchdog_enabled) | 496 | if (write) { |
502 | watchdog_enable_all_cpus(); | 497 | if (watchdog_enabled) |
503 | else | 498 | watchdog_enable_all_cpus(); |
504 | watchdog_disable_all_cpus(); | 499 | else |
500 | watchdog_disable_all_cpus(); | ||
501 | } | ||
505 | return 0; | 502 | return 0; |
506 | } | 503 | } |
507 | 504 | ||
@@ -530,7 +527,8 @@ cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) | |||
530 | break; | 527 | break; |
531 | case CPU_ONLINE: | 528 | case CPU_ONLINE: |
532 | case CPU_ONLINE_FROZEN: | 529 | case CPU_ONLINE_FROZEN: |
533 | err = watchdog_enable(hotcpu); | 530 | if (watchdog_enabled) |
531 | err = watchdog_enable(hotcpu); | ||
534 | break; | 532 | break; |
535 | #ifdef CONFIG_HOTPLUG_CPU | 533 | #ifdef CONFIG_HOTPLUG_CPU |
536 | case CPU_UP_CANCELED: | 534 | case CPU_UP_CANCELED: |
@@ -555,9 +553,6 @@ void __init lockup_detector_init(void) | |||
555 | void *cpu = (void *)(long)smp_processor_id(); | 553 | void *cpu = (void *)(long)smp_processor_id(); |
556 | int err; | 554 | int err; |
557 | 555 | ||
558 | if (no_watchdog) | ||
559 | return; | ||
560 | |||
561 | err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); | 556 | err = cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu); |
562 | WARN_ON(notifier_to_errno(err)); | 557 | WARN_ON(notifier_to_errno(err)); |
563 | 558 | ||
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index e187454d82f6..b6c1ce3c53b5 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -1162,7 +1162,12 @@ static void __split_huge_page_refcount(struct page *page) | |||
1162 | /* after clearing PageTail the gup refcount can be released */ | 1162 | /* after clearing PageTail the gup refcount can be released */ |
1163 | smp_mb(); | 1163 | smp_mb(); |
1164 | 1164 | ||
1165 | page_tail->flags &= ~PAGE_FLAGS_CHECK_AT_PREP; | 1165 | /* |
1166 | * retain hwpoison flag of the poisoned tail page: | ||
1167 | * fix for the unsuitable process killed on Guest Machine(KVM) | ||
1168 | * by the memory-failure. | ||
1169 | */ | ||
1170 | page_tail->flags &= ~PAGE_FLAGS_CHECK_AT_PREP | __PG_HWPOISON; | ||
1166 | page_tail->flags |= (page->flags & | 1171 | page_tail->flags |= (page->flags & |
1167 | ((1L << PG_referenced) | | 1172 | ((1L << PG_referenced) | |
1168 | (1L << PG_swapbacked) | | 1173 | (1L << PG_swapbacked) | |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3878cfe399dc..da53a252b259 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -612,8 +612,10 @@ static void mem_cgroup_charge_statistics(struct mem_cgroup *mem, | |||
612 | /* pagein of a big page is an event. So, ignore page size */ | 612 | /* pagein of a big page is an event. So, ignore page size */ |
613 | if (nr_pages > 0) | 613 | if (nr_pages > 0) |
614 | __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGIN_COUNT]); | 614 | __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGIN_COUNT]); |
615 | else | 615 | else { |
616 | __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGOUT_COUNT]); | 616 | __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGOUT_COUNT]); |
617 | nr_pages = -nr_pages; /* for event */ | ||
618 | } | ||
617 | 619 | ||
618 | __this_cpu_add(mem->stat->count[MEM_CGROUP_EVENTS], nr_pages); | 620 | __this_cpu_add(mem->stat->count[MEM_CGROUP_EVENTS], nr_pages); |
619 | 621 | ||
@@ -1111,6 +1113,23 @@ static bool mem_cgroup_check_under_limit(struct mem_cgroup *mem) | |||
1111 | return false; | 1113 | return false; |
1112 | } | 1114 | } |
1113 | 1115 | ||
1116 | /** | ||
1117 | * mem_cgroup_check_margin - check if the memory cgroup allows charging | ||
1118 | * @mem: memory cgroup to check | ||
1119 | * @bytes: the number of bytes the caller intends to charge | ||
1120 | * | ||
1121 | * Returns a boolean value on whether @mem can be charged @bytes or | ||
1122 | * whether this would exceed the limit. | ||
1123 | */ | ||
1124 | static bool mem_cgroup_check_margin(struct mem_cgroup *mem, unsigned long bytes) | ||
1125 | { | ||
1126 | if (!res_counter_check_margin(&mem->res, bytes)) | ||
1127 | return false; | ||
1128 | if (do_swap_account && !res_counter_check_margin(&mem->memsw, bytes)) | ||
1129 | return false; | ||
1130 | return true; | ||
1131 | } | ||
1132 | |||
1114 | static unsigned int get_swappiness(struct mem_cgroup *memcg) | 1133 | static unsigned int get_swappiness(struct mem_cgroup *memcg) |
1115 | { | 1134 | { |
1116 | struct cgroup *cgrp = memcg->css.cgroup; | 1135 | struct cgroup *cgrp = memcg->css.cgroup; |
@@ -1837,23 +1856,34 @@ static int __mem_cgroup_do_charge(struct mem_cgroup *mem, gfp_t gfp_mask, | |||
1837 | flags |= MEM_CGROUP_RECLAIM_NOSWAP; | 1856 | flags |= MEM_CGROUP_RECLAIM_NOSWAP; |
1838 | } else | 1857 | } else |
1839 | mem_over_limit = mem_cgroup_from_res_counter(fail_res, res); | 1858 | mem_over_limit = mem_cgroup_from_res_counter(fail_res, res); |
1840 | 1859 | /* | |
1841 | if (csize > PAGE_SIZE) /* change csize and retry */ | 1860 | * csize can be either a huge page (HPAGE_SIZE), a batch of |
1861 | * regular pages (CHARGE_SIZE), or a single regular page | ||
1862 | * (PAGE_SIZE). | ||
1863 | * | ||
1864 | * Never reclaim on behalf of optional batching, retry with a | ||
1865 | * single page instead. | ||
1866 | */ | ||
1867 | if (csize == CHARGE_SIZE) | ||
1842 | return CHARGE_RETRY; | 1868 | return CHARGE_RETRY; |
1843 | 1869 | ||
1844 | if (!(gfp_mask & __GFP_WAIT)) | 1870 | if (!(gfp_mask & __GFP_WAIT)) |
1845 | return CHARGE_WOULDBLOCK; | 1871 | return CHARGE_WOULDBLOCK; |
1846 | 1872 | ||
1847 | ret = mem_cgroup_hierarchical_reclaim(mem_over_limit, NULL, | 1873 | ret = mem_cgroup_hierarchical_reclaim(mem_over_limit, NULL, |
1848 | gfp_mask, flags); | 1874 | gfp_mask, flags); |
1875 | if (mem_cgroup_check_margin(mem_over_limit, csize)) | ||
1876 | return CHARGE_RETRY; | ||
1849 | /* | 1877 | /* |
1850 | * try_to_free_mem_cgroup_pages() might not give us a full | 1878 | * Even though the limit is exceeded at this point, reclaim |
1851 | * picture of reclaim. Some pages are reclaimed and might be | 1879 | * may have been able to free some pages. Retry the charge |
1852 | * moved to swap cache or just unmapped from the cgroup. | 1880 | * before killing the task. |
1853 | * Check the limit again to see if the reclaim reduced the | 1881 | * |
1854 | * current usage of the cgroup before giving up | 1882 | * Only for regular pages, though: huge pages are rather |
1883 | * unlikely to succeed so close to the limit, and we fall back | ||
1884 | * to regular pages anyway in case of failure. | ||
1855 | */ | 1885 | */ |
1856 | if (ret || mem_cgroup_check_under_limit(mem_over_limit)) | 1886 | if (csize == PAGE_SIZE && ret) |
1857 | return CHARGE_RETRY; | 1887 | return CHARGE_RETRY; |
1858 | 1888 | ||
1859 | /* | 1889 | /* |
@@ -2323,13 +2353,19 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, | |||
2323 | gfp_t gfp_mask, enum charge_type ctype) | 2353 | gfp_t gfp_mask, enum charge_type ctype) |
2324 | { | 2354 | { |
2325 | struct mem_cgroup *mem = NULL; | 2355 | struct mem_cgroup *mem = NULL; |
2356 | int page_size = PAGE_SIZE; | ||
2326 | struct page_cgroup *pc; | 2357 | struct page_cgroup *pc; |
2358 | bool oom = true; | ||
2327 | int ret; | 2359 | int ret; |
2328 | int page_size = PAGE_SIZE; | ||
2329 | 2360 | ||
2330 | if (PageTransHuge(page)) { | 2361 | if (PageTransHuge(page)) { |
2331 | page_size <<= compound_order(page); | 2362 | page_size <<= compound_order(page); |
2332 | VM_BUG_ON(!PageTransHuge(page)); | 2363 | VM_BUG_ON(!PageTransHuge(page)); |
2364 | /* | ||
2365 | * Never OOM-kill a process for a huge page. The | ||
2366 | * fault handler will fall back to regular pages. | ||
2367 | */ | ||
2368 | oom = false; | ||
2333 | } | 2369 | } |
2334 | 2370 | ||
2335 | pc = lookup_page_cgroup(page); | 2371 | pc = lookup_page_cgroup(page); |
@@ -2338,7 +2374,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm, | |||
2338 | return 0; | 2374 | return 0; |
2339 | prefetchw(pc); | 2375 | prefetchw(pc); |
2340 | 2376 | ||
2341 | ret = __mem_cgroup_try_charge(mm, gfp_mask, &mem, true, page_size); | 2377 | ret = __mem_cgroup_try_charge(mm, gfp_mask, &mem, oom, page_size); |
2342 | if (ret || !mem) | 2378 | if (ret || !mem) |
2343 | return ret; | 2379 | return ret; |
2344 | 2380 | ||
@@ -5024,9 +5060,9 @@ struct cgroup_subsys mem_cgroup_subsys = { | |||
5024 | static int __init enable_swap_account(char *s) | 5060 | static int __init enable_swap_account(char *s) |
5025 | { | 5061 | { |
5026 | /* consider enabled if no parameter or 1 is given */ | 5062 | /* consider enabled if no parameter or 1 is given */ |
5027 | if (!s || !strcmp(s, "1")) | 5063 | if (!(*s) || !strcmp(s, "=1")) |
5028 | really_do_swap_account = 1; | 5064 | really_do_swap_account = 1; |
5029 | else if (!strcmp(s, "0")) | 5065 | else if (!strcmp(s, "=0")) |
5030 | really_do_swap_account = 0; | 5066 | really_do_swap_account = 0; |
5031 | return 1; | 5067 | return 1; |
5032 | } | 5068 | } |
@@ -5034,7 +5070,8 @@ __setup("swapaccount", enable_swap_account); | |||
5034 | 5070 | ||
5035 | static int __init disable_swap_account(char *s) | 5071 | static int __init disable_swap_account(char *s) |
5036 | { | 5072 | { |
5037 | enable_swap_account("0"); | 5073 | printk_once("noswapaccount is deprecated and will be removed in 2.6.40. Use swapaccount=0 instead\n"); |
5074 | enable_swap_account("=0"); | ||
5038 | return 1; | 5075 | return 1; |
5039 | } | 5076 | } |
5040 | __setup("noswapaccount", disable_swap_account); | 5077 | __setup("noswapaccount", disable_swap_account); |
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 548fbd70f026..0207c2f6f8bd 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
@@ -233,8 +233,8 @@ void shake_page(struct page *p, int access) | |||
233 | } | 233 | } |
234 | 234 | ||
235 | /* | 235 | /* |
236 | * Only all shrink_slab here (which would also | 236 | * Only call shrink_slab here (which would also shrink other caches) if |
237 | * shrink other caches) if access is not potentially fatal. | 237 | * access is not potentially fatal. |
238 | */ | 238 | */ |
239 | if (access) { | 239 | if (access) { |
240 | int nr; | 240 | int nr; |
@@ -386,8 +386,6 @@ static void collect_procs_anon(struct page *page, struct list_head *to_kill, | |||
386 | struct task_struct *tsk; | 386 | struct task_struct *tsk; |
387 | struct anon_vma *av; | 387 | struct anon_vma *av; |
388 | 388 | ||
389 | if (!PageHuge(page) && unlikely(split_huge_page(page))) | ||
390 | return; | ||
391 | read_lock(&tasklist_lock); | 389 | read_lock(&tasklist_lock); |
392 | av = page_lock_anon_vma(page); | 390 | av = page_lock_anon_vma(page); |
393 | if (av == NULL) /* Not actually mapped anymore */ | 391 | if (av == NULL) /* Not actually mapped anymore */ |
@@ -856,6 +854,7 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn, | |||
856 | int ret; | 854 | int ret; |
857 | int kill = 1; | 855 | int kill = 1; |
858 | struct page *hpage = compound_head(p); | 856 | struct page *hpage = compound_head(p); |
857 | struct page *ppage; | ||
859 | 858 | ||
860 | if (PageReserved(p) || PageSlab(p)) | 859 | if (PageReserved(p) || PageSlab(p)) |
861 | return SWAP_SUCCESS; | 860 | return SWAP_SUCCESS; |
@@ -897,6 +896,44 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn, | |||
897 | } | 896 | } |
898 | 897 | ||
899 | /* | 898 | /* |
899 | * ppage: poisoned page | ||
900 | * if p is regular page(4k page) | ||
901 | * ppage == real poisoned page; | ||
902 | * else p is hugetlb or THP, ppage == head page. | ||
903 | */ | ||
904 | ppage = hpage; | ||
905 | |||
906 | if (PageTransHuge(hpage)) { | ||
907 | /* | ||
908 | * Verify that this isn't a hugetlbfs head page, the check for | ||
909 | * PageAnon is just for avoid tripping a split_huge_page | ||
910 | * internal debug check, as split_huge_page refuses to deal with | ||
911 | * anything that isn't an anon page. PageAnon can't go away fro | ||
912 | * under us because we hold a refcount on the hpage, without a | ||
913 | * refcount on the hpage. split_huge_page can't be safely called | ||
914 | * in the first place, having a refcount on the tail isn't | ||
915 | * enough * to be safe. | ||
916 | */ | ||
917 | if (!PageHuge(hpage) && PageAnon(hpage)) { | ||
918 | if (unlikely(split_huge_page(hpage))) { | ||
919 | /* | ||
920 | * FIXME: if splitting THP is failed, it is | ||
921 | * better to stop the following operation rather | ||
922 | * than causing panic by unmapping. System might | ||
923 | * survive if the page is freed later. | ||
924 | */ | ||
925 | printk(KERN_INFO | ||
926 | "MCE %#lx: failed to split THP\n", pfn); | ||
927 | |||
928 | BUG_ON(!PageHWPoison(p)); | ||
929 | return SWAP_FAIL; | ||
930 | } | ||
931 | /* THP is split, so ppage should be the real poisoned page. */ | ||
932 | ppage = p; | ||
933 | } | ||
934 | } | ||
935 | |||
936 | /* | ||
900 | * First collect all the processes that have the page | 937 | * First collect all the processes that have the page |
901 | * mapped in dirty form. This has to be done before try_to_unmap, | 938 | * mapped in dirty form. This has to be done before try_to_unmap, |
902 | * because ttu takes the rmap data structures down. | 939 | * because ttu takes the rmap data structures down. |
@@ -905,12 +942,18 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn, | |||
905 | * there's nothing that can be done. | 942 | * there's nothing that can be done. |
906 | */ | 943 | */ |
907 | if (kill) | 944 | if (kill) |
908 | collect_procs(hpage, &tokill); | 945 | collect_procs(ppage, &tokill); |
946 | |||
947 | if (hpage != ppage) | ||
948 | lock_page_nosync(ppage); | ||
909 | 949 | ||
910 | ret = try_to_unmap(hpage, ttu); | 950 | ret = try_to_unmap(ppage, ttu); |
911 | if (ret != SWAP_SUCCESS) | 951 | if (ret != SWAP_SUCCESS) |
912 | printk(KERN_ERR "MCE %#lx: failed to unmap page (mapcount=%d)\n", | 952 | printk(KERN_ERR "MCE %#lx: failed to unmap page (mapcount=%d)\n", |
913 | pfn, page_mapcount(hpage)); | 953 | pfn, page_mapcount(ppage)); |
954 | |||
955 | if (hpage != ppage) | ||
956 | unlock_page(ppage); | ||
914 | 957 | ||
915 | /* | 958 | /* |
916 | * Now that the dirty bit has been propagated to the | 959 | * Now that the dirty bit has been propagated to the |
@@ -921,7 +964,7 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn, | |||
921 | * use a more force-full uncatchable kill to prevent | 964 | * use a more force-full uncatchable kill to prevent |
922 | * any accesses to the poisoned memory. | 965 | * any accesses to the poisoned memory. |
923 | */ | 966 | */ |
924 | kill_procs_ao(&tokill, !!PageDirty(hpage), trapno, | 967 | kill_procs_ao(&tokill, !!PageDirty(ppage), trapno, |
925 | ret != SWAP_SUCCESS, p, pfn); | 968 | ret != SWAP_SUCCESS, p, pfn); |
926 | 969 | ||
927 | return ret; | 970 | return ret; |
@@ -1022,19 +1065,22 @@ int __memory_failure(unsigned long pfn, int trapno, int flags) | |||
1022 | * The check (unnecessarily) ignores LRU pages being isolated and | 1065 | * The check (unnecessarily) ignores LRU pages being isolated and |
1023 | * walked by the page reclaim code, however that's not a big loss. | 1066 | * walked by the page reclaim code, however that's not a big loss. |
1024 | */ | 1067 | */ |
1025 | if (!PageLRU(p) && !PageHuge(p)) | 1068 | if (!PageHuge(p) && !PageTransCompound(p)) { |
1026 | shake_page(p, 0); | 1069 | if (!PageLRU(p)) |
1027 | if (!PageLRU(p) && !PageHuge(p)) { | 1070 | shake_page(p, 0); |
1028 | /* | 1071 | if (!PageLRU(p)) { |
1029 | * shake_page could have turned it free. | 1072 | /* |
1030 | */ | 1073 | * shake_page could have turned it free. |
1031 | if (is_free_buddy_page(p)) { | 1074 | */ |
1032 | action_result(pfn, "free buddy, 2nd try", DELAYED); | 1075 | if (is_free_buddy_page(p)) { |
1033 | return 0; | 1076 | action_result(pfn, "free buddy, 2nd try", |
1077 | DELAYED); | ||
1078 | return 0; | ||
1079 | } | ||
1080 | action_result(pfn, "non LRU", IGNORED); | ||
1081 | put_page(p); | ||
1082 | return -EBUSY; | ||
1034 | } | 1083 | } |
1035 | action_result(pfn, "non LRU", IGNORED); | ||
1036 | put_page(p); | ||
1037 | return -EBUSY; | ||
1038 | } | 1084 | } |
1039 | 1085 | ||
1040 | /* | 1086 | /* |
@@ -1064,7 +1110,7 @@ int __memory_failure(unsigned long pfn, int trapno, int flags) | |||
1064 | * For error on the tail page, we should set PG_hwpoison | 1110 | * For error on the tail page, we should set PG_hwpoison |
1065 | * on the head page to show that the hugepage is hwpoisoned | 1111 | * on the head page to show that the hugepage is hwpoisoned |
1066 | */ | 1112 | */ |
1067 | if (PageTail(p) && TestSetPageHWPoison(hpage)) { | 1113 | if (PageHuge(p) && PageTail(p) && TestSetPageHWPoison(hpage)) { |
1068 | action_result(pfn, "hugepage already hardware poisoned", | 1114 | action_result(pfn, "hugepage already hardware poisoned", |
1069 | IGNORED); | 1115 | IGNORED); |
1070 | unlock_page(hpage); | 1116 | unlock_page(hpage); |
@@ -1295,7 +1341,10 @@ static int soft_offline_huge_page(struct page *page, int flags) | |||
1295 | ret = migrate_huge_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, 0, | 1341 | ret = migrate_huge_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, 0, |
1296 | true); | 1342 | true); |
1297 | if (ret) { | 1343 | if (ret) { |
1298 | putback_lru_pages(&pagelist); | 1344 | struct page *page1, *page2; |
1345 | list_for_each_entry_safe(page1, page2, &pagelist, lru) | ||
1346 | put_page(page1); | ||
1347 | |||
1299 | pr_debug("soft offline: %#lx: migration failed %d, type %lx\n", | 1348 | pr_debug("soft offline: %#lx: migration failed %d, type %lx\n", |
1300 | pfn, ret, page->flags); | 1349 | pfn, ret, page->flags); |
1301 | if (ret > 0) | 1350 | if (ret > 0) |
@@ -1419,6 +1468,7 @@ int soft_offline_page(struct page *page, int flags) | |||
1419 | ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, | 1468 | ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL, |
1420 | 0, true); | 1469 | 0, true); |
1421 | if (ret) { | 1470 | if (ret) { |
1471 | putback_lru_pages(&pagelist); | ||
1422 | pr_info("soft offline: %#lx: migration failed %d, type %lx\n", | 1472 | pr_info("soft offline: %#lx: migration failed %d, type %lx\n", |
1423 | pfn, ret, page->flags); | 1473 | pfn, ret, page->flags); |
1424 | if (ret > 0) | 1474 | if (ret > 0) |
diff --git a/mm/migrate.c b/mm/migrate.c index 9f29a3b7aac2..766115253807 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -772,6 +772,7 @@ uncharge: | |||
772 | unlock: | 772 | unlock: |
773 | unlock_page(page); | 773 | unlock_page(page); |
774 | 774 | ||
775 | move_newpage: | ||
775 | if (rc != -EAGAIN) { | 776 | if (rc != -EAGAIN) { |
776 | /* | 777 | /* |
777 | * A page that has been migrated has all references | 778 | * A page that has been migrated has all references |
@@ -785,8 +786,6 @@ unlock: | |||
785 | putback_lru_page(page); | 786 | putback_lru_page(page); |
786 | } | 787 | } |
787 | 788 | ||
788 | move_newpage: | ||
789 | |||
790 | /* | 789 | /* |
791 | * Move the new page to the LRU. If migration was not successful | 790 | * Move the new page to the LRU. If migration was not successful |
792 | * then this will free the page. | 791 | * then this will free the page. |
@@ -981,10 +980,6 @@ int migrate_huge_pages(struct list_head *from, | |||
981 | } | 980 | } |
982 | rc = 0; | 981 | rc = 0; |
983 | out: | 982 | out: |
984 | |||
985 | list_for_each_entry_safe(page, page2, from, lru) | ||
986 | put_page(page); | ||
987 | |||
988 | if (rc) | 983 | if (rc) |
989 | return rc; | 984 | return rc; |
990 | 985 | ||
diff --git a/mm/mlock.c b/mm/mlock.c index 13e81ee8be9d..c3924c7f00be 100644 --- a/mm/mlock.c +++ b/mm/mlock.c | |||
@@ -178,6 +178,13 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma, | |||
178 | if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == VM_WRITE) | 178 | if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == VM_WRITE) |
179 | gup_flags |= FOLL_WRITE; | 179 | gup_flags |= FOLL_WRITE; |
180 | 180 | ||
181 | /* | ||
182 | * We want mlock to succeed for regions that have any permissions | ||
183 | * other than PROT_NONE. | ||
184 | */ | ||
185 | if (vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC)) | ||
186 | gup_flags |= FOLL_FORCE; | ||
187 | |||
181 | if (vma->vm_flags & VM_LOCKED) | 188 | if (vma->vm_flags & VM_LOCKED) |
182 | gup_flags |= FOLL_MLOCK; | 189 | gup_flags |= FOLL_MLOCK; |
183 | 190 | ||
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c index cd4c4231fa48..de1022cacaf7 100644 --- a/net/batman-adv/vis.c +++ b/net/batman-adv/vis.c | |||
@@ -64,6 +64,7 @@ static void free_info(struct kref *ref) | |||
64 | 64 | ||
65 | spin_unlock_bh(&bat_priv->vis_list_lock); | 65 | spin_unlock_bh(&bat_priv->vis_list_lock); |
66 | kfree_skb(info->skb_packet); | 66 | kfree_skb(info->skb_packet); |
67 | kfree(info); | ||
67 | } | 68 | } |
68 | 69 | ||
69 | /* Compare two vis packets, used by the hashing algorithm */ | 70 | /* Compare two vis packets, used by the hashing algorithm */ |
@@ -268,10 +269,10 @@ int vis_seq_print_text(struct seq_file *seq, void *offset) | |||
268 | buff_pos += sprintf(buff + buff_pos, "%pM,", | 269 | buff_pos += sprintf(buff + buff_pos, "%pM,", |
269 | entry->addr); | 270 | entry->addr); |
270 | 271 | ||
271 | for (i = 0; i < packet->entries; i++) | 272 | for (j = 0; j < packet->entries; j++) |
272 | buff_pos += vis_data_read_entry( | 273 | buff_pos += vis_data_read_entry( |
273 | buff + buff_pos, | 274 | buff + buff_pos, |
274 | &entries[i], | 275 | &entries[j], |
275 | entry->addr, | 276 | entry->addr, |
276 | entry->primary); | 277 | entry->primary); |
277 | 278 | ||
@@ -444,7 +445,7 @@ static struct vis_info *add_packet(struct bat_priv *bat_priv, | |||
444 | info); | 445 | info); |
445 | if (hash_added < 0) { | 446 | if (hash_added < 0) { |
446 | /* did not work (for some reason) */ | 447 | /* did not work (for some reason) */ |
447 | kref_put(&old_info->refcount, free_info); | 448 | kref_put(&info->refcount, free_info); |
448 | info = NULL; | 449 | info = NULL; |
449 | } | 450 | } |
450 | 451 | ||
@@ -815,7 +816,7 @@ static void send_vis_packets(struct work_struct *work) | |||
815 | container_of(work, struct delayed_work, work); | 816 | container_of(work, struct delayed_work, work); |
816 | struct bat_priv *bat_priv = | 817 | struct bat_priv *bat_priv = |
817 | container_of(delayed_work, struct bat_priv, vis_work); | 818 | container_of(delayed_work, struct bat_priv, vis_work); |
818 | struct vis_info *info, *temp; | 819 | struct vis_info *info; |
819 | 820 | ||
820 | spin_lock_bh(&bat_priv->vis_hash_lock); | 821 | spin_lock_bh(&bat_priv->vis_hash_lock); |
821 | purge_vis_packets(bat_priv); | 822 | purge_vis_packets(bat_priv); |
@@ -825,8 +826,9 @@ static void send_vis_packets(struct work_struct *work) | |||
825 | send_list_add(bat_priv, bat_priv->my_vis_info); | 826 | send_list_add(bat_priv, bat_priv->my_vis_info); |
826 | } | 827 | } |
827 | 828 | ||
828 | list_for_each_entry_safe(info, temp, &bat_priv->vis_send_list, | 829 | while (!list_empty(&bat_priv->vis_send_list)) { |
829 | send_list) { | 830 | info = list_first_entry(&bat_priv->vis_send_list, |
831 | typeof(*info), send_list); | ||
830 | 832 | ||
831 | kref_get(&info->refcount); | 833 | kref_get(&info->refcount); |
832 | spin_unlock_bh(&bat_priv->vis_hash_lock); | 834 | spin_unlock_bh(&bat_priv->vis_hash_lock); |
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 2872393b2939..88485cc74dc3 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -328,12 +328,12 @@ static struct net_bridge_fdb_entry *fdb_create(struct hlist_head *head, | |||
328 | fdb = kmem_cache_alloc(br_fdb_cache, GFP_ATOMIC); | 328 | fdb = kmem_cache_alloc(br_fdb_cache, GFP_ATOMIC); |
329 | if (fdb) { | 329 | if (fdb) { |
330 | memcpy(fdb->addr.addr, addr, ETH_ALEN); | 330 | memcpy(fdb->addr.addr, addr, ETH_ALEN); |
331 | hlist_add_head_rcu(&fdb->hlist, head); | ||
332 | |||
333 | fdb->dst = source; | 331 | fdb->dst = source; |
334 | fdb->is_local = is_local; | 332 | fdb->is_local = is_local; |
335 | fdb->is_static = is_local; | 333 | fdb->is_static = is_local; |
336 | fdb->ageing_timer = jiffies; | 334 | fdb->ageing_timer = jiffies; |
335 | |||
336 | hlist_add_head_rcu(&fdb->hlist, head); | ||
337 | } | 337 | } |
338 | return fdb; | 338 | return fdb; |
339 | } | 339 | } |
diff --git a/net/core/dev.c b/net/core/dev.c index 24ea2d71e7ea..b6d0bf875a8e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2563,7 +2563,8 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, | |||
2563 | 2563 | ||
2564 | map = rcu_dereference(rxqueue->rps_map); | 2564 | map = rcu_dereference(rxqueue->rps_map); |
2565 | if (map) { | 2565 | if (map) { |
2566 | if (map->len == 1) { | 2566 | if (map->len == 1 && |
2567 | !rcu_dereference_raw(rxqueue->rps_flow_table)) { | ||
2567 | tcpu = map->cpus[0]; | 2568 | tcpu = map->cpus[0]; |
2568 | if (cpu_online(tcpu)) | 2569 | if (cpu_online(tcpu)) |
2569 | cpu = tcpu; | 2570 | cpu = tcpu; |
@@ -3424,6 +3425,8 @@ static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) | |||
3424 | __skb_pull(skb, skb_headlen(skb)); | 3425 | __skb_pull(skb, skb_headlen(skb)); |
3425 | skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb)); | 3426 | skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb)); |
3426 | skb->vlan_tci = 0; | 3427 | skb->vlan_tci = 0; |
3428 | skb->dev = napi->dev; | ||
3429 | skb->skb_iif = 0; | ||
3427 | 3430 | ||
3428 | napi->skb = skb; | 3431 | napi->skb = skb; |
3429 | } | 3432 | } |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 750db57f3bb3..2d65c6bb24c1 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1121,8 +1121,7 @@ static int validate_linkmsg(struct net_device *dev, struct nlattr *tb[]) | |||
1121 | return -EOPNOTSUPP; | 1121 | return -EOPNOTSUPP; |
1122 | 1122 | ||
1123 | if (af_ops->validate_link_af) { | 1123 | if (af_ops->validate_link_af) { |
1124 | err = af_ops->validate_link_af(dev, | 1124 | err = af_ops->validate_link_af(dev, af); |
1125 | tb[IFLA_AF_SPEC]); | ||
1126 | if (err < 0) | 1125 | if (err < 0) |
1127 | return err; | 1126 | return err; |
1128 | } | 1127 | } |
@@ -1672,6 +1671,9 @@ replay: | |||
1672 | snprintf(ifname, IFNAMSIZ, "%s%%d", ops->kind); | 1671 | snprintf(ifname, IFNAMSIZ, "%s%%d", ops->kind); |
1673 | 1672 | ||
1674 | dest_net = rtnl_link_get_net(net, tb); | 1673 | dest_net = rtnl_link_get_net(net, tb); |
1674 | if (IS_ERR(dest_net)) | ||
1675 | return PTR_ERR(dest_net); | ||
1676 | |||
1675 | dev = rtnl_create_link(net, dest_net, ifname, ops, tb); | 1677 | dev = rtnl_create_link(net, dest_net, ifname, ops, tb); |
1676 | 1678 | ||
1677 | if (IS_ERR(dev)) | 1679 | if (IS_ERR(dev)) |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 7cd1bc86d591..d883dcc78b6b 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -210,6 +210,7 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask, | |||
210 | shinfo = skb_shinfo(skb); | 210 | shinfo = skb_shinfo(skb); |
211 | memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); | 211 | memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); |
212 | atomic_set(&shinfo->dataref, 1); | 212 | atomic_set(&shinfo->dataref, 1); |
213 | kmemcheck_annotate_variable(shinfo->destructor_arg); | ||
213 | 214 | ||
214 | if (fclone) { | 215 | if (fclone) { |
215 | struct sk_buff *child = skb + 1; | 216 | struct sk_buff *child = skb + 1; |
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index 15dcc1a586b4..0c2826337919 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
@@ -265,13 +265,13 @@ static void ec_tx_done(struct sk_buff *skb, int result) | |||
265 | static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, | 265 | static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, |
266 | struct msghdr *msg, size_t len) | 266 | struct msghdr *msg, size_t len) |
267 | { | 267 | { |
268 | struct sock *sk = sock->sk; | ||
269 | struct sockaddr_ec *saddr=(struct sockaddr_ec *)msg->msg_name; | 268 | struct sockaddr_ec *saddr=(struct sockaddr_ec *)msg->msg_name; |
270 | struct net_device *dev; | 269 | struct net_device *dev; |
271 | struct ec_addr addr; | 270 | struct ec_addr addr; |
272 | int err; | 271 | int err; |
273 | unsigned char port, cb; | 272 | unsigned char port, cb; |
274 | #if defined(CONFIG_ECONET_AUNUDP) || defined(CONFIG_ECONET_NATIVE) | 273 | #if defined(CONFIG_ECONET_AUNUDP) || defined(CONFIG_ECONET_NATIVE) |
274 | struct sock *sk = sock->sk; | ||
275 | struct sk_buff *skb; | 275 | struct sk_buff *skb; |
276 | struct ec_cb *eb; | 276 | struct ec_cb *eb; |
277 | #endif | 277 | #endif |
@@ -488,10 +488,10 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
488 | 488 | ||
489 | error_free_buf: | 489 | error_free_buf: |
490 | vfree(userbuf); | 490 | vfree(userbuf); |
491 | error: | ||
491 | #else | 492 | #else |
492 | err = -EPROTOTYPE; | 493 | err = -EPROTOTYPE; |
493 | #endif | 494 | #endif |
494 | error: | ||
495 | mutex_unlock(&econet_mutex); | 495 | mutex_unlock(&econet_mutex); |
496 | 496 | ||
497 | return err; | 497 | return err; |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index f2b61107df6c..45b89d7bda5a 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -880,6 +880,19 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
880 | } | 880 | } |
881 | EXPORT_SYMBOL(inet_ioctl); | 881 | EXPORT_SYMBOL(inet_ioctl); |
882 | 882 | ||
883 | #ifdef CONFIG_COMPAT | ||
884 | int inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | ||
885 | { | ||
886 | struct sock *sk = sock->sk; | ||
887 | int err = -ENOIOCTLCMD; | ||
888 | |||
889 | if (sk->sk_prot->compat_ioctl) | ||
890 | err = sk->sk_prot->compat_ioctl(sk, cmd, arg); | ||
891 | |||
892 | return err; | ||
893 | } | ||
894 | #endif | ||
895 | |||
883 | const struct proto_ops inet_stream_ops = { | 896 | const struct proto_ops inet_stream_ops = { |
884 | .family = PF_INET, | 897 | .family = PF_INET, |
885 | .owner = THIS_MODULE, | 898 | .owner = THIS_MODULE, |
@@ -903,6 +916,7 @@ const struct proto_ops inet_stream_ops = { | |||
903 | #ifdef CONFIG_COMPAT | 916 | #ifdef CONFIG_COMPAT |
904 | .compat_setsockopt = compat_sock_common_setsockopt, | 917 | .compat_setsockopt = compat_sock_common_setsockopt, |
905 | .compat_getsockopt = compat_sock_common_getsockopt, | 918 | .compat_getsockopt = compat_sock_common_getsockopt, |
919 | .compat_ioctl = inet_compat_ioctl, | ||
906 | #endif | 920 | #endif |
907 | }; | 921 | }; |
908 | EXPORT_SYMBOL(inet_stream_ops); | 922 | EXPORT_SYMBOL(inet_stream_ops); |
@@ -929,6 +943,7 @@ const struct proto_ops inet_dgram_ops = { | |||
929 | #ifdef CONFIG_COMPAT | 943 | #ifdef CONFIG_COMPAT |
930 | .compat_setsockopt = compat_sock_common_setsockopt, | 944 | .compat_setsockopt = compat_sock_common_setsockopt, |
931 | .compat_getsockopt = compat_sock_common_getsockopt, | 945 | .compat_getsockopt = compat_sock_common_getsockopt, |
946 | .compat_ioctl = inet_compat_ioctl, | ||
932 | #endif | 947 | #endif |
933 | }; | 948 | }; |
934 | EXPORT_SYMBOL(inet_dgram_ops); | 949 | EXPORT_SYMBOL(inet_dgram_ops); |
@@ -959,6 +974,7 @@ static const struct proto_ops inet_sockraw_ops = { | |||
959 | #ifdef CONFIG_COMPAT | 974 | #ifdef CONFIG_COMPAT |
960 | .compat_setsockopt = compat_sock_common_setsockopt, | 975 | .compat_setsockopt = compat_sock_common_setsockopt, |
961 | .compat_getsockopt = compat_sock_common_getsockopt, | 976 | .compat_getsockopt = compat_sock_common_getsockopt, |
977 | .compat_ioctl = inet_compat_ioctl, | ||
962 | #endif | 978 | #endif |
963 | }; | 979 | }; |
964 | 980 | ||
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 3f3a9afd73e0..8b65a12654e7 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -60,6 +60,7 @@ | |||
60 | #include <linux/notifier.h> | 60 | #include <linux/notifier.h> |
61 | #include <linux/if_arp.h> | 61 | #include <linux/if_arp.h> |
62 | #include <linux/netfilter_ipv4.h> | 62 | #include <linux/netfilter_ipv4.h> |
63 | #include <linux/compat.h> | ||
63 | #include <net/ipip.h> | 64 | #include <net/ipip.h> |
64 | #include <net/checksum.h> | 65 | #include <net/checksum.h> |
65 | #include <net/netlink.h> | 66 | #include <net/netlink.h> |
@@ -1434,6 +1435,81 @@ int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg) | |||
1434 | } | 1435 | } |
1435 | } | 1436 | } |
1436 | 1437 | ||
1438 | #ifdef CONFIG_COMPAT | ||
1439 | struct compat_sioc_sg_req { | ||
1440 | struct in_addr src; | ||
1441 | struct in_addr grp; | ||
1442 | compat_ulong_t pktcnt; | ||
1443 | compat_ulong_t bytecnt; | ||
1444 | compat_ulong_t wrong_if; | ||
1445 | }; | ||
1446 | |||
1447 | struct compat_sioc_vif_req { | ||
1448 | vifi_t vifi; /* Which iface */ | ||
1449 | compat_ulong_t icount; | ||
1450 | compat_ulong_t ocount; | ||
1451 | compat_ulong_t ibytes; | ||
1452 | compat_ulong_t obytes; | ||
1453 | }; | ||
1454 | |||
1455 | int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg) | ||
1456 | { | ||
1457 | struct compat_sioc_sg_req sr; | ||
1458 | struct compat_sioc_vif_req vr; | ||
1459 | struct vif_device *vif; | ||
1460 | struct mfc_cache *c; | ||
1461 | struct net *net = sock_net(sk); | ||
1462 | struct mr_table *mrt; | ||
1463 | |||
1464 | mrt = ipmr_get_table(net, raw_sk(sk)->ipmr_table ? : RT_TABLE_DEFAULT); | ||
1465 | if (mrt == NULL) | ||
1466 | return -ENOENT; | ||
1467 | |||
1468 | switch (cmd) { | ||
1469 | case SIOCGETVIFCNT: | ||
1470 | if (copy_from_user(&vr, arg, sizeof(vr))) | ||
1471 | return -EFAULT; | ||
1472 | if (vr.vifi >= mrt->maxvif) | ||
1473 | return -EINVAL; | ||
1474 | read_lock(&mrt_lock); | ||
1475 | vif = &mrt->vif_table[vr.vifi]; | ||
1476 | if (VIF_EXISTS(mrt, vr.vifi)) { | ||
1477 | vr.icount = vif->pkt_in; | ||
1478 | vr.ocount = vif->pkt_out; | ||
1479 | vr.ibytes = vif->bytes_in; | ||
1480 | vr.obytes = vif->bytes_out; | ||
1481 | read_unlock(&mrt_lock); | ||
1482 | |||
1483 | if (copy_to_user(arg, &vr, sizeof(vr))) | ||
1484 | return -EFAULT; | ||
1485 | return 0; | ||
1486 | } | ||
1487 | read_unlock(&mrt_lock); | ||
1488 | return -EADDRNOTAVAIL; | ||
1489 | case SIOCGETSGCNT: | ||
1490 | if (copy_from_user(&sr, arg, sizeof(sr))) | ||
1491 | return -EFAULT; | ||
1492 | |||
1493 | rcu_read_lock(); | ||
1494 | c = ipmr_cache_find(mrt, sr.src.s_addr, sr.grp.s_addr); | ||
1495 | if (c) { | ||
1496 | sr.pktcnt = c->mfc_un.res.pkt; | ||
1497 | sr.bytecnt = c->mfc_un.res.bytes; | ||
1498 | sr.wrong_if = c->mfc_un.res.wrong_if; | ||
1499 | rcu_read_unlock(); | ||
1500 | |||
1501 | if (copy_to_user(arg, &sr, sizeof(sr))) | ||
1502 | return -EFAULT; | ||
1503 | return 0; | ||
1504 | } | ||
1505 | rcu_read_unlock(); | ||
1506 | return -EADDRNOTAVAIL; | ||
1507 | default: | ||
1508 | return -ENOIOCTLCMD; | ||
1509 | } | ||
1510 | } | ||
1511 | #endif | ||
1512 | |||
1437 | 1513 | ||
1438 | static int ipmr_device_event(struct notifier_block *this, unsigned long event, void *ptr) | 1514 | static int ipmr_device_event(struct notifier_block *this, unsigned long event, void *ptr) |
1439 | { | 1515 | { |
diff --git a/net/ipv4/netfilter/arpt_mangle.c b/net/ipv4/netfilter/arpt_mangle.c index b8ddcc480ed9..a5e52a9f0a12 100644 --- a/net/ipv4/netfilter/arpt_mangle.c +++ b/net/ipv4/netfilter/arpt_mangle.c | |||
@@ -60,12 +60,12 @@ static int checkentry(const struct xt_tgchk_param *par) | |||
60 | 60 | ||
61 | if (mangle->flags & ~ARPT_MANGLE_MASK || | 61 | if (mangle->flags & ~ARPT_MANGLE_MASK || |
62 | !(mangle->flags & ARPT_MANGLE_MASK)) | 62 | !(mangle->flags & ARPT_MANGLE_MASK)) |
63 | return false; | 63 | return -EINVAL; |
64 | 64 | ||
65 | if (mangle->target != NF_DROP && mangle->target != NF_ACCEPT && | 65 | if (mangle->target != NF_DROP && mangle->target != NF_ACCEPT && |
66 | mangle->target != XT_CONTINUE) | 66 | mangle->target != XT_CONTINUE) |
67 | return false; | 67 | return -EINVAL; |
68 | return true; | 68 | return 0; |
69 | } | 69 | } |
70 | 70 | ||
71 | static struct xt_target arpt_mangle_reg __read_mostly = { | 71 | static struct xt_target arpt_mangle_reg __read_mostly = { |
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index a3d5ab786e81..6390ba299b3d 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -76,6 +76,7 @@ | |||
76 | #include <linux/seq_file.h> | 76 | #include <linux/seq_file.h> |
77 | #include <linux/netfilter.h> | 77 | #include <linux/netfilter.h> |
78 | #include <linux/netfilter_ipv4.h> | 78 | #include <linux/netfilter_ipv4.h> |
79 | #include <linux/compat.h> | ||
79 | 80 | ||
80 | static struct raw_hashinfo raw_v4_hashinfo = { | 81 | static struct raw_hashinfo raw_v4_hashinfo = { |
81 | .lock = __RW_LOCK_UNLOCKED(raw_v4_hashinfo.lock), | 82 | .lock = __RW_LOCK_UNLOCKED(raw_v4_hashinfo.lock), |
@@ -838,6 +839,23 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg) | |||
838 | } | 839 | } |
839 | } | 840 | } |
840 | 841 | ||
842 | #ifdef CONFIG_COMPAT | ||
843 | static int compat_raw_ioctl(struct sock *sk, unsigned int cmd, unsigned long arg) | ||
844 | { | ||
845 | switch (cmd) { | ||
846 | case SIOCOUTQ: | ||
847 | case SIOCINQ: | ||
848 | return -ENOIOCTLCMD; | ||
849 | default: | ||
850 | #ifdef CONFIG_IP_MROUTE | ||
851 | return ipmr_compat_ioctl(sk, cmd, compat_ptr(arg)); | ||
852 | #else | ||
853 | return -ENOIOCTLCMD; | ||
854 | #endif | ||
855 | } | ||
856 | } | ||
857 | #endif | ||
858 | |||
841 | struct proto raw_prot = { | 859 | struct proto raw_prot = { |
842 | .name = "RAW", | 860 | .name = "RAW", |
843 | .owner = THIS_MODULE, | 861 | .owner = THIS_MODULE, |
@@ -860,6 +878,7 @@ struct proto raw_prot = { | |||
860 | #ifdef CONFIG_COMPAT | 878 | #ifdef CONFIG_COMPAT |
861 | .compat_setsockopt = compat_raw_setsockopt, | 879 | .compat_setsockopt = compat_raw_setsockopt, |
862 | .compat_getsockopt = compat_raw_getsockopt, | 880 | .compat_getsockopt = compat_raw_getsockopt, |
881 | .compat_ioctl = compat_raw_ioctl, | ||
863 | #endif | 882 | #endif |
864 | }; | 883 | }; |
865 | 884 | ||
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 351dc4e85242..788a3e74834e 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2707,6 +2707,11 @@ static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 coo | |||
2707 | return NULL; | 2707 | return NULL; |
2708 | } | 2708 | } |
2709 | 2709 | ||
2710 | static unsigned int ipv4_blackhole_default_mtu(const struct dst_entry *dst) | ||
2711 | { | ||
2712 | return 0; | ||
2713 | } | ||
2714 | |||
2710 | static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) | 2715 | static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) |
2711 | { | 2716 | { |
2712 | } | 2717 | } |
@@ -2716,6 +2721,7 @@ static struct dst_ops ipv4_dst_blackhole_ops = { | |||
2716 | .protocol = cpu_to_be16(ETH_P_IP), | 2721 | .protocol = cpu_to_be16(ETH_P_IP), |
2717 | .destroy = ipv4_dst_destroy, | 2722 | .destroy = ipv4_dst_destroy, |
2718 | .check = ipv4_blackhole_dst_check, | 2723 | .check = ipv4_blackhole_dst_check, |
2724 | .default_mtu = ipv4_blackhole_default_mtu, | ||
2719 | .update_pmtu = ipv4_rt_blackhole_update_pmtu, | 2725 | .update_pmtu = ipv4_rt_blackhole_update_pmtu, |
2720 | }; | 2726 | }; |
2721 | 2727 | ||
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 9fab274019c0..0e1d53bcf1e0 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <linux/compat.h> | ||
37 | #include <net/protocol.h> | 38 | #include <net/protocol.h> |
38 | #include <linux/skbuff.h> | 39 | #include <linux/skbuff.h> |
39 | #include <net/sock.h> | 40 | #include <net/sock.h> |
@@ -1804,6 +1805,80 @@ int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg) | |||
1804 | } | 1805 | } |
1805 | } | 1806 | } |
1806 | 1807 | ||
1808 | #ifdef CONFIG_COMPAT | ||
1809 | struct compat_sioc_sg_req6 { | ||
1810 | struct sockaddr_in6 src; | ||
1811 | struct sockaddr_in6 grp; | ||
1812 | compat_ulong_t pktcnt; | ||
1813 | compat_ulong_t bytecnt; | ||
1814 | compat_ulong_t wrong_if; | ||
1815 | }; | ||
1816 | |||
1817 | struct compat_sioc_mif_req6 { | ||
1818 | mifi_t mifi; | ||
1819 | compat_ulong_t icount; | ||
1820 | compat_ulong_t ocount; | ||
1821 | compat_ulong_t ibytes; | ||
1822 | compat_ulong_t obytes; | ||
1823 | }; | ||
1824 | |||
1825 | int ip6mr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg) | ||
1826 | { | ||
1827 | struct compat_sioc_sg_req6 sr; | ||
1828 | struct compat_sioc_mif_req6 vr; | ||
1829 | struct mif_device *vif; | ||
1830 | struct mfc6_cache *c; | ||
1831 | struct net *net = sock_net(sk); | ||
1832 | struct mr6_table *mrt; | ||
1833 | |||
1834 | mrt = ip6mr_get_table(net, raw6_sk(sk)->ip6mr_table ? : RT6_TABLE_DFLT); | ||
1835 | if (mrt == NULL) | ||
1836 | return -ENOENT; | ||
1837 | |||
1838 | switch (cmd) { | ||
1839 | case SIOCGETMIFCNT_IN6: | ||
1840 | if (copy_from_user(&vr, arg, sizeof(vr))) | ||
1841 | return -EFAULT; | ||
1842 | if (vr.mifi >= mrt->maxvif) | ||
1843 | return -EINVAL; | ||
1844 | read_lock(&mrt_lock); | ||
1845 | vif = &mrt->vif6_table[vr.mifi]; | ||
1846 | if (MIF_EXISTS(mrt, vr.mifi)) { | ||
1847 | vr.icount = vif->pkt_in; | ||
1848 | vr.ocount = vif->pkt_out; | ||
1849 | vr.ibytes = vif->bytes_in; | ||
1850 | vr.obytes = vif->bytes_out; | ||
1851 | read_unlock(&mrt_lock); | ||
1852 | |||
1853 | if (copy_to_user(arg, &vr, sizeof(vr))) | ||
1854 | return -EFAULT; | ||
1855 | return 0; | ||
1856 | } | ||
1857 | read_unlock(&mrt_lock); | ||
1858 | return -EADDRNOTAVAIL; | ||
1859 | case SIOCGETSGCNT_IN6: | ||
1860 | if (copy_from_user(&sr, arg, sizeof(sr))) | ||
1861 | return -EFAULT; | ||
1862 | |||
1863 | read_lock(&mrt_lock); | ||
1864 | c = ip6mr_cache_find(mrt, &sr.src.sin6_addr, &sr.grp.sin6_addr); | ||
1865 | if (c) { | ||
1866 | sr.pktcnt = c->mfc_un.res.pkt; | ||
1867 | sr.bytecnt = c->mfc_un.res.bytes; | ||
1868 | sr.wrong_if = c->mfc_un.res.wrong_if; | ||
1869 | read_unlock(&mrt_lock); | ||
1870 | |||
1871 | if (copy_to_user(arg, &sr, sizeof(sr))) | ||
1872 | return -EFAULT; | ||
1873 | return 0; | ||
1874 | } | ||
1875 | read_unlock(&mrt_lock); | ||
1876 | return -EADDRNOTAVAIL; | ||
1877 | default: | ||
1878 | return -ENOIOCTLCMD; | ||
1879 | } | ||
1880 | } | ||
1881 | #endif | ||
1807 | 1882 | ||
1808 | static inline int ip6mr_forward2_finish(struct sk_buff *skb) | 1883 | static inline int ip6mr_forward2_finish(struct sk_buff *skb) |
1809 | { | 1884 | { |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 86c39526ba5e..c5b0915d106b 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/netfilter.h> | 31 | #include <linux/netfilter.h> |
32 | #include <linux/netfilter_ipv6.h> | 32 | #include <linux/netfilter_ipv6.h> |
33 | #include <linux/skbuff.h> | 33 | #include <linux/skbuff.h> |
34 | #include <linux/compat.h> | ||
34 | #include <asm/uaccess.h> | 35 | #include <asm/uaccess.h> |
35 | #include <asm/ioctls.h> | 36 | #include <asm/ioctls.h> |
36 | 37 | ||
@@ -1157,6 +1158,23 @@ static int rawv6_ioctl(struct sock *sk, int cmd, unsigned long arg) | |||
1157 | } | 1158 | } |
1158 | } | 1159 | } |
1159 | 1160 | ||
1161 | #ifdef CONFIG_COMPAT | ||
1162 | static int compat_rawv6_ioctl(struct sock *sk, unsigned int cmd, unsigned long arg) | ||
1163 | { | ||
1164 | switch (cmd) { | ||
1165 | case SIOCOUTQ: | ||
1166 | case SIOCINQ: | ||
1167 | return -ENOIOCTLCMD; | ||
1168 | default: | ||
1169 | #ifdef CONFIG_IPV6_MROUTE | ||
1170 | return ip6mr_compat_ioctl(sk, cmd, compat_ptr(arg)); | ||
1171 | #else | ||
1172 | return -ENOIOCTLCMD; | ||
1173 | #endif | ||
1174 | } | ||
1175 | } | ||
1176 | #endif | ||
1177 | |||
1160 | static void rawv6_close(struct sock *sk, long timeout) | 1178 | static void rawv6_close(struct sock *sk, long timeout) |
1161 | { | 1179 | { |
1162 | if (inet_sk(sk)->inet_num == IPPROTO_RAW) | 1180 | if (inet_sk(sk)->inet_num == IPPROTO_RAW) |
@@ -1215,6 +1233,7 @@ struct proto rawv6_prot = { | |||
1215 | #ifdef CONFIG_COMPAT | 1233 | #ifdef CONFIG_COMPAT |
1216 | .compat_setsockopt = compat_rawv6_setsockopt, | 1234 | .compat_setsockopt = compat_rawv6_setsockopt, |
1217 | .compat_getsockopt = compat_rawv6_getsockopt, | 1235 | .compat_getsockopt = compat_rawv6_getsockopt, |
1236 | .compat_ioctl = compat_rawv6_ioctl, | ||
1218 | #endif | 1237 | #endif |
1219 | }; | 1238 | }; |
1220 | 1239 | ||
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 1534508f6c68..1c29f95695de 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -113,6 +113,11 @@ static struct dst_ops ip6_dst_ops_template = { | |||
113 | .local_out = __ip6_local_out, | 113 | .local_out = __ip6_local_out, |
114 | }; | 114 | }; |
115 | 115 | ||
116 | static unsigned int ip6_blackhole_default_mtu(const struct dst_entry *dst) | ||
117 | { | ||
118 | return 0; | ||
119 | } | ||
120 | |||
116 | static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) | 121 | static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) |
117 | { | 122 | { |
118 | } | 123 | } |
@@ -122,6 +127,7 @@ static struct dst_ops ip6_dst_blackhole_ops = { | |||
122 | .protocol = cpu_to_be16(ETH_P_IPV6), | 127 | .protocol = cpu_to_be16(ETH_P_IPV6), |
123 | .destroy = ip6_dst_destroy, | 128 | .destroy = ip6_dst_destroy, |
124 | .check = ip6_dst_check, | 129 | .check = ip6_dst_check, |
130 | .default_mtu = ip6_blackhole_default_mtu, | ||
125 | .update_pmtu = ip6_rt_blackhole_update_pmtu, | 131 | .update_pmtu = ip6_rt_blackhole_update_pmtu, |
126 | }; | 132 | }; |
127 | 133 | ||
@@ -194,7 +200,6 @@ static void ip6_dst_destroy(struct dst_entry *dst) | |||
194 | in6_dev_put(idev); | 200 | in6_dev_put(idev); |
195 | } | 201 | } |
196 | if (peer) { | 202 | if (peer) { |
197 | BUG_ON(!(rt->rt6i_flags & RTF_CACHE)); | ||
198 | rt->rt6i_peer = NULL; | 203 | rt->rt6i_peer = NULL; |
199 | inet_putpeer(peer); | 204 | inet_putpeer(peer); |
200 | } | 205 | } |
@@ -204,9 +209,6 @@ void rt6_bind_peer(struct rt6_info *rt, int create) | |||
204 | { | 209 | { |
205 | struct inet_peer *peer; | 210 | struct inet_peer *peer; |
206 | 211 | ||
207 | if (WARN_ON(!(rt->rt6i_flags & RTF_CACHE))) | ||
208 | return; | ||
209 | |||
210 | peer = inet_getpeer_v6(&rt->rt6i_dst.addr, create); | 212 | peer = inet_getpeer_v6(&rt->rt6i_dst.addr, create); |
211 | if (peer && cmpxchg(&rt->rt6i_peer, NULL, peer) != NULL) | 213 | if (peer && cmpxchg(&rt->rt6i_peer, NULL, peer) != NULL) |
212 | inet_putpeer(peer); | 214 | inet_putpeer(peer); |
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c index fa1d8f4e0051..7cb65ef79f9c 100644 --- a/net/ipv6/sysctl_net_ipv6.c +++ b/net/ipv6/sysctl_net_ipv6.c | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <net/addrconf.h> | 15 | #include <net/addrconf.h> |
16 | #include <net/inet_frag.h> | 16 | #include <net/inet_frag.h> |
17 | 17 | ||
18 | static struct ctl_table empty[1]; | ||
19 | |||
18 | static ctl_table ipv6_table_template[] = { | 20 | static ctl_table ipv6_table_template[] = { |
19 | { | 21 | { |
20 | .procname = "route", | 22 | .procname = "route", |
@@ -35,6 +37,12 @@ static ctl_table ipv6_table_template[] = { | |||
35 | .mode = 0644, | 37 | .mode = 0644, |
36 | .proc_handler = proc_dointvec | 38 | .proc_handler = proc_dointvec |
37 | }, | 39 | }, |
40 | { | ||
41 | .procname = "neigh", | ||
42 | .maxlen = 0, | ||
43 | .mode = 0555, | ||
44 | .child = empty, | ||
45 | }, | ||
38 | { } | 46 | { } |
39 | }; | 47 | }; |
40 | 48 | ||
@@ -152,7 +160,6 @@ static struct ctl_table_header *ip6_base; | |||
152 | 160 | ||
153 | int ipv6_static_sysctl_register(void) | 161 | int ipv6_static_sysctl_register(void) |
154 | { | 162 | { |
155 | static struct ctl_table empty[1]; | ||
156 | ip6_base = register_sysctl_paths(net_ipv6_ctl_path, empty); | 163 | ip6_base = register_sysctl_paths(net_ipv6_ctl_path, empty); |
157 | if (ip6_base == NULL) | 164 | if (ip6_base == NULL) |
158 | return -ENOMEM; | 165 | return -ENOMEM; |
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c index 5702de35e2bb..63a1b915a7e4 100644 --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c | |||
@@ -63,6 +63,9 @@ void nf_ct_deliver_cached_events(struct nf_conn *ct) | |||
63 | * this does not harm and it happens very rarely. */ | 63 | * this does not harm and it happens very rarely. */ |
64 | unsigned long missed = e->missed; | 64 | unsigned long missed = e->missed; |
65 | 65 | ||
66 | if (!((events | missed) & e->ctmask)) | ||
67 | goto out_unlock; | ||
68 | |||
66 | ret = notify->fcn(events | missed, &item); | 69 | ret = notify->fcn(events | missed, &item); |
67 | if (unlikely(ret < 0 || missed)) { | 70 | if (unlikely(ret < 0 || missed)) { |
68 | spin_lock_bh(&ct->lock); | 71 | spin_lock_bh(&ct->lock); |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 93297aaceb2b..eead9db6f899 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -667,6 +667,7 @@ restart: | |||
667 | if (ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid, | 667 | if (ctnetlink_fill_info(skb, NETLINK_CB(cb->skb).pid, |
668 | cb->nlh->nlmsg_seq, | 668 | cb->nlh->nlmsg_seq, |
669 | IPCTNL_MSG_CT_NEW, ct) < 0) { | 669 | IPCTNL_MSG_CT_NEW, ct) < 0) { |
670 | nf_conntrack_get(&ct->ct_general); | ||
670 | cb->args[1] = (unsigned long)ct; | 671 | cb->args[1] = (unsigned long)ct; |
671 | goto out; | 672 | goto out; |
672 | } | 673 | } |
diff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c index 88f7c3511c72..73c33a42f87f 100644 --- a/net/netfilter/xt_iprange.c +++ b/net/netfilter/xt_iprange.c | |||
@@ -53,15 +53,13 @@ iprange_mt4(const struct sk_buff *skb, struct xt_action_param *par) | |||
53 | } | 53 | } |
54 | 54 | ||
55 | static inline int | 55 | static inline int |
56 | iprange_ipv6_sub(const struct in6_addr *a, const struct in6_addr *b) | 56 | iprange_ipv6_lt(const struct in6_addr *a, const struct in6_addr *b) |
57 | { | 57 | { |
58 | unsigned int i; | 58 | unsigned int i; |
59 | int r; | ||
60 | 59 | ||
61 | for (i = 0; i < 4; ++i) { | 60 | for (i = 0; i < 4; ++i) { |
62 | r = ntohl(a->s6_addr32[i]) - ntohl(b->s6_addr32[i]); | 61 | if (a->s6_addr32[i] != b->s6_addr32[i]) |
63 | if (r != 0) | 62 | return ntohl(a->s6_addr32[i]) < ntohl(b->s6_addr32[i]); |
64 | return r; | ||
65 | } | 63 | } |
66 | 64 | ||
67 | return 0; | 65 | return 0; |
@@ -75,15 +73,15 @@ iprange_mt6(const struct sk_buff *skb, struct xt_action_param *par) | |||
75 | bool m; | 73 | bool m; |
76 | 74 | ||
77 | if (info->flags & IPRANGE_SRC) { | 75 | if (info->flags & IPRANGE_SRC) { |
78 | m = iprange_ipv6_sub(&iph->saddr, &info->src_min.in6) < 0; | 76 | m = iprange_ipv6_lt(&iph->saddr, &info->src_min.in6); |
79 | m |= iprange_ipv6_sub(&iph->saddr, &info->src_max.in6) > 0; | 77 | m |= iprange_ipv6_lt(&info->src_max.in6, &iph->saddr); |
80 | m ^= !!(info->flags & IPRANGE_SRC_INV); | 78 | m ^= !!(info->flags & IPRANGE_SRC_INV); |
81 | if (m) | 79 | if (m) |
82 | return false; | 80 | return false; |
83 | } | 81 | } |
84 | if (info->flags & IPRANGE_DST) { | 82 | if (info->flags & IPRANGE_DST) { |
85 | m = iprange_ipv6_sub(&iph->daddr, &info->dst_min.in6) < 0; | 83 | m = iprange_ipv6_lt(&iph->daddr, &info->dst_min.in6); |
86 | m |= iprange_ipv6_sub(&iph->daddr, &info->dst_max.in6) > 0; | 84 | m |= iprange_ipv6_lt(&info->dst_max.in6, &iph->daddr); |
87 | m ^= !!(info->flags & IPRANGE_DST_INV); | 85 | m ^= !!(info->flags & IPRANGE_DST_INV); |
88 | if (m) | 86 | if (m) |
89 | return false; | 87 | return false; |
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c index da03597fc893..5c426df87678 100644 --- a/sound/drivers/mtpav.c +++ b/sound/drivers/mtpav.c | |||
@@ -55,14 +55,13 @@ | |||
55 | #include <linux/err.h> | 55 | #include <linux/err.h> |
56 | #include <linux/platform_device.h> | 56 | #include <linux/platform_device.h> |
57 | #include <linux/ioport.h> | 57 | #include <linux/ioport.h> |
58 | #include <linux/io.h> | ||
58 | #include <linux/moduleparam.h> | 59 | #include <linux/moduleparam.h> |
59 | #include <sound/core.h> | 60 | #include <sound/core.h> |
60 | #include <sound/initval.h> | 61 | #include <sound/initval.h> |
61 | #include <sound/rawmidi.h> | 62 | #include <sound/rawmidi.h> |
62 | #include <linux/delay.h> | 63 | #include <linux/delay.h> |
63 | 64 | ||
64 | #include <asm/io.h> | ||
65 | |||
66 | /* | 65 | /* |
67 | * globals | 66 | * globals |
68 | */ | 67 | */ |
diff --git a/sound/oss/Makefile b/sound/oss/Makefile index 96f14dcd0cd1..90ffb99c6b17 100644 --- a/sound/oss/Makefile +++ b/sound/oss/Makefile | |||
@@ -87,7 +87,7 @@ ifeq ($(CONFIG_PSS_HAVE_BOOT),y) | |||
87 | $(obj)/bin2hex pss_synth < $< > $@ | 87 | $(obj)/bin2hex pss_synth < $< > $@ |
88 | else | 88 | else |
89 | $(obj)/pss_boot.h: | 89 | $(obj)/pss_boot.h: |
90 | ( \ | 90 | $(Q)( \ |
91 | echo 'static unsigned char * pss_synth = NULL;'; \ | 91 | echo 'static unsigned char * pss_synth = NULL;'; \ |
92 | echo 'static int pss_synthLen = 0;'; \ | 92 | echo 'static int pss_synthLen = 0;'; \ |
93 | ) > $@ | 93 | ) > $@ |
@@ -102,7 +102,7 @@ ifeq ($(CONFIG_TRIX_HAVE_BOOT),y) | |||
102 | $(obj)/hex2hex -i trix_boot < $< > $@ | 102 | $(obj)/hex2hex -i trix_boot < $< > $@ |
103 | else | 103 | else |
104 | $(obj)/trix_boot.h: | 104 | $(obj)/trix_boot.h: |
105 | ( \ | 105 | $(Q)( \ |
106 | echo 'static unsigned char * trix_boot = NULL;'; \ | 106 | echo 'static unsigned char * trix_boot = NULL;'; \ |
107 | echo 'static int trix_boot_len = 0;'; \ | 107 | echo 'static int trix_boot_len = 0;'; \ |
108 | ) > $@ | 108 | ) > $@ |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 9bb030a469cd..fbe97d32140d 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -85,6 +85,7 @@ struct conexant_spec { | |||
85 | unsigned int auto_mic; | 85 | unsigned int auto_mic; |
86 | int auto_mic_ext; /* autocfg.inputs[] index for ext mic */ | 86 | int auto_mic_ext; /* autocfg.inputs[] index for ext mic */ |
87 | unsigned int need_dac_fix; | 87 | unsigned int need_dac_fix; |
88 | hda_nid_t slave_dig_outs[2]; | ||
88 | 89 | ||
89 | /* capture */ | 90 | /* capture */ |
90 | unsigned int num_adc_nids; | 91 | unsigned int num_adc_nids; |
@@ -127,6 +128,7 @@ struct conexant_spec { | |||
127 | unsigned int ideapad:1; | 128 | unsigned int ideapad:1; |
128 | unsigned int thinkpad:1; | 129 | unsigned int thinkpad:1; |
129 | unsigned int hp_laptop:1; | 130 | unsigned int hp_laptop:1; |
131 | unsigned int asus:1; | ||
130 | 132 | ||
131 | unsigned int ext_mic_present; | 133 | unsigned int ext_mic_present; |
132 | unsigned int recording; | 134 | unsigned int recording; |
@@ -352,6 +354,8 @@ static int conexant_build_pcms(struct hda_codec *codec) | |||
352 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = | 354 | info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = |
353 | spec->dig_in_nid; | 355 | spec->dig_in_nid; |
354 | } | 356 | } |
357 | if (spec->slave_dig_outs[0]) | ||
358 | codec->slave_dig_outs = spec->slave_dig_outs; | ||
355 | } | 359 | } |
356 | 360 | ||
357 | return 0; | 361 | return 0; |
@@ -403,10 +407,16 @@ static int conexant_add_jack(struct hda_codec *codec, | |||
403 | struct conexant_spec *spec; | 407 | struct conexant_spec *spec; |
404 | struct conexant_jack *jack; | 408 | struct conexant_jack *jack; |
405 | const char *name; | 409 | const char *name; |
406 | int err; | 410 | int i, err; |
407 | 411 | ||
408 | spec = codec->spec; | 412 | spec = codec->spec; |
409 | snd_array_init(&spec->jacks, sizeof(*jack), 32); | 413 | snd_array_init(&spec->jacks, sizeof(*jack), 32); |
414 | |||
415 | jack = spec->jacks.list; | ||
416 | for (i = 0; i < spec->jacks.used; i++, jack++) | ||
417 | if (jack->nid == nid) | ||
418 | return 0 ; /* already present */ | ||
419 | |||
410 | jack = snd_array_new(&spec->jacks); | 420 | jack = snd_array_new(&spec->jacks); |
411 | name = (type == SND_JACK_HEADPHONE) ? "Headphone" : "Mic" ; | 421 | name = (type == SND_JACK_HEADPHONE) ? "Headphone" : "Mic" ; |
412 | 422 | ||
@@ -2100,7 +2110,7 @@ static int patch_cxt5051(struct hda_codec *codec) | |||
2100 | static hda_nid_t cxt5066_dac_nids[1] = { 0x10 }; | 2110 | static hda_nid_t cxt5066_dac_nids[1] = { 0x10 }; |
2101 | static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 }; | 2111 | static hda_nid_t cxt5066_adc_nids[3] = { 0x14, 0x15, 0x16 }; |
2102 | static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 }; | 2112 | static hda_nid_t cxt5066_capsrc_nids[1] = { 0x17 }; |
2103 | #define CXT5066_SPDIF_OUT 0x21 | 2113 | static hda_nid_t cxt5066_digout_pin_nids[2] = { 0x20, 0x22 }; |
2104 | 2114 | ||
2105 | /* OLPC's microphone port is DC coupled for use with external sensors, | 2115 | /* OLPC's microphone port is DC coupled for use with external sensors, |
2106 | * therefore we use a 50% mic bias in order to center the input signal with | 2116 | * therefore we use a 50% mic bias in order to center the input signal with |
@@ -2312,6 +2322,19 @@ static void cxt5066_ideapad_automic(struct hda_codec *codec) | |||
2312 | } | 2322 | } |
2313 | } | 2323 | } |
2314 | 2324 | ||
2325 | |||
2326 | /* toggle input of built-in digital mic and mic jack appropriately */ | ||
2327 | static void cxt5066_asus_automic(struct hda_codec *codec) | ||
2328 | { | ||
2329 | unsigned int present; | ||
2330 | |||
2331 | present = snd_hda_jack_detect(codec, 0x1b); | ||
2332 | snd_printdd("CXT5066: external microphone present=%d\n", present); | ||
2333 | snd_hda_codec_write(codec, 0x17, 0, AC_VERB_SET_CONNECT_SEL, | ||
2334 | present ? 1 : 0); | ||
2335 | } | ||
2336 | |||
2337 | |||
2315 | /* toggle input of built-in digital mic and mic jack appropriately */ | 2338 | /* toggle input of built-in digital mic and mic jack appropriately */ |
2316 | static void cxt5066_hp_laptop_automic(struct hda_codec *codec) | 2339 | static void cxt5066_hp_laptop_automic(struct hda_codec *codec) |
2317 | { | 2340 | { |
@@ -2387,79 +2410,55 @@ static void cxt5066_hp_automute(struct hda_codec *codec) | |||
2387 | cxt5066_update_speaker(codec); | 2410 | cxt5066_update_speaker(codec); |
2388 | } | 2411 | } |
2389 | 2412 | ||
2390 | /* unsolicited event for jack sensing */ | 2413 | /* Dispatch the right mic autoswitch function */ |
2391 | static void cxt5066_olpc_unsol_event(struct hda_codec *codec, unsigned int res) | 2414 | static void cxt5066_automic(struct hda_codec *codec) |
2392 | { | 2415 | { |
2393 | struct conexant_spec *spec = codec->spec; | 2416 | struct conexant_spec *spec = codec->spec; |
2394 | snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26); | ||
2395 | switch (res >> 26) { | ||
2396 | case CONEXANT_HP_EVENT: | ||
2397 | cxt5066_hp_automute(codec); | ||
2398 | break; | ||
2399 | case CONEXANT_MIC_EVENT: | ||
2400 | /* ignore mic events in DC mode; we're always using the jack */ | ||
2401 | if (!spec->dc_enable) | ||
2402 | cxt5066_olpc_automic(codec); | ||
2403 | break; | ||
2404 | } | ||
2405 | } | ||
2406 | 2417 | ||
2407 | /* unsolicited event for jack sensing */ | 2418 | if (spec->dell_vostro) |
2408 | static void cxt5066_vostro_event(struct hda_codec *codec, unsigned int res) | ||
2409 | { | ||
2410 | snd_printdd("CXT5066_vostro: unsol event %x (%x)\n", res, res >> 26); | ||
2411 | switch (res >> 26) { | ||
2412 | case CONEXANT_HP_EVENT: | ||
2413 | cxt5066_hp_automute(codec); | ||
2414 | break; | ||
2415 | case CONEXANT_MIC_EVENT: | ||
2416 | cxt5066_vostro_automic(codec); | 2419 | cxt5066_vostro_automic(codec); |
2417 | break; | 2420 | else if (spec->ideapad) |
2418 | } | ||
2419 | } | ||
2420 | |||
2421 | /* unsolicited event for jack sensing */ | ||
2422 | static void cxt5066_ideapad_event(struct hda_codec *codec, unsigned int res) | ||
2423 | { | ||
2424 | snd_printdd("CXT5066_ideapad: unsol event %x (%x)\n", res, res >> 26); | ||
2425 | switch (res >> 26) { | ||
2426 | case CONEXANT_HP_EVENT: | ||
2427 | cxt5066_hp_automute(codec); | ||
2428 | break; | ||
2429 | case CONEXANT_MIC_EVENT: | ||
2430 | cxt5066_ideapad_automic(codec); | 2421 | cxt5066_ideapad_automic(codec); |
2431 | break; | 2422 | else if (spec->thinkpad) |
2432 | } | 2423 | cxt5066_thinkpad_automic(codec); |
2424 | else if (spec->hp_laptop) | ||
2425 | cxt5066_hp_laptop_automic(codec); | ||
2426 | else if (spec->asus) | ||
2427 | cxt5066_asus_automic(codec); | ||
2433 | } | 2428 | } |
2434 | 2429 | ||
2435 | /* unsolicited event for jack sensing */ | 2430 | /* unsolicited event for jack sensing */ |
2436 | static void cxt5066_hp_laptop_event(struct hda_codec *codec, unsigned int res) | 2431 | static void cxt5066_olpc_unsol_event(struct hda_codec *codec, unsigned int res) |
2437 | { | 2432 | { |
2438 | snd_printdd("CXT5066_hp_laptop: unsol event %x (%x)\n", res, res >> 26); | 2433 | struct conexant_spec *spec = codec->spec; |
2434 | snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26); | ||
2439 | switch (res >> 26) { | 2435 | switch (res >> 26) { |
2440 | case CONEXANT_HP_EVENT: | 2436 | case CONEXANT_HP_EVENT: |
2441 | cxt5066_hp_automute(codec); | 2437 | cxt5066_hp_automute(codec); |
2442 | break; | 2438 | break; |
2443 | case CONEXANT_MIC_EVENT: | 2439 | case CONEXANT_MIC_EVENT: |
2444 | cxt5066_hp_laptop_automic(codec); | 2440 | /* ignore mic events in DC mode; we're always using the jack */ |
2441 | if (!spec->dc_enable) | ||
2442 | cxt5066_olpc_automic(codec); | ||
2445 | break; | 2443 | break; |
2446 | } | 2444 | } |
2447 | } | 2445 | } |
2448 | 2446 | ||
2449 | /* unsolicited event for jack sensing */ | 2447 | /* unsolicited event for jack sensing */ |
2450 | static void cxt5066_thinkpad_event(struct hda_codec *codec, unsigned int res) | 2448 | static void cxt5066_unsol_event(struct hda_codec *codec, unsigned int res) |
2451 | { | 2449 | { |
2452 | snd_printdd("CXT5066_thinkpad: unsol event %x (%x)\n", res, res >> 26); | 2450 | snd_printdd("CXT5066: unsol event %x (%x)\n", res, res >> 26); |
2453 | switch (res >> 26) { | 2451 | switch (res >> 26) { |
2454 | case CONEXANT_HP_EVENT: | 2452 | case CONEXANT_HP_EVENT: |
2455 | cxt5066_hp_automute(codec); | 2453 | cxt5066_hp_automute(codec); |
2456 | break; | 2454 | break; |
2457 | case CONEXANT_MIC_EVENT: | 2455 | case CONEXANT_MIC_EVENT: |
2458 | cxt5066_thinkpad_automic(codec); | 2456 | cxt5066_automic(codec); |
2459 | break; | 2457 | break; |
2460 | } | 2458 | } |
2461 | } | 2459 | } |
2462 | 2460 | ||
2461 | |||
2463 | static const struct hda_input_mux cxt5066_analog_mic_boost = { | 2462 | static const struct hda_input_mux cxt5066_analog_mic_boost = { |
2464 | .num_items = 5, | 2463 | .num_items = 5, |
2465 | .items = { | 2464 | .items = { |
@@ -2633,6 +2632,27 @@ static void cxt5066_olpc_capture_cleanup(struct hda_codec *codec) | |||
2633 | spec->recording = 0; | 2632 | spec->recording = 0; |
2634 | } | 2633 | } |
2635 | 2634 | ||
2635 | static void conexant_check_dig_outs(struct hda_codec *codec, | ||
2636 | hda_nid_t *dig_pins, | ||
2637 | int num_pins) | ||
2638 | { | ||
2639 | struct conexant_spec *spec = codec->spec; | ||
2640 | hda_nid_t *nid_loc = &spec->multiout.dig_out_nid; | ||
2641 | int i; | ||
2642 | |||
2643 | for (i = 0; i < num_pins; i++, dig_pins++) { | ||
2644 | unsigned int cfg = snd_hda_codec_get_pincfg(codec, *dig_pins); | ||
2645 | if (get_defcfg_connect(cfg) == AC_JACK_PORT_NONE) | ||
2646 | continue; | ||
2647 | if (snd_hda_get_connections(codec, *dig_pins, nid_loc, 1) != 1) | ||
2648 | continue; | ||
2649 | if (spec->slave_dig_outs[0]) | ||
2650 | nid_loc++; | ||
2651 | else | ||
2652 | nid_loc = spec->slave_dig_outs; | ||
2653 | } | ||
2654 | } | ||
2655 | |||
2636 | static struct hda_input_mux cxt5066_capture_source = { | 2656 | static struct hda_input_mux cxt5066_capture_source = { |
2637 | .num_items = 4, | 2657 | .num_items = 4, |
2638 | .items = { | 2658 | .items = { |
@@ -3039,20 +3059,11 @@ static struct hda_verb cxt5066_init_verbs_hp_laptop[] = { | |||
3039 | /* initialize jack-sensing, too */ | 3059 | /* initialize jack-sensing, too */ |
3040 | static int cxt5066_init(struct hda_codec *codec) | 3060 | static int cxt5066_init(struct hda_codec *codec) |
3041 | { | 3061 | { |
3042 | struct conexant_spec *spec = codec->spec; | ||
3043 | |||
3044 | snd_printdd("CXT5066: init\n"); | 3062 | snd_printdd("CXT5066: init\n"); |
3045 | conexant_init(codec); | 3063 | conexant_init(codec); |
3046 | if (codec->patch_ops.unsol_event) { | 3064 | if (codec->patch_ops.unsol_event) { |
3047 | cxt5066_hp_automute(codec); | 3065 | cxt5066_hp_automute(codec); |
3048 | if (spec->dell_vostro) | 3066 | cxt5066_automic(codec); |
3049 | cxt5066_vostro_automic(codec); | ||
3050 | else if (spec->ideapad) | ||
3051 | cxt5066_ideapad_automic(codec); | ||
3052 | else if (spec->thinkpad) | ||
3053 | cxt5066_thinkpad_automic(codec); | ||
3054 | else if (spec->hp_laptop) | ||
3055 | cxt5066_hp_laptop_automic(codec); | ||
3056 | } | 3067 | } |
3057 | cxt5066_set_mic_boost(codec); | 3068 | cxt5066_set_mic_boost(codec); |
3058 | return 0; | 3069 | return 0; |
@@ -3080,6 +3091,7 @@ enum { | |||
3080 | CXT5066_DELL_VOSTRO, /* Dell Vostro 1015i */ | 3091 | CXT5066_DELL_VOSTRO, /* Dell Vostro 1015i */ |
3081 | CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */ | 3092 | CXT5066_IDEAPAD, /* Lenovo IdeaPad U150 */ |
3082 | CXT5066_THINKPAD, /* Lenovo ThinkPad T410s, others? */ | 3093 | CXT5066_THINKPAD, /* Lenovo ThinkPad T410s, others? */ |
3094 | CXT5066_ASUS, /* Asus K52JU, Lenovo G560 - Int mic at 0x1a and Ext mic at 0x1b */ | ||
3083 | CXT5066_HP_LAPTOP, /* HP Laptop */ | 3095 | CXT5066_HP_LAPTOP, /* HP Laptop */ |
3084 | CXT5066_MODELS | 3096 | CXT5066_MODELS |
3085 | }; | 3097 | }; |
@@ -3091,6 +3103,7 @@ static const char * const cxt5066_models[CXT5066_MODELS] = { | |||
3091 | [CXT5066_DELL_VOSTRO] = "dell-vostro", | 3103 | [CXT5066_DELL_VOSTRO] = "dell-vostro", |
3092 | [CXT5066_IDEAPAD] = "ideapad", | 3104 | [CXT5066_IDEAPAD] = "ideapad", |
3093 | [CXT5066_THINKPAD] = "thinkpad", | 3105 | [CXT5066_THINKPAD] = "thinkpad", |
3106 | [CXT5066_ASUS] = "asus", | ||
3094 | [CXT5066_HP_LAPTOP] = "hp-laptop", | 3107 | [CXT5066_HP_LAPTOP] = "hp-laptop", |
3095 | }; | 3108 | }; |
3096 | 3109 | ||
@@ -3102,7 +3115,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
3102 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), | 3115 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), |
3103 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), | 3116 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), |
3104 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), | 3117 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), |
3105 | SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_HP_LAPTOP), | 3118 | SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS), |
3119 | SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS), | ||
3120 | SND_PCI_QUIRK(0x1043, 0x1993, "Asus U50F", CXT5066_ASUS), | ||
3106 | SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD), | 3121 | SND_PCI_QUIRK(0x1179, 0xff1e, "Toshiba Satellite C650D", CXT5066_IDEAPAD), |
3107 | SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), | 3122 | SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), |
3108 | SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), | 3123 | SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), |
@@ -3111,7 +3126,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
3111 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), | 3126 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), |
3112 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), | 3127 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), |
3113 | SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), | 3128 | SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), |
3129 | SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS), | ||
3114 | SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), | 3130 | SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), |
3131 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS), | ||
3115 | SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ | 3132 | SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ |
3116 | {} | 3133 | {} |
3117 | }; | 3134 | }; |
@@ -3133,7 +3150,8 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
3133 | spec->multiout.max_channels = 2; | 3150 | spec->multiout.max_channels = 2; |
3134 | spec->multiout.num_dacs = ARRAY_SIZE(cxt5066_dac_nids); | 3151 | spec->multiout.num_dacs = ARRAY_SIZE(cxt5066_dac_nids); |
3135 | spec->multiout.dac_nids = cxt5066_dac_nids; | 3152 | spec->multiout.dac_nids = cxt5066_dac_nids; |
3136 | spec->multiout.dig_out_nid = CXT5066_SPDIF_OUT; | 3153 | conexant_check_dig_outs(codec, cxt5066_digout_pin_nids, |
3154 | ARRAY_SIZE(cxt5066_digout_pin_nids)); | ||
3137 | spec->num_adc_nids = 1; | 3155 | spec->num_adc_nids = 1; |
3138 | spec->adc_nids = cxt5066_adc_nids; | 3156 | spec->adc_nids = cxt5066_adc_nids; |
3139 | spec->capsrc_nids = cxt5066_capsrc_nids; | 3157 | spec->capsrc_nids = cxt5066_capsrc_nids; |
@@ -3167,17 +3185,20 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
3167 | spec->num_init_verbs++; | 3185 | spec->num_init_verbs++; |
3168 | spec->dell_automute = 1; | 3186 | spec->dell_automute = 1; |
3169 | break; | 3187 | break; |
3188 | case CXT5066_ASUS: | ||
3170 | case CXT5066_HP_LAPTOP: | 3189 | case CXT5066_HP_LAPTOP: |
3171 | codec->patch_ops.init = cxt5066_init; | 3190 | codec->patch_ops.init = cxt5066_init; |
3172 | codec->patch_ops.unsol_event = cxt5066_hp_laptop_event; | 3191 | codec->patch_ops.unsol_event = cxt5066_unsol_event; |
3173 | spec->init_verbs[spec->num_init_verbs] = | 3192 | spec->init_verbs[spec->num_init_verbs] = |
3174 | cxt5066_init_verbs_hp_laptop; | 3193 | cxt5066_init_verbs_hp_laptop; |
3175 | spec->num_init_verbs++; | 3194 | spec->num_init_verbs++; |
3176 | spec->hp_laptop = 1; | 3195 | spec->hp_laptop = board_config == CXT5066_HP_LAPTOP; |
3196 | spec->asus = board_config == CXT5066_ASUS; | ||
3177 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; | 3197 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; |
3178 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; | 3198 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; |
3179 | /* no S/PDIF out */ | 3199 | /* no S/PDIF out */ |
3180 | spec->multiout.dig_out_nid = 0; | 3200 | if (board_config == CXT5066_HP_LAPTOP) |
3201 | spec->multiout.dig_out_nid = 0; | ||
3181 | /* input source automatically selected */ | 3202 | /* input source automatically selected */ |
3182 | spec->input_mux = NULL; | 3203 | spec->input_mux = NULL; |
3183 | spec->port_d_mode = 0; | 3204 | spec->port_d_mode = 0; |
@@ -3207,7 +3228,7 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
3207 | break; | 3228 | break; |
3208 | case CXT5066_DELL_VOSTRO: | 3229 | case CXT5066_DELL_VOSTRO: |
3209 | codec->patch_ops.init = cxt5066_init; | 3230 | codec->patch_ops.init = cxt5066_init; |
3210 | codec->patch_ops.unsol_event = cxt5066_vostro_event; | 3231 | codec->patch_ops.unsol_event = cxt5066_unsol_event; |
3211 | spec->init_verbs[0] = cxt5066_init_verbs_vostro; | 3232 | spec->init_verbs[0] = cxt5066_init_verbs_vostro; |
3212 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; | 3233 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master_olpc; |
3213 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; | 3234 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; |
@@ -3224,7 +3245,7 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
3224 | break; | 3245 | break; |
3225 | case CXT5066_IDEAPAD: | 3246 | case CXT5066_IDEAPAD: |
3226 | codec->patch_ops.init = cxt5066_init; | 3247 | codec->patch_ops.init = cxt5066_init; |
3227 | codec->patch_ops.unsol_event = cxt5066_ideapad_event; | 3248 | codec->patch_ops.unsol_event = cxt5066_unsol_event; |
3228 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; | 3249 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; |
3229 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; | 3250 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; |
3230 | spec->init_verbs[0] = cxt5066_init_verbs_ideapad; | 3251 | spec->init_verbs[0] = cxt5066_init_verbs_ideapad; |
@@ -3240,7 +3261,7 @@ static int patch_cxt5066(struct hda_codec *codec) | |||
3240 | break; | 3261 | break; |
3241 | case CXT5066_THINKPAD: | 3262 | case CXT5066_THINKPAD: |
3242 | codec->patch_ops.init = cxt5066_init; | 3263 | codec->patch_ops.init = cxt5066_init; |
3243 | codec->patch_ops.unsol_event = cxt5066_thinkpad_event; | 3264 | codec->patch_ops.unsol_event = cxt5066_unsol_event; |
3244 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; | 3265 | spec->mixers[spec->num_mixers++] = cxt5066_mixer_master; |
3245 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; | 3266 | spec->mixers[spec->num_mixers++] = cxt5066_mixers; |
3246 | spec->init_verbs[0] = cxt5066_init_verbs_thinkpad; | 3267 | spec->init_verbs[0] = cxt5066_init_verbs_thinkpad; |
diff --git a/sound/pci/oxygen/oxygen.h b/sound/pci/oxygen/oxygen.h index c2ae63d17cd2..f53897a708b4 100644 --- a/sound/pci/oxygen/oxygen.h +++ b/sound/pci/oxygen/oxygen.h | |||
@@ -92,6 +92,8 @@ struct oxygen_model { | |||
92 | void (*update_dac_volume)(struct oxygen *chip); | 92 | void (*update_dac_volume)(struct oxygen *chip); |
93 | void (*update_dac_mute)(struct oxygen *chip); | 93 | void (*update_dac_mute)(struct oxygen *chip); |
94 | void (*update_center_lfe_mix)(struct oxygen *chip, bool mixed); | 94 | void (*update_center_lfe_mix)(struct oxygen *chip, bool mixed); |
95 | unsigned int (*adjust_dac_routing)(struct oxygen *chip, | ||
96 | unsigned int play_routing); | ||
95 | void (*gpio_changed)(struct oxygen *chip); | 97 | void (*gpio_changed)(struct oxygen *chip); |
96 | void (*uart_input)(struct oxygen *chip); | 98 | void (*uart_input)(struct oxygen *chip); |
97 | void (*ac97_switch)(struct oxygen *chip, | 99 | void (*ac97_switch)(struct oxygen *chip, |
diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 9bff14d5895d..26c7e8bcb229 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c | |||
@@ -180,6 +180,8 @@ void oxygen_update_dac_routing(struct oxygen *chip) | |||
180 | (1 << OXYGEN_PLAY_DAC1_SOURCE_SHIFT) | | 180 | (1 << OXYGEN_PLAY_DAC1_SOURCE_SHIFT) | |
181 | (2 << OXYGEN_PLAY_DAC2_SOURCE_SHIFT) | | 181 | (2 << OXYGEN_PLAY_DAC2_SOURCE_SHIFT) | |
182 | (3 << OXYGEN_PLAY_DAC3_SOURCE_SHIFT); | 182 | (3 << OXYGEN_PLAY_DAC3_SOURCE_SHIFT); |
183 | if (chip->model.adjust_dac_routing) | ||
184 | reg_value = chip->model.adjust_dac_routing(chip, reg_value); | ||
183 | oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value, | 185 | oxygen_write16_masked(chip, OXYGEN_PLAY_ROUTING, reg_value, |
184 | OXYGEN_PLAY_DAC0_SOURCE_MASK | | 186 | OXYGEN_PLAY_DAC0_SOURCE_MASK | |
185 | OXYGEN_PLAY_DAC1_SOURCE_MASK | | 187 | OXYGEN_PLAY_DAC1_SOURCE_MASK | |
diff --git a/sound/pci/oxygen/xonar_dg.c b/sound/pci/oxygen/xonar_dg.c index e1fa602eba79..bc6eb58be380 100644 --- a/sound/pci/oxygen/xonar_dg.c +++ b/sound/pci/oxygen/xonar_dg.c | |||
@@ -24,6 +24,11 @@ | |||
24 | * | 24 | * |
25 | * SPI 0 -> CS4245 | 25 | * SPI 0 -> CS4245 |
26 | * | 26 | * |
27 | * I²S 1 -> CS4245 | ||
28 | * I²S 2 -> CS4361 (center/LFE) | ||
29 | * I²S 3 -> CS4361 (surround) | ||
30 | * I²S 4 -> CS4361 (front) | ||
31 | * | ||
27 | * GPIO 3 <- ? | 32 | * GPIO 3 <- ? |
28 | * GPIO 4 <- headphone detect | 33 | * GPIO 4 <- headphone detect |
29 | * GPIO 5 -> route input jack to line-in (0) or mic-in (1) | 34 | * GPIO 5 -> route input jack to line-in (0) or mic-in (1) |
@@ -36,6 +41,7 @@ | |||
36 | * input 1 <- aux | 41 | * input 1 <- aux |
37 | * input 2 <- front mic | 42 | * input 2 <- front mic |
38 | * input 4 <- line/mic | 43 | * input 4 <- line/mic |
44 | * DAC out -> headphones | ||
39 | * aux out -> front panel headphones | 45 | * aux out -> front panel headphones |
40 | */ | 46 | */ |
41 | 47 | ||
@@ -207,6 +213,35 @@ static void set_cs4245_adc_params(struct oxygen *chip, | |||
207 | cs4245_write_cached(chip, CS4245_ADC_CTRL, value); | 213 | cs4245_write_cached(chip, CS4245_ADC_CTRL, value); |
208 | } | 214 | } |
209 | 215 | ||
216 | static inline unsigned int shift_bits(unsigned int value, | ||
217 | unsigned int shift_from, | ||
218 | unsigned int shift_to, | ||
219 | unsigned int mask) | ||
220 | { | ||
221 | if (shift_from < shift_to) | ||
222 | return (value << (shift_to - shift_from)) & mask; | ||
223 | else | ||
224 | return (value >> (shift_from - shift_to)) & mask; | ||
225 | } | ||
226 | |||
227 | static unsigned int adjust_dg_dac_routing(struct oxygen *chip, | ||
228 | unsigned int play_routing) | ||
229 | { | ||
230 | return (play_routing & OXYGEN_PLAY_DAC0_SOURCE_MASK) | | ||
231 | shift_bits(play_routing, | ||
232 | OXYGEN_PLAY_DAC2_SOURCE_SHIFT, | ||
233 | OXYGEN_PLAY_DAC1_SOURCE_SHIFT, | ||
234 | OXYGEN_PLAY_DAC1_SOURCE_MASK) | | ||
235 | shift_bits(play_routing, | ||
236 | OXYGEN_PLAY_DAC1_SOURCE_SHIFT, | ||
237 | OXYGEN_PLAY_DAC2_SOURCE_SHIFT, | ||
238 | OXYGEN_PLAY_DAC2_SOURCE_MASK) | | ||
239 | shift_bits(play_routing, | ||
240 | OXYGEN_PLAY_DAC0_SOURCE_SHIFT, | ||
241 | OXYGEN_PLAY_DAC3_SOURCE_SHIFT, | ||
242 | OXYGEN_PLAY_DAC3_SOURCE_MASK); | ||
243 | } | ||
244 | |||
210 | static int output_switch_info(struct snd_kcontrol *ctl, | 245 | static int output_switch_info(struct snd_kcontrol *ctl, |
211 | struct snd_ctl_elem_info *info) | 246 | struct snd_ctl_elem_info *info) |
212 | { | 247 | { |
@@ -557,6 +592,7 @@ struct oxygen_model model_xonar_dg = { | |||
557 | .resume = dg_resume, | 592 | .resume = dg_resume, |
558 | .set_dac_params = set_cs4245_dac_params, | 593 | .set_dac_params = set_cs4245_dac_params, |
559 | .set_adc_params = set_cs4245_adc_params, | 594 | .set_adc_params = set_cs4245_adc_params, |
595 | .adjust_dac_routing = adjust_dg_dac_routing, | ||
560 | .dump_registers = dump_cs4245_registers, | 596 | .dump_registers = dump_cs4245_registers, |
561 | .model_data_size = sizeof(struct dg), | 597 | .model_data_size = sizeof(struct dg), |
562 | .device_config = PLAYBACK_0_TO_I2S | | 598 | .device_config = PLAYBACK_0_TO_I2S | |
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h index bd26e092aead..6ce9ad700290 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.h +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #define __PDAUDIOCF_H | 22 | #define __PDAUDIOCF_H |
23 | 23 | ||
24 | #include <sound/pcm.h> | 24 | #include <sound/pcm.h> |
25 | #include <asm/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <pcmcia/cistpl.h> | 27 | #include <pcmcia/cistpl.h> |
28 | #include <pcmcia/ds.h> | 28 | #include <pcmcia/ds.h> |
diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c index 989e04abb520..fe33e122e372 100644 --- a/sound/pcmcia/vx/vxp_ops.c +++ b/sound/pcmcia/vx/vxp_ops.c | |||
@@ -23,8 +23,8 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
25 | #include <linux/firmware.h> | 25 | #include <linux/firmware.h> |
26 | #include <linux/io.h> | ||
26 | #include <sound/core.h> | 27 | #include <sound/core.h> |
27 | #include <asm/io.h> | ||
28 | #include "vxpocket.h" | 28 | #include "vxpocket.h" |
29 | 29 | ||
30 | 30 | ||
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c index 46dbfd067f79..347a567b01e1 100644 --- a/sound/soc/codecs/cq93vc.c +++ b/sound/soc/codecs/cq93vc.c | |||
@@ -153,7 +153,7 @@ static int cq93vc_resume(struct snd_soc_codec *codec) | |||
153 | 153 | ||
154 | static int cq93vc_probe(struct snd_soc_codec *codec) | 154 | static int cq93vc_probe(struct snd_soc_codec *codec) |
155 | { | 155 | { |
156 | struct davinci_vc *davinci_vc = codec->dev->platform_data; | 156 | struct davinci_vc *davinci_vc = snd_soc_codec_get_drvdata(codec); |
157 | 157 | ||
158 | davinci_vc->cq93vc.codec = codec; | 158 | davinci_vc->cq93vc.codec = codec; |
159 | codec->control_data = davinci_vc; | 159 | codec->control_data = davinci_vc; |
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c index 03d1e860d229..bb4bf65b9e7e 100644 --- a/sound/soc/codecs/cx20442.c +++ b/sound/soc/codecs/cx20442.c | |||
@@ -367,9 +367,12 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec) | |||
367 | return 0; | 367 | return 0; |
368 | } | 368 | } |
369 | 369 | ||
370 | static const u8 cx20442_reg = CX20442_TELOUT | CX20442_MIC; | ||
371 | |||
370 | static struct snd_soc_codec_driver cx20442_codec_dev = { | 372 | static struct snd_soc_codec_driver cx20442_codec_dev = { |
371 | .probe = cx20442_codec_probe, | 373 | .probe = cx20442_codec_probe, |
372 | .remove = cx20442_codec_remove, | 374 | .remove = cx20442_codec_remove, |
375 | .reg_cache_default = &cx20442_reg, | ||
373 | .reg_cache_size = 1, | 376 | .reg_cache_size = 1, |
374 | .reg_word_size = sizeof(u8), | 377 | .reg_word_size = sizeof(u8), |
375 | .read = cx20442_read_reg_cache, | 378 | .read = cx20442_read_reg_cache, |
diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c index 2101bdcee21f..3167be689621 100644 --- a/sound/soc/omap/ams-delta.c +++ b/sound/soc/omap/ams-delta.c | |||
@@ -507,8 +507,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd) | |||
507 | /* Set up digital mute if not provided by the codec */ | 507 | /* Set up digital mute if not provided by the codec */ |
508 | if (!codec_dai->driver->ops) { | 508 | if (!codec_dai->driver->ops) { |
509 | codec_dai->driver->ops = &ams_delta_dai_ops; | 509 | codec_dai->driver->ops = &ams_delta_dai_ops; |
510 | } else if (!codec_dai->driver->ops->digital_mute) { | ||
511 | codec_dai->driver->ops->digital_mute = ams_delta_digital_mute; | ||
512 | } else { | 510 | } else { |
513 | ams_delta_ops.startup = ams_delta_startup; | 511 | ams_delta_ops.startup = ams_delta_startup; |
514 | ams_delta_ops.shutdown = ams_delta_shutdown; | 512 | ams_delta_ops.shutdown = ams_delta_shutdown; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index bac7291b6ff6..c4b60610beb0 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1664,9 +1664,6 @@ static int soc_probe_aux_dev(struct snd_soc_card *card, int num) | |||
1664 | goto out; | 1664 | goto out; |
1665 | 1665 | ||
1666 | found: | 1666 | found: |
1667 | if (!try_module_get(codec->dev->driver->owner)) | ||
1668 | return -ENODEV; | ||
1669 | |||
1670 | ret = soc_probe_codec(card, codec); | 1667 | ret = soc_probe_codec(card, codec); |
1671 | if (ret < 0) | 1668 | if (ret < 0) |
1672 | return ret; | 1669 | return ret; |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 499730ab5638..8194f150bab7 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -1742,7 +1742,7 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
1742 | int max = mc->max; | 1742 | int max = mc->max; |
1743 | unsigned int mask = (1 << fls(max)) - 1; | 1743 | unsigned int mask = (1 << fls(max)) - 1; |
1744 | unsigned int invert = mc->invert; | 1744 | unsigned int invert = mc->invert; |
1745 | unsigned int val, val_mask; | 1745 | unsigned int val; |
1746 | int connect, change; | 1746 | int connect, change; |
1747 | struct snd_soc_dapm_update update; | 1747 | struct snd_soc_dapm_update update; |
1748 | 1748 | ||
@@ -1750,13 +1750,13 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | |||
1750 | 1750 | ||
1751 | if (invert) | 1751 | if (invert) |
1752 | val = max - val; | 1752 | val = max - val; |
1753 | val_mask = mask << shift; | 1753 | mask = mask << shift; |
1754 | val = val << shift; | 1754 | val = val << shift; |
1755 | 1755 | ||
1756 | mutex_lock(&widget->codec->mutex); | 1756 | mutex_lock(&widget->codec->mutex); |
1757 | widget->value = val; | 1757 | widget->value = val; |
1758 | 1758 | ||
1759 | change = snd_soc_test_bits(widget->codec, reg, val_mask, val); | 1759 | change = snd_soc_test_bits(widget->codec, reg, mask, val); |
1760 | if (change) { | 1760 | if (change) { |
1761 | if (val) | 1761 | if (val) |
1762 | /* new connection */ | 1762 | /* new connection */ |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 2720bc1d578b..211063eed474 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -122,7 +122,7 @@ int __perf_evsel__read(struct perf_evsel *evsel, | |||
122 | int cpu, thread; | 122 | int cpu, thread; |
123 | struct perf_counts_values *aggr = &evsel->counts->aggr, count; | 123 | struct perf_counts_values *aggr = &evsel->counts->aggr, count; |
124 | 124 | ||
125 | aggr->val = 0; | 125 | aggr->val = aggr->ena = aggr->run = 0; |
126 | 126 | ||
127 | for (cpu = 0; cpu < ncpus; cpu++) { | 127 | for (cpu = 0; cpu < ncpus; cpu++) { |
128 | for (thread = 0; thread < nthreads; thread++) { | 128 | for (thread = 0; thread < nthreads; thread++) { |