diff options
Diffstat (limited to 'drivers')
153 files changed, 1599 insertions, 1603 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index a8634a0655fc..d9b8af763e1e 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -63,6 +63,7 @@ | |||
63 | ACPI_MODULE_NAME("processor_idle"); | 63 | ACPI_MODULE_NAME("processor_idle"); |
64 | #define ACPI_PROCESSOR_FILE_POWER "power" | 64 | #define ACPI_PROCESSOR_FILE_POWER "power" |
65 | #define US_TO_PM_TIMER_TICKS(t) ((t * (PM_TIMER_FREQUENCY/1000)) / 1000) | 65 | #define US_TO_PM_TIMER_TICKS(t) ((t * (PM_TIMER_FREQUENCY/1000)) / 1000) |
66 | #define PM_TIMER_TICK_NS (1000000000ULL/PM_TIMER_FREQUENCY) | ||
66 | #define C2_OVERHEAD 4 /* 1us (3.579 ticks per us) */ | 67 | #define C2_OVERHEAD 4 /* 1us (3.579 ticks per us) */ |
67 | #define C3_OVERHEAD 4 /* 1us (3.579 ticks per us) */ | 68 | #define C3_OVERHEAD 4 /* 1us (3.579 ticks per us) */ |
68 | static void (*pm_idle_save) (void) __read_mostly; | 69 | static void (*pm_idle_save) (void) __read_mostly; |
@@ -462,6 +463,9 @@ static void acpi_processor_idle(void) | |||
462 | * TBD: Can't get time duration while in C1, as resumes | 463 | * TBD: Can't get time duration while in C1, as resumes |
463 | * go to an ISR rather than here. Need to instrument | 464 | * go to an ISR rather than here. Need to instrument |
464 | * base interrupt handler. | 465 | * base interrupt handler. |
466 | * | ||
467 | * Note: the TSC better not stop in C1, sched_clock() will | ||
468 | * skew otherwise. | ||
465 | */ | 469 | */ |
466 | sleep_ticks = 0xFFFFFFFF; | 470 | sleep_ticks = 0xFFFFFFFF; |
467 | break; | 471 | break; |
@@ -469,6 +473,8 @@ static void acpi_processor_idle(void) | |||
469 | case ACPI_STATE_C2: | 473 | case ACPI_STATE_C2: |
470 | /* Get start time (ticks) */ | 474 | /* Get start time (ticks) */ |
471 | t1 = inl(acpi_gbl_FADT.xpm_timer_block.address); | 475 | t1 = inl(acpi_gbl_FADT.xpm_timer_block.address); |
476 | /* Tell the scheduler that we are going deep-idle: */ | ||
477 | sched_clock_idle_sleep_event(); | ||
472 | /* Invoke C2 */ | 478 | /* Invoke C2 */ |
473 | acpi_state_timer_broadcast(pr, cx, 1); | 479 | acpi_state_timer_broadcast(pr, cx, 1); |
474 | acpi_cstate_enter(cx); | 480 | acpi_cstate_enter(cx); |
@@ -479,17 +485,22 @@ static void acpi_processor_idle(void) | |||
479 | /* TSC halts in C2, so notify users */ | 485 | /* TSC halts in C2, so notify users */ |
480 | mark_tsc_unstable("possible TSC halt in C2"); | 486 | mark_tsc_unstable("possible TSC halt in C2"); |
481 | #endif | 487 | #endif |
488 | /* Compute time (ticks) that we were actually asleep */ | ||
489 | sleep_ticks = ticks_elapsed(t1, t2); | ||
490 | |||
491 | /* Tell the scheduler how much we idled: */ | ||
492 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); | ||
493 | |||
482 | /* Re-enable interrupts */ | 494 | /* Re-enable interrupts */ |
483 | local_irq_enable(); | 495 | local_irq_enable(); |
496 | /* Do not account our idle-switching overhead: */ | ||
497 | sleep_ticks -= cx->latency_ticks + C2_OVERHEAD; | ||
498 | |||
484 | current_thread_info()->status |= TS_POLLING; | 499 | current_thread_info()->status |= TS_POLLING; |
485 | /* Compute time (ticks) that we were actually asleep */ | ||
486 | sleep_ticks = | ||
487 | ticks_elapsed(t1, t2) - cx->latency_ticks - C2_OVERHEAD; | ||
488 | acpi_state_timer_broadcast(pr, cx, 0); | 500 | acpi_state_timer_broadcast(pr, cx, 0); |
489 | break; | 501 | break; |
490 | 502 | ||
491 | case ACPI_STATE_C3: | 503 | case ACPI_STATE_C3: |
492 | |||
493 | /* | 504 | /* |
494 | * disable bus master | 505 | * disable bus master |
495 | * bm_check implies we need ARB_DIS | 506 | * bm_check implies we need ARB_DIS |
@@ -518,6 +529,8 @@ static void acpi_processor_idle(void) | |||
518 | t1 = inl(acpi_gbl_FADT.xpm_timer_block.address); | 529 | t1 = inl(acpi_gbl_FADT.xpm_timer_block.address); |
519 | /* Invoke C3 */ | 530 | /* Invoke C3 */ |
520 | acpi_state_timer_broadcast(pr, cx, 1); | 531 | acpi_state_timer_broadcast(pr, cx, 1); |
532 | /* Tell the scheduler that we are going deep-idle: */ | ||
533 | sched_clock_idle_sleep_event(); | ||
521 | acpi_cstate_enter(cx); | 534 | acpi_cstate_enter(cx); |
522 | /* Get end time (ticks) */ | 535 | /* Get end time (ticks) */ |
523 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); | 536 | t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); |
@@ -531,12 +544,17 @@ static void acpi_processor_idle(void) | |||
531 | /* TSC halts in C3, so notify users */ | 544 | /* TSC halts in C3, so notify users */ |
532 | mark_tsc_unstable("TSC halts in C3"); | 545 | mark_tsc_unstable("TSC halts in C3"); |
533 | #endif | 546 | #endif |
547 | /* Compute time (ticks) that we were actually asleep */ | ||
548 | sleep_ticks = ticks_elapsed(t1, t2); | ||
549 | /* Tell the scheduler how much we idled: */ | ||
550 | sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); | ||
551 | |||
534 | /* Re-enable interrupts */ | 552 | /* Re-enable interrupts */ |
535 | local_irq_enable(); | 553 | local_irq_enable(); |
554 | /* Do not account our idle-switching overhead: */ | ||
555 | sleep_ticks -= cx->latency_ticks + C3_OVERHEAD; | ||
556 | |||
536 | current_thread_info()->status |= TS_POLLING; | 557 | current_thread_info()->status |= TS_POLLING; |
537 | /* Compute time (ticks) that we were actually asleep */ | ||
538 | sleep_ticks = | ||
539 | ticks_elapsed(t1, t2) - cx->latency_ticks - C3_OVERHEAD; | ||
540 | acpi_state_timer_broadcast(pr, cx, 0); | 558 | acpi_state_timer_broadcast(pr, cx, 0); |
541 | break; | 559 | break; |
542 | 560 | ||
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index a78832ea81fa..071d274afaab 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -436,7 +436,7 @@ static const struct piix_map_db ich8_map_db = { | |||
436 | /* PM PS SM SS MAP */ | 436 | /* PM PS SM SS MAP */ |
437 | { P0, P2, P1, P3 }, /* 00b (hardwired when in AHCI) */ | 437 | { P0, P2, P1, P3 }, /* 00b (hardwired when in AHCI) */ |
438 | { RV, RV, RV, RV }, | 438 | { RV, RV, RV, RV }, |
439 | { IDE, IDE, NA, NA }, /* 10b (IDE mode) */ | 439 | { P0, P2, IDE, IDE }, /* 10b (IDE mode) */ |
440 | { RV, RV, RV, RV }, | 440 | { RV, RV, RV, RV }, |
441 | }, | 441 | }, |
442 | }; | 442 | }; |
@@ -901,6 +901,13 @@ static int piix_broken_suspend(void) | |||
901 | }, | 901 | }, |
902 | }, | 902 | }, |
903 | { | 903 | { |
904 | .ident = "TECRA M7", | ||
905 | .matches = { | ||
906 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
907 | DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M7"), | ||
908 | }, | ||
909 | }, | ||
910 | { | ||
904 | .ident = "Satellite U205", | 911 | .ident = "Satellite U205", |
905 | .matches = { | 912 | .matches = { |
906 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 913 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 60e78bef469f..2ad4dda6d4a7 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1723,7 +1723,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, | |||
1723 | tf.protocol = ATA_PROT_NODATA; | 1723 | tf.protocol = ATA_PROT_NODATA; |
1724 | tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; | 1724 | tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE; |
1725 | err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0); | 1725 | err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0); |
1726 | if (err_mask) { | 1726 | if (err_mask && id[2] != 0x738c) { |
1727 | rc = -EIO; | 1727 | rc = -EIO; |
1728 | reason = "SPINUP failed"; | 1728 | reason = "SPINUP failed"; |
1729 | goto err_out; | 1729 | goto err_out; |
@@ -3700,11 +3700,16 @@ int ata_dev_revalidate(struct ata_device *dev, unsigned int readid_flags) | |||
3700 | goto fail; | 3700 | goto fail; |
3701 | 3701 | ||
3702 | /* verify n_sectors hasn't changed */ | 3702 | /* verify n_sectors hasn't changed */ |
3703 | if (dev->class == ATA_DEV_ATA && dev->n_sectors != n_sectors) { | 3703 | if (dev->class == ATA_DEV_ATA && n_sectors && |
3704 | dev->n_sectors != n_sectors) { | ||
3704 | ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " | 3705 | ata_dev_printk(dev, KERN_INFO, "n_sectors mismatch " |
3705 | "%llu != %llu\n", | 3706 | "%llu != %llu\n", |
3706 | (unsigned long long)n_sectors, | 3707 | (unsigned long long)n_sectors, |
3707 | (unsigned long long)dev->n_sectors); | 3708 | (unsigned long long)dev->n_sectors); |
3709 | |||
3710 | /* restore original n_sectors */ | ||
3711 | dev->n_sectors = n_sectors; | ||
3712 | |||
3708 | rc = -ENODEV; | 3713 | rc = -ENODEV; |
3709 | goto fail; | 3714 | goto fail; |
3710 | } | 3715 | } |
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index ce589d96ca42..b5352ebecef9 100644 --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * pata_artop.c - ARTOP ATA controller driver | 2 | * pata_artop.c - ARTOP ATA controller driver |
3 | * | 3 | * |
4 | * (C) 2006 Red Hat <alan@redhat.com> | 4 | * (C) 2006 Red Hat <alan@redhat.com> |
5 | * (C) 2007 Bartlomiej Zolnierkiewicz | ||
5 | * | 6 | * |
6 | * Based in part on drivers/ide/pci/aec62xx.c | 7 | * Based in part on drivers/ide/pci/aec62xx.c |
7 | * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> | 8 | * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> |
@@ -28,7 +29,7 @@ | |||
28 | #include <linux/ata.h> | 29 | #include <linux/ata.h> |
29 | 30 | ||
30 | #define DRV_NAME "pata_artop" | 31 | #define DRV_NAME "pata_artop" |
31 | #define DRV_VERSION "0.4.3" | 32 | #define DRV_VERSION "0.4.4" |
32 | 33 | ||
33 | /* | 34 | /* |
34 | * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we | 35 | * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we |
@@ -430,7 +431,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) | |||
430 | .udma_mask = ATA_UDMA4, | 431 | .udma_mask = ATA_UDMA4, |
431 | .port_ops = &artop6260_ops, | 432 | .port_ops = &artop6260_ops, |
432 | }; | 433 | }; |
433 | static const struct ata_port_info info_626x_fast = { | 434 | static const struct ata_port_info info_628x = { |
434 | .sht = &artop_sht, | 435 | .sht = &artop_sht, |
435 | .flags = ATA_FLAG_SLAVE_POSS, | 436 | .flags = ATA_FLAG_SLAVE_POSS, |
436 | .pio_mask = 0x1f, /* pio0-4 */ | 437 | .pio_mask = 0x1f, /* pio0-4 */ |
@@ -438,6 +439,14 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) | |||
438 | .udma_mask = ATA_UDMA5, | 439 | .udma_mask = ATA_UDMA5, |
439 | .port_ops = &artop6260_ops, | 440 | .port_ops = &artop6260_ops, |
440 | }; | 441 | }; |
442 | static const struct ata_port_info info_628x_fast = { | ||
443 | .sht = &artop_sht, | ||
444 | .flags = ATA_FLAG_SLAVE_POSS, | ||
445 | .pio_mask = 0x1f, /* pio0-4 */ | ||
446 | .mwdma_mask = 0x07, /* mwdma0-2 */ | ||
447 | .udma_mask = ATA_UDMA6, | ||
448 | .port_ops = &artop6260_ops, | ||
449 | }; | ||
441 | const struct ata_port_info *ppi[] = { NULL, NULL }; | 450 | const struct ata_port_info *ppi[] = { NULL, NULL }; |
442 | 451 | ||
443 | if (!printed_version++) | 452 | if (!printed_version++) |
@@ -455,13 +464,13 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) | |||
455 | } | 464 | } |
456 | else if (id->driver_data == 1) /* 6260 */ | 465 | else if (id->driver_data == 1) /* 6260 */ |
457 | ppi[0] = &info_626x; | 466 | ppi[0] = &info_626x; |
458 | else if (id->driver_data == 2) { /* 6260 or 6260 + fast */ | 467 | else if (id->driver_data == 2) { /* 6280 or 6280 + fast */ |
459 | unsigned long io = pci_resource_start(pdev, 4); | 468 | unsigned long io = pci_resource_start(pdev, 4); |
460 | u8 reg; | 469 | u8 reg; |
461 | 470 | ||
462 | ppi[0] = &info_626x; | 471 | ppi[0] = &info_628x; |
463 | if (inb(io) & 0x10) | 472 | if (inb(io) & 0x10) |
464 | ppi[0] = &info_626x_fast; | 473 | ppi[0] = &info_628x_fast; |
465 | /* Mac systems come up with some registers not set as we | 474 | /* Mac systems come up with some registers not set as we |
466 | will need them */ | 475 | will need them */ |
467 | 476 | ||
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index 84d9c5568567..c5ddd937dbf2 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c | |||
@@ -8,12 +8,10 @@ | |||
8 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> | 8 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> |
9 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. | 9 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. |
10 | * Portions Copyright (C) 2003 Red Hat Inc | 10 | * Portions Copyright (C) 2003 Red Hat Inc |
11 | * Portions Copyright (C) 2005-2006 MontaVista Software, Inc. | 11 | * Portions Copyright (C) 2005-2007 MontaVista Software, Inc. |
12 | * | 12 | * |
13 | * TODO | 13 | * TODO |
14 | * PLL mode | 14 | * Look into engine reset on timeout errors. Should not be required. |
15 | * Look into engine reset on timeout errors. Should not be | ||
16 | * required. | ||
17 | */ | 15 | */ |
18 | 16 | ||
19 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
@@ -26,7 +24,7 @@ | |||
26 | #include <linux/libata.h> | 24 | #include <linux/libata.h> |
27 | 25 | ||
28 | #define DRV_NAME "pata_hpt37x" | 26 | #define DRV_NAME "pata_hpt37x" |
29 | #define DRV_VERSION "0.6.7" | 27 | #define DRV_VERSION "0.6.9" |
30 | 28 | ||
31 | struct hpt_clock { | 29 | struct hpt_clock { |
32 | u8 xfer_speed; | 30 | u8 xfer_speed; |
@@ -1092,9 +1090,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1092 | int dpll, adjust; | 1090 | int dpll, adjust; |
1093 | 1091 | ||
1094 | /* Compute DPLL */ | 1092 | /* Compute DPLL */ |
1095 | dpll = 2; | 1093 | dpll = (port->udma_mask & 0xC0) ? 3 : 2; |
1096 | if (port->udma_mask & 0xE0) | ||
1097 | dpll = 3; | ||
1098 | 1094 | ||
1099 | f_low = (MHz[clock_slot] * 48) / MHz[dpll]; | 1095 | f_low = (MHz[clock_slot] * 48) / MHz[dpll]; |
1100 | f_high = f_low + 2; | 1096 | f_high = f_low + 2; |
@@ -1116,7 +1112,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1116 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100); | 1112 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100); |
1117 | } | 1113 | } |
1118 | if (adjust == 8) { | 1114 | if (adjust == 8) { |
1119 | printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n"); | 1115 | printk(KERN_ERR "pata_hpt37x: DPLL did not stabilize!\n"); |
1120 | return -ENODEV; | 1116 | return -ENODEV; |
1121 | } | 1117 | } |
1122 | if (dpll == 3) | 1118 | if (dpll == 3) |
@@ -1124,7 +1120,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1124 | else | 1120 | else |
1125 | private_data = (void *)hpt37x_timings_50; | 1121 | private_data = (void *)hpt37x_timings_50; |
1126 | 1122 | ||
1127 | printk(KERN_INFO "hpt37x: Bus clock %dMHz, using DPLL.\n", MHz[dpll]); | 1123 | printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using %dMHz DPLL.\n", |
1124 | MHz[clock_slot], MHz[dpll]); | ||
1128 | } else { | 1125 | } else { |
1129 | private_data = (void *)chip_table->clocks[clock_slot]; | 1126 | private_data = (void *)chip_table->clocks[clock_slot]; |
1130 | /* | 1127 | /* |
@@ -1137,7 +1134,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
1137 | port = &info_hpt370_33; | 1134 | port = &info_hpt370_33; |
1138 | if (clock_slot < 2 && port == &info_hpt370a) | 1135 | if (clock_slot < 2 && port == &info_hpt370a) |
1139 | port = &info_hpt370a_33; | 1136 | port = &info_hpt370a_33; |
1140 | printk(KERN_INFO "hpt37x: %s: Bus clock %dMHz.\n", chip_table->name, MHz[clock_slot]); | 1137 | printk(KERN_INFO "pata_hpt37x: %s using %dMHz bus clock.\n", |
1138 | chip_table->name, MHz[clock_slot]); | ||
1141 | } | 1139 | } |
1142 | 1140 | ||
1143 | /* Now kick off ATA set up */ | 1141 | /* Now kick off ATA set up */ |
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c index aa29cde09f8b..f8f234bfc8ce 100644 --- a/drivers/ata/pata_hpt3x2n.c +++ b/drivers/ata/pata_hpt3x2n.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> | 8 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> |
9 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. | 9 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. |
10 | * Portions Copyright (C) 2003 Red Hat Inc | 10 | * Portions Copyright (C) 2003 Red Hat Inc |
11 | * Portions Copyright (C) 2005-2006 MontaVista Software, Inc. | 11 | * Portions Copyright (C) 2005-2007 MontaVista Software, Inc. |
12 | * | 12 | * |
13 | * | 13 | * |
14 | * TODO | 14 | * TODO |
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/libata.h> | 25 | #include <linux/libata.h> |
26 | 26 | ||
27 | #define DRV_NAME "pata_hpt3x2n" | 27 | #define DRV_NAME "pata_hpt3x2n" |
28 | #define DRV_VERSION "0.3.3" | 28 | #define DRV_VERSION "0.3.4" |
29 | 29 | ||
30 | enum { | 30 | enum { |
31 | HPT_PCI_FAST = (1 << 31), | 31 | HPT_PCI_FAST = (1 << 31), |
@@ -579,10 +579,12 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
579 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); | 579 | pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); |
580 | } | 580 | } |
581 | if (adjust == 8) { | 581 | if (adjust == 8) { |
582 | printk(KERN_WARNING "hpt3x2n: DPLL did not stabilize.\n"); | 582 | printk(KERN_ERR "pata_hpt3x2n: DPLL did not stabilize!\n"); |
583 | return -ENODEV; | 583 | return -ENODEV; |
584 | } | 584 | } |
585 | 585 | ||
586 | printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using 66MHz DPLL.\n", | ||
587 | pci_mhz); | ||
586 | /* Set our private data up. We only need a few flags so we use | 588 | /* Set our private data up. We only need a few flags so we use |
587 | it directly */ | 589 | it directly */ |
588 | port.private_data = NULL; | 590 | port.private_data = NULL; |
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c index 5525518204e6..91a396fa5b20 100644 --- a/drivers/ata/pata_isapnp.c +++ b/drivers/ata/pata_isapnp.c | |||
@@ -139,6 +139,8 @@ static struct pnp_device_id isapnp_devices[] = { | |||
139 | {.id = ""} | 139 | {.id = ""} |
140 | }; | 140 | }; |
141 | 141 | ||
142 | MODULE_DEVICE_TABLE(pnp, isapnp_devices); | ||
143 | |||
142 | static struct pnp_driver isapnp_driver = { | 144 | static struct pnp_driver isapnp_driver = { |
143 | .name = DRV_NAME, | 145 | .name = DRV_NAME, |
144 | .id_table = isapnp_devices, | 146 | .id_table = isapnp_devices, |
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index 430673be1df7..7225124d96c2 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c | |||
@@ -587,7 +587,7 @@ static int it821x_port_start(struct ata_port *ap) | |||
587 | itdev->want[1][1] = ATA_ANY; | 587 | itdev->want[1][1] = ATA_ANY; |
588 | itdev->last_device = -1; | 588 | itdev->last_device = -1; |
589 | 589 | ||
590 | if (pdev->revision == 0x11) { | 590 | if (pdev->revision == 0x10) { |
591 | itdev->timing10 = 1; | 591 | itdev->timing10 = 1; |
592 | /* Need to disable ATAPI DMA for this case */ | 592 | /* Need to disable ATAPI DMA for this case */ |
593 | if (!itdev->smart) | 593 | if (!itdev->smart) |
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c index 69a5aa4949f5..e3245b36269a 100644 --- a/drivers/ata/pata_pdc2027x.c +++ b/drivers/ata/pata_pdc2027x.c | |||
@@ -563,13 +563,13 @@ static long pdc_read_counter(struct ata_host *host) | |||
563 | u32 bccrl, bccrh, bccrlv, bccrhv; | 563 | u32 bccrl, bccrh, bccrlv, bccrhv; |
564 | 564 | ||
565 | retry: | 565 | retry: |
566 | bccrl = readl(mmio_base + PDC_BYTE_COUNT) & 0xffff; | 566 | bccrl = readl(mmio_base + PDC_BYTE_COUNT) & 0x7fff; |
567 | bccrh = readl(mmio_base + PDC_BYTE_COUNT + 0x100) & 0xffff; | 567 | bccrh = readl(mmio_base + PDC_BYTE_COUNT + 0x100) & 0x7fff; |
568 | rmb(); | 568 | rmb(); |
569 | 569 | ||
570 | /* Read the counter values again for verification */ | 570 | /* Read the counter values again for verification */ |
571 | bccrlv = readl(mmio_base + PDC_BYTE_COUNT) & 0xffff; | 571 | bccrlv = readl(mmio_base + PDC_BYTE_COUNT) & 0x7fff; |
572 | bccrhv = readl(mmio_base + PDC_BYTE_COUNT + 0x100) & 0xffff; | 572 | bccrhv = readl(mmio_base + PDC_BYTE_COUNT + 0x100) & 0x7fff; |
573 | rmb(); | 573 | rmb(); |
574 | 574 | ||
575 | counter = (bccrh << 15) | bccrl; | 575 | counter = (bccrh << 15) | bccrl; |
@@ -692,16 +692,16 @@ static long pdc_detect_pll_input_clock(struct ata_host *host) | |||
692 | struct timeval start_time, end_time; | 692 | struct timeval start_time, end_time; |
693 | long pll_clock, usec_elapsed; | 693 | long pll_clock, usec_elapsed; |
694 | 694 | ||
695 | /* Read current counter value */ | ||
696 | start_count = pdc_read_counter(host); | ||
697 | do_gettimeofday(&start_time); | ||
698 | |||
699 | /* Start the test mode */ | 695 | /* Start the test mode */ |
700 | scr = readl(mmio_base + PDC_SYS_CTL); | 696 | scr = readl(mmio_base + PDC_SYS_CTL); |
701 | PDPRINTK("scr[%X]\n", scr); | 697 | PDPRINTK("scr[%X]\n", scr); |
702 | writel(scr | (0x01 << 14), mmio_base + PDC_SYS_CTL); | 698 | writel(scr | (0x01 << 14), mmio_base + PDC_SYS_CTL); |
703 | readl(mmio_base + PDC_SYS_CTL); /* flush */ | 699 | readl(mmio_base + PDC_SYS_CTL); /* flush */ |
704 | 700 | ||
701 | /* Read current counter value */ | ||
702 | start_count = pdc_read_counter(host); | ||
703 | do_gettimeofday(&start_time); | ||
704 | |||
705 | /* Let the counter run for 100 ms. */ | 705 | /* Let the counter run for 100 ms. */ |
706 | mdelay(100); | 706 | mdelay(100); |
707 | 707 | ||
@@ -719,7 +719,7 @@ static long pdc_detect_pll_input_clock(struct ata_host *host) | |||
719 | usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 + | 719 | usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 + |
720 | (end_time.tv_usec - start_time.tv_usec); | 720 | (end_time.tv_usec - start_time.tv_usec); |
721 | 721 | ||
722 | pll_clock = (start_count - end_count) / 100 * | 722 | pll_clock = ((start_count - end_count) & 0x3fffffff) / 100 * |
723 | (100000000 / usec_elapsed); | 723 | (100000000 / usec_elapsed); |
724 | 724 | ||
725 | PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count); | 725 | PDPRINTK("start[%ld] end[%ld] \n", start_count, end_count); |
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index 66bd0e83ac07..2bd7645f1a88 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c | |||
@@ -54,6 +54,7 @@ struct sis_laptop { | |||
54 | static const struct sis_laptop sis_laptop[] = { | 54 | static const struct sis_laptop sis_laptop[] = { |
55 | /* devid, subvendor, subdev */ | 55 | /* devid, subvendor, subdev */ |
56 | { 0x5513, 0x1043, 0x1107 }, /* ASUS A6K */ | 56 | { 0x5513, 0x1043, 0x1107 }, /* ASUS A6K */ |
57 | { 0x5513, 0x1734, 0x105F }, /* FSC Amilo A1630 */ | ||
57 | /* end marker */ | 58 | /* end marker */ |
58 | { 0, } | 59 | { 0, } |
59 | }; | 60 | }; |
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index f645fe22cd1e..ea18e33f50ef 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
@@ -63,7 +63,7 @@ | |||
63 | #include <linux/dmi.h> | 63 | #include <linux/dmi.h> |
64 | 64 | ||
65 | #define DRV_NAME "pata_via" | 65 | #define DRV_NAME "pata_via" |
66 | #define DRV_VERSION "0.3.1" | 66 | #define DRV_VERSION "0.3.2" |
67 | 67 | ||
68 | /* | 68 | /* |
69 | * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx | 69 | * The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx |
@@ -144,6 +144,9 @@ static int via_cable_override(struct pci_dev *pdev) | |||
144 | /* Systems by DMI */ | 144 | /* Systems by DMI */ |
145 | if (dmi_check_system(cable_dmi_table)) | 145 | if (dmi_check_system(cable_dmi_table)) |
146 | return 1; | 146 | return 1; |
147 | /* Arima W730-K8/Targa Visionary 811/... */ | ||
148 | if (pdev->subsystem_vendor == 0x161F && pdev->subsystem_device == 0x2032) | ||
149 | return 1; | ||
147 | return 0; | 150 | return 0; |
148 | } | 151 | } |
149 | 152 | ||
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 8ec520885b95..3acf65e75eb2 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -621,6 +621,9 @@ static const struct pci_device_id mv_pci_tbl[] = { | |||
621 | { PCI_VDEVICE(MARVELL, 0x5041), chip_504x }, | 621 | { PCI_VDEVICE(MARVELL, 0x5041), chip_504x }, |
622 | { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 }, | 622 | { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 }, |
623 | { PCI_VDEVICE(MARVELL, 0x5081), chip_508x }, | 623 | { PCI_VDEVICE(MARVELL, 0x5081), chip_508x }, |
624 | /* RocketRAID 1740/174x have different identifiers */ | ||
625 | { PCI_VDEVICE(TTI, 0x1740), chip_508x }, | ||
626 | { PCI_VDEVICE(TTI, 0x1742), chip_508x }, | ||
624 | 627 | ||
625 | { PCI_VDEVICE(MARVELL, 0x6040), chip_604x }, | 628 | { PCI_VDEVICE(MARVELL, 0x6040), chip_604x }, |
626 | { PCI_VDEVICE(MARVELL, 0x6041), chip_604x }, | 629 | { PCI_VDEVICE(MARVELL, 0x6041), chip_604x }, |
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig index bed9f58c2d5a..b554edac1ced 100644 --- a/drivers/atm/Kconfig +++ b/drivers/atm/Kconfig | |||
@@ -6,6 +6,11 @@ menuconfig ATM_DRIVERS | |||
6 | bool "ATM drivers" | 6 | bool "ATM drivers" |
7 | depends on NETDEVICES && ATM | 7 | depends on NETDEVICES && ATM |
8 | default y | 8 | default y |
9 | ---help--- | ||
10 | Say Y here to get to see options for Asynchronous Transfer Mode | ||
11 | device drivers. This option alone does not add any kernel code. | ||
12 | |||
13 | If you say N, all options in this submenu will be skipped and disabled. | ||
9 | 14 | ||
10 | if ATM_DRIVERS && NETDEVICES && ATM | 15 | if ATM_DRIVERS && NETDEVICES && ATM |
11 | 16 | ||
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig index de2fcce10ba5..043353bd0600 100644 --- a/drivers/auxdisplay/Kconfig +++ b/drivers/auxdisplay/Kconfig | |||
@@ -8,6 +8,11 @@ | |||
8 | menuconfig AUXDISPLAY | 8 | menuconfig AUXDISPLAY |
9 | depends on PARPORT | 9 | depends on PARPORT |
10 | bool "Auxiliary Display support" | 10 | bool "Auxiliary Display support" |
11 | ---help--- | ||
12 | Say Y here to get to see options for auxiliary display drivers. | ||
13 | This option alone does not add any kernel code. | ||
14 | |||
15 | If you say N, all options in this submenu will be skipped and disabled. | ||
11 | 16 | ||
12 | if AUXDISPLAY && PARPORT | 17 | if AUXDISPLAY && PARPORT |
13 | 18 | ||
diff --git a/drivers/auxdisplay/cfag12864b.c b/drivers/auxdisplay/cfag12864b.c index cb44cb4f6a47..80bb06105387 100644 --- a/drivers/auxdisplay/cfag12864b.c +++ b/drivers/auxdisplay/cfag12864b.c | |||
@@ -355,7 +355,7 @@ static int __init cfag12864b_init(void) | |||
355 | 355 | ||
356 | cfag12864b_cache = kmalloc(sizeof(unsigned char) * | 356 | cfag12864b_cache = kmalloc(sizeof(unsigned char) * |
357 | CFAG12864B_SIZE, GFP_KERNEL); | 357 | CFAG12864B_SIZE, GFP_KERNEL); |
358 | if (cfag12864b_buffer == NULL) { | 358 | if (cfag12864b_cache == NULL) { |
359 | printk(KERN_ERR CFAG12864B_NAME ": ERROR: " | 359 | printk(KERN_ERR CFAG12864B_NAME ": ERROR: " |
360 | "can't alloc cache buffer (%i bytes)\n", | 360 | "can't alloc cache buffer (%i bytes)\n", |
361 | CFAG12864B_SIZE); | 361 | CFAG12864B_SIZE); |
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index a4a311992408..4245b7f80a49 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig | |||
@@ -6,6 +6,12 @@ menuconfig BLK_DEV | |||
6 | bool "Block devices" | 6 | bool "Block devices" |
7 | depends on BLOCK | 7 | depends on BLOCK |
8 | default y | 8 | default y |
9 | ---help--- | ||
10 | Say Y here to get to see options for various different block device | ||
11 | drivers. This option alone does not add any kernel code. | ||
12 | |||
13 | If you say N, all options in this submenu will be skipped and disabled; | ||
14 | only do this if you know what you are doing. | ||
9 | 15 | ||
10 | if BLK_DEV | 16 | if BLK_DEV |
11 | 17 | ||
@@ -62,6 +68,7 @@ config AMIGA_Z2RAM | |||
62 | config BLK_DEV_XD | 68 | config BLK_DEV_XD |
63 | tristate "XT hard disk support" | 69 | tristate "XT hard disk support" |
64 | depends on ISA && ISA_DMA_API | 70 | depends on ISA && ISA_DMA_API |
71 | select CHECK_SIGNATURE | ||
65 | help | 72 | help |
66 | Very old 8 bit hard disk controllers used in the IBM XT computer | 73 | Very old 8 bit hard disk controllers used in the IBM XT computer |
67 | will be supported if you say Y here. | 74 | will be supported if you say Y here. |
diff --git a/drivers/block/lguest_blk.c b/drivers/block/lguest_blk.c index 93e3c4001bf5..160cf14431ac 100644 --- a/drivers/block/lguest_blk.c +++ b/drivers/block/lguest_blk.c | |||
@@ -308,9 +308,12 @@ static int lguestblk_probe(struct lguest_device *lgdev) | |||
308 | } | 308 | } |
309 | 309 | ||
310 | /* This allocates a "struct gendisk" where we pack all the information | 310 | /* This allocates a "struct gendisk" where we pack all the information |
311 | * about the disk which the rest of Linux sees. We ask for one minor | 311 | * about the disk which the rest of Linux sees. The argument is the |
312 | * number; I do wonder if we should be asking for more. */ | 312 | * number of minor devices desired: we need one minor for the main |
313 | bd->disk = alloc_disk(1); | 313 | * disk, and one for each partition. Of course, we can't possibly know |
314 | * how many partitions are on the disk (add_disk does that). | ||
315 | */ | ||
316 | bd->disk = alloc_disk(16); | ||
314 | if (!bd->disk) { | 317 | if (!bd->disk) { |
315 | err = -ENOMEM; | 318 | err = -ENOMEM; |
316 | goto out_unregister_blkdev; | 319 | goto out_unregister_blkdev; |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 96d2f9ee42d6..9b07f7851061 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -2292,7 +2292,7 @@ static int __devinit ipmi_of_probe(struct of_device *dev, | |||
2292 | info->irq = irq_of_parse_and_map(dev->node, 0); | 2292 | info->irq = irq_of_parse_and_map(dev->node, 0); |
2293 | info->dev = &dev->dev; | 2293 | info->dev = &dev->dev; |
2294 | 2294 | ||
2295 | dev_dbg(&dev->dev, "addr 0x%lx regsize %ld spacing %ld irq %x\n", | 2295 | dev_dbg(&dev->dev, "addr 0x%lx regsize %d spacing %d irq %x\n", |
2296 | info->io.addr_data, info->io.regsize, info->io.regspacing, | 2296 | info->io.addr_data, info->io.regsize, info->io.regspacing, |
2297 | info->irq); | 2297 | info->irq); |
2298 | 2298 | ||
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 2ce0af1bd588..d95f316afb5a 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c | |||
@@ -1022,10 +1022,6 @@ static const unsigned short x86_keycodes[256] = | |||
1022 | 308,310,313,314,315,317,318,319,320,357,322,323,324,325,276,330, | 1022 | 308,310,313,314,315,317,318,319,320,357,322,323,324,325,276,330, |
1023 | 332,340,365,342,343,344,345,346,356,270,341,368,369,370,371,372 }; | 1023 | 332,340,365,342,343,344,345,346,356,270,341,368,369,370,371,372 }; |
1024 | 1024 | ||
1025 | #ifdef CONFIG_MAC_EMUMOUSEBTN | ||
1026 | extern int mac_hid_mouse_emulate_buttons(int, int, int); | ||
1027 | #endif /* CONFIG_MAC_EMUMOUSEBTN */ | ||
1028 | |||
1029 | #ifdef CONFIG_SPARC | 1025 | #ifdef CONFIG_SPARC |
1030 | static int sparc_l1_a_state = 0; | 1026 | static int sparc_l1_a_state = 0; |
1031 | extern void sun_do_break(void); | 1027 | extern void sun_do_break(void); |
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index bbb7f1292665..2f97d2f8f916 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -1565,6 +1565,9 @@ static int hdlcdev_open(struct net_device *dev) | |||
1565 | int rc; | 1565 | int rc; |
1566 | unsigned long flags; | 1566 | unsigned long flags; |
1567 | 1567 | ||
1568 | if (!try_module_get(THIS_MODULE)) | ||
1569 | return -EBUSY; | ||
1570 | |||
1568 | DBGINFO(("%s hdlcdev_open\n", dev->name)); | 1571 | DBGINFO(("%s hdlcdev_open\n", dev->name)); |
1569 | 1572 | ||
1570 | /* generic HDLC layer open processing */ | 1573 | /* generic HDLC layer open processing */ |
@@ -1634,6 +1637,7 @@ static int hdlcdev_close(struct net_device *dev) | |||
1634 | info->netcount=0; | 1637 | info->netcount=0; |
1635 | spin_unlock_irqrestore(&info->netlock, flags); | 1638 | spin_unlock_irqrestore(&info->netlock, flags); |
1636 | 1639 | ||
1640 | module_put(THIS_MODULE); | ||
1637 | return 0; | 1641 | return 0; |
1638 | } | 1642 | } |
1639 | 1643 | ||
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 9bb542913b86..39564b76d4a3 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * Reiner Sailer <sailer@watson.ibm.com> | 7 | * Reiner Sailer <sailer@watson.ibm.com> |
8 | * Kylene Hall <kjhall@us.ibm.com> | 8 | * Kylene Hall <kjhall@us.ibm.com> |
9 | * | 9 | * |
10 | * Maintained by: <tpmdd_devel@lists.sourceforge.net> | 10 | * Maintained by: <tpmdd-devel@lists.sourceforge.net> |
11 | * | 11 | * |
12 | * Device driver for TCG/TCPA TPM (trusted platform module). | 12 | * Device driver for TCG/TCPA TPM (trusted platform module). |
13 | * Specifications at www.trustedcomputinggroup.org | 13 | * Specifications at www.trustedcomputinggroup.org |
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index b2e2b002a1bb..d15ccddc92eb 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * Reiner Sailer <sailer@watson.ibm.com> | 7 | * Reiner Sailer <sailer@watson.ibm.com> |
8 | * Kylene Hall <kjhall@us.ibm.com> | 8 | * Kylene Hall <kjhall@us.ibm.com> |
9 | * | 9 | * |
10 | * Maintained by: <tpmdd_devel@lists.sourceforge.net> | 10 | * Maintained by: <tpmdd-devel@lists.sourceforge.net> |
11 | * | 11 | * |
12 | * Device driver for TCG/TCPA TPM (trusted platform module). | 12 | * Device driver for TCG/TCPA TPM (trusted platform module). |
13 | * Specifications at www.trustedcomputinggroup.org | 13 | * Specifications at www.trustedcomputinggroup.org |
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c index 1ab0896070be..d0e7926eb486 100644 --- a/drivers/char/tpm/tpm_atmel.c +++ b/drivers/char/tpm/tpm_atmel.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * Reiner Sailer <sailer@watson.ibm.com> | 7 | * Reiner Sailer <sailer@watson.ibm.com> |
8 | * Kylene Hall <kjhall@us.ibm.com> | 8 | * Kylene Hall <kjhall@us.ibm.com> |
9 | * | 9 | * |
10 | * Maintained by: <tpmdd_devel@lists.sourceforge.net> | 10 | * Maintained by: <tpmdd-devel@lists.sourceforge.net> |
11 | * | 11 | * |
12 | * Device driver for TCG/TCPA TPM (trusted platform module). | 12 | * Device driver for TCG/TCPA TPM (trusted platform module). |
13 | * Specifications at www.trustedcomputinggroup.org | 13 | * Specifications at www.trustedcomputinggroup.org |
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h index 9363bcf0a402..6c831f9466b7 100644 --- a/drivers/char/tpm/tpm_atmel.h +++ b/drivers/char/tpm/tpm_atmel.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * Authors: | 4 | * Authors: |
5 | * Kylene Hall <kjhall@us.ibm.com> | 5 | * Kylene Hall <kjhall@us.ibm.com> |
6 | * | 6 | * |
7 | * Maintained by: <tpmdd_devel@lists.sourceforge.net> | 7 | * Maintained by: <tpmdd-devel@lists.sourceforge.net> |
8 | * | 8 | * |
9 | * Device driver for TCG/TCPA TPM (trusted platform module). | 9 | * Device driver for TCG/TCPA TPM (trusted platform module). |
10 | * Specifications at www.trustedcomputinggroup.org | 10 | * Specifications at www.trustedcomputinggroup.org |
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index 8677fc6a545e..60a2d2630e36 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c | |||
@@ -7,6 +7,8 @@ | |||
7 | * Reiner Sailer <sailer@watson.ibm.com> | 7 | * Reiner Sailer <sailer@watson.ibm.com> |
8 | * Kylene Hall <kjhall@us.ibm.com> | 8 | * Kylene Hall <kjhall@us.ibm.com> |
9 | * | 9 | * |
10 | * Maintained by: <tpmdd-devel@lists.sourceforge.net> | ||
11 | * | ||
10 | * Access to the eventlog extended by the TCG BIOS of PC platform | 12 | * Access to the eventlog extended by the TCG BIOS of PC platform |
11 | * | 13 | * |
12 | * This program is free software; you can redistribute it and/or | 14 | * This program is free software; you can redistribute it and/or |
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c index 608f73071bef..6313326bc41f 100644 --- a/drivers/char/tpm/tpm_nsc.c +++ b/drivers/char/tpm/tpm_nsc.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * Reiner Sailer <sailer@watson.ibm.com> | 7 | * Reiner Sailer <sailer@watson.ibm.com> |
8 | * Kylene Hall <kjhall@us.ibm.com> | 8 | * Kylene Hall <kjhall@us.ibm.com> |
9 | * | 9 | * |
10 | * Maintained by: <tpmdd_devel@lists.sourceforge.net> | 10 | * Maintained by: <tpmdd-devel@lists.sourceforge.net> |
11 | * | 11 | * |
12 | * Device driver for TCG/TCPA TPM (trusted platform module). | 12 | * Device driver for TCG/TCPA TPM (trusted platform module). |
13 | * Specifications at www.trustedcomputinggroup.org | 13 | * Specifications at www.trustedcomputinggroup.org |
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 483f3f60013c..23fa18a6654c 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -5,6 +5,8 @@ | |||
5 | * Leendert van Doorn <leendert@watson.ibm.com> | 5 | * Leendert van Doorn <leendert@watson.ibm.com> |
6 | * Kylene Hall <kjhall@us.ibm.com> | 6 | * Kylene Hall <kjhall@us.ibm.com> |
7 | * | 7 | * |
8 | * Maintained by: <tpmdd-devel@lists.sourceforge.net> | ||
9 | * | ||
8 | * Device driver for TCG/TCPA TPM (trusted platform module). | 10 | * Device driver for TCG/TCPA TPM (trusted platform module). |
9 | * Specifications at www.trustedcomputinggroup.org | 11 | * Specifications at www.trustedcomputinggroup.org |
10 | * | 12 | * |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 51ea93cab6c4..9c867cf6de64 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -2063,8 +2063,7 @@ static int init_dev(struct tty_driver *driver, int idx, | |||
2063 | } | 2063 | } |
2064 | 2064 | ||
2065 | if (!*tp_loc) { | 2065 | if (!*tp_loc) { |
2066 | tp = (struct ktermios *) kmalloc(sizeof(struct ktermios), | 2066 | tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL); |
2067 | GFP_KERNEL); | ||
2068 | if (!tp) | 2067 | if (!tp) |
2069 | goto free_mem_out; | 2068 | goto free_mem_out; |
2070 | *tp = driver->init_termios; | 2069 | *tp = driver->init_termios; |
@@ -2094,8 +2093,7 @@ static int init_dev(struct tty_driver *driver, int idx, | |||
2094 | } | 2093 | } |
2095 | 2094 | ||
2096 | if (!*o_tp_loc) { | 2095 | if (!*o_tp_loc) { |
2097 | o_tp = (struct ktermios *) | 2096 | o_tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL); |
2098 | kmalloc(sizeof(struct ktermios), GFP_KERNEL); | ||
2099 | if (!o_tp) | 2097 | if (!o_tp) |
2100 | goto free_mem_out; | 2098 | goto free_mem_out; |
2101 | *o_tp = driver->other->init_termios; | 2099 | *o_tp = driver->other->init_termios; |
diff --git a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c index e3f6a7d0c83d..c404fc69e7e6 100644 --- a/drivers/char/watchdog/alim1535_wdt.c +++ b/drivers/char/watchdog/alim1535_wdt.c | |||
@@ -312,6 +312,7 @@ static int ali_notify_sys(struct notifier_block *this, unsigned long code, void | |||
312 | */ | 312 | */ |
313 | 313 | ||
314 | static struct pci_device_id ali_pci_tbl[] = { | 314 | static struct pci_device_id ali_pci_tbl[] = { |
315 | { PCI_VENDOR_ID_AL, 0x1533, PCI_ANY_ID, PCI_ANY_ID,}, | ||
315 | { PCI_VENDOR_ID_AL, 0x1535, PCI_ANY_ID, PCI_ANY_ID,}, | 316 | { PCI_VENDOR_ID_AL, 0x1535, PCI_ANY_ID, PCI_ANY_ID,}, |
316 | { 0, }, | 317 | { 0, }, |
317 | }; | 318 | }; |
@@ -329,9 +330,11 @@ static int __init ali_find_watchdog(void) | |||
329 | struct pci_dev *pdev; | 330 | struct pci_dev *pdev; |
330 | u32 wdog; | 331 | u32 wdog; |
331 | 332 | ||
332 | /* Check for a 1535 series bridge */ | 333 | /* Check for a 1533/1535 series bridge */ |
333 | pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x1535, NULL); | 334 | pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x1535, NULL); |
334 | if(pdev == NULL) | 335 | if (pdev == NULL) |
336 | pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x1533, NULL); | ||
337 | if (pdev == NULL) | ||
335 | return -ENODEV; | 338 | return -ENODEV; |
336 | pci_dev_put(pdev); | 339 | pci_dev_put(pdev); |
337 | 340 | ||
diff --git a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c index b070324e27a6..b14e9d1f164d 100644 --- a/drivers/char/watchdog/eurotechwdt.c +++ b/drivers/char/watchdog/eurotechwdt.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Eurotech CPU-1220/1410 on board WDT driver | 2 | * Eurotech CPU-1220/1410/1420 on board WDT driver |
3 | * | 3 | * |
4 | * (c) Copyright 2001 Ascensit <support@ascensit.com> | 4 | * (c) Copyright 2001 Ascensit <support@ascensit.com> |
5 | * (c) Copyright 2001 Rodolfo Giometti <giometti@ascensit.com> | 5 | * (c) Copyright 2001 Rodolfo Giometti <giometti@ascensit.com> |
@@ -25,6 +25,9 @@ | |||
25 | 25 | ||
26 | /* Changelog: | 26 | /* Changelog: |
27 | * | 27 | * |
28 | * 2001 - Rodolfo Giometti | ||
29 | * Initial release | ||
30 | * | ||
28 | * 2002/04/25 - Rob Radez | 31 | * 2002/04/25 - Rob Radez |
29 | * clean up #includes | 32 | * clean up #includes |
30 | * clean up locking | 33 | * clean up locking |
@@ -33,13 +36,15 @@ | |||
33 | * add WDIOC_GETSTATUS and WDIOC_SETOPTIONS ioctls | 36 | * add WDIOC_GETSTATUS and WDIOC_SETOPTIONS ioctls |
34 | * add expect_close support | 37 | * add expect_close support |
35 | * | 38 | * |
36 | * 2001 - Rodolfo Giometti | ||
37 | * Initial release | ||
38 | * | ||
39 | * 2002.05.30 - Joel Becker <joel.becker@oracle.com> | 39 | * 2002.05.30 - Joel Becker <joel.becker@oracle.com> |
40 | * Added Matt Domsch's nowayout module option. | 40 | * Added Matt Domsch's nowayout module option. |
41 | */ | 41 | */ |
42 | 42 | ||
43 | /* | ||
44 | * The eurotech CPU-1220/1410/1420's watchdog is a part | ||
45 | * of the on-board SUPER I/O device SMSC FDC 37B782. | ||
46 | */ | ||
47 | |||
43 | #include <linux/interrupt.h> | 48 | #include <linux/interrupt.h> |
44 | #include <linux/module.h> | 49 | #include <linux/module.h> |
45 | #include <linux/moduleparam.h> | 50 | #include <linux/moduleparam.h> |
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 84ebfcc1ffb4..c0fc4aeb8596 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig | |||
@@ -2,6 +2,11 @@ | |||
2 | menuconfig CRYPTO_HW | 2 | menuconfig CRYPTO_HW |
3 | bool "Hardware crypto devices" | 3 | bool "Hardware crypto devices" |
4 | default y | 4 | default y |
5 | ---help--- | ||
6 | Say Y here to get to see options for hardware crypto devices and | ||
7 | processors. This option alone does not add any kernel code. | ||
8 | |||
9 | If you say N, all options in this submenu will be skipped and disabled. | ||
5 | 10 | ||
6 | if CRYPTO_HW | 11 | if CRYPTO_HW |
7 | 12 | ||
diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c index 5fbe56b5cea0..2d1f17865b64 100644 --- a/drivers/dma/ioatdma.c +++ b/drivers/dma/ioatdma.c | |||
@@ -347,8 +347,7 @@ ioat_dma_prep_memcpy(struct dma_chan *chan, size_t len, int int_en) | |||
347 | new->async_tx.ack = 0; /* client is in control of this ack */ | 347 | new->async_tx.ack = 0; /* client is in control of this ack */ |
348 | new->async_tx.cookie = -EBUSY; | 348 | new->async_tx.cookie = -EBUSY; |
349 | 349 | ||
350 | pci_unmap_len_set(new, src_len, orig_len); | 350 | pci_unmap_len_set(new, len, orig_len); |
351 | pci_unmap_len_set(new, dst_len, orig_len); | ||
352 | spin_unlock_bh(&ioat_chan->desc_lock); | 351 | spin_unlock_bh(&ioat_chan->desc_lock); |
353 | 352 | ||
354 | return new ? &new->async_tx : NULL; | 353 | return new ? &new->async_tx : NULL; |
@@ -423,11 +422,11 @@ static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *chan) | |||
423 | */ | 422 | */ |
424 | pci_unmap_page(chan->device->pdev, | 423 | pci_unmap_page(chan->device->pdev, |
425 | pci_unmap_addr(desc, dst), | 424 | pci_unmap_addr(desc, dst), |
426 | pci_unmap_len(desc, dst_len), | 425 | pci_unmap_len(desc, len), |
427 | PCI_DMA_FROMDEVICE); | 426 | PCI_DMA_FROMDEVICE); |
428 | pci_unmap_page(chan->device->pdev, | 427 | pci_unmap_page(chan->device->pdev, |
429 | pci_unmap_addr(desc, src), | 428 | pci_unmap_addr(desc, src), |
430 | pci_unmap_len(desc, src_len), | 429 | pci_unmap_len(desc, len), |
431 | PCI_DMA_TODEVICE); | 430 | PCI_DMA_TODEVICE); |
432 | } | 431 | } |
433 | 432 | ||
diff --git a/drivers/dma/ioatdma.h b/drivers/dma/ioatdma.h index d3726478031a..bf4dad70e0f5 100644 --- a/drivers/dma/ioatdma.h +++ b/drivers/dma/ioatdma.h | |||
@@ -111,10 +111,9 @@ struct ioat_desc_sw { | |||
111 | struct ioat_dma_descriptor *hw; | 111 | struct ioat_dma_descriptor *hw; |
112 | struct list_head node; | 112 | struct list_head node; |
113 | int tx_cnt; | 113 | int tx_cnt; |
114 | DECLARE_PCI_UNMAP_LEN(len) | ||
114 | DECLARE_PCI_UNMAP_ADDR(src) | 115 | DECLARE_PCI_UNMAP_ADDR(src) |
115 | DECLARE_PCI_UNMAP_LEN(src_len) | ||
116 | DECLARE_PCI_UNMAP_ADDR(dst) | 116 | DECLARE_PCI_UNMAP_ADDR(dst) |
117 | DECLARE_PCI_UNMAP_LEN(dst_len) | ||
118 | struct dma_async_tx_descriptor async_tx; | 117 | struct dma_async_tx_descriptor async_tx; |
119 | }; | 118 | }; |
120 | 119 | ||
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 3b63b0b78122..19667fcc722a 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -5,6 +5,11 @@ menuconfig HID_SUPPORT | |||
5 | bool "HID Devices" | 5 | bool "HID Devices" |
6 | depends on INPUT | 6 | depends on INPUT |
7 | default y | 7 | default y |
8 | ---help--- | ||
9 | Say Y here to get to see options for various computer-human interface | ||
10 | device drivers. This option alone does not add any kernel code. | ||
11 | |||
12 | If you say N, all options in this submenu will be skipped and disabled. | ||
8 | 13 | ||
9 | if HID_SUPPORT | 14 | if HID_SUPPORT |
10 | 15 | ||
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c index 338ee4f54614..d3181967f167 100644 --- a/drivers/hwmon/smsc47m1.c +++ b/drivers/hwmon/smsc47m1.c | |||
@@ -585,6 +585,8 @@ static int __devinit smsc47m1_probe(struct platform_device *pdev) | |||
585 | 585 | ||
586 | if ((err = device_create_file(dev, &dev_attr_alarms))) | 586 | if ((err = device_create_file(dev, &dev_attr_alarms))) |
587 | goto error_remove_files; | 587 | goto error_remove_files; |
588 | if ((err = device_create_file(dev, &dev_attr_name))) | ||
589 | goto error_remove_files; | ||
588 | 590 | ||
589 | data->class_dev = hwmon_device_register(dev); | 591 | data->class_dev = hwmon_device_register(dev); |
590 | if (IS_ERR(data->class_dev)) { | 592 | if (IS_ERR(data->class_dev)) { |
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index c51ae2e17758..d9a9ec7dd84a 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
@@ -309,18 +309,16 @@ static inline int is_word_sized(u16 reg) | |||
309 | || (reg & 0x00ff) == 0x55)); | 309 | || (reg & 0x00ff) == 0x55)); |
310 | } | 310 | } |
311 | 311 | ||
312 | /* We assume that the default bank is 0, thus the following two functions do | 312 | /* Registers 0x50-0x5f are banked */ |
313 | nothing for registers which live in bank 0. For others, they respectively | ||
314 | set the bank register to the correct value (before the register is | ||
315 | accessed), and back to 0 (afterwards). */ | ||
316 | static inline void w83627ehf_set_bank(struct w83627ehf_data *data, u16 reg) | 313 | static inline void w83627ehf_set_bank(struct w83627ehf_data *data, u16 reg) |
317 | { | 314 | { |
318 | if (reg & 0xff00) { | 315 | if ((reg & 0x00f0) == 0x50) { |
319 | outb_p(W83627EHF_REG_BANK, data->addr + ADDR_REG_OFFSET); | 316 | outb_p(W83627EHF_REG_BANK, data->addr + ADDR_REG_OFFSET); |
320 | outb_p(reg >> 8, data->addr + DATA_REG_OFFSET); | 317 | outb_p(reg >> 8, data->addr + DATA_REG_OFFSET); |
321 | } | 318 | } |
322 | } | 319 | } |
323 | 320 | ||
321 | /* Not strictly necessary, but play it safe for now */ | ||
324 | static inline void w83627ehf_reset_bank(struct w83627ehf_data *data, u16 reg) | 322 | static inline void w83627ehf_reset_bank(struct w83627ehf_data *data, u16 reg) |
325 | { | 323 | { |
326 | if (reg & 0xff00) { | 324 | if (reg & 0xff00) { |
@@ -421,6 +419,31 @@ static void w83627ehf_write_fan_div(struct w83627ehf_data *data, int nr) | |||
421 | } | 419 | } |
422 | } | 420 | } |
423 | 421 | ||
422 | static void w83627ehf_update_fan_div(struct w83627ehf_data *data) | ||
423 | { | ||
424 | int i; | ||
425 | |||
426 | i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV1); | ||
427 | data->fan_div[0] = (i >> 4) & 0x03; | ||
428 | data->fan_div[1] = (i >> 6) & 0x03; | ||
429 | i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV2); | ||
430 | data->fan_div[2] = (i >> 6) & 0x03; | ||
431 | i = w83627ehf_read_value(data, W83627EHF_REG_VBAT); | ||
432 | data->fan_div[0] |= (i >> 3) & 0x04; | ||
433 | data->fan_div[1] |= (i >> 4) & 0x04; | ||
434 | data->fan_div[2] |= (i >> 5) & 0x04; | ||
435 | if (data->has_fan & ((1 << 3) | (1 << 4))) { | ||
436 | i = w83627ehf_read_value(data, W83627EHF_REG_DIODE); | ||
437 | data->fan_div[3] = i & 0x03; | ||
438 | data->fan_div[4] = ((i >> 2) & 0x03) | ||
439 | | ((i >> 5) & 0x04); | ||
440 | } | ||
441 | if (data->has_fan & (1 << 3)) { | ||
442 | i = w83627ehf_read_value(data, W83627EHF_REG_SMI_OVT); | ||
443 | data->fan_div[3] |= (i >> 5) & 0x04; | ||
444 | } | ||
445 | } | ||
446 | |||
424 | static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) | 447 | static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) |
425 | { | 448 | { |
426 | struct w83627ehf_data *data = dev_get_drvdata(dev); | 449 | struct w83627ehf_data *data = dev_get_drvdata(dev); |
@@ -432,25 +455,7 @@ static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) | |||
432 | if (time_after(jiffies, data->last_updated + HZ + HZ/2) | 455 | if (time_after(jiffies, data->last_updated + HZ + HZ/2) |
433 | || !data->valid) { | 456 | || !data->valid) { |
434 | /* Fan clock dividers */ | 457 | /* Fan clock dividers */ |
435 | i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV1); | 458 | w83627ehf_update_fan_div(data); |
436 | data->fan_div[0] = (i >> 4) & 0x03; | ||
437 | data->fan_div[1] = (i >> 6) & 0x03; | ||
438 | i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV2); | ||
439 | data->fan_div[2] = (i >> 6) & 0x03; | ||
440 | i = w83627ehf_read_value(data, W83627EHF_REG_VBAT); | ||
441 | data->fan_div[0] |= (i >> 3) & 0x04; | ||
442 | data->fan_div[1] |= (i >> 4) & 0x04; | ||
443 | data->fan_div[2] |= (i >> 5) & 0x04; | ||
444 | if (data->has_fan & ((1 << 3) | (1 << 4))) { | ||
445 | i = w83627ehf_read_value(data, W83627EHF_REG_DIODE); | ||
446 | data->fan_div[3] = i & 0x03; | ||
447 | data->fan_div[4] = ((i >> 2) & 0x03) | ||
448 | | ((i >> 5) & 0x04); | ||
449 | } | ||
450 | if (data->has_fan & (1 << 3)) { | ||
451 | i = w83627ehf_read_value(data, W83627EHF_REG_SMI_OVT); | ||
452 | data->fan_div[3] |= (i >> 5) & 0x04; | ||
453 | } | ||
454 | 459 | ||
455 | /* Measured voltages and limits */ | 460 | /* Measured voltages and limits */ |
456 | for (i = 0; i < data->in_num; i++) { | 461 | for (i = 0; i < data->in_num; i++) { |
@@ -1312,6 +1317,9 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
1312 | if (!(i & (1 << 1)) && (!fan5pin)) | 1317 | if (!(i & (1 << 1)) && (!fan5pin)) |
1313 | data->has_fan |= (1 << 4); | 1318 | data->has_fan |= (1 << 4); |
1314 | 1319 | ||
1320 | /* Read fan clock dividers immediately */ | ||
1321 | w83627ehf_update_fan_div(data); | ||
1322 | |||
1315 | /* Register sysfs hooks */ | 1323 | /* Register sysfs hooks */ |
1316 | for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays); i++) | 1324 | for (i = 0; i < ARRAY_SIZE(sda_sf3_arrays); i++) |
1317 | if ((err = device_create_file(dev, | 1325 | if ((err = device_create_file(dev, |
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index f85b48fea1c4..c95909cc1d21 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -740,9 +740,9 @@ store_sensor(struct device *dev, struct device_attribute *da, | |||
740 | static SENSOR_DEVICE_ATTR(temp1_type, S_IRUGO | S_IWUSR, | 740 | static SENSOR_DEVICE_ATTR(temp1_type, S_IRUGO | S_IWUSR, |
741 | show_sensor, store_sensor, 0); | 741 | show_sensor, store_sensor, 0); |
742 | static SENSOR_DEVICE_ATTR(temp2_type, S_IRUGO | S_IWUSR, | 742 | static SENSOR_DEVICE_ATTR(temp2_type, S_IRUGO | S_IWUSR, |
743 | show_sensor, store_sensor, 0); | 743 | show_sensor, store_sensor, 1); |
744 | static SENSOR_DEVICE_ATTR(temp3_type, S_IRUGO | S_IWUSR, | 744 | static SENSOR_DEVICE_ATTR(temp3_type, S_IRUGO | S_IWUSR, |
745 | show_sensor, store_sensor, 0); | 745 | show_sensor, store_sensor, 2); |
746 | 746 | ||
747 | /* I2C devices get this name attribute automatically, but for ISA devices | 747 | /* I2C devices get this name attribute automatically, but for ISA devices |
748 | we must create it by ourselves. */ | 748 | we must create it by ourselves. */ |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index e049f65bc3a2..7adb61bad6ad 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -304,9 +304,9 @@ comment "IDE chipset support/bugfixes" | |||
304 | 304 | ||
305 | config IDE_GENERIC | 305 | config IDE_GENERIC |
306 | tristate "generic/default IDE chipset support" | 306 | tristate "generic/default IDE chipset support" |
307 | default y | 307 | default H8300 |
308 | help | 308 | help |
309 | If unsure, say Y. | 309 | If unsure, say N. |
310 | 310 | ||
311 | config BLK_DEV_CMD640 | 311 | config BLK_DEV_CMD640 |
312 | bool "CMD640 chipset bugfix/support" | 312 | bool "CMD640 chipset bugfix/support" |
@@ -345,6 +345,7 @@ config BLK_DEV_CMD640_ENHANCED | |||
345 | config BLK_DEV_IDEPNP | 345 | config BLK_DEV_IDEPNP |
346 | bool "PNP EIDE support" | 346 | bool "PNP EIDE support" |
347 | depends on PNP | 347 | depends on PNP |
348 | select IDE_GENERIC | ||
348 | help | 349 | help |
349 | If you have a PnP (Plug and Play) compatible EIDE card and | 350 | If you have a PnP (Plug and Play) compatible EIDE card and |
350 | would like the kernel to automatically detect and activate | 351 | would like the kernel to automatically detect and activate |
@@ -834,6 +835,7 @@ config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ | |||
834 | 835 | ||
835 | config IDE_ARM | 836 | config IDE_ARM |
836 | def_bool ARM && (ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK) | 837 | def_bool ARM && (ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK) |
838 | select IDE_GENERIC | ||
837 | 839 | ||
838 | config BLK_DEV_IDE_ICSIDE | 840 | config BLK_DEV_IDE_ICSIDE |
839 | tristate "ICS IDE interface support" | 841 | tristate "ICS IDE interface support" |
@@ -867,6 +869,7 @@ config BLK_DEV_IDE_BAST | |||
867 | config BLK_DEV_GAYLE | 869 | config BLK_DEV_GAYLE |
868 | bool "Amiga Gayle IDE interface support" | 870 | bool "Amiga Gayle IDE interface support" |
869 | depends on AMIGA | 871 | depends on AMIGA |
872 | select IDE_GENERIC | ||
870 | help | 873 | help |
871 | This is the IDE driver for the Amiga Gayle IDE interface. It supports | 874 | This is the IDE driver for the Amiga Gayle IDE interface. It supports |
872 | both the `A1200 style' and `A4000 style' of the Gayle IDE interface, | 875 | both the `A1200 style' and `A4000 style' of the Gayle IDE interface, |
@@ -898,6 +901,7 @@ config BLK_DEV_IDEDOUBLER | |||
898 | config BLK_DEV_BUDDHA | 901 | config BLK_DEV_BUDDHA |
899 | bool "Buddha/Catweasel/X-Surf IDE interface support (EXPERIMENTAL)" | 902 | bool "Buddha/Catweasel/X-Surf IDE interface support (EXPERIMENTAL)" |
900 | depends on ZORRO && EXPERIMENTAL | 903 | depends on ZORRO && EXPERIMENTAL |
904 | select IDE_GENERIC | ||
901 | help | 905 | help |
902 | This is the IDE driver for the IDE interfaces on the Buddha, | 906 | This is the IDE driver for the IDE interfaces on the Buddha, |
903 | Catweasel and X-Surf expansion boards. It supports up to two interfaces | 907 | Catweasel and X-Surf expansion boards. It supports up to two interfaces |
@@ -910,6 +914,7 @@ config BLK_DEV_BUDDHA | |||
910 | config BLK_DEV_FALCON_IDE | 914 | config BLK_DEV_FALCON_IDE |
911 | bool "Falcon IDE interface support" | 915 | bool "Falcon IDE interface support" |
912 | depends on ATARI | 916 | depends on ATARI |
917 | select IDE_GENERIC | ||
913 | help | 918 | help |
914 | This is the IDE driver for the builtin IDE interface on the Atari | 919 | This is the IDE driver for the builtin IDE interface on the Atari |
915 | Falcon. Say Y if you have a Falcon and want to use IDE devices (hard | 920 | Falcon. Say Y if you have a Falcon and want to use IDE devices (hard |
@@ -919,6 +924,7 @@ config BLK_DEV_FALCON_IDE | |||
919 | config BLK_DEV_MAC_IDE | 924 | config BLK_DEV_MAC_IDE |
920 | bool "Macintosh Quadra/Powerbook IDE interface support" | 925 | bool "Macintosh Quadra/Powerbook IDE interface support" |
921 | depends on MAC | 926 | depends on MAC |
927 | select IDE_GENERIC | ||
922 | help | 928 | help |
923 | This is the IDE driver for the builtin IDE interface on some m68k | 929 | This is the IDE driver for the builtin IDE interface on some m68k |
924 | Macintosh models. It supports both the `Quadra style' (used in | 930 | Macintosh models. It supports both the `Quadra style' (used in |
@@ -932,6 +938,7 @@ config BLK_DEV_MAC_IDE | |||
932 | config BLK_DEV_Q40IDE | 938 | config BLK_DEV_Q40IDE |
933 | bool "Q40/Q60 IDE interface support" | 939 | bool "Q40/Q60 IDE interface support" |
934 | depends on Q40 | 940 | depends on Q40 |
941 | select IDE_GENERIC | ||
935 | help | 942 | help |
936 | Enable the on-board IDE controller in the Q40/Q60. This should | 943 | Enable the on-board IDE controller in the Q40/Q60. This should |
937 | normally be on; disable it only if you are running a custom hard | 944 | normally be on; disable it only if you are running a custom hard |
@@ -940,6 +947,7 @@ config BLK_DEV_Q40IDE | |||
940 | config BLK_DEV_MPC8xx_IDE | 947 | config BLK_DEV_MPC8xx_IDE |
941 | bool "MPC8xx IDE support" | 948 | bool "MPC8xx IDE support" |
942 | depends on 8xx && IDE=y && BLK_DEV_IDE=y | 949 | depends on 8xx && IDE=y && BLK_DEV_IDE=y |
950 | select IDE_GENERIC | ||
943 | help | 951 | help |
944 | This option provides support for IDE on Motorola MPC8xx Systems. | 952 | This option provides support for IDE on Motorola MPC8xx Systems. |
945 | Please see 'Type of MPC8xx IDE interface' for details. | 953 | Please see 'Type of MPC8xx IDE interface' for details. |
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c index fbfea46a34f2..04636f7eaae7 100644 --- a/drivers/ide/cris/ide-cris.c +++ b/drivers/ide/cris/ide-cris.c | |||
@@ -718,6 +718,8 @@ static void tune_cris_ide(ide_drive_t *drive, u8 pio) | |||
718 | } | 718 | } |
719 | 719 | ||
720 | cris_ide_set_speed(TYPE_PIO, setup, strobe, hold); | 720 | cris_ide_set_speed(TYPE_PIO, setup, strobe, hold); |
721 | |||
722 | (void)ide_config_drive_speed(drive, XFER_PIO_0 + pio); | ||
721 | } | 723 | } |
722 | 724 | ||
723 | static int speed_cris_ide(ide_drive_t *drive, u8 speed) | 725 | static int speed_cris_ide(ide_drive_t *drive, u8 speed) |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 5ce4216f72a2..eba1adbc1b6a 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -481,6 +481,15 @@ static inline int idedisk_supports_lba48(const struct hd_driveid *id) | |||
481 | && id->lba_capacity_2; | 481 | && id->lba_capacity_2; |
482 | } | 482 | } |
483 | 483 | ||
484 | /* | ||
485 | * Some disks report total number of sectors instead of | ||
486 | * maximum sector address. We list them here. | ||
487 | */ | ||
488 | static const struct drive_list_entry hpa_list[] = { | ||
489 | { "ST340823A", NULL }, | ||
490 | { NULL, NULL } | ||
491 | }; | ||
492 | |||
484 | static void idedisk_check_hpa(ide_drive_t *drive) | 493 | static void idedisk_check_hpa(ide_drive_t *drive) |
485 | { | 494 | { |
486 | unsigned long long capacity, set_max; | 495 | unsigned long long capacity, set_max; |
@@ -492,6 +501,15 @@ static void idedisk_check_hpa(ide_drive_t *drive) | |||
492 | else | 501 | else |
493 | set_max = idedisk_read_native_max_address(drive); | 502 | set_max = idedisk_read_native_max_address(drive); |
494 | 503 | ||
504 | if (ide_in_drive_list(drive->id, hpa_list)) { | ||
505 | /* | ||
506 | * Since we are inclusive wrt to firmware revisions do this | ||
507 | * extra check and apply the workaround only when needed. | ||
508 | */ | ||
509 | if (set_max == capacity + 1) | ||
510 | set_max--; | ||
511 | } | ||
512 | |||
495 | if (set_max <= capacity) | 513 | if (set_max <= capacity) |
496 | return; | 514 | return; |
497 | 515 | ||
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 5fe1d72ab451..ff644a5e12cd 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -135,25 +135,6 @@ static const struct drive_list_entry drive_blacklist [] = { | |||
135 | }; | 135 | }; |
136 | 136 | ||
137 | /** | 137 | /** |
138 | * ide_in_drive_list - look for drive in black/white list | ||
139 | * @id: drive identifier | ||
140 | * @drive_table: list to inspect | ||
141 | * | ||
142 | * Look for a drive in the blacklist and the whitelist tables | ||
143 | * Returns 1 if the drive is found in the table. | ||
144 | */ | ||
145 | |||
146 | int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table) | ||
147 | { | ||
148 | for ( ; drive_table->id_model ; drive_table++) | ||
149 | if ((!strcmp(drive_table->id_model, id->model)) && | ||
150 | (!drive_table->id_firmware || | ||
151 | strstr(id->fw_rev, drive_table->id_firmware))) | ||
152 | return 1; | ||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | /** | ||
157 | * ide_dma_intr - IDE DMA interrupt handler | 138 | * ide_dma_intr - IDE DMA interrupt handler |
158 | * @drive: the drive the interrupt is for | 139 | * @drive: the drive the interrupt is for |
159 | * | 140 | * |
@@ -349,9 +330,17 @@ EXPORT_SYMBOL_GPL(ide_destroy_dmatable); | |||
349 | 330 | ||
350 | static int config_drive_for_dma (ide_drive_t *drive) | 331 | static int config_drive_for_dma (ide_drive_t *drive) |
351 | { | 332 | { |
333 | ide_hwif_t *hwif = drive->hwif; | ||
352 | struct hd_driveid *id = drive->id; | 334 | struct hd_driveid *id = drive->id; |
353 | 335 | ||
354 | if ((id->capability & 1) && drive->hwif->autodma) { | 336 | /* consult the list of known "bad" drives */ |
337 | if (__ide_dma_bad_drive(drive)) | ||
338 | return -1; | ||
339 | |||
340 | if (drive->media != ide_disk && hwif->atapi_dma == 0) | ||
341 | return -1; | ||
342 | |||
343 | if ((id->capability & 1) && drive->autodma) { | ||
355 | /* | 344 | /* |
356 | * Enable DMA on any drive that has | 345 | * Enable DMA on any drive that has |
357 | * UltraDMA (mode 0/1/2/3/4/5/6) enabled | 346 | * UltraDMA (mode 0/1/2/3/4/5/6) enabled |
@@ -514,20 +503,6 @@ int __ide_dma_on (ide_drive_t *drive) | |||
514 | EXPORT_SYMBOL(__ide_dma_on); | 503 | EXPORT_SYMBOL(__ide_dma_on); |
515 | 504 | ||
516 | /** | 505 | /** |
517 | * __ide_dma_check - check DMA setup | ||
518 | * @drive: drive to check | ||
519 | * | ||
520 | * Don't use - due for extermination | ||
521 | */ | ||
522 | |||
523 | int __ide_dma_check (ide_drive_t *drive) | ||
524 | { | ||
525 | return config_drive_for_dma(drive); | ||
526 | } | ||
527 | |||
528 | EXPORT_SYMBOL(__ide_dma_check); | ||
529 | |||
530 | /** | ||
531 | * ide_dma_setup - begin a DMA phase | 506 | * ide_dma_setup - begin a DMA phase |
532 | * @drive: target device | 507 | * @drive: target device |
533 | * | 508 | * |
@@ -1021,7 +996,7 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p | |||
1021 | if (!hwif->dma_host_on) | 996 | if (!hwif->dma_host_on) |
1022 | hwif->dma_host_on = &ide_dma_host_on; | 997 | hwif->dma_host_on = &ide_dma_host_on; |
1023 | if (!hwif->ide_dma_check) | 998 | if (!hwif->ide_dma_check) |
1024 | hwif->ide_dma_check = &__ide_dma_check; | 999 | hwif->ide_dma_check = &config_drive_for_dma; |
1025 | if (!hwif->dma_setup) | 1000 | if (!hwif->dma_setup) |
1026 | hwif->dma_setup = &ide_dma_setup; | 1001 | hwif->dma_setup = &ide_dma_setup; |
1027 | if (!hwif->dma_exec_cmd) | 1002 | if (!hwif->dma_exec_cmd) |
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 92578b6832e9..f4cd2700cae5 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -565,6 +565,36 @@ int ide_wait_stat (ide_startstop_t *startstop, ide_drive_t *drive, u8 good, u8 b | |||
565 | 565 | ||
566 | EXPORT_SYMBOL(ide_wait_stat); | 566 | EXPORT_SYMBOL(ide_wait_stat); |
567 | 567 | ||
568 | /** | ||
569 | * ide_in_drive_list - look for drive in black/white list | ||
570 | * @id: drive identifier | ||
571 | * @drive_table: list to inspect | ||
572 | * | ||
573 | * Look for a drive in the blacklist and the whitelist tables | ||
574 | * Returns 1 if the drive is found in the table. | ||
575 | */ | ||
576 | |||
577 | int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *drive_table) | ||
578 | { | ||
579 | for ( ; drive_table->id_model; drive_table++) | ||
580 | if ((!strcmp(drive_table->id_model, id->model)) && | ||
581 | (!drive_table->id_firmware || | ||
582 | strstr(id->fw_rev, drive_table->id_firmware))) | ||
583 | return 1; | ||
584 | return 0; | ||
585 | } | ||
586 | |||
587 | EXPORT_SYMBOL_GPL(ide_in_drive_list); | ||
588 | |||
589 | /* | ||
590 | * Early UDMA66 devices don't set bit14 to 1, only bit13 is valid. | ||
591 | * We list them here and depend on the device side cable detection for them. | ||
592 | */ | ||
593 | static const struct drive_list_entry ivb_list[] = { | ||
594 | { "QUANTUM FIREBALLlct10 05" , "A03.0900" }, | ||
595 | { NULL , NULL } | ||
596 | }; | ||
597 | |||
568 | /* | 598 | /* |
569 | * All hosts that use the 80c ribbon must use! | 599 | * All hosts that use the 80c ribbon must use! |
570 | * The name is derived from upper byte of word 93 and the 80c ribbon. | 600 | * The name is derived from upper byte of word 93 and the 80c ribbon. |
@@ -573,11 +603,16 @@ u8 eighty_ninty_three (ide_drive_t *drive) | |||
573 | { | 603 | { |
574 | ide_hwif_t *hwif = drive->hwif; | 604 | ide_hwif_t *hwif = drive->hwif; |
575 | struct hd_driveid *id = drive->id; | 605 | struct hd_driveid *id = drive->id; |
606 | int ivb = ide_in_drive_list(id, ivb_list); | ||
576 | 607 | ||
577 | if (hwif->cbl == ATA_CBL_PATA40_SHORT) | 608 | if (hwif->cbl == ATA_CBL_PATA40_SHORT) |
578 | return 1; | 609 | return 1; |
579 | 610 | ||
580 | if (hwif->cbl != ATA_CBL_PATA80) | 611 | if (ivb) |
612 | printk(KERN_DEBUG "%s: skipping word 93 validity check\n", | ||
613 | drive->name); | ||
614 | |||
615 | if (hwif->cbl != ATA_CBL_PATA80 && !ivb) | ||
581 | goto no_80w; | 616 | goto no_80w; |
582 | 617 | ||
583 | /* Check for SATA but only if we are ATA5 or higher */ | 618 | /* Check for SATA but only if we are ATA5 or higher */ |
@@ -587,11 +622,11 @@ u8 eighty_ninty_three (ide_drive_t *drive) | |||
587 | /* | 622 | /* |
588 | * FIXME: | 623 | * FIXME: |
589 | * - change master/slave IDENTIFY order | 624 | * - change master/slave IDENTIFY order |
590 | * - force bit13 (80c cable present) check | 625 | * - force bit13 (80c cable present) check also for !ivb devices |
591 | * (unless the slave device is pre-ATA3) | 626 | * (unless the slave device is pre-ATA3) |
592 | */ | 627 | */ |
593 | #ifndef CONFIG_IDEDMA_IVB | 628 | #ifndef CONFIG_IDEDMA_IVB |
594 | if (id->hw_config & 0x4000) | 629 | if ((id->hw_config & 0x4000) || (ivb && (id->hw_config & 0x2000))) |
595 | #else | 630 | #else |
596 | if (id->hw_config & 0x6000) | 631 | if (id->hw_config & 0x6000) |
597 | #endif | 632 | #endif |
@@ -795,7 +830,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed) | |||
795 | hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG); | 830 | hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG); |
796 | hwif->OUTB(speed, IDE_NSECTOR_REG); | 831 | hwif->OUTB(speed, IDE_NSECTOR_REG); |
797 | hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG); | 832 | hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG); |
798 | hwif->OUTB(WIN_SETFEATURES, IDE_COMMAND_REG); | 833 | hwif->OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG); |
799 | if ((IDE_CONTROL_REG) && (drive->quirk_list == 2)) | 834 | if ((IDE_CONTROL_REG) && (drive->quirk_list == 2)) |
800 | hwif->OUTB(drive->ctl, IDE_CONTROL_REG); | 835 | hwif->OUTB(drive->ctl, IDE_CONTROL_REG); |
801 | udelay(1); | 836 | udelay(1); |
@@ -822,7 +857,7 @@ int ide_config_drive_speed (ide_drive_t *drive, u8 speed) | |||
822 | */ | 857 | */ |
823 | for (i = 0; i < 10; i++) { | 858 | for (i = 0; i < 10; i++) { |
824 | udelay(1); | 859 | udelay(1); |
825 | if (OK_STAT((stat = hwif->INB(IDE_STATUS_REG)), DRIVE_READY, BUSY_STAT|DRQ_STAT|ERR_STAT)) { | 860 | if (OK_STAT((stat = hwif->INB(IDE_STATUS_REG)), drive->ready_stat, BUSY_STAT|DRQ_STAT|ERR_STAT)) { |
826 | error = 0; | 861 | error = 0; |
827 | break; | 862 | break; |
828 | } | 863 | } |
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c index acaf71fd4c09..e5949b1d3fb0 100644 --- a/drivers/ide/pci/cs5530.c +++ b/drivers/ide/pci/cs5530.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/cs5530.c Version 0.73 Mar 10 2007 | 2 | * linux/drivers/ide/pci/cs5530.c Version 0.74 Jul 28 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org> | 4 | * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org> |
5 | * Copyright (C) 2000 Mark Lord <mlord@pobox.com> | 5 | * Copyright (C) 2000 Mark Lord <mlord@pobox.com> |
@@ -207,6 +207,9 @@ static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const ch | |||
207 | struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; | 207 | struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; |
208 | unsigned long flags; | 208 | unsigned long flags; |
209 | 209 | ||
210 | if (pci_resource_start(dev, 4) == 0) | ||
211 | return -EFAULT; | ||
212 | |||
210 | dev = NULL; | 213 | dev = NULL; |
211 | while ((dev = pci_get_device(PCI_VENDOR_ID_CYRIX, PCI_ANY_ID, dev)) != NULL) { | 214 | while ((dev = pci_get_device(PCI_VENDOR_ID_CYRIX, PCI_ANY_ID, dev)) != NULL) { |
212 | switch (dev->device) { | 215 | switch (dev->device) { |
@@ -325,6 +328,9 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif) | |||
325 | /* needs autotuning later */ | 328 | /* needs autotuning later */ |
326 | } | 329 | } |
327 | 330 | ||
331 | if (hwif->dma_base == 0) | ||
332 | return; | ||
333 | |||
328 | hwif->atapi_dma = 1; | 334 | hwif->atapi_dma = 1; |
329 | hwif->ultra_mask = 0x07; | 335 | hwif->ultra_mask = 0x07; |
330 | hwif->mwdma_mask = 0x07; | 336 | hwif->mwdma_mask = 0x07; |
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index 19778c5fe711..cb8fe5643d3b 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c | |||
@@ -89,11 +89,7 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive) | |||
89 | drive->init_speed = 0; | 89 | drive->init_speed = 0; |
90 | 90 | ||
91 | if (ide_tune_dma(drive)) | 91 | if (ide_tune_dma(drive)) |
92 | #ifndef CONFIG_HPT34X_AUTODMA | ||
93 | return -1; | 92 | return -1; |
94 | #else | ||
95 | return 0; | ||
96 | #endif | ||
97 | 93 | ||
98 | if (ide_use_fast_pio(drive)) | 94 | if (ide_use_fast_pio(drive)) |
99 | hpt34x_tune_drive(drive, 255); | 95 | hpt34x_tune_drive(drive, 255); |
@@ -160,9 +156,11 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif) | |||
160 | if (!hwif->dma_base) | 156 | if (!hwif->dma_base) |
161 | return; | 157 | return; |
162 | 158 | ||
159 | #ifdef CONFIG_HPT34X_AUTODMA | ||
163 | hwif->ultra_mask = 0x07; | 160 | hwif->ultra_mask = 0x07; |
164 | hwif->mwdma_mask = 0x07; | 161 | hwif->mwdma_mask = 0x07; |
165 | hwif->swdma_mask = 0x07; | 162 | hwif->swdma_mask = 0x07; |
163 | #endif | ||
166 | 164 | ||
167 | hwif->ide_dma_check = &hpt34x_config_drive_xfer_rate; | 165 | hwif->ide_dma_check = &hpt34x_config_drive_xfer_rate; |
168 | if (!noautodma) | 166 | if (!noautodma) |
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index 09941f37d635..465c935fdf25 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c | |||
@@ -187,14 +187,6 @@ static int ns87415_ide_dma_setup(ide_drive_t *drive) | |||
187 | return 1; | 187 | return 1; |
188 | } | 188 | } |
189 | 189 | ||
190 | static int ns87415_ide_dma_check (ide_drive_t *drive) | ||
191 | { | ||
192 | if (drive->media != ide_disk) | ||
193 | return -1; | ||
194 | |||
195 | return __ide_dma_check(drive); | ||
196 | } | ||
197 | |||
198 | static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) | 190 | static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) |
199 | { | 191 | { |
200 | struct pci_dev *dev = hwif->pci_dev; | 192 | struct pci_dev *dev = hwif->pci_dev; |
@@ -266,7 +258,6 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) | |||
266 | 258 | ||
267 | outb(0x60, hwif->dma_status); | 259 | outb(0x60, hwif->dma_status); |
268 | hwif->dma_setup = &ns87415_ide_dma_setup; | 260 | hwif->dma_setup = &ns87415_ide_dma_setup; |
269 | hwif->ide_dma_check = &ns87415_ide_dma_check; | ||
270 | hwif->ide_dma_end = &ns87415_ide_dma_end; | 261 | hwif->ide_dma_end = &ns87415_ide_dma_end; |
271 | 262 | ||
272 | if (!noautodma) | 263 | if (!noautodma) |
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 8a66a2871b3a..f6db2f37efad 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c | |||
@@ -378,6 +378,9 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha | |||
378 | int f, r; | 378 | int f, r; |
379 | u8 pll_ctl0, pll_ctl1; | 379 | u8 pll_ctl0, pll_ctl1; |
380 | 380 | ||
381 | if (dma_base == 0) | ||
382 | return -EFAULT; | ||
383 | |||
381 | #ifdef CONFIG_PPC_PMAC | 384 | #ifdef CONFIG_PPC_PMAC |
382 | apple_kiwi_init(dev); | 385 | apple_kiwi_init(dev); |
383 | #endif | 386 | #endif |
@@ -494,15 +497,18 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif) | |||
494 | hwif->speedproc = &pdcnew_tune_chipset; | 497 | hwif->speedproc = &pdcnew_tune_chipset; |
495 | hwif->resetproc = &pdcnew_reset; | 498 | hwif->resetproc = &pdcnew_reset; |
496 | 499 | ||
500 | hwif->err_stops_fifo = 1; | ||
501 | |||
497 | hwif->drives[0].autotune = hwif->drives[1].autotune = 1; | 502 | hwif->drives[0].autotune = hwif->drives[1].autotune = 1; |
498 | 503 | ||
504 | if (hwif->dma_base == 0) | ||
505 | return; | ||
506 | |||
499 | hwif->atapi_dma = 1; | 507 | hwif->atapi_dma = 1; |
500 | 508 | ||
501 | hwif->ultra_mask = hwif->cds->udma_mask; | 509 | hwif->ultra_mask = hwif->cds->udma_mask; |
502 | hwif->mwdma_mask = 0x07; | 510 | hwif->mwdma_mask = 0x07; |
503 | 511 | ||
504 | hwif->err_stops_fifo = 1; | ||
505 | |||
506 | hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate; | 512 | hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate; |
507 | 513 | ||
508 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) | 514 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) |
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index fbcb0bb9c956..e19a891171cb 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/pdc202xx_old.c Version 0.50 Mar 3, 2007 | 2 | * linux/drivers/ide/pci/pdc202xx_old.c Version 0.51 Jul 27, 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> | 4 | * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> |
5 | * Copyright (C) 2006-2007 MontaVista Software, Inc. | 5 | * Copyright (C) 2006-2007 MontaVista Software, Inc. |
@@ -337,15 +337,18 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) | |||
337 | 337 | ||
338 | hwif->speedproc = &pdc202xx_tune_chipset; | 338 | hwif->speedproc = &pdc202xx_tune_chipset; |
339 | 339 | ||
340 | hwif->err_stops_fifo = 1; | ||
341 | |||
340 | hwif->drives[0].autotune = hwif->drives[1].autotune = 1; | 342 | hwif->drives[0].autotune = hwif->drives[1].autotune = 1; |
341 | 343 | ||
344 | if (hwif->dma_base == 0) | ||
345 | return; | ||
346 | |||
342 | hwif->ultra_mask = hwif->cds->udma_mask; | 347 | hwif->ultra_mask = hwif->cds->udma_mask; |
343 | hwif->mwdma_mask = 0x07; | 348 | hwif->mwdma_mask = 0x07; |
344 | hwif->swdma_mask = 0x07; | 349 | hwif->swdma_mask = 0x07; |
345 | hwif->atapi_dma = 1; | 350 | hwif->atapi_dma = 1; |
346 | 351 | ||
347 | hwif->err_stops_fifo = 1; | ||
348 | |||
349 | hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; | 352 | hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; |
350 | hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; | 353 | hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; |
351 | hwif->dma_timeout = &pdc202xx_dma_timeout; | 354 | hwif->dma_timeout = &pdc202xx_dma_timeout; |
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index 024bbfae0429..098692a6d615 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c | |||
@@ -115,6 +115,9 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif) | |||
115 | hwif->tuneproc = &triflex_tune_drive; | 115 | hwif->tuneproc = &triflex_tune_drive; |
116 | hwif->speedproc = &triflex_tune_chipset; | 116 | hwif->speedproc = &triflex_tune_chipset; |
117 | 117 | ||
118 | if (hwif->dma_base == 0) | ||
119 | return; | ||
120 | |||
118 | hwif->atapi_dma = 1; | 121 | hwif->atapi_dma = 1; |
119 | hwif->mwdma_mask = 0x07; | 122 | hwif->mwdma_mask = 0x07; |
120 | hwif->swdma_mask = 0x07; | 123 | hwif->swdma_mask = 0x07; |
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 33630ad3e794..4b13cd9a027d 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -604,6 +604,9 @@ out: | |||
604 | drive->id->dma_1word |= 0x0101; break; | 604 | drive->id->dma_1word |= 0x0101; break; |
605 | default: break; | 605 | default: break; |
606 | } | 606 | } |
607 | if (!drive->init_speed) | ||
608 | drive->init_speed = command; | ||
609 | drive->current_speed = command; | ||
607 | } | 610 | } |
608 | enable_irq(hwif->irq); | 611 | enable_irq(hwif->irq); |
609 | return result; | 612 | return result; |
@@ -986,7 +989,6 @@ pmac_ide_tune_chipset (ide_drive_t *drive, byte speed) | |||
986 | return ret; | 989 | return ret; |
987 | 990 | ||
988 | pmac_ide_do_update_timings(drive); | 991 | pmac_ide_do_update_timings(drive); |
989 | drive->current_speed = speed; | ||
990 | 992 | ||
991 | return 0; | 993 | return 0; |
992 | } | 994 | } |
@@ -1737,11 +1739,6 @@ pmac_ide_mdma_enable(ide_drive_t *drive, u16 mode) | |||
1737 | /* Apply timings to controller */ | 1739 | /* Apply timings to controller */ |
1738 | *timings = timing_local[0]; | 1740 | *timings = timing_local[0]; |
1739 | *timings2 = timing_local[1]; | 1741 | *timings2 = timing_local[1]; |
1740 | |||
1741 | /* Set speed info in drive */ | ||
1742 | drive->current_speed = mode; | ||
1743 | if (!drive->init_speed) | ||
1744 | drive->init_speed = mode; | ||
1745 | 1742 | ||
1746 | return 1; | 1743 | return 1; |
1747 | } | 1744 | } |
@@ -1793,11 +1790,6 @@ pmac_ide_udma_enable(ide_drive_t *drive, u16 mode) | |||
1793 | *timings = timing_local[0]; | 1790 | *timings = timing_local[0]; |
1794 | *timings2 = timing_local[1]; | 1791 | *timings2 = timing_local[1]; |
1795 | 1792 | ||
1796 | /* Set speed info in drive */ | ||
1797 | drive->current_speed = mode; | ||
1798 | if (!drive->init_speed) | ||
1799 | drive->init_speed = mode; | ||
1800 | |||
1801 | return 1; | 1793 | return 1; |
1802 | } | 1794 | } |
1803 | 1795 | ||
diff --git a/drivers/infiniband/core/agent.c b/drivers/infiniband/core/agent.c index db2633e4aae6..ae7c2880e624 100644 --- a/drivers/infiniband/core/agent.c +++ b/drivers/infiniband/core/agent.c | |||
@@ -78,15 +78,14 @@ ib_get_agent_port(struct ib_device *device, int port_num) | |||
78 | return entry; | 78 | return entry; |
79 | } | 79 | } |
80 | 80 | ||
81 | int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, | 81 | void agent_send_response(struct ib_mad *mad, struct ib_grh *grh, |
82 | struct ib_wc *wc, struct ib_device *device, | 82 | struct ib_wc *wc, struct ib_device *device, |
83 | int port_num, int qpn) | 83 | int port_num, int qpn) |
84 | { | 84 | { |
85 | struct ib_agent_port_private *port_priv; | 85 | struct ib_agent_port_private *port_priv; |
86 | struct ib_mad_agent *agent; | 86 | struct ib_mad_agent *agent; |
87 | struct ib_mad_send_buf *send_buf; | 87 | struct ib_mad_send_buf *send_buf; |
88 | struct ib_ah *ah; | 88 | struct ib_ah *ah; |
89 | int ret; | ||
90 | struct ib_mad_send_wr_private *mad_send_wr; | 89 | struct ib_mad_send_wr_private *mad_send_wr; |
91 | 90 | ||
92 | if (device->node_type == RDMA_NODE_IB_SWITCH) | 91 | if (device->node_type == RDMA_NODE_IB_SWITCH) |
@@ -96,23 +95,21 @@ int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, | |||
96 | 95 | ||
97 | if (!port_priv) { | 96 | if (!port_priv) { |
98 | printk(KERN_ERR SPFX "Unable to find port agent\n"); | 97 | printk(KERN_ERR SPFX "Unable to find port agent\n"); |
99 | return -ENODEV; | 98 | return; |
100 | } | 99 | } |
101 | 100 | ||
102 | agent = port_priv->agent[qpn]; | 101 | agent = port_priv->agent[qpn]; |
103 | ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num); | 102 | ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num); |
104 | if (IS_ERR(ah)) { | 103 | if (IS_ERR(ah)) { |
105 | ret = PTR_ERR(ah); | 104 | printk(KERN_ERR SPFX "ib_create_ah_from_wc error\n"); |
106 | printk(KERN_ERR SPFX "ib_create_ah_from_wc error:%d\n", ret); | 105 | return; |
107 | return ret; | ||
108 | } | 106 | } |
109 | 107 | ||
110 | send_buf = ib_create_send_mad(agent, wc->src_qp, wc->pkey_index, 0, | 108 | send_buf = ib_create_send_mad(agent, wc->src_qp, wc->pkey_index, 0, |
111 | IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA, | 109 | IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA, |
112 | GFP_KERNEL); | 110 | GFP_KERNEL); |
113 | if (IS_ERR(send_buf)) { | 111 | if (IS_ERR(send_buf)) { |
114 | ret = PTR_ERR(send_buf); | 112 | printk(KERN_ERR SPFX "ib_create_send_mad error\n"); |
115 | printk(KERN_ERR SPFX "ib_create_send_mad error:%d\n", ret); | ||
116 | goto err1; | 113 | goto err1; |
117 | } | 114 | } |
118 | 115 | ||
@@ -126,16 +123,15 @@ int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, | |||
126 | mad_send_wr->send_wr.wr.ud.port_num = port_num; | 123 | mad_send_wr->send_wr.wr.ud.port_num = port_num; |
127 | } | 124 | } |
128 | 125 | ||
129 | if ((ret = ib_post_send_mad(send_buf, NULL))) { | 126 | if (ib_post_send_mad(send_buf, NULL)) { |
130 | printk(KERN_ERR SPFX "ib_post_send_mad error:%d\n", ret); | 127 | printk(KERN_ERR SPFX "ib_post_send_mad error\n"); |
131 | goto err2; | 128 | goto err2; |
132 | } | 129 | } |
133 | return 0; | 130 | return; |
134 | err2: | 131 | err2: |
135 | ib_free_send_mad(send_buf); | 132 | ib_free_send_mad(send_buf); |
136 | err1: | 133 | err1: |
137 | ib_destroy_ah(ah); | 134 | ib_destroy_ah(ah); |
138 | return ret; | ||
139 | } | 135 | } |
140 | 136 | ||
141 | static void agent_send_handler(struct ib_mad_agent *mad_agent, | 137 | static void agent_send_handler(struct ib_mad_agent *mad_agent, |
diff --git a/drivers/infiniband/core/agent.h b/drivers/infiniband/core/agent.h index 86d72fab37b0..fb9ed1489f95 100644 --- a/drivers/infiniband/core/agent.h +++ b/drivers/infiniband/core/agent.h | |||
@@ -46,8 +46,8 @@ extern int ib_agent_port_open(struct ib_device *device, int port_num); | |||
46 | 46 | ||
47 | extern int ib_agent_port_close(struct ib_device *device, int port_num); | 47 | extern int ib_agent_port_close(struct ib_device *device, int port_num); |
48 | 48 | ||
49 | extern int agent_send_response(struct ib_mad *mad, struct ib_grh *grh, | 49 | extern void agent_send_response(struct ib_mad *mad, struct ib_grh *grh, |
50 | struct ib_wc *wc, struct ib_device *device, | 50 | struct ib_wc *wc, struct ib_device *device, |
51 | int port_num, int qpn); | 51 | int port_num, int qpn); |
52 | 52 | ||
53 | #endif /* __AGENT_H_ */ | 53 | #endif /* __AGENT_H_ */ |
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 3ada17c0f239..2506c43ba041 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c | |||
@@ -702,7 +702,7 @@ int ib_find_pkey(struct ib_device *device, | |||
702 | if (ret) | 702 | if (ret) |
703 | return ret; | 703 | return ret; |
704 | 704 | ||
705 | if (pkey == tmp_pkey) { | 705 | if ((pkey & 0x7fff) == (tmp_pkey & 0x7fff)) { |
706 | *index = i; | 706 | *index = i; |
707 | return 0; | 707 | return 0; |
708 | } | 708 | } |
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index bc547f1d34ba..6f4287716ab1 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c | |||
@@ -1842,16 +1842,11 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, | |||
1842 | { | 1842 | { |
1843 | struct ib_mad_qp_info *qp_info; | 1843 | struct ib_mad_qp_info *qp_info; |
1844 | struct ib_mad_private_header *mad_priv_hdr; | 1844 | struct ib_mad_private_header *mad_priv_hdr; |
1845 | struct ib_mad_private *recv, *response; | 1845 | struct ib_mad_private *recv, *response = NULL; |
1846 | struct ib_mad_list_head *mad_list; | 1846 | struct ib_mad_list_head *mad_list; |
1847 | struct ib_mad_agent_private *mad_agent; | 1847 | struct ib_mad_agent_private *mad_agent; |
1848 | int port_num; | 1848 | int port_num; |
1849 | 1849 | ||
1850 | response = kmem_cache_alloc(ib_mad_cache, GFP_KERNEL); | ||
1851 | if (!response) | ||
1852 | printk(KERN_ERR PFX "ib_mad_recv_done_handler no memory " | ||
1853 | "for response buffer\n"); | ||
1854 | |||
1855 | mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id; | 1850 | mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id; |
1856 | qp_info = mad_list->mad_queue->qp_info; | 1851 | qp_info = mad_list->mad_queue->qp_info; |
1857 | dequeue_mad(mad_list); | 1852 | dequeue_mad(mad_list); |
@@ -1879,6 +1874,13 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, | |||
1879 | if (!validate_mad(&recv->mad.mad, qp_info->qp->qp_num)) | 1874 | if (!validate_mad(&recv->mad.mad, qp_info->qp->qp_num)) |
1880 | goto out; | 1875 | goto out; |
1881 | 1876 | ||
1877 | response = kmem_cache_alloc(ib_mad_cache, GFP_KERNEL); | ||
1878 | if (!response) { | ||
1879 | printk(KERN_ERR PFX "ib_mad_recv_done_handler no memory " | ||
1880 | "for response buffer\n"); | ||
1881 | goto out; | ||
1882 | } | ||
1883 | |||
1882 | if (port_priv->device->node_type == RDMA_NODE_IB_SWITCH) | 1884 | if (port_priv->device->node_type == RDMA_NODE_IB_SWITCH) |
1883 | port_num = wc->port_num; | 1885 | port_num = wc->port_num; |
1884 | else | 1886 | else |
@@ -1914,12 +1916,11 @@ static void ib_mad_recv_done_handler(struct ib_mad_port_private *port_priv, | |||
1914 | response->header.recv_wc.recv_buf.mad = &response->mad.mad; | 1916 | response->header.recv_wc.recv_buf.mad = &response->mad.mad; |
1915 | response->header.recv_wc.recv_buf.grh = &response->grh; | 1917 | response->header.recv_wc.recv_buf.grh = &response->grh; |
1916 | 1918 | ||
1917 | if (!agent_send_response(&response->mad.mad, | 1919 | agent_send_response(&response->mad.mad, |
1918 | &response->grh, wc, | 1920 | &response->grh, wc, |
1919 | port_priv->device, | 1921 | port_priv->device, |
1920 | smi_get_fwd_port(&recv->mad.smp), | 1922 | smi_get_fwd_port(&recv->mad.smp), |
1921 | qp_info->qp->qp_num)) | 1923 | qp_info->qp->qp_num); |
1922 | response = NULL; | ||
1923 | 1924 | ||
1924 | goto out; | 1925 | goto out; |
1925 | } | 1926 | } |
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c index 3663fd7022be..d43bc62005b3 100644 --- a/drivers/infiniband/core/mad_rmpp.c +++ b/drivers/infiniband/core/mad_rmpp.c | |||
@@ -163,8 +163,10 @@ static struct ib_mad_send_buf *alloc_response_msg(struct ib_mad_agent *agent, | |||
163 | hdr_len, 0, GFP_KERNEL); | 163 | hdr_len, 0, GFP_KERNEL); |
164 | if (IS_ERR(msg)) | 164 | if (IS_ERR(msg)) |
165 | ib_destroy_ah(ah); | 165 | ib_destroy_ah(ah); |
166 | else | 166 | else { |
167 | msg->ah = ah; | 167 | msg->ah = ah; |
168 | msg->context[0] = ah; | ||
169 | } | ||
168 | 170 | ||
169 | return msg; | 171 | return msg; |
170 | } | 172 | } |
@@ -197,9 +199,7 @@ static void ack_ds_ack(struct ib_mad_agent_private *agent, | |||
197 | 199 | ||
198 | void ib_rmpp_send_handler(struct ib_mad_send_wc *mad_send_wc) | 200 | void ib_rmpp_send_handler(struct ib_mad_send_wc *mad_send_wc) |
199 | { | 201 | { |
200 | struct ib_rmpp_mad *rmpp_mad = mad_send_wc->send_buf->mad; | 202 | if (mad_send_wc->send_buf->context[0] == mad_send_wc->send_buf->ah) |
201 | |||
202 | if (rmpp_mad->rmpp_hdr.rmpp_type != IB_MGMT_RMPP_TYPE_ACK) | ||
203 | ib_destroy_ah(mad_send_wc->send_buf->ah); | 203 | ib_destroy_ah(mad_send_wc->send_buf->ah); |
204 | ib_free_send_mad(mad_send_wc->send_buf); | 204 | ib_free_send_mad(mad_send_wc->send_buf); |
205 | } | 205 | } |
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c index 20ab6b3e484d..d271bd715c12 100644 --- a/drivers/infiniband/core/sa_query.c +++ b/drivers/infiniband/core/sa_query.c | |||
@@ -385,9 +385,7 @@ static void update_sm_ah(struct work_struct *work) | |||
385 | 385 | ||
386 | new_ah->pkey_index = 0; | 386 | new_ah->pkey_index = 0; |
387 | if (ib_find_pkey(port->agent->device, port->port_num, | 387 | if (ib_find_pkey(port->agent->device, port->port_num, |
388 | IB_DEFAULT_PKEY_FULL, &new_ah->pkey_index) && | 388 | IB_DEFAULT_PKEY_FULL, &new_ah->pkey_index)) |
389 | ib_find_pkey(port->agent->device, port->port_num, | ||
390 | IB_DEFAULT_PKEY_PARTIAL, &new_ah->pkey_index)) | ||
391 | printk(KERN_ERR "Couldn't find index for default PKey\n"); | 389 | printk(KERN_ERR "Couldn't find index for default PKey\n"); |
392 | 390 | ||
393 | memset(&ah_attr, 0, sizeof ah_attr); | 391 | memset(&ah_attr, 0, sizeof ah_attr); |
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index 26d0470eef6e..664d2faa9e74 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c | |||
@@ -40,6 +40,11 @@ | |||
40 | 40 | ||
41 | #include "uverbs.h" | 41 | #include "uverbs.h" |
42 | 42 | ||
43 | #define IB_UMEM_MAX_PAGE_CHUNK \ | ||
44 | ((PAGE_SIZE - offsetof(struct ib_umem_chunk, page_list)) / \ | ||
45 | ((void *) &((struct ib_umem_chunk *) 0)->page_list[1] - \ | ||
46 | (void *) &((struct ib_umem_chunk *) 0)->page_list[0])) | ||
47 | |||
43 | static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int dirty) | 48 | static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int dirty) |
44 | { | 49 | { |
45 | struct ib_umem_chunk *chunk, *tmp; | 50 | struct ib_umem_chunk *chunk, *tmp; |
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index 9574088f0d4e..1cdfcd43b0bc 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
@@ -139,7 +139,7 @@ static void release_tid(struct t3cdev *tdev, u32 hwtid, struct sk_buff *skb) | |||
139 | req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); | 139 | req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD)); |
140 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, hwtid)); | 140 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_TID_RELEASE, hwtid)); |
141 | skb->priority = CPL_PRIORITY_SETUP; | 141 | skb->priority = CPL_PRIORITY_SETUP; |
142 | tdev->send(tdev, skb); | 142 | cxgb3_ofld_send(tdev, skb); |
143 | return; | 143 | return; |
144 | } | 144 | } |
145 | 145 | ||
@@ -161,7 +161,7 @@ int iwch_quiesce_tid(struct iwch_ep *ep) | |||
161 | req->val = cpu_to_be64(1 << S_TCB_RX_QUIESCE); | 161 | req->val = cpu_to_be64(1 << S_TCB_RX_QUIESCE); |
162 | 162 | ||
163 | skb->priority = CPL_PRIORITY_DATA; | 163 | skb->priority = CPL_PRIORITY_DATA; |
164 | ep->com.tdev->send(ep->com.tdev, skb); | 164 | cxgb3_ofld_send(ep->com.tdev, skb); |
165 | return 0; | 165 | return 0; |
166 | } | 166 | } |
167 | 167 | ||
@@ -183,7 +183,7 @@ int iwch_resume_tid(struct iwch_ep *ep) | |||
183 | req->val = 0; | 183 | req->val = 0; |
184 | 184 | ||
185 | skb->priority = CPL_PRIORITY_DATA; | 185 | skb->priority = CPL_PRIORITY_DATA; |
186 | ep->com.tdev->send(ep->com.tdev, skb); | 186 | cxgb3_ofld_send(ep->com.tdev, skb); |
187 | return 0; | 187 | return 0; |
188 | } | 188 | } |
189 | 189 | ||
@@ -784,7 +784,7 @@ static int update_rx_credits(struct iwch_ep *ep, u32 credits) | |||
784 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RX_DATA_ACK, ep->hwtid)); | 784 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_RX_DATA_ACK, ep->hwtid)); |
785 | req->credit_dack = htonl(V_RX_CREDITS(credits) | V_RX_FORCE_ACK(1)); | 785 | req->credit_dack = htonl(V_RX_CREDITS(credits) | V_RX_FORCE_ACK(1)); |
786 | skb->priority = CPL_PRIORITY_ACK; | 786 | skb->priority = CPL_PRIORITY_ACK; |
787 | ep->com.tdev->send(ep->com.tdev, skb); | 787 | cxgb3_ofld_send(ep->com.tdev, skb); |
788 | return credits; | 788 | return credits; |
789 | } | 789 | } |
790 | 790 | ||
@@ -1152,7 +1152,7 @@ static int listen_start(struct iwch_listen_ep *ep) | |||
1152 | req->opt1 = htonl(V_CONN_POLICY(CPL_CONN_POLICY_ASK)); | 1152 | req->opt1 = htonl(V_CONN_POLICY(CPL_CONN_POLICY_ASK)); |
1153 | 1153 | ||
1154 | skb->priority = 1; | 1154 | skb->priority = 1; |
1155 | ep->com.tdev->send(ep->com.tdev, skb); | 1155 | cxgb3_ofld_send(ep->com.tdev, skb); |
1156 | return 0; | 1156 | return 0; |
1157 | } | 1157 | } |
1158 | 1158 | ||
@@ -1186,7 +1186,7 @@ static int listen_stop(struct iwch_listen_ep *ep) | |||
1186 | req->cpu_idx = 0; | 1186 | req->cpu_idx = 0; |
1187 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, ep->stid)); | 1187 | OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, ep->stid)); |
1188 | skb->priority = 1; | 1188 | skb->priority = 1; |
1189 | ep->com.tdev->send(ep->com.tdev, skb); | 1189 | cxgb3_ofld_send(ep->com.tdev, skb); |
1190 | return 0; | 1190 | return 0; |
1191 | } | 1191 | } |
1192 | 1192 | ||
@@ -1264,7 +1264,7 @@ static void reject_cr(struct t3cdev *tdev, u32 hwtid, __be32 peer_ip, | |||
1264 | rpl->opt0l_status = htonl(CPL_PASS_OPEN_REJECT); | 1264 | rpl->opt0l_status = htonl(CPL_PASS_OPEN_REJECT); |
1265 | rpl->opt2 = 0; | 1265 | rpl->opt2 = 0; |
1266 | rpl->rsvd = rpl->opt2; | 1266 | rpl->rsvd = rpl->opt2; |
1267 | tdev->send(tdev, skb); | 1267 | cxgb3_ofld_send(tdev, skb); |
1268 | } | 1268 | } |
1269 | } | 1269 | } |
1270 | 1270 | ||
@@ -1557,7 +1557,7 @@ static int peer_abort(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1557 | rpl->wr.wr_lo = htonl(V_WR_TID(ep->hwtid)); | 1557 | rpl->wr.wr_lo = htonl(V_WR_TID(ep->hwtid)); |
1558 | OPCODE_TID(rpl) = htonl(MK_OPCODE_TID(CPL_ABORT_RPL, ep->hwtid)); | 1558 | OPCODE_TID(rpl) = htonl(MK_OPCODE_TID(CPL_ABORT_RPL, ep->hwtid)); |
1559 | rpl->cmd = CPL_ABORT_NO_RST; | 1559 | rpl->cmd = CPL_ABORT_NO_RST; |
1560 | ep->com.tdev->send(ep->com.tdev, rpl_skb); | 1560 | cxgb3_ofld_send(ep->com.tdev, rpl_skb); |
1561 | if (state != ABORTING) { | 1561 | if (state != ABORTING) { |
1562 | state_set(&ep->com, DEAD); | 1562 | state_set(&ep->com, DEAD); |
1563 | release_ep_resources(ep); | 1563 | release_ep_resources(ep); |
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c index 660b27aecae5..8bf44daf45ec 100644 --- a/drivers/infiniband/hw/mlx4/cq.c +++ b/drivers/infiniband/hw/mlx4/cq.c | |||
@@ -389,7 +389,7 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq, | |||
389 | wc->opcode = IB_WC_SEND; | 389 | wc->opcode = IB_WC_SEND; |
390 | break; | 390 | break; |
391 | case MLX4_OPCODE_RDMA_READ: | 391 | case MLX4_OPCODE_RDMA_READ: |
392 | wc->opcode = IB_WC_SEND; | 392 | wc->opcode = IB_WC_RDMA_READ; |
393 | wc->byte_len = be32_to_cpu(cqe->byte_cnt); | 393 | wc->byte_len = be32_to_cpu(cqe->byte_cnt); |
394 | break; | 394 | break; |
395 | case MLX4_OPCODE_ATOMIC_CS: | 395 | case MLX4_OPCODE_ATOMIC_CS: |
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c index 333091787c5f..0ed02b7834da 100644 --- a/drivers/infiniband/hw/mlx4/mad.c +++ b/drivers/infiniband/hw/mlx4/mad.c | |||
@@ -109,7 +109,7 @@ int mlx4_MAD_IFC(struct mlx4_ib_dev *dev, int ignore_mkey, int ignore_bkey, | |||
109 | in_modifier, op_modifier, | 109 | in_modifier, op_modifier, |
110 | MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C); | 110 | MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C); |
111 | 111 | ||
112 | if (!err); | 112 | if (!err) |
113 | memcpy(response_mad, outmailbox->buf, 256); | 113 | memcpy(response_mad, outmailbox->buf, 256); |
114 | 114 | ||
115 | mlx4_free_cmd_mailbox(dev->dev, inmailbox); | 115 | mlx4_free_cmd_mailbox(dev->dev, inmailbox); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c index 982eb88e27ec..563aeacf9e14 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_verbs.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_verbs.c | |||
@@ -211,6 +211,7 @@ out_free_cq: | |||
211 | 211 | ||
212 | out_free_mr: | 212 | out_free_mr: |
213 | ib_dereg_mr(priv->mr); | 213 | ib_dereg_mr(priv->mr); |
214 | ipoib_cm_dev_cleanup(dev); | ||
214 | 215 | ||
215 | out_free_pd: | 216 | out_free_pd: |
216 | ib_dealloc_pd(priv->pd); | 217 | ib_dealloc_pd(priv->pd); |
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index f01ca182f226..f6a051428144 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -75,16 +75,12 @@ module_param(topspin_workarounds, int, 0444); | |||
75 | MODULE_PARM_DESC(topspin_workarounds, | 75 | MODULE_PARM_DESC(topspin_workarounds, |
76 | "Enable workarounds for Topspin/Cisco SRP target bugs if != 0"); | 76 | "Enable workarounds for Topspin/Cisco SRP target bugs if != 0"); |
77 | 77 | ||
78 | static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad }; | ||
79 | |||
80 | static int mellanox_workarounds = 1; | 78 | static int mellanox_workarounds = 1; |
81 | 79 | ||
82 | module_param(mellanox_workarounds, int, 0444); | 80 | module_param(mellanox_workarounds, int, 0444); |
83 | MODULE_PARM_DESC(mellanox_workarounds, | 81 | MODULE_PARM_DESC(mellanox_workarounds, |
84 | "Enable workarounds for Mellanox SRP target bugs if != 0"); | 82 | "Enable workarounds for Mellanox SRP target bugs if != 0"); |
85 | 83 | ||
86 | static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 }; | ||
87 | |||
88 | static void srp_add_one(struct ib_device *device); | 84 | static void srp_add_one(struct ib_device *device); |
89 | static void srp_remove_one(struct ib_device *device); | 85 | static void srp_remove_one(struct ib_device *device); |
90 | static void srp_completion(struct ib_cq *cq, void *target_ptr); | 86 | static void srp_completion(struct ib_cq *cq, void *target_ptr); |
@@ -108,6 +104,24 @@ static const char *srp_target_info(struct Scsi_Host *host) | |||
108 | return host_to_target(host)->target_name; | 104 | return host_to_target(host)->target_name; |
109 | } | 105 | } |
110 | 106 | ||
107 | static int srp_target_is_topspin(struct srp_target_port *target) | ||
108 | { | ||
109 | static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad }; | ||
110 | static const u8 cisco_oui[3] = { 0x00, 0x1b, 0x0d }; | ||
111 | |||
112 | return topspin_workarounds && | ||
113 | (!memcmp(&target->ioc_guid, topspin_oui, sizeof topspin_oui) || | ||
114 | !memcmp(&target->ioc_guid, cisco_oui, sizeof cisco_oui)); | ||
115 | } | ||
116 | |||
117 | static int srp_target_is_mellanox(struct srp_target_port *target) | ||
118 | { | ||
119 | static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 }; | ||
120 | |||
121 | return mellanox_workarounds && | ||
122 | !memcmp(&target->ioc_guid, mellanox_oui, sizeof mellanox_oui); | ||
123 | } | ||
124 | |||
111 | static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size, | 125 | static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size, |
112 | gfp_t gfp_mask, | 126 | gfp_t gfp_mask, |
113 | enum dma_data_direction direction) | 127 | enum dma_data_direction direction) |
@@ -360,7 +374,7 @@ static int srp_send_req(struct srp_target_port *target) | |||
360 | * zero out the first 8 bytes of our initiator port ID and set | 374 | * zero out the first 8 bytes of our initiator port ID and set |
361 | * the second 8 bytes to the local node GUID. | 375 | * the second 8 bytes to the local node GUID. |
362 | */ | 376 | */ |
363 | if (topspin_workarounds && !memcmp(&target->ioc_guid, topspin_oui, 3)) { | 377 | if (srp_target_is_topspin(target)) { |
364 | printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround " | 378 | printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround " |
365 | "activated for target GUID %016llx\n", | 379 | "activated for target GUID %016llx\n", |
366 | (unsigned long long) be64_to_cpu(target->ioc_guid)); | 380 | (unsigned long long) be64_to_cpu(target->ioc_guid)); |
@@ -585,8 +599,8 @@ static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat, | |||
585 | if (!dev->fmr_pool) | 599 | if (!dev->fmr_pool) |
586 | return -ENODEV; | 600 | return -ENODEV; |
587 | 601 | ||
588 | if ((ib_sg_dma_address(ibdev, &scat[0]) & ~dev->fmr_page_mask) && | 602 | if (srp_target_is_mellanox(target) && |
589 | mellanox_workarounds && !memcmp(&target->ioc_guid, mellanox_oui, 3)) | 603 | (ib_sg_dma_address(ibdev, &scat[0]) & ~dev->fmr_page_mask)) |
590 | return -EINVAL; | 604 | return -EINVAL; |
591 | 605 | ||
592 | len = page_cnt = 0; | 606 | len = page_cnt = 0; |
@@ -1087,8 +1101,7 @@ static void srp_cm_rej_handler(struct ib_cm_id *cm_id, | |||
1087 | break; | 1101 | break; |
1088 | 1102 | ||
1089 | case IB_CM_REJ_PORT_REDIRECT: | 1103 | case IB_CM_REJ_PORT_REDIRECT: |
1090 | if (topspin_workarounds && | 1104 | if (srp_target_is_topspin(target)) { |
1091 | !memcmp(&target->ioc_guid, topspin_oui, 3)) { | ||
1092 | /* | 1105 | /* |
1093 | * Topspin/Cisco SRP gateways incorrectly send | 1106 | * Topspin/Cisco SRP gateways incorrectly send |
1094 | * reject reason code 25 when they mean 24 | 1107 | * reject reason code 25 when they mean 24 |
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 9b26574f1466..d602b8fa7d46 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
@@ -68,6 +68,7 @@ config INPUT_WISTRON_BTNS | |||
68 | select INPUT_POLLDEV | 68 | select INPUT_POLLDEV |
69 | select NEW_LEDS | 69 | select NEW_LEDS |
70 | select LEDS_CLASS | 70 | select LEDS_CLASS |
71 | select CHECK_SIGNATURE | ||
71 | help | 72 | help |
72 | Say Y here for support of Winstron laptop button interface, used on | 73 | Say Y here for support of Winstron laptop button interface, used on |
73 | laptops of various brands, including Acer and Fujitsu-Siemens. If | 74 | laptops of various brands, including Acer and Fujitsu-Siemens. If |
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index b1a26e02df02..60843b3f3b6f 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * hfc_usb.c | 2 | * hfc_usb.c |
3 | * | 3 | * |
4 | * $Id: hfc_usb.c,v 2.3.2.13 2006/02/17 17:17:22 mbachem Exp $ | 4 | * $Id: hfc_usb.c,v 2.3.2.20 2007/08/20 14:07:54 mbachem Exp $ |
5 | * | 5 | * |
6 | * modular HiSax ISDN driver for Colognechip HFC-S USB chip | 6 | * modular HiSax ISDN driver for Colognechip HFC-S USB chip |
7 | * | 7 | * |
8 | * Authors : Peter Sprenger (sprenger@moving-bytes.de) | 8 | * Authors : Peter Sprenger (sprenger@moving-bytes.de) |
9 | * Martin Bachem (info@colognechip.com) | 9 | * Martin Bachem (m.bachem@gmx.de, info@colognechip.com) |
10 | * | 10 | * |
11 | * based on the first hfc_usb driver of | 11 | * based on the first hfc_usb driver of |
12 | * Werner Cornelius (werner@isdn-development.de) | 12 | * Werner Cornelius (werner@isdn-development.de) |
@@ -37,24 +37,25 @@ | |||
37 | #include <linux/kernel_stat.h> | 37 | #include <linux/kernel_stat.h> |
38 | #include <linux/usb.h> | 38 | #include <linux/usb.h> |
39 | #include <linux/kernel.h> | 39 | #include <linux/kernel.h> |
40 | #include <linux/smp_lock.h> | ||
41 | #include <linux/sched.h> | ||
42 | #include <linux/moduleparam.h> | ||
40 | #include "hisax.h" | 43 | #include "hisax.h" |
41 | #include "hisax_if.h" | 44 | #include "hisax_if.h" |
42 | #include "hfc_usb.h" | 45 | #include "hfc_usb.h" |
43 | 46 | ||
44 | static const char *hfcusb_revision = | 47 | static const char *hfcusb_revision = |
45 | "$Revision: 2.3.2.13 $ $Date: 2006/02/17 17:17:22 $ "; | 48 | "$Revision: 2.3.2.20 $ $Date: 2007/08/20 14:07:54 $ "; |
46 | 49 | ||
47 | /* Hisax debug support | 50 | /* Hisax debug support |
48 | * use "modprobe debug=x" where x is bitfield of USB_DBG & ISDN_DBG | 51 | * debug flags defined in hfc_usb.h as HFCUSB_DBG_[*] |
49 | */ | 52 | */ |
50 | #ifdef CONFIG_HISAX_DEBUG | ||
51 | #include <linux/moduleparam.h> | ||
52 | #define __debug_variable hfc_debug | 53 | #define __debug_variable hfc_debug |
53 | #include "hisax_debug.h" | 54 | #include "hisax_debug.h" |
54 | static u_int debug; | 55 | static u_int debug; |
55 | module_param(debug, uint, 0); | 56 | module_param(debug, uint, 0); |
56 | static int hfc_debug; | 57 | static int hfc_debug; |
57 | #endif | 58 | |
58 | 59 | ||
59 | /* private vendor specific data */ | 60 | /* private vendor specific data */ |
60 | typedef struct { | 61 | typedef struct { |
@@ -63,9 +64,7 @@ typedef struct { | |||
63 | char *vend_name; // device name | 64 | char *vend_name; // device name |
64 | } hfcsusb_vdata; | 65 | } hfcsusb_vdata; |
65 | 66 | ||
66 | /****************************************/ | 67 | /* VID/PID device list */ |
67 | /* data defining the devices to be used */ | ||
68 | /****************************************/ | ||
69 | static struct usb_device_id hfcusb_idtab[] = { | 68 | static struct usb_device_id hfcusb_idtab[] = { |
70 | { | 69 | { |
71 | USB_DEVICE(0x0959, 0x2bd0), | 70 | USB_DEVICE(0x0959, 0x2bd0), |
@@ -90,49 +89,47 @@ static struct usb_device_id hfcusb_idtab[] = { | |||
90 | .driver_info = (unsigned long) &((hfcsusb_vdata) | 89 | .driver_info = (unsigned long) &((hfcsusb_vdata) |
91 | {LED_SCHEME1, {4, 0, 2, 1}, | 90 | {LED_SCHEME1, {4, 0, 2, 1}, |
92 | "Stollmann USB TA"}), | 91 | "Stollmann USB TA"}), |
93 | }, | 92 | }, |
94 | { | 93 | { |
95 | USB_DEVICE(0x0742, 0x2009), | 94 | USB_DEVICE(0x0742, 0x2009), |
96 | .driver_info = (unsigned long) &((hfcsusb_vdata) | 95 | .driver_info = (unsigned long) &((hfcsusb_vdata) |
97 | {LED_SCHEME1, {4, 0, 2, 1}, | 96 | {LED_SCHEME1, {4, 0, 2, 1}, |
98 | "Aceex USB ISDN TA"}), | 97 | "Aceex USB ISDN TA"}), |
99 | }, | 98 | }, |
100 | { | 99 | { |
101 | USB_DEVICE(0x0742, 0x200A), | 100 | USB_DEVICE(0x0742, 0x200A), |
102 | .driver_info = (unsigned long) &((hfcsusb_vdata) | 101 | .driver_info = (unsigned long) &((hfcsusb_vdata) |
103 | {LED_SCHEME1, {4, 0, 2, 1}, | 102 | {LED_SCHEME1, {4, 0, 2, 1}, |
104 | "OEM USB ISDN TA"}), | 103 | "OEM USB ISDN TA"}), |
105 | }, | 104 | }, |
106 | { | 105 | { |
107 | USB_DEVICE(0x08e3, 0x0301), | 106 | USB_DEVICE(0x08e3, 0x0301), |
108 | .driver_info = (unsigned long) &((hfcsusb_vdata) | 107 | .driver_info = (unsigned long) &((hfcsusb_vdata) |
109 | {LED_SCHEME1, {2, 0, 1, 4}, | 108 | {LED_SCHEME1, {2, 0, 1, 4}, |
110 | "Olitec USB RNIS"}), | 109 | "Olitec USB RNIS"}), |
111 | }, | 110 | }, |
112 | { | 111 | { |
113 | USB_DEVICE(0x07fa, 0x0846), | 112 | USB_DEVICE(0x07fa, 0x0846), |
114 | .driver_info = (unsigned long) &((hfcsusb_vdata) | 113 | .driver_info = (unsigned long) &((hfcsusb_vdata) |
115 | {LED_SCHEME1, {0x80, -64, -32, -16}, | 114 | {LED_SCHEME1, {0x80, -64, -32, -16}, |
116 | "Bewan Modem RNIS USB"}), | 115 | "Bewan Modem RNIS USB"}), |
117 | }, | 116 | }, |
118 | { | 117 | { |
119 | USB_DEVICE(0x07fa, 0x0847), | 118 | USB_DEVICE(0x07fa, 0x0847), |
120 | .driver_info = (unsigned long) &((hfcsusb_vdata) | 119 | .driver_info = (unsigned long) &((hfcsusb_vdata) |
121 | {LED_SCHEME1, {0x80, -64, -32, -16}, | 120 | {LED_SCHEME1, {0x80, -64, -32, -16}, |
122 | "Djinn Numeris USB"}), | 121 | "Djinn Numeris USB"}), |
123 | }, | 122 | }, |
124 | { | 123 | { |
125 | USB_DEVICE(0x07b0, 0x0006), | 124 | USB_DEVICE(0x07b0, 0x0006), |
126 | .driver_info = (unsigned long) &((hfcsusb_vdata) | 125 | .driver_info = (unsigned long) &((hfcsusb_vdata) |
127 | {LED_SCHEME1, {0x80, -64, -32, -16}, | 126 | {LED_SCHEME1, {0x80, -64, -32, -16}, |
128 | "Twister ISDN TA"}), | 127 | "Twister ISDN TA"}), |
129 | }, | 128 | }, |
130 | { } | 129 | { } |
131 | }; | 130 | }; |
132 | 131 | ||
133 | /***************************************************************/ | ||
134 | /* structure defining input+output fifos (interrupt/bulk mode) */ | 132 | /* structure defining input+output fifos (interrupt/bulk mode) */ |
135 | /***************************************************************/ | ||
136 | struct usb_fifo; /* forward definition */ | 133 | struct usb_fifo; /* forward definition */ |
137 | typedef struct iso_urb_struct { | 134 | typedef struct iso_urb_struct { |
138 | struct urb *purb; | 135 | struct urb *purb; |
@@ -140,8 +137,8 @@ typedef struct iso_urb_struct { | |||
140 | struct usb_fifo *owner_fifo; /* pointer to owner fifo */ | 137 | struct usb_fifo *owner_fifo; /* pointer to owner fifo */ |
141 | } iso_urb_struct; | 138 | } iso_urb_struct; |
142 | 139 | ||
143 | |||
144 | struct hfcusb_data; /* forward definition */ | 140 | struct hfcusb_data; /* forward definition */ |
141 | |||
145 | typedef struct usb_fifo { | 142 | typedef struct usb_fifo { |
146 | int fifonum; /* fifo index attached to this structure */ | 143 | int fifonum; /* fifo index attached to this structure */ |
147 | int active; /* fifo is currently active */ | 144 | int active; /* fifo is currently active */ |
@@ -160,15 +157,12 @@ typedef struct usb_fifo { | |||
160 | struct hisax_if *hif; /* hisax interface */ | 157 | struct hisax_if *hif; /* hisax interface */ |
161 | int delete_flg; /* only delete skbuff once */ | 158 | int delete_flg; /* only delete skbuff once */ |
162 | int last_urblen; /* remember length of last packet */ | 159 | int last_urblen; /* remember length of last packet */ |
163 | |||
164 | } usb_fifo; | 160 | } usb_fifo; |
165 | 161 | ||
166 | /*********************************************/ | ||
167 | /* structure holding all data for one device */ | 162 | /* structure holding all data for one device */ |
168 | /*********************************************/ | ||
169 | typedef struct hfcusb_data { | 163 | typedef struct hfcusb_data { |
170 | /* HiSax Interface for loadable Layer1 drivers */ | 164 | /* HiSax Interface for loadable Layer1 drivers */ |
171 | struct hisax_d_if d_if; /* see hisax_if.h */ | 165 | struct hisax_d_if d_if; /* see hisax_if.h */ |
172 | struct hisax_b_if b_if[2]; /* see hisax_if.h */ | 166 | struct hisax_b_if b_if[2]; /* see hisax_if.h */ |
173 | int protocol; | 167 | int protocol; |
174 | 168 | ||
@@ -176,12 +170,13 @@ typedef struct hfcusb_data { | |||
176 | int if_used; /* used interface number */ | 170 | int if_used; /* used interface number */ |
177 | int alt_used; /* used alternate config */ | 171 | int alt_used; /* used alternate config */ |
178 | int ctrl_paksize; /* control pipe packet size */ | 172 | int ctrl_paksize; /* control pipe packet size */ |
179 | int ctrl_in_pipe, ctrl_out_pipe; /* handles for control pipe */ | 173 | int ctrl_in_pipe, /* handles for control pipe */ |
174 | ctrl_out_pipe; | ||
180 | int cfg_used; /* configuration index used */ | 175 | int cfg_used; /* configuration index used */ |
181 | int vend_idx; /* vendor found */ | 176 | int vend_idx; /* vendor found */ |
182 | int b_mode[2]; /* B-channel mode */ | 177 | int b_mode[2]; /* B-channel mode */ |
183 | int l1_activated; /* layer 1 activated */ | 178 | int l1_activated; /* layer 1 activated */ |
184 | int disc_flag; /* 'true' if device was disonnected to avoid some USB actions */ | 179 | int disc_flag; /* TRUE if device was disonnected to avoid some USB actions */ |
185 | int packet_size, iso_packet_size; | 180 | int packet_size, iso_packet_size; |
186 | 181 | ||
187 | /* control pipe background handling */ | 182 | /* control pipe background handling */ |
@@ -208,7 +203,6 @@ typedef struct hfcusb_data { | |||
208 | static void collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, | 203 | static void collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, |
209 | int finish); | 204 | int finish); |
210 | 205 | ||
211 | |||
212 | static inline const char * | 206 | static inline const char * |
213 | symbolic(struct hfcusb_symbolic_list list[], const int num) | 207 | symbolic(struct hfcusb_symbolic_list list[], const int num) |
214 | { | 208 | { |
@@ -219,10 +213,6 @@ symbolic(struct hfcusb_symbolic_list list[], const int num) | |||
219 | return "<unknown ERROR>"; | 213 | return "<unknown ERROR>"; |
220 | } | 214 | } |
221 | 215 | ||
222 | |||
223 | /******************************************************/ | ||
224 | /* start next background transfer for control channel */ | ||
225 | /******************************************************/ | ||
226 | static void | 216 | static void |
227 | ctrl_start_transfer(hfcusb_data * hfc) | 217 | ctrl_start_transfer(hfcusb_data * hfc) |
228 | { | 218 | { |
@@ -240,10 +230,6 @@ ctrl_start_transfer(hfcusb_data * hfc) | |||
240 | } | 230 | } |
241 | } /* ctrl_start_transfer */ | 231 | } /* ctrl_start_transfer */ |
242 | 232 | ||
243 | /************************************/ | ||
244 | /* queue a control transfer request */ | ||
245 | /* return 0 on success. */ | ||
246 | /************************************/ | ||
247 | static int | 233 | static int |
248 | queue_control_request(hfcusb_data * hfc, __u8 reg, __u8 val, int action) | 234 | queue_control_request(hfcusb_data * hfc, __u8 reg, __u8 val, int action) |
249 | { | 235 | { |
@@ -260,19 +246,8 @@ queue_control_request(hfcusb_data * hfc, __u8 reg, __u8 val, int action) | |||
260 | if (++hfc->ctrl_cnt == 1) | 246 | if (++hfc->ctrl_cnt == 1) |
261 | ctrl_start_transfer(hfc); | 247 | ctrl_start_transfer(hfc); |
262 | return (0); | 248 | return (0); |
263 | } /* queue_control_request */ | ||
264 | |||
265 | static int | ||
266 | control_action_handler(hfcusb_data * hfc, int reg, int val, int action) | ||
267 | { | ||
268 | if (!action) | ||
269 | return (1); /* no action defined */ | ||
270 | return (0); | ||
271 | } | 249 | } |
272 | 250 | ||
273 | /***************************************************************/ | ||
274 | /* control completion routine handling background control cmds */ | ||
275 | /***************************************************************/ | ||
276 | static void | 251 | static void |
277 | ctrl_complete(struct urb *urb) | 252 | ctrl_complete(struct urb *urb) |
278 | { | 253 | { |
@@ -282,9 +257,6 @@ ctrl_complete(struct urb *urb) | |||
282 | urb->dev = hfc->dev; | 257 | urb->dev = hfc->dev; |
283 | if (hfc->ctrl_cnt) { | 258 | if (hfc->ctrl_cnt) { |
284 | buf = &hfc->ctrl_buff[hfc->ctrl_out_idx]; | 259 | buf = &hfc->ctrl_buff[hfc->ctrl_out_idx]; |
285 | control_action_handler(hfc, buf->hfc_reg, buf->reg_val, | ||
286 | buf->action); | ||
287 | |||
288 | hfc->ctrl_cnt--; /* decrement actual count */ | 260 | hfc->ctrl_cnt--; /* decrement actual count */ |
289 | if (++hfc->ctrl_out_idx >= HFC_CTRL_BUFSIZE) | 261 | if (++hfc->ctrl_out_idx >= HFC_CTRL_BUFSIZE) |
290 | hfc->ctrl_out_idx = 0; /* pointer wrap */ | 262 | hfc->ctrl_out_idx = 0; /* pointer wrap */ |
@@ -293,9 +265,7 @@ ctrl_complete(struct urb *urb) | |||
293 | } | 265 | } |
294 | } /* ctrl_complete */ | 266 | } /* ctrl_complete */ |
295 | 267 | ||
296 | /***************************************************/ | ||
297 | /* write led data to auxport & invert if necessary */ | 268 | /* write led data to auxport & invert if necessary */ |
298 | /***************************************************/ | ||
299 | static void | 269 | static void |
300 | write_led(hfcusb_data * hfc, __u8 led_state) | 270 | write_led(hfcusb_data * hfc, __u8 led_state) |
301 | { | 271 | { |
@@ -305,9 +275,6 @@ write_led(hfcusb_data * hfc, __u8 led_state) | |||
305 | } | 275 | } |
306 | } | 276 | } |
307 | 277 | ||
308 | /**************************/ | ||
309 | /* handle LED bits */ | ||
310 | /**************************/ | ||
311 | static void | 278 | static void |
312 | set_led_bit(hfcusb_data * hfc, signed short led_bits, int unset) | 279 | set_led_bit(hfcusb_data * hfc, signed short led_bits, int unset) |
313 | { | 280 | { |
@@ -324,9 +291,7 @@ set_led_bit(hfcusb_data * hfc, signed short led_bits, int unset) | |||
324 | } | 291 | } |
325 | } | 292 | } |
326 | 293 | ||
327 | /**************************/ | 294 | /* handle LED requests */ |
328 | /* handle LED requests */ | ||
329 | /**************************/ | ||
330 | static void | 295 | static void |
331 | handle_led(hfcusb_data * hfc, int event) | 296 | handle_led(hfcusb_data * hfc, int event) |
332 | { | 297 | { |
@@ -339,85 +304,73 @@ handle_led(hfcusb_data * hfc, int event) | |||
339 | 304 | ||
340 | switch (event) { | 305 | switch (event) { |
341 | case LED_POWER_ON: | 306 | case LED_POWER_ON: |
342 | set_led_bit(hfc, driver_info->led_bits[0], | 307 | set_led_bit(hfc, driver_info->led_bits[0], 0); |
343 | 0); | 308 | set_led_bit(hfc, driver_info->led_bits[1], 1); |
344 | set_led_bit(hfc, driver_info->led_bits[1], | 309 | set_led_bit(hfc, driver_info->led_bits[2], 1); |
345 | 1); | 310 | set_led_bit(hfc, driver_info->led_bits[3], 1); |
346 | set_led_bit(hfc, driver_info->led_bits[2], | ||
347 | 1); | ||
348 | set_led_bit(hfc, driver_info->led_bits[3], | ||
349 | 1); | ||
350 | break; | 311 | break; |
351 | case LED_POWER_OFF: /* no Power off handling */ | 312 | case LED_POWER_OFF: |
313 | set_led_bit(hfc, driver_info->led_bits[0], 1); | ||
314 | set_led_bit(hfc, driver_info->led_bits[1], 1); | ||
315 | set_led_bit(hfc, driver_info->led_bits[2], 1); | ||
316 | set_led_bit(hfc, driver_info->led_bits[3], 1); | ||
352 | break; | 317 | break; |
353 | case LED_S0_ON: | 318 | case LED_S0_ON: |
354 | set_led_bit(hfc, driver_info->led_bits[1], | 319 | set_led_bit(hfc, driver_info->led_bits[1], 0); |
355 | 0); | ||
356 | break; | 320 | break; |
357 | case LED_S0_OFF: | 321 | case LED_S0_OFF: |
358 | set_led_bit(hfc, driver_info->led_bits[1], | 322 | set_led_bit(hfc, driver_info->led_bits[1], 1); |
359 | 1); | ||
360 | break; | 323 | break; |
361 | case LED_B1_ON: | 324 | case LED_B1_ON: |
362 | set_led_bit(hfc, driver_info->led_bits[2], | 325 | set_led_bit(hfc, driver_info->led_bits[2], 0); |
363 | 0); | ||
364 | break; | 326 | break; |
365 | case LED_B1_OFF: | 327 | case LED_B1_OFF: |
366 | set_led_bit(hfc, driver_info->led_bits[2], | 328 | set_led_bit(hfc, driver_info->led_bits[2], 1); |
367 | 1); | ||
368 | break; | 329 | break; |
369 | case LED_B2_ON: | 330 | case LED_B2_ON: |
370 | set_led_bit(hfc, driver_info->led_bits[3], | 331 | set_led_bit(hfc, driver_info->led_bits[3], 0); |
371 | 0); | ||
372 | break; | 332 | break; |
373 | case LED_B2_OFF: | 333 | case LED_B2_OFF: |
374 | set_led_bit(hfc, driver_info->led_bits[3], | 334 | set_led_bit(hfc, driver_info->led_bits[3], 1); |
375 | 1); | ||
376 | break; | 335 | break; |
377 | } | 336 | } |
378 | write_led(hfc, hfc->led_state); | 337 | write_led(hfc, hfc->led_state); |
379 | } | 338 | } |
380 | 339 | ||
381 | /********************************/ | 340 | /* ISDN l1 timer T3 expires */ |
382 | /* called when timer t3 expires */ | ||
383 | /********************************/ | ||
384 | static void | 341 | static void |
385 | l1_timer_expire_t3(hfcusb_data * hfc) | 342 | l1_timer_expire_t3(hfcusb_data * hfc) |
386 | { | 343 | { |
387 | hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, PH_DEACTIVATE | INDICATION, | 344 | hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, PH_DEACTIVATE | INDICATION, |
388 | NULL); | 345 | NULL); |
389 | #ifdef CONFIG_HISAX_DEBUG | 346 | |
390 | DBG(ISDN_DBG, | 347 | DBG(HFCUSB_DBG_STATES, |
391 | "HFC-S USB: PH_DEACTIVATE | INDICATION sent (T3 expire)"); | 348 | "HFC-S USB: PH_DEACTIVATE | INDICATION sent (T3 expire)"); |
392 | #endif | 349 | |
393 | hfc->l1_activated = false; | 350 | hfc->l1_activated = 0; |
394 | handle_led(hfc, LED_S0_OFF); | 351 | handle_led(hfc, LED_S0_OFF); |
395 | /* deactivate : */ | 352 | /* deactivate : */ |
396 | queue_control_request(hfc, HFCUSB_STATES, 0x10, 1); | 353 | queue_control_request(hfc, HFCUSB_STATES, 0x10, 1); |
397 | queue_control_request(hfc, HFCUSB_STATES, 3, 1); | 354 | queue_control_request(hfc, HFCUSB_STATES, 3, 1); |
398 | } | 355 | } |
399 | 356 | ||
400 | /********************************/ | 357 | /* ISDN l1 timer T4 expires */ |
401 | /* called when timer t4 expires */ | ||
402 | /********************************/ | ||
403 | static void | 358 | static void |
404 | l1_timer_expire_t4(hfcusb_data * hfc) | 359 | l1_timer_expire_t4(hfcusb_data * hfc) |
405 | { | 360 | { |
406 | hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, PH_DEACTIVATE | INDICATION, | 361 | hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, PH_DEACTIVATE | INDICATION, |
407 | NULL); | 362 | NULL); |
408 | #ifdef CONFIG_HISAX_DEBUG | 363 | |
409 | DBG(ISDN_DBG, | 364 | DBG(HFCUSB_DBG_STATES, |
410 | "HFC-S USB: PH_DEACTIVATE | INDICATION sent (T4 expire)"); | 365 | "HFC-S USB: PH_DEACTIVATE | INDICATION sent (T4 expire)"); |
411 | #endif | 366 | |
412 | hfc->l1_activated = false; | 367 | hfc->l1_activated = 0; |
413 | handle_led(hfc, LED_S0_OFF); | 368 | handle_led(hfc, LED_S0_OFF); |
414 | } | 369 | } |
415 | 370 | ||
416 | /*****************************/ | 371 | /* S0 state changed */ |
417 | /* handle S0 state changes */ | ||
418 | /*****************************/ | ||
419 | static void | 372 | static void |
420 | state_handler(hfcusb_data * hfc, __u8 state) | 373 | s0_state_handler(hfcusb_data * hfc, __u8 state) |
421 | { | 374 | { |
422 | __u8 old_state; | 375 | __u8 old_state; |
423 | 376 | ||
@@ -425,38 +378,29 @@ state_handler(hfcusb_data * hfc, __u8 state) | |||
425 | if (state == old_state || state < 1 || state > 8) | 378 | if (state == old_state || state < 1 || state > 8) |
426 | return; | 379 | return; |
427 | 380 | ||
428 | #ifdef CONFIG_HISAX_DEBUG | 381 | DBG(HFCUSB_DBG_STATES, "HFC-S USB: S0 statechange(%d -> %d)", |
429 | DBG(ISDN_DBG, "HFC-S USB: new S0 state:%d old_state:%d", state, | 382 | old_state, state); |
430 | old_state); | 383 | |
431 | #endif | ||
432 | if (state < 4 || state == 7 || state == 8) { | 384 | if (state < 4 || state == 7 || state == 8) { |
433 | if (timer_pending(&hfc->t3_timer)) | 385 | if (timer_pending(&hfc->t3_timer)) |
434 | del_timer(&hfc->t3_timer); | 386 | del_timer(&hfc->t3_timer); |
435 | #ifdef CONFIG_HISAX_DEBUG | 387 | DBG(HFCUSB_DBG_STATES, "HFC-S USB: T3 deactivated"); |
436 | DBG(ISDN_DBG, "HFC-S USB: T3 deactivated"); | ||
437 | #endif | ||
438 | } | 388 | } |
439 | if (state >= 7) { | 389 | if (state >= 7) { |
440 | if (timer_pending(&hfc->t4_timer)) | 390 | if (timer_pending(&hfc->t4_timer)) |
441 | del_timer(&hfc->t4_timer); | 391 | del_timer(&hfc->t4_timer); |
442 | #ifdef CONFIG_HISAX_DEBUG | 392 | DBG(HFCUSB_DBG_STATES, "HFC-S USB: T4 deactivated"); |
443 | DBG(ISDN_DBG, "HFC-S USB: T4 deactivated"); | ||
444 | #endif | ||
445 | } | 393 | } |
446 | 394 | ||
447 | if (state == 7 && !hfc->l1_activated) { | 395 | if (state == 7 && !hfc->l1_activated) { |
448 | hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, | 396 | hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, |
449 | PH_ACTIVATE | INDICATION, NULL); | 397 | PH_ACTIVATE | INDICATION, NULL); |
450 | #ifdef CONFIG_HISAX_DEBUG | 398 | DBG(HFCUSB_DBG_STATES, "HFC-S USB: PH_ACTIVATE | INDICATION sent"); |
451 | DBG(ISDN_DBG, "HFC-S USB: PH_ACTIVATE | INDICATION sent"); | 399 | hfc->l1_activated = 1; |
452 | #endif | ||
453 | hfc->l1_activated = true; | ||
454 | handle_led(hfc, LED_S0_ON); | 400 | handle_led(hfc, LED_S0_ON); |
455 | } else if (state <= 3 /* && activated */ ) { | 401 | } else if (state <= 3 /* && activated */ ) { |
456 | if (old_state == 7 || old_state == 8) { | 402 | if (old_state == 7 || old_state == 8) { |
457 | #ifdef CONFIG_HISAX_DEBUG | 403 | DBG(HFCUSB_DBG_STATES, "HFC-S USB: T4 activated"); |
458 | DBG(ISDN_DBG, "HFC-S USB: T4 activated"); | ||
459 | #endif | ||
460 | if (!timer_pending(&hfc->t4_timer)) { | 404 | if (!timer_pending(&hfc->t4_timer)) { |
461 | hfc->t4_timer.expires = | 405 | hfc->t4_timer.expires = |
462 | jiffies + (HFC_TIMER_T4 * HZ) / 1000; | 406 | jiffies + (HFC_TIMER_T4 * HZ) / 1000; |
@@ -466,18 +410,15 @@ state_handler(hfcusb_data * hfc, __u8 state) | |||
466 | hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, | 410 | hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, |
467 | PH_DEACTIVATE | INDICATION, | 411 | PH_DEACTIVATE | INDICATION, |
468 | NULL); | 412 | NULL); |
469 | #ifdef CONFIG_HISAX_DEBUG | 413 | DBG(HFCUSB_DBG_STATES, |
470 | DBG(ISDN_DBG, | ||
471 | "HFC-S USB: PH_DEACTIVATE | INDICATION sent"); | 414 | "HFC-S USB: PH_DEACTIVATE | INDICATION sent"); |
472 | #endif | 415 | hfc->l1_activated = 0; |
473 | hfc->l1_activated = false; | ||
474 | handle_led(hfc, LED_S0_OFF); | 416 | handle_led(hfc, LED_S0_OFF); |
475 | } | 417 | } |
476 | } | 418 | } |
477 | hfc->l1_state = state; | 419 | hfc->l1_state = state; |
478 | } | 420 | } |
479 | 421 | ||
480 | /* prepare iso urb */ | ||
481 | static void | 422 | static void |
482 | fill_isoc_urb(struct urb *urb, struct usb_device *dev, unsigned int pipe, | 423 | fill_isoc_urb(struct urb *urb, struct usb_device *dev, unsigned int pipe, |
483 | void *buf, int num_packets, int packet_size, int interval, | 424 | void *buf, int num_packets, int packet_size, int interval, |
@@ -503,15 +444,16 @@ fill_isoc_urb(struct urb *urb, struct usb_device *dev, unsigned int pipe, | |||
503 | } | 444 | } |
504 | 445 | ||
505 | /* allocs urbs and start isoc transfer with two pending urbs to avoid | 446 | /* allocs urbs and start isoc transfer with two pending urbs to avoid |
506 | gaps in the transfer chain */ | 447 | * gaps in the transfer chain |
448 | */ | ||
507 | static int | 449 | static int |
508 | start_isoc_chain(usb_fifo * fifo, int num_packets_per_urb, | 450 | start_isoc_chain(usb_fifo * fifo, int num_packets_per_urb, |
509 | usb_complete_t complete, int packet_size) | 451 | usb_complete_t complete, int packet_size) |
510 | { | 452 | { |
511 | int i, k, errcode; | 453 | int i, k, errcode; |
512 | 454 | ||
513 | printk(KERN_INFO "HFC-S USB: starting ISO-chain for Fifo %i\n", | 455 | DBG(HFCUSB_DBG_INIT, "HFC-S USB: starting ISO-URBs for fifo:%d\n", |
514 | fifo->fifonum); | 456 | fifo->fifonum); |
515 | 457 | ||
516 | /* allocate Memory for Iso out Urbs */ | 458 | /* allocate Memory for Iso out Urbs */ |
517 | for (i = 0; i < 2; i++) { | 459 | for (i = 0; i < 2; i++) { |
@@ -556,10 +498,9 @@ start_isoc_chain(usb_fifo * fifo, int num_packets_per_urb, | |||
556 | 498 | ||
557 | errcode = usb_submit_urb(fifo->iso[i].purb, GFP_KERNEL); | 499 | errcode = usb_submit_urb(fifo->iso[i].purb, GFP_KERNEL); |
558 | fifo->active = (errcode >= 0) ? 1 : 0; | 500 | fifo->active = (errcode >= 0) ? 1 : 0; |
559 | if (errcode < 0) { | 501 | if (errcode < 0) |
560 | printk(KERN_INFO "HFC-S USB: %s URB nr:%d\n", | 502 | printk(KERN_INFO "HFC-S USB: usb_submit_urb URB nr:%d, error(%i): '%s'\n", |
561 | symbolic(urb_errlist, errcode), i); | 503 | i, errcode, symbolic(urb_errlist, errcode)); |
562 | }; | ||
563 | } | 504 | } |
564 | return (fifo->active); | 505 | return (fifo->active); |
565 | } | 506 | } |
@@ -572,16 +513,15 @@ stop_isoc_chain(usb_fifo * fifo) | |||
572 | 513 | ||
573 | for (i = 0; i < 2; i++) { | 514 | for (i = 0; i < 2; i++) { |
574 | if (fifo->iso[i].purb) { | 515 | if (fifo->iso[i].purb) { |
575 | #ifdef CONFIG_HISAX_DEBUG | 516 | DBG(HFCUSB_DBG_INIT, |
576 | DBG(USB_DBG, | ||
577 | "HFC-S USB: Stopping iso chain for fifo %i.%i", | 517 | "HFC-S USB: Stopping iso chain for fifo %i.%i", |
578 | fifo->fifonum, i); | 518 | fifo->fifonum, i); |
579 | #endif | ||
580 | usb_kill_urb(fifo->iso[i].purb); | 519 | usb_kill_urb(fifo->iso[i].purb); |
581 | usb_free_urb(fifo->iso[i].purb); | 520 | usb_free_urb(fifo->iso[i].purb); |
582 | fifo->iso[i].purb = NULL; | 521 | fifo->iso[i].purb = NULL; |
583 | } | 522 | } |
584 | } | 523 | } |
524 | |||
585 | usb_kill_urb(fifo->urb); | 525 | usb_kill_urb(fifo->urb); |
586 | usb_free_urb(fifo->urb); | 526 | usb_free_urb(fifo->urb); |
587 | fifo->urb = NULL; | 527 | fifo->urb = NULL; |
@@ -594,9 +534,6 @@ static int iso_packets[8] = | |||
594 | ISOC_PACKETS_D, ISOC_PACKETS_D, ISOC_PACKETS_D, ISOC_PACKETS_D | 534 | ISOC_PACKETS_D, ISOC_PACKETS_D, ISOC_PACKETS_D, ISOC_PACKETS_D |
595 | }; | 535 | }; |
596 | 536 | ||
597 | /*****************************************************/ | ||
598 | /* transmit completion routine for all ISO tx fifos */ | ||
599 | /*****************************************************/ | ||
600 | static void | 537 | static void |
601 | tx_iso_complete(struct urb *urb) | 538 | tx_iso_complete(struct urb *urb) |
602 | { | 539 | { |
@@ -607,20 +544,38 @@ tx_iso_complete(struct urb *urb) | |||
607 | errcode; | 544 | errcode; |
608 | int frame_complete, transp_mode, fifon, status; | 545 | int frame_complete, transp_mode, fifon, status; |
609 | __u8 threshbit; | 546 | __u8 threshbit; |
610 | __u8 threshtable[8] = { 1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80 }; | ||
611 | 547 | ||
612 | fifon = fifo->fifonum; | 548 | fifon = fifo->fifonum; |
613 | status = urb->status; | 549 | status = urb->status; |
614 | 550 | ||
615 | tx_offset = 0; | 551 | tx_offset = 0; |
616 | 552 | ||
553 | /* ISO transfer only partially completed, | ||
554 | look at individual frame status for details */ | ||
555 | if (status == -EXDEV) { | ||
556 | DBG(HFCUSB_DBG_VERBOSE_USB, "HFC-S USB: tx_iso_complete with -EXDEV" | ||
557 | ", urb->status %d, fifonum %d\n", | ||
558 | status, fifon); | ||
559 | |||
560 | for (k = 0; k < iso_packets[fifon]; ++k) { | ||
561 | errcode = urb->iso_frame_desc[k].status; | ||
562 | if (errcode) | ||
563 | DBG(HFCUSB_DBG_VERBOSE_USB, "HFC-S USB: tx_iso_complete " | ||
564 | "packet %i, status: %i\n", | ||
565 | k, errcode); | ||
566 | } | ||
567 | |||
568 | // clear status, so go on with ISO transfers | ||
569 | status = 0; | ||
570 | } | ||
571 | |||
617 | if (fifo->active && !status) { | 572 | if (fifo->active && !status) { |
618 | transp_mode = 0; | 573 | transp_mode = 0; |
619 | if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS) | 574 | if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS) |
620 | transp_mode = true; | 575 | transp_mode = 1; |
621 | 576 | ||
622 | /* is FifoFull-threshold set for our channel? */ | 577 | /* is FifoFull-threshold set for our channel? */ |
623 | threshbit = threshtable[fifon] & hfc->threshold_mask; | 578 | threshbit = (hfc->threshold_mask & (1 << fifon)); |
624 | num_isoc_packets = iso_packets[fifon]; | 579 | num_isoc_packets = iso_packets[fifon]; |
625 | 580 | ||
626 | /* predict dataflow to avoid fifo overflow */ | 581 | /* predict dataflow to avoid fifo overflow */ |
@@ -635,8 +590,9 @@ tx_iso_complete(struct urb *urb) | |||
635 | tx_iso_complete, urb->context); | 590 | tx_iso_complete, urb->context); |
636 | memset(context_iso_urb->buffer, 0, | 591 | memset(context_iso_urb->buffer, 0, |
637 | sizeof(context_iso_urb->buffer)); | 592 | sizeof(context_iso_urb->buffer)); |
638 | frame_complete = false; | 593 | frame_complete = 0; |
639 | /* Generate next Iso Packets */ | 594 | |
595 | /* Generate next ISO Packets */ | ||
640 | for (k = 0; k < num_isoc_packets; ++k) { | 596 | for (k = 0; k < num_isoc_packets; ++k) { |
641 | if (fifo->skbuff) { | 597 | if (fifo->skbuff) { |
642 | len = fifo->skbuff->len; | 598 | len = fifo->skbuff->len; |
@@ -661,7 +617,7 @@ tx_iso_complete(struct urb *urb) | |||
661 | /* add 2 byte flags and 16bit CRC at end of ISDN frame */ | 617 | /* add 2 byte flags and 16bit CRC at end of ISDN frame */ |
662 | fifo->bit_line += 32; | 618 | fifo->bit_line += 32; |
663 | } | 619 | } |
664 | frame_complete = true; | 620 | frame_complete = 1; |
665 | } | 621 | } |
666 | 622 | ||
667 | memcpy(context_iso_urb->buffer + | 623 | memcpy(context_iso_urb->buffer + |
@@ -688,7 +644,7 @@ tx_iso_complete(struct urb *urb) | |||
688 | } | 644 | } |
689 | 645 | ||
690 | if (frame_complete) { | 646 | if (frame_complete) { |
691 | fifo->delete_flg = true; | 647 | fifo->delete_flg = 1; |
692 | fifo->hif->l1l2(fifo->hif, | 648 | fifo->hif->l1l2(fifo->hif, |
693 | PH_DATA | CONFIRM, | 649 | PH_DATA | CONFIRM, |
694 | (void *) (unsigned long) fifo->skbuff-> | 650 | (void *) (unsigned long) fifo->skbuff-> |
@@ -696,30 +652,26 @@ tx_iso_complete(struct urb *urb) | |||
696 | if (fifo->skbuff && fifo->delete_flg) { | 652 | if (fifo->skbuff && fifo->delete_flg) { |
697 | dev_kfree_skb_any(fifo->skbuff); | 653 | dev_kfree_skb_any(fifo->skbuff); |
698 | fifo->skbuff = NULL; | 654 | fifo->skbuff = NULL; |
699 | fifo->delete_flg = false; | 655 | fifo->delete_flg = 0; |
700 | } | 656 | } |
701 | frame_complete = false; | 657 | frame_complete = 0; |
702 | } | 658 | } |
703 | } | 659 | } |
704 | errcode = usb_submit_urb(urb, GFP_ATOMIC); | 660 | errcode = usb_submit_urb(urb, GFP_ATOMIC); |
705 | if (errcode < 0) { | 661 | if (errcode < 0) { |
706 | printk(KERN_INFO | 662 | printk(KERN_INFO |
707 | "HFC-S USB: error submitting ISO URB: %d \n", | 663 | "HFC-S USB: error submitting ISO URB: %d\n", |
708 | errcode); | 664 | errcode); |
709 | } | 665 | } |
710 | } else { | 666 | } else { |
711 | if (status && !hfc->disc_flag) { | 667 | if (status && !hfc->disc_flag) { |
712 | printk(KERN_INFO | 668 | printk(KERN_INFO |
713 | "HFC-S USB: tx_iso_complete : urb->status %s (%i), fifonum=%d\n", | 669 | "HFC-S USB: tx_iso_complete: error(%i): '%s', fifonum=%d\n", |
714 | symbolic(urb_errlist, status), status, | 670 | status, symbolic(urb_errlist, status), fifon); |
715 | fifon); | ||
716 | } | 671 | } |
717 | } | 672 | } |
718 | } /* tx_iso_complete */ | 673 | } |
719 | 674 | ||
720 | /*****************************************************/ | ||
721 | /* receive completion routine for all ISO tx fifos */ | ||
722 | /*****************************************************/ | ||
723 | static void | 675 | static void |
724 | rx_iso_complete(struct urb *urb) | 676 | rx_iso_complete(struct urb *urb) |
725 | { | 677 | { |
@@ -731,21 +683,25 @@ rx_iso_complete(struct urb *urb) | |||
731 | unsigned int iso_status; | 683 | unsigned int iso_status; |
732 | __u8 *buf; | 684 | __u8 *buf; |
733 | static __u8 eof[8]; | 685 | static __u8 eof[8]; |
734 | #ifdef CONFIG_HISAX_DEBUG | ||
735 | __u8 i; | ||
736 | #endif | ||
737 | 686 | ||
738 | fifon = fifo->fifonum; | 687 | fifon = fifo->fifonum; |
739 | status = urb->status; | 688 | status = urb->status; |
740 | 689 | ||
741 | if (urb->status == -EOVERFLOW) { | 690 | if (urb->status == -EOVERFLOW) { |
742 | #ifdef CONFIG_HISAX_DEBUG | 691 | DBG(HFCUSB_DBG_VERBOSE_USB, |
743 | DBG(USB_DBG, | 692 | "HFC-USB: ignoring USB DATAOVERRUN fifo(%i)", fifon); |
744 | "HFC-USB: ignoring USB DATAOVERRUN for fifo %i \n", | 693 | status = 0; |
745 | fifon); | 694 | } |
746 | #endif | 695 | |
696 | /* ISO transfer only partially completed, | ||
697 | look at individual frame status for details */ | ||
698 | if (status == -EXDEV) { | ||
699 | DBG(HFCUSB_DBG_VERBOSE_USB, "HFC-S USB: rx_iso_complete with -EXDEV " | ||
700 | "urb->status %d, fifonum %d\n", | ||
701 | status, fifon); | ||
747 | status = 0; | 702 | status = 0; |
748 | } | 703 | } |
704 | |||
749 | if (fifo->active && !status) { | 705 | if (fifo->active && !status) { |
750 | num_isoc_packets = iso_packets[fifon]; | 706 | num_isoc_packets = iso_packets[fifon]; |
751 | maxlen = fifo->usb_packet_maxlen; | 707 | maxlen = fifo->usb_packet_maxlen; |
@@ -754,40 +710,38 @@ rx_iso_complete(struct urb *urb) | |||
754 | offset = urb->iso_frame_desc[k].offset; | 710 | offset = urb->iso_frame_desc[k].offset; |
755 | buf = context_iso_urb->buffer + offset; | 711 | buf = context_iso_urb->buffer + offset; |
756 | iso_status = urb->iso_frame_desc[k].status; | 712 | iso_status = urb->iso_frame_desc[k].status; |
757 | #ifdef CONFIG_HISAX_DEBUG | 713 | |
758 | if (iso_status && !hfc->disc_flag) | 714 | if (iso_status && !hfc->disc_flag) |
759 | DBG(USB_DBG, | 715 | DBG(HFCUSB_DBG_VERBOSE_USB, |
760 | "HFC-S USB: ISO packet failure - status:%x", | 716 | "HFC-S USB: rx_iso_complete " |
761 | iso_status); | 717 | "ISO packet %i, status: %i\n", |
718 | k, iso_status); | ||
762 | 719 | ||
763 | if ((fifon == 5) && (debug > 1)) { | 720 | if (fifon == HFCUSB_D_RX) { |
764 | printk(KERN_INFO | 721 | DBG(HFCUSB_DBG_VERBOSE_USB, |
765 | "HFC-S USB: ISO-D-RX lst_urblen:%2d " | 722 | "HFC-S USB: ISO-D-RX lst_urblen:%2d " |
766 | "act_urblen:%2d max-urblen:%2d " | 723 | "act_urblen:%2d max-urblen:%2d EOF:0x%0x", |
767 | "EOF:0x%0x DATA: ", | ||
768 | fifo->last_urblen, len, maxlen, | 724 | fifo->last_urblen, len, maxlen, |
769 | eof[5]); | 725 | eof[5]); |
770 | for (i = 0; i < len; i++) | 726 | |
771 | printk("%.2x ", buf[i]); | 727 | DBG_PACKET(HFCUSB_DBG_VERBOSE_USB, buf, len); |
772 | printk("\n"); | ||
773 | } | 728 | } |
774 | #endif | 729 | |
775 | if (fifo->last_urblen != maxlen) { | 730 | if (fifo->last_urblen != maxlen) { |
776 | /* the threshold mask is in the 2nd status byte */ | 731 | /* the threshold mask is in the 2nd status byte */ |
777 | hfc->threshold_mask = buf[1]; | 732 | hfc->threshold_mask = buf[1]; |
778 | /* care for L1 state only for D-Channel | 733 | /* care for L1 state only for D-Channel |
779 | to avoid overlapped iso completions */ | 734 | to avoid overlapped iso completions */ |
780 | if (fifon == 5) { | 735 | if (fifon == HFCUSB_D_RX) { |
781 | /* the S0 state is in the upper half | 736 | /* the S0 state is in the upper half |
782 | of the 1st status byte */ | 737 | of the 1st status byte */ |
783 | state_handler(hfc, buf[0] >> 4); | 738 | s0_state_handler(hfc, buf[0] >> 4); |
784 | } | 739 | } |
785 | eof[fifon] = buf[0] & 1; | 740 | eof[fifon] = buf[0] & 1; |
786 | if (len > 2) | 741 | if (len > 2) |
787 | collect_rx_frame(fifo, buf + 2, | 742 | collect_rx_frame(fifo, buf + 2, |
788 | len - 2, | 743 | len - 2, |
789 | (len < | 744 | (len < maxlen) ? |
790 | maxlen) ? | ||
791 | eof[fifon] : 0); | 745 | eof[fifon] : 0); |
792 | } else { | 746 | } else { |
793 | collect_rx_frame(fifo, buf, len, | 747 | collect_rx_frame(fifo, buf, len, |
@@ -804,41 +758,37 @@ rx_iso_complete(struct urb *urb) | |||
804 | rx_iso_complete, urb->context); | 758 | rx_iso_complete, urb->context); |
805 | errcode = usb_submit_urb(urb, GFP_ATOMIC); | 759 | errcode = usb_submit_urb(urb, GFP_ATOMIC); |
806 | if (errcode < 0) { | 760 | if (errcode < 0) { |
807 | printk(KERN_INFO | 761 | printk(KERN_ERR |
808 | "HFC-S USB: error submitting ISO URB: %d \n", | 762 | "HFC-S USB: error submitting ISO URB: %d\n", |
809 | errcode); | 763 | errcode); |
810 | } | 764 | } |
811 | } else { | 765 | } else { |
812 | if (status && !hfc->disc_flag) { | 766 | if (status && !hfc->disc_flag) { |
813 | printk(KERN_INFO | 767 | printk(KERN_ERR |
814 | "HFC-S USB: rx_iso_complete : " | 768 | "HFC-S USB: rx_iso_complete : " |
815 | "urb->status %d, fifonum %d\n", | 769 | "urb->status %d, fifonum %d\n", |
816 | status, fifon); | 770 | status, fifon); |
817 | } | 771 | } |
818 | } | 772 | } |
819 | } /* rx_iso_complete */ | 773 | } |
820 | 774 | ||
821 | /*****************************************************/ | 775 | /* collect rx data from INT- and ISO-URBs */ |
822 | /* collect data from interrupt or isochron in */ | ||
823 | /*****************************************************/ | ||
824 | static void | 776 | static void |
825 | collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish) | 777 | collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish) |
826 | { | 778 | { |
827 | hfcusb_data *hfc = fifo->hfc; | 779 | hfcusb_data *hfc = fifo->hfc; |
828 | int transp_mode, fifon; | 780 | int transp_mode, fifon; |
829 | #ifdef CONFIG_HISAX_DEBUG | 781 | |
830 | int i; | ||
831 | #endif | ||
832 | fifon = fifo->fifonum; | 782 | fifon = fifo->fifonum; |
833 | transp_mode = 0; | 783 | transp_mode = 0; |
834 | if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS) | 784 | if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS) |
835 | transp_mode = true; | 785 | transp_mode = 1; |
836 | 786 | ||
837 | if (!fifo->skbuff) { | 787 | if (!fifo->skbuff) { |
838 | fifo->skbuff = dev_alloc_skb(fifo->max_size + 3); | 788 | fifo->skbuff = dev_alloc_skb(fifo->max_size + 3); |
839 | if (!fifo->skbuff) { | 789 | if (!fifo->skbuff) { |
840 | printk(KERN_INFO | 790 | printk(KERN_ERR |
841 | "HFC-S USB: cannot allocate buffer (dev_alloc_skb) fifo:%d\n", | 791 | "HFC-S USB: cannot allocate buffer for fifo(%d)\n", |
842 | fifon); | 792 | fifon); |
843 | return; | 793 | return; |
844 | } | 794 | } |
@@ -847,17 +797,11 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish) | |||
847 | if (fifo->skbuff->len + len < fifo->max_size) { | 797 | if (fifo->skbuff->len + len < fifo->max_size) { |
848 | memcpy(skb_put(fifo->skbuff, len), data, len); | 798 | memcpy(skb_put(fifo->skbuff, len), data, len); |
849 | } else { | 799 | } else { |
850 | #ifdef CONFIG_HISAX_DEBUG | 800 | DBG(HFCUSB_DBG_FIFO_ERR, |
851 | printk(KERN_INFO "HFC-S USB: "); | 801 | "HCF-USB: got frame exceeded fifo->max_size(%d) fifo(%d)", |
852 | for (i = 0; i < 15; i++) | ||
853 | printk("%.2x ", | ||
854 | fifo->skbuff->data[fifo->skbuff-> | ||
855 | len - 15 + i]); | ||
856 | printk("\n"); | ||
857 | #endif | ||
858 | printk(KERN_INFO | ||
859 | "HCF-USB: got frame exceeded fifo->max_size:%d on fifo:%d\n", | ||
860 | fifo->max_size, fifon); | 802 | fifo->max_size, fifon); |
803 | DBG_SKB(HFCUSB_DBG_VERBOSE_USB, fifo->skbuff); | ||
804 | skb_trim(fifo->skbuff, 0); | ||
861 | } | 805 | } |
862 | } | 806 | } |
863 | if (transp_mode && fifo->skbuff->len >= 128) { | 807 | if (transp_mode && fifo->skbuff->len >= 128) { |
@@ -870,6 +814,13 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish) | |||
870 | if (finish) { | 814 | if (finish) { |
871 | if ((!fifo->skbuff->data[fifo->skbuff->len - 1]) | 815 | if ((!fifo->skbuff->data[fifo->skbuff->len - 1]) |
872 | && (fifo->skbuff->len > 3)) { | 816 | && (fifo->skbuff->len > 3)) { |
817 | |||
818 | if (fifon == HFCUSB_D_RX) { | ||
819 | DBG(HFCUSB_DBG_DCHANNEL, | ||
820 | "HFC-S USB: D-RX len(%d)", fifo->skbuff->len); | ||
821 | DBG_SKB(HFCUSB_DBG_DCHANNEL, fifo->skbuff); | ||
822 | } | ||
823 | |||
873 | /* remove CRC & status */ | 824 | /* remove CRC & status */ |
874 | skb_trim(fifo->skbuff, fifo->skbuff->len - 3); | 825 | skb_trim(fifo->skbuff, fifo->skbuff->len - 3); |
875 | if (fifon == HFCUSB_PCM_RX) { | 826 | if (fifon == HFCUSB_PCM_RX) { |
@@ -882,39 +833,17 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish) | |||
882 | fifo->skbuff); | 833 | fifo->skbuff); |
883 | fifo->skbuff = NULL; /* buffer was freed from upper layer */ | 834 | fifo->skbuff = NULL; /* buffer was freed from upper layer */ |
884 | } else { | 835 | } else { |
885 | if (fifo->skbuff->len > 3) { | 836 | DBG(HFCUSB_DBG_FIFO_ERR, |
886 | printk(KERN_INFO | 837 | "HFC-S USB: ERROR frame len(%d) fifo(%d)", |
887 | "HFC-S USB: got frame %d bytes but CRC ERROR on fifo:%d!!!\n", | 838 | fifo->skbuff->len, fifon); |
888 | fifo->skbuff->len, fifon); | 839 | DBG_SKB(HFCUSB_DBG_VERBOSE_USB, fifo->skbuff); |
889 | #ifdef CONFIG_HISAX_DEBUG | ||
890 | if (debug > 1) { | ||
891 | printk(KERN_INFO "HFC-S USB: "); | ||
892 | for (i = 0; i < 15; i++) | ||
893 | printk("%.2x ", | ||
894 | fifo->skbuff-> | ||
895 | data[fifo->skbuff-> | ||
896 | len - 15 + i]); | ||
897 | printk("\n"); | ||
898 | } | ||
899 | #endif | ||
900 | } | ||
901 | #ifdef CONFIG_HISAX_DEBUG | ||
902 | else { | ||
903 | printk(KERN_INFO | ||
904 | "HFC-S USB: frame to small (%d bytes)!!!\n", | ||
905 | fifo->skbuff->len); | ||
906 | } | ||
907 | #endif | ||
908 | skb_trim(fifo->skbuff, 0); | 840 | skb_trim(fifo->skbuff, 0); |
909 | } | 841 | } |
910 | } | 842 | } |
911 | } | 843 | } |
912 | 844 | ||
913 | /***********************************************/ | ||
914 | /* receive completion routine for all rx fifos */ | ||
915 | /***********************************************/ | ||
916 | static void | 845 | static void |
917 | rx_complete(struct urb *urb) | 846 | rx_int_complete(struct urb *urb) |
918 | { | 847 | { |
919 | int len; | 848 | int len; |
920 | int status; | 849 | int status; |
@@ -922,18 +851,14 @@ rx_complete(struct urb *urb) | |||
922 | usb_fifo *fifo = (usb_fifo *) urb->context; | 851 | usb_fifo *fifo = (usb_fifo *) urb->context; |
923 | hfcusb_data *hfc = fifo->hfc; | 852 | hfcusb_data *hfc = fifo->hfc; |
924 | static __u8 eof[8]; | 853 | static __u8 eof[8]; |
925 | #ifdef CONFIG_HISAX_DEBUG | ||
926 | __u8 i; | ||
927 | #endif | ||
928 | 854 | ||
929 | urb->dev = hfc->dev; /* security init */ | 855 | urb->dev = hfc->dev; /* security init */ |
930 | 856 | ||
931 | fifon = fifo->fifonum; | 857 | fifon = fifo->fifonum; |
932 | if ((!fifo->active) || (urb->status)) { | 858 | if ((!fifo->active) || (urb->status)) { |
933 | #ifdef CONFIG_HISAX_DEBUG | 859 | DBG(HFCUSB_DBG_INIT, "HFC-S USB: RX-Fifo %i is going down (%i)", |
934 | DBG(USB_DBG, "HFC-S USB: RX-Fifo %i is going down (%i)", | ||
935 | fifon, urb->status); | 860 | fifon, urb->status); |
936 | #endif | 861 | |
937 | fifo->urb->interval = 0; /* cancel automatic rescheduling */ | 862 | fifo->urb->interval = 0; /* cancel automatic rescheduling */ |
938 | if (fifo->skbuff) { | 863 | if (fifo->skbuff) { |
939 | dev_kfree_skb_any(fifo->skbuff); | 864 | dev_kfree_skb_any(fifo->skbuff); |
@@ -945,22 +870,20 @@ rx_complete(struct urb *urb) | |||
945 | buf = fifo->buffer; | 870 | buf = fifo->buffer; |
946 | maxlen = fifo->usb_packet_maxlen; | 871 | maxlen = fifo->usb_packet_maxlen; |
947 | 872 | ||
948 | #ifdef CONFIG_HISAX_DEBUG | 873 | if (fifon == HFCUSB_D_RX) { |
949 | if ((fifon == 5) && (debug > 1)) { | 874 | DBG(HFCUSB_DBG_VERBOSE_USB, |
950 | printk(KERN_INFO | 875 | "HFC-S USB: INT-D-RX lst_urblen:%2d " |
951 | "HFC-S USB: INT-D-RX lst_urblen:%2d act_urblen:%2d max-urblen:%2d EOF:0x%0x DATA: ", | 876 | "act_urblen:%2d max-urblen:%2d EOF:0x%0x", |
952 | fifo->last_urblen, len, maxlen, eof[5]); | 877 | fifo->last_urblen, len, maxlen, |
953 | for (i = 0; i < len; i++) | 878 | eof[5]); |
954 | printk("%.2x ", buf[i]); | 879 | DBG_PACKET(HFCUSB_DBG_VERBOSE_USB, buf, len); |
955 | printk("\n"); | ||
956 | } | 880 | } |
957 | #endif | ||
958 | 881 | ||
959 | if (fifo->last_urblen != fifo->usb_packet_maxlen) { | 882 | if (fifo->last_urblen != fifo->usb_packet_maxlen) { |
960 | /* the threshold mask is in the 2nd status byte */ | 883 | /* the threshold mask is in the 2nd status byte */ |
961 | hfc->threshold_mask = buf[1]; | 884 | hfc->threshold_mask = buf[1]; |
962 | /* the S0 state is in the upper half of the 1st status byte */ | 885 | /* the S0 state is in the upper half of the 1st status byte */ |
963 | state_handler(hfc, buf[0] >> 4); | 886 | s0_state_handler(hfc, buf[0] >> 4); |
964 | eof[fifon] = buf[0] & 1; | 887 | eof[fifon] = buf[0] & 1; |
965 | /* if we have more than the 2 status bytes -> collect data */ | 888 | /* if we have more than the 2 status bytes -> collect data */ |
966 | if (len > 2) | 889 | if (len > 2) |
@@ -975,20 +898,19 @@ rx_complete(struct urb *urb) | |||
975 | status = usb_submit_urb(urb, GFP_ATOMIC); | 898 | status = usb_submit_urb(urb, GFP_ATOMIC); |
976 | if (status) { | 899 | if (status) { |
977 | printk(KERN_INFO | 900 | printk(KERN_INFO |
978 | "HFC-S USB: error resubmitting URN at rx_complete...\n"); | 901 | "HFC-S USB: %s error resubmitting URB fifo(%d)\n", |
902 | __FUNCTION__, fifon); | ||
979 | } | 903 | } |
980 | } /* rx_complete */ | 904 | } |
981 | 905 | ||
982 | /***************************************************/ | 906 | /* start initial INT-URB for certain fifo */ |
983 | /* start the interrupt transfer for the given fifo */ | ||
984 | /***************************************************/ | ||
985 | static void | 907 | static void |
986 | start_int_fifo(usb_fifo * fifo) | 908 | start_int_fifo(usb_fifo * fifo) |
987 | { | 909 | { |
988 | int errcode; | 910 | int errcode; |
989 | 911 | ||
990 | printk(KERN_INFO "HFC-S USB: starting intr IN fifo:%d\n", | 912 | DBG(HFCUSB_DBG_INIT, "HFC-S USB: starting RX INT-URB for fifo:%d\n", |
991 | fifo->fifonum); | 913 | fifo->fifonum); |
992 | 914 | ||
993 | if (!fifo->urb) { | 915 | if (!fifo->urb) { |
994 | fifo->urb = usb_alloc_urb(0, GFP_KERNEL); | 916 | fifo->urb = usb_alloc_urb(0, GFP_KERNEL); |
@@ -997,33 +919,28 @@ start_int_fifo(usb_fifo * fifo) | |||
997 | } | 919 | } |
998 | usb_fill_int_urb(fifo->urb, fifo->hfc->dev, fifo->pipe, | 920 | usb_fill_int_urb(fifo->urb, fifo->hfc->dev, fifo->pipe, |
999 | fifo->buffer, fifo->usb_packet_maxlen, | 921 | fifo->buffer, fifo->usb_packet_maxlen, |
1000 | rx_complete, fifo, fifo->intervall); | 922 | rx_int_complete, fifo, fifo->intervall); |
1001 | fifo->active = 1; /* must be marked active */ | 923 | fifo->active = 1; /* must be marked active */ |
1002 | errcode = usb_submit_urb(fifo->urb, GFP_KERNEL); | 924 | errcode = usb_submit_urb(fifo->urb, GFP_KERNEL); |
1003 | if (errcode) { | 925 | if (errcode) { |
1004 | printk(KERN_INFO | 926 | printk(KERN_ERR |
1005 | "HFC-S USB: submit URB error(start_int_info): status:%i\n", | 927 | "HFC-S USB: submit URB error(start_int_info): status:%i\n", |
1006 | errcode); | 928 | errcode); |
1007 | fifo->active = 0; | 929 | fifo->active = 0; |
1008 | fifo->skbuff = NULL; | 930 | fifo->skbuff = NULL; |
1009 | } | 931 | } |
1010 | } /* start_int_fifo */ | 932 | } |
1011 | 933 | ||
1012 | /*****************************/ | ||
1013 | /* set the B-channel mode */ | ||
1014 | /*****************************/ | ||
1015 | static void | 934 | static void |
1016 | set_hfcmode(hfcusb_data * hfc, int channel, int mode) | 935 | setup_bchannel(hfcusb_data * hfc, int channel, int mode) |
1017 | { | 936 | { |
1018 | __u8 val, idx_table[2] = { 0, 2 }; | 937 | __u8 val, idx_table[2] = { 0, 2 }; |
1019 | 938 | ||
1020 | if (hfc->disc_flag) { | 939 | if (hfc->disc_flag) { |
1021 | return; | 940 | return; |
1022 | } | 941 | } |
1023 | #ifdef CONFIG_HISAX_DEBUG | 942 | DBG(HFCUSB_DBG_STATES, "HFC-S USB: setting channel %d to mode %d", |
1024 | DBG(ISDN_DBG, "HFC-S USB: setting channel %d to mode %d", channel, | 943 | channel, mode); |
1025 | mode); | ||
1026 | #endif | ||
1027 | hfc->b_mode[channel] = mode; | 944 | hfc->b_mode[channel] = mode; |
1028 | 945 | ||
1029 | /* setup CON_HDLC */ | 946 | /* setup CON_HDLC */ |
@@ -1080,20 +997,17 @@ hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg) | |||
1080 | switch (pr) { | 997 | switch (pr) { |
1081 | case PH_ACTIVATE | REQUEST: | 998 | case PH_ACTIVATE | REQUEST: |
1082 | if (fifo->fifonum == HFCUSB_D_TX) { | 999 | if (fifo->fifonum == HFCUSB_D_TX) { |
1083 | #ifdef CONFIG_HISAX_DEBUG | 1000 | DBG(HFCUSB_DBG_STATES, |
1084 | DBG(ISDN_DBG, | ||
1085 | "HFC_USB: hfc_usb_d_l2l1 D-chan: PH_ACTIVATE | REQUEST"); | 1001 | "HFC_USB: hfc_usb_d_l2l1 D-chan: PH_ACTIVATE | REQUEST"); |
1086 | #endif | 1002 | |
1087 | if (hfc->l1_state != 3 | 1003 | if (hfc->l1_state != 3 |
1088 | && hfc->l1_state != 7) { | 1004 | && hfc->l1_state != 7) { |
1089 | hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, | 1005 | hfc->d_if.ifc.l1l2(&hfc->d_if.ifc, |
1090 | PH_DEACTIVATE | | 1006 | PH_DEACTIVATE | |
1091 | INDICATION, | 1007 | INDICATION, |
1092 | NULL); | 1008 | NULL); |
1093 | #ifdef CONFIG_HISAX_DEBUG | 1009 | DBG(HFCUSB_DBG_STATES, |
1094 | DBG(ISDN_DBG, | ||
1095 | "HFC-S USB: PH_DEACTIVATE | INDICATION sent (not state 3 or 7)"); | 1010 | "HFC-S USB: PH_DEACTIVATE | INDICATION sent (not state 3 or 7)"); |
1096 | #endif | ||
1097 | } else { | 1011 | } else { |
1098 | if (hfc->l1_state == 7) { /* l1 already active */ | 1012 | if (hfc->l1_state == 7) { /* l1 already active */ |
1099 | hfc->d_if.ifc.l1l2(&hfc-> | 1013 | hfc->d_if.ifc.l1l2(&hfc-> |
@@ -1103,10 +1017,8 @@ hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg) | |||
1103 | | | 1017 | | |
1104 | INDICATION, | 1018 | INDICATION, |
1105 | NULL); | 1019 | NULL); |
1106 | #ifdef CONFIG_HISAX_DEBUG | 1020 | DBG(HFCUSB_DBG_STATES, |
1107 | DBG(ISDN_DBG, | ||
1108 | "HFC-S USB: PH_ACTIVATE | INDICATION sent again ;)"); | 1021 | "HFC-S USB: PH_ACTIVATE | INDICATION sent again ;)"); |
1109 | #endif | ||
1110 | } else { | 1022 | } else { |
1111 | /* force sending sending INFO1 */ | 1023 | /* force sending sending INFO1 */ |
1112 | queue_control_request(hfc, | 1024 | queue_control_request(hfc, |
@@ -1132,11 +1044,9 @@ hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg) | |||
1132 | } | 1044 | } |
1133 | } | 1045 | } |
1134 | } else { | 1046 | } else { |
1135 | #ifdef CONFIG_HISAX_DEBUG | 1047 | DBG(HFCUSB_DBG_STATES, |
1136 | DBG(ISDN_DBG, | 1048 | "HFC_USB: hfc_usb_d_l2l1 B-chan: PH_ACTIVATE | REQUEST"); |
1137 | "HFC_USB: hfc_usb_d_l2l1 Bx-chan: PH_ACTIVATE | REQUEST"); | 1049 | setup_bchannel(hfc, |
1138 | #endif | ||
1139 | set_hfcmode(hfc, | ||
1140 | (fifo->fifonum == | 1050 | (fifo->fifonum == |
1141 | HFCUSB_B1_TX) ? 0 : 1, | 1051 | HFCUSB_B1_TX) ? 0 : 1, |
1142 | (long) arg); | 1052 | (long) arg); |
@@ -1147,18 +1057,12 @@ hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg) | |||
1147 | break; | 1057 | break; |
1148 | case PH_DEACTIVATE | REQUEST: | 1058 | case PH_DEACTIVATE | REQUEST: |
1149 | if (fifo->fifonum == HFCUSB_D_TX) { | 1059 | if (fifo->fifonum == HFCUSB_D_TX) { |
1150 | #ifdef CONFIG_HISAX_DEBUG | 1060 | DBG(HFCUSB_DBG_STATES, |
1151 | DBG(ISDN_DBG, | ||
1152 | "HFC_USB: hfc_usb_d_l2l1 D-chan: PH_DEACTIVATE | REQUEST"); | 1061 | "HFC_USB: hfc_usb_d_l2l1 D-chan: PH_DEACTIVATE | REQUEST"); |
1153 | #endif | ||
1154 | printk(KERN_INFO | ||
1155 | "HFC-S USB: ISDN TE device should not deativate...\n"); | ||
1156 | } else { | 1062 | } else { |
1157 | #ifdef CONFIG_HISAX_DEBUG | 1063 | DBG(HFCUSB_DBG_STATES, |
1158 | DBG(ISDN_DBG, | ||
1159 | "HFC_USB: hfc_usb_d_l2l1 Bx-chan: PH_DEACTIVATE | REQUEST"); | 1064 | "HFC_USB: hfc_usb_d_l2l1 Bx-chan: PH_DEACTIVATE | REQUEST"); |
1160 | #endif | 1065 | setup_bchannel(hfc, |
1161 | set_hfcmode(hfc, | ||
1162 | (fifo->fifonum == | 1066 | (fifo->fifonum == |
1163 | HFCUSB_B1_TX) ? 0 : 1, | 1067 | HFCUSB_B1_TX) ? 0 : 1, |
1164 | (int) L1_MODE_NULL); | 1068 | (int) L1_MODE_NULL); |
@@ -1171,25 +1075,20 @@ hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg) | |||
1171 | if (fifo->skbuff && fifo->delete_flg) { | 1075 | if (fifo->skbuff && fifo->delete_flg) { |
1172 | dev_kfree_skb_any(fifo->skbuff); | 1076 | dev_kfree_skb_any(fifo->skbuff); |
1173 | fifo->skbuff = NULL; | 1077 | fifo->skbuff = NULL; |
1174 | fifo->delete_flg = false; | 1078 | fifo->delete_flg = 0; |
1175 | } | 1079 | } |
1176 | fifo->skbuff = arg; /* we have a new buffer */ | 1080 | fifo->skbuff = arg; /* we have a new buffer */ |
1177 | break; | 1081 | break; |
1178 | default: | 1082 | default: |
1179 | printk(KERN_INFO | 1083 | DBG(HFCUSB_DBG_STATES, |
1180 | "HFC_USB: hfc_usb_d_l2l1: unkown state : %#x\n", | 1084 | "HFC_USB: hfc_usb_d_l2l1: unkown state : %#x", pr); |
1181 | pr); | ||
1182 | break; | 1085 | break; |
1183 | } | 1086 | } |
1184 | } | 1087 | } |
1185 | 1088 | ||
1186 | /***************************************************************************/ | 1089 | /* initial init HFC-S USB chip registers, HiSax interface, USB URBs */ |
1187 | /* usb_init is called once when a new matching device is detected to setup */ | ||
1188 | /* main parameters. It registers the driver at the main hisax module. */ | ||
1189 | /* on success 0 is returned. */ | ||
1190 | /***************************************************************************/ | ||
1191 | static int | 1090 | static int |
1192 | usb_init(hfcusb_data * hfc) | 1091 | hfc_usb_init(hfcusb_data * hfc) |
1193 | { | 1092 | { |
1194 | usb_fifo *fifo; | 1093 | usb_fifo *fifo; |
1195 | int i, err; | 1094 | int i, err; |
@@ -1214,11 +1113,11 @@ usb_init(hfcusb_data * hfc) | |||
1214 | /* aux = output, reset off */ | 1113 | /* aux = output, reset off */ |
1215 | write_usb(hfc, HFCUSB_CIRM, 0x10); | 1114 | write_usb(hfc, HFCUSB_CIRM, 0x10); |
1216 | 1115 | ||
1217 | /* set USB_SIZE to match the wMaxPacketSize for INT or BULK transfers */ | 1116 | /* set USB_SIZE to match wMaxPacketSize for INT or BULK transfers */ |
1218 | write_usb(hfc, HFCUSB_USB_SIZE, | 1117 | write_usb(hfc, HFCUSB_USB_SIZE, |
1219 | (hfc->packet_size / 8) | ((hfc->packet_size / 8) << 4)); | 1118 | (hfc->packet_size / 8) | ((hfc->packet_size / 8) << 4)); |
1220 | 1119 | ||
1221 | /* set USB_SIZE_I to match the wMaxPacketSize for ISO transfers */ | 1120 | /* set USB_SIZE_I to match wMaxPacketSize for ISO transfers */ |
1222 | write_usb(hfc, HFCUSB_USB_SIZE_I, hfc->iso_packet_size); | 1121 | write_usb(hfc, HFCUSB_USB_SIZE_I, hfc->iso_packet_size); |
1223 | 1122 | ||
1224 | /* enable PCM/GCI master mode */ | 1123 | /* enable PCM/GCI master mode */ |
@@ -1257,8 +1156,8 @@ usb_init(hfcusb_data * hfc) | |||
1257 | hfc->b_mode[0] = L1_MODE_NULL; | 1156 | hfc->b_mode[0] = L1_MODE_NULL; |
1258 | hfc->b_mode[1] = L1_MODE_NULL; | 1157 | hfc->b_mode[1] = L1_MODE_NULL; |
1259 | 1158 | ||
1260 | hfc->l1_activated = false; | 1159 | hfc->l1_activated = 0; |
1261 | hfc->disc_flag = false; | 1160 | hfc->disc_flag = 0; |
1262 | hfc->led_state = 0; | 1161 | hfc->led_state = 0; |
1263 | hfc->led_new_data = 0; | 1162 | hfc->led_new_data = 0; |
1264 | hfc->old_led_state = 0; | 1163 | hfc->old_led_state = 0; |
@@ -1349,11 +1248,9 @@ usb_init(hfcusb_data * hfc) | |||
1349 | handle_led(hfc, LED_POWER_ON); | 1248 | handle_led(hfc, LED_POWER_ON); |
1350 | 1249 | ||
1351 | return (0); | 1250 | return (0); |
1352 | } /* usb_init */ | 1251 | } |
1353 | 1252 | ||
1354 | /*************************************************/ | 1253 | /* initial callback for each plugged USB device */ |
1355 | /* function called to probe a new plugged device */ | ||
1356 | /*************************************************/ | ||
1357 | static int | 1254 | static int |
1358 | hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | 1255 | hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) |
1359 | { | 1256 | { |
@@ -1378,11 +1275,6 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1378 | } | 1275 | } |
1379 | } | 1276 | } |
1380 | 1277 | ||
1381 | #ifdef CONFIG_HISAX_DEBUG | ||
1382 | DBG(USB_DBG, | ||
1383 | "HFC-USB: probing interface(%d) actalt(%d) minor(%d)\n", ifnum, | ||
1384 | iface->desc.bAlternateSetting, intf->minor); | ||
1385 | #endif | ||
1386 | printk(KERN_INFO | 1278 | printk(KERN_INFO |
1387 | "HFC-S USB: probing interface(%d) actalt(%d) minor(%d)\n", | 1279 | "HFC-S USB: probing interface(%d) actalt(%d) minor(%d)\n", |
1388 | ifnum, iface->desc.bAlternateSetting, intf->minor); | 1280 | ifnum, iface->desc.bAlternateSetting, intf->minor); |
@@ -1403,15 +1295,11 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1403 | 1295 | ||
1404 | /* check for config EOL element */ | 1296 | /* check for config EOL element */ |
1405 | while (validconf[cfg_used][0]) { | 1297 | while (validconf[cfg_used][0]) { |
1406 | cfg_found = true; | 1298 | cfg_found = 1; |
1407 | vcf = validconf[cfg_used]; | 1299 | vcf = validconf[cfg_used]; |
1408 | /* first endpoint descriptor */ | 1300 | /* first endpoint descriptor */ |
1409 | ep = iface->endpoint; | 1301 | ep = iface->endpoint; |
1410 | #ifdef CONFIG_HISAX_DEBUG | 1302 | |
1411 | DBG(USB_DBG, | ||
1412 | "HFC-S USB: (if=%d alt=%d cfg_used=%d)\n", | ||
1413 | ifnum, probe_alt_setting, cfg_used); | ||
1414 | #endif | ||
1415 | memcpy(cmptbl, vcf, 16 * sizeof(int)); | 1303 | memcpy(cmptbl, vcf, 16 * sizeof(int)); |
1416 | 1304 | ||
1417 | /* check for all endpoints in this alternate setting */ | 1305 | /* check for all endpoints in this alternate setting */ |
@@ -1425,7 +1313,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1425 | idx++; | 1313 | idx++; |
1426 | attr = ep->desc.bmAttributes; | 1314 | attr = ep->desc.bmAttributes; |
1427 | if (cmptbl[idx] == EP_NUL) { | 1315 | if (cmptbl[idx] == EP_NUL) { |
1428 | cfg_found = false; | 1316 | cfg_found = 0; |
1429 | } | 1317 | } |
1430 | if (attr == USB_ENDPOINT_XFER_INT | 1318 | if (attr == USB_ENDPOINT_XFER_INT |
1431 | && cmptbl[idx] == EP_INT) | 1319 | && cmptbl[idx] == EP_INT) |
@@ -1438,16 +1326,9 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1438 | cmptbl[idx] = EP_NUL; | 1326 | cmptbl[idx] = EP_NUL; |
1439 | 1327 | ||
1440 | /* check if all INT endpoints match minimum interval */ | 1328 | /* check if all INT endpoints match minimum interval */ |
1441 | if (attr == USB_ENDPOINT_XFER_INT | 1329 | if ((attr == USB_ENDPOINT_XFER_INT) |
1442 | && ep->desc.bInterval < | 1330 | && (ep->desc.bInterval < vcf[17])) { |
1443 | vcf[17]) { | 1331 | cfg_found = 0; |
1444 | #ifdef CONFIG_HISAX_DEBUG | ||
1445 | if (cfg_found) | ||
1446 | DBG(USB_DBG, | ||
1447 | "HFC-S USB: Interrupt Endpoint interval < %d found - skipping config", | ||
1448 | vcf[17]); | ||
1449 | #endif | ||
1450 | cfg_found = false; | ||
1451 | } | 1332 | } |
1452 | ep++; | 1333 | ep++; |
1453 | } | 1334 | } |
@@ -1455,7 +1336,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1455 | /* all entries must be EP_NOP or EP_NUL for a valid config */ | 1336 | /* all entries must be EP_NOP or EP_NUL for a valid config */ |
1456 | if (cmptbl[i] != EP_NOP | 1337 | if (cmptbl[i] != EP_NOP |
1457 | && cmptbl[i] != EP_NUL) | 1338 | && cmptbl[i] != EP_NUL) |
1458 | cfg_found = false; | 1339 | cfg_found = 0; |
1459 | } | 1340 | } |
1460 | if (cfg_found) { | 1341 | if (cfg_found) { |
1461 | if (cfg_used < small_match) { | 1342 | if (cfg_used < small_match) { |
@@ -1464,23 +1345,16 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1464 | probe_alt_setting; | 1345 | probe_alt_setting; |
1465 | iface_used = iface; | 1346 | iface_used = iface; |
1466 | } | 1347 | } |
1467 | #ifdef CONFIG_HISAX_DEBUG | ||
1468 | DBG(USB_DBG, | ||
1469 | "HFC-USB: small_match=%x %x\n", | ||
1470 | small_match, alt_used); | ||
1471 | #endif | ||
1472 | } | 1348 | } |
1473 | cfg_used++; | 1349 | cfg_used++; |
1474 | } | 1350 | } |
1475 | alt_idx++; | 1351 | alt_idx++; |
1476 | } /* (alt_idx < intf->num_altsetting) */ | 1352 | } /* (alt_idx < intf->num_altsetting) */ |
1477 | 1353 | ||
1478 | /* found a valid USB Ta Endpint config */ | 1354 | /* found a valid USB Ta Endpint config */ |
1479 | if (small_match != 0xffff) { | 1355 | if (small_match != 0xffff) { |
1480 | iface = iface_used; | 1356 | iface = iface_used; |
1481 | if (! | 1357 | if (!(context = kzalloc(sizeof(hfcusb_data), GFP_KERNEL))) |
1482 | (context = | ||
1483 | kzalloc(sizeof(hfcusb_data), GFP_KERNEL))) | ||
1484 | return (-ENOMEM); /* got no mem */ | 1358 | return (-ENOMEM); /* got no mem */ |
1485 | 1359 | ||
1486 | ep = iface->endpoint; | 1360 | ep = iface->endpoint; |
@@ -1613,20 +1487,15 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1613 | driver_info; | 1487 | driver_info; |
1614 | printk(KERN_INFO "HFC-S USB: detected \"%s\"\n", | 1488 | printk(KERN_INFO "HFC-S USB: detected \"%s\"\n", |
1615 | driver_info->vend_name); | 1489 | driver_info->vend_name); |
1616 | #ifdef CONFIG_HISAX_DEBUG | 1490 | |
1617 | DBG(USB_DBG, | 1491 | DBG(HFCUSB_DBG_INIT, |
1618 | "HFC-S USB: Endpoint-Config: %s (if=%d alt=%d)\n", | 1492 | "HFC-S USB: Endpoint-Config: %s (if=%d alt=%d), E-Channel(%d)", |
1619 | conf_str[small_match], context->if_used, | 1493 | conf_str[small_match], context->if_used, |
1620 | context->alt_used); | 1494 | context->alt_used, |
1621 | printk(KERN_INFO | 1495 | validconf[small_match][18]); |
1622 | "HFC-S USB: E-channel (\"ECHO:\") logging "); | 1496 | |
1623 | if (validconf[small_match][18]) | ||
1624 | printk(" possible\n"); | ||
1625 | else | ||
1626 | printk("NOT possible\n"); | ||
1627 | #endif | ||
1628 | /* init the chip and register the driver */ | 1497 | /* init the chip and register the driver */ |
1629 | if (usb_init(context)) { | 1498 | if (hfc_usb_init(context)) { |
1630 | usb_kill_urb(context->ctrl_urb); | 1499 | usb_kill_urb(context->ctrl_urb); |
1631 | usb_free_urb(context->ctrl_urb); | 1500 | usb_free_urb(context->ctrl_urb); |
1632 | context->ctrl_urb = NULL; | 1501 | context->ctrl_urb = NULL; |
@@ -1643,17 +1512,19 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1643 | return (-EIO); | 1512 | return (-EIO); |
1644 | } | 1513 | } |
1645 | 1514 | ||
1646 | /****************************************************/ | 1515 | /* callback for unplugged USB device */ |
1647 | /* function called when an active device is removed */ | ||
1648 | /****************************************************/ | ||
1649 | static void | 1516 | static void |
1650 | hfc_usb_disconnect(struct usb_interface | 1517 | hfc_usb_disconnect(struct usb_interface |
1651 | *intf) | 1518 | *intf) |
1652 | { | 1519 | { |
1653 | hfcusb_data *context = usb_get_intfdata(intf); | 1520 | hfcusb_data *context = usb_get_intfdata(intf); |
1654 | int i; | 1521 | int i; |
1522 | |||
1523 | handle_led(context, LED_POWER_OFF); | ||
1524 | schedule_timeout((10 * HZ) / 1000); | ||
1525 | |||
1655 | printk(KERN_INFO "HFC-S USB: device disconnect\n"); | 1526 | printk(KERN_INFO "HFC-S USB: device disconnect\n"); |
1656 | context->disc_flag = true; | 1527 | context->disc_flag = 1; |
1657 | usb_set_intfdata(intf, NULL); | 1528 | usb_set_intfdata(intf, NULL); |
1658 | if (!context) | 1529 | if (!context) |
1659 | return; | 1530 | return; |
@@ -1661,25 +1532,22 @@ hfc_usb_disconnect(struct usb_interface | |||
1661 | del_timer(&context->t3_timer); | 1532 | del_timer(&context->t3_timer); |
1662 | if (timer_pending(&context->t4_timer)) | 1533 | if (timer_pending(&context->t4_timer)) |
1663 | del_timer(&context->t4_timer); | 1534 | del_timer(&context->t4_timer); |
1535 | |||
1664 | /* tell all fifos to terminate */ | 1536 | /* tell all fifos to terminate */ |
1665 | for (i = 0; i < HFCUSB_NUM_FIFOS; i++) { | 1537 | for (i = 0; i < HFCUSB_NUM_FIFOS; i++) { |
1666 | if (context->fifos[i].usb_transfer_mode == USB_ISOC) { | 1538 | if (context->fifos[i].usb_transfer_mode == USB_ISOC) { |
1667 | if (context->fifos[i].active > 0) { | 1539 | if (context->fifos[i].active > 0) { |
1668 | stop_isoc_chain(&context->fifos[i]); | 1540 | stop_isoc_chain(&context->fifos[i]); |
1669 | #ifdef CONFIG_HISAX_DEBUG | 1541 | DBG(HFCUSB_DBG_INIT, |
1670 | DBG(USB_DBG, | 1542 | "HFC-S USB: %s stopping ISOC chain Fifo(%i)", |
1671 | "HFC-S USB: hfc_usb_disconnect: stopping ISOC chain Fifo no %i", | 1543 | __FUNCTION__, i); |
1672 | i); | ||
1673 | #endif | ||
1674 | } | 1544 | } |
1675 | } else { | 1545 | } else { |
1676 | if (context->fifos[i].active > 0) { | 1546 | if (context->fifos[i].active > 0) { |
1677 | context->fifos[i].active = 0; | 1547 | context->fifos[i].active = 0; |
1678 | #ifdef CONFIG_HISAX_DEBUG | 1548 | DBG(HFCUSB_DBG_INIT, |
1679 | DBG(USB_DBG, | 1549 | "HFC-S USB: %s unlinking URB for Fifo(%i)", |
1680 | "HFC-S USB: hfc_usb_disconnect: unlinking URB for Fifo no %i", | 1550 | __FUNCTION__, i); |
1681 | i); | ||
1682 | #endif | ||
1683 | } | 1551 | } |
1684 | usb_kill_urb(context->fifos[i].urb); | 1552 | usb_kill_urb(context->fifos[i].urb); |
1685 | usb_free_urb(context->fifos[i].urb); | 1553 | usb_free_urb(context->fifos[i].urb); |
@@ -1692,34 +1560,29 @@ hfc_usb_disconnect(struct usb_interface | |||
1692 | context->ctrl_urb = NULL; | 1560 | context->ctrl_urb = NULL; |
1693 | hisax_unregister(&context->d_if); | 1561 | hisax_unregister(&context->d_if); |
1694 | kfree(context); /* free our structure again */ | 1562 | kfree(context); /* free our structure again */ |
1695 | } /* hfc_usb_disconnect */ | 1563 | } |
1696 | 1564 | ||
1697 | /************************************/ | ||
1698 | /* our driver information structure */ | ||
1699 | /************************************/ | ||
1700 | static struct usb_driver hfc_drv = { | 1565 | static struct usb_driver hfc_drv = { |
1701 | .name = "hfc_usb", | 1566 | .name = "hfc_usb", |
1702 | .id_table = hfcusb_idtab, | 1567 | .id_table = hfcusb_idtab, |
1703 | .probe = hfc_usb_probe, | 1568 | .probe = hfc_usb_probe, |
1704 | .disconnect = hfc_usb_disconnect, | 1569 | .disconnect = hfc_usb_disconnect, |
1705 | }; | 1570 | }; |
1571 | |||
1706 | static void __exit | 1572 | static void __exit |
1707 | hfc_usb_exit(void) | 1573 | hfc_usb_mod_exit(void) |
1708 | { | 1574 | { |
1709 | #ifdef CONFIG_HISAX_DEBUG | 1575 | usb_deregister(&hfc_drv); /* release our driver */ |
1710 | DBG(USB_DBG, "HFC-S USB: calling \"hfc_usb_exit\" ..."); | ||
1711 | #endif | ||
1712 | usb_deregister(&hfc_drv); /* release our driver */ | ||
1713 | printk(KERN_INFO "HFC-S USB: module removed\n"); | 1576 | printk(KERN_INFO "HFC-S USB: module removed\n"); |
1714 | } | 1577 | } |
1715 | 1578 | ||
1716 | static int __init | 1579 | static int __init |
1717 | hfc_usb_init(void) | 1580 | hfc_usb_mod_init(void) |
1718 | { | 1581 | { |
1582 | char revstr[30], datestr[30], dummy[30]; | ||
1719 | #ifndef CONFIG_HISAX_DEBUG | 1583 | #ifndef CONFIG_HISAX_DEBUG |
1720 | unsigned int debug = -1; | 1584 | hfc_debug = debug; |
1721 | #endif | 1585 | #endif |
1722 | char revstr[30], datestr[30], dummy[30]; | ||
1723 | sscanf(hfcusb_revision, | 1586 | sscanf(hfcusb_revision, |
1724 | "%s %s $ %s %s %s $ ", dummy, revstr, | 1587 | "%s %s $ %s %s %s $ ", dummy, revstr, |
1725 | dummy, datestr, dummy); | 1588 | dummy, datestr, dummy); |
@@ -1734,8 +1597,8 @@ hfc_usb_init(void) | |||
1734 | return (0); | 1597 | return (0); |
1735 | } | 1598 | } |
1736 | 1599 | ||
1737 | module_init(hfc_usb_init); | 1600 | module_init(hfc_usb_mod_init); |
1738 | module_exit(hfc_usb_exit); | 1601 | module_exit(hfc_usb_mod_exit); |
1739 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1602 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1740 | MODULE_DESCRIPTION(DRIVER_DESC); | 1603 | MODULE_DESCRIPTION(DRIVER_DESC); |
1741 | MODULE_LICENSE("GPL"); | 1604 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/isdn/hisax/hfc_usb.h b/drivers/isdn/hisax/hfc_usb.h index 471f2354dfde..e79f56568d30 100644 --- a/drivers/isdn/hisax/hfc_usb.h +++ b/drivers/isdn/hisax/hfc_usb.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * hfc_usb.h | 2 | * hfc_usb.h |
3 | * | 3 | * |
4 | * $Id: hfc_usb.h,v 4.2 2005/04/07 15:27:17 martinb1 Exp $ | 4 | * $Id: hfc_usb.h,v 1.1.2.5 2007/08/20 14:36:03 mbachem Exp $ |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef __HFC_USB_H__ | 7 | #ifndef __HFC_USB_H__ |
8 | #define __HFC_USB_H__ | 8 | #define __HFC_USB_H__ |
@@ -10,25 +10,20 @@ | |||
10 | #define DRIVER_AUTHOR "Peter Sprenger (sprenger@moving-byters.de)" | 10 | #define DRIVER_AUTHOR "Peter Sprenger (sprenger@moving-byters.de)" |
11 | #define DRIVER_DESC "HFC-S USB based HiSAX ISDN driver" | 11 | #define DRIVER_DESC "HFC-S USB based HiSAX ISDN driver" |
12 | 12 | ||
13 | #define VERBOSE_USB_DEBUG | ||
14 | 13 | ||
14 | #define HFC_CTRL_TIMEOUT 20 /* 5ms timeout writing/reading regs */ | ||
15 | #define HFC_TIMER_T3 8000 /* timeout for l1 activation timer */ | ||
16 | #define HFC_TIMER_T4 500 /* time for state change interval */ | ||
15 | 17 | ||
16 | /***********/ | 18 | #define HFCUSB_L1_STATECHANGE 0 /* L1 state changed */ |
17 | /* defines */ | 19 | #define HFCUSB_L1_DRX 1 /* D-frame received */ |
18 | /***********/ | 20 | #define HFCUSB_L1_ERX 2 /* E-frame received */ |
19 | #define HFC_CTRL_TIMEOUT 20 /* 5ms timeout writing/reading regs */ | 21 | #define HFCUSB_L1_DTX 4 /* D-frames completed */ |
20 | #define HFC_TIMER_T3 8000 /* timeout for l1 activation timer */ | ||
21 | #define HFC_TIMER_T4 500 /* time for state change interval */ | ||
22 | 22 | ||
23 | #define HFCUSB_L1_STATECHANGE 0 /* L1 state changed */ | 23 | #define MAX_BCH_SIZE 2048 /* allowed B-channel packet size */ |
24 | #define HFCUSB_L1_DRX 1 /* D-frame received */ | ||
25 | #define HFCUSB_L1_ERX 2 /* E-frame received */ | ||
26 | #define HFCUSB_L1_DTX 4 /* D-frames completed */ | ||
27 | 24 | ||
28 | #define MAX_BCH_SIZE 2048 /* allowed B-channel packet size */ | 25 | #define HFCUSB_RX_THRESHOLD 64 /* threshold for fifo report bit rx */ |
29 | 26 | #define HFCUSB_TX_THRESHOLD 64 /* threshold for fifo report bit tx */ | |
30 | #define HFCUSB_RX_THRESHOLD 64 /* threshold for fifo report bit rx */ | ||
31 | #define HFCUSB_TX_THRESHOLD 64 /* threshold for fifo report bit tx */ | ||
32 | 27 | ||
33 | #define HFCUSB_CHIP_ID 0x16 /* Chip ID register index */ | 28 | #define HFCUSB_CHIP_ID 0x16 /* Chip ID register index */ |
34 | #define HFCUSB_CIRM 0x00 /* cirm register index */ | 29 | #define HFCUSB_CIRM 0x00 /* cirm register index */ |
@@ -52,9 +47,8 @@ | |||
52 | 47 | ||
53 | #define HFCUSB_CHIPID 0x40 /* ID value of HFC-S USB */ | 48 | #define HFCUSB_CHIPID 0x40 /* ID value of HFC-S USB */ |
54 | 49 | ||
55 | /******************/ | 50 | |
56 | /* fifo registers */ | 51 | /* fifo registers */ |
57 | /******************/ | ||
58 | #define HFCUSB_NUM_FIFOS 8 /* maximum number of fifos */ | 52 | #define HFCUSB_NUM_FIFOS 8 /* maximum number of fifos */ |
59 | #define HFCUSB_B1_TX 0 /* index for B1 transmit bulk/int */ | 53 | #define HFCUSB_B1_TX 0 /* index for B1 transmit bulk/int */ |
60 | #define HFCUSB_B1_RX 1 /* index for B1 receive bulk/int */ | 54 | #define HFCUSB_B1_RX 1 /* index for B1 receive bulk/int */ |
@@ -66,9 +60,9 @@ | |||
66 | #define HFCUSB_PCM_RX 7 | 60 | #define HFCUSB_PCM_RX 7 |
67 | 61 | ||
68 | /* | 62 | /* |
69 | * used to switch snd_transfer_mode for different TA modes e.g. the Billion USB TA just | 63 | * used to switch snd_transfer_mode for different TA modes e.g. the Billion USB TA just |
70 | * supports ISO out, while the Cologne Chip EVAL TA just supports BULK out | 64 | * supports ISO out, while the Cologne Chip EVAL TA just supports BULK out |
71 | */ | 65 | */ |
72 | #define USB_INT 0 | 66 | #define USB_INT 0 |
73 | #define USB_BULK 1 | 67 | #define USB_BULK 1 |
74 | #define USB_ISOC 2 | 68 | #define USB_ISOC 2 |
@@ -77,49 +71,36 @@ | |||
77 | #define ISOC_PACKETS_B 8 | 71 | #define ISOC_PACKETS_B 8 |
78 | #define ISO_BUFFER_SIZE 128 | 72 | #define ISO_BUFFER_SIZE 128 |
79 | 73 | ||
80 | // ISO send definitions | 74 | /* Fifo flow Control for TX ISO */ |
81 | #define SINK_MAX 68 | 75 | #define SINK_MAX 68 |
82 | #define SINK_MIN 48 | 76 | #define SINK_MIN 48 |
83 | #define SINK_DMIN 12 | 77 | #define SINK_DMIN 12 |
84 | #define SINK_DMAX 18 | 78 | #define SINK_DMAX 18 |
85 | #define BITLINE_INF (-64*8) | 79 | #define BITLINE_INF (-64*8) |
86 | 80 | ||
87 | 81 | /* HFC-S USB register access by Control-URSs */ | |
88 | /**********/ | ||
89 | /* macros */ | ||
90 | /**********/ | ||
91 | #define write_usb(a,b,c)usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),NULL,0,HFC_CTRL_TIMEOUT) | 82 | #define write_usb(a,b,c)usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),NULL,0,HFC_CTRL_TIMEOUT) |
92 | #define read_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT) | 83 | #define read_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT) |
93 | |||
94 | |||
95 | /*******************/ | ||
96 | /* Debugging Flags */ | ||
97 | /*******************/ | ||
98 | #define USB_DBG 1 | ||
99 | #define ISDN_DBG 2 | ||
100 | |||
101 | |||
102 | /* *********************/ | ||
103 | /* USB related defines */ | ||
104 | /***********************/ | ||
105 | #define HFC_CTRL_BUFSIZE 32 | 84 | #define HFC_CTRL_BUFSIZE 32 |
106 | 85 | ||
107 | |||
108 | |||
109 | /*************************************************/ | ||
110 | /* entry and size of output/input control buffer */ | 86 | /* entry and size of output/input control buffer */ |
111 | /*************************************************/ | ||
112 | typedef struct { | 87 | typedef struct { |
113 | __u8 hfc_reg; /* register number */ | 88 | __u8 hfc_reg; /* register number */ |
114 | __u8 reg_val; /* value to be written (or read) */ | 89 | __u8 reg_val; /* value to be written (or read) */ |
115 | int action; /* data for action handler */ | 90 | int action; /* data for action handler */ |
116 | } ctrl_buft; | 91 | } ctrl_buft; |
117 | 92 | ||
93 | /* Debugging Flags */ | ||
94 | #define HFCUSB_DBG_INIT 0x0001 | ||
95 | #define HFCUSB_DBG_STATES 0x0002 | ||
96 | #define HFCUSB_DBG_DCHANNEL 0x0080 | ||
97 | #define HFCUSB_DBG_FIFO_ERR 0x4000 | ||
98 | #define HFCUSB_DBG_VERBOSE_USB 0x8000 | ||
118 | 99 | ||
119 | /********************/ | 100 | /* |
120 | /* URB error codes: */ | 101 | * URB error codes: |
121 | /********************/ | 102 | * Used to represent a list of values and their respective symbolic names |
122 | /* Used to represent a list of values and their respective symbolic names */ | 103 | */ |
123 | struct hfcusb_symbolic_list { | 104 | struct hfcusb_symbolic_list { |
124 | const int num; | 105 | const int num; |
125 | const char *name; | 106 | const char *name; |
@@ -134,20 +115,20 @@ static struct hfcusb_symbolic_list urb_errlist[] = { | |||
134 | {-ENXIO, "URB already queued"}, | 115 | {-ENXIO, "URB already queued"}, |
135 | {-EFBIG, "Too much ISO frames requested"}, | 116 | {-EFBIG, "Too much ISO frames requested"}, |
136 | {-ENOSR, "Buffer error (overrun)"}, | 117 | {-ENOSR, "Buffer error (overrun)"}, |
137 | {-EPIPE, "Specified endpoint is stalled"}, | 118 | {-EPIPE, "Specified endpoint is stalled (device not responding)"}, |
138 | {-EOVERFLOW, "Babble (bad cable?)"}, | 119 | {-EOVERFLOW, "Babble (bad cable?)"}, |
139 | {-EPROTO, "Bit-stuff error (bad cable?)"}, | 120 | {-EPROTO, "Bit-stuff error (bad cable?)"}, |
140 | {-EILSEQ, "CRC or missing token"}, | 121 | {-EILSEQ, "CRC/Timeout"}, |
141 | {-ETIME, "Device did not respond"}, | 122 | {-ETIMEDOUT, "NAK (device does not respond)"}, |
142 | {-ESHUTDOWN, "Device unplugged"}, | 123 | {-ESHUTDOWN, "Device unplugged"}, |
143 | {-1, NULL} | 124 | {-1, NULL} |
144 | }; | 125 | }; |
145 | 126 | ||
146 | 127 | ||
147 | /*****************************************************/ | 128 | /* |
148 | /* device dependant information to support different */ | 129 | * device dependant information to support different |
149 | /* ISDN Ta's using the HFC-S USB chip */ | 130 | * ISDN Ta's using the HFC-S USB chip |
150 | /*****************************************************/ | 131 | */ |
151 | 132 | ||
152 | /* USB descriptor need to contain one of the following EndPoint combination: */ | 133 | /* USB descriptor need to contain one of the following EndPoint combination: */ |
153 | #define CNF_4INT3ISO 1 // 4 INT IN, 3 ISO OUT | 134 | #define CNF_4INT3ISO 1 // 4 INT IN, 3 ISO OUT |
@@ -155,16 +136,19 @@ static struct hfcusb_symbolic_list urb_errlist[] = { | |||
155 | #define CNF_4ISO3ISO 3 // 4 ISO IN, 3 ISO OUT | 136 | #define CNF_4ISO3ISO 3 // 4 ISO IN, 3 ISO OUT |
156 | #define CNF_3ISO3ISO 4 // 3 ISO IN, 3 ISO OUT | 137 | #define CNF_3ISO3ISO 4 // 3 ISO IN, 3 ISO OUT |
157 | 138 | ||
158 | #define EP_NUL 1 // Endpoint at this position not allowed | 139 | #define EP_NUL 1 // Endpoint at this position not allowed |
159 | #define EP_NOP 2 // all type of endpoints allowed at this position | 140 | #define EP_NOP 2 // all type of endpoints allowed at this position |
160 | #define EP_ISO 3 // Isochron endpoint mandatory at this position | 141 | #define EP_ISO 3 // Isochron endpoint mandatory at this position |
161 | #define EP_BLK 4 // Bulk endpoint mandatory at this position | 142 | #define EP_BLK 4 // Bulk endpoint mandatory at this position |
162 | #define EP_INT 5 // Interrupt endpoint mandatory at this position | 143 | #define EP_INT 5 // Interrupt endpoint mandatory at this position |
163 | 144 | ||
164 | /* this array represents all endpoints possible in the HCF-USB the last | 145 | /* |
165 | * 3 entries are the configuration number, the minimum interval for | 146 | * List of all supported endpoint configuration sets, used to find the |
166 | * Interrupt endpoints & boolean if E-channel logging possible | 147 | * best matching endpoint configuration within a devices' USB descriptor. |
167 | */ | 148 | * We need at least 3 RX endpoints, and 3 TX endpoints, either |
149 | * INT-in and ISO-out, or ISO-in and ISO-out) | ||
150 | * with 4 RX endpoints even E-Channel logging is possible | ||
151 | */ | ||
168 | static int validconf[][19] = { | 152 | static int validconf[][19] = { |
169 | // INT in, ISO out config | 153 | // INT in, ISO out config |
170 | {EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NOP, EP_INT, | 154 | {EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NUL, EP_INT, EP_NOP, EP_INT, |
@@ -193,7 +177,6 @@ static char *conf_str[] = { | |||
193 | }; | 177 | }; |
194 | #endif | 178 | #endif |
195 | 179 | ||
196 | |||
197 | typedef struct { | 180 | typedef struct { |
198 | int vendor; // vendor id | 181 | int vendor; // vendor id |
199 | int prod_id; // product id | 182 | int prod_id; // product id |
@@ -202,9 +185,9 @@ typedef struct { | |||
202 | signed short led_bits[8]; // array of 8 possible LED bitmask settings | 185 | signed short led_bits[8]; // array of 8 possible LED bitmask settings |
203 | } vendor_data; | 186 | } vendor_data; |
204 | 187 | ||
205 | #define LED_OFF 0 // no LED support | 188 | #define LED_OFF 0 // no LED support |
206 | #define LED_SCHEME1 1 // LED standard scheme | 189 | #define LED_SCHEME1 1 // LED standard scheme |
207 | #define LED_SCHEME2 2 // not used yet... | 190 | #define LED_SCHEME2 2 // not used yet... |
208 | 191 | ||
209 | #define LED_POWER_ON 1 | 192 | #define LED_POWER_ON 1 |
210 | #define LED_POWER_OFF 2 | 193 | #define LED_POWER_OFF 2 |
@@ -217,11 +200,8 @@ typedef struct { | |||
217 | #define LED_B2_OFF 9 | 200 | #define LED_B2_OFF 9 |
218 | #define LED_B2_DATA 10 | 201 | #define LED_B2_DATA 10 |
219 | 202 | ||
220 | #define LED_NORMAL 0 // LEDs are normal | 203 | #define LED_NORMAL 0 // LEDs are normal |
221 | #define LED_INVERTED 1 // LEDs are inverted | 204 | #define LED_INVERTED 1 // LEDs are inverted |
222 | |||
223 | /* time in ms to perform a Flashing LED when B-Channel has traffic */ | ||
224 | #define LED_TIME 250 | ||
225 | 205 | ||
226 | 206 | ||
227 | #endif // __HFC_USB_H__ | 207 | #endif // __HFC_USB_H__ |
diff --git a/drivers/kvm/Kconfig b/drivers/kvm/Kconfig index 6cecc396e040..7b64fd4aa2f3 100644 --- a/drivers/kvm/Kconfig +++ b/drivers/kvm/Kconfig | |||
@@ -5,6 +5,11 @@ menuconfig VIRTUALIZATION | |||
5 | bool "Virtualization" | 5 | bool "Virtualization" |
6 | depends on X86 | 6 | depends on X86 |
7 | default y | 7 | default y |
8 | ---help--- | ||
9 | Say Y here to get to see options for virtualization guest drivers. | ||
10 | This option alone does not add any kernel code. | ||
11 | |||
12 | If you say N, all options in this submenu will be skipped and disabled. | ||
8 | 13 | ||
9 | if VIRTUALIZATION | 14 | if VIRTUALIZATION |
10 | 15 | ||
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 96856097d15b..cd0557954e50 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -2974,6 +2974,10 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val, | |||
2974 | switch (val) { | 2974 | switch (val) { |
2975 | case CPU_DYING: | 2975 | case CPU_DYING: |
2976 | case CPU_DYING_FROZEN: | 2976 | case CPU_DYING_FROZEN: |
2977 | printk(KERN_INFO "kvm: disabling virtualization on CPU%d\n", | ||
2978 | cpu); | ||
2979 | hardware_disable(NULL); | ||
2980 | break; | ||
2977 | case CPU_UP_CANCELED: | 2981 | case CPU_UP_CANCELED: |
2978 | case CPU_UP_CANCELED_FROZEN: | 2982 | case CPU_UP_CANCELED_FROZEN: |
2979 | printk(KERN_INFO "kvm: disabling virtualization on CPU%d\n", | 2983 | printk(KERN_INFO "kvm: disabling virtualization on CPU%d\n", |
diff --git a/drivers/lguest/Kconfig b/drivers/lguest/Kconfig index fd6925f41647..41e2250613a1 100644 --- a/drivers/lguest/Kconfig +++ b/drivers/lguest/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config LGUEST | 1 | config LGUEST |
2 | tristate "Linux hypervisor example code" | 2 | tristate "Linux hypervisor example code" |
3 | depends on X86 && PARAVIRT && EXPERIMENTAL && !X86_PAE | 3 | depends on X86 && PARAVIRT && EXPERIMENTAL && !X86_PAE && FUTEX |
4 | select LGUEST_GUEST | 4 | select LGUEST_GUEST |
5 | select HVC_DRIVER | 5 | select HVC_DRIVER |
6 | ---help--- | 6 | ---help--- |
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig index dbe96268866e..56cd8998fe4b 100644 --- a/drivers/macintosh/Kconfig +++ b/drivers/macintosh/Kconfig | |||
@@ -3,6 +3,11 @@ menuconfig MACINTOSH_DRIVERS | |||
3 | bool "Macintosh device drivers" | 3 | bool "Macintosh device drivers" |
4 | depends on PPC || MAC || X86 | 4 | depends on PPC || MAC || X86 |
5 | default y if (PPC_PMAC || MAC) | 5 | default y if (PPC_PMAC || MAC) |
6 | ---help--- | ||
7 | Say Y here to get to see options for devices used with Macintosh | ||
8 | computers. This option alone does not add any kernel code. | ||
9 | |||
10 | If you say N, all options in this submenu will be skipped and disabled. | ||
6 | 11 | ||
7 | if MACINTOSH_DRIVERS | 12 | if MACINTOSH_DRIVERS |
8 | 13 | ||
diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index 76c1e8e4a487..33dee3a773ed 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/sysctl.h> | 13 | #include <linux/sysctl.h> |
14 | #include <linux/input.h> | 14 | #include <linux/input.h> |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/kbd_kern.h> | ||
16 | 17 | ||
17 | 18 | ||
18 | static struct input_dev *emumousebtn; | 19 | static struct input_dev *emumousebtn; |
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c index dfdf11c1eec4..e2f84da09e7c 100644 --- a/drivers/macintosh/via-pmu68k.c +++ b/drivers/macintosh/via-pmu68k.c | |||
@@ -818,243 +818,3 @@ pmu_present(void) | |||
818 | { | 818 | { |
819 | return (pmu_kind != PMU_UNKNOWN); | 819 | return (pmu_kind != PMU_UNKNOWN); |
820 | } | 820 | } |
821 | |||
822 | #if 0 /* needs some work for 68K */ | ||
823 | |||
824 | /* | ||
825 | * This struct is used to store config register values for | ||
826 | * PCI devices which may get powered off when we sleep. | ||
827 | */ | ||
828 | static struct pci_save { | ||
829 | u16 command; | ||
830 | u16 cache_lat; | ||
831 | u16 intr; | ||
832 | } *pbook_pci_saves; | ||
833 | static int n_pbook_pci_saves; | ||
834 | |||
835 | static inline void | ||
836 | pbook_pci_save(void) | ||
837 | { | ||
838 | int npci; | ||
839 | struct pci_dev *pd = NULL; | ||
840 | struct pci_save *ps; | ||
841 | |||
842 | npci = 0; | ||
843 | while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) | ||
844 | ++npci; | ||
845 | n_pbook_pci_saves = npci; | ||
846 | if (npci == 0) | ||
847 | return; | ||
848 | ps = kmalloc(npci * sizeof(*ps), GFP_KERNEL); | ||
849 | pbook_pci_saves = ps; | ||
850 | if (ps == NULL) | ||
851 | return; | ||
852 | |||
853 | pd = NULL; | ||
854 | while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { | ||
855 | pci_read_config_word(pd, PCI_COMMAND, &ps->command); | ||
856 | pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat); | ||
857 | pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr); | ||
858 | ++ps; | ||
859 | --npci; | ||
860 | } | ||
861 | } | ||
862 | |||
863 | static inline void | ||
864 | pbook_pci_restore(void) | ||
865 | { | ||
866 | u16 cmd; | ||
867 | struct pci_save *ps = pbook_pci_saves; | ||
868 | struct pci_dev *pd = NULL; | ||
869 | int j; | ||
870 | |||
871 | while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) { | ||
872 | if (ps->command == 0) | ||
873 | continue; | ||
874 | pci_read_config_word(pd, PCI_COMMAND, &cmd); | ||
875 | if ((ps->command & ~cmd) == 0) | ||
876 | continue; | ||
877 | switch (pd->hdr_type) { | ||
878 | case PCI_HEADER_TYPE_NORMAL: | ||
879 | for (j = 0; j < 6; ++j) | ||
880 | pci_write_config_dword(pd, | ||
881 | PCI_BASE_ADDRESS_0 + j*4, | ||
882 | pd->resource[j].start); | ||
883 | pci_write_config_dword(pd, PCI_ROM_ADDRESS, | ||
884 | pd->resource[PCI_ROM_RESOURCE].start); | ||
885 | pci_write_config_word(pd, PCI_CACHE_LINE_SIZE, | ||
886 | ps->cache_lat); | ||
887 | pci_write_config_word(pd, PCI_INTERRUPT_LINE, | ||
888 | ps->intr); | ||
889 | pci_write_config_word(pd, PCI_COMMAND, ps->command); | ||
890 | break; | ||
891 | /* other header types not restored at present */ | ||
892 | } | ||
893 | } | ||
894 | } | ||
895 | |||
896 | /* | ||
897 | * Put the powerbook to sleep. | ||
898 | */ | ||
899 | #define IRQ_ENABLE ((unsigned int *)0xf3000024) | ||
900 | #define MEM_CTRL ((unsigned int *)0xf8000070) | ||
901 | |||
902 | int powerbook_sleep(void) | ||
903 | { | ||
904 | int ret, i, x; | ||
905 | static int save_backlight; | ||
906 | static unsigned int save_irqen; | ||
907 | unsigned long msr; | ||
908 | unsigned int hid0; | ||
909 | unsigned long p, wait; | ||
910 | struct adb_request sleep_req; | ||
911 | |||
912 | /* Notify device drivers */ | ||
913 | ret = blocking_notifier_call_chain(&sleep_notifier_list, | ||
914 | PBOOK_SLEEP, NULL); | ||
915 | if (ret & NOTIFY_STOP_MASK) | ||
916 | return -EBUSY; | ||
917 | |||
918 | /* Sync the disks. */ | ||
919 | /* XXX It would be nice to have some way to ensure that | ||
920 | * nobody is dirtying any new buffers while we wait. */ | ||
921 | sys_sync(); | ||
922 | |||
923 | /* Turn off the display backlight */ | ||
924 | save_backlight = backlight_enabled; | ||
925 | if (save_backlight) | ||
926 | pmu_enable_backlight(0); | ||
927 | |||
928 | /* Give the disks a little time to actually finish writing */ | ||
929 | for (wait = jiffies + (HZ/4); time_before(jiffies, wait); ) | ||
930 | mb(); | ||
931 | |||
932 | /* Disable all interrupts except pmu */ | ||
933 | save_irqen = in_le32(IRQ_ENABLE); | ||
934 | for (i = 0; i < 32; ++i) | ||
935 | if (i != vias->intrs[0].line && (save_irqen & (1 << i))) | ||
936 | disable_irq(i); | ||
937 | asm volatile("mtdec %0" : : "r" (0x7fffffff)); | ||
938 | |||
939 | /* Save the state of PCI config space for some slots */ | ||
940 | pbook_pci_save(); | ||
941 | |||
942 | /* Set the memory controller to keep the memory refreshed | ||
943 | while we're asleep */ | ||
944 | for (i = 0x403f; i >= 0x4000; --i) { | ||
945 | out_be32(MEM_CTRL, i); | ||
946 | do { | ||
947 | x = (in_be32(MEM_CTRL) >> 16) & 0x3ff; | ||
948 | } while (x == 0); | ||
949 | if (x >= 0x100) | ||
950 | break; | ||
951 | } | ||
952 | |||
953 | /* Ask the PMU to put us to sleep */ | ||
954 | pmu_request(&sleep_req, NULL, 5, PMU_SLEEP, 'M', 'A', 'T', 'T'); | ||
955 | while (!sleep_req.complete) | ||
956 | mb(); | ||
957 | /* displacement-flush the L2 cache - necessary? */ | ||
958 | for (p = KERNELBASE; p < KERNELBASE + 0x100000; p += 0x1000) | ||
959 | i = *(volatile int *)p; | ||
960 | asleep = 1; | ||
961 | |||
962 | /* Put the CPU into sleep mode */ | ||
963 | asm volatile("mfspr %0,1008" : "=r" (hid0) :); | ||
964 | hid0 = (hid0 & ~(HID0_NAP | HID0_DOZE)) | HID0_SLEEP; | ||
965 | asm volatile("mtspr 1008,%0" : : "r" (hid0)); | ||
966 | local_save_flags(msr); | ||
967 | msr |= MSR_POW | MSR_EE; | ||
968 | local_irq_restore(msr); | ||
969 | udelay(10); | ||
970 | |||
971 | /* OK, we're awake again, start restoring things */ | ||
972 | out_be32(MEM_CTRL, 0x3f); | ||
973 | pbook_pci_restore(); | ||
974 | |||
975 | /* wait for the PMU interrupt sequence to complete */ | ||
976 | while (asleep) | ||
977 | mb(); | ||
978 | |||
979 | /* reenable interrupts */ | ||
980 | for (i = 0; i < 32; ++i) | ||
981 | if (i != vias->intrs[0].line && (save_irqen & (1 << i))) | ||
982 | enable_irq(i); | ||
983 | |||
984 | /* Notify drivers */ | ||
985 | blocking_notifier_call_chain(&sleep_notifier_list, PBOOK_WAKE, NULL); | ||
986 | |||
987 | /* reenable ADB autopoll */ | ||
988 | pmu_adb_autopoll(adb_dev_map); | ||
989 | |||
990 | /* Turn on the screen backlight, if it was on before */ | ||
991 | if (save_backlight) | ||
992 | pmu_enable_backlight(1); | ||
993 | |||
994 | /* Wait for the hard disk to spin up */ | ||
995 | |||
996 | return 0; | ||
997 | } | ||
998 | |||
999 | /* | ||
1000 | * Support for /dev/pmu device | ||
1001 | */ | ||
1002 | static int pmu_open(struct inode *inode, struct file *file) | ||
1003 | { | ||
1004 | return 0; | ||
1005 | } | ||
1006 | |||
1007 | static ssize_t pmu_read(struct file *file, char *buf, | ||
1008 | size_t count, loff_t *ppos) | ||
1009 | { | ||
1010 | return 0; | ||
1011 | } | ||
1012 | |||
1013 | static ssize_t pmu_write(struct file *file, const char *buf, | ||
1014 | size_t count, loff_t *ppos) | ||
1015 | { | ||
1016 | return 0; | ||
1017 | } | ||
1018 | |||
1019 | static int pmu_ioctl(struct inode * inode, struct file *filp, | ||
1020 | u_int cmd, u_long arg) | ||
1021 | { | ||
1022 | int error; | ||
1023 | __u32 value; | ||
1024 | |||
1025 | switch (cmd) { | ||
1026 | case PMU_IOC_SLEEP: | ||
1027 | return -ENOSYS; | ||
1028 | case PMU_IOC_GET_BACKLIGHT: | ||
1029 | return put_user(backlight_level, (__u32 *)arg); | ||
1030 | case PMU_IOC_SET_BACKLIGHT: | ||
1031 | error = get_user(value, (__u32 *)arg); | ||
1032 | if (!error) | ||
1033 | pmu_set_brightness(value); | ||
1034 | return error; | ||
1035 | case PMU_IOC_GET_MODEL: | ||
1036 | return put_user(pmu_kind, (__u32 *)arg); | ||
1037 | } | ||
1038 | return -EINVAL; | ||
1039 | } | ||
1040 | |||
1041 | static const struct file_operations pmu_device_fops = { | ||
1042 | .read = pmu_read, | ||
1043 | .write = pmu_write, | ||
1044 | .ioctl = pmu_ioctl, | ||
1045 | .open = pmu_open, | ||
1046 | }; | ||
1047 | |||
1048 | static struct miscdevice pmu_device = { | ||
1049 | PMU_MINOR, "pmu", &pmu_device_fops | ||
1050 | }; | ||
1051 | |||
1052 | void pmu_device_init(void) | ||
1053 | { | ||
1054 | if (!via) | ||
1055 | return; | ||
1056 | if (misc_register(&pmu_device) < 0) | ||
1057 | printk(KERN_ERR "via-pmu68k: cannot register misc device.\n"); | ||
1058 | } | ||
1059 | #endif /* CONFIG_PMAC_PBOOK */ | ||
1060 | |||
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 650991bddd8e..f33a729960ca 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1972,7 +1972,8 @@ static int run(mddev_t *mddev) | |||
1972 | !test_bit(In_sync, &disk->rdev->flags)) { | 1972 | !test_bit(In_sync, &disk->rdev->flags)) { |
1973 | disk->head_position = 0; | 1973 | disk->head_position = 0; |
1974 | mddev->degraded++; | 1974 | mddev->degraded++; |
1975 | conf->fullsync = 1; | 1975 | if (disk->rdev) |
1976 | conf->fullsync = 1; | ||
1976 | } | 1977 | } |
1977 | } | 1978 | } |
1978 | if (mddev->degraded == conf->raid_disks) { | 1979 | if (mddev->degraded == conf->raid_disks) { |
@@ -2153,11 +2154,25 @@ static int raid1_reshape(mddev_t *mddev) | |||
2153 | oldpool = conf->r1bio_pool; | 2154 | oldpool = conf->r1bio_pool; |
2154 | conf->r1bio_pool = newpool; | 2155 | conf->r1bio_pool = newpool; |
2155 | 2156 | ||
2156 | for (d=d2=0; d < conf->raid_disks; d++) | 2157 | for (d = d2 = 0; d < conf->raid_disks; d++) { |
2157 | if (conf->mirrors[d].rdev) { | 2158 | mdk_rdev_t *rdev = conf->mirrors[d].rdev; |
2158 | conf->mirrors[d].rdev->raid_disk = d2; | 2159 | if (rdev && rdev->raid_disk != d2) { |
2159 | newmirrors[d2++].rdev = conf->mirrors[d].rdev; | 2160 | char nm[20]; |
2161 | sprintf(nm, "rd%d", rdev->raid_disk); | ||
2162 | sysfs_remove_link(&mddev->kobj, nm); | ||
2163 | rdev->raid_disk = d2; | ||
2164 | sprintf(nm, "rd%d", rdev->raid_disk); | ||
2165 | sysfs_remove_link(&mddev->kobj, nm); | ||
2166 | if (sysfs_create_link(&mddev->kobj, | ||
2167 | &rdev->kobj, nm)) | ||
2168 | printk(KERN_WARNING | ||
2169 | "md/raid1: cannot register " | ||
2170 | "%s for %s\n", | ||
2171 | nm, mdname(mddev)); | ||
2160 | } | 2172 | } |
2173 | if (rdev) | ||
2174 | newmirrors[d2++].rdev = rdev; | ||
2175 | } | ||
2161 | kfree(conf->mirrors); | 2176 | kfree(conf->mirrors); |
2162 | conf->mirrors = newmirrors; | 2177 | conf->mirrors = newmirrors; |
2163 | kfree(conf->poolinfo); | 2178 | kfree(conf->poolinfo); |
diff --git a/drivers/media/dvb/b2c2/flexcop-i2c.c b/drivers/media/dvb/b2c2/flexcop-i2c.c index 02a0ea6e1c17..6bf858a436c9 100644 --- a/drivers/media/dvb/b2c2/flexcop-i2c.c +++ b/drivers/media/dvb/b2c2/flexcop-i2c.c | |||
@@ -135,6 +135,13 @@ static int flexcop_master_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs | |||
135 | struct flexcop_device *fc = i2c_get_adapdata(i2c_adap); | 135 | struct flexcop_device *fc = i2c_get_adapdata(i2c_adap); |
136 | int i, ret = 0; | 136 | int i, ret = 0; |
137 | 137 | ||
138 | /* Some drivers use 1 byte or 0 byte reads as probes, which this | ||
139 | * driver doesn't support. These probes will always fail, so this | ||
140 | * hack makes them always succeed. If one knew how, it would of | ||
141 | * course be better to actually do the read. */ | ||
142 | if (num == 1 && msgs[0].flags == I2C_M_RD && msgs[0].len <= 1) | ||
143 | return 1; | ||
144 | |||
138 | if (mutex_lock_interruptible(&fc->i2c_mutex)) | 145 | if (mutex_lock_interruptible(&fc->i2c_mutex)) |
139 | return -ERESTARTSYS; | 146 | return -ERESTARTSYS; |
140 | 147 | ||
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index acf026342ec5..bdd797071cb0 100644 --- a/drivers/media/dvb/dvb-core/dvb_net.c +++ b/drivers/media/dvb/dvb-core/dvb_net.c | |||
@@ -800,7 +800,8 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len, | |||
800 | } | 800 | } |
801 | 801 | ||
802 | 802 | ||
803 | static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len) | 803 | static void dvb_net_sec(struct net_device *dev, const u8 *pkt, int |
804 | pkt_len) | ||
804 | { | 805 | { |
805 | u8 *eth; | 806 | u8 *eth; |
806 | struct sk_buff *skb; | 807 | struct sk_buff *skb; |
@@ -902,7 +903,7 @@ static int dvb_net_sec_callback(const u8 *buffer1, size_t buffer1_len, | |||
902 | * we rely on the DVB API definition where exactly one complete | 903 | * we rely on the DVB API definition where exactly one complete |
903 | * section is delivered in buffer1 | 904 | * section is delivered in buffer1 |
904 | */ | 905 | */ |
905 | dvb_net_sec (dev, (u8*) buffer1, buffer1_len); | 906 | dvb_net_sec (dev, buffer1, buffer1_len); |
906 | return 0; | 907 | return 0; |
907 | } | 908 | } |
908 | 909 | ||
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index ca99e439c97c..11f7d5939bd9 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c | |||
@@ -784,7 +784,7 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, | |||
784 | strncpy(fe->ops.tuner_ops.info.name, desc->name, | 784 | strncpy(fe->ops.tuner_ops.info.name, desc->name, |
785 | sizeof(fe->ops.tuner_ops.info.name)); | 785 | sizeof(fe->ops.tuner_ops.info.name)); |
786 | fe->ops.tuner_ops.info.frequency_min = desc->min; | 786 | fe->ops.tuner_ops.info.frequency_min = desc->min; |
787 | fe->ops.tuner_ops.info.frequency_min = desc->max; | 787 | fe->ops.tuner_ops.info.frequency_max = desc->max; |
788 | if (!desc->initdata) | 788 | if (!desc->initdata) |
789 | fe->ops.tuner_ops.init = NULL; | 789 | fe->ops.tuner_ops.init = NULL; |
790 | if (!desc->sleepdata) | 790 | if (!desc->sleepdata) |
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index c08f650df423..ef5361824f87 100644 --- a/drivers/media/video/cafe_ccic.c +++ b/drivers/media/video/cafe_ccic.c | |||
@@ -356,6 +356,7 @@ static int cafe_smbus_write_data(struct cafe_camera *cam, | |||
356 | { | 356 | { |
357 | unsigned int rval; | 357 | unsigned int rval; |
358 | unsigned long flags; | 358 | unsigned long flags; |
359 | DEFINE_WAIT(the_wait); | ||
359 | 360 | ||
360 | spin_lock_irqsave(&cam->dev_lock, flags); | 361 | spin_lock_irqsave(&cam->dev_lock, flags); |
361 | rval = TWSIC0_EN | ((addr << TWSIC0_SID_SHIFT) & TWSIC0_SID); | 362 | rval = TWSIC0_EN | ((addr << TWSIC0_SID_SHIFT) & TWSIC0_SID); |
@@ -369,10 +370,29 @@ static int cafe_smbus_write_data(struct cafe_camera *cam, | |||
369 | rval = value | ((command << TWSIC1_ADDR_SHIFT) & TWSIC1_ADDR); | 370 | rval = value | ((command << TWSIC1_ADDR_SHIFT) & TWSIC1_ADDR); |
370 | cafe_reg_write(cam, REG_TWSIC1, rval); | 371 | cafe_reg_write(cam, REG_TWSIC1, rval); |
371 | spin_unlock_irqrestore(&cam->dev_lock, flags); | 372 | spin_unlock_irqrestore(&cam->dev_lock, flags); |
372 | msleep(2); /* Required or things flake */ | ||
373 | 373 | ||
374 | /* | ||
375 | * Time to wait for the write to complete. THIS IS A RACY | ||
376 | * WAY TO DO IT, but the sad fact is that reading the TWSIC1 | ||
377 | * register too quickly after starting the operation sends | ||
378 | * the device into a place that may be kinder and better, but | ||
379 | * which is absolutely useless for controlling the sensor. In | ||
380 | * practice we have plenty of time to get into our sleep state | ||
381 | * before the interrupt hits, and the worst case is that we | ||
382 | * time out and then see that things completed, so this seems | ||
383 | * the best way for now. | ||
384 | */ | ||
385 | do { | ||
386 | prepare_to_wait(&cam->smbus_wait, &the_wait, | ||
387 | TASK_UNINTERRUPTIBLE); | ||
388 | schedule_timeout(1); /* even 1 jiffy is too long */ | ||
389 | finish_wait(&cam->smbus_wait, &the_wait); | ||
390 | } while (!cafe_smbus_write_done(cam)); | ||
391 | |||
392 | #ifdef IF_THE_CAFE_HARDWARE_WORKED_RIGHT | ||
374 | wait_event_timeout(cam->smbus_wait, cafe_smbus_write_done(cam), | 393 | wait_event_timeout(cam->smbus_wait, cafe_smbus_write_done(cam), |
375 | CAFE_SMBUS_TIMEOUT); | 394 | CAFE_SMBUS_TIMEOUT); |
395 | #endif | ||
376 | spin_lock_irqsave(&cam->dev_lock, flags); | 396 | spin_lock_irqsave(&cam->dev_lock, flags); |
377 | rval = cafe_reg_read(cam, REG_TWSIC1); | 397 | rval = cafe_reg_read(cam, REG_TWSIC1); |
378 | spin_unlock_irqrestore(&cam->dev_lock, flags); | 398 | spin_unlock_irqrestore(&cam->dev_lock, flags); |
@@ -710,7 +730,7 @@ static void cafe_ctlr_init(struct cafe_camera *cam) | |||
710 | * Here we must wait a bit for the controller to come around. | 730 | * Here we must wait a bit for the controller to come around. |
711 | */ | 731 | */ |
712 | spin_unlock_irqrestore(&cam->dev_lock, flags); | 732 | spin_unlock_irqrestore(&cam->dev_lock, flags); |
713 | mdelay(5); /* FIXME revisit this */ | 733 | msleep(5); |
714 | spin_lock_irqsave(&cam->dev_lock, flags); | 734 | spin_lock_irqsave(&cam->dev_lock, flags); |
715 | 735 | ||
716 | cafe_reg_write(cam, REG_GL_CSR, GCSR_CCIC_EN|GCSR_SRC|GCSR_MRC); | 736 | cafe_reg_write(cam, REG_GL_CSR, GCSR_CCIC_EN|GCSR_SRC|GCSR_MRC); |
@@ -2233,12 +2253,21 @@ static int cafe_pci_resume(struct pci_dev *pdev) | |||
2233 | if (ret) | 2253 | if (ret) |
2234 | return ret; | 2254 | return ret; |
2235 | ret = pci_enable_device(pdev); | 2255 | ret = pci_enable_device(pdev); |
2256 | |||
2236 | if (ret) { | 2257 | if (ret) { |
2237 | cam_warn(cam, "Unable to re-enable device on resume!\n"); | 2258 | cam_warn(cam, "Unable to re-enable device on resume!\n"); |
2238 | return ret; | 2259 | return ret; |
2239 | } | 2260 | } |
2240 | cafe_ctlr_init(cam); | 2261 | cafe_ctlr_init(cam); |
2241 | cafe_ctlr_power_up(cam); | 2262 | cafe_ctlr_power_down(cam); |
2263 | |||
2264 | mutex_lock(&cam->s_mutex); | ||
2265 | if (cam->users > 0) { | ||
2266 | cafe_ctlr_power_up(cam); | ||
2267 | __cafe_cam_reset(cam); | ||
2268 | } | ||
2269 | mutex_unlock(&cam->s_mutex); | ||
2270 | |||
2242 | set_bit(CF_CONFIG_NEEDED, &cam->flags); | 2271 | set_bit(CF_CONFIG_NEEDED, &cam->flags); |
2243 | if (cam->state == S_SPECREAD) | 2272 | if (cam->state == S_SPECREAD) |
2244 | cam->state = S_IDLE; /* Don't bother restarting */ | 2273 | cam->state = S_IDLE; /* Don't bother restarting */ |
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 2c7b158ce7e1..40307f3f6fe3 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1772,6 +1772,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
1772 | if (dev->alt_max_pkt_size == NULL) { | 1772 | if (dev->alt_max_pkt_size == NULL) { |
1773 | em28xx_errdev("out of memory!\n"); | 1773 | em28xx_errdev("out of memory!\n"); |
1774 | em28xx_devused&=~(1<<nr); | 1774 | em28xx_devused&=~(1<<nr); |
1775 | kfree(dev); | ||
1775 | return -ENOMEM; | 1776 | return -ENOMEM; |
1776 | } | 1777 | } |
1777 | 1778 | ||
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index 047624b9e271..5977a79619c2 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -1190,6 +1190,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1190 | itv->osd_global_alpha_state = (fb->flags & V4L2_FBUF_FLAG_GLOBAL_ALPHA) != 0; | 1190 | itv->osd_global_alpha_state = (fb->flags & V4L2_FBUF_FLAG_GLOBAL_ALPHA) != 0; |
1191 | itv->osd_local_alpha_state = (fb->flags & V4L2_FBUF_FLAG_LOCAL_ALPHA) != 0; | 1191 | itv->osd_local_alpha_state = (fb->flags & V4L2_FBUF_FLAG_LOCAL_ALPHA) != 0; |
1192 | itv->osd_color_key_state = (fb->flags & V4L2_FBUF_FLAG_CHROMAKEY) != 0; | 1192 | itv->osd_color_key_state = (fb->flags & V4L2_FBUF_FLAG_CHROMAKEY) != 0; |
1193 | ivtv_set_osd_alpha(itv); | ||
1193 | break; | 1194 | break; |
1194 | } | 1195 | } |
1195 | 1196 | ||
@@ -1234,7 +1235,7 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void | |||
1234 | IVTV_INFO("Tuner: %s\n", | 1235 | IVTV_INFO("Tuner: %s\n", |
1235 | test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags) ? "Radio" : "TV"); | 1236 | test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags) ? "Radio" : "TV"); |
1236 | cx2341x_log_status(&itv->params, itv->name); | 1237 | cx2341x_log_status(&itv->params, itv->name); |
1237 | IVTV_INFO("Status flags: 0x%08lx\n", itv->i_flags); | 1238 | IVTV_INFO("Version: %s Status flags: 0x%08lx\n", IVTV_VERSION, itv->i_flags); |
1238 | for (i = 0; i < IVTV_MAX_STREAMS; i++) { | 1239 | for (i = 0; i < IVTV_MAX_STREAMS; i++) { |
1239 | struct ivtv_stream *s = &itv->streams[i]; | 1240 | struct ivtv_stream *s = &itv->streams[i]; |
1240 | 1241 | ||
diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c index f8f21ddd9843..c4c5bd67f795 100644 --- a/drivers/media/video/ov7670.c +++ b/drivers/media/video/ov7670.c | |||
@@ -416,7 +416,10 @@ static int ov7670_read(struct i2c_client *c, unsigned char reg, | |||
416 | static int ov7670_write(struct i2c_client *c, unsigned char reg, | 416 | static int ov7670_write(struct i2c_client *c, unsigned char reg, |
417 | unsigned char value) | 417 | unsigned char value) |
418 | { | 418 | { |
419 | return i2c_smbus_write_byte_data(c, reg, value); | 419 | int ret = i2c_smbus_write_byte_data(c, reg, value); |
420 | if (reg == REG_COM7 && (value & COM7_RESET)) | ||
421 | msleep(2); /* Wait for reset to run */ | ||
422 | return ret; | ||
420 | } | 423 | } |
421 | 424 | ||
422 | 425 | ||
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c index 9c0e8d18c2f6..3d81966d8c42 100644 --- a/drivers/media/video/pwc/pwc-if.c +++ b/drivers/media/video/pwc/pwc-if.c | |||
@@ -1196,12 +1196,19 @@ static int pwc_video_open(struct inode *inode, struct file *file) | |||
1196 | return 0; | 1196 | return 0; |
1197 | } | 1197 | } |
1198 | 1198 | ||
1199 | |||
1200 | static void pwc_cleanup(struct pwc_device *pdev) | ||
1201 | { | ||
1202 | pwc_remove_sysfs_files(pdev->vdev); | ||
1203 | video_unregister_device(pdev->vdev); | ||
1204 | } | ||
1205 | |||
1199 | /* Note that all cleanup is done in the reverse order as in _open */ | 1206 | /* Note that all cleanup is done in the reverse order as in _open */ |
1200 | static int pwc_video_close(struct inode *inode, struct file *file) | 1207 | static int pwc_video_close(struct inode *inode, struct file *file) |
1201 | { | 1208 | { |
1202 | struct video_device *vdev = file->private_data; | 1209 | struct video_device *vdev = file->private_data; |
1203 | struct pwc_device *pdev; | 1210 | struct pwc_device *pdev; |
1204 | int i; | 1211 | int i, hint; |
1205 | 1212 | ||
1206 | PWC_DEBUG_OPEN(">> video_close called(vdev = 0x%p).\n", vdev); | 1213 | PWC_DEBUG_OPEN(">> video_close called(vdev = 0x%p).\n", vdev); |
1207 | 1214 | ||
@@ -1224,8 +1231,9 @@ static int pwc_video_close(struct inode *inode, struct file *file) | |||
1224 | pwc_isoc_cleanup(pdev); | 1231 | pwc_isoc_cleanup(pdev); |
1225 | pwc_free_buffers(pdev); | 1232 | pwc_free_buffers(pdev); |
1226 | 1233 | ||
1234 | lock_kernel(); | ||
1227 | /* Turn off LEDS and power down camera, but only when not unplugged */ | 1235 | /* Turn off LEDS and power down camera, but only when not unplugged */ |
1228 | if (pdev->error_status != EPIPE) { | 1236 | if (!pdev->unplugged) { |
1229 | /* Turn LEDs off */ | 1237 | /* Turn LEDs off */ |
1230 | if (pwc_set_leds(pdev, 0, 0) < 0) | 1238 | if (pwc_set_leds(pdev, 0, 0) < 0) |
1231 | PWC_DEBUG_MODULE("Failed to set LED on/off time.\n"); | 1239 | PWC_DEBUG_MODULE("Failed to set LED on/off time.\n"); |
@@ -1234,9 +1242,19 @@ static int pwc_video_close(struct inode *inode, struct file *file) | |||
1234 | if (i < 0) | 1242 | if (i < 0) |
1235 | PWC_ERROR("Failed to power down camera (%d)\n", i); | 1243 | PWC_ERROR("Failed to power down camera (%d)\n", i); |
1236 | } | 1244 | } |
1245 | pdev->vopen--; | ||
1246 | PWC_DEBUG_OPEN("<< video_close() vopen=%d\n", i); | ||
1247 | } else { | ||
1248 | pwc_cleanup(pdev); | ||
1249 | /* Free memory (don't set pdev to 0 just yet) */ | ||
1250 | kfree(pdev); | ||
1251 | /* search device_hint[] table if we occupy a slot, by any chance */ | ||
1252 | for (hint = 0; hint < MAX_DEV_HINTS; hint++) | ||
1253 | if (device_hint[hint].pdev == pdev) | ||
1254 | device_hint[hint].pdev = NULL; | ||
1237 | } | 1255 | } |
1238 | pdev->vopen--; | 1256 | unlock_kernel(); |
1239 | PWC_DEBUG_OPEN("<< video_close() vopen=%d\n", pdev->vopen); | 1257 | |
1240 | return 0; | 1258 | return 0; |
1241 | } | 1259 | } |
1242 | 1260 | ||
@@ -1791,21 +1809,21 @@ static void usb_pwc_disconnect(struct usb_interface *intf) | |||
1791 | /* Alert waiting processes */ | 1809 | /* Alert waiting processes */ |
1792 | wake_up_interruptible(&pdev->frameq); | 1810 | wake_up_interruptible(&pdev->frameq); |
1793 | /* Wait until device is closed */ | 1811 | /* Wait until device is closed */ |
1794 | while (pdev->vopen) | 1812 | if(pdev->vopen) { |
1795 | schedule(); | 1813 | pdev->unplugged = 1; |
1796 | /* Device is now closed, so we can safely unregister it */ | 1814 | } else { |
1797 | PWC_DEBUG_PROBE("Unregistering video device in disconnect().\n"); | 1815 | /* Device is closed, so we can safely unregister it */ |
1798 | pwc_remove_sysfs_files(pdev->vdev); | 1816 | PWC_DEBUG_PROBE("Unregistering video device in disconnect().\n"); |
1799 | video_unregister_device(pdev->vdev); | 1817 | pwc_cleanup(pdev); |
1800 | 1818 | /* Free memory (don't set pdev to 0 just yet) */ | |
1801 | /* Free memory (don't set pdev to 0 just yet) */ | 1819 | kfree(pdev); |
1802 | kfree(pdev); | ||
1803 | 1820 | ||
1804 | disconnect_out: | 1821 | disconnect_out: |
1805 | /* search device_hint[] table if we occupy a slot, by any chance */ | 1822 | /* search device_hint[] table if we occupy a slot, by any chance */ |
1806 | for (hint = 0; hint < MAX_DEV_HINTS; hint++) | 1823 | for (hint = 0; hint < MAX_DEV_HINTS; hint++) |
1807 | if (device_hint[hint].pdev == pdev) | 1824 | if (device_hint[hint].pdev == pdev) |
1808 | device_hint[hint].pdev = NULL; | 1825 | device_hint[hint].pdev = NULL; |
1826 | } | ||
1809 | 1827 | ||
1810 | unlock_kernel(); | 1828 | unlock_kernel(); |
1811 | } | 1829 | } |
diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h index 910a04f53920..8e8e5b27e77e 100644 --- a/drivers/media/video/pwc/pwc.h +++ b/drivers/media/video/pwc/pwc.h | |||
@@ -193,6 +193,7 @@ struct pwc_device | |||
193 | char vsnapshot; /* snapshot mode */ | 193 | char vsnapshot; /* snapshot mode */ |
194 | char vsync; /* used by isoc handler */ | 194 | char vsync; /* used by isoc handler */ |
195 | char vmirror; /* for ToUCaM series */ | 195 | char vmirror; /* for ToUCaM series */ |
196 | char unplugged; | ||
196 | 197 | ||
197 | int cmd_len; | 198 | int cmd_len; |
198 | unsigned char cmd_buf[13]; | 199 | unsigned char cmd_buf[13]; |
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 518d5d335464..a26655881e6a 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig | |||
@@ -5,6 +5,11 @@ | |||
5 | menuconfig MISC_DEVICES | 5 | menuconfig MISC_DEVICES |
6 | bool "Misc devices" | 6 | bool "Misc devices" |
7 | default y | 7 | default y |
8 | ---help--- | ||
9 | Say Y here to get to see options for device drivers from various | ||
10 | different categories. This option alone does not add any kernel code. | ||
11 | |||
12 | If you say N, all options in this submenu will be skipped and disabled. | ||
8 | 13 | ||
9 | if MISC_DEVICES | 14 | if MISC_DEVICES |
10 | 15 | ||
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c index d0fc4fd212e6..40db9f70148f 100644 --- a/drivers/misc/asus-laptop.c +++ b/drivers/misc/asus-laptop.c | |||
@@ -1072,7 +1072,8 @@ static void asus_backlight_exit(void) | |||
1072 | } | 1072 | } |
1073 | 1073 | ||
1074 | #define ASUS_LED_UNREGISTER(object) \ | 1074 | #define ASUS_LED_UNREGISTER(object) \ |
1075 | led_classdev_unregister(&object##_led) | 1075 | if (object##_led.dev) \ |
1076 | led_classdev_unregister(&object##_led) | ||
1076 | 1077 | ||
1077 | static void asus_led_exit(void) | 1078 | static void asus_led_exit(void) |
1078 | { | 1079 | { |
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index fe0e785ed7d2..817a79462b3d 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c | |||
@@ -186,12 +186,10 @@ struct mmc_card *mmc_alloc_card(struct mmc_host *host) | |||
186 | { | 186 | { |
187 | struct mmc_card *card; | 187 | struct mmc_card *card; |
188 | 188 | ||
189 | card = kmalloc(sizeof(struct mmc_card), GFP_KERNEL); | 189 | card = kzalloc(sizeof(struct mmc_card), GFP_KERNEL); |
190 | if (!card) | 190 | if (!card) |
191 | return ERR_PTR(-ENOMEM); | 191 | return ERR_PTR(-ENOMEM); |
192 | 192 | ||
193 | memset(card, 0, sizeof(struct mmc_card)); | ||
194 | |||
195 | card->host = host; | 193 | card->host = host; |
196 | 194 | ||
197 | device_initialize(&card->dev); | 195 | device_initialize(&card->dev); |
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 6a7e29849603..2c7ce8f43a9a 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c | |||
@@ -58,12 +58,10 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) | |||
58 | { | 58 | { |
59 | struct mmc_host *host; | 59 | struct mmc_host *host; |
60 | 60 | ||
61 | host = kmalloc(sizeof(struct mmc_host) + extra, GFP_KERNEL); | 61 | host = kzalloc(sizeof(struct mmc_host) + extra, GFP_KERNEL); |
62 | if (!host) | 62 | if (!host) |
63 | return NULL; | 63 | return NULL; |
64 | 64 | ||
65 | memset(host, 0, sizeof(struct mmc_host) + extra); | ||
66 | |||
67 | host->parent = dev; | 65 | host->parent = dev; |
68 | host->class_dev.parent = dev; | 66 | host->class_dev.parent = dev; |
69 | host->class_dev.class = &mmc_host_class; | 67 | host->class_dev.class = &mmc_host_class; |
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index f2bc87ac24f7..20a7d89e01ba 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -385,6 +385,9 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data) | |||
385 | BUG_ON(data->blksz > host->mmc->max_blk_size); | 385 | BUG_ON(data->blksz > host->mmc->max_blk_size); |
386 | BUG_ON(data->blocks > 65535); | 386 | BUG_ON(data->blocks > 65535); |
387 | 387 | ||
388 | host->data = data; | ||
389 | host->data_early = 0; | ||
390 | |||
388 | /* timeout in us */ | 391 | /* timeout in us */ |
389 | target_timeout = data->timeout_ns / 1000 + | 392 | target_timeout = data->timeout_ns / 1000 + |
390 | data->timeout_clks / host->clock; | 393 | data->timeout_clks / host->clock; |
@@ -443,11 +446,11 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, | |||
443 | { | 446 | { |
444 | u16 mode; | 447 | u16 mode; |
445 | 448 | ||
446 | WARN_ON(host->data); | ||
447 | |||
448 | if (data == NULL) | 449 | if (data == NULL) |
449 | return; | 450 | return; |
450 | 451 | ||
452 | WARN_ON(!host->data); | ||
453 | |||
451 | mode = SDHCI_TRNS_BLK_CNT_EN; | 454 | mode = SDHCI_TRNS_BLK_CNT_EN; |
452 | if (data->blocks > 1) | 455 | if (data->blocks > 1) |
453 | mode |= SDHCI_TRNS_MULTI; | 456 | mode |= SDHCI_TRNS_MULTI; |
@@ -477,8 +480,8 @@ static void sdhci_finish_data(struct sdhci_host *host) | |||
477 | /* | 480 | /* |
478 | * Controller doesn't count down when in single block mode. | 481 | * Controller doesn't count down when in single block mode. |
479 | */ | 482 | */ |
480 | if ((data->blocks == 1) && (data->error == MMC_ERR_NONE)) | 483 | if (data->blocks == 1) |
481 | blocks = 0; | 484 | blocks = (data->error == MMC_ERR_NONE) ? 0 : 1; |
482 | else | 485 | else |
483 | blocks = readw(host->ioaddr + SDHCI_BLOCK_COUNT); | 486 | blocks = readw(host->ioaddr + SDHCI_BLOCK_COUNT); |
484 | data->bytes_xfered = data->blksz * (data->blocks - blocks); | 487 | data->bytes_xfered = data->blksz * (data->blocks - blocks); |
@@ -600,9 +603,10 @@ static void sdhci_finish_command(struct sdhci_host *host) | |||
600 | 603 | ||
601 | host->cmd->error = MMC_ERR_NONE; | 604 | host->cmd->error = MMC_ERR_NONE; |
602 | 605 | ||
603 | if (host->cmd->data) | 606 | if (host->data && host->data_early) |
604 | host->data = host->cmd->data; | 607 | sdhci_finish_data(host); |
605 | else | 608 | |
609 | if (!host->cmd->data) | ||
606 | tasklet_schedule(&host->finish_tasklet); | 610 | tasklet_schedule(&host->finish_tasklet); |
607 | 611 | ||
608 | host->cmd = NULL; | 612 | host->cmd = NULL; |
@@ -929,9 +933,9 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) | |||
929 | BUG_ON(intmask == 0); | 933 | BUG_ON(intmask == 0); |
930 | 934 | ||
931 | if (!host->cmd) { | 935 | if (!host->cmd) { |
932 | printk(KERN_ERR "%s: Got command interrupt even though no " | 936 | printk(KERN_ERR "%s: Got command interrupt 0x%08x even " |
933 | "command operation was in progress.\n", | 937 | "though no command operation was in progress.\n", |
934 | mmc_hostname(host->mmc)); | 938 | mmc_hostname(host->mmc), (unsigned)intmask); |
935 | sdhci_dumpregs(host); | 939 | sdhci_dumpregs(host); |
936 | return; | 940 | return; |
937 | } | 941 | } |
@@ -961,9 +965,9 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) | |||
961 | if (intmask & SDHCI_INT_DATA_END) | 965 | if (intmask & SDHCI_INT_DATA_END) |
962 | return; | 966 | return; |
963 | 967 | ||
964 | printk(KERN_ERR "%s: Got data interrupt even though no " | 968 | printk(KERN_ERR "%s: Got data interrupt 0x%08x even " |
965 | "data operation was in progress.\n", | 969 | "though no data operation was in progress.\n", |
966 | mmc_hostname(host->mmc)); | 970 | mmc_hostname(host->mmc), (unsigned)intmask); |
967 | sdhci_dumpregs(host); | 971 | sdhci_dumpregs(host); |
968 | 972 | ||
969 | return; | 973 | return; |
@@ -991,8 +995,18 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) | |||
991 | writel(readl(host->ioaddr + SDHCI_DMA_ADDRESS), | 995 | writel(readl(host->ioaddr + SDHCI_DMA_ADDRESS), |
992 | host->ioaddr + SDHCI_DMA_ADDRESS); | 996 | host->ioaddr + SDHCI_DMA_ADDRESS); |
993 | 997 | ||
994 | if (intmask & SDHCI_INT_DATA_END) | 998 | if (intmask & SDHCI_INT_DATA_END) { |
995 | sdhci_finish_data(host); | 999 | if (host->cmd) { |
1000 | /* | ||
1001 | * Data managed to finish before the | ||
1002 | * command completed. Make sure we do | ||
1003 | * things in the proper order. | ||
1004 | */ | ||
1005 | host->data_early = 1; | ||
1006 | } else { | ||
1007 | sdhci_finish_data(host); | ||
1008 | } | ||
1009 | } | ||
996 | } | 1010 | } |
997 | } | 1011 | } |
998 | 1012 | ||
@@ -1347,12 +1361,11 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | |||
1347 | */ | 1361 | */ |
1348 | mmc->max_blk_size = (caps & SDHCI_MAX_BLOCK_MASK) >> SDHCI_MAX_BLOCK_SHIFT; | 1362 | mmc->max_blk_size = (caps & SDHCI_MAX_BLOCK_MASK) >> SDHCI_MAX_BLOCK_SHIFT; |
1349 | if (mmc->max_blk_size >= 3) { | 1363 | if (mmc->max_blk_size >= 3) { |
1350 | printk(KERN_ERR "%s: Invalid maximum block size.\n", | 1364 | printk(KERN_WARNING "%s: Invalid maximum block size, assuming 512\n", |
1351 | host->slot_descr); | 1365 | host->slot_descr); |
1352 | ret = -ENODEV; | 1366 | mmc->max_blk_size = 512; |
1353 | goto unmap; | 1367 | } else |
1354 | } | 1368 | mmc->max_blk_size = 512 << mmc->max_blk_size; |
1355 | mmc->max_blk_size = 512 << mmc->max_blk_size; | ||
1356 | 1369 | ||
1357 | /* | 1370 | /* |
1358 | * Maximum block count. | 1371 | * Maximum block count. |
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index d157776c1149..e28987d6d2eb 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -182,6 +182,7 @@ struct sdhci_host { | |||
182 | struct mmc_request *mrq; /* Current request */ | 182 | struct mmc_request *mrq; /* Current request */ |
183 | struct mmc_command *cmd; /* Current command */ | 183 | struct mmc_command *cmd; /* Current command */ |
184 | struct mmc_data *data; /* Current data request */ | 184 | struct mmc_data *data; /* Current data request */ |
185 | int data_early:1; /* Data finished before cmd */ | ||
185 | 186 | ||
186 | struct scatterlist *cur_sg; /* We're working on this */ | 187 | struct scatterlist *cur_sg; /* We're working on this */ |
187 | int num_sg; /* Entries left */ | 188 | int num_sg; /* Entries left */ |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 81ef81c9a584..5b9e17bf1749 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1968,6 +1968,16 @@ menuconfig NETDEV_1000 | |||
1968 | bool "Ethernet (1000 Mbit)" | 1968 | bool "Ethernet (1000 Mbit)" |
1969 | depends on !UML | 1969 | depends on !UML |
1970 | default y | 1970 | default y |
1971 | ---help--- | ||
1972 | Ethernet (also called IEEE 802.3 or ISO 8802-2) is the most common | ||
1973 | type of Local Area Network (LAN) in universities and companies. | ||
1974 | |||
1975 | Say Y here to get to see options for Gigabit Ethernet drivers. | ||
1976 | This option alone does not add any kernel code. | ||
1977 | Note that drivers supporting both 100 and 1000 MBit may be listed | ||
1978 | under "Ethernet (10 or 100MBit)" instead. | ||
1979 | |||
1980 | If you say N, all options in this submenu will be skipped and disabled. | ||
1971 | 1981 | ||
1972 | if NETDEV_1000 | 1982 | if NETDEV_1000 |
1973 | 1983 | ||
@@ -2339,6 +2349,11 @@ menuconfig NETDEV_10000 | |||
2339 | bool "Ethernet (10000 Mbit)" | 2349 | bool "Ethernet (10000 Mbit)" |
2340 | depends on !UML | 2350 | depends on !UML |
2341 | default y | 2351 | default y |
2352 | ---help--- | ||
2353 | Say Y here to get to see options for 10 Gigabit Ethernet drivers. | ||
2354 | This option alone does not add any kernel code. | ||
2355 | |||
2356 | If you say N, all options in this submenu will be skipped and disabled. | ||
2342 | 2357 | ||
2343 | if NETDEV_10000 | 2358 | if NETDEV_10000 |
2344 | 2359 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 69f5f365239a..10f4e3b55168 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -3068,8 +3068,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data) | |||
3068 | np->nic_poll_irq = np->irqmask; | 3068 | np->nic_poll_irq = np->irqmask; |
3069 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3069 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3070 | } | 3070 | } |
3071 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i); | ||
3072 | spin_unlock(&np->lock); | 3071 | spin_unlock(&np->lock); |
3072 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i); | ||
3073 | break; | 3073 | break; |
3074 | } | 3074 | } |
3075 | 3075 | ||
@@ -3186,8 +3186,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data) | |||
3186 | np->nic_poll_irq = np->irqmask; | 3186 | np->nic_poll_irq = np->irqmask; |
3187 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3187 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3188 | } | 3188 | } |
3189 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i); | ||
3190 | spin_unlock(&np->lock); | 3189 | spin_unlock(&np->lock); |
3190 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq.\n", dev->name, i); | ||
3191 | break; | 3191 | break; |
3192 | } | 3192 | } |
3193 | 3193 | ||
@@ -3233,8 +3233,8 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data) | |||
3233 | np->nic_poll_irq |= NVREG_IRQ_TX_ALL; | 3233 | np->nic_poll_irq |= NVREG_IRQ_TX_ALL; |
3234 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3234 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3235 | } | 3235 | } |
3236 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_tx.\n", dev->name, i); | ||
3237 | spin_unlock_irqrestore(&np->lock, flags); | 3236 | spin_unlock_irqrestore(&np->lock, flags); |
3237 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_tx.\n", dev->name, i); | ||
3238 | break; | 3238 | break; |
3239 | } | 3239 | } |
3240 | 3240 | ||
@@ -3348,8 +3348,8 @@ static irqreturn_t nv_nic_irq_rx(int foo, void *data) | |||
3348 | np->nic_poll_irq |= NVREG_IRQ_RX_ALL; | 3348 | np->nic_poll_irq |= NVREG_IRQ_RX_ALL; |
3349 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3349 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3350 | } | 3350 | } |
3351 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_rx.\n", dev->name, i); | ||
3352 | spin_unlock_irqrestore(&np->lock, flags); | 3351 | spin_unlock_irqrestore(&np->lock, flags); |
3352 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_rx.\n", dev->name, i); | ||
3353 | break; | 3353 | break; |
3354 | } | 3354 | } |
3355 | } | 3355 | } |
@@ -3421,8 +3421,8 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data) | |||
3421 | np->nic_poll_irq |= NVREG_IRQ_OTHER; | 3421 | np->nic_poll_irq |= NVREG_IRQ_OTHER; |
3422 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3422 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3423 | } | 3423 | } |
3424 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_other.\n", dev->name, i); | ||
3425 | spin_unlock_irqrestore(&np->lock, flags); | 3424 | spin_unlock_irqrestore(&np->lock, flags); |
3425 | printk(KERN_DEBUG "%s: too many iterations (%d) in nv_nic_irq_other.\n", dev->name, i); | ||
3426 | break; | 3426 | break; |
3427 | } | 3427 | } |
3428 | 3428 | ||
diff --git a/drivers/net/mlx4/reset.c b/drivers/net/mlx4/reset.c index e4dfd4b11a4a..e199715fabd0 100644 --- a/drivers/net/mlx4/reset.c +++ b/drivers/net/mlx4/reset.c | |||
@@ -119,6 +119,9 @@ int mlx4_reset(struct mlx4_dev *dev) | |||
119 | writel(MLX4_RESET_VALUE, reset + MLX4_RESET_OFFSET); | 119 | writel(MLX4_RESET_VALUE, reset + MLX4_RESET_OFFSET); |
120 | iounmap(reset); | 120 | iounmap(reset); |
121 | 121 | ||
122 | /* Docs say to wait one second before accessing device */ | ||
123 | msleep(1000); | ||
124 | |||
122 | end = jiffies + MLX4_RESET_TIMEOUT_JIFFIES; | 125 | end = jiffies + MLX4_RESET_TIMEOUT_JIFFIES; |
123 | do { | 126 | do { |
124 | if (!pci_read_config_word(dev->pdev, PCI_VENDOR_ID, &vendor) && | 127 | if (!pci_read_config_word(dev->pdev, PCI_VENDOR_ID, &vendor) && |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index ef3325b69233..9293c82ef2af 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -1726,7 +1726,7 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb) | |||
1726 | } | 1726 | } |
1727 | /* the decompressor still expects the A/C bytes in the hdr */ | 1727 | /* the decompressor still expects the A/C bytes in the hdr */ |
1728 | len = ppp->rcomp->decompress(ppp->rc_state, skb->data - 2, | 1728 | len = ppp->rcomp->decompress(ppp->rc_state, skb->data - 2, |
1729 | skb->len + 2, ns->data, ppp->mru + PPP_HDRLEN); | 1729 | skb->len + 2, ns->data, obuff_size); |
1730 | if (len < 0) { | 1730 | if (len < 0) { |
1731 | /* Pass the compressed frame to pppd as an | 1731 | /* Pass the compressed frame to pppd as an |
1732 | error indication. */ | 1732 | error indication. */ |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index e7a2eadcc3b0..757592436390 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -696,8 +696,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) | |||
696 | int i; | 696 | int i; |
697 | const u8 *addr = hw->dev[port]->dev_addr; | 697 | const u8 *addr = hw->dev[port]->dev_addr; |
698 | 698 | ||
699 | sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); | 699 | sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); |
700 | sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR); | 700 | sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR); |
701 | 701 | ||
702 | sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR); | 702 | sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR); |
703 | 703 | ||
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index 79ff6b4de3a6..37d72f123a80 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c | |||
@@ -1746,10 +1746,8 @@ static void pushbutton_helper_thread(unsigned long data) | |||
1746 | static int event_thread(void* data) | 1746 | static int event_thread(void* data) |
1747 | { | 1747 | { |
1748 | struct controller *ctrl; | 1748 | struct controller *ctrl; |
1749 | lock_kernel(); | 1749 | |
1750 | daemonize("phpd_event"); | 1750 | daemonize("phpd_event"); |
1751 | |||
1752 | unlock_kernel(); | ||
1753 | 1751 | ||
1754 | while (1) { | 1752 | while (1) { |
1755 | dbg("!!!!event_thread sleeping\n"); | 1753 | dbg("!!!!event_thread sleeping\n"); |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index c6e132d7c0f7..4c36e80f6d26 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -5,12 +5,7 @@ extern int pci_uevent(struct device *dev, char **envp, int num_envp, | |||
5 | extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); | 5 | extern int pci_create_sysfs_dev_files(struct pci_dev *pdev); |
6 | extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); | 6 | extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); |
7 | extern void pci_cleanup_rom(struct pci_dev *dev); | 7 | extern void pci_cleanup_rom(struct pci_dev *dev); |
8 | extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | 8 | |
9 | resource_size_t size, resource_size_t align, | ||
10 | resource_size_t min, unsigned int type_mask, | ||
11 | void (*alignf)(void *, struct resource *, | ||
12 | resource_size_t, resource_size_t), | ||
13 | void *alignf_data); | ||
14 | /* Firmware callbacks */ | 9 | /* Firmware callbacks */ |
15 | extern pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); | 10 | extern pci_power_t (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); |
16 | extern int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t state); | 11 | extern int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t state); |
@@ -35,7 +30,6 @@ static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; } | |||
35 | 30 | ||
36 | /* Functions for PCI Hotplug drivers to use */ | 31 | /* Functions for PCI Hotplug drivers to use */ |
37 | extern unsigned int pci_do_scan_bus(struct pci_bus *bus); | 32 | extern unsigned int pci_do_scan_bus(struct pci_bus *bus); |
38 | extern int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap); | ||
39 | 33 | ||
40 | extern void pci_remove_legacy_files(struct pci_bus *bus); | 34 | extern void pci_remove_legacy_files(struct pci_bus *bus); |
41 | 35 | ||
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 34b8dae0d90f..27e00b2d7b5b 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -653,20 +653,20 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass | |||
653 | 653 | ||
654 | sprintf(child->name, (is_cardbus ? "PCI CardBus #%02x" : "PCI Bus #%02x"), child->number); | 654 | sprintf(child->name, (is_cardbus ? "PCI CardBus #%02x" : "PCI Bus #%02x"), child->number); |
655 | 655 | ||
656 | /* Has only triggered on CardBus, fixup is in yenta_socket */ | ||
656 | while (bus->parent) { | 657 | while (bus->parent) { |
657 | if ((child->subordinate > bus->subordinate) || | 658 | if ((child->subordinate > bus->subordinate) || |
658 | (child->number > bus->subordinate) || | 659 | (child->number > bus->subordinate) || |
659 | (child->number < bus->number) || | 660 | (child->number < bus->number) || |
660 | (child->subordinate < bus->number)) { | 661 | (child->subordinate < bus->number)) { |
661 | printk(KERN_WARNING "PCI: Bus #%02x (-#%02x) is " | 662 | pr_debug("PCI: Bus #%02x (-#%02x) is %s" |
662 | "hidden behind%s bridge #%02x (-#%02x)%s\n", | 663 | "hidden behind%s bridge #%02x (-#%02x)\n", |
663 | child->number, child->subordinate, | 664 | child->number, child->subordinate, |
664 | bus->self->transparent ? " transparent" : " ", | 665 | (bus->number > child->subordinate && |
665 | bus->number, bus->subordinate, | 666 | bus->subordinate < child->number) ? |
666 | pcibios_assign_all_busses() ? " " : | 667 | "wholly " : " partially", |
667 | " (try 'pci=assign-busses')"); | 668 | bus->self->transparent ? " transparent" : " ", |
668 | printk(KERN_WARNING "Please report the result to " | 669 | bus->number, bus->subordinate); |
669 | "<bk@suse.de> to fix this permanently\n"); | ||
670 | } | 670 | } |
671 | bus = bus->parent; | 671 | bus = bus->parent; |
672 | } | 672 | } |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index c559085c89a5..2d40f437b9fc 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -947,7 +947,7 @@ static void k8t_sound_hostbridge(struct pci_dev *dev) | |||
947 | unsigned char val; | 947 | unsigned char val; |
948 | 948 | ||
949 | pci_read_config_byte(dev, 0x50, &val); | 949 | pci_read_config_byte(dev, 0x50, &val); |
950 | if (val == 0x88 || val == 0xc8) { | 950 | if (val == 0xc8) { |
951 | /* Assume it's probably a MSI-K8T-Neo2Fir */ | 951 | /* Assume it's probably a MSI-K8T-Neo2Fir */ |
952 | printk(KERN_INFO "PCI: MSI-K8T-Neo2Fir, attempting to turn soundcard ON\n"); | 952 | printk(KERN_INFO "PCI: MSI-K8T-Neo2Fir, attempting to turn soundcard ON\n"); |
953 | pci_write_config_byte(dev, 0x50, val & (~0x40)); | 953 | pci_write_config_byte(dev, 0x50, val & (~0x40)); |
@@ -1485,7 +1485,7 @@ static void __devinit quirk_e100_interrupt(struct pci_dev *dev) | |||
1485 | 1485 | ||
1486 | iounmap(csr); | 1486 | iounmap(csr); |
1487 | } | 1487 | } |
1488 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_e100_interrupt); | 1488 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_e100_interrupt); |
1489 | 1489 | ||
1490 | static void __devinit fixup_rev1_53c810(struct pci_dev* dev) | 1490 | static void __devinit fixup_rev1_53c810(struct pci_dev* dev) |
1491 | { | 1491 | { |
@@ -1650,6 +1650,9 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCN | |||
1650 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX, quirk_disable_all_msi); | 1650 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX, quirk_disable_all_msi); |
1651 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi); | 1651 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi); |
1652 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi); | 1652 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi); |
1653 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RD580, quirk_disable_all_msi); | ||
1654 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RX790, quirk_disable_all_msi); | ||
1655 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS690, quirk_disable_all_msi); | ||
1653 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi); | 1656 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi); |
1654 | 1657 | ||
1655 | /* Disable MSI on chipsets that are known to not support it */ | 1658 | /* Disable MSI on chipsets that are known to not support it */ |
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index 80c4a8463065..1cb33cac1237 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c | |||
@@ -892,7 +892,7 @@ static int m41t80_remove(struct i2c_client *client) | |||
892 | 892 | ||
893 | static struct i2c_driver m41t80_driver = { | 893 | static struct i2c_driver m41t80_driver = { |
894 | .driver = { | 894 | .driver = { |
895 | .name = "m41t80", | 895 | .name = "rtc-m41t80", |
896 | }, | 896 | }, |
897 | .probe = m41t80_probe, | 897 | .probe = m41t80_probe, |
898 | .remove = m41t80_remove, | 898 | .remove = m41t80_remove, |
diff --git a/drivers/rtc/rtc-max6902.c b/drivers/rtc/rtc-max6902.c index d94170728075..3e183cfee10f 100644 --- a/drivers/rtc/rtc-max6902.c +++ b/drivers/rtc/rtc-max6902.c | |||
@@ -13,7 +13,7 @@ | |||
13 | * | 13 | * |
14 | * 24-May-2006: Raphael Assenat <raph@8d.com> | 14 | * 24-May-2006: Raphael Assenat <raph@8d.com> |
15 | * - Major rework | 15 | * - Major rework |
16 | * Converted to rtc_device and uses the SPI layer. | 16 | * Converted to rtc_device and uses the SPI layer. |
17 | * | 17 | * |
18 | * ??-???-2005: Someone at Compulab | 18 | * ??-???-2005: Someone at Compulab |
19 | * - Initial driver creation. | 19 | * - Initial driver creation. |
@@ -259,11 +259,11 @@ static int __devexit max6902_remove(struct spi_device *spi) | |||
259 | 259 | ||
260 | static struct spi_driver max6902_driver = { | 260 | static struct spi_driver max6902_driver = { |
261 | .driver = { | 261 | .driver = { |
262 | .name = "max6902", | 262 | .name = "rtc-max6902", |
263 | .bus = &spi_bus_type, | 263 | .bus = &spi_bus_type, |
264 | .owner = THIS_MODULE, | 264 | .owner = THIS_MODULE, |
265 | }, | 265 | }, |
266 | .probe = max6902_probe, | 266 | .probe = max6902_probe, |
267 | .remove = __devexit_p(max6902_remove), | 267 | .remove = __devexit_p(max6902_remove), |
268 | }; | 268 | }; |
269 | 269 | ||
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index eccac1c3b71b..d32c60dbdd82 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/s390_ext.h> | 24 | #include <asm/s390_ext.h> |
25 | #include <asm/todclk.h> | 25 | #include <asm/todclk.h> |
26 | #include <asm/vtoc.h> | 26 | #include <asm/vtoc.h> |
27 | #include <asm/diag.h> | ||
27 | 28 | ||
28 | #include "dasd_int.h" | 29 | #include "dasd_int.h" |
29 | #include "dasd_diag.h" | 30 | #include "dasd_diag.h" |
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index 4f2f81b16cfa..2edd5fb6d3dc 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/ccwdev.h> | 21 | #include <asm/ccwdev.h> |
22 | #include <asm/cio.h> | 22 | #include <asm/cio.h> |
23 | #include <asm/ebcdic.h> | 23 | #include <asm/ebcdic.h> |
24 | #include <asm/diag.h> | ||
24 | 25 | ||
25 | #include "raw3270.h" | 26 | #include "raw3270.h" |
26 | 27 | ||
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c index 04b19bdc09da..d70a6e65bf14 100644 --- a/drivers/s390/char/vmur.c +++ b/drivers/s390/char/vmur.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/cio.h> | 14 | #include <asm/cio.h> |
15 | #include <asm/ccwdev.h> | 15 | #include <asm/ccwdev.h> |
16 | #include <asm/debug.h> | 16 | #include <asm/debug.h> |
17 | #include <asm/diag.h> | ||
17 | 18 | ||
18 | #include "vmur.h" | 19 | #include "vmur.h" |
19 | 20 | ||
@@ -68,8 +69,26 @@ static struct ccw_driver ur_driver = { | |||
68 | .set_offline = ur_set_offline, | 69 | .set_offline = ur_set_offline, |
69 | }; | 70 | }; |
70 | 71 | ||
72 | static DEFINE_MUTEX(vmur_mutex); | ||
73 | |||
71 | /* | 74 | /* |
72 | * Allocation, freeing, getting and putting of urdev structures | 75 | * Allocation, freeing, getting and putting of urdev structures |
76 | * | ||
77 | * Each ur device (urd) contains a reference to its corresponding ccw device | ||
78 | * (cdev) using the urd->cdev pointer. Each ccw device has a reference to the | ||
79 | * ur device using the cdev->dev.driver_data pointer. | ||
80 | * | ||
81 | * urd references: | ||
82 | * - ur_probe gets a urd reference, ur_remove drops the reference | ||
83 | * (cdev->dev.driver_data) | ||
84 | * - ur_open gets a urd reference, ur_relase drops the reference | ||
85 | * (urf->urd) | ||
86 | * | ||
87 | * cdev references: | ||
88 | * - urdev_alloc get a cdev reference (urd->cdev) | ||
89 | * - urdev_free drops the cdev reference (urd->cdev) | ||
90 | * | ||
91 | * Setting and clearing of cdev->dev.driver_data is protected by the ccwdev lock | ||
73 | */ | 92 | */ |
74 | static struct urdev *urdev_alloc(struct ccw_device *cdev) | 93 | static struct urdev *urdev_alloc(struct ccw_device *cdev) |
75 | { | 94 | { |
@@ -78,42 +97,61 @@ static struct urdev *urdev_alloc(struct ccw_device *cdev) | |||
78 | urd = kzalloc(sizeof(struct urdev), GFP_KERNEL); | 97 | urd = kzalloc(sizeof(struct urdev), GFP_KERNEL); |
79 | if (!urd) | 98 | if (!urd) |
80 | return NULL; | 99 | return NULL; |
81 | urd->cdev = cdev; | ||
82 | urd->reclen = cdev->id.driver_info; | 100 | urd->reclen = cdev->id.driver_info; |
83 | ccw_device_get_id(cdev, &urd->dev_id); | 101 | ccw_device_get_id(cdev, &urd->dev_id); |
84 | mutex_init(&urd->io_mutex); | 102 | mutex_init(&urd->io_mutex); |
85 | mutex_init(&urd->open_mutex); | 103 | mutex_init(&urd->open_mutex); |
104 | atomic_set(&urd->ref_count, 1); | ||
105 | urd->cdev = cdev; | ||
106 | get_device(&cdev->dev); | ||
86 | return urd; | 107 | return urd; |
87 | } | 108 | } |
88 | 109 | ||
89 | static void urdev_free(struct urdev *urd) | 110 | static void urdev_free(struct urdev *urd) |
90 | { | 111 | { |
112 | TRACE("urdev_free: %p\n", urd); | ||
113 | if (urd->cdev) | ||
114 | put_device(&urd->cdev->dev); | ||
91 | kfree(urd); | 115 | kfree(urd); |
92 | } | 116 | } |
93 | 117 | ||
94 | /* | 118 | static void urdev_get(struct urdev *urd) |
95 | * This is how the character device driver gets a reference to a | 119 | { |
96 | * ur device. When this call returns successfully, a reference has | 120 | atomic_inc(&urd->ref_count); |
97 | * been taken (by get_device) on the underlying kobject. The recipient | 121 | } |
98 | * of this urdev pointer must eventually drop it with urdev_put(urd) | 122 | |
99 | * which does the corresponding put_device(). | 123 | static struct urdev *urdev_get_from_cdev(struct ccw_device *cdev) |
100 | */ | 124 | { |
125 | struct urdev *urd; | ||
126 | unsigned long flags; | ||
127 | |||
128 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); | ||
129 | urd = cdev->dev.driver_data; | ||
130 | if (urd) | ||
131 | urdev_get(urd); | ||
132 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); | ||
133 | return urd; | ||
134 | } | ||
135 | |||
101 | static struct urdev *urdev_get_from_devno(u16 devno) | 136 | static struct urdev *urdev_get_from_devno(u16 devno) |
102 | { | 137 | { |
103 | char bus_id[16]; | 138 | char bus_id[16]; |
104 | struct ccw_device *cdev; | 139 | struct ccw_device *cdev; |
140 | struct urdev *urd; | ||
105 | 141 | ||
106 | sprintf(bus_id, "0.0.%04x", devno); | 142 | sprintf(bus_id, "0.0.%04x", devno); |
107 | cdev = get_ccwdev_by_busid(&ur_driver, bus_id); | 143 | cdev = get_ccwdev_by_busid(&ur_driver, bus_id); |
108 | if (!cdev) | 144 | if (!cdev) |
109 | return NULL; | 145 | return NULL; |
110 | 146 | urd = urdev_get_from_cdev(cdev); | |
111 | return cdev->dev.driver_data; | 147 | put_device(&cdev->dev); |
148 | return urd; | ||
112 | } | 149 | } |
113 | 150 | ||
114 | static void urdev_put(struct urdev *urd) | 151 | static void urdev_put(struct urdev *urd) |
115 | { | 152 | { |
116 | put_device(&urd->cdev->dev); | 153 | if (atomic_dec_and_test(&urd->ref_count)) |
154 | urdev_free(urd); | ||
117 | } | 155 | } |
118 | 156 | ||
119 | /* | 157 | /* |
@@ -245,6 +283,7 @@ static void ur_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
245 | return; | 283 | return; |
246 | } | 284 | } |
247 | urd = cdev->dev.driver_data; | 285 | urd = cdev->dev.driver_data; |
286 | BUG_ON(!urd); | ||
248 | /* On special conditions irb is an error pointer */ | 287 | /* On special conditions irb is an error pointer */ |
249 | if (IS_ERR(irb)) | 288 | if (IS_ERR(irb)) |
250 | urd->io_request_rc = PTR_ERR(irb); | 289 | urd->io_request_rc = PTR_ERR(irb); |
@@ -262,9 +301,15 @@ static void ur_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
262 | static ssize_t ur_attr_reclen_show(struct device *dev, | 301 | static ssize_t ur_attr_reclen_show(struct device *dev, |
263 | struct device_attribute *attr, char *buf) | 302 | struct device_attribute *attr, char *buf) |
264 | { | 303 | { |
265 | struct urdev *urd = dev->driver_data; | 304 | struct urdev *urd; |
305 | int rc; | ||
266 | 306 | ||
267 | return sprintf(buf, "%zu\n", urd->reclen); | 307 | urd = urdev_get_from_cdev(to_ccwdev(dev)); |
308 | if (!urd) | ||
309 | return -ENODEV; | ||
310 | rc = sprintf(buf, "%zu\n", urd->reclen); | ||
311 | urdev_put(urd); | ||
312 | return rc; | ||
268 | } | 313 | } |
269 | 314 | ||
270 | static DEVICE_ATTR(reclen, 0444, ur_attr_reclen_show, NULL); | 315 | static DEVICE_ATTR(reclen, 0444, ur_attr_reclen_show, NULL); |
@@ -379,31 +424,6 @@ static ssize_t ur_write(struct file *file, const char __user *udata, | |||
379 | return do_write(urf->urd, udata, count, urf->dev_reclen, ppos); | 424 | return do_write(urf->urd, udata, count, urf->dev_reclen, ppos); |
380 | } | 425 | } |
381 | 426 | ||
382 | static int do_diag_14(unsigned long rx, unsigned long ry1, | ||
383 | unsigned long subcode) | ||
384 | { | ||
385 | register unsigned long _ry1 asm("2") = ry1; | ||
386 | register unsigned long _ry2 asm("3") = subcode; | ||
387 | int rc = 0; | ||
388 | |||
389 | asm volatile( | ||
390 | #ifdef CONFIG_64BIT | ||
391 | " sam31\n" | ||
392 | " diag %2,2,0x14\n" | ||
393 | " sam64\n" | ||
394 | #else | ||
395 | " diag %2,2,0x14\n" | ||
396 | #endif | ||
397 | " ipm %0\n" | ||
398 | " srl %0,28\n" | ||
399 | : "=d" (rc), "+d" (_ry2) | ||
400 | : "d" (rx), "d" (_ry1) | ||
401 | : "cc"); | ||
402 | |||
403 | TRACE("diag 14: subcode=0x%lx, cc=%i\n", subcode, rc); | ||
404 | return rc; | ||
405 | } | ||
406 | |||
407 | /* | 427 | /* |
408 | * diagnose code 0x14 subcode 0x0028 - position spool file to designated | 428 | * diagnose code 0x14 subcode 0x0028 - position spool file to designated |
409 | * record | 429 | * record |
@@ -415,7 +435,7 @@ static int diag_position_to_record(int devno, int record) | |||
415 | { | 435 | { |
416 | int cc; | 436 | int cc; |
417 | 437 | ||
418 | cc = do_diag_14(record, devno, 0x28); | 438 | cc = diag14(record, devno, 0x28); |
419 | switch (cc) { | 439 | switch (cc) { |
420 | case 0: | 440 | case 0: |
421 | return 0; | 441 | return 0; |
@@ -440,7 +460,7 @@ static int diag_read_file(int devno, char *buf) | |||
440 | { | 460 | { |
441 | int cc; | 461 | int cc; |
442 | 462 | ||
443 | cc = do_diag_14((unsigned long) buf, devno, 0x00); | 463 | cc = diag14((unsigned long) buf, devno, 0x00); |
444 | switch (cc) { | 464 | switch (cc) { |
445 | case 0: | 465 | case 0: |
446 | return 0; | 466 | return 0; |
@@ -533,7 +553,7 @@ static int diag_read_next_file_info(struct file_control_block *buf, int spid) | |||
533 | { | 553 | { |
534 | int cc; | 554 | int cc; |
535 | 555 | ||
536 | cc = do_diag_14((unsigned long) buf, spid, 0xfff); | 556 | cc = diag14((unsigned long) buf, spid, 0xfff); |
537 | switch (cc) { | 557 | switch (cc) { |
538 | case 0: | 558 | case 0: |
539 | return 0; | 559 | return 0; |
@@ -750,64 +770,63 @@ static struct file_operations ur_fops = { | |||
750 | 770 | ||
751 | /* | 771 | /* |
752 | * ccw_device infrastructure: | 772 | * ccw_device infrastructure: |
753 | * ur_probe gets its own ref to the device (i.e. get_device), | 773 | * ur_probe creates the struct urdev (with refcount = 1), the device |
754 | * creates the struct urdev, the device attributes, sets up | 774 | * attributes, sets up the interrupt handler and validates the virtual |
755 | * the interrupt handler and validates the virtual unit record device. | 775 | * unit record device. |
756 | * ur_remove removes the device attributes, frees the struct urdev | 776 | * ur_remove removes the device attributes and drops the reference to |
757 | * and drops (put_device) the ref to the device we got in ur_probe. | 777 | * struct urdev. |
778 | * | ||
779 | * ur_probe, ur_remove, ur_set_online and ur_set_offline are serialized | ||
780 | * by the vmur_mutex lock. | ||
781 | * | ||
782 | * urd->char_device is used as indication that the online function has | ||
783 | * been completed successfully. | ||
758 | */ | 784 | */ |
759 | static int ur_probe(struct ccw_device *cdev) | 785 | static int ur_probe(struct ccw_device *cdev) |
760 | { | 786 | { |
761 | struct urdev *urd; | 787 | struct urdev *urd; |
762 | int rc; | 788 | int rc; |
763 | 789 | ||
764 | TRACE("ur_probe: cdev=%p state=%d\n", cdev, *(int *) cdev->private); | 790 | TRACE("ur_probe: cdev=%p\n", cdev); |
765 | |||
766 | if (!get_device(&cdev->dev)) | ||
767 | return -ENODEV; | ||
768 | 791 | ||
792 | mutex_lock(&vmur_mutex); | ||
769 | urd = urdev_alloc(cdev); | 793 | urd = urdev_alloc(cdev); |
770 | if (!urd) { | 794 | if (!urd) { |
771 | rc = -ENOMEM; | 795 | rc = -ENOMEM; |
772 | goto fail; | 796 | goto fail_unlock; |
773 | } | 797 | } |
798 | |||
774 | rc = ur_create_attributes(&cdev->dev); | 799 | rc = ur_create_attributes(&cdev->dev); |
775 | if (rc) { | 800 | if (rc) { |
776 | rc = -ENOMEM; | 801 | rc = -ENOMEM; |
777 | goto fail; | 802 | goto fail_urdev_put; |
778 | } | 803 | } |
779 | cdev->dev.driver_data = urd; | ||
780 | cdev->handler = ur_int_handler; | 804 | cdev->handler = ur_int_handler; |
781 | 805 | ||
782 | /* validate virtual unit record device */ | 806 | /* validate virtual unit record device */ |
783 | urd->class = get_urd_class(urd); | 807 | urd->class = get_urd_class(urd); |
784 | if (urd->class < 0) { | 808 | if (urd->class < 0) { |
785 | rc = urd->class; | 809 | rc = urd->class; |
786 | goto fail; | 810 | goto fail_remove_attr; |
787 | } | 811 | } |
788 | if ((urd->class != DEV_CLASS_UR_I) && (urd->class != DEV_CLASS_UR_O)) { | 812 | if ((urd->class != DEV_CLASS_UR_I) && (urd->class != DEV_CLASS_UR_O)) { |
789 | rc = -ENOTSUPP; | 813 | rc = -ENOTSUPP; |
790 | goto fail; | 814 | goto fail_remove_attr; |
791 | } | 815 | } |
816 | spin_lock_irq(get_ccwdev_lock(cdev)); | ||
817 | cdev->dev.driver_data = urd; | ||
818 | spin_unlock_irq(get_ccwdev_lock(cdev)); | ||
792 | 819 | ||
820 | mutex_unlock(&vmur_mutex); | ||
793 | return 0; | 821 | return 0; |
794 | 822 | ||
795 | fail: | 823 | fail_remove_attr: |
796 | urdev_free(urd); | ||
797 | put_device(&cdev->dev); | ||
798 | return rc; | ||
799 | } | ||
800 | |||
801 | static void ur_remove(struct ccw_device *cdev) | ||
802 | { | ||
803 | struct urdev *urd = cdev->dev.driver_data; | ||
804 | |||
805 | TRACE("ur_remove\n"); | ||
806 | if (cdev->online) | ||
807 | ur_set_offline(cdev); | ||
808 | ur_remove_attributes(&cdev->dev); | 824 | ur_remove_attributes(&cdev->dev); |
809 | urdev_free(urd); | 825 | fail_urdev_put: |
810 | put_device(&cdev->dev); | 826 | urdev_put(urd); |
827 | fail_unlock: | ||
828 | mutex_unlock(&vmur_mutex); | ||
829 | return rc; | ||
811 | } | 830 | } |
812 | 831 | ||
813 | static int ur_set_online(struct ccw_device *cdev) | 832 | static int ur_set_online(struct ccw_device *cdev) |
@@ -816,20 +835,29 @@ static int ur_set_online(struct ccw_device *cdev) | |||
816 | int minor, major, rc; | 835 | int minor, major, rc; |
817 | char node_id[16]; | 836 | char node_id[16]; |
818 | 837 | ||
819 | TRACE("ur_set_online: cdev=%p state=%d\n", cdev, | 838 | TRACE("ur_set_online: cdev=%p\n", cdev); |
820 | *(int *) cdev->private); | ||
821 | 839 | ||
822 | if (!try_module_get(ur_driver.owner)) | 840 | mutex_lock(&vmur_mutex); |
823 | return -EINVAL; | 841 | urd = urdev_get_from_cdev(cdev); |
842 | if (!urd) { | ||
843 | /* ur_remove already deleted our urd */ | ||
844 | rc = -ENODEV; | ||
845 | goto fail_unlock; | ||
846 | } | ||
847 | |||
848 | if (urd->char_device) { | ||
849 | /* Another ur_set_online was faster */ | ||
850 | rc = -EBUSY; | ||
851 | goto fail_urdev_put; | ||
852 | } | ||
824 | 853 | ||
825 | urd = (struct urdev *) cdev->dev.driver_data; | ||
826 | minor = urd->dev_id.devno; | 854 | minor = urd->dev_id.devno; |
827 | major = MAJOR(ur_first_dev_maj_min); | 855 | major = MAJOR(ur_first_dev_maj_min); |
828 | 856 | ||
829 | urd->char_device = cdev_alloc(); | 857 | urd->char_device = cdev_alloc(); |
830 | if (!urd->char_device) { | 858 | if (!urd->char_device) { |
831 | rc = -ENOMEM; | 859 | rc = -ENOMEM; |
832 | goto fail_module_put; | 860 | goto fail_urdev_put; |
833 | } | 861 | } |
834 | 862 | ||
835 | cdev_init(urd->char_device, &ur_fops); | 863 | cdev_init(urd->char_device, &ur_fops); |
@@ -858,29 +886,79 @@ static int ur_set_online(struct ccw_device *cdev) | |||
858 | TRACE("ur_set_online: device_create rc=%d\n", rc); | 886 | TRACE("ur_set_online: device_create rc=%d\n", rc); |
859 | goto fail_free_cdev; | 887 | goto fail_free_cdev; |
860 | } | 888 | } |
861 | 889 | urdev_put(urd); | |
890 | mutex_unlock(&vmur_mutex); | ||
862 | return 0; | 891 | return 0; |
863 | 892 | ||
864 | fail_free_cdev: | 893 | fail_free_cdev: |
865 | cdev_del(urd->char_device); | 894 | cdev_del(urd->char_device); |
866 | fail_module_put: | 895 | urd->char_device = NULL; |
867 | module_put(ur_driver.owner); | 896 | fail_urdev_put: |
868 | 897 | urdev_put(urd); | |
898 | fail_unlock: | ||
899 | mutex_unlock(&vmur_mutex); | ||
869 | return rc; | 900 | return rc; |
870 | } | 901 | } |
871 | 902 | ||
872 | static int ur_set_offline(struct ccw_device *cdev) | 903 | static int ur_set_offline_force(struct ccw_device *cdev, int force) |
873 | { | 904 | { |
874 | struct urdev *urd; | 905 | struct urdev *urd; |
906 | int rc; | ||
875 | 907 | ||
876 | TRACE("ur_set_offline: cdev=%p cdev->private=%p state=%d\n", | 908 | TRACE("ur_set_offline: cdev=%p\n", cdev); |
877 | cdev, cdev->private, *(int *) cdev->private); | 909 | urd = urdev_get_from_cdev(cdev); |
878 | urd = (struct urdev *) cdev->dev.driver_data; | 910 | if (!urd) |
911 | /* ur_remove already deleted our urd */ | ||
912 | return -ENODEV; | ||
913 | if (!urd->char_device) { | ||
914 | /* Another ur_set_offline was faster */ | ||
915 | rc = -EBUSY; | ||
916 | goto fail_urdev_put; | ||
917 | } | ||
918 | if (!force && (atomic_read(&urd->ref_count) > 2)) { | ||
919 | /* There is still a user of urd (e.g. ur_open) */ | ||
920 | TRACE("ur_set_offline: BUSY\n"); | ||
921 | rc = -EBUSY; | ||
922 | goto fail_urdev_put; | ||
923 | } | ||
879 | device_destroy(vmur_class, urd->char_device->dev); | 924 | device_destroy(vmur_class, urd->char_device->dev); |
880 | cdev_del(urd->char_device); | 925 | cdev_del(urd->char_device); |
881 | module_put(ur_driver.owner); | 926 | urd->char_device = NULL; |
927 | rc = 0; | ||
882 | 928 | ||
883 | return 0; | 929 | fail_urdev_put: |
930 | urdev_put(urd); | ||
931 | return rc; | ||
932 | } | ||
933 | |||
934 | static int ur_set_offline(struct ccw_device *cdev) | ||
935 | { | ||
936 | int rc; | ||
937 | |||
938 | mutex_lock(&vmur_mutex); | ||
939 | rc = ur_set_offline_force(cdev, 0); | ||
940 | mutex_unlock(&vmur_mutex); | ||
941 | return rc; | ||
942 | } | ||
943 | |||
944 | static void ur_remove(struct ccw_device *cdev) | ||
945 | { | ||
946 | unsigned long flags; | ||
947 | |||
948 | TRACE("ur_remove\n"); | ||
949 | |||
950 | mutex_lock(&vmur_mutex); | ||
951 | |||
952 | if (cdev->online) | ||
953 | ur_set_offline_force(cdev, 1); | ||
954 | ur_remove_attributes(&cdev->dev); | ||
955 | |||
956 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); | ||
957 | urdev_put(cdev->dev.driver_data); | ||
958 | cdev->dev.driver_data = NULL; | ||
959 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); | ||
960 | |||
961 | mutex_unlock(&vmur_mutex); | ||
884 | } | 962 | } |
885 | 963 | ||
886 | /* | 964 | /* |
diff --git a/drivers/s390/char/vmur.h b/drivers/s390/char/vmur.h index 2b3c564e0472..fa959644735a 100644 --- a/drivers/s390/char/vmur.h +++ b/drivers/s390/char/vmur.h | |||
@@ -70,6 +70,7 @@ struct urdev { | |||
70 | size_t reclen; /* Record length for *write* CCWs */ | 70 | size_t reclen; /* Record length for *write* CCWs */ |
71 | int class; /* VM device class */ | 71 | int class; /* VM device class */ |
72 | int io_request_rc; /* return code from I/O request */ | 72 | int io_request_rc; /* return code from I/O request */ |
73 | atomic_t ref_count; /* reference counter */ | ||
73 | }; | 74 | }; |
74 | 75 | ||
75 | /* | 76 | /* |
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c index 02fd00b55e1b..34a796913b06 100644 --- a/drivers/s390/cio/cmf.c +++ b/drivers/s390/cio/cmf.c | |||
@@ -594,6 +594,9 @@ alloc_cmb (struct ccw_device *cdev) | |||
594 | free_pages((unsigned long)mem, get_order(size)); | 594 | free_pages((unsigned long)mem, get_order(size)); |
595 | } else if (!mem) { | 595 | } else if (!mem) { |
596 | /* no luck */ | 596 | /* no luck */ |
597 | printk(KERN_WARNING "cio: failed to allocate area " | ||
598 | "for measuring %d subchannels\n", | ||
599 | cmb_area.num_channels); | ||
597 | ret = -ENOMEM; | 600 | ret = -ENOMEM; |
598 | goto out; | 601 | goto out; |
599 | } else { | 602 | } else { |
@@ -1279,13 +1282,6 @@ init_cmf(void) | |||
1279 | case CMF_BASIC: | 1282 | case CMF_BASIC: |
1280 | format_string = "basic"; | 1283 | format_string = "basic"; |
1281 | cmbops = &cmbops_basic; | 1284 | cmbops = &cmbops_basic; |
1282 | if (cmb_area.num_channels > 4096 || cmb_area.num_channels < 1) { | ||
1283 | printk(KERN_ERR "cio: Basic channel measurement " | ||
1284 | "facility can only use 1 to 4096 devices\n" | ||
1285 | KERN_ERR "when the cmf driver is built" | ||
1286 | " as a loadable module\n"); | ||
1287 | return 1; | ||
1288 | } | ||
1289 | break; | 1285 | break; |
1290 | case CMF_EXTENDED: | 1286 | case CMF_EXTENDED: |
1291 | format_string = "extended"; | 1287 | format_string = "extended"; |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 297659fa0e26..e44d92eac8e9 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -117,7 +117,10 @@ static int ccw_uevent(struct device *dev, char **envp, int num_envp, | |||
117 | snprint_alias(modalias_buf, sizeof(modalias_buf), id, ""); | 117 | snprint_alias(modalias_buf, sizeof(modalias_buf), id, ""); |
118 | ret = add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len, | 118 | ret = add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len, |
119 | "MODALIAS=%s", modalias_buf); | 119 | "MODALIAS=%s", modalias_buf); |
120 | return ret; | 120 | if (ret) |
121 | return ret; | ||
122 | envp[i] = NULL; | ||
123 | return 0; | ||
121 | } | 124 | } |
122 | 125 | ||
123 | struct bus_type ccw_bus_type; | 126 | struct bus_type ccw_bus_type; |
diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c index 60b9347f7c92..f232832f2b22 100644 --- a/drivers/s390/cio/device_id.c +++ b/drivers/s390/cio/device_id.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/delay.h> | 17 | #include <asm/delay.h> |
18 | #include <asm/cio.h> | 18 | #include <asm/cio.h> |
19 | #include <asm/lowcore.h> | 19 | #include <asm/lowcore.h> |
20 | #include <asm/diag.h> | ||
20 | 21 | ||
21 | #include "cio.h" | 22 | #include "cio.h" |
22 | #include "cio_debug.h" | 23 | #include "cio_debug.h" |
@@ -25,51 +26,6 @@ | |||
25 | #include "ioasm.h" | 26 | #include "ioasm.h" |
26 | 27 | ||
27 | /* | 28 | /* |
28 | * diag210 is used under VM to get information about a virtual device | ||
29 | */ | ||
30 | int | ||
31 | diag210(struct diag210 * addr) | ||
32 | { | ||
33 | /* | ||
34 | * diag 210 needs its data below the 2GB border, so we | ||
35 | * use a static data area to be sure | ||
36 | */ | ||
37 | static struct diag210 diag210_tmp; | ||
38 | static DEFINE_SPINLOCK(diag210_lock); | ||
39 | unsigned long flags; | ||
40 | int ccode; | ||
41 | |||
42 | spin_lock_irqsave(&diag210_lock, flags); | ||
43 | diag210_tmp = *addr; | ||
44 | |||
45 | #ifdef CONFIG_64BIT | ||
46 | asm volatile( | ||
47 | " lhi %0,-1\n" | ||
48 | " sam31\n" | ||
49 | " diag %1,0,0x210\n" | ||
50 | "0: ipm %0\n" | ||
51 | " srl %0,28\n" | ||
52 | "1: sam64\n" | ||
53 | EX_TABLE(0b,1b) | ||
54 | : "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory"); | ||
55 | #else | ||
56 | asm volatile( | ||
57 | " lhi %0,-1\n" | ||
58 | " diag %1,0,0x210\n" | ||
59 | "0: ipm %0\n" | ||
60 | " srl %0,28\n" | ||
61 | "1:\n" | ||
62 | EX_TABLE(0b,1b) | ||
63 | : "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory"); | ||
64 | #endif | ||
65 | |||
66 | *addr = diag210_tmp; | ||
67 | spin_unlock_irqrestore(&diag210_lock, flags); | ||
68 | |||
69 | return ccode; | ||
70 | } | ||
71 | |||
72 | /* | ||
73 | * Input : | 29 | * Input : |
74 | * devno - device number | 30 | * devno - device number |
75 | * ps - pointer to sense ID data area | 31 | * ps - pointer to sense ID data area |
@@ -349,5 +305,3 @@ ccw_device_sense_id_irq(struct ccw_device *cdev, enum dev_event dev_event) | |||
349 | break; | 305 | break; |
350 | } | 306 | } |
351 | } | 307 | } |
352 | |||
353 | EXPORT_SYMBOL(diag210); | ||
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index 03347aed2b3e..d8d479876ec7 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c | |||
@@ -195,6 +195,8 @@ qdio_do_eqbs(struct qdio_q *q, unsigned char *state, | |||
195 | again: | 195 | again: |
196 | ccq = do_eqbs(irq->sch_token, state, q_no, start, cnt); | 196 | ccq = do_eqbs(irq->sch_token, state, q_no, start, cnt); |
197 | rc = qdio_check_ccq(q, ccq); | 197 | rc = qdio_check_ccq(q, ccq); |
198 | if ((ccq == 96) && (tmp_cnt != *cnt)) | ||
199 | rc = 0; | ||
198 | if (rc == 1) { | 200 | if (rc == 1) { |
199 | QDIO_DBF_TEXT5(1,trace,"eqAGAIN"); | 201 | QDIO_DBF_TEXT5(1,trace,"eqAGAIN"); |
200 | goto again; | 202 | goto again; |
@@ -740,7 +742,8 @@ qdio_get_outbound_buffer_frontier(struct qdio_q *q) | |||
740 | first_not_to_check=f+qdio_min(atomic_read(&q->number_of_buffers_used), | 742 | first_not_to_check=f+qdio_min(atomic_read(&q->number_of_buffers_used), |
741 | (QDIO_MAX_BUFFERS_PER_Q-1)); | 743 | (QDIO_MAX_BUFFERS_PER_Q-1)); |
742 | 744 | ||
743 | if ((!q->is_iqdio_q)&&(!q->hydra_gives_outbound_pcis)) | 745 | if (((!q->is_iqdio_q) && (!q->hydra_gives_outbound_pcis)) || |
746 | (q->queue_type == QDIO_IQDIO_QFMT_ASYNCH)) | ||
744 | SYNC_MEMORY; | 747 | SYNC_MEMORY; |
745 | 748 | ||
746 | check_next: | 749 | check_next: |
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index d2b3898b750a..6f2c71ef47ee 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -367,6 +367,7 @@ config SCSI_3W_9XXX | |||
367 | config SCSI_7000FASST | 367 | config SCSI_7000FASST |
368 | tristate "7000FASST SCSI support" | 368 | tristate "7000FASST SCSI support" |
369 | depends on ISA && SCSI && ISA_DMA_API | 369 | depends on ISA && SCSI && ISA_DMA_API |
370 | select CHECK_SIGNATURE | ||
370 | help | 371 | help |
371 | This driver supports the Western Digital 7000 SCSI host adapter | 372 | This driver supports the Western Digital 7000 SCSI host adapter |
372 | family. Some information is in the source: | 373 | family. Some information is in the source: |
@@ -388,6 +389,7 @@ config SCSI_AHA152X | |||
388 | tristate "Adaptec AHA152X/2825 support" | 389 | tristate "Adaptec AHA152X/2825 support" |
389 | depends on ISA && SCSI && !64BIT | 390 | depends on ISA && SCSI && !64BIT |
390 | select SCSI_SPI_ATTRS | 391 | select SCSI_SPI_ATTRS |
392 | select CHECK_SIGNATURE | ||
391 | ---help--- | 393 | ---help--- |
392 | This is a driver for the AHA-1510, AHA-1520, AHA-1522, and AHA-2825 | 394 | This is a driver for the AHA-1510, AHA-1520, AHA-1522, and AHA-2825 |
393 | SCSI host adapters. It also works for the AVA-1505, but the IRQ etc. | 395 | SCSI host adapters. It also works for the AVA-1505, but the IRQ etc. |
@@ -583,6 +585,7 @@ config SCSI_DTC3280 | |||
583 | tristate "DTC3180/3280 SCSI support" | 585 | tristate "DTC3180/3280 SCSI support" |
584 | depends on ISA && SCSI | 586 | depends on ISA && SCSI |
585 | select SCSI_SPI_ATTRS | 587 | select SCSI_SPI_ATTRS |
588 | select CHECK_SIGNATURE | ||
586 | help | 589 | help |
587 | This is support for DTC 3180/3280 SCSI Host Adapters. Please read | 590 | This is support for DTC 3180/3280 SCSI Host Adapters. Please read |
588 | the SCSI-HOWTO, available from | 591 | the SCSI-HOWTO, available from |
@@ -657,6 +660,7 @@ config SCSI_EATA_PIO | |||
657 | config SCSI_FUTURE_DOMAIN | 660 | config SCSI_FUTURE_DOMAIN |
658 | tristate "Future Domain 16xx SCSI/AHA-2920A support" | 661 | tristate "Future Domain 16xx SCSI/AHA-2920A support" |
659 | depends on (ISA || PCI) && SCSI | 662 | depends on (ISA || PCI) && SCSI |
663 | select CHECK_SIGNATURE | ||
660 | ---help--- | 664 | ---help--- |
661 | This is support for Future Domain's 16-bit SCSI host adapters | 665 | This is support for Future Domain's 16-bit SCSI host adapters |
662 | (TMC-1660/1680, TMC-1650/1670, TMC-3260, TMC-1610M/MER/MEX) and | 666 | (TMC-1660/1680, TMC-1650/1670, TMC-3260, TMC-1610M/MER/MEX) and |
@@ -1324,6 +1328,7 @@ config SCSI_LPFC | |||
1324 | config SCSI_SEAGATE | 1328 | config SCSI_SEAGATE |
1325 | tristate "Seagate ST-02 and Future Domain TMC-8xx SCSI support" | 1329 | tristate "Seagate ST-02 and Future Domain TMC-8xx SCSI support" |
1326 | depends on X86 && ISA && SCSI | 1330 | depends on X86 && ISA && SCSI |
1331 | select CHECK_SIGNATURE | ||
1327 | ---help--- | 1332 | ---help--- |
1328 | These are 8-bit SCSI controllers; the ST-01 is also supported by | 1333 | These are 8-bit SCSI controllers; the ST-01 is also supported by |
1329 | this driver. It is explained in section 3.9 of the SCSI-HOWTO, | 1334 | this driver. It is explained in section 3.9 of the SCSI-HOWTO, |
@@ -1397,6 +1402,7 @@ config SCSI_T128 | |||
1397 | tristate "Trantor T128/T128F/T228 SCSI support" | 1402 | tristate "Trantor T128/T128F/T228 SCSI support" |
1398 | depends on ISA && SCSI | 1403 | depends on ISA && SCSI |
1399 | select SCSI_SPI_ATTRS | 1404 | select SCSI_SPI_ATTRS |
1405 | select CHECK_SIGNATURE | ||
1400 | ---help--- | 1406 | ---help--- |
1401 | This is support for a SCSI host adapter. It is explained in section | 1407 | This is support for a SCSI host adapter. It is explained in section |
1402 | 3.11 of the SCSI-HOWTO, available from | 1408 | 3.11 of the SCSI-HOWTO, available from |
@@ -1561,7 +1567,7 @@ config A3000_SCSI | |||
1561 | built-in SCSI controller, say Y. Otherwise, say N. | 1567 | built-in SCSI controller, say Y. Otherwise, say N. |
1562 | 1568 | ||
1563 | To compile this driver as a module, choose M here: the | 1569 | To compile this driver as a module, choose M here: the |
1564 | module will be called wd33c93. | 1570 | module will be called a3000. |
1565 | 1571 | ||
1566 | config A2091_SCSI | 1572 | config A2091_SCSI |
1567 | tristate "A2091/A590 WD33C93A support" | 1573 | tristate "A2091/A590 WD33C93A support" |
@@ -1571,7 +1577,7 @@ config A2091_SCSI | |||
1571 | say N. | 1577 | say N. |
1572 | 1578 | ||
1573 | To compile this driver as a module, choose M here: the | 1579 | To compile this driver as a module, choose M here: the |
1574 | module will be called wd33c93. | 1580 | module will be called a2091. |
1575 | 1581 | ||
1576 | config GVP11_SCSI | 1582 | config GVP11_SCSI |
1577 | tristate "GVP Series II WD33C93A support" | 1583 | tristate "GVP Series II WD33C93A support" |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 301313002f6b..f94109cbb46e 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -129,7 +129,16 @@ struct uart_8250_port { | |||
129 | unsigned char mcr; | 129 | unsigned char mcr; |
130 | unsigned char mcr_mask; /* mask of user bits */ | 130 | unsigned char mcr_mask; /* mask of user bits */ |
131 | unsigned char mcr_force; /* mask of forced bits */ | 131 | unsigned char mcr_force; /* mask of forced bits */ |
132 | unsigned char lsr_break_flag; | 132 | |
133 | /* | ||
134 | * Some bits in registers are cleared on a read, so they must | ||
135 | * be saved whenever the register is read but the bits will not | ||
136 | * be immediately processed. | ||
137 | */ | ||
138 | #define LSR_SAVE_FLAGS UART_LSR_BRK_ERROR_BITS | ||
139 | unsigned char lsr_saved_flags; | ||
140 | #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA | ||
141 | unsigned char msr_saved_flags; | ||
133 | 142 | ||
134 | /* | 143 | /* |
135 | * We provide a per-port pm hook. | 144 | * We provide a per-port pm hook. |
@@ -1238,6 +1247,7 @@ static void serial8250_start_tx(struct uart_port *port) | |||
1238 | if (up->bugs & UART_BUG_TXEN) { | 1247 | if (up->bugs & UART_BUG_TXEN) { |
1239 | unsigned char lsr, iir; | 1248 | unsigned char lsr, iir; |
1240 | lsr = serial_in(up, UART_LSR); | 1249 | lsr = serial_in(up, UART_LSR); |
1250 | up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; | ||
1241 | iir = serial_in(up, UART_IIR) & 0x0f; | 1251 | iir = serial_in(up, UART_IIR) & 0x0f; |
1242 | if ((up->port.type == PORT_RM9000) ? | 1252 | if ((up->port.type == PORT_RM9000) ? |
1243 | (lsr & UART_LSR_THRE && | 1253 | (lsr & UART_LSR_THRE && |
@@ -1290,18 +1300,10 @@ receive_chars(struct uart_8250_port *up, unsigned int *status) | |||
1290 | flag = TTY_NORMAL; | 1300 | flag = TTY_NORMAL; |
1291 | up->port.icount.rx++; | 1301 | up->port.icount.rx++; |
1292 | 1302 | ||
1293 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 1303 | lsr |= up->lsr_saved_flags; |
1294 | /* | 1304 | up->lsr_saved_flags = 0; |
1295 | * Recover the break flag from console xmit | ||
1296 | */ | ||
1297 | if (up->port.line == up->port.cons->index) { | ||
1298 | lsr |= up->lsr_break_flag; | ||
1299 | up->lsr_break_flag = 0; | ||
1300 | } | ||
1301 | #endif | ||
1302 | 1305 | ||
1303 | if (unlikely(lsr & (UART_LSR_BI | UART_LSR_PE | | 1306 | if (unlikely(lsr & UART_LSR_BRK_ERROR_BITS)) { |
1304 | UART_LSR_FE | UART_LSR_OE))) { | ||
1305 | /* | 1307 | /* |
1306 | * For statistics only | 1308 | * For statistics only |
1307 | */ | 1309 | */ |
@@ -1392,6 +1394,8 @@ static unsigned int check_modem_status(struct uart_8250_port *up) | |||
1392 | { | 1394 | { |
1393 | unsigned int status = serial_in(up, UART_MSR); | 1395 | unsigned int status = serial_in(up, UART_MSR); |
1394 | 1396 | ||
1397 | status |= up->msr_saved_flags; | ||
1398 | up->msr_saved_flags = 0; | ||
1395 | if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI && | 1399 | if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI && |
1396 | up->port.info != NULL) { | 1400 | up->port.info != NULL) { |
1397 | if (status & UART_MSR_TERI) | 1401 | if (status & UART_MSR_TERI) |
@@ -1591,7 +1595,8 @@ static void serial8250_timeout(unsigned long data) | |||
1591 | static void serial8250_backup_timeout(unsigned long data) | 1595 | static void serial8250_backup_timeout(unsigned long data) |
1592 | { | 1596 | { |
1593 | struct uart_8250_port *up = (struct uart_8250_port *)data; | 1597 | struct uart_8250_port *up = (struct uart_8250_port *)data; |
1594 | unsigned int iir, ier = 0; | 1598 | unsigned int iir, ier = 0, lsr; |
1599 | unsigned long flags; | ||
1595 | 1600 | ||
1596 | /* | 1601 | /* |
1597 | * Must disable interrupts or else we risk racing with the interrupt | 1602 | * Must disable interrupts or else we risk racing with the interrupt |
@@ -1610,9 +1615,13 @@ static void serial8250_backup_timeout(unsigned long data) | |||
1610 | * the "Diva" UART used on the management processor on many HP | 1615 | * the "Diva" UART used on the management processor on many HP |
1611 | * ia64 and parisc boxes. | 1616 | * ia64 and parisc boxes. |
1612 | */ | 1617 | */ |
1618 | spin_lock_irqsave(&up->port.lock, flags); | ||
1619 | lsr = serial_in(up, UART_LSR); | ||
1620 | up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; | ||
1621 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
1613 | if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) && | 1622 | if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) && |
1614 | (!uart_circ_empty(&up->port.info->xmit) || up->port.x_char) && | 1623 | (!uart_circ_empty(&up->port.info->xmit) || up->port.x_char) && |
1615 | (serial_in(up, UART_LSR) & UART_LSR_THRE)) { | 1624 | (lsr & UART_LSR_THRE)) { |
1616 | iir &= ~(UART_IIR_ID | UART_IIR_NO_INT); | 1625 | iir &= ~(UART_IIR_ID | UART_IIR_NO_INT); |
1617 | iir |= UART_IIR_THRI; | 1626 | iir |= UART_IIR_THRI; |
1618 | } | 1627 | } |
@@ -1631,13 +1640,14 @@ static unsigned int serial8250_tx_empty(struct uart_port *port) | |||
1631 | { | 1640 | { |
1632 | struct uart_8250_port *up = (struct uart_8250_port *)port; | 1641 | struct uart_8250_port *up = (struct uart_8250_port *)port; |
1633 | unsigned long flags; | 1642 | unsigned long flags; |
1634 | unsigned int ret; | 1643 | unsigned int lsr; |
1635 | 1644 | ||
1636 | spin_lock_irqsave(&up->port.lock, flags); | 1645 | spin_lock_irqsave(&up->port.lock, flags); |
1637 | ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0; | 1646 | lsr = serial_in(up, UART_LSR); |
1647 | up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; | ||
1638 | spin_unlock_irqrestore(&up->port.lock, flags); | 1648 | spin_unlock_irqrestore(&up->port.lock, flags); |
1639 | 1649 | ||
1640 | return ret; | 1650 | return lsr & UART_LSR_TEMT ? TIOCSER_TEMT : 0; |
1641 | } | 1651 | } |
1642 | 1652 | ||
1643 | static unsigned int serial8250_get_mctrl(struct uart_port *port) | 1653 | static unsigned int serial8250_get_mctrl(struct uart_port *port) |
@@ -1708,8 +1718,7 @@ static inline void wait_for_xmitr(struct uart_8250_port *up, int bits) | |||
1708 | do { | 1718 | do { |
1709 | status = serial_in(up, UART_LSR); | 1719 | status = serial_in(up, UART_LSR); |
1710 | 1720 | ||
1711 | if (status & UART_LSR_BI) | 1721 | up->lsr_saved_flags |= status & LSR_SAVE_FLAGS; |
1712 | up->lsr_break_flag = UART_LSR_BI; | ||
1713 | 1722 | ||
1714 | if (--tmout == 0) | 1723 | if (--tmout == 0) |
1715 | break; | 1724 | break; |
@@ -1718,8 +1727,12 @@ static inline void wait_for_xmitr(struct uart_8250_port *up, int bits) | |||
1718 | 1727 | ||
1719 | /* Wait up to 1s for flow control if necessary */ | 1728 | /* Wait up to 1s for flow control if necessary */ |
1720 | if (up->port.flags & UPF_CONS_FLOW) { | 1729 | if (up->port.flags & UPF_CONS_FLOW) { |
1721 | tmout = 1000000; | 1730 | unsigned int tmout; |
1722 | while (!(serial_in(up, UART_MSR) & UART_MSR_CTS) && --tmout) { | 1731 | for (tmout = 1000000; tmout; tmout--) { |
1732 | unsigned int msr = serial_in(up, UART_MSR); | ||
1733 | up->msr_saved_flags |= msr & MSR_SAVE_FLAGS; | ||
1734 | if (msr & UART_MSR_CTS) | ||
1735 | break; | ||
1723 | udelay(1); | 1736 | udelay(1); |
1724 | touch_nmi_watchdog(); | 1737 | touch_nmi_watchdog(); |
1725 | } | 1738 | } |
@@ -1889,6 +1902,18 @@ static int serial8250_startup(struct uart_port *port) | |||
1889 | spin_unlock_irqrestore(&up->port.lock, flags); | 1902 | spin_unlock_irqrestore(&up->port.lock, flags); |
1890 | 1903 | ||
1891 | /* | 1904 | /* |
1905 | * Clear the interrupt registers again for luck, and clear the | ||
1906 | * saved flags to avoid getting false values from polling | ||
1907 | * routines or the previous session. | ||
1908 | */ | ||
1909 | serial_inp(up, UART_LSR); | ||
1910 | serial_inp(up, UART_RX); | ||
1911 | serial_inp(up, UART_IIR); | ||
1912 | serial_inp(up, UART_MSR); | ||
1913 | up->lsr_saved_flags = 0; | ||
1914 | up->msr_saved_flags = 0; | ||
1915 | |||
1916 | /* | ||
1892 | * Finally, enable interrupts. Note: Modem status interrupts | 1917 | * Finally, enable interrupts. Note: Modem status interrupts |
1893 | * are set via set_termios(), which will be occurring imminently | 1918 | * are set via set_termios(), which will be occurring imminently |
1894 | * anyway, so we don't enable them here. | 1919 | * anyway, so we don't enable them here. |
@@ -1906,14 +1931,6 @@ static int serial8250_startup(struct uart_port *port) | |||
1906 | (void) inb_p(icp); | 1931 | (void) inb_p(icp); |
1907 | } | 1932 | } |
1908 | 1933 | ||
1909 | /* | ||
1910 | * And clear the interrupt registers again for luck. | ||
1911 | */ | ||
1912 | (void) serial_inp(up, UART_LSR); | ||
1913 | (void) serial_inp(up, UART_RX); | ||
1914 | (void) serial_inp(up, UART_IIR); | ||
1915 | (void) serial_inp(up, UART_MSR); | ||
1916 | |||
1917 | return 0; | 1934 | return 0; |
1918 | } | 1935 | } |
1919 | 1936 | ||
@@ -2484,6 +2501,16 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) | |||
2484 | wait_for_xmitr(up, BOTH_EMPTY); | 2501 | wait_for_xmitr(up, BOTH_EMPTY); |
2485 | serial_out(up, UART_IER, ier); | 2502 | serial_out(up, UART_IER, ier); |
2486 | 2503 | ||
2504 | /* | ||
2505 | * The receive handling will happen properly because the | ||
2506 | * receive ready bit will still be set; it is not cleared | ||
2507 | * on read. However, modem control will not, we must | ||
2508 | * call it if we have saved something in the saved flags | ||
2509 | * while processing with interrupts off. | ||
2510 | */ | ||
2511 | if (up->msr_saved_flags) | ||
2512 | check_modem_status(up); | ||
2513 | |||
2487 | if (locked) | 2514 | if (locked) |
2488 | spin_unlock(&up->port.lock); | 2515 | spin_unlock(&up->port.lock); |
2489 | local_irq_restore(flags); | 2516 | local_irq_restore(flags); |
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index 5e485876f54c..bd66339f7a3f 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c | |||
@@ -580,6 +580,138 @@ static int pci_netmos_init(struct pci_dev *dev) | |||
580 | return num_serial; | 580 | return num_serial; |
581 | } | 581 | } |
582 | 582 | ||
583 | /* | ||
584 | * ITE support by Niels de Vos <niels.devos@wincor-nixdorf.com> | ||
585 | * | ||
586 | * These chips are available with optionally one parallel port and up to | ||
587 | * two serial ports. Unfortunately they all have the same product id. | ||
588 | * | ||
589 | * Basic configuration is done over a region of 32 I/O ports. The base | ||
590 | * ioport is called INTA or INTC, depending on docs/other drivers. | ||
591 | * | ||
592 | * The region of the 32 I/O ports is configured in POSIO0R... | ||
593 | */ | ||
594 | |||
595 | /* registers */ | ||
596 | #define ITE_887x_MISCR 0x9c | ||
597 | #define ITE_887x_INTCBAR 0x78 | ||
598 | #define ITE_887x_UARTBAR 0x7c | ||
599 | #define ITE_887x_PS0BAR 0x10 | ||
600 | #define ITE_887x_POSIO0 0x60 | ||
601 | |||
602 | /* I/O space size */ | ||
603 | #define ITE_887x_IOSIZE 32 | ||
604 | /* I/O space size (bits 26-24; 8 bytes = 011b) */ | ||
605 | #define ITE_887x_POSIO_IOSIZE_8 (3 << 24) | ||
606 | /* I/O space size (bits 26-24; 32 bytes = 101b) */ | ||
607 | #define ITE_887x_POSIO_IOSIZE_32 (5 << 24) | ||
608 | /* Decoding speed (1 = slow, 2 = medium, 3 = fast) */ | ||
609 | #define ITE_887x_POSIO_SPEED (3 << 29) | ||
610 | /* enable IO_Space bit */ | ||
611 | #define ITE_887x_POSIO_ENABLE (1 << 31) | ||
612 | |||
613 | static int __devinit pci_ite887x_init(struct pci_dev *dev) | ||
614 | { | ||
615 | /* inta_addr are the configuration addresses of the ITE */ | ||
616 | static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0, | ||
617 | 0x200, 0x280, 0 }; | ||
618 | int ret, i, type; | ||
619 | struct resource *iobase = NULL; | ||
620 | u32 miscr, uartbar, ioport; | ||
621 | |||
622 | /* search for the base-ioport */ | ||
623 | i = 0; | ||
624 | while (inta_addr[i] && iobase == NULL) { | ||
625 | iobase = request_region(inta_addr[i], ITE_887x_IOSIZE, | ||
626 | "ite887x"); | ||
627 | if (iobase != NULL) { | ||
628 | /* write POSIO0R - speed | size | ioport */ | ||
629 | pci_write_config_dword(dev, ITE_887x_POSIO0, | ||
630 | ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED | | ||
631 | ITE_887x_POSIO_IOSIZE_32 | inta_addr[i]); | ||
632 | /* write INTCBAR - ioport */ | ||
633 | pci_write_config_dword(dev, ITE_887x_INTCBAR, inta_addr[i]); | ||
634 | ret = inb(inta_addr[i]); | ||
635 | if (ret != 0xff) { | ||
636 | /* ioport connected */ | ||
637 | break; | ||
638 | } | ||
639 | release_region(iobase->start, ITE_887x_IOSIZE); | ||
640 | iobase = NULL; | ||
641 | } | ||
642 | i++; | ||
643 | } | ||
644 | |||
645 | if (!inta_addr[i]) { | ||
646 | printk(KERN_ERR "ite887x: could not find iobase\n"); | ||
647 | return -ENODEV; | ||
648 | } | ||
649 | |||
650 | /* start of undocumented type checking (see parport_pc.c) */ | ||
651 | type = inb(iobase->start + 0x18) & 0x0f; | ||
652 | |||
653 | switch (type) { | ||
654 | case 0x2: /* ITE8871 (1P) */ | ||
655 | case 0xa: /* ITE8875 (1P) */ | ||
656 | ret = 0; | ||
657 | break; | ||
658 | case 0xe: /* ITE8872 (2S1P) */ | ||
659 | ret = 2; | ||
660 | break; | ||
661 | case 0x6: /* ITE8873 (1S) */ | ||
662 | ret = 1; | ||
663 | break; | ||
664 | case 0x8: /* ITE8874 (2S) */ | ||
665 | ret = 2; | ||
666 | break; | ||
667 | default: | ||
668 | moan_device("Unknown ITE887x", dev); | ||
669 | ret = -ENODEV; | ||
670 | } | ||
671 | |||
672 | /* configure all serial ports */ | ||
673 | for (i = 0; i < ret; i++) { | ||
674 | /* read the I/O port from the device */ | ||
675 | pci_read_config_dword(dev, ITE_887x_PS0BAR + (0x4 * (i + 1)), | ||
676 | &ioport); | ||
677 | ioport &= 0x0000FF00; /* the actual base address */ | ||
678 | pci_write_config_dword(dev, ITE_887x_POSIO0 + (0x4 * (i + 1)), | ||
679 | ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED | | ||
680 | ITE_887x_POSIO_IOSIZE_8 | ioport); | ||
681 | |||
682 | /* write the ioport to the UARTBAR */ | ||
683 | pci_read_config_dword(dev, ITE_887x_UARTBAR, &uartbar); | ||
684 | uartbar &= ~(0xffff << (16 * i)); /* clear half the reg */ | ||
685 | uartbar |= (ioport << (16 * i)); /* set the ioport */ | ||
686 | pci_write_config_dword(dev, ITE_887x_UARTBAR, uartbar); | ||
687 | |||
688 | /* get current config */ | ||
689 | pci_read_config_dword(dev, ITE_887x_MISCR, &miscr); | ||
690 | /* disable interrupts (UARTx_Routing[3:0]) */ | ||
691 | miscr &= ~(0xf << (12 - 4 * i)); | ||
692 | /* activate the UART (UARTx_En) */ | ||
693 | miscr |= 1 << (23 - i); | ||
694 | /* write new config with activated UART */ | ||
695 | pci_write_config_dword(dev, ITE_887x_MISCR, miscr); | ||
696 | } | ||
697 | |||
698 | if (ret <= 0) { | ||
699 | /* the device has no UARTs if we get here */ | ||
700 | release_region(iobase->start, ITE_887x_IOSIZE); | ||
701 | } | ||
702 | |||
703 | return ret; | ||
704 | } | ||
705 | |||
706 | static void __devexit pci_ite887x_exit(struct pci_dev *dev) | ||
707 | { | ||
708 | u32 ioport; | ||
709 | /* the ioport is bit 0-15 in POSIO0R */ | ||
710 | pci_read_config_dword(dev, ITE_887x_POSIO0, &ioport); | ||
711 | ioport &= 0xffff; | ||
712 | release_region(ioport, ITE_887x_IOSIZE); | ||
713 | } | ||
714 | |||
583 | static int | 715 | static int |
584 | pci_default_setup(struct serial_private *priv, struct pciserial_board *board, | 716 | pci_default_setup(struct serial_private *priv, struct pciserial_board *board, |
585 | struct uart_port *port, int idx) | 717 | struct uart_port *port, int idx) |
@@ -653,6 +785,18 @@ static struct pci_serial_quirk pci_serial_quirks[] = { | |||
653 | .setup = pci_default_setup, | 785 | .setup = pci_default_setup, |
654 | }, | 786 | }, |
655 | /* | 787 | /* |
788 | * ITE | ||
789 | */ | ||
790 | { | ||
791 | .vendor = PCI_VENDOR_ID_ITE, | ||
792 | .device = PCI_DEVICE_ID_ITE_8872, | ||
793 | .subvendor = PCI_ANY_ID, | ||
794 | .subdevice = PCI_ANY_ID, | ||
795 | .init = pci_ite887x_init, | ||
796 | .setup = pci_default_setup, | ||
797 | .exit = __devexit_p(pci_ite887x_exit), | ||
798 | }, | ||
799 | /* | ||
656 | * Panacom | 800 | * Panacom |
657 | */ | 801 | */ |
658 | { | 802 | { |
@@ -933,6 +1077,7 @@ enum pci_board_num_t { | |||
933 | 1077 | ||
934 | pbn_b1_2_1250000, | 1078 | pbn_b1_2_1250000, |
935 | 1079 | ||
1080 | pbn_b1_bt_1_115200, | ||
936 | pbn_b1_bt_2_921600, | 1081 | pbn_b1_bt_2_921600, |
937 | 1082 | ||
938 | pbn_b1_1_1382400, | 1083 | pbn_b1_1_1382400, |
@@ -983,6 +1128,7 @@ enum pci_board_num_t { | |||
983 | pbn_exar_XR17C152, | 1128 | pbn_exar_XR17C152, |
984 | pbn_exar_XR17C154, | 1129 | pbn_exar_XR17C154, |
985 | pbn_exar_XR17C158, | 1130 | pbn_exar_XR17C158, |
1131 | pbn_pasemi_1682M, | ||
986 | }; | 1132 | }; |
987 | 1133 | ||
988 | /* | 1134 | /* |
@@ -1211,6 +1357,13 @@ static struct pciserial_board pci_boards[] __devinitdata = { | |||
1211 | .uart_offset = 8, | 1357 | .uart_offset = 8, |
1212 | }, | 1358 | }, |
1213 | 1359 | ||
1360 | [pbn_b1_bt_1_115200] = { | ||
1361 | .flags = FL_BASE1|FL_BASE_BARS, | ||
1362 | .num_ports = 1, | ||
1363 | .base_baud = 115200, | ||
1364 | .uart_offset = 8, | ||
1365 | }, | ||
1366 | |||
1214 | [pbn_b1_bt_2_921600] = { | 1367 | [pbn_b1_bt_2_921600] = { |
1215 | .flags = FL_BASE1|FL_BASE_BARS, | 1368 | .flags = FL_BASE1|FL_BASE_BARS, |
1216 | .num_ports = 2, | 1369 | .num_ports = 2, |
@@ -1498,6 +1651,18 @@ static struct pciserial_board pci_boards[] __devinitdata = { | |||
1498 | .base_baud = 921600, | 1651 | .base_baud = 921600, |
1499 | .uart_offset = 0x200, | 1652 | .uart_offset = 0x200, |
1500 | }, | 1653 | }, |
1654 | /* | ||
1655 | * PA Semi PWRficient PA6T-1682M on-chip UART | ||
1656 | */ | ||
1657 | [pbn_pasemi_1682M] = { | ||
1658 | .flags = FL_BASE0, | ||
1659 | .num_ports = 1, | ||
1660 | .base_baud = 8333333, | ||
1661 | }, | ||
1662 | }; | ||
1663 | |||
1664 | static const struct pci_device_id softmodem_blacklist[] = { | ||
1665 | { PCI_VDEVICE ( AL, 0x5457 ), }, /* ALi Corporation M5457 AC'97 Modem */ | ||
1501 | }; | 1666 | }; |
1502 | 1667 | ||
1503 | /* | 1668 | /* |
@@ -1508,6 +1673,7 @@ static struct pciserial_board pci_boards[] __devinitdata = { | |||
1508 | static int __devinit | 1673 | static int __devinit |
1509 | serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) | 1674 | serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) |
1510 | { | 1675 | { |
1676 | const struct pci_device_id *blacklist; | ||
1511 | int num_iomem, num_port, first_port = -1, i; | 1677 | int num_iomem, num_port, first_port = -1, i; |
1512 | 1678 | ||
1513 | /* | 1679 | /* |
@@ -1522,6 +1688,18 @@ serial_pci_guess_board(struct pci_dev *dev, struct pciserial_board *board) | |||
1522 | (dev->class & 0xff) > 6) | 1688 | (dev->class & 0xff) > 6) |
1523 | return -ENODEV; | 1689 | return -ENODEV; |
1524 | 1690 | ||
1691 | /* | ||
1692 | * Do not access blacklisted devices that are known not to | ||
1693 | * feature serial ports. | ||
1694 | */ | ||
1695 | for (blacklist = softmodem_blacklist; | ||
1696 | blacklist < softmodem_blacklist + ARRAY_SIZE(softmodem_blacklist); | ||
1697 | blacklist++) { | ||
1698 | if (dev->vendor == blacklist->vendor && | ||
1699 | dev->device == blacklist->device) | ||
1700 | return -ENODEV; | ||
1701 | } | ||
1702 | |||
1525 | num_iomem = num_port = 0; | 1703 | num_iomem = num_port = 0; |
1526 | for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { | 1704 | for (i = 0; i < PCI_NUM_BAR_RESOURCES; i++) { |
1527 | if (pci_resource_flags(dev, i) & IORESOURCE_IO) { | 1705 | if (pci_resource_flags(dev, i) & IORESOURCE_IO) { |
@@ -2364,6 +2542,13 @@ static struct pci_device_id serial_pci_tbl[] = { | |||
2364 | { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560, | 2542 | { PCI_VENDOR_ID_TOPIC, PCI_DEVICE_ID_TOPIC_TP560, |
2365 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, | 2543 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
2366 | pbn_b0_1_115200 }, | 2544 | pbn_b0_1_115200 }, |
2545 | /* | ||
2546 | * ITE | ||
2547 | */ | ||
2548 | { PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8872, | ||
2549 | PCI_ANY_ID, PCI_ANY_ID, | ||
2550 | 0, 0, | ||
2551 | pbn_b1_bt_1_115200 }, | ||
2367 | 2552 | ||
2368 | /* | 2553 | /* |
2369 | * IntaShield IS-200 | 2554 | * IntaShield IS-200 |
@@ -2382,6 +2567,13 @@ static struct pci_device_id serial_pci_tbl[] = { | |||
2382 | PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8, | 2567 | PCI_SUBVENDOR_ID_PERLE, PCI_SUBDEVICE_ID_PCI_RAS8, |
2383 | 0, 0, pbn_b2_8_921600 }, | 2568 | 0, 0, pbn_b2_8_921600 }, |
2384 | /* | 2569 | /* |
2570 | * PA Semi PA6T-1682M on-chip UART | ||
2571 | */ | ||
2572 | { PCI_VENDOR_ID_PASEMI, 0xa004, | ||
2573 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, | ||
2574 | pbn_pasemi_1682M }, | ||
2575 | |||
2576 | /* | ||
2385 | * These entries match devices with class COMMUNICATION_SERIAL, | 2577 | * These entries match devices with class COMMUNICATION_SERIAL, |
2386 | * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL | 2578 | * COMMUNICATION_MODEM or COMMUNICATION_MULTISERIAL |
2387 | */ | 2579 | */ |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 030a6063541d..a055f58f342f 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -1146,11 +1146,14 @@ static void uart_set_termios(struct tty_struct *tty, struct ktermios *old_termio | |||
1146 | 1146 | ||
1147 | /* | 1147 | /* |
1148 | * These are the bits that are used to setup various | 1148 | * These are the bits that are used to setup various |
1149 | * flags in the low level driver. | 1149 | * flags in the low level driver. We can ignore the Bfoo |
1150 | * bits in c_cflag; c_[io]speed will always be set | ||
1151 | * appropriately by set_termios() in tty_ioctl.c | ||
1150 | */ | 1152 | */ |
1151 | #define RELEVANT_IFLAG(iflag) ((iflag) & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | 1153 | #define RELEVANT_IFLAG(iflag) ((iflag) & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) |
1152 | |||
1153 | if ((cflag ^ old_termios->c_cflag) == 0 && | 1154 | if ((cflag ^ old_termios->c_cflag) == 0 && |
1155 | tty->termios->c_ospeed == old_termios->c_ospeed && | ||
1156 | tty->termios->c_ispeed == old_termios->c_ispeed && | ||
1154 | RELEVANT_IFLAG(tty->termios->c_iflag ^ old_termios->c_iflag) == 0) | 1157 | RELEVANT_IFLAG(tty->termios->c_iflag ^ old_termios->c_iflag) == 0) |
1155 | return; | 1158 | return; |
1156 | 1159 | ||
diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c index b8f91e018b21..0930e2a85514 100644 --- a/drivers/serial/serial_txx9.c +++ b/drivers/serial/serial_txx9.c | |||
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | #include <asm/io.h> | 38 | #include <asm/io.h> |
39 | 39 | ||
40 | static char *serial_version = "1.09"; | 40 | static char *serial_version = "1.10"; |
41 | static char *serial_name = "TX39/49 Serial driver"; | 41 | static char *serial_name = "TX39/49 Serial driver"; |
42 | 42 | ||
43 | #define PASS_LIMIT 256 | 43 | #define PASS_LIMIT 256 |
@@ -436,8 +436,10 @@ static unsigned int serial_txx9_get_mctrl(struct uart_port *port) | |||
436 | struct uart_txx9_port *up = (struct uart_txx9_port *)port; | 436 | struct uart_txx9_port *up = (struct uart_txx9_port *)port; |
437 | unsigned int ret; | 437 | unsigned int ret; |
438 | 438 | ||
439 | ret = ((sio_in(up, TXX9_SIFLCR) & TXX9_SIFLCR_RTSSC) ? 0 : TIOCM_RTS) | 439 | /* no modem control lines */ |
440 | | ((sio_in(up, TXX9_SICISR) & TXX9_SICISR_CTSS) ? 0 : TIOCM_CTS); | 440 | ret = TIOCM_CAR | TIOCM_DSR; |
441 | ret |= (sio_in(up, TXX9_SIFLCR) & TXX9_SIFLCR_RTSSC) ? 0 : TIOCM_RTS; | ||
442 | ret |= (sio_in(up, TXX9_SICISR) & TXX9_SICISR_CTSS) ? 0 : TIOCM_CTS; | ||
441 | 443 | ||
442 | return ret; | 444 | return ret; |
443 | } | 445 | } |
@@ -557,6 +559,12 @@ serial_txx9_set_termios(struct uart_port *port, struct ktermios *termios, | |||
557 | unsigned long flags; | 559 | unsigned long flags; |
558 | unsigned int baud, quot; | 560 | unsigned int baud, quot; |
559 | 561 | ||
562 | /* | ||
563 | * We don't support modem control lines. | ||
564 | */ | ||
565 | termios->c_cflag &= ~(HUPCL | CMSPAR); | ||
566 | termios->c_cflag |= CLOCAL; | ||
567 | |||
560 | cval = sio_in(up, TXX9_SILCR); | 568 | cval = sio_in(up, TXX9_SILCR); |
561 | /* byte size and parity */ | 569 | /* byte size and parity */ |
562 | cval &= ~TXX9_SILCR_UMODE_MASK; | 570 | cval &= ~TXX9_SILCR_UMODE_MASK; |
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 7dd73546bf43..7580aa5da0f8 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig | |||
@@ -6,6 +6,9 @@ menuconfig USB_SUPPORT | |||
6 | bool "USB support" | 6 | bool "USB support" |
7 | depends on HAS_IOMEM | 7 | depends on HAS_IOMEM |
8 | default y | 8 | default y |
9 | ---help--- | ||
10 | This option adds core support for Universal Serial Bus (USB). | ||
11 | You will also need drivers from the following menu to make use of it. | ||
9 | 12 | ||
10 | if USB_SUPPORT | 13 | if USB_SUPPORT |
11 | 14 | ||
@@ -18,6 +21,7 @@ config USB_ARCH_HAS_HCD | |||
18 | default y if USB_ARCH_HAS_EHCI | 21 | default y if USB_ARCH_HAS_EHCI |
19 | default y if PCMCIA && !M32R # sl811_cs | 22 | default y if PCMCIA && !M32R # sl811_cs |
20 | default y if ARM # SL-811 | 23 | default y if ARM # SL-811 |
24 | default y if SUPERH # r8a66597-hcd | ||
21 | default PCI | 25 | default PCI |
22 | 26 | ||
23 | # many non-PCI SOC chips embed OHCI | 27 | # many non-PCI SOC chips embed OHCI |
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 02c52f8d5dbf..a73e714288e5 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c | |||
@@ -456,7 +456,6 @@ static int cxacru_start_wait_urb(struct urb *urb, struct completion *done, | |||
456 | int* actual_length) | 456 | int* actual_length) |
457 | { | 457 | { |
458 | struct timer_list timer; | 458 | struct timer_list timer; |
459 | int status = urb->status; | ||
460 | 459 | ||
461 | init_timer(&timer); | 460 | init_timer(&timer); |
462 | timer.expires = jiffies + msecs_to_jiffies(CMD_TIMEOUT); | 461 | timer.expires = jiffies + msecs_to_jiffies(CMD_TIMEOUT); |
@@ -468,7 +467,7 @@ static int cxacru_start_wait_urb(struct urb *urb, struct completion *done, | |||
468 | 467 | ||
469 | if (actual_length) | 468 | if (actual_length) |
470 | *actual_length = urb->actual_length; | 469 | *actual_length = urb->actual_length; |
471 | return status; | 470 | return urb->status; /* must read status after completion */ |
472 | } | 471 | } |
473 | 472 | ||
474 | static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm, | 473 | static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm, |
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index a1a1c9d467e0..29807d048b04 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -1721,9 +1721,12 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf, | |||
1721 | 1721 | ||
1722 | ret = uea_boot(sc); | 1722 | ret = uea_boot(sc); |
1723 | if (ret < 0) | 1723 | if (ret < 0) |
1724 | goto error; | 1724 | goto error_rm_grp; |
1725 | 1725 | ||
1726 | return 0; | 1726 | return 0; |
1727 | |||
1728 | error_rm_grp: | ||
1729 | sysfs_remove_group(&intf->dev.kobj, &attr_grp); | ||
1727 | error: | 1730 | error: |
1728 | kfree(sc); | 1731 | kfree(sc); |
1729 | return ret; | 1732 | return ret; |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index fe940e0536e0..f51e22490edf 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -921,6 +921,10 @@ skip_normal_probe: | |||
921 | return -EINVAL; | 921 | return -EINVAL; |
922 | } | 922 | } |
923 | } | 923 | } |
924 | |||
925 | /* Accept probe requests only for the control interface */ | ||
926 | if (intf != control_interface) | ||
927 | return -ENODEV; | ||
924 | 928 | ||
925 | if (usb_interface_claimed(data_interface)) { /* valid in this context */ | 929 | if (usb_interface_claimed(data_interface)) { /* valid in this context */ |
926 | dev_dbg(&intf->dev,"The data interface isn't available"); | 930 | dev_dbg(&intf->dev,"The data interface isn't available"); |
@@ -1109,10 +1113,12 @@ static void acm_disconnect(struct usb_interface *intf) | |||
1109 | return; | 1113 | return; |
1110 | } | 1114 | } |
1111 | if (acm->country_codes){ | 1115 | if (acm->country_codes){ |
1112 | device_remove_file(&intf->dev, &dev_attr_wCountryCodes); | 1116 | device_remove_file(&acm->control->dev, |
1113 | device_remove_file(&intf->dev, &dev_attr_iCountryCodeRelDate); | 1117 | &dev_attr_wCountryCodes); |
1118 | device_remove_file(&acm->control->dev, | ||
1119 | &dev_attr_iCountryCodeRelDate); | ||
1114 | } | 1120 | } |
1115 | device_remove_file(&intf->dev, &dev_attr_bmCapabilities); | 1121 | device_remove_file(&acm->control->dev, &dev_attr_bmCapabilities); |
1116 | acm->dev = NULL; | 1122 | acm->dev = NULL; |
1117 | usb_set_intfdata(acm->control, NULL); | 1123 | usb_set_intfdata(acm->control, NULL); |
1118 | usb_set_intfdata(acm->data, NULL); | 1124 | usb_set_intfdata(acm->data, NULL); |
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 654857493a82..a1ad11d0c47c 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -1224,6 +1224,8 @@ static int usb_autopm_do_device(struct usb_device *udev, int inc_usage_cnt) | |||
1224 | udev->auto_pm = 1; | 1224 | udev->auto_pm = 1; |
1225 | udev->pm_usage_cnt += inc_usage_cnt; | 1225 | udev->pm_usage_cnt += inc_usage_cnt; |
1226 | WARN_ON(udev->pm_usage_cnt < 0); | 1226 | WARN_ON(udev->pm_usage_cnt < 0); |
1227 | if (inc_usage_cnt) | ||
1228 | udev->last_busy = jiffies; | ||
1227 | if (inc_usage_cnt >= 0 && udev->pm_usage_cnt > 0) { | 1229 | if (inc_usage_cnt >= 0 && udev->pm_usage_cnt > 0) { |
1228 | if (udev->state == USB_STATE_SUSPENDED) | 1230 | if (udev->state == USB_STATE_SUSPENDED) |
1229 | status = usb_resume_both(udev); | 1231 | status = usb_resume_both(udev); |
@@ -1232,8 +1234,6 @@ static int usb_autopm_do_device(struct usb_device *udev, int inc_usage_cnt) | |||
1232 | else if (inc_usage_cnt) | 1234 | else if (inc_usage_cnt) |
1233 | udev->last_busy = jiffies; | 1235 | udev->last_busy = jiffies; |
1234 | } else if (inc_usage_cnt <= 0 && udev->pm_usage_cnt <= 0) { | 1236 | } else if (inc_usage_cnt <= 0 && udev->pm_usage_cnt <= 0) { |
1235 | if (inc_usage_cnt) | ||
1236 | udev->last_busy = jiffies; | ||
1237 | status = usb_suspend_both(udev, PMSG_SUSPEND); | 1237 | status = usb_suspend_both(udev, PMSG_SUSPEND); |
1238 | } | 1238 | } |
1239 | usb_pm_unlock(udev); | 1239 | usb_pm_unlock(udev); |
@@ -1342,16 +1342,15 @@ static int usb_autopm_do_interface(struct usb_interface *intf, | |||
1342 | else { | 1342 | else { |
1343 | udev->auto_pm = 1; | 1343 | udev->auto_pm = 1; |
1344 | intf->pm_usage_cnt += inc_usage_cnt; | 1344 | intf->pm_usage_cnt += inc_usage_cnt; |
1345 | udev->last_busy = jiffies; | ||
1345 | if (inc_usage_cnt >= 0 && intf->pm_usage_cnt > 0) { | 1346 | if (inc_usage_cnt >= 0 && intf->pm_usage_cnt > 0) { |
1346 | if (udev->state == USB_STATE_SUSPENDED) | 1347 | if (udev->state == USB_STATE_SUSPENDED) |
1347 | status = usb_resume_both(udev); | 1348 | status = usb_resume_both(udev); |
1348 | if (status != 0) | 1349 | if (status != 0) |
1349 | intf->pm_usage_cnt -= inc_usage_cnt; | 1350 | intf->pm_usage_cnt -= inc_usage_cnt; |
1350 | else if (inc_usage_cnt) | 1351 | else |
1351 | udev->last_busy = jiffies; | 1352 | udev->last_busy = jiffies; |
1352 | } else if (inc_usage_cnt <= 0 && intf->pm_usage_cnt <= 0) { | 1353 | } else if (inc_usage_cnt <= 0 && intf->pm_usage_cnt <= 0) { |
1353 | if (inc_usage_cnt) | ||
1354 | udev->last_busy = jiffies; | ||
1355 | status = usb_suspend_both(udev, PMSG_SUSPEND); | 1354 | status = usb_suspend_both(udev, PMSG_SUSPEND); |
1356 | } | 1355 | } |
1357 | } | 1356 | } |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index e341a1da517f..f7b337feb3ea 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1644,9 +1644,10 @@ static int finish_port_resume(struct usb_device *udev) | |||
1644 | * and device drivers will know about any resume quirks. | 1644 | * and device drivers will know about any resume quirks. |
1645 | */ | 1645 | */ |
1646 | if (status == 0) { | 1646 | if (status == 0) { |
1647 | devstatus = 0; | ||
1647 | status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); | 1648 | status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); |
1648 | if (status >= 0) | 1649 | if (status >= 0) |
1649 | status = (status == 2 ? 0 : -ENODEV); | 1650 | status = (status > 0 ? 0 : -ENODEV); |
1650 | } | 1651 | } |
1651 | 1652 | ||
1652 | if (status) { | 1653 | if (status) { |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index b6bd05e3d439..d8f7b089a8f0 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -637,12 +637,12 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type, unsigned char | |||
637 | memset(buf,0,size); // Make sure we parse really received data | 637 | memset(buf,0,size); // Make sure we parse really received data |
638 | 638 | ||
639 | for (i = 0; i < 3; ++i) { | 639 | for (i = 0; i < 3; ++i) { |
640 | /* retry on length 0 or stall; some devices are flakey */ | 640 | /* retry on length 0 or error; some devices are flakey */ |
641 | result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), | 641 | result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), |
642 | USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, | 642 | USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, |
643 | (type << 8) + index, 0, buf, size, | 643 | (type << 8) + index, 0, buf, size, |
644 | USB_CTRL_GET_TIMEOUT); | 644 | USB_CTRL_GET_TIMEOUT); |
645 | if (result == 0 || result == -EPIPE) | 645 | if (result <= 0 && result != -ETIMEDOUT) |
646 | continue; | 646 | continue; |
647 | if (result > 1 && ((u8 *)buf)[1] != type) { | 647 | if (result > 1 && ((u8 *)buf)[1] != type) { |
648 | result = -EPROTO; | 648 | result = -EPROTO; |
@@ -1358,6 +1358,30 @@ static int usb_if_uevent(struct device *dev, char **envp, int num_envp, | |||
1358 | usb_dev = interface_to_usbdev(intf); | 1358 | usb_dev = interface_to_usbdev(intf); |
1359 | alt = intf->cur_altsetting; | 1359 | alt = intf->cur_altsetting; |
1360 | 1360 | ||
1361 | #ifdef CONFIG_USB_DEVICEFS | ||
1362 | if (add_uevent_var(envp, num_envp, &i, | ||
1363 | buffer, buffer_size, &length, | ||
1364 | "DEVICE=/proc/bus/usb/%03d/%03d", | ||
1365 | usb_dev->bus->busnum, usb_dev->devnum)) | ||
1366 | return -ENOMEM; | ||
1367 | #endif | ||
1368 | |||
1369 | if (add_uevent_var(envp, num_envp, &i, | ||
1370 | buffer, buffer_size, &length, | ||
1371 | "PRODUCT=%x/%x/%x", | ||
1372 | le16_to_cpu(usb_dev->descriptor.idVendor), | ||
1373 | le16_to_cpu(usb_dev->descriptor.idProduct), | ||
1374 | le16_to_cpu(usb_dev->descriptor.bcdDevice))) | ||
1375 | return -ENOMEM; | ||
1376 | |||
1377 | if (add_uevent_var(envp, num_envp, &i, | ||
1378 | buffer, buffer_size, &length, | ||
1379 | "TYPE=%d/%d/%d", | ||
1380 | usb_dev->descriptor.bDeviceClass, | ||
1381 | usb_dev->descriptor.bDeviceSubClass, | ||
1382 | usb_dev->descriptor.bDeviceProtocol)) | ||
1383 | return -ENOMEM; | ||
1384 | |||
1361 | if (add_uevent_var(envp, num_envp, &i, | 1385 | if (add_uevent_var(envp, num_envp, &i, |
1362 | buffer, buffer_size, &length, | 1386 | buffer, buffer_size, &length, |
1363 | "INTERFACE=%d/%d/%d", | 1387 | "INTERFACE=%d/%d/%d", |
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index b7917c5a3c6f..9e467118dc94 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
@@ -30,6 +30,8 @@ | |||
30 | static const struct usb_device_id usb_quirk_list[] = { | 30 | static const struct usb_device_id usb_quirk_list[] = { |
31 | /* HP 5300/5370C scanner */ | 31 | /* HP 5300/5370C scanner */ |
32 | { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, | 32 | { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, |
33 | /* Hewlett-Packard PhotoSmart 720 / PhotoSmart 935 (storage) */ | ||
34 | { USB_DEVICE(0x03f0, 0x4002), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
33 | /* Acer Peripherals Inc. (now BenQ Corp.) Prisa 640BU */ | 35 | /* Acer Peripherals Inc. (now BenQ Corp.) Prisa 640BU */ |
34 | { USB_DEVICE(0x04a5, 0x207e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 36 | { USB_DEVICE(0x04a5, 0x207e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
35 | /* Benq S2W 3300U */ | 37 | /* Benq S2W 3300U */ |
@@ -56,6 +58,8 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
56 | { USB_DEVICE(0x04b8, 0x0121), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 58 | { USB_DEVICE(0x04b8, 0x0121), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
57 | /* Seiko Epson Corp.*/ | 59 | /* Seiko Epson Corp.*/ |
58 | { USB_DEVICE(0x04b8, 0x0122), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 60 | { USB_DEVICE(0x04b8, 0x0122), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
61 | /* Samsung ML-2010 printer */ | ||
62 | { USB_DEVICE(0x04e8, 0x326c), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
59 | /* Samsung ML-2510 Series printer */ | 63 | /* Samsung ML-2510 Series printer */ |
60 | { USB_DEVICE(0x04e8, 0x327e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 64 | { USB_DEVICE(0x04e8, 0x327e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
61 | /* Elsa MicroLink 56k (V.250) */ | 65 | /* Elsa MicroLink 56k (V.250) */ |
@@ -64,12 +68,20 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
64 | { USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 68 | { USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
65 | /* Agfa Snapscan1212u */ | 69 | /* Agfa Snapscan1212u */ |
66 | { USB_DEVICE(0x06bd, 0x2061), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 70 | { USB_DEVICE(0x06bd, 0x2061), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
71 | /* Seagate RSS LLC */ | ||
72 | { USB_DEVICE(0x0bc2, 0x3000), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
67 | /* Umax [hex] Astra 3400U */ | 73 | /* Umax [hex] Astra 3400U */ |
68 | { USB_DEVICE(0x1606, 0x0060), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 74 | { USB_DEVICE(0x1606, 0x0060), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
69 | 75 | ||
70 | /* Philips PSC805 audio device */ | 76 | /* Philips PSC805 audio device */ |
71 | { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, | 77 | { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, |
72 | 78 | ||
79 | /* Alcor multi-card reader */ | ||
80 | { USB_DEVICE(0x058f, 0x6366), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
81 | |||
82 | /* Canon EOS 5D in PC Connection mode */ | ||
83 | { USB_DEVICE(0x04a9, 0x3101), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | ||
84 | |||
73 | /* RIM Blackberry */ | 85 | /* RIM Blackberry */ |
74 | { USB_DEVICE(0x0fca, 0x0001), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 86 | { USB_DEVICE(0x0fca, 0x0001), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
75 | { USB_DEVICE(0x0fca, 0x0004), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, | 87 | { USB_DEVICE(0x0fca, 0x0004), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, |
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index f2fbdc7fe376..d008d1360a7a 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c | |||
@@ -34,8 +34,6 @@ | |||
34 | * bypassing some hardware (and driver) issues. UML could help too. | 34 | * bypassing some hardware (and driver) issues. UML could help too. |
35 | */ | 35 | */ |
36 | 36 | ||
37 | #define DEBUG | ||
38 | |||
39 | #include <linux/module.h> | 37 | #include <linux/module.h> |
40 | #include <linux/kernel.h> | 38 | #include <linux/kernel.h> |
41 | #include <linux/delay.h> | 39 | #include <linux/delay.h> |
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index be7a1bd2823b..965ad7bec7b7 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c | |||
@@ -599,7 +599,6 @@ enum fsg_buffer_state { | |||
599 | 599 | ||
600 | struct fsg_buffhd { | 600 | struct fsg_buffhd { |
601 | void *buf; | 601 | void *buf; |
602 | dma_addr_t dma; | ||
603 | enum fsg_buffer_state state; | 602 | enum fsg_buffer_state state; |
604 | struct fsg_buffhd *next; | 603 | struct fsg_buffhd *next; |
605 | 604 | ||
@@ -1295,6 +1294,7 @@ static int class_setup_req(struct fsg_dev *fsg, | |||
1295 | struct usb_request *req = fsg->ep0req; | 1294 | struct usb_request *req = fsg->ep0req; |
1296 | int value = -EOPNOTSUPP; | 1295 | int value = -EOPNOTSUPP; |
1297 | u16 w_index = le16_to_cpu(ctrl->wIndex); | 1296 | u16 w_index = le16_to_cpu(ctrl->wIndex); |
1297 | u16 w_value = le16_to_cpu(ctrl->wValue); | ||
1298 | u16 w_length = le16_to_cpu(ctrl->wLength); | 1298 | u16 w_length = le16_to_cpu(ctrl->wLength); |
1299 | 1299 | ||
1300 | if (!fsg->config) | 1300 | if (!fsg->config) |
@@ -1308,7 +1308,7 @@ static int class_setup_req(struct fsg_dev *fsg, | |||
1308 | if (ctrl->bRequestType != (USB_DIR_OUT | | 1308 | if (ctrl->bRequestType != (USB_DIR_OUT | |
1309 | USB_TYPE_CLASS | USB_RECIP_INTERFACE)) | 1309 | USB_TYPE_CLASS | USB_RECIP_INTERFACE)) |
1310 | break; | 1310 | break; |
1311 | if (w_index != 0) { | 1311 | if (w_index != 0 || w_value != 0) { |
1312 | value = -EDOM; | 1312 | value = -EDOM; |
1313 | break; | 1313 | break; |
1314 | } | 1314 | } |
@@ -1324,7 +1324,7 @@ static int class_setup_req(struct fsg_dev *fsg, | |||
1324 | if (ctrl->bRequestType != (USB_DIR_IN | | 1324 | if (ctrl->bRequestType != (USB_DIR_IN | |
1325 | USB_TYPE_CLASS | USB_RECIP_INTERFACE)) | 1325 | USB_TYPE_CLASS | USB_RECIP_INTERFACE)) |
1326 | break; | 1326 | break; |
1327 | if (w_index != 0) { | 1327 | if (w_index != 0 || w_value != 0) { |
1328 | value = -EDOM; | 1328 | value = -EDOM; |
1329 | break; | 1329 | break; |
1330 | } | 1330 | } |
@@ -1343,7 +1343,7 @@ static int class_setup_req(struct fsg_dev *fsg, | |||
1343 | if (ctrl->bRequestType != (USB_DIR_OUT | | 1343 | if (ctrl->bRequestType != (USB_DIR_OUT | |
1344 | USB_TYPE_CLASS | USB_RECIP_INTERFACE)) | 1344 | USB_TYPE_CLASS | USB_RECIP_INTERFACE)) |
1345 | break; | 1345 | break; |
1346 | if (w_index != 0) { | 1346 | if (w_index != 0 || w_value != 0) { |
1347 | value = -EDOM; | 1347 | value = -EDOM; |
1348 | break; | 1348 | break; |
1349 | } | 1349 | } |
@@ -2611,7 +2611,6 @@ static int send_status(struct fsg_dev *fsg) | |||
2611 | 2611 | ||
2612 | fsg->intr_buffhd = bh; // Point to the right buffhd | 2612 | fsg->intr_buffhd = bh; // Point to the right buffhd |
2613 | fsg->intreq->buf = bh->inreq->buf; | 2613 | fsg->intreq->buf = bh->inreq->buf; |
2614 | fsg->intreq->dma = bh->inreq->dma; | ||
2615 | fsg->intreq->context = bh; | 2614 | fsg->intreq->context = bh; |
2616 | start_transfer(fsg, fsg->intr_in, fsg->intreq, | 2615 | start_transfer(fsg, fsg->intr_in, fsg->intreq, |
2617 | &fsg->intreq_busy, &bh->state); | 2616 | &fsg->intreq_busy, &bh->state); |
@@ -3200,7 +3199,6 @@ reset: | |||
3200 | if ((rc = alloc_request(fsg, fsg->bulk_out, &bh->outreq)) != 0) | 3199 | if ((rc = alloc_request(fsg, fsg->bulk_out, &bh->outreq)) != 0) |
3201 | goto reset; | 3200 | goto reset; |
3202 | bh->inreq->buf = bh->outreq->buf = bh->buf; | 3201 | bh->inreq->buf = bh->outreq->buf = bh->buf; |
3203 | bh->inreq->dma = bh->outreq->dma = bh->dma; | ||
3204 | bh->inreq->context = bh->outreq->context = bh; | 3202 | bh->inreq->context = bh->outreq->context = bh; |
3205 | bh->inreq->complete = bulk_in_complete; | 3203 | bh->inreq->complete = bulk_in_complete; |
3206 | bh->outreq->complete = bulk_out_complete; | 3204 | bh->outreq->complete = bulk_out_complete; |
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c index 10b2b33b8698..d57bcfbc08a5 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.c +++ b/drivers/usb/gadget/fsl_usb2_udc.c | |||
@@ -1277,31 +1277,32 @@ static void setup_received_irq(struct fsl_udc *udc, | |||
1277 | 1277 | ||
1278 | udc_reset_ep_queue(udc, 0); | 1278 | udc_reset_ep_queue(udc, 0); |
1279 | 1279 | ||
1280 | /* We process some stardard setup requests here */ | ||
1280 | switch (setup->bRequest) { | 1281 | switch (setup->bRequest) { |
1281 | /* Request that need Data+Status phase from udc */ | ||
1282 | case USB_REQ_GET_STATUS: | 1282 | case USB_REQ_GET_STATUS: |
1283 | if ((setup->bRequestType & (USB_DIR_IN | USB_TYPE_STANDARD)) | 1283 | /* Data+Status phase from udc */ |
1284 | if ((setup->bRequestType & (USB_DIR_IN | USB_TYPE_MASK)) | ||
1284 | != (USB_DIR_IN | USB_TYPE_STANDARD)) | 1285 | != (USB_DIR_IN | USB_TYPE_STANDARD)) |
1285 | break; | 1286 | break; |
1286 | ch9getstatus(udc, setup->bRequestType, wValue, wIndex, wLength); | 1287 | ch9getstatus(udc, setup->bRequestType, wValue, wIndex, wLength); |
1287 | break; | 1288 | return; |
1288 | 1289 | ||
1289 | /* Requests that need Status phase from udc */ | ||
1290 | case USB_REQ_SET_ADDRESS: | 1290 | case USB_REQ_SET_ADDRESS: |
1291 | /* Status phase from udc */ | ||
1291 | if (setup->bRequestType != (USB_DIR_OUT | USB_TYPE_STANDARD | 1292 | if (setup->bRequestType != (USB_DIR_OUT | USB_TYPE_STANDARD |
1292 | | USB_RECIP_DEVICE)) | 1293 | | USB_RECIP_DEVICE)) |
1293 | break; | 1294 | break; |
1294 | ch9setaddress(udc, wValue, wIndex, wLength); | 1295 | ch9setaddress(udc, wValue, wIndex, wLength); |
1295 | break; | 1296 | return; |
1296 | 1297 | ||
1297 | /* Handled by udc, no data, status by udc */ | ||
1298 | case USB_REQ_CLEAR_FEATURE: | 1298 | case USB_REQ_CLEAR_FEATURE: |
1299 | case USB_REQ_SET_FEATURE: | 1299 | case USB_REQ_SET_FEATURE: |
1300 | { /* status transaction */ | 1300 | /* Status phase from udc */ |
1301 | { | ||
1301 | int rc = -EOPNOTSUPP; | 1302 | int rc = -EOPNOTSUPP; |
1302 | 1303 | ||
1303 | if ((setup->bRequestType & USB_RECIP_MASK) | 1304 | if ((setup->bRequestType & (USB_RECIP_MASK | USB_TYPE_MASK)) |
1304 | == USB_RECIP_ENDPOINT) { | 1305 | == (USB_RECIP_ENDPOINT | USB_TYPE_STANDARD)) { |
1305 | int pipe = get_pipe_by_windex(wIndex); | 1306 | int pipe = get_pipe_by_windex(wIndex); |
1306 | struct fsl_ep *ep; | 1307 | struct fsl_ep *ep; |
1307 | 1308 | ||
@@ -1315,8 +1316,9 @@ static void setup_received_irq(struct fsl_udc *udc, | |||
1315 | ? 1 : 0); | 1316 | ? 1 : 0); |
1316 | spin_lock(&udc->lock); | 1317 | spin_lock(&udc->lock); |
1317 | 1318 | ||
1318 | } else if ((setup->bRequestType & USB_RECIP_MASK) | 1319 | } else if ((setup->bRequestType & (USB_RECIP_MASK |
1319 | == USB_RECIP_DEVICE) { | 1320 | | USB_TYPE_MASK)) == (USB_RECIP_DEVICE |
1321 | | USB_TYPE_STANDARD)) { | ||
1320 | /* Note: The driver has not include OTG support yet. | 1322 | /* Note: The driver has not include OTG support yet. |
1321 | * This will be set when OTG support is added */ | 1323 | * This will be set when OTG support is added */ |
1322 | if (!udc->gadget.is_otg) | 1324 | if (!udc->gadget.is_otg) |
@@ -1329,39 +1331,42 @@ static void setup_received_irq(struct fsl_udc *udc, | |||
1329 | USB_DEVICE_A_ALT_HNP_SUPPORT) | 1331 | USB_DEVICE_A_ALT_HNP_SUPPORT) |
1330 | udc->gadget.a_alt_hnp_support = 1; | 1332 | udc->gadget.a_alt_hnp_support = 1; |
1331 | rc = 0; | 1333 | rc = 0; |
1332 | } | 1334 | } else |
1335 | break; | ||
1336 | |||
1333 | if (rc == 0) { | 1337 | if (rc == 0) { |
1334 | if (ep0_prime_status(udc, EP_DIR_IN)) | 1338 | if (ep0_prime_status(udc, EP_DIR_IN)) |
1335 | ep0stall(udc); | 1339 | ep0stall(udc); |
1336 | } | 1340 | } |
1337 | break; | 1341 | return; |
1338 | } | 1342 | } |
1339 | /* Requests handled by gadget */ | ||
1340 | default: | ||
1341 | if (wLength) { | ||
1342 | /* Data phase from gadget, status phase from udc */ | ||
1343 | udc->ep0_dir = (setup->bRequestType & USB_DIR_IN) | ||
1344 | ? USB_DIR_IN : USB_DIR_OUT; | ||
1345 | spin_unlock(&udc->lock); | ||
1346 | if (udc->driver->setup(&udc->gadget, | ||
1347 | &udc->local_setup_buff) < 0) | ||
1348 | ep0stall(udc); | ||
1349 | spin_lock(&udc->lock); | ||
1350 | udc->ep0_state = (setup->bRequestType & USB_DIR_IN) | ||
1351 | ? DATA_STATE_XMIT : DATA_STATE_RECV; | ||
1352 | 1343 | ||
1353 | } else { | 1344 | default: |
1354 | /* No data phase, IN status from gadget */ | ||
1355 | udc->ep0_dir = USB_DIR_IN; | ||
1356 | spin_unlock(&udc->lock); | ||
1357 | if (udc->driver->setup(&udc->gadget, | ||
1358 | &udc->local_setup_buff) < 0) | ||
1359 | ep0stall(udc); | ||
1360 | spin_lock(&udc->lock); | ||
1361 | udc->ep0_state = WAIT_FOR_OUT_STATUS; | ||
1362 | } | ||
1363 | break; | 1345 | break; |
1364 | } | 1346 | } |
1347 | |||
1348 | /* Requests handled by gadget */ | ||
1349 | if (wLength) { | ||
1350 | /* Data phase from gadget, status phase from udc */ | ||
1351 | udc->ep0_dir = (setup->bRequestType & USB_DIR_IN) | ||
1352 | ? USB_DIR_IN : USB_DIR_OUT; | ||
1353 | spin_unlock(&udc->lock); | ||
1354 | if (udc->driver->setup(&udc->gadget, | ||
1355 | &udc->local_setup_buff) < 0) | ||
1356 | ep0stall(udc); | ||
1357 | spin_lock(&udc->lock); | ||
1358 | udc->ep0_state = (setup->bRequestType & USB_DIR_IN) | ||
1359 | ? DATA_STATE_XMIT : DATA_STATE_RECV; | ||
1360 | } else { | ||
1361 | /* No data phase, IN status from gadget */ | ||
1362 | udc->ep0_dir = USB_DIR_IN; | ||
1363 | spin_unlock(&udc->lock); | ||
1364 | if (udc->driver->setup(&udc->gadget, | ||
1365 | &udc->local_setup_buff) < 0) | ||
1366 | ep0stall(udc); | ||
1367 | spin_lock(&udc->lock); | ||
1368 | udc->ep0_state = WAIT_FOR_OUT_STATUS; | ||
1369 | } | ||
1365 | } | 1370 | } |
1366 | 1371 | ||
1367 | /* Process request for Data or Status phase of ep0 | 1372 | /* Process request for Data or Status phase of ep0 |
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c index 72b4ebbf132d..1407ad1c8128 100644 --- a/drivers/usb/gadget/pxa2xx_udc.c +++ b/drivers/usb/gadget/pxa2xx_udc.c | |||
@@ -967,7 +967,7 @@ static int pxa2xx_udc_pullup(struct usb_gadget *_gadget, int is_active) | |||
967 | udc = container_of(_gadget, struct pxa2xx_udc, gadget); | 967 | udc = container_of(_gadget, struct pxa2xx_udc, gadget); |
968 | 968 | ||
969 | /* not all boards support pullup control */ | 969 | /* not all boards support pullup control */ |
970 | if (!udc->mach->udc_command) | 970 | if (!udc->mach->gpio_pullup && !udc->mach->udc_command) |
971 | return -EOPNOTSUPP; | 971 | return -EOPNOTSUPP; |
972 | 972 | ||
973 | is_active = (is_active != 0); | 973 | is_active = (is_active != 0); |
@@ -2309,7 +2309,7 @@ static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state) | |||
2309 | { | 2309 | { |
2310 | struct pxa2xx_udc *udc = platform_get_drvdata(dev); | 2310 | struct pxa2xx_udc *udc = platform_get_drvdata(dev); |
2311 | 2311 | ||
2312 | if (!udc->mach->udc_command) | 2312 | if (!udc->mach->gpio_pullup && !udc->mach->udc_command) |
2313 | WARN("USB host won't detect disconnect!\n"); | 2313 | WARN("USB host won't detect disconnect!\n"); |
2314 | pullup(udc, 0); | 2314 | pullup(udc, 0); |
2315 | 2315 | ||
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 2f529828c74d..565d6ef4c4cf 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -237,7 +237,7 @@ config USB_SL811_CS | |||
237 | module will be called "sl811_cs". | 237 | module will be called "sl811_cs". |
238 | 238 | ||
239 | config USB_R8A66597_HCD | 239 | config USB_R8A66597_HCD |
240 | tristate "R8A66597 HCD suppoort" | 240 | tristate "R8A66597 HCD support" |
241 | depends on USB | 241 | depends on USB |
242 | help | 242 | help |
243 | The R8A66597 is a USB 2.0 host and peripheral controller. | 243 | The R8A66597 is a USB 2.0 host and peripheral controller. |
diff --git a/drivers/usb/host/ehci-au1xxx.c b/drivers/usb/host/ehci-au1xxx.c index 5d1b12aad776..b1d19268cb23 100644 --- a/drivers/usb/host/ehci-au1xxx.c +++ b/drivers/usb/host/ehci-au1xxx.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * EHCI HCD (Host Controller Driver) for USB. | 2 | * EHCI HCD (Host Controller Driver) for USB. |
3 | * | 3 | * |
4 | * (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net> | ||
5 | * | ||
6 | * Bus Glue for AMD Alchemy Au1xxx | 4 | * Bus Glue for AMD Alchemy Au1xxx |
7 | * | 5 | * |
8 | * Based on "ohci-au1xxx.c" by Matt Porter <mporter@kernel.crashing.org> | 6 | * Based on "ohci-au1xxx.c" by Matt Porter <mporter@kernel.crashing.org> |
@@ -196,6 +194,9 @@ static const struct hc_driver ehci_au1xxx_hc_driver = { | |||
196 | 194 | ||
197 | /* | 195 | /* |
198 | * basic lifecycle operations | 196 | * basic lifecycle operations |
197 | * | ||
198 | * FIXME -- ehci_init() doesn't do enough here. | ||
199 | * See ehci-ppc-soc for a complete implementation. | ||
199 | */ | 200 | */ |
200 | .reset = ehci_init, | 201 | .reset = ehci_init, |
201 | .start = ehci_run, | 202 | .start = ehci_run, |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index c4e15ed1405a..35cdba10411b 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -275,58 +275,6 @@ static void ehci_work(struct ehci_hcd *ehci); | |||
275 | 275 | ||
276 | /*-------------------------------------------------------------------------*/ | 276 | /*-------------------------------------------------------------------------*/ |
277 | 277 | ||
278 | #ifdef CONFIG_CPU_FREQ | ||
279 | |||
280 | #include <linux/cpufreq.h> | ||
281 | |||
282 | static void ehci_cpufreq_pause (struct ehci_hcd *ehci) | ||
283 | { | ||
284 | unsigned long flags; | ||
285 | |||
286 | spin_lock_irqsave(&ehci->lock, flags); | ||
287 | if (!ehci->cpufreq_changing++) | ||
288 | qh_inactivate_split_intr_qhs(ehci); | ||
289 | spin_unlock_irqrestore(&ehci->lock, flags); | ||
290 | } | ||
291 | |||
292 | static void ehci_cpufreq_unpause (struct ehci_hcd *ehci) | ||
293 | { | ||
294 | unsigned long flags; | ||
295 | |||
296 | spin_lock_irqsave(&ehci->lock, flags); | ||
297 | if (!--ehci->cpufreq_changing) | ||
298 | qh_reactivate_split_intr_qhs(ehci); | ||
299 | spin_unlock_irqrestore(&ehci->lock, flags); | ||
300 | } | ||
301 | |||
302 | /* | ||
303 | * ehci_cpufreq_notifier is needed to avoid MMF errors that occur when | ||
304 | * EHCI controllers that don't cache many uframes get delayed trying to | ||
305 | * read main memory during CPU frequency transitions. This can cause | ||
306 | * split interrupt transactions to not be completed in the required uframe. | ||
307 | * This has been observed on the Broadcom/ServerWorks HT1000 controller. | ||
308 | */ | ||
309 | static int ehci_cpufreq_notifier(struct notifier_block *nb, unsigned long val, | ||
310 | void *data) | ||
311 | { | ||
312 | struct ehci_hcd *ehci = container_of(nb, struct ehci_hcd, | ||
313 | cpufreq_transition); | ||
314 | |||
315 | switch (val) { | ||
316 | case CPUFREQ_PRECHANGE: | ||
317 | ehci_cpufreq_pause(ehci); | ||
318 | break; | ||
319 | case CPUFREQ_POSTCHANGE: | ||
320 | ehci_cpufreq_unpause(ehci); | ||
321 | break; | ||
322 | } | ||
323 | return 0; | ||
324 | } | ||
325 | |||
326 | #endif | ||
327 | |||
328 | /*-------------------------------------------------------------------------*/ | ||
329 | |||
330 | static void ehci_watchdog (unsigned long param) | 278 | static void ehci_watchdog (unsigned long param) |
331 | { | 279 | { |
332 | struct ehci_hcd *ehci = (struct ehci_hcd *) param; | 280 | struct ehci_hcd *ehci = (struct ehci_hcd *) param; |
@@ -460,10 +408,6 @@ static void ehci_stop (struct usb_hcd *hcd) | |||
460 | ehci_writel(ehci, 0, &ehci->regs->intr_enable); | 408 | ehci_writel(ehci, 0, &ehci->regs->intr_enable); |
461 | spin_unlock_irq(&ehci->lock); | 409 | spin_unlock_irq(&ehci->lock); |
462 | 410 | ||
463 | #ifdef CONFIG_CPU_FREQ | ||
464 | cpufreq_unregister_notifier(&ehci->cpufreq_transition, | ||
465 | CPUFREQ_TRANSITION_NOTIFIER); | ||
466 | #endif | ||
467 | /* let companion controllers work when we aren't */ | 411 | /* let companion controllers work when we aren't */ |
468 | ehci_writel(ehci, 0, &ehci->regs->configured_flag); | 412 | ehci_writel(ehci, 0, &ehci->regs->configured_flag); |
469 | 413 | ||
@@ -569,17 +513,6 @@ static int ehci_init(struct usb_hcd *hcd) | |||
569 | } | 513 | } |
570 | ehci->command = temp; | 514 | ehci->command = temp; |
571 | 515 | ||
572 | #ifdef CONFIG_CPU_FREQ | ||
573 | INIT_LIST_HEAD(&ehci->split_intr_qhs); | ||
574 | /* | ||
575 | * If the EHCI controller caches enough uframes, this probably | ||
576 | * isn't needed unless there are so many low/full speed devices | ||
577 | * that the controller's can't cache it all. | ||
578 | */ | ||
579 | ehci->cpufreq_transition.notifier_call = ehci_cpufreq_notifier; | ||
580 | cpufreq_register_notifier(&ehci->cpufreq_transition, | ||
581 | CPUFREQ_TRANSITION_NOTIFIER); | ||
582 | #endif | ||
583 | return 0; | 516 | return 0; |
584 | } | 517 | } |
585 | 518 | ||
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 8816d09903d0..0431397836f6 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c | |||
@@ -94,9 +94,6 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) | |||
94 | qh->qh_dma = dma; | 94 | qh->qh_dma = dma; |
95 | // INIT_LIST_HEAD (&qh->qh_list); | 95 | // INIT_LIST_HEAD (&qh->qh_list); |
96 | INIT_LIST_HEAD (&qh->qtd_list); | 96 | INIT_LIST_HEAD (&qh->qtd_list); |
97 | #ifdef CONFIG_CPU_FREQ | ||
98 | INIT_LIST_HEAD (&qh->split_intr_qhs); | ||
99 | #endif | ||
100 | 97 | ||
101 | /* dummy td enables safe urb queuing */ | 98 | /* dummy td enables safe urb queuing */ |
102 | qh->dummy = ehci_qtd_alloc (ehci, flags); | 99 | qh->dummy = ehci_qtd_alloc (ehci, flags); |
diff --git a/drivers/usb/host/ehci-ppc-soc.c b/drivers/usb/host/ehci-ppc-soc.c index c2cedb09ed8b..4f99b0eb27bc 100644 --- a/drivers/usb/host/ehci-ppc-soc.c +++ b/drivers/usb/host/ehci-ppc-soc.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * Bus Glue for PPC On-Chip EHCI driver | 6 | * Bus Glue for PPC On-Chip EHCI driver |
7 | * Tested on AMCC 440EPx | 7 | * Tested on AMCC 440EPx |
8 | * | 8 | * |
9 | * Based on "ehci-au12xx.c" by David Brownell <dbrownell@users.sourceforge.net> | 9 | * Based on "ehci-au1xxx.c" by K.Boge <karsten.boge@amd.com> |
10 | * | 10 | * |
11 | * This file is licenced under the GPL. | 11 | * This file is licenced under the GPL. |
12 | */ | 12 | */ |
@@ -15,6 +15,24 @@ | |||
15 | 15 | ||
16 | extern int usb_disabled(void); | 16 | extern int usb_disabled(void); |
17 | 17 | ||
18 | /* called during probe() after chip reset completes */ | ||
19 | static int ehci_ppc_soc_setup(struct usb_hcd *hcd) | ||
20 | { | ||
21 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | ||
22 | int retval; | ||
23 | |||
24 | retval = ehci_halt(ehci); | ||
25 | if (retval) | ||
26 | return retval; | ||
27 | |||
28 | retval = ehci_init(hcd); | ||
29 | if (retval) | ||
30 | return retval; | ||
31 | |||
32 | ehci->sbrn = 0x20; | ||
33 | return ehci_reset(ehci); | ||
34 | } | ||
35 | |||
18 | /** | 36 | /** |
19 | * usb_ehci_ppc_soc_probe - initialize PPC-SoC-based HCDs | 37 | * usb_ehci_ppc_soc_probe - initialize PPC-SoC-based HCDs |
20 | * Context: !in_interrupt() | 38 | * Context: !in_interrupt() |
@@ -120,7 +138,7 @@ static const struct hc_driver ehci_ppc_soc_hc_driver = { | |||
120 | /* | 138 | /* |
121 | * basic lifecycle operations | 139 | * basic lifecycle operations |
122 | */ | 140 | */ |
123 | .reset = ehci_init, | 141 | .reset = ehci_ppc_soc_setup, |
124 | .start = ehci_run, | 142 | .start = ehci_run, |
125 | .stop = ehci_stop, | 143 | .stop = ehci_stop, |
126 | .shutdown = ehci_shutdown, | 144 | .shutdown = ehci_shutdown, |
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 2284028f8aa5..140bfa423e07 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -312,10 +312,6 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
312 | struct urb *urb; | 312 | struct urb *urb; |
313 | u32 token = 0; | 313 | u32 token = 0; |
314 | 314 | ||
315 | /* ignore QHs that are currently inactive */ | ||
316 | if (qh->hw_info1 & __constant_cpu_to_le32(QH_INACTIVATE)) | ||
317 | break; | ||
318 | |||
319 | qtd = list_entry (entry, struct ehci_qtd, qtd_list); | 315 | qtd = list_entry (entry, struct ehci_qtd, qtd_list); |
320 | urb = qtd->urb; | 316 | urb = qtd->urb; |
321 | 317 | ||
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index d4a8ace49676..e682f2342ef8 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -479,109 +479,6 @@ static int disable_periodic (struct ehci_hcd *ehci) | |||
479 | } | 479 | } |
480 | 480 | ||
481 | /*-------------------------------------------------------------------------*/ | 481 | /*-------------------------------------------------------------------------*/ |
482 | #ifdef CONFIG_CPU_FREQ | ||
483 | |||
484 | static int safe_to_modify_i (struct ehci_hcd *ehci, struct ehci_qh *qh) | ||
485 | { | ||
486 | int now; /* current (frame * 8) + uframe */ | ||
487 | int prev_start, next_start; /* uframes from/to split start */ | ||
488 | int start_uframe = ffs(le32_to_cpup (&qh->hw_info2) & QH_SMASK); | ||
489 | int end_uframe = fls((le32_to_cpup (&qh->hw_info2) & QH_CMASK) >> 8); | ||
490 | int split_duration = end_uframe - start_uframe; | ||
491 | |||
492 | now = readl(&ehci->regs->frame_index) % (ehci->periodic_size << 3); | ||
493 | |||
494 | next_start = ((1024 << 3) + (qh->start << 3) + start_uframe - now) | ||
495 | % (qh->period << 3); | ||
496 | prev_start = (qh->period << 3) - next_start; | ||
497 | |||
498 | /* | ||
499 | * Make sure there will be at least one uframe when qh is safe. | ||
500 | */ | ||
501 | if ((qh->period << 3) <= (ehci->i_thresh + 2 + split_duration)) | ||
502 | /* never safe */ | ||
503 | return -EINVAL; | ||
504 | |||
505 | /* | ||
506 | * Wait 1 uframe after transaction should have started, to make | ||
507 | * sure controller has time to write back overlay, so we can | ||
508 | * check QTD_STS_STS to see if transaction is in progress. | ||
509 | */ | ||
510 | if ((next_start > ehci->i_thresh) && (prev_start > 1)) | ||
511 | /* safe to set "i" bit if split isn't in progress */ | ||
512 | return (qh->hw_token & STATUS_BIT(ehci)) ? 0 : 1; | ||
513 | else | ||
514 | return 0; | ||
515 | } | ||
516 | |||
517 | /* Set inactivate bit for all the split interrupt QHs. */ | ||
518 | static void qh_inactivate_split_intr_qhs (struct ehci_hcd *ehci) | ||
519 | { | ||
520 | struct ehci_qh *qh; | ||
521 | int not_done, safe; | ||
522 | u32 inactivate = INACTIVATE_BIT(ehci); | ||
523 | u32 active = ACTIVE_BIT(ehci); | ||
524 | |||
525 | do { | ||
526 | not_done = 0; | ||
527 | list_for_each_entry(qh, &ehci->split_intr_qhs, | ||
528 | split_intr_qhs) { | ||
529 | if (qh->hw_info1 & inactivate) | ||
530 | /* already off */ | ||
531 | continue; | ||
532 | /* | ||
533 | * To avoid setting "I" after the start split happens, | ||
534 | * don't set it if the QH might be cached in the | ||
535 | * controller. Some HCs (Broadcom/ServerWorks HT1000) | ||
536 | * will stop in the middle of a split transaction when | ||
537 | * the "I" bit is set. | ||
538 | */ | ||
539 | safe = safe_to_modify_i(ehci, qh); | ||
540 | if (safe == 0) { | ||
541 | not_done = 1; | ||
542 | } else if (safe > 0) { | ||
543 | qh->was_active = qh->hw_token & active; | ||
544 | qh->hw_info1 |= inactivate; | ||
545 | } | ||
546 | } | ||
547 | } while (not_done); | ||
548 | wmb(); | ||
549 | } | ||
550 | |||
551 | static void qh_reactivate_split_intr_qhs (struct ehci_hcd *ehci) | ||
552 | { | ||
553 | struct ehci_qh *qh; | ||
554 | u32 token; | ||
555 | int not_done, safe; | ||
556 | u32 inactivate = INACTIVATE_BIT(ehci); | ||
557 | u32 active = ACTIVE_BIT(ehci); | ||
558 | u32 halt = HALT_BIT(ehci); | ||
559 | |||
560 | do { | ||
561 | not_done = 0; | ||
562 | list_for_each_entry(qh, &ehci->split_intr_qhs, split_intr_qhs) { | ||
563 | if (!(qh->hw_info1 & inactivate)) /* already on */ | ||
564 | continue; | ||
565 | /* | ||
566 | * Don't reactivate if cached, or controller might | ||
567 | * overwrite overlay after we modify it! | ||
568 | */ | ||
569 | safe = safe_to_modify_i(ehci, qh); | ||
570 | if (safe == 0) { | ||
571 | not_done = 1; | ||
572 | } else if (safe > 0) { | ||
573 | /* See EHCI 1.0 section 4.15.2.4. */ | ||
574 | token = qh->hw_token; | ||
575 | qh->hw_token = (token | halt) & ~active; | ||
576 | wmb(); | ||
577 | qh->hw_info1 &= ~inactivate; | ||
578 | wmb(); | ||
579 | qh->hw_token = (token & ~halt) | qh->was_active; | ||
580 | } | ||
581 | } | ||
582 | } while (not_done); | ||
583 | } | ||
584 | #endif | ||
585 | 482 | ||
586 | /* periodic schedule slots have iso tds (normal or split) first, then a | 483 | /* periodic schedule slots have iso tds (normal or split) first, then a |
587 | * sparse tree for active interrupt transfers. | 484 | * sparse tree for active interrupt transfers. |
@@ -599,17 +496,6 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
599 | period, hc32_to_cpup(ehci, &qh->hw_info2) & (QH_CMASK | QH_SMASK), | 496 | period, hc32_to_cpup(ehci, &qh->hw_info2) & (QH_CMASK | QH_SMASK), |
600 | qh, qh->start, qh->usecs, qh->c_usecs); | 497 | qh, qh->start, qh->usecs, qh->c_usecs); |
601 | 498 | ||
602 | #ifdef CONFIG_CPU_FREQ | ||
603 | /* | ||
604 | * If low/full speed interrupt QHs are inactive (because of | ||
605 | * cpufreq changing processor speeds), start QH with I flag set-- | ||
606 | * it will automatically be cleared when cpufreq is done. | ||
607 | */ | ||
608 | if (ehci->cpufreq_changing) | ||
609 | if (!(qh->hw_info1 & (cpu_to_le32(1 << 13)))) | ||
610 | qh->hw_info1 |= INACTIVATE_BIT(ehci); | ||
611 | #endif | ||
612 | |||
613 | /* high bandwidth, or otherwise every microframe */ | 499 | /* high bandwidth, or otherwise every microframe */ |
614 | if (period == 0) | 500 | if (period == 0) |
615 | period = 1; | 501 | period = 1; |
@@ -658,12 +544,6 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
658 | ? ((qh->usecs + qh->c_usecs) / qh->period) | 544 | ? ((qh->usecs + qh->c_usecs) / qh->period) |
659 | : (qh->usecs * 8); | 545 | : (qh->usecs * 8); |
660 | 546 | ||
661 | #ifdef CONFIG_CPU_FREQ | ||
662 | /* add qh to list of low/full speed interrupt QHs, if applicable */ | ||
663 | if (!(qh->hw_info1 & (cpu_to_le32(1 << 13)))) { | ||
664 | list_add(&qh->split_intr_qhs, &ehci->split_intr_qhs); | ||
665 | } | ||
666 | #endif | ||
667 | /* maybe enable periodic schedule processing */ | 547 | /* maybe enable periodic schedule processing */ |
668 | if (!ehci->periodic_sched++) | 548 | if (!ehci->periodic_sched++) |
669 | return enable_periodic (ehci); | 549 | return enable_periodic (ehci); |
@@ -683,13 +563,6 @@ static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
683 | // THEN | 563 | // THEN |
684 | // qh->hw_info1 |= __constant_cpu_to_hc32(1 << 7 /* "ignore" */); | 564 | // qh->hw_info1 |= __constant_cpu_to_hc32(1 << 7 /* "ignore" */); |
685 | 565 | ||
686 | #ifdef CONFIG_CPU_FREQ | ||
687 | /* remove qh from list of low/full speed interrupt QHs */ | ||
688 | if (!(qh->hw_info1 & (cpu_to_le32(1 << 13)))) { | ||
689 | list_del_init(&qh->split_intr_qhs); | ||
690 | } | ||
691 | #endif | ||
692 | |||
693 | /* high bandwidth, or otherwise part of every microframe */ | 566 | /* high bandwidth, or otherwise part of every microframe */ |
694 | if ((period = qh->period) == 0) | 567 | if ((period = qh->period) == 0) |
695 | period = 1; | 568 | period = 1; |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 2c68a04230c1..951d69fec513 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -71,12 +71,6 @@ struct ehci_hcd { /* one per controller */ | |||
71 | __u32 hcs_params; /* cached register copy */ | 71 | __u32 hcs_params; /* cached register copy */ |
72 | spinlock_t lock; | 72 | spinlock_t lock; |
73 | 73 | ||
74 | #ifdef CONFIG_CPU_FREQ | ||
75 | struct notifier_block cpufreq_transition; | ||
76 | int cpufreq_changing; | ||
77 | struct list_head split_intr_qhs; | ||
78 | #endif | ||
79 | |||
80 | /* async schedule support */ | 74 | /* async schedule support */ |
81 | struct ehci_qh *async; | 75 | struct ehci_qh *async; |
82 | struct ehci_qh *reclaim; | 76 | struct ehci_qh *reclaim; |
@@ -439,10 +433,6 @@ struct ehci_qh { | |||
439 | __hc32 hw_next; /* see EHCI 3.6.1 */ | 433 | __hc32 hw_next; /* see EHCI 3.6.1 */ |
440 | __hc32 hw_info1; /* see EHCI 3.6.2 */ | 434 | __hc32 hw_info1; /* see EHCI 3.6.2 */ |
441 | #define QH_HEAD 0x00008000 | 435 | #define QH_HEAD 0x00008000 |
442 | #define QH_INACTIVATE 0x00000080 | ||
443 | |||
444 | #define INACTIVATE_BIT(ehci) cpu_to_hc32(ehci, QH_INACTIVATE) | ||
445 | |||
446 | __hc32 hw_info2; /* see EHCI 3.6.2 */ | 436 | __hc32 hw_info2; /* see EHCI 3.6.2 */ |
447 | #define QH_SMASK 0x000000ff | 437 | #define QH_SMASK 0x000000ff |
448 | #define QH_CMASK 0x0000ff00 | 438 | #define QH_CMASK 0x0000ff00 |
@@ -492,10 +482,6 @@ struct ehci_qh { | |||
492 | unsigned short start; /* where polling starts */ | 482 | unsigned short start; /* where polling starts */ |
493 | #define NO_FRAME ((unsigned short)~0) /* pick new start */ | 483 | #define NO_FRAME ((unsigned short)~0) /* pick new start */ |
494 | struct usb_device *dev; /* access to TT */ | 484 | struct usb_device *dev; /* access to TT */ |
495 | #ifdef CONFIG_CPU_FREQ | ||
496 | struct list_head split_intr_qhs; /* list of split qhs */ | ||
497 | __le32 was_active; /* active bit before "i" set */ | ||
498 | #endif | ||
499 | } __attribute__ ((aligned (32))); | 485 | } __attribute__ ((aligned (32))); |
500 | 486 | ||
501 | /*-------------------------------------------------------------------------*/ | 487 | /*-------------------------------------------------------------------------*/ |
diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c index 6f9e43e9a6ca..f61c6cdd06f2 100644 --- a/drivers/usb/host/ohci-dbg.c +++ b/drivers/usb/host/ohci-dbg.c | |||
@@ -74,7 +74,7 @@ urb_print (struct urb * urb, char * str, int small) | |||
74 | 74 | ||
75 | #define ohci_dbg_sw(ohci, next, size, format, arg...) \ | 75 | #define ohci_dbg_sw(ohci, next, size, format, arg...) \ |
76 | do { \ | 76 | do { \ |
77 | if (next) { \ | 77 | if (next != NULL) { \ |
78 | unsigned s_len; \ | 78 | unsigned s_len; \ |
79 | s_len = scnprintf (*next, *size, format, ## arg ); \ | 79 | s_len = scnprintf (*next, *size, format, ## arg ); \ |
80 | *size -= s_len; *next += s_len; \ | 80 | *size -= s_len; *next += s_len; \ |
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index d60f1985320c..40a1de4c256e 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
@@ -2208,8 +2208,6 @@ static int __init r8a66597_probe(struct platform_device *pdev) | |||
2208 | clean_up: | 2208 | clean_up: |
2209 | if (reg) | 2209 | if (reg) |
2210 | iounmap(reg); | 2210 | iounmap(reg); |
2211 | if (res) | ||
2212 | release_mem_region(res->start, 1); | ||
2213 | 2211 | ||
2214 | return ret; | 2212 | return ret; |
2215 | } | 2213 | } |
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index 7f765ec038cd..b88eb3c62c02 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c | |||
@@ -1520,12 +1520,15 @@ static void u132_hcd_endp_work_scheduler(struct work_struct *work) | |||
1520 | } | 1520 | } |
1521 | } | 1521 | } |
1522 | } | 1522 | } |
1523 | #ifdef CONFIG_PM | ||
1523 | 1524 | ||
1524 | static void port_power(struct u132 *u132, int pn, int is_on) | 1525 | static void port_power(struct u132 *u132, int pn, int is_on) |
1525 | { | 1526 | { |
1526 | u132->port[pn].power = is_on; | 1527 | u132->port[pn].power = is_on; |
1527 | } | 1528 | } |
1528 | 1529 | ||
1530 | #endif | ||
1531 | |||
1529 | static void u132_power(struct u132 *u132, int is_on) | 1532 | static void u132_power(struct u132 *u132, int is_on) |
1530 | { | 1533 | { |
1531 | struct usb_hcd *hcd = u132_to_hcd(u132) | 1534 | struct usb_hcd *hcd = u132_to_hcd(u132) |
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c index cff6fd190a28..77bb893bf2e9 100644 --- a/drivers/usb/serial/airprime.c +++ b/drivers/usb/serial/airprime.c | |||
@@ -18,7 +18,6 @@ | |||
18 | 18 | ||
19 | static struct usb_device_id id_table [] = { | 19 | static struct usb_device_id id_table [] = { |
20 | { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ | 20 | { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ |
21 | { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */ | ||
22 | { }, | 21 | { }, |
23 | }; | 22 | }; |
24 | MODULE_DEVICE_TABLE(usb, id_table); | 23 | MODULE_DEVICE_TABLE(usb, id_table); |
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c index e67ce25f7512..86724e885704 100644 --- a/drivers/usb/serial/belkin_sa.c +++ b/drivers/usb/serial/belkin_sa.c | |||
@@ -383,6 +383,10 @@ static void belkin_sa_set_termios (struct usb_serial_port *port, struct ktermios | |||
383 | } | 383 | } |
384 | 384 | ||
385 | baud = tty_get_baud_rate(port->tty); | 385 | baud = tty_get_baud_rate(port->tty); |
386 | if (baud == 0) { | ||
387 | dbg("%s - tty_get_baud_rate says 0 baud", __FUNCTION__); | ||
388 | return; | ||
389 | } | ||
386 | urb_value = BELKIN_SA_BAUD(baud); | 390 | urb_value = BELKIN_SA_BAUD(baud); |
387 | /* Clip to maximum speed */ | 391 | /* Clip to maximum speed */ |
388 | if (urb_value == 0) | 392 | if (urb_value == 0) |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 7b1673a44077..1370c423d7c2 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -538,6 +538,8 @@ static struct usb_device_id id_table_combined [] = { | |||
538 | { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, | 538 | { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, |
539 | { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, | 539 | { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, |
540 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, | 540 | { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, |
541 | { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, | ||
542 | { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, | ||
541 | { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, | 543 | { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, |
542 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, | 544 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, |
543 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, | 545 | { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index d9e49716db13..c70e1de6389e 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -430,6 +430,9 @@ | |||
430 | */ | 430 | */ |
431 | #define EVOLUTION_VID 0xDEEE /* Vendor ID */ | 431 | #define EVOLUTION_VID 0xDEEE /* Vendor ID */ |
432 | #define EVOLUTION_ER1_PID 0x0300 /* ER1 Control Module */ | 432 | #define EVOLUTION_ER1_PID 0x0300 /* ER1 Control Module */ |
433 | #define EVO_8U232AM_PID 0x02FF /* Evolution robotics RCM2 (FT232AM)*/ | ||
434 | #define EVO_HYBRID_PID 0x0302 /* Evolution robotics RCM4 PID (FT232BM)*/ | ||
435 | #define EVO_RCM4_PID 0x0303 /* Evolution robotics RCM4 PID */ | ||
433 | 436 | ||
434 | /* Pyramid Computer GmbH */ | 437 | /* Pyramid Computer GmbH */ |
435 | #define FTDI_PYRAMID_PID 0xE6C8 /* Pyramid Appliance Display */ | 438 | #define FTDI_PYRAMID_PID 0xE6C8 /* Pyramid Appliance Display */ |
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index 04bd3b7a2985..f1c90cfe7251 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Garmin GPS driver | 2 | * Garmin GPS driver |
3 | * | 3 | * |
4 | * Copyright (C) 2006 Hermann Kneissel herkne@users.sourceforge.net | 4 | * Copyright (C) 2006,2007 Hermann Kneissel herkne@users.sourceforge.net |
5 | * | 5 | * |
6 | * The latest version of the driver can be found at | 6 | * The latest version of the driver can be found at |
7 | * http://sourceforge.net/projects/garmin-gps/ | 7 | * http://sourceforge.net/projects/garmin-gps/ |
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
35 | #include <linux/spinlock.h> | 35 | #include <linux/spinlock.h> |
36 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
37 | #include <asm/atomic.h> | ||
37 | #include <linux/usb.h> | 38 | #include <linux/usb.h> |
38 | #include <linux/usb/serial.h> | 39 | #include <linux/usb/serial.h> |
39 | 40 | ||
@@ -52,7 +53,7 @@ static int debug = 0; | |||
52 | */ | 53 | */ |
53 | 54 | ||
54 | #define VERSION_MAJOR 0 | 55 | #define VERSION_MAJOR 0 |
55 | #define VERSION_MINOR 28 | 56 | #define VERSION_MINOR 31 |
56 | 57 | ||
57 | #define _STR(s) #s | 58 | #define _STR(s) #s |
58 | #define _DRIVER_VERSION(a,b) "v" _STR(a) "." _STR(b) | 59 | #define _DRIVER_VERSION(a,b) "v" _STR(a) "." _STR(b) |
@@ -141,6 +142,8 @@ struct garmin_data { | |||
141 | __u8 inbuffer [GPS_IN_BUFSIZ]; /* tty -> usb */ | 142 | __u8 inbuffer [GPS_IN_BUFSIZ]; /* tty -> usb */ |
142 | __u8 outbuffer[GPS_OUT_BUFSIZ]; /* usb -> tty */ | 143 | __u8 outbuffer[GPS_OUT_BUFSIZ]; /* usb -> tty */ |
143 | __u8 privpkt[4*6]; | 144 | __u8 privpkt[4*6]; |
145 | atomic_t req_count; | ||
146 | atomic_t resp_count; | ||
144 | spinlock_t lock; | 147 | spinlock_t lock; |
145 | struct list_head pktlist; | 148 | struct list_head pktlist; |
146 | }; | 149 | }; |
@@ -171,8 +174,6 @@ struct garmin_data { | |||
171 | #define CLEAR_HALT_REQUIRED 0x0001 | 174 | #define CLEAR_HALT_REQUIRED 0x0001 |
172 | 175 | ||
173 | #define FLAGS_QUEUING 0x0100 | 176 | #define FLAGS_QUEUING 0x0100 |
174 | #define FLAGS_APP_RESP_SEEN 0x0200 | ||
175 | #define FLAGS_APP_REQ_SEEN 0x0400 | ||
176 | #define FLAGS_DROP_DATA 0x0800 | 177 | #define FLAGS_DROP_DATA 0x0800 |
177 | 178 | ||
178 | #define FLAGS_GSP_SKIP 0x1000 | 179 | #define FLAGS_GSP_SKIP 0x1000 |
@@ -186,7 +187,8 @@ struct garmin_data { | |||
186 | /* function prototypes */ | 187 | /* function prototypes */ |
187 | static void gsp_next_packet(struct garmin_data * garmin_data_p); | 188 | static void gsp_next_packet(struct garmin_data * garmin_data_p); |
188 | static int garmin_write_bulk(struct usb_serial_port *port, | 189 | static int garmin_write_bulk(struct usb_serial_port *port, |
189 | const unsigned char *buf, int count); | 190 | const unsigned char *buf, int count, |
191 | int dismiss_ack); | ||
190 | 192 | ||
191 | /* some special packets to be send or received */ | 193 | /* some special packets to be send or received */ |
192 | static unsigned char const GARMIN_START_SESSION_REQ[] | 194 | static unsigned char const GARMIN_START_SESSION_REQ[] |
@@ -233,9 +235,7 @@ static struct usb_driver garmin_driver = { | |||
233 | 235 | ||
234 | static inline int noResponseFromAppLayer(struct garmin_data * garmin_data_p) | 236 | static inline int noResponseFromAppLayer(struct garmin_data * garmin_data_p) |
235 | { | 237 | { |
236 | return ((garmin_data_p->flags | 238 | return atomic_read(&garmin_data_p->req_count) == atomic_read(&garmin_data_p->resp_count); |
237 | & (FLAGS_APP_REQ_SEEN|FLAGS_APP_RESP_SEEN)) | ||
238 | == FLAGS_APP_REQ_SEEN); | ||
239 | } | 239 | } |
240 | 240 | ||
241 | 241 | ||
@@ -463,7 +463,7 @@ static int gsp_rec_packet(struct garmin_data * garmin_data_p, int count) | |||
463 | usbdata[2] = __cpu_to_le32(size); | 463 | usbdata[2] = __cpu_to_le32(size); |
464 | 464 | ||
465 | garmin_write_bulk (garmin_data_p->port, garmin_data_p->inbuffer, | 465 | garmin_write_bulk (garmin_data_p->port, garmin_data_p->inbuffer, |
466 | GARMIN_PKTHDR_LENGTH+size); | 466 | GARMIN_PKTHDR_LENGTH+size, 0); |
467 | 467 | ||
468 | /* if this was an abort-transfer command, flush all | 468 | /* if this was an abort-transfer command, flush all |
469 | queued data. */ | 469 | queued data. */ |
@@ -818,7 +818,7 @@ static int nat_receive(struct garmin_data * garmin_data_p, | |||
818 | if (garmin_data_p->insize >= len) { | 818 | if (garmin_data_p->insize >= len) { |
819 | garmin_write_bulk (garmin_data_p->port, | 819 | garmin_write_bulk (garmin_data_p->port, |
820 | garmin_data_p->inbuffer, | 820 | garmin_data_p->inbuffer, |
821 | len); | 821 | len, 0); |
822 | garmin_data_p->insize = 0; | 822 | garmin_data_p->insize = 0; |
823 | 823 | ||
824 | /* if this was an abort-transfer command, | 824 | /* if this was an abort-transfer command, |
@@ -893,10 +893,11 @@ static int garmin_clear(struct garmin_data * garmin_data_p) | |||
893 | 893 | ||
894 | struct usb_serial_port *port = garmin_data_p->port; | 894 | struct usb_serial_port *port = garmin_data_p->port; |
895 | 895 | ||
896 | if (port != NULL && garmin_data_p->flags & FLAGS_APP_RESP_SEEN) { | 896 | if (port != NULL && atomic_read(&garmin_data_p->resp_count)) { |
897 | /* send a terminate command */ | 897 | /* send a terminate command */ |
898 | status = garmin_write_bulk(port, GARMIN_STOP_TRANSFER_REQ, | 898 | status = garmin_write_bulk(port, GARMIN_STOP_TRANSFER_REQ, |
899 | sizeof(GARMIN_STOP_TRANSFER_REQ)); | 899 | sizeof(GARMIN_STOP_TRANSFER_REQ), |
900 | 1); | ||
900 | } | 901 | } |
901 | 902 | ||
902 | /* flush all queued data */ | 903 | /* flush all queued data */ |
@@ -939,7 +940,8 @@ static int garmin_init_session(struct usb_serial_port *port) | |||
939 | dbg("%s - starting session ...", __FUNCTION__); | 940 | dbg("%s - starting session ...", __FUNCTION__); |
940 | garmin_data_p->state = STATE_ACTIVE; | 941 | garmin_data_p->state = STATE_ACTIVE; |
941 | status = garmin_write_bulk(port, GARMIN_START_SESSION_REQ, | 942 | status = garmin_write_bulk(port, GARMIN_START_SESSION_REQ, |
942 | sizeof(GARMIN_START_SESSION_REQ)); | 943 | sizeof(GARMIN_START_SESSION_REQ), |
944 | 0); | ||
943 | 945 | ||
944 | if (status >= 0) { | 946 | if (status >= 0) { |
945 | 947 | ||
@@ -950,7 +952,8 @@ static int garmin_init_session(struct usb_serial_port *port) | |||
950 | /* not needed, but the win32 driver does it too ... */ | 952 | /* not needed, but the win32 driver does it too ... */ |
951 | status = garmin_write_bulk(port, | 953 | status = garmin_write_bulk(port, |
952 | GARMIN_START_SESSION_REQ2, | 954 | GARMIN_START_SESSION_REQ2, |
953 | sizeof(GARMIN_START_SESSION_REQ2)); | 955 | sizeof(GARMIN_START_SESSION_REQ2), |
956 | 0); | ||
954 | if (status >= 0) { | 957 | if (status >= 0) { |
955 | status = 0; | 958 | status = 0; |
956 | spin_lock_irqsave(&garmin_data_p->lock, flags); | 959 | spin_lock_irqsave(&garmin_data_p->lock, flags); |
@@ -987,6 +990,8 @@ static int garmin_open (struct usb_serial_port *port, struct file *filp) | |||
987 | garmin_data_p->mode = initial_mode; | 990 | garmin_data_p->mode = initial_mode; |
988 | garmin_data_p->count = 0; | 991 | garmin_data_p->count = 0; |
989 | garmin_data_p->flags = 0; | 992 | garmin_data_p->flags = 0; |
993 | atomic_set(&garmin_data_p->req_count, 0); | ||
994 | atomic_set(&garmin_data_p->resp_count, 0); | ||
990 | spin_unlock_irqrestore(&garmin_data_p->lock, flags); | 995 | spin_unlock_irqrestore(&garmin_data_p->lock, flags); |
991 | 996 | ||
992 | /* shutdown any bulk reads that might be going on */ | 997 | /* shutdown any bulk reads that might be going on */ |
@@ -1035,28 +1040,39 @@ static void garmin_write_bulk_callback (struct urb *urb) | |||
1035 | { | 1040 | { |
1036 | unsigned long flags; | 1041 | unsigned long flags; |
1037 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 1042 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; |
1038 | struct garmin_data * garmin_data_p = usb_get_serial_port_data(port); | ||
1039 | int status = urb->status; | 1043 | int status = urb->status; |
1040 | 1044 | ||
1041 | /* free up the transfer buffer, as usb_free_urb() does not do this */ | 1045 | if (port) { |
1042 | kfree (urb->transfer_buffer); | 1046 | struct garmin_data * garmin_data_p = usb_get_serial_port_data(port); |
1043 | 1047 | ||
1044 | dbg("%s - port %d", __FUNCTION__, port->number); | 1048 | dbg("%s - port %d", __FUNCTION__, port->number); |
1045 | 1049 | ||
1046 | if (status) { | 1050 | if (GARMIN_LAYERID_APPL == getLayerId(urb->transfer_buffer) |
1047 | dbg("%s - nonzero write bulk status received: %d", | 1051 | && (garmin_data_p->mode == MODE_GARMIN_SERIAL)) { |
1048 | __FUNCTION__, status); | 1052 | gsp_send_ack(garmin_data_p, ((__u8 *)urb->transfer_buffer)[4]); |
1049 | spin_lock_irqsave(&garmin_data_p->lock, flags); | 1053 | } |
1050 | garmin_data_p->flags |= CLEAR_HALT_REQUIRED; | 1054 | |
1051 | spin_unlock_irqrestore(&garmin_data_p->lock, flags); | 1055 | if (status) { |
1056 | dbg("%s - nonzero write bulk status received: %d", | ||
1057 | __FUNCTION__, urb->status); | ||
1058 | spin_lock_irqsave(&garmin_data_p->lock, flags); | ||
1059 | garmin_data_p->flags |= CLEAR_HALT_REQUIRED; | ||
1060 | spin_unlock_irqrestore(&garmin_data_p->lock, flags); | ||
1061 | } | ||
1062 | |||
1063 | usb_serial_port_softint(port); | ||
1052 | } | 1064 | } |
1053 | 1065 | ||
1054 | usb_serial_port_softint(port); | 1066 | /* Ignore errors that resulted from garmin_write_bulk with dismiss_ack=1 */ |
1067 | |||
1068 | /* free up the transfer buffer, as usb_free_urb() does not do this */ | ||
1069 | kfree (urb->transfer_buffer); | ||
1055 | } | 1070 | } |
1056 | 1071 | ||
1057 | 1072 | ||
1058 | static int garmin_write_bulk (struct usb_serial_port *port, | 1073 | static int garmin_write_bulk (struct usb_serial_port *port, |
1059 | const unsigned char *buf, int count) | 1074 | const unsigned char *buf, int count, |
1075 | int dismiss_ack) | ||
1060 | { | 1076 | { |
1061 | unsigned long flags; | 1077 | unsigned long flags; |
1062 | struct usb_serial *serial = port->serial; | 1078 | struct usb_serial *serial = port->serial; |
@@ -1093,13 +1109,12 @@ static int garmin_write_bulk (struct usb_serial_port *port, | |||
1093 | usb_sndbulkpipe (serial->dev, | 1109 | usb_sndbulkpipe (serial->dev, |
1094 | port->bulk_out_endpointAddress), | 1110 | port->bulk_out_endpointAddress), |
1095 | buffer, count, | 1111 | buffer, count, |
1096 | garmin_write_bulk_callback, port); | 1112 | garmin_write_bulk_callback, |
1113 | dismiss_ack ? NULL : port); | ||
1097 | urb->transfer_flags |= URB_ZERO_PACKET; | 1114 | urb->transfer_flags |= URB_ZERO_PACKET; |
1098 | 1115 | ||
1099 | if (GARMIN_LAYERID_APPL == getLayerId(buffer)) { | 1116 | if (GARMIN_LAYERID_APPL == getLayerId(buffer)) { |
1100 | spin_lock_irqsave(&garmin_data_p->lock, flags); | 1117 | atomic_inc(&garmin_data_p->req_count); |
1101 | garmin_data_p->flags |= FLAGS_APP_REQ_SEEN; | ||
1102 | spin_unlock_irqrestore(&garmin_data_p->lock, flags); | ||
1103 | if (garmin_data_p->mode == MODE_GARMIN_SERIAL) { | 1118 | if (garmin_data_p->mode == MODE_GARMIN_SERIAL) { |
1104 | pkt_clear(garmin_data_p); | 1119 | pkt_clear(garmin_data_p); |
1105 | garmin_data_p->state = STATE_GSP_WAIT_DATA; | 1120 | garmin_data_p->state = STATE_GSP_WAIT_DATA; |
@@ -1114,13 +1129,6 @@ static int garmin_write_bulk (struct usb_serial_port *port, | |||
1114 | "failed with status = %d\n", | 1129 | "failed with status = %d\n", |
1115 | __FUNCTION__, status); | 1130 | __FUNCTION__, status); |
1116 | count = status; | 1131 | count = status; |
1117 | } else { | ||
1118 | |||
1119 | if (GARMIN_LAYERID_APPL == getLayerId(buffer) | ||
1120 | && (garmin_data_p->mode == MODE_GARMIN_SERIAL)) { | ||
1121 | |||
1122 | gsp_send_ack(garmin_data_p, buffer[4]); | ||
1123 | } | ||
1124 | } | 1132 | } |
1125 | 1133 | ||
1126 | /* we are done with this urb, so let the host driver | 1134 | /* we are done with this urb, so let the host driver |
@@ -1135,7 +1143,6 @@ static int garmin_write_bulk (struct usb_serial_port *port, | |||
1135 | static int garmin_write (struct usb_serial_port *port, | 1143 | static int garmin_write (struct usb_serial_port *port, |
1136 | const unsigned char *buf, int count) | 1144 | const unsigned char *buf, int count) |
1137 | { | 1145 | { |
1138 | unsigned long flags; | ||
1139 | int pktid, pktsiz, len; | 1146 | int pktid, pktsiz, len; |
1140 | struct garmin_data * garmin_data_p = usb_get_serial_port_data(port); | 1147 | struct garmin_data * garmin_data_p = usb_get_serial_port_data(port); |
1141 | __le32 *privpkt = (__le32 *)garmin_data_p->privpkt; | 1148 | __le32 *privpkt = (__le32 *)garmin_data_p->privpkt; |
@@ -1186,9 +1193,7 @@ static int garmin_write (struct usb_serial_port *port, | |||
1186 | break; | 1193 | break; |
1187 | 1194 | ||
1188 | case PRIV_PKTID_RESET_REQ: | 1195 | case PRIV_PKTID_RESET_REQ: |
1189 | spin_lock_irqsave(&garmin_data_p->lock, flags); | 1196 | atomic_inc(&garmin_data_p->req_count); |
1190 | garmin_data_p->flags |= FLAGS_APP_REQ_SEEN; | ||
1191 | spin_unlock_irqrestore(&garmin_data_p->lock, flags); | ||
1192 | break; | 1197 | break; |
1193 | 1198 | ||
1194 | case PRIV_PKTID_SET_DEF_MODE: | 1199 | case PRIV_PKTID_SET_DEF_MODE: |
@@ -1241,8 +1246,6 @@ static int garmin_chars_in_buffer (struct usb_serial_port *port) | |||
1241 | static void garmin_read_process(struct garmin_data * garmin_data_p, | 1246 | static void garmin_read_process(struct garmin_data * garmin_data_p, |
1242 | unsigned char *data, unsigned data_length) | 1247 | unsigned char *data, unsigned data_length) |
1243 | { | 1248 | { |
1244 | unsigned long flags; | ||
1245 | |||
1246 | if (garmin_data_p->flags & FLAGS_DROP_DATA) { | 1249 | if (garmin_data_p->flags & FLAGS_DROP_DATA) { |
1247 | /* abort-transfer cmd is actice */ | 1250 | /* abort-transfer cmd is actice */ |
1248 | dbg("%s - pkt dropped", __FUNCTION__); | 1251 | dbg("%s - pkt dropped", __FUNCTION__); |
@@ -1254,9 +1257,7 @@ static void garmin_read_process(struct garmin_data * garmin_data_p, | |||
1254 | the device */ | 1257 | the device */ |
1255 | if (0 == memcmp(data, GARMIN_APP_LAYER_REPLY, | 1258 | if (0 == memcmp(data, GARMIN_APP_LAYER_REPLY, |
1256 | sizeof(GARMIN_APP_LAYER_REPLY))) { | 1259 | sizeof(GARMIN_APP_LAYER_REPLY))) { |
1257 | spin_lock_irqsave(&garmin_data_p->lock, flags); | 1260 | atomic_inc(&garmin_data_p->resp_count); |
1258 | garmin_data_p->flags |= FLAGS_APP_RESP_SEEN; | ||
1259 | spin_unlock_irqrestore(&garmin_data_p->lock, flags); | ||
1260 | } | 1261 | } |
1261 | 1262 | ||
1262 | /* if throttling is active or postprecessing is required | 1263 | /* if throttling is active or postprecessing is required |
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index 0455c1552ae9..6a3a704b5849 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c | |||
@@ -545,6 +545,7 @@ static struct usb_device_id ipaq_id_table [] = { | |||
545 | { USB_DEVICE(0x413C, 0x4009) }, /* Dell Axim USB Sync */ | 545 | { USB_DEVICE(0x413C, 0x4009) }, /* Dell Axim USB Sync */ |
546 | { USB_DEVICE(0x4505, 0x0010) }, /* Smartphone */ | 546 | { USB_DEVICE(0x4505, 0x0010) }, /* Smartphone */ |
547 | { USB_DEVICE(0x5E04, 0xCE00) }, /* SAGEM Wireless Assistant */ | 547 | { USB_DEVICE(0x5E04, 0xCE00) }, /* SAGEM Wireless Assistant */ |
548 | { USB_DEVICE(0x0BB4, 0x00CF) }, /* HTC smartphone modems */ | ||
548 | { } /* Terminating entry */ | 549 | { } /* Terminating entry */ |
549 | }; | 550 | }; |
550 | 551 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 84c12b5f1271..4cb3c165742b 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -110,6 +110,7 @@ static int option_send_setup(struct usb_serial_port *port); | |||
110 | #define HUAWEI_PRODUCT_E220 0x1003 | 110 | #define HUAWEI_PRODUCT_E220 0x1003 |
111 | 111 | ||
112 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 | 112 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 |
113 | #define DELL_VENDOR_ID 0x413C | ||
113 | 114 | ||
114 | #define ANYDATA_VENDOR_ID 0x16d5 | 115 | #define ANYDATA_VENDOR_ID 0x16d5 |
115 | #define ANYDATA_PRODUCT_ADU_E100A 0x6501 | 116 | #define ANYDATA_PRODUCT_ADU_E100A 0x6501 |
@@ -119,8 +120,6 @@ static int option_send_setup(struct usb_serial_port *port); | |||
119 | #define BANDRICH_PRODUCT_C100_1 0x1002 | 120 | #define BANDRICH_PRODUCT_C100_1 0x1002 |
120 | #define BANDRICH_PRODUCT_C100_2 0x1003 | 121 | #define BANDRICH_PRODUCT_C100_2 0x1003 |
121 | 122 | ||
122 | #define DELL_VENDOR_ID 0x413C | ||
123 | |||
124 | static struct usb_device_id option_ids[] = { | 123 | static struct usb_device_id option_ids[] = { |
125 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, | 124 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, |
126 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, | 125 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, |
@@ -171,11 +170,16 @@ static struct usb_device_id option_ids[] = { | |||
171 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ | 170 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ |
172 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ | 171 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ |
173 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */ | 172 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */ |
173 | { USB_DEVICE(DELL_VENDOR_ID, 0x8114) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ | ||
174 | { USB_DEVICE(DELL_VENDOR_ID, 0x8115) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ | ||
175 | { USB_DEVICE(DELL_VENDOR_ID, 0x8116) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ | ||
176 | { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */ | ||
177 | { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */ | ||
178 | { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */ | ||
174 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, | 179 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, |
175 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, | 180 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, |
176 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, | 181 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, |
177 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, | 182 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, |
178 | { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard */ | ||
179 | { } /* Terminating entry */ | 183 | { } /* Terminating entry */ |
180 | }; | 184 | }; |
181 | MODULE_DEVICE_TABLE(usb, option_ids); | 185 | MODULE_DEVICE_TABLE(usb, option_ids); |
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index d7db71eca520..833ada47fc54 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c | |||
@@ -818,19 +818,17 @@ static int oti6858_ioctl(struct usb_serial_port *port, struct file *file, | |||
818 | 818 | ||
819 | switch (cmd) { | 819 | switch (cmd) { |
820 | case TCGETS: | 820 | case TCGETS: |
821 | if (copy_to_user(user_arg, port->tty->termios, | 821 | if (kernel_termios_to_user_termios((struct ktermios __user *)arg, |
822 | sizeof(struct ktermios))) { | 822 | port->tty->termios)) |
823 | return -EFAULT; | 823 | return -EFAULT; |
824 | } | ||
825 | return 0; | 824 | return 0; |
826 | 825 | ||
827 | case TCSETS: | 826 | case TCSETS: |
828 | case TCSETSW: /* FIXME: this is not the same! */ | 827 | case TCSETSW: /* FIXME: this is not the same! */ |
829 | case TCSETSF: /* FIXME: this is not the same! */ | 828 | case TCSETSF: /* FIXME: this is not the same! */ |
830 | if (copy_from_user(port->tty->termios, user_arg, | 829 | if (user_termios_to_kernel_termios(port->tty->termios, |
831 | sizeof(struct ktermios))) { | 830 | (struct ktermios __user *)arg)) |
832 | return -EFAULT; | 831 | return -EFAULT; |
833 | } | ||
834 | oti6858_set_termios(port, NULL); | 832 | oti6858_set_termios(port, NULL); |
835 | return 0; | 833 | return 0; |
836 | 834 | ||
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c index 86899d55d8d8..51669b7622bb 100644 --- a/drivers/usb/serial/safe_serial.c +++ b/drivers/usb/serial/safe_serial.c | |||
@@ -74,13 +74,13 @@ | |||
74 | #include <linux/usb/serial.h> | 74 | #include <linux/usb/serial.h> |
75 | 75 | ||
76 | 76 | ||
77 | #ifndef CONFIG_USB_SAFE_PADDED | 77 | #ifndef CONFIG_USB_SERIAL_SAFE_PADDED |
78 | #define CONFIG_USB_SAFE_PADDED 0 | 78 | #define CONFIG_USB_SERIAL_SAFE_PADDED 0 |
79 | #endif | 79 | #endif |
80 | 80 | ||
81 | static int debug; | 81 | static int debug; |
82 | static int safe = 1; | 82 | static int safe = 1; |
83 | static int padded = CONFIG_USB_SAFE_PADDED; | 83 | static int padded = CONFIG_USB_SERIAL_SAFE_PADDED; |
84 | 84 | ||
85 | #define DRIVER_VERSION "v0.0b" | 85 | #define DRIVER_VERSION "v0.0b" |
86 | #define DRIVER_AUTHOR "sl@lineo.com, tbr@lineo.com" | 86 | #define DRIVER_AUTHOR "sl@lineo.com, tbr@lineo.com" |
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 7d84a7647e81..30e08c0bcdc2 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
@@ -104,6 +104,8 @@ static struct usb_device_id id_table [] = { | |||
104 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, | 104 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, |
105 | { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_TJ25_ID), | 105 | { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_TJ25_ID), |
106 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, | 106 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, |
107 | { USB_DEVICE(ACER_VENDOR_ID, ACER_S10_ID), | ||
108 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, | ||
107 | { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID), | 109 | { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID), |
108 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, | 110 | .driver_info = (kernel_ulong_t)&palm_os_4_probe }, |
109 | { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID), | 111 | { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID), |
diff --git a/drivers/usb/serial/visor.h b/drivers/usb/serial/visor.h index 4ce6f62a6f39..57229cf66477 100644 --- a/drivers/usb/serial/visor.h +++ b/drivers/usb/serial/visor.h | |||
@@ -48,6 +48,9 @@ | |||
48 | #define SONY_CLIE_UX50_ID 0x0144 | 48 | #define SONY_CLIE_UX50_ID 0x0144 |
49 | #define SONY_CLIE_TJ25_ID 0x0169 | 49 | #define SONY_CLIE_TJ25_ID 0x0169 |
50 | 50 | ||
51 | #define ACER_VENDOR_ID 0x0502 | ||
52 | #define ACER_S10_ID 0x0001 | ||
53 | |||
51 | #define SAMSUNG_VENDOR_ID 0x04E8 | 54 | #define SAMSUNG_VENDOR_ID 0x04E8 |
52 | #define SAMSUNG_SCH_I330_ID 0x8001 | 55 | #define SAMSUNG_SCH_I330_ID 0x8001 |
53 | #define SAMSUNG_SPH_I500_ID 0x6601 | 56 | #define SAMSUNG_SPH_I500_ID 0x6601 |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index d8d008d42946..2d92ce31018f 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -342,7 +342,7 @@ UNUSUAL_DEV( 0x04b0, 0x040d, 0x0100, 0x0100, | |||
342 | US_FL_FIX_CAPACITY), | 342 | US_FL_FIX_CAPACITY), |
343 | 343 | ||
344 | /* Reported by Emil Larsson <emil@swip.net> */ | 344 | /* Reported by Emil Larsson <emil@swip.net> */ |
345 | UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0100, | 345 | UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0101, |
346 | "NIKON", | 346 | "NIKON", |
347 | "NIKON DSC D80", | 347 | "NIKON DSC D80", |
348 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 348 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 28842d208bb0..25e557d4fe6b 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
@@ -112,13 +112,6 @@ module_param(delay_use, uint, S_IRUGO | S_IWUSR); | |||
112 | MODULE_PARM_DESC(delay_use, "seconds to delay before using a new device"); | 112 | MODULE_PARM_DESC(delay_use, "seconds to delay before using a new device"); |
113 | 113 | ||
114 | 114 | ||
115 | /* These are used to make sure the module doesn't unload before all the | ||
116 | * threads have exited. | ||
117 | */ | ||
118 | static atomic_t total_threads = ATOMIC_INIT(0); | ||
119 | static DECLARE_COMPLETION(threads_gone); | ||
120 | |||
121 | |||
122 | /* | 115 | /* |
123 | * The entries in this table correspond, line for line, | 116 | * The entries in this table correspond, line for line, |
124 | * with the entries of us_unusual_dev_list[]. | 117 | * with the entries of us_unusual_dev_list[]. |
@@ -879,9 +872,6 @@ static void quiesce_and_remove_host(struct us_data *us) | |||
879 | usb_stor_stop_transport(us); | 872 | usb_stor_stop_transport(us); |
880 | wake_up(&us->delay_wait); | 873 | wake_up(&us->delay_wait); |
881 | 874 | ||
882 | /* It doesn't matter if the SCSI-scanning thread is still running. | ||
883 | * The thread will exit when it sees the DISCONNECTING flag. */ | ||
884 | |||
885 | /* queuecommand won't accept any new commands and the control | 875 | /* queuecommand won't accept any new commands and the control |
886 | * thread won't execute a previously-queued command. If there | 876 | * thread won't execute a previously-queued command. If there |
887 | * is such a command pending, complete it with an error. */ | 877 | * is such a command pending, complete it with an error. */ |
@@ -891,12 +881,16 @@ static void quiesce_and_remove_host(struct us_data *us) | |||
891 | scsi_lock(host); | 881 | scsi_lock(host); |
892 | us->srb->scsi_done(us->srb); | 882 | us->srb->scsi_done(us->srb); |
893 | us->srb = NULL; | 883 | us->srb = NULL; |
884 | complete(&us->notify); /* in case of an abort */ | ||
894 | scsi_unlock(host); | 885 | scsi_unlock(host); |
895 | } | 886 | } |
896 | mutex_unlock(&us->dev_mutex); | 887 | mutex_unlock(&us->dev_mutex); |
897 | 888 | ||
898 | /* Now we own no commands so it's safe to remove the SCSI host */ | 889 | /* Now we own no commands so it's safe to remove the SCSI host */ |
899 | scsi_remove_host(host); | 890 | scsi_remove_host(host); |
891 | |||
892 | /* Wait for the SCSI-scanning thread to stop */ | ||
893 | wait_for_completion(&us->scanning_done); | ||
900 | } | 894 | } |
901 | 895 | ||
902 | /* Second stage of disconnect processing: deallocate all resources */ | 896 | /* Second stage of disconnect processing: deallocate all resources */ |
@@ -947,9 +941,8 @@ retry: | |||
947 | /* Should we unbind if no devices were detected? */ | 941 | /* Should we unbind if no devices were detected? */ |
948 | } | 942 | } |
949 | 943 | ||
950 | scsi_host_put(us_to_host(us)); | ||
951 | usb_autopm_put_interface(us->pusb_intf); | 944 | usb_autopm_put_interface(us->pusb_intf); |
952 | complete_and_exit(&threads_gone, 0); | 945 | complete_and_exit(&us->scanning_done, 0); |
953 | } | 946 | } |
954 | 947 | ||
955 | 948 | ||
@@ -984,6 +977,7 @@ static int storage_probe(struct usb_interface *intf, | |||
984 | init_MUTEX_LOCKED(&(us->sema)); | 977 | init_MUTEX_LOCKED(&(us->sema)); |
985 | init_completion(&(us->notify)); | 978 | init_completion(&(us->notify)); |
986 | init_waitqueue_head(&us->delay_wait); | 979 | init_waitqueue_head(&us->delay_wait); |
980 | init_completion(&us->scanning_done); | ||
987 | 981 | ||
988 | /* Associate the us_data structure with the USB device */ | 982 | /* Associate the us_data structure with the USB device */ |
989 | result = associate_dev(us, intf); | 983 | result = associate_dev(us, intf); |
@@ -1033,11 +1027,6 @@ static int storage_probe(struct usb_interface *intf, | |||
1033 | goto BadDevice; | 1027 | goto BadDevice; |
1034 | } | 1028 | } |
1035 | 1029 | ||
1036 | /* Take a reference to the host for the scanning thread and | ||
1037 | * count it among all the threads we have launched. Then | ||
1038 | * start it up. */ | ||
1039 | scsi_host_get(us_to_host(us)); | ||
1040 | atomic_inc(&total_threads); | ||
1041 | usb_autopm_get_interface(intf); /* dropped in the scanning thread */ | 1030 | usb_autopm_get_interface(intf); /* dropped in the scanning thread */ |
1042 | wake_up_process(th); | 1031 | wake_up_process(th); |
1043 | 1032 | ||
@@ -1104,16 +1093,6 @@ static void __exit usb_stor_exit(void) | |||
1104 | US_DEBUGP("-- calling usb_deregister()\n"); | 1093 | US_DEBUGP("-- calling usb_deregister()\n"); |
1105 | usb_deregister(&usb_storage_driver) ; | 1094 | usb_deregister(&usb_storage_driver) ; |
1106 | 1095 | ||
1107 | /* Don't return until all of our control and scanning threads | ||
1108 | * have exited. Since each thread signals threads_gone as its | ||
1109 | * last act, we have to call wait_for_completion the right number | ||
1110 | * of times. | ||
1111 | */ | ||
1112 | while (atomic_read(&total_threads) > 0) { | ||
1113 | wait_for_completion(&threads_gone); | ||
1114 | atomic_dec(&total_threads); | ||
1115 | } | ||
1116 | |||
1117 | usb_usual_clear_present(USB_US_TYPE_STOR); | 1096 | usb_usual_clear_present(USB_US_TYPE_STOR); |
1118 | } | 1097 | } |
1119 | 1098 | ||
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h index 6445665b1577..8d87503e2560 100644 --- a/drivers/usb/storage/usb.h +++ b/drivers/usb/storage/usb.h | |||
@@ -150,6 +150,7 @@ struct us_data { | |||
150 | struct semaphore sema; /* to sleep thread on */ | 150 | struct semaphore sema; /* to sleep thread on */ |
151 | struct completion notify; /* thread begin/end */ | 151 | struct completion notify; /* thread begin/end */ |
152 | wait_queue_head_t delay_wait; /* wait during scan, reset */ | 152 | wait_queue_head_t delay_wait; /* wait during scan, reset */ |
153 | struct completion scanning_done; /* wait for scan thread */ | ||
153 | 154 | ||
154 | /* subdriver information */ | 155 | /* subdriver information */ |
155 | void *extra; /* Any extra data */ | 156 | void *extra; /* Any extra data */ |
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index 80a81eccad36..832e4613673a 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c | |||
@@ -115,6 +115,52 @@ static int nocursor = 0; | |||
115 | module_param(nocursor, int, 0644); | 115 | module_param(nocursor, int, 0644); |
116 | MODULE_PARM_DESC(nocursor, "cursor enable/disable"); | 116 | MODULE_PARM_DESC(nocursor, "cursor enable/disable"); |
117 | 117 | ||
118 | /* fb_blank | ||
119 | * Blank the screen. Depending on the mode, the screen will be | ||
120 | * activated with the backlight color, or desactivated | ||
121 | */ | ||
122 | static int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi) | ||
123 | { | ||
124 | struct au1100fb_device *fbdev = to_au1100fb_device(fbi); | ||
125 | |||
126 | print_dbg("fb_blank %d %p", blank_mode, fbi); | ||
127 | |||
128 | switch (blank_mode) { | ||
129 | |||
130 | case VESA_NO_BLANKING: | ||
131 | /* Turn on panel */ | ||
132 | fbdev->regs->lcd_control |= LCD_CONTROL_GO; | ||
133 | #ifdef CONFIG_MIPS_PB1100 | ||
134 | if (drv_info.panel_idx == 1) { | ||
135 | au_writew(au_readw(PB1100_G_CONTROL) | ||
136 | | (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD), | ||
137 | PB1100_G_CONTROL); | ||
138 | } | ||
139 | #endif | ||
140 | au_sync(); | ||
141 | break; | ||
142 | |||
143 | case VESA_VSYNC_SUSPEND: | ||
144 | case VESA_HSYNC_SUSPEND: | ||
145 | case VESA_POWERDOWN: | ||
146 | /* Turn off panel */ | ||
147 | fbdev->regs->lcd_control &= ~LCD_CONTROL_GO; | ||
148 | #ifdef CONFIG_MIPS_PB1100 | ||
149 | if (drv_info.panel_idx == 1) { | ||
150 | au_writew(au_readw(PB1100_G_CONTROL) | ||
151 | & ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD), | ||
152 | PB1100_G_CONTROL); | ||
153 | } | ||
154 | #endif | ||
155 | au_sync(); | ||
156 | break; | ||
157 | default: | ||
158 | break; | ||
159 | |||
160 | } | ||
161 | return 0; | ||
162 | } | ||
163 | |||
118 | /* | 164 | /* |
119 | * Set hardware with var settings. This will enable the controller with a specific | 165 | * Set hardware with var settings. This will enable the controller with a specific |
120 | * mode, normally validated with the fb_check_var method | 166 | * mode, normally validated with the fb_check_var method |
@@ -272,52 +318,6 @@ int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned | |||
272 | return 0; | 318 | return 0; |
273 | } | 319 | } |
274 | 320 | ||
275 | /* fb_blank | ||
276 | * Blank the screen. Depending on the mode, the screen will be | ||
277 | * activated with the backlight color, or desactivated | ||
278 | */ | ||
279 | int au1100fb_fb_blank(int blank_mode, struct fb_info *fbi) | ||
280 | { | ||
281 | struct au1100fb_device *fbdev = to_au1100fb_device(fbi); | ||
282 | |||
283 | print_dbg("fb_blank %d %p", blank_mode, fbi); | ||
284 | |||
285 | switch (blank_mode) { | ||
286 | |||
287 | case VESA_NO_BLANKING: | ||
288 | /* Turn on panel */ | ||
289 | fbdev->regs->lcd_control |= LCD_CONTROL_GO; | ||
290 | #ifdef CONFIG_MIPS_PB1100 | ||
291 | if (drv_info.panel_idx == 1) { | ||
292 | au_writew(au_readw(PB1100_G_CONTROL) | ||
293 | | (PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD), | ||
294 | PB1100_G_CONTROL); | ||
295 | } | ||
296 | #endif | ||
297 | au_sync(); | ||
298 | break; | ||
299 | |||
300 | case VESA_VSYNC_SUSPEND: | ||
301 | case VESA_HSYNC_SUSPEND: | ||
302 | case VESA_POWERDOWN: | ||
303 | /* Turn off panel */ | ||
304 | fbdev->regs->lcd_control &= ~LCD_CONTROL_GO; | ||
305 | #ifdef CONFIG_MIPS_PB1100 | ||
306 | if (drv_info.panel_idx == 1) { | ||
307 | au_writew(au_readw(PB1100_G_CONTROL) | ||
308 | & ~(PB1100_G_CONTROL_BL | PB1100_G_CONTROL_VDD), | ||
309 | PB1100_G_CONTROL); | ||
310 | } | ||
311 | #endif | ||
312 | au_sync(); | ||
313 | break; | ||
314 | default: | ||
315 | break; | ||
316 | |||
317 | } | ||
318 | return 0; | ||
319 | } | ||
320 | |||
321 | /* fb_pan_display | 321 | /* fb_pan_display |
322 | * Pan display in x and/or y as specified | 322 | * Pan display in x and/or y as specified |
323 | */ | 323 | */ |
diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c index 7fa1afeae8dc..dda0586ab3f3 100644 --- a/drivers/video/console/newport_con.c +++ b/drivers/video/console/newport_con.c | |||
@@ -738,9 +738,8 @@ const struct consw newport_con = { | |||
738 | #ifdef MODULE | 738 | #ifdef MODULE |
739 | static int __init newport_console_init(void) | 739 | static int __init newport_console_init(void) |
740 | { | 740 | { |
741 | |||
742 | if (!sgi_gfxaddr) | 741 | if (!sgi_gfxaddr) |
743 | return NULL; | 742 | return 0; |
744 | 743 | ||
745 | if (!npregs) | 744 | if (!npregs) |
746 | npregs = (struct newport_regs *)/* ioremap cannot fail */ | 745 | npregs = (struct newport_regs *)/* ioremap cannot fail */ |
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c index 5715b8ad0ddc..94f4511023d8 100644 --- a/drivers/video/imsttfb.c +++ b/drivers/video/imsttfb.c | |||
@@ -1391,7 +1391,7 @@ init_imstt(struct fb_info *info) | |||
1391 | } | 1391 | } |
1392 | } | 1392 | } |
1393 | 1393 | ||
1394 | #if USE_NV_MODES && defined(CONFIG_PPC) | 1394 | #if USE_NV_MODES && defined(CONFIG_PPC32) |
1395 | { | 1395 | { |
1396 | int vmode = init_vmode, cmode = init_cmode; | 1396 | int vmode = init_vmode, cmode = init_cmode; |
1397 | 1397 | ||
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 81e571d59b50..a280a52f8efe 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -66,7 +66,7 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state); | |||
66 | 66 | ||
67 | #ifdef CONFIG_FB_PXA_PARAMETERS | 67 | #ifdef CONFIG_FB_PXA_PARAMETERS |
68 | #define PXAFB_OPTIONS_SIZE 256 | 68 | #define PXAFB_OPTIONS_SIZE 256 |
69 | static char g_options[PXAFB_OPTIONS_SIZE] __initdata = ""; | 69 | static char g_options[PXAFB_OPTIONS_SIZE] __devinitdata = ""; |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | static inline void pxafb_schedule_work(struct pxafb_info *fbi, u_int state) | 72 | static inline void pxafb_schedule_work(struct pxafb_info *fbi, u_int state) |
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c index 2fbd8dd16df5..6840dfebe4d4 100644 --- a/drivers/w1/w1_int.c +++ b/drivers/w1/w1_int.c | |||
@@ -170,22 +170,24 @@ void __w1_remove_master_device(struct w1_master *dev) | |||
170 | 170 | ||
171 | void w1_remove_master_device(struct w1_bus_master *bm) | 171 | void w1_remove_master_device(struct w1_bus_master *bm) |
172 | { | 172 | { |
173 | struct w1_master *dev = NULL; | 173 | struct w1_master *dev, *found = NULL; |
174 | 174 | ||
175 | list_for_each_entry(dev, &w1_masters, w1_master_entry) { | 175 | list_for_each_entry(dev, &w1_masters, w1_master_entry) { |
176 | if (!dev->initialized) | 176 | if (!dev->initialized) |
177 | continue; | 177 | continue; |
178 | 178 | ||
179 | if (dev->bus_master->data == bm->data) | 179 | if (dev->bus_master->data == bm->data) { |
180 | found = dev; | ||
180 | break; | 181 | break; |
182 | } | ||
181 | } | 183 | } |
182 | 184 | ||
183 | if (!dev) { | 185 | if (!found) { |
184 | printk(KERN_ERR "Device doesn't exist.\n"); | 186 | printk(KERN_ERR "Device doesn't exist.\n"); |
185 | return; | 187 | return; |
186 | } | 188 | } |
187 | 189 | ||
188 | __w1_remove_master_device(dev); | 190 | __w1_remove_master_device(found); |
189 | } | 191 | } |
190 | 192 | ||
191 | EXPORT_SYMBOL(w1_add_master_device); | 193 | EXPORT_SYMBOL(w1_add_master_device); |
diff --git a/drivers/zorro/zorro-sysfs.c b/drivers/zorro/zorro-sysfs.c index 9130f1c12c26..808b4f8675c5 100644 --- a/drivers/zorro/zorro-sysfs.c +++ b/drivers/zorro/zorro-sysfs.c | |||
@@ -78,7 +78,7 @@ static ssize_t zorro_read_config(struct kobject *kobj, | |||
78 | static struct bin_attribute zorro_config_attr = { | 78 | static struct bin_attribute zorro_config_attr = { |
79 | .attr = { | 79 | .attr = { |
80 | .name = "config", | 80 | .name = "config", |
81 | .mode = S_IRUGO | S_IWUSR, | 81 | .mode = S_IRUGO, |
82 | }, | 82 | }, |
83 | .size = sizeof(struct ConfigDev), | 83 | .size = sizeof(struct ConfigDev), |
84 | .read = zorro_read_config, | 84 | .read = zorro_read_config, |