Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge commit 'v3.0' into x86/cpu

+1356 -703
-1
Documentation/filesystems/nilfs2.txt
··· 40 40 - POSIX ACLs 41 41 - quotas 42 42 - fsck 43 - - resize 44 43 - defragmentation 45 44 46 45 Mount options
+1 -1
Documentation/networking/ip-sysctl.txt
··· 346 346 when RTO retransmissions remain unacknowledged. 347 347 See tcp_retries2 for more details. 348 348 349 - The default value is 7. 349 + The default value is 8. 350 350 If your machine is a loaded WEB server, 351 351 you should think about lowering this value, such sockets 352 352 may consume significant resources. Cf. tcp_max_orphans.
+1 -1
Documentation/x86/boot.txt
··· 674 674 675 675 Field name: init_size 676 676 Type: read 677 - Offset/size: 0x25c/4 677 + Offset/size: 0x260/4 678 678 679 679 This field indicates the amount of linear contiguous memory starting 680 680 at the kernel runtime start address that the kernel needs before it
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 0 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc7 4 + EXTRAVERSION = 5 5 NAME = Sneaky Weasel 6 6 7 7 # *DOCUMENTATION*
+2 -2
arch/arm/mach-davinci/board-dm365-evm.c
··· 520 520 */ 521 521 if (have_imager()) { 522 522 label = "HD imager"; 523 - mux |= 1; 523 + mux |= 2; 524 524 525 525 /* externally mux MMC1/ENET/AIC33 to imager */ 526 526 mux |= BIT(6) | BIT(5) | BIT(3); ··· 540 540 resets &= ~BIT(1); 541 541 542 542 if (have_tvp7002()) { 543 - mux |= 2; 543 + mux |= 1; 544 544 resets &= ~BIT(2); 545 545 label = "tvp7002 HD"; 546 546 } else {
+16 -5
arch/arm/mach-davinci/gpio.c
··· 254 254 { 255 255 struct davinci_gpio_regs __iomem *g; 256 256 u32 mask = 0xffff; 257 + struct davinci_gpio_controller *d; 257 258 258 - g = (__force struct davinci_gpio_regs __iomem *) irq_desc_get_handler_data(desc); 259 + d = (struct davinci_gpio_controller *)irq_desc_get_handler_data(desc); 260 + g = (struct davinci_gpio_regs __iomem *)d->regs; 259 261 260 262 /* we only care about one bank */ 261 263 if (irq & 1) ··· 276 274 if (!status) 277 275 break; 278 276 __raw_writel(status, &g->intstat); 279 - if (irq & 1) 280 - status >>= 16; 281 277 282 278 /* now demux them to the right lowlevel handler */ 283 - n = (int)irq_get_handler_data(irq); 279 + n = d->irq_base; 280 + if (irq & 1) { 281 + n += 16; 282 + status >>= 16; 283 + } 284 + 284 285 while (status) { 285 286 res = ffs(status); 286 287 n += res; ··· 429 424 430 425 /* set up all irqs in this bank */ 431 426 irq_set_chained_handler(bank_irq, gpio_irq_handler); 432 - irq_set_handler_data(bank_irq, (__force void *)g); 427 + 428 + /* 429 + * Each chip handles 32 gpios, and each irq bank consists of 16 430 + * gpio irqs. Pass the irq bank's corresponding controller to 431 + * the chained irq handler. 432 + */ 433 + irq_set_handler_data(bank_irq, &chips[gpio / 32]); 433 434 434 435 for (i = 0; i < 16 && gpio < ngpio; i++, irq++, gpio++) { 435 436 irq_set_chip(irq, &gpio_irqchip);
+7 -1
arch/arm/mach-davinci/irq.c
··· 52 52 struct irq_chip_type *ct; 53 53 54 54 gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq); 55 + if (!gc) { 56 + pr_err("%s: irq_alloc_generic_chip for IRQ %u failed\n", 57 + __func__, irq_start); 58 + return; 59 + } 60 + 55 61 ct = gc->chip_types; 56 - ct->chip.irq_ack = irq_gc_ack; 62 + ct->chip.irq_ack = irq_gc_ack_set_bit; 57 63 ct->chip.irq_mask = irq_gc_mask_clr_bit; 58 64 ct->chip.irq_unmask = irq_gc_mask_set_bit; 59 65
+8 -2
arch/arm/mach-ixp4xx/common.c
··· 419 419 /* 420 420 * clocksource 421 421 */ 422 + 423 + static cycle_t ixp4xx_clocksource_read(struct clocksource *c) 424 + { 425 + return *IXP4XX_OSTS; 426 + } 427 + 422 428 unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ; 423 429 EXPORT_SYMBOL(ixp4xx_timer_freq); 424 430 static void __init ixp4xx_clocksource_init(void) 425 431 { 426 432 init_sched_clock(&cd, ixp4xx_update_sched_clock, 32, ixp4xx_timer_freq); 427 433 428 - clocksource_mmio_init(&IXP4XX_OSTS, "OSTS", ixp4xx_timer_freq, 200, 32, 429 - clocksource_mmio_readl_up); 434 + clocksource_mmio_init(NULL, "OSTS", ixp4xx_timer_freq, 200, 32, 435 + ixp4xx_clocksource_read); 430 436 } 431 437 432 438 /*
+1 -1
arch/arm/mach-mmp/pxa168.c
··· 79 79 static APBC_CLK(ssp5, PXA168_SSP5, 4, 0); 80 80 static APBC_CLK(keypad, PXA168_KPC, 0, 32000); 81 81 82 - static APMU_CLK(nand, NAND, 0x01db, 208000000); 82 + static APMU_CLK(nand, NAND, 0x19b, 156000000); 83 83 static APMU_CLK(lcd, LCD, 0x7f, 312000000); 84 84 85 85 /* device and clock bindings */
+1 -1
arch/arm/mach-mmp/pxa910.c
··· 110 110 static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); 111 111 static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); 112 112 113 - static APMU_CLK(nand, NAND, 0x01db, 208000000); 113 + static APMU_CLK(nand, NAND, 0x19b, 156000000); 114 114 static APMU_CLK(u2o, USB, 0x1b, 480000000); 115 115 116 116 /* device and clock bindings */
+2 -2
arch/arm/mach-pxa/mfp-pxa2xx.c
··· 347 347 if ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) && 348 348 (GPDR(i) & GPIO_bit(i))) { 349 349 if (GPLR(i) & GPIO_bit(i)) 350 - PGSR(i) |= GPIO_bit(i); 350 + PGSR(gpio_to_bank(i)) |= GPIO_bit(i); 351 351 else 352 - PGSR(i) &= ~GPIO_bit(i); 352 + PGSR(gpio_to_bank(i)) &= ~GPIO_bit(i); 353 353 } 354 354 } 355 355
+19 -17
arch/arm/mach-pxa/raumfeld.c
··· 573 573 .xres = 480, 574 574 .yres = 272, 575 575 .bpp = 16, 576 - .hsync_len = 4, 576 + .hsync_len = 41, 577 577 .left_margin = 2, 578 578 .right_margin = 1, 579 - .vsync_len = 1, 579 + .vsync_len = 10, 580 580 .upper_margin = 3, 581 581 .lower_margin = 1, 582 582 .sync = 0, ··· 596 596 { 597 597 int ret; 598 598 599 - pxa_set_fb_info(NULL, &raumfeld_sharp_lcd_info); 600 - 601 - /* Earlier devices had the backlight regulator controlled 602 - * via PWM, later versions use another controller for that */ 603 - if ((system_rev & 0xff) < 2) { 604 - mfp_cfg_t raumfeld_pwm_pin_config = GPIO17_PWM0_OUT; 605 - pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1); 606 - platform_device_register(&raumfeld_pwm_backlight_device); 607 - } else 608 - platform_device_register(&raumfeld_lt3593_device); 609 - 610 599 ret = gpio_request(GPIO_TFT_VA_EN, "display VA enable"); 611 600 if (ret < 0) 612 601 pr_warning("Unable to request GPIO_TFT_VA_EN\n"); 613 602 else 614 603 gpio_direction_output(GPIO_TFT_VA_EN, 1); 604 + 605 + msleep(100); 615 606 616 607 ret = gpio_request(GPIO_DISPLAY_ENABLE, "display enable"); 617 608 if (ret < 0) ··· 610 619 else 611 620 gpio_direction_output(GPIO_DISPLAY_ENABLE, 1); 612 621 622 + /* Hardware revision 2 has the backlight regulator controlled 623 + * by an LT3593, earlier and later devices use PWM for that. */ 624 + if ((system_rev & 0xff) == 2) { 625 + platform_device_register(&raumfeld_lt3593_device); 626 + } else { 627 + mfp_cfg_t raumfeld_pwm_pin_config = GPIO17_PWM0_OUT; 628 + pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1); 629 + platform_device_register(&raumfeld_pwm_backlight_device); 630 + } 631 + 632 + pxa_set_fb_info(NULL, &raumfeld_sharp_lcd_info); 613 633 platform_device_register(&pxa3xx_device_gcu); 614 634 } 615 635 ··· 659 657 660 658 #define SPI_AK4104 \ 661 659 { \ 662 - .modalias = "ak4104", \ 663 - .max_speed_hz = 10000, \ 664 - .bus_num = 0, \ 665 - .chip_select = 0, \ 660 + .modalias = "ak4104-codec", \ 661 + .max_speed_hz = 10000, \ 662 + .bus_num = 0, \ 663 + .chip_select = 0, \ 666 664 .controller_data = (void *) GPIO_SPDIF_CS, \ 667 665 } 668 666
+7 -7
arch/arm/mach-s3c64xx/dma.c
··· 113 113 return chan; 114 114 } 115 115 116 - int s3c2410_dma_config(unsigned int channel, int xferunit) 116 + int s3c2410_dma_config(enum dma_ch channel, int xferunit) 117 117 { 118 118 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 119 119 ··· 297 297 return 0; 298 298 } 299 299 300 - int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op) 300 + int s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op) 301 301 { 302 302 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 303 303 ··· 331 331 * 332 332 */ 333 333 334 - int s3c2410_dma_enqueue(unsigned int channel, void *id, 334 + int s3c2410_dma_enqueue(enum dma_ch channel, void *id, 335 335 dma_addr_t data, int size) 336 336 { 337 337 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); ··· 415 415 EXPORT_SYMBOL(s3c2410_dma_enqueue); 416 416 417 417 418 - int s3c2410_dma_devconfig(unsigned int channel, 418 + int s3c2410_dma_devconfig(enum dma_ch channel, 419 419 enum s3c2410_dmasrc source, 420 420 unsigned long devaddr) 421 421 { ··· 463 463 EXPORT_SYMBOL(s3c2410_dma_devconfig); 464 464 465 465 466 - int s3c2410_dma_getposition(unsigned int channel, 466 + int s3c2410_dma_getposition(enum dma_ch channel, 467 467 dma_addr_t *src, dma_addr_t *dst) 468 468 { 469 469 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); ··· 487 487 * get control of an dma channel 488 488 */ 489 489 490 - int s3c2410_dma_request(unsigned int channel, 490 + int s3c2410_dma_request(enum dma_ch channel, 491 491 struct s3c2410_dma_client *client, 492 492 void *dev) 493 493 { ··· 533 533 * allowed to go through. 534 534 */ 535 535 536 - int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) 536 + int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *client) 537 537 { 538 538 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 539 539 unsigned long flags;
+1 -1
arch/arm/plat-orion/gpio.c
··· 432 432 ct->regs.mask = ochip->mask_offset + GPIO_EDGE_MASK_OFF; 433 433 ct->regs.ack = GPIO_EDGE_CAUSE_OFF; 434 434 ct->type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; 435 - ct->chip.irq_ack = irq_gc_ack; 435 + ct->chip.irq_ack = irq_gc_ack_clr_bit; 436 436 ct->chip.irq_mask = irq_gc_mask_clr_bit; 437 437 ct->chip.irq_unmask = irq_gc_mask_set_bit; 438 438 ct->chip.irq_set_type = gpio_irq_set_type;
+5 -5
arch/arm/plat-pxa/gpio.c
··· 50 50 return container_of(c, struct pxa_gpio_chip, chip)->regbase; 51 51 } 52 52 53 - static inline struct pxa_gpio_chip *gpio_to_chip(unsigned gpio) 53 + static inline struct pxa_gpio_chip *gpio_to_pxachip(unsigned gpio) 54 54 { 55 55 return &pxa_gpio_chips[gpio_to_bank(gpio)]; 56 56 } ··· 161 161 int gpio = irq_to_gpio(d->irq); 162 162 unsigned long gpdr, mask = GPIO_bit(gpio); 163 163 164 - c = gpio_to_chip(gpio); 164 + c = gpio_to_pxachip(gpio); 165 165 166 166 if (type == IRQ_TYPE_PROBE) { 167 167 /* Don't mess with enabled GPIOs using preconfigured edges or ··· 230 230 static void pxa_ack_muxed_gpio(struct irq_data *d) 231 231 { 232 232 int gpio = irq_to_gpio(d->irq); 233 - struct pxa_gpio_chip *c = gpio_to_chip(gpio); 233 + struct pxa_gpio_chip *c = gpio_to_pxachip(gpio); 234 234 235 235 __raw_writel(GPIO_bit(gpio), c->regbase + GEDR_OFFSET); 236 236 } ··· 238 238 static void pxa_mask_muxed_gpio(struct irq_data *d) 239 239 { 240 240 int gpio = irq_to_gpio(d->irq); 241 - struct pxa_gpio_chip *c = gpio_to_chip(gpio); 241 + struct pxa_gpio_chip *c = gpio_to_pxachip(gpio); 242 242 uint32_t grer, gfer; 243 243 244 244 c->irq_mask &= ~GPIO_bit(gpio); ··· 252 252 static void pxa_unmask_muxed_gpio(struct irq_data *d) 253 253 { 254 254 int gpio = irq_to_gpio(d->irq); 255 - struct pxa_gpio_chip *c = gpio_to_chip(gpio); 255 + struct pxa_gpio_chip *c = gpio_to_pxachip(gpio); 256 256 257 257 c->irq_mask |= GPIO_bit(gpio); 258 258 update_edge_detect(c);
+6 -6
arch/arm/plat-s3c24xx/dma.c
··· 712 712 * get control of an dma channel 713 713 */ 714 714 715 - int s3c2410_dma_request(unsigned int channel, 715 + int s3c2410_dma_request(enum dma_ch channel, 716 716 struct s3c2410_dma_client *client, 717 717 void *dev) 718 718 { ··· 783 783 * allowed to go through. 784 784 */ 785 785 786 - int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) 786 + int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *client) 787 787 { 788 788 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 789 789 unsigned long flags; ··· 974 974 } 975 975 976 976 int 977 - s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op) 977 + s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op) 978 978 { 979 979 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 980 980 ··· 1021 1021 * xfersize: size of unit in bytes (1,2,4) 1022 1022 */ 1023 1023 1024 - int s3c2410_dma_config(unsigned int channel, 1024 + int s3c2410_dma_config(enum dma_ch channel, 1025 1025 int xferunit) 1026 1026 { 1027 1027 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); ··· 1100 1100 * devaddr: physical address of the source 1101 1101 */ 1102 1102 1103 - int s3c2410_dma_devconfig(unsigned int channel, 1103 + int s3c2410_dma_devconfig(enum dma_ch channel, 1104 1104 enum s3c2410_dmasrc source, 1105 1105 unsigned long devaddr) 1106 1106 { ··· 1173 1173 * returns the current transfer points for the dma source and destination 1174 1174 */ 1175 1175 1176 - int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *dst) 1176 + int s3c2410_dma_getposition(enum dma_ch channel, dma_addr_t *src, dma_addr_t *dst) 1177 1177 { 1178 1178 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 1179 1179
+1 -1
arch/arm/plat-s5p/irq-gpioint.c
··· 152 152 if (!gc) 153 153 return -ENOMEM; 154 154 ct = gc->chip_types; 155 - ct->chip.irq_ack = irq_gc_ack; 155 + ct->chip.irq_ack = irq_gc_ack_set_bit; 156 156 ct->chip.irq_mask = irq_gc_mask_set_bit; 157 157 ct->chip.irq_unmask = irq_gc_mask_clr_bit; 158 158 ct->chip.irq_set_type = s5p_gpioint_set_type,
+3 -3
arch/arm/plat-samsung/dma.c
··· 41 41 * irq? 42 42 */ 43 43 44 - int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn) 44 + int s3c2410_dma_set_opfn(enum dma_ch channel, s3c2410_dma_opfn_t rtn) 45 45 { 46 46 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 47 47 ··· 56 56 } 57 57 EXPORT_SYMBOL(s3c2410_dma_set_opfn); 58 58 59 - int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn) 59 + int s3c2410_dma_set_buffdone_fn(enum dma_ch channel, s3c2410_dma_cbfn_t rtn) 60 60 { 61 61 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 62 62 ··· 71 71 } 72 72 EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn); 73 73 74 - int s3c2410_dma_setflags(unsigned int channel, unsigned int flags) 74 + int s3c2410_dma_setflags(enum dma_ch channel, unsigned int flags) 75 75 { 76 76 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 77 77
+11 -10
arch/arm/plat-samsung/include/plat/dma.h
··· 42 42 }; 43 43 44 44 struct s3c2410_dma_chan; 45 + enum dma_ch; 45 46 46 47 /* s3c2410_dma_cbfn_t 47 48 * ··· 63 62 * request a dma channel exclusivley 64 63 */ 65 64 66 - extern int s3c2410_dma_request(unsigned int channel, 65 + extern int s3c2410_dma_request(enum dma_ch channel, 67 66 struct s3c2410_dma_client *, void *dev); 68 67 69 68 ··· 72 71 * change the state of the dma channel 73 72 */ 74 73 75 - extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op); 74 + extern int s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op); 76 75 77 76 /* s3c2410_dma_setflags 78 77 * 79 78 * set the channel's flags to a given state 80 79 */ 81 80 82 - extern int s3c2410_dma_setflags(unsigned int channel, 81 + extern int s3c2410_dma_setflags(enum dma_ch channel, 83 82 unsigned int flags); 84 83 85 84 /* s3c2410_dma_free ··· 87 86 * free the dma channel (will also abort any outstanding operations) 88 87 */ 89 88 90 - extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *); 89 + extern int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *); 91 90 92 91 /* s3c2410_dma_enqueue 93 92 * ··· 96 95 * drained before the buffer is given to the DMA system. 97 96 */ 98 97 99 - extern int s3c2410_dma_enqueue(unsigned int channel, void *id, 98 + extern int s3c2410_dma_enqueue(enum dma_ch channel, void *id, 100 99 dma_addr_t data, int size); 101 100 102 101 /* s3c2410_dma_config ··· 104 103 * configure the dma channel 105 104 */ 106 105 107 - extern int s3c2410_dma_config(unsigned int channel, int xferunit); 106 + extern int s3c2410_dma_config(enum dma_ch channel, int xferunit); 108 107 109 108 /* s3c2410_dma_devconfig 110 109 * 111 110 * configure the device we're talking to 112 111 */ 113 112 114 - extern int s3c2410_dma_devconfig(unsigned int channel, 113 + extern int s3c2410_dma_devconfig(enum dma_ch channel, 115 114 enum s3c2410_dmasrc source, unsigned long devaddr); 116 115 117 116 /* s3c2410_dma_getposition ··· 119 118 * get the position that the dma transfer is currently at 120 119 */ 121 120 122 - extern int s3c2410_dma_getposition(unsigned int channel, 121 + extern int s3c2410_dma_getposition(enum dma_ch channel, 123 122 dma_addr_t *src, dma_addr_t *dest); 124 123 125 - extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn); 126 - extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn); 124 + extern int s3c2410_dma_set_opfn(enum dma_ch, s3c2410_dma_opfn_t rtn); 125 + extern int s3c2410_dma_set_buffdone_fn(enum dma_ch, s3c2410_dma_cbfn_t rtn); 127 126 128 127
+8 -1
arch/arm/plat-samsung/irq-uart.c
··· 54 54 55 55 gc = irq_alloc_generic_chip("s3c-uart", 1, uirq->base_irq, reg_base, 56 56 handle_level_irq); 57 + 58 + if (!gc) { 59 + pr_err("%s: irq_alloc_generic_chip for IRQ %u failed\n", 60 + __func__, uirq->base_irq); 61 + return; 62 + } 63 + 57 64 ct = gc->chip_types; 58 - ct->chip.irq_ack = irq_gc_ack; 65 + ct->chip.irq_ack = irq_gc_ack_set_bit; 59 66 ct->chip.irq_mask = irq_gc_mask_set_bit; 60 67 ct->chip.irq_unmask = irq_gc_mask_clr_bit; 61 68 ct->regs.ack = S3C64XX_UINTP;
+7
arch/arm/plat-samsung/irq-vic-timer.c
··· 54 54 55 55 s3c_tgc = irq_alloc_generic_chip("s3c-timer", 1, timer_irq, 56 56 S3C64XX_TINT_CSTAT, handle_level_irq); 57 + 58 + if (!s3c_tgc) { 59 + pr_err("%s: irq_alloc_generic_chip for IRQ %d failed\n", 60 + __func__, timer_irq); 61 + return; 62 + } 63 + 57 64 ct = s3c_tgc->chip_types; 58 65 ct->chip.irq_mask = irq_gc_mask_clr_bit; 59 66 ct->chip.irq_unmask = irq_gc_mask_set_bit;
+6 -16
arch/mips/kernel/i8259.c
··· 14 14 #include <linux/interrupt.h> 15 15 #include <linux/kernel.h> 16 16 #include <linux/spinlock.h> 17 - #include <linux/sysdev.h> 17 + #include <linux/syscore_ops.h> 18 18 #include <linux/irq.h> 19 19 20 20 #include <asm/i8259.h> ··· 215 215 } 216 216 } 217 217 218 - static int i8259A_resume(struct sys_device *dev) 218 + static void i8259A_resume(void) 219 219 { 220 220 if (i8259A_auto_eoi >= 0) 221 221 init_8259A(i8259A_auto_eoi); 222 - return 0; 223 222 } 224 223 225 - static int i8259A_shutdown(struct sys_device *dev) 224 + static void i8259A_shutdown(void) 226 225 { 227 226 /* Put the i8259A into a quiescent state that 228 227 * the kernel initialization code can get it ··· 231 232 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ 232 233 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-1 */ 233 234 } 234 - return 0; 235 235 } 236 236 237 - static struct sysdev_class i8259_sysdev_class = { 238 - .name = "i8259", 237 + static struct syscore_ops i8259_syscore_ops = { 239 238 .resume = i8259A_resume, 240 239 .shutdown = i8259A_shutdown, 241 240 }; 242 241 243 - static struct sys_device device_i8259A = { 244 - .id = 0, 245 - .cls = &i8259_sysdev_class, 246 - }; 247 - 248 242 static int __init i8259A_init_sysfs(void) 249 243 { 250 - int error = sysdev_class_register(&i8259_sysdev_class); 251 - if (!error) 252 - error = sysdev_register(&device_i8259A); 253 - return error; 244 + register_syscore_ops(&i8259_syscore_ops); 245 + return 0; 254 246 } 255 247 256 248 device_initcall(i8259A_init_sysfs);
+19 -11
arch/powerpc/platforms/pseries/hotplug-memory.c
··· 12 12 #include <linux/of.h> 13 13 #include <linux/memblock.h> 14 14 #include <linux/vmalloc.h> 15 + #include <linux/memory.h> 16 + 15 17 #include <asm/firmware.h> 16 18 #include <asm/machdep.h> 17 19 #include <asm/pSeries_reconfig.h> ··· 22 20 static unsigned long get_memblock_size(void) 23 21 { 24 22 struct device_node *np; 25 - unsigned int memblock_size = 0; 23 + unsigned int memblock_size = MIN_MEMORY_BLOCK_SIZE; 24 + struct resource r; 26 25 27 26 np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); 28 27 if (np) { 29 - const unsigned long *size; 28 + const __be64 *size; 30 29 31 30 size = of_get_property(np, "ibm,lmb-size", NULL); 32 - memblock_size = size ? *size : 0; 33 - 31 + if (size) 32 + memblock_size = be64_to_cpup(size); 34 33 of_node_put(np); 35 - } else { 34 + } else if (machine_is(pseries)) { 35 + /* This fallback really only applies to pseries */ 36 36 unsigned int memzero_size = 0; 37 - const unsigned int *regs; 38 37 39 38 np = of_find_node_by_path("/memory@0"); 40 39 if (np) { 41 - regs = of_get_property(np, "reg", NULL); 42 - memzero_size = regs ? regs[3] : 0; 40 + if (!of_address_to_resource(np, 0, &r)) 41 + memzero_size = resource_size(&r); 43 42 of_node_put(np); 44 43 } 45 44 ··· 53 50 sprintf(buf, "/memory@%x", memzero_size); 54 51 np = of_find_node_by_path(buf); 55 52 if (np) { 56 - regs = of_get_property(np, "reg", NULL); 57 - memblock_size = regs ? regs[3] : 0; 53 + if (!of_address_to_resource(np, 0, &r)) 54 + memblock_size = resource_size(&r); 58 55 of_node_put(np); 59 56 } 60 57 } 61 58 } 62 - 63 59 return memblock_size; 64 60 } 65 61 62 + /* WARNING: This is going to override the generic definition whenever 63 + * pseries is built-in regardless of what platform is active at boot 64 + * time. This is fine for now as this is the only "option" and it 65 + * should work everywhere. If not, we'll have to turn this into a 66 + * ppc_md. callback 67 + */ 66 68 unsigned long memory_block_size_bytes(void) 67 69 { 68 70 return get_memblock_size();
+4 -4
arch/sparc/include/asm/irqflags_32.h
··· 18 18 extern unsigned long arch_local_irq_save(void); 19 19 extern void arch_local_irq_enable(void); 20 20 21 - static inline unsigned long arch_local_save_flags(void) 21 + static inline notrace unsigned long arch_local_save_flags(void) 22 22 { 23 23 unsigned long flags; 24 24 ··· 26 26 return flags; 27 27 } 28 28 29 - static inline void arch_local_irq_disable(void) 29 + static inline notrace void arch_local_irq_disable(void) 30 30 { 31 31 arch_local_irq_save(); 32 32 } 33 33 34 - static inline bool arch_irqs_disabled_flags(unsigned long flags) 34 + static inline notrace bool arch_irqs_disabled_flags(unsigned long flags) 35 35 { 36 36 return (flags & PSR_PIL) != 0; 37 37 } 38 38 39 - static inline bool arch_irqs_disabled(void) 39 + static inline notrace bool arch_irqs_disabled(void) 40 40 { 41 41 return arch_irqs_disabled_flags(arch_local_save_flags()); 42 42 }
+7 -7
arch/sparc/include/asm/irqflags_64.h
··· 14 14 15 15 #ifndef __ASSEMBLY__ 16 16 17 - static inline unsigned long arch_local_save_flags(void) 17 + static inline notrace unsigned long arch_local_save_flags(void) 18 18 { 19 19 unsigned long flags; 20 20 ··· 26 26 return flags; 27 27 } 28 28 29 - static inline void arch_local_irq_restore(unsigned long flags) 29 + static inline notrace void arch_local_irq_restore(unsigned long flags) 30 30 { 31 31 __asm__ __volatile__( 32 32 "wrpr %0, %%pil" ··· 36 36 ); 37 37 } 38 38 39 - static inline void arch_local_irq_disable(void) 39 + static inline notrace void arch_local_irq_disable(void) 40 40 { 41 41 __asm__ __volatile__( 42 42 "wrpr %0, %%pil" ··· 46 46 ); 47 47 } 48 48 49 - static inline void arch_local_irq_enable(void) 49 + static inline notrace void arch_local_irq_enable(void) 50 50 { 51 51 __asm__ __volatile__( 52 52 "wrpr 0, %%pil" ··· 56 56 ); 57 57 } 58 58 59 - static inline int arch_irqs_disabled_flags(unsigned long flags) 59 + static inline notrace int arch_irqs_disabled_flags(unsigned long flags) 60 60 { 61 61 return (flags > 0); 62 62 } 63 63 64 - static inline int arch_irqs_disabled(void) 64 + static inline notrace int arch_irqs_disabled(void) 65 65 { 66 66 return arch_irqs_disabled_flags(arch_local_save_flags()); 67 67 } 68 68 69 - static inline unsigned long arch_local_irq_save(void) 69 + static inline notrace unsigned long arch_local_irq_save(void) 70 70 { 71 71 unsigned long flags, tmp; 72 72
+1
arch/sparc/include/asm/ptrace.h
··· 205 205 } while (0) 206 206 #define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV)) 207 207 #define instruction_pointer(regs) ((regs)->tpc) 208 + #define instruction_pointer_set(regs, val) ((regs)->tpc = (val)) 208 209 #define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP]) 209 210 #define regs_return_value(regs) ((regs)->u_regs[UREG_I0]) 210 211 #ifdef CONFIG_SMP
+1 -1
arch/sparc/kernel/entry.S
··· 293 293 WRITE_PAUSE 294 294 wr %l4, PSR_ET, %psr 295 295 WRITE_PAUSE 296 - sll %o3, 28, %o2 ! shift for simpler checks below 296 + srl %o3, 28, %o2 ! shift for simpler checks below 297 297 maybe_smp4m_msg_check_single: 298 298 andcc %o2, 0x1, %g0 299 299 beq,a maybe_smp4m_msg_check_mask
+1 -1
arch/sparc/mm/leon_mm.c
··· 226 226 * Leon2 and Leon3 differ in their way of telling cache information 227 227 * 228 228 */ 229 - int leon_flush_needed(void) 229 + int __init leon_flush_needed(void) 230 230 { 231 231 int flush_needed = -1; 232 232 unsigned int ssize, sets;
+1 -1
arch/x86/Kconfig
··· 1170 1170 config AMD_NUMA 1171 1171 def_bool y 1172 1172 prompt "Old style AMD Opteron NUMA detection" 1173 - depends on NUMA && PCI 1173 + depends on X86_64 && NUMA && PCI 1174 1174 ---help--- 1175 1175 Enable AMD NUMA node topology detection. You should say Y here if 1176 1176 you have a multi processor AMD system. This uses an old method to
+24
arch/x86/kernel/reboot.c
··· 419 419 DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"), 420 420 }, 421 421 }, 422 + { /* Handle problems with rebooting on the Latitude E6320. */ 423 + .callback = set_pci_reboot, 424 + .ident = "Dell Latitude E6320", 425 + .matches = { 426 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 427 + DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6320"), 428 + }, 429 + }, 430 + { /* Handle problems with rebooting on the Latitude E5420. */ 431 + .callback = set_pci_reboot, 432 + .ident = "Dell Latitude E5420", 433 + .matches = { 434 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 435 + DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E5420"), 436 + }, 437 + }, 438 + { /* Handle problems with rebooting on the Latitude E6420. */ 439 + .callback = set_pci_reboot, 440 + .ident = "Dell Latitude E6420", 441 + .matches = { 442 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 443 + DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"), 444 + }, 445 + }, 422 446 { } 423 447 }; 424 448
+1 -2
arch/x86/mm/init_64.c
··· 28 28 #include <linux/poison.h> 29 29 #include <linux/dma-mapping.h> 30 30 #include <linux/module.h> 31 + #include <linux/memory.h> 31 32 #include <linux/memory_hotplug.h> 32 33 #include <linux/nmi.h> 33 34 #include <linux/gfp.h> ··· 896 895 } 897 896 898 897 #ifdef CONFIG_X86_UV 899 - #define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS) 900 - 901 898 unsigned long memory_block_size_bytes(void) 902 899 { 903 900 if (is_uv_system()) {
+11 -1
drivers/acpi/apei/hest.c
··· 139 139 { 140 140 struct platform_device *ghes_dev; 141 141 struct ghes_arr *ghes_arr = data; 142 - int rc; 142 + int rc, i; 143 143 144 144 if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) 145 145 return 0; 146 146 147 147 if (!((struct acpi_hest_generic *)hest_hdr)->enabled) 148 148 return 0; 149 + for (i = 0; i < ghes_arr->count; i++) { 150 + struct acpi_hest_header *hdr; 151 + ghes_dev = ghes_arr->ghes_devs[i]; 152 + hdr = *(struct acpi_hest_header **)ghes_dev->dev.platform_data; 153 + if (hdr->source_id == hest_hdr->source_id) { 154 + pr_warning(FW_WARN HEST_PFX "Duplicated hardware error source ID: %d.\n", 155 + hdr->source_id); 156 + return -EIO; 157 + } 158 + } 149 159 ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id); 150 160 if (!ghes_dev) 151 161 return -ENOMEM;
-17
drivers/acpi/osl.c
··· 1333 1333 EXPORT_SYMBOL(acpi_resources_are_enforced); 1334 1334 1335 1335 /* 1336 - * Create and initialize a spinlock. 1337 - */ 1338 - acpi_status 1339 - acpi_os_create_lock(acpi_spinlock *out_handle) 1340 - { 1341 - spinlock_t *lock; 1342 - 1343 - lock = ACPI_ALLOCATE(sizeof(spinlock_t)); 1344 - if (!lock) 1345 - return AE_NO_MEMORY; 1346 - spin_lock_init(lock); 1347 - *out_handle = lock; 1348 - 1349 - return AE_OK; 1350 - } 1351 - 1352 - /* 1353 1336 * Deallocate the memory for a spinlock. 1354 1337 */ 1355 1338 void acpi_os_delete_lock(acpi_spinlock handle)
-1
drivers/base/memory.c
··· 30 30 static DEFINE_MUTEX(mem_sysfs_mutex); 31 31 32 32 #define MEMORY_CLASS_NAME "memory" 33 - #define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS) 34 33 35 34 static int sections_per_block; 36 35
+4 -3
drivers/char/agp/intel-agp.h
··· 90 90 #define G4x_GMCH_SIZE_MASK (0xf << 8) 91 91 #define G4x_GMCH_SIZE_1M (0x1 << 8) 92 92 #define G4x_GMCH_SIZE_2M (0x3 << 8) 93 - #define G4x_GMCH_SIZE_VT_1M (0x9 << 8) 94 - #define G4x_GMCH_SIZE_VT_1_5M (0xa << 8) 95 - #define G4x_GMCH_SIZE_VT_2M (0xc << 8) 93 + #define G4x_GMCH_SIZE_VT_EN (0x8 << 8) 94 + #define G4x_GMCH_SIZE_VT_1M (G4x_GMCH_SIZE_1M | G4x_GMCH_SIZE_VT_EN) 95 + #define G4x_GMCH_SIZE_VT_1_5M ((0x2 << 8) | G4x_GMCH_SIZE_VT_EN) 96 + #define G4x_GMCH_SIZE_VT_2M (G4x_GMCH_SIZE_2M | G4x_GMCH_SIZE_VT_EN) 96 97 97 98 #define GFX_FLSH_CNTL 0x2170 /* 915+ */ 98 99
+1
drivers/gpio/wm831x-gpio.c
··· 180 180 break; 181 181 case WM831X_GPIO_PULL_UP: 182 182 pull = "pullup"; 183 + break; 183 184 default: 184 185 pull = "INVALID PULL"; 185 186 break;
+11 -3
drivers/gpu/drm/i915/i915_dma.c
··· 1943 1943 if (!dev_priv->mm.gtt) { 1944 1944 DRM_ERROR("Failed to initialize GTT\n"); 1945 1945 ret = -ENODEV; 1946 - goto out_iomapfree; 1946 + goto out_rmmap; 1947 1947 } 1948 1948 1949 1949 agp_size = dev_priv->mm.gtt->gtt_mappable_entries << PAGE_SHIFT; ··· 1987 1987 if (dev_priv->wq == NULL) { 1988 1988 DRM_ERROR("Failed to create our workqueue.\n"); 1989 1989 ret = -ENOMEM; 1990 - goto out_iomapfree; 1990 + goto out_mtrrfree; 1991 1991 } 1992 1992 1993 1993 /* enable GEM by default */ ··· 2074 2074 return 0; 2075 2075 2076 2076 out_gem_unload: 2077 + if (dev_priv->mm.inactive_shrinker.shrink) 2078 + unregister_shrinker(&dev_priv->mm.inactive_shrinker); 2079 + 2077 2080 if (dev->pdev->msi_enabled) 2078 2081 pci_disable_msi(dev->pdev); 2079 2082 2080 2083 intel_teardown_gmbus(dev); 2081 2084 intel_teardown_mchbar(dev); 2082 2085 destroy_workqueue(dev_priv->wq); 2083 - out_iomapfree: 2086 + out_mtrrfree: 2087 + if (dev_priv->mm.gtt_mtrr >= 0) { 2088 + mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base, 2089 + dev->agp->agp_info.aper_size * 1024 * 1024); 2090 + dev_priv->mm.gtt_mtrr = -1; 2091 + } 2084 2092 io_mapping_free(dev_priv->mm.gtt_mapping); 2085 2093 out_rmmap: 2086 2094 pci_iounmap(dev->pdev, dev_priv->regs);
+2 -1
drivers/gpu/drm/i915/i915_drv.c
··· 52 52 unsigned int i915_semaphores = 0; 53 53 module_param_named(semaphores, i915_semaphores, int, 0600); 54 54 55 - unsigned int i915_enable_rc6 = 1; 55 + unsigned int i915_enable_rc6 = 0; 56 56 module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600); 57 57 58 58 unsigned int i915_enable_fbc = 0; ··· 577 577 if (get_seconds() - dev_priv->last_gpu_reset < 5) { 578 578 DRM_ERROR("GPU hanging too fast, declaring wedged!\n"); 579 579 } else switch (INTEL_INFO(dev)->gen) { 580 + case 7: 580 581 case 6: 581 582 ret = gen6_do_reset(dev, flags); 582 583 /* If reset with a user forcewake, try to restore */
+4 -1
drivers/gpu/drm/i915/i915_drv.h
··· 262 262 }; 263 263 264 264 #define QUIRK_PIPEA_FORCE (1<<0) 265 + #define QUIRK_LVDS_SSC_DISABLE (1<<1) 265 266 266 267 struct intel_fbdev; 267 268 ··· 1195 1194 void i915_gem_release(struct drm_device *dev, struct drm_file *file); 1196 1195 1197 1196 uint32_t 1198 - i915_gem_get_unfenced_gtt_alignment(struct drm_i915_gem_object *obj); 1197 + i915_gem_get_unfenced_gtt_alignment(struct drm_device *dev, 1198 + uint32_t size, 1199 + int tiling_mode); 1199 1200 1200 1201 /* i915_gem_gtt.c */ 1201 1202 void i915_gem_restore_gtt_mappings(struct drm_device *dev);
+35 -36
drivers/gpu/drm/i915/i915_gem.c
··· 1374 1374 } 1375 1375 1376 1376 static uint32_t 1377 - i915_gem_get_gtt_size(struct drm_i915_gem_object *obj) 1377 + i915_gem_get_gtt_size(struct drm_device *dev, uint32_t size, int tiling_mode) 1378 1378 { 1379 - struct drm_device *dev = obj->base.dev; 1380 - uint32_t size; 1379 + uint32_t gtt_size; 1381 1380 1382 1381 if (INTEL_INFO(dev)->gen >= 4 || 1383 - obj->tiling_mode == I915_TILING_NONE) 1384 - return obj->base.size; 1382 + tiling_mode == I915_TILING_NONE) 1383 + return size; 1385 1384 1386 1385 /* Previous chips need a power-of-two fence region when tiling */ 1387 1386 if (INTEL_INFO(dev)->gen == 3) 1388 - size = 1024*1024; 1387 + gtt_size = 1024*1024; 1389 1388 else 1390 - size = 512*1024; 1389 + gtt_size = 512*1024; 1391 1390 1392 - while (size < obj->base.size) 1393 - size <<= 1; 1391 + while (gtt_size < size) 1392 + gtt_size <<= 1; 1394 1393 1395 - return size; 1394 + return gtt_size; 1396 1395 } 1397 1396 1398 1397 /** ··· 1402 1403 * potential fence register mapping. 1403 1404 */ 1404 1405 static uint32_t 1405 - i915_gem_get_gtt_alignment(struct drm_i915_gem_object *obj) 1406 + i915_gem_get_gtt_alignment(struct drm_device *dev, 1407 + uint32_t size, 1408 + int tiling_mode) 1406 1409 { 1407 - struct drm_device *dev = obj->base.dev; 1408 - 1409 1410 /* 1410 1411 * Minimum alignment is 4k (GTT page size), but might be greater 1411 1412 * if a fence register is needed for the object. 1412 1413 */ 1413 1414 if (INTEL_INFO(dev)->gen >= 4 || 1414 - obj->tiling_mode == I915_TILING_NONE) 1415 + tiling_mode == I915_TILING_NONE) 1415 1416 return 4096; 1416 1417 1417 1418 /* 1418 1419 * Previous chips need to be aligned to the size of the smallest 1419 1420 * fence register that can contain the object. 1420 1421 */ 1421 - return i915_gem_get_gtt_size(obj); 1422 + return i915_gem_get_gtt_size(dev, size, tiling_mode); 1422 1423 } 1423 1424 1424 1425 /** 1425 1426 * i915_gem_get_unfenced_gtt_alignment - return required GTT alignment for an 1426 1427 * unfenced object 1427 - * @obj: object to check 1428 + * @dev: the device 1429 + * @size: size of the object 1430 + * @tiling_mode: tiling mode of the object 1428 1431 * 1429 1432 * Return the required GTT alignment for an object, only taking into account 1430 1433 * unfenced tiled surface requirements. 1431 1434 */ 1432 1435 uint32_t 1433 - i915_gem_get_unfenced_gtt_alignment(struct drm_i915_gem_object *obj) 1436 + i915_gem_get_unfenced_gtt_alignment(struct drm_device *dev, 1437 + uint32_t size, 1438 + int tiling_mode) 1434 1439 { 1435 - struct drm_device *dev = obj->base.dev; 1436 - int tile_height; 1437 - 1438 1440 /* 1439 1441 * Minimum alignment is 4k (GTT page size) for sane hw. 1440 1442 */ 1441 1443 if (INTEL_INFO(dev)->gen >= 4 || IS_G33(dev) || 1442 - obj->tiling_mode == I915_TILING_NONE) 1444 + tiling_mode == I915_TILING_NONE) 1443 1445 return 4096; 1444 1446 1445 - /* 1446 - * Older chips need unfenced tiled buffers to be aligned to the left 1447 - * edge of an even tile row (where tile rows are counted as if the bo is 1448 - * placed in a fenced gtt region). 1447 + /* Previous hardware however needs to be aligned to a power-of-two 1448 + * tile height. The simplest method for determining this is to reuse 1449 + * the power-of-tile object size. 1449 1450 */ 1450 - if (IS_GEN2(dev)) 1451 - tile_height = 16; 1452 - else if (obj->tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev)) 1453 - tile_height = 32; 1454 - else 1455 - tile_height = 8; 1456 - 1457 - return tile_height * obj->stride * 2; 1451 + return i915_gem_get_gtt_size(dev, size, tiling_mode); 1458 1452 } 1459 1453 1460 1454 int ··· 2736 2744 return -EINVAL; 2737 2745 } 2738 2746 2739 - fence_size = i915_gem_get_gtt_size(obj); 2740 - fence_alignment = i915_gem_get_gtt_alignment(obj); 2741 - unfenced_alignment = i915_gem_get_unfenced_gtt_alignment(obj); 2747 + fence_size = i915_gem_get_gtt_size(dev, 2748 + obj->base.size, 2749 + obj->tiling_mode); 2750 + fence_alignment = i915_gem_get_gtt_alignment(dev, 2751 + obj->base.size, 2752 + obj->tiling_mode); 2753 + unfenced_alignment = 2754 + i915_gem_get_unfenced_gtt_alignment(dev, 2755 + obj->base.size, 2756 + obj->tiling_mode); 2742 2757 2743 2758 if (alignment == 0) 2744 2759 alignment = map_and_fenceable ? fence_alignment :
+3 -1
drivers/gpu/drm/i915/i915_gem_tiling.c
··· 348 348 /* Rebind if we need a change of alignment */ 349 349 if (!obj->map_and_fenceable) { 350 350 u32 unfenced_alignment = 351 - i915_gem_get_unfenced_gtt_alignment(obj); 351 + i915_gem_get_unfenced_gtt_alignment(dev, 352 + obj->base.size, 353 + args->tiling_mode); 352 354 if (obj->gtt_offset & (unfenced_alignment - 1)) 353 355 ret = i915_gem_object_unbind(obj); 354 356 }
+14 -1
drivers/gpu/drm/i915/intel_display.c
··· 4305 4305 4306 4306 static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv) 4307 4307 { 4308 - return dev_priv->lvds_use_ssc && i915_panel_use_ssc; 4308 + return dev_priv->lvds_use_ssc && i915_panel_use_ssc 4309 + && !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE); 4309 4310 } 4310 4311 4311 4312 static int i9xx_crtc_mode_set(struct drm_crtc *crtc, ··· 7811 7810 DRM_DEBUG_DRIVER("applying pipe a force quirk\n"); 7812 7811 } 7813 7812 7813 + /* 7814 + * Some machines (Lenovo U160) do not work with SSC on LVDS for some reason 7815 + */ 7816 + static void quirk_ssc_force_disable(struct drm_device *dev) 7817 + { 7818 + struct drm_i915_private *dev_priv = dev->dev_private; 7819 + dev_priv->quirks |= QUIRK_LVDS_SSC_DISABLE; 7820 + } 7821 + 7814 7822 struct intel_quirk { 7815 7823 int device; 7816 7824 int subsystem_vendor; ··· 7848 7838 /* 855 & before need to leave pipe A & dpll A up */ 7849 7839 { 0x3582, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, 7850 7840 { 0x2562, PCI_ANY_ID, PCI_ANY_ID, quirk_pipea_force }, 7841 + 7842 + /* Lenovo U160 cannot use SSC on LVDS */ 7843 + { 0x0046, 0x17aa, 0x3920, quirk_ssc_force_disable }, 7851 7844 }; 7852 7845 7853 7846 static void intel_init_quirks(struct drm_device *dev)
+91 -27
drivers/gpu/drm/i915/intel_dp.c
··· 50 50 bool has_audio; 51 51 int force_audio; 52 52 uint32_t color_range; 53 - int dpms_mode; 54 53 uint8_t link_bw; 55 54 uint8_t lane_count; 56 55 uint8_t dpcd[4]; ··· 137 138 { 138 139 int max_lane_count = 4; 139 140 140 - if (intel_dp->dpcd[0] >= 0x11) { 141 - max_lane_count = intel_dp->dpcd[2] & 0x1f; 141 + if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) { 142 + max_lane_count = intel_dp->dpcd[DP_MAX_LANE_COUNT] & 0x1f; 142 143 switch (max_lane_count) { 143 144 case 1: case 2: case 4: 144 145 break; ··· 152 153 static int 153 154 intel_dp_max_link_bw(struct intel_dp *intel_dp) 154 155 { 155 - int max_link_bw = intel_dp->dpcd[1]; 156 + int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE]; 156 157 157 158 switch (max_link_bw) { 158 159 case DP_LINK_BW_1_62: ··· 773 774 /* 774 775 * Check for DPCD version > 1.1 and enhanced framing support 775 776 */ 776 - if (intel_dp->dpcd[0] >= 0x11 && (intel_dp->dpcd[2] & DP_ENHANCED_FRAME_CAP)) { 777 + if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 && 778 + (intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP)) { 777 779 intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; 778 780 intel_dp->DP |= DP_ENHANCED_FRAMING; 779 781 } ··· 942 942 udelay(200); 943 943 } 944 944 945 + /* If the sink supports it, try to set the power state appropriately */ 946 + static void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode) 947 + { 948 + int ret, i; 949 + 950 + /* Should have a valid DPCD by this point */ 951 + if (intel_dp->dpcd[DP_DPCD_REV] < 0x11) 952 + return; 953 + 954 + if (mode != DRM_MODE_DPMS_ON) { 955 + ret = intel_dp_aux_native_write_1(intel_dp, DP_SET_POWER, 956 + DP_SET_POWER_D3); 957 + if (ret != 1) 958 + DRM_DEBUG_DRIVER("failed to write sink power state\n"); 959 + } else { 960 + /* 961 + * When turning on, we need to retry for 1ms to give the sink 962 + * time to wake up. 963 + */ 964 + for (i = 0; i < 3; i++) { 965 + ret = intel_dp_aux_native_write_1(intel_dp, 966 + DP_SET_POWER, 967 + DP_SET_POWER_D0); 968 + if (ret == 1) 969 + break; 970 + msleep(1); 971 + } 972 + } 973 + } 974 + 945 975 static void intel_dp_prepare(struct drm_encoder *encoder) 946 976 { 947 977 struct intel_dp *intel_dp = enc_to_intel_dp(encoder); 948 978 struct drm_device *dev = encoder->dev; 979 + 980 + /* Wake up the sink first */ 981 + intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON); 949 982 950 983 if (is_edp(intel_dp)) { 951 984 ironlake_edp_backlight_off(dev); ··· 1023 990 if (mode != DRM_MODE_DPMS_ON) { 1024 991 if (is_edp(intel_dp)) 1025 992 ironlake_edp_backlight_off(dev); 993 + intel_dp_sink_dpms(intel_dp, mode); 1026 994 intel_dp_link_down(intel_dp); 1027 995 if (is_edp(intel_dp)) 1028 996 ironlake_edp_panel_off(dev); ··· 1032 998 } else { 1033 999 if (is_edp(intel_dp)) 1034 1000 ironlake_edp_panel_vdd_on(intel_dp); 1001 + intel_dp_sink_dpms(intel_dp, mode); 1035 1002 if (!(dp_reg & DP_PORT_EN)) { 1036 1003 intel_dp_start_link_train(intel_dp); 1037 1004 if (is_edp(intel_dp)) { ··· 1044 1009 if (is_edp(intel_dp)) 1045 1010 ironlake_edp_backlight_on(dev); 1046 1011 } 1047 - intel_dp->dpms_mode = mode; 1012 + } 1013 + 1014 + /* 1015 + * Native read with retry for link status and receiver capability reads for 1016 + * cases where the sink may still be asleep. 1017 + */ 1018 + static bool 1019 + intel_dp_aux_native_read_retry(struct intel_dp *intel_dp, uint16_t address, 1020 + uint8_t *recv, int recv_bytes) 1021 + { 1022 + int ret, i; 1023 + 1024 + /* 1025 + * Sinks are *supposed* to come up within 1ms from an off state, 1026 + * but we're also supposed to retry 3 times per the spec. 1027 + */ 1028 + for (i = 0; i < 3; i++) { 1029 + ret = intel_dp_aux_native_read(intel_dp, address, recv, 1030 + recv_bytes); 1031 + if (ret == recv_bytes) 1032 + return true; 1033 + msleep(1); 1034 + } 1035 + 1036 + return false; 1048 1037 } 1049 1038 1050 1039 /* ··· 1078 1019 static bool 1079 1020 intel_dp_get_link_status(struct intel_dp *intel_dp) 1080 1021 { 1081 - int ret; 1082 - 1083 - ret = intel_dp_aux_native_read(intel_dp, 1084 - DP_LANE0_1_STATUS, 1085 - intel_dp->link_status, DP_LINK_STATUS_SIZE); 1086 - if (ret != DP_LINK_STATUS_SIZE) 1087 - return false; 1088 - return true; 1022 + return intel_dp_aux_native_read_retry(intel_dp, 1023 + DP_LANE0_1_STATUS, 1024 + intel_dp->link_status, 1025 + DP_LINK_STATUS_SIZE); 1089 1026 } 1090 1027 1091 1028 static uint8_t ··· 1570 1515 static void 1571 1516 intel_dp_check_link_status(struct intel_dp *intel_dp) 1572 1517 { 1518 + int ret; 1519 + 1573 1520 if (!intel_dp->base.base.crtc) 1574 1521 return; 1575 1522 1576 1523 if (!intel_dp_get_link_status(intel_dp)) { 1524 + intel_dp_link_down(intel_dp); 1525 + return; 1526 + } 1527 + 1528 + /* Try to read receiver status if the link appears to be up */ 1529 + ret = intel_dp_aux_native_read(intel_dp, 1530 + 0x000, intel_dp->dpcd, 1531 + sizeof (intel_dp->dpcd)); 1532 + if (ret != sizeof(intel_dp->dpcd)) { 1577 1533 intel_dp_link_down(intel_dp); 1578 1534 return; 1579 1535 } ··· 1599 1533 ironlake_dp_detect(struct intel_dp *intel_dp) 1600 1534 { 1601 1535 enum drm_connector_status status; 1536 + bool ret; 1602 1537 1603 1538 /* Can't disconnect eDP, but you can close the lid... */ 1604 1539 if (is_edp(intel_dp)) { ··· 1610 1543 } 1611 1544 1612 1545 status = connector_status_disconnected; 1613 - if (intel_dp_aux_native_read(intel_dp, 1614 - 0x000, intel_dp->dpcd, 1615 - sizeof (intel_dp->dpcd)) 1616 - == sizeof(intel_dp->dpcd)) { 1617 - if (intel_dp->dpcd[0] != 0) 1618 - status = connector_status_connected; 1619 - } 1546 + ret = intel_dp_aux_native_read_retry(intel_dp, 1547 + 0x000, intel_dp->dpcd, 1548 + sizeof (intel_dp->dpcd)); 1549 + if (ret && intel_dp->dpcd[DP_DPCD_REV] != 0) 1550 + status = connector_status_connected; 1620 1551 DRM_DEBUG_KMS("DPCD: %hx%hx%hx%hx\n", intel_dp->dpcd[0], 1621 1552 intel_dp->dpcd[1], intel_dp->dpcd[2], intel_dp->dpcd[3]); 1622 1553 return status; ··· 1651 1586 if (intel_dp_aux_native_read(intel_dp, 0x000, intel_dp->dpcd, 1652 1587 sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd)) 1653 1588 { 1654 - if (intel_dp->dpcd[0] != 0) 1589 + if (intel_dp->dpcd[DP_DPCD_REV] != 0) 1655 1590 status = connector_status_connected; 1656 1591 } 1657 1592 ··· 1855 1790 { 1856 1791 struct intel_dp *intel_dp = container_of(intel_encoder, struct intel_dp, base); 1857 1792 1858 - if (intel_dp->dpms_mode == DRM_MODE_DPMS_ON) 1859 - intel_dp_check_link_status(intel_dp); 1793 + intel_dp_check_link_status(intel_dp); 1860 1794 } 1861 1795 1862 1796 /* Return which DP Port should be selected for Transcoder DP control */ ··· 1923 1859 return; 1924 1860 1925 1861 intel_dp->output_reg = output_reg; 1926 - intel_dp->dpms_mode = -1; 1927 1862 1928 1863 intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); 1929 1864 if (!intel_connector) { ··· 2017 1954 sizeof(intel_dp->dpcd)); 2018 1955 ironlake_edp_panel_vdd_off(intel_dp); 2019 1956 if (ret == sizeof(intel_dp->dpcd)) { 2020 - if (intel_dp->dpcd[0] >= 0x11) 2021 - dev_priv->no_aux_handshake = intel_dp->dpcd[3] & 1957 + if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) 1958 + dev_priv->no_aux_handshake = 1959 + intel_dp->dpcd[DP_MAX_DOWNSPREAD] & 2022 1960 DP_NO_AUX_HANDSHAKE_LINK_TRAINING; 2023 1961 } else { 2024 1962 /* if this fails, presume the device is a ghost */
+1 -1
drivers/gpu/drm/i915/intel_ringbuffer.h
··· 165 165 int __must_check intel_wait_ring_buffer(struct intel_ring_buffer *ring, int n); 166 166 static inline int intel_wait_ring_idle(struct intel_ring_buffer *ring) 167 167 { 168 - return intel_wait_ring_buffer(ring, ring->space - 8); 168 + return intel_wait_ring_buffer(ring, ring->size - 8); 169 169 } 170 170 171 171 int __must_check intel_ring_begin(struct intel_ring_buffer *ring, int n);
+1 -1
drivers/gpu/drm/radeon/evergreen.c
··· 2000 2000 gb_backend_map = 0x66442200; 2001 2001 break; 2002 2002 case CHIP_JUNIPER: 2003 - gb_backend_map = 0x00006420; 2003 + gb_backend_map = 0x00002200; 2004 2004 break; 2005 2005 default: 2006 2006 gb_backend_map =
+7 -2
drivers/gpu/drm/radeon/evergreen_blit_kms.c
··· 252 252 253 253 } 254 254 255 - /* emits 36 */ 255 + /* emits 39 */ 256 256 static void 257 257 set_default_state(struct radeon_device *rdev) 258 258 { ··· 531 531 radeon_ring_write(rdev, (SQ_DYN_GPR_CNTL_PS_FLUSH_REQ - PACKET3_SET_CONFIG_REG_START) >> 2); 532 532 radeon_ring_write(rdev, 0); 533 533 534 + /* setup LDS */ 535 + radeon_ring_write(rdev, PACKET3(PACKET3_SET_CONFIG_REG, 1)); 536 + radeon_ring_write(rdev, (SQ_LDS_RESOURCE_MGMT - PACKET3_SET_CONFIG_REG_START) >> 2); 537 + radeon_ring_write(rdev, 0x10001000); 538 + 534 539 /* SQ config */ 535 540 radeon_ring_write(rdev, PACKET3(PACKET3_SET_CONFIG_REG, 11)); 536 541 radeon_ring_write(rdev, (SQ_CONFIG - PACKET3_SET_CONFIG_REG_START) >> 2); ··· 778 773 /* calculate number of loops correctly */ 779 774 ring_size = num_loops * dwords_per_loop; 780 775 /* set default + shaders */ 781 - ring_size += 52; /* shaders + def state */ 776 + ring_size += 55; /* shaders + def state */ 782 777 ring_size += 10; /* fence emit for VB IB */ 783 778 ring_size += 5; /* done copy */ 784 779 ring_size += 10; /* fence emit for done copy */
+15 -6
drivers/gpu/drm/radeon/radeon_bios.c
··· 331 331 332 332 seprom_cntl1 = RREG32(RADEON_SEPROM_CNTL1); 333 333 viph_control = RREG32(RADEON_VIPH_CONTROL); 334 - bus_cntl = RREG32(RADEON_BUS_CNTL); 334 + bus_cntl = RREG32(RV370_BUS_CNTL); 335 335 d1vga_control = RREG32(AVIVO_D1VGA_CONTROL); 336 336 d2vga_control = RREG32(AVIVO_D2VGA_CONTROL); 337 337 vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL); ··· 350 350 WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); 351 351 352 352 /* enable the rom */ 353 - WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); 353 + WREG32(RV370_BUS_CNTL, (bus_cntl & ~RV370_BUS_BIOS_DIS_ROM)); 354 354 355 355 /* Disable VGA mode */ 356 356 WREG32(AVIVO_D1VGA_CONTROL, ··· 367 367 /* restore regs */ 368 368 WREG32(RADEON_SEPROM_CNTL1, seprom_cntl1); 369 369 WREG32(RADEON_VIPH_CONTROL, viph_control); 370 - WREG32(RADEON_BUS_CNTL, bus_cntl); 370 + WREG32(RV370_BUS_CNTL, bus_cntl); 371 371 WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); 372 372 WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); 373 373 WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); ··· 390 390 391 391 seprom_cntl1 = RREG32(RADEON_SEPROM_CNTL1); 392 392 viph_control = RREG32(RADEON_VIPH_CONTROL); 393 - bus_cntl = RREG32(RADEON_BUS_CNTL); 393 + if (rdev->flags & RADEON_IS_PCIE) 394 + bus_cntl = RREG32(RV370_BUS_CNTL); 395 + else 396 + bus_cntl = RREG32(RADEON_BUS_CNTL); 394 397 crtc_gen_cntl = RREG32(RADEON_CRTC_GEN_CNTL); 395 398 crtc2_gen_cntl = 0; 396 399 crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL); ··· 415 412 WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); 416 413 417 414 /* enable the rom */ 418 - WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); 415 + if (rdev->flags & RADEON_IS_PCIE) 416 + WREG32(RV370_BUS_CNTL, (bus_cntl & ~RV370_BUS_BIOS_DIS_ROM)); 417 + else 418 + WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); 419 419 420 420 /* Turn off mem requests and CRTC for both controllers */ 421 421 WREG32(RADEON_CRTC_GEN_CNTL, ··· 445 439 /* restore regs */ 446 440 WREG32(RADEON_SEPROM_CNTL1, seprom_cntl1); 447 441 WREG32(RADEON_VIPH_CONTROL, viph_control); 448 - WREG32(RADEON_BUS_CNTL, bus_cntl); 442 + if (rdev->flags & RADEON_IS_PCIE) 443 + WREG32(RV370_BUS_CNTL, bus_cntl); 444 + else 445 + WREG32(RADEON_BUS_CNTL, bus_cntl); 449 446 WREG32(RADEON_CRTC_GEN_CNTL, crtc_gen_cntl); 450 447 if (!(rdev->flags & RADEON_SINGLE_CRTC)) { 451 448 WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl);
+6
drivers/gpu/drm/radeon/radeon_connectors.c
··· 52 52 struct radeon_device *rdev = dev->dev_private; 53 53 struct radeon_connector *radeon_connector = to_radeon_connector(connector); 54 54 55 + /* bail if the connector does not have hpd pin, e.g., 56 + * VGA, TV, etc. 57 + */ 58 + if (radeon_connector->hpd.hpd == RADEON_HPD_NONE) 59 + return; 60 + 55 61 radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd); 56 62 57 63 /* powering up/down the eDP panel generates hpd events which
+2
drivers/gpu/drm/radeon/radeon_reg.h
··· 300 300 # define RADEON_BUS_READ_BURST (1 << 30) 301 301 #define RADEON_BUS_CNTL1 0x0034 302 302 # define RADEON_BUS_WAIT_ON_LOCK_EN (1 << 4) 303 + #define RV370_BUS_CNTL 0x004c 304 + # define RV370_BUS_BIOS_DIS_ROM (1 << 2) 303 305 /* rv370/rv380, rv410, r423/r430/r480, r5xx */ 304 306 #define RADEON_MSI_REARM_EN 0x0160 305 307 # define RV370_MSI_REARM_EN (1 << 0)
+3 -3
drivers/gpu/drm/radeon/rs600.c
··· 426 426 return radeon_gart_table_vram_alloc(rdev); 427 427 } 428 428 429 - int rs600_gart_enable(struct radeon_device *rdev) 429 + static int rs600_gart_enable(struct radeon_device *rdev) 430 430 { 431 431 u32 tmp; 432 432 int r, i; ··· 440 440 return r; 441 441 radeon_gart_restore(rdev); 442 442 /* Enable bus master */ 443 - tmp = RREG32(R_00004C_BUS_CNTL) & C_00004C_BUS_MASTER_DIS; 444 - WREG32(R_00004C_BUS_CNTL, tmp); 443 + tmp = RREG32(RADEON_BUS_CNTL) & ~RS600_BUS_MASTER_DIS; 444 + WREG32(RADEON_BUS_CNTL, tmp); 445 445 /* FIXME: setup default page */ 446 446 WREG32_MC(R_000100_MC_PT0_CNTL, 447 447 (S_000100_EFFECTIVE_L2_CACHE_SIZE(6) |
+5 -5
drivers/hwmon/adm1275.c
··· 53 53 info->direct[PSC_VOLTAGE_IN] = true; 54 54 info->direct[PSC_VOLTAGE_OUT] = true; 55 55 info->direct[PSC_CURRENT_OUT] = true; 56 - info->m[PSC_CURRENT_OUT] = 800; 56 + info->m[PSC_CURRENT_OUT] = 807; 57 57 info->b[PSC_CURRENT_OUT] = 20475; 58 58 info->R[PSC_CURRENT_OUT] = -1; 59 59 info->func[0] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT; 60 60 61 61 if (config & ADM1275_VRANGE) { 62 - info->m[PSC_VOLTAGE_IN] = 19045; 62 + info->m[PSC_VOLTAGE_IN] = 19199; 63 63 info->b[PSC_VOLTAGE_IN] = 0; 64 64 info->R[PSC_VOLTAGE_IN] = -2; 65 - info->m[PSC_VOLTAGE_OUT] = 19045; 65 + info->m[PSC_VOLTAGE_OUT] = 19199; 66 66 info->b[PSC_VOLTAGE_OUT] = 0; 67 67 info->R[PSC_VOLTAGE_OUT] = -2; 68 68 } else { 69 - info->m[PSC_VOLTAGE_IN] = 6666; 69 + info->m[PSC_VOLTAGE_IN] = 6720; 70 70 info->b[PSC_VOLTAGE_IN] = 0; 71 71 info->R[PSC_VOLTAGE_IN] = -1; 72 - info->m[PSC_VOLTAGE_OUT] = 6666; 72 + info->m[PSC_VOLTAGE_OUT] = 6720; 73 73 info->b[PSC_VOLTAGE_OUT] = 0; 74 74 info->R[PSC_VOLTAGE_OUT] = -1; 75 75 }
+1
drivers/hwmon/asus_atk0110.c
··· 674 674 else 675 675 err = -EIO; 676 676 677 + ACPI_FREE(ret); 677 678 return err; 678 679 } 679 680
+1 -1
drivers/hwmon/it87.c
··· 1538 1538 }; 1539 1539 1540 1540 static const struct attribute_group it87_group_label = { 1541 - .attrs = it87_attributes_vid, 1541 + .attrs = it87_attributes_label, 1542 1542 }; 1543 1543 1544 1544 /* SuperIO detection - will change isa_address if a chip is found */
+11
drivers/hwmon/max1111.c
··· 40 40 struct spi_transfer xfer[2]; 41 41 uint8_t *tx_buf; 42 42 uint8_t *rx_buf; 43 + struct mutex drvdata_lock; 44 + /* protect msg, xfer and buffers from multiple access */ 43 45 }; 44 46 45 47 static int max1111_read(struct device *dev, int channel) ··· 50 48 uint8_t v1, v2; 51 49 int err; 52 50 51 + /* writing to drvdata struct is not thread safe, wait on mutex */ 52 + mutex_lock(&data->drvdata_lock); 53 + 53 54 data->tx_buf[0] = (channel << MAX1111_CTRL_SEL_SH) | 54 55 MAX1111_CTRL_PD0 | MAX1111_CTRL_PD1 | 55 56 MAX1111_CTRL_SGL | MAX1111_CTRL_UNI | MAX1111_CTRL_STR; ··· 60 55 err = spi_sync(data->spi, &data->msg); 61 56 if (err < 0) { 62 57 dev_err(dev, "spi_sync failed with %d\n", err); 58 + mutex_unlock(&data->drvdata_lock); 63 59 return err; 64 60 } 65 61 66 62 v1 = data->rx_buf[0]; 67 63 v2 = data->rx_buf[1]; 64 + 65 + mutex_unlock(&data->drvdata_lock); 68 66 69 67 if ((v1 & 0xc0) || (v2 & 0x3f)) 70 68 return -EINVAL; ··· 184 176 if (err) 185 177 goto err_free_data; 186 178 179 + mutex_init(&data->drvdata_lock); 180 + 187 181 data->spi = spi; 188 182 spi_set_drvdata(spi, data); 189 183 ··· 223 213 224 214 hwmon_device_unregister(data->hwmon_dev); 225 215 sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group); 216 + mutex_destroy(&data->drvdata_lock); 226 217 kfree(data->rx_buf); 227 218 kfree(data->tx_buf); 228 219 kfree(data);
+10 -10
drivers/hwmon/pmbus_core.c
··· 362 362 * Convert linear sensor values to milli- or micro-units 363 363 * depending on sensor type. 364 364 */ 365 - static int pmbus_reg2data_linear(struct pmbus_data *data, 366 - struct pmbus_sensor *sensor) 365 + static long pmbus_reg2data_linear(struct pmbus_data *data, 366 + struct pmbus_sensor *sensor) 367 367 { 368 368 s16 exponent; 369 369 s32 mantissa; ··· 397 397 else 398 398 val >>= -exponent; 399 399 400 - return (int)val; 400 + return val; 401 401 } 402 402 403 403 /* 404 404 * Convert direct sensor values to milli- or micro-units 405 405 * depending on sensor type. 406 406 */ 407 - static int pmbus_reg2data_direct(struct pmbus_data *data, 408 - struct pmbus_sensor *sensor) 407 + static long pmbus_reg2data_direct(struct pmbus_data *data, 408 + struct pmbus_sensor *sensor) 409 409 { 410 410 long val = (s16) sensor->data; 411 411 long m, b, R; ··· 440 440 R++; 441 441 } 442 442 443 - return (int)((val - b) / m); 443 + return (val - b) / m; 444 444 } 445 445 446 - static int pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor) 446 + static long pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor) 447 447 { 448 - int val; 448 + long val; 449 449 450 450 if (data->info->direct[sensor->class]) 451 451 val = pmbus_reg2data_direct(data, sensor); ··· 619 619 if (!s1 && !s2) 620 620 *val = !!regval; 621 621 else { 622 - int v1, v2; 622 + long v1, v2; 623 623 struct pmbus_sensor *sensor1, *sensor2; 624 624 625 625 sensor1 = &data->sensors[s1]; ··· 661 661 if (sensor->data < 0) 662 662 return sensor->data; 663 663 664 - return snprintf(buf, PAGE_SIZE, "%d\n", pmbus_reg2data(data, sensor)); 664 + return snprintf(buf, PAGE_SIZE, "%ld\n", pmbus_reg2data(data, sensor)); 665 665 } 666 666 667 667 static ssize_t pmbus_set_sensor(struct device *dev,
+8
drivers/media/dvb/dvb-core/dvb_frontend.c
··· 1988 1988 if (dvbdev->users == -1 && fe->ops.ts_bus_ctrl) { 1989 1989 if ((ret = fe->ops.ts_bus_ctrl(fe, 1)) < 0) 1990 1990 goto err0; 1991 + 1992 + /* If we took control of the bus, we need to force 1993 + reinitialization. This is because many ts_bus_ctrl() 1994 + functions strobe the RESET pin on the demod, and if the 1995 + frontend thread already exists then the dvb_init() routine 1996 + won't get called (which is what usually does initial 1997 + register configuration). */ 1998 + fepriv->reinitialise = 1; 1991 1999 } 1992 2000 1993 2001 if ((ret = dvb_generic_open (inode, file)) < 0)
+2 -2
drivers/media/radio/Kconfig
··· 168 168 169 169 config RADIO_MIROPCM20 170 170 tristate "miroSOUND PCM20 radio" 171 - depends on ISA && VIDEO_V4L2 && SND 171 + depends on ISA && ISA_DMA_API && VIDEO_V4L2 && SND 172 172 select SND_ISA 173 173 select SND_MIRO 174 174 ---help--- ··· 201 201 202 202 config RADIO_SF16FMR2 203 203 tristate "SF16FMR2 Radio" 204 - depends on ISA && VIDEO_V4L2 204 + depends on ISA && VIDEO_V4L2 && SND 205 205 ---help--- 206 206 Choose Y here if you have one of these FM radio cards. 207 207
+2 -2
drivers/media/radio/si4713-i2c.c
··· 1033 1033 char ps_name[MAX_RDS_PS_NAME + 1]; 1034 1034 1035 1035 len = control->size - 1; 1036 - if (len > MAX_RDS_PS_NAME) { 1036 + if (len < 0 || len > MAX_RDS_PS_NAME) { 1037 1037 rval = -ERANGE; 1038 1038 goto exit; 1039 1039 } ··· 1057 1057 char radio_text[MAX_RDS_RADIO_TEXT + 1]; 1058 1058 1059 1059 len = control->size - 1; 1060 - if (len > MAX_RDS_RADIO_TEXT) { 1060 + if (len < 0 || len > MAX_RDS_RADIO_TEXT) { 1061 1061 rval = -ERANGE; 1062 1062 goto exit; 1063 1063 }
+5 -4
drivers/media/rc/mceusb.c
··· 558 558 inout, data1); 559 559 break; 560 560 case MCE_CMD_S_TIMEOUT: 561 - /* value is in units of 50us, so x*50/100 or x/2 ms */ 561 + /* value is in units of 50us, so x*50/1000 ms */ 562 562 dev_info(dev, "%s receive timeout of %d ms\n", 563 - inout, ((data1 << 8) | data2) / 2); 563 + inout, 564 + ((data1 << 8) | data2) * MCE_TIME_UNIT / 1000); 564 565 break; 565 566 case MCE_CMD_G_TIMEOUT: 566 567 dev_info(dev, "Get receive timeout\n"); ··· 848 847 switch (ir->buf_in[index]) { 849 848 /* 2-byte return value commands */ 850 849 case MCE_CMD_S_TIMEOUT: 851 - ir->rc->timeout = US_TO_NS((hi << 8 | lo) / 2); 850 + ir->rc->timeout = US_TO_NS((hi << 8 | lo) * MCE_TIME_UNIT); 852 851 break; 853 852 854 853 /* 1-byte return value commands */ ··· 1079 1078 rc->priv = ir; 1080 1079 rc->driver_type = RC_DRIVER_IR_RAW; 1081 1080 rc->allowed_protos = RC_TYPE_ALL; 1082 - rc->timeout = US_TO_NS(1000); 1081 + rc->timeout = MS_TO_NS(100); 1083 1082 if (!ir->flags.no_tx) { 1084 1083 rc->s_tx_mask = mceusb_set_tx_mask; 1085 1084 rc->s_tx_carrier = mceusb_set_tx_carrier;
+1 -1
drivers/media/rc/nuvoton-cir.c
··· 1110 1110 rdev->dev.parent = &pdev->dev; 1111 1111 rdev->driver_name = NVT_DRIVER_NAME; 1112 1112 rdev->map_name = RC_MAP_RC6_MCE; 1113 - rdev->timeout = US_TO_NS(1000); 1113 + rdev->timeout = MS_TO_NS(100); 1114 1114 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ 1115 1115 rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); 1116 1116 #if 0
+2 -7
drivers/media/video/cx23885/cx23885-core.c
··· 2060 2060 goto fail_irq; 2061 2061 } 2062 2062 2063 - if (!pci_enable_msi(pci_dev)) 2064 - err = request_irq(pci_dev->irq, cx23885_irq, 2065 - IRQF_DISABLED, dev->name, dev); 2066 - else 2067 - err = request_irq(pci_dev->irq, cx23885_irq, 2068 - IRQF_SHARED | IRQF_DISABLED, dev->name, dev); 2063 + err = request_irq(pci_dev->irq, cx23885_irq, 2064 + IRQF_SHARED | IRQF_DISABLED, dev->name, dev); 2069 2065 if (err < 0) { 2070 2066 printk(KERN_ERR "%s: can't get IRQ %d\n", 2071 2067 dev->name, pci_dev->irq); ··· 2110 2114 2111 2115 /* unregister stuff */ 2112 2116 free_irq(pci_dev->irq, dev); 2113 - pci_disable_msi(pci_dev); 2114 2117 2115 2118 cx23885_dev_unregister(dev); 2116 2119 v4l2_device_unregister(v4l2_dev);
+12 -4
drivers/media/video/tuner-core.c
··· 714 714 * returns 0. 715 715 * This function is needed for boards that have a separate tuner for 716 716 * radio (like devices with tea5767). 717 + * NOTE: mt20xx uses V4L2_TUNER_DIGITAL_TV and calls set_tv_freq to 718 + * select a TV frequency. So, t_mode = T_ANALOG_TV could actually 719 + * be used to represent a Digital TV too. 717 720 */ 718 721 static inline int check_mode(struct tuner *t, enum v4l2_tuner_type mode) 719 722 { 720 - if ((1 << mode & t->mode_mask) == 0) 723 + int t_mode; 724 + if (mode == V4L2_TUNER_RADIO) 725 + t_mode = T_RADIO; 726 + else 727 + t_mode = T_ANALOG_TV; 728 + 729 + if ((t_mode & t->mode_mask) == 0) 721 730 return -EINVAL; 722 731 723 732 return 0; ··· 993 984 case V4L2_TUNER_RADIO: 994 985 p = "radio"; 995 986 break; 996 - case V4L2_TUNER_DIGITAL_TV: 987 + case V4L2_TUNER_DIGITAL_TV: /* Used by mt20xx */ 997 988 p = "digital TV"; 998 989 break; 999 990 case V4L2_TUNER_ANALOG_TV: ··· 1144 1135 return 0; 1145 1136 if (vt->type == t->mode && analog_ops->get_afc) 1146 1137 vt->afc = analog_ops->get_afc(&t->fe); 1147 - if (vt->type == V4L2_TUNER_ANALOG_TV) 1138 + if (t->mode != V4L2_TUNER_RADIO) { 1148 1139 vt->capability |= V4L2_TUNER_CAP_NORM; 1149 - if (vt->type != V4L2_TUNER_RADIO) { 1150 1140 vt->rangelow = tv_range[0] * 16; 1151 1141 vt->rangehigh = tv_range[1] * 16; 1152 1142 return 0;
+51 -28
drivers/mmc/core/mmc.c
··· 247 247 return 0; 248 248 249 249 /* Version is coded in the CSD_STRUCTURE byte in the EXT_CSD register */ 250 + card->ext_csd.raw_ext_csd_structure = ext_csd[EXT_CSD_STRUCTURE]; 250 251 if (card->csd.structure == 3) { 251 - int ext_csd_struct = ext_csd[EXT_CSD_STRUCTURE]; 252 - if (ext_csd_struct > 2) { 252 + if (card->ext_csd.raw_ext_csd_structure > 2) { 253 253 printk(KERN_ERR "%s: unrecognised EXT_CSD structure " 254 254 "version %d\n", mmc_hostname(card->host), 255 - ext_csd_struct); 255 + card->ext_csd.raw_ext_csd_structure); 256 256 err = -EINVAL; 257 257 goto out; 258 258 } ··· 266 266 goto out; 267 267 } 268 268 269 + card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0]; 270 + card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1]; 271 + card->ext_csd.raw_sectors[2] = ext_csd[EXT_CSD_SEC_CNT + 2]; 272 + card->ext_csd.raw_sectors[3] = ext_csd[EXT_CSD_SEC_CNT + 3]; 269 273 if (card->ext_csd.rev >= 2) { 270 274 card->ext_csd.sectors = 271 275 ext_csd[EXT_CSD_SEC_CNT + 0] << 0 | ··· 281 277 if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) 282 278 mmc_card_set_blockaddr(card); 283 279 } 284 - 280 + card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE]; 285 281 switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) { 286 282 case EXT_CSD_CARD_TYPE_DDR_52 | EXT_CSD_CARD_TYPE_52 | 287 283 EXT_CSD_CARD_TYPE_26: ··· 311 307 mmc_hostname(card->host)); 312 308 } 313 309 310 + card->ext_csd.raw_s_a_timeout = ext_csd[EXT_CSD_S_A_TIMEOUT]; 311 + card->ext_csd.raw_erase_timeout_mult = 312 + ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]; 313 + card->ext_csd.raw_hc_erase_grp_size = 314 + ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; 314 315 if (card->ext_csd.rev >= 3) { 315 316 u8 sa_shift = ext_csd[EXT_CSD_S_A_TIMEOUT]; 316 317 card->ext_csd.part_config = ext_csd[EXT_CSD_PART_CONFIG]; ··· 343 334 card->ext_csd.boot_size = ext_csd[EXT_CSD_BOOT_MULT] << 17; 344 335 } 345 336 337 + card->ext_csd.raw_hc_erase_gap_size = 338 + ext_csd[EXT_CSD_PARTITION_ATTRIBUTE]; 339 + card->ext_csd.raw_sec_trim_mult = 340 + ext_csd[EXT_CSD_SEC_TRIM_MULT]; 341 + card->ext_csd.raw_sec_erase_mult = 342 + ext_csd[EXT_CSD_SEC_ERASE_MULT]; 343 + card->ext_csd.raw_sec_feature_support = 344 + ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]; 345 + card->ext_csd.raw_trim_mult = 346 + ext_csd[EXT_CSD_TRIM_MULT]; 346 347 if (card->ext_csd.rev >= 4) { 347 348 /* 348 349 * Enhanced area feature support -- check whether the eMMC ··· 360 341 * area offset and size to user by adding sysfs interface. 361 342 */ 362 343 if ((ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x2) && 363 - (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) { 344 + (ext_csd[EXT_CSD_PARTITION_ATTRIBUTE] & 0x1)) { 364 345 u8 hc_erase_grp_sz = 365 346 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; 366 347 u8 hc_wp_grp_sz = ··· 420 401 } 421 402 422 403 423 - static int mmc_compare_ext_csds(struct mmc_card *card, u8 *ext_csd, 424 - unsigned bus_width) 404 + static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width) 425 405 { 426 406 u8 *bw_ext_csd; 427 407 int err; 428 408 429 - err = mmc_get_ext_csd(card, &bw_ext_csd); 430 - if (err) 431 - return err; 409 + if (bus_width == MMC_BUS_WIDTH_1) 410 + return 0; 432 411 433 - if ((ext_csd == NULL || bw_ext_csd == NULL)) { 412 + err = mmc_get_ext_csd(card, &bw_ext_csd); 413 + 414 + if (err || bw_ext_csd == NULL) { 434 415 if (bus_width != MMC_BUS_WIDTH_1) 435 416 err = -EINVAL; 436 417 goto out; ··· 440 421 goto out; 441 422 442 423 /* only compare read only fields */ 443 - err = (!(ext_csd[EXT_CSD_PARTITION_SUPPORT] == 424 + err = (!(card->ext_csd.raw_partition_support == 444 425 bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) && 445 - (ext_csd[EXT_CSD_ERASED_MEM_CONT] == 426 + (card->ext_csd.raw_erased_mem_count == 446 427 bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) && 447 - (ext_csd[EXT_CSD_REV] == 428 + (card->ext_csd.rev == 448 429 bw_ext_csd[EXT_CSD_REV]) && 449 - (ext_csd[EXT_CSD_STRUCTURE] == 430 + (card->ext_csd.raw_ext_csd_structure == 450 431 bw_ext_csd[EXT_CSD_STRUCTURE]) && 451 - (ext_csd[EXT_CSD_CARD_TYPE] == 432 + (card->ext_csd.raw_card_type == 452 433 bw_ext_csd[EXT_CSD_CARD_TYPE]) && 453 - (ext_csd[EXT_CSD_S_A_TIMEOUT] == 434 + (card->ext_csd.raw_s_a_timeout == 454 435 bw_ext_csd[EXT_CSD_S_A_TIMEOUT]) && 455 - (ext_csd[EXT_CSD_HC_WP_GRP_SIZE] == 436 + (card->ext_csd.raw_hc_erase_gap_size == 456 437 bw_ext_csd[EXT_CSD_HC_WP_GRP_SIZE]) && 457 - (ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT] == 438 + (card->ext_csd.raw_erase_timeout_mult == 458 439 bw_ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT]) && 459 - (ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] == 440 + (card->ext_csd.raw_hc_erase_grp_size == 460 441 bw_ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]) && 461 - (ext_csd[EXT_CSD_SEC_TRIM_MULT] == 442 + (card->ext_csd.raw_sec_trim_mult == 462 443 bw_ext_csd[EXT_CSD_SEC_TRIM_MULT]) && 463 - (ext_csd[EXT_CSD_SEC_ERASE_MULT] == 444 + (card->ext_csd.raw_sec_erase_mult == 464 445 bw_ext_csd[EXT_CSD_SEC_ERASE_MULT]) && 465 - (ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT] == 446 + (card->ext_csd.raw_sec_feature_support == 466 447 bw_ext_csd[EXT_CSD_SEC_FEATURE_SUPPORT]) && 467 - (ext_csd[EXT_CSD_TRIM_MULT] == 448 + (card->ext_csd.raw_trim_mult == 468 449 bw_ext_csd[EXT_CSD_TRIM_MULT]) && 469 - memcmp(&ext_csd[EXT_CSD_SEC_CNT], 470 - &bw_ext_csd[EXT_CSD_SEC_CNT], 471 - 4) != 0); 450 + (card->ext_csd.raw_sectors[0] == 451 + bw_ext_csd[EXT_CSD_SEC_CNT + 0]) && 452 + (card->ext_csd.raw_sectors[1] == 453 + bw_ext_csd[EXT_CSD_SEC_CNT + 1]) && 454 + (card->ext_csd.raw_sectors[2] == 455 + bw_ext_csd[EXT_CSD_SEC_CNT + 2]) && 456 + (card->ext_csd.raw_sectors[3] == 457 + bw_ext_csd[EXT_CSD_SEC_CNT + 3])); 472 458 if (err) 473 459 err = -EINVAL; 474 460 ··· 794 770 */ 795 771 if (!(host->caps & MMC_CAP_BUS_WIDTH_TEST)) 796 772 err = mmc_compare_ext_csds(card, 797 - ext_csd, 798 773 bus_width); 799 774 else 800 775 err = mmc_bus_test(card, bus_width);
+3 -3
drivers/net/bonding/bond_main.c
··· 1428 1428 return features; 1429 1429 } 1430 1430 1431 - #define BOND_VLAN_FEATURES (NETIF_F_ALL_TX_OFFLOADS | \ 1432 - NETIF_F_SOFT_FEATURES | \ 1433 - NETIF_F_LRO) 1431 + #define BOND_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \ 1432 + NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ 1433 + NETIF_F_HIGHDMA | NETIF_F_LRO) 1434 1434 1435 1435 static void bond_compute_features(struct bonding *bond) 1436 1436 {
+19 -5
drivers/net/gianfar.c
··· 2289 2289 return 0; 2290 2290 } 2291 2291 2292 + /* Check if rx parser should be activated */ 2293 + void gfar_check_rx_parser_mode(struct gfar_private *priv) 2294 + { 2295 + struct gfar __iomem *regs; 2296 + u32 tempval; 2297 + 2298 + regs = priv->gfargrp[0].regs; 2299 + 2300 + tempval = gfar_read(&regs->rctrl); 2301 + /* If parse is no longer required, then disable parser */ 2302 + if (tempval & RCTRL_REQ_PARSER) 2303 + tempval |= RCTRL_PRSDEP_INIT; 2304 + else 2305 + tempval &= ~RCTRL_PRSDEP_INIT; 2306 + gfar_write(&regs->rctrl, tempval); 2307 + } 2308 + 2292 2309 2293 2310 /* Enables and disables VLAN insertion/extraction */ 2294 2311 static void gfar_vlan_rx_register(struct net_device *dev, ··· 2342 2325 /* Disable VLAN tag extraction */ 2343 2326 tempval = gfar_read(&regs->rctrl); 2344 2327 tempval &= ~RCTRL_VLEX; 2345 - /* If parse is no longer required, then disable parser */ 2346 - if (tempval & RCTRL_REQ_PARSER) 2347 - tempval |= RCTRL_PRSDEP_INIT; 2348 - else 2349 - tempval &= ~RCTRL_PRSDEP_INIT; 2350 2328 gfar_write(&regs->rctrl, tempval); 2329 + 2330 + gfar_check_rx_parser_mode(priv); 2351 2331 } 2352 2332 2353 2333 gfar_change_mtu(dev, dev->mtu);
+2 -1
drivers/net/gianfar.h
··· 274 274 #define RCTRL_PROM 0x00000008 275 275 #define RCTRL_EMEN 0x00000002 276 276 #define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \ 277 - RCTRL_TUCSEN) 277 + RCTRL_TUCSEN | RCTRL_FILREN) 278 278 #define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \ 279 279 RCTRL_PRSDEP_INIT) 280 280 #define RCTRL_EXTHASH (RCTRL_GHTX) ··· 1156 1156 unsigned long tx_mask, unsigned long rx_mask); 1157 1157 void gfar_init_sysfs(struct net_device *dev); 1158 1158 int gfar_set_features(struct net_device *dev, u32 features); 1159 + extern void gfar_check_rx_parser_mode(struct gfar_private *priv); 1159 1160 1160 1161 extern const struct ethtool_ops gfar_ethtool_ops; 1161 1162
+3 -3
drivers/net/natsemi.c
··· 140 140 module_param(mtu, int, 0); 141 141 module_param(debug, int, 0); 142 142 module_param(rx_copybreak, int, 0); 143 - module_param(dspcfg_workaround, int, 1); 143 + module_param(dspcfg_workaround, int, 0); 144 144 module_param_array(options, int, NULL, 0); 145 145 module_param_array(full_duplex, int, NULL, 0); 146 146 MODULE_PARM_DESC(mtu, "DP8381x MTU (all boards)"); ··· 2028 2028 np->rx_ring[i].cmd_status = 0; 2029 2029 np->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */ 2030 2030 if (np->rx_skbuff[i]) { 2031 - pci_unmap_single(np->pci_dev, 2032 - np->rx_dma[i], buflen, 2031 + pci_unmap_single(np->pci_dev, np->rx_dma[i], 2032 + buflen + NATSEMI_PADDING, 2033 2033 PCI_DMA_FROMDEVICE); 2034 2034 dev_kfree_skb(np->rx_skbuff[i]); 2035 2035 }
+2 -1
drivers/net/pppoe.c
··· 348 348 349 349 /* Only look at sockets that are using this specific device. */ 350 350 switch (event) { 351 + case NETDEV_CHANGEADDR: 351 352 case NETDEV_CHANGEMTU: 352 - /* A change in mtu is a bad thing, requiring 353 + /* A change in mtu or address is a bad thing, requiring 353 354 * LCP re-negotiation. 354 355 */ 355 356
+5 -3
drivers/net/r6040.c
··· 677 677 if (status & RX_FIFO_FULL) 678 678 dev->stats.rx_fifo_errors++; 679 679 680 - /* Mask off RX interrupt */ 681 - misr &= ~RX_INTS; 682 - napi_schedule(&lp->napi); 680 + if (likely(napi_schedule_prep(&lp->napi))) { 681 + /* Mask off RX interrupt */ 682 + misr &= ~RX_INTS; 683 + __napi_schedule(&lp->napi); 684 + } 683 685 } 684 686 685 687 /* TX interrupt request */
+1 -1
drivers/net/slip.c
··· 182 182 #ifdef SL_INCLUDE_CSLIP 183 183 cbuff = xchg(&sl->cbuff, cbuff); 184 184 slcomp = xchg(&sl->slcomp, slcomp); 185 + #endif 185 186 #ifdef CONFIG_SLIP_MODE_SLIP6 186 187 sl->xdata = 0; 187 188 sl->xbits = 0; 188 - #endif 189 189 #endif 190 190 spin_unlock_bh(&sl->lock); 191 191 err = 0;
-4
drivers/net/tulip/dmfe.c
··· 879 879 txptr = db->tx_remove_ptr; 880 880 while(db->tx_packet_cnt) { 881 881 tdes0 = le32_to_cpu(txptr->tdes0); 882 - pr_debug("tdes0=%x\n", tdes0); 883 882 if (tdes0 & 0x80000000) 884 883 break; 885 884 ··· 888 889 889 890 /* Transmit statistic counter */ 890 891 if ( tdes0 != 0x7fffffff ) { 891 - pr_debug("tdes0=%x\n", tdes0); 892 892 dev->stats.collisions += (tdes0 >> 3) & 0xf; 893 893 dev->stats.tx_bytes += le32_to_cpu(txptr->tdes1) & 0x7ff; 894 894 if (tdes0 & TDES0_ERR_MASK) { ··· 984 986 /* error summary bit check */ 985 987 if (rdes0 & 0x8000) { 986 988 /* This is a error packet */ 987 - pr_debug("rdes0: %x\n", rdes0); 988 989 dev->stats.rx_errors++; 989 990 if (rdes0 & 1) 990 991 dev->stats.rx_fifo_errors++; ··· 1635 1638 else /* DM9102/DM9102A */ 1636 1639 phy_mode = phy_read(db->ioaddr, 1637 1640 db->phy_addr, 17, db->chip_id) & 0xf000; 1638 - pr_debug("Phy_mode %x\n", phy_mode); 1639 1641 switch (phy_mode) { 1640 1642 case 0x1000: db->op_mode = DMFE_10MHF; break; 1641 1643 case 0x2000: db->op_mode = DMFE_10MFD; break;
+4 -3
drivers/net/usb/hso.c
··· 2421 2421 2422 2422 remove_net_device(hso_net->parent); 2423 2423 2424 - if (hso_net->net) { 2424 + if (hso_net->net) 2425 2425 unregister_netdev(hso_net->net); 2426 - free_netdev(hso_net->net); 2427 - } 2428 2426 2429 2427 /* start freeing */ 2430 2428 for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) { ··· 2433 2435 usb_free_urb(hso_net->mux_bulk_tx_urb); 2434 2436 kfree(hso_net->mux_bulk_tx_buf); 2435 2437 hso_net->mux_bulk_tx_buf = NULL; 2438 + 2439 + if (hso_net->net) 2440 + free_netdev(hso_net->net); 2436 2441 2437 2442 kfree(hso_dev); 2438 2443 }
+5 -2
drivers/net/wireless/ath/ath5k/pci.c
··· 297 297 #ifdef CONFIG_PM_SLEEP 298 298 static int ath5k_pci_suspend(struct device *dev) 299 299 { 300 - struct ath5k_softc *sc = pci_get_drvdata(to_pci_dev(dev)); 300 + struct pci_dev *pdev = to_pci_dev(dev); 301 + struct ieee80211_hw *hw = pci_get_drvdata(pdev); 302 + struct ath5k_softc *sc = hw->priv; 301 303 302 304 ath5k_led_off(sc); 303 305 return 0; ··· 308 306 static int ath5k_pci_resume(struct device *dev) 309 307 { 310 308 struct pci_dev *pdev = to_pci_dev(dev); 311 - struct ath5k_softc *sc = pci_get_drvdata(pdev); 309 + struct ieee80211_hw *hw = pci_get_drvdata(pdev); 310 + struct ath5k_softc *sc = hw->priv; 312 311 313 312 /* 314 313 * Suspend/Resume resets the PCI configuration space, so we have to
+6 -3
drivers/net/wireless/ath/ath5k/sysfs.c
··· 10 10 struct device_attribute *attr, \ 11 11 char *buf) \ 12 12 { \ 13 - struct ath5k_softc *sc = dev_get_drvdata(dev); \ 13 + struct ieee80211_hw *hw = dev_get_drvdata(dev); \ 14 + struct ath5k_softc *sc = hw->priv; \ 14 15 return snprintf(buf, PAGE_SIZE, "%d\n", get); \ 15 16 } \ 16 17 \ ··· 19 18 struct device_attribute *attr, \ 20 19 const char *buf, size_t count) \ 21 20 { \ 22 - struct ath5k_softc *sc = dev_get_drvdata(dev); \ 21 + struct ieee80211_hw *hw = dev_get_drvdata(dev); \ 22 + struct ath5k_softc *sc = hw->priv; \ 23 23 int val; \ 24 24 \ 25 25 val = (int)simple_strtoul(buf, NULL, 10); \ ··· 35 33 struct device_attribute *attr, \ 36 34 char *buf) \ 37 35 { \ 38 - struct ath5k_softc *sc = dev_get_drvdata(dev); \ 36 + struct ieee80211_hw *hw = dev_get_drvdata(dev); \ 37 + struct ath5k_softc *sc = hw->priv; \ 39 38 return snprintf(buf, PAGE_SIZE, "%d\n", get); \ 40 39 } \ 41 40 static DEVICE_ATTR(name, S_IRUGO, ath5k_attr_show_##name, NULL)
+2 -1
drivers/net/wireless/ath/ath9k/xmit.c
··· 671 671 * TODO - this could be improved to be dependent on the rate. 672 672 * The hardware can keep up at lower rates, but not higher rates 673 673 */ 674 - if (fi->keyix != ATH9K_TXKEYIX_INVALID) 674 + if ((fi->keyix != ATH9K_TXKEYIX_INVALID) && 675 + !(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) 675 676 ndelim += ATH_AGGR_ENCRYPTDELIM; 676 677 677 678 /*
+2
drivers/net/wireless/ath/carl9170/usb.c
··· 112 112 { USB_DEVICE(0x04bb, 0x093f) }, 113 113 /* NEC WL300NU-G */ 114 114 { USB_DEVICE(0x0409, 0x0249) }, 115 + /* NEC WL300NU-AG */ 116 + { USB_DEVICE(0x0409, 0x02b4) }, 115 117 /* AVM FRITZ!WLAN USB Stick N */ 116 118 { USB_DEVICE(0x057c, 0x8401) }, 117 119 /* AVM FRITZ!WLAN USB Stick N 2.4 */
+1
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
··· 298 298 {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/ 299 299 {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/ 300 300 {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/ 301 + {RTL_USB_DEVICE(0x0846, 0x9041, rtl92cu_hal_cfg)}, /*NetGear WNA1000M*/ 301 302 {RTL_USB_DEVICE(0x0Df6, 0x0052, rtl92cu_hal_cfg)}, /*Sitecom - Edimax*/ 302 303 {RTL_USB_DEVICE(0x0eb0, 0x9071, rtl92cu_hal_cfg)}, /*NO Brand - Etop*/ 303 304 /* HP - Lite-On ,8188CUS Slim Combo */
+2 -2
drivers/pcmcia/pxa2xx_vpac270.c
··· 76 76 static void vpac270_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) 77 77 { 78 78 if (skt->nr == 0) 79 - gpio_request_array(vpac270_pcmcia_gpios, 79 + gpio_free_array(vpac270_pcmcia_gpios, 80 80 ARRAY_SIZE(vpac270_pcmcia_gpios)); 81 81 else 82 - gpio_request_array(vpac270_cf_gpios, 82 + gpio_free_array(vpac270_cf_gpios, 83 83 ARRAY_SIZE(vpac270_cf_gpios)); 84 84 } 85 85
+9 -9
drivers/ssb/driver_pcicore.c
··· 516 516 517 517 static void ssb_pcicore_init_clientmode(struct ssb_pcicore *pc) 518 518 { 519 + ssb_pcicore_fix_sprom_core_index(pc); 520 + 519 521 /* Disable PCI interrupts. */ 520 522 ssb_write32(pc->dev, SSB_INTVEC, 0); 523 + 524 + /* Additional PCIe always once-executed workarounds */ 525 + if (pc->dev->id.coreid == SSB_DEV_PCIE) { 526 + ssb_pcicore_serdes_workaround(pc); 527 + /* TODO: ASPM */ 528 + /* TODO: Clock Request Update */ 529 + } 521 530 } 522 531 523 532 void ssb_pcicore_init(struct ssb_pcicore *pc) ··· 538 529 if (!ssb_device_is_enabled(dev)) 539 530 ssb_device_enable(dev, 0); 540 531 541 - ssb_pcicore_fix_sprom_core_index(pc); 542 - 543 532 #ifdef CONFIG_SSB_PCICORE_HOSTMODE 544 533 pc->hostmode = pcicore_is_in_hostmode(pc); 545 534 if (pc->hostmode) ··· 545 538 #endif /* CONFIG_SSB_PCICORE_HOSTMODE */ 546 539 if (!pc->hostmode) 547 540 ssb_pcicore_init_clientmode(pc); 548 - 549 - /* Additional PCIe always once-executed workarounds */ 550 - if (dev->id.coreid == SSB_DEV_PCIE) { 551 - ssb_pcicore_serdes_workaround(pc); 552 - /* TODO: ASPM */ 553 - /* TODO: Clock Request Update */ 554 - } 555 541 } 556 542 557 543 static u32 ssb_pcie_read(struct ssb_pcicore *pc, u32 address)
+1 -2
drivers/watchdog/Kconfig
··· 599 599 600 600 config HP_WATCHDOG 601 601 tristate "HP ProLiant iLO2+ Hardware Watchdog Timer" 602 - depends on X86 603 - default m 602 + depends on X86 && PCI 604 603 help 605 604 A software monitoring watchdog and NMI sourcing driver. This driver 606 605 will detect lockups and provide a stack trace. This is a driver that
+16 -3
fs/ceph/mds_client.c
··· 1438 1438 struct dentry *temp; 1439 1439 char *path; 1440 1440 int len, pos; 1441 + unsigned seq; 1441 1442 1442 1443 if (dentry == NULL) 1443 1444 return ERR_PTR(-EINVAL); 1444 1445 1445 1446 retry: 1446 1447 len = 0; 1448 + seq = read_seqbegin(&rename_lock); 1449 + rcu_read_lock(); 1447 1450 for (temp = dentry; !IS_ROOT(temp);) { 1448 1451 struct inode *inode = temp->d_inode; 1449 1452 if (inode && ceph_snap(inode) == CEPH_SNAPDIR) ··· 1458 1455 len += 1 + temp->d_name.len; 1459 1456 temp = temp->d_parent; 1460 1457 if (temp == NULL) { 1458 + rcu_read_unlock(); 1461 1459 pr_err("build_path corrupt dentry %p\n", dentry); 1462 1460 return ERR_PTR(-EINVAL); 1463 1461 } 1464 1462 } 1463 + rcu_read_unlock(); 1465 1464 if (len) 1466 1465 len--; /* no leading '/' */ 1467 1466 ··· 1472 1467 return ERR_PTR(-ENOMEM); 1473 1468 pos = len; 1474 1469 path[pos] = 0; /* trailing null */ 1470 + rcu_read_lock(); 1475 1471 for (temp = dentry; !IS_ROOT(temp) && pos != 0; ) { 1476 - struct inode *inode = temp->d_inode; 1472 + struct inode *inode; 1477 1473 1474 + spin_lock(&temp->d_lock); 1475 + inode = temp->d_inode; 1478 1476 if (inode && ceph_snap(inode) == CEPH_SNAPDIR) { 1479 1477 dout("build_path path+%d: %p SNAPDIR\n", 1480 1478 pos, temp); ··· 1486 1478 break; 1487 1479 } else { 1488 1480 pos -= temp->d_name.len; 1489 - if (pos < 0) 1481 + if (pos < 0) { 1482 + spin_unlock(&temp->d_lock); 1490 1483 break; 1484 + } 1491 1485 strncpy(path + pos, temp->d_name.name, 1492 1486 temp->d_name.len); 1493 1487 } 1488 + spin_unlock(&temp->d_lock); 1494 1489 if (pos) 1495 1490 path[--pos] = '/'; 1496 1491 temp = temp->d_parent; 1497 1492 if (temp == NULL) { 1493 + rcu_read_unlock(); 1498 1494 pr_err("build_path corrupt dentry\n"); 1499 1495 kfree(path); 1500 1496 return ERR_PTR(-EINVAL); 1501 1497 } 1502 1498 } 1503 - if (pos != 0) { 1499 + rcu_read_unlock(); 1500 + if (pos != 0 || read_seqretry(&rename_lock, seq)) { 1504 1501 pr_err("build_path did not end path lookup where " 1505 1502 "expected, namelen is %d, pos is %d\n", len, pos); 1506 1503 /* presumably this is only possible if racing with a
+26 -68
fs/cifs/cifsfs.c
··· 35 35 #include <linux/delay.h> 36 36 #include <linux/kthread.h> 37 37 #include <linux/freezer.h> 38 + #include <linux/namei.h> 38 39 #include <net/ipv6.h> 39 40 #include "cifsfs.h" 40 41 #include "cifspdu.h" ··· 543 542 static struct dentry * 544 543 cifs_get_root(struct smb_vol *vol, struct super_block *sb) 545 544 { 546 - int xid, rc; 547 - struct inode *inode; 548 - struct qstr name; 549 - struct dentry *dparent = NULL, *dchild = NULL, *alias; 545 + struct dentry *dentry; 550 546 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 551 - unsigned int i, full_len, len; 552 - char *full_path = NULL, *pstart; 547 + char *full_path = NULL; 548 + char *s, *p; 553 549 char sep; 550 + int xid; 554 551 555 552 full_path = cifs_build_path_to_root(vol, cifs_sb, 556 553 cifs_sb_master_tcon(cifs_sb)); ··· 559 560 560 561 xid = GetXid(); 561 562 sep = CIFS_DIR_SEP(cifs_sb); 562 - dparent = dget(sb->s_root); 563 - full_len = strlen(full_path); 564 - full_path[full_len] = sep; 565 - pstart = full_path + 1; 563 + dentry = dget(sb->s_root); 564 + p = s = full_path; 566 565 567 - for (i = 1, len = 0; i <= full_len; i++) { 568 - if (full_path[i] != sep || !len) { 569 - len++; 570 - continue; 571 - } 566 + do { 567 + struct inode *dir = dentry->d_inode; 568 + struct dentry *child; 572 569 573 - full_path[i] = 0; 574 - cFYI(1, "get dentry for %s", pstart); 570 + /* skip separators */ 571 + while (*s == sep) 572 + s++; 573 + if (!*s) 574 + break; 575 + p = s++; 576 + /* next separator */ 577 + while (*s && *s != sep) 578 + s++; 575 579 576 - name.name = pstart; 577 - name.len = len; 578 - name.hash = full_name_hash(pstart, len); 579 - dchild = d_lookup(dparent, &name); 580 - if (dchild == NULL) { 581 - cFYI(1, "not exists"); 582 - dchild = d_alloc(dparent, &name); 583 - if (dchild == NULL) { 584 - dput(dparent); 585 - dparent = ERR_PTR(-ENOMEM); 586 - goto out; 587 - } 588 - } 589 - 590 - cFYI(1, "get inode"); 591 - if (dchild->d_inode == NULL) { 592 - cFYI(1, "not exists"); 593 - inode = NULL; 594 - if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext) 595 - rc = cifs_get_inode_info_unix(&inode, full_path, 596 - sb, xid); 597 - else 598 - rc = cifs_get_inode_info(&inode, full_path, 599 - NULL, sb, xid, NULL); 600 - if (rc) { 601 - dput(dchild); 602 - dput(dparent); 603 - dparent = ERR_PTR(rc); 604 - goto out; 605 - } 606 - alias = d_materialise_unique(dchild, inode); 607 - if (alias != NULL) { 608 - dput(dchild); 609 - if (IS_ERR(alias)) { 610 - dput(dparent); 611 - dparent = ERR_PTR(-EINVAL); /* XXX */ 612 - goto out; 613 - } 614 - dchild = alias; 615 - } 616 - } 617 - cFYI(1, "parent %p, child %p", dparent, dchild); 618 - 619 - dput(dparent); 620 - dparent = dchild; 621 - len = 0; 622 - pstart = full_path + i + 1; 623 - full_path[i] = sep; 624 - } 625 - out: 580 + mutex_lock(&dir->i_mutex); 581 + child = lookup_one_len(p, dentry, s - p); 582 + mutex_unlock(&dir->i_mutex); 583 + dput(dentry); 584 + dentry = child; 585 + } while (!IS_ERR(dentry)); 626 586 _FreeXid(xid); 627 587 kfree(full_path); 628 - return dparent; 588 + return dentry; 629 589 } 630 590 631 591 static int cifs_set_super(struct super_block *sb, void *data)
+1 -1
fs/cifs/cifsfs.h
··· 129 129 extern const struct export_operations cifs_export_ops; 130 130 #endif /* CIFS_NFSD_EXPORT */ 131 131 132 - #define CIFS_VERSION "1.73" 132 + #define CIFS_VERSION "1.74" 133 133 #endif /* _CIFSFS_H */
+1 -1
fs/cifs/connect.c
··· 3485 3485 goto out; 3486 3486 } 3487 3487 3488 - snprintf(username, MAX_USERNAME_SIZE, "krb50x%x", fsuid); 3488 + snprintf(username, sizeof(username), "krb50x%x", fsuid); 3489 3489 vol_info->username = username; 3490 3490 vol_info->local_nls = cifs_sb->local_nls; 3491 3491 vol_info->linux_uid = fsuid;
+12 -1
fs/cifs/dir.c
··· 55 55 char dirsep; 56 56 struct cifs_sb_info *cifs_sb = CIFS_SB(direntry->d_sb); 57 57 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); 58 + unsigned seq; 58 59 59 60 if (direntry == NULL) 60 61 return NULL; /* not much we can do if dentry is freed and ··· 69 68 dfsplen = 0; 70 69 cifs_bp_rename_retry: 71 70 namelen = dfsplen; 71 + seq = read_seqbegin(&rename_lock); 72 + rcu_read_lock(); 72 73 for (temp = direntry; !IS_ROOT(temp);) { 73 74 namelen += (1 + temp->d_name.len); 74 75 temp = temp->d_parent; 75 76 if (temp == NULL) { 76 77 cERROR(1, "corrupt dentry"); 78 + rcu_read_unlock(); 77 79 return NULL; 78 80 } 79 81 } 82 + rcu_read_unlock(); 80 83 81 84 full_path = kmalloc(namelen+1, GFP_KERNEL); 82 85 if (full_path == NULL) 83 86 return full_path; 84 87 full_path[namelen] = 0; /* trailing null */ 88 + rcu_read_lock(); 85 89 for (temp = direntry; !IS_ROOT(temp);) { 90 + spin_lock(&temp->d_lock); 86 91 namelen -= 1 + temp->d_name.len; 87 92 if (namelen < 0) { 93 + spin_unlock(&temp->d_lock); 88 94 break; 89 95 } else { 90 96 full_path[namelen] = dirsep; ··· 99 91 temp->d_name.len); 100 92 cFYI(0, "name: %s", full_path + namelen); 101 93 } 94 + spin_unlock(&temp->d_lock); 102 95 temp = temp->d_parent; 103 96 if (temp == NULL) { 104 97 cERROR(1, "corrupt dentry"); 98 + rcu_read_unlock(); 105 99 kfree(full_path); 106 100 return NULL; 107 101 } 108 102 } 109 - if (namelen != dfsplen) { 103 + rcu_read_unlock(); 104 + if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) { 110 105 cERROR(1, "did not end path lookup where expected namelen is %d", 111 106 namelen); 112 107 /* presumably this is only possible if racing with a rename
+1 -1
fs/cifs/file.c
··· 1737 1737 io_parms.pid = pid; 1738 1738 io_parms.tcon = pTcon; 1739 1739 io_parms.offset = *poffset; 1740 - io_parms.length = len; 1740 + io_parms.length = cur_len; 1741 1741 rc = CIFSSMBRead(xid, &io_parms, &bytes_read, 1742 1742 &read_data, &buf_type); 1743 1743 pSMBr = (struct smb_com_read_rsp *)read_data;
+5 -5
fs/cifs/sess.c
··· 428 428 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) { 429 429 flags |= NTLMSSP_NEGOTIATE_SIGN; 430 430 if (!ses->server->session_estab) 431 - flags |= NTLMSSP_NEGOTIATE_KEY_XCH | 432 - NTLMSSP_NEGOTIATE_EXTENDED_SEC; 431 + flags |= NTLMSSP_NEGOTIATE_KEY_XCH; 433 432 } 434 433 435 434 sec_blob->NegotiateFlags = cpu_to_le32(flags); ··· 464 465 NTLMSSP_NEGOTIATE_128 | NTLMSSP_NEGOTIATE_UNICODE | 465 466 NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_EXTENDED_SEC; 466 467 if (ses->server->sec_mode & 467 - (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) 468 + (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) { 468 469 flags |= NTLMSSP_NEGOTIATE_SIGN; 469 - if (ses->server->sec_mode & SECMODE_SIGN_REQUIRED) 470 - flags |= NTLMSSP_NEGOTIATE_ALWAYS_SIGN; 470 + if (!ses->server->session_estab) 471 + flags |= NTLMSSP_NEGOTIATE_KEY_XCH; 472 + } 471 473 472 474 tmp = pbuffer + sizeof(AUTHENTICATE_MESSAGE); 473 475 sec_blob->NegotiateFlags = cpu_to_le32(flags);
+12 -10
fs/cramfs/inode.c
··· 37 37 /* These macros may change in future, to provide better st_ino semantics. */ 38 38 #define OFFSET(x) ((x)->i_ino) 39 39 40 - static unsigned long cramino(struct cramfs_inode *cino, unsigned int offset) 40 + static unsigned long cramino(const struct cramfs_inode *cino, unsigned int offset) 41 41 { 42 42 if (!cino->offset) 43 43 return offset + 1; ··· 61 61 } 62 62 63 63 static struct inode *get_cramfs_inode(struct super_block *sb, 64 - struct cramfs_inode *cramfs_inode, unsigned int offset) 64 + const struct cramfs_inode *cramfs_inode, unsigned int offset) 65 65 { 66 66 struct inode *inode; 67 67 static struct timespec zerotime; ··· 317 317 /* Set it all up.. */ 318 318 sb->s_op = &cramfs_ops; 319 319 root = get_cramfs_inode(sb, &super.root, 0); 320 - if (!root) 320 + if (IS_ERR(root)) 321 321 goto out; 322 322 sb->s_root = d_alloc_root(root); 323 323 if (!sb->s_root) { ··· 423 423 static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) 424 424 { 425 425 unsigned int offset = 0; 426 + struct inode *inode = NULL; 426 427 int sorted; 427 428 428 429 mutex_lock(&read_mutex); ··· 450 449 451 450 for (;;) { 452 451 if (!namelen) { 453 - mutex_unlock(&read_mutex); 454 - return ERR_PTR(-EIO); 452 + inode = ERR_PTR(-EIO); 453 + goto out; 455 454 } 456 455 if (name[namelen-1]) 457 456 break; ··· 463 462 if (retval > 0) 464 463 continue; 465 464 if (!retval) { 466 - struct cramfs_inode entry = *de; 467 - mutex_unlock(&read_mutex); 468 - d_add(dentry, get_cramfs_inode(dir->i_sb, &entry, dir_off)); 469 - return NULL; 465 + inode = get_cramfs_inode(dir->i_sb, de, dir_off); 466 + break; 470 467 } 471 468 /* else (retval < 0) */ 472 469 if (sorted) 473 470 break; 474 471 } 472 + out: 475 473 mutex_unlock(&read_mutex); 476 - d_add(dentry, NULL); 474 + if (IS_ERR(inode)) 475 + return ERR_CAST(inode); 476 + d_add(dentry, inode); 477 477 return NULL; 478 478 } 479 479
+34 -19
fs/dcache.c
··· 1813 1813 tname = dentry->d_name.name; 1814 1814 i = dentry->d_inode; 1815 1815 prefetch(tname); 1816 - if (i) 1817 - prefetch(i); 1818 1816 /* 1819 1817 * This seqcount check is required to ensure name and 1820 1818 * len are loaded atomically, so as not to walk off the ··· 2211 2213 * The hash value has to match the hash queue that the dentry is on.. 2212 2214 */ 2213 2215 /* 2214 - * d_move - move a dentry 2216 + * __d_move - move a dentry 2215 2217 * @dentry: entry to move 2216 2218 * @target: new dentry 2217 2219 * 2218 2220 * Update the dcache to reflect the move of a file name. Negative 2219 - * dcache entries should not be moved in this way. 2221 + * dcache entries should not be moved in this way. Caller hold 2222 + * rename_lock. 2220 2223 */ 2221 - void d_move(struct dentry * dentry, struct dentry * target) 2224 + static void __d_move(struct dentry * dentry, struct dentry * target) 2222 2225 { 2223 2226 if (!dentry->d_inode) 2224 2227 printk(KERN_WARNING "VFS: moving negative dcache entry\n"); 2225 2228 2226 2229 BUG_ON(d_ancestor(dentry, target)); 2227 2230 BUG_ON(d_ancestor(target, dentry)); 2228 - 2229 - write_seqlock(&rename_lock); 2230 2231 2231 2232 dentry_lock_for_move(dentry, target); 2232 2233 ··· 2272 2275 spin_unlock(&target->d_lock); 2273 2276 fsnotify_d_move(dentry); 2274 2277 spin_unlock(&dentry->d_lock); 2278 + } 2279 + 2280 + /* 2281 + * d_move - move a dentry 2282 + * @dentry: entry to move 2283 + * @target: new dentry 2284 + * 2285 + * Update the dcache to reflect the move of a file name. Negative 2286 + * dcache entries should not be moved in this way. 2287 + */ 2288 + void d_move(struct dentry *dentry, struct dentry *target) 2289 + { 2290 + write_seqlock(&rename_lock); 2291 + __d_move(dentry, target); 2275 2292 write_sequnlock(&rename_lock); 2276 2293 } 2277 2294 EXPORT_SYMBOL(d_move); ··· 2313 2302 * This helper attempts to cope with remotely renamed directories 2314 2303 * 2315 2304 * It assumes that the caller is already holding 2316 - * dentry->d_parent->d_inode->i_mutex and the inode->i_lock 2305 + * dentry->d_parent->d_inode->i_mutex, inode->i_lock and rename_lock 2317 2306 * 2318 2307 * Note: If ever the locking in lock_rename() changes, then please 2319 2308 * remember to update this too... ··· 2328 2317 if (alias->d_parent == dentry->d_parent) 2329 2318 goto out_unalias; 2330 2319 2331 - /* Check for loops */ 2332 - ret = ERR_PTR(-ELOOP); 2333 - if (d_ancestor(alias, dentry)) 2334 - goto out_err; 2335 - 2336 2320 /* See lock_rename() */ 2337 2321 ret = ERR_PTR(-EBUSY); 2338 2322 if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex)) ··· 2337 2331 goto out_err; 2338 2332 m2 = &alias->d_parent->d_inode->i_mutex; 2339 2333 out_unalias: 2340 - d_move(alias, dentry); 2334 + __d_move(alias, dentry); 2341 2335 ret = alias; 2342 2336 out_err: 2343 2337 spin_unlock(&inode->i_lock); ··· 2422 2416 alias = __d_find_alias(inode, 0); 2423 2417 if (alias) { 2424 2418 actual = alias; 2425 - /* Is this an anonymous mountpoint that we could splice 2426 - * into our tree? */ 2427 - if (IS_ROOT(alias)) { 2419 + write_seqlock(&rename_lock); 2420 + 2421 + if (d_ancestor(alias, dentry)) { 2422 + /* Check for loops */ 2423 + actual = ERR_PTR(-ELOOP); 2424 + } else if (IS_ROOT(alias)) { 2425 + /* Is this an anonymous mountpoint that we 2426 + * could splice into our tree? */ 2428 2427 __d_materialise_dentry(dentry, alias); 2428 + write_sequnlock(&rename_lock); 2429 2429 __d_drop(alias); 2430 2430 goto found; 2431 + } else { 2432 + /* Nope, but we must(!) avoid directory 2433 + * aliasing */ 2434 + actual = __d_unalias(inode, dentry, alias); 2431 2435 } 2432 - /* Nope, but we must(!) avoid directory aliasing */ 2433 - actual = __d_unalias(inode, dentry, alias); 2436 + write_sequnlock(&rename_lock); 2434 2437 if (IS_ERR(actual)) 2435 2438 dput(alias); 2436 2439 goto out_nolock;
+1 -1
fs/exofs/super.c
··· 913 913 unsigned long ino = exofs_parent_ino(child); 914 914 915 915 if (!ino) 916 - return NULL; 916 + return ERR_PTR(-ESTALE); 917 917 918 918 return d_obtain_alias(exofs_iget(child->d_inode->i_sb, ino)); 919 919 }
+5 -9
fs/fscache/page.c
··· 976 976 977 977 pagevec_init(&pvec, 0); 978 978 next = 0; 979 - while (next <= (loff_t)-1 && 980 - pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE) 981 - ) { 979 + do { 980 + if (!pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) 981 + break; 982 982 for (i = 0; i < pagevec_count(&pvec); i++) { 983 983 struct page *page = pvec.pages[i]; 984 - pgoff_t page_index = page->index; 985 - 986 - ASSERTCMP(page_index, >=, next); 987 - next = page_index + 1; 988 - 984 + next = page->index; 989 985 if (PageFsCache(page)) { 990 986 __fscache_wait_on_page_write(cookie, page); 991 987 __fscache_uncache_page(cookie, page); ··· 989 993 } 990 994 pagevec_release(&pvec); 991 995 cond_resched(); 992 - } 996 + } while (++next); 993 997 994 998 _leave(""); 995 999 }
+3
fs/gfs2/aops.c
··· 1069 1069 return 0; 1070 1070 1071 1071 gfs2_log_lock(sdp); 1072 + spin_lock(&sdp->sd_ail_lock); 1072 1073 head = bh = page_buffers(page); 1073 1074 do { 1074 1075 if (atomic_read(&bh->b_count)) ··· 1081 1080 goto not_possible; 1082 1081 bh = bh->b_this_page; 1083 1082 } while(bh != head); 1083 + spin_unlock(&sdp->sd_ail_lock); 1084 1084 gfs2_log_unlock(sdp); 1085 1085 1086 1086 head = bh = page_buffers(page); ··· 1114 1112 WARN_ON(buffer_dirty(bh)); 1115 1113 WARN_ON(buffer_pinned(bh)); 1116 1114 cannot_release: 1115 + spin_unlock(&sdp->sd_ail_lock); 1117 1116 gfs2_log_unlock(sdp); 1118 1117 return 0; 1119 1118 }
+5 -3
fs/gfs2/glops.c
··· 47 47 bd_ail_gl_list); 48 48 bh = bd->bd_bh; 49 49 gfs2_remove_from_ail(bd); 50 - spin_unlock(&sdp->sd_ail_lock); 51 - 52 50 bd->bd_bh = NULL; 53 51 bh->b_private = NULL; 52 + spin_unlock(&sdp->sd_ail_lock); 53 + 54 54 bd->bd_blkno = bh->b_blocknr; 55 55 gfs2_log_lock(sdp); 56 56 gfs2_assert_withdraw(sdp, !buffer_busy(bh)); ··· 221 221 } 222 222 } 223 223 224 - if (ip == GFS2_I(gl->gl_sbd->sd_rindex)) 224 + if (ip == GFS2_I(gl->gl_sbd->sd_rindex)) { 225 + gfs2_log_flush(gl->gl_sbd, NULL); 225 226 gl->gl_sbd->sd_rindex_uptodate = 0; 227 + } 226 228 if (ip && S_ISREG(ip->i_inode.i_mode)) 227 229 truncate_inode_pages(ip->i_inode.i_mapping, 0); 228 230 }
+2
fs/gfs2/incore.h
··· 17 17 #include <linux/buffer_head.h> 18 18 #include <linux/rcupdate.h> 19 19 #include <linux/rculist_bl.h> 20 + #include <linux/completion.h> 20 21 21 22 #define DIO_WAIT 0x00000010 22 23 #define DIO_METADATA 0x00000020 ··· 547 546 struct gfs2_glock *sd_trans_gl; 548 547 wait_queue_head_t sd_glock_wait; 549 548 atomic_t sd_glock_disposal; 549 + struct completion sd_locking_init; 550 550 551 551 /* Inode Stuff */ 552 552
+1
fs/gfs2/log.c
··· 903 903 if (gfs2_ail1_empty(sdp)) 904 904 break; 905 905 } 906 + gfs2_log_flush(sdp, NULL); 906 907 } 907 908 908 909 static inline int gfs2_jrnl_flush_reqd(struct gfs2_sbd *sdp)
+3
fs/gfs2/ops_fstype.c
··· 72 72 73 73 init_waitqueue_head(&sdp->sd_glock_wait); 74 74 atomic_set(&sdp->sd_glock_disposal, 0); 75 + init_completion(&sdp->sd_locking_init); 75 76 spin_lock_init(&sdp->sd_statfs_spin); 76 77 77 78 spin_lock_init(&sdp->sd_rindex_spin); ··· 1018 1017 fsname++; 1019 1018 if (lm->lm_mount == NULL) { 1020 1019 fs_info(sdp, "Now mounting FS...\n"); 1020 + complete(&sdp->sd_locking_init); 1021 1021 return 0; 1022 1022 } 1023 1023 ret = lm->lm_mount(sdp, fsname); 1024 1024 if (ret == 0) 1025 1025 fs_info(sdp, "Joined cluster. Now mounting FS...\n"); 1026 + complete(&sdp->sd_locking_init); 1026 1027 return ret; 1027 1028 } 1028 1029
+30 -6
fs/gfs2/super.c
··· 757 757 struct timespec atime; 758 758 struct gfs2_dinode *di; 759 759 int ret = -EAGAIN; 760 + int unlock_required = 0; 760 761 761 762 /* Skip timestamp update, if this is from a memalloc */ 762 763 if (current->flags & PF_MEMALLOC) 763 764 goto do_flush; 764 - ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); 765 - if (ret) 766 - goto do_flush; 765 + if (!gfs2_glock_is_locked_by_me(ip->i_gl)) { 766 + ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); 767 + if (ret) 768 + goto do_flush; 769 + unlock_required = 1; 770 + } 767 771 ret = gfs2_trans_begin(sdp, RES_DINODE, 0); 768 772 if (ret) 769 773 goto do_unlock; ··· 784 780 } 785 781 gfs2_trans_end(sdp); 786 782 do_unlock: 787 - gfs2_glock_dq_uninit(&gh); 783 + if (unlock_required) 784 + gfs2_glock_dq_uninit(&gh); 788 785 do_flush: 789 786 if (wbc->sync_mode == WB_SYNC_ALL) 790 787 gfs2_log_flush(GFS2_SB(inode), ip->i_gl); ··· 1432 1427 return error; 1433 1428 } 1434 1429 1435 - /* 1430 + /** 1431 + * gfs2_evict_inode - Remove an inode from cache 1432 + * @inode: The inode to evict 1433 + * 1434 + * There are three cases to consider: 1435 + * 1. i_nlink == 0, we are final opener (and must deallocate) 1436 + * 2. i_nlink == 0, we are not the final opener (and cannot deallocate) 1437 + * 3. i_nlink > 0 1438 + * 1439 + * If the fs is read only, then we have to treat all cases as per #3 1440 + * since we are unable to do any deallocation. The inode will be 1441 + * deallocated by the next read/write node to attempt an allocation 1442 + * in the same resource group 1443 + * 1436 1444 * We have to (at the moment) hold the inodes main lock to cover 1437 1445 * the gap between unlocking the shared lock on the iopen lock and 1438 1446 * taking the exclusive lock. I'd rather do a shared -> exclusive ··· 1488 1470 if (error) 1489 1471 goto out_truncate; 1490 1472 1473 + /* Case 1 starts here */ 1474 + 1491 1475 if (S_ISDIR(inode->i_mode) && 1492 1476 (ip->i_diskflags & GFS2_DIF_EXHASH)) { 1493 1477 error = gfs2_dir_exhash_dealloc(ip); ··· 1513 1493 goto out_unlock; 1514 1494 1515 1495 out_truncate: 1496 + /* Case 2 starts here */ 1516 1497 error = gfs2_trans_begin(sdp, 0, sdp->sd_jdesc->jd_blocks); 1517 1498 if (error) 1518 1499 goto out_unlock; 1519 - gfs2_final_release_pages(ip); 1500 + /* Needs to be done before glock release & also in a transaction */ 1501 + truncate_inode_pages(&inode->i_data, 0); 1520 1502 gfs2_trans_end(sdp); 1521 1503 1522 1504 out_unlock: 1505 + /* Error path for case 1 */ 1523 1506 if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) 1524 1507 gfs2_glock_dq(&ip->i_iopen_gh); 1525 1508 gfs2_holder_uninit(&ip->i_iopen_gh); ··· 1530 1507 if (error && error != GLR_TRYFAILED && error != -EROFS) 1531 1508 fs_warn(sdp, "gfs2_evict_inode: %d\n", error); 1532 1509 out: 1510 + /* Case 3 starts here */ 1533 1511 truncate_inode_pages(&inode->i_data, 0); 1534 1512 end_writeback(inode); 1535 1513
+6 -1
fs/gfs2/sys.c
··· 338 338 rv = sscanf(buf, "%u", &first); 339 339 if (rv != 1 || first > 1) 340 340 return -EINVAL; 341 + rv = wait_for_completion_killable(&sdp->sd_locking_init); 342 + if (rv) 343 + return rv; 341 344 spin_lock(&sdp->sd_jindex_spin); 342 345 rv = -EBUSY; 343 346 if (test_bit(SDF_NOJOURNALID, &sdp->sd_flags) == 0) ··· 417 414 rv = sscanf(buf, "%d", &jid); 418 415 if (rv != 1) 419 416 return -EINVAL; 420 - 417 + rv = wait_for_completion_killable(&sdp->sd_locking_init); 418 + if (rv) 419 + return rv; 421 420 spin_lock(&sdp->sd_jindex_spin); 422 421 rv = -EINVAL; 423 422 if (sdp->sd_lockstruct.ls_ops->lm_mount == NULL)
+9 -22
fs/hppfs/hppfs.c
··· 139 139 static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry, 140 140 struct nameidata *nd) 141 141 { 142 - struct dentry *proc_dentry, *new, *parent; 142 + struct dentry *proc_dentry, *parent; 143 + struct qstr *name = &dentry->d_name; 143 144 struct inode *inode; 144 145 int err, deleted; 145 146 ··· 150 149 else if (deleted) 151 150 return ERR_PTR(-ENOENT); 152 151 153 - err = -ENOMEM; 154 152 parent = HPPFS_I(ino)->proc_dentry; 155 153 mutex_lock(&parent->d_inode->i_mutex); 156 - proc_dentry = d_lookup(parent, &dentry->d_name); 157 - if (proc_dentry == NULL) { 158 - proc_dentry = d_alloc(parent, &dentry->d_name); 159 - if (proc_dentry == NULL) { 160 - mutex_unlock(&parent->d_inode->i_mutex); 161 - goto out; 162 - } 163 - new = (*parent->d_inode->i_op->lookup)(parent->d_inode, 164 - proc_dentry, NULL); 165 - if (new) { 166 - dput(proc_dentry); 167 - proc_dentry = new; 168 - } 169 - } 154 + proc_dentry = lookup_one_len(name->name, parent, name->len); 170 155 mutex_unlock(&parent->d_inode->i_mutex); 171 156 172 157 if (IS_ERR(proc_dentry)) ··· 161 174 err = -ENOMEM; 162 175 inode = get_inode(ino->i_sb, proc_dentry); 163 176 if (!inode) 164 - goto out_dput; 177 + goto out; 165 178 166 179 d_add(dentry, inode); 167 180 return NULL; 168 181 169 - out_dput: 170 - dput(proc_dentry); 171 182 out: 172 183 return ERR_PTR(err); 173 184 } ··· 675 690 struct inode *proc_ino = dentry->d_inode; 676 691 struct inode *inode = new_inode(sb); 677 692 678 - if (!inode) 693 + if (!inode) { 694 + dput(dentry); 679 695 return ERR_PTR(-ENOMEM); 696 + } 680 697 681 698 if (S_ISDIR(dentry->d_inode->i_mode)) { 682 699 inode->i_op = &hppfs_dir_iops; ··· 691 704 inode->i_fop = &hppfs_file_fops; 692 705 } 693 706 694 - HPPFS_I(inode)->proc_dentry = dget(dentry); 707 + HPPFS_I(inode)->proc_dentry = dentry; 695 708 696 709 inode->i_uid = proc_ino->i_uid; 697 710 inode->i_gid = proc_ino->i_gid; ··· 724 737 sb->s_fs_info = proc_mnt; 725 738 726 739 err = -ENOMEM; 727 - root_inode = get_inode(sb, proc_mnt->mnt_sb->s_root); 740 + root_inode = get_inode(sb, dget(proc_mnt->mnt_sb->s_root)); 728 741 if (!root_inode) 729 742 goto out_mntput; 730 743
+1 -1
fs/libfs.c
··· 822 822 goto out; 823 823 824 824 attr->set_buf[size] = '\0'; 825 - val = simple_strtol(attr->set_buf, NULL, 0); 825 + val = simple_strtoll(attr->set_buf, NULL, 0); 826 826 ret = attr->set(attr->data, val); 827 827 if (ret == 0) 828 828 ret = len; /* on success, claim we got the whole input */
+8 -1
fs/namei.c
··· 433 433 goto err_parent; 434 434 BUG_ON(nd->inode != parent->d_inode); 435 435 } else { 436 + if (dentry->d_parent != parent) 437 + goto err_parent; 436 438 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); 437 439 if (!__d_rcu_to_refcount(dentry, nd->seq)) 438 440 goto err_child; ··· 942 940 * Don't forget we might have a non-mountpoint managed dentry 943 941 * that wants to block transit. 944 942 */ 945 - *inode = path->dentry->d_inode; 946 943 if (unlikely(managed_dentry_might_block(path->dentry))) 947 944 return false; 948 945 ··· 954 953 path->mnt = mounted; 955 954 path->dentry = mounted->mnt_root; 956 955 nd->seq = read_seqcount_begin(&path->dentry->d_seq); 956 + /* 957 + * Update the inode too. We don't need to re-check the 958 + * dentry sequence number here after this d_inode read, 959 + * because a mount-point is always pinned. 960 + */ 961 + *inode = path->dentry->d_inode; 957 962 } 958 963 return true; 959 964 }
-1
fs/nfs/nfs4filelayout.c
··· 398 398 * this offset and save the original offset. 399 399 */ 400 400 data->args.offset = filelayout_get_dserver_offset(lseg, offset); 401 - data->mds_offset = offset; 402 401 403 402 /* Perform an asynchronous write */ 404 403 status = nfs_initiate_write(data, ds->ds_clp->cl_rpcclient,
+1 -1
fs/nfs/nfs4xdr.c
··· 91 91 #define encode_getfh_maxsz (op_encode_hdr_maxsz) 92 92 #define decode_getfh_maxsz (op_decode_hdr_maxsz + 1 + \ 93 93 ((3+NFS4_FHSIZE) >> 2)) 94 - #define nfs4_fattr_bitmap_maxsz 3 94 + #define nfs4_fattr_bitmap_maxsz 4 95 95 #define encode_getattr_maxsz (op_encode_hdr_maxsz + nfs4_fattr_bitmap_maxsz) 96 96 #define nfs4_name_maxsz (1 + ((3 + NFS4_MAXNAMLEN) >> 2)) 97 97 #define nfs4_path_maxsz (1 + ((3 + NFS4_MAXPATHLEN) >> 2))
+2
fs/nfs/write.c
··· 864 864 865 865 data->args.fh = NFS_FH(inode); 866 866 data->args.offset = req_offset(req) + offset; 867 + /* pnfs_set_layoutcommit needs this */ 868 + data->mds_offset = data->args.offset; 867 869 data->args.pgbase = req->wb_pgbase + offset; 868 870 data->args.pages = data->pagevec; 869 871 data->args.count = count;
+4 -8
fs/ufs/namei.c
··· 56 56 57 57 lock_ufs(dir->i_sb); 58 58 ino = ufs_inode_by_name(dir, &dentry->d_name); 59 - if (ino) { 59 + if (ino) 60 60 inode = ufs_iget(dir->i_sb, ino); 61 - if (IS_ERR(inode)) { 62 - unlock_ufs(dir->i_sb); 63 - return ERR_CAST(inode); 64 - } 65 - } 66 61 unlock_ufs(dir->i_sb); 67 - d_add(dentry, inode); 68 - return NULL; 62 + if (IS_ERR(inode)) 63 + return ERR_CAST(inode); 64 + return d_splice_alias(inode, dentry); 69 65 } 70 66 71 67 /*
+1 -1
include/acpi/acpi_bus.h
··· 210 210 struct acpi_device_power { 211 211 int state; /* Current state */ 212 212 struct acpi_device_power_flags flags; 213 - struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ 213 + struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */ 214 214 }; 215 215 216 216 /* Performance Management */
+3
include/acpi/acpiosxf.h
··· 98 98 /* 99 99 * Spinlock primitives 100 100 */ 101 + 102 + #ifndef acpi_os_create_lock 101 103 acpi_status 102 104 acpi_os_create_lock(acpi_spinlock *out_handle); 105 + #endif 103 106 104 107 void acpi_os_delete_lock(acpi_spinlock handle); 105 108
+18
include/acpi/platform/aclinux.h
··· 159 159 } while (0) 160 160 #endif 161 161 162 + /* 163 + * When lockdep is enabled, the spin_lock_init() macro stringifies it's 164 + * argument and uses that as a name for the lock in debugging. 165 + * By executing spin_lock_init() in a macro the key changes from "lock" for 166 + * all locks to the name of the argument of acpi_os_create_lock(), which 167 + * prevents lockdep from reporting false positives for ACPICA locks. 168 + */ 169 + #define acpi_os_create_lock(__handle) \ 170 + ({ \ 171 + spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \ 172 + \ 173 + if (lock) { \ 174 + *(__handle) = lock; \ 175 + spin_lock_init(*(__handle)); \ 176 + } \ 177 + lock ? AE_OK : AE_NO_MEMORY; \ 178 + }) 179 + 162 180 #endif /* __KERNEL__ */ 163 181 164 182 #endif /* __ACLINUX_H__ */
+2
include/drm/drm_pciids.h
··· 182 182 {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 183 183 {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 184 184 {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 185 + {0x1002, 0x675F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 185 186 {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 186 187 {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 187 188 {0x1002, 0x6762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ ··· 193 192 {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 194 193 {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 195 194 {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 195 + {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 196 196 {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 197 197 {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 198 198 {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \
+2 -1
include/linux/irq.h
··· 676 676 void irq_gc_mask_set_bit(struct irq_data *d); 677 677 void irq_gc_mask_clr_bit(struct irq_data *d); 678 678 void irq_gc_unmask_enable_reg(struct irq_data *d); 679 - void irq_gc_ack(struct irq_data *d); 679 + void irq_gc_ack_set_bit(struct irq_data *d); 680 + void irq_gc_ack_clr_bit(struct irq_data *d); 680 681 void irq_gc_mask_disable_reg_and_ack(struct irq_data *d); 681 682 void irq_gc_eoi(struct irq_data *d); 682 683 int irq_gc_set_wake(struct irq_data *d, unsigned int on);
+2
include/linux/memory.h
··· 20 20 #include <linux/compiler.h> 21 21 #include <linux/mutex.h> 22 22 23 + #define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS) 24 + 23 25 struct memory_block { 24 26 unsigned long start_section_nr; 25 27 unsigned long end_section_nr;
+13
include/linux/mmc/card.h
··· 64 64 unsigned long long enhanced_area_offset; /* Units: Byte */ 65 65 unsigned int enhanced_area_size; /* Units: KB */ 66 66 unsigned int boot_size; /* in bytes */ 67 + u8 raw_partition_support; /* 160 */ 68 + u8 raw_erased_mem_count; /* 181 */ 69 + u8 raw_ext_csd_structure; /* 194 */ 70 + u8 raw_card_type; /* 196 */ 71 + u8 raw_s_a_timeout; /* 217 */ 72 + u8 raw_hc_erase_gap_size; /* 221 */ 73 + u8 raw_erase_timeout_mult; /* 223 */ 74 + u8 raw_hc_erase_grp_size; /* 224 */ 75 + u8 raw_sec_trim_mult; /* 229 */ 76 + u8 raw_sec_erase_mult; /* 230 */ 77 + u8 raw_sec_feature_support;/* 231 */ 78 + u8 raw_trim_mult; /* 232 */ 79 + u8 raw_sectors[4]; /* 212 - 4 bytes */ 67 80 }; 68 81 69 82 struct sd_scr {
-6
include/linux/netdevice.h
··· 1097 1097 #define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ 1098 1098 NETIF_F_FSO) 1099 1099 1100 - #define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \ 1101 - NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ 1102 - NETIF_F_HIGHDMA | \ 1103 - NETIF_F_SCTP_CSUM | \ 1104 - NETIF_F_ALL_FCOE) 1105 - 1106 1100 /* 1107 1101 * If one device supports one of these features, then enable them 1108 1102 * for all in netdev_increment_features.
+13 -4
include/linux/sched.h
··· 844 844 #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ 845 845 #define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ 846 846 #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ 847 + #define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */ 847 848 848 849 enum powersavings_balance_level { 849 850 POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */ ··· 894 893 return 0; 895 894 } 896 895 897 - struct sched_group { 898 - struct sched_group *next; /* Must be a circular list */ 896 + struct sched_group_power { 899 897 atomic_t ref; 900 - 901 898 /* 902 899 * CPU power of this group, SCHED_LOAD_SCALE being max power for a 903 900 * single CPU. 904 901 */ 905 - unsigned int cpu_power, cpu_power_orig; 902 + unsigned int power, power_orig; 903 + }; 904 + 905 + struct sched_group { 906 + struct sched_group *next; /* Must be a circular list */ 907 + atomic_t ref; 908 + 906 909 unsigned int group_weight; 910 + struct sched_group_power *sgp; 907 911 908 912 /* 909 913 * The CPUs this group covers. ··· 1260 1254 #ifdef CONFIG_PREEMPT_RCU 1261 1255 int rcu_read_lock_nesting; 1262 1256 char rcu_read_unlock_special; 1257 + #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) 1258 + int rcu_boosted; 1259 + #endif /* #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) */ 1263 1260 struct list_head rcu_node_entry; 1264 1261 #endif /* #ifdef CONFIG_PREEMPT_RCU */ 1265 1262 #ifdef CONFIG_TREE_PREEMPT_RCU
+1 -5
include/linux/sdla.h
··· 112 112 short Tb_max; 113 113 }; 114 114 115 - #ifndef __KERNEL__ 116 - 117 - void sdla(void *cfg_info, char *dev, struct frad_conf *conf, int quiet); 118 - 119 - #else 115 + #ifdef __KERNEL__ 120 116 121 117 /* important Z80 window addresses */ 122 118 #define SDLA_CONTROL_WND 0xE000
+1
include/net/sctp/command.h
··· 63 63 SCTP_CMD_ECN_ECNE, /* Do delayed ECNE processing. */ 64 64 SCTP_CMD_ECN_CWR, /* Do delayed CWR processing. */ 65 65 SCTP_CMD_TIMER_START, /* Start a timer. */ 66 + SCTP_CMD_TIMER_START_ONCE, /* Start a timer once */ 66 67 SCTP_CMD_TIMER_RESTART, /* Restart a timer. */ 67 68 SCTP_CMD_TIMER_STOP, /* Stop a timer. */ 68 69 SCTP_CMD_INIT_CHOOSE_TRANSPORT, /* Choose transport for an INIT. */
+1 -1
include/net/sctp/ulpevent.h
··· 80 80 81 81 void sctp_ulpevent_free(struct sctp_ulpevent *); 82 82 int sctp_ulpevent_is_notification(const struct sctp_ulpevent *); 83 - void sctp_queue_purge_ulpevents(struct sk_buff_head *list); 83 + unsigned int sctp_queue_purge_ulpevents(struct sk_buff_head *list); 84 84 85 85 struct sctp_ulpevent *sctp_ulpevent_make_assoc_change( 86 86 const struct sctp_association *asoc,
+16 -2
kernel/irq/generic-chip.c
··· 101 101 } 102 102 103 103 /** 104 - * irq_gc_ack - Ack pending interrupt 104 + * irq_gc_ack_set_bit - Ack pending interrupt via setting bit 105 105 * @d: irq_data 106 106 */ 107 - void irq_gc_ack(struct irq_data *d) 107 + void irq_gc_ack_set_bit(struct irq_data *d) 108 108 { 109 109 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 110 110 u32 mask = 1 << (d->irq - gc->irq_base); 111 + 112 + irq_gc_lock(gc); 113 + irq_reg_writel(mask, gc->reg_base + cur_regs(d)->ack); 114 + irq_gc_unlock(gc); 115 + } 116 + 117 + /** 118 + * irq_gc_ack_clr_bit - Ack pending interrupt via clearing bit 119 + * @d: irq_data 120 + */ 121 + void irq_gc_ack_clr_bit(struct irq_data *d) 122 + { 123 + struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 124 + u32 mask = ~(1 << (d->irq - gc->irq_base)); 111 125 112 126 irq_gc_lock(gc); 113 127 irq_reg_writel(mask, gc->reg_base + cur_regs(d)->ack);
+25 -1
kernel/rcutree.c
··· 84 84 85 85 static struct rcu_state *rcu_state; 86 86 87 + /* 88 + * The rcu_scheduler_active variable transitions from zero to one just 89 + * before the first task is spawned. So when this variable is zero, RCU 90 + * can assume that there is but one task, allowing RCU to (for example) 91 + * optimized synchronize_sched() to a simple barrier(). When this variable 92 + * is one, RCU must actually do all the hard work required to detect real 93 + * grace periods. This variable is also used to suppress boot-time false 94 + * positives from lockdep-RCU error checking. 95 + */ 87 96 int rcu_scheduler_active __read_mostly; 88 97 EXPORT_SYMBOL_GPL(rcu_scheduler_active); 98 + 99 + /* 100 + * The rcu_scheduler_fully_active variable transitions from zero to one 101 + * during the early_initcall() processing, which is after the scheduler 102 + * is capable of creating new tasks. So RCU processing (for example, 103 + * creating tasks for RCU priority boosting) must be delayed until after 104 + * rcu_scheduler_fully_active transitions from zero to one. We also 105 + * currently delay invocation of any RCU callbacks until after this point. 106 + * 107 + * It might later prove better for people registering RCU callbacks during 108 + * early boot to take responsibility for these callbacks, but one step at 109 + * a time. 110 + */ 111 + static int rcu_scheduler_fully_active __read_mostly; 89 112 90 113 #ifdef CONFIG_RCU_BOOST 91 114 ··· 121 98 DEFINE_PER_CPU(int, rcu_cpu_kthread_cpu); 122 99 DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_loops); 123 100 DEFINE_PER_CPU(char, rcu_cpu_has_work); 124 - static char rcu_kthreads_spawnable; 125 101 126 102 #endif /* #ifdef CONFIG_RCU_BOOST */ 127 103 ··· 1489 1467 */ 1490 1468 static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp) 1491 1469 { 1470 + if (unlikely(!ACCESS_ONCE(rcu_scheduler_fully_active))) 1471 + return; 1492 1472 if (likely(!rsp->boost)) { 1493 1473 rcu_do_batch(rsp, rdp); 1494 1474 return;
+50 -18
kernel/rcutree_plugin.h
··· 68 68 DEFINE_PER_CPU(struct rcu_data, rcu_preempt_data); 69 69 static struct rcu_state *rcu_state = &rcu_preempt_state; 70 70 71 + static void rcu_read_unlock_special(struct task_struct *t); 71 72 static int rcu_preempted_readers_exp(struct rcu_node *rnp); 72 73 73 74 /* ··· 148 147 struct rcu_data *rdp; 149 148 struct rcu_node *rnp; 150 149 151 - if (t->rcu_read_lock_nesting && 150 + if (t->rcu_read_lock_nesting > 0 && 152 151 (t->rcu_read_unlock_special & RCU_READ_UNLOCK_BLOCKED) == 0) { 153 152 154 153 /* Possibly blocking in an RCU read-side critical section. */ ··· 191 190 rnp->gp_tasks = &t->rcu_node_entry; 192 191 } 193 192 raw_spin_unlock_irqrestore(&rnp->lock, flags); 193 + } else if (t->rcu_read_lock_nesting < 0 && 194 + t->rcu_read_unlock_special) { 195 + 196 + /* 197 + * Complete exit from RCU read-side critical section on 198 + * behalf of preempted instance of __rcu_read_unlock(). 199 + */ 200 + rcu_read_unlock_special(t); 194 201 } 195 202 196 203 /* ··· 293 284 * notify RCU core processing or task having blocked during the RCU 294 285 * read-side critical section. 295 286 */ 296 - static void rcu_read_unlock_special(struct task_struct *t) 287 + static noinline void rcu_read_unlock_special(struct task_struct *t) 297 288 { 298 289 int empty; 299 290 int empty_exp; ··· 318 309 } 319 310 320 311 /* Hardware IRQ handlers cannot block. */ 321 - if (in_irq()) { 312 + if (in_irq() || in_serving_softirq()) { 322 313 local_irq_restore(flags); 323 314 return; 324 315 } ··· 351 342 #ifdef CONFIG_RCU_BOOST 352 343 if (&t->rcu_node_entry == rnp->boost_tasks) 353 344 rnp->boost_tasks = np; 345 + /* Snapshot and clear ->rcu_boosted with rcu_node lock held. */ 346 + if (t->rcu_boosted) { 347 + special |= RCU_READ_UNLOCK_BOOSTED; 348 + t->rcu_boosted = 0; 349 + } 354 350 #endif /* #ifdef CONFIG_RCU_BOOST */ 355 351 t->rcu_blocked_node = NULL; 356 352 ··· 372 358 #ifdef CONFIG_RCU_BOOST 373 359 /* Unboost if we were boosted. */ 374 360 if (special & RCU_READ_UNLOCK_BOOSTED) { 375 - t->rcu_read_unlock_special &= ~RCU_READ_UNLOCK_BOOSTED; 376 361 rt_mutex_unlock(t->rcu_boost_mutex); 377 362 t->rcu_boost_mutex = NULL; 378 363 } ··· 400 387 struct task_struct *t = current; 401 388 402 389 barrier(); /* needed if we ever invoke rcu_read_unlock in rcutree.c */ 403 - --t->rcu_read_lock_nesting; 404 - barrier(); /* decrement before load of ->rcu_read_unlock_special */ 405 - if (t->rcu_read_lock_nesting == 0 && 406 - unlikely(ACCESS_ONCE(t->rcu_read_unlock_special))) 407 - rcu_read_unlock_special(t); 390 + if (t->rcu_read_lock_nesting != 1) 391 + --t->rcu_read_lock_nesting; 392 + else { 393 + t->rcu_read_lock_nesting = INT_MIN; 394 + barrier(); /* assign before ->rcu_read_unlock_special load */ 395 + if (unlikely(ACCESS_ONCE(t->rcu_read_unlock_special))) 396 + rcu_read_unlock_special(t); 397 + barrier(); /* ->rcu_read_unlock_special load before assign */ 398 + t->rcu_read_lock_nesting = 0; 399 + } 408 400 #ifdef CONFIG_PROVE_LOCKING 409 - WARN_ON_ONCE(ACCESS_ONCE(t->rcu_read_lock_nesting) < 0); 401 + { 402 + int rrln = ACCESS_ONCE(t->rcu_read_lock_nesting); 403 + 404 + WARN_ON_ONCE(rrln < 0 && rrln > INT_MIN / 2); 405 + } 410 406 #endif /* #ifdef CONFIG_PROVE_LOCKING */ 411 407 } 412 408 EXPORT_SYMBOL_GPL(__rcu_read_unlock); ··· 611 589 rcu_preempt_qs(cpu); 612 590 return; 613 591 } 614 - if (per_cpu(rcu_preempt_data, cpu).qs_pending) 592 + if (t->rcu_read_lock_nesting > 0 && 593 + per_cpu(rcu_preempt_data, cpu).qs_pending) 615 594 t->rcu_read_unlock_special |= RCU_READ_UNLOCK_NEED_QS; 616 595 } 617 596 ··· 718 695 719 696 raw_spin_lock_irqsave(&rnp->lock, flags); 720 697 for (;;) { 721 - if (!sync_rcu_preempt_exp_done(rnp)) 698 + if (!sync_rcu_preempt_exp_done(rnp)) { 699 + raw_spin_unlock_irqrestore(&rnp->lock, flags); 722 700 break; 701 + } 723 702 if (rnp->parent == NULL) { 703 + raw_spin_unlock_irqrestore(&rnp->lock, flags); 724 704 wake_up(&sync_rcu_preempt_exp_wq); 725 705 break; 726 706 } ··· 733 707 raw_spin_lock(&rnp->lock); /* irqs already disabled */ 734 708 rnp->expmask &= ~mask; 735 709 } 736 - raw_spin_unlock_irqrestore(&rnp->lock, flags); 737 710 } 738 711 739 712 /* ··· 1199 1174 t = container_of(tb, struct task_struct, rcu_node_entry); 1200 1175 rt_mutex_init_proxy_locked(&mtx, t); 1201 1176 t->rcu_boost_mutex = &mtx; 1202 - t->rcu_read_unlock_special |= RCU_READ_UNLOCK_BOOSTED; 1177 + t->rcu_boosted = 1; 1203 1178 raw_spin_unlock_irqrestore(&rnp->lock, flags); 1204 1179 rt_mutex_lock(&mtx); /* Side effect: boosts task t's priority. */ 1205 1180 rt_mutex_unlock(&mtx); /* Keep lockdep happy. */ ··· 1557 1532 struct sched_param sp; 1558 1533 struct task_struct *t; 1559 1534 1560 - if (!rcu_kthreads_spawnable || 1535 + if (!rcu_scheduler_fully_active || 1561 1536 per_cpu(rcu_cpu_kthread_task, cpu) != NULL) 1562 1537 return 0; 1563 1538 t = kthread_create(rcu_cpu_kthread, (void *)(long)cpu, "rcuc%d", cpu); ··· 1664 1639 struct sched_param sp; 1665 1640 struct task_struct *t; 1666 1641 1667 - if (!rcu_kthreads_spawnable || 1642 + if (!rcu_scheduler_fully_active || 1668 1643 rnp->qsmaskinit == 0) 1669 1644 return 0; 1670 1645 if (rnp->node_kthread_task == NULL) { ··· 1690 1665 int cpu; 1691 1666 struct rcu_node *rnp; 1692 1667 1693 - rcu_kthreads_spawnable = 1; 1668 + rcu_scheduler_fully_active = 1; 1694 1669 for_each_possible_cpu(cpu) { 1695 1670 per_cpu(rcu_cpu_has_work, cpu) = 0; 1696 1671 if (cpu_online(cpu)) ··· 1712 1687 struct rcu_node *rnp = rdp->mynode; 1713 1688 1714 1689 /* Fire up the incoming CPU's kthread and leaf rcu_node kthread. */ 1715 - if (rcu_kthreads_spawnable) { 1690 + if (rcu_scheduler_fully_active) { 1716 1691 (void)rcu_spawn_one_cpu_kthread(cpu); 1717 1692 if (rnp->node_kthread_task == NULL) 1718 1693 (void)rcu_spawn_one_node_kthread(rcu_state, rnp); ··· 1750 1725 static void rcu_cpu_kthread_setrt(int cpu, int to_rt) 1751 1726 { 1752 1727 } 1728 + 1729 + static int __init rcu_scheduler_really_started(void) 1730 + { 1731 + rcu_scheduler_fully_active = 1; 1732 + return 0; 1733 + } 1734 + early_initcall(rcu_scheduler_really_started); 1753 1735 1754 1736 static void __cpuinit rcu_prepare_kthreads(int cpu) 1755 1737 {
+196 -40
kernel/sched.c
··· 2544 2544 } 2545 2545 2546 2546 #ifdef CONFIG_SMP 2547 - static void sched_ttwu_pending(void) 2547 + static void sched_ttwu_do_pending(struct task_struct *list) 2548 2548 { 2549 2549 struct rq *rq = this_rq(); 2550 - struct task_struct *list = xchg(&rq->wake_list, NULL); 2551 - 2552 - if (!list) 2553 - return; 2554 2550 2555 2551 raw_spin_lock(&rq->lock); 2556 2552 ··· 2559 2563 raw_spin_unlock(&rq->lock); 2560 2564 } 2561 2565 2566 + #ifdef CONFIG_HOTPLUG_CPU 2567 + 2568 + static void sched_ttwu_pending(void) 2569 + { 2570 + struct rq *rq = this_rq(); 2571 + struct task_struct *list = xchg(&rq->wake_list, NULL); 2572 + 2573 + if (!list) 2574 + return; 2575 + 2576 + sched_ttwu_do_pending(list); 2577 + } 2578 + 2579 + #endif /* CONFIG_HOTPLUG_CPU */ 2580 + 2562 2581 void scheduler_ipi(void) 2563 2582 { 2564 - sched_ttwu_pending(); 2583 + struct rq *rq = this_rq(); 2584 + struct task_struct *list = xchg(&rq->wake_list, NULL); 2585 + 2586 + if (!list) 2587 + return; 2588 + 2589 + /* 2590 + * Not all reschedule IPI handlers call irq_enter/irq_exit, since 2591 + * traditionally all their work was done from the interrupt return 2592 + * path. Now that we actually do some work, we need to make sure 2593 + * we do call them. 2594 + * 2595 + * Some archs already do call them, luckily irq_enter/exit nest 2596 + * properly. 2597 + * 2598 + * Arguably we should visit all archs and update all handlers, 2599 + * however a fair share of IPIs are still resched only so this would 2600 + * somewhat pessimize the simple resched case. 2601 + */ 2602 + irq_enter(); 2603 + sched_ttwu_do_pending(list); 2604 + irq_exit(); 2565 2605 } 2566 2606 2567 2607 static void ttwu_queue_remote(struct task_struct *p, int cpu) ··· 6589 6557 break; 6590 6558 } 6591 6559 6592 - if (!group->cpu_power) { 6560 + if (!group->sgp->power) { 6593 6561 printk(KERN_CONT "\n"); 6594 6562 printk(KERN_ERR "ERROR: domain->cpu_power not " 6595 6563 "set\n"); ··· 6613 6581 cpulist_scnprintf(str, sizeof(str), sched_group_cpus(group)); 6614 6582 6615 6583 printk(KERN_CONT " %s", str); 6616 - if (group->cpu_power != SCHED_POWER_SCALE) { 6584 + if (group->sgp->power != SCHED_POWER_SCALE) { 6617 6585 printk(KERN_CONT " (cpu_power = %d)", 6618 - group->cpu_power); 6586 + group->sgp->power); 6619 6587 } 6620 6588 6621 6589 group = group->next; ··· 6806 6774 return rd; 6807 6775 } 6808 6776 6777 + static void free_sched_groups(struct sched_group *sg, int free_sgp) 6778 + { 6779 + struct sched_group *tmp, *first; 6780 + 6781 + if (!sg) 6782 + return; 6783 + 6784 + first = sg; 6785 + do { 6786 + tmp = sg->next; 6787 + 6788 + if (free_sgp && atomic_dec_and_test(&sg->sgp->ref)) 6789 + kfree(sg->sgp); 6790 + 6791 + kfree(sg); 6792 + sg = tmp; 6793 + } while (sg != first); 6794 + } 6795 + 6809 6796 static void free_sched_domain(struct rcu_head *rcu) 6810 6797 { 6811 6798 struct sched_domain *sd = container_of(rcu, struct sched_domain, rcu); 6812 - if (atomic_dec_and_test(&sd->groups->ref)) 6799 + 6800 + /* 6801 + * If its an overlapping domain it has private groups, iterate and 6802 + * nuke them all. 6803 + */ 6804 + if (sd->flags & SD_OVERLAP) { 6805 + free_sched_groups(sd->groups, 1); 6806 + } else if (atomic_dec_and_test(&sd->groups->ref)) { 6807 + kfree(sd->groups->sgp); 6813 6808 kfree(sd->groups); 6809 + } 6814 6810 kfree(sd); 6815 6811 } 6816 6812 ··· 7005 6945 struct sd_data { 7006 6946 struct sched_domain **__percpu sd; 7007 6947 struct sched_group **__percpu sg; 6948 + struct sched_group_power **__percpu sgp; 7008 6949 }; 7009 6950 7010 6951 struct s_data { ··· 7025 6964 typedef struct sched_domain *(*sched_domain_init_f)(struct sched_domain_topology_level *tl, int cpu); 7026 6965 typedef const struct cpumask *(*sched_domain_mask_f)(int cpu); 7027 6966 6967 + #define SDTL_OVERLAP 0x01 6968 + 7028 6969 struct sched_domain_topology_level { 7029 6970 sched_domain_init_f init; 7030 6971 sched_domain_mask_f mask; 6972 + int flags; 7031 6973 struct sd_data data; 7032 6974 }; 7033 6975 7034 - /* 7035 - * Assumes the sched_domain tree is fully constructed 7036 - */ 6976 + static int 6977 + build_overlap_sched_groups(struct sched_domain *sd, int cpu) 6978 + { 6979 + struct sched_group *first = NULL, *last = NULL, *groups = NULL, *sg; 6980 + const struct cpumask *span = sched_domain_span(sd); 6981 + struct cpumask *covered = sched_domains_tmpmask; 6982 + struct sd_data *sdd = sd->private; 6983 + struct sched_domain *child; 6984 + int i; 6985 + 6986 + cpumask_clear(covered); 6987 + 6988 + for_each_cpu(i, span) { 6989 + struct cpumask *sg_span; 6990 + 6991 + if (cpumask_test_cpu(i, covered)) 6992 + continue; 6993 + 6994 + sg = kzalloc_node(sizeof(struct sched_group) + cpumask_size(), 6995 + GFP_KERNEL, cpu_to_node(i)); 6996 + 6997 + if (!sg) 6998 + goto fail; 6999 + 7000 + sg_span = sched_group_cpus(sg); 7001 + 7002 + child = *per_cpu_ptr(sdd->sd, i); 7003 + if (child->child) { 7004 + child = child->child; 7005 + cpumask_copy(sg_span, sched_domain_span(child)); 7006 + } else 7007 + cpumask_set_cpu(i, sg_span); 7008 + 7009 + cpumask_or(covered, covered, sg_span); 7010 + 7011 + sg->sgp = *per_cpu_ptr(sdd->sgp, cpumask_first(sg_span)); 7012 + atomic_inc(&sg->sgp->ref); 7013 + 7014 + if (cpumask_test_cpu(cpu, sg_span)) 7015 + groups = sg; 7016 + 7017 + if (!first) 7018 + first = sg; 7019 + if (last) 7020 + last->next = sg; 7021 + last = sg; 7022 + last->next = first; 7023 + } 7024 + sd->groups = groups; 7025 + 7026 + return 0; 7027 + 7028 + fail: 7029 + free_sched_groups(first, 0); 7030 + 7031 + return -ENOMEM; 7032 + } 7033 + 7037 7034 static int get_group(int cpu, struct sd_data *sdd, struct sched_group **sg) 7038 7035 { 7039 7036 struct sched_domain *sd = *per_cpu_ptr(sdd->sd, cpu); ··· 7100 6981 if (child) 7101 6982 cpu = cpumask_first(sched_domain_span(child)); 7102 6983 7103 - if (sg) 6984 + if (sg) { 7104 6985 *sg = *per_cpu_ptr(sdd->sg, cpu); 6986 + (*sg)->sgp = *per_cpu_ptr(sdd->sgp, cpu); 6987 + atomic_set(&(*sg)->sgp->ref, 1); /* for claim_allocations */ 6988 + } 7105 6989 7106 6990 return cpu; 7107 6991 } 7108 6992 7109 6993 /* 7110 - * build_sched_groups takes the cpumask we wish to span, and a pointer 7111 - * to a function which identifies what group(along with sched group) a CPU 7112 - * belongs to. The return value of group_fn must be a >= 0 and < nr_cpu_ids 7113 - * (due to the fact that we keep track of groups covered with a struct cpumask). 7114 - * 7115 6994 * build_sched_groups will build a circular linked list of the groups 7116 6995 * covered by the given span, and will set each group's ->cpumask correctly, 7117 6996 * and ->cpu_power to 0. 6997 + * 6998 + * Assumes the sched_domain tree is fully constructed 7118 6999 */ 7119 - static void 7120 - build_sched_groups(struct sched_domain *sd) 7000 + static int 7001 + build_sched_groups(struct sched_domain *sd, int cpu) 7121 7002 { 7122 7003 struct sched_group *first = NULL, *last = NULL; 7123 7004 struct sd_data *sdd = sd->private; 7124 7005 const struct cpumask *span = sched_domain_span(sd); 7125 7006 struct cpumask *covered; 7126 7007 int i; 7008 + 7009 + get_group(cpu, sdd, &sd->groups); 7010 + atomic_inc(&sd->groups->ref); 7011 + 7012 + if (cpu != cpumask_first(sched_domain_span(sd))) 7013 + return 0; 7127 7014 7128 7015 lockdep_assert_held(&sched_domains_mutex); 7129 7016 covered = sched_domains_tmpmask; ··· 7145 7020 continue; 7146 7021 7147 7022 cpumask_clear(sched_group_cpus(sg)); 7148 - sg->cpu_power = 0; 7023 + sg->sgp->power = 0; 7149 7024 7150 7025 for_each_cpu(j, span) { 7151 7026 if (get_group(j, sdd, NULL) != group) ··· 7162 7037 last = sg; 7163 7038 } 7164 7039 last->next = first; 7040 + 7041 + return 0; 7165 7042 } 7166 7043 7167 7044 /* ··· 7178 7051 */ 7179 7052 static void init_sched_groups_power(int cpu, struct sched_domain *sd) 7180 7053 { 7181 - WARN_ON(!sd || !sd->groups); 7054 + struct sched_group *sg = sd->groups; 7182 7055 7183 - if (cpu != group_first_cpu(sd->groups)) 7056 + WARN_ON(!sd || !sg); 7057 + 7058 + do { 7059 + sg->group_weight = cpumask_weight(sched_group_cpus(sg)); 7060 + sg = sg->next; 7061 + } while (sg != sd->groups); 7062 + 7063 + if (cpu != group_first_cpu(sg)) 7184 7064 return; 7185 - 7186 - sd->groups->group_weight = cpumask_weight(sched_group_cpus(sd->groups)); 7187 7065 7188 7066 update_group_power(sd, cpu); 7189 7067 } ··· 7309 7177 static void claim_allocations(int cpu, struct sched_domain *sd) 7310 7178 { 7311 7179 struct sd_data *sdd = sd->private; 7312 - struct sched_group *sg = sd->groups; 7313 7180 7314 7181 WARN_ON_ONCE(*per_cpu_ptr(sdd->sd, cpu) != sd); 7315 7182 *per_cpu_ptr(sdd->sd, cpu) = NULL; 7316 7183 7317 - if (cpu == cpumask_first(sched_group_cpus(sg))) { 7318 - WARN_ON_ONCE(*per_cpu_ptr(sdd->sg, cpu) != sg); 7184 + if (atomic_read(&(*per_cpu_ptr(sdd->sg, cpu))->ref)) 7319 7185 *per_cpu_ptr(sdd->sg, cpu) = NULL; 7320 - } 7186 + 7187 + if (atomic_read(&(*per_cpu_ptr(sdd->sgp, cpu))->ref)) 7188 + *per_cpu_ptr(sdd->sgp, cpu) = NULL; 7321 7189 } 7322 7190 7323 7191 #ifdef CONFIG_SCHED_SMT ··· 7342 7210 #endif 7343 7211 { sd_init_CPU, cpu_cpu_mask, }, 7344 7212 #ifdef CONFIG_NUMA 7345 - { sd_init_NODE, cpu_node_mask, }, 7213 + { sd_init_NODE, cpu_node_mask, SDTL_OVERLAP, }, 7346 7214 { sd_init_ALLNODES, cpu_allnodes_mask, }, 7347 7215 #endif 7348 7216 { NULL, }, ··· 7366 7234 if (!sdd->sg) 7367 7235 return -ENOMEM; 7368 7236 7237 + sdd->sgp = alloc_percpu(struct sched_group_power *); 7238 + if (!sdd->sgp) 7239 + return -ENOMEM; 7240 + 7369 7241 for_each_cpu(j, cpu_map) { 7370 7242 struct sched_domain *sd; 7371 7243 struct sched_group *sg; 7244 + struct sched_group_power *sgp; 7372 7245 7373 7246 sd = kzalloc_node(sizeof(struct sched_domain) + cpumask_size(), 7374 7247 GFP_KERNEL, cpu_to_node(j)); ··· 7388 7251 return -ENOMEM; 7389 7252 7390 7253 *per_cpu_ptr(sdd->sg, j) = sg; 7254 + 7255 + sgp = kzalloc_node(sizeof(struct sched_group_power), 7256 + GFP_KERNEL, cpu_to_node(j)); 7257 + if (!sgp) 7258 + return -ENOMEM; 7259 + 7260 + *per_cpu_ptr(sdd->sgp, j) = sgp; 7391 7261 } 7392 7262 } 7393 7263 ··· 7410 7266 struct sd_data *sdd = &tl->data; 7411 7267 7412 7268 for_each_cpu(j, cpu_map) { 7413 - kfree(*per_cpu_ptr(sdd->sd, j)); 7269 + struct sched_domain *sd = *per_cpu_ptr(sdd->sd, j); 7270 + if (sd && (sd->flags & SD_OVERLAP)) 7271 + free_sched_groups(sd->groups, 0); 7414 7272 kfree(*per_cpu_ptr(sdd->sg, j)); 7273 + kfree(*per_cpu_ptr(sdd->sgp, j)); 7415 7274 } 7416 7275 free_percpu(sdd->sd); 7417 7276 free_percpu(sdd->sg); 7277 + free_percpu(sdd->sgp); 7418 7278 } 7419 7279 } 7420 7280 ··· 7464 7316 struct sched_domain_topology_level *tl; 7465 7317 7466 7318 sd = NULL; 7467 - for (tl = sched_domain_topology; tl->init; tl++) 7319 + for (tl = sched_domain_topology; tl->init; tl++) { 7468 7320 sd = build_sched_domain(tl, &d, cpu_map, attr, sd, i); 7321 + if (tl->flags & SDTL_OVERLAP || sched_feat(FORCE_SD_OVERLAP)) 7322 + sd->flags |= SD_OVERLAP; 7323 + if (cpumask_equal(cpu_map, sched_domain_span(sd))) 7324 + break; 7325 + } 7469 7326 7470 7327 while (sd->child) 7471 7328 sd = sd->child; ··· 7482 7329 for_each_cpu(i, cpu_map) { 7483 7330 for (sd = *per_cpu_ptr(d.sd, i); sd; sd = sd->parent) { 7484 7331 sd->span_weight = cpumask_weight(sched_domain_span(sd)); 7485 - get_group(i, sd->private, &sd->groups); 7486 - atomic_inc(&sd->groups->ref); 7487 - 7488 - if (i != cpumask_first(sched_domain_span(sd))) 7489 - continue; 7490 - 7491 - build_sched_groups(sd); 7332 + if (sd->flags & SD_OVERLAP) { 7333 + if (build_overlap_sched_groups(sd, i)) 7334 + goto error; 7335 + } else { 7336 + if (build_sched_groups(sd, i)) 7337 + goto error; 7338 + } 7492 7339 } 7493 7340 } 7494 7341 ··· 7910 7757 #endif 7911 7758 #endif 7912 7759 cfs_rq->min_vruntime = (u64)(-(1LL << 20)); 7760 + #ifndef CONFIG_64BIT 7761 + cfs_rq->min_vruntime_copy = cfs_rq->min_vruntime; 7762 + #endif 7913 7763 } 7914 7764 7915 7765 static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
+23 -23
kernel/sched_fair.c
··· 1585 1585 } 1586 1586 1587 1587 /* Adjust by relative CPU power of the group */ 1588 - avg_load = (avg_load * SCHED_POWER_SCALE) / group->cpu_power; 1588 + avg_load = (avg_load * SCHED_POWER_SCALE) / group->sgp->power; 1589 1589 1590 1590 if (local_group) { 1591 1591 this_load = avg_load; ··· 2631 2631 power >>= SCHED_POWER_SHIFT; 2632 2632 } 2633 2633 2634 - sdg->cpu_power_orig = power; 2634 + sdg->sgp->power_orig = power; 2635 2635 2636 2636 if (sched_feat(ARCH_POWER)) 2637 2637 power *= arch_scale_freq_power(sd, cpu); ··· 2647 2647 power = 1; 2648 2648 2649 2649 cpu_rq(cpu)->cpu_power = power; 2650 - sdg->cpu_power = power; 2650 + sdg->sgp->power = power; 2651 2651 } 2652 2652 2653 2653 static void update_group_power(struct sched_domain *sd, int cpu) ··· 2665 2665 2666 2666 group = child->groups; 2667 2667 do { 2668 - power += group->cpu_power; 2668 + power += group->sgp->power; 2669 2669 group = group->next; 2670 2670 } while (group != child->groups); 2671 2671 2672 - sdg->cpu_power = power; 2672 + sdg->sgp->power = power; 2673 2673 } 2674 2674 2675 2675 /* ··· 2691 2691 /* 2692 2692 * If ~90% of the cpu_power is still there, we're good. 2693 2693 */ 2694 - if (group->cpu_power * 32 > group->cpu_power_orig * 29) 2694 + if (group->sgp->power * 32 > group->sgp->power_orig * 29) 2695 2695 return 1; 2696 2696 2697 2697 return 0; ··· 2771 2771 } 2772 2772 2773 2773 /* Adjust by relative CPU power of the group */ 2774 - sgs->avg_load = (sgs->group_load*SCHED_POWER_SCALE) / group->cpu_power; 2774 + sgs->avg_load = (sgs->group_load*SCHED_POWER_SCALE) / group->sgp->power; 2775 2775 2776 2776 /* 2777 2777 * Consider the group unbalanced when the imbalance is larger ··· 2788 2788 if ((max_cpu_load - min_cpu_load) >= avg_load_per_task && max_nr_running > 1) 2789 2789 sgs->group_imb = 1; 2790 2790 2791 - sgs->group_capacity = DIV_ROUND_CLOSEST(group->cpu_power, 2791 + sgs->group_capacity = DIV_ROUND_CLOSEST(group->sgp->power, 2792 2792 SCHED_POWER_SCALE); 2793 2793 if (!sgs->group_capacity) 2794 2794 sgs->group_capacity = fix_small_capacity(sd, group); ··· 2877 2877 return; 2878 2878 2879 2879 sds->total_load += sgs.group_load; 2880 - sds->total_pwr += sg->cpu_power; 2880 + sds->total_pwr += sg->sgp->power; 2881 2881 2882 2882 /* 2883 2883 * In case the child domain prefers tasks go to siblings ··· 2962 2962 if (this_cpu > busiest_cpu) 2963 2963 return 0; 2964 2964 2965 - *imbalance = DIV_ROUND_CLOSEST(sds->max_load * sds->busiest->cpu_power, 2965 + *imbalance = DIV_ROUND_CLOSEST(sds->max_load * sds->busiest->sgp->power, 2966 2966 SCHED_POWER_SCALE); 2967 2967 return 1; 2968 2968 } ··· 2993 2993 2994 2994 scaled_busy_load_per_task = sds->busiest_load_per_task 2995 2995 * SCHED_POWER_SCALE; 2996 - scaled_busy_load_per_task /= sds->busiest->cpu_power; 2996 + scaled_busy_load_per_task /= sds->busiest->sgp->power; 2997 2997 2998 2998 if (sds->max_load - sds->this_load + scaled_busy_load_per_task >= 2999 2999 (scaled_busy_load_per_task * imbn)) { ··· 3007 3007 * moving them. 3008 3008 */ 3009 3009 3010 - pwr_now += sds->busiest->cpu_power * 3010 + pwr_now += sds->busiest->sgp->power * 3011 3011 min(sds->busiest_load_per_task, sds->max_load); 3012 - pwr_now += sds->this->cpu_power * 3012 + pwr_now += sds->this->sgp->power * 3013 3013 min(sds->this_load_per_task, sds->this_load); 3014 3014 pwr_now /= SCHED_POWER_SCALE; 3015 3015 3016 3016 /* Amount of load we'd subtract */ 3017 3017 tmp = (sds->busiest_load_per_task * SCHED_POWER_SCALE) / 3018 - sds->busiest->cpu_power; 3018 + sds->busiest->sgp->power; 3019 3019 if (sds->max_load > tmp) 3020 - pwr_move += sds->busiest->cpu_power * 3020 + pwr_move += sds->busiest->sgp->power * 3021 3021 min(sds->busiest_load_per_task, sds->max_load - tmp); 3022 3022 3023 3023 /* Amount of load we'd add */ 3024 - if (sds->max_load * sds->busiest->cpu_power < 3024 + if (sds->max_load * sds->busiest->sgp->power < 3025 3025 sds->busiest_load_per_task * SCHED_POWER_SCALE) 3026 - tmp = (sds->max_load * sds->busiest->cpu_power) / 3027 - sds->this->cpu_power; 3026 + tmp = (sds->max_load * sds->busiest->sgp->power) / 3027 + sds->this->sgp->power; 3028 3028 else 3029 3029 tmp = (sds->busiest_load_per_task * SCHED_POWER_SCALE) / 3030 - sds->this->cpu_power; 3031 - pwr_move += sds->this->cpu_power * 3030 + sds->this->sgp->power; 3031 + pwr_move += sds->this->sgp->power * 3032 3032 min(sds->this_load_per_task, sds->this_load + tmp); 3033 3033 pwr_move /= SCHED_POWER_SCALE; 3034 3034 ··· 3074 3074 3075 3075 load_above_capacity *= (SCHED_LOAD_SCALE * SCHED_POWER_SCALE); 3076 3076 3077 - load_above_capacity /= sds->busiest->cpu_power; 3077 + load_above_capacity /= sds->busiest->sgp->power; 3078 3078 } 3079 3079 3080 3080 /* ··· 3090 3090 max_pull = min(sds->max_load - sds->avg_load, load_above_capacity); 3091 3091 3092 3092 /* How much load to actually move to equalise the imbalance */ 3093 - *imbalance = min(max_pull * sds->busiest->cpu_power, 3094 - (sds->avg_load - sds->this_load) * sds->this->cpu_power) 3093 + *imbalance = min(max_pull * sds->busiest->sgp->power, 3094 + (sds->avg_load - sds->this_load) * sds->this->sgp->power) 3095 3095 / SCHED_POWER_SCALE; 3096 3096 3097 3097 /*
+2
kernel/sched_features.h
··· 70 70 * using the scheduler IPI. Reduces rq->lock contention/bounces. 71 71 */ 72 72 SCHED_FEAT(TTWU_QUEUE, 1) 73 + 74 + SCHED_FEAT(FORCE_SD_OVERLAP, 0)
+13 -6
kernel/signal.c
··· 1178 1178 { 1179 1179 struct sighand_struct *sighand; 1180 1180 1181 - rcu_read_lock(); 1182 1181 for (;;) { 1182 + local_irq_save(*flags); 1183 + rcu_read_lock(); 1183 1184 sighand = rcu_dereference(tsk->sighand); 1184 - if (unlikely(sighand == NULL)) 1185 + if (unlikely(sighand == NULL)) { 1186 + rcu_read_unlock(); 1187 + local_irq_restore(*flags); 1185 1188 break; 1189 + } 1186 1190 1187 - spin_lock_irqsave(&sighand->siglock, *flags); 1188 - if (likely(sighand == tsk->sighand)) 1191 + spin_lock(&sighand->siglock); 1192 + if (likely(sighand == tsk->sighand)) { 1193 + rcu_read_unlock(); 1189 1194 break; 1190 - spin_unlock_irqrestore(&sighand->siglock, *flags); 1195 + } 1196 + spin_unlock(&sighand->siglock); 1197 + rcu_read_unlock(); 1198 + local_irq_restore(*flags); 1191 1199 } 1192 - rcu_read_unlock(); 1193 1200 1194 1201 return sighand; 1195 1202 }
+10 -2
kernel/softirq.c
··· 315 315 { 316 316 if (!force_irqthreads) 317 317 __do_softirq(); 318 - else 318 + else { 319 + __local_bh_disable((unsigned long)__builtin_return_address(0), 320 + SOFTIRQ_OFFSET); 319 321 wakeup_softirqd(); 322 + __local_bh_enable(SOFTIRQ_OFFSET); 323 + } 320 324 } 321 325 #else 322 326 static inline void invoke_softirq(void) 323 327 { 324 328 if (!force_irqthreads) 325 329 do_softirq(); 326 - else 330 + else { 331 + __local_bh_disable((unsigned long)__builtin_return_address(0), 332 + SOFTIRQ_OFFSET); 327 333 wakeup_softirqd(); 334 + __local_bh_enable(SOFTIRQ_OFFSET); 335 + } 328 336 } 329 337 #endif 330 338
+2 -1
mm/vmscan.c
··· 2310 2310 for (i = 0; i <= classzone_idx; i++) 2311 2311 present_pages += pgdat->node_zones[i].present_pages; 2312 2312 2313 - return balanced_pages > (present_pages >> 2); 2313 + /* A special case here: if zone has no page, we think it's balanced */ 2314 + return balanced_pages >= (present_pages >> 2); 2314 2315 } 2315 2316 2316 2317 /* is kswapd sleeping prematurely? */
+5 -1
net/8021q/vlan_dev.c
··· 528 528 (1<<__LINK_STATE_DORMANT))) | 529 529 (1<<__LINK_STATE_PRESENT); 530 530 531 - dev->hw_features = NETIF_F_ALL_TX_OFFLOADS; 531 + dev->hw_features = NETIF_F_ALL_CSUM | NETIF_F_SG | 532 + NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | 533 + NETIF_F_HIGHDMA | NETIF_F_SCTP_CSUM | 534 + NETIF_F_ALL_FCOE; 535 + 532 536 dev->features |= real_dev->vlan_features | NETIF_F_LLTX; 533 537 dev->gso_max_size = real_dev->gso_max_size; 534 538
+3
net/bluetooth/hci_conn.c
··· 393 393 394 394 hci_dev_put(hdev); 395 395 396 + if (conn->handle == 0) 397 + kfree(conn); 398 + 396 399 return 0; 397 400 } 398 401
+11 -7
net/bluetooth/hidp/core.c
··· 464 464 { 465 465 struct hidp_session *session = (struct hidp_session *) arg; 466 466 467 - kthread_stop(session->task); 467 + atomic_inc(&session->terminate); 468 + wake_up_process(session->task); 468 469 } 469 470 470 471 static void hidp_set_timer(struct hidp_session *session) ··· 536 535 skb_queue_purge(&session->ctrl_transmit); 537 536 skb_queue_purge(&session->intr_transmit); 538 537 539 - kthread_stop(session->task); 538 + atomic_inc(&session->terminate); 539 + wake_up_process(current); 540 540 } 541 541 } 542 542 ··· 708 706 add_wait_queue(sk_sleep(intr_sk), &intr_wait); 709 707 session->waiting_for_startup = 0; 710 708 wake_up_interruptible(&session->startup_queue); 711 - while (!kthread_should_stop()) { 712 - set_current_state(TASK_INTERRUPTIBLE); 713 - 709 + set_current_state(TASK_INTERRUPTIBLE); 710 + while (!atomic_read(&session->terminate)) { 714 711 if (ctrl_sk->sk_state != BT_CONNECTED || 715 712 intr_sk->sk_state != BT_CONNECTED) 716 713 break; ··· 727 726 hidp_process_transmit(session); 728 727 729 728 schedule(); 729 + set_current_state(TASK_INTERRUPTIBLE); 730 730 } 731 731 set_current_state(TASK_RUNNING); 732 732 remove_wait_queue(sk_sleep(intr_sk), &intr_wait); ··· 1062 1060 err_add_device: 1063 1061 hid_destroy_device(session->hid); 1064 1062 session->hid = NULL; 1065 - kthread_stop(session->task); 1063 + atomic_inc(&session->terminate); 1064 + wake_up_process(session->task); 1066 1065 1067 1066 unlink: 1068 1067 hidp_del_timer(session); ··· 1114 1111 skb_queue_purge(&session->ctrl_transmit); 1115 1112 skb_queue_purge(&session->intr_transmit); 1116 1113 1117 - kthread_stop(session->task); 1114 + atomic_inc(&session->terminate); 1115 + wake_up_process(session->task); 1118 1116 } 1119 1117 } else 1120 1118 err = -ENOENT;
+1
net/bluetooth/hidp/hidp.h
··· 142 142 uint ctrl_mtu; 143 143 uint intr_mtu; 144 144 145 + atomic_t terminate; 145 146 struct task_struct *task; 146 147 147 148 unsigned char keys[8];
+6 -4
net/bluetooth/l2cap_core.c
··· 620 620 struct sock *parent = bt_sk(sk)->parent; 621 621 rsp.result = cpu_to_le16(L2CAP_CR_PEND); 622 622 rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND); 623 - parent->sk_data_ready(parent, 0); 623 + if (parent) 624 + parent->sk_data_ready(parent, 0); 624 625 625 626 } else { 626 627 sk->sk_state = BT_CONFIG; ··· 2324 2323 2325 2324 sk = chan->sk; 2326 2325 2327 - if (sk->sk_state != BT_CONFIG) { 2326 + if (sk->sk_state != BT_CONFIG && sk->sk_state != BT_CONNECT2) { 2328 2327 struct l2cap_cmd_rej rej; 2329 2328 2330 2329 rej.reason = cpu_to_le16(0x0002); ··· 2335 2334 2336 2335 /* Reject if config buffer is too small. */ 2337 2336 len = cmd_len - sizeof(*req); 2338 - if (chan->conf_len + len > sizeof(chan->conf_req)) { 2337 + if (len < 0 || chan->conf_len + len > sizeof(chan->conf_req)) { 2339 2338 l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP, 2340 2339 l2cap_build_conf_rsp(chan, rsp, 2341 2340 L2CAP_CONF_REJECT, flags), rsp); ··· 4010 4009 struct sock *parent = bt_sk(sk)->parent; 4011 4010 res = L2CAP_CR_PEND; 4012 4011 stat = L2CAP_CS_AUTHOR_PEND; 4013 - parent->sk_data_ready(parent, 0); 4012 + if (parent) 4013 + parent->sk_data_ready(parent, 0); 4014 4014 } else { 4015 4015 sk->sk_state = BT_CONFIG; 4016 4016 res = L2CAP_CR_SUCCESS;
+10 -7
net/ceph/ceph_fs.c
··· 36 36 if ((flags & O_DIRECTORY) == O_DIRECTORY) 37 37 return CEPH_FILE_MODE_PIN; 38 38 #endif 39 - if ((flags & O_APPEND) == O_APPEND) 40 - flags |= O_WRONLY; 41 39 42 - if ((flags & O_ACCMODE) == O_RDWR) 43 - mode = CEPH_FILE_MODE_RDWR; 44 - else if ((flags & O_ACCMODE) == O_WRONLY) 40 + switch (flags & O_ACCMODE) { 41 + case O_WRONLY: 45 42 mode = CEPH_FILE_MODE_WR; 46 - else 43 + break; 44 + case O_RDONLY: 47 45 mode = CEPH_FILE_MODE_RD; 48 - 46 + break; 47 + case O_RDWR: 48 + case O_ACCMODE: /* this is what the VFS does */ 49 + mode = CEPH_FILE_MODE_RDWR; 50 + break; 51 + } 49 52 #ifdef O_LAZY 50 53 if (flags & O_LAZY) 51 54 mode |= CEPH_FILE_MODE_LAZY;
+2 -1
net/mac80211/scan.c
··· 877 877 for (i = 0; i < IEEE80211_NUM_BANDS; i++) { 878 878 local->sched_scan_ies.ie[i] = kzalloc(2 + 879 879 IEEE80211_MAX_SSID_LEN + 880 - local->scan_ies_len, 880 + local->scan_ies_len + 881 + req->ie_len, 881 882 GFP_KERNEL); 882 883 if (!local->sched_scan_ies.ie[i]) { 883 884 ret = -ENOMEM;
+13 -3
net/mac80211/wpa.c
··· 86 86 struct sk_buff *skb = rx->skb; 87 87 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 88 88 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 89 + int queue = rx->queue; 90 + 91 + /* otherwise, TKIP is vulnerable to TID 0 vs. non-QoS replays */ 92 + if (rx->queue == NUM_RX_DATA_QUEUES - 1) 93 + queue = 0; 89 94 90 95 /* 91 96 * it makes no sense to check for MIC errors on anything other ··· 153 148 154 149 update_iv: 155 150 /* update IV in key information to be able to detect replays */ 156 - rx->key->u.tkip.rx[rx->queue].iv32 = rx->tkip_iv32; 157 - rx->key->u.tkip.rx[rx->queue].iv16 = rx->tkip_iv16; 151 + rx->key->u.tkip.rx[queue].iv32 = rx->tkip_iv32; 152 + rx->key->u.tkip.rx[queue].iv16 = rx->tkip_iv16; 158 153 159 154 return RX_CONTINUE; 160 155 ··· 246 241 struct ieee80211_key *key = rx->key; 247 242 struct sk_buff *skb = rx->skb; 248 243 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 244 + int queue = rx->queue; 245 + 246 + /* otherwise, TKIP is vulnerable to TID 0 vs. non-QoS replays */ 247 + if (rx->queue == NUM_RX_DATA_QUEUES - 1) 248 + queue = 0; 249 249 250 250 hdrlen = ieee80211_hdrlen(hdr->frame_control); 251 251 ··· 271 261 res = ieee80211_tkip_decrypt_data(rx->local->wep_rx_tfm, 272 262 key, skb->data + hdrlen, 273 263 skb->len - hdrlen, rx->sta->sta.addr, 274 - hdr->addr1, hwaccel, rx->queue, 264 + hdr->addr1, hwaccel, queue, 275 265 &rx->tkip_iv32, 276 266 &rx->tkip_iv16); 277 267 if (res != TKIP_DECRYPT_OK)
+8 -11
net/sctp/output.c
··· 500 500 * Note: Adler-32 is no longer applicable, as has been replaced 501 501 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. 502 502 */ 503 - if (!sctp_checksum_disable && 504 - !(dst->dev->features & (NETIF_F_NO_CSUM | NETIF_F_SCTP_CSUM))) { 505 - __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); 503 + if (!sctp_checksum_disable) { 504 + if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) { 505 + __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); 506 506 507 - /* 3) Put the resultant value into the checksum field in the 508 - * common header, and leave the rest of the bits unchanged. 509 - */ 510 - sh->checksum = sctp_end_cksum(crc32); 511 - } else { 512 - if (dst->dev->features & NETIF_F_SCTP_CSUM) { 507 + /* 3) Put the resultant value into the checksum field in the 508 + * common header, and leave the rest of the bits unchanged. 509 + */ 510 + sh->checksum = sctp_end_cksum(crc32); 511 + } else { 513 512 /* no need to seed pseudo checksum for SCTP */ 514 513 nskb->ip_summed = CHECKSUM_PARTIAL; 515 514 nskb->csum_start = (skb_transport_header(nskb) - 516 515 nskb->head); 517 516 nskb->csum_offset = offsetof(struct sctphdr, checksum); 518 - } else { 519 - nskb->ip_summed = CHECKSUM_UNNECESSARY; 520 517 } 521 518 } 522 519
+19 -1
net/sctp/outqueue.c
··· 1582 1582 #endif /* SCTP_DEBUG */ 1583 1583 if (transport) { 1584 1584 if (bytes_acked) { 1585 + struct sctp_association *asoc = transport->asoc; 1586 + 1585 1587 /* We may have counted DATA that was migrated 1586 1588 * to this transport due to DEL-IP operation. 1587 1589 * Subtract those bytes, since the were never ··· 1601 1599 */ 1602 1600 transport->error_count = 0; 1603 1601 transport->asoc->overall_error_count = 0; 1602 + 1603 + /* 1604 + * While in SHUTDOWN PENDING, we may have started 1605 + * the T5 shutdown guard timer after reaching the 1606 + * retransmission limit. Stop that timer as soon 1607 + * as the receiver acknowledged any data. 1608 + */ 1609 + if (asoc->state == SCTP_STATE_SHUTDOWN_PENDING && 1610 + del_timer(&asoc->timers 1611 + [SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD])) 1612 + sctp_association_put(asoc); 1604 1613 1605 1614 /* Mark the destination transport address as 1606 1615 * active if it is not so marked. ··· 1642 1629 * A sender is doing zero window probing when the 1643 1630 * receiver's advertised window is zero, and there is 1644 1631 * only one data chunk in flight to the receiver. 1632 + * 1633 + * Allow the association to timeout while in SHUTDOWN 1634 + * PENDING or SHUTDOWN RECEIVED in case the receiver 1635 + * stays in zero window mode forever. 1645 1636 */ 1646 1637 if (!q->asoc->peer.rwnd && 1647 1638 !list_empty(&tlist) && 1648 - (sack_ctsn+2 == q->asoc->next_tsn)) { 1639 + (sack_ctsn+2 == q->asoc->next_tsn) && 1640 + q->asoc->state < SCTP_STATE_SHUTDOWN_PENDING) { 1649 1641 SCTP_DEBUG_PRINTK("%s: SACK received for zero " 1650 1642 "window probe: %u\n", 1651 1643 __func__, sack_ctsn);
+18 -2
net/sctp/sm_sideeffect.c
··· 670 670 /* 8.3 Upon the receipt of the HEARTBEAT ACK, the sender of the 671 671 * HEARTBEAT should clear the error counter of the destination 672 672 * transport address to which the HEARTBEAT was sent. 673 - * The association's overall error count is also cleared. 674 673 */ 675 674 t->error_count = 0; 676 - t->asoc->overall_error_count = 0; 675 + 676 + /* 677 + * Although RFC4960 specifies that the overall error count must 678 + * be cleared when a HEARTBEAT ACK is received, we make an 679 + * exception while in SHUTDOWN PENDING. If the peer keeps its 680 + * window shut forever, we may never be able to transmit our 681 + * outstanding data and rely on the retransmission limit be reached 682 + * to shutdown the association. 683 + */ 684 + if (t->asoc->state != SCTP_STATE_SHUTDOWN_PENDING) 685 + t->asoc->overall_error_count = 0; 677 686 678 687 /* Clear the hb_sent flag to signal that we had a good 679 688 * acknowledgement. ··· 1445 1436 case SCTP_CMD_SETUP_T2: 1446 1437 sctp_cmd_setup_t2(commands, asoc, cmd->obj.ptr); 1447 1438 break; 1439 + 1440 + case SCTP_CMD_TIMER_START_ONCE: 1441 + timer = &asoc->timers[cmd->obj.to]; 1442 + 1443 + if (timer_pending(timer)) 1444 + break; 1445 + /* fall through */ 1448 1446 1449 1447 case SCTP_CMD_TIMER_START: 1450 1448 timer = &asoc->timers[cmd->obj.to];
+23 -9
net/sctp/sm_statefuns.c
··· 5154 5154 * The sender of the SHUTDOWN MAY also start an overall guard timer 5155 5155 * 'T5-shutdown-guard' to bound the overall time for shutdown sequence. 5156 5156 */ 5157 - sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START, 5157 + sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, 5158 5158 SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD)); 5159 5159 5160 5160 if (asoc->autoclose) ··· 5299 5299 SCTP_INC_STATS(SCTP_MIB_T3_RTX_EXPIREDS); 5300 5300 5301 5301 if (asoc->overall_error_count >= asoc->max_retrans) { 5302 - sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, 5303 - SCTP_ERROR(ETIMEDOUT)); 5304 - /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ 5305 - sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 5306 - SCTP_PERR(SCTP_ERROR_NO_ERROR)); 5307 - SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 5308 - SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); 5309 - return SCTP_DISPOSITION_DELETE_TCB; 5302 + if (asoc->state == SCTP_STATE_SHUTDOWN_PENDING) { 5303 + /* 5304 + * We are here likely because the receiver had its rwnd 5305 + * closed for a while and we have not been able to 5306 + * transmit the locally queued data within the maximum 5307 + * retransmission attempts limit. Start the T5 5308 + * shutdown guard timer to give the receiver one last 5309 + * chance and some additional time to recover before 5310 + * aborting. 5311 + */ 5312 + sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START_ONCE, 5313 + SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD)); 5314 + } else { 5315 + sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, 5316 + SCTP_ERROR(ETIMEDOUT)); 5317 + /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ 5318 + sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 5319 + SCTP_PERR(SCTP_ERROR_NO_ERROR)); 5320 + SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 5321 + SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); 5322 + return SCTP_DISPOSITION_DELETE_TCB; 5323 + } 5310 5324 } 5311 5325 5312 5326 /* E1) For the destination address for which the timer
+1 -1
net/sctp/sm_statetable.c
··· 827 827 /* SCTP_STATE_ESTABLISHED */ \ 828 828 TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ 829 829 /* SCTP_STATE_SHUTDOWN_PENDING */ \ 830 - TYPE_SCTP_FUNC(sctp_sf_timer_ignore), \ 830 + TYPE_SCTP_FUNC(sctp_sf_t5_timer_expire), \ 831 831 /* SCTP_STATE_SHUTDOWN_SENT */ \ 832 832 TYPE_SCTP_FUNC(sctp_sf_t5_timer_expire), \ 833 833 /* SCTP_STATE_SHUTDOWN_RECEIVED */ \
+8 -5
net/sctp/socket.c
··· 1384 1384 struct sctp_endpoint *ep; 1385 1385 struct sctp_association *asoc; 1386 1386 struct list_head *pos, *temp; 1387 + unsigned int data_was_unread; 1387 1388 1388 1389 SCTP_DEBUG_PRINTK("sctp_close(sk: 0x%p, timeout:%ld)\n", sk, timeout); 1389 1390 ··· 1393 1392 sk->sk_state = SCTP_SS_CLOSING; 1394 1393 1395 1394 ep = sctp_sk(sk)->ep; 1395 + 1396 + /* Clean up any skbs sitting on the receive queue. */ 1397 + data_was_unread = sctp_queue_purge_ulpevents(&sk->sk_receive_queue); 1398 + data_was_unread += sctp_queue_purge_ulpevents(&sctp_sk(sk)->pd_lobby); 1396 1399 1397 1400 /* Walk all associations on an endpoint. */ 1398 1401 list_for_each_safe(pos, temp, &ep->asocs) { ··· 1415 1410 } 1416 1411 } 1417 1412 1418 - if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) { 1413 + if (data_was_unread || !skb_queue_empty(&asoc->ulpq.lobby) || 1414 + !skb_queue_empty(&asoc->ulpq.reasm) || 1415 + (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime)) { 1419 1416 struct sctp_chunk *chunk; 1420 1417 1421 1418 chunk = sctp_make_abort_user(asoc, NULL, 0); ··· 1426 1419 } else 1427 1420 sctp_primitive_SHUTDOWN(asoc, NULL); 1428 1421 } 1429 - 1430 - /* Clean up any skbs sitting on the receive queue. */ 1431 - sctp_queue_purge_ulpevents(&sk->sk_receive_queue); 1432 - sctp_queue_purge_ulpevents(&sctp_sk(sk)->pd_lobby); 1433 1422 1434 1423 /* On a TCP-style socket, block for at most linger_time if set. */ 1435 1424 if (sctp_style(sk, TCP) && timeout)
+13 -3
net/sctp/ulpevent.c
··· 1081 1081 } 1082 1082 1083 1083 /* Purge the skb lists holding ulpevents. */ 1084 - void sctp_queue_purge_ulpevents(struct sk_buff_head *list) 1084 + unsigned int sctp_queue_purge_ulpevents(struct sk_buff_head *list) 1085 1085 { 1086 1086 struct sk_buff *skb; 1087 - while ((skb = skb_dequeue(list)) != NULL) 1088 - sctp_ulpevent_free(sctp_skb2event(skb)); 1087 + unsigned int data_unread = 0; 1088 + 1089 + while ((skb = skb_dequeue(list)) != NULL) { 1090 + struct sctp_ulpevent *event = sctp_skb2event(skb); 1091 + 1092 + if (!sctp_ulpevent_is_notification(event)) 1093 + data_unread += skb->len; 1094 + 1095 + sctp_ulpevent_free(event); 1096 + } 1097 + 1098 + return data_unread; 1089 1099 }
+1 -1
net/sunrpc/rpcb_clnt.c
··· 597 597 u32 bind_version; 598 598 struct rpc_xprt *xprt; 599 599 struct rpc_clnt *rpcb_clnt; 600 - static struct rpcbind_args *map; 600 + struct rpcbind_args *map; 601 601 struct rpc_task *child; 602 602 struct sockaddr_storage addr; 603 603 struct sockaddr *sap = (struct sockaddr *)&addr;
+11 -16
net/sunrpc/sched.c
··· 616 616 BUG_ON(RPC_IS_QUEUED(task)); 617 617 618 618 for (;;) { 619 + void (*do_action)(struct rpc_task *); 619 620 620 621 /* 621 - * Execute any pending callback. 622 + * Execute any pending callback first. 622 623 */ 623 - if (task->tk_callback) { 624 - void (*save_callback)(struct rpc_task *); 625 - 626 - /* 627 - * We set tk_callback to NULL before calling it, 628 - * in case it sets the tk_callback field itself: 629 - */ 630 - save_callback = task->tk_callback; 631 - task->tk_callback = NULL; 632 - save_callback(task); 633 - } else { 624 + do_action = task->tk_callback; 625 + task->tk_callback = NULL; 626 + if (do_action == NULL) { 634 627 /* 635 628 * Perform the next FSM step. 636 - * tk_action may be NULL when the task has been killed 637 - * by someone else. 629 + * tk_action may be NULL if the task has been killed. 630 + * In particular, note that rpc_killall_tasks may 631 + * do this at any time, so beware when dereferencing. 638 632 */ 639 - if (task->tk_action == NULL) 633 + do_action = task->tk_action; 634 + if (do_action == NULL) 640 635 break; 641 - task->tk_action(task); 642 636 } 637 + do_action(task); 643 638 644 639 /* 645 640 * Lockless check for whether task is sleeping or not.
+9 -3
net/wireless/core.c
··· 366 366 367 367 mutex_init(&rdev->mtx); 368 368 mutex_init(&rdev->devlist_mtx); 369 + mutex_init(&rdev->sched_scan_mtx); 369 370 INIT_LIST_HEAD(&rdev->netdev_list); 370 371 spin_lock_init(&rdev->bss_lock); 371 372 INIT_LIST_HEAD(&rdev->bss_list); ··· 702 701 rfkill_destroy(rdev->rfkill); 703 702 mutex_destroy(&rdev->mtx); 704 703 mutex_destroy(&rdev->devlist_mtx); 704 + mutex_destroy(&rdev->sched_scan_mtx); 705 705 list_for_each_entry_safe(scan, tmp, &rdev->bss_list, list) 706 706 cfg80211_put_bss(&scan->pub); 707 707 cfg80211_rdev_free_wowlan(rdev); ··· 739 737 ___cfg80211_scan_done(rdev, true); 740 738 } 741 739 740 + cfg80211_unlock_rdev(rdev); 741 + 742 + mutex_lock(&rdev->sched_scan_mtx); 743 + 742 744 if (WARN_ON(rdev->sched_scan_req && 743 745 rdev->sched_scan_req->dev == wdev->netdev)) { 744 746 __cfg80211_stop_sched_scan(rdev, false); 745 747 } 746 748 747 - cfg80211_unlock_rdev(rdev); 749 + mutex_unlock(&rdev->sched_scan_mtx); 748 750 749 751 mutex_lock(&rdev->devlist_mtx); 750 752 rdev->opencount--; ··· 836 830 break; 837 831 case NL80211_IFTYPE_P2P_CLIENT: 838 832 case NL80211_IFTYPE_STATION: 839 - cfg80211_lock_rdev(rdev); 833 + mutex_lock(&rdev->sched_scan_mtx); 840 834 __cfg80211_stop_sched_scan(rdev, false); 841 - cfg80211_unlock_rdev(rdev); 835 + mutex_unlock(&rdev->sched_scan_mtx); 842 836 843 837 wdev_lock(wdev); 844 838 #ifdef CONFIG_CFG80211_WEXT
+2
net/wireless/core.h
··· 65 65 struct work_struct scan_done_wk; 66 66 struct work_struct sched_scan_results_wk; 67 67 68 + struct mutex sched_scan_mtx; 69 + 68 70 #ifdef CONFIG_NL80211_TESTMODE 69 71 struct genl_info *testmode_info; 70 72 #endif
+18 -6
net/wireless/nl80211.c
··· 3461 3461 if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE])) 3462 3462 return -EINVAL; 3463 3463 3464 - if (rdev->sched_scan_req) 3465 - return -EINPROGRESS; 3466 - 3467 3464 if (!info->attrs[NL80211_ATTR_SCHED_SCAN_INTERVAL]) 3468 3465 return -EINVAL; 3469 3466 ··· 3499 3502 if (ie_len > wiphy->max_scan_ie_len) 3500 3503 return -EINVAL; 3501 3504 3505 + mutex_lock(&rdev->sched_scan_mtx); 3506 + 3507 + if (rdev->sched_scan_req) { 3508 + err = -EINPROGRESS; 3509 + goto out; 3510 + } 3511 + 3502 3512 request = kzalloc(sizeof(*request) 3503 3513 + sizeof(*request->ssids) * n_ssids 3504 3514 + sizeof(*request->channels) * n_channels 3505 3515 + ie_len, GFP_KERNEL); 3506 - if (!request) 3507 - return -ENOMEM; 3516 + if (!request) { 3517 + err = -ENOMEM; 3518 + goto out; 3519 + } 3508 3520 3509 3521 if (n_ssids) 3510 3522 request->ssids = (void *)&request->channels[n_channels]; ··· 3611 3605 out_free: 3612 3606 kfree(request); 3613 3607 out: 3608 + mutex_unlock(&rdev->sched_scan_mtx); 3614 3609 return err; 3615 3610 } 3616 3611 ··· 3619 3612 struct genl_info *info) 3620 3613 { 3621 3614 struct cfg80211_registered_device *rdev = info->user_ptr[0]; 3615 + int err; 3622 3616 3623 3617 if (!(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_SCHED_SCAN) || 3624 3618 !rdev->ops->sched_scan_stop) 3625 3619 return -EOPNOTSUPP; 3626 3620 3627 - return __cfg80211_stop_sched_scan(rdev, false); 3621 + mutex_lock(&rdev->sched_scan_mtx); 3622 + err = __cfg80211_stop_sched_scan(rdev, false); 3623 + mutex_unlock(&rdev->sched_scan_mtx); 3624 + 3625 + return err; 3628 3626 } 3629 3627 3630 3628 static int nl80211_send_bss(struct sk_buff *msg, u32 pid, u32 seq, int flags,
+5 -5
net/wireless/scan.c
··· 100 100 rdev = container_of(wk, struct cfg80211_registered_device, 101 101 sched_scan_results_wk); 102 102 103 - cfg80211_lock_rdev(rdev); 103 + mutex_lock(&rdev->sched_scan_mtx); 104 104 105 105 /* we don't have sched_scan_req anymore if the scan is stopping */ 106 106 if (rdev->sched_scan_req) 107 107 nl80211_send_sched_scan_results(rdev, 108 108 rdev->sched_scan_req->dev); 109 109 110 - cfg80211_unlock_rdev(rdev); 110 + mutex_unlock(&rdev->sched_scan_mtx); 111 111 } 112 112 113 113 void cfg80211_sched_scan_results(struct wiphy *wiphy) ··· 123 123 { 124 124 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 125 125 126 - cfg80211_lock_rdev(rdev); 126 + mutex_lock(&rdev->sched_scan_mtx); 127 127 __cfg80211_stop_sched_scan(rdev, true); 128 - cfg80211_unlock_rdev(rdev); 128 + mutex_unlock(&rdev->sched_scan_mtx); 129 129 } 130 130 EXPORT_SYMBOL(cfg80211_sched_scan_stopped); 131 131 ··· 135 135 int err; 136 136 struct net_device *dev; 137 137 138 - ASSERT_RDEV_LOCK(rdev); 138 + lockdep_assert_held(&rdev->sched_scan_mtx); 139 139 140 140 if (!rdev->sched_scan_req) 141 141 return 0;
+2
net/xfrm/xfrm_state.c
··· 1345 1345 xfrm_state_check_expire(x1); 1346 1346 1347 1347 err = 0; 1348 + x->km.state = XFRM_STATE_DEAD; 1349 + __xfrm_state_put(x); 1348 1350 } 1349 1351 spin_unlock_bh(&x1->lock); 1350 1352
+6 -4
scripts/depmod.sh
··· 21 21 # older versions of depmod require the version string to start with three 22 22 # numbers, so we cheat with a symlink here 23 23 depmod_hack_needed=true 24 - mkdir -p .tmp_depmod/lib/modules/$KERNELRELEASE 25 - if "$DEPMOD" -b .tmp_depmod $KERNELRELEASE 2>/dev/null; then 26 - if test -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep -o \ 27 - -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep.bin; then 24 + tmp_dir=$(mktemp -d ${TMPDIR:-/tmp}/depmod.XXXXXX) 25 + mkdir -p "$tmp_dir/lib/modules/$KERNELRELEASE" 26 + if "$DEPMOD" -b "$tmp_dir" $KERNELRELEASE 2>/dev/null; then 27 + if test -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep" -o \ 28 + -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep.bin"; then 28 29 depmod_hack_needed=false 29 30 fi 30 31 fi 32 + rm -rf "$tmp_dir" 31 33 if $depmod_hack_needed; then 32 34 symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE" 33 35 ln -s "$KERNELRELEASE" "$symlink"
+5 -4
sound/soc/codecs/wm8994.c
··· 1190 1190 SND_SOC_DAPM_INPUT("DMIC2DAT"), 1191 1191 SND_SOC_DAPM_INPUT("Clock"), 1192 1192 1193 - SND_SOC_DAPM_MICBIAS("MICBIAS", WM8994_MICBIAS, 2, 0), 1194 1193 SND_SOC_DAPM_SUPPLY_S("MICBIAS Supply", 1, SND_SOC_NOPM, 0, 0, micbias_ev, 1195 1194 SND_SOC_DAPM_PRE_PMU), 1196 1195 ··· 1508 1509 { "AIF2DACDAT", NULL, "AIF1DACDAT" }, 1509 1510 { "AIF1ADCDAT", NULL, "AIF2ADCDAT" }, 1510 1511 { "AIF2ADCDAT", NULL, "AIF1ADCDAT" }, 1511 - { "MICBIAS", NULL, "CLK_SYS" }, 1512 - { "MICBIAS", NULL, "MICBIAS Supply" }, 1512 + { "MICBIAS1", NULL, "CLK_SYS" }, 1513 + { "MICBIAS1", NULL, "MICBIAS Supply" }, 1514 + { "MICBIAS2", NULL, "CLK_SYS" }, 1515 + { "MICBIAS2", NULL, "MICBIAS Supply" }, 1513 1516 }; 1514 1517 1515 1518 static const struct snd_soc_dapm_route wm8994_intercon[] = { ··· 2764 2763 report = SND_JACK_MICROPHONE; 2765 2764 2766 2765 /* Everything else is buttons; just assign slots */ 2767 - if (status & 0x1c0) 2766 + if (status & 0x1c) 2768 2767 report |= SND_JACK_BTN_0; 2769 2768 2770 2769 done:
+8 -8
sound/soc/sh/fsi-ak4642.c
··· 97 97 98 98 static struct fsi_ak4642_data fsi_a_ak4642 = { 99 99 .name = "AK4642", 100 - .card = "FSIA (AK4642)", 100 + .card = "FSIA-AK4642", 101 101 .cpu_dai = "fsia-dai", 102 102 .codec = "ak4642-codec.0-0012", 103 103 .platform = "sh_fsi.0", ··· 106 106 107 107 static struct fsi_ak4642_data fsi_b_ak4642 = { 108 108 .name = "AK4642", 109 - .card = "FSIB (AK4642)", 109 + .card = "FSIB-AK4642", 110 110 .cpu_dai = "fsib-dai", 111 111 .codec = "ak4642-codec.0-0012", 112 112 .platform = "sh_fsi.0", ··· 115 115 116 116 static struct fsi_ak4642_data fsi_a_ak4643 = { 117 117 .name = "AK4643", 118 - .card = "FSIA (AK4643)", 118 + .card = "FSIA-AK4643", 119 119 .cpu_dai = "fsia-dai", 120 120 .codec = "ak4642-codec.0-0013", 121 121 .platform = "sh_fsi.0", ··· 124 124 125 125 static struct fsi_ak4642_data fsi_b_ak4643 = { 126 126 .name = "AK4643", 127 - .card = "FSIB (AK4643)", 127 + .card = "FSIB-AK4643", 128 128 .cpu_dai = "fsib-dai", 129 129 .codec = "ak4642-codec.0-0013", 130 130 .platform = "sh_fsi.0", ··· 133 133 134 134 static struct fsi_ak4642_data fsi2_a_ak4642 = { 135 135 .name = "AK4642", 136 - .card = "FSI2A (AK4642)", 136 + .card = "FSI2A-AK4642", 137 137 .cpu_dai = "fsia-dai", 138 138 .codec = "ak4642-codec.0-0012", 139 139 .platform = "sh_fsi2", ··· 142 142 143 143 static struct fsi_ak4642_data fsi2_b_ak4642 = { 144 144 .name = "AK4642", 145 - .card = "FSI2B (AK4642)", 145 + .card = "FSI2B-AK4642", 146 146 .cpu_dai = "fsib-dai", 147 147 .codec = "ak4642-codec.0-0012", 148 148 .platform = "sh_fsi2", ··· 151 151 152 152 static struct fsi_ak4642_data fsi2_a_ak4643 = { 153 153 .name = "AK4643", 154 - .card = "FSI2A (AK4643)", 154 + .card = "FSI2A-AK4643", 155 155 .cpu_dai = "fsia-dai", 156 156 .codec = "ak4642-codec.0-0013", 157 157 .platform = "sh_fsi2", ··· 160 160 161 161 static struct fsi_ak4642_data fsi2_b_ak4643 = { 162 162 .name = "AK4643", 163 - .card = "FSI2B (AK4643)", 163 + .card = "FSI2B-AK4643", 164 164 .cpu_dai = "fsib-dai", 165 165 .codec = "ak4642-codec.0-0013", 166 166 .platform = "sh_fsi2",
+1 -1
sound/soc/sh/fsi-da7210.c
··· 42 42 }; 43 43 44 44 static struct snd_soc_card fsi_soc_card = { 45 - .name = "FSI (DA7210)", 45 + .name = "FSI-DA7210", 46 46 .dai_link = &fsi_da7210_dai, 47 47 .num_links = 1, 48 48 };
+2 -2
sound/soc/sh/fsi-hdmi.c
··· 83 83 84 84 static struct fsi_hdmi_data fsi2_a_hdmi = { 85 85 .cpu_dai = "fsia-dai", 86 - .card = "FSI2A (SH MOBILE HDMI)", 86 + .card = "FSI2A-HDMI", 87 87 .id = FSI_PORT_A, 88 88 }; 89 89 90 90 static struct fsi_hdmi_data fsi2_b_hdmi = { 91 91 .cpu_dai = "fsib-dai", 92 - .card = "FSI2B (SH MOBILE HDMI)", 92 + .card = "FSI2B-HDMI", 93 93 .id = FSI_PORT_B, 94 94 }; 95 95