aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-21 16:38:42 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-21 16:38:42 -0400
commit033b1142f4bd44a116d1356fe4a0510437ceddf9 (patch)
treed2a971a7dc9f3a1af8035e38419c4c4ad8c22632
parentf5caadbb3d8fc0b71533e880c684b2230bdb76ac (diff)
parente6625fa48e6580a74b7e700efd7e6463e282810b (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: net/bluetooth/l2cap_core.c
-rw-r--r--Documentation/filesystems/nilfs2.txt1
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c4
-rw-r--r--arch/arm/mach-davinci/gpio.c21
-rw-r--r--arch/arm/mach-davinci/irq.c6
-rw-r--r--arch/arm/mach-ixp4xx/common.c10
-rw-r--r--arch/arm/mach-s3c64xx/dma.c14
-rw-r--r--arch/arm/plat-s3c24xx/dma.c12
-rw-r--r--arch/arm/plat-samsung/dma.c6
-rw-r--r--arch/arm/plat-samsung/include/plat/dma.h21
-rw-r--r--arch/arm/plat-samsung/irq-uart.c7
-rw-r--r--arch/arm/plat-samsung/irq-vic-timer.c7
-rw-r--r--arch/mips/kernel/i8259.c22
-rw-r--r--arch/sparc/include/asm/irqflags_32.h8
-rw-r--r--arch/sparc/include/asm/irqflags_64.h14
-rw-r--r--arch/sparc/kernel/entry.S2
-rw-r--r--arch/sparc/mm/leon_mm.c2
-rw-r--r--drivers/acpi/apei/hest.c12
-rw-r--r--drivers/acpi/osl.c17
-rw-r--r--drivers/gpio/wm831x-gpio.c1
-rw-r--r--drivers/hwmon/adm1275.c10
-rw-r--r--drivers/hwmon/asus_atk0110.c1
-rw-r--r--drivers/hwmon/it87.c2
-rw-r--r--drivers/hwmon/max1111.c11
-rw-r--r--drivers/hwmon/pmbus_core.c20
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c8
-rw-r--r--drivers/media/radio/Kconfig4
-rw-r--r--drivers/media/radio/si4713-i2c.c4
-rw-r--r--drivers/media/rc/mceusb.c9
-rw-r--r--drivers/media/rc/nuvoton-cir.c2
-rw-r--r--drivers/media/video/cx23885/cx23885-core.c9
-rw-r--r--drivers/media/video/tuner-core.c16
-rw-r--r--drivers/net/bonding/bond_main.c6
-rw-r--r--drivers/net/gianfar.c24
-rw-r--r--drivers/net/gianfar.h3
-rw-r--r--drivers/net/pppoe.c3
-rw-r--r--drivers/net/r6040.c8
-rw-r--r--drivers/net/tulip/dmfe.c4
-rw-r--r--drivers/watchdog/Kconfig3
-rw-r--r--fs/ceph/mds_client.c19
-rw-r--r--fs/cifs/cifsfs.c100
-rw-r--r--fs/cifs/cifsfs.h2
-rw-r--r--fs/cifs/connect.c2
-rw-r--r--fs/cifs/dir.c13
-rw-r--r--fs/cifs/sess.c10
-rw-r--r--fs/cramfs/inode.c22
-rw-r--r--fs/dcache.c51
-rw-r--r--fs/exofs/super.c2
-rw-r--r--fs/gfs2/aops.c3
-rw-r--r--fs/gfs2/glops.c8
-rw-r--r--fs/gfs2/incore.h2
-rw-r--r--fs/gfs2/log.c1
-rw-r--r--fs/gfs2/ops_fstype.c3
-rw-r--r--fs/gfs2/super.c36
-rw-r--r--fs/gfs2/sys.c7
-rw-r--r--fs/hppfs/hppfs.c31
-rw-r--r--fs/libfs.c2
-rw-r--r--fs/namei.c9
-rw-r--r--fs/ufs/namei.c12
-rw-r--r--include/acpi/acpi_bus.h2
-rw-r--r--include/acpi/acpiosxf.h3
-rw-r--r--include/acpi/platform/aclinux.h18
-rw-r--r--include/drm/drm_pciids.h2
-rw-r--r--include/linux/netdevice.h6
-rw-r--r--include/linux/sdla.h6
-rw-r--r--kernel/rcutree.c26
-rw-r--r--kernel/rcutree_plugin.h15
-rw-r--r--kernel/sched.c3
-rw-r--r--mm/vmscan.c3
-rw-r--r--net/8021q/vlan_dev.c6
-rw-r--r--net/bluetooth/l2cap_core.c9
-rw-r--r--net/ceph/ceph_fs.c17
-rw-r--r--net/sctp/output.c19
-rw-r--r--sound/soc/codecs/wm8994.c9
-rw-r--r--sound/soc/sh/fsi-ak4642.c16
-rw-r--r--sound/soc/sh/fsi-da7210.c2
-rw-r--r--sound/soc/sh/fsi-hdmi.c4
76 files changed, 489 insertions, 346 deletions
diff --git a/Documentation/filesystems/nilfs2.txt b/Documentation/filesystems/nilfs2.txt
index d5c0cef38a71..873a2ab2e9f8 100644
--- a/Documentation/filesystems/nilfs2.txt
+++ b/Documentation/filesystems/nilfs2.txt
@@ -40,7 +40,6 @@ Features which NILFS2 does not support yet:
40 - POSIX ACLs 40 - POSIX ACLs
41 - quotas 41 - quotas
42 - fsck 42 - fsck
43 - resize
44 - defragmentation 43 - defragmentation
45 44
46Mount options 45Mount options
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index c67f684ee3e5..09a87e61ffcf 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -520,7 +520,7 @@ fail:
520 */ 520 */
521 if (have_imager()) { 521 if (have_imager()) {
522 label = "HD imager"; 522 label = "HD imager";
523 mux |= 1; 523 mux |= 2;
524 524
525 /* externally mux MMC1/ENET/AIC33 to imager */ 525 /* externally mux MMC1/ENET/AIC33 to imager */
526 mux |= BIT(6) | BIT(5) | BIT(3); 526 mux |= BIT(6) | BIT(5) | BIT(3);
@@ -540,7 +540,7 @@ fail:
540 resets &= ~BIT(1); 540 resets &= ~BIT(1);
541 541
542 if (have_tvp7002()) { 542 if (have_tvp7002()) {
543 mux |= 2; 543 mux |= 1;
544 resets &= ~BIT(2); 544 resets &= ~BIT(2);
545 label = "tvp7002 HD"; 545 label = "tvp7002 HD";
546 } else { 546 } else {
diff --git a/arch/arm/mach-davinci/gpio.c b/arch/arm/mach-davinci/gpio.c
index e7221398e5af..cafbe13a82a5 100644
--- a/arch/arm/mach-davinci/gpio.c
+++ b/arch/arm/mach-davinci/gpio.c
@@ -254,8 +254,10 @@ gpio_irq_handler(unsigned irq, struct irq_desc *desc)
254{ 254{
255 struct davinci_gpio_regs __iomem *g; 255 struct davinci_gpio_regs __iomem *g;
256 u32 mask = 0xffff; 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 /* we only care about one bank */ 262 /* we only care about one bank */
261 if (irq & 1) 263 if (irq & 1)
@@ -274,11 +276,14 @@ gpio_irq_handler(unsigned irq, struct irq_desc *desc)
274 if (!status) 276 if (!status)
275 break; 277 break;
276 __raw_writel(status, &g->intstat); 278 __raw_writel(status, &g->intstat);
277 if (irq & 1)
278 status >>= 16;
279 279
280 /* now demux them to the right lowlevel handler */ 280 /* now demux them to the right lowlevel handler */
281 n = (int)irq_get_handler_data(irq); 281 n = d->irq_base;
282 if (irq & 1) {
283 n += 16;
284 status >>= 16;
285 }
286
282 while (status) { 287 while (status) {
283 res = ffs(status); 288 res = ffs(status);
284 n += res; 289 n += res;
@@ -424,7 +429,13 @@ static int __init davinci_gpio_irq_setup(void)
424 429
425 /* set up all irqs in this bank */ 430 /* set up all irqs in this bank */
426 irq_set_chained_handler(bank_irq, gpio_irq_handler); 431 irq_set_chained_handler(bank_irq, gpio_irq_handler);
427 irq_set_handler_data(bank_irq, (__force void *)g); 432
433 /*
434 * Each chip handles 32 gpios, and each irq bank consists of 16
435 * gpio irqs. Pass the irq bank's corresponding controller to
436 * the chained irq handler.
437 */
438 irq_set_handler_data(bank_irq, &chips[gpio / 32]);
428 439
429 for (i = 0; i < 16 && gpio < ngpio; i++, irq++, gpio++) { 440 for (i = 0; i < 16 && gpio < ngpio; i++, irq++, gpio++) {
430 irq_set_chip(irq, &gpio_irqchip); 441 irq_set_chip(irq, &gpio_irqchip);
diff --git a/arch/arm/mach-davinci/irq.c b/arch/arm/mach-davinci/irq.c
index d8c1af025931..952dc126c390 100644
--- a/arch/arm/mach-davinci/irq.c
+++ b/arch/arm/mach-davinci/irq.c
@@ -52,6 +52,12 @@ davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
52 struct irq_chip_type *ct; 52 struct irq_chip_type *ct;
53 53
54 gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq); 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 ct = gc->chip_types; 61 ct = gc->chip_types;
56 ct->chip.irq_ack = irq_gc_ack_set_bit; 62 ct->chip.irq_ack = irq_gc_ack_set_bit;
57 ct->chip.irq_mask = irq_gc_mask_clr_bit; 63 ct->chip.irq_mask = irq_gc_mask_clr_bit;
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 74ed81a3cb1a..07772575d7ab 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -419,14 +419,20 @@ static void notrace ixp4xx_update_sched_clock(void)
419/* 419/*
420 * clocksource 420 * clocksource
421 */ 421 */
422
423static cycle_t ixp4xx_clocksource_read(struct clocksource *c)
424{
425 return *IXP4XX_OSTS;
426}
427
422unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ; 428unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ;
423EXPORT_SYMBOL(ixp4xx_timer_freq); 429EXPORT_SYMBOL(ixp4xx_timer_freq);
424static void __init ixp4xx_clocksource_init(void) 430static void __init ixp4xx_clocksource_init(void)
425{ 431{
426 init_sched_clock(&cd, ixp4xx_update_sched_clock, 32, ixp4xx_timer_freq); 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, 434 clocksource_mmio_init(NULL, "OSTS", ixp4xx_timer_freq, 200, 32,
429 clocksource_mmio_readl_up); 435 ixp4xx_clocksource_read);
430} 436}
431 437
432/* 438/*
diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c
index b197171e7d03..204bfafe4bfc 100644
--- a/arch/arm/mach-s3c64xx/dma.c
+++ b/arch/arm/mach-s3c64xx/dma.c
@@ -113,7 +113,7 @@ found:
113 return chan; 113 return chan;
114} 114}
115 115
116int s3c2410_dma_config(unsigned int channel, int xferunit) 116int s3c2410_dma_config(enum dma_ch channel, int xferunit)
117{ 117{
118 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 118 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
119 119
@@ -297,7 +297,7 @@ static int s3c64xx_dma_flush(struct s3c2410_dma_chan *chan)
297 return 0; 297 return 0;
298} 298}
299 299
300int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op) 300int s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op)
301{ 301{
302 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 302 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
303 303
@@ -331,7 +331,7 @@ EXPORT_SYMBOL(s3c2410_dma_ctrl);
331 * 331 *
332 */ 332 */
333 333
334int s3c2410_dma_enqueue(unsigned int channel, void *id, 334int s3c2410_dma_enqueue(enum dma_ch channel, void *id,
335 dma_addr_t data, int size) 335 dma_addr_t data, int size)
336{ 336{
337 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 337 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
@@ -415,7 +415,7 @@ err_buff:
415EXPORT_SYMBOL(s3c2410_dma_enqueue); 415EXPORT_SYMBOL(s3c2410_dma_enqueue);
416 416
417 417
418int s3c2410_dma_devconfig(unsigned int channel, 418int s3c2410_dma_devconfig(enum dma_ch channel,
419 enum s3c2410_dmasrc source, 419 enum s3c2410_dmasrc source,
420 unsigned long devaddr) 420 unsigned long devaddr)
421{ 421{
@@ -463,7 +463,7 @@ int s3c2410_dma_devconfig(unsigned int channel,
463EXPORT_SYMBOL(s3c2410_dma_devconfig); 463EXPORT_SYMBOL(s3c2410_dma_devconfig);
464 464
465 465
466int s3c2410_dma_getposition(unsigned int channel, 466int s3c2410_dma_getposition(enum dma_ch channel,
467 dma_addr_t *src, dma_addr_t *dst) 467 dma_addr_t *src, dma_addr_t *dst)
468{ 468{
469 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 469 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
@@ -487,7 +487,7 @@ EXPORT_SYMBOL(s3c2410_dma_getposition);
487 * get control of an dma channel 487 * get control of an dma channel
488*/ 488*/
489 489
490int s3c2410_dma_request(unsigned int channel, 490int s3c2410_dma_request(enum dma_ch channel,
491 struct s3c2410_dma_client *client, 491 struct s3c2410_dma_client *client,
492 void *dev) 492 void *dev)
493{ 493{
@@ -533,7 +533,7 @@ EXPORT_SYMBOL(s3c2410_dma_request);
533 * allowed to go through. 533 * allowed to go through.
534*/ 534*/
535 535
536int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) 536int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *client)
537{ 537{
538 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 538 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
539 unsigned long flags; 539 unsigned long flags;
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index a79a8ccd25f6..539bd0e3defd 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -712,7 +712,7 @@ static struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel);
712 * get control of an dma channel 712 * get control of an dma channel
713*/ 713*/
714 714
715int s3c2410_dma_request(unsigned int channel, 715int s3c2410_dma_request(enum dma_ch channel,
716 struct s3c2410_dma_client *client, 716 struct s3c2410_dma_client *client,
717 void *dev) 717 void *dev)
718{ 718{
@@ -783,7 +783,7 @@ EXPORT_SYMBOL(s3c2410_dma_request);
783 * allowed to go through. 783 * allowed to go through.
784*/ 784*/
785 785
786int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) 786int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *client)
787{ 787{
788 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 788 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
789 unsigned long flags; 789 unsigned long flags;
@@ -974,7 +974,7 @@ static int s3c2410_dma_started(struct s3c2410_dma_chan *chan)
974} 974}
975 975
976int 976int
977s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op) 977s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op)
978{ 978{
979 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 979 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
980 980
@@ -1021,7 +1021,7 @@ EXPORT_SYMBOL(s3c2410_dma_ctrl);
1021 * xfersize: size of unit in bytes (1,2,4) 1021 * xfersize: size of unit in bytes (1,2,4)
1022*/ 1022*/
1023 1023
1024int s3c2410_dma_config(unsigned int channel, 1024int s3c2410_dma_config(enum dma_ch channel,
1025 int xferunit) 1025 int xferunit)
1026{ 1026{
1027 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 1027 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
@@ -1100,7 +1100,7 @@ EXPORT_SYMBOL(s3c2410_dma_config);
1100 * devaddr: physical address of the source 1100 * devaddr: physical address of the source
1101*/ 1101*/
1102 1102
1103int s3c2410_dma_devconfig(unsigned int channel, 1103int s3c2410_dma_devconfig(enum dma_ch channel,
1104 enum s3c2410_dmasrc source, 1104 enum s3c2410_dmasrc source,
1105 unsigned long devaddr) 1105 unsigned long devaddr)
1106{ 1106{
@@ -1173,7 +1173,7 @@ EXPORT_SYMBOL(s3c2410_dma_devconfig);
1173 * returns the current transfer points for the dma source and destination 1173 * returns the current transfer points for the dma source and destination
1174*/ 1174*/
1175 1175
1176int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *dst) 1176int s3c2410_dma_getposition(enum dma_ch channel, dma_addr_t *src, dma_addr_t *dst)
1177{ 1177{
1178 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 1178 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
1179 1179
diff --git a/arch/arm/plat-samsung/dma.c b/arch/arm/plat-samsung/dma.c
index cb459dd95459..6143aa147688 100644
--- a/arch/arm/plat-samsung/dma.c
+++ b/arch/arm/plat-samsung/dma.c
@@ -41,7 +41,7 @@ struct s3c2410_dma_chan *s3c_dma_lookup_channel(unsigned int channel)
41 * irq? 41 * irq?
42*/ 42*/
43 43
44int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn) 44int s3c2410_dma_set_opfn(enum dma_ch channel, s3c2410_dma_opfn_t rtn)
45{ 45{
46 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 46 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
47 47
@@ -56,7 +56,7 @@ int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn)
56} 56}
57EXPORT_SYMBOL(s3c2410_dma_set_opfn); 57EXPORT_SYMBOL(s3c2410_dma_set_opfn);
58 58
59int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn) 59int s3c2410_dma_set_buffdone_fn(enum dma_ch channel, s3c2410_dma_cbfn_t rtn)
60{ 60{
61 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 61 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
62 62
@@ -71,7 +71,7 @@ int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn)
71} 71}
72EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn); 72EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn);
73 73
74int s3c2410_dma_setflags(unsigned int channel, unsigned int flags) 74int s3c2410_dma_setflags(enum dma_ch channel, unsigned int flags)
75{ 75{
76 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 76 struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
77 77
diff --git a/arch/arm/plat-samsung/include/plat/dma.h b/arch/arm/plat-samsung/include/plat/dma.h
index 2e8f8c6560d7..8c273b7a6f56 100644
--- a/arch/arm/plat-samsung/include/plat/dma.h
+++ b/arch/arm/plat-samsung/include/plat/dma.h
@@ -42,6 +42,7 @@ struct s3c2410_dma_client {
42}; 42};
43 43
44struct s3c2410_dma_chan; 44struct s3c2410_dma_chan;
45enum dma_ch;
45 46
46/* s3c2410_dma_cbfn_t 47/* s3c2410_dma_cbfn_t
47 * 48 *
@@ -62,7 +63,7 @@ typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *,
62 * request a dma channel exclusivley 63 * request a dma channel exclusivley
63*/ 64*/
64 65
65extern int s3c2410_dma_request(unsigned int channel, 66extern int s3c2410_dma_request(enum dma_ch channel,
66 struct s3c2410_dma_client *, void *dev); 67 struct s3c2410_dma_client *, void *dev);
67 68
68 69
@@ -71,14 +72,14 @@ extern int s3c2410_dma_request(unsigned int channel,
71 * change the state of the dma channel 72 * change the state of the dma channel
72*/ 73*/
73 74
74extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op); 75extern int s3c2410_dma_ctrl(enum dma_ch channel, enum s3c2410_chan_op op);
75 76
76/* s3c2410_dma_setflags 77/* s3c2410_dma_setflags
77 * 78 *
78 * set the channel's flags to a given state 79 * set the channel's flags to a given state
79*/ 80*/
80 81
81extern int s3c2410_dma_setflags(unsigned int channel, 82extern int s3c2410_dma_setflags(enum dma_ch channel,
82 unsigned int flags); 83 unsigned int flags);
83 84
84/* s3c2410_dma_free 85/* s3c2410_dma_free
@@ -86,7 +87,7 @@ extern int s3c2410_dma_setflags(unsigned int channel,
86 * free the dma channel (will also abort any outstanding operations) 87 * free the dma channel (will also abort any outstanding operations)
87*/ 88*/
88 89
89extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *); 90extern int s3c2410_dma_free(enum dma_ch channel, struct s3c2410_dma_client *);
90 91
91/* s3c2410_dma_enqueue 92/* s3c2410_dma_enqueue
92 * 93 *
@@ -95,7 +96,7 @@ extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *);
95 * drained before the buffer is given to the DMA system. 96 * drained before the buffer is given to the DMA system.
96*/ 97*/
97 98
98extern int s3c2410_dma_enqueue(unsigned int channel, void *id, 99extern int s3c2410_dma_enqueue(enum dma_ch channel, void *id,
99 dma_addr_t data, int size); 100 dma_addr_t data, int size);
100 101
101/* s3c2410_dma_config 102/* s3c2410_dma_config
@@ -103,14 +104,14 @@ extern int s3c2410_dma_enqueue(unsigned int channel, void *id,
103 * configure the dma channel 104 * configure the dma channel
104*/ 105*/
105 106
106extern int s3c2410_dma_config(unsigned int channel, int xferunit); 107extern int s3c2410_dma_config(enum dma_ch channel, int xferunit);
107 108
108/* s3c2410_dma_devconfig 109/* s3c2410_dma_devconfig
109 * 110 *
110 * configure the device we're talking to 111 * configure the device we're talking to
111*/ 112*/
112 113
113extern int s3c2410_dma_devconfig(unsigned int channel, 114extern int s3c2410_dma_devconfig(enum dma_ch channel,
114 enum s3c2410_dmasrc source, unsigned long devaddr); 115 enum s3c2410_dmasrc source, unsigned long devaddr);
115 116
116/* s3c2410_dma_getposition 117/* s3c2410_dma_getposition
@@ -118,10 +119,10 @@ extern int s3c2410_dma_devconfig(unsigned int channel,
118 * get the position that the dma transfer is currently at 119 * get the position that the dma transfer is currently at
119*/ 120*/
120 121
121extern int s3c2410_dma_getposition(unsigned int channel, 122extern int s3c2410_dma_getposition(enum dma_ch channel,
122 dma_addr_t *src, dma_addr_t *dest); 123 dma_addr_t *src, dma_addr_t *dest);
123 124
124extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn); 125extern int s3c2410_dma_set_opfn(enum dma_ch, s3c2410_dma_opfn_t rtn);
125extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn); 126extern int s3c2410_dma_set_buffdone_fn(enum dma_ch, s3c2410_dma_cbfn_t rtn);
126 127
127 128
diff --git a/arch/arm/plat-samsung/irq-uart.c b/arch/arm/plat-samsung/irq-uart.c
index 0e46588d847b..657405c481d0 100644
--- a/arch/arm/plat-samsung/irq-uart.c
+++ b/arch/arm/plat-samsung/irq-uart.c
@@ -54,6 +54,13 @@ static void __init s3c_init_uart_irq(struct s3c_uart_irq *uirq)
54 54
55 gc = irq_alloc_generic_chip("s3c-uart", 1, uirq->base_irq, reg_base, 55 gc = irq_alloc_generic_chip("s3c-uart", 1, uirq->base_irq, reg_base,
56 handle_level_irq); 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 ct = gc->chip_types; 64 ct = gc->chip_types;
58 ct->chip.irq_ack = irq_gc_ack_set_bit; 65 ct->chip.irq_ack = irq_gc_ack_set_bit;
59 ct->chip.irq_mask = irq_gc_mask_set_bit; 66 ct->chip.irq_mask = irq_gc_mask_set_bit;
diff --git a/arch/arm/plat-samsung/irq-vic-timer.c b/arch/arm/plat-samsung/irq-vic-timer.c
index a607546ddbd0..f714d060370d 100644
--- a/arch/arm/plat-samsung/irq-vic-timer.c
+++ b/arch/arm/plat-samsung/irq-vic-timer.c
@@ -54,6 +54,13 @@ void __init s3c_init_vic_timer_irq(unsigned int num, unsigned int timer_irq)
54 54
55 s3c_tgc = irq_alloc_generic_chip("s3c-timer", 1, timer_irq, 55 s3c_tgc = irq_alloc_generic_chip("s3c-timer", 1, timer_irq,
56 S3C64XX_TINT_CSTAT, handle_level_irq); 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 ct = s3c_tgc->chip_types; 64 ct = s3c_tgc->chip_types;
58 ct->chip.irq_mask = irq_gc_mask_clr_bit; 65 ct->chip.irq_mask = irq_gc_mask_clr_bit;
59 ct->chip.irq_unmask = irq_gc_mask_set_bit; 66 ct->chip.irq_unmask = irq_gc_mask_set_bit;
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index c018696765d4..5c74eb797f08 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -14,7 +14,7 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/sysdev.h> 17#include <linux/syscore_ops.h>
18#include <linux/irq.h> 18#include <linux/irq.h>
19 19
20#include <asm/i8259.h> 20#include <asm/i8259.h>
@@ -215,14 +215,13 @@ spurious_8259A_irq:
215 } 215 }
216} 216}
217 217
218static int i8259A_resume(struct sys_device *dev) 218static void i8259A_resume(void)
219{ 219{
220 if (i8259A_auto_eoi >= 0) 220 if (i8259A_auto_eoi >= 0)
221 init_8259A(i8259A_auto_eoi); 221 init_8259A(i8259A_auto_eoi);
222 return 0;
223} 222}
224 223
225static int i8259A_shutdown(struct sys_device *dev) 224static void i8259A_shutdown(void)
226{ 225{
227 /* Put the i8259A into a quiescent state that 226 /* Put the i8259A into a quiescent state that
228 * the kernel initialization code can get it 227 * the kernel initialization code can get it
@@ -232,26 +231,17 @@ static int i8259A_shutdown(struct sys_device *dev)
232 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ 231 outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */
233 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-1 */ 232 outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-1 */
234 } 233 }
235 return 0;
236} 234}
237 235
238static struct sysdev_class i8259_sysdev_class = { 236static struct syscore_ops i8259_syscore_ops = {
239 .name = "i8259",
240 .resume = i8259A_resume, 237 .resume = i8259A_resume,
241 .shutdown = i8259A_shutdown, 238 .shutdown = i8259A_shutdown,
242}; 239};
243 240
244static struct sys_device device_i8259A = {
245 .id = 0,
246 .cls = &i8259_sysdev_class,
247};
248
249static int __init i8259A_init_sysfs(void) 241static int __init i8259A_init_sysfs(void)
250{ 242{
251 int error = sysdev_class_register(&i8259_sysdev_class); 243 register_syscore_ops(&i8259_syscore_ops);
252 if (!error) 244 return 0;
253 error = sysdev_register(&device_i8259A);
254 return error;
255} 245}
256 246
257device_initcall(i8259A_init_sysfs); 247device_initcall(i8259A_init_sysfs);
diff --git a/arch/sparc/include/asm/irqflags_32.h b/arch/sparc/include/asm/irqflags_32.h
index d4d0711de0f9..14848909e0de 100644
--- a/arch/sparc/include/asm/irqflags_32.h
+++ b/arch/sparc/include/asm/irqflags_32.h
@@ -18,7 +18,7 @@ extern void arch_local_irq_restore(unsigned long);
18extern unsigned long arch_local_irq_save(void); 18extern unsigned long arch_local_irq_save(void);
19extern void arch_local_irq_enable(void); 19extern void arch_local_irq_enable(void);
20 20
21static inline unsigned long arch_local_save_flags(void) 21static inline notrace unsigned long arch_local_save_flags(void)
22{ 22{
23 unsigned long flags; 23 unsigned long flags;
24 24
@@ -26,17 +26,17 @@ static inline unsigned long arch_local_save_flags(void)
26 return flags; 26 return flags;
27} 27}
28 28
29static inline void arch_local_irq_disable(void) 29static inline notrace void arch_local_irq_disable(void)
30{ 30{
31 arch_local_irq_save(); 31 arch_local_irq_save();
32} 32}
33 33
34static inline bool arch_irqs_disabled_flags(unsigned long flags) 34static inline notrace bool arch_irqs_disabled_flags(unsigned long flags)
35{ 35{
36 return (flags & PSR_PIL) != 0; 36 return (flags & PSR_PIL) != 0;
37} 37}
38 38
39static inline bool arch_irqs_disabled(void) 39static inline notrace bool arch_irqs_disabled(void)
40{ 40{
41 return arch_irqs_disabled_flags(arch_local_save_flags()); 41 return arch_irqs_disabled_flags(arch_local_save_flags());
42} 42}
diff --git a/arch/sparc/include/asm/irqflags_64.h b/arch/sparc/include/asm/irqflags_64.h
index aab969c82c2b..23cd27f6beb4 100644
--- a/arch/sparc/include/asm/irqflags_64.h
+++ b/arch/sparc/include/asm/irqflags_64.h
@@ -14,7 +14,7 @@
14 14
15#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
16 16
17static inline unsigned long arch_local_save_flags(void) 17static inline notrace unsigned long arch_local_save_flags(void)
18{ 18{
19 unsigned long flags; 19 unsigned long flags;
20 20
@@ -26,7 +26,7 @@ static inline unsigned long arch_local_save_flags(void)
26 return flags; 26 return flags;
27} 27}
28 28
29static inline void arch_local_irq_restore(unsigned long flags) 29static inline notrace void arch_local_irq_restore(unsigned long flags)
30{ 30{
31 __asm__ __volatile__( 31 __asm__ __volatile__(
32 "wrpr %0, %%pil" 32 "wrpr %0, %%pil"
@@ -36,7 +36,7 @@ static inline void arch_local_irq_restore(unsigned long flags)
36 ); 36 );
37} 37}
38 38
39static inline void arch_local_irq_disable(void) 39static inline notrace void arch_local_irq_disable(void)
40{ 40{
41 __asm__ __volatile__( 41 __asm__ __volatile__(
42 "wrpr %0, %%pil" 42 "wrpr %0, %%pil"
@@ -46,7 +46,7 @@ static inline void arch_local_irq_disable(void)
46 ); 46 );
47} 47}
48 48
49static inline void arch_local_irq_enable(void) 49static inline notrace void arch_local_irq_enable(void)
50{ 50{
51 __asm__ __volatile__( 51 __asm__ __volatile__(
52 "wrpr 0, %%pil" 52 "wrpr 0, %%pil"
@@ -56,17 +56,17 @@ static inline void arch_local_irq_enable(void)
56 ); 56 );
57} 57}
58 58
59static inline int arch_irqs_disabled_flags(unsigned long flags) 59static inline notrace int arch_irqs_disabled_flags(unsigned long flags)
60{ 60{
61 return (flags > 0); 61 return (flags > 0);
62} 62}
63 63
64static inline int arch_irqs_disabled(void) 64static inline notrace int arch_irqs_disabled(void)
65{ 65{
66 return arch_irqs_disabled_flags(arch_local_save_flags()); 66 return arch_irqs_disabled_flags(arch_local_save_flags());
67} 67}
68 68
69static inline unsigned long arch_local_irq_save(void) 69static inline notrace unsigned long arch_local_irq_save(void)
70{ 70{
71 unsigned long flags, tmp; 71 unsigned long flags, tmp;
72 72
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index 9fe08a1ea6c6..f445e98463e6 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -293,7 +293,7 @@ maybe_smp4m_msg:
293 WRITE_PAUSE 293 WRITE_PAUSE
294 wr %l4, PSR_ET, %psr 294 wr %l4, PSR_ET, %psr
295 WRITE_PAUSE 295 WRITE_PAUSE
296 sll %o3, 28, %o2 ! shift for simpler checks below 296 srl %o3, 28, %o2 ! shift for simpler checks below
297maybe_smp4m_msg_check_single: 297maybe_smp4m_msg_check_single:
298 andcc %o2, 0x1, %g0 298 andcc %o2, 0x1, %g0
299 beq,a maybe_smp4m_msg_check_mask 299 beq,a maybe_smp4m_msg_check_mask
diff --git a/arch/sparc/mm/leon_mm.c b/arch/sparc/mm/leon_mm.c
index c0e01297e64e..e485a6804998 100644
--- a/arch/sparc/mm/leon_mm.c
+++ b/arch/sparc/mm/leon_mm.c
@@ -226,7 +226,7 @@ void leon3_getCacheRegs(struct leon3_cacheregs *regs)
226 * Leon2 and Leon3 differ in their way of telling cache information 226 * Leon2 and Leon3 differ in their way of telling cache information
227 * 227 *
228 */ 228 */
229int leon_flush_needed(void) 229int __init leon_flush_needed(void)
230{ 230{
231 int flush_needed = -1; 231 int flush_needed = -1;
232 unsigned int ssize, sets; 232 unsigned int ssize, sets;
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c
index abda3786a5d7..181bc2f7bb74 100644
--- a/drivers/acpi/apei/hest.c
+++ b/drivers/acpi/apei/hest.c
@@ -139,13 +139,23 @@ static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
139{ 139{
140 struct platform_device *ghes_dev; 140 struct platform_device *ghes_dev;
141 struct ghes_arr *ghes_arr = data; 141 struct ghes_arr *ghes_arr = data;
142 int rc; 142 int rc, i;
143 143
144 if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR) 144 if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR)
145 return 0; 145 return 0;
146 146
147 if (!((struct acpi_hest_generic *)hest_hdr)->enabled) 147 if (!((struct acpi_hest_generic *)hest_hdr)->enabled)
148 return 0; 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 ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id); 159 ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id);
150 if (!ghes_dev) 160 if (!ghes_dev)
151 return -ENOMEM; 161 return -ENOMEM;
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 52ca9649d769..372f9b70f7f4 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -1333,23 +1333,6 @@ int acpi_resources_are_enforced(void)
1333EXPORT_SYMBOL(acpi_resources_are_enforced); 1333EXPORT_SYMBOL(acpi_resources_are_enforced);
1334 1334
1335/* 1335/*
1336 * Create and initialize a spinlock.
1337 */
1338acpi_status
1339acpi_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 * Deallocate the memory for a spinlock. 1336 * Deallocate the memory for a spinlock.
1354 */ 1337 */
1355void acpi_os_delete_lock(acpi_spinlock handle) 1338void acpi_os_delete_lock(acpi_spinlock handle)
diff --git a/drivers/gpio/wm831x-gpio.c b/drivers/gpio/wm831x-gpio.c
index 309644cf4d9b..2bcfb0be09ff 100644
--- a/drivers/gpio/wm831x-gpio.c
+++ b/drivers/gpio/wm831x-gpio.c
@@ -180,6 +180,7 @@ static void wm831x_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
180 break; 180 break;
181 case WM831X_GPIO_PULL_UP: 181 case WM831X_GPIO_PULL_UP:
182 pull = "pullup"; 182 pull = "pullup";
183 break;
183 default: 184 default:
184 pull = "INVALID PULL"; 185 pull = "INVALID PULL";
185 break; 186 break;
diff --git a/drivers/hwmon/adm1275.c b/drivers/hwmon/adm1275.c
index b9b7caf4a1d2..8bc1bd663721 100644
--- a/drivers/hwmon/adm1275.c
+++ b/drivers/hwmon/adm1275.c
@@ -53,23 +53,23 @@ static int adm1275_probe(struct i2c_client *client,
53 info->direct[PSC_VOLTAGE_IN] = true; 53 info->direct[PSC_VOLTAGE_IN] = true;
54 info->direct[PSC_VOLTAGE_OUT] = true; 54 info->direct[PSC_VOLTAGE_OUT] = true;
55 info->direct[PSC_CURRENT_OUT] = true; 55 info->direct[PSC_CURRENT_OUT] = true;
56 info->m[PSC_CURRENT_OUT] = 800; 56 info->m[PSC_CURRENT_OUT] = 807;
57 info->b[PSC_CURRENT_OUT] = 20475; 57 info->b[PSC_CURRENT_OUT] = 20475;
58 info->R[PSC_CURRENT_OUT] = -1; 58 info->R[PSC_CURRENT_OUT] = -1;
59 info->func[0] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT; 59 info->func[0] = PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT;
60 60
61 if (config & ADM1275_VRANGE) { 61 if (config & ADM1275_VRANGE) {
62 info->m[PSC_VOLTAGE_IN] = 19045; 62 info->m[PSC_VOLTAGE_IN] = 19199;
63 info->b[PSC_VOLTAGE_IN] = 0; 63 info->b[PSC_VOLTAGE_IN] = 0;
64 info->R[PSC_VOLTAGE_IN] = -2; 64 info->R[PSC_VOLTAGE_IN] = -2;
65 info->m[PSC_VOLTAGE_OUT] = 19045; 65 info->m[PSC_VOLTAGE_OUT] = 19199;
66 info->b[PSC_VOLTAGE_OUT] = 0; 66 info->b[PSC_VOLTAGE_OUT] = 0;
67 info->R[PSC_VOLTAGE_OUT] = -2; 67 info->R[PSC_VOLTAGE_OUT] = -2;
68 } else { 68 } else {
69 info->m[PSC_VOLTAGE_IN] = 6666; 69 info->m[PSC_VOLTAGE_IN] = 6720;
70 info->b[PSC_VOLTAGE_IN] = 0; 70 info->b[PSC_VOLTAGE_IN] = 0;
71 info->R[PSC_VOLTAGE_IN] = -1; 71 info->R[PSC_VOLTAGE_IN] = -1;
72 info->m[PSC_VOLTAGE_OUT] = 6666; 72 info->m[PSC_VOLTAGE_OUT] = 6720;
73 info->b[PSC_VOLTAGE_OUT] = 0; 73 info->b[PSC_VOLTAGE_OUT] = 0;
74 info->R[PSC_VOLTAGE_OUT] = -1; 74 info->R[PSC_VOLTAGE_OUT] = -1;
75 } 75 }
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
index dcb78a7a8047..00e98517f94c 100644
--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -674,6 +674,7 @@ static int atk_debugfs_gitm_get(void *p, u64 *val)
674 else 674 else
675 err = -EIO; 675 err = -EIO;
676 676
677 ACPI_FREE(ret);
677 return err; 678 return err;
678} 679}
679 680
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index bb6405b92007..5f5247750430 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -1538,7 +1538,7 @@ static struct attribute *it87_attributes_label[] = {
1538}; 1538};
1539 1539
1540static const struct attribute_group it87_group_label = { 1540static const struct attribute_group it87_group_label = {
1541 .attrs = it87_attributes_vid, 1541 .attrs = it87_attributes_label,
1542}; 1542};
1543 1543
1544/* SuperIO detection - will change isa_address if a chip is found */ 1544/* SuperIO detection - will change isa_address if a chip is found */
diff --git a/drivers/hwmon/max1111.c b/drivers/hwmon/max1111.c
index 12a54aa29776..14335bbc9bdc 100644
--- a/drivers/hwmon/max1111.c
+++ b/drivers/hwmon/max1111.c
@@ -40,6 +40,8 @@ struct max1111_data {
40 struct spi_transfer xfer[2]; 40 struct spi_transfer xfer[2];
41 uint8_t *tx_buf; 41 uint8_t *tx_buf;
42 uint8_t *rx_buf; 42 uint8_t *rx_buf;
43 struct mutex drvdata_lock;
44 /* protect msg, xfer and buffers from multiple access */
43}; 45};
44 46
45static int max1111_read(struct device *dev, int channel) 47static int max1111_read(struct device *dev, int channel)
@@ -48,6 +50,9 @@ static int max1111_read(struct device *dev, int channel)
48 uint8_t v1, v2; 50 uint8_t v1, v2;
49 int err; 51 int err;
50 52
53 /* writing to drvdata struct is not thread safe, wait on mutex */
54 mutex_lock(&data->drvdata_lock);
55
51 data->tx_buf[0] = (channel << MAX1111_CTRL_SEL_SH) | 56 data->tx_buf[0] = (channel << MAX1111_CTRL_SEL_SH) |
52 MAX1111_CTRL_PD0 | MAX1111_CTRL_PD1 | 57 MAX1111_CTRL_PD0 | MAX1111_CTRL_PD1 |
53 MAX1111_CTRL_SGL | MAX1111_CTRL_UNI | MAX1111_CTRL_STR; 58 MAX1111_CTRL_SGL | MAX1111_CTRL_UNI | MAX1111_CTRL_STR;
@@ -55,12 +60,15 @@ static int max1111_read(struct device *dev, int channel)
55 err = spi_sync(data->spi, &data->msg); 60 err = spi_sync(data->spi, &data->msg);
56 if (err < 0) { 61 if (err < 0) {
57 dev_err(dev, "spi_sync failed with %d\n", err); 62 dev_err(dev, "spi_sync failed with %d\n", err);
63 mutex_unlock(&data->drvdata_lock);
58 return err; 64 return err;
59 } 65 }
60 66
61 v1 = data->rx_buf[0]; 67 v1 = data->rx_buf[0];
62 v2 = data->rx_buf[1]; 68 v2 = data->rx_buf[1];
63 69
70 mutex_unlock(&data->drvdata_lock);
71
64 if ((v1 & 0xc0) || (v2 & 0x3f)) 72 if ((v1 & 0xc0) || (v2 & 0x3f))
65 return -EINVAL; 73 return -EINVAL;
66 74
@@ -176,6 +184,8 @@ static int __devinit max1111_probe(struct spi_device *spi)
176 if (err) 184 if (err)
177 goto err_free_data; 185 goto err_free_data;
178 186
187 mutex_init(&data->drvdata_lock);
188
179 data->spi = spi; 189 data->spi = spi;
180 spi_set_drvdata(spi, data); 190 spi_set_drvdata(spi, data);
181 191
@@ -213,6 +223,7 @@ static int __devexit max1111_remove(struct spi_device *spi)
213 223
214 hwmon_device_unregister(data->hwmon_dev); 224 hwmon_device_unregister(data->hwmon_dev);
215 sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group); 225 sysfs_remove_group(&spi->dev.kobj, &max1111_attr_group);
226 mutex_destroy(&data->drvdata_lock);
216 kfree(data->rx_buf); 227 kfree(data->rx_buf);
217 kfree(data->tx_buf); 228 kfree(data->tx_buf);
218 kfree(data); 229 kfree(data);
diff --git a/drivers/hwmon/pmbus_core.c b/drivers/hwmon/pmbus_core.c
index 744672c1f26d..8e31a8e2c746 100644
--- a/drivers/hwmon/pmbus_core.c
+++ b/drivers/hwmon/pmbus_core.c
@@ -362,8 +362,8 @@ static struct pmbus_data *pmbus_update_device(struct device *dev)
362 * Convert linear sensor values to milli- or micro-units 362 * Convert linear sensor values to milli- or micro-units
363 * depending on sensor type. 363 * depending on sensor type.
364 */ 364 */
365static int pmbus_reg2data_linear(struct pmbus_data *data, 365static long pmbus_reg2data_linear(struct pmbus_data *data,
366 struct pmbus_sensor *sensor) 366 struct pmbus_sensor *sensor)
367{ 367{
368 s16 exponent; 368 s16 exponent;
369 s32 mantissa; 369 s32 mantissa;
@@ -397,15 +397,15 @@ static int pmbus_reg2data_linear(struct pmbus_data *data,
397 else 397 else
398 val >>= -exponent; 398 val >>= -exponent;
399 399
400 return (int)val; 400 return val;
401} 401}
402 402
403/* 403/*
404 * Convert direct sensor values to milli- or micro-units 404 * Convert direct sensor values to milli- or micro-units
405 * depending on sensor type. 405 * depending on sensor type.
406 */ 406 */
407static int pmbus_reg2data_direct(struct pmbus_data *data, 407static long pmbus_reg2data_direct(struct pmbus_data *data,
408 struct pmbus_sensor *sensor) 408 struct pmbus_sensor *sensor)
409{ 409{
410 long val = (s16) sensor->data; 410 long val = (s16) sensor->data;
411 long m, b, R; 411 long m, b, R;
@@ -440,12 +440,12 @@ static int pmbus_reg2data_direct(struct pmbus_data *data,
440 R++; 440 R++;
441 } 441 }
442 442
443 return (int)((val - b) / m); 443 return (val - b) / m;
444} 444}
445 445
446static int pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor) 446static long pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor)
447{ 447{
448 int val; 448 long val;
449 449
450 if (data->info->direct[sensor->class]) 450 if (data->info->direct[sensor->class])
451 val = pmbus_reg2data_direct(data, sensor); 451 val = pmbus_reg2data_direct(data, sensor);
@@ -619,7 +619,7 @@ static int pmbus_get_boolean(struct pmbus_data *data, int index, int *val)
619 if (!s1 && !s2) 619 if (!s1 && !s2)
620 *val = !!regval; 620 *val = !!regval;
621 else { 621 else {
622 int v1, v2; 622 long v1, v2;
623 struct pmbus_sensor *sensor1, *sensor2; 623 struct pmbus_sensor *sensor1, *sensor2;
624 624
625 sensor1 = &data->sensors[s1]; 625 sensor1 = &data->sensors[s1];
@@ -661,7 +661,7 @@ static ssize_t pmbus_show_sensor(struct device *dev,
661 if (sensor->data < 0) 661 if (sensor->data < 0)
662 return sensor->data; 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
667static ssize_t pmbus_set_sensor(struct device *dev, 667static ssize_t pmbus_set_sensor(struct device *dev,
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 98278041d75f..5b6b451d4694 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1988,6 +1988,14 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)
1988 if (dvbdev->users == -1 && fe->ops.ts_bus_ctrl) { 1988 if (dvbdev->users == -1 && fe->ops.ts_bus_ctrl) {
1989 if ((ret = fe->ops.ts_bus_ctrl(fe, 1)) < 0) 1989 if ((ret = fe->ops.ts_bus_ctrl(fe, 1)) < 0)
1990 goto err0; 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 if ((ret = dvb_generic_open (inode, file)) < 0) 2001 if ((ret = dvb_generic_open (inode, file)) < 0)
diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig
index e4c97fd6f05a..52798a111e16 100644
--- a/drivers/media/radio/Kconfig
+++ b/drivers/media/radio/Kconfig
@@ -168,7 +168,7 @@ config RADIO_MAXIRADIO
168 168
169config RADIO_MIROPCM20 169config RADIO_MIROPCM20
170 tristate "miroSOUND PCM20 radio" 170 tristate "miroSOUND PCM20 radio"
171 depends on ISA && VIDEO_V4L2 && SND 171 depends on ISA && ISA_DMA_API && VIDEO_V4L2 && SND
172 select SND_ISA 172 select SND_ISA
173 select SND_MIRO 173 select SND_MIRO
174 ---help--- 174 ---help---
@@ -201,7 +201,7 @@ config RADIO_SF16FMI
201 201
202config RADIO_SF16FMR2 202config RADIO_SF16FMR2
203 tristate "SF16FMR2 Radio" 203 tristate "SF16FMR2 Radio"
204 depends on ISA && VIDEO_V4L2 204 depends on ISA && VIDEO_V4L2 && SND
205 ---help--- 205 ---help---
206 Choose Y here if you have one of these FM radio cards. 206 Choose Y here if you have one of these FM radio cards.
207 207
diff --git a/drivers/media/radio/si4713-i2c.c b/drivers/media/radio/si4713-i2c.c
index deca2e06ff22..c9f4a8e65dc4 100644
--- a/drivers/media/radio/si4713-i2c.c
+++ b/drivers/media/radio/si4713-i2c.c
@@ -1033,7 +1033,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev,
1033 char ps_name[MAX_RDS_PS_NAME + 1]; 1033 char ps_name[MAX_RDS_PS_NAME + 1];
1034 1034
1035 len = control->size - 1; 1035 len = control->size - 1;
1036 if (len > MAX_RDS_PS_NAME) { 1036 if (len < 0 || len > MAX_RDS_PS_NAME) {
1037 rval = -ERANGE; 1037 rval = -ERANGE;
1038 goto exit; 1038 goto exit;
1039 } 1039 }
@@ -1057,7 +1057,7 @@ static int si4713_write_econtrol_string(struct si4713_device *sdev,
1057 char radio_text[MAX_RDS_RADIO_TEXT + 1]; 1057 char radio_text[MAX_RDS_RADIO_TEXT + 1];
1058 1058
1059 len = control->size - 1; 1059 len = control->size - 1;
1060 if (len > MAX_RDS_RADIO_TEXT) { 1060 if (len < 0 || len > MAX_RDS_RADIO_TEXT) {
1061 rval = -ERANGE; 1061 rval = -ERANGE;
1062 goto exit; 1062 goto exit;
1063 } 1063 }
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 06dfe0957b5e..ec972dc25790 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -558,9 +558,10 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf,
558 inout, data1); 558 inout, data1);
559 break; 559 break;
560 case MCE_CMD_S_TIMEOUT: 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 dev_info(dev, "%s receive timeout of %d ms\n", 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 break; 565 break;
565 case MCE_CMD_G_TIMEOUT: 566 case MCE_CMD_G_TIMEOUT:
566 dev_info(dev, "Get receive timeout\n"); 567 dev_info(dev, "Get receive timeout\n");
@@ -847,7 +848,7 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index)
847 switch (ir->buf_in[index]) { 848 switch (ir->buf_in[index]) {
848 /* 2-byte return value commands */ 849 /* 2-byte return value commands */
849 case MCE_CMD_S_TIMEOUT: 850 case MCE_CMD_S_TIMEOUT:
850 ir->rc->timeout = US_TO_NS((hi << 8 | lo) / 2); 851 ir->rc->timeout = US_TO_NS((hi << 8 | lo) * MCE_TIME_UNIT);
851 break; 852 break;
852 853
853 /* 1-byte return value commands */ 854 /* 1-byte return value commands */
@@ -1078,7 +1079,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir)
1078 rc->priv = ir; 1079 rc->priv = ir;
1079 rc->driver_type = RC_DRIVER_IR_RAW; 1080 rc->driver_type = RC_DRIVER_IR_RAW;
1080 rc->allowed_protos = RC_TYPE_ALL; 1081 rc->allowed_protos = RC_TYPE_ALL;
1081 rc->timeout = US_TO_NS(1000); 1082 rc->timeout = MS_TO_NS(100);
1082 if (!ir->flags.no_tx) { 1083 if (!ir->flags.no_tx) {
1083 rc->s_tx_mask = mceusb_set_tx_mask; 1084 rc->s_tx_mask = mceusb_set_tx_mask;
1084 rc->s_tx_carrier = mceusb_set_tx_carrier; 1085 rc->s_tx_carrier = mceusb_set_tx_carrier;
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index 565f24c20d77..ce595f9ab4c7 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -1110,7 +1110,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
1110 rdev->dev.parent = &pdev->dev; 1110 rdev->dev.parent = &pdev->dev;
1111 rdev->driver_name = NVT_DRIVER_NAME; 1111 rdev->driver_name = NVT_DRIVER_NAME;
1112 rdev->map_name = RC_MAP_RC6_MCE; 1112 rdev->map_name = RC_MAP_RC6_MCE;
1113 rdev->timeout = US_TO_NS(1000); 1113 rdev->timeout = MS_TO_NS(100);
1114 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ 1114 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */
1115 rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); 1115 rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD);
1116#if 0 1116#if 0
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c
index 64d9b2136ff6..419777a832ee 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -2060,12 +2060,8 @@ static int __devinit cx23885_initdev(struct pci_dev *pci_dev,
2060 goto fail_irq; 2060 goto fail_irq;
2061 } 2061 }
2062 2062
2063 if (!pci_enable_msi(pci_dev)) 2063 err = request_irq(pci_dev->irq, cx23885_irq,
2064 err = request_irq(pci_dev->irq, cx23885_irq, 2064 IRQF_SHARED | IRQF_DISABLED, dev->name, dev);
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);
2069 if (err < 0) { 2065 if (err < 0) {
2070 printk(KERN_ERR "%s: can't get IRQ %d\n", 2066 printk(KERN_ERR "%s: can't get IRQ %d\n",
2071 dev->name, pci_dev->irq); 2067 dev->name, pci_dev->irq);
@@ -2114,7 +2110,6 @@ static void __devexit cx23885_finidev(struct pci_dev *pci_dev)
2114 2110
2115 /* unregister stuff */ 2111 /* unregister stuff */
2116 free_irq(pci_dev->irq, dev); 2112 free_irq(pci_dev->irq, dev);
2117 pci_disable_msi(pci_dev);
2118 2113
2119 cx23885_dev_unregister(dev); 2114 cx23885_dev_unregister(dev);
2120 v4l2_device_unregister(v4l2_dev); 2115 v4l2_device_unregister(v4l2_dev);
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index cfa9f7efe93d..a03945ab9f08 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -714,10 +714,19 @@ static int tuner_remove(struct i2c_client *client)
714 * returns 0. 714 * returns 0.
715 * This function is needed for boards that have a separate tuner for 715 * This function is needed for boards that have a separate tuner for
716 * radio (like devices with tea5767). 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 */
718static inline int check_mode(struct tuner *t, enum v4l2_tuner_type mode) 721static 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 return -EINVAL; 730 return -EINVAL;
722 731
723 return 0; 732 return 0;
@@ -984,7 +993,7 @@ static void tuner_status(struct dvb_frontend *fe)
984 case V4L2_TUNER_RADIO: 993 case V4L2_TUNER_RADIO:
985 p = "radio"; 994 p = "radio";
986 break; 995 break;
987 case V4L2_TUNER_DIGITAL_TV: 996 case V4L2_TUNER_DIGITAL_TV: /* Used by mt20xx */
988 p = "digital TV"; 997 p = "digital TV";
989 break; 998 break;
990 case V4L2_TUNER_ANALOG_TV: 999 case V4L2_TUNER_ANALOG_TV:
@@ -1135,9 +1144,8 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
1135 return 0; 1144 return 0;
1136 if (vt->type == t->mode && analog_ops->get_afc) 1145 if (vt->type == t->mode && analog_ops->get_afc)
1137 vt->afc = analog_ops->get_afc(&t->fe); 1146 vt->afc = analog_ops->get_afc(&t->fe);
1138 if (vt->type == V4L2_TUNER_ANALOG_TV) 1147 if (t->mode != V4L2_TUNER_RADIO) {
1139 vt->capability |= V4L2_TUNER_CAP_NORM; 1148 vt->capability |= V4L2_TUNER_CAP_NORM;
1140 if (vt->type != V4L2_TUNER_RADIO) {
1141 vt->rangelow = tv_range[0] * 16; 1149 vt->rangelow = tv_range[0] * 16;
1142 vt->rangehigh = tv_range[1] * 16; 1150 vt->rangehigh = tv_range[1] * 16;
1143 return 0; 1151 return 0;
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 61265f74ed3d..b9eaf5c0dc72 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1415,9 +1415,9 @@ out:
1415 return features; 1415 return features;
1416} 1416}
1417 1417
1418#define BOND_VLAN_FEATURES (NETIF_F_ALL_TX_OFFLOADS | \ 1418#define BOND_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \
1419 NETIF_F_SOFT_FEATURES | \ 1419 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
1420 NETIF_F_LRO) 1420 NETIF_F_HIGHDMA | NETIF_F_LRO)
1421 1421
1422static void bond_compute_features(struct bonding *bond) 1422static void bond_compute_features(struct bonding *bond)
1423{ 1423{
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 3321d714ca22..d265c6e13873 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -2287,6 +2287,23 @@ static int gfar_set_mac_address(struct net_device *dev)
2287 return 0; 2287 return 0;
2288} 2288}
2289 2289
2290/* Check if rx parser should be activated */
2291void gfar_check_rx_parser_mode(struct gfar_private *priv)
2292{
2293 struct gfar __iomem *regs;
2294 u32 tempval;
2295
2296 regs = priv->gfargrp[0].regs;
2297
2298 tempval = gfar_read(&regs->rctrl);
2299 /* If parse is no longer required, then disable parser */
2300 if (tempval & RCTRL_REQ_PARSER)
2301 tempval |= RCTRL_PRSDEP_INIT;
2302 else
2303 tempval &= ~RCTRL_PRSDEP_INIT;
2304 gfar_write(&regs->rctrl, tempval);
2305}
2306
2290 2307
2291/* Enables and disables VLAN insertion/extraction */ 2308/* Enables and disables VLAN insertion/extraction */
2292static void gfar_vlan_rx_register(struct net_device *dev, 2309static void gfar_vlan_rx_register(struct net_device *dev,
@@ -2323,12 +2340,9 @@ static void gfar_vlan_rx_register(struct net_device *dev,
2323 /* Disable VLAN tag extraction */ 2340 /* Disable VLAN tag extraction */
2324 tempval = gfar_read(&regs->rctrl); 2341 tempval = gfar_read(&regs->rctrl);
2325 tempval &= ~RCTRL_VLEX; 2342 tempval &= ~RCTRL_VLEX;
2326 /* If parse is no longer required, then disable parser */
2327 if (tempval & RCTRL_REQ_PARSER)
2328 tempval |= RCTRL_PRSDEP_INIT;
2329 else
2330 tempval &= ~RCTRL_PRSDEP_INIT;
2331 gfar_write(&regs->rctrl, tempval); 2343 gfar_write(&regs->rctrl, tempval);
2344
2345 gfar_check_rx_parser_mode(priv);
2332 } 2346 }
2333 2347
2334 gfar_change_mtu(dev, dev->mtu); 2348 gfar_change_mtu(dev, dev->mtu);
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 27499c606a4a..87c1d8608b73 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -286,7 +286,7 @@ extern const char gfar_driver_version[];
286#define RCTRL_PROM 0x00000008 286#define RCTRL_PROM 0x00000008
287#define RCTRL_EMEN 0x00000002 287#define RCTRL_EMEN 0x00000002
288#define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \ 288#define RCTRL_REQ_PARSER (RCTRL_VLEX | RCTRL_IPCSEN | \
289 RCTRL_TUCSEN) 289 RCTRL_TUCSEN | RCTRL_FILREN)
290#define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \ 290#define RCTRL_CHECKSUMMING (RCTRL_IPCSEN | RCTRL_TUCSEN | \
291 RCTRL_PRSDEP_INIT) 291 RCTRL_PRSDEP_INIT)
292#define RCTRL_EXTHASH (RCTRL_GHTX) 292#define RCTRL_EXTHASH (RCTRL_GHTX)
@@ -1182,6 +1182,7 @@ extern void gfar_configure_coalescing(struct gfar_private *priv,
1182 unsigned long tx_mask, unsigned long rx_mask); 1182 unsigned long tx_mask, unsigned long rx_mask);
1183void gfar_init_sysfs(struct net_device *dev); 1183void gfar_init_sysfs(struct net_device *dev);
1184int gfar_set_features(struct net_device *dev, u32 features); 1184int gfar_set_features(struct net_device *dev, u32 features);
1185extern void gfar_check_rx_parser_mode(struct gfar_private *priv);
1185 1186
1186extern const struct ethtool_ops gfar_ethtool_ops; 1187extern const struct ethtool_ops gfar_ethtool_ops;
1187 1188
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 718879b35b7d..bc9a4bb31980 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -348,8 +348,9 @@ static int pppoe_device_event(struct notifier_block *this,
348 348
349 /* Only look at sockets that are using this specific device. */ 349 /* Only look at sockets that are using this specific device. */
350 switch (event) { 350 switch (event) {
351 case NETDEV_CHANGEADDR:
351 case NETDEV_CHANGEMTU: 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 * LCP re-negotiation. 354 * LCP re-negotiation.
354 */ 355 */
355 356
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 00f06e9a7796..b64fcee483aa 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -677,9 +677,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
677 if (status & RX_FIFO_FULL) 677 if (status & RX_FIFO_FULL)
678 dev->stats.rx_fifo_errors++; 678 dev->stats.rx_fifo_errors++;
679 679
680 /* Mask off RX interrupt */ 680 if (likely(napi_schedule_prep(&lp->napi))) {
681 misr &= ~RX_INTS; 681 /* Mask off RX interrupt */
682 napi_schedule(&lp->napi); 682 misr &= ~RX_INTS;
683 __napi_schedule(&lp->napi);
684 }
683 } 685 }
684 686
685 /* TX interrupt request */ 687 /* TX interrupt request */
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 468512731966..9a21ca3873fc 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -879,7 +879,6 @@ static void dmfe_free_tx_pkt(struct DEVICE *dev, struct dmfe_board_info * db)
879 txptr = db->tx_remove_ptr; 879 txptr = db->tx_remove_ptr;
880 while(db->tx_packet_cnt) { 880 while(db->tx_packet_cnt) {
881 tdes0 = le32_to_cpu(txptr->tdes0); 881 tdes0 = le32_to_cpu(txptr->tdes0);
882 pr_debug("tdes0=%x\n", tdes0);
883 if (tdes0 & 0x80000000) 882 if (tdes0 & 0x80000000)
884 break; 883 break;
885 884
@@ -889,7 +888,6 @@ static void dmfe_free_tx_pkt(struct DEVICE *dev, struct dmfe_board_info * db)
889 888
890 /* Transmit statistic counter */ 889 /* Transmit statistic counter */
891 if ( tdes0 != 0x7fffffff ) { 890 if ( tdes0 != 0x7fffffff ) {
892 pr_debug("tdes0=%x\n", tdes0);
893 dev->stats.collisions += (tdes0 >> 3) & 0xf; 891 dev->stats.collisions += (tdes0 >> 3) & 0xf;
894 dev->stats.tx_bytes += le32_to_cpu(txptr->tdes1) & 0x7ff; 892 dev->stats.tx_bytes += le32_to_cpu(txptr->tdes1) & 0x7ff;
895 if (tdes0 & TDES0_ERR_MASK) { 893 if (tdes0 & TDES0_ERR_MASK) {
@@ -986,7 +984,6 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
986 /* error summary bit check */ 984 /* error summary bit check */
987 if (rdes0 & 0x8000) { 985 if (rdes0 & 0x8000) {
988 /* This is a error packet */ 986 /* This is a error packet */
989 pr_debug("rdes0: %x\n", rdes0);
990 dev->stats.rx_errors++; 987 dev->stats.rx_errors++;
991 if (rdes0 & 1) 988 if (rdes0 & 1)
992 dev->stats.rx_fifo_errors++; 989 dev->stats.rx_fifo_errors++;
@@ -1638,7 +1635,6 @@ static u8 dmfe_sense_speed(struct dmfe_board_info * db)
1638 else /* DM9102/DM9102A */ 1635 else /* DM9102/DM9102A */
1639 phy_mode = phy_read(db->ioaddr, 1636 phy_mode = phy_read(db->ioaddr,
1640 db->phy_addr, 17, db->chip_id) & 0xf000; 1637 db->phy_addr, 17, db->chip_id) & 0xf000;
1641 pr_debug("Phy_mode %x\n", phy_mode);
1642 switch (phy_mode) { 1638 switch (phy_mode) {
1643 case 0x1000: db->op_mode = DMFE_10MHF; break; 1639 case 0x1000: db->op_mode = DMFE_10MHF; break;
1644 case 0x2000: db->op_mode = DMFE_10MFD; break; 1640 case 0x2000: db->op_mode = DMFE_10MFD; break;
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 9536d386bb38..21d816e9dfa5 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -599,8 +599,7 @@ config IT87_WDT
599 599
600config HP_WATCHDOG 600config HP_WATCHDOG
601 tristate "HP ProLiant iLO2+ Hardware Watchdog Timer" 601 tristate "HP ProLiant iLO2+ Hardware Watchdog Timer"
602 depends on X86 602 depends on X86 && PCI
603 default m
604 help 603 help
605 A software monitoring watchdog and NMI sourcing driver. This driver 604 A software monitoring watchdog and NMI sourcing driver. This driver
606 will detect lockups and provide a stack trace. This is a driver that 605 will detect lockups and provide a stack trace. This is a driver that
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 79743d146be6..0c1d91756528 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1438,12 +1438,15 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *base,
1438 struct dentry *temp; 1438 struct dentry *temp;
1439 char *path; 1439 char *path;
1440 int len, pos; 1440 int len, pos;
1441 unsigned seq;
1441 1442
1442 if (dentry == NULL) 1443 if (dentry == NULL)
1443 return ERR_PTR(-EINVAL); 1444 return ERR_PTR(-EINVAL);
1444 1445
1445retry: 1446retry:
1446 len = 0; 1447 len = 0;
1448 seq = read_seqbegin(&rename_lock);
1449 rcu_read_lock();
1447 for (temp = dentry; !IS_ROOT(temp);) { 1450 for (temp = dentry; !IS_ROOT(temp);) {
1448 struct inode *inode = temp->d_inode; 1451 struct inode *inode = temp->d_inode;
1449 if (inode && ceph_snap(inode) == CEPH_SNAPDIR) 1452 if (inode && ceph_snap(inode) == CEPH_SNAPDIR)
@@ -1455,10 +1458,12 @@ retry:
1455 len += 1 + temp->d_name.len; 1458 len += 1 + temp->d_name.len;
1456 temp = temp->d_parent; 1459 temp = temp->d_parent;
1457 if (temp == NULL) { 1460 if (temp == NULL) {
1461 rcu_read_unlock();
1458 pr_err("build_path corrupt dentry %p\n", dentry); 1462 pr_err("build_path corrupt dentry %p\n", dentry);
1459 return ERR_PTR(-EINVAL); 1463 return ERR_PTR(-EINVAL);
1460 } 1464 }
1461 } 1465 }
1466 rcu_read_unlock();
1462 if (len) 1467 if (len)
1463 len--; /* no leading '/' */ 1468 len--; /* no leading '/' */
1464 1469
@@ -1467,9 +1472,12 @@ retry:
1467 return ERR_PTR(-ENOMEM); 1472 return ERR_PTR(-ENOMEM);
1468 pos = len; 1473 pos = len;
1469 path[pos] = 0; /* trailing null */ 1474 path[pos] = 0; /* trailing null */
1475 rcu_read_lock();
1470 for (temp = dentry; !IS_ROOT(temp) && pos != 0; ) { 1476 for (temp = dentry; !IS_ROOT(temp) && pos != 0; ) {
1471 struct inode *inode = temp->d_inode; 1477 struct inode *inode;
1472 1478
1479 spin_lock(&temp->d_lock);
1480 inode = temp->d_inode;
1473 if (inode && ceph_snap(inode) == CEPH_SNAPDIR) { 1481 if (inode && ceph_snap(inode) == CEPH_SNAPDIR) {
1474 dout("build_path path+%d: %p SNAPDIR\n", 1482 dout("build_path path+%d: %p SNAPDIR\n",
1475 pos, temp); 1483 pos, temp);
@@ -1478,21 +1486,26 @@ retry:
1478 break; 1486 break;
1479 } else { 1487 } else {
1480 pos -= temp->d_name.len; 1488 pos -= temp->d_name.len;
1481 if (pos < 0) 1489 if (pos < 0) {
1490 spin_unlock(&temp->d_lock);
1482 break; 1491 break;
1492 }
1483 strncpy(path + pos, temp->d_name.name, 1493 strncpy(path + pos, temp->d_name.name,
1484 temp->d_name.len); 1494 temp->d_name.len);
1485 } 1495 }
1496 spin_unlock(&temp->d_lock);
1486 if (pos) 1497 if (pos)
1487 path[--pos] = '/'; 1498 path[--pos] = '/';
1488 temp = temp->d_parent; 1499 temp = temp->d_parent;
1489 if (temp == NULL) { 1500 if (temp == NULL) {
1501 rcu_read_unlock();
1490 pr_err("build_path corrupt dentry\n"); 1502 pr_err("build_path corrupt dentry\n");
1491 kfree(path); 1503 kfree(path);
1492 return ERR_PTR(-EINVAL); 1504 return ERR_PTR(-EINVAL);
1493 } 1505 }
1494 } 1506 }
1495 if (pos != 0) { 1507 rcu_read_unlock();
1508 if (pos != 0 || read_seqretry(&rename_lock, seq)) {
1496 pr_err("build_path did not end path lookup where " 1509 pr_err("build_path did not end path lookup where "
1497 "expected, namelen is %d, pos is %d\n", len, pos); 1510 "expected, namelen is %d, pos is %d\n", len, pos);
1498 /* presumably this is only possible if racing with a 1511 /* presumably this is only possible if racing with a
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 3e2989976297..bc4b12ca537b 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -35,6 +35,7 @@
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/kthread.h> 36#include <linux/kthread.h>
37#include <linux/freezer.h> 37#include <linux/freezer.h>
38#include <linux/namei.h>
38#include <net/ipv6.h> 39#include <net/ipv6.h>
39#include "cifsfs.h" 40#include "cifsfs.h"
40#include "cifspdu.h" 41#include "cifspdu.h"
@@ -542,14 +543,12 @@ static const struct super_operations cifs_super_ops = {
542static struct dentry * 543static struct dentry *
543cifs_get_root(struct smb_vol *vol, struct super_block *sb) 544cifs_get_root(struct smb_vol *vol, struct super_block *sb)
544{ 545{
545 int xid, rc; 546 struct dentry *dentry;
546 struct inode *inode;
547 struct qstr name;
548 struct dentry *dparent = NULL, *dchild = NULL, *alias;
549 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 547 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
550 unsigned int i, full_len, len; 548 char *full_path = NULL;
551 char *full_path = NULL, *pstart; 549 char *s, *p;
552 char sep; 550 char sep;
551 int xid;
553 552
554 full_path = cifs_build_path_to_root(vol, cifs_sb, 553 full_path = cifs_build_path_to_root(vol, cifs_sb,
555 cifs_sb_master_tcon(cifs_sb)); 554 cifs_sb_master_tcon(cifs_sb));
@@ -560,73 +559,32 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
560 559
561 xid = GetXid(); 560 xid = GetXid();
562 sep = CIFS_DIR_SEP(cifs_sb); 561 sep = CIFS_DIR_SEP(cifs_sb);
563 dparent = dget(sb->s_root); 562 dentry = dget(sb->s_root);
564 full_len = strlen(full_path); 563 p = s = full_path;
565 full_path[full_len] = sep; 564
566 pstart = full_path + 1; 565 do {
567 566 struct inode *dir = dentry->d_inode;
568 for (i = 1, len = 0; i <= full_len; i++) { 567 struct dentry *child;
569 if (full_path[i] != sep || !len) { 568
570 len++; 569 /* skip separators */
571 continue; 570 while (*s == sep)
572 } 571 s++;
573 572 if (!*s)
574 full_path[i] = 0; 573 break;
575 cFYI(1, "get dentry for %s", pstart); 574 p = s++;
576 575 /* next separator */
577 name.name = pstart; 576 while (*s && *s != sep)
578 name.len = len; 577 s++;
579 name.hash = full_name_hash(pstart, len); 578
580 dchild = d_lookup(dparent, &name); 579 mutex_lock(&dir->i_mutex);
581 if (dchild == NULL) { 580 child = lookup_one_len(p, dentry, s - p);
582 cFYI(1, "not exists"); 581 mutex_unlock(&dir->i_mutex);
583 dchild = d_alloc(dparent, &name); 582 dput(dentry);
584 if (dchild == NULL) { 583 dentry = child;
585 dput(dparent); 584 } while (!IS_ERR(dentry));
586 dparent = ERR_PTR(-ENOMEM);
587 goto out;
588 }
589 }
590
591 cFYI(1, "get inode");
592 if (dchild->d_inode == NULL) {
593 cFYI(1, "not exists");
594 inode = NULL;
595 if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext)
596 rc = cifs_get_inode_info_unix(&inode, full_path,
597 sb, xid);
598 else
599 rc = cifs_get_inode_info(&inode, full_path,
600 NULL, sb, xid, NULL);
601 if (rc) {
602 dput(dchild);
603 dput(dparent);
604 dparent = ERR_PTR(rc);
605 goto out;
606 }
607 alias = d_materialise_unique(dchild, inode);
608 if (alias != NULL) {
609 dput(dchild);
610 if (IS_ERR(alias)) {
611 dput(dparent);
612 dparent = ERR_PTR(-EINVAL); /* XXX */
613 goto out;
614 }
615 dchild = alias;
616 }
617 }
618 cFYI(1, "parent %p, child %p", dparent, dchild);
619
620 dput(dparent);
621 dparent = dchild;
622 len = 0;
623 pstart = full_path + i + 1;
624 full_path[i] = sep;
625 }
626out:
627 _FreeXid(xid); 585 _FreeXid(xid);
628 kfree(full_path); 586 kfree(full_path);
629 return dparent; 587 return dentry;
630} 588}
631 589
632static int cifs_set_super(struct super_block *sb, void *data) 590static int cifs_set_super(struct super_block *sb, void *data)
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 0900e1658c96..036ca83e5f46 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -129,5 +129,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
129extern const struct export_operations cifs_export_ops; 129extern const struct export_operations cifs_export_ops;
130#endif /* CIFS_NFSD_EXPORT */ 130#endif /* CIFS_NFSD_EXPORT */
131 131
132#define CIFS_VERSION "1.73" 132#define CIFS_VERSION "1.74"
133#endif /* _CIFSFS_H */ 133#endif /* _CIFSFS_H */
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index dbd669cc5bc7..ccc1afa0bf3b 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3485,7 +3485,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid)
3485 goto out; 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 vol_info->username = username; 3489 vol_info->username = username;
3490 vol_info->local_nls = cifs_sb->local_nls; 3490 vol_info->local_nls = cifs_sb->local_nls;
3491 vol_info->linux_uid = fsuid; 3491 vol_info->linux_uid = fsuid;
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 81914df47ef1..fa8c21d913bc 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -55,6 +55,7 @@ build_path_from_dentry(struct dentry *direntry)
55 char dirsep; 55 char dirsep;
56 struct cifs_sb_info *cifs_sb = CIFS_SB(direntry->d_sb); 56 struct cifs_sb_info *cifs_sb = CIFS_SB(direntry->d_sb);
57 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); 57 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
58 unsigned seq;
58 59
59 if (direntry == NULL) 60 if (direntry == NULL)
60 return NULL; /* not much we can do if dentry is freed and 61 return NULL; /* not much we can do if dentry is freed and
@@ -68,22 +69,29 @@ build_path_from_dentry(struct dentry *direntry)
68 dfsplen = 0; 69 dfsplen = 0;
69cifs_bp_rename_retry: 70cifs_bp_rename_retry:
70 namelen = dfsplen; 71 namelen = dfsplen;
72 seq = read_seqbegin(&rename_lock);
73 rcu_read_lock();
71 for (temp = direntry; !IS_ROOT(temp);) { 74 for (temp = direntry; !IS_ROOT(temp);) {
72 namelen += (1 + temp->d_name.len); 75 namelen += (1 + temp->d_name.len);
73 temp = temp->d_parent; 76 temp = temp->d_parent;
74 if (temp == NULL) { 77 if (temp == NULL) {
75 cERROR(1, "corrupt dentry"); 78 cERROR(1, "corrupt dentry");
79 rcu_read_unlock();
76 return NULL; 80 return NULL;
77 } 81 }
78 } 82 }
83 rcu_read_unlock();
79 84
80 full_path = kmalloc(namelen+1, GFP_KERNEL); 85 full_path = kmalloc(namelen+1, GFP_KERNEL);
81 if (full_path == NULL) 86 if (full_path == NULL)
82 return full_path; 87 return full_path;
83 full_path[namelen] = 0; /* trailing null */ 88 full_path[namelen] = 0; /* trailing null */
89 rcu_read_lock();
84 for (temp = direntry; !IS_ROOT(temp);) { 90 for (temp = direntry; !IS_ROOT(temp);) {
91 spin_lock(&temp->d_lock);
85 namelen -= 1 + temp->d_name.len; 92 namelen -= 1 + temp->d_name.len;
86 if (namelen < 0) { 93 if (namelen < 0) {
94 spin_unlock(&temp->d_lock);
87 break; 95 break;
88 } else { 96 } else {
89 full_path[namelen] = dirsep; 97 full_path[namelen] = dirsep;
@@ -91,14 +99,17 @@ cifs_bp_rename_retry:
91 temp->d_name.len); 99 temp->d_name.len);
92 cFYI(0, "name: %s", full_path + namelen); 100 cFYI(0, "name: %s", full_path + namelen);
93 } 101 }
102 spin_unlock(&temp->d_lock);
94 temp = temp->d_parent; 103 temp = temp->d_parent;
95 if (temp == NULL) { 104 if (temp == NULL) {
96 cERROR(1, "corrupt dentry"); 105 cERROR(1, "corrupt dentry");
106 rcu_read_unlock();
97 kfree(full_path); 107 kfree(full_path);
98 return NULL; 108 return NULL;
99 } 109 }
100 } 110 }
101 if (namelen != dfsplen) { 111 rcu_read_unlock();
112 if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) {
102 cERROR(1, "did not end path lookup where expected namelen is %d", 113 cERROR(1, "did not end path lookup where expected namelen is %d",
103 namelen); 114 namelen);
104 /* presumably this is only possible if racing with a rename 115 /* presumably this is only possible if racing with a rename
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 3892ab817a36..d3e619692ee0 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -428,8 +428,7 @@ static void build_ntlmssp_negotiate_blob(unsigned char *pbuffer,
428 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) { 428 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) {
429 flags |= NTLMSSP_NEGOTIATE_SIGN; 429 flags |= NTLMSSP_NEGOTIATE_SIGN;
430 if (!ses->server->session_estab) 430 if (!ses->server->session_estab)
431 flags |= NTLMSSP_NEGOTIATE_KEY_XCH | 431 flags |= NTLMSSP_NEGOTIATE_KEY_XCH;
432 NTLMSSP_NEGOTIATE_EXTENDED_SEC;
433 } 432 }
434 433
435 sec_blob->NegotiateFlags = cpu_to_le32(flags); 434 sec_blob->NegotiateFlags = cpu_to_le32(flags);
@@ -465,10 +464,11 @@ static int build_ntlmssp_auth_blob(unsigned char *pbuffer,
465 NTLMSSP_NEGOTIATE_128 | NTLMSSP_NEGOTIATE_UNICODE | 464 NTLMSSP_NEGOTIATE_128 | NTLMSSP_NEGOTIATE_UNICODE |
466 NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_EXTENDED_SEC; 465 NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_EXTENDED_SEC;
467 if (ses->server->sec_mode & 466 if (ses->server->sec_mode &
468 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) 467 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) {
469 flags |= NTLMSSP_NEGOTIATE_SIGN; 468 flags |= NTLMSSP_NEGOTIATE_SIGN;
470 if (ses->server->sec_mode & SECMODE_SIGN_REQUIRED) 469 if (!ses->server->session_estab)
471 flags |= NTLMSSP_NEGOTIATE_ALWAYS_SIGN; 470 flags |= NTLMSSP_NEGOTIATE_KEY_XCH;
471 }
472 472
473 tmp = pbuffer + sizeof(AUTHENTICATE_MESSAGE); 473 tmp = pbuffer + sizeof(AUTHENTICATE_MESSAGE);
474 sec_blob->NegotiateFlags = cpu_to_le32(flags); 474 sec_blob->NegotiateFlags = cpu_to_le32(flags);
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index e141939080f0..739fb59bcdc2 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -37,7 +37,7 @@ static DEFINE_MUTEX(read_mutex);
37/* These macros may change in future, to provide better st_ino semantics. */ 37/* These macros may change in future, to provide better st_ino semantics. */
38#define OFFSET(x) ((x)->i_ino) 38#define OFFSET(x) ((x)->i_ino)
39 39
40static unsigned long cramino(struct cramfs_inode *cino, unsigned int offset) 40static unsigned long cramino(const struct cramfs_inode *cino, unsigned int offset)
41{ 41{
42 if (!cino->offset) 42 if (!cino->offset)
43 return offset + 1; 43 return offset + 1;
@@ -61,7 +61,7 @@ static unsigned long cramino(struct cramfs_inode *cino, unsigned int offset)
61} 61}
62 62
63static struct inode *get_cramfs_inode(struct super_block *sb, 63static 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 struct inode *inode; 66 struct inode *inode;
67 static struct timespec zerotime; 67 static struct timespec zerotime;
@@ -317,7 +317,7 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
317 /* Set it all up.. */ 317 /* Set it all up.. */
318 sb->s_op = &cramfs_ops; 318 sb->s_op = &cramfs_ops;
319 root = get_cramfs_inode(sb, &super.root, 0); 319 root = get_cramfs_inode(sb, &super.root, 0);
320 if (!root) 320 if (IS_ERR(root))
321 goto out; 321 goto out;
322 sb->s_root = d_alloc_root(root); 322 sb->s_root = d_alloc_root(root);
323 if (!sb->s_root) { 323 if (!sb->s_root) {
@@ -423,6 +423,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
423static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) 423static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
424{ 424{
425 unsigned int offset = 0; 425 unsigned int offset = 0;
426 struct inode *inode = NULL;
426 int sorted; 427 int sorted;
427 428
428 mutex_lock(&read_mutex); 429 mutex_lock(&read_mutex);
@@ -449,8 +450,8 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s
449 450
450 for (;;) { 451 for (;;) {
451 if (!namelen) { 452 if (!namelen) {
452 mutex_unlock(&read_mutex); 453 inode = ERR_PTR(-EIO);
453 return ERR_PTR(-EIO); 454 goto out;
454 } 455 }
455 if (name[namelen-1]) 456 if (name[namelen-1])
456 break; 457 break;
@@ -462,17 +463,18 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s
462 if (retval > 0) 463 if (retval > 0)
463 continue; 464 continue;
464 if (!retval) { 465 if (!retval) {
465 struct cramfs_inode entry = *de; 466 inode = get_cramfs_inode(dir->i_sb, de, dir_off);
466 mutex_unlock(&read_mutex); 467 break;
467 d_add(dentry, get_cramfs_inode(dir->i_sb, &entry, dir_off));
468 return NULL;
469 } 468 }
470 /* else (retval < 0) */ 469 /* else (retval < 0) */
471 if (sorted) 470 if (sorted)
472 break; 471 break;
473 } 472 }
473out:
474 mutex_unlock(&read_mutex); 474 mutex_unlock(&read_mutex);
475 d_add(dentry, NULL); 475 if (IS_ERR(inode))
476 return ERR_CAST(inode);
477 d_add(dentry, inode);
476 return NULL; 478 return NULL;
477} 479}
478 480
diff --git a/fs/dcache.c b/fs/dcache.c
index 37f72ee5bf7c..6e4ea6d87774 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2213,14 +2213,15 @@ static void dentry_unlock_parents_for_move(struct dentry *dentry,
2213 * The hash value has to match the hash queue that the dentry is on.. 2213 * The hash value has to match the hash queue that the dentry is on..
2214 */ 2214 */
2215/* 2215/*
2216 * d_move - move a dentry 2216 * __d_move - move a dentry
2217 * @dentry: entry to move 2217 * @dentry: entry to move
2218 * @target: new dentry 2218 * @target: new dentry
2219 * 2219 *
2220 * Update the dcache to reflect the move of a file name. Negative 2220 * Update the dcache to reflect the move of a file name. Negative
2221 * dcache entries should not be moved in this way. 2221 * dcache entries should not be moved in this way. Caller hold
2222 * rename_lock.
2222 */ 2223 */
2223void d_move(struct dentry * dentry, struct dentry * target) 2224static void __d_move(struct dentry * dentry, struct dentry * target)
2224{ 2225{
2225 if (!dentry->d_inode) 2226 if (!dentry->d_inode)
2226 printk(KERN_WARNING "VFS: moving negative dcache entry\n"); 2227 printk(KERN_WARNING "VFS: moving negative dcache entry\n");
@@ -2228,8 +2229,6 @@ void d_move(struct dentry * dentry, struct dentry * target)
2228 BUG_ON(d_ancestor(dentry, target)); 2229 BUG_ON(d_ancestor(dentry, target));
2229 BUG_ON(d_ancestor(target, dentry)); 2230 BUG_ON(d_ancestor(target, dentry));
2230 2231
2231 write_seqlock(&rename_lock);
2232
2233 dentry_lock_for_move(dentry, target); 2232 dentry_lock_for_move(dentry, target);
2234 2233
2235 write_seqcount_begin(&dentry->d_seq); 2234 write_seqcount_begin(&dentry->d_seq);
@@ -2275,6 +2274,20 @@ void d_move(struct dentry * dentry, struct dentry * target)
2275 spin_unlock(&target->d_lock); 2274 spin_unlock(&target->d_lock);
2276 fsnotify_d_move(dentry); 2275 fsnotify_d_move(dentry);
2277 spin_unlock(&dentry->d_lock); 2276 spin_unlock(&dentry->d_lock);
2277}
2278
2279/*
2280 * d_move - move a dentry
2281 * @dentry: entry to move
2282 * @target: new dentry
2283 *
2284 * Update the dcache to reflect the move of a file name. Negative
2285 * dcache entries should not be moved in this way.
2286 */
2287void d_move(struct dentry *dentry, struct dentry *target)
2288{
2289 write_seqlock(&rename_lock);
2290 __d_move(dentry, target);
2278 write_sequnlock(&rename_lock); 2291 write_sequnlock(&rename_lock);
2279} 2292}
2280EXPORT_SYMBOL(d_move); 2293EXPORT_SYMBOL(d_move);
@@ -2302,7 +2315,7 @@ struct dentry *d_ancestor(struct dentry *p1, struct dentry *p2)
2302 * This helper attempts to cope with remotely renamed directories 2315 * This helper attempts to cope with remotely renamed directories
2303 * 2316 *
2304 * It assumes that the caller is already holding 2317 * It assumes that the caller is already holding
2305 * dentry->d_parent->d_inode->i_mutex and the inode->i_lock 2318 * dentry->d_parent->d_inode->i_mutex, inode->i_lock and rename_lock
2306 * 2319 *
2307 * Note: If ever the locking in lock_rename() changes, then please 2320 * Note: If ever the locking in lock_rename() changes, then please
2308 * remember to update this too... 2321 * remember to update this too...
@@ -2317,11 +2330,6 @@ static struct dentry *__d_unalias(struct inode *inode,
2317 if (alias->d_parent == dentry->d_parent) 2330 if (alias->d_parent == dentry->d_parent)
2318 goto out_unalias; 2331 goto out_unalias;
2319 2332
2320 /* Check for loops */
2321 ret = ERR_PTR(-ELOOP);
2322 if (d_ancestor(alias, dentry))
2323 goto out_err;
2324
2325 /* See lock_rename() */ 2333 /* See lock_rename() */
2326 ret = ERR_PTR(-EBUSY); 2334 ret = ERR_PTR(-EBUSY);
2327 if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex)) 2335 if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex))
@@ -2331,7 +2339,7 @@ static struct dentry *__d_unalias(struct inode *inode,
2331 goto out_err; 2339 goto out_err;
2332 m2 = &alias->d_parent->d_inode->i_mutex; 2340 m2 = &alias->d_parent->d_inode->i_mutex;
2333out_unalias: 2341out_unalias:
2334 d_move(alias, dentry); 2342 __d_move(alias, dentry);
2335 ret = alias; 2343 ret = alias;
2336out_err: 2344out_err:
2337 spin_unlock(&inode->i_lock); 2345 spin_unlock(&inode->i_lock);
@@ -2416,15 +2424,24 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
2416 alias = __d_find_alias(inode, 0); 2424 alias = __d_find_alias(inode, 0);
2417 if (alias) { 2425 if (alias) {
2418 actual = alias; 2426 actual = alias;
2419 /* Is this an anonymous mountpoint that we could splice 2427 write_seqlock(&rename_lock);
2420 * into our tree? */ 2428
2421 if (IS_ROOT(alias)) { 2429 if (d_ancestor(alias, dentry)) {
2430 /* Check for loops */
2431 actual = ERR_PTR(-ELOOP);
2432 } else if (IS_ROOT(alias)) {
2433 /* Is this an anonymous mountpoint that we
2434 * could splice into our tree? */
2422 __d_materialise_dentry(dentry, alias); 2435 __d_materialise_dentry(dentry, alias);
2436 write_sequnlock(&rename_lock);
2423 __d_drop(alias); 2437 __d_drop(alias);
2424 goto found; 2438 goto found;
2439 } else {
2440 /* Nope, but we must(!) avoid directory
2441 * aliasing */
2442 actual = __d_unalias(inode, dentry, alias);
2425 } 2443 }
2426 /* Nope, but we must(!) avoid directory aliasing */ 2444 write_sequnlock(&rename_lock);
2427 actual = __d_unalias(inode, dentry, alias);
2428 if (IS_ERR(actual)) 2445 if (IS_ERR(actual))
2429 dput(alias); 2446 dput(alias);
2430 goto out_nolock; 2447 goto out_nolock;
diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index 06065bd37fc3..c57beddcc217 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -913,7 +913,7 @@ struct dentry *exofs_get_parent(struct dentry *child)
913 unsigned long ino = exofs_parent_ino(child); 913 unsigned long ino = exofs_parent_ino(child);
914 914
915 if (!ino) 915 if (!ino)
916 return NULL; 916 return ERR_PTR(-ESTALE);
917 917
918 return d_obtain_alias(exofs_iget(child->d_inode->i_sb, ino)); 918 return d_obtain_alias(exofs_iget(child->d_inode->i_sb, ino));
919} 919}
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 802ac5eeba28..f9fbbe96c222 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -1069,6 +1069,7 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
1069 return 0; 1069 return 0;
1070 1070
1071 gfs2_log_lock(sdp); 1071 gfs2_log_lock(sdp);
1072 spin_lock(&sdp->sd_ail_lock);
1072 head = bh = page_buffers(page); 1073 head = bh = page_buffers(page);
1073 do { 1074 do {
1074 if (atomic_read(&bh->b_count)) 1075 if (atomic_read(&bh->b_count))
@@ -1080,6 +1081,7 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
1080 goto not_possible; 1081 goto not_possible;
1081 bh = bh->b_this_page; 1082 bh = bh->b_this_page;
1082 } while(bh != head); 1083 } while(bh != head);
1084 spin_unlock(&sdp->sd_ail_lock);
1083 gfs2_log_unlock(sdp); 1085 gfs2_log_unlock(sdp);
1084 1086
1085 head = bh = page_buffers(page); 1087 head = bh = page_buffers(page);
@@ -1112,6 +1114,7 @@ not_possible: /* Should never happen */
1112 WARN_ON(buffer_dirty(bh)); 1114 WARN_ON(buffer_dirty(bh));
1113 WARN_ON(buffer_pinned(bh)); 1115 WARN_ON(buffer_pinned(bh));
1114cannot_release: 1116cannot_release:
1117 spin_unlock(&sdp->sd_ail_lock);
1115 gfs2_log_unlock(sdp); 1118 gfs2_log_unlock(sdp);
1116 return 0; 1119 return 0;
1117} 1120}
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index 8ef70f464731..2cca29316bd6 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -47,10 +47,10 @@ static void __gfs2_ail_flush(struct gfs2_glock *gl)
47 bd_ail_gl_list); 47 bd_ail_gl_list);
48 bh = bd->bd_bh; 48 bh = bd->bd_bh;
49 gfs2_remove_from_ail(bd); 49 gfs2_remove_from_ail(bd);
50 spin_unlock(&sdp->sd_ail_lock);
51
52 bd->bd_bh = NULL; 50 bd->bd_bh = NULL;
53 bh->b_private = NULL; 51 bh->b_private = NULL;
52 spin_unlock(&sdp->sd_ail_lock);
53
54 bd->bd_blkno = bh->b_blocknr; 54 bd->bd_blkno = bh->b_blocknr;
55 gfs2_log_lock(sdp); 55 gfs2_log_lock(sdp);
56 gfs2_assert_withdraw(sdp, !buffer_busy(bh)); 56 gfs2_assert_withdraw(sdp, !buffer_busy(bh));
@@ -221,8 +221,10 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
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 gl->gl_sbd->sd_rindex_uptodate = 0; 226 gl->gl_sbd->sd_rindex_uptodate = 0;
227 }
226 if (ip && S_ISREG(ip->i_inode.i_mode)) 228 if (ip && S_ISREG(ip->i_inode.i_mode))
227 truncate_inode_pages(ip->i_inode.i_mapping, 0); 229 truncate_inode_pages(ip->i_inode.i_mapping, 0);
228} 230}
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 0a064e91ac70..81206e70cbf6 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -17,6 +17,7 @@
17#include <linux/buffer_head.h> 17#include <linux/buffer_head.h>
18#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
19#include <linux/rculist_bl.h> 19#include <linux/rculist_bl.h>
20#include <linux/completion.h>
20 21
21#define DIO_WAIT 0x00000010 22#define DIO_WAIT 0x00000010
22#define DIO_METADATA 0x00000020 23#define DIO_METADATA 0x00000020
@@ -546,6 +547,7 @@ struct gfs2_sbd {
546 struct gfs2_glock *sd_trans_gl; 547 struct gfs2_glock *sd_trans_gl;
547 wait_queue_head_t sd_glock_wait; 548 wait_queue_head_t sd_glock_wait;
548 atomic_t sd_glock_disposal; 549 atomic_t sd_glock_disposal;
550 struct completion sd_locking_init;
549 551
550 /* Inode Stuff */ 552 /* Inode Stuff */
551 553
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 903115f2bb34..85c62923ee29 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -903,6 +903,7 @@ void gfs2_meta_syncfs(struct gfs2_sbd *sdp)
903 if (gfs2_ail1_empty(sdp)) 903 if (gfs2_ail1_empty(sdp))
904 break; 904 break;
905 } 905 }
906 gfs2_log_flush(sdp, NULL);
906} 907}
907 908
908static inline int gfs2_jrnl_flush_reqd(struct gfs2_sbd *sdp) 909static inline int gfs2_jrnl_flush_reqd(struct gfs2_sbd *sdp)
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 8ac9ae189b53..2a77071fb7b6 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -72,6 +72,7 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)
72 72
73 init_waitqueue_head(&sdp->sd_glock_wait); 73 init_waitqueue_head(&sdp->sd_glock_wait);
74 atomic_set(&sdp->sd_glock_disposal, 0); 74 atomic_set(&sdp->sd_glock_disposal, 0);
75 init_completion(&sdp->sd_locking_init);
75 spin_lock_init(&sdp->sd_statfs_spin); 76 spin_lock_init(&sdp->sd_statfs_spin);
76 77
77 spin_lock_init(&sdp->sd_rindex_spin); 78 spin_lock_init(&sdp->sd_rindex_spin);
@@ -1017,11 +1018,13 @@ hostdata_error:
1017 fsname++; 1018 fsname++;
1018 if (lm->lm_mount == NULL) { 1019 if (lm->lm_mount == NULL) {
1019 fs_info(sdp, "Now mounting FS...\n"); 1020 fs_info(sdp, "Now mounting FS...\n");
1021 complete(&sdp->sd_locking_init);
1020 return 0; 1022 return 0;
1021 } 1023 }
1022 ret = lm->lm_mount(sdp, fsname); 1024 ret = lm->lm_mount(sdp, fsname);
1023 if (ret == 0) 1025 if (ret == 0)
1024 fs_info(sdp, "Joined cluster. Now mounting FS...\n"); 1026 fs_info(sdp, "Joined cluster. Now mounting FS...\n");
1027 complete(&sdp->sd_locking_init);
1025 return ret; 1028 return ret;
1026} 1029}
1027 1030
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index ed540e7018be..fb0edf735483 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -757,13 +757,17 @@ static int gfs2_write_inode(struct inode *inode, struct writeback_control *wbc)
757 struct timespec atime; 757 struct timespec atime;
758 struct gfs2_dinode *di; 758 struct gfs2_dinode *di;
759 int ret = -EAGAIN; 759 int ret = -EAGAIN;
760 int unlock_required = 0;
760 761
761 /* Skip timestamp update, if this is from a memalloc */ 762 /* Skip timestamp update, if this is from a memalloc */
762 if (current->flags & PF_MEMALLOC) 763 if (current->flags & PF_MEMALLOC)
763 goto do_flush; 764 goto do_flush;
764 ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); 765 if (!gfs2_glock_is_locked_by_me(ip->i_gl)) {
765 if (ret) 766 ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
766 goto do_flush; 767 if (ret)
768 goto do_flush;
769 unlock_required = 1;
770 }
767 ret = gfs2_trans_begin(sdp, RES_DINODE, 0); 771 ret = gfs2_trans_begin(sdp, RES_DINODE, 0);
768 if (ret) 772 if (ret)
769 goto do_unlock; 773 goto do_unlock;
@@ -780,7 +784,8 @@ static int gfs2_write_inode(struct inode *inode, struct writeback_control *wbc)
780 } 784 }
781 gfs2_trans_end(sdp); 785 gfs2_trans_end(sdp);
782do_unlock: 786do_unlock:
783 gfs2_glock_dq_uninit(&gh); 787 if (unlock_required)
788 gfs2_glock_dq_uninit(&gh);
784do_flush: 789do_flush:
785 if (wbc->sync_mode == WB_SYNC_ALL) 790 if (wbc->sync_mode == WB_SYNC_ALL)
786 gfs2_log_flush(GFS2_SB(inode), ip->i_gl); 791 gfs2_log_flush(GFS2_SB(inode), ip->i_gl);
@@ -1427,7 +1432,20 @@ out:
1427 return error; 1432 return error;
1428} 1433}
1429 1434
1430/* 1435/**
1436 * gfs2_evict_inode - Remove an inode from cache
1437 * @inode: The inode to evict
1438 *
1439 * There are three cases to consider:
1440 * 1. i_nlink == 0, we are final opener (and must deallocate)
1441 * 2. i_nlink == 0, we are not the final opener (and cannot deallocate)
1442 * 3. i_nlink > 0
1443 *
1444 * If the fs is read only, then we have to treat all cases as per #3
1445 * since we are unable to do any deallocation. The inode will be
1446 * deallocated by the next read/write node to attempt an allocation
1447 * in the same resource group
1448 *
1431 * We have to (at the moment) hold the inodes main lock to cover 1449 * We have to (at the moment) hold the inodes main lock to cover
1432 * the gap between unlocking the shared lock on the iopen lock and 1450 * the gap between unlocking the shared lock on the iopen lock and
1433 * taking the exclusive lock. I'd rather do a shared -> exclusive 1451 * taking the exclusive lock. I'd rather do a shared -> exclusive
@@ -1470,6 +1488,8 @@ static void gfs2_evict_inode(struct inode *inode)
1470 if (error) 1488 if (error)
1471 goto out_truncate; 1489 goto out_truncate;
1472 1490
1491 /* Case 1 starts here */
1492
1473 if (S_ISDIR(inode->i_mode) && 1493 if (S_ISDIR(inode->i_mode) &&
1474 (ip->i_diskflags & GFS2_DIF_EXHASH)) { 1494 (ip->i_diskflags & GFS2_DIF_EXHASH)) {
1475 error = gfs2_dir_exhash_dealloc(ip); 1495 error = gfs2_dir_exhash_dealloc(ip);
@@ -1493,13 +1513,16 @@ static void gfs2_evict_inode(struct inode *inode)
1493 goto out_unlock; 1513 goto out_unlock;
1494 1514
1495out_truncate: 1515out_truncate:
1516 /* Case 2 starts here */
1496 error = gfs2_trans_begin(sdp, 0, sdp->sd_jdesc->jd_blocks); 1517 error = gfs2_trans_begin(sdp, 0, sdp->sd_jdesc->jd_blocks);
1497 if (error) 1518 if (error)
1498 goto out_unlock; 1519 goto out_unlock;
1499 gfs2_final_release_pages(ip); 1520 /* Needs to be done before glock release & also in a transaction */
1521 truncate_inode_pages(&inode->i_data, 0);
1500 gfs2_trans_end(sdp); 1522 gfs2_trans_end(sdp);
1501 1523
1502out_unlock: 1524out_unlock:
1525 /* Error path for case 1 */
1503 if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags)) 1526 if (test_bit(HIF_HOLDER, &ip->i_iopen_gh.gh_iflags))
1504 gfs2_glock_dq(&ip->i_iopen_gh); 1527 gfs2_glock_dq(&ip->i_iopen_gh);
1505 gfs2_holder_uninit(&ip->i_iopen_gh); 1528 gfs2_holder_uninit(&ip->i_iopen_gh);
@@ -1507,6 +1530,7 @@ out_unlock:
1507 if (error && error != GLR_TRYFAILED && error != -EROFS) 1530 if (error && error != GLR_TRYFAILED && error != -EROFS)
1508 fs_warn(sdp, "gfs2_evict_inode: %d\n", error); 1531 fs_warn(sdp, "gfs2_evict_inode: %d\n", error);
1509out: 1532out:
1533 /* Case 3 starts here */
1510 truncate_inode_pages(&inode->i_data, 0); 1534 truncate_inode_pages(&inode->i_data, 0);
1511 end_writeback(inode); 1535 end_writeback(inode);
1512 1536
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index e20eab37bc80..443cabcfcd23 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -338,6 +338,9 @@ static ssize_t lkfirst_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
338 rv = sscanf(buf, "%u", &first); 338 rv = sscanf(buf, "%u", &first);
339 if (rv != 1 || first > 1) 339 if (rv != 1 || first > 1)
340 return -EINVAL; 340 return -EINVAL;
341 rv = wait_for_completion_killable(&sdp->sd_locking_init);
342 if (rv)
343 return rv;
341 spin_lock(&sdp->sd_jindex_spin); 344 spin_lock(&sdp->sd_jindex_spin);
342 rv = -EBUSY; 345 rv = -EBUSY;
343 if (test_bit(SDF_NOJOURNALID, &sdp->sd_flags) == 0) 346 if (test_bit(SDF_NOJOURNALID, &sdp->sd_flags) == 0)
@@ -414,7 +417,9 @@ static ssize_t jid_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
414 rv = sscanf(buf, "%d", &jid); 417 rv = sscanf(buf, "%d", &jid);
415 if (rv != 1) 418 if (rv != 1)
416 return -EINVAL; 419 return -EINVAL;
417 420 rv = wait_for_completion_killable(&sdp->sd_locking_init);
421 if (rv)
422 return rv;
418 spin_lock(&sdp->sd_jindex_spin); 423 spin_lock(&sdp->sd_jindex_spin);
419 rv = -EINVAL; 424 rv = -EINVAL;
420 if (sdp->sd_lockstruct.ls_ops->lm_mount == NULL) 425 if (sdp->sd_lockstruct.ls_ops->lm_mount == NULL)
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c
index 87ed48e0343d..85c098a499f3 100644
--- a/fs/hppfs/hppfs.c
+++ b/fs/hppfs/hppfs.c
@@ -139,7 +139,8 @@ static int file_removed(struct dentry *dentry, const char *file)
139static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry, 139static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
140 struct nameidata *nd) 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 struct inode *inode; 144 struct inode *inode;
144 int err, deleted; 145 int err, deleted;
145 146
@@ -149,23 +150,9 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
149 else if (deleted) 150 else if (deleted)
150 return ERR_PTR(-ENOENT); 151 return ERR_PTR(-ENOENT);
151 152
152 err = -ENOMEM;
153 parent = HPPFS_I(ino)->proc_dentry; 153 parent = HPPFS_I(ino)->proc_dentry;
154 mutex_lock(&parent->d_inode->i_mutex); 154 mutex_lock(&parent->d_inode->i_mutex);
155 proc_dentry = d_lookup(parent, &dentry->d_name); 155 proc_dentry = lookup_one_len(name->name, parent, name->len);
156 if (proc_dentry == NULL) {
157 proc_dentry = d_alloc(parent, &dentry->d_name);
158 if (proc_dentry == NULL) {
159 mutex_unlock(&parent->d_inode->i_mutex);
160 goto out;
161 }
162 new = (*parent->d_inode->i_op->lookup)(parent->d_inode,
163 proc_dentry, NULL);
164 if (new) {
165 dput(proc_dentry);
166 proc_dentry = new;
167 }
168 }
169 mutex_unlock(&parent->d_inode->i_mutex); 156 mutex_unlock(&parent->d_inode->i_mutex);
170 157
171 if (IS_ERR(proc_dentry)) 158 if (IS_ERR(proc_dentry))
@@ -174,13 +161,11 @@ static struct dentry *hppfs_lookup(struct inode *ino, struct dentry *dentry,
174 err = -ENOMEM; 161 err = -ENOMEM;
175 inode = get_inode(ino->i_sb, proc_dentry); 162 inode = get_inode(ino->i_sb, proc_dentry);
176 if (!inode) 163 if (!inode)
177 goto out_dput; 164 goto out;
178 165
179 d_add(dentry, inode); 166 d_add(dentry, inode);
180 return NULL; 167 return NULL;
181 168
182 out_dput:
183 dput(proc_dentry);
184 out: 169 out:
185 return ERR_PTR(err); 170 return ERR_PTR(err);
186} 171}
@@ -690,8 +675,10 @@ static struct inode *get_inode(struct super_block *sb, struct dentry *dentry)
690 struct inode *proc_ino = dentry->d_inode; 675 struct inode *proc_ino = dentry->d_inode;
691 struct inode *inode = new_inode(sb); 676 struct inode *inode = new_inode(sb);
692 677
693 if (!inode) 678 if (!inode) {
679 dput(dentry);
694 return ERR_PTR(-ENOMEM); 680 return ERR_PTR(-ENOMEM);
681 }
695 682
696 if (S_ISDIR(dentry->d_inode->i_mode)) { 683 if (S_ISDIR(dentry->d_inode->i_mode)) {
697 inode->i_op = &hppfs_dir_iops; 684 inode->i_op = &hppfs_dir_iops;
@@ -704,7 +691,7 @@ static struct inode *get_inode(struct super_block *sb, struct dentry *dentry)
704 inode->i_fop = &hppfs_file_fops; 691 inode->i_fop = &hppfs_file_fops;
705 } 692 }
706 693
707 HPPFS_I(inode)->proc_dentry = dget(dentry); 694 HPPFS_I(inode)->proc_dentry = dentry;
708 695
709 inode->i_uid = proc_ino->i_uid; 696 inode->i_uid = proc_ino->i_uid;
710 inode->i_gid = proc_ino->i_gid; 697 inode->i_gid = proc_ino->i_gid;
@@ -737,7 +724,7 @@ static int hppfs_fill_super(struct super_block *sb, void *d, int silent)
737 sb->s_fs_info = proc_mnt; 724 sb->s_fs_info = proc_mnt;
738 725
739 err = -ENOMEM; 726 err = -ENOMEM;
740 root_inode = get_inode(sb, proc_mnt->mnt_sb->s_root); 727 root_inode = get_inode(sb, dget(proc_mnt->mnt_sb->s_root));
741 if (!root_inode) 728 if (!root_inode)
742 goto out_mntput; 729 goto out_mntput;
743 730
diff --git a/fs/libfs.c b/fs/libfs.c
index c88eab55aec9..275ca4749a2e 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -822,7 +822,7 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
822 goto out; 822 goto out;
823 823
824 attr->set_buf[size] = '\0'; 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 ret = attr->set(attr->data, val); 826 ret = attr->set(attr->data, val);
827 if (ret == 0) 827 if (ret == 0)
828 ret = len; /* on success, claim we got the whole input */ 828 ret = len; /* on success, claim we got the whole input */
diff --git a/fs/namei.c b/fs/namei.c
index 0223c41fb114..14ab8d3f2f0c 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -433,6 +433,8 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
433 goto err_parent; 433 goto err_parent;
434 BUG_ON(nd->inode != parent->d_inode); 434 BUG_ON(nd->inode != parent->d_inode);
435 } else { 435 } else {
436 if (dentry->d_parent != parent)
437 goto err_parent;
436 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); 438 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
437 if (!__d_rcu_to_refcount(dentry, nd->seq)) 439 if (!__d_rcu_to_refcount(dentry, nd->seq))
438 goto err_child; 440 goto err_child;
@@ -940,7 +942,6 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
940 * Don't forget we might have a non-mountpoint managed dentry 942 * Don't forget we might have a non-mountpoint managed dentry
941 * that wants to block transit. 943 * that wants to block transit.
942 */ 944 */
943 *inode = path->dentry->d_inode;
944 if (unlikely(managed_dentry_might_block(path->dentry))) 945 if (unlikely(managed_dentry_might_block(path->dentry)))
945 return false; 946 return false;
946 947
@@ -953,6 +954,12 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
953 path->mnt = mounted; 954 path->mnt = mounted;
954 path->dentry = mounted->mnt_root; 955 path->dentry = mounted->mnt_root;
955 nd->seq = read_seqcount_begin(&path->dentry->d_seq); 956 nd->seq = read_seqcount_begin(&path->dentry->d_seq);
957 /*
958 * Update the inode too. We don't need to re-check the
959 * dentry sequence number here after this d_inode read,
960 * because a mount-point is always pinned.
961 */
962 *inode = path->dentry->d_inode;
956 } 963 }
957 return true; 964 return true;
958} 965}
diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c
index 29309e25417f..b57aab9a1184 100644
--- a/fs/ufs/namei.c
+++ b/fs/ufs/namei.c
@@ -56,16 +56,12 @@ static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, stru
56 56
57 lock_ufs(dir->i_sb); 57 lock_ufs(dir->i_sb);
58 ino = ufs_inode_by_name(dir, &dentry->d_name); 58 ino = ufs_inode_by_name(dir, &dentry->d_name);
59 if (ino) { 59 if (ino)
60 inode = ufs_iget(dir->i_sb, ino); 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 unlock_ufs(dir->i_sb); 61 unlock_ufs(dir->i_sb);
67 d_add(dentry, inode); 62 if (IS_ERR(inode))
68 return NULL; 63 return ERR_CAST(inode);
64 return d_splice_alias(inode, dentry);
69} 65}
70 66
71/* 67/*
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 3a10ef5914eb..6cd5b6403a7b 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -210,7 +210,7 @@ struct acpi_device_power_state {
210struct acpi_device_power { 210struct acpi_device_power {
211 int state; /* Current state */ 211 int state; /* Current state */
212 struct acpi_device_power_flags flags; 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/* Performance Management */ 216/* Performance Management */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index a756bc8d866d..4543b6f75867 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -98,8 +98,11 @@ acpi_os_table_override(struct acpi_table_header *existing_table,
98/* 98/*
99 * Spinlock primitives 99 * Spinlock primitives
100 */ 100 */
101
102#ifndef acpi_os_create_lock
101acpi_status 103acpi_status
102acpi_os_create_lock(acpi_spinlock *out_handle); 104acpi_os_create_lock(acpi_spinlock *out_handle);
105#endif
103 106
104void acpi_os_delete_lock(acpi_spinlock handle); 107void acpi_os_delete_lock(acpi_spinlock handle);
105 108
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 5d2a5e9544d9..2ce1be9f6291 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -159,6 +159,24 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
159 } while (0) 159 } while (0)
160#endif 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#endif /* __KERNEL__ */ 180#endif /* __KERNEL__ */
163 181
164#endif /* __ACLINUX_H__ */ 182#endif /* __ACLINUX_H__ */
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index e08f344c6cff..3d53efd25ab9 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -182,6 +182,7 @@
182 {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 182 {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
183 {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 183 {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
184 {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 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 {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 186 {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
186 {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 187 {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
187 {0x1002, 0x6762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 188 {0x1002, 0x6762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
@@ -192,6 +193,7 @@
192 {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 193 {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
193 {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 194 {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
194 {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 195 {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
196 {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
195 {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 197 {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
196 {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 198 {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
197 {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ 199 {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 52c4e3835aa6..25c805b2c9e5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1070,12 +1070,6 @@ struct net_device {
1070#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ 1070#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
1071 NETIF_F_FSO) 1071 NETIF_F_FSO)
1072 1072
1073#define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \
1074 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
1075 NETIF_F_HIGHDMA | \
1076 NETIF_F_SCTP_CSUM | \
1077 NETIF_F_ALL_FCOE)
1078
1079 /* 1073 /*
1080 * If one device supports one of these features, then enable them 1074 * If one device supports one of these features, then enable them
1081 * for all in netdev_increment_features. 1075 * for all in netdev_increment_features.
diff --git a/include/linux/sdla.h b/include/linux/sdla.h
index 564acd3a71c1..9995c7fc3f60 100644
--- a/include/linux/sdla.h
+++ b/include/linux/sdla.h
@@ -112,11 +112,7 @@ struct sdla_dlci_conf {
112 short Tb_max; 112 short Tb_max;
113}; 113};
114 114
115#ifndef __KERNEL__ 115#ifdef __KERNEL__
116
117void sdla(void *cfg_info, char *dev, struct frad_conf *conf, int quiet);
118
119#else
120 116
121/* important Z80 window addresses */ 117/* important Z80 window addresses */
122#define SDLA_CONTROL_WND 0xE000 118#define SDLA_CONTROL_WND 0xE000
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 7e59ffb3d0ba..ba06207b1dd3 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -84,9 +84,32 @@ DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
84 84
85static struct rcu_state *rcu_state; 85static 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 */
87int rcu_scheduler_active __read_mostly; 96int rcu_scheduler_active __read_mostly;
88EXPORT_SYMBOL_GPL(rcu_scheduler_active); 97EXPORT_SYMBOL_GPL(rcu_scheduler_active);
89 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 */
111static int rcu_scheduler_fully_active __read_mostly;
112
90#ifdef CONFIG_RCU_BOOST 113#ifdef CONFIG_RCU_BOOST
91 114
92/* 115/*
@@ -98,7 +121,6 @@ DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_status);
98DEFINE_PER_CPU(int, rcu_cpu_kthread_cpu); 121DEFINE_PER_CPU(int, rcu_cpu_kthread_cpu);
99DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_loops); 122DEFINE_PER_CPU(unsigned int, rcu_cpu_kthread_loops);
100DEFINE_PER_CPU(char, rcu_cpu_has_work); 123DEFINE_PER_CPU(char, rcu_cpu_has_work);
101static char rcu_kthreads_spawnable;
102 124
103#endif /* #ifdef CONFIG_RCU_BOOST */ 125#endif /* #ifdef CONFIG_RCU_BOOST */
104 126
@@ -1467,6 +1489,8 @@ static void rcu_process_callbacks(struct softirq_action *unused)
1467 */ 1489 */
1468static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp) 1490static void invoke_rcu_callbacks(struct rcu_state *rsp, struct rcu_data *rdp)
1469{ 1491{
1492 if (unlikely(!ACCESS_ONCE(rcu_scheduler_fully_active)))
1493 return;
1470 if (likely(!rsp->boost)) { 1494 if (likely(!rsp->boost)) {
1471 rcu_do_batch(rsp, rdp); 1495 rcu_do_batch(rsp, rdp);
1472 return; 1496 return;
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 14dc7dd00902..75113cb7c4fb 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -1532,7 +1532,7 @@ static int __cpuinit rcu_spawn_one_cpu_kthread(int cpu)
1532 struct sched_param sp; 1532 struct sched_param sp;
1533 struct task_struct *t; 1533 struct task_struct *t;
1534 1534
1535 if (!rcu_kthreads_spawnable || 1535 if (!rcu_scheduler_fully_active ||
1536 per_cpu(rcu_cpu_kthread_task, cpu) != NULL) 1536 per_cpu(rcu_cpu_kthread_task, cpu) != NULL)
1537 return 0; 1537 return 0;
1538 t = kthread_create(rcu_cpu_kthread, (void *)(long)cpu, "rcuc%d", cpu); 1538 t = kthread_create(rcu_cpu_kthread, (void *)(long)cpu, "rcuc%d", cpu);
@@ -1639,7 +1639,7 @@ static int __cpuinit rcu_spawn_one_node_kthread(struct rcu_state *rsp,
1639 struct sched_param sp; 1639 struct sched_param sp;
1640 struct task_struct *t; 1640 struct task_struct *t;
1641 1641
1642 if (!rcu_kthreads_spawnable || 1642 if (!rcu_scheduler_fully_active ||
1643 rnp->qsmaskinit == 0) 1643 rnp->qsmaskinit == 0)
1644 return 0; 1644 return 0;
1645 if (rnp->node_kthread_task == NULL) { 1645 if (rnp->node_kthread_task == NULL) {
@@ -1665,7 +1665,7 @@ static int __init rcu_spawn_kthreads(void)
1665 int cpu; 1665 int cpu;
1666 struct rcu_node *rnp; 1666 struct rcu_node *rnp;
1667 1667
1668 rcu_kthreads_spawnable = 1; 1668 rcu_scheduler_fully_active = 1;
1669 for_each_possible_cpu(cpu) { 1669 for_each_possible_cpu(cpu) {
1670 per_cpu(rcu_cpu_has_work, cpu) = 0; 1670 per_cpu(rcu_cpu_has_work, cpu) = 0;
1671 if (cpu_online(cpu)) 1671 if (cpu_online(cpu))
@@ -1687,7 +1687,7 @@ static void __cpuinit rcu_prepare_kthreads(int cpu)
1687 struct rcu_node *rnp = rdp->mynode; 1687 struct rcu_node *rnp = rdp->mynode;
1688 1688
1689 /* Fire up the incoming CPU's kthread and leaf rcu_node kthread. */ 1689 /* Fire up the incoming CPU's kthread and leaf rcu_node kthread. */
1690 if (rcu_kthreads_spawnable) { 1690 if (rcu_scheduler_fully_active) {
1691 (void)rcu_spawn_one_cpu_kthread(cpu); 1691 (void)rcu_spawn_one_cpu_kthread(cpu);
1692 if (rnp->node_kthread_task == NULL) 1692 if (rnp->node_kthread_task == NULL)
1693 (void)rcu_spawn_one_node_kthread(rcu_state, rnp); 1693 (void)rcu_spawn_one_node_kthread(rcu_state, rnp);
@@ -1726,6 +1726,13 @@ static void rcu_cpu_kthread_setrt(int cpu, int to_rt)
1726{ 1726{
1727} 1727}
1728 1728
1729static int __init rcu_scheduler_really_started(void)
1730{
1731 rcu_scheduler_fully_active = 1;
1732 return 0;
1733}
1734early_initcall(rcu_scheduler_really_started);
1735
1729static void __cpuinit rcu_prepare_kthreads(int cpu) 1736static void __cpuinit rcu_prepare_kthreads(int cpu)
1730{ 1737{
1731} 1738}
diff --git a/kernel/sched.c b/kernel/sched.c
index 9769c756ad66..3dc716f6d8ad 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7757,6 +7757,9 @@ static void init_cfs_rq(struct cfs_rq *cfs_rq, struct rq *rq)
7757#endif 7757#endif
7758#endif 7758#endif
7759 cfs_rq->min_vruntime = (u64)(-(1LL << 20)); 7759 cfs_rq->min_vruntime = (u64)(-(1LL << 20));
7760#ifndef CONFIG_64BIT
7761 cfs_rq->min_vruntime_copy = cfs_rq->min_vruntime;
7762#endif
7760} 7763}
7761 7764
7762static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq) 7765static void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 5ed24b94c5e6..d036e59d302b 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2310,7 +2310,8 @@ static bool pgdat_balanced(pg_data_t *pgdat, unsigned long balanced_pages,
2310 for (i = 0; i <= classzone_idx; i++) 2310 for (i = 0; i <= classzone_idx; i++)
2311 present_pages += pgdat->node_zones[i].present_pages; 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/* is kswapd sleeping prematurely? */ 2317/* is kswapd sleeping prematurely? */
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 49bb75294b7d..934e221c1d07 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -530,7 +530,11 @@ static int vlan_dev_init(struct net_device *dev)
530 (1<<__LINK_STATE_DORMANT))) | 530 (1<<__LINK_STATE_DORMANT))) |
531 (1<<__LINK_STATE_PRESENT); 531 (1<<__LINK_STATE_PRESENT);
532 532
533 dev->hw_features = NETIF_F_ALL_TX_OFFLOADS; 533 dev->hw_features = NETIF_F_ALL_CSUM | NETIF_F_SG |
534 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO |
535 NETIF_F_HIGHDMA | NETIF_F_SCTP_CSUM |
536 NETIF_F_ALL_FCOE;
537
534 dev->features |= real_dev->vlan_features | NETIF_F_LLTX; 538 dev->features |= real_dev->vlan_features | NETIF_F_LLTX;
535 dev->gso_max_size = real_dev->gso_max_size; 539 dev->gso_max_size = real_dev->gso_max_size;
536 540
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index f7f8e2cd3f70..3204ba8a701c 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -763,7 +763,8 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
763 struct sock *parent = bt_sk(sk)->parent; 763 struct sock *parent = bt_sk(sk)->parent;
764 rsp.result = cpu_to_le16(L2CAP_CR_PEND); 764 rsp.result = cpu_to_le16(L2CAP_CR_PEND);
765 rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND); 765 rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND);
766 parent->sk_data_ready(parent, 0); 766 if (parent)
767 parent->sk_data_ready(parent, 0);
767 768
768 } else { 769 } else {
769 l2cap_state_change(chan, BT_CONFIG); 770 l2cap_state_change(chan, BT_CONFIG);
@@ -2523,8 +2524,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
2523 2524
2524 sk = chan->sk; 2525 sk = chan->sk;
2525 2526
2526 if ((bt_sk(sk)->defer_setup && chan->state != BT_CONNECT2) || 2527 if (chan->state != BT_CONFIG && chan->state != BT_CONNECT2) {
2527 (!bt_sk(sk)->defer_setup && chan->state != BT_CONFIG)) {
2528 struct l2cap_cmd_rej_cid rej; 2528 struct l2cap_cmd_rej_cid rej;
2529 2529
2530 rej.reason = cpu_to_le16(L2CAP_REJ_INVALID_CID); 2530 rej.reason = cpu_to_le16(L2CAP_REJ_INVALID_CID);
@@ -4150,7 +4150,8 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
4150 struct sock *parent = bt_sk(sk)->parent; 4150 struct sock *parent = bt_sk(sk)->parent;
4151 res = L2CAP_CR_PEND; 4151 res = L2CAP_CR_PEND;
4152 stat = L2CAP_CS_AUTHOR_PEND; 4152 stat = L2CAP_CS_AUTHOR_PEND;
4153 parent->sk_data_ready(parent, 0); 4153 if (parent)
4154 parent->sk_data_ready(parent, 0);
4154 } else { 4155 } else {
4155 l2cap_state_change(chan, BT_CONFIG); 4156 l2cap_state_change(chan, BT_CONFIG);
4156 res = L2CAP_CR_SUCCESS; 4157 res = L2CAP_CR_SUCCESS;
diff --git a/net/ceph/ceph_fs.c b/net/ceph/ceph_fs.c
index a3a3a31d3c37..41466ccb972a 100644
--- a/net/ceph/ceph_fs.c
+++ b/net/ceph/ceph_fs.c
@@ -36,16 +36,19 @@ int ceph_flags_to_mode(int flags)
36 if ((flags & O_DIRECTORY) == O_DIRECTORY) 36 if ((flags & O_DIRECTORY) == O_DIRECTORY)
37 return CEPH_FILE_MODE_PIN; 37 return CEPH_FILE_MODE_PIN;
38#endif 38#endif
39 if ((flags & O_APPEND) == O_APPEND)
40 flags |= O_WRONLY;
41 39
42 if ((flags & O_ACCMODE) == O_RDWR) 40 switch (flags & O_ACCMODE) {
43 mode = CEPH_FILE_MODE_RDWR; 41 case O_WRONLY:
44 else if ((flags & O_ACCMODE) == O_WRONLY)
45 mode = CEPH_FILE_MODE_WR; 42 mode = CEPH_FILE_MODE_WR;
46 else 43 break;
44 case O_RDONLY:
47 mode = CEPH_FILE_MODE_RD; 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#ifdef O_LAZY 52#ifdef O_LAZY
50 if (flags & O_LAZY) 53 if (flags & O_LAZY)
51 mode |= CEPH_FILE_MODE_LAZY; 54 mode |= CEPH_FILE_MODE_LAZY;
diff --git a/net/sctp/output.c b/net/sctp/output.c
index b4f3cf06d8da..08b3cead6503 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -500,23 +500,20 @@ int sctp_packet_transmit(struct sctp_packet *packet)
500 * Note: Adler-32 is no longer applicable, as has been replaced 500 * Note: Adler-32 is no longer applicable, as has been replaced
501 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. 501 * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>.
502 */ 502 */
503 if (!sctp_checksum_disable && 503 if (!sctp_checksum_disable) {
504 !(dst->dev->features & (NETIF_F_NO_CSUM | NETIF_F_SCTP_CSUM))) { 504 if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) {
505 __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); 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 507 /* 3) Put the resultant value into the checksum field in the
508 * common header, and leave the rest of the bits unchanged. 508 * common header, and leave the rest of the bits unchanged.
509 */ 509 */
510 sh->checksum = sctp_end_cksum(crc32); 510 sh->checksum = sctp_end_cksum(crc32);
511 } else { 511 } else {
512 if (dst->dev->features & NETIF_F_SCTP_CSUM) {
513 /* no need to seed pseudo checksum for SCTP */ 512 /* no need to seed pseudo checksum for SCTP */
514 nskb->ip_summed = CHECKSUM_PARTIAL; 513 nskb->ip_summed = CHECKSUM_PARTIAL;
515 nskb->csum_start = (skb_transport_header(nskb) - 514 nskb->csum_start = (skb_transport_header(nskb) -
516 nskb->head); 515 nskb->head);
517 nskb->csum_offset = offsetof(struct sctphdr, checksum); 516 nskb->csum_offset = offsetof(struct sctphdr, checksum);
518 } else {
519 nskb->ip_summed = CHECKSUM_UNNECESSARY;
520 } 517 }
521 } 518 }
522 519
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index c2fc0356c2a4..83014a7c2e14 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -1190,7 +1190,6 @@ SND_SOC_DAPM_INPUT("DMIC1DAT"),
1190SND_SOC_DAPM_INPUT("DMIC2DAT"), 1190SND_SOC_DAPM_INPUT("DMIC2DAT"),
1191SND_SOC_DAPM_INPUT("Clock"), 1191SND_SOC_DAPM_INPUT("Clock"),
1192 1192
1193SND_SOC_DAPM_MICBIAS("MICBIAS", WM8994_MICBIAS, 2, 0),
1194SND_SOC_DAPM_SUPPLY_S("MICBIAS Supply", 1, SND_SOC_NOPM, 0, 0, micbias_ev, 1193SND_SOC_DAPM_SUPPLY_S("MICBIAS Supply", 1, SND_SOC_NOPM, 0, 0, micbias_ev,
1195 SND_SOC_DAPM_PRE_PMU), 1194 SND_SOC_DAPM_PRE_PMU),
1196 1195
@@ -1509,8 +1508,10 @@ static const struct snd_soc_dapm_route wm8994_revd_intercon[] = {
1509 { "AIF2DACDAT", NULL, "AIF1DACDAT" }, 1508 { "AIF2DACDAT", NULL, "AIF1DACDAT" },
1510 { "AIF1ADCDAT", NULL, "AIF2ADCDAT" }, 1509 { "AIF1ADCDAT", NULL, "AIF2ADCDAT" },
1511 { "AIF2ADCDAT", NULL, "AIF1ADCDAT" }, 1510 { "AIF2ADCDAT", NULL, "AIF1ADCDAT" },
1512 { "MICBIAS", NULL, "CLK_SYS" }, 1511 { "MICBIAS1", NULL, "CLK_SYS" },
1513 { "MICBIAS", NULL, "MICBIAS Supply" }, 1512 { "MICBIAS1", NULL, "MICBIAS Supply" },
1513 { "MICBIAS2", NULL, "CLK_SYS" },
1514 { "MICBIAS2", NULL, "MICBIAS Supply" },
1514}; 1515};
1515 1516
1516static const struct snd_soc_dapm_route wm8994_intercon[] = { 1517static const struct snd_soc_dapm_route wm8994_intercon[] = {
@@ -2763,7 +2764,7 @@ static void wm8958_default_micdet(u16 status, void *data)
2763 report = SND_JACK_MICROPHONE; 2764 report = SND_JACK_MICROPHONE;
2764 2765
2765 /* Everything else is buttons; just assign slots */ 2766 /* Everything else is buttons; just assign slots */
2766 if (status & 0x1c0) 2767 if (status & 0x1c)
2767 report |= SND_JACK_BTN_0; 2768 report |= SND_JACK_BTN_0;
2768 2769
2769done: 2770done:
diff --git a/sound/soc/sh/fsi-ak4642.c b/sound/soc/sh/fsi-ak4642.c
index d6f4703b3c07..770a71a15366 100644
--- a/sound/soc/sh/fsi-ak4642.c
+++ b/sound/soc/sh/fsi-ak4642.c
@@ -97,7 +97,7 @@ static int fsi_ak4642_remove(struct platform_device *pdev)
97 97
98static struct fsi_ak4642_data fsi_a_ak4642 = { 98static struct fsi_ak4642_data fsi_a_ak4642 = {
99 .name = "AK4642", 99 .name = "AK4642",
100 .card = "FSIA (AK4642)", 100 .card = "FSIA-AK4642",
101 .cpu_dai = "fsia-dai", 101 .cpu_dai = "fsia-dai",
102 .codec = "ak4642-codec.0-0012", 102 .codec = "ak4642-codec.0-0012",
103 .platform = "sh_fsi.0", 103 .platform = "sh_fsi.0",
@@ -106,7 +106,7 @@ static struct fsi_ak4642_data fsi_a_ak4642 = {
106 106
107static struct fsi_ak4642_data fsi_b_ak4642 = { 107static struct fsi_ak4642_data fsi_b_ak4642 = {
108 .name = "AK4642", 108 .name = "AK4642",
109 .card = "FSIB (AK4642)", 109 .card = "FSIB-AK4642",
110 .cpu_dai = "fsib-dai", 110 .cpu_dai = "fsib-dai",
111 .codec = "ak4642-codec.0-0012", 111 .codec = "ak4642-codec.0-0012",
112 .platform = "sh_fsi.0", 112 .platform = "sh_fsi.0",
@@ -115,7 +115,7 @@ static struct fsi_ak4642_data fsi_b_ak4642 = {
115 115
116static struct fsi_ak4642_data fsi_a_ak4643 = { 116static struct fsi_ak4642_data fsi_a_ak4643 = {
117 .name = "AK4643", 117 .name = "AK4643",
118 .card = "FSIA (AK4643)", 118 .card = "FSIA-AK4643",
119 .cpu_dai = "fsia-dai", 119 .cpu_dai = "fsia-dai",
120 .codec = "ak4642-codec.0-0013", 120 .codec = "ak4642-codec.0-0013",
121 .platform = "sh_fsi.0", 121 .platform = "sh_fsi.0",
@@ -124,7 +124,7 @@ static struct fsi_ak4642_data fsi_a_ak4643 = {
124 124
125static struct fsi_ak4642_data fsi_b_ak4643 = { 125static struct fsi_ak4642_data fsi_b_ak4643 = {
126 .name = "AK4643", 126 .name = "AK4643",
127 .card = "FSIB (AK4643)", 127 .card = "FSIB-AK4643",
128 .cpu_dai = "fsib-dai", 128 .cpu_dai = "fsib-dai",
129 .codec = "ak4642-codec.0-0013", 129 .codec = "ak4642-codec.0-0013",
130 .platform = "sh_fsi.0", 130 .platform = "sh_fsi.0",
@@ -133,7 +133,7 @@ static struct fsi_ak4642_data fsi_b_ak4643 = {
133 133
134static struct fsi_ak4642_data fsi2_a_ak4642 = { 134static struct fsi_ak4642_data fsi2_a_ak4642 = {
135 .name = "AK4642", 135 .name = "AK4642",
136 .card = "FSI2A (AK4642)", 136 .card = "FSI2A-AK4642",
137 .cpu_dai = "fsia-dai", 137 .cpu_dai = "fsia-dai",
138 .codec = "ak4642-codec.0-0012", 138 .codec = "ak4642-codec.0-0012",
139 .platform = "sh_fsi2", 139 .platform = "sh_fsi2",
@@ -142,7 +142,7 @@ static struct fsi_ak4642_data fsi2_a_ak4642 = {
142 142
143static struct fsi_ak4642_data fsi2_b_ak4642 = { 143static struct fsi_ak4642_data fsi2_b_ak4642 = {
144 .name = "AK4642", 144 .name = "AK4642",
145 .card = "FSI2B (AK4642)", 145 .card = "FSI2B-AK4642",
146 .cpu_dai = "fsib-dai", 146 .cpu_dai = "fsib-dai",
147 .codec = "ak4642-codec.0-0012", 147 .codec = "ak4642-codec.0-0012",
148 .platform = "sh_fsi2", 148 .platform = "sh_fsi2",
@@ -151,7 +151,7 @@ static struct fsi_ak4642_data fsi2_b_ak4642 = {
151 151
152static struct fsi_ak4642_data fsi2_a_ak4643 = { 152static struct fsi_ak4642_data fsi2_a_ak4643 = {
153 .name = "AK4643", 153 .name = "AK4643",
154 .card = "FSI2A (AK4643)", 154 .card = "FSI2A-AK4643",
155 .cpu_dai = "fsia-dai", 155 .cpu_dai = "fsia-dai",
156 .codec = "ak4642-codec.0-0013", 156 .codec = "ak4642-codec.0-0013",
157 .platform = "sh_fsi2", 157 .platform = "sh_fsi2",
@@ -160,7 +160,7 @@ static struct fsi_ak4642_data fsi2_a_ak4643 = {
160 160
161static struct fsi_ak4642_data fsi2_b_ak4643 = { 161static struct fsi_ak4642_data fsi2_b_ak4643 = {
162 .name = "AK4643", 162 .name = "AK4643",
163 .card = "FSI2B (AK4643)", 163 .card = "FSI2B-AK4643",
164 .cpu_dai = "fsib-dai", 164 .cpu_dai = "fsib-dai",
165 .codec = "ak4642-codec.0-0013", 165 .codec = "ak4642-codec.0-0013",
166 .platform = "sh_fsi2", 166 .platform = "sh_fsi2",
diff --git a/sound/soc/sh/fsi-da7210.c b/sound/soc/sh/fsi-da7210.c
index dbafd7ac5590..59553fd8c2fb 100644
--- a/sound/soc/sh/fsi-da7210.c
+++ b/sound/soc/sh/fsi-da7210.c
@@ -42,7 +42,7 @@ static struct snd_soc_dai_link fsi_da7210_dai = {
42}; 42};
43 43
44static struct snd_soc_card fsi_soc_card = { 44static struct snd_soc_card fsi_soc_card = {
45 .name = "FSI (DA7210)", 45 .name = "FSI-DA7210",
46 .dai_link = &fsi_da7210_dai, 46 .dai_link = &fsi_da7210_dai,
47 .num_links = 1, 47 .num_links = 1,
48}; 48};
diff --git a/sound/soc/sh/fsi-hdmi.c b/sound/soc/sh/fsi-hdmi.c
index 9719985eb82d..d3d9fd880680 100644
--- a/sound/soc/sh/fsi-hdmi.c
+++ b/sound/soc/sh/fsi-hdmi.c
@@ -83,13 +83,13 @@ static int fsi_hdmi_remove(struct platform_device *pdev)
83 83
84static struct fsi_hdmi_data fsi2_a_hdmi = { 84static struct fsi_hdmi_data fsi2_a_hdmi = {
85 .cpu_dai = "fsia-dai", 85 .cpu_dai = "fsia-dai",
86 .card = "FSI2A (SH MOBILE HDMI)", 86 .card = "FSI2A-HDMI",
87 .id = FSI_PORT_A, 87 .id = FSI_PORT_A,
88}; 88};
89 89
90static struct fsi_hdmi_data fsi2_b_hdmi = { 90static struct fsi_hdmi_data fsi2_b_hdmi = {
91 .cpu_dai = "fsib-dai", 91 .cpu_dai = "fsib-dai",
92 .card = "FSI2B (SH MOBILE HDMI)", 92 .card = "FSI2B-HDMI",
93 .id = FSI_PORT_B, 93 .id = FSI_PORT_B,
94}; 94};
95 95