diff options
Diffstat (limited to 'drivers')
43 files changed, 301 insertions, 246 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index dc7b56225923..fd27227771b4 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -80,6 +80,7 @@ enum { | |||
80 | board_ahci_pi = 1, | 80 | board_ahci_pi = 1, |
81 | board_ahci_vt8251 = 2, | 81 | board_ahci_vt8251 = 2, |
82 | board_ahci_ign_iferr = 3, | 82 | board_ahci_ign_iferr = 3, |
83 | board_ahci_sb600 = 4, | ||
83 | 84 | ||
84 | /* global controller registers */ | 85 | /* global controller registers */ |
85 | HOST_CAP = 0x00, /* host capabilities */ | 86 | HOST_CAP = 0x00, /* host capabilities */ |
@@ -168,6 +169,7 @@ enum { | |||
168 | AHCI_FLAG_NO_NCQ = (1 << 24), | 169 | AHCI_FLAG_NO_NCQ = (1 << 24), |
169 | AHCI_FLAG_IGN_IRQ_IF_ERR = (1 << 25), /* ignore IRQ_IF_ERR */ | 170 | AHCI_FLAG_IGN_IRQ_IF_ERR = (1 << 25), /* ignore IRQ_IF_ERR */ |
170 | AHCI_FLAG_HONOR_PI = (1 << 26), /* honor PORTS_IMPL */ | 171 | AHCI_FLAG_HONOR_PI = (1 << 26), /* honor PORTS_IMPL */ |
172 | AHCI_FLAG_IGN_SERR_INTERNAL = (1 << 27), /* ignore SERR_INTERNAL */ | ||
171 | }; | 173 | }; |
172 | 174 | ||
173 | struct ahci_cmd_hdr { | 175 | struct ahci_cmd_hdr { |
@@ -362,6 +364,18 @@ static const struct ata_port_info ahci_port_info[] = { | |||
362 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | 364 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ |
363 | .port_ops = &ahci_ops, | 365 | .port_ops = &ahci_ops, |
364 | }, | 366 | }, |
367 | /* board_ahci_sb600 */ | ||
368 | { | ||
369 | .sht = &ahci_sht, | ||
370 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | ||
371 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | | ||
372 | ATA_FLAG_SKIP_D2H_BSY | | ||
373 | AHCI_FLAG_IGN_SERR_INTERNAL, | ||
374 | .pio_mask = 0x1f, /* pio0-4 */ | ||
375 | .udma_mask = 0x7f, /* udma0-6 ; FIXME */ | ||
376 | .port_ops = &ahci_ops, | ||
377 | }, | ||
378 | |||
365 | }; | 379 | }; |
366 | 380 | ||
367 | static const struct pci_device_id ahci_pci_tbl[] = { | 381 | static const struct pci_device_id ahci_pci_tbl[] = { |
@@ -399,7 +413,7 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
399 | PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr }, | 413 | PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr }, |
400 | 414 | ||
401 | /* ATI */ | 415 | /* ATI */ |
402 | { PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */ | 416 | { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */ |
403 | { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */ | 417 | { PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */ |
404 | 418 | ||
405 | /* VIA */ | 419 | /* VIA */ |
@@ -1067,8 +1081,11 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) | |||
1067 | if (ap->flags & AHCI_FLAG_IGN_IRQ_IF_ERR) | 1081 | if (ap->flags & AHCI_FLAG_IGN_IRQ_IF_ERR) |
1068 | irq_stat &= ~PORT_IRQ_IF_ERR; | 1082 | irq_stat &= ~PORT_IRQ_IF_ERR; |
1069 | 1083 | ||
1070 | if (irq_stat & PORT_IRQ_TF_ERR) | 1084 | if (irq_stat & PORT_IRQ_TF_ERR) { |
1071 | err_mask |= AC_ERR_DEV; | 1085 | err_mask |= AC_ERR_DEV; |
1086 | if (ap->flags & AHCI_FLAG_IGN_SERR_INTERNAL) | ||
1087 | serror &= ~SERR_INTERNAL; | ||
1088 | } | ||
1072 | 1089 | ||
1073 | if (irq_stat & (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) { | 1090 | if (irq_stat & (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) { |
1074 | err_mask |= AC_ERR_HOST_BUS; | 1091 | err_mask |= AC_ERR_HOST_BUS; |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index c428a56e6f31..03a0acff6cfa 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -305,7 +305,7 @@ static int do_drive_get_GTF(struct ata_port *ap, int ix, | |||
305 | *gtf_address = 0UL; | 305 | *gtf_address = 0UL; |
306 | *obj_loc = 0UL; | 306 | *obj_loc = 0UL; |
307 | 307 | ||
308 | if (noacpi) | 308 | if (libata_noacpi) |
309 | return 0; | 309 | return 0; |
310 | 310 | ||
311 | if (ata_msg_probe(ap)) | 311 | if (ata_msg_probe(ap)) |
@@ -531,7 +531,7 @@ static int do_drive_set_taskfiles(struct ata_port *ap, | |||
531 | ata_dev_printk(atadev, KERN_DEBUG, "%s: ENTER: port#: %d\n", | 531 | ata_dev_printk(atadev, KERN_DEBUG, "%s: ENTER: port#: %d\n", |
532 | __FUNCTION__, ap->port_no); | 532 | __FUNCTION__, ap->port_no); |
533 | 533 | ||
534 | if (noacpi || !(ap->cbl == ATA_CBL_SATA)) | 534 | if (libata_noacpi || !(ap->cbl == ATA_CBL_SATA)) |
535 | return 0; | 535 | return 0; |
536 | 536 | ||
537 | if (!ata_dev_enabled(atadev) || (ap->flags & ATA_FLAG_DISABLED)) | 537 | if (!ata_dev_enabled(atadev) || (ap->flags & ATA_FLAG_DISABLED)) |
@@ -574,7 +574,7 @@ int ata_acpi_exec_tfs(struct ata_port *ap) | |||
574 | unsigned long gtf_address; | 574 | unsigned long gtf_address; |
575 | unsigned long obj_loc; | 575 | unsigned long obj_loc; |
576 | 576 | ||
577 | if (noacpi) | 577 | if (libata_noacpi) |
578 | return 0; | 578 | return 0; |
579 | /* | 579 | /* |
580 | * TBD - implement PATA support. For now, | 580 | * TBD - implement PATA support. For now, |
@@ -636,7 +636,7 @@ int ata_acpi_push_id(struct ata_port *ap, unsigned int ix) | |||
636 | struct acpi_object_list input; | 636 | struct acpi_object_list input; |
637 | union acpi_object in_params[1]; | 637 | union acpi_object in_params[1]; |
638 | 638 | ||
639 | if (noacpi) | 639 | if (libata_noacpi) |
640 | return 0; | 640 | return 0; |
641 | 641 | ||
642 | if (ata_msg_probe(ap)) | 642 | if (ata_msg_probe(ap)) |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index bf327d473ce9..f1f595f53d95 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -93,8 +93,8 @@ static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ; | |||
93 | module_param(ata_probe_timeout, int, 0444); | 93 | module_param(ata_probe_timeout, int, 0444); |
94 | MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)"); | 94 | MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)"); |
95 | 95 | ||
96 | int noacpi; | 96 | int libata_noacpi = 1; |
97 | module_param(noacpi, int, 0444); | 97 | module_param_named(noacpi, libata_noacpi, int, 0444); |
98 | MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set"); | 98 | MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set"); |
99 | 99 | ||
100 | MODULE_AUTHOR("Jeff Garzik"); | 100 | MODULE_AUTHOR("Jeff Garzik"); |
@@ -3359,6 +3359,8 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
3359 | { "WDC WD740ADFD-00", NULL, ATA_HORKAGE_NONCQ }, | 3359 | { "WDC WD740ADFD-00", NULL, ATA_HORKAGE_NONCQ }, |
3360 | /* http://thread.gmane.org/gmane.linux.ide/14907 */ | 3360 | /* http://thread.gmane.org/gmane.linux.ide/14907 */ |
3361 | { "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ }, | 3361 | { "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ }, |
3362 | /* NCQ is broken */ | ||
3363 | { "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ }, | ||
3362 | 3364 | ||
3363 | /* Devices with NCQ limits */ | 3365 | /* Devices with NCQ limits */ |
3364 | 3366 | ||
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 361953a50203..c89664a77a9c 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1743,12 +1743,17 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap, | |||
1743 | { | 1743 | { |
1744 | struct ata_eh_context *ehc = &ap->eh_context; | 1744 | struct ata_eh_context *ehc = &ap->eh_context; |
1745 | struct ata_device *dev; | 1745 | struct ata_device *dev; |
1746 | unsigned int new_mask = 0; | ||
1746 | unsigned long flags; | 1747 | unsigned long flags; |
1747 | int i, rc = 0; | 1748 | int i, rc = 0; |
1748 | 1749 | ||
1749 | DPRINTK("ENTER\n"); | 1750 | DPRINTK("ENTER\n"); |
1750 | 1751 | ||
1751 | for (i = 0; i < ATA_MAX_DEVICES; i++) { | 1752 | /* For PATA drive side cable detection to work, IDENTIFY must |
1753 | * be done backwards such that PDIAG- is released by the slave | ||
1754 | * device before the master device is identified. | ||
1755 | */ | ||
1756 | for (i = ATA_MAX_DEVICES - 1; i >= 0; i--) { | ||
1752 | unsigned int action, readid_flags = 0; | 1757 | unsigned int action, readid_flags = 0; |
1753 | 1758 | ||
1754 | dev = &ap->device[i]; | 1759 | dev = &ap->device[i]; |
@@ -1760,13 +1765,13 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap, | |||
1760 | if (action & ATA_EH_REVALIDATE && ata_dev_ready(dev)) { | 1765 | if (action & ATA_EH_REVALIDATE && ata_dev_ready(dev)) { |
1761 | if (ata_port_offline(ap)) { | 1766 | if (ata_port_offline(ap)) { |
1762 | rc = -EIO; | 1767 | rc = -EIO; |
1763 | break; | 1768 | goto err; |
1764 | } | 1769 | } |
1765 | 1770 | ||
1766 | ata_eh_about_to_do(ap, dev, ATA_EH_REVALIDATE); | 1771 | ata_eh_about_to_do(ap, dev, ATA_EH_REVALIDATE); |
1767 | rc = ata_dev_revalidate(dev, readid_flags); | 1772 | rc = ata_dev_revalidate(dev, readid_flags); |
1768 | if (rc) | 1773 | if (rc) |
1769 | break; | 1774 | goto err; |
1770 | 1775 | ||
1771 | ata_eh_done(ap, dev, ATA_EH_REVALIDATE); | 1776 | ata_eh_done(ap, dev, ATA_EH_REVALIDATE); |
1772 | 1777 | ||
@@ -1784,40 +1789,53 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap, | |||
1784 | 1789 | ||
1785 | rc = ata_dev_read_id(dev, &dev->class, readid_flags, | 1790 | rc = ata_dev_read_id(dev, &dev->class, readid_flags, |
1786 | dev->id); | 1791 | dev->id); |
1787 | if (rc == 0) { | 1792 | switch (rc) { |
1788 | ehc->i.flags |= ATA_EHI_PRINTINFO; | 1793 | case 0: |
1789 | rc = ata_dev_configure(dev); | 1794 | new_mask |= 1 << i; |
1790 | ehc->i.flags &= ~ATA_EHI_PRINTINFO; | 1795 | break; |
1791 | } else if (rc == -ENOENT) { | 1796 | case -ENOENT: |
1792 | /* IDENTIFY was issued to non-existent | 1797 | /* IDENTIFY was issued to non-existent |
1793 | * device. No need to reset. Just | 1798 | * device. No need to reset. Just |
1794 | * thaw and kill the device. | 1799 | * thaw and kill the device. |
1795 | */ | 1800 | */ |
1796 | ata_eh_thaw_port(ap); | 1801 | ata_eh_thaw_port(ap); |
1797 | dev->class = ATA_DEV_UNKNOWN; | 1802 | dev->class = ATA_DEV_UNKNOWN; |
1798 | rc = 0; | ||
1799 | } | ||
1800 | |||
1801 | if (rc) { | ||
1802 | dev->class = ATA_DEV_UNKNOWN; | ||
1803 | break; | 1803 | break; |
1804 | default: | ||
1805 | dev->class = ATA_DEV_UNKNOWN; | ||
1806 | goto err; | ||
1804 | } | 1807 | } |
1808 | } | ||
1809 | } | ||
1805 | 1810 | ||
1806 | if (ata_dev_enabled(dev)) { | 1811 | /* Configure new devices forward such that user doesn't see |
1807 | spin_lock_irqsave(ap->lock, flags); | 1812 | * device detection messages backwards. |
1808 | ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG; | 1813 | */ |
1809 | spin_unlock_irqrestore(ap->lock, flags); | 1814 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
1815 | dev = &ap->device[i]; | ||
1810 | 1816 | ||
1811 | /* new device discovered, configure xfermode */ | 1817 | if (!(new_mask & (1 << i))) |
1812 | ehc->i.flags |= ATA_EHI_SETMODE; | 1818 | continue; |
1813 | } | 1819 | |
1814 | } | 1820 | ehc->i.flags |= ATA_EHI_PRINTINFO; |
1821 | rc = ata_dev_configure(dev); | ||
1822 | ehc->i.flags &= ~ATA_EHI_PRINTINFO; | ||
1823 | if (rc) | ||
1824 | goto err; | ||
1825 | |||
1826 | spin_lock_irqsave(ap->lock, flags); | ||
1827 | ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG; | ||
1828 | spin_unlock_irqrestore(ap->lock, flags); | ||
1829 | |||
1830 | /* new device discovered, configure xfermode */ | ||
1831 | ehc->i.flags |= ATA_EHI_SETMODE; | ||
1815 | } | 1832 | } |
1816 | 1833 | ||
1817 | if (rc) | 1834 | return 0; |
1818 | *r_failed_dev = dev; | ||
1819 | 1835 | ||
1820 | DPRINTK("EXIT\n"); | 1836 | err: |
1837 | *r_failed_dev = dev; | ||
1838 | DPRINTK("EXIT rc=%d\n", rc); | ||
1821 | return rc; | 1839 | return rc; |
1822 | } | 1840 | } |
1823 | 1841 | ||
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index c42671493e8c..1f1e3a51f859 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -56,7 +56,7 @@ extern struct workqueue_struct *ata_aux_wq; | |||
56 | extern int atapi_enabled; | 56 | extern int atapi_enabled; |
57 | extern int atapi_dmadir; | 57 | extern int atapi_dmadir; |
58 | extern int libata_fua; | 58 | extern int libata_fua; |
59 | extern int noacpi; | 59 | extern int libata_noacpi; |
60 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); | 60 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); |
61 | extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, | 61 | extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, |
62 | u64 block, u32 n_block, unsigned int tf_flags, | 62 | u64 block, u32 n_block, unsigned int tf_flags, |
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c index acdc52cbe38a..0a1493398913 100644 --- a/drivers/ata/pata_pdc202xx_old.c +++ b/drivers/ata/pata_pdc202xx_old.c | |||
@@ -195,7 +195,7 @@ static void pdc2026x_bmdma_start(struct ata_queued_cmd *qc) | |||
195 | /* Cases the state machine will not complete correctly without help */ | 195 | /* Cases the state machine will not complete correctly without help */ |
196 | if ((tf->flags & ATA_TFLAG_LBA48) || tf->protocol == ATA_PROT_ATAPI_DMA) | 196 | if ((tf->flags & ATA_TFLAG_LBA48) || tf->protocol == ATA_PROT_ATAPI_DMA) |
197 | { | 197 | { |
198 | len = qc->nbytes; | 198 | len = qc->nbytes / 2; |
199 | 199 | ||
200 | if (tf->flags & ATA_TFLAG_WRITE) | 200 | if (tf->flags & ATA_TFLAG_WRITE) |
201 | len |= 0x06000000; | 201 | len |= 0x06000000; |
diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c index 337bbcdcf13d..8ea02755b1c9 100644 --- a/drivers/char/generic_serial.c +++ b/drivers/char/generic_serial.c | |||
@@ -710,12 +710,6 @@ void gs_close(struct tty_struct * tty, struct file * filp) | |||
710 | } | 710 | } |
711 | 711 | ||
712 | 712 | ||
713 | static unsigned int gs_baudrates[] = { | ||
714 | 0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, | ||
715 | 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 | ||
716 | }; | ||
717 | |||
718 | |||
719 | void gs_set_termios (struct tty_struct * tty, | 713 | void gs_set_termios (struct tty_struct * tty, |
720 | struct ktermios * old_termios) | 714 | struct ktermios * old_termios) |
721 | { | 715 | { |
@@ -771,7 +765,6 @@ void gs_set_termios (struct tty_struct * tty, | |||
771 | 765 | ||
772 | baudrate = tty_get_baud_rate(tty); | 766 | baudrate = tty_get_baud_rate(tty); |
773 | 767 | ||
774 | baudrate = gs_baudrates[baudrate]; | ||
775 | if ((tiosp->c_cflag & CBAUD) == B38400) { | 768 | if ((tiosp->c_cflag & CBAUD) == B38400) { |
776 | if ( (port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) | 769 | if ( (port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) |
777 | baudrate = 57600; | 770 | baudrate = 57600; |
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c index d42060ede930..5ac309ee7f05 100644 --- a/drivers/clocksource/acpi_pm.c +++ b/drivers/clocksource/acpi_pm.c | |||
@@ -90,7 +90,7 @@ __setup("acpi_pm_good", acpi_pm_good_setup); | |||
90 | static inline void acpi_pm_need_workaround(void) | 90 | static inline void acpi_pm_need_workaround(void) |
91 | { | 91 | { |
92 | clocksource_acpi_pm.read = acpi_pm_read_slow; | 92 | clocksource_acpi_pm.read = acpi_pm_read_slow; |
93 | clocksource_acpi_pm.rating = 110; | 93 | clocksource_acpi_pm.rating = 120; |
94 | } | 94 | } |
95 | 95 | ||
96 | /* | 96 | /* |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index f52facc570f5..3162010900c9 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1015,6 +1015,10 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev) | |||
1015 | { | 1015 | { |
1016 | unsigned int cpu = sys_dev->id; | 1016 | unsigned int cpu = sys_dev->id; |
1017 | int retval; | 1017 | int retval; |
1018 | |||
1019 | if (cpu_is_offline(cpu)) | ||
1020 | return 0; | ||
1021 | |||
1018 | if (unlikely(lock_policy_rwsem_write(cpu))) | 1022 | if (unlikely(lock_policy_rwsem_write(cpu))) |
1019 | BUG(); | 1023 | BUG(); |
1020 | 1024 | ||
diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c index 9e913629ef39..74edb1d0110f 100644 --- a/drivers/eisa/pci_eisa.c +++ b/drivers/eisa/pci_eisa.c | |||
@@ -19,8 +19,8 @@ | |||
19 | /* There is only *one* pci_eisa device per machine, right ? */ | 19 | /* There is only *one* pci_eisa device per machine, right ? */ |
20 | static struct eisa_root_device pci_eisa_root; | 20 | static struct eisa_root_device pci_eisa_root; |
21 | 21 | ||
22 | static int __devinit pci_eisa_init (struct pci_dev *pdev, | 22 | static int __init pci_eisa_init(struct pci_dev *pdev, |
23 | const struct pci_device_id *ent) | 23 | const struct pci_device_id *ent) |
24 | { | 24 | { |
25 | int rc; | 25 | int rc; |
26 | 26 | ||
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c index 818cf1aee8c7..f5e9aeec6f6e 100644 --- a/drivers/infiniband/hw/cxgb3/cxio_hal.c +++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c | |||
@@ -498,9 +498,9 @@ static int cxio_hal_init_ctrl_qp(struct cxio_rdev *rdev_p) | |||
498 | u64 sge_cmd, ctx0, ctx1; | 498 | u64 sge_cmd, ctx0, ctx1; |
499 | u64 base_addr; | 499 | u64 base_addr; |
500 | struct t3_modify_qp_wr *wqe; | 500 | struct t3_modify_qp_wr *wqe; |
501 | struct sk_buff *skb = alloc_skb(sizeof(*wqe), GFP_KERNEL); | 501 | struct sk_buff *skb; |
502 | |||
503 | 502 | ||
503 | skb = alloc_skb(sizeof(*wqe), GFP_KERNEL); | ||
504 | if (!skb) { | 504 | if (!skb) { |
505 | PDBG("%s alloc_skb failed\n", __FUNCTION__); | 505 | PDBG("%s alloc_skb failed\n", __FUNCTION__); |
506 | return -ENOMEM; | 506 | return -ENOMEM; |
@@ -508,7 +508,7 @@ static int cxio_hal_init_ctrl_qp(struct cxio_rdev *rdev_p) | |||
508 | err = cxio_hal_init_ctrl_cq(rdev_p); | 508 | err = cxio_hal_init_ctrl_cq(rdev_p); |
509 | if (err) { | 509 | if (err) { |
510 | PDBG("%s err %d initializing ctrl_cq\n", __FUNCTION__, err); | 510 | PDBG("%s err %d initializing ctrl_cq\n", __FUNCTION__, err); |
511 | return err; | 511 | goto err; |
512 | } | 512 | } |
513 | rdev_p->ctrl_qp.workq = dma_alloc_coherent( | 513 | rdev_p->ctrl_qp.workq = dma_alloc_coherent( |
514 | &(rdev_p->rnic_info.pdev->dev), | 514 | &(rdev_p->rnic_info.pdev->dev), |
@@ -518,7 +518,8 @@ static int cxio_hal_init_ctrl_qp(struct cxio_rdev *rdev_p) | |||
518 | GFP_KERNEL); | 518 | GFP_KERNEL); |
519 | if (!rdev_p->ctrl_qp.workq) { | 519 | if (!rdev_p->ctrl_qp.workq) { |
520 | PDBG("%s dma_alloc_coherent failed\n", __FUNCTION__); | 520 | PDBG("%s dma_alloc_coherent failed\n", __FUNCTION__); |
521 | return -ENOMEM; | 521 | err = -ENOMEM; |
522 | goto err; | ||
522 | } | 523 | } |
523 | pci_unmap_addr_set(&rdev_p->ctrl_qp, mapping, | 524 | pci_unmap_addr_set(&rdev_p->ctrl_qp, mapping, |
524 | rdev_p->ctrl_qp.dma_addr); | 525 | rdev_p->ctrl_qp.dma_addr); |
@@ -556,6 +557,9 @@ static int cxio_hal_init_ctrl_qp(struct cxio_rdev *rdev_p) | |||
556 | rdev_p->ctrl_qp.workq, 1 << T3_CTRL_QP_SIZE_LOG2); | 557 | rdev_p->ctrl_qp.workq, 1 << T3_CTRL_QP_SIZE_LOG2); |
557 | skb->priority = CPL_PRIORITY_CONTROL; | 558 | skb->priority = CPL_PRIORITY_CONTROL; |
558 | return (cxgb3_ofld_send(rdev_p->t3cdev_p, skb)); | 559 | return (cxgb3_ofld_send(rdev_p->t3cdev_p, skb)); |
560 | err: | ||
561 | kfree_skb(skb); | ||
562 | return err; | ||
559 | } | 563 | } |
560 | 564 | ||
561 | static int cxio_hal_destroy_ctrl_qp(struct cxio_rdev *rdev_p) | 565 | static int cxio_hal_destroy_ctrl_qp(struct cxio_rdev *rdev_p) |
diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c index 8e4846b5c641..fdb576dcfaa8 100644 --- a/drivers/infiniband/hw/mthca/mthca_mr.c +++ b/drivers/infiniband/hw/mthca/mthca_mr.c | |||
@@ -881,8 +881,8 @@ int mthca_init_mr_table(struct mthca_dev *dev) | |||
881 | } | 881 | } |
882 | mpts = mtts = 1 << i; | 882 | mpts = mtts = 1 << i; |
883 | } else { | 883 | } else { |
884 | mpts = dev->limits.num_mtt_segs; | 884 | mtts = dev->limits.num_mtt_segs; |
885 | mtts = dev->limits.num_mpts; | 885 | mpts = dev->limits.num_mpts; |
886 | } | 886 | } |
887 | 887 | ||
888 | if (!mthca_is_memfree(dev) && | 888 | if (!mthca_is_memfree(dev) && |
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c index 89e37283c836..278fcbccc2d9 100644 --- a/drivers/infiniband/ulp/iser/iser_initiator.c +++ b/drivers/infiniband/ulp/iser/iser_initiator.c | |||
@@ -658,6 +658,7 @@ void iser_ctask_rdma_finalize(struct iscsi_iser_cmd_task *iser_ctask) | |||
658 | { | 658 | { |
659 | int deferred; | 659 | int deferred; |
660 | int is_rdma_aligned = 1; | 660 | int is_rdma_aligned = 1; |
661 | struct iser_regd_buf *regd; | ||
661 | 662 | ||
662 | /* if we were reading, copy back to unaligned sglist, | 663 | /* if we were reading, copy back to unaligned sglist, |
663 | * anyway dma_unmap and free the copy | 664 | * anyway dma_unmap and free the copy |
@@ -672,20 +673,20 @@ void iser_ctask_rdma_finalize(struct iscsi_iser_cmd_task *iser_ctask) | |||
672 | } | 673 | } |
673 | 674 | ||
674 | if (iser_ctask->dir[ISER_DIR_IN]) { | 675 | if (iser_ctask->dir[ISER_DIR_IN]) { |
675 | deferred = iser_regd_buff_release | 676 | regd = &iser_ctask->rdma_regd[ISER_DIR_IN]; |
676 | (&iser_ctask->rdma_regd[ISER_DIR_IN]); | 677 | deferred = iser_regd_buff_release(regd); |
677 | if (deferred) { | 678 | if (deferred) { |
678 | iser_err("References remain for BUF-IN rdma reg\n"); | 679 | iser_err("%d references remain for BUF-IN rdma reg\n", |
679 | BUG(); | 680 | atomic_read(®d->ref_count)); |
680 | } | 681 | } |
681 | } | 682 | } |
682 | 683 | ||
683 | if (iser_ctask->dir[ISER_DIR_OUT]) { | 684 | if (iser_ctask->dir[ISER_DIR_OUT]) { |
684 | deferred = iser_regd_buff_release | 685 | regd = &iser_ctask->rdma_regd[ISER_DIR_OUT]; |
685 | (&iser_ctask->rdma_regd[ISER_DIR_OUT]); | 686 | deferred = iser_regd_buff_release(regd); |
686 | if (deferred) { | 687 | if (deferred) { |
687 | iser_err("References remain for BUF-OUT rdma reg\n"); | 688 | iser_err("%d references remain for BUF-OUT rdma reg\n", |
688 | BUG(); | 689 | atomic_read(®d->ref_count)); |
689 | } | 690 | } |
690 | } | 691 | } |
691 | 692 | ||
diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c index 9df9e3548cf1..c547a6665052 100644 --- a/drivers/isdn/hisax/isar.c +++ b/drivers/isdn/hisax/isar.c | |||
@@ -440,7 +440,7 @@ isar_bh(struct work_struct *work) | |||
440 | { | 440 | { |
441 | struct BCState *bcs = container_of(work, struct BCState, tqueue); | 441 | struct BCState *bcs = container_of(work, struct BCState, tqueue); |
442 | 442 | ||
443 | BChannel_bh(bcs); | 443 | BChannel_bh(work); |
444 | if (test_and_clear_bit(B_LL_NOCARRIER, &bcs->event)) | 444 | if (test_and_clear_bit(B_LL_NOCARRIER, &bcs->event)) |
445 | ll_deliver_faxstat(bcs, ISDN_FAX_CLASS1_NOCARR); | 445 | ll_deliver_faxstat(bcs, ISDN_FAX_CLASS1_NOCARR); |
446 | if (test_and_clear_bit(B_LL_CONNECT, &bcs->event)) | 446 | if (test_and_clear_bit(B_LL_CONNECT, &bcs->event)) |
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index bfa0ce42ea92..fbbf9d6b299f 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -618,7 +618,7 @@ static void fix_pmode_dataseg(int seg, struct kvm_save_segment *save) | |||
618 | { | 618 | { |
619 | struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; | 619 | struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; |
620 | 620 | ||
621 | if (vmcs_readl(sf->base) == save->base) { | 621 | if (vmcs_readl(sf->base) == save->base && (save->base & AR_S_MASK)) { |
622 | vmcs_write16(sf->selector, save->selector); | 622 | vmcs_write16(sf->selector, save->selector); |
623 | vmcs_writel(sf->base, save->base); | 623 | vmcs_writel(sf->base, save->base); |
624 | vmcs_write32(sf->limit, save->limit); | 624 | vmcs_write32(sf->limit, save->limit); |
@@ -1888,6 +1888,27 @@ again: | |||
1888 | [cr2]"i"(offsetof(struct kvm_vcpu, cr2)) | 1888 | [cr2]"i"(offsetof(struct kvm_vcpu, cr2)) |
1889 | : "cc", "memory" ); | 1889 | : "cc", "memory" ); |
1890 | 1890 | ||
1891 | /* | ||
1892 | * Reload segment selectors ASAP. (it's needed for a functional | ||
1893 | * kernel: x86 relies on having __KERNEL_PDA in %fs and x86_64 | ||
1894 | * relies on having 0 in %gs for the CPU PDA to work.) | ||
1895 | */ | ||
1896 | if (fs_gs_ldt_reload_needed) { | ||
1897 | load_ldt(ldt_sel); | ||
1898 | load_fs(fs_sel); | ||
1899 | /* | ||
1900 | * If we have to reload gs, we must take care to | ||
1901 | * preserve our gs base. | ||
1902 | */ | ||
1903 | local_irq_disable(); | ||
1904 | load_gs(gs_sel); | ||
1905 | #ifdef CONFIG_X86_64 | ||
1906 | wrmsrl(MSR_GS_BASE, vmcs_readl(HOST_GS_BASE)); | ||
1907 | #endif | ||
1908 | local_irq_enable(); | ||
1909 | |||
1910 | reload_tss(); | ||
1911 | } | ||
1891 | ++kvm_stat.exits; | 1912 | ++kvm_stat.exits; |
1892 | 1913 | ||
1893 | save_msrs(vcpu->guest_msrs, NR_BAD_MSRS); | 1914 | save_msrs(vcpu->guest_msrs, NR_BAD_MSRS); |
@@ -1905,22 +1926,6 @@ again: | |||
1905 | kvm_run->exit_reason = vmcs_read32(VM_INSTRUCTION_ERROR); | 1926 | kvm_run->exit_reason = vmcs_read32(VM_INSTRUCTION_ERROR); |
1906 | r = 0; | 1927 | r = 0; |
1907 | } else { | 1928 | } else { |
1908 | if (fs_gs_ldt_reload_needed) { | ||
1909 | load_ldt(ldt_sel); | ||
1910 | load_fs(fs_sel); | ||
1911 | /* | ||
1912 | * If we have to reload gs, we must take care to | ||
1913 | * preserve our gs base. | ||
1914 | */ | ||
1915 | local_irq_disable(); | ||
1916 | load_gs(gs_sel); | ||
1917 | #ifdef CONFIG_X86_64 | ||
1918 | wrmsrl(MSR_GS_BASE, vmcs_readl(HOST_GS_BASE)); | ||
1919 | #endif | ||
1920 | local_irq_enable(); | ||
1921 | |||
1922 | reload_tss(); | ||
1923 | } | ||
1924 | /* | 1929 | /* |
1925 | * Profile KVM exit RIPs: | 1930 | * Profile KVM exit RIPs: |
1926 | */ | 1931 | */ |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 6c06e825cff5..2a9b6a07e3a2 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1318,6 +1318,7 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev) | |||
1318 | char b[BDEVNAME_SIZE]; | 1318 | char b[BDEVNAME_SIZE]; |
1319 | struct kobject *ko; | 1319 | struct kobject *ko; |
1320 | char *s; | 1320 | char *s; |
1321 | int err; | ||
1321 | 1322 | ||
1322 | if (rdev->mddev) { | 1323 | if (rdev->mddev) { |
1323 | MD_BUG(); | 1324 | MD_BUG(); |
@@ -1352,20 +1353,29 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev) | |||
1352 | while ( (s=strchr(rdev->kobj.k_name, '/')) != NULL) | 1353 | while ( (s=strchr(rdev->kobj.k_name, '/')) != NULL) |
1353 | *s = '!'; | 1354 | *s = '!'; |
1354 | 1355 | ||
1355 | list_add(&rdev->same_set, &mddev->disks); | ||
1356 | rdev->mddev = mddev; | 1356 | rdev->mddev = mddev; |
1357 | printk(KERN_INFO "md: bind<%s>\n", b); | 1357 | printk(KERN_INFO "md: bind<%s>\n", b); |
1358 | 1358 | ||
1359 | rdev->kobj.parent = &mddev->kobj; | 1359 | rdev->kobj.parent = &mddev->kobj; |
1360 | kobject_add(&rdev->kobj); | 1360 | if ((err = kobject_add(&rdev->kobj))) |
1361 | goto fail; | ||
1361 | 1362 | ||
1362 | if (rdev->bdev->bd_part) | 1363 | if (rdev->bdev->bd_part) |
1363 | ko = &rdev->bdev->bd_part->kobj; | 1364 | ko = &rdev->bdev->bd_part->kobj; |
1364 | else | 1365 | else |
1365 | ko = &rdev->bdev->bd_disk->kobj; | 1366 | ko = &rdev->bdev->bd_disk->kobj; |
1366 | sysfs_create_link(&rdev->kobj, ko, "block"); | 1367 | if ((err = sysfs_create_link(&rdev->kobj, ko, "block"))) { |
1368 | kobject_del(&rdev->kobj); | ||
1369 | goto fail; | ||
1370 | } | ||
1371 | list_add(&rdev->same_set, &mddev->disks); | ||
1367 | bd_claim_by_disk(rdev->bdev, rdev, mddev->gendisk); | 1372 | bd_claim_by_disk(rdev->bdev, rdev, mddev->gendisk); |
1368 | return 0; | 1373 | return 0; |
1374 | |||
1375 | fail: | ||
1376 | printk(KERN_WARNING "md: failed to register dev-%s for %s\n", | ||
1377 | b, mdname(mddev)); | ||
1378 | return err; | ||
1369 | } | 1379 | } |
1370 | 1380 | ||
1371 | static void unbind_rdev_from_array(mdk_rdev_t * rdev) | 1381 | static void unbind_rdev_from_array(mdk_rdev_t * rdev) |
@@ -2966,7 +2976,9 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data) | |||
2966 | mddev->kobj.k_name = NULL; | 2976 | mddev->kobj.k_name = NULL; |
2967 | snprintf(mddev->kobj.name, KOBJ_NAME_LEN, "%s", "md"); | 2977 | snprintf(mddev->kobj.name, KOBJ_NAME_LEN, "%s", "md"); |
2968 | mddev->kobj.ktype = &md_ktype; | 2978 | mddev->kobj.ktype = &md_ktype; |
2969 | kobject_register(&mddev->kobj); | 2979 | if (kobject_register(&mddev->kobj)) |
2980 | printk(KERN_WARNING "md: cannot register %s/md - name in use\n", | ||
2981 | disk->disk_name); | ||
2970 | return NULL; | 2982 | return NULL; |
2971 | } | 2983 | } |
2972 | 2984 | ||
@@ -3144,9 +3156,12 @@ static int do_md_run(mddev_t * mddev) | |||
3144 | bitmap_destroy(mddev); | 3156 | bitmap_destroy(mddev); |
3145 | return err; | 3157 | return err; |
3146 | } | 3158 | } |
3147 | if (mddev->pers->sync_request) | 3159 | if (mddev->pers->sync_request) { |
3148 | sysfs_create_group(&mddev->kobj, &md_redundancy_group); | 3160 | if (sysfs_create_group(&mddev->kobj, &md_redundancy_group)) |
3149 | else if (mddev->ro == 2) /* auto-readonly not meaningful */ | 3161 | printk(KERN_WARNING |
3162 | "md: cannot register extra attributes for %s\n", | ||
3163 | mdname(mddev)); | ||
3164 | } else if (mddev->ro == 2) /* auto-readonly not meaningful */ | ||
3150 | mddev->ro = 0; | 3165 | mddev->ro = 0; |
3151 | 3166 | ||
3152 | atomic_set(&mddev->writes_pending,0); | 3167 | atomic_set(&mddev->writes_pending,0); |
@@ -3160,7 +3175,9 @@ static int do_md_run(mddev_t * mddev) | |||
3160 | if (rdev->raid_disk >= 0) { | 3175 | if (rdev->raid_disk >= 0) { |
3161 | char nm[20]; | 3176 | char nm[20]; |
3162 | sprintf(nm, "rd%d", rdev->raid_disk); | 3177 | sprintf(nm, "rd%d", rdev->raid_disk); |
3163 | sysfs_create_link(&mddev->kobj, &rdev->kobj, nm); | 3178 | if (sysfs_create_link(&mddev->kobj, &rdev->kobj, nm)) |
3179 | printk("md: cannot register %s for %s\n", | ||
3180 | nm, mdname(mddev)); | ||
3164 | } | 3181 | } |
3165 | 3182 | ||
3166 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 3183 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
@@ -3325,6 +3342,7 @@ static int do_md_stop(mddev_t * mddev, int mode) | |||
3325 | mddev->queue->merge_bvec_fn = NULL; | 3342 | mddev->queue->merge_bvec_fn = NULL; |
3326 | mddev->queue->unplug_fn = NULL; | 3343 | mddev->queue->unplug_fn = NULL; |
3327 | mddev->queue->issue_flush_fn = NULL; | 3344 | mddev->queue->issue_flush_fn = NULL; |
3345 | mddev->queue->backing_dev_info.congested_fn = NULL; | ||
3328 | if (mddev->pers->sync_request) | 3346 | if (mddev->pers->sync_request) |
3329 | sysfs_remove_group(&mddev->kobj, &md_redundancy_group); | 3347 | sysfs_remove_group(&mddev->kobj, &md_redundancy_group); |
3330 | 3348 | ||
@@ -5385,8 +5403,12 @@ static int remove_and_add_spares(mddev_t *mddev) | |||
5385 | if (mddev->pers->hot_add_disk(mddev,rdev)) { | 5403 | if (mddev->pers->hot_add_disk(mddev,rdev)) { |
5386 | char nm[20]; | 5404 | char nm[20]; |
5387 | sprintf(nm, "rd%d", rdev->raid_disk); | 5405 | sprintf(nm, "rd%d", rdev->raid_disk); |
5388 | sysfs_create_link(&mddev->kobj, | 5406 | if (sysfs_create_link(&mddev->kobj, |
5389 | &rdev->kobj, nm); | 5407 | &rdev->kobj, nm)) |
5408 | printk(KERN_WARNING | ||
5409 | "md: cannot register " | ||
5410 | "%s for %s\n", | ||
5411 | nm, mdname(mddev)); | ||
5390 | spares++; | 5412 | spares++; |
5391 | md_new_event(mddev); | 5413 | md_new_event(mddev); |
5392 | } else | 5414 | } else |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 54a1ad5eef42..8d59914f2057 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -3642,12 +3642,15 @@ static int run(mddev_t *mddev) | |||
3642 | } | 3642 | } |
3643 | 3643 | ||
3644 | /* Ok, everything is just fine now */ | 3644 | /* Ok, everything is just fine now */ |
3645 | sysfs_create_group(&mddev->kobj, &raid5_attrs_group); | 3645 | if (sysfs_create_group(&mddev->kobj, &raid5_attrs_group)) |
3646 | printk(KERN_WARNING | ||
3647 | "raid5: failed to create sysfs attributes for %s\n", | ||
3648 | mdname(mddev)); | ||
3646 | 3649 | ||
3647 | mddev->queue->unplug_fn = raid5_unplug_device; | 3650 | mddev->queue->unplug_fn = raid5_unplug_device; |
3648 | mddev->queue->issue_flush_fn = raid5_issue_flush; | 3651 | mddev->queue->issue_flush_fn = raid5_issue_flush; |
3649 | mddev->queue->backing_dev_info.congested_fn = raid5_congested; | ||
3650 | mddev->queue->backing_dev_info.congested_data = mddev; | 3652 | mddev->queue->backing_dev_info.congested_data = mddev; |
3653 | mddev->queue->backing_dev_info.congested_fn = raid5_congested; | ||
3651 | 3654 | ||
3652 | mddev->array_size = mddev->size * (conf->previous_raid_disks - | 3655 | mddev->array_size = mddev->size * (conf->previous_raid_disks - |
3653 | conf->max_degraded); | 3656 | conf->max_degraded); |
@@ -3678,6 +3681,7 @@ static int stop(mddev_t *mddev) | |||
3678 | mddev->thread = NULL; | 3681 | mddev->thread = NULL; |
3679 | shrink_stripes(conf); | 3682 | shrink_stripes(conf); |
3680 | kfree(conf->stripe_hashtbl); | 3683 | kfree(conf->stripe_hashtbl); |
3684 | mddev->queue->backing_dev_info.congested_fn = NULL; | ||
3681 | blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ | 3685 | blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/ |
3682 | sysfs_remove_group(&mddev->kobj, &raid5_attrs_group); | 3686 | sysfs_remove_group(&mddev->kobj, &raid5_attrs_group); |
3683 | kfree(conf->disks); | 3687 | kfree(conf->disks); |
@@ -3950,7 +3954,12 @@ static int raid5_start_reshape(mddev_t *mddev) | |||
3950 | added_devices++; | 3954 | added_devices++; |
3951 | rdev->recovery_offset = 0; | 3955 | rdev->recovery_offset = 0; |
3952 | sprintf(nm, "rd%d", rdev->raid_disk); | 3956 | sprintf(nm, "rd%d", rdev->raid_disk); |
3953 | sysfs_create_link(&mddev->kobj, &rdev->kobj, nm); | 3957 | if (sysfs_create_link(&mddev->kobj, |
3958 | &rdev->kobj, nm)) | ||
3959 | printk(KERN_WARNING | ||
3960 | "raid5: failed to create " | ||
3961 | " link %s for %s\n", | ||
3962 | nm, mdname(mddev)); | ||
3954 | } else | 3963 | } else |
3955 | break; | 3964 | break; |
3956 | } | 3965 | } |
@@ -4104,6 +4113,10 @@ static struct mdk_personality raid4_personality = | |||
4104 | .spare_active = raid5_spare_active, | 4113 | .spare_active = raid5_spare_active, |
4105 | .sync_request = sync_request, | 4114 | .sync_request = sync_request, |
4106 | .resize = raid5_resize, | 4115 | .resize = raid5_resize, |
4116 | #ifdef CONFIG_MD_RAID5_RESHAPE | ||
4117 | .check_reshape = raid5_check_reshape, | ||
4118 | .start_reshape = raid5_start_reshape, | ||
4119 | #endif | ||
4107 | .quiesce = raid5_quiesce, | 4120 | .quiesce = raid5_quiesce, |
4108 | }; | 4121 | }; |
4109 | 4122 | ||
diff --git a/drivers/media/common/ir-functions.c b/drivers/media/common/ir-functions.c index cbf7c0564889..fcb194135627 100644 --- a/drivers/media/common/ir-functions.c +++ b/drivers/media/common/ir-functions.c | |||
@@ -310,13 +310,15 @@ void ir_rc5_timer_end(unsigned long data) | |||
310 | tv.tv_usec - ir->base_time.tv_usec; | 310 | tv.tv_usec - ir->base_time.tv_usec; |
311 | } | 311 | } |
312 | 312 | ||
313 | /* Allow some timmer jitter (RC5 is ~24ms anyway so this is ok) */ | 313 | /* signal we're ready to start a new code */ |
314 | ir->active = 0; | ||
315 | |||
316 | /* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */ | ||
314 | if (gap < 28000) { | 317 | if (gap < 28000) { |
315 | dprintk(1, "ir-common: spurious timer_end\n"); | 318 | dprintk(1, "ir-common: spurious timer_end\n"); |
316 | return; | 319 | return; |
317 | } | 320 | } |
318 | 321 | ||
319 | ir->active = 0; | ||
320 | if (ir->last_bit < 20) { | 322 | if (ir->last_bit < 20) { |
321 | /* ignore spurious codes (caused by light/other remotes) */ | 323 | /* ignore spurious codes (caused by light/other remotes) */ |
322 | dprintk(1, "ir-common: short code: %x\n", ir->code); | 324 | dprintk(1, "ir-common: short code: %x\n", ir->code); |
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c index fc77de45ca4d..a5c0e1a3e6d1 100644 --- a/drivers/media/dvb/dvb-core/dmxdev.c +++ b/drivers/media/dvb/dvb-core/dmxdev.c | |||
@@ -180,8 +180,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file) | |||
180 | struct dvb_device *dvbdev = file->private_data; | 180 | struct dvb_device *dvbdev = file->private_data; |
181 | struct dmxdev *dmxdev = dvbdev->priv; | 181 | struct dmxdev *dmxdev = dvbdev->priv; |
182 | 182 | ||
183 | if (mutex_lock_interruptible(&dmxdev->mutex)) | 183 | mutex_lock(&dmxdev->mutex); |
184 | return -ERESTARTSYS; | ||
185 | 184 | ||
186 | if ((file->f_flags & O_ACCMODE) == O_WRONLY) { | 185 | if ((file->f_flags & O_ACCMODE) == O_WRONLY) { |
187 | dmxdev->demux->disconnect_frontend(dmxdev->demux); | 186 | dmxdev->demux->disconnect_frontend(dmxdev->demux); |
@@ -673,13 +672,8 @@ static int dvb_demux_open(struct inode *inode, struct file *file) | |||
673 | static int dvb_dmxdev_filter_free(struct dmxdev *dmxdev, | 672 | static int dvb_dmxdev_filter_free(struct dmxdev *dmxdev, |
674 | struct dmxdev_filter *dmxdevfilter) | 673 | struct dmxdev_filter *dmxdevfilter) |
675 | { | 674 | { |
676 | if (mutex_lock_interruptible(&dmxdev->mutex)) | 675 | mutex_lock(&dmxdev->mutex); |
677 | return -ERESTARTSYS; | 676 | mutex_lock(&dmxdevfilter->mutex); |
678 | |||
679 | if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { | ||
680 | mutex_unlock(&dmxdev->mutex); | ||
681 | return -ERESTARTSYS; | ||
682 | } | ||
683 | 677 | ||
684 | dvb_dmxdev_filter_stop(dmxdevfilter); | 678 | dvb_dmxdev_filter_stop(dmxdevfilter); |
685 | dvb_dmxdev_filter_reset(dmxdevfilter); | 679 | dvb_dmxdev_filter_reset(dmxdevfilter); |
diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c index fcff5eab21a3..6d8d1c3df863 100644 --- a/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/drivers/media/dvb/dvb-core/dvb_demux.c | |||
@@ -673,8 +673,7 @@ static int dmx_ts_feed_stop_filtering(struct dmx_ts_feed *ts_feed) | |||
673 | struct dvb_demux *demux = feed->demux; | 673 | struct dvb_demux *demux = feed->demux; |
674 | int ret; | 674 | int ret; |
675 | 675 | ||
676 | if (mutex_lock_interruptible(&demux->mutex)) | 676 | mutex_lock(&demux->mutex); |
677 | return -ERESTARTSYS; | ||
678 | 677 | ||
679 | if (feed->state < DMX_STATE_GO) { | 678 | if (feed->state < DMX_STATE_GO) { |
680 | mutex_unlock(&demux->mutex); | 679 | mutex_unlock(&demux->mutex); |
@@ -748,8 +747,7 @@ static int dvbdmx_release_ts_feed(struct dmx_demux *dmx, | |||
748 | struct dvb_demux *demux = (struct dvb_demux *)dmx; | 747 | struct dvb_demux *demux = (struct dvb_demux *)dmx; |
749 | struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed; | 748 | struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed; |
750 | 749 | ||
751 | if (mutex_lock_interruptible(&demux->mutex)) | 750 | mutex_lock(&demux->mutex); |
752 | return -ERESTARTSYS; | ||
753 | 751 | ||
754 | if (feed->state == DMX_STATE_FREE) { | 752 | if (feed->state == DMX_STATE_FREE) { |
755 | mutex_unlock(&demux->mutex); | 753 | mutex_unlock(&demux->mutex); |
@@ -916,8 +914,7 @@ static int dmx_section_feed_stop_filtering(struct dmx_section_feed *feed) | |||
916 | struct dvb_demux *dvbdmx = dvbdmxfeed->demux; | 914 | struct dvb_demux *dvbdmx = dvbdmxfeed->demux; |
917 | int ret; | 915 | int ret; |
918 | 916 | ||
919 | if (mutex_lock_interruptible(&dvbdmx->mutex)) | 917 | mutex_lock(&dvbdmx->mutex); |
920 | return -ERESTARTSYS; | ||
921 | 918 | ||
922 | if (!dvbdmx->stop_feed) { | 919 | if (!dvbdmx->stop_feed) { |
923 | mutex_unlock(&dvbdmx->mutex); | 920 | mutex_unlock(&dvbdmx->mutex); |
@@ -942,8 +939,7 @@ static int dmx_section_feed_release_filter(struct dmx_section_feed *feed, | |||
942 | struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; | 939 | struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; |
943 | struct dvb_demux *dvbdmx = dvbdmxfeed->demux; | 940 | struct dvb_demux *dvbdmx = dvbdmxfeed->demux; |
944 | 941 | ||
945 | if (mutex_lock_interruptible(&dvbdmx->mutex)) | 942 | mutex_lock(&dvbdmx->mutex); |
946 | return -ERESTARTSYS; | ||
947 | 943 | ||
948 | if (dvbdmxfilter->feed != dvbdmxfeed) { | 944 | if (dvbdmxfilter->feed != dvbdmxfeed) { |
949 | mutex_unlock(&dvbdmx->mutex); | 945 | mutex_unlock(&dvbdmx->mutex); |
@@ -1016,8 +1012,7 @@ static int dvbdmx_release_section_feed(struct dmx_demux *demux, | |||
1016 | struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; | 1012 | struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed; |
1017 | struct dvb_demux *dvbdmx = (struct dvb_demux *)demux; | 1013 | struct dvb_demux *dvbdmx = (struct dvb_demux *)demux; |
1018 | 1014 | ||
1019 | if (mutex_lock_interruptible(&dvbdmx->mutex)) | 1015 | mutex_lock(&dvbdmx->mutex); |
1020 | return -ERESTARTSYS; | ||
1021 | 1016 | ||
1022 | if (dvbdmxfeed->state == DMX_STATE_FREE) { | 1017 | if (dvbdmxfeed->state == DMX_STATE_FREE) { |
1023 | mutex_unlock(&dvbdmx->mutex); | 1018 | mutex_unlock(&dvbdmx->mutex); |
@@ -1126,8 +1121,7 @@ static int dvbdmx_connect_frontend(struct dmx_demux *demux, | |||
1126 | if (demux->frontend) | 1121 | if (demux->frontend) |
1127 | return -EINVAL; | 1122 | return -EINVAL; |
1128 | 1123 | ||
1129 | if (mutex_lock_interruptible(&dvbdemux->mutex)) | 1124 | mutex_lock(&dvbdemux->mutex); |
1130 | return -ERESTARTSYS; | ||
1131 | 1125 | ||
1132 | demux->frontend = frontend; | 1126 | demux->frontend = frontend; |
1133 | mutex_unlock(&dvbdemux->mutex); | 1127 | mutex_unlock(&dvbdemux->mutex); |
@@ -1138,8 +1132,7 @@ static int dvbdmx_disconnect_frontend(struct dmx_demux *demux) | |||
1138 | { | 1132 | { |
1139 | struct dvb_demux *dvbdemux = (struct dvb_demux *)demux; | 1133 | struct dvb_demux *dvbdemux = (struct dvb_demux *)demux; |
1140 | 1134 | ||
1141 | if (mutex_lock_interruptible(&dvbdemux->mutex)) | 1135 | mutex_lock(&dvbdemux->mutex); |
1142 | return -ERESTARTSYS; | ||
1143 | 1136 | ||
1144 | demux->frontend = NULL; | 1137 | demux->frontend = NULL; |
1145 | mutex_unlock(&dvbdemux->mutex); | 1138 | mutex_unlock(&dvbdemux->mutex); |
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 490337b5ee3e..14a372a0fe8b 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -203,8 +203,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
203 | 203 | ||
204 | int id; | 204 | int id; |
205 | 205 | ||
206 | if (mutex_lock_interruptible(&dvbdev_register_lock)) | 206 | mutex_lock(&dvbdev_register_lock); |
207 | return -ERESTARTSYS; | ||
208 | 207 | ||
209 | if ((id = dvbdev_get_free_id (adap, type)) < 0){ | 208 | if ((id = dvbdev_get_free_id (adap, type)) < 0){ |
210 | mutex_unlock(&dvbdev_register_lock); | 209 | mutex_unlock(&dvbdev_register_lock); |
@@ -294,8 +293,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu | |||
294 | { | 293 | { |
295 | int num; | 294 | int num; |
296 | 295 | ||
297 | if (mutex_lock_interruptible(&dvbdev_register_lock)) | 296 | mutex_lock(&dvbdev_register_lock); |
298 | return -ERESTARTSYS; | ||
299 | 297 | ||
300 | if ((num = dvbdev_get_free_adapter_num ()) < 0) { | 298 | if ((num = dvbdev_get_free_adapter_num ()) < 0) { |
301 | mutex_unlock(&dvbdev_register_lock); | 299 | mutex_unlock(&dvbdev_register_lock); |
@@ -323,8 +321,7 @@ EXPORT_SYMBOL(dvb_register_adapter); | |||
323 | 321 | ||
324 | int dvb_unregister_adapter(struct dvb_adapter *adap) | 322 | int dvb_unregister_adapter(struct dvb_adapter *adap) |
325 | { | 323 | { |
326 | if (mutex_lock_interruptible(&dvbdev_register_lock)) | 324 | mutex_lock(&dvbdev_register_lock); |
327 | return -ERESTARTSYS; | ||
328 | list_del (&adap->list_head); | 325 | list_del (&adap->list_head); |
329 | mutex_unlock(&dvbdev_register_lock); | 326 | mutex_unlock(&dvbdev_register_lock); |
330 | return 0; | 327 | return 0; |
diff --git a/drivers/media/dvb/frontends/isl6421.c b/drivers/media/dvb/frontends/isl6421.c index ef319369ec26..c967148a5945 100644 --- a/drivers/media/dvb/frontends/isl6421.c +++ b/drivers/media/dvb/frontends/isl6421.c | |||
@@ -122,6 +122,7 @@ struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter | |||
122 | /* detect if it is present or not */ | 122 | /* detect if it is present or not */ |
123 | if (isl6421_set_voltage(fe, SEC_VOLTAGE_OFF)) { | 123 | if (isl6421_set_voltage(fe, SEC_VOLTAGE_OFF)) { |
124 | kfree(isl6421); | 124 | kfree(isl6421); |
125 | fe->sec_priv = NULL; | ||
125 | return NULL; | 126 | return NULL; |
126 | } | 127 | } |
127 | 128 | ||
diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig index 920b63f8cf05..af66a5d5ecd8 100644 --- a/drivers/media/radio/Kconfig +++ b/drivers/media/radio/Kconfig | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | menu "Radio Adapters" | 5 | menu "Radio Adapters" |
6 | depends on VIDEO_DEV!=n | 6 | depends on VIDEO_DEV |
7 | 7 | ||
8 | config RADIO_CADET | 8 | config RADIO_CADET |
9 | tristate "ADS Cadet AM/FM Tuner" | 9 | tristate "ADS Cadet AM/FM Tuner" |
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index 2fb9fe6a1ae7..ba1af3c8525e 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -780,18 +780,16 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
780 | return 0; | 780 | return 0; |
781 | } | 781 | } |
782 | 782 | ||
783 | static int msp_suspend(struct device * dev, pm_message_t state) | 783 | static int msp_suspend(struct i2c_client *client, pm_message_t state) |
784 | { | 784 | { |
785 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); | ||
786 | 785 | ||
787 | v4l_dbg(1, msp_debug, client, "suspend\n"); | 786 | v4l_dbg(1, msp_debug, client, "suspend\n"); |
788 | msp_reset(client); | 787 | msp_reset(client); |
789 | return 0; | 788 | return 0; |
790 | } | 789 | } |
791 | 790 | ||
792 | static int msp_resume(struct device * dev) | 791 | static int msp_resume(struct i2c_client *client) |
793 | { | 792 | { |
794 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); | ||
795 | 793 | ||
796 | v4l_dbg(1, msp_debug, client, "resume\n"); | 794 | v4l_dbg(1, msp_debug, client, "resume\n"); |
797 | msp_wake_thread(client); | 795 | msp_wake_thread(client); |
@@ -825,7 +823,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) | |||
825 | if (msp_reset(client) == -1) { | 823 | if (msp_reset(client) == -1) { |
826 | v4l_dbg(1, msp_debug, client, "msp3400 not found\n"); | 824 | v4l_dbg(1, msp_debug, client, "msp3400 not found\n"); |
827 | kfree(client); | 825 | kfree(client); |
828 | return -1; | 826 | return 0; |
829 | } | 827 | } |
830 | 828 | ||
831 | state = kmalloc(sizeof(*state), GFP_KERNEL); | 829 | state = kmalloc(sizeof(*state), GFP_KERNEL); |
@@ -859,7 +857,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) | |||
859 | v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n"); | 857 | v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n"); |
860 | kfree(state); | 858 | kfree(state); |
861 | kfree(client); | 859 | kfree(client); |
862 | return -1; | 860 | return 0; |
863 | } | 861 | } |
864 | 862 | ||
865 | msp_set_audio(client); | 863 | msp_set_audio(client); |
@@ -996,11 +994,11 @@ static struct i2c_driver i2c_driver = { | |||
996 | .id = I2C_DRIVERID_MSP3400, | 994 | .id = I2C_DRIVERID_MSP3400, |
997 | .attach_adapter = msp_probe, | 995 | .attach_adapter = msp_probe, |
998 | .detach_client = msp_detach, | 996 | .detach_client = msp_detach, |
997 | .suspend = msp_suspend, | ||
998 | .resume = msp_resume, | ||
999 | .command = msp_command, | 999 | .command = msp_command, |
1000 | .driver = { | 1000 | .driver = { |
1001 | .name = "msp3400", | 1001 | .name = "msp3400", |
1002 | .suspend = msp_suspend, | ||
1003 | .resume = msp_resume, | ||
1004 | }, | 1002 | }, |
1005 | }; | 1003 | }; |
1006 | 1004 | ||
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 7735b6758921..4d5bbd859de1 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -961,7 +961,7 @@ static void saa711x_set_v4lstd(struct i2c_client *client, v4l2_std_id std) | |||
961 | reg |= 0x10; | 961 | reg |= 0x10; |
962 | } else if (std == V4L2_STD_NTSC_M_JP) { | 962 | } else if (std == V4L2_STD_NTSC_M_JP) { |
963 | reg |= 0x40; | 963 | reg |= 0x40; |
964 | } else if (std == V4L2_STD_SECAM) { | 964 | } else if (std & V4L2_STD_SECAM) { |
965 | reg |= 0x50; | 965 | reg |= 0x50; |
966 | } | 966 | } |
967 | saa711x_write(client, R_0E_CHROMA_CNTL_1, reg); | 967 | saa711x_write(client, R_0E_CHROMA_CNTL_1, reg); |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 7be73e3763de..15dbc6bf42a7 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -804,9 +804,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
804 | return 0; | 804 | return 0; |
805 | } | 805 | } |
806 | 806 | ||
807 | static int tuner_suspend(struct device *dev, pm_message_t state) | 807 | static int tuner_suspend(struct i2c_client *c, pm_message_t state) |
808 | { | 808 | { |
809 | struct i2c_client *c = container_of (dev, struct i2c_client, dev); | ||
810 | struct tuner *t = i2c_get_clientdata (c); | 809 | struct tuner *t = i2c_get_clientdata (c); |
811 | 810 | ||
812 | tuner_dbg ("suspend\n"); | 811 | tuner_dbg ("suspend\n"); |
@@ -814,9 +813,8 @@ static int tuner_suspend(struct device *dev, pm_message_t state) | |||
814 | return 0; | 813 | return 0; |
815 | } | 814 | } |
816 | 815 | ||
817 | static int tuner_resume(struct device *dev) | 816 | static int tuner_resume(struct i2c_client *c) |
818 | { | 817 | { |
819 | struct i2c_client *c = container_of (dev, struct i2c_client, dev); | ||
820 | struct tuner *t = i2c_get_clientdata (c); | 818 | struct tuner *t = i2c_get_clientdata (c); |
821 | 819 | ||
822 | tuner_dbg ("resume\n"); | 820 | tuner_dbg ("resume\n"); |
@@ -837,10 +835,10 @@ static struct i2c_driver driver = { | |||
837 | .attach_adapter = tuner_probe, | 835 | .attach_adapter = tuner_probe, |
838 | .detach_client = tuner_detach, | 836 | .detach_client = tuner_detach, |
839 | .command = tuner_command, | 837 | .command = tuner_command, |
838 | .suspend = tuner_suspend, | ||
839 | .resume = tuner_resume, | ||
840 | .driver = { | 840 | .driver = { |
841 | .name = "tuner", | 841 | .name = "tuner", |
842 | .suspend = tuner_suspend, | ||
843 | .resume = tuner_resume, | ||
844 | }, | 842 | }, |
845 | }; | 843 | }; |
846 | static struct i2c_client client_template = { | 844 | static struct i2c_client client_template = { |
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 404c014db1bd..1d2d03f77894 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -815,7 +815,7 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
815 | static int | 815 | static int |
816 | mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | 816 | mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) |
817 | { | 817 | { |
818 | MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)ioc->sh->hostdata; | 818 | MPT_SCSI_HOST *hd; |
819 | struct mptsas_target_reset_event *target_reset_list, *n; | 819 | struct mptsas_target_reset_event *target_reset_list, *n; |
820 | int rc; | 820 | int rc; |
821 | 821 | ||
@@ -827,7 +827,10 @@ mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | |||
827 | if (reset_phase != MPT_IOC_POST_RESET) | 827 | if (reset_phase != MPT_IOC_POST_RESET) |
828 | goto out; | 828 | goto out; |
829 | 829 | ||
830 | if (!hd || !hd->ioc) | 830 | if (!ioc->sh || !ioc->sh->hostdata) |
831 | goto out; | ||
832 | hd = (MPT_SCSI_HOST *)ioc->sh->hostdata; | ||
833 | if (!hd->ioc) | ||
831 | goto out; | 834 | goto out; |
832 | 835 | ||
833 | if (list_empty(&hd->target_reset_list)) | 836 | if (list_empty(&hd->target_reset_list)) |
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index da9859f2caf2..b17c4b2bc9ef 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c | |||
@@ -390,13 +390,6 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req) | |||
390 | return BLKPREP_KILL; | 390 | return BLKPREP_KILL; |
391 | } | 391 | } |
392 | 392 | ||
393 | /* request is already processed by us, so return */ | ||
394 | if (blk_special_request(req)) { | ||
395 | osm_debug("REQ_SPECIAL already set!\n"); | ||
396 | req->cmd_flags |= REQ_DONTPREP; | ||
397 | return BLKPREP_OK; | ||
398 | } | ||
399 | |||
400 | /* connect the i2o_block_request to the request */ | 393 | /* connect the i2o_block_request to the request */ |
401 | if (!req->special) { | 394 | if (!req->special) { |
402 | ireq = i2o_block_request_alloc(); | 395 | ireq = i2o_block_request_alloc(); |
@@ -408,11 +401,8 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req) | |||
408 | ireq->i2o_blk_dev = i2o_blk_dev; | 401 | ireq->i2o_blk_dev = i2o_blk_dev; |
409 | req->special = ireq; | 402 | req->special = ireq; |
410 | ireq->req = req; | 403 | ireq->req = req; |
411 | } else | 404 | } |
412 | ireq = req->special; | ||
413 | |||
414 | /* do not come back here */ | 405 | /* do not come back here */ |
415 | req->cmd_type = REQ_TYPE_SPECIAL; | ||
416 | req->cmd_flags |= REQ_DONTPREP; | 406 | req->cmd_flags |= REQ_DONTPREP; |
417 | 407 | ||
418 | return BLKPREP_OK; | 408 | return BLKPREP_OK; |
diff --git a/drivers/net/atl1/atl1_hw.c b/drivers/net/atl1/atl1_hw.c index 314dbaabb642..69482e0d849b 100644 --- a/drivers/net/atl1/atl1_hw.c +++ b/drivers/net/atl1/atl1_hw.c | |||
@@ -334,7 +334,6 @@ u32 atl1_hash_mc_addr(struct atl1_hw *hw, u8 *mc_addr) | |||
334 | int i; | 334 | int i; |
335 | 335 | ||
336 | crc32 = ether_crc_le(6, mc_addr); | 336 | crc32 = ether_crc_le(6, mc_addr); |
337 | crc32 = ~crc32; | ||
338 | for (i = 0; i < 32; i++) | 337 | for (i = 0; i < 32; i++) |
339 | value |= (((crc32 >> i) & 1) << (31 - i)); | 338 | value |= (((crc32 >> i) & 1) << (31 - i)); |
340 | 339 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 46e1697d9cfd..d04214e4e581 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -2050,9 +2050,10 @@ static void nv_tx_timeout(struct net_device *dev) | |||
2050 | nv_drain_tx(dev); | 2050 | nv_drain_tx(dev); |
2051 | nv_init_tx(dev); | 2051 | nv_init_tx(dev); |
2052 | setup_hw_rings(dev, NV_SETUP_TX_RING); | 2052 | setup_hw_rings(dev, NV_SETUP_TX_RING); |
2053 | netif_wake_queue(dev); | ||
2054 | } | 2053 | } |
2055 | 2054 | ||
2055 | netif_wake_queue(dev); | ||
2056 | |||
2056 | /* 4) restart tx engine */ | 2057 | /* 4) restart tx engine */ |
2057 | nv_start_tx(dev); | 2058 | nv_start_tx(dev); |
2058 | spin_unlock_irq(&np->lock); | 2059 | spin_unlock_irq(&np->lock); |
@@ -3536,7 +3537,10 @@ static void nv_do_nic_poll(unsigned long data) | |||
3536 | pci_push(base); | 3537 | pci_push(base); |
3537 | 3538 | ||
3538 | if (!using_multi_irqs(dev)) { | 3539 | if (!using_multi_irqs(dev)) { |
3539 | nv_nic_irq(0, dev); | 3540 | if (np->desc_ver == DESC_VER_3) |
3541 | nv_nic_irq_optimized(0, dev); | ||
3542 | else | ||
3543 | nv_nic_irq(0, dev); | ||
3540 | if (np->msi_flags & NV_MSI_X_ENABLED) | 3544 | if (np->msi_flags & NV_MSI_X_ENABLED) |
3541 | enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector); | 3545 | enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector); |
3542 | else | 3546 | else |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index c9f55bc57edb..8015a7c5b0c9 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -1379,7 +1379,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
1379 | 1379 | ||
1380 | spin_lock_init(&mp->lock); | 1380 | spin_lock_init(&mp->lock); |
1381 | 1381 | ||
1382 | port_num = pd->port_number; | 1382 | port_num = mp->port_num = pd->port_number; |
1383 | 1383 | ||
1384 | /* set default config values */ | 1384 | /* set default config values */ |
1385 | eth_port_uc_addr_get(dev, dev->dev_addr); | 1385 | eth_port_uc_addr_get(dev, dev->dev_addr); |
@@ -1411,8 +1411,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
1411 | duplex = pd->duplex; | 1411 | duplex = pd->duplex; |
1412 | speed = pd->speed; | 1412 | speed = pd->speed; |
1413 | 1413 | ||
1414 | mp->port_num = port_num; | ||
1415 | |||
1416 | /* Hook up MII support for ethtool */ | 1414 | /* Hook up MII support for ethtool */ |
1417 | mp->mii.dev = dev; | 1415 | mp->mii.dev = dev; |
1418 | mp->mii.mdio_read = mv643xx_mdio_read; | 1416 | mp->mii.mdio_read = mv643xx_mdio_read; |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index b05b20ef8c0a..c216e6a5d235 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -71,7 +71,7 @@ | |||
71 | #include "myri10ge_mcp.h" | 71 | #include "myri10ge_mcp.h" |
72 | #include "myri10ge_mcp_gen_header.h" | 72 | #include "myri10ge_mcp_gen_header.h" |
73 | 73 | ||
74 | #define MYRI10GE_VERSION_STR "1.3.0-1.226" | 74 | #define MYRI10GE_VERSION_STR "1.3.0-1.227" |
75 | 75 | ||
76 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 76 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
77 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 77 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
@@ -2015,10 +2015,9 @@ again: | |||
2015 | mss = 0; | 2015 | mss = 0; |
2016 | max_segments = MXGEFW_MAX_SEND_DESC; | 2016 | max_segments = MXGEFW_MAX_SEND_DESC; |
2017 | 2017 | ||
2018 | if (skb->len > (dev->mtu + ETH_HLEN)) { | 2018 | if (skb_is_gso(skb)) { |
2019 | mss = skb_shinfo(skb)->gso_size; | 2019 | mss = skb_shinfo(skb)->gso_size; |
2020 | if (mss != 0) | 2020 | max_segments = MYRI10GE_MAX_SEND_DESC_TSO; |
2021 | max_segments = MYRI10GE_MAX_SEND_DESC_TSO; | ||
2022 | } | 2021 | } |
2023 | 2022 | ||
2024 | if ((unlikely(avail < max_segments))) { | 2023 | if ((unlikely(avail < max_segments))) { |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index d3f65dab306c..a8246eb2f8d9 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -1691,6 +1691,27 @@ static int ql_populate_free_queue(struct ql3_adapter *qdev) | |||
1691 | /* | 1691 | /* |
1692 | * Caller holds hw_lock. | 1692 | * Caller holds hw_lock. |
1693 | */ | 1693 | */ |
1694 | static void ql_update_small_bufq_prod_index(struct ql3_adapter *qdev) | ||
1695 | { | ||
1696 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; | ||
1697 | if (qdev->small_buf_release_cnt >= 16) { | ||
1698 | while (qdev->small_buf_release_cnt >= 16) { | ||
1699 | qdev->small_buf_q_producer_index++; | ||
1700 | |||
1701 | if (qdev->small_buf_q_producer_index == | ||
1702 | NUM_SBUFQ_ENTRIES) | ||
1703 | qdev->small_buf_q_producer_index = 0; | ||
1704 | qdev->small_buf_release_cnt -= 8; | ||
1705 | } | ||
1706 | wmb(); | ||
1707 | writel(qdev->small_buf_q_producer_index, | ||
1708 | &port_regs->CommonRegs.rxSmallQProducerIndex); | ||
1709 | } | ||
1710 | } | ||
1711 | |||
1712 | /* | ||
1713 | * Caller holds hw_lock. | ||
1714 | */ | ||
1694 | static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) | 1715 | static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) |
1695 | { | 1716 | { |
1696 | struct bufq_addr_element *lrg_buf_q_ele; | 1717 | struct bufq_addr_element *lrg_buf_q_ele; |
@@ -1732,13 +1753,10 @@ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) | |||
1732 | lrg_buf_q_ele = qdev->lrg_buf_q_virt_addr; | 1753 | lrg_buf_q_ele = qdev->lrg_buf_q_virt_addr; |
1733 | } | 1754 | } |
1734 | } | 1755 | } |
1735 | 1756 | wmb(); | |
1736 | qdev->lrg_buf_next_free = lrg_buf_q_ele; | 1757 | qdev->lrg_buf_next_free = lrg_buf_q_ele; |
1737 | 1758 | writel(qdev->lrg_buf_q_producer_index, | |
1738 | ql_write_common_reg(qdev, | 1759 | &port_regs->CommonRegs.rxLargeQProducerIndex); |
1739 | &port_regs->CommonRegs. | ||
1740 | rxLargeQProducerIndex, | ||
1741 | qdev->lrg_buf_q_producer_index); | ||
1742 | } | 1760 | } |
1743 | } | 1761 | } |
1744 | 1762 | ||
@@ -1915,17 +1933,18 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev, | |||
1915 | u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum); | 1933 | u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum); |
1916 | if (checksum & | 1934 | if (checksum & |
1917 | (IB_IP_IOCB_RSP_3032_ICE | | 1935 | (IB_IP_IOCB_RSP_3032_ICE | |
1918 | IB_IP_IOCB_RSP_3032_CE | | 1936 | IB_IP_IOCB_RSP_3032_CE)) { |
1919 | IB_IP_IOCB_RSP_3032_NUC)) { | ||
1920 | printk(KERN_ERR | 1937 | printk(KERN_ERR |
1921 | "%s: Bad checksum for this %s packet, checksum = %x.\n", | 1938 | "%s: Bad checksum for this %s packet, checksum = %x.\n", |
1922 | __func__, | 1939 | __func__, |
1923 | ((checksum & | 1940 | ((checksum & |
1924 | IB_IP_IOCB_RSP_3032_TCP) ? "TCP" : | 1941 | IB_IP_IOCB_RSP_3032_TCP) ? "TCP" : |
1925 | "UDP"),checksum); | 1942 | "UDP"),checksum); |
1926 | } else if (checksum & IB_IP_IOCB_RSP_3032_TCP) { | 1943 | } else if ((checksum & IB_IP_IOCB_RSP_3032_TCP) || |
1944 | (checksum & IB_IP_IOCB_RSP_3032_UDP && | ||
1945 | !(checksum & IB_IP_IOCB_RSP_3032_NUC))) { | ||
1927 | skb2->ip_summed = CHECKSUM_UNNECESSARY; | 1946 | skb2->ip_summed = CHECKSUM_UNNECESSARY; |
1928 | } | 1947 | } |
1929 | } | 1948 | } |
1930 | skb2->dev = qdev->ndev; | 1949 | skb2->dev = qdev->ndev; |
1931 | skb2->protocol = eth_type_trans(skb2, qdev->ndev); | 1950 | skb2->protocol = eth_type_trans(skb2, qdev->ndev); |
@@ -1944,16 +1963,12 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev, | |||
1944 | static int ql_tx_rx_clean(struct ql3_adapter *qdev, | 1963 | static int ql_tx_rx_clean(struct ql3_adapter *qdev, |
1945 | int *tx_cleaned, int *rx_cleaned, int work_to_do) | 1964 | int *tx_cleaned, int *rx_cleaned, int work_to_do) |
1946 | { | 1965 | { |
1947 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; | ||
1948 | struct net_rsp_iocb *net_rsp; | 1966 | struct net_rsp_iocb *net_rsp; |
1949 | struct net_device *ndev = qdev->ndev; | 1967 | struct net_device *ndev = qdev->ndev; |
1950 | unsigned long hw_flags; | ||
1951 | int work_done = 0; | 1968 | int work_done = 0; |
1952 | 1969 | ||
1953 | u32 rsp_producer_index = le32_to_cpu(*(qdev->prsp_producer_index)); | ||
1954 | |||
1955 | /* While there are entries in the completion queue. */ | 1970 | /* While there are entries in the completion queue. */ |
1956 | while ((rsp_producer_index != | 1971 | while ((le32_to_cpu(*(qdev->prsp_producer_index)) != |
1957 | qdev->rsp_consumer_index) && (work_done < work_to_do)) { | 1972 | qdev->rsp_consumer_index) && (work_done < work_to_do)) { |
1958 | 1973 | ||
1959 | net_rsp = qdev->rsp_current; | 1974 | net_rsp = qdev->rsp_current; |
@@ -2009,33 +2024,7 @@ static int ql_tx_rx_clean(struct ql3_adapter *qdev, | |||
2009 | work_done = *tx_cleaned + *rx_cleaned; | 2024 | work_done = *tx_cleaned + *rx_cleaned; |
2010 | } | 2025 | } |
2011 | 2026 | ||
2012 | if(work_done) { | 2027 | return work_done; |
2013 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | ||
2014 | |||
2015 | ql_update_lrg_bufq_prod_index(qdev); | ||
2016 | |||
2017 | if (qdev->small_buf_release_cnt >= 16) { | ||
2018 | while (qdev->small_buf_release_cnt >= 16) { | ||
2019 | qdev->small_buf_q_producer_index++; | ||
2020 | |||
2021 | if (qdev->small_buf_q_producer_index == | ||
2022 | NUM_SBUFQ_ENTRIES) | ||
2023 | qdev->small_buf_q_producer_index = 0; | ||
2024 | qdev->small_buf_release_cnt -= 8; | ||
2025 | } | ||
2026 | |||
2027 | wmb(); | ||
2028 | ql_write_common_reg(qdev, | ||
2029 | &port_regs->CommonRegs. | ||
2030 | rxSmallQProducerIndex, | ||
2031 | qdev->small_buf_q_producer_index); | ||
2032 | |||
2033 | } | ||
2034 | |||
2035 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | ||
2036 | } | ||
2037 | |||
2038 | return *tx_cleaned + *rx_cleaned; | ||
2039 | } | 2028 | } |
2040 | 2029 | ||
2041 | static int ql_poll(struct net_device *ndev, int *budget) | 2030 | static int ql_poll(struct net_device *ndev, int *budget) |
@@ -2059,9 +2048,10 @@ quit_polling: | |||
2059 | netif_rx_complete(ndev); | 2048 | netif_rx_complete(ndev); |
2060 | 2049 | ||
2061 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | 2050 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); |
2062 | ql_write_common_reg(qdev, | 2051 | ql_update_small_bufq_prod_index(qdev); |
2063 | &port_regs->CommonRegs.rspQConsumerIndex, | 2052 | ql_update_lrg_bufq_prod_index(qdev); |
2064 | qdev->rsp_consumer_index); | 2053 | writel(qdev->rsp_consumer_index, |
2054 | &port_regs->CommonRegs.rspQConsumerIndex); | ||
2065 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 2055 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
2066 | 2056 | ||
2067 | ql_enable_interrupts(qdev); | 2057 | ql_enable_interrupts(qdev); |
@@ -2217,12 +2207,7 @@ static int ql_send_map(struct ql3_adapter *qdev, | |||
2217 | int seg_cnt, seg = 0; | 2207 | int seg_cnt, seg = 0; |
2218 | int frag_cnt = (int)skb_shinfo(skb)->nr_frags; | 2208 | int frag_cnt = (int)skb_shinfo(skb)->nr_frags; |
2219 | 2209 | ||
2220 | seg_cnt = tx_cb->seg_count = ql_get_seg_count(qdev, | 2210 | seg_cnt = tx_cb->seg_count; |
2221 | (skb_shinfo(skb)->nr_frags)); | ||
2222 | if(seg_cnt == -1) { | ||
2223 | printk(KERN_ERR PFX"%s: invalid segment count!\n",__func__); | ||
2224 | return NETDEV_TX_BUSY; | ||
2225 | } | ||
2226 | /* | 2211 | /* |
2227 | * Map the skb buffer first. | 2212 | * Map the skb buffer first. |
2228 | */ | 2213 | */ |
@@ -2278,7 +2263,7 @@ static int ql_send_map(struct ql3_adapter *qdev, | |||
2278 | pci_unmap_addr_set(&tx_cb->map[seg], mapaddr, | 2263 | pci_unmap_addr_set(&tx_cb->map[seg], mapaddr, |
2279 | map); | 2264 | map); |
2280 | pci_unmap_len_set(&tx_cb->map[seg], maplen, | 2265 | pci_unmap_len_set(&tx_cb->map[seg], maplen, |
2281 | len); | 2266 | sizeof(struct oal)); |
2282 | oal_entry = (struct oal_entry *)oal; | 2267 | oal_entry = (struct oal_entry *)oal; |
2283 | oal++; | 2268 | oal++; |
2284 | seg++; | 2269 | seg++; |
@@ -2380,6 +2365,7 @@ static int ql3xxx_send(struct sk_buff *skb, struct net_device *ndev) | |||
2380 | } | 2365 | } |
2381 | 2366 | ||
2382 | mac_iocb_ptr = tx_cb->queue_entry; | 2367 | mac_iocb_ptr = tx_cb->queue_entry; |
2368 | memset((void *)mac_iocb_ptr, 0, sizeof(struct ob_mac_iocb_req)); | ||
2383 | mac_iocb_ptr->opcode = qdev->mac_ob_opcode; | 2369 | mac_iocb_ptr->opcode = qdev->mac_ob_opcode; |
2384 | mac_iocb_ptr->flags = OB_MAC_IOCB_REQ_X; | 2370 | mac_iocb_ptr->flags = OB_MAC_IOCB_REQ_X; |
2385 | mac_iocb_ptr->flags |= qdev->mb_bit_mask; | 2371 | mac_iocb_ptr->flags |= qdev->mb_bit_mask; |
@@ -3054,15 +3040,6 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3054 | goto out; | 3040 | goto out; |
3055 | } | 3041 | } |
3056 | 3042 | ||
3057 | if (qdev->mac_index) | ||
3058 | ql_write_page0_reg(qdev, | ||
3059 | &port_regs->mac1MaxFrameLengthReg, | ||
3060 | qdev->max_frame_size); | ||
3061 | else | ||
3062 | ql_write_page0_reg(qdev, | ||
3063 | &port_regs->mac0MaxFrameLengthReg, | ||
3064 | qdev->max_frame_size); | ||
3065 | |||
3066 | value = qdev->nvram_data.tcpMaxWindowSize; | 3043 | value = qdev->nvram_data.tcpMaxWindowSize; |
3067 | ql_write_page0_reg(qdev, &port_regs->tcpMaxWindow, value); | 3044 | ql_write_page0_reg(qdev, &port_regs->tcpMaxWindow, value); |
3068 | 3045 | ||
@@ -3082,6 +3059,14 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3082 | ql_sem_unlock(qdev, QL_FLASH_SEM_MASK); | 3059 | ql_sem_unlock(qdev, QL_FLASH_SEM_MASK); |
3083 | } | 3060 | } |
3084 | 3061 | ||
3062 | if (qdev->mac_index) | ||
3063 | ql_write_page0_reg(qdev, | ||
3064 | &port_regs->mac1MaxFrameLengthReg, | ||
3065 | qdev->max_frame_size); | ||
3066 | else | ||
3067 | ql_write_page0_reg(qdev, | ||
3068 | &port_regs->mac0MaxFrameLengthReg, | ||
3069 | qdev->max_frame_size); | ||
3085 | 3070 | ||
3086 | if(ql_sem_spinlock(qdev, QL_PHY_GIO_SEM_MASK, | 3071 | if(ql_sem_spinlock(qdev, QL_PHY_GIO_SEM_MASK, |
3087 | (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) * | 3072 | (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) * |
@@ -3152,7 +3137,8 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) | |||
3152 | if (qdev->device_id == QL3032_DEVICE_ID) { | 3137 | if (qdev->device_id == QL3032_DEVICE_ID) { |
3153 | value = | 3138 | value = |
3154 | (QL3032_PORT_CONTROL_EF | QL3032_PORT_CONTROL_KIE | | 3139 | (QL3032_PORT_CONTROL_EF | QL3032_PORT_CONTROL_KIE | |
3155 | QL3032_PORT_CONTROL_EIv6 | QL3032_PORT_CONTROL_EIv4); | 3140 | QL3032_PORT_CONTROL_EIv6 | QL3032_PORT_CONTROL_EIv4 | |
3141 | QL3032_PORT_CONTROL_ET); | ||
3156 | ql_write_page0_reg(qdev, &port_regs->functionControl, | 3142 | ql_write_page0_reg(qdev, &port_regs->functionControl, |
3157 | ((value << 16) | value)); | 3143 | ((value << 16) | value)); |
3158 | } else { | 3144 | } else { |
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h index 34cd6580fd07..0203f88f0544 100755 --- a/drivers/net/qla3xxx.h +++ b/drivers/net/qla3xxx.h | |||
@@ -1014,8 +1014,7 @@ struct eeprom_data { | |||
1014 | 1014 | ||
1015 | /* Transmit and Receive Buffers */ | 1015 | /* Transmit and Receive Buffers */ |
1016 | #define NUM_LBUFQ_ENTRIES 128 | 1016 | #define NUM_LBUFQ_ENTRIES 128 |
1017 | #define JUMBO_NUM_LBUFQ_ENTRIES \ | 1017 | #define JUMBO_NUM_LBUFQ_ENTRIES 32 |
1018 | (NUM_LBUFQ_ENTRIES/(JUMBO_MTU_SIZE/NORMAL_MTU_SIZE)) | ||
1019 | #define NUM_SBUFQ_ENTRIES 64 | 1018 | #define NUM_SBUFQ_ENTRIES 64 |
1020 | #define QL_SMALL_BUFFER_SIZE 32 | 1019 | #define QL_SMALL_BUFFER_SIZE 32 |
1021 | #define QL_ADDR_ELE_PER_BUFQ_ENTRY \ | 1020 | #define QL_ADDR_ELE_PER_BUFQ_ENTRY \ |
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c index c62e85d89f41..7bee45b42a2c 100644 --- a/drivers/net/sun3lance.c +++ b/drivers/net/sun3lance.c | |||
@@ -336,13 +336,27 @@ static int __init lance_probe( struct net_device *dev) | |||
336 | 336 | ||
337 | /* XXX - leak? */ | 337 | /* XXX - leak? */ |
338 | MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x10000); | 338 | MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x10000); |
339 | if (MEM == NULL) { | ||
340 | #ifdef CONFIG_SUN3 | ||
341 | iounmap((void __iomem *)ioaddr); | ||
342 | #endif | ||
343 | printk(KERN_WARNING "SUN3 Lance couldn't allocate DVMA memory\n"); | ||
344 | return 0; | ||
345 | } | ||
339 | 346 | ||
340 | lp->iobase = (volatile unsigned short *)ioaddr; | 347 | lp->iobase = (volatile unsigned short *)ioaddr; |
341 | dev->base_addr = (unsigned long)ioaddr; /* informational only */ | 348 | dev->base_addr = (unsigned long)ioaddr; /* informational only */ |
342 | 349 | ||
343 | REGA(CSR0) = CSR0_STOP; | 350 | REGA(CSR0) = CSR0_STOP; |
344 | 351 | ||
345 | request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev); | 352 | if (request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev) < 0) { |
353 | #ifdef CONFIG_SUN3 | ||
354 | iounmap((void __iomem *)ioaddr); | ||
355 | #endif | ||
356 | dvma_free((void *)MEM); | ||
357 | printk(KERN_WARNING "SUN3 Lance unable to allocate IRQ\n"); | ||
358 | return 0; | ||
359 | } | ||
346 | dev->irq = (unsigned short)LANCE_IRQ; | 360 | dev->irq = (unsigned short)LANCE_IRQ; |
347 | 361 | ||
348 | 362 | ||
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c index cae89258a640..d1e89be965cd 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c | |||
@@ -757,7 +757,7 @@ static void bcm43xx_phy_initb5(struct bcm43xx_private *bcm) | |||
757 | if (radio->version == 0x2050) | 757 | if (radio->version == 0x2050) |
758 | bcm43xx_phy_write(bcm, 0x0038, 0x0667); | 758 | bcm43xx_phy_write(bcm, 0x0038, 0x0667); |
759 | 759 | ||
760 | if (phy->type == BCM43xx_PHYTYPE_G) { | 760 | if (phy->connected) { |
761 | if (radio->version == 0x2050) { | 761 | if (radio->version == 0x2050) { |
762 | bcm43xx_radio_write16(bcm, 0x007A, | 762 | bcm43xx_radio_write16(bcm, 0x007A, |
763 | bcm43xx_radio_read16(bcm, 0x007A) | 763 | bcm43xx_radio_read16(bcm, 0x007A) |
@@ -1192,7 +1192,7 @@ static void bcm43xx_phy_initg(struct bcm43xx_private *bcm) | |||
1192 | bcm43xx_phy_write(bcm, 0x0811, 0x0400); | 1192 | bcm43xx_phy_write(bcm, 0x0811, 0x0400); |
1193 | bcm43xx_phy_write(bcm, 0x0015, 0x00C0); | 1193 | bcm43xx_phy_write(bcm, 0x0015, 0x00C0); |
1194 | } | 1194 | } |
1195 | if (phy->connected) { | 1195 | if (phy->rev >= 2 && phy->connected) { |
1196 | tmp = bcm43xx_phy_read(bcm, 0x0400) & 0xFF; | 1196 | tmp = bcm43xx_phy_read(bcm, 0x0400) & 0xFF; |
1197 | if (tmp < 6) { | 1197 | if (tmp < 6) { |
1198 | bcm43xx_phy_write(bcm, 0x04C2, 0x1816); | 1198 | bcm43xx_phy_write(bcm, 0x04C2, 0x1816); |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_radio.c b/drivers/net/wireless/bcm43xx/bcm43xx_radio.c index ee1e7a2afc08..4025dd0089d2 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_radio.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_radio.c | |||
@@ -458,7 +458,7 @@ static void bcm43xx_calc_nrssi_offset(struct bcm43xx_private *bcm) | |||
458 | bcm43xx_phy_write(bcm, 0x005A, 0x0480); | 458 | bcm43xx_phy_write(bcm, 0x005A, 0x0480); |
459 | bcm43xx_phy_write(bcm, 0x0059, 0x0810); | 459 | bcm43xx_phy_write(bcm, 0x0059, 0x0810); |
460 | bcm43xx_phy_write(bcm, 0x0058, 0x000D); | 460 | bcm43xx_phy_write(bcm, 0x0058, 0x000D); |
461 | if (phy->rev == 0) { | 461 | if (phy->analog == 0) { |
462 | bcm43xx_phy_write(bcm, 0x0003, 0x0122); | 462 | bcm43xx_phy_write(bcm, 0x0003, 0x0122); |
463 | } else { | 463 | } else { |
464 | bcm43xx_phy_write(bcm, 0x000A, | 464 | bcm43xx_phy_write(bcm, 0x000A, |
@@ -570,9 +570,9 @@ void bcm43xx_calc_nrssi_slope(struct bcm43xx_private *bcm) | |||
570 | nrssi0 = (s16)bcm43xx_phy_read(bcm, 0x0027); | 570 | nrssi0 = (s16)bcm43xx_phy_read(bcm, 0x0027); |
571 | bcm43xx_radio_write16(bcm, 0x007A, | 571 | bcm43xx_radio_write16(bcm, 0x007A, |
572 | bcm43xx_radio_read16(bcm, 0x007A) & 0x007F); | 572 | bcm43xx_radio_read16(bcm, 0x007A) & 0x007F); |
573 | if (phy->rev >= 2) { | 573 | if (phy->analog >= 2) { |
574 | bcm43xx_write16(bcm, 0x03E6, 0x0040); | 574 | bcm43xx_write16(bcm, 0x03E6, 0x0040); |
575 | } else if (phy->rev == 0) { | 575 | } else if (phy->analog == 0) { |
576 | bcm43xx_write16(bcm, 0x03E6, 0x0122); | 576 | bcm43xx_write16(bcm, 0x03E6, 0x0122); |
577 | } else { | 577 | } else { |
578 | bcm43xx_write16(bcm, BCM43xx_MMIO_CHANNEL_EXT, | 578 | bcm43xx_write16(bcm, BCM43xx_MMIO_CHANNEL_EXT, |
@@ -596,7 +596,7 @@ void bcm43xx_calc_nrssi_slope(struct bcm43xx_private *bcm) | |||
596 | bcm43xx_phy_write(bcm, 0x0015, backup[5]); | 596 | bcm43xx_phy_write(bcm, 0x0015, backup[5]); |
597 | bcm43xx_phy_write(bcm, 0x002A, backup[6]); | 597 | bcm43xx_phy_write(bcm, 0x002A, backup[6]); |
598 | bcm43xx_synth_pu_workaround(bcm, radio->channel); | 598 | bcm43xx_synth_pu_workaround(bcm, radio->channel); |
599 | if (phy->rev != 0) | 599 | if (phy->analog != 0) |
600 | bcm43xx_write16(bcm, 0x03F4, backup[13]); | 600 | bcm43xx_write16(bcm, 0x03F4, backup[13]); |
601 | 601 | ||
602 | bcm43xx_phy_write(bcm, 0x0020, backup[7]); | 602 | bcm43xx_phy_write(bcm, 0x0020, backup[7]); |
@@ -692,7 +692,7 @@ void bcm43xx_calc_nrssi_slope(struct bcm43xx_private *bcm) | |||
692 | 692 | ||
693 | bcm43xx_radio_write16(bcm, 0x007A, | 693 | bcm43xx_radio_write16(bcm, 0x007A, |
694 | bcm43xx_radio_read16(bcm, 0x007A) & 0x007F); | 694 | bcm43xx_radio_read16(bcm, 0x007A) & 0x007F); |
695 | if (phy->rev >= 2) { | 695 | if (phy->analog >= 2) { |
696 | bcm43xx_phy_write(bcm, 0x0003, | 696 | bcm43xx_phy_write(bcm, 0x0003, |
697 | (bcm43xx_phy_read(bcm, 0x0003) | 697 | (bcm43xx_phy_read(bcm, 0x0003) |
698 | & 0xFF9F) | 0x0040); | 698 | & 0xFF9F) | 0x0040); |
@@ -1579,7 +1579,7 @@ void bcm43xx_radio_set_tx_iq(struct bcm43xx_private *bcm) | |||
1579 | 1579 | ||
1580 | for (i = 0; i < 5; i++) { | 1580 | for (i = 0; i < 5; i++) { |
1581 | for (j = 0; j < 5; j++) { | 1581 | for (j = 0; j < 5; j++) { |
1582 | if (tmp == (data_high[i] << 4 | data_low[j])) { | 1582 | if (tmp == (data_high[i] | data_low[j])) { |
1583 | bcm43xx_phy_write(bcm, 0x0069, (i - j) << 8 | 0x00C0); | 1583 | bcm43xx_phy_write(bcm, 0x0069, (i - j) << 8 | 0x00C0); |
1584 | return; | 1584 | return; |
1585 | } | 1585 | } |
diff --git a/drivers/oprofile/event_buffer.c b/drivers/oprofile/event_buffer.c index 00e937e9240e..e7fbac529935 100644 --- a/drivers/oprofile/event_buffer.c +++ b/drivers/oprofile/event_buffer.c | |||
@@ -70,11 +70,12 @@ void wake_up_buffer_waiter(void) | |||
70 | int alloc_event_buffer(void) | 70 | int alloc_event_buffer(void) |
71 | { | 71 | { |
72 | int err = -ENOMEM; | 72 | int err = -ENOMEM; |
73 | unsigned long flags; | ||
73 | 74 | ||
74 | spin_lock(&oprofilefs_lock); | 75 | spin_lock_irqsave(&oprofilefs_lock, flags); |
75 | buffer_size = fs_buffer_size; | 76 | buffer_size = fs_buffer_size; |
76 | buffer_watershed = fs_buffer_watershed; | 77 | buffer_watershed = fs_buffer_watershed; |
77 | spin_unlock(&oprofilefs_lock); | 78 | spin_unlock_irqrestore(&oprofilefs_lock, flags); |
78 | 79 | ||
79 | if (buffer_watershed >= buffer_size) | 80 | if (buffer_watershed >= buffer_size) |
80 | return -EINVAL; | 81 | return -EINVAL; |
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index 6e67b42ca46d..8543cb26cf34 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c | |||
@@ -65,6 +65,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t co | |||
65 | int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count) | 65 | int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count) |
66 | { | 66 | { |
67 | char tmpbuf[TMPBUFSIZE]; | 67 | char tmpbuf[TMPBUFSIZE]; |
68 | unsigned long flags; | ||
68 | 69 | ||
69 | if (!count) | 70 | if (!count) |
70 | return 0; | 71 | return 0; |
@@ -77,9 +78,9 @@ int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, siz | |||
77 | if (copy_from_user(tmpbuf, buf, count)) | 78 | if (copy_from_user(tmpbuf, buf, count)) |
78 | return -EFAULT; | 79 | return -EFAULT; |
79 | 80 | ||
80 | spin_lock(&oprofilefs_lock); | 81 | spin_lock_irqsave(&oprofilefs_lock, flags); |
81 | *val = simple_strtoul(tmpbuf, NULL, 0); | 82 | *val = simple_strtoul(tmpbuf, NULL, 0); |
82 | spin_unlock(&oprofilefs_lock); | 83 | spin_unlock_irqrestore(&oprofilefs_lock, flags); |
83 | return 0; | 84 | return 0; |
84 | } | 85 | } |
85 | 86 | ||
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c index 551bde5d9430..b693367d38cd 100644 --- a/drivers/pcmcia/au1000_generic.c +++ b/drivers/pcmcia/au1000_generic.c | |||
@@ -372,7 +372,7 @@ int au1x00_pcmcia_socket_probe(struct device *dev, struct pcmcia_low_level *ops, | |||
372 | skt->socket.resource_ops = &pccard_static_ops; | 372 | skt->socket.resource_ops = &pccard_static_ops; |
373 | skt->socket.ops = &au1x00_pcmcia_operations; | 373 | skt->socket.ops = &au1x00_pcmcia_operations; |
374 | skt->socket.owner = ops->owner; | 374 | skt->socket.owner = ops->owner; |
375 | skt->socket.dev.dev = dev; | 375 | skt->socket.dev.parent = dev; |
376 | 376 | ||
377 | init_timer(&skt->poll_timer); | 377 | init_timer(&skt->poll_timer); |
378 | skt->poll_timer.function = au1x00_pcmcia_poll_event; | 378 | skt->poll_timer.function = au1x00_pcmcia_poll_event; |
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 8c81cec85298..60446b88f721 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
@@ -3091,6 +3091,7 @@ static int gdth_fill_raw_cmd(int hanum,Scsi_Cmnd *scp,unchar b) | |||
3091 | cmdp->u.raw64.direction = | 3091 | cmdp->u.raw64.direction = |
3092 | gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN; | 3092 | gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN; |
3093 | memcpy(cmdp->u.raw64.cmd,scp->cmnd,16); | 3093 | memcpy(cmdp->u.raw64.cmd,scp->cmnd,16); |
3094 | cmdp->u.raw64.sg_ranz = 0; | ||
3094 | } else { | 3095 | } else { |
3095 | cmdp->u.raw.reserved = 0; | 3096 | cmdp->u.raw.reserved = 0; |
3096 | cmdp->u.raw.mdisc_time = 0; | 3097 | cmdp->u.raw.mdisc_time = 0; |
@@ -3107,6 +3108,7 @@ static int gdth_fill_raw_cmd(int hanum,Scsi_Cmnd *scp,unchar b) | |||
3107 | cmdp->u.raw.direction = | 3108 | cmdp->u.raw.direction = |
3108 | gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN; | 3109 | gdth_direction_tab[scp->cmnd[0]]==DOU ? GDTH_DATA_OUT:GDTH_DATA_IN; |
3109 | memcpy(cmdp->u.raw.cmd,scp->cmnd,12); | 3110 | memcpy(cmdp->u.raw.cmd,scp->cmnd,12); |
3111 | cmdp->u.raw.sg_ranz = 0; | ||
3110 | } | 3112 | } |
3111 | 3113 | ||
3112 | if (scp->use_sg) { | 3114 | if (scp->use_sg) { |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 9d014e5a81c4..057fd7e0e379 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1817,10 +1817,9 @@ static pci_ers_result_t lpfc_io_error_detected(struct pci_dev *pdev, | |||
1817 | struct lpfc_sli *psli = &phba->sli; | 1817 | struct lpfc_sli *psli = &phba->sli; |
1818 | struct lpfc_sli_ring *pring; | 1818 | struct lpfc_sli_ring *pring; |
1819 | 1819 | ||
1820 | if (state == pci_channel_io_perm_failure) { | 1820 | if (state == pci_channel_io_perm_failure) |
1821 | lpfc_pci_remove_one(pdev); | ||
1822 | return PCI_ERS_RESULT_DISCONNECT; | 1821 | return PCI_ERS_RESULT_DISCONNECT; |
1823 | } | 1822 | |
1824 | pci_disable_device(pdev); | 1823 | pci_disable_device(pdev); |
1825 | /* | 1824 | /* |
1826 | * There may be I/Os dropped by the firmware. | 1825 | * There may be I/Os dropped by the firmware. |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 2328128728be..6657331eed93 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -189,8 +189,8 @@ static DECLARE_MUTEX(board_lock); | |||
189 | * this is exported so that for example a USB or parport based adapter | 189 | * this is exported so that for example a USB or parport based adapter |
190 | * driver could add devices (which it would learn about out-of-band). | 190 | * driver could add devices (which it would learn about out-of-band). |
191 | */ | 191 | */ |
192 | struct spi_device *__init_or_module | 192 | struct spi_device *spi_new_device(struct spi_master *master, |
193 | spi_new_device(struct spi_master *master, struct spi_board_info *chip) | 193 | struct spi_board_info *chip) |
194 | { | 194 | { |
195 | struct spi_device *proxy; | 195 | struct spi_device *proxy; |
196 | struct device *dev = master->cdev.dev; | 196 | struct device *dev = master->cdev.dev; |
@@ -352,8 +352,7 @@ static struct class spi_master_class = { | |||
352 | * the master's methods before calling spi_register_master(); and (after errors | 352 | * the master's methods before calling spi_register_master(); and (after errors |
353 | * adding the device) calling spi_master_put() to prevent a memory leak. | 353 | * adding the device) calling spi_master_put() to prevent a memory leak. |
354 | */ | 354 | */ |
355 | struct spi_master * __init_or_module | 355 | struct spi_master *spi_alloc_master(struct device *dev, unsigned size) |
356 | spi_alloc_master(struct device *dev, unsigned size) | ||
357 | { | 356 | { |
358 | struct spi_master *master; | 357 | struct spi_master *master; |
359 | 358 | ||
@@ -392,8 +391,7 @@ EXPORT_SYMBOL_GPL(spi_alloc_master); | |||
392 | * After a successful return, the caller is responsible for calling | 391 | * After a successful return, the caller is responsible for calling |
393 | * spi_unregister_master(). | 392 | * spi_unregister_master(). |
394 | */ | 393 | */ |
395 | int __init_or_module | 394 | int spi_register_master(struct spi_master *master) |
396 | spi_register_master(struct spi_master *master) | ||
397 | { | 395 | { |
398 | static atomic_t dyn_bus_id = ATOMIC_INIT((1<<16) - 1); | 396 | static atomic_t dyn_bus_id = ATOMIC_INIT((1<<16) - 1); |
399 | struct device *dev = master->cdev.dev; | 397 | struct device *dev = master->cdev.dev; |