aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/floppy.c12
-rw-r--r--drivers/char/drm/radeon_state.c9
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c1
-rw-r--r--drivers/char/synclink_gt.c14
-rw-r--r--drivers/char/watchdog/sbc8360.c4
-rw-r--r--drivers/ide/pci/sgiioc4.c60
-rw-r--r--drivers/ide/pci/via82cxxx.c3
-rw-r--r--drivers/infiniband/hw/mthca/mthca_allocator.c15
-rw-r--r--drivers/macintosh/via-pmu-backlight.c99
-rw-r--r--drivers/macintosh/via-pmu.c12
-rw-r--r--drivers/md/raid1.c57
-rw-r--r--drivers/net/e100.c6
-rw-r--r--drivers/net/sunlance.c27
-rw-r--r--drivers/net/wireless/strip.c6
-rw-r--r--drivers/pci/quirks.c1
-rw-r--r--drivers/s390/block/dasd.c192
-rw-r--r--drivers/s390/block/dasd_genhd.c10
-rw-r--r--drivers/s390/cio/ccwgroup.c14
-rw-r--r--drivers/s390/cio/chsc.c10
-rw-r--r--drivers/s390/cio/device.c19
-rw-r--r--drivers/s390/cio/device_fsm.c20
-rw-r--r--drivers/s390/cio/device_pgid.c27
-rw-r--r--drivers/serial/8250_pci.c31
-rw-r--r--drivers/serial/serial_core.c3
-rw-r--r--drivers/usb/gadget/ether.c45
-rw-r--r--drivers/usb/host/uhci-q.c4
-rw-r--r--drivers/usb/input/hid-core.c149
-rw-r--r--drivers/usb/net/pegasus.h3
-rw-r--r--drivers/usb/net/rtl8150.c1
-rw-r--r--drivers/usb/storage/unusual_devs.h24
-rw-r--r--drivers/video/aty/aty128fb.c18
-rw-r--r--drivers/video/aty/atyfb_base.c18
-rw-r--r--drivers/video/aty/radeon_backlight.c4
-rw-r--r--drivers/video/nvidia/nv_backlight.c18
-rw-r--r--drivers/video/riva/fbdev.c18
35 files changed, 593 insertions, 361 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 5109fa37c662..ad1d7065a1b2 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4177,6 +4177,11 @@ static int __init floppy_init(void)
4177 int i, unit, drive; 4177 int i, unit, drive;
4178 int err, dr; 4178 int err, dr;
4179 4179
4180#if defined(CONFIG_PPC_MERGE)
4181 if (check_legacy_ioport(FDC1))
4182 return -ENODEV;
4183#endif
4184
4180 raw_cmd = NULL; 4185 raw_cmd = NULL;
4181 4186
4182 for (dr = 0; dr < N_DRIVE; dr++) { 4187 for (dr = 0; dr < N_DRIVE; dr++) {
@@ -4234,13 +4239,6 @@ static int __init floppy_init(void)
4234 } 4239 }
4235 4240
4236 use_virtual_dma = can_use_virtual_dma & 1; 4241 use_virtual_dma = can_use_virtual_dma & 1;
4237#if defined(CONFIG_PPC_MERGE)
4238 if (check_legacy_ioport(FDC1)) {
4239 del_timer(&fd_timeout);
4240 err = -ENODEV;
4241 goto out_unreg_region;
4242 }
4243#endif
4244 fdc_state[0].address = FDC1; 4242 fdc_state[0].address = FDC1;
4245 if (fdc_state[0].address == -1) { 4243 if (fdc_state[0].address == -1) {
4246 del_timer(&fd_timeout); 4244 del_timer(&fd_timeout);
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index 5bb2234a9094..39a7f685e3fd 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -175,6 +175,14 @@ static __inline__ int radeon_check_and_fixup_packets(drm_radeon_private_t *
175 } 175 }
176 break; 176 break;
177 177
178 case R200_EMIT_VAP_CTL:{
179 RING_LOCALS;
180 BEGIN_RING(2);
181 OUT_RING_REG(RADEON_SE_TCL_STATE_FLUSH, 0);
182 ADVANCE_RING();
183 }
184 break;
185
178 case RADEON_EMIT_RB3D_COLORPITCH: 186 case RADEON_EMIT_RB3D_COLORPITCH:
179 case RADEON_EMIT_RE_LINE_PATTERN: 187 case RADEON_EMIT_RE_LINE_PATTERN:
180 case RADEON_EMIT_SE_LINE_WIDTH: 188 case RADEON_EMIT_SE_LINE_WIDTH:
@@ -202,7 +210,6 @@ static __inline__ int radeon_check_and_fixup_packets(drm_radeon_private_t *
202 case R200_EMIT_TCL_LIGHT_MODEL_CTL_0: 210 case R200_EMIT_TCL_LIGHT_MODEL_CTL_0:
203 case R200_EMIT_TFACTOR_0: 211 case R200_EMIT_TFACTOR_0:
204 case R200_EMIT_VTX_FMT_0: 212 case R200_EMIT_VTX_FMT_0:
205 case R200_EMIT_VAP_CTL:
206 case R200_EMIT_MATRIX_SELECT_0: 213 case R200_EMIT_MATRIX_SELECT_0:
207 case R200_EMIT_TEX_PROC_CTL_2: 214 case R200_EMIT_TEX_PROC_CTL_2:
208 case R200_EMIT_TCL_UCP_VERT_BLEND_CTL: 215 case R200_EMIT_TCL_UCP_VERT_BLEND_CTL:
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 0aa5d608fe6f..843d34c8627c 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -3428,6 +3428,7 @@ struct ipmi_recv_msg *ipmi_alloc_recv_msg(void)
3428 3428
3429 rv = kmalloc(sizeof(struct ipmi_recv_msg), GFP_ATOMIC); 3429 rv = kmalloc(sizeof(struct ipmi_recv_msg), GFP_ATOMIC);
3430 if (rv) { 3430 if (rv) {
3431 rv->user = NULL;
3431 rv->done = free_recv_msg; 3432 rv->done = free_recv_msg;
3432 atomic_inc(&recv_msg_inuse_count); 3433 atomic_inc(&recv_msg_inuse_count);
3433 } 3434 }
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index b2dbbdb1bf81..2f07b085536b 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -391,8 +391,8 @@ static MGSL_PARAMS default_params = {
391#define DESC_LIST_SIZE 4096 391#define DESC_LIST_SIZE 4096
392 392
393#define MASK_PARITY BIT1 393#define MASK_PARITY BIT1
394#define MASK_FRAMING BIT2 394#define MASK_FRAMING BIT0
395#define MASK_BREAK BIT3 395#define MASK_BREAK BIT14
396#define MASK_OVERRUN BIT4 396#define MASK_OVERRUN BIT4
397 397
398#define GSR 0x00 /* global status */ 398#define GSR 0x00 /* global status */
@@ -1800,17 +1800,17 @@ static void rx_async(struct slgt_info *info)
1800 1800
1801 stat = 0; 1801 stat = 0;
1802 1802
1803 if ((status = *(p+1) & (BIT9 + BIT8))) { 1803 if ((status = *(p+1) & (BIT1 + BIT0))) {
1804 if (status & BIT9) 1804 if (status & BIT1)
1805 icount->parity++; 1805 icount->parity++;
1806 else if (status & BIT8) 1806 else if (status & BIT0)
1807 icount->frame++; 1807 icount->frame++;
1808 /* discard char if tty control flags say so */ 1808 /* discard char if tty control flags say so */
1809 if (status & info->ignore_status_mask) 1809 if (status & info->ignore_status_mask)
1810 continue; 1810 continue;
1811 if (status & BIT9) 1811 if (status & BIT1)
1812 stat = TTY_PARITY; 1812 stat = TTY_PARITY;
1813 else if (status & BIT8) 1813 else if (status & BIT0)
1814 stat = TTY_FRAME; 1814 stat = TTY_FRAME;
1815 } 1815 }
1816 if (tty) { 1816 if (tty) {
diff --git a/drivers/char/watchdog/sbc8360.c b/drivers/char/watchdog/sbc8360.c
index 1035be5b5019..41fc6f80c493 100644
--- a/drivers/char/watchdog/sbc8360.c
+++ b/drivers/char/watchdog/sbc8360.c
@@ -200,7 +200,7 @@ static int wd_margin = 0xB;
200static int wd_multiplier = 2; 200static int wd_multiplier = 2;
201static int nowayout = WATCHDOG_NOWAYOUT; 201static int nowayout = WATCHDOG_NOWAYOUT;
202 202
203module_param(timeout, int, 27); 203module_param(timeout, int, 0);
204MODULE_PARM_DESC(timeout, "Index into timeout table (0-63) (default=27 (60s))"); 204MODULE_PARM_DESC(timeout, "Index into timeout table (0-63) (default=27 (60s))");
205module_param(nowayout, int, 0); 205module_param(nowayout, int, 0);
206MODULE_PARM_DESC(nowayout, 206MODULE_PARM_DESC(nowayout,
@@ -407,7 +407,7 @@ module_exit(sbc8360_exit);
407MODULE_AUTHOR("Ian E. Morgan <imorgan@webcon.ca>"); 407MODULE_AUTHOR("Ian E. Morgan <imorgan@webcon.ca>");
408MODULE_DESCRIPTION("SBC8360 watchdog driver"); 408MODULE_DESCRIPTION("SBC8360 watchdog driver");
409MODULE_LICENSE("GPL"); 409MODULE_LICENSE("GPL");
410MODULE_VERSION("1.0"); 410MODULE_VERSION("1.01");
411MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 411MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
412 412
413/* end of sbc8360.c */ 413/* end of sbc8360.c */
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index e125032bb403..d8a0d87df734 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -367,12 +367,13 @@ sgiioc4_INB(unsigned long port)
367static void __devinit 367static void __devinit
368ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base) 368ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
369{ 369{
370 void __iomem *virt_dma_base;
370 int num_ports = sizeof (ioc4_dma_regs_t); 371 int num_ports = sizeof (ioc4_dma_regs_t);
371 372
372 printk(KERN_INFO "%s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name, 373 printk(KERN_INFO "%s: BM-DMA at 0x%04lx-0x%04lx\n", hwif->name,
373 dma_base, dma_base + num_ports - 1); 374 dma_base, dma_base + num_ports - 1);
374 375
375 if (!request_region(dma_base, num_ports, hwif->name)) { 376 if (!request_mem_region(dma_base, num_ports, hwif->name)) {
376 printk(KERN_ERR 377 printk(KERN_ERR
377 "%s(%s) -- ERROR, Addresses 0x%p to 0x%p " 378 "%s(%s) -- ERROR, Addresses 0x%p to 0x%p "
378 "ALREADY in use\n", 379 "ALREADY in use\n",
@@ -381,13 +382,21 @@ ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
381 goto dma_alloc_failure; 382 goto dma_alloc_failure;
382 } 383 }
383 384
384 hwif->dma_base = dma_base; 385 virt_dma_base = ioremap(dma_base, num_ports);
386 if (virt_dma_base == NULL) {
387 printk(KERN_ERR
388 "%s(%s) -- ERROR, Unable to map addresses 0x%lx to 0x%lx\n",
389 __FUNCTION__, hwif->name, dma_base, dma_base + num_ports - 1);
390 goto dma_remap_failure;
391 }
392 hwif->dma_base = (unsigned long) virt_dma_base;
393
385 hwif->dmatable_cpu = pci_alloc_consistent(hwif->pci_dev, 394 hwif->dmatable_cpu = pci_alloc_consistent(hwif->pci_dev,
386 IOC4_PRD_ENTRIES * IOC4_PRD_BYTES, 395 IOC4_PRD_ENTRIES * IOC4_PRD_BYTES,
387 &hwif->dmatable_dma); 396 &hwif->dmatable_dma);
388 397
389 if (!hwif->dmatable_cpu) 398 if (!hwif->dmatable_cpu)
390 goto dma_alloc_failure; 399 goto dma_pci_alloc_failure;
391 400
392 hwif->sg_max_nents = IOC4_PRD_ENTRIES; 401 hwif->sg_max_nents = IOC4_PRD_ENTRIES;
393 402
@@ -411,6 +420,12 @@ dma_base2alloc_failure:
411 printk(KERN_INFO 420 printk(KERN_INFO
412 "Changing from DMA to PIO mode for Drive %s\n", hwif->name); 421 "Changing from DMA to PIO mode for Drive %s\n", hwif->name);
413 422
423dma_pci_alloc_failure:
424 iounmap(virt_dma_base);
425
426dma_remap_failure:
427 release_mem_region(dma_base, num_ports);
428
414dma_alloc_failure: 429dma_alloc_failure:
415 /* Disable DMA because we couldnot allocate any DMA maps */ 430 /* Disable DMA because we couldnot allocate any DMA maps */
416 hwif->autodma = 0; 431 hwif->autodma = 0;
@@ -607,18 +622,15 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
607 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; 622 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq;
608 hwif->ide_dma_timeout = &__ide_dma_timeout; 623 hwif->ide_dma_timeout = &__ide_dma_timeout;
609 624
610 /*
611 * The IOC4 uses MMIO rather than Port IO.
612 * It also needs special workarounds for INB.
613 */
614 default_hwif_mmiops(hwif);
615 hwif->INB = &sgiioc4_INB; 625 hwif->INB = &sgiioc4_INB;
616} 626}
617 627
618static int __devinit 628static int __devinit
619sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d) 629sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d)
620{ 630{
621 unsigned long base, ctl, dma_base, irqport; 631 unsigned long cmd_base, dma_base, irqport;
632 unsigned long bar0, cmd_phys_base, ctl;
633 void __iomem *virt_base;
622 ide_hwif_t *hwif; 634 ide_hwif_t *hwif;
623 int h; 635 int h;
624 636
@@ -636,23 +648,32 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d)
636 } 648 }
637 649
638 /* Get the CmdBlk and CtrlBlk Base Registers */ 650 /* Get the CmdBlk and CtrlBlk Base Registers */
639 base = pci_resource_start(dev, 0) + IOC4_CMD_OFFSET; 651 bar0 = pci_resource_start(dev, 0);
640 ctl = pci_resource_start(dev, 0) + IOC4_CTRL_OFFSET; 652 virt_base = ioremap(bar0, pci_resource_len(dev, 0));
641 irqport = pci_resource_start(dev, 0) + IOC4_INTR_OFFSET; 653 if (virt_base == NULL) {
654 printk(KERN_ERR "%s: Unable to remap BAR 0 address: 0x%lx\n",
655 d->name, bar0);
656 return -ENOMEM;
657 }
658 cmd_base = (unsigned long) virt_base + IOC4_CMD_OFFSET;
659 ctl = (unsigned long) virt_base + IOC4_CTRL_OFFSET;
660 irqport = (unsigned long) virt_base + IOC4_INTR_OFFSET;
642 dma_base = pci_resource_start(dev, 0) + IOC4_DMA_OFFSET; 661 dma_base = pci_resource_start(dev, 0) + IOC4_DMA_OFFSET;
643 662
644 if (!request_region(base, IOC4_CMD_CTL_BLK_SIZE, hwif->name)) { 663 cmd_phys_base = bar0 + IOC4_CMD_OFFSET;
664 if (!request_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE,
665 hwif->name)) {
645 printk(KERN_ERR 666 printk(KERN_ERR
646 "%s : %s -- ERROR, Port Addresses " 667 "%s : %s -- ERROR, Addresses "
647 "0x%p to 0x%p ALREADY in use\n", 668 "0x%p to 0x%p ALREADY in use\n",
648 __FUNCTION__, hwif->name, (void *) base, 669 __FUNCTION__, hwif->name, (void *) cmd_phys_base,
649 (void *) base + IOC4_CMD_CTL_BLK_SIZE); 670 (void *) cmd_phys_base + IOC4_CMD_CTL_BLK_SIZE);
650 return -ENOMEM; 671 return -ENOMEM;
651 } 672 }
652 673
653 if (hwif->io_ports[IDE_DATA_OFFSET] != base) { 674 if (hwif->io_ports[IDE_DATA_OFFSET] != cmd_base) {
654 /* Initialize the IO registers */ 675 /* Initialize the IO registers */
655 sgiioc4_init_hwif_ports(&hwif->hw, base, ctl, irqport); 676 sgiioc4_init_hwif_ports(&hwif->hw, cmd_base, ctl, irqport);
656 memcpy(hwif->io_ports, hwif->hw.io_ports, 677 memcpy(hwif->io_ports, hwif->hw.io_ports,
657 sizeof (hwif->io_ports)); 678 sizeof (hwif->io_ports));
658 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; 679 hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
@@ -665,6 +686,9 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d)
665 hwif->cds = (struct ide_pci_device_s *) d; 686 hwif->cds = (struct ide_pci_device_s *) d;
666 hwif->gendev.parent = &dev->dev;/* setup proper ancestral information */ 687 hwif->gendev.parent = &dev->dev;/* setup proper ancestral information */
667 688
689 /* The IOC4 uses MMIO rather than Port IO. */
690 default_hwif_mmiops(hwif);
691
668 /* Initializing chipset IRQ Registers */ 692 /* Initializing chipset IRQ Registers */
669 hwif->OUTL(0x03, irqport + IOC4_INTR_SET * 4); 693 hwif->OUTL(0x03, irqport + IOC4_INTR_SET * 4);
670 694
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index afdaee3c15c9..9b7589e8e93e 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -6,7 +6,7 @@
6 * 6 *
7 * vt82c576, vt82c586, vt82c586a, vt82c586b, vt82c596a, vt82c596b, 7 * vt82c576, vt82c586, vt82c586a, vt82c586b, vt82c596a, vt82c596b,
8 * vt82c686, vt82c686a, vt82c686b, vt8231, vt8233, vt8233c, vt8233a, 8 * vt82c686, vt82c686a, vt82c686b, vt8231, vt8233, vt8233c, vt8233a,
9 * vt8235, vt8237 9 * vt8235, vt8237, vt8237a
10 * 10 *
11 * Copyright (c) 2000-2002 Vojtech Pavlik 11 * Copyright (c) 2000-2002 Vojtech Pavlik
12 * 12 *
@@ -81,6 +81,7 @@ static struct via_isa_bridge {
81 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 81 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
82 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 82 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
83 { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 83 { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
84 { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
84 { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 85 { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
85 { "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 86 { "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
86 { "vt8233c", PCI_DEVICE_ID_VIA_8233C_0, 0x00, 0x2f, VIA_UDMA_100 }, 87 { "vt8233c", PCI_DEVICE_ID_VIA_8233C_0, 0x00, 0x2f, VIA_UDMA_100 },
diff --git a/drivers/infiniband/hw/mthca/mthca_allocator.c b/drivers/infiniband/hw/mthca/mthca_allocator.c
index 25157f57a6d0..f930e55b58fc 100644
--- a/drivers/infiniband/hw/mthca/mthca_allocator.c
+++ b/drivers/infiniband/hw/mthca/mthca_allocator.c
@@ -41,9 +41,11 @@
41/* Trivial bitmap-based allocator */ 41/* Trivial bitmap-based allocator */
42u32 mthca_alloc(struct mthca_alloc *alloc) 42u32 mthca_alloc(struct mthca_alloc *alloc)
43{ 43{
44 unsigned long flags;
44 u32 obj; 45 u32 obj;
45 46
46 spin_lock(&alloc->lock); 47 spin_lock_irqsave(&alloc->lock, flags);
48
47 obj = find_next_zero_bit(alloc->table, alloc->max, alloc->last); 49 obj = find_next_zero_bit(alloc->table, alloc->max, alloc->last);
48 if (obj >= alloc->max) { 50 if (obj >= alloc->max) {
49 alloc->top = (alloc->top + alloc->max) & alloc->mask; 51 alloc->top = (alloc->top + alloc->max) & alloc->mask;
@@ -56,19 +58,24 @@ u32 mthca_alloc(struct mthca_alloc *alloc)
56 } else 58 } else
57 obj = -1; 59 obj = -1;
58 60
59 spin_unlock(&alloc->lock); 61 spin_unlock_irqrestore(&alloc->lock, flags);
60 62
61 return obj; 63 return obj;
62} 64}
63 65
64void mthca_free(struct mthca_alloc *alloc, u32 obj) 66void mthca_free(struct mthca_alloc *alloc, u32 obj)
65{ 67{
68 unsigned long flags;
69
66 obj &= alloc->max - 1; 70 obj &= alloc->max - 1;
67 spin_lock(&alloc->lock); 71
72 spin_lock_irqsave(&alloc->lock, flags);
73
68 clear_bit(obj, alloc->table); 74 clear_bit(obj, alloc->table);
69 alloc->last = min(alloc->last, obj); 75 alloc->last = min(alloc->last, obj);
70 alloc->top = (alloc->top + alloc->max) & alloc->mask; 76 alloc->top = (alloc->top + alloc->max) & alloc->mask;
71 spin_unlock(&alloc->lock); 77
78 spin_unlock_irqrestore(&alloc->lock, flags);
72} 79}
73 80
74int mthca_alloc_init(struct mthca_alloc *alloc, u32 num, u32 mask, 81int mthca_alloc_init(struct mthca_alloc *alloc, u32 num, u32 mask,
diff --git a/drivers/macintosh/via-pmu-backlight.c b/drivers/macintosh/via-pmu-backlight.c
index d3f8d75bcbb4..a82f313d9dc9 100644
--- a/drivers/macintosh/via-pmu-backlight.c
+++ b/drivers/macintosh/via-pmu-backlight.c
@@ -18,17 +18,48 @@
18static struct backlight_properties pmu_backlight_data; 18static struct backlight_properties pmu_backlight_data;
19static spinlock_t pmu_backlight_lock; 19static spinlock_t pmu_backlight_lock;
20static int sleeping; 20static int sleeping;
21static u8 bl_curve[FB_BACKLIGHT_LEVELS];
21 22
22static int pmu_backlight_get_level_brightness(struct fb_info *info, 23static void pmu_backlight_init_curve(u8 off, u8 min, u8 max)
23 int level) 24{
25 unsigned int i, flat, count, range = (max - min);
26
27 bl_curve[0] = off;
28
29 for (flat = 1; flat < (FB_BACKLIGHT_LEVELS / 16); ++flat)
30 bl_curve[flat] = min;
31
32 count = FB_BACKLIGHT_LEVELS * 15 / 16;
33 for (i = 0; i < count; ++i)
34 bl_curve[flat + i] = min + (range * (i + 1) / count);
35}
36
37static int pmu_backlight_curve_lookup(int value)
38{
39 int level = (FB_BACKLIGHT_LEVELS - 1);
40 int i, max = 0;
41
42 /* Look for biggest value */
43 for (i = 0; i < FB_BACKLIGHT_LEVELS; i++)
44 max = max((int)bl_curve[i], max);
45
46 /* Look for nearest value */
47 for (i = 0; i < FB_BACKLIGHT_LEVELS; i++) {
48 int diff = abs(bl_curve[i] - value);
49 if (diff < max) {
50 max = diff;
51 level = i;
52 }
53 }
54 return level;
55}
56
57static int pmu_backlight_get_level_brightness(int level)
24{ 58{
25 int pmulevel; 59 int pmulevel;
26 60
27 /* Get and convert the value */ 61 /* Get and convert the value */
28 mutex_lock(&info->bl_mutex); 62 pmulevel = bl_curve[level] * FB_BACKLIGHT_MAX / MAX_PMU_LEVEL;
29 pmulevel = info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_PMU_LEVEL;
30 mutex_unlock(&info->bl_mutex);
31
32 if (pmulevel < 0) 63 if (pmulevel < 0)
33 pmulevel = 0; 64 pmulevel = 0;
34 else if (pmulevel > MAX_PMU_LEVEL) 65 else if (pmulevel > MAX_PMU_LEVEL)
@@ -39,7 +70,6 @@ static int pmu_backlight_get_level_brightness(struct fb_info *info,
39 70
40static int pmu_backlight_update_status(struct backlight_device *bd) 71static int pmu_backlight_update_status(struct backlight_device *bd)
41{ 72{
42 struct fb_info *info = class_get_devdata(&bd->class_dev);
43 struct adb_request req; 73 struct adb_request req;
44 unsigned long flags; 74 unsigned long flags;
45 int level = bd->props->brightness; 75 int level = bd->props->brightness;
@@ -55,7 +85,7 @@ static int pmu_backlight_update_status(struct backlight_device *bd)
55 level = 0; 85 level = 0;
56 86
57 if (level > 0) { 87 if (level > 0) {
58 int pmulevel = pmu_backlight_get_level_brightness(info, level); 88 int pmulevel = pmu_backlight_get_level_brightness(level);
59 89
60 pmu_request(&req, NULL, 2, PMU_BACKLIGHT_BRIGHT, pmulevel); 90 pmu_request(&req, NULL, 2, PMU_BACKLIGHT_BRIGHT, pmulevel);
61 pmu_wait_complete(&req); 91 pmu_wait_complete(&req);
@@ -88,35 +118,19 @@ static struct backlight_properties pmu_backlight_data = {
88}; 118};
89 119
90#ifdef CONFIG_PM 120#ifdef CONFIG_PM
91static int pmu_backlight_sleep_call(struct pmu_sleep_notifier *self, int when) 121void pmu_backlight_set_sleep(int sleep)
92{ 122{
93 unsigned long flags; 123 unsigned long flags;
94 124
95 spin_lock_irqsave(&pmu_backlight_lock, flags); 125 spin_lock_irqsave(&pmu_backlight_lock, flags);
96 126 sleeping = sleep;
97 switch (when) {
98 case PBOOK_SLEEP_REQUEST:
99 sleeping = 1;
100 break;
101 case PBOOK_WAKE:
102 sleeping = 0;
103 break;
104 }
105
106 spin_unlock_irqrestore(&pmu_backlight_lock, flags); 127 spin_unlock_irqrestore(&pmu_backlight_lock, flags);
107
108 return PBOOK_SLEEP_OK;
109} 128}
110 129#endif /* CONFIG_PM */
111static struct pmu_sleep_notifier pmu_backlight_sleep_notif = {
112 .notifier_call = pmu_backlight_sleep_call,
113};
114#endif
115 130
116void __init pmu_backlight_init() 131void __init pmu_backlight_init()
117{ 132{
118 struct backlight_device *bd; 133 struct backlight_device *bd;
119 struct fb_info *info;
120 char name[10]; 134 char name[10];
121 int level, autosave; 135 int level, autosave;
122 136
@@ -131,27 +145,14 @@ void __init pmu_backlight_init()
131 !machine_is_compatible("PowerBook1,1")) 145 !machine_is_compatible("PowerBook1,1"))
132 return; 146 return;
133 147
134 /* Actually, this is a hack, but I don't know of a better way 148 snprintf(name, sizeof(name), "pmubl");
135 * to get the first framebuffer device.
136 */
137 info = registered_fb[0];
138 if (!info) {
139 printk("pmubl: No framebuffer found\n");
140 goto error;
141 }
142
143 snprintf(name, sizeof(name), "pmubl%d", info->node);
144 149
145 bd = backlight_device_register(name, info, &pmu_backlight_data); 150 bd = backlight_device_register(name, NULL, &pmu_backlight_data);
146 if (IS_ERR(bd)) { 151 if (IS_ERR(bd)) {
147 printk("pmubl: Backlight registration failed\n"); 152 printk("pmubl: Backlight registration failed\n");
148 goto error; 153 goto error;
149 } 154 }
150 155 pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
151 mutex_lock(&info->bl_mutex);
152 info->bl_dev = bd;
153 fb_bl_default_curve(info, 0x7F, 0x46, 0x0E);
154 mutex_unlock(&info->bl_mutex);
155 156
156 level = pmu_backlight_data.max_brightness; 157 level = pmu_backlight_data.max_brightness;
157 158
@@ -161,28 +162,22 @@ void __init pmu_backlight_init()
161 pmu_request(&req, NULL, 2, 0xd9, 0); 162 pmu_request(&req, NULL, 2, 0xd9, 0);
162 pmu_wait_complete(&req); 163 pmu_wait_complete(&req);
163 164
164 mutex_lock(&info->bl_mutex); 165 level = pmu_backlight_curve_lookup(
165 level = pmac_backlight_curve_lookup(info,
166 (req.reply[0] >> 4) * 166 (req.reply[0] >> 4) *
167 pmu_backlight_data.max_brightness / 15); 167 pmu_backlight_data.max_brightness / 15);
168 mutex_unlock(&info->bl_mutex);
169 } 168 }
170 169
171 up(&bd->sem); 170 down(&bd->sem);
172 bd->props->brightness = level; 171 bd->props->brightness = level;
173 bd->props->power = FB_BLANK_UNBLANK; 172 bd->props->power = FB_BLANK_UNBLANK;
174 bd->props->update_status(bd); 173 bd->props->update_status(bd);
175 down(&bd->sem); 174 up(&bd->sem);
176 175
177 mutex_lock(&pmac_backlight_mutex); 176 mutex_lock(&pmac_backlight_mutex);
178 if (!pmac_backlight) 177 if (!pmac_backlight)
179 pmac_backlight = bd; 178 pmac_backlight = bd;
180 mutex_unlock(&pmac_backlight_mutex); 179 mutex_unlock(&pmac_backlight_mutex);
181 180
182#ifdef CONFIG_PM
183 pmu_register_sleep_notifier(&pmu_backlight_sleep_notif);
184#endif
185
186 printk("pmubl: Backlight initialized (%s)\n", name); 181 printk("pmubl: Backlight initialized (%s)\n", name);
187 182
188 return; 183 return;
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index ea386801e215..14610a63f580 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -1995,6 +1995,8 @@ restore_via_state(void)
1995 out_8(&via[IER], IER_SET | SR_INT | CB1_INT); 1995 out_8(&via[IER], IER_SET | SR_INT | CB1_INT);
1996} 1996}
1997 1997
1998extern void pmu_backlight_set_sleep(int sleep);
1999
1998static int 2000static int
1999pmac_suspend_devices(void) 2001pmac_suspend_devices(void)
2000{ 2002{
@@ -2032,6 +2034,11 @@ pmac_suspend_devices(void)
2032 return -EBUSY; 2034 return -EBUSY;
2033 } 2035 }
2034 2036
2037#ifdef CONFIG_PMAC_BACKLIGHT
2038 /* Tell backlight code not to muck around with the chip anymore */
2039 pmu_backlight_set_sleep(1);
2040#endif
2041
2035 /* Call platform functions marked "on sleep" */ 2042 /* Call platform functions marked "on sleep" */
2036 pmac_pfunc_i2c_suspend(); 2043 pmac_pfunc_i2c_suspend();
2037 pmac_pfunc_base_suspend(); 2044 pmac_pfunc_base_suspend();
@@ -2090,6 +2097,11 @@ pmac_wakeup_devices(void)
2090{ 2097{
2091 mdelay(100); 2098 mdelay(100);
2092 2099
2100#ifdef CONFIG_PMAC_BACKLIGHT
2101 /* Tell backlight code it can use the chip again */
2102 pmu_backlight_set_sleep(0);
2103#endif
2104
2093 /* Power back up system devices (including the PIC) */ 2105 /* Power back up system devices (including the PIC) */
2094 device_power_up(); 2106 device_power_up();
2095 2107
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 87bfe9e7d8ca..3b4d69c05623 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -930,10 +930,13 @@ static void status(struct seq_file *seq, mddev_t *mddev)
930 930
931 seq_printf(seq, " [%d/%d] [", conf->raid_disks, 931 seq_printf(seq, " [%d/%d] [", conf->raid_disks,
932 conf->working_disks); 932 conf->working_disks);
933 for (i = 0; i < conf->raid_disks; i++) 933 rcu_read_lock();
934 for (i = 0; i < conf->raid_disks; i++) {
935 mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev);
934 seq_printf(seq, "%s", 936 seq_printf(seq, "%s",
935 conf->mirrors[i].rdev && 937 rdev && test_bit(In_sync, &rdev->flags) ? "U" : "_");
936 test_bit(In_sync, &conf->mirrors[i].rdev->flags) ? "U" : "_"); 938 }
939 rcu_read_unlock();
937 seq_printf(seq, "]"); 940 seq_printf(seq, "]");
938} 941}
939 942
@@ -975,7 +978,6 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
975static void print_conf(conf_t *conf) 978static void print_conf(conf_t *conf)
976{ 979{
977 int i; 980 int i;
978 mirror_info_t *tmp;
979 981
980 printk("RAID1 conf printout:\n"); 982 printk("RAID1 conf printout:\n");
981 if (!conf) { 983 if (!conf) {
@@ -985,14 +987,17 @@ static void print_conf(conf_t *conf)
985 printk(" --- wd:%d rd:%d\n", conf->working_disks, 987 printk(" --- wd:%d rd:%d\n", conf->working_disks,
986 conf->raid_disks); 988 conf->raid_disks);
987 989
990 rcu_read_lock();
988 for (i = 0; i < conf->raid_disks; i++) { 991 for (i = 0; i < conf->raid_disks; i++) {
989 char b[BDEVNAME_SIZE]; 992 char b[BDEVNAME_SIZE];
990 tmp = conf->mirrors + i; 993 mdk_rdev_t *rdev = rcu_dereference(conf->mirrors[i].rdev);
991 if (tmp->rdev) 994 if (rdev)
992 printk(" disk %d, wo:%d, o:%d, dev:%s\n", 995 printk(" disk %d, wo:%d, o:%d, dev:%s\n",
993 i, !test_bit(In_sync, &tmp->rdev->flags), !test_bit(Faulty, &tmp->rdev->flags), 996 i, !test_bit(In_sync, &rdev->flags),
994 bdevname(tmp->rdev->bdev,b)); 997 !test_bit(Faulty, &rdev->flags),
998 bdevname(rdev->bdev,b));
995 } 999 }
1000 rcu_read_unlock();
996} 1001}
997 1002
998static void close_sync(conf_t *conf) 1003static void close_sync(conf_t *conf)
@@ -1008,20 +1013,20 @@ static int raid1_spare_active(mddev_t *mddev)
1008{ 1013{
1009 int i; 1014 int i;
1010 conf_t *conf = mddev->private; 1015 conf_t *conf = mddev->private;
1011 mirror_info_t *tmp;
1012 1016
1013 /* 1017 /*
1014 * Find all failed disks within the RAID1 configuration 1018 * Find all failed disks within the RAID1 configuration
1015 * and mark them readable 1019 * and mark them readable.
1020 * Called under mddev lock, so rcu protection not needed.
1016 */ 1021 */
1017 for (i = 0; i < conf->raid_disks; i++) { 1022 for (i = 0; i < conf->raid_disks; i++) {
1018 tmp = conf->mirrors + i; 1023 mdk_rdev_t *rdev = conf->mirrors[i].rdev;
1019 if (tmp->rdev 1024 if (rdev
1020 && !test_bit(Faulty, &tmp->rdev->flags) 1025 && !test_bit(Faulty, &rdev->flags)
1021 && !test_bit(In_sync, &tmp->rdev->flags)) { 1026 && !test_bit(In_sync, &rdev->flags)) {
1022 conf->working_disks++; 1027 conf->working_disks++;
1023 mddev->degraded--; 1028 mddev->degraded--;
1024 set_bit(In_sync, &tmp->rdev->flags); 1029 set_bit(In_sync, &rdev->flags);
1025 } 1030 }
1026 } 1031 }
1027 1032
@@ -1237,7 +1242,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
1237 /* ouch - failed to read all of that. 1242 /* ouch - failed to read all of that.
1238 * Try some synchronous reads of other devices to get 1243 * Try some synchronous reads of other devices to get
1239 * good data, much like with normal read errors. Only 1244 * good data, much like with normal read errors. Only
1240 * read into the pages we already have so they we don't 1245 * read into the pages we already have so we don't
1241 * need to re-issue the read request. 1246 * need to re-issue the read request.
1242 * We don't need to freeze the array, because being in an 1247 * We don't need to freeze the array, because being in an
1243 * active sync request, there is no normal IO, and 1248 * active sync request, there is no normal IO, and
@@ -1257,6 +1262,10 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
1257 s = PAGE_SIZE >> 9; 1262 s = PAGE_SIZE >> 9;
1258 do { 1263 do {
1259 if (r1_bio->bios[d]->bi_end_io == end_sync_read) { 1264 if (r1_bio->bios[d]->bi_end_io == end_sync_read) {
1265 /* No rcu protection needed here devices
1266 * can only be removed when no resync is
1267 * active, and resync is currently active
1268 */
1260 rdev = conf->mirrors[d].rdev; 1269 rdev = conf->mirrors[d].rdev;
1261 if (sync_page_io(rdev->bdev, 1270 if (sync_page_io(rdev->bdev,
1262 sect + rdev->data_offset, 1271 sect + rdev->data_offset,
@@ -1463,6 +1472,11 @@ static void raid1d(mddev_t *mddev)
1463 s = PAGE_SIZE >> 9; 1472 s = PAGE_SIZE >> 9;
1464 1473
1465 do { 1474 do {
1475 /* Note: no rcu protection needed here
1476 * as this is synchronous in the raid1d thread
1477 * which is the thread that might remove
1478 * a device. If raid1d ever becomes multi-threaded....
1479 */
1466 rdev = conf->mirrors[d].rdev; 1480 rdev = conf->mirrors[d].rdev;
1467 if (rdev && 1481 if (rdev &&
1468 test_bit(In_sync, &rdev->flags) && 1482 test_bit(In_sync, &rdev->flags) &&
@@ -1486,7 +1500,6 @@ static void raid1d(mddev_t *mddev)
1486 d = conf->raid_disks; 1500 d = conf->raid_disks;
1487 d--; 1501 d--;
1488 rdev = conf->mirrors[d].rdev; 1502 rdev = conf->mirrors[d].rdev;
1489 atomic_add(s, &rdev->corrected_errors);
1490 if (rdev && 1503 if (rdev &&
1491 test_bit(In_sync, &rdev->flags)) { 1504 test_bit(In_sync, &rdev->flags)) {
1492 if (sync_page_io(rdev->bdev, 1505 if (sync_page_io(rdev->bdev,
@@ -1509,9 +1522,11 @@ static void raid1d(mddev_t *mddev)
1509 s<<9, conf->tmppage, READ) == 0) 1522 s<<9, conf->tmppage, READ) == 0)
1510 /* Well, this device is dead */ 1523 /* Well, this device is dead */
1511 md_error(mddev, rdev); 1524 md_error(mddev, rdev);
1512 else 1525 else {
1526 atomic_add(s, &rdev->corrected_errors);
1513 printk(KERN_INFO "raid1:%s: read error corrected (%d sectors at %llu on %s)\n", 1527 printk(KERN_INFO "raid1:%s: read error corrected (%d sectors at %llu on %s)\n",
1514 mdname(mddev), s, (unsigned long long)(sect + rdev->data_offset), bdevname(rdev->bdev, b)); 1528 mdname(mddev), s, (unsigned long long)(sect + rdev->data_offset), bdevname(rdev->bdev, b));
1529 }
1515 } 1530 }
1516 } 1531 }
1517 } else { 1532 } else {
@@ -1787,19 +1802,17 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
1787 for (i=0; i<conf->raid_disks; i++) { 1802 for (i=0; i<conf->raid_disks; i++) {
1788 bio = r1_bio->bios[i]; 1803 bio = r1_bio->bios[i];
1789 if (bio->bi_end_io == end_sync_read) { 1804 if (bio->bi_end_io == end_sync_read) {
1790 md_sync_acct(conf->mirrors[i].rdev->bdev, nr_sectors); 1805 md_sync_acct(bio->bi_bdev, nr_sectors);
1791 generic_make_request(bio); 1806 generic_make_request(bio);
1792 } 1807 }
1793 } 1808 }
1794 } else { 1809 } else {
1795 atomic_set(&r1_bio->remaining, 1); 1810 atomic_set(&r1_bio->remaining, 1);
1796 bio = r1_bio->bios[r1_bio->read_disk]; 1811 bio = r1_bio->bios[r1_bio->read_disk];
1797 md_sync_acct(conf->mirrors[r1_bio->read_disk].rdev->bdev, 1812 md_sync_acct(bio->bi_bdev, nr_sectors);
1798 nr_sectors);
1799 generic_make_request(bio); 1813 generic_make_request(bio);
1800 1814
1801 } 1815 }
1802
1803 return nr_sectors; 1816 return nr_sectors;
1804} 1817}
1805 1818
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 91ef5f2fd768..ce850f1078b5 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -173,8 +173,11 @@ MODULE_LICENSE("GPL");
173MODULE_VERSION(DRV_VERSION); 173MODULE_VERSION(DRV_VERSION);
174 174
175static int debug = 3; 175static int debug = 3;
176static int eeprom_bad_csum_allow = 0;
176module_param(debug, int, 0); 177module_param(debug, int, 0);
178module_param(eeprom_bad_csum_allow, int, 0);
177MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); 179MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
180MODULE_PARM_DESC(eeprom_bad_csum_allow, "Allow bad eeprom checksums");
178#define DPRINTK(nlevel, klevel, fmt, args...) \ 181#define DPRINTK(nlevel, klevel, fmt, args...) \
179 (void)((NETIF_MSG_##nlevel & nic->msg_enable) && \ 182 (void)((NETIF_MSG_##nlevel & nic->msg_enable) && \
180 printk(KERN_##klevel PFX "%s: %s: " fmt, nic->netdev->name, \ 183 printk(KERN_##klevel PFX "%s: %s: " fmt, nic->netdev->name, \
@@ -756,7 +759,8 @@ static int e100_eeprom_load(struct nic *nic)
756 checksum = le16_to_cpu(0xBABA - checksum); 759 checksum = le16_to_cpu(0xBABA - checksum);
757 if(checksum != nic->eeprom[nic->eeprom_wc - 1]) { 760 if(checksum != nic->eeprom[nic->eeprom_wc - 1]) {
758 DPRINTK(PROBE, ERR, "EEPROM corrupted\n"); 761 DPRINTK(PROBE, ERR, "EEPROM corrupted\n");
759 return -EAGAIN; 762 if (!eeprom_bad_csum_allow)
763 return -EAGAIN;
760 } 764 }
761 765
762 return 0; 766 return 0;
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 0e3fdf7c6dd3..ec0413609f36 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -1566,20 +1566,21 @@ static int __exit sunlance_sun4_remove(void)
1566static int __devinit sunlance_sbus_probe(struct of_device *dev, const struct of_device_id *match) 1566static int __devinit sunlance_sbus_probe(struct of_device *dev, const struct of_device_id *match)
1567{ 1567{
1568 struct sbus_dev *sdev = to_sbus_device(&dev->dev); 1568 struct sbus_dev *sdev = to_sbus_device(&dev->dev);
1569 struct device_node *dp = dev->node;
1570 int err; 1569 int err;
1571 1570
1572 if (!strcmp(dp->name, "le")) { 1571 if (sdev->parent) {
1573 err = sparc_lance_probe_one(sdev, NULL, NULL); 1572 struct of_device *parent = &sdev->parent->ofdev;
1574 } else if (!strcmp(dp->name, "ledma")) {
1575 struct sbus_dma *ledma = find_ledma(sdev);
1576 1573
1577 err = sparc_lance_probe_one(sdev->child, ledma, NULL); 1574 if (!strcmp(parent->node->name, "ledma")) {
1578 } else { 1575 struct sbus_dma *ledma = find_ledma(to_sbus_device(&parent->dev));
1579 BUG_ON(strcmp(dp->name, "lebuffer"));
1580 1576
1581 err = sparc_lance_probe_one(sdev->child, NULL, sdev); 1577 err = sparc_lance_probe_one(sdev, ledma, NULL);
1582 } 1578 } else if (!strcmp(parent->node->name, "lebuffer")) {
1579 err = sparc_lance_probe_one(sdev, NULL, to_sbus_device(&parent->dev));
1580 } else
1581 err = sparc_lance_probe_one(sdev, NULL, NULL);
1582 } else
1583 err = sparc_lance_probe_one(sdev, NULL, NULL);
1583 1584
1584 return err; 1585 return err;
1585} 1586}
@@ -1604,12 +1605,6 @@ static struct of_device_id sunlance_sbus_match[] = {
1604 { 1605 {
1605 .name = "le", 1606 .name = "le",
1606 }, 1607 },
1607 {
1608 .name = "ledma",
1609 },
1610 {
1611 .name = "lebuffer",
1612 },
1613 {}, 1608 {},
1614}; 1609};
1615 1610
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index fd31885c6844..ccaf28e8db0a 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -467,6 +467,7 @@ static int arp_query(unsigned char *haddr, u32 paddr,
467 struct net_device *dev) 467 struct net_device *dev)
468{ 468{
469 struct neighbour *neighbor_entry; 469 struct neighbour *neighbor_entry;
470 int ret = 0;
470 471
471 neighbor_entry = neigh_lookup(&arp_tbl, &paddr, dev); 472 neighbor_entry = neigh_lookup(&arp_tbl, &paddr, dev);
472 473
@@ -474,10 +475,11 @@ static int arp_query(unsigned char *haddr, u32 paddr,
474 neighbor_entry->used = jiffies; 475 neighbor_entry->used = jiffies;
475 if (neighbor_entry->nud_state & NUD_VALID) { 476 if (neighbor_entry->nud_state & NUD_VALID) {
476 memcpy(haddr, neighbor_entry->ha, dev->addr_len); 477 memcpy(haddr, neighbor_entry->ha, dev->addr_len);
477 return 1; 478 ret = 1;
478 } 479 }
480 neigh_release(neighbor_entry);
479 } 481 }
480 return 0; 482 return ret;
481} 483}
482 484
483static void DumpData(char *msg, struct strip *strip_info, __u8 * ptr, 485static void DumpData(char *msg, struct strip *strip_info, __u8 * ptr,
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index b4970387a16f..def78a2a7c15 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -667,6 +667,7 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, quirk_vi
667DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, quirk_via_irq); 667DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, quirk_via_irq);
668DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irq); 668DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irq);
669DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_irq); 669DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_irq);
670DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235_USB_2, quirk_via_irq);
670DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_irq); 671DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_irq);
671DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_irq); 672DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_irq);
672DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irq); 673DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irq);
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index d8e9b95f0a1a..25c1ef6dfd44 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -52,7 +52,7 @@ static void dasd_setup_queue(struct dasd_device * device);
52static void dasd_free_queue(struct dasd_device * device); 52static void dasd_free_queue(struct dasd_device * device);
53static void dasd_flush_request_queue(struct dasd_device *); 53static void dasd_flush_request_queue(struct dasd_device *);
54static void dasd_int_handler(struct ccw_device *, unsigned long, struct irb *); 54static void dasd_int_handler(struct ccw_device *, unsigned long, struct irb *);
55static void dasd_flush_ccw_queue(struct dasd_device *, int); 55static int dasd_flush_ccw_queue(struct dasd_device *, int);
56static void dasd_tasklet(struct dasd_device *); 56static void dasd_tasklet(struct dasd_device *);
57static void do_kick_device(void *data); 57static void do_kick_device(void *data);
58 58
@@ -60,6 +60,7 @@ static void do_kick_device(void *data);
60 * SECTION: Operations on the device structure. 60 * SECTION: Operations on the device structure.
61 */ 61 */
62static wait_queue_head_t dasd_init_waitq; 62static wait_queue_head_t dasd_init_waitq;
63static wait_queue_head_t dasd_flush_wq;
63 64
64/* 65/*
65 * Allocate memory for a new device structure. 66 * Allocate memory for a new device structure.
@@ -121,7 +122,7 @@ dasd_free_device(struct dasd_device *device)
121/* 122/*
122 * Make a new device known to the system. 123 * Make a new device known to the system.
123 */ 124 */
124static inline int 125static int
125dasd_state_new_to_known(struct dasd_device *device) 126dasd_state_new_to_known(struct dasd_device *device)
126{ 127{
127 int rc; 128 int rc;
@@ -145,7 +146,7 @@ dasd_state_new_to_known(struct dasd_device *device)
145/* 146/*
146 * Let the system forget about a device. 147 * Let the system forget about a device.
147 */ 148 */
148static inline void 149static int
149dasd_state_known_to_new(struct dasd_device * device) 150dasd_state_known_to_new(struct dasd_device * device)
150{ 151{
151 /* Disable extended error reporting for this device. */ 152 /* Disable extended error reporting for this device. */
@@ -163,12 +164,13 @@ dasd_state_known_to_new(struct dasd_device * device)
163 164
164 /* Give up reference we took in dasd_state_new_to_known. */ 165 /* Give up reference we took in dasd_state_new_to_known. */
165 dasd_put_device(device); 166 dasd_put_device(device);
167 return 0;
166} 168}
167 169
168/* 170/*
169 * Request the irq line for the device. 171 * Request the irq line for the device.
170 */ 172 */
171static inline int 173static int
172dasd_state_known_to_basic(struct dasd_device * device) 174dasd_state_known_to_basic(struct dasd_device * device)
173{ 175{
174 int rc; 176 int rc;
@@ -192,17 +194,23 @@ dasd_state_known_to_basic(struct dasd_device * device)
192/* 194/*
193 * Release the irq line for the device. Terminate any running i/o. 195 * Release the irq line for the device. Terminate any running i/o.
194 */ 196 */
195static inline void 197static int
196dasd_state_basic_to_known(struct dasd_device * device) 198dasd_state_basic_to_known(struct dasd_device * device)
197{ 199{
200 int rc;
201
198 dasd_gendisk_free(device); 202 dasd_gendisk_free(device);
199 dasd_flush_ccw_queue(device, 1); 203 rc = dasd_flush_ccw_queue(device, 1);
204 if (rc)
205 return rc;
206
200 DBF_DEV_EVENT(DBF_EMERG, device, "%p debug area deleted", device); 207 DBF_DEV_EVENT(DBF_EMERG, device, "%p debug area deleted", device);
201 if (device->debug_area != NULL) { 208 if (device->debug_area != NULL) {
202 debug_unregister(device->debug_area); 209 debug_unregister(device->debug_area);
203 device->debug_area = NULL; 210 device->debug_area = NULL;
204 } 211 }
205 device->state = DASD_STATE_KNOWN; 212 device->state = DASD_STATE_KNOWN;
213 return 0;
206} 214}
207 215
208/* 216/*
@@ -219,7 +227,7 @@ dasd_state_basic_to_known(struct dasd_device * device)
219 * In case the analysis returns an error, the device setup is stopped 227 * In case the analysis returns an error, the device setup is stopped
220 * (a fake disk was already added to allow formatting). 228 * (a fake disk was already added to allow formatting).
221 */ 229 */
222static inline int 230static int
223dasd_state_basic_to_ready(struct dasd_device * device) 231dasd_state_basic_to_ready(struct dasd_device * device)
224{ 232{
225 int rc; 233 int rc;
@@ -247,25 +255,31 @@ dasd_state_basic_to_ready(struct dasd_device * device)
247 * Forget format information. Check if the target level is basic 255 * Forget format information. Check if the target level is basic
248 * and if it is create fake disk for formatting. 256 * and if it is create fake disk for formatting.
249 */ 257 */
250static inline void 258static int
251dasd_state_ready_to_basic(struct dasd_device * device) 259dasd_state_ready_to_basic(struct dasd_device * device)
252{ 260{
253 dasd_flush_ccw_queue(device, 0); 261 int rc;
262
263 rc = dasd_flush_ccw_queue(device, 0);
264 if (rc)
265 return rc;
254 dasd_destroy_partitions(device); 266 dasd_destroy_partitions(device);
255 dasd_flush_request_queue(device); 267 dasd_flush_request_queue(device);
256 device->blocks = 0; 268 device->blocks = 0;
257 device->bp_block = 0; 269 device->bp_block = 0;
258 device->s2b_shift = 0; 270 device->s2b_shift = 0;
259 device->state = DASD_STATE_BASIC; 271 device->state = DASD_STATE_BASIC;
272 return 0;
260} 273}
261 274
262/* 275/*
263 * Back to basic. 276 * Back to basic.
264 */ 277 */
265static inline void 278static int
266dasd_state_unfmt_to_basic(struct dasd_device * device) 279dasd_state_unfmt_to_basic(struct dasd_device * device)
267{ 280{
268 device->state = DASD_STATE_BASIC; 281 device->state = DASD_STATE_BASIC;
282 return 0;
269} 283}
270 284
271/* 285/*
@@ -273,7 +287,7 @@ dasd_state_unfmt_to_basic(struct dasd_device * device)
273 * the requeueing of requests from the linux request queue to the 287 * the requeueing of requests from the linux request queue to the
274 * ccw queue. 288 * ccw queue.
275 */ 289 */
276static inline int 290static int
277dasd_state_ready_to_online(struct dasd_device * device) 291dasd_state_ready_to_online(struct dasd_device * device)
278{ 292{
279 device->state = DASD_STATE_ONLINE; 293 device->state = DASD_STATE_ONLINE;
@@ -284,16 +298,17 @@ dasd_state_ready_to_online(struct dasd_device * device)
284/* 298/*
285 * Stop the requeueing of requests again. 299 * Stop the requeueing of requests again.
286 */ 300 */
287static inline void 301static int
288dasd_state_online_to_ready(struct dasd_device * device) 302dasd_state_online_to_ready(struct dasd_device * device)
289{ 303{
290 device->state = DASD_STATE_READY; 304 device->state = DASD_STATE_READY;
305 return 0;
291} 306}
292 307
293/* 308/*
294 * Device startup state changes. 309 * Device startup state changes.
295 */ 310 */
296static inline int 311static int
297dasd_increase_state(struct dasd_device *device) 312dasd_increase_state(struct dasd_device *device)
298{ 313{
299 int rc; 314 int rc;
@@ -329,30 +344,37 @@ dasd_increase_state(struct dasd_device *device)
329/* 344/*
330 * Device shutdown state changes. 345 * Device shutdown state changes.
331 */ 346 */
332static inline int 347static int
333dasd_decrease_state(struct dasd_device *device) 348dasd_decrease_state(struct dasd_device *device)
334{ 349{
350 int rc;
351
352 rc = 0;
335 if (device->state == DASD_STATE_ONLINE && 353 if (device->state == DASD_STATE_ONLINE &&
336 device->target <= DASD_STATE_READY) 354 device->target <= DASD_STATE_READY)
337 dasd_state_online_to_ready(device); 355 rc = dasd_state_online_to_ready(device);
338 356
339 if (device->state == DASD_STATE_READY && 357 if (!rc &&
358 device->state == DASD_STATE_READY &&
340 device->target <= DASD_STATE_BASIC) 359 device->target <= DASD_STATE_BASIC)
341 dasd_state_ready_to_basic(device); 360 rc = dasd_state_ready_to_basic(device);
342 361
343 if (device->state == DASD_STATE_UNFMT && 362 if (!rc &&
363 device->state == DASD_STATE_UNFMT &&
344 device->target <= DASD_STATE_BASIC) 364 device->target <= DASD_STATE_BASIC)
345 dasd_state_unfmt_to_basic(device); 365 rc = dasd_state_unfmt_to_basic(device);
346 366
347 if (device->state == DASD_STATE_BASIC && 367 if (!rc &&
368 device->state == DASD_STATE_BASIC &&
348 device->target <= DASD_STATE_KNOWN) 369 device->target <= DASD_STATE_KNOWN)
349 dasd_state_basic_to_known(device); 370 rc = dasd_state_basic_to_known(device);
350 371
351 if (device->state == DASD_STATE_KNOWN && 372 if (!rc &&
373 device->state == DASD_STATE_KNOWN &&
352 device->target <= DASD_STATE_NEW) 374 device->target <= DASD_STATE_NEW)
353 dasd_state_known_to_new(device); 375 rc = dasd_state_known_to_new(device);
354 376
355 return 0; 377 return rc;
356} 378}
357 379
358/* 380/*
@@ -701,6 +723,7 @@ dasd_term_IO(struct dasd_ccw_req * cqr)
701 cqr->retries--; 723 cqr->retries--;
702 cqr->status = DASD_CQR_CLEAR; 724 cqr->status = DASD_CQR_CLEAR;
703 cqr->stopclk = get_clock(); 725 cqr->stopclk = get_clock();
726 cqr->starttime = 0;
704 DBF_DEV_EVENT(DBF_DEBUG, device, 727 DBF_DEV_EVENT(DBF_DEBUG, device,
705 "terminate cqr %p successful", 728 "terminate cqr %p successful",
706 cqr); 729 cqr);
@@ -978,6 +1001,7 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
978 irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) { 1001 irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) {
979 cqr->status = DASD_CQR_QUEUED; 1002 cqr->status = DASD_CQR_QUEUED;
980 dasd_clear_timer(device); 1003 dasd_clear_timer(device);
1004 wake_up(&dasd_flush_wq);
981 dasd_schedule_bh(device); 1005 dasd_schedule_bh(device);
982 return; 1006 return;
983 } 1007 }
@@ -1241,6 +1265,10 @@ __dasd_check_expire(struct dasd_device * device)
1241 cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list); 1265 cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list);
1242 if (cqr->status == DASD_CQR_IN_IO && cqr->expires != 0) { 1266 if (cqr->status == DASD_CQR_IN_IO && cqr->expires != 0) {
1243 if (time_after_eq(jiffies, cqr->expires + cqr->starttime)) { 1267 if (time_after_eq(jiffies, cqr->expires + cqr->starttime)) {
1268 DEV_MESSAGE(KERN_ERR, device,
1269 "internal error - timeout (%is) expired "
1270 "for cqr %p (%i retries left)",
1271 (cqr->expires/HZ), cqr, cqr->retries);
1244 if (device->discipline->term_IO(cqr) != 0) 1272 if (device->discipline->term_IO(cqr) != 0)
1245 /* Hmpf, try again in 1/10 sec */ 1273 /* Hmpf, try again in 1/10 sec */
1246 dasd_set_timer(device, 10); 1274 dasd_set_timer(device, 10);
@@ -1285,46 +1313,100 @@ __dasd_start_head(struct dasd_device * device)
1285 dasd_set_timer(device, 50); 1313 dasd_set_timer(device, 50);
1286} 1314}
1287 1315
1316static inline int
1317_wait_for_clear(struct dasd_ccw_req *cqr)
1318{
1319 return (cqr->status == DASD_CQR_QUEUED);
1320}
1321
1288/* 1322/*
1289 * Remove requests from the ccw queue. 1323 * Remove all requests from the ccw queue (all = '1') or only block device
1324 * requests in case all = '0'.
1325 * Take care of the erp-chain (chained via cqr->refers) and remove either
1326 * the whole erp-chain or none of the erp-requests.
1327 * If a request is currently running, term_IO is called and the request
1328 * is re-queued. Prior to removing the terminated request we need to wait
1329 * for the clear-interrupt.
1330 * In case termination is not possible we stop processing and just finishing
1331 * the already moved requests.
1290 */ 1332 */
1291static void 1333static int
1292dasd_flush_ccw_queue(struct dasd_device * device, int all) 1334dasd_flush_ccw_queue(struct dasd_device * device, int all)
1293{ 1335{
1336 struct dasd_ccw_req *cqr, *orig, *n;
1337 int rc, i;
1338
1294 struct list_head flush_queue; 1339 struct list_head flush_queue;
1295 struct list_head *l, *n;
1296 struct dasd_ccw_req *cqr;
1297 1340
1298 INIT_LIST_HEAD(&flush_queue); 1341 INIT_LIST_HEAD(&flush_queue);
1299 spin_lock_irq(get_ccwdev_lock(device->cdev)); 1342 spin_lock_irq(get_ccwdev_lock(device->cdev));
1300 list_for_each_safe(l, n, &device->ccw_queue) { 1343 rc = 0;
1301 cqr = list_entry(l, struct dasd_ccw_req, list); 1344restart:
1345 list_for_each_entry_safe(cqr, n, &device->ccw_queue, list) {
1346 /* get original request of erp request-chain */
1347 for (orig = cqr; orig->refers != NULL; orig = orig->refers);
1348
1302 /* Flush all request or only block device requests? */ 1349 /* Flush all request or only block device requests? */
1303 if (all == 0 && cqr->callback == dasd_end_request_cb) 1350 if (all == 0 && cqr->callback != dasd_end_request_cb &&
1351 orig->callback != dasd_end_request_cb) {
1304 continue; 1352 continue;
1305 if (cqr->status == DASD_CQR_IN_IO) 1353 }
1306 device->discipline->term_IO(cqr); 1354 /* Check status and move request to flush_queue */
1307 if (cqr->status != DASD_CQR_DONE || 1355 switch (cqr->status) {
1308 cqr->status != DASD_CQR_FAILED) { 1356 case DASD_CQR_IN_IO:
1309 cqr->status = DASD_CQR_FAILED; 1357 rc = device->discipline->term_IO(cqr);
1358 if (rc) {
1359 /* unable to terminate requeust */
1360 DEV_MESSAGE(KERN_ERR, device,
1361 "dasd flush ccw_queue is unable "
1362 " to terminate request %p",
1363 cqr);
1364 /* stop flush processing */
1365 goto finished;
1366 }
1367 break;
1368 case DASD_CQR_QUEUED:
1369 case DASD_CQR_ERROR:
1370 /* set request to FAILED */
1310 cqr->stopclk = get_clock(); 1371 cqr->stopclk = get_clock();
1372 cqr->status = DASD_CQR_FAILED;
1373 break;
1374 default: /* do not touch the others */
1375 break;
1376 }
1377 /* Rechain request (including erp chain) */
1378 for (i = 0; cqr != NULL; cqr = cqr->refers, i++) {
1379 cqr->endclk = get_clock();
1380 list_move_tail(&cqr->list, &flush_queue);
1381 }
1382 if (i > 1)
1383 /* moved more than one request - need to restart */
1384 goto restart;
1385 }
1386
1387finished:
1388 spin_unlock_irq(get_ccwdev_lock(device->cdev));
1389 /* Now call the callback function of flushed requests */
1390restart_cb:
1391 list_for_each_entry_safe(cqr, n, &flush_queue, list) {
1392 if (cqr->status == DASD_CQR_CLEAR) {
1393 /* wait for clear interrupt! */
1394 wait_event(dasd_flush_wq, _wait_for_clear(cqr));
1395 cqr->status = DASD_CQR_FAILED;
1311 } 1396 }
1312 /* Process finished ERP request. */ 1397 /* Process finished ERP request. */
1313 if (cqr->refers) { 1398 if (cqr->refers) {
1314 __dasd_process_erp(device, cqr); 1399 __dasd_process_erp(device, cqr);
1315 continue; 1400 /* restart list_for_xx loop since dasd_process_erp
1401 * might remove multiple elements */
1402 goto restart_cb;
1316 } 1403 }
1317 /* Rechain request on device request queue */ 1404 /* call the callback function */
1318 cqr->endclk = get_clock(); 1405 cqr->endclk = get_clock();
1319 list_move_tail(&cqr->list, &flush_queue);
1320 }
1321 spin_unlock_irq(get_ccwdev_lock(device->cdev));
1322 /* Now call the callback function of flushed requests */
1323 list_for_each_safe(l, n, &flush_queue) {
1324 cqr = list_entry(l, struct dasd_ccw_req, list);
1325 if (cqr->callback != NULL) 1406 if (cqr->callback != NULL)
1326 (cqr->callback)(cqr, cqr->callback_data); 1407 (cqr->callback)(cqr, cqr->callback_data);
1327 } 1408 }
1409 return rc;
1328} 1410}
1329 1411
1330/* 1412/*
@@ -1510,10 +1592,8 @@ dasd_sleep_on_interruptible(struct dasd_ccw_req * cqr)
1510 if (device->discipline->term_IO) { 1592 if (device->discipline->term_IO) {
1511 cqr->retries = -1; 1593 cqr->retries = -1;
1512 device->discipline->term_IO(cqr); 1594 device->discipline->term_IO(cqr);
1513 /*nished = 1595 /* wait (non-interruptible) for final status
1514 * wait (non-interruptible) for final status 1596 * because signal ist still pending */
1515 * because signal ist still pending
1516 */
1517 spin_unlock_irq(get_ccwdev_lock(device->cdev)); 1597 spin_unlock_irq(get_ccwdev_lock(device->cdev));
1518 wait_event(wait_q, _wait_for_wakeup(cqr)); 1598 wait_event(wait_q, _wait_for_wakeup(cqr));
1519 spin_lock_irq(get_ccwdev_lock(device->cdev)); 1599 spin_lock_irq(get_ccwdev_lock(device->cdev));
@@ -1546,19 +1626,11 @@ static inline int
1546_dasd_term_running_cqr(struct dasd_device *device) 1626_dasd_term_running_cqr(struct dasd_device *device)
1547{ 1627{
1548 struct dasd_ccw_req *cqr; 1628 struct dasd_ccw_req *cqr;
1549 int rc;
1550 1629
1551 if (list_empty(&device->ccw_queue)) 1630 if (list_empty(&device->ccw_queue))
1552 return 0; 1631 return 0;
1553 cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list); 1632 cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list);
1554 rc = device->discipline->term_IO(cqr); 1633 return device->discipline->term_IO(cqr);
1555 if (rc == 0) {
1556 /* termination successful */
1557 cqr->status = DASD_CQR_QUEUED;
1558 cqr->startclk = cqr->stopclk = 0;
1559 cqr->starttime = 0;
1560 }
1561 return rc;
1562} 1634}
1563 1635
1564int 1636int
@@ -1726,10 +1798,7 @@ dasd_flush_request_queue(struct dasd_device * device)
1726 return; 1798 return;
1727 1799
1728 spin_lock_irq(&device->request_queue_lock); 1800 spin_lock_irq(&device->request_queue_lock);
1729 while (!list_empty(&device->request_queue->queue_head)) { 1801 while ((req = elv_next_request(device->request_queue))) {
1730 req = elv_next_request(device->request_queue);
1731 if (req == NULL)
1732 break;
1733 blkdev_dequeue_request(req); 1802 blkdev_dequeue_request(req);
1734 dasd_end_request(req, 0); 1803 dasd_end_request(req, 0);
1735 } 1804 }
@@ -2091,6 +2160,7 @@ dasd_init(void)
2091 int rc; 2160 int rc;
2092 2161
2093 init_waitqueue_head(&dasd_init_waitq); 2162 init_waitqueue_head(&dasd_init_waitq);
2163 init_waitqueue_head(&dasd_flush_wq);
2094 2164
2095 /* register 'common' DASD debug area, used for all DBF_XXX calls */ 2165 /* register 'common' DASD debug area, used for all DBF_XXX calls */
2096 dasd_debug_area = debug_register("dasd", 1, 2, 8 * sizeof (long)); 2166 dasd_debug_area = debug_register("dasd", 1, 2, 8 * sizeof (long));
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 4c272b70f41a..d163632101d2 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -83,10 +83,12 @@ dasd_gendisk_alloc(struct dasd_device *device)
83void 83void
84dasd_gendisk_free(struct dasd_device *device) 84dasd_gendisk_free(struct dasd_device *device)
85{ 85{
86 del_gendisk(device->gdp); 86 if (device->gdp) {
87 device->gdp->queue = NULL; 87 del_gendisk(device->gdp);
88 put_disk(device->gdp); 88 device->gdp->queue = NULL;
89 device->gdp = NULL; 89 put_disk(device->gdp);
90 device->gdp = NULL;
91 }
90} 92}
91 93
92/* 94/*
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index 3cba6c9fab11..38954f5cd14c 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -183,11 +183,9 @@ ccwgroup_create(struct device *root,
183 183
184 gdev->creator_id = creator_id; 184 gdev->creator_id = creator_id;
185 gdev->count = argc; 185 gdev->count = argc;
186 gdev->dev = (struct device ) { 186 gdev->dev.bus = &ccwgroup_bus_type;
187 .bus = &ccwgroup_bus_type, 187 gdev->dev.parent = root;
188 .parent = root, 188 gdev->dev.release = ccwgroup_release;
189 .release = ccwgroup_release,
190 };
191 189
192 snprintf (gdev->dev.bus_id, BUS_ID_SIZE, "%s", 190 snprintf (gdev->dev.bus_id, BUS_ID_SIZE, "%s",
193 gdev->cdev[0]->dev.bus_id); 191 gdev->cdev[0]->dev.bus_id);
@@ -391,10 +389,8 @@ int
391ccwgroup_driver_register (struct ccwgroup_driver *cdriver) 389ccwgroup_driver_register (struct ccwgroup_driver *cdriver)
392{ 390{
393 /* register our new driver with the core */ 391 /* register our new driver with the core */
394 cdriver->driver = (struct device_driver) { 392 cdriver->driver.bus = &ccwgroup_bus_type;
395 .bus = &ccwgroup_bus_type, 393 cdriver->driver.name = cdriver->name;
396 .name = cdriver->name,
397 };
398 394
399 return driver_register(&cdriver->driver); 395 return driver_register(&cdriver->driver);
400} 396}
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 61ce3f1d5228..c28444af0919 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -238,8 +238,6 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
238 /* Check for single path devices. */ 238 /* Check for single path devices. */
239 if (sch->schib.pmcw.pim == 0x80) 239 if (sch->schib.pmcw.pim == 0x80)
240 goto out_unreg; 240 goto out_unreg;
241 if (sch->vpm == mask)
242 goto out_unreg;
243 241
244 if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) && 242 if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
245 (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) && 243 (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
@@ -258,6 +256,8 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
258 /* trigger path verification. */ 256 /* trigger path verification. */
259 if (sch->driver && sch->driver->verify) 257 if (sch->driver && sch->driver->verify)
260 sch->driver->verify(&sch->dev); 258 sch->driver->verify(&sch->dev);
259 else if (sch->vpm == mask)
260 goto out_unreg;
261out_unlock: 261out_unlock:
262 spin_unlock_irq(&sch->lock); 262 spin_unlock_irq(&sch->lock);
263 return 0; 263 return 0;
@@ -1391,10 +1391,8 @@ new_channel_path(int chpid)
1391 /* fill in status, etc. */ 1391 /* fill in status, etc. */
1392 chp->id = chpid; 1392 chp->id = chpid;
1393 chp->state = 1; 1393 chp->state = 1;
1394 chp->dev = (struct device) { 1394 chp->dev.parent = &css[0]->device;
1395 .parent = &css[0]->device, 1395 chp->dev.release = chp_release;
1396 .release = chp_release,
1397 };
1398 snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp0.%x", chpid); 1396 snprintf(chp->dev.bus_id, BUS_ID_SIZE, "chp0.%x", chpid);
1399 1397
1400 /* Obtain channel path description and fill it in. */ 1398 /* Obtain channel path description and fill it in. */
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 585fa04233c3..646da5640401 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -556,12 +556,11 @@ get_disc_ccwdev_by_devno(unsigned int devno, unsigned int ssid,
556 struct ccw_device *sibling) 556 struct ccw_device *sibling)
557{ 557{
558 struct device *dev; 558 struct device *dev;
559 struct match_data data = { 559 struct match_data data;
560 .devno = devno,
561 .ssid = ssid,
562 .sibling = sibling,
563 };
564 560
561 data.devno = devno;
562 data.ssid = ssid;
563 data.sibling = sibling;
565 dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno); 564 dev = bus_find_device(&ccw_bus_type, NULL, &data, match_devno);
566 565
567 return dev ? to_ccwdev(dev) : NULL; 566 return dev ? to_ccwdev(dev) : NULL;
@@ -835,10 +834,8 @@ io_subchannel_probe (struct subchannel *sch)
835 return -ENOMEM; 834 return -ENOMEM;
836 } 835 }
837 atomic_set(&cdev->private->onoff, 0); 836 atomic_set(&cdev->private->onoff, 0);
838 cdev->dev = (struct device) { 837 cdev->dev.parent = &sch->dev;
839 .parent = &sch->dev, 838 cdev->dev.release = ccw_device_release;
840 .release = ccw_device_release,
841 };
842 INIT_LIST_HEAD(&cdev->private->kick_work.entry); 839 INIT_LIST_HEAD(&cdev->private->kick_work.entry);
843 /* Do first half of device_register. */ 840 /* Do first half of device_register. */
844 device_initialize(&cdev->dev); 841 device_initialize(&cdev->dev);
@@ -977,9 +974,7 @@ ccw_device_console_enable (struct ccw_device *cdev, struct subchannel *sch)
977 int rc; 974 int rc;
978 975
979 /* Initialize the ccw_device structure. */ 976 /* Initialize the ccw_device structure. */
980 cdev->dev = (struct device) { 977 cdev->dev.parent= &sch->dev;
981 .parent = &sch->dev,
982 };
983 rc = io_subchannel_recog(cdev, sch); 978 rc = io_subchannel_recog(cdev, sch);
984 if (rc) 979 if (rc)
985 return rc; 980 return rc;
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 6d91c2eb205b..35e162ba6d54 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -267,12 +267,10 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
267 notify = 1; 267 notify = 1;
268 } 268 }
269 /* fill out sense information */ 269 /* fill out sense information */
270 cdev->id = (struct ccw_device_id) { 270 cdev->id.cu_type = cdev->private->senseid.cu_type;
271 .cu_type = cdev->private->senseid.cu_type, 271 cdev->id.cu_model = cdev->private->senseid.cu_model;
272 .cu_model = cdev->private->senseid.cu_model, 272 cdev->id.dev_type = cdev->private->senseid.dev_type;
273 .dev_type = cdev->private->senseid.dev_type, 273 cdev->id.dev_model = cdev->private->senseid.dev_model;
274 .dev_model = cdev->private->senseid.dev_model,
275 };
276 if (notify) { 274 if (notify) {
277 cdev->private->state = DEV_STATE_OFFLINE; 275 cdev->private->state = DEV_STATE_OFFLINE;
278 if (same_dev) { 276 if (same_dev) {
@@ -566,12 +564,10 @@ ccw_device_verify_done(struct ccw_device *cdev, int err)
566 /* Deliver fake irb to device driver, if needed. */ 564 /* Deliver fake irb to device driver, if needed. */
567 if (cdev->private->flags.fake_irb) { 565 if (cdev->private->flags.fake_irb) {
568 memset(&cdev->private->irb, 0, sizeof(struct irb)); 566 memset(&cdev->private->irb, 0, sizeof(struct irb));
569 cdev->private->irb.scsw = (struct scsw) { 567 cdev->private->irb.scsw.cc = 1;
570 .cc = 1, 568 cdev->private->irb.scsw.fctl = SCSW_FCTL_START_FUNC;
571 .fctl = SCSW_FCTL_START_FUNC, 569 cdev->private->irb.scsw.actl = SCSW_ACTL_START_PEND;
572 .actl = SCSW_ACTL_START_PEND, 570 cdev->private->irb.scsw.stctl = SCSW_STCTL_STATUS_PEND;
573 .stctl = SCSW_STCTL_STATUS_PEND,
574 };
575 cdev->private->flags.fake_irb = 0; 571 cdev->private->flags.fake_irb = 0;
576 if (cdev->handler) 572 if (cdev->handler)
577 cdev->handler(cdev, cdev->private->intparm, 573 cdev->handler(cdev, cdev->private->intparm,
diff --git a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c
index 32610fd8868e..1693a102dcfe 100644
--- a/drivers/s390/cio/device_pgid.c
+++ b/drivers/s390/cio/device_pgid.c
@@ -24,6 +24,21 @@
24#include "ioasm.h" 24#include "ioasm.h"
25 25
26/* 26/*
27 * Helper function called from interrupt context to decide whether an
28 * operation should be tried again.
29 */
30static int __ccw_device_should_retry(struct scsw *scsw)
31{
32 /* CC is only valid if start function bit is set. */
33 if ((scsw->fctl & SCSW_FCTL_START_FUNC) && scsw->cc == 1)
34 return 1;
35 /* No more activity. For sense and set PGID we stubbornly try again. */
36 if (!scsw->actl)
37 return 1;
38 return 0;
39}
40
41/*
27 * Start Sense Path Group ID helper function. Used in ccw_device_recog 42 * Start Sense Path Group ID helper function. Used in ccw_device_recog
28 * and ccw_device_sense_pgid. 43 * and ccw_device_sense_pgid.
29 */ 44 */
@@ -155,10 +170,10 @@ ccw_device_sense_pgid_irq(struct ccw_device *cdev, enum dev_event dev_event)
155 int ret; 170 int ret;
156 171
157 irb = (struct irb *) __LC_IRB; 172 irb = (struct irb *) __LC_IRB;
158 /* Retry sense pgid for cc=1. */ 173
159 if (irb->scsw.stctl == 174 if (irb->scsw.stctl ==
160 (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) { 175 (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
161 if (irb->scsw.cc == 1) { 176 if (__ccw_device_should_retry(&irb->scsw)) {
162 ret = __ccw_device_sense_pgid_start(cdev); 177 ret = __ccw_device_sense_pgid_start(cdev);
163 if (ret && ret != -EBUSY) 178 if (ret && ret != -EBUSY)
164 ccw_device_sense_pgid_done(cdev, ret); 179 ccw_device_sense_pgid_done(cdev, ret);
@@ -391,10 +406,10 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event)
391 int ret; 406 int ret;
392 407
393 irb = (struct irb *) __LC_IRB; 408 irb = (struct irb *) __LC_IRB;
394 /* Retry set pgid for cc=1. */ 409
395 if (irb->scsw.stctl == 410 if (irb->scsw.stctl ==
396 (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) { 411 (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
397 if (irb->scsw.cc == 1) 412 if (__ccw_device_should_retry(&irb->scsw))
398 __ccw_device_verify_start(cdev); 413 __ccw_device_verify_start(cdev);
399 return; 414 return;
400 } 415 }
@@ -494,10 +509,10 @@ ccw_device_disband_irq(struct ccw_device *cdev, enum dev_event dev_event)
494 int ret; 509 int ret;
495 510
496 irb = (struct irb *) __LC_IRB; 511 irb = (struct irb *) __LC_IRB;
497 /* Retry set pgid for cc=1. */ 512
498 if (irb->scsw.stctl == 513 if (irb->scsw.stctl ==
499 (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) { 514 (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
500 if (irb->scsw.cc == 1) 515 if (__ccw_device_should_retry(&irb->scsw))
501 __ccw_device_disband_start(cdev); 516 __ccw_device_disband_start(cdev);
502 return; 517 return;
503 } 518 }
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index a1d322f8a16c..851e4839d6d9 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -458,11 +458,11 @@ static int pci_siig_setup(struct serial_private *priv,
458 * growing *huge*, we use this function to collapse some 70 entries 458 * growing *huge*, we use this function to collapse some 70 entries
459 * in the PCI table into one, for sanity's and compactness's sake. 459 * in the PCI table into one, for sanity's and compactness's sake.
460 */ 460 */
461static unsigned short timedia_single_port[] = { 461static const unsigned short timedia_single_port[] = {
462 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0 462 0x4025, 0x4027, 0x4028, 0x5025, 0x5027, 0
463}; 463};
464 464
465static unsigned short timedia_dual_port[] = { 465static const unsigned short timedia_dual_port[] = {
466 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085, 466 0x0002, 0x4036, 0x4037, 0x4038, 0x4078, 0x4079, 0x4085,
467 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079, 467 0x4088, 0x4089, 0x5037, 0x5078, 0x5079, 0x5085, 0x6079,
468 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079, 468 0x7079, 0x8079, 0x8137, 0x8138, 0x8237, 0x8238, 0x9079,
@@ -470,35 +470,34 @@ static unsigned short timedia_dual_port[] = {
470 0xD079, 0 470 0xD079, 0
471}; 471};
472 472
473static unsigned short timedia_quad_port[] = { 473static const unsigned short timedia_quad_port[] = {
474 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157, 474 0x4055, 0x4056, 0x4095, 0x4096, 0x5056, 0x8156, 0x8157,
475 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159, 475 0x8256, 0x8257, 0x9056, 0x9156, 0x9157, 0x9158, 0x9159,
476 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056, 476 0x9256, 0x9257, 0xA056, 0xA157, 0xA158, 0xA159, 0xB056,
477 0xB157, 0 477 0xB157, 0
478}; 478};
479 479
480static unsigned short timedia_eight_port[] = { 480static const unsigned short timedia_eight_port[] = {
481 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166, 481 0x4065, 0x4066, 0x5065, 0x5066, 0x8166, 0x9066, 0x9166,
482 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0 482 0x9167, 0x9168, 0xA066, 0xA167, 0xA168, 0
483}; 483};
484 484
485static const struct timedia_struct { 485static const struct timedia_struct {
486 int num; 486 int num;
487 unsigned short *ids; 487 const unsigned short *ids;
488} timedia_data[] = { 488} timedia_data[] = {
489 { 1, timedia_single_port }, 489 { 1, timedia_single_port },
490 { 2, timedia_dual_port }, 490 { 2, timedia_dual_port },
491 { 4, timedia_quad_port }, 491 { 4, timedia_quad_port },
492 { 8, timedia_eight_port }, 492 { 8, timedia_eight_port }
493 { 0, NULL }
494}; 493};
495 494
496static int pci_timedia_init(struct pci_dev *dev) 495static int pci_timedia_init(struct pci_dev *dev)
497{ 496{
498 unsigned short *ids; 497 const unsigned short *ids;
499 int i, j; 498 int i, j;
500 499
501 for (i = 0; timedia_data[i].num; i++) { 500 for (i = 0; i < ARRAY_SIZE(timedia_data); i++) {
502 ids = timedia_data[i].ids; 501 ids = timedia_data[i].ids;
503 for (j = 0; ids[j]; j++) 502 for (j = 0; ids[j]; j++)
504 if (dev->subsystem_device == ids[j]) 503 if (dev->subsystem_device == ids[j])
@@ -936,6 +935,7 @@ enum pci_board_num_t {
936 pbn_b1_8_1382400, 935 pbn_b1_8_1382400,
937 936
938 pbn_b2_1_115200, 937 pbn_b2_1_115200,
938 pbn_b2_2_115200,
939 pbn_b2_8_115200, 939 pbn_b2_8_115200,
940 940
941 pbn_b2_1_460800, 941 pbn_b2_1_460800,
@@ -1243,6 +1243,12 @@ static struct pciserial_board pci_boards[] __devinitdata = {
1243 .base_baud = 115200, 1243 .base_baud = 115200,
1244 .uart_offset = 8, 1244 .uart_offset = 8,
1245 }, 1245 },
1246 [pbn_b2_2_115200] = {
1247 .flags = FL_BASE2,
1248 .num_ports = 2,
1249 .base_baud = 115200,
1250 .uart_offset = 8,
1251 },
1246 [pbn_b2_8_115200] = { 1252 [pbn_b2_8_115200] = {
1247 .flags = FL_BASE2, 1253 .flags = FL_BASE2,
1248 .num_ports = 8, 1254 .num_ports = 8,
@@ -2340,6 +2346,13 @@ static struct pci_device_id serial_pci_tbl[] = {
2340 pbn_b0_1_115200 }, 2346 pbn_b0_1_115200 },
2341 2347
2342 /* 2348 /*
2349 * IntaShield IS-200
2350 */
2351 { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200,
2352 PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0811 */
2353 pbn_b2_2_115200 },
2354
2355 /*
2343 * These entries match devices with class COMMUNICATION_SERIAL, 2356 * These entries match devices with class COMMUNICATION_SERIAL,
2344 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL 2357 * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL
2345 */ 2358 */
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 80ef7d482756..372e47f7d596 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -2377,6 +2377,9 @@ int uart_match_port(struct uart_port *port1, struct uart_port *port2)
2377 return (port1->iobase == port2->iobase) && 2377 return (port1->iobase == port2->iobase) &&
2378 (port1->hub6 == port2->hub6); 2378 (port1->hub6 == port2->hub6);
2379 case UPIO_MEM: 2379 case UPIO_MEM:
2380 case UPIO_MEM32:
2381 case UPIO_AU:
2382 case UPIO_TSI:
2380 return (port1->mapbase == port2->mapbase); 2383 return (port1->mapbase == port2->mapbase);
2381 } 2384 }
2382 return 0; 2385 return 0;
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 4fe1bec1c255..30299c620d97 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -117,6 +117,8 @@ struct eth_dev {
117 struct usb_ep *in_ep, *out_ep, *status_ep; 117 struct usb_ep *in_ep, *out_ep, *status_ep;
118 const struct usb_endpoint_descriptor 118 const struct usb_endpoint_descriptor
119 *in, *out, *status; 119 *in, *out, *status;
120
121 spinlock_t req_lock;
120 struct list_head tx_reqs, rx_reqs; 122 struct list_head tx_reqs, rx_reqs;
121 123
122 struct net_device *net; 124 struct net_device *net;
@@ -1066,21 +1068,31 @@ static void eth_reset_config (struct eth_dev *dev)
1066 */ 1068 */
1067 if (dev->in) { 1069 if (dev->in) {
1068 usb_ep_disable (dev->in_ep); 1070 usb_ep_disable (dev->in_ep);
1071 spin_lock(&dev->req_lock);
1069 while (likely (!list_empty (&dev->tx_reqs))) { 1072 while (likely (!list_empty (&dev->tx_reqs))) {
1070 req = container_of (dev->tx_reqs.next, 1073 req = container_of (dev->tx_reqs.next,
1071 struct usb_request, list); 1074 struct usb_request, list);
1072 list_del (&req->list); 1075 list_del (&req->list);
1076
1077 spin_unlock(&dev->req_lock);
1073 usb_ep_free_request (dev->in_ep, req); 1078 usb_ep_free_request (dev->in_ep, req);
1079 spin_lock(&dev->req_lock);
1074 } 1080 }
1081 spin_unlock(&dev->req_lock);
1075 } 1082 }
1076 if (dev->out) { 1083 if (dev->out) {
1077 usb_ep_disable (dev->out_ep); 1084 usb_ep_disable (dev->out_ep);
1085 spin_lock(&dev->req_lock);
1078 while (likely (!list_empty (&dev->rx_reqs))) { 1086 while (likely (!list_empty (&dev->rx_reqs))) {
1079 req = container_of (dev->rx_reqs.next, 1087 req = container_of (dev->rx_reqs.next,
1080 struct usb_request, list); 1088 struct usb_request, list);
1081 list_del (&req->list); 1089 list_del (&req->list);
1090
1091 spin_unlock(&dev->req_lock);
1082 usb_ep_free_request (dev->out_ep, req); 1092 usb_ep_free_request (dev->out_ep, req);
1093 spin_lock(&dev->req_lock);
1083 } 1094 }
1095 spin_unlock(&dev->req_lock);
1084 } 1096 }
1085 1097
1086 if (dev->status) { 1098 if (dev->status) {
@@ -1659,9 +1671,9 @@ enomem:
1659 if (retval) { 1671 if (retval) {
1660 DEBUG (dev, "rx submit --> %d\n", retval); 1672 DEBUG (dev, "rx submit --> %d\n", retval);
1661 dev_kfree_skb_any (skb); 1673 dev_kfree_skb_any (skb);
1662 spin_lock (&dev->lock); 1674 spin_lock(&dev->req_lock);
1663 list_add (&req->list, &dev->rx_reqs); 1675 list_add (&req->list, &dev->rx_reqs);
1664 spin_unlock (&dev->lock); 1676 spin_unlock(&dev->req_lock);
1665 } 1677 }
1666 return retval; 1678 return retval;
1667} 1679}
@@ -1730,8 +1742,9 @@ quiesce:
1730 dev_kfree_skb_any (skb); 1742 dev_kfree_skb_any (skb);
1731 if (!netif_running (dev->net)) { 1743 if (!netif_running (dev->net)) {
1732clean: 1744clean:
1733 /* nobody reading rx_reqs, so no dev->lock */ 1745 spin_lock(&dev->req_lock);
1734 list_add (&req->list, &dev->rx_reqs); 1746 list_add (&req->list, &dev->rx_reqs);
1747 spin_unlock(&dev->req_lock);
1735 req = NULL; 1748 req = NULL;
1736 } 1749 }
1737 if (req) 1750 if (req)
@@ -1782,15 +1795,18 @@ static int alloc_requests (struct eth_dev *dev, unsigned n, gfp_t gfp_flags)
1782{ 1795{
1783 int status; 1796 int status;
1784 1797
1798 spin_lock(&dev->req_lock);
1785 status = prealloc (&dev->tx_reqs, dev->in_ep, n, gfp_flags); 1799 status = prealloc (&dev->tx_reqs, dev->in_ep, n, gfp_flags);
1786 if (status < 0) 1800 if (status < 0)
1787 goto fail; 1801 goto fail;
1788 status = prealloc (&dev->rx_reqs, dev->out_ep, n, gfp_flags); 1802 status = prealloc (&dev->rx_reqs, dev->out_ep, n, gfp_flags);
1789 if (status < 0) 1803 if (status < 0)
1790 goto fail; 1804 goto fail;
1791 return 0; 1805 goto done;
1792fail: 1806fail:
1793 DEBUG (dev, "can't alloc requests\n"); 1807 DEBUG (dev, "can't alloc requests\n");
1808done:
1809 spin_unlock(&dev->req_lock);
1794 return status; 1810 return status;
1795} 1811}
1796 1812
@@ -1800,21 +1816,21 @@ static void rx_fill (struct eth_dev *dev, gfp_t gfp_flags)
1800 unsigned long flags; 1816 unsigned long flags;
1801 1817
1802 /* fill unused rxq slots with some skb */ 1818 /* fill unused rxq slots with some skb */
1803 spin_lock_irqsave (&dev->lock, flags); 1819 spin_lock_irqsave(&dev->req_lock, flags);
1804 while (!list_empty (&dev->rx_reqs)) { 1820 while (!list_empty (&dev->rx_reqs)) {
1805 req = container_of (dev->rx_reqs.next, 1821 req = container_of (dev->rx_reqs.next,
1806 struct usb_request, list); 1822 struct usb_request, list);
1807 list_del_init (&req->list); 1823 list_del_init (&req->list);
1808 spin_unlock_irqrestore (&dev->lock, flags); 1824 spin_unlock_irqrestore(&dev->req_lock, flags);
1809 1825
1810 if (rx_submit (dev, req, gfp_flags) < 0) { 1826 if (rx_submit (dev, req, gfp_flags) < 0) {
1811 defer_kevent (dev, WORK_RX_MEMORY); 1827 defer_kevent (dev, WORK_RX_MEMORY);
1812 return; 1828 return;
1813 } 1829 }
1814 1830
1815 spin_lock_irqsave (&dev->lock, flags); 1831 spin_lock_irqsave(&dev->req_lock, flags);
1816 } 1832 }
1817 spin_unlock_irqrestore (&dev->lock, flags); 1833 spin_unlock_irqrestore(&dev->req_lock, flags);
1818} 1834}
1819 1835
1820static void eth_work (void *_dev) 1836static void eth_work (void *_dev)
@@ -1848,9 +1864,9 @@ static void tx_complete (struct usb_ep *ep, struct usb_request *req)
1848 } 1864 }
1849 dev->stats.tx_packets++; 1865 dev->stats.tx_packets++;
1850 1866
1851 spin_lock (&dev->lock); 1867 spin_lock(&dev->req_lock);
1852 list_add (&req->list, &dev->tx_reqs); 1868 list_add (&req->list, &dev->tx_reqs);
1853 spin_unlock (&dev->lock); 1869 spin_unlock(&dev->req_lock);
1854 dev_kfree_skb_any (skb); 1870 dev_kfree_skb_any (skb);
1855 1871
1856 atomic_dec (&dev->tx_qlen); 1872 atomic_dec (&dev->tx_qlen);
@@ -1896,12 +1912,12 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
1896 /* ignores USB_CDC_PACKET_TYPE_DIRECTED */ 1912 /* ignores USB_CDC_PACKET_TYPE_DIRECTED */
1897 } 1913 }
1898 1914
1899 spin_lock_irqsave (&dev->lock, flags); 1915 spin_lock_irqsave(&dev->req_lock, flags);
1900 req = container_of (dev->tx_reqs.next, struct usb_request, list); 1916 req = container_of (dev->tx_reqs.next, struct usb_request, list);
1901 list_del (&req->list); 1917 list_del (&req->list);
1902 if (list_empty (&dev->tx_reqs)) 1918 if (list_empty (&dev->tx_reqs))
1903 netif_stop_queue (net); 1919 netif_stop_queue (net);
1904 spin_unlock_irqrestore (&dev->lock, flags); 1920 spin_unlock_irqrestore(&dev->req_lock, flags);
1905 1921
1906 /* no buffer copies needed, unless the network stack did it 1922 /* no buffer copies needed, unless the network stack did it
1907 * or the hardware can't use skb buffers. 1923 * or the hardware can't use skb buffers.
@@ -1955,11 +1971,11 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
1955drop: 1971drop:
1956 dev->stats.tx_dropped++; 1972 dev->stats.tx_dropped++;
1957 dev_kfree_skb_any (skb); 1973 dev_kfree_skb_any (skb);
1958 spin_lock_irqsave (&dev->lock, flags); 1974 spin_lock_irqsave(&dev->req_lock, flags);
1959 if (list_empty (&dev->tx_reqs)) 1975 if (list_empty (&dev->tx_reqs))
1960 netif_start_queue (net); 1976 netif_start_queue (net);
1961 list_add (&req->list, &dev->tx_reqs); 1977 list_add (&req->list, &dev->tx_reqs);
1962 spin_unlock_irqrestore (&dev->lock, flags); 1978 spin_unlock_irqrestore(&dev->req_lock, flags);
1963 } 1979 }
1964 return 0; 1980 return 0;
1965} 1981}
@@ -2378,6 +2394,7 @@ autoconf_fail:
2378 return status; 2394 return status;
2379 dev = netdev_priv(net); 2395 dev = netdev_priv(net);
2380 spin_lock_init (&dev->lock); 2396 spin_lock_init (&dev->lock);
2397 spin_lock_init (&dev->req_lock);
2381 INIT_WORK (&dev->work, eth_work, dev); 2398 INIT_WORK (&dev->work, eth_work, dev);
2382 INIT_LIST_HEAD (&dev->tx_reqs); 2399 INIT_LIST_HEAD (&dev->tx_reqs);
2383 INIT_LIST_HEAD (&dev->rx_reqs); 2400 INIT_LIST_HEAD (&dev->rx_reqs);
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index 66c3f61bc9d1..431e8f31f1a9 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -372,7 +372,7 @@ static void uhci_fixup_toggles(struct uhci_qh *qh, int skip_first)
372 * need to change any toggles in this URB */ 372 * need to change any toggles in this URB */
373 td = list_entry(urbp->td_list.next, struct uhci_td, list); 373 td = list_entry(urbp->td_list.next, struct uhci_td, list);
374 if (toggle > 1 || uhci_toggle(td_token(td)) == toggle) { 374 if (toggle > 1 || uhci_toggle(td_token(td)) == toggle) {
375 td = list_entry(urbp->td_list.next, struct uhci_td, 375 td = list_entry(urbp->td_list.prev, struct uhci_td,
376 list); 376 list);
377 toggle = uhci_toggle(td_token(td)) ^ 1; 377 toggle = uhci_toggle(td_token(td)) ^ 1;
378 378
@@ -1348,7 +1348,7 @@ static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh,
1348 } 1348 }
1349 1349
1350 uhci_giveback_urb(uhci, qh, urb, regs); 1350 uhci_giveback_urb(uhci, qh, urb, regs);
1351 if (status < 0) 1351 if (status < 0 && qh->type != USB_ENDPOINT_XFER_ISOC)
1352 break; 1352 break;
1353 } 1353 }
1354 1354
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 8ea9c915fbf9..acb24c6219d9 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -1411,17 +1411,54 @@ void hid_init_reports(struct hid_device *hid)
1411 warn("timeout initializing reports"); 1411 warn("timeout initializing reports");
1412} 1412}
1413 1413
1414#define USB_VENDOR_ID_GTCO 0x078c
1415#define USB_DEVICE_ID_GTCO_90 0x0090
1416#define USB_DEVICE_ID_GTCO_100 0x0100
1417#define USB_DEVICE_ID_GTCO_101 0x0101
1418#define USB_DEVICE_ID_GTCO_103 0x0103
1419#define USB_DEVICE_ID_GTCO_104 0x0104
1420#define USB_DEVICE_ID_GTCO_105 0x0105
1421#define USB_DEVICE_ID_GTCO_106 0x0106
1422#define USB_DEVICE_ID_GTCO_107 0x0107
1423#define USB_DEVICE_ID_GTCO_108 0x0108
1424#define USB_DEVICE_ID_GTCO_200 0x0200
1425#define USB_DEVICE_ID_GTCO_201 0x0201
1426#define USB_DEVICE_ID_GTCO_202 0x0202
1427#define USB_DEVICE_ID_GTCO_203 0x0203
1428#define USB_DEVICE_ID_GTCO_204 0x0204
1429#define USB_DEVICE_ID_GTCO_205 0x0205
1430#define USB_DEVICE_ID_GTCO_206 0x0206
1431#define USB_DEVICE_ID_GTCO_207 0x0207
1432#define USB_DEVICE_ID_GTCO_300 0x0300
1433#define USB_DEVICE_ID_GTCO_301 0x0301
1434#define USB_DEVICE_ID_GTCO_302 0x0302
1435#define USB_DEVICE_ID_GTCO_303 0x0303
1436#define USB_DEVICE_ID_GTCO_304 0x0304
1437#define USB_DEVICE_ID_GTCO_305 0x0305
1438#define USB_DEVICE_ID_GTCO_306 0x0306
1439#define USB_DEVICE_ID_GTCO_307 0x0307
1440#define USB_DEVICE_ID_GTCO_308 0x0308
1441#define USB_DEVICE_ID_GTCO_309 0x0309
1442#define USB_DEVICE_ID_GTCO_400 0x0400
1443#define USB_DEVICE_ID_GTCO_401 0x0401
1444#define USB_DEVICE_ID_GTCO_402 0x0402
1445#define USB_DEVICE_ID_GTCO_403 0x0403
1446#define USB_DEVICE_ID_GTCO_404 0x0404
1447#define USB_DEVICE_ID_GTCO_404 0x0405
1448#define USB_DEVICE_ID_GTCO_500 0x0500
1449#define USB_DEVICE_ID_GTCO_501 0x0501
1450#define USB_DEVICE_ID_GTCO_502 0x0502
1451#define USB_DEVICE_ID_GTCO_503 0x0503
1452#define USB_DEVICE_ID_GTCO_504 0x0504
1453#define USB_DEVICE_ID_GTCO_1000 0x1000
1454#define USB_DEVICE_ID_GTCO_1001 0x1001
1455#define USB_DEVICE_ID_GTCO_1002 0x1002
1456#define USB_DEVICE_ID_GTCO_1003 0x1003
1457#define USB_DEVICE_ID_GTCO_1004 0x1004
1458#define USB_DEVICE_ID_GTCO_1005 0x1005
1459#define USB_DEVICE_ID_GTCO_1006 0x1006
1460
1414#define USB_VENDOR_ID_WACOM 0x056a 1461#define USB_VENDOR_ID_WACOM 0x056a
1415#define USB_DEVICE_ID_WACOM_PENPARTNER 0x0000
1416#define USB_DEVICE_ID_WACOM_GRAPHIRE 0x0010
1417#define USB_DEVICE_ID_WACOM_INTUOS 0x0020
1418#define USB_DEVICE_ID_WACOM_PL 0x0030
1419#define USB_DEVICE_ID_WACOM_INTUOS2 0x0040
1420#define USB_DEVICE_ID_WACOM_VOLITO 0x0060
1421#define USB_DEVICE_ID_WACOM_PTU 0x0003
1422#define USB_DEVICE_ID_WACOM_INTUOS3 0x00B0
1423#define USB_DEVICE_ID_WACOM_CINTIQ 0x003F
1424#define USB_DEVICE_ID_WACOM_DTF 0x00C0
1425 1462
1426#define USB_VENDOR_ID_ACECAD 0x0460 1463#define USB_VENDOR_ID_ACECAD 0x0460
1427#define USB_DEVICE_ID_ACECAD_FLAIR 0x0004 1464#define USB_DEVICE_ID_ACECAD_FLAIR 0x0004
@@ -1588,6 +1625,51 @@ static const struct hid_blacklist {
1588 { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_8_IF_KIT, HID_QUIRK_IGNORE }, 1625 { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_8_IF_KIT, HID_QUIRK_IGNORE },
1589 { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE }, 1626 { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE },
1590 { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE }, 1627 { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE },
1628 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_90, HID_QUIRK_IGNORE },
1629 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_100, HID_QUIRK_IGNORE },
1630 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_101, HID_QUIRK_IGNORE },
1631 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_103, HID_QUIRK_IGNORE },
1632 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_104, HID_QUIRK_IGNORE },
1633 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_105, HID_QUIRK_IGNORE },
1634 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_106, HID_QUIRK_IGNORE },
1635 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_107, HID_QUIRK_IGNORE },
1636 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_108, HID_QUIRK_IGNORE },
1637 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_200, HID_QUIRK_IGNORE },
1638 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_201, HID_QUIRK_IGNORE },
1639 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_202, HID_QUIRK_IGNORE },
1640 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_203, HID_QUIRK_IGNORE },
1641 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_204, HID_QUIRK_IGNORE },
1642 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_205, HID_QUIRK_IGNORE },
1643 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_206, HID_QUIRK_IGNORE },
1644 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_207, HID_QUIRK_IGNORE },
1645 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_300, HID_QUIRK_IGNORE },
1646 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_301, HID_QUIRK_IGNORE },
1647 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_302, HID_QUIRK_IGNORE },
1648 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_303, HID_QUIRK_IGNORE },
1649 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_304, HID_QUIRK_IGNORE },
1650 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_305, HID_QUIRK_IGNORE },
1651 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_306, HID_QUIRK_IGNORE },
1652 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_307, HID_QUIRK_IGNORE },
1653 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_308, HID_QUIRK_IGNORE },
1654 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_309, HID_QUIRK_IGNORE },
1655 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_400, HID_QUIRK_IGNORE },
1656 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_401, HID_QUIRK_IGNORE },
1657 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_402, HID_QUIRK_IGNORE },
1658 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_403, HID_QUIRK_IGNORE },
1659 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_404, HID_QUIRK_IGNORE },
1660 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_404, HID_QUIRK_IGNORE },
1661 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_500, HID_QUIRK_IGNORE },
1662 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_501, HID_QUIRK_IGNORE },
1663 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_502, HID_QUIRK_IGNORE },
1664 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_503, HID_QUIRK_IGNORE },
1665 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_504, HID_QUIRK_IGNORE },
1666 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1000, HID_QUIRK_IGNORE },
1667 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1001, HID_QUIRK_IGNORE },
1668 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1002, HID_QUIRK_IGNORE },
1669 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1003, HID_QUIRK_IGNORE },
1670 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE },
1671 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE },
1672 { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE },
1591 { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE }, 1673 { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE },
1592 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE }, 1674 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE },
1593 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE }, 1675 { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE },
@@ -1617,49 +1699,6 @@ static const struct hid_blacklist {
1617 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP, HID_QUIRK_IGNORE }, 1699 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP, HID_QUIRK_IGNORE },
1618 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP, HID_QUIRK_IGNORE }, 1700 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP, HID_QUIRK_IGNORE },
1619 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS, HID_QUIRK_IGNORE }, 1701 { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS, HID_QUIRK_IGNORE },
1620 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PENPARTNER, HID_QUIRK_IGNORE },
1621 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE, HID_QUIRK_IGNORE },
1622 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 1, HID_QUIRK_IGNORE },
1623 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 2, HID_QUIRK_IGNORE },
1624 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 3, HID_QUIRK_IGNORE },
1625 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 4, HID_QUIRK_IGNORE },
1626 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS, HID_QUIRK_IGNORE },
1627 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 1, HID_QUIRK_IGNORE },
1628 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 2, HID_QUIRK_IGNORE },
1629 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 3, HID_QUIRK_IGNORE },
1630 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS + 4, HID_QUIRK_IGNORE },
1631 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL, HID_QUIRK_IGNORE },
1632 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 1, HID_QUIRK_IGNORE },
1633 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 2, HID_QUIRK_IGNORE },
1634 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 3, HID_QUIRK_IGNORE },
1635 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 4, HID_QUIRK_IGNORE },
1636 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 5, HID_QUIRK_IGNORE },
1637 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 7, HID_QUIRK_IGNORE },
1638 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 8, HID_QUIRK_IGNORE },
1639 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PL + 9, HID_QUIRK_IGNORE },
1640 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 1, HID_QUIRK_IGNORE },
1641 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 2, HID_QUIRK_IGNORE },
1642 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 3, HID_QUIRK_IGNORE },
1643 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 4, HID_QUIRK_IGNORE },
1644 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 5, HID_QUIRK_IGNORE },
1645 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 7, HID_QUIRK_IGNORE },
1646 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO, HID_QUIRK_IGNORE },
1647 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO + 1, HID_QUIRK_IGNORE },
1648 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO + 2, HID_QUIRK_IGNORE },
1649 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO + 3, HID_QUIRK_IGNORE },
1650 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO + 4, HID_QUIRK_IGNORE },
1651 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 5, HID_QUIRK_IGNORE },
1652 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE + 6, HID_QUIRK_IGNORE },
1653 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PTU, HID_QUIRK_IGNORE },
1654 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3, HID_QUIRK_IGNORE },
1655 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 1, HID_QUIRK_IGNORE },
1656 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 2, HID_QUIRK_IGNORE },
1657 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 3, HID_QUIRK_IGNORE },
1658 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 4, HID_QUIRK_IGNORE },
1659 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS3 + 5, HID_QUIRK_IGNORE },
1660 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_CINTIQ, HID_QUIRK_IGNORE },
1661 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_DTF, HID_QUIRK_IGNORE },
1662 { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_DTF + 3, HID_QUIRK_IGNORE },
1663 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, 1702 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
1664 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, 1703 { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
1665 { USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K, HID_QUIRK_IGNORE }, 1704 { USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K, HID_QUIRK_IGNORE },
@@ -1778,6 +1817,10 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
1778 char *rdesc; 1817 char *rdesc;
1779 int n, len, insize = 0; 1818 int n, len, insize = 0;
1780 1819
1820 /* Ignore all Wacom devices */
1821 if (dev->descriptor.idVendor == USB_VENDOR_ID_WACOM)
1822 return NULL;
1823
1781 for (n = 0; hid_blacklist[n].idVendor; n++) 1824 for (n = 0; hid_blacklist[n].idVendor; n++)
1782 if ((hid_blacklist[n].idVendor == le16_to_cpu(dev->descriptor.idVendor)) && 1825 if ((hid_blacklist[n].idVendor == le16_to_cpu(dev->descriptor.idVendor)) &&
1783 (hid_blacklist[n].idProduct == le16_to_cpu(dev->descriptor.idProduct))) 1826 (hid_blacklist[n].idProduct == le16_to_cpu(dev->descriptor.idProduct)))
diff --git a/drivers/usb/net/pegasus.h b/drivers/usb/net/pegasus.h
index a54752ce1493..006438069b66 100644
--- a/drivers/usb/net/pegasus.h
+++ b/drivers/usb/net/pegasus.h
@@ -131,6 +131,7 @@ struct usb_eth_dev {
131#define VENDOR_COREGA 0x07aa 131#define VENDOR_COREGA 0x07aa
132#define VENDOR_DLINK 0x2001 132#define VENDOR_DLINK 0x2001
133#define VENDOR_ELCON 0x0db7 133#define VENDOR_ELCON 0x0db7
134#define VENDOR_ELECOM 0x056e
134#define VENDOR_ELSA 0x05cc 135#define VENDOR_ELSA 0x05cc
135#define VENDOR_GIGABYTE 0x1044 136#define VENDOR_GIGABYTE 0x1044
136#define VENDOR_HAWKING 0x0e66 137#define VENDOR_HAWKING 0x0e66
@@ -233,6 +234,8 @@ PEGASUS_DEV( "D-Link DSB-650", VENDOR_DLINK, 0xabc1,
233 DEFAULT_GPIO_RESET ) 234 DEFAULT_GPIO_RESET )
234PEGASUS_DEV( "GOLDPFEIL USB Adapter", VENDOR_ELCON, 0x0002, 235PEGASUS_DEV( "GOLDPFEIL USB Adapter", VENDOR_ELCON, 0x0002,
235 DEFAULT_GPIO_RESET | PEGASUS_II | HAS_HOME_PNA ) 236 DEFAULT_GPIO_RESET | PEGASUS_II | HAS_HOME_PNA )
237PEGASUS_DEV( "ELECOM USB Ethernet LD-USB20", VENDOR_ELECOM, 0x4010,
238 DEFAULT_GPIO_RESET | PEGASUS_II )
236PEGASUS_DEV( "EasiDock Ethernet", VENDOR_MOBILITY, 0x0304, 239PEGASUS_DEV( "EasiDock Ethernet", VENDOR_MOBILITY, 0x0304,
237 DEFAULT_GPIO_RESET ) 240 DEFAULT_GPIO_RESET )
238PEGASUS_DEV( "Elsa Micolink USB2Ethernet", VENDOR_ELSA, 0x3000, 241PEGASUS_DEV( "Elsa Micolink USB2Ethernet", VENDOR_ELSA, 0x3000,
diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c
index bd09232ce13c..a72685b96061 100644
--- a/drivers/usb/net/rtl8150.c
+++ b/drivers/usb/net/rtl8150.c
@@ -972,6 +972,7 @@ static void rtl8150_disconnect(struct usb_interface *intf)
972 if (dev) { 972 if (dev) {
973 set_bit(RTL8150_UNPLUG, &dev->flags); 973 set_bit(RTL8150_UNPLUG, &dev->flags);
974 tasklet_disable(&dev->tl); 974 tasklet_disable(&dev->tl);
975 tasklet_kill(&dev->tl);
975 unregister_netdev(dev->netdev); 976 unregister_netdev(dev->netdev);
976 unlink_all_urbs(dev); 977 unlink_all_urbs(dev);
977 free_all_urbs(dev); 978 free_all_urbs(dev);
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 4a803d69fa36..b130e170b4a8 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -241,16 +241,6 @@ UNUSUAL_DEV( 0x0482, 0x0103, 0x0100, 0x0100,
241 "Finecam S5", 241 "Finecam S5",
242 US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY), 242 US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY),
243 243
244/* Patch for Kyocera Finecam L3
245 * Submitted by Michael Krauth <michael.krauth@web.de>
246 * and Alessandro Fracchetti <al.fracchetti@tin.it>
247 */
248UNUSUAL_DEV( 0x0482, 0x0105, 0x0100, 0x0100,
249 "Kyocera",
250 "Finecam L3",
251 US_SC_SCSI, US_PR_BULK, NULL,
252 US_FL_FIX_INQUIRY),
253
254/* Reported by Paul Stewart <stewart@wetlogic.net> 244/* Reported by Paul Stewart <stewart@wetlogic.net>
255 * This entry is needed because the device reports Sub=ff */ 245 * This entry is needed because the device reports Sub=ff */
256UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001, 246UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001,
@@ -599,6 +589,13 @@ UNUSUAL_DEV( 0x054c, 0x0099, 0x0000, 0x9999,
599 US_SC_DEVICE, US_PR_DEVICE, NULL, 589 US_SC_DEVICE, US_PR_DEVICE, NULL,
600 US_FL_FIX_INQUIRY ), 590 US_FL_FIX_INQUIRY ),
601 591
592/* floppy reports multiple luns */
593UNUSUAL_DEV( 0x055d, 0x2020, 0x0000, 0x0210,
594 "SAMSUNG",
595 "SFD-321U [FW 0C]",
596 US_SC_DEVICE, US_PR_DEVICE, NULL,
597 US_FL_SINGLE_LUN ),
598
602 599
603UNUSUAL_DEV( 0x057b, 0x0000, 0x0000, 0x0299, 600UNUSUAL_DEV( 0x057b, 0x0000, 0x0000, 0x0299,
604 "Y-E Data", 601 "Y-E Data",
@@ -1257,6 +1254,13 @@ UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000,
1257 US_SC_DEVICE, US_PR_DEVICE, NULL, 1254 US_SC_DEVICE, US_PR_DEVICE, NULL,
1258 US_FL_NO_WP_DETECT ), 1255 US_FL_NO_WP_DETECT ),
1259 1256
1257/* Reported by Emmanuel Vasilakis <evas@forthnet.gr> */
1258UNUSUAL_DEV( 0x0fce, 0xe031, 0x0000, 0x0000,
1259 "Sony Ericsson",
1260 "M600i",
1261 US_SC_DEVICE, US_PR_DEVICE, NULL,
1262 US_FL_FIX_CAPACITY ),
1263
1260/* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu> 1264/* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu>
1261 * Tested on hardware version 1.10. 1265 * Tested on hardware version 1.10.
1262 * Entry is needed only for the initializer function override. 1266 * Entry is needed only for the initializer function override.
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 3e827e04a2aa..276a21530b95 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1801,10 +1801,14 @@ static struct backlight_properties aty128_bl_data = {
1801static void aty128_bl_set_power(struct fb_info *info, int power) 1801static void aty128_bl_set_power(struct fb_info *info, int power)
1802{ 1802{
1803 mutex_lock(&info->bl_mutex); 1803 mutex_lock(&info->bl_mutex);
1804 up(&info->bl_dev->sem); 1804
1805 info->bl_dev->props->power = power; 1805 if (info->bl_dev) {
1806 __aty128_bl_update_status(info->bl_dev); 1806 down(&info->bl_dev->sem);
1807 down(&info->bl_dev->sem); 1807 info->bl_dev->props->power = power;
1808 __aty128_bl_update_status(info->bl_dev);
1809 up(&info->bl_dev->sem);
1810 }
1811
1808 mutex_unlock(&info->bl_mutex); 1812 mutex_unlock(&info->bl_mutex);
1809} 1813}
1810 1814
@@ -1828,7 +1832,7 @@ static void aty128_bl_init(struct aty128fb_par *par)
1828 bd = backlight_device_register(name, par, &aty128_bl_data); 1832 bd = backlight_device_register(name, par, &aty128_bl_data);
1829 if (IS_ERR(bd)) { 1833 if (IS_ERR(bd)) {
1830 info->bl_dev = NULL; 1834 info->bl_dev = NULL;
1831 printk("aty128: Backlight registration failed\n"); 1835 printk(KERN_WARNING "aty128: Backlight registration failed\n");
1832 goto error; 1836 goto error;
1833 } 1837 }
1834 1838
@@ -1839,11 +1843,11 @@ static void aty128_bl_init(struct aty128fb_par *par)
1839 219 * FB_BACKLIGHT_MAX / MAX_LEVEL); 1843 219 * FB_BACKLIGHT_MAX / MAX_LEVEL);
1840 mutex_unlock(&info->bl_mutex); 1844 mutex_unlock(&info->bl_mutex);
1841 1845
1842 up(&bd->sem); 1846 down(&bd->sem);
1843 bd->props->brightness = aty128_bl_data.max_brightness; 1847 bd->props->brightness = aty128_bl_data.max_brightness;
1844 bd->props->power = FB_BLANK_UNBLANK; 1848 bd->props->power = FB_BLANK_UNBLANK;
1845 bd->props->update_status(bd); 1849 bd->props->update_status(bd);
1846 down(&bd->sem); 1850 up(&bd->sem);
1847 1851
1848#ifdef CONFIG_PMAC_BACKLIGHT 1852#ifdef CONFIG_PMAC_BACKLIGHT
1849 mutex_lock(&pmac_backlight_mutex); 1853 mutex_lock(&pmac_backlight_mutex);
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 053ff63365b7..19a71f045784 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2200,10 +2200,14 @@ static struct backlight_properties aty_bl_data = {
2200static void aty_bl_set_power(struct fb_info *info, int power) 2200static void aty_bl_set_power(struct fb_info *info, int power)
2201{ 2201{
2202 mutex_lock(&info->bl_mutex); 2202 mutex_lock(&info->bl_mutex);
2203 up(&info->bl_dev->sem); 2203
2204 info->bl_dev->props->power = power; 2204 if (info->bl_dev) {
2205 __aty_bl_update_status(info->bl_dev); 2205 down(&info->bl_dev->sem);
2206 down(&info->bl_dev->sem); 2206 info->bl_dev->props->power = power;
2207 __aty_bl_update_status(info->bl_dev);
2208 up(&info->bl_dev->sem);
2209 }
2210
2207 mutex_unlock(&info->bl_mutex); 2211 mutex_unlock(&info->bl_mutex);
2208} 2212}
2209 2213
@@ -2223,7 +2227,7 @@ static void aty_bl_init(struct atyfb_par *par)
2223 bd = backlight_device_register(name, par, &aty_bl_data); 2227 bd = backlight_device_register(name, par, &aty_bl_data);
2224 if (IS_ERR(bd)) { 2228 if (IS_ERR(bd)) {
2225 info->bl_dev = NULL; 2229 info->bl_dev = NULL;
2226 printk("aty: Backlight registration failed\n"); 2230 printk(KERN_WARNING "aty: Backlight registration failed\n");
2227 goto error; 2231 goto error;
2228 } 2232 }
2229 2233
@@ -2234,11 +2238,11 @@ static void aty_bl_init(struct atyfb_par *par)
2234 0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL); 2238 0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL);
2235 mutex_unlock(&info->bl_mutex); 2239 mutex_unlock(&info->bl_mutex);
2236 2240
2237 up(&bd->sem); 2241 down(&bd->sem);
2238 bd->props->brightness = aty_bl_data.max_brightness; 2242 bd->props->brightness = aty_bl_data.max_brightness;
2239 bd->props->power = FB_BLANK_UNBLANK; 2243 bd->props->power = FB_BLANK_UNBLANK;
2240 bd->props->update_status(bd); 2244 bd->props->update_status(bd);
2241 down(&bd->sem); 2245 up(&bd->sem);
2242 2246
2243#ifdef CONFIG_PMAC_BACKLIGHT 2247#ifdef CONFIG_PMAC_BACKLIGHT
2244 mutex_lock(&pmac_backlight_mutex); 2248 mutex_lock(&pmac_backlight_mutex);
diff --git a/drivers/video/aty/radeon_backlight.c b/drivers/video/aty/radeon_backlight.c
index 1755dddf1899..585eb7b9e636 100644
--- a/drivers/video/aty/radeon_backlight.c
+++ b/drivers/video/aty/radeon_backlight.c
@@ -195,11 +195,11 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
195 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL); 195 217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL);
196 mutex_unlock(&rinfo->info->bl_mutex); 196 mutex_unlock(&rinfo->info->bl_mutex);
197 197
198 up(&bd->sem); 198 down(&bd->sem);
199 bd->props->brightness = radeon_bl_data.max_brightness; 199 bd->props->brightness = radeon_bl_data.max_brightness;
200 bd->props->power = FB_BLANK_UNBLANK; 200 bd->props->power = FB_BLANK_UNBLANK;
201 bd->props->update_status(bd); 201 bd->props->update_status(bd);
202 down(&bd->sem); 202 up(&bd->sem);
203 203
204#ifdef CONFIG_PMAC_BACKLIGHT 204#ifdef CONFIG_PMAC_BACKLIGHT
205 mutex_lock(&pmac_backlight_mutex); 205 mutex_lock(&pmac_backlight_mutex);
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c
index b45f577094ac..5b75ae4e9457 100644
--- a/drivers/video/nvidia/nv_backlight.c
+++ b/drivers/video/nvidia/nv_backlight.c
@@ -113,10 +113,14 @@ static struct backlight_properties nvidia_bl_data = {
113void nvidia_bl_set_power(struct fb_info *info, int power) 113void nvidia_bl_set_power(struct fb_info *info, int power)
114{ 114{
115 mutex_lock(&info->bl_mutex); 115 mutex_lock(&info->bl_mutex);
116 up(&info->bl_dev->sem); 116
117 info->bl_dev->props->power = power; 117 if (info->bl_dev) {
118 __nvidia_bl_update_status(info->bl_dev); 118 down(&info->bl_dev->sem);
119 down(&info->bl_dev->sem); 119 info->bl_dev->props->power = power;
120 __nvidia_bl_update_status(info->bl_dev);
121 up(&info->bl_dev->sem);
122 }
123
120 mutex_unlock(&info->bl_mutex); 124 mutex_unlock(&info->bl_mutex);
121} 125}
122 126
@@ -140,7 +144,7 @@ void nvidia_bl_init(struct nvidia_par *par)
140 bd = backlight_device_register(name, par, &nvidia_bl_data); 144 bd = backlight_device_register(name, par, &nvidia_bl_data);
141 if (IS_ERR(bd)) { 145 if (IS_ERR(bd)) {
142 info->bl_dev = NULL; 146 info->bl_dev = NULL;
143 printk("nvidia: Backlight registration failed\n"); 147 printk(KERN_WARNING "nvidia: Backlight registration failed\n");
144 goto error; 148 goto error;
145 } 149 }
146 150
@@ -151,11 +155,11 @@ void nvidia_bl_init(struct nvidia_par *par)
151 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); 155 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
152 mutex_unlock(&info->bl_mutex); 156 mutex_unlock(&info->bl_mutex);
153 157
154 up(&bd->sem); 158 down(&bd->sem);
155 bd->props->brightness = nvidia_bl_data.max_brightness; 159 bd->props->brightness = nvidia_bl_data.max_brightness;
156 bd->props->power = FB_BLANK_UNBLANK; 160 bd->props->power = FB_BLANK_UNBLANK;
157 bd->props->update_status(bd); 161 bd->props->update_status(bd);
158 down(&bd->sem); 162 up(&bd->sem);
159 163
160#ifdef CONFIG_PMAC_BACKLIGHT 164#ifdef CONFIG_PMAC_BACKLIGHT
161 mutex_lock(&pmac_backlight_mutex); 165 mutex_lock(&pmac_backlight_mutex);
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 76fc9d355eb7..8ddb47a56b07 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -355,10 +355,14 @@ static struct backlight_properties riva_bl_data = {
355static void riva_bl_set_power(struct fb_info *info, int power) 355static void riva_bl_set_power(struct fb_info *info, int power)
356{ 356{
357 mutex_lock(&info->bl_mutex); 357 mutex_lock(&info->bl_mutex);
358 up(&info->bl_dev->sem); 358
359 info->bl_dev->props->power = power; 359 if (info->bl_dev) {
360 __riva_bl_update_status(info->bl_dev); 360 down(&info->bl_dev->sem);
361 down(&info->bl_dev->sem); 361 info->bl_dev->props->power = power;
362 __riva_bl_update_status(info->bl_dev);
363 up(&info->bl_dev->sem);
364 }
365
362 mutex_unlock(&info->bl_mutex); 366 mutex_unlock(&info->bl_mutex);
363} 367}
364 368
@@ -382,7 +386,7 @@ static void riva_bl_init(struct riva_par *par)
382 bd = backlight_device_register(name, par, &riva_bl_data); 386 bd = backlight_device_register(name, par, &riva_bl_data);
383 if (IS_ERR(bd)) { 387 if (IS_ERR(bd)) {
384 info->bl_dev = NULL; 388 info->bl_dev = NULL;
385 printk("riva: Backlight registration failed\n"); 389 printk(KERN_WARNING "riva: Backlight registration failed\n");
386 goto error; 390 goto error;
387 } 391 }
388 392
@@ -393,11 +397,11 @@ static void riva_bl_init(struct riva_par *par)
393 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL); 397 0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
394 mutex_unlock(&info->bl_mutex); 398 mutex_unlock(&info->bl_mutex);
395 399
396 up(&bd->sem); 400 down(&bd->sem);
397 bd->props->brightness = riva_bl_data.max_brightness; 401 bd->props->brightness = riva_bl_data.max_brightness;
398 bd->props->power = FB_BLANK_UNBLANK; 402 bd->props->power = FB_BLANK_UNBLANK;
399 bd->props->update_status(bd); 403 bd->props->update_status(bd);
400 down(&bd->sem); 404 up(&bd->sem);
401 405
402#ifdef CONFIG_PMAC_BACKLIGHT 406#ifdef CONFIG_PMAC_BACKLIGHT
403 mutex_lock(&pmac_backlight_mutex); 407 mutex_lock(&pmac_backlight_mutex);