aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-09-13 11:24:25 -0400
committerPaul Mackerras <paulus@samba.org>2007-09-13 11:24:25 -0400
commitb2315372eac9cd9f622c32a93e323cf6f0f03462 (patch)
tree9e1faa7cdcddf5d90bec4fb9523742d4cce699a1 /drivers
parent5326152fa182b0a16e4abf913ce403e3c7ab53b7 (diff)
parentc87ce65868bbf9bbea9c3f112ff8315302daf8f2 (diff)
Merge branch 'linux-2.6' into for-2.6.24
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/ec.c3
-rw-r--r--drivers/ata/ata_generic.c2
-rw-r--r--drivers/ata/ata_piix.c77
-rw-r--r--drivers/ata/libata-core.c17
-rw-r--r--drivers/ata/pata_ali.c9
-rw-r--r--drivers/ata/pata_amd.c2
-rw-r--r--drivers/ata/pata_atiixp.c2
-rw-r--r--drivers/ata/pata_cs5520.c2
-rw-r--r--drivers/ata/pata_cs5530.c2
-rw-r--r--drivers/ata/pata_isapnp.c2
-rw-r--r--drivers/ata/pata_it821x.c6
-rw-r--r--drivers/ata/pata_marvell.c2
-rw-r--r--drivers/ata/pata_mpc52xx.c2
-rw-r--r--drivers/ata/pata_pcmcia.c2
-rw-r--r--drivers/ata/pata_pdc2027x.c2
-rw-r--r--drivers/ata/pata_platform.c2
-rw-r--r--drivers/ata/pata_sc1200.c2
-rw-r--r--drivers/ata/pata_scc.c2
-rw-r--r--drivers/ata/pata_serverworks.c2
-rw-r--r--drivers/ata/pata_sil680.c2
-rw-r--r--drivers/ata/pata_sl82c105.c2
-rw-r--r--drivers/ata/pata_via.c14
-rw-r--r--drivers/ata/pdc_adma.c2
-rw-r--r--drivers/ata/sata_inic162x.c2
-rw-r--r--drivers/ata/sata_mv.c2
-rw-r--r--drivers/ata/sata_nv.c2
-rw-r--r--drivers/ata/sata_promise.c6
-rw-r--r--drivers/ata/sata_qstor.c2
-rw-r--r--drivers/ata/sata_sil.c2
-rw-r--r--drivers/ata/sata_sil24.c2
-rw-r--r--drivers/ata/sata_sis.c2
-rw-r--r--drivers/ata/sata_svw.c2
-rw-r--r--drivers/ata/sata_sx4.c2
-rw-r--r--drivers/ata/sata_uli.c2
-rw-r--r--drivers/ata/sata_via.c4
-rw-r--r--drivers/ata/sata_vsc.c2
-rw-r--r--drivers/block/DAC960.c17
-rw-r--r--drivers/block/DAC960.h7
-rw-r--r--drivers/bluetooth/hci_usb.c5
-rw-r--r--drivers/char/agp/intel-agp.c10
-rw-r--r--drivers/char/hpet.c3
-rw-r--r--drivers/char/tty_ioctl.c4
-rw-r--r--drivers/edac/e752x_edac.c2
-rw-r--r--drivers/edac/edac_core.h2
-rw-r--r--drivers/firewire/fw-ohci.c6
-rw-r--r--drivers/hwmon/lm78.c2
-rw-r--r--drivers/hwmon/w83781d.c2
-rw-r--r--drivers/i2c/algos/i2c-algo-bit.c52
-rw-r--r--drivers/i2c/busses/Kconfig1
-rw-r--r--drivers/i2c/busses/i2c-gpio.c2
-rw-r--r--drivers/i2c/busses/i2c-piix4.c6
-rw-r--r--drivers/i2c/busses/i2c-pxa.c2
-rw-r--r--drivers/ide/Kconfig4
-rw-r--r--drivers/ide/ide-iops.c3
-rw-r--r--drivers/ide/pci/alim15x3.c7
-rw-r--r--drivers/ide/pci/hpt366.c138
-rw-r--r--drivers/ide/pci/pdc202xx_new.c9
-rw-r--r--drivers/ide/pci/via82cxxx.c16
-rw-r--r--drivers/ide/ppc/mpc8xx.c1
-rw-r--r--drivers/ide/setup-pci.c41
-rw-r--r--drivers/infiniband/hw/cxgb3/cxio_hal.c2
-rw-r--r--drivers/infiniband/hw/ehca/ehca_hca.c10
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c48
-rw-r--r--drivers/infiniband/hw/ehca/ehca_qp.c10
-rw-r--r--drivers/infiniband/hw/ehca/ipz_pt_fn.c2
-rw-r--r--drivers/input/joystick/iforce/iforce-packets.c8
-rw-r--r--drivers/input/keyboard/gpio_keys.c1
-rw-r--r--drivers/input/mouse/touchkit_ps2.h3
-rw-r--r--drivers/input/serio/gscps2.c6
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h10
-rw-r--r--drivers/input/serio/i8042.c6
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c2
-rw-r--r--drivers/lguest/interrupts_and_traps.c7
-rw-r--r--drivers/lguest/lguest.c7
-rw-r--r--drivers/md/raid5.c17
-rw-r--r--drivers/mmc/host/at91_mci.c6
-rw-r--r--drivers/mtd/maps/lubbock-flash.c6
-rw-r--r--drivers/mtd/maps/mainstone-flash.c5
-rw-r--r--drivers/mtd/mtdsuper.c2
-rw-r--r--drivers/net/bnx2.c10
-rw-r--r--drivers/net/cxgb3/adapter.h2
-rw-r--r--drivers/net/cxgb3/common.h3
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c252
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c16
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.h2
-rw-r--r--drivers/net/cxgb3/sge.c23
-rw-r--r--drivers/net/cxgb3/t3_hw.c46
-rw-r--r--drivers/net/cxgb3/t3cdev.h3
-rw-r--r--drivers/net/ioc3-eth.c80
-rw-r--r--drivers/net/netxen/netxen_nic_hdr.h6
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c8
-rw-r--r--drivers/net/netxen/netxen_nic_main.c19
-rw-r--r--drivers/net/ps3_gelic_net.c1
-rw-r--r--drivers/net/tg3.c13
-rw-r--r--drivers/pci/probe.c2
-rw-r--r--drivers/pci/quirks.c16
-rw-r--r--drivers/pnp/quirks.c103
-rw-r--r--drivers/rtc/rtc-v3020.c9
-rw-r--r--drivers/s390/net/qeth.h4
-rw-r--r--drivers/s390/net/qeth_main.c158
-rw-r--r--drivers/s390/net/qeth_mpc.h1
-rw-r--r--drivers/s390/net/qeth_sys.c8
-rw-r--r--drivers/s390/scsi/zfcp_aux.c4
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c10
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c4
-rw-r--r--drivers/scsi/libiscsi.c65
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c21
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h1
-rw-r--r--drivers/scsi/qla2xxx/qla_gs.c28
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c51
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c1
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_version.h2
-rw-r--r--drivers/serial/8250_pci.c2
-rw-r--r--drivers/serial/Kconfig8
-rw-r--r--drivers/serial/sb1250-duart.c6
-rw-r--r--drivers/spi/atmel_spi.c2
-rw-r--r--drivers/spi/spi_bfin5xx.c3
-rw-r--r--drivers/spi/spi_imx.c2
-rw-r--r--drivers/spi/spi_mpc83xx.c8
-rw-r--r--drivers/spi/spi_s3c24xx.c1
-rw-r--r--drivers/spi/spi_s3c24xx_gpio.c2
-rw-r--r--drivers/spi/spi_txx9.c2
-rw-r--r--drivers/spi/xilinx_spi.c2
-rw-r--r--drivers/usb/core/driver.c2
-rw-r--r--drivers/usb/core/quirks.c25
-rw-r--r--drivers/usb/gadget/serial.c25
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb.c1
-rw-r--r--drivers/usb/serial/bus.c2
-rw-r--r--drivers/usb/serial/ftdi_sio.c1
-rw-r--r--drivers/usb/serial/ftdi_sio.h8
-rw-r--r--drivers/usb/serial/option.c3
-rw-r--r--drivers/usb/serial/oti6858.c15
-rw-r--r--drivers/usb/storage/unusual_devs.h30
-rw-r--r--drivers/video/console/Kconfig2
-rw-r--r--drivers/video/intelfb/intelfbhw.c6
136 files changed, 1121 insertions, 703 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 43749c86861..3f7935ab0cf 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -886,7 +886,8 @@ int __init acpi_ec_ecdt_probe(void)
886 printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n"); 886 printk(KERN_DEBUG PREFIX "Look up EC in DSDT\n");
887 status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device, 887 status = acpi_get_devices(ec_device_ids[0].id, ec_parse_device,
888 boot_ec, NULL); 888 boot_ec, NULL);
889 if (ACPI_FAILURE(status)) 889 /* Check that acpi_get_devices actually find something */
890 if (ACPI_FAILURE(status) || !boot_ec->handle)
890 goto error; 891 goto error;
891 } 892 }
892 893
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
index 430fcf4f9ef..94546695472 100644
--- a/drivers/ata/ata_generic.c
+++ b/drivers/ata/ata_generic.c
@@ -26,7 +26,7 @@
26#include <linux/libata.h> 26#include <linux/libata.h>
27 27
28#define DRV_NAME "ata_generic" 28#define DRV_NAME "ata_generic"
29#define DRV_VERSION "0.2.12" 29#define DRV_VERSION "0.2.13"
30 30
31/* 31/*
32 * A generic parallel ATA driver using libata 32 * A generic parallel ATA driver using libata
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 071d274afaa..3b8bf1812dc 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -94,7 +94,7 @@
94#include <linux/dmi.h> 94#include <linux/dmi.h>
95 95
96#define DRV_NAME "ata_piix" 96#define DRV_NAME "ata_piix"
97#define DRV_VERSION "2.11" 97#define DRV_VERSION "2.12"
98 98
99enum { 99enum {
100 PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ 100 PIIX_IOCFG = 0x54, /* IDE I/O configuration register */
@@ -130,6 +130,7 @@ enum {
130 ich6m_sata_ahci = 8, 130 ich6m_sata_ahci = 8,
131 ich8_sata_ahci = 9, 131 ich8_sata_ahci = 9,
132 piix_pata_mwdma = 10, /* PIIX3 MWDMA only */ 132 piix_pata_mwdma = 10, /* PIIX3 MWDMA only */
133 tolapai_sata_ahci = 11,
133 134
134 /* constants for mapping table */ 135 /* constants for mapping table */
135 P0 = 0, /* port 0 */ 136 P0 = 0, /* port 0 */
@@ -253,6 +254,8 @@ static const struct pci_device_id piix_pci_tbl[] = {
253 { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 254 { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
254 /* SATA Controller IDE (ICH9M) */ 255 /* SATA Controller IDE (ICH9M) */
255 { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, 256 { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci },
257 /* SATA Controller IDE (Tolapai) */
258 { 0x8086, 0x5028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, tolapai_sata_ahci },
256 259
257 { } /* terminate list */ 260 { } /* terminate list */
258}; 261};
@@ -441,12 +444,25 @@ static const struct piix_map_db ich8_map_db = {
441 }, 444 },
442}; 445};
443 446
447static const struct piix_map_db tolapai_map_db = {
448 .mask = 0x3,
449 .port_enable = 0x3,
450 .map = {
451 /* PM PS SM SS MAP */
452 { P0, NA, P1, NA }, /* 00b */
453 { RV, RV, RV, RV }, /* 01b */
454 { RV, RV, RV, RV }, /* 10b */
455 { RV, RV, RV, RV },
456 },
457};
458
444static const struct piix_map_db *piix_map_db_table[] = { 459static const struct piix_map_db *piix_map_db_table[] = {
445 [ich5_sata] = &ich5_map_db, 460 [ich5_sata] = &ich5_map_db,
446 [ich6_sata] = &ich6_map_db, 461 [ich6_sata] = &ich6_map_db,
447 [ich6_sata_ahci] = &ich6_map_db, 462 [ich6_sata_ahci] = &ich6_map_db,
448 [ich6m_sata_ahci] = &ich6m_map_db, 463 [ich6m_sata_ahci] = &ich6m_map_db,
449 [ich8_sata_ahci] = &ich8_map_db, 464 [ich8_sata_ahci] = &ich8_map_db,
465 [tolapai_sata_ahci] = &tolapai_map_db,
450}; 466};
451 467
452static struct ata_port_info piix_port_info[] = { 468static struct ata_port_info piix_port_info[] = {
@@ -560,6 +576,17 @@ static struct ata_port_info piix_port_info[] = {
560 .mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ 576 .mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
561 .port_ops = &piix_pata_ops, 577 .port_ops = &piix_pata_ops,
562 }, 578 },
579
580 /* tolapai_sata_ahci: 11: */
581 {
582 .sht = &piix_sht,
583 .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR |
584 PIIX_FLAG_AHCI,
585 .pio_mask = 0x1f, /* pio0-4 */
586 .mwdma_mask = 0x07, /* mwdma0-2 */
587 .udma_mask = ATA_UDMA6,
588 .port_ops = &piix_sata_ops,
589 },
563}; 590};
564 591
565static struct pci_bits piix_enable_bits[] = { 592static struct pci_bits piix_enable_bits[] = {
@@ -908,6 +935,13 @@ static int piix_broken_suspend(void)
908 }, 935 },
909 }, 936 },
910 { 937 {
938 .ident = "Satellite U200",
939 .matches = {
940 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
941 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"),
942 },
943 },
944 {
911 .ident = "Satellite U205", 945 .ident = "Satellite U205",
912 .matches = { 946 .matches = {
913 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 947 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
@@ -921,7 +955,8 @@ static int piix_broken_suspend(void)
921 DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M500"), 955 DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M500"),
922 }, 956 },
923 }, 957 },
924 { } 958
959 { } /* terminate list */
925 }; 960 };
926 static const char *oemstrs[] = { 961 static const char *oemstrs[] = {
927 "Tecra M3,", 962 "Tecra M3,",
@@ -1139,6 +1174,41 @@ static void __devinit piix_init_sata_map(struct pci_dev *pdev,
1139 hpriv->map = map; 1174 hpriv->map = map;
1140} 1175}
1141 1176
1177static void piix_iocfg_bit18_quirk(struct pci_dev *pdev)
1178{
1179 static struct dmi_system_id sysids[] = {
1180 {
1181 /* Clevo M570U sets IOCFG bit 18 if the cdrom
1182 * isn't used to boot the system which
1183 * disables the channel.
1184 */
1185 .ident = "M570U",
1186 .matches = {
1187 DMI_MATCH(DMI_SYS_VENDOR, "Clevo Co."),
1188 DMI_MATCH(DMI_PRODUCT_NAME, "M570U"),
1189 },
1190 },
1191
1192 { } /* terminate list */
1193 };
1194 u32 iocfg;
1195
1196 if (!dmi_check_system(sysids))
1197 return;
1198
1199 /* The datasheet says that bit 18 is NOOP but certain systems
1200 * seem to use it to disable a channel. Clear the bit on the
1201 * affected systems.
1202 */
1203 pci_read_config_dword(pdev, PIIX_IOCFG, &iocfg);
1204 if (iocfg & (1 << 18)) {
1205 dev_printk(KERN_INFO, &pdev->dev,
1206 "applying IOCFG bit18 quirk\n");
1207 iocfg &= ~(1 << 18);
1208 pci_write_config_dword(pdev, PIIX_IOCFG, iocfg);
1209 }
1210}
1211
1142/** 1212/**
1143 * piix_init_one - Register PIIX ATA PCI device with kernel services 1213 * piix_init_one - Register PIIX ATA PCI device with kernel services
1144 * @pdev: PCI device to register 1214 * @pdev: PCI device to register
@@ -1200,6 +1270,9 @@ static int piix_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1200 piix_map_db_table[ent->driver_data]); 1270 piix_map_db_table[ent->driver_data]);
1201 } 1271 }
1202 1272
1273 /* apply IOCFG bit18 quirk */
1274 piix_iocfg_bit18_quirk(pdev);
1275
1203 /* On ICH5, some BIOSen disable the interrupt using the 1276 /* On ICH5, some BIOSen disable the interrupt using the
1204 * PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3. 1277 * PCI_COMMAND_INTX_DISABLE bit added in PCI 2.3.
1205 * On ICH6, this bit has the same effect, but only when 1278 * On ICH6, this bit has the same effect, but only when
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 2ad4dda6d4a..c43de9a710d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1911,8 +1911,9 @@ int ata_dev_configure(struct ata_device *dev)
1911 dev->flags |= ATA_DFLAG_FLUSH_EXT; 1911 dev->flags |= ATA_DFLAG_FLUSH_EXT;
1912 } 1912 }
1913 1913
1914 if (ata_id_hpa_enabled(dev->id)) 1914 if (!(dev->horkage & ATA_HORKAGE_BROKEN_HPA) &&
1915 dev->n_sectors = ata_hpa_resize(dev); 1915 ata_id_hpa_enabled(dev->id))
1916 dev->n_sectors = ata_hpa_resize(dev);
1916 1917
1917 /* config NCQ */ 1918 /* config NCQ */
1918 ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc)); 1919 ata_dev_config_ncq(dev, ncq_desc, sizeof(ncq_desc));
@@ -3795,7 +3796,11 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
3795 { "ST9160821AS", "3.CLF", ATA_HORKAGE_NONCQ, }, 3796 { "ST9160821AS", "3.CLF", ATA_HORKAGE_NONCQ, },
3796 { "SAMSUNG HD401LJ", "ZZ100-15", ATA_HORKAGE_NONCQ, }, 3797 { "SAMSUNG HD401LJ", "ZZ100-15", ATA_HORKAGE_NONCQ, },
3797 3798
3798 /* Devices with NCQ limits */ 3799 /* devices which puke on READ_NATIVE_MAX */
3800 { "HDS724040KLSA80", "KFAOA20N", ATA_HORKAGE_BROKEN_HPA, },
3801 { "WDC WD3200JD-00KLB0", "WD-WCAMR1130137", ATA_HORKAGE_BROKEN_HPA },
3802 { "WDC WD2500JD-00HBB0", "WD-WMAL71490727", ATA_HORKAGE_BROKEN_HPA },
3803 { "MAXTOR 6L080L4", "A93.0500", ATA_HORKAGE_BROKEN_HPA },
3799 3804
3800 /* End Marker */ 3805 /* End Marker */
3801 { } 3806 { }
@@ -3985,6 +3990,11 @@ static unsigned int ata_dev_init_params(struct ata_device *dev,
3985 tf.device |= (heads - 1) & 0x0f; /* max head = num. of heads - 1 */ 3990 tf.device |= (heads - 1) & 0x0f; /* max head = num. of heads - 1 */
3986 3991
3987 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0); 3992 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0);
3993 /* A clean abort indicates an original or just out of spec drive
3994 and we should continue as we issue the setup based on the
3995 drive reported working geometry */
3996 if (err_mask == AC_ERR_DEV && (tf.feature & ATA_ABORTED))
3997 err_mask = 0;
3988 3998
3989 DPRINTK("EXIT, err_mask=%x\n", err_mask); 3999 DPRINTK("EXIT, err_mask=%x\n", err_mask);
3990 return err_mask; 4000 return err_mask;
@@ -6025,6 +6035,7 @@ void ata_dev_init(struct ata_device *dev)
6025 */ 6035 */
6026 spin_lock_irqsave(ap->lock, flags); 6036 spin_lock_irqsave(ap->lock, flags);
6027 dev->flags &= ~ATA_DFLAG_INIT_MASK; 6037 dev->flags &= ~ATA_DFLAG_INIT_MASK;
6038 dev->horkage = 0;
6028 spin_unlock_irqrestore(ap->lock, flags); 6039 spin_unlock_irqrestore(ap->lock, flags);
6029 6040
6030 memset((void *)dev + ATA_DEVICE_CLEAR_OFFSET, 0, 6041 memset((void *)dev + ATA_DEVICE_CLEAR_OFFSET, 0,
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index e8a28e94fe4..71bdc3b3189 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -34,7 +34,7 @@
34#include <linux/dmi.h> 34#include <linux/dmi.h>
35 35
36#define DRV_NAME "pata_ali" 36#define DRV_NAME "pata_ali"
37#define DRV_VERSION "0.7.4" 37#define DRV_VERSION "0.7.5"
38 38
39/* 39/*
40 * Cable special cases 40 * Cable special cases
@@ -48,6 +48,13 @@ static struct dmi_system_id cable_dmi_table[] = {
48 DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"), 48 DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
49 }, 49 },
50 }, 50 },
51 {
52 .ident = "Toshiba Satelite S1800-814",
53 .matches = {
54 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
55 DMI_MATCH(DMI_PRODUCT_NAME, "S1800-814"),
56 },
57 },
51 { } 58 { }
52}; 59};
53 60
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index b09facad63e..04048fcf630 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -25,7 +25,7 @@
25#include <linux/libata.h> 25#include <linux/libata.h>
26 26
27#define DRV_NAME "pata_amd" 27#define DRV_NAME "pata_amd"
28#define DRV_VERSION "0.3.8" 28#define DRV_VERSION "0.3.9"
29 29
30/** 30/**
31 * timing_setup - shared timing computation and load 31 * timing_setup - shared timing computation and load
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index 80509be49e7..86f85a2cab7 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -22,7 +22,7 @@
22#include <linux/libata.h> 22#include <linux/libata.h>
23 23
24#define DRV_NAME "pata_atiixp" 24#define DRV_NAME "pata_atiixp"
25#define DRV_VERSION "0.4.5" 25#define DRV_VERSION "0.4.6"
26 26
27enum { 27enum {
28 ATIIXP_IDE_PIO_TIMING = 0x40, 28 ATIIXP_IDE_PIO_TIMING = 0x40,
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index 7dc76e71bd5..e2459088cdc 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -41,7 +41,7 @@
41#include <linux/libata.h> 41#include <linux/libata.h>
42 42
43#define DRV_NAME "pata_cs5520" 43#define DRV_NAME "pata_cs5520"
44#define DRV_VERSION "0.6.5" 44#define DRV_VERSION "0.6.6"
45 45
46struct pio_clocks 46struct pio_clocks
47{ 47{
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c
index 68f150a1e2f..c6066aa43ec 100644
--- a/drivers/ata/pata_cs5530.c
+++ b/drivers/ata/pata_cs5530.c
@@ -35,7 +35,7 @@
35#include <linux/dmi.h> 35#include <linux/dmi.h>
36 36
37#define DRV_NAME "pata_cs5530" 37#define DRV_NAME "pata_cs5530"
38#define DRV_VERSION "0.7.3" 38#define DRV_VERSION "0.7.4"
39 39
40static void __iomem *cs5530_port_base(struct ata_port *ap) 40static void __iomem *cs5530_port_base(struct ata_port *ap)
41{ 41{
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c
index 91a396fa5b2..9e553c54203 100644
--- a/drivers/ata/pata_isapnp.c
+++ b/drivers/ata/pata_isapnp.c
@@ -17,7 +17,7 @@
17#include <linux/libata.h> 17#include <linux/libata.h>
18 18
19#define DRV_NAME "pata_isapnp" 19#define DRV_NAME "pata_isapnp"
20#define DRV_VERSION "0.2.1" 20#define DRV_VERSION "0.2.2"
21 21
22static struct scsi_host_template isapnp_sht = { 22static struct scsi_host_template isapnp_sht = {
23 .module = THIS_MODULE, 23 .module = THIS_MODULE,
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index 7225124d96c..5d8b91e70ec 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -80,7 +80,7 @@
80 80
81 81
82#define DRV_NAME "pata_it821x" 82#define DRV_NAME "pata_it821x"
83#define DRV_VERSION "0.3.7" 83#define DRV_VERSION "0.3.8"
84 84
85struct it821x_dev 85struct it821x_dev
86{ 86{
@@ -533,6 +533,10 @@ static int it821x_check_atapi_dma(struct ata_queued_cmd *qc)
533 struct ata_port *ap = qc->ap; 533 struct ata_port *ap = qc->ap;
534 struct it821x_dev *itdev = ap->private_data; 534 struct it821x_dev *itdev = ap->private_data;
535 535
536 /* Only use dma for transfers to/from the media. */
537 if (qc->nbytes < 2048)
538 return -EOPNOTSUPP;
539
536 /* No ATAPI DMA in smart mode */ 540 /* No ATAPI DMA in smart mode */
537 if (itdev->smart) 541 if (itdev->smart)
538 return -EOPNOTSUPP; 542 return -EOPNOTSUPP;
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c
index 87594c04d3a..ae206f35f74 100644
--- a/drivers/ata/pata_marvell.c
+++ b/drivers/ata/pata_marvell.c
@@ -192,6 +192,8 @@ static int marvell_init_one (struct pci_dev *pdev, const struct pci_device_id *i
192 192
193static const struct pci_device_id marvell_pci_tbl[] = { 193static const struct pci_device_id marvell_pci_tbl[] = {
194 { PCI_DEVICE(0x11AB, 0x6101), }, 194 { PCI_DEVICE(0x11AB, 0x6101), },
195 { PCI_DEVICE(0x11AB, 0x6121), },
196 { PCI_DEVICE(0x11AB, 0x6123), },
195 { PCI_DEVICE(0x11AB, 0x6145), }, 197 { PCI_DEVICE(0x11AB, 0x6145), },
196 { } /* terminate list */ 198 { } /* terminate list */
197}; 199};
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index 182e83c9047..099f4cdc4cd 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -24,7 +24,7 @@
24 24
25 25
26#define DRV_NAME "mpc52xx_ata" 26#define DRV_NAME "mpc52xx_ata"
27#define DRV_VERSION "0.1.0ac2" 27#define DRV_VERSION "0.1.2"
28 28
29 29
30/* Private structures used by the driver */ 30/* Private structures used by the driver */
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 6da23feed03..0f2b027624d 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -42,7 +42,7 @@
42 42
43 43
44#define DRV_NAME "pata_pcmcia" 44#define DRV_NAME "pata_pcmcia"
45#define DRV_VERSION "0.3.1" 45#define DRV_VERSION "0.3.2"
46 46
47/* 47/*
48 * Private data structure to glue stuff together 48 * Private data structure to glue stuff together
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index e3245b36269..bb64a986e8f 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -35,7 +35,7 @@
35#include <linux/libata.h> 35#include <linux/libata.h>
36 36
37#define DRV_NAME "pata_pdc2027x" 37#define DRV_NAME "pata_pdc2027x"
38#define DRV_VERSION "0.9" 38#define DRV_VERSION "1.0"
39#undef PDC_DEBUG 39#undef PDC_DEBUG
40 40
41#ifdef PDC_DEBUG 41#ifdef PDC_DEBUG
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index a909f793ffc..5086d03f2d7 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -22,7 +22,7 @@
22#include <linux/pata_platform.h> 22#include <linux/pata_platform.h>
23 23
24#define DRV_NAME "pata_platform" 24#define DRV_NAME "pata_platform"
25#define DRV_VERSION "1.0" 25#define DRV_VERSION "1.1"
26 26
27static int pio_mask = 1; 27static int pio_mask = 1;
28 28
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c
index b8b2d11e418..5edf67b1f3b 100644
--- a/drivers/ata/pata_sc1200.c
+++ b/drivers/ata/pata_sc1200.c
@@ -40,7 +40,7 @@
40#include <linux/libata.h> 40#include <linux/libata.h>
41 41
42#define DRV_NAME "sc1200" 42#define DRV_NAME "sc1200"
43#define DRV_VERSION "0.2.5" 43#define DRV_VERSION "0.2.6"
44 44
45#define SC1200_REV_A 0x00 45#define SC1200_REV_A 0x00
46#define SC1200_REV_B1 0x01 46#define SC1200_REV_B1 0x01
diff --git a/drivers/ata/pata_scc.c b/drivers/ata/pata_scc.c
index 36cdbd2b0bd..2d048ef25a5 100644
--- a/drivers/ata/pata_scc.c
+++ b/drivers/ata/pata_scc.c
@@ -43,7 +43,7 @@
43#include <linux/libata.h> 43#include <linux/libata.h>
44 44
45#define DRV_NAME "pata_scc" 45#define DRV_NAME "pata_scc"
46#define DRV_VERSION "0.2" 46#define DRV_VERSION "0.3"
47 47
48#define PCI_DEVICE_ID_TOSHIBA_SCC_ATA 0x01b4 48#define PCI_DEVICE_ID_TOSHIBA_SCC_ATA 0x01b4
49 49
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index 89691541fe5..0faf99c8f13 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -41,7 +41,7 @@
41#include <linux/libata.h> 41#include <linux/libata.h>
42 42
43#define DRV_NAME "pata_serverworks" 43#define DRV_NAME "pata_serverworks"
44#define DRV_VERSION "0.4.1" 44#define DRV_VERSION "0.4.2"
45 45
46#define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */ 46#define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */
47#define SVWKS_CSB6_REVISION 0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */ 47#define SVWKS_CSB6_REVISION 0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index b0cd52d6e3f..40395804a66 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -33,7 +33,7 @@
33#include <linux/libata.h> 33#include <linux/libata.h>
34 34
35#define DRV_NAME "pata_sil680" 35#define DRV_NAME "pata_sil680"
36#define DRV_VERSION "0.4.6" 36#define DRV_VERSION "0.4.7"
37 37
38#define SIL680_MMIO_BAR 5 38#define SIL680_MMIO_BAR 5
39 39
diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c
index 8c2813aa6cd..c0f43bb2595 100644
--- a/drivers/ata/pata_sl82c105.c
+++ b/drivers/ata/pata_sl82c105.c
@@ -26,7 +26,7 @@
26#include <linux/libata.h> 26#include <linux/libata.h>
27 27
28#define DRV_NAME "pata_sl82c105" 28#define DRV_NAME "pata_sl82c105"
29#define DRV_VERSION "0.3.1" 29#define DRV_VERSION "0.3.2"
30 30
31enum { 31enum {
32 /* 32 /*
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index ea18e33f50e..636c4f1a0b2 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -97,6 +97,7 @@ static const struct via_isa_bridge {
97 u8 rev_max; 97 u8 rev_max;
98 u16 flags; 98 u16 flags;
99} via_isa_bridges[] = { 99} via_isa_bridges[] = {
100 { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
100 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 101 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
101 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 102 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
102 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 103 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
@@ -243,7 +244,6 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
243 int ut; 244 int ut;
244 int offset = 3 - (2*ap->port_no) - adev->devno; 245 int offset = 3 - (2*ap->port_no) - adev->devno;
245 246
246
247 /* Calculate the timing values we require */ 247 /* Calculate the timing values we require */
248 ata_timing_compute(adev, mode, &t, T, UT); 248 ata_timing_compute(adev, mode, &t, T, UT);
249 249
@@ -290,9 +290,17 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
290 ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07; 290 ut = t.udma ? (0xe0 | (FIT(t.udma, 2, 9) - 2)) : 0x07;
291 break; 291 break;
292 } 292 }
293
293 /* Set UDMA unless device is not UDMA capable */ 294 /* Set UDMA unless device is not UDMA capable */
294 if (udma_type) 295 if (udma_type) {
295 pci_write_config_byte(pdev, 0x50 + offset, ut); 296 u8 cable80_status;
297
298 /* Get 80-wire cable detection bit */
299 pci_read_config_byte(pdev, 0x50 + offset, &cable80_status);
300 cable80_status &= 0x10;
301
302 pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
303 }
296} 304}
297 305
298static void via_set_piomode(struct ata_port *ap, struct ata_device *adev) 306static void via_set_piomode(struct ata_port *ap, struct ata_device *adev)
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
index bec1de594de..5c79271401a 100644
--- a/drivers/ata/pdc_adma.c
+++ b/drivers/ata/pdc_adma.c
@@ -44,7 +44,7 @@
44#include <linux/libata.h> 44#include <linux/libata.h>
45 45
46#define DRV_NAME "pdc_adma" 46#define DRV_NAME "pdc_adma"
47#define DRV_VERSION "0.06" 47#define DRV_VERSION "1.0"
48 48
49/* macro to calculate base address for ATA regs */ 49/* macro to calculate base address for ATA regs */
50#define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40)) 50#define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40))
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index a9c948d7604..fdbed8ecdfc 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -28,7 +28,7 @@
28#include <scsi/scsi_device.h> 28#include <scsi/scsi_device.h>
29 29
30#define DRV_NAME "sata_inic162x" 30#define DRV_NAME "sata_inic162x"
31#define DRV_VERSION "0.2" 31#define DRV_VERSION "0.3"
32 32
33enum { 33enum {
34 MMIO_BAR = 5, 34 MMIO_BAR = 5,
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 3acf65e75eb..11bf6c7ac12 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -72,7 +72,7 @@
72#include <linux/libata.h> 72#include <linux/libata.h>
73 73
74#define DRV_NAME "sata_mv" 74#define DRV_NAME "sata_mv"
75#define DRV_VERSION "0.81" 75#define DRV_VERSION "1.0"
76 76
77enum { 77enum {
78 /* BAR's are enumerated in terms of pci_resource_start() terms */ 78 /* BAR's are enumerated in terms of pci_resource_start() terms */
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 0b58c4df6fd..40dc7313985 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -49,7 +49,7 @@
49#include <linux/libata.h> 49#include <linux/libata.h>
50 50
51#define DRV_NAME "sata_nv" 51#define DRV_NAME "sata_nv"
52#define DRV_VERSION "3.4" 52#define DRV_VERSION "3.5"
53 53
54#define NV_ADMA_DMA_BOUNDARY 0xffffffffUL 54#define NV_ADMA_DMA_BOUNDARY 0xffffffffUL
55 55
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index d39ebc23c4a..25698cf0dce 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -45,7 +45,7 @@
45#include "sata_promise.h" 45#include "sata_promise.h"
46 46
47#define DRV_NAME "sata_promise" 47#define DRV_NAME "sata_promise"
48#define DRV_VERSION "2.09" 48#define DRV_VERSION "2.10"
49 49
50enum { 50enum {
51 PDC_MAX_PORTS = 4, 51 PDC_MAX_PORTS = 4,
@@ -328,8 +328,8 @@ static const struct pci_device_id pdc_ata_pci_tbl[] = {
328 328
329 { PCI_VDEVICE(PROMISE, 0x3318), board_20319 }, 329 { PCI_VDEVICE(PROMISE, 0x3318), board_20319 },
330 { PCI_VDEVICE(PROMISE, 0x3319), board_20319 }, 330 { PCI_VDEVICE(PROMISE, 0x3319), board_20319 },
331 { PCI_VDEVICE(PROMISE, 0x3515), board_20319 }, 331 { PCI_VDEVICE(PROMISE, 0x3515), board_40518 },
332 { PCI_VDEVICE(PROMISE, 0x3519), board_20319 }, 332 { PCI_VDEVICE(PROMISE, 0x3519), board_40518 },
333 { PCI_VDEVICE(PROMISE, 0x3d17), board_40518 }, 333 { PCI_VDEVICE(PROMISE, 0x3d17), board_40518 },
334 { PCI_VDEVICE(PROMISE, 0x3d18), board_40518 }, 334 { PCI_VDEVICE(PROMISE, 0x3d18), board_40518 },
335 335
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c
index c8f9242e7f4..5e1dfdda698 100644
--- a/drivers/ata/sata_qstor.c
+++ b/drivers/ata/sata_qstor.c
@@ -39,7 +39,7 @@
39#include <linux/libata.h> 39#include <linux/libata.h>
40 40
41#define DRV_NAME "sata_qstor" 41#define DRV_NAME "sata_qstor"
42#define DRV_VERSION "0.08" 42#define DRV_VERSION "0.09"
43 43
44enum { 44enum {
45 QS_MMIO_BAR = 4, 45 QS_MMIO_BAR = 4,
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index db676375895..8c72e714b45 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -46,7 +46,7 @@
46#include <linux/libata.h> 46#include <linux/libata.h>
47 47
48#define DRV_NAME "sata_sil" 48#define DRV_NAME "sata_sil"
49#define DRV_VERSION "2.2" 49#define DRV_VERSION "2.3"
50 50
51enum { 51enum {
52 SIL_MMIO_BAR = 5, 52 SIL_MMIO_BAR = 5,
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 46fbbe7f121..ef83e6b1e31 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -30,7 +30,7 @@
30#include <linux/libata.h> 30#include <linux/libata.h>
31 31
32#define DRV_NAME "sata_sil24" 32#define DRV_NAME "sata_sil24"
33#define DRV_VERSION "0.9" 33#define DRV_VERSION "1.0"
34 34
35/* 35/*
36 * Port request block (PRB) 32 bytes 36 * Port request block (PRB) 32 bytes
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 31a2f55aae6..41c1d6e8f1f 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -43,7 +43,7 @@
43#include "sis.h" 43#include "sis.h"
44 44
45#define DRV_NAME "sata_sis" 45#define DRV_NAME "sata_sis"
46#define DRV_VERSION "0.8" 46#define DRV_VERSION "1.0"
47 47
48enum { 48enum {
49 sis_180 = 0, 49 sis_180 = 0,
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index 92e87707503..d9678e7bc3a 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -53,7 +53,7 @@
53#endif /* CONFIG_PPC_OF */ 53#endif /* CONFIG_PPC_OF */
54 54
55#define DRV_NAME "sata_svw" 55#define DRV_NAME "sata_svw"
56#define DRV_VERSION "2.2" 56#define DRV_VERSION "2.3"
57 57
58enum { 58enum {
59 /* ap->flags bits */ 59 /* ap->flags bits */
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index 5193bd8647b..97aefdd87be 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -92,7 +92,7 @@
92#include "sata_promise.h" 92#include "sata_promise.h"
93 93
94#define DRV_NAME "sata_sx4" 94#define DRV_NAME "sata_sx4"
95#define DRV_VERSION "0.11" 95#define DRV_VERSION "0.12"
96 96
97 97
98enum { 98enum {
diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c
index 78c28512f01..e6b8b45279a 100644
--- a/drivers/ata/sata_uli.c
+++ b/drivers/ata/sata_uli.c
@@ -36,7 +36,7 @@
36#include <linux/libata.h> 36#include <linux/libata.h>
37 37
38#define DRV_NAME "sata_uli" 38#define DRV_NAME "sata_uli"
39#define DRV_VERSION "1.2" 39#define DRV_VERSION "1.3"
40 40
41enum { 41enum {
42 uli_5289 = 0, 42 uli_5289 = 0,
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index 86b7bfc1732..57fd30de8f0 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -46,7 +46,7 @@
46#include <linux/libata.h> 46#include <linux/libata.h>
47 47
48#define DRV_NAME "sata_via" 48#define DRV_NAME "sata_via"
49#define DRV_VERSION "2.2" 49#define DRV_VERSION "2.3"
50 50
51enum board_ids_enum { 51enum board_ids_enum {
52 vt6420, 52 vt6420,
@@ -371,7 +371,7 @@ static void vt6421_set_dma_mode(struct ata_port *ap, struct ata_device *adev)
371{ 371{
372 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 372 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
373 static const u8 udma_bits[] = { 0xEE, 0xE8, 0xE6, 0xE4, 0xE2, 0xE1, 0xE0, 0xE0 }; 373 static const u8 udma_bits[] = { 0xEE, 0xE8, 0xE6, 0xE4, 0xE2, 0xE1, 0xE0, 0xE0 };
374 pci_write_config_byte(pdev, PATA_UDMA_TIMING, udma_bits[adev->pio_mode - XFER_UDMA_0]); 374 pci_write_config_byte(pdev, PATA_UDMA_TIMING, udma_bits[adev->dma_mode - XFER_UDMA_0]);
375} 375}
376 376
377static const unsigned int svia_bar_sizes[] = { 377static const unsigned int svia_bar_sizes[] = {
diff --git a/drivers/ata/sata_vsc.c b/drivers/ata/sata_vsc.c
index 24344d0d057..1920915dfa2 100644
--- a/drivers/ata/sata_vsc.c
+++ b/drivers/ata/sata_vsc.c
@@ -47,7 +47,7 @@
47#include <linux/libata.h> 47#include <linux/libata.h>
48 48
49#define DRV_NAME "sata_vsc" 49#define DRV_NAME "sata_vsc"
50#define DRV_VERSION "2.2" 50#define DRV_VERSION "2.3"
51 51
52enum { 52enum {
53 VSC_MMIO_BAR = 0, 53 VSC_MMIO_BAR = 0,
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 92bf868ca05..504a95d888b 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -17,8 +17,8 @@
17*/ 17*/
18 18
19 19
20#define DAC960_DriverVersion "2.5.48" 20#define DAC960_DriverVersion "2.5.49"
21#define DAC960_DriverDate "14 May 2006" 21#define DAC960_DriverDate "21 Aug 2007"
22 22
23 23
24#include <linux/module.h> 24#include <linux/module.h>
@@ -1165,9 +1165,9 @@ static bool DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T
1165 int i; 1165 int i;
1166 1166
1167 1167
1168 if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V1_PciDmaMask)) 1168 if (pci_set_dma_mask(Controller->PCIDevice, DMA_32BIT_MASK))
1169 return DAC960_Failure(Controller, "DMA mask out of range"); 1169 return DAC960_Failure(Controller, "DMA mask out of range");
1170 Controller->BounceBufferLimit = DAC690_V1_PciDmaMask; 1170 Controller->BounceBufferLimit = DMA_32BIT_MASK;
1171 1171
1172 if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) { 1172 if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) {
1173 CommandMailboxesSize = 0; 1173 CommandMailboxesSize = 0;
@@ -1368,9 +1368,12 @@ static bool DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T
1368 dma_addr_t CommandMailboxDMA; 1368 dma_addr_t CommandMailboxDMA;
1369 DAC960_V2_CommandStatus_T CommandStatus; 1369 DAC960_V2_CommandStatus_T CommandStatus;
1370 1370
1371 if (pci_set_dma_mask(Controller->PCIDevice, DAC690_V2_PciDmaMask)) 1371 if (!pci_set_dma_mask(Controller->PCIDevice, DMA_64BIT_MASK))
1372 return DAC960_Failure(Controller, "DMA mask out of range"); 1372 Controller->BounceBufferLimit = DMA_64BIT_MASK;
1373 Controller->BounceBufferLimit = DAC690_V2_PciDmaMask; 1373 else if (!pci_set_dma_mask(Controller->PCIDevice, DMA_32BIT_MASK))
1374 Controller->BounceBufferLimit = DMA_32BIT_MASK;
1375 else
1376 return DAC960_Failure(Controller, "DMA mask out of range");
1374 1377
1375 /* This is a temporary dma mapping, used only in the scope of this function */ 1378 /* This is a temporary dma mapping, used only in the scope of this function */
1376 CommandMailbox = pci_alloc_consistent(PCI_Device, 1379 CommandMailbox = pci_alloc_consistent(PCI_Device,
diff --git a/drivers/block/DAC960.h b/drivers/block/DAC960.h
index f5e2436c39a..85fa9bb6375 100644
--- a/drivers/block/DAC960.h
+++ b/drivers/block/DAC960.h
@@ -61,13 +61,6 @@
61#define DAC960_V2_MaxPhysicalDevices 272 61#define DAC960_V2_MaxPhysicalDevices 272
62 62
63/* 63/*
64 Define the pci dma mask supported by DAC960 V1 and V2 Firmware Controlers
65 */
66
67#define DAC690_V1_PciDmaMask 0xffffffff
68#define DAC690_V2_PciDmaMask 0xffffffffffffffffULL
69
70/*
71 Define a 32/64 bit I/O Address data type. 64 Define a 32/64 bit I/O Address data type.
72*/ 65*/
73 66
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 59b054810ed..98a9cdeaffb 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -691,15 +691,18 @@ static void hci_usb_rx_complete(struct urb *urb)
691 urb->iso_frame_desc[i].offset, 691 urb->iso_frame_desc[i].offset,
692 urb->iso_frame_desc[i].actual_length); 692 urb->iso_frame_desc[i].actual_length);
693 693
694 if (!urb->iso_frame_desc[i].status) 694 if (!urb->iso_frame_desc[i].status) {
695 husb->hdev->stat.byte_rx += urb->iso_frame_desc[i].actual_length;
695 hci_recv_fragment(husb->hdev, _urb->type, 696 hci_recv_fragment(husb->hdev, _urb->type,
696 urb->transfer_buffer + urb->iso_frame_desc[i].offset, 697 urb->transfer_buffer + urb->iso_frame_desc[i].offset,
697 urb->iso_frame_desc[i].actual_length); 698 urb->iso_frame_desc[i].actual_length);
699 }
698 } 700 }
699#else 701#else
700 ; 702 ;
701#endif 703#endif
702 } else { 704 } else {
705 husb->hdev->stat.byte_rx += count;
703 err = hci_recv_fragment(husb->hdev, _urb->type, urb->transfer_buffer, count); 706 err = hci_recv_fragment(husb->hdev, _urb->type, urb->transfer_buffer, count);
704 if (err < 0) { 707 if (err < 0) {
705 BT_ERR("%s corrupted packet: type %d count %d", 708 BT_ERR("%s corrupted packet: type %d count %d",
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 2c9ca2c6462..7c69bf259ca 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -506,6 +506,11 @@ static void intel_i830_init_gtt_entries(void)
506 break; 506 break;
507 } 507 }
508 } else { 508 } else {
509 /* G33's GTT stolen memory is separate from gfx data
510 * stolen memory.
511 */
512 if (IS_G33)
513 size = 0;
509 switch (gmch_ctrl & I830_GMCH_GMS_MASK) { 514 switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
510 case I855_GMCH_GMS_STOLEN_1M: 515 case I855_GMCH_GMS_STOLEN_1M:
511 gtt_entries = MB(1) - KB(size); 516 gtt_entries = MB(1) - KB(size);
@@ -914,6 +919,7 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
914 struct aper_size_info_fixed *size; 919 struct aper_size_info_fixed *size;
915 int num_entries; 920 int num_entries;
916 u32 temp, temp2; 921 u32 temp, temp2;
922 int gtt_map_size = 256 * 1024;
917 923
918 size = agp_bridge->current_size; 924 size = agp_bridge->current_size;
919 page_order = size->page_order; 925 page_order = size->page_order;
@@ -923,7 +929,9 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
923 pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp); 929 pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp);
924 pci_read_config_dword(intel_private.pcidev, I915_PTEADDR,&temp2); 930 pci_read_config_dword(intel_private.pcidev, I915_PTEADDR,&temp2);
925 931
926 intel_private.gtt = ioremap(temp2, 256 * 1024); 932 if (IS_G33)
933 gtt_map_size = 1024 * 1024; /* 1M on G33 */
934 intel_private.gtt = ioremap(temp2, gtt_map_size);
927 if (!intel_private.gtt) 935 if (!intel_private.gtt)
928 return -ENOMEM; 936 return -ENOMEM;
929 937
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 77bf4aa217a..7ecffc9c738 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -909,6 +909,8 @@ int hpet_alloc(struct hpet_data *hdp)
909 909
910 hpetp->hp_delta = hpet_calibrate(hpetp); 910 hpetp->hp_delta = hpet_calibrate(hpetp);
911 911
912/* This clocksource driver currently only works on ia64 */
913#ifdef CONFIG_IA64
912 if (!hpet_clocksource) { 914 if (!hpet_clocksource) {
913 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; 915 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc;
914 CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr); 916 CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr);
@@ -918,6 +920,7 @@ int hpet_alloc(struct hpet_data *hdp)
918 hpetp->hp_clocksource = &clocksource_hpet; 920 hpetp->hp_clocksource = &clocksource_hpet;
919 hpet_clocksource = &clocksource_hpet; 921 hpet_clocksource = &clocksource_hpet;
920 } 922 }
923#endif
921 924
922 return 0; 925 return 0;
923} 926}
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 3423e9ee648..4a8969cef31 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -796,14 +796,14 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
796 retval = inq_canon(tty); 796 retval = inq_canon(tty);
797 return put_user(retval, (unsigned int __user *) arg); 797 return put_user(retval, (unsigned int __user *) arg);
798 case TIOCGLCKTRMIOS: 798 case TIOCGLCKTRMIOS:
799 if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked)) 799 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked))
800 return -EFAULT; 800 return -EFAULT;
801 return 0; 801 return 0;
802 802
803 case TIOCSLCKTRMIOS: 803 case TIOCSLCKTRMIOS:
804 if (!capable(CAP_SYS_ADMIN)) 804 if (!capable(CAP_SYS_ADMIN))
805 return -EPERM; 805 return -EPERM;
806 if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg)) 806 if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg))
807 return -EFAULT; 807 return -EFAULT;
808 return 0; 808 return 0;
809 809
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index 3bba224cb55..6eb434749cd 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -967,7 +967,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
967 if (!force_function_unhide && !(stat8 & (1 << 5))) { 967 if (!force_function_unhide && !(stat8 & (1 << 5))) {
968 printk(KERN_INFO "Contact your BIOS vendor to see if the " 968 printk(KERN_INFO "Contact your BIOS vendor to see if the "
969 "E752x error registers can be safely un-hidden\n"); 969 "E752x error registers can be safely un-hidden\n");
970 return -ENOMEM; 970 return -ENODEV;
971 } 971 }
972 stat8 |= (1 << 5); 972 stat8 |= (1 << 5);
973 pci_write_config_byte(pdev, E752X_DEVPRES1, stat8); 973 pci_write_config_byte(pdev, E752X_DEVPRES1, stat8);
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h
index 4e6bad15c4b..e80af67664c 100644
--- a/drivers/edac/edac_core.h
+++ b/drivers/edac/edac_core.h
@@ -75,7 +75,7 @@ extern int edac_debug_level;
75#define edac_debug_printk(level, fmt, arg...) \ 75#define edac_debug_printk(level, fmt, arg...) \
76 do { \ 76 do { \
77 if (level <= edac_debug_level) \ 77 if (level <= edac_debug_level) \
78 edac_printk(KERN_EMERG, EDAC_DEBUG, fmt, ##arg); \ 78 edac_printk(KERN_DEBUG, EDAC_DEBUG, fmt, ##arg); \
79 } while(0) 79 } while(0)
80 80
81#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ ) 81#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ )
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 7e427b4c74b..e14c1ca7813 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -1945,10 +1945,8 @@ static int pci_suspend(struct pci_dev *pdev, pm_message_t state)
1945 return err; 1945 return err;
1946 } 1946 }
1947 err = pci_set_power_state(pdev, pci_choose_state(pdev, state)); 1947 err = pci_set_power_state(pdev, pci_choose_state(pdev, state));
1948 if (err) { 1948 if (err)
1949 fw_error("pci_set_power_state failed\n"); 1949 fw_error("pci_set_power_state failed with %d\n", err);
1950 return err;
1951 }
1952 1950
1953 return 0; 1951 return 0;
1954} 1952}
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
index 565c4e679b8..6eea3476b90 100644
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -882,7 +882,7 @@ static int __init lm78_isa_device_add(unsigned short address)
882{ 882{
883 struct resource res = { 883 struct resource res = {
884 .start = address, 884 .start = address,
885 .end = address + LM78_EXTENT, 885 .end = address + LM78_EXTENT - 1,
886 .name = "lm78", 886 .name = "lm78",
887 .flags = IORESOURCE_IO, 887 .flags = IORESOURCE_IO,
888 }; 888 };
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index c95909cc1d2..dcc941a5aaf 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -1746,7 +1746,7 @@ w83781d_isa_device_add(unsigned short address)
1746{ 1746{
1747 struct resource res = { 1747 struct resource res = {
1748 .start = address, 1748 .start = address,
1749 .end = address + W83781D_EXTENT, 1749 .end = address + W83781D_EXTENT - 1,
1750 .name = "w83781d", 1750 .name = "w83781d",
1751 .flags = IORESOURCE_IO, 1751 .flags = IORESOURCE_IO,
1752 }; 1752 };
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index 8a5f5825bb7..7f0a0a62cf6 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -357,13 +357,29 @@ static int sendbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
357 return wrcount; 357 return wrcount;
358} 358}
359 359
360static int acknak(struct i2c_adapter *i2c_adap, int is_ack)
361{
362 struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
363
364 /* assert: sda is high */
365 if (is_ack) /* send ack */
366 setsda(adap, 0);
367 udelay((adap->udelay + 1) / 2);
368 if (sclhi(adap) < 0) { /* timeout */
369 dev_err(&i2c_adap->dev, "readbytes: ack/nak timeout\n");
370 return -ETIMEDOUT;
371 }
372 scllo(adap);
373 return 0;
374}
375
360static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) 376static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
361{ 377{
362 int inval; 378 int inval;
363 int rdcount=0; /* counts bytes read */ 379 int rdcount=0; /* counts bytes read */
364 struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
365 unsigned char *temp = msg->buf; 380 unsigned char *temp = msg->buf;
366 int count = msg->len; 381 int count = msg->len;
382 const unsigned flags = msg->flags;
367 383
368 while (count > 0) { 384 while (count > 0) {
369 inval = i2c_inb(i2c_adap); 385 inval = i2c_inb(i2c_adap);
@@ -377,28 +393,12 @@ static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
377 temp++; 393 temp++;
378 count--; 394 count--;
379 395
380 if (msg->flags & I2C_M_NO_RD_ACK) {
381 bit_dbg(2, &i2c_adap->dev, "i2c_inb: 0x%02x\n",
382 inval);
383 continue;
384 }
385
386 /* assert: sda is high */
387 if (count) /* send ack */
388 setsda(adap, 0);
389 udelay((adap->udelay + 1) / 2);
390 bit_dbg(2, &i2c_adap->dev, "i2c_inb: 0x%02x %s\n", inval,
391 count ? "A" : "NA");
392 if (sclhi(adap)<0) { /* timeout */
393 dev_err(&i2c_adap->dev, "readbytes: timeout at ack\n");
394 return -ETIMEDOUT;
395 };
396 scllo(adap);
397
398 /* Some SMBus transactions require that we receive the 396 /* Some SMBus transactions require that we receive the
399 transaction length as the first read byte. */ 397 transaction length as the first read byte. */
400 if (rdcount == 1 && (msg->flags & I2C_M_RECV_LEN)) { 398 if (rdcount == 1 && (flags & I2C_M_RECV_LEN)) {
401 if (inval <= 0 || inval > I2C_SMBUS_BLOCK_MAX) { 399 if (inval <= 0 || inval > I2C_SMBUS_BLOCK_MAX) {
400 if (!(flags & I2C_M_NO_RD_ACK))
401 acknak(i2c_adap, 0);
402 dev_err(&i2c_adap->dev, "readbytes: invalid " 402 dev_err(&i2c_adap->dev, "readbytes: invalid "
403 "block length (%d)\n", inval); 403 "block length (%d)\n", inval);
404 return -EREMOTEIO; 404 return -EREMOTEIO;
@@ -409,6 +409,18 @@ static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
409 count += inval; 409 count += inval;
410 msg->len += inval; 410 msg->len += inval;
411 } 411 }
412
413 bit_dbg(2, &i2c_adap->dev, "readbytes: 0x%02x %s\n",
414 inval,
415 (flags & I2C_M_NO_RD_ACK)
416 ? "(no ack/nak)"
417 : (count ? "A" : "NA"));
418
419 if (!(flags & I2C_M_NO_RD_ACK)) {
420 inval = acknak(i2c_adap, count);
421 if (inval < 0)
422 return inval;
423 }
412 } 424 }
413 return rdcount; 425 return rdcount;
414} 426}
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 1842f523c23..9f3a4cd0b07 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -208,6 +208,7 @@ config I2C_PIIX4
208 ATI IXP400 208 ATI IXP400
209 ATI SB600 209 ATI SB600
210 ATI SB700 210 ATI SB700
211 ATI SB800
211 Serverworks OSB4 212 Serverworks OSB4
212 Serverworks CSB5 213 Serverworks CSB5
213 Serverworks CSB6 214 Serverworks CSB6
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index 025f19423fa..44e1cd21bb0 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -147,7 +147,7 @@ static int __init i2c_gpio_probe(struct platform_device *pdev)
147 * The reason to do so is to avoid sysfs names that only make 147 * The reason to do so is to avoid sysfs names that only make
148 * sense when there are multiple adapters. 148 * sense when there are multiple adapters.
149 */ 149 */
150 adap->nr = pdev->id >= 0 ? pdev->id : 0; 150 adap->nr = (pdev->id != -1) ? pdev->id : 0;
151 ret = i2c_bit_add_numbered_bus(adap); 151 ret = i2c_bit_add_numbered_bus(adap);
152 if (ret) 152 if (ret)
153 goto err_add_bus; 153 goto err_add_bus;
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index debc76cd216..167e4137ee2 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -23,7 +23,7 @@
23 Supports: 23 Supports:
24 Intel PIIX4, 440MX 24 Intel PIIX4, 440MX
25 Serverworks OSB4, CSB5, CSB6, HT-1000 25 Serverworks OSB4, CSB5, CSB6, HT-1000
26 ATI IXP200, IXP300, IXP400, SB600, SB700 26 ATI IXP200, IXP300, IXP400, SB600, SB700, SB800
27 SMSC Victory66 27 SMSC Victory66
28 28
29 Note: we assume there can only be one device, with one SMBus interface. 29 Note: we assume there can only be one device, with one SMBus interface.
@@ -397,9 +397,7 @@ static struct pci_device_id piix4_ids[] = {
397 .driver_data = 0 }, 397 .driver_data = 0 },
398 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS), 398 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS),
399 .driver_data = 0 }, 399 .driver_data = 0 },
400 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SMBUS), 400 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS),
401 .driver_data = 0 },
402 { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SMBUS),
403 .driver_data = 0 }, 401 .driver_data = 0 },
404 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4), 402 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4),
405 .driver_data = 0 }, 403 .driver_data = 0 },
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 9d6b790d432..bb5466b27b5 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -926,7 +926,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
926 * The reason to do so is to avoid sysfs names that only make 926 * The reason to do so is to avoid sysfs names that only make
927 * sense when there are multiple adapters. 927 * sense when there are multiple adapters.
928 */ 928 */
929 i2c->adap.nr = dev->id >= 0 ? dev->id : 0; 929 i2c->adap.nr = dev->id != -1 ? dev->id : 0;
930 930
931 ret = i2c_add_numbered_adapter(&i2c->adap); 931 ret = i2c_add_numbered_adapter(&i2c->adap);
932 if (ret < 0) { 932 if (ret < 0) {
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 7adb61bad6a..4200251ff63 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -781,7 +781,7 @@ endif
781 781
782config BLK_DEV_IDE_PMAC 782config BLK_DEV_IDE_PMAC
783 bool "Builtin PowerMac IDE support" 783 bool "Builtin PowerMac IDE support"
784 depends on PPC_PMAC && IDE=y 784 depends on PPC_PMAC && IDE=y && BLK_DEV_IDE=y
785 help 785 help
786 This driver provides support for the built-in IDE controller on 786 This driver provides support for the built-in IDE controller on
787 most of the recent Apple Power Macintoshes and PowerBooks. 787 most of the recent Apple Power Macintoshes and PowerBooks.
@@ -946,7 +946,7 @@ config BLK_DEV_Q40IDE
946 946
947config BLK_DEV_MPC8xx_IDE 947config BLK_DEV_MPC8xx_IDE
948 bool "MPC8xx IDE support" 948 bool "MPC8xx IDE support"
949 depends on 8xx && IDE=y && BLK_DEV_IDE=y 949 depends on 8xx && IDE=y && BLK_DEV_IDE=y && !PPC_MERGE
950 select IDE_GENERIC 950 select IDE_GENERIC
951 help 951 help
952 This option provides support for IDE on Motorola MPC8xx Systems. 952 This option provides support for IDE on Motorola MPC8xx Systems.
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index f4cd2700cae..646a54e233d 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -615,8 +615,7 @@ u8 eighty_ninty_three (ide_drive_t *drive)
615 if (hwif->cbl != ATA_CBL_PATA80 && !ivb) 615 if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
616 goto no_80w; 616 goto no_80w;
617 617
618 /* Check for SATA but only if we are ATA5 or higher */ 618 if (ide_dev_is_sata(id))
619 if (id->hw_config == 0 && (id->major_rev_num & 0x7FE0))
620 return 1; 619 return 1;
621 620
622 /* 621 /*
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 025689de50e..11ecb618007 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -596,6 +596,13 @@ static struct dmi_system_id cable_dmi_table[] = {
596 DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"), 596 DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
597 }, 597 },
598 }, 598 },
599 {
600 .ident = "Toshiba Satellite S1800-814",
601 .matches = {
602 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
603 DMI_MATCH(DMI_PRODUCT_NAME, "S1800-814"),
604 },
605 },
599 { } 606 { }
600}; 607};
601 608
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 2cd74c345a6..39f1c89f7c8 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/hpt366.c Version 1.10 Jun 29, 2007 2 * linux/drivers/ide/pci/hpt366.c Version 1.12 Aug 19, 2007
3 * 3 *
4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
5 * Portions Copyright (C) 2001 Sun Microsystems, Inc. 5 * Portions Copyright (C) 2001 Sun Microsystems, Inc.
@@ -68,7 +68,8 @@
68 * HPT37x chip family; save space by introducing the separate transfer mode 68 * HPT37x chip family; save space by introducing the separate transfer mode
69 * table in which the mode lookup is done 69 * table in which the mode lookup is done
70 * - use f_CNT value saved by the HighPoint BIOS as reading it directly gives 70 * - use f_CNT value saved by the HighPoint BIOS as reading it directly gives
71 * the wrong PCI frequency since DPLL has already been calibrated by BIOS 71 * the wrong PCI frequency since DPLL has already been calibrated by BIOS;
72 * read it only from the function 0 of HPT374 chips
72 * - fix the hotswap code: it caused RESET- to glitch when tristating the bus, 73 * - fix the hotswap code: it caused RESET- to glitch when tristating the bus,
73 * and for HPT36x the obsolete HDIO_TRISTATE_HWIF handler was called instead 74 * and for HPT36x the obsolete HDIO_TRISTATE_HWIF handler was called instead
74 * - pass to init_chipset() handlers a copy of the IDE PCI device structure as 75 * - pass to init_chipset() handlers a copy of the IDE PCI device structure as
@@ -113,6 +114,7 @@
113 * unify HPT36x/37x timing setup code and the speedproc handlers by joining 114 * unify HPT36x/37x timing setup code and the speedproc handlers by joining
114 * the register setting lists into the table indexed by the clock selected 115 * the register setting lists into the table indexed by the clock selected
115 * - set the correct hwif->ultra_mask for each individual chip 116 * - set the correct hwif->ultra_mask for each individual chip
117 * - add UltraDMA mode filtering for the HPT37[24] based SATA cards
116 * Sergei Shtylyov, <sshtylyov@ru.mvista.com> or <source@mvista.com> 118 * Sergei Shtylyov, <sshtylyov@ru.mvista.com> or <source@mvista.com>
117 */ 119 */
118 120
@@ -517,42 +519,44 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list)
517} 519}
518 520
519/* 521/*
520 * Note for the future; the SATA hpt37x we must set 522 * The Marvell bridge chips used on the HighPoint SATA cards do not seem
521 * either PIO or UDMA modes 0,4,5 523 * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes...
522 */ 524 */
523 525
524static u8 hpt3xx_udma_filter(ide_drive_t *drive) 526static u8 hpt3xx_udma_filter(ide_drive_t *drive)
525{ 527{
526 struct hpt_info *info = pci_get_drvdata(HWIF(drive)->pci_dev); 528 ide_hwif_t *hwif = HWIF(drive);
527 u8 mask; 529 struct hpt_info *info = pci_get_drvdata(hwif->pci_dev);
530 u8 mask = hwif->ultra_mask;
528 531
529 switch (info->chip_type) { 532 switch (info->chip_type) {
530 case HPT370A:
531 if (!HPT370_ALLOW_ATA100_5 ||
532 check_in_drive_list(drive, bad_ata100_5))
533 return 0x1f;
534 else
535 return 0x3f;
536 case HPT370:
537 if (!HPT370_ALLOW_ATA100_5 ||
538 check_in_drive_list(drive, bad_ata100_5))
539 mask = 0x1f;
540 else
541 mask = 0x3f;
542 break;
543 case HPT36x: 533 case HPT36x:
544 if (!HPT366_ALLOW_ATA66_4 || 534 if (!HPT366_ALLOW_ATA66_4 ||
545 check_in_drive_list(drive, bad_ata66_4)) 535 check_in_drive_list(drive, bad_ata66_4))
546 mask = 0x0f; 536 mask = ATA_UDMA3;
547 else
548 mask = 0x1f;
549 537
550 if (!HPT366_ALLOW_ATA66_3 || 538 if (!HPT366_ALLOW_ATA66_3 ||
551 check_in_drive_list(drive, bad_ata66_3)) 539 check_in_drive_list(drive, bad_ata66_3))
552 mask = 0x07; 540 mask = ATA_UDMA2;
541 break;
542 case HPT370:
543 if (!HPT370_ALLOW_ATA100_5 ||
544 check_in_drive_list(drive, bad_ata100_5))
545 mask = ATA_UDMA4;
553 break; 546 break;
547 case HPT370A:
548 if (!HPT370_ALLOW_ATA100_5 ||
549 check_in_drive_list(drive, bad_ata100_5))
550 return ATA_UDMA4;
551 case HPT372 :
552 case HPT372A:
553 case HPT372N:
554 case HPT374 :
555 if (ide_dev_is_sata(drive->id))
556 mask &= ~0x0e;
557 /* Fall thru */
554 default: 558 default:
555 return 0x7f; 559 return mask;
556 } 560 }
557 561
558 return check_in_drive_list(drive, bad_ata33) ? 0x00 : mask; 562 return check_in_drive_list(drive, bad_ata33) ? 0x00 : mask;
@@ -981,6 +985,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
981 struct hpt_info *info = kmalloc(sizeof(struct hpt_info), GFP_KERNEL); 985 struct hpt_info *info = kmalloc(sizeof(struct hpt_info), GFP_KERNEL);
982 unsigned long io_base = pci_resource_start(dev, 4); 986 unsigned long io_base = pci_resource_start(dev, 4);
983 u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */ 987 u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */
988 u8 chip_type;
984 enum ata_clock clock; 989 enum ata_clock clock;
985 990
986 if (info == NULL) { 991 if (info == NULL) {
@@ -992,7 +997,8 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
992 * Copy everything from a static "template" structure 997 * Copy everything from a static "template" structure
993 * to just allocated per-chip hpt_info structure. 998 * to just allocated per-chip hpt_info structure.
994 */ 999 */
995 *info = *(struct hpt_info *)pci_get_drvdata(dev); 1000 memcpy(info, pci_get_drvdata(dev), sizeof(struct hpt_info));
1001 chip_type = info->chip_type;
996 1002
997 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4)); 1003 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4));
998 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78); 1004 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78);
@@ -1002,7 +1008,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1002 /* 1008 /*
1003 * First, try to estimate the PCI clock frequency... 1009 * First, try to estimate the PCI clock frequency...
1004 */ 1010 */
1005 if (info->chip_type >= HPT370) { 1011 if (chip_type >= HPT370) {
1006 u8 scr1 = 0; 1012 u8 scr1 = 0;
1007 u16 f_cnt = 0; 1013 u16 f_cnt = 0;
1008 u32 temp = 0; 1014 u32 temp = 0;
@@ -1016,7 +1022,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1016 * HighPoint does this for HPT372A. 1022 * HighPoint does this for HPT372A.
1017 * NOTE: This register is only writeable via I/O space. 1023 * NOTE: This register is only writeable via I/O space.
1018 */ 1024 */
1019 if (info->chip_type == HPT372A) 1025 if (chip_type == HPT372A)
1020 outb(0x0e, io_base + 0x9c); 1026 outb(0x0e, io_base + 0x9c);
1021 1027
1022 /* 1028 /*
@@ -1034,13 +1040,28 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1034 * First try reading the register in which the HighPoint BIOS 1040 * First try reading the register in which the HighPoint BIOS
1035 * saves f_CNT value before reprogramming the DPLL from its 1041 * saves f_CNT value before reprogramming the DPLL from its
1036 * default setting (which differs for the various chips). 1042 * default setting (which differs for the various chips).
1037 * NOTE: This register is only accessible via I/O space.
1038 * 1043 *
1039 * In case the signature check fails, we'll have to resort to 1044 * NOTE: This register is only accessible via I/O space;
1040 * reading the f_CNT register itself in hopes that nobody has 1045 * HPT374 BIOS only saves it for the function 0, so we have to
1041 * touched the DPLL yet... 1046 * always read it from there -- no need to check the result of
1047 * pci_get_slot() for the function 0 as the whole device has
1048 * been already "pinned" (via function 1) in init_setup_hpt374()
1049 */
1050 if (chip_type == HPT374 && (PCI_FUNC(dev->devfn) & 1)) {
1051 struct pci_dev *dev1 = pci_get_slot(dev->bus,
1052 dev->devfn - 1);
1053 unsigned long io_base = pci_resource_start(dev1, 4);
1054
1055 temp = inl(io_base + 0x90);
1056 pci_dev_put(dev1);
1057 } else
1058 temp = inl(io_base + 0x90);
1059
1060 /*
1061 * In case the signature check fails, we'll have to
1062 * resort to reading the f_CNT register itself in hopes
1063 * that nobody has touched the DPLL yet...
1042 */ 1064 */
1043 temp = inl(io_base + 0x90);
1044 if ((temp & 0xFFFFF000) != 0xABCDE000) { 1065 if ((temp & 0xFFFFF000) != 0xABCDE000) {
1045 int i; 1066 int i;
1046 1067
@@ -1120,7 +1141,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1120 * We also don't like using the DPLL because this causes glitches 1141 * We also don't like using the DPLL because this causes glitches
1121 * on PRST-/SRST- when the state engine gets reset... 1142 * on PRST-/SRST- when the state engine gets reset...
1122 */ 1143 */
1123 if (info->chip_type >= HPT374 || info->settings[clock] == NULL) { 1144 if (chip_type >= HPT374 || info->settings[clock] == NULL) {
1124 u16 f_low, delta = pci_clk < 50 ? 2 : 4; 1145 u16 f_low, delta = pci_clk < 50 ? 2 : 4;
1125 int adjust; 1146 int adjust;
1126 1147
@@ -1190,7 +1211,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1190 /* Point to this chip's own instance of the hpt_info structure. */ 1211 /* Point to this chip's own instance of the hpt_info structure. */
1191 pci_set_drvdata(dev, info); 1212 pci_set_drvdata(dev, info);
1192 1213
1193 if (info->chip_type >= HPT370) { 1214 if (chip_type >= HPT370) {
1194 u8 mcr1, mcr4; 1215 u8 mcr1, mcr4;
1195 1216
1196 /* 1217 /*
@@ -1209,7 +1230,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1209 * the MISC. register to stretch the UltraDMA Tss timing. 1230 * the MISC. register to stretch the UltraDMA Tss timing.
1210 * NOTE: This register is only writeable via I/O space. 1231 * NOTE: This register is only writeable via I/O space.
1211 */ 1232 */
1212 if (info->chip_type == HPT371N && clock == ATA_CLOCK_66MHZ) 1233 if (chip_type == HPT371N && clock == ATA_CLOCK_66MHZ)
1213 1234
1214 outb(inb(io_base + 0x9c) | 0x04, io_base + 0x9c); 1235 outb(inb(io_base + 0x9c) | 0x04, io_base + 0x9c);
1215 1236
@@ -1218,25 +1239,24 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
1218 1239
1219static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) 1240static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
1220{ 1241{
1221 struct pci_dev *dev = hwif->pci_dev; 1242 struct pci_dev *dev = hwif->pci_dev;
1222 struct hpt_info *info = pci_get_drvdata(dev); 1243 struct hpt_info *info = pci_get_drvdata(dev);
1223 int serialize = HPT_SERIALIZE_IO; 1244 int serialize = HPT_SERIALIZE_IO;
1224 u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02; 1245 u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02;
1225 u8 chip_type = info->chip_type; 1246 u8 chip_type = info->chip_type;
1226 u8 new_mcr, old_mcr = 0; 1247 u8 new_mcr, old_mcr = 0;
1227 1248
1228 /* Cache the channel's MISC. control registers' offset */ 1249 /* Cache the channel's MISC. control registers' offset */
1229 hwif->select_data = hwif->channel ? 0x54 : 0x50; 1250 hwif->select_data = hwif->channel ? 0x54 : 0x50;
1230 1251
1231 hwif->tuneproc = &hpt3xx_tune_drive; 1252 hwif->tuneproc = &hpt3xx_tune_drive;
1232 hwif->speedproc = &hpt3xx_tune_chipset; 1253 hwif->speedproc = &hpt3xx_tune_chipset;
1233 hwif->quirkproc = &hpt3xx_quirkproc; 1254 hwif->quirkproc = &hpt3xx_quirkproc;
1234 hwif->intrproc = &hpt3xx_intrproc; 1255 hwif->intrproc = &hpt3xx_intrproc;
1235 hwif->maskproc = &hpt3xx_maskproc; 1256 hwif->maskproc = &hpt3xx_maskproc;
1236 hwif->busproc = &hpt3xx_busproc; 1257 hwif->busproc = &hpt3xx_busproc;
1237 1258
1238 if (chip_type <= HPT370A) 1259 hwif->udma_filter = &hpt3xx_udma_filter;
1239 hwif->udma_filter = &hpt3xx_udma_filter;
1240 1260
1241 /* 1261 /*
1242 * HPT3xxN chips have some complications: 1262 * HPT3xxN chips have some complications:
@@ -1486,19 +1506,19 @@ static int __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d)
1486 d->host_flags |= IDE_HFLAG_SINGLE; 1506 d->host_flags |= IDE_HFLAG_SINGLE;
1487 d->enablebits[0].mask = d->enablebits[0].val = 0x10; 1507 d->enablebits[0].mask = d->enablebits[0].val = 0x10;
1488 1508
1489 d->udma_mask = HPT366_ALLOW_ATA66_3 ? 1509 d->udma_mask = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ?
1490 (HPT366_ALLOW_ATA66_4 ? 0x1f : 0x0f) : 0x07; 1510 ATA_UDMA4 : ATA_UDMA3) : ATA_UDMA2;
1491 break; 1511 break;
1492 case 3: 1512 case 3:
1493 case 4: 1513 case 4:
1494 d->udma_mask = HPT370_ALLOW_ATA100_5 ? 0x3f : 0x1f; 1514 d->udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4;
1495 break; 1515 break;
1496 default: 1516 default:
1497 rev = 6; 1517 rev = 6;
1498 /* fall thru */ 1518 /* fall thru */
1499 case 5: 1519 case 5:
1500 case 6: 1520 case 6:
1501 d->udma_mask = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f; 1521 d->udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5;
1502 break; 1522 break;
1503 } 1523 }
1504 1524
@@ -1559,7 +1579,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1559 .init_dma = init_dma_hpt366, 1579 .init_dma = init_dma_hpt366,
1560 .autodma = AUTODMA, 1580 .autodma = AUTODMA,
1561 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1581 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1562 .udma_mask = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f, 1582 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
1563 .bootable = OFF_BOARD, 1583 .bootable = OFF_BOARD,
1564 .extra = 240, 1584 .extra = 240,
1565 .pio_mask = ATA_PIO4, 1585 .pio_mask = ATA_PIO4,
@@ -1571,7 +1591,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1571 .init_dma = init_dma_hpt366, 1591 .init_dma = init_dma_hpt366,
1572 .autodma = AUTODMA, 1592 .autodma = AUTODMA,
1573 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1593 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1574 .udma_mask = HPT302_ALLOW_ATA133_6 ? 0x7f : 0x3f, 1594 .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
1575 .bootable = OFF_BOARD, 1595 .bootable = OFF_BOARD,
1576 .extra = 240, 1596 .extra = 240,
1577 .pio_mask = ATA_PIO4, 1597 .pio_mask = ATA_PIO4,
@@ -1583,7 +1603,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1583 .init_dma = init_dma_hpt366, 1603 .init_dma = init_dma_hpt366,
1584 .autodma = AUTODMA, 1604 .autodma = AUTODMA,
1585 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1605 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1586 .udma_mask = HPT371_ALLOW_ATA133_6 ? 0x7f : 0x3f, 1606 .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
1587 .bootable = OFF_BOARD, 1607 .bootable = OFF_BOARD,
1588 .extra = 240, 1608 .extra = 240,
1589 .pio_mask = ATA_PIO4, 1609 .pio_mask = ATA_PIO4,
@@ -1595,7 +1615,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1595 .init_dma = init_dma_hpt366, 1615 .init_dma = init_dma_hpt366,
1596 .autodma = AUTODMA, 1616 .autodma = AUTODMA,
1597 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1617 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1598 .udma_mask = 0x3f, 1618 .udma_mask = ATA_UDMA5,
1599 .bootable = OFF_BOARD, 1619 .bootable = OFF_BOARD,
1600 .extra = 240, 1620 .extra = 240,
1601 .pio_mask = ATA_PIO4, 1621 .pio_mask = ATA_PIO4,
@@ -1607,7 +1627,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
1607 .init_dma = init_dma_hpt366, 1627 .init_dma = init_dma_hpt366,
1608 .autodma = AUTODMA, 1628 .autodma = AUTODMA,
1609 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}}, 1629 .enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
1610 .udma_mask = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f, 1630 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
1611 .bootable = OFF_BOARD, 1631 .bootable = OFF_BOARD,
1612 .extra = 240, 1632 .extra = 240,
1613 .pio_mask = ATA_PIO4, 1633 .pio_mask = ATA_PIO4,
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index f6db2f37efa..7b0e479c355 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -9,7 +9,7 @@
9 * Split from: 9 * Split from:
10 * linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002 10 * linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002
11 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> 11 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
12 * Copyright (C) 2005-2006 MontaVista Software, Inc. 12 * Copyright (C) 2005-2007 MontaVista Software, Inc.
13 * Portions Copyright (C) 1999 Promise Technology, Inc. 13 * Portions Copyright (C) 1999 Promise Technology, Inc.
14 * Author: Frank Tiernan (frankt@promise.com) 14 * Author: Frank Tiernan (frankt@promise.com)
15 * Released under terms of General Public License 15 * Released under terms of General Public License
@@ -341,7 +341,7 @@ static long __devinit detect_pll_input_clock(unsigned long dma_base)
341 */ 341 */
342 usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 + 342 usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 +
343 (end_time.tv_usec - start_time.tv_usec); 343 (end_time.tv_usec - start_time.tv_usec);
344 pll_input = ((start_count - end_count) & 0x3ffffff) / 10 * 344 pll_input = ((start_count - end_count) & 0x3fffffff) / 10 *
345 (10000000 / usec_elapsed); 345 (10000000 / usec_elapsed);
346 346
347 DBG("start[%ld] end[%ld]\n", start_count, end_count); 347 DBG("start[%ld] end[%ld]\n", start_count, end_count);
@@ -535,7 +535,7 @@ static int __devinit init_setup_pdc20270(struct pci_dev *dev,
535 (dev->bus->self->device == PCI_DEVICE_ID_DEC_21150)) { 535 (dev->bus->self->device == PCI_DEVICE_ID_DEC_21150)) {
536 if (PCI_SLOT(dev->devfn) & 2) 536 if (PCI_SLOT(dev->devfn) & 2)
537 return -ENODEV; 537 return -ENODEV;
538 d->extra = 0; 538
539 while ((findev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) { 539 while ((findev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, findev)) != NULL) {
540 if ((findev->vendor == dev->vendor) && 540 if ((findev->vendor == dev->vendor) &&
541 (findev->device == dev->device) && 541 (findev->device == dev->device) &&
@@ -544,7 +544,8 @@ static int __devinit init_setup_pdc20270(struct pci_dev *dev,
544 findev->irq = dev->irq; 544 findev->irq = dev->irq;
545 } 545 }
546 ret = ide_setup_pci_devices(dev, findev, d); 546 ret = ide_setup_pci_devices(dev, findev, d);
547 pci_dev_put(findev); 547 if (ret < 0)
548 pci_dev_put(findev);
548 return ret; 549 return ret;
549 } 550 }
550 } 551 }
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 581316f9581..a7be7795e6a 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * Version 3.46 3 * Version 3.47
4 * 4 *
5 * VIA IDE driver for Linux. Supported southbridges: 5 * VIA IDE driver for Linux. Supported southbridges:
6 * 6 *
@@ -74,6 +74,7 @@ static struct via_isa_bridge {
74 u8 udma_mask; 74 u8 udma_mask;
75 u8 flags; 75 u8 flags;
76} via_isa_bridges[] = { 76} via_isa_bridges[] = {
77 { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
77 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 78 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
78 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 79 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
79 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST }, 80 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
@@ -429,19 +430,26 @@ static struct dmi_system_id cable_dmi_table[] = {
429 { } 430 { }
430}; 431};
431 432
432static int via_cable_override(void) 433static int via_cable_override(struct pci_dev *pdev)
433{ 434{
434 /* Systems by DMI */ 435 /* Systems by DMI */
435 if (dmi_check_system(cable_dmi_table)) 436 if (dmi_check_system(cable_dmi_table))
436 return 1; 437 return 1;
438
439 /* Arima W730-K8/Targa Visionary 811/... */
440 if (pdev->subsystem_vendor == 0x161F &&
441 pdev->subsystem_device == 0x2032)
442 return 1;
443
437 return 0; 444 return 0;
438} 445}
439 446
440static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif) 447static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif)
441{ 448{
442 struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev); 449 struct pci_dev *pdev = hwif->pci_dev;
450 struct via82cxxx_dev *vdev = pci_get_drvdata(pdev);
443 451
444 if (via_cable_override()) 452 if (via_cable_override(pdev))
445 return ATA_CBL_PATA40_SHORT; 453 return ATA_CBL_PATA40_SHORT;
446 454
447 if ((vdev->via_80w >> hwif->channel) & 1) 455 if ((vdev->via_80w >> hwif->channel) & 1)
diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c
index 8859fe2f5ac..dab79afa9b2 100644
--- a/drivers/ide/ppc/mpc8xx.c
+++ b/drivers/ide/ppc/mpc8xx.c
@@ -32,7 +32,6 @@
32#include <asm/mpc8xx.h> 32#include <asm/mpc8xx.h>
33#include <asm/mmu.h> 33#include <asm/mmu.h>
34#include <asm/processor.h> 34#include <asm/processor.h>
35#include <asm/residual.h>
36#include <asm/io.h> 35#include <asm/io.h>
37#include <asm/pgtable.h> 36#include <asm/pgtable.h>
38#include <asm/ide.h> 37#include <asm/ide.h>
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 30e596c0f12..1129f8c3084 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -816,19 +816,15 @@ static int __init ide_scan_pcidev(struct pci_dev *dev)
816 struct list_head *l; 816 struct list_head *l;
817 struct pci_driver *d; 817 struct pci_driver *d;
818 818
819 list_for_each(l, &ide_pci_drivers) 819 list_for_each(l, &ide_pci_drivers) {
820 {
821 d = list_entry(l, struct pci_driver, node); 820 d = list_entry(l, struct pci_driver, node);
822 if(d->id_table) 821 if (d->id_table) {
823 { 822 const struct pci_device_id *id = pci_match_id(d->id_table,
824 const struct pci_device_id *id = pci_match_id(d->id_table, dev); 823 dev);
825 if(id != NULL) 824 if (id != NULL && d->probe(dev, id) >= 0) {
826 { 825 dev->driver = d;
827 if(d->probe(dev, id) >= 0) 826 pci_dev_get(dev);
828 { 827 return 1;
829 dev->driver = d;
830 return 1;
831 }
832 } 828 }
833 } 829 }
834 } 830 }
@@ -851,15 +847,13 @@ void __init ide_scan_pcibus (int scan_direction)
851 struct list_head *l, *n; 847 struct list_head *l, *n;
852 848
853 pre_init = 0; 849 pre_init = 0;
854 if (!scan_direction) { 850 if (!scan_direction)
855 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 851 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
856 ide_scan_pcidev(dev); 852 ide_scan_pcidev(dev);
857 } 853 else
858 } else { 854 while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID, dev))
859 while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 855 != NULL)
860 ide_scan_pcidev(dev); 856 ide_scan_pcidev(dev);
861 }
862 }
863 857
864 /* 858 /*
865 * Hand the drivers over to the PCI layer now we 859 * Hand the drivers over to the PCI layer now we
@@ -869,12 +863,9 @@ void __init ide_scan_pcibus (int scan_direction)
869 list_for_each_safe(l, n, &ide_pci_drivers) { 863 list_for_each_safe(l, n, &ide_pci_drivers) {
870 list_del(l); 864 list_del(l);
871 d = list_entry(l, struct pci_driver, node); 865 d = list_entry(l, struct pci_driver, node);
872 if (__pci_register_driver(d, d->driver.owner, 866 if (__pci_register_driver(d, d->driver.owner, d->driver.mod_name))
873 d->driver.mod_name)) { 867 printk(KERN_ERR "%s: failed to register driver for %s\n",
874 printk(KERN_ERR "%s: failed to register driver " 868 __FUNCTION__, d->driver.mod_name);
875 "for %s\n", __FUNCTION__,
876 d->driver.mod_name);
877 }
878 } 869 }
879} 870}
880#endif 871#endif
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c
index 1518b41482a..beb2a381467 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_hal.c
+++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c
@@ -916,7 +916,7 @@ int cxio_rdev_open(struct cxio_rdev *rdev_p)
916 PDBG("%s opening rnic dev %s\n", __FUNCTION__, rdev_p->dev_name); 916 PDBG("%s opening rnic dev %s\n", __FUNCTION__, rdev_p->dev_name);
917 memset(&rdev_p->ctrl_qp, 0, sizeof(rdev_p->ctrl_qp)); 917 memset(&rdev_p->ctrl_qp, 0, sizeof(rdev_p->ctrl_qp));
918 if (!rdev_p->t3cdev_p) 918 if (!rdev_p->t3cdev_p)
919 rdev_p->t3cdev_p = T3CDEV(netdev_p); 919 rdev_p->t3cdev_p = dev2t3cdev(netdev_p);
920 rdev_p->t3cdev_p->ulp = (void *) rdev_p; 920 rdev_p->t3cdev_p->ulp = (void *) rdev_p;
921 err = rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_GET_PARAMS, 921 err = rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_GET_PARAMS,
922 &(rdev_p->rnic_info)); 922 &(rdev_p->rnic_info));
diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c
index fc19ef9fd96..cf22472d941 100644
--- a/drivers/infiniband/hw/ehca/ehca_hca.c
+++ b/drivers/infiniband/hw/ehca/ehca_hca.c
@@ -93,9 +93,13 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
93 props->max_pd = min_t(int, rblock->max_pd, INT_MAX); 93 props->max_pd = min_t(int, rblock->max_pd, INT_MAX);
94 props->max_ah = min_t(int, rblock->max_ah, INT_MAX); 94 props->max_ah = min_t(int, rblock->max_ah, INT_MAX);
95 props->max_fmr = min_t(int, rblock->max_mr, INT_MAX); 95 props->max_fmr = min_t(int, rblock->max_mr, INT_MAX);
96 props->max_srq = 0; 96
97 props->max_srq_wr = 0; 97 if (EHCA_BMASK_GET(HCA_CAP_SRQ, shca->hca_cap)) {
98 props->max_srq_sge = 0; 98 props->max_srq = props->max_qp;
99 props->max_srq_wr = props->max_qp_wr;
100 props->max_srq_sge = 3;
101 }
102
99 props->max_pkeys = 16; 103 props->max_pkeys = 16;
100 props->local_ca_ack_delay 104 props->local_ca_ack_delay
101 = rblock->local_ca_ack_delay; 105 = rblock->local_ca_ack_delay;
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index ee06d8bd739..a925ea52443 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -175,41 +175,55 @@ error_data1:
175 175
176} 176}
177 177
178static void qp_event_callback(struct ehca_shca *shca, u64 eqe, 178static void dispatch_qp_event(struct ehca_shca *shca, struct ehca_qp *qp,
179 enum ib_event_type event_type, int fatal) 179 enum ib_event_type event_type)
180{ 180{
181 struct ib_event event; 181 struct ib_event event;
182 struct ehca_qp *qp;
183 u32 token = EHCA_BMASK_GET(EQE_QP_TOKEN, eqe);
184
185 read_lock(&ehca_qp_idr_lock);
186 qp = idr_find(&ehca_qp_idr, token);
187 read_unlock(&ehca_qp_idr_lock);
188
189
190 if (!qp)
191 return;
192
193 if (fatal)
194 ehca_error_data(shca, qp, qp->ipz_qp_handle.handle);
195 182
196 event.device = &shca->ib_device; 183 event.device = &shca->ib_device;
184 event.event = event_type;
197 185
198 if (qp->ext_type == EQPT_SRQ) { 186 if (qp->ext_type == EQPT_SRQ) {
199 if (!qp->ib_srq.event_handler) 187 if (!qp->ib_srq.event_handler)
200 return; 188 return;
201 189
202 event.event = fatal ? IB_EVENT_SRQ_ERR : event_type;
203 event.element.srq = &qp->ib_srq; 190 event.element.srq = &qp->ib_srq;
204 qp->ib_srq.event_handler(&event, qp->ib_srq.srq_context); 191 qp->ib_srq.event_handler(&event, qp->ib_srq.srq_context);
205 } else { 192 } else {
206 if (!qp->ib_qp.event_handler) 193 if (!qp->ib_qp.event_handler)
207 return; 194 return;
208 195
209 event.event = event_type;
210 event.element.qp = &qp->ib_qp; 196 event.element.qp = &qp->ib_qp;
211 qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context); 197 qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context);
212 } 198 }
199}
200
201static void qp_event_callback(struct ehca_shca *shca, u64 eqe,
202 enum ib_event_type event_type, int fatal)
203{
204 struct ehca_qp *qp;
205 u32 token = EHCA_BMASK_GET(EQE_QP_TOKEN, eqe);
206
207 read_lock(&ehca_qp_idr_lock);
208 qp = idr_find(&ehca_qp_idr, token);
209 read_unlock(&ehca_qp_idr_lock);
210
211 if (!qp)
212 return;
213
214 if (fatal)
215 ehca_error_data(shca, qp, qp->ipz_qp_handle.handle);
216
217 dispatch_qp_event(shca, qp, fatal && qp->ext_type == EQPT_SRQ ?
218 IB_EVENT_SRQ_ERR : event_type);
219
220 /*
221 * eHCA only processes one WQE at a time for SRQ base QPs,
222 * so the last WQE has been processed as soon as the QP enters
223 * error state.
224 */
225 if (fatal && qp->ext_type == EQPT_SRQBASE)
226 dispatch_qp_event(shca, qp, IB_EVENT_QP_LAST_WQE_REACHED);
213 227
214 return; 228 return;
215} 229}
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index b178cba9634..84d435a5ee1 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -600,10 +600,12 @@ static struct ehca_qp *internal_create_qp(
600 600
601 if (EHCA_BMASK_GET(HCA_CAP_MINI_QP, shca->hca_cap) 601 if (EHCA_BMASK_GET(HCA_CAP_MINI_QP, shca->hca_cap)
602 && !(context && udata)) { /* no small QP support in userspace ATM */ 602 && !(context && udata)) { /* no small QP support in userspace ATM */
603 ehca_determine_small_queue( 603 if (HAS_SQ(my_qp))
604 &parms.squeue, max_send_sge, is_llqp); 604 ehca_determine_small_queue(
605 ehca_determine_small_queue( 605 &parms.squeue, max_send_sge, is_llqp);
606 &parms.rqueue, max_recv_sge, is_llqp); 606 if (HAS_RQ(my_qp))
607 ehca_determine_small_queue(
608 &parms.rqueue, max_recv_sge, is_llqp);
607 parms.qp_storage = 609 parms.qp_storage =
608 (parms.squeue.is_small || parms.rqueue.is_small); 610 (parms.squeue.is_small || parms.rqueue.is_small);
609 } 611 }
diff --git a/drivers/infiniband/hw/ehca/ipz_pt_fn.c b/drivers/infiniband/hw/ehca/ipz_pt_fn.c
index a090c679c39..29bd476fbd5 100644
--- a/drivers/infiniband/hw/ehca/ipz_pt_fn.c
+++ b/drivers/infiniband/hw/ehca/ipz_pt_fn.c
@@ -172,7 +172,7 @@ static void free_small_queue_page(struct ipz_queue *queue, struct ehca_pd *pd)
172 unsigned long bit; 172 unsigned long bit;
173 int free_page = 0; 173 int free_page = 0;
174 174
175 bit = ((unsigned long)queue->queue_pages[0] & PAGE_MASK) 175 bit = ((unsigned long)queue->queue_pages[0] & ~PAGE_MASK)
176 >> (order + 9); 176 >> (order + 9);
177 177
178 mutex_lock(&pd->lock); 178 mutex_lock(&pd->lock);
diff --git a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c
index 3154ccd7400..45c4939ced7 100644
--- a/drivers/input/joystick/iforce/iforce-packets.c
+++ b/drivers/input/joystick/iforce/iforce-packets.c
@@ -246,13 +246,12 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
246 246
247int iforce_get_id_packet(struct iforce *iforce, char *packet) 247int iforce_get_id_packet(struct iforce *iforce, char *packet)
248{ 248{
249 int status;
250
251 switch (iforce->bus) { 249 switch (iforce->bus) {
252 250
253 case IFORCE_USB: 251 case IFORCE_USB: {
254
255#ifdef CONFIG_JOYSTICK_IFORCE_USB 252#ifdef CONFIG_JOYSTICK_IFORCE_USB
253 int status;
254
256 iforce->cr.bRequest = packet[0]; 255 iforce->cr.bRequest = packet[0];
257 iforce->ctrl->dev = iforce->usbdev; 256 iforce->ctrl->dev = iforce->usbdev;
258 257
@@ -273,6 +272,7 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
273#else 272#else
274 dbg("iforce_get_id_packet: iforce->bus = USB!"); 273 dbg("iforce_get_id_packet: iforce->bus = USB!");
275#endif 274#endif
275 }
276 break; 276 break;
277 277
278 case IFORCE_232: 278 case IFORCE_232:
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 739212252b0..f0b22b8b276 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -22,7 +22,6 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/input.h> 24#include <linux/input.h>
25#include <linux/irq.h>
26#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
27 26
28#include <asm/gpio.h> 27#include <asm/gpio.h>
diff --git a/drivers/input/mouse/touchkit_ps2.h b/drivers/input/mouse/touchkit_ps2.h
index 61e9dfd8419..8a0dd3574ae 100644
--- a/drivers/input/mouse/touchkit_ps2.h
+++ b/drivers/input/mouse/touchkit_ps2.h
@@ -15,7 +15,8 @@
15#ifdef CONFIG_MOUSE_PS2_TOUCHKIT 15#ifdef CONFIG_MOUSE_PS2_TOUCHKIT
16int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties); 16int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties);
17#else 17#else
18inline int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties) 18static inline int touchkit_ps2_detect(struct psmouse *psmouse,
19 int set_properties)
19{ 20{
20 return -ENOSYS; 21 return -ENOSYS;
21} 22}
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c
index 74f14e09778..3e99df6be08 100644
--- a/drivers/input/serio/gscps2.c
+++ b/drivers/input/serio/gscps2.c
@@ -340,8 +340,8 @@ static int __init gscps2_probe(struct parisc_device *dev)
340 if (dev->id.sversion == 0x96) 340 if (dev->id.sversion == 0x96)
341 hpa += GSC_DINO_OFFSET; 341 hpa += GSC_DINO_OFFSET;
342 342
343 ps2port = kmalloc(sizeof(struct gscps2port), GFP_KERNEL); 343 ps2port = kzalloc(sizeof(struct gscps2port), GFP_KERNEL);
344 serio = kmalloc(sizeof(struct serio), GFP_KERNEL); 344 serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
345 if (!ps2port || !serio) { 345 if (!ps2port || !serio) {
346 ret = -ENOMEM; 346 ret = -ENOMEM;
347 goto fail_nomem; 347 goto fail_nomem;
@@ -349,8 +349,6 @@ static int __init gscps2_probe(struct parisc_device *dev)
349 349
350 dev_set_drvdata(&dev->dev, ps2port); 350 dev_set_drvdata(&dev->dev, ps2port);
351 351
352 memset(ps2port, 0, sizeof(struct gscps2port));
353 memset(serio, 0, sizeof(struct serio));
354 ps2port->port = serio; 352 ps2port->port = serio;
355 ps2port->padev = dev; 353 ps2port->padev = dev;
356 ps2port->addr = ioremap_nocache(hpa, GSC_STATUS + 4); 354 ps2port->addr = ioremap_nocache(hpa, GSC_STATUS + 4);
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 702a526cf45..f8fe4214809 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -211,6 +211,16 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
211 }, 211 },
212 }, 212 },
213 { 213 {
214 /*
215 * Like DV4017EA does not raise AUXERR for errors on MUX ports.
216 */
217 .ident = "HP Pavilion DV4270ca",
218 .matches = {
219 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
220 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
221 },
222 },
223 {
214 .ident = "Toshiba P10", 224 .ident = "Toshiba P10",
215 .matches = { 225 .matches = {
216 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 226 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 3888dc307e0..c2eea2767e1 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -512,6 +512,7 @@ static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id)
512{ 512{
513 unsigned long flags; 513 unsigned long flags;
514 unsigned char str, data; 514 unsigned char str, data;
515 int ret = 0;
515 516
516 spin_lock_irqsave(&i8042_lock, flags); 517 spin_lock_irqsave(&i8042_lock, flags);
517 str = i8042_read_status(); 518 str = i8042_read_status();
@@ -520,10 +521,11 @@ static irqreturn_t __devinit i8042_aux_test_irq(int irq, void *dev_id)
520 if (i8042_irq_being_tested && 521 if (i8042_irq_being_tested &&
521 data == 0xa5 && (str & I8042_STR_AUXDATA)) 522 data == 0xa5 && (str & I8042_STR_AUXDATA))
522 complete(&i8042_aux_irq_delivered); 523 complete(&i8042_aux_irq_delivered);
524 ret = 1;
523 } 525 }
524 spin_unlock_irqrestore(&i8042_lock, flags); 526 spin_unlock_irqrestore(&i8042_lock, flags);
525 527
526 return IRQ_HANDLED; 528 return IRQ_RETVAL(ret);
527} 529}
528 530
529/* 531/*
@@ -1038,7 +1040,7 @@ static void __devinit i8042_register_ports(void)
1038 } 1040 }
1039} 1041}
1040 1042
1041static void __devinit i8042_unregister_ports(void) 1043static void __devexit i8042_unregister_ports(void)
1042{ 1044{
1043 int i; 1045 int i;
1044 1046
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index b407028ffc5..741f6c6f1e5 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -767,7 +767,7 @@ static int usbtouch_probe(struct usb_interface *intf,
767 le16_to_cpu(udev->descriptor.idProduct)); 767 le16_to_cpu(udev->descriptor.idProduct));
768 768
769 usb_make_path(udev, usbtouch->phys, sizeof(usbtouch->phys)); 769 usb_make_path(udev, usbtouch->phys, sizeof(usbtouch->phys));
770 strlcpy(usbtouch->phys, "/input0", sizeof(usbtouch->phys)); 770 strlcat(usbtouch->phys, "/input0", sizeof(usbtouch->phys));
771 771
772 input_dev->name = usbtouch->name; 772 input_dev->name = usbtouch->name;
773 input_dev->phys = usbtouch->phys; 773 input_dev->phys = usbtouch->phys;
diff --git a/drivers/lguest/interrupts_and_traps.c b/drivers/lguest/interrupts_and_traps.c
index 49aa55577d0..39731232d82 100644
--- a/drivers/lguest/interrupts_and_traps.c
+++ b/drivers/lguest/interrupts_and_traps.c
@@ -270,8 +270,11 @@ void pin_stack_pages(struct lguest *lg)
270 /* Depending on the CONFIG_4KSTACKS option, the Guest can have one or 270 /* Depending on the CONFIG_4KSTACKS option, the Guest can have one or
271 * two pages of stack space. */ 271 * two pages of stack space. */
272 for (i = 0; i < lg->stack_pages; i++) 272 for (i = 0; i < lg->stack_pages; i++)
273 /* The stack grows *upwards*, hence the subtraction */ 273 /* The stack grows *upwards*, so the address we're given is the
274 pin_page(lg, lg->esp1 - i * PAGE_SIZE); 274 * start of the page after the kernel stack. Subtract one to
275 * get back onto the first stack page, and keep subtracting to
276 * get to the rest of the stack pages. */
277 pin_page(lg, lg->esp1 - 1 - i * PAGE_SIZE);
275} 278}
276 279
277/* Direct traps also mean that we need to know whenever the Guest wants to use 280/* Direct traps also mean that we need to know whenever the Guest wants to use
diff --git a/drivers/lguest/lguest.c b/drivers/lguest/lguest.c
index 6e135ac0834..ee1c6d05c3d 100644
--- a/drivers/lguest/lguest.c
+++ b/drivers/lguest/lguest.c
@@ -964,11 +964,12 @@ __init void lguest_init(void *boot)
964{ 964{
965 /* Copy boot parameters first: the Launcher put the physical location 965 /* Copy boot parameters first: the Launcher put the physical location
966 * in %esi, and head.S converted that to a virtual address and handed 966 * in %esi, and head.S converted that to a virtual address and handed
967 * it to us. */ 967 * it to us. We use "__memcpy" because "memcpy" sometimes tries to do
968 memcpy(&boot_params, boot, PARAM_SIZE); 968 * tricky things to go faster, and we're not ready for that. */
969 __memcpy(&boot_params, boot, PARAM_SIZE);
969 /* The boot parameters also tell us where the command-line is: save 970 /* The boot parameters also tell us where the command-line is: save
970 * that, too. */ 971 * that, too. */
971 memcpy(boot_command_line, __va(boot_params.hdr.cmd_line_ptr), 972 __memcpy(boot_command_line, __va(boot_params.hdr.cmd_line_ptr),
972 COMMAND_LINE_SIZE); 973 COMMAND_LINE_SIZE);
973 974
974 /* We're under lguest, paravirt is enabled, and we're running at 975 /* We're under lguest, paravirt is enabled, and we're running at
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 2aff4be35dc..4d63773ee73 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2541,7 +2541,7 @@ static void handle_stripe_expansion(raid5_conf_t *conf, struct stripe_head *sh,
2541 struct dma_async_tx_descriptor *tx = NULL; 2541 struct dma_async_tx_descriptor *tx = NULL;
2542 clear_bit(STRIPE_EXPAND_SOURCE, &sh->state); 2542 clear_bit(STRIPE_EXPAND_SOURCE, &sh->state);
2543 for (i = 0; i < sh->disks; i++) 2543 for (i = 0; i < sh->disks; i++)
2544 if (i != sh->pd_idx && (r6s && i != r6s->qd_idx)) { 2544 if (i != sh->pd_idx && (!r6s || i != r6s->qd_idx)) {
2545 int dd_idx, pd_idx, j; 2545 int dd_idx, pd_idx, j;
2546 struct stripe_head *sh2; 2546 struct stripe_head *sh2;
2547 2547
@@ -2574,7 +2574,8 @@ static void handle_stripe_expansion(raid5_conf_t *conf, struct stripe_head *sh,
2574 set_bit(R5_UPTODATE, &sh2->dev[dd_idx].flags); 2574 set_bit(R5_UPTODATE, &sh2->dev[dd_idx].flags);
2575 for (j = 0; j < conf->raid_disks; j++) 2575 for (j = 0; j < conf->raid_disks; j++)
2576 if (j != sh2->pd_idx && 2576 if (j != sh2->pd_idx &&
2577 (r6s && j != r6s->qd_idx) && 2577 (!r6s || j != raid6_next_disk(sh2->pd_idx,
2578 sh2->disks)) &&
2578 !test_bit(R5_Expanded, &sh2->dev[j].flags)) 2579 !test_bit(R5_Expanded, &sh2->dev[j].flags))
2579 break; 2580 break;
2580 if (j == conf->raid_disks) { 2581 if (j == conf->raid_disks) {
@@ -2583,12 +2584,12 @@ static void handle_stripe_expansion(raid5_conf_t *conf, struct stripe_head *sh,
2583 } 2584 }
2584 release_stripe(sh2); 2585 release_stripe(sh2);
2585 2586
2586 /* done submitting copies, wait for them to complete */
2587 if (i + 1 >= sh->disks) {
2588 async_tx_ack(tx);
2589 dma_wait_for_async_tx(tx);
2590 }
2591 } 2587 }
2588 /* done submitting copies, wait for them to complete */
2589 if (tx) {
2590 async_tx_ack(tx);
2591 dma_wait_for_async_tx(tx);
2592 }
2592} 2593}
2593 2594
2594/* 2595/*
@@ -2855,7 +2856,7 @@ static void handle_stripe5(struct stripe_head *sh)
2855 sh->disks = conf->raid_disks; 2856 sh->disks = conf->raid_disks;
2856 sh->pd_idx = stripe_to_pdidx(sh->sector, conf, 2857 sh->pd_idx = stripe_to_pdidx(sh->sector, conf,
2857 conf->raid_disks); 2858 conf->raid_disks);
2858 s.locked += handle_write_operations5(sh, 0, 1); 2859 s.locked += handle_write_operations5(sh, 1, 1);
2859 } else if (s.expanded && 2860 } else if (s.expanded &&
2860 !test_bit(STRIPE_OP_POSTXOR, &sh->ops.pending)) { 2861 !test_bit(STRIPE_OP_POSTXOR, &sh->ops.pending)) {
2861 clear_bit(STRIPE_EXPAND_READY, &sh->state); 2862 clear_bit(STRIPE_EXPAND_READY, &sh->state);
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
index bfebd2fa7ad..955ea60583b 100644
--- a/drivers/mmc/host/at91_mci.c
+++ b/drivers/mmc/host/at91_mci.c
@@ -941,7 +941,7 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
941 941
942 host = mmc_priv(mmc); 942 host = mmc_priv(mmc);
943 943
944 if (host->present != -1) { 944 if (host->board->det_pin) {
945 device_init_wakeup(&pdev->dev, 0); 945 device_init_wakeup(&pdev->dev, 0);
946 free_irq(host->board->det_pin, host); 946 free_irq(host->board->det_pin, host);
947 cancel_delayed_work(&host->mmc->detect); 947 cancel_delayed_work(&host->mmc->detect);
@@ -972,7 +972,7 @@ static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)
972 struct at91mci_host *host = mmc_priv(mmc); 972 struct at91mci_host *host = mmc_priv(mmc);
973 int ret = 0; 973 int ret = 0;
974 974
975 if (device_may_wakeup(&pdev->dev)) 975 if (host->board->det_pin && device_may_wakeup(&pdev->dev))
976 enable_irq_wake(host->board->det_pin); 976 enable_irq_wake(host->board->det_pin);
977 977
978 if (mmc) 978 if (mmc)
@@ -987,7 +987,7 @@ static int at91_mci_resume(struct platform_device *pdev)
987 struct at91mci_host *host = mmc_priv(mmc); 987 struct at91mci_host *host = mmc_priv(mmc);
988 int ret = 0; 988 int ret = 0;
989 989
990 if (device_may_wakeup(&pdev->dev)) 990 if (host->board->det_pin && device_may_wakeup(&pdev->dev))
991 disable_irq_wake(host->board->det_pin); 991 disable_irq_wake(host->board->det_pin);
992 992
993 if (mmc) 993 if (mmc)
diff --git a/drivers/mtd/maps/lubbock-flash.c b/drivers/mtd/maps/lubbock-flash.c
index 1aa0447c5e6..e8560683b97 100644
--- a/drivers/mtd/maps/lubbock-flash.c
+++ b/drivers/mtd/maps/lubbock-flash.c
@@ -15,9 +15,7 @@
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/slab.h>
19 18
20#include <linux/dma-mapping.h>
21#include <linux/mtd/mtd.h> 19#include <linux/mtd/mtd.h>
22#include <linux/mtd/map.h> 20#include <linux/mtd/map.h>
23#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
@@ -26,7 +24,7 @@
26#include <asm/hardware.h> 24#include <asm/hardware.h>
27#include <asm/arch/pxa-regs.h> 25#include <asm/arch/pxa-regs.h>
28#include <asm/arch/lubbock.h> 26#include <asm/arch/lubbock.h>
29 27#include <asm/cacheflush.h>
30 28
31#define ROM_ADDR 0x00000000 29#define ROM_ADDR 0x00000000
32#define FLASH_ADDR 0x04000000 30#define FLASH_ADDR 0x04000000
@@ -35,7 +33,7 @@
35 33
36static void lubbock_map_inval_cache(struct map_info *map, unsigned long from, ssize_t len) 34static void lubbock_map_inval_cache(struct map_info *map, unsigned long from, ssize_t len)
37{ 35{
38 consistent_sync((char *)map->cached + from, len, DMA_FROM_DEVICE); 36 flush_ioremap_region(map->phys, map->cached, from, len);
39} 37}
40 38
41static struct map_info lubbock_maps[2] = { { 39static struct map_info lubbock_maps[2] = { {
diff --git a/drivers/mtd/maps/mainstone-flash.c b/drivers/mtd/maps/mainstone-flash.c
index eaa4bbb868a..d76487d82dc 100644
--- a/drivers/mtd/maps/mainstone-flash.c
+++ b/drivers/mtd/maps/mainstone-flash.c
@@ -15,8 +15,6 @@
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/dma-mapping.h>
19#include <linux/slab.h>
20 18
21#include <linux/mtd/mtd.h> 19#include <linux/mtd/mtd.h>
22#include <linux/mtd/map.h> 20#include <linux/mtd/map.h>
@@ -26,6 +24,7 @@
26#include <asm/hardware.h> 24#include <asm/hardware.h>
27#include <asm/arch/pxa-regs.h> 25#include <asm/arch/pxa-regs.h>
28#include <asm/arch/mainstone.h> 26#include <asm/arch/mainstone.h>
27#include <asm/cacheflush.h>
29 28
30 29
31#define ROM_ADDR 0x00000000 30#define ROM_ADDR 0x00000000
@@ -36,7 +35,7 @@
36static void mainstone_map_inval_cache(struct map_info *map, unsigned long from, 35static void mainstone_map_inval_cache(struct map_info *map, unsigned long from,
37 ssize_t len) 36 ssize_t len)
38{ 37{
39 consistent_sync((char *)map->cached + from, len, DMA_FROM_DEVICE); 38 flush_ioremap_region(map->phys, map->cached, from, len);
40} 39}
41 40
42static struct map_info mainstone_maps[2] = { { 41static struct map_info mainstone_maps[2] = { {
diff --git a/drivers/mtd/mtdsuper.c b/drivers/mtd/mtdsuper.c
index aca33197120..9b430f20b64 100644
--- a/drivers/mtd/mtdsuper.c
+++ b/drivers/mtd/mtdsuper.c
@@ -70,6 +70,8 @@ static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags,
70 DEBUG(1, "MTDSB: New superblock for device %d (\"%s\")\n", 70 DEBUG(1, "MTDSB: New superblock for device %d (\"%s\")\n",
71 mtd->index, mtd->name); 71 mtd->index, mtd->name);
72 72
73 sb->s_flags = flags;
74
73 ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0); 75 ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
74 if (ret < 0) { 76 if (ret < 0) {
75 up_write(&sb->s_umount); 77 up_write(&sb->s_umount);
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 24e7f9ab3f5..854d80c330e 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -3934,11 +3934,13 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code)
3934 /* Chip reset. */ 3934 /* Chip reset. */
3935 REG_WR(bp, BNX2_PCICFG_MISC_CONFIG, val); 3935 REG_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);
3936 3936
3937 /* Reading back any register after chip reset will hang the
3938 * bus on 5706 A0 and A1. The msleep below provides plenty
3939 * of margin for write posting.
3940 */
3937 if ((CHIP_ID(bp) == CHIP_ID_5706_A0) || 3941 if ((CHIP_ID(bp) == CHIP_ID_5706_A0) ||
3938 (CHIP_ID(bp) == CHIP_ID_5706_A1)) { 3942 (CHIP_ID(bp) == CHIP_ID_5706_A1))
3939 current->state = TASK_UNINTERRUPTIBLE; 3943 msleep(20);
3940 schedule_timeout(HZ / 50);
3941 }
3942 3944
3943 /* Reset takes approximate 30 usec */ 3945 /* Reset takes approximate 30 usec */
3944 for (i = 0; i < 10; i++) { 3946 for (i = 0; i < 10; i++) {
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index ab72563b81e..20e887de254 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -50,7 +50,9 @@ typedef irqreturn_t(*intr_handler_t) (int, void *);
50 50
51struct vlan_group; 51struct vlan_group;
52 52
53struct adapter;
53struct port_info { 54struct port_info {
55 struct adapter *adapter;
54 struct vlan_group *vlan_grp; 56 struct vlan_group *vlan_grp;
55 const struct port_type_info *port_type; 57 const struct port_type_info *port_type;
56 u8 port_id; 58 u8 port_id;
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index 16378004507..2129210a67c 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -679,7 +679,8 @@ const struct adapter_info *t3_get_adapter_info(unsigned int board_id);
679int t3_seeprom_read(struct adapter *adapter, u32 addr, u32 *data); 679int t3_seeprom_read(struct adapter *adapter, u32 addr, u32 *data);
680int t3_seeprom_write(struct adapter *adapter, u32 addr, u32 data); 680int t3_seeprom_write(struct adapter *adapter, u32 addr, u32 data);
681int t3_seeprom_wp(struct adapter *adapter, int enable); 681int t3_seeprom_wp(struct adapter *adapter, int enable);
682int t3_check_tpsram_version(struct adapter *adapter); 682int t3_get_tp_version(struct adapter *adapter, u32 *vers);
683int t3_check_tpsram_version(struct adapter *adapter, int *must_load);
683int t3_check_tpsram(struct adapter *adapter, u8 *tp_ram, unsigned int size); 684int t3_check_tpsram(struct adapter *adapter, u8 *tp_ram, unsigned int size);
684int t3_set_proto_sram(struct adapter *adap, u8 *data); 685int t3_set_proto_sram(struct adapter *adap, u8 *data);
685int t3_read_flash(struct adapter *adapter, unsigned int addr, 686int t3_read_flash(struct adapter *adapter, unsigned int addr,
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index dc5d26988bb..5ab319cfe5d 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -358,11 +358,14 @@ static int init_dummy_netdevs(struct adapter *adap)
358 358
359 for (j = 0; j < pi->nqsets - 1; j++) { 359 for (j = 0; j < pi->nqsets - 1; j++) {
360 if (!adap->dummy_netdev[dummy_idx]) { 360 if (!adap->dummy_netdev[dummy_idx]) {
361 nd = alloc_netdev(0, "", ether_setup); 361 struct port_info *p;
362
363 nd = alloc_netdev(sizeof(*p), "", ether_setup);
362 if (!nd) 364 if (!nd)
363 goto free_all; 365 goto free_all;
364 366
365 nd->priv = adap; 367 p = netdev_priv(nd);
368 p->adapter = adap;
366 nd->weight = 64; 369 nd->weight = 64;
367 set_bit(__LINK_STATE_START, &nd->state); 370 set_bit(__LINK_STATE_START, &nd->state);
368 adap->dummy_netdev[dummy_idx] = nd; 371 adap->dummy_netdev[dummy_idx] = nd;
@@ -482,7 +485,8 @@ static ssize_t attr_store(struct device *d, struct device_attribute *attr,
482#define CXGB3_SHOW(name, val_expr) \ 485#define CXGB3_SHOW(name, val_expr) \
483static ssize_t format_##name(struct net_device *dev, char *buf) \ 486static ssize_t format_##name(struct net_device *dev, char *buf) \
484{ \ 487{ \
485 struct adapter *adap = dev->priv; \ 488 struct port_info *pi = netdev_priv(dev); \
489 struct adapter *adap = pi->adapter; \
486 return sprintf(buf, "%u\n", val_expr); \ 490 return sprintf(buf, "%u\n", val_expr); \
487} \ 491} \
488static ssize_t show_##name(struct device *d, struct device_attribute *attr, \ 492static ssize_t show_##name(struct device *d, struct device_attribute *attr, \
@@ -493,7 +497,8 @@ static ssize_t show_##name(struct device *d, struct device_attribute *attr, \
493 497
494static ssize_t set_nfilters(struct net_device *dev, unsigned int val) 498static ssize_t set_nfilters(struct net_device *dev, unsigned int val)
495{ 499{
496 struct adapter *adap = dev->priv; 500 struct port_info *pi = netdev_priv(dev);
501 struct adapter *adap = pi->adapter;
497 int min_tids = is_offload(adap) ? MC5_MIN_TIDS : 0; 502 int min_tids = is_offload(adap) ? MC5_MIN_TIDS : 0;
498 503
499 if (adap->flags & FULL_INIT_DONE) 504 if (adap->flags & FULL_INIT_DONE)
@@ -515,7 +520,8 @@ static ssize_t store_nfilters(struct device *d, struct device_attribute *attr,
515 520
516static ssize_t set_nservers(struct net_device *dev, unsigned int val) 521static ssize_t set_nservers(struct net_device *dev, unsigned int val)
517{ 522{
518 struct adapter *adap = dev->priv; 523 struct port_info *pi = netdev_priv(dev);
524 struct adapter *adap = pi->adapter;
519 525
520 if (adap->flags & FULL_INIT_DONE) 526 if (adap->flags & FULL_INIT_DONE)
521 return -EBUSY; 527 return -EBUSY;
@@ -556,9 +562,10 @@ static struct attribute_group cxgb3_attr_group = {.attrs = cxgb3_attrs };
556static ssize_t tm_attr_show(struct device *d, struct device_attribute *attr, 562static ssize_t tm_attr_show(struct device *d, struct device_attribute *attr,
557 char *buf, int sched) 563 char *buf, int sched)
558{ 564{
559 ssize_t len; 565 struct port_info *pi = netdev_priv(to_net_dev(d));
566 struct adapter *adap = pi->adapter;
560 unsigned int v, addr, bpt, cpt; 567 unsigned int v, addr, bpt, cpt;
561 struct adapter *adap = to_net_dev(d)->priv; 568 ssize_t len;
562 569
563 addr = A_TP_TX_MOD_Q1_Q0_RATE_LIMIT - sched / 2; 570 addr = A_TP_TX_MOD_Q1_Q0_RATE_LIMIT - sched / 2;
564 rtnl_lock(); 571 rtnl_lock();
@@ -581,10 +588,11 @@ static ssize_t tm_attr_show(struct device *d, struct device_attribute *attr,
581static ssize_t tm_attr_store(struct device *d, struct device_attribute *attr, 588static ssize_t tm_attr_store(struct device *d, struct device_attribute *attr,
582 const char *buf, size_t len, int sched) 589 const char *buf, size_t len, int sched)
583{ 590{
591 struct port_info *pi = netdev_priv(to_net_dev(d));
592 struct adapter *adap = pi->adapter;
593 unsigned int val;
584 char *endp; 594 char *endp;
585 ssize_t ret; 595 ssize_t ret;
586 unsigned int val;
587 struct adapter *adap = to_net_dev(d)->priv;
588 596
589 if (!capable(CAP_NET_ADMIN)) 597 if (!capable(CAP_NET_ADMIN))
590 return -EPERM; 598 return -EPERM;
@@ -721,6 +729,7 @@ static void bind_qsets(struct adapter *adap)
721} 729}
722 730
723#define FW_FNAME "t3fw-%d.%d.%d.bin" 731#define FW_FNAME "t3fw-%d.%d.%d.bin"
732#define TPSRAM_NAME "t3%c_protocol_sram-%d.%d.%d.bin"
724 733
725static int upgrade_fw(struct adapter *adap) 734static int upgrade_fw(struct adapter *adap)
726{ 735{
@@ -739,6 +748,71 @@ static int upgrade_fw(struct adapter *adap)
739 } 748 }
740 ret = t3_load_fw(adap, fw->data, fw->size); 749 ret = t3_load_fw(adap, fw->data, fw->size);
741 release_firmware(fw); 750 release_firmware(fw);
751
752 if (ret == 0)
753 dev_info(dev, "successful upgrade to firmware %d.%d.%d\n",
754 FW_VERSION_MAJOR, FW_VERSION_MINOR, FW_VERSION_MICRO);
755 else
756 dev_err(dev, "failed to upgrade to firmware %d.%d.%d\n",
757 FW_VERSION_MAJOR, FW_VERSION_MINOR, FW_VERSION_MICRO);
758
759 return ret;
760}
761
762static inline char t3rev2char(struct adapter *adapter)
763{
764 char rev = 0;
765
766 switch(adapter->params.rev) {
767 case T3_REV_B:
768 case T3_REV_B2:
769 rev = 'b';
770 break;
771 }
772 return rev;
773}
774
775int update_tpsram(struct adapter *adap)
776{
777 const struct firmware *tpsram;
778 char buf[64];
779 struct device *dev = &adap->pdev->dev;
780 int ret;
781 char rev;
782
783 rev = t3rev2char(adap);
784 if (!rev)
785 return 0;
786
787 snprintf(buf, sizeof(buf), TPSRAM_NAME, rev,
788 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
789
790 ret = request_firmware(&tpsram, buf, dev);
791 if (ret < 0) {
792 dev_err(dev, "could not load TP SRAM: unable to load %s\n",
793 buf);
794 return ret;
795 }
796
797 ret = t3_check_tpsram(adap, tpsram->data, tpsram->size);
798 if (ret)
799 goto release_tpsram;
800
801 ret = t3_set_proto_sram(adap, tpsram->data);
802 if (ret == 0)
803 dev_info(dev,
804 "successful update of protocol engine "
805 "to %d.%d.%d\n",
806 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
807 else
808 dev_err(dev, "failed to update of protocol engine %d.%d.%d\n",
809 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
810 if (ret)
811 dev_err(dev, "loading protocol SRAM failed\n");
812
813release_tpsram:
814 release_firmware(tpsram);
815
742 return ret; 816 return ret;
743} 817}
744 818
@@ -755,6 +829,7 @@ static int upgrade_fw(struct adapter *adap)
755static int cxgb_up(struct adapter *adap) 829static int cxgb_up(struct adapter *adap)
756{ 830{
757 int err = 0; 831 int err = 0;
832 int must_load;
758 833
759 if (!(adap->flags & FULL_INIT_DONE)) { 834 if (!(adap->flags & FULL_INIT_DONE)) {
760 err = t3_check_fw_version(adap); 835 err = t3_check_fw_version(adap);
@@ -763,6 +838,13 @@ static int cxgb_up(struct adapter *adap)
763 if (err) 838 if (err)
764 goto out; 839 goto out;
765 840
841 err = t3_check_tpsram_version(adap, &must_load);
842 if (err == -EINVAL) {
843 err = update_tpsram(adap);
844 if (err && must_load)
845 goto out;
846 }
847
766 err = init_dummy_netdevs(adap); 848 err = init_dummy_netdevs(adap);
767 if (err) 849 if (err)
768 goto out; 850 goto out;
@@ -858,8 +940,9 @@ static void schedule_chk_task(struct adapter *adap)
858 940
859static int offload_open(struct net_device *dev) 941static int offload_open(struct net_device *dev)
860{ 942{
861 struct adapter *adapter = dev->priv; 943 struct port_info *pi = netdev_priv(dev);
862 struct t3cdev *tdev = T3CDEV(dev); 944 struct adapter *adapter = pi->adapter;
945 struct t3cdev *tdev = dev2t3cdev(dev);
863 int adap_up = adapter->open_device_map & PORT_MASK; 946 int adap_up = adapter->open_device_map & PORT_MASK;
864 int err = 0; 947 int err = 0;
865 948
@@ -924,10 +1007,10 @@ static int offload_close(struct t3cdev *tdev)
924 1007
925static int cxgb_open(struct net_device *dev) 1008static int cxgb_open(struct net_device *dev)
926{ 1009{
927 int err;
928 struct adapter *adapter = dev->priv;
929 struct port_info *pi = netdev_priv(dev); 1010 struct port_info *pi = netdev_priv(dev);
1011 struct adapter *adapter = pi->adapter;
930 int other_ports = adapter->open_device_map & PORT_MASK; 1012 int other_ports = adapter->open_device_map & PORT_MASK;
1013 int err;
931 1014
932 if (!adapter->open_device_map && (err = cxgb_up(adapter)) < 0) 1015 if (!adapter->open_device_map && (err = cxgb_up(adapter)) < 0)
933 return err; 1016 return err;
@@ -951,17 +1034,17 @@ static int cxgb_open(struct net_device *dev)
951 1034
952static int cxgb_close(struct net_device *dev) 1035static int cxgb_close(struct net_device *dev)
953{ 1036{
954 struct adapter *adapter = dev->priv; 1037 struct port_info *pi = netdev_priv(dev);
955 struct port_info *p = netdev_priv(dev); 1038 struct adapter *adapter = pi->adapter;
956 1039
957 t3_port_intr_disable(adapter, p->port_id); 1040 t3_port_intr_disable(adapter, pi->port_id);
958 netif_stop_queue(dev); 1041 netif_stop_queue(dev);
959 p->phy.ops->power_down(&p->phy, 1); 1042 pi->phy.ops->power_down(&pi->phy, 1);
960 netif_carrier_off(dev); 1043 netif_carrier_off(dev);
961 t3_mac_disable(&p->mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX); 1044 t3_mac_disable(&pi->mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX);
962 1045
963 spin_lock(&adapter->work_lock); /* sync with update task */ 1046 spin_lock(&adapter->work_lock); /* sync with update task */
964 clear_bit(p->port_id, &adapter->open_device_map); 1047 clear_bit(pi->port_id, &adapter->open_device_map);
965 spin_unlock(&adapter->work_lock); 1048 spin_unlock(&adapter->work_lock);
966 1049
967 if (!(adapter->open_device_map & PORT_MASK)) 1050 if (!(adapter->open_device_map & PORT_MASK))
@@ -976,13 +1059,13 @@ static int cxgb_close(struct net_device *dev)
976 1059
977static struct net_device_stats *cxgb_get_stats(struct net_device *dev) 1060static struct net_device_stats *cxgb_get_stats(struct net_device *dev)
978{ 1061{
979 struct adapter *adapter = dev->priv; 1062 struct port_info *pi = netdev_priv(dev);
980 struct port_info *p = netdev_priv(dev); 1063 struct adapter *adapter = pi->adapter;
981 struct net_device_stats *ns = &p->netstats; 1064 struct net_device_stats *ns = &pi->netstats;
982 const struct mac_stats *pstats; 1065 const struct mac_stats *pstats;
983 1066
984 spin_lock(&adapter->stats_lock); 1067 spin_lock(&adapter->stats_lock);
985 pstats = t3_mac_update_stats(&p->mac); 1068 pstats = t3_mac_update_stats(&pi->mac);
986 spin_unlock(&adapter->stats_lock); 1069 spin_unlock(&adapter->stats_lock);
987 1070
988 ns->tx_bytes = pstats->tx_octets; 1071 ns->tx_bytes = pstats->tx_octets;
@@ -1015,14 +1098,16 @@ static struct net_device_stats *cxgb_get_stats(struct net_device *dev)
1015 1098
1016static u32 get_msglevel(struct net_device *dev) 1099static u32 get_msglevel(struct net_device *dev)
1017{ 1100{
1018 struct adapter *adapter = dev->priv; 1101 struct port_info *pi = netdev_priv(dev);
1102 struct adapter *adapter = pi->adapter;
1019 1103
1020 return adapter->msg_enable; 1104 return adapter->msg_enable;
1021} 1105}
1022 1106
1023static void set_msglevel(struct net_device *dev, u32 val) 1107static void set_msglevel(struct net_device *dev, u32 val)
1024{ 1108{
1025 struct adapter *adapter = dev->priv; 1109 struct port_info *pi = netdev_priv(dev);
1110 struct adapter *adapter = pi->adapter;
1026 1111
1027 adapter->msg_enable = val; 1112 adapter->msg_enable = val;
1028} 1113}
@@ -1096,10 +1181,13 @@ static int get_eeprom_len(struct net_device *dev)
1096 1181
1097static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 1182static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
1098{ 1183{
1184 struct port_info *pi = netdev_priv(dev);
1185 struct adapter *adapter = pi->adapter;
1099 u32 fw_vers = 0; 1186 u32 fw_vers = 0;
1100 struct adapter *adapter = dev->priv; 1187 u32 tp_vers = 0;
1101 1188
1102 t3_get_fw_version(adapter, &fw_vers); 1189 t3_get_fw_version(adapter, &fw_vers);
1190 t3_get_tp_version(adapter, &tp_vers);
1103 1191
1104 strcpy(info->driver, DRV_NAME); 1192 strcpy(info->driver, DRV_NAME);
1105 strcpy(info->version, DRV_VERSION); 1193 strcpy(info->version, DRV_VERSION);
@@ -1108,11 +1196,14 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
1108 strcpy(info->fw_version, "N/A"); 1196 strcpy(info->fw_version, "N/A");
1109 else { 1197 else {
1110 snprintf(info->fw_version, sizeof(info->fw_version), 1198 snprintf(info->fw_version, sizeof(info->fw_version),
1111 "%s %u.%u.%u", 1199 "%s %u.%u.%u TP %u.%u.%u",
1112 G_FW_VERSION_TYPE(fw_vers) ? "T" : "N", 1200 G_FW_VERSION_TYPE(fw_vers) ? "T" : "N",
1113 G_FW_VERSION_MAJOR(fw_vers), 1201 G_FW_VERSION_MAJOR(fw_vers),
1114 G_FW_VERSION_MINOR(fw_vers), 1202 G_FW_VERSION_MINOR(fw_vers),
1115 G_FW_VERSION_MICRO(fw_vers)); 1203 G_FW_VERSION_MICRO(fw_vers),
1204 G_TP_VERSION_MAJOR(tp_vers),
1205 G_TP_VERSION_MINOR(tp_vers),
1206 G_TP_VERSION_MICRO(tp_vers));
1116 } 1207 }
1117} 1208}
1118 1209
@@ -1136,8 +1227,8 @@ static unsigned long collect_sge_port_stats(struct adapter *adapter,
1136static void get_stats(struct net_device *dev, struct ethtool_stats *stats, 1227static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
1137 u64 *data) 1228 u64 *data)
1138{ 1229{
1139 struct adapter *adapter = dev->priv;
1140 struct port_info *pi = netdev_priv(dev); 1230 struct port_info *pi = netdev_priv(dev);
1231 struct adapter *adapter = pi->adapter;
1141 const struct mac_stats *s; 1232 const struct mac_stats *s;
1142 1233
1143 spin_lock(&adapter->stats_lock); 1234 spin_lock(&adapter->stats_lock);
@@ -1205,7 +1296,8 @@ static inline void reg_block_dump(struct adapter *ap, void *buf,
1205static void get_regs(struct net_device *dev, struct ethtool_regs *regs, 1296static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
1206 void *buf) 1297 void *buf)
1207{ 1298{
1208 struct adapter *ap = dev->priv; 1299 struct port_info *pi = netdev_priv(dev);
1300 struct adapter *ap = pi->adapter;
1209 1301
1210 /* 1302 /*
1211 * Version scheme: 1303 * Version scheme:
@@ -1246,8 +1338,9 @@ static int restart_autoneg(struct net_device *dev)
1246 1338
1247static int cxgb3_phys_id(struct net_device *dev, u32 data) 1339static int cxgb3_phys_id(struct net_device *dev, u32 data)
1248{ 1340{
1341 struct port_info *pi = netdev_priv(dev);
1342 struct adapter *adapter = pi->adapter;
1249 int i; 1343 int i;
1250 struct adapter *adapter = dev->priv;
1251 1344
1252 if (data == 0) 1345 if (data == 0)
1253 data = 2; 1346 data = 2;
@@ -1408,8 +1501,8 @@ static int set_rx_csum(struct net_device *dev, u32 data)
1408 1501
1409static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e) 1502static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1410{ 1503{
1411 const struct adapter *adapter = dev->priv; 1504 struct port_info *pi = netdev_priv(dev);
1412 const struct port_info *pi = netdev_priv(dev); 1505 struct adapter *adapter = pi->adapter;
1413 const struct qset_params *q = &adapter->params.sge.qset[pi->first_qset]; 1506 const struct qset_params *q = &adapter->params.sge.qset[pi->first_qset];
1414 1507
1415 e->rx_max_pending = MAX_RX_BUFFERS; 1508 e->rx_max_pending = MAX_RX_BUFFERS;
@@ -1425,10 +1518,10 @@ static void get_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1425 1518
1426static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e) 1519static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1427{ 1520{
1428 int i; 1521 struct port_info *pi = netdev_priv(dev);
1522 struct adapter *adapter = pi->adapter;
1429 struct qset_params *q; 1523 struct qset_params *q;
1430 struct adapter *adapter = dev->priv; 1524 int i;
1431 const struct port_info *pi = netdev_priv(dev);
1432 1525
1433 if (e->rx_pending > MAX_RX_BUFFERS || 1526 if (e->rx_pending > MAX_RX_BUFFERS ||
1434 e->rx_jumbo_pending > MAX_RX_JUMBO_BUFFERS || 1527 e->rx_jumbo_pending > MAX_RX_JUMBO_BUFFERS ||
@@ -1457,7 +1550,8 @@ static int set_sge_param(struct net_device *dev, struct ethtool_ringparam *e)
1457 1550
1458static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c) 1551static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
1459{ 1552{
1460 struct adapter *adapter = dev->priv; 1553 struct port_info *pi = netdev_priv(dev);
1554 struct adapter *adapter = pi->adapter;
1461 struct qset_params *qsp = &adapter->params.sge.qset[0]; 1555 struct qset_params *qsp = &adapter->params.sge.qset[0];
1462 struct sge_qset *qs = &adapter->sge.qs[0]; 1556 struct sge_qset *qs = &adapter->sge.qs[0];
1463 1557
@@ -1471,7 +1565,8 @@ static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
1471 1565
1472static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c) 1566static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
1473{ 1567{
1474 struct adapter *adapter = dev->priv; 1568 struct port_info *pi = netdev_priv(dev);
1569 struct adapter *adapter = pi->adapter;
1475 struct qset_params *q = adapter->params.sge.qset; 1570 struct qset_params *q = adapter->params.sge.qset;
1476 1571
1477 c->rx_coalesce_usecs = q->coalesce_usecs; 1572 c->rx_coalesce_usecs = q->coalesce_usecs;
@@ -1481,8 +1576,9 @@ static int get_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
1481static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e, 1576static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
1482 u8 * data) 1577 u8 * data)
1483{ 1578{
1579 struct port_info *pi = netdev_priv(dev);
1580 struct adapter *adapter = pi->adapter;
1484 int i, err = 0; 1581 int i, err = 0;
1485 struct adapter *adapter = dev->priv;
1486 1582
1487 u8 *buf = kmalloc(EEPROMSIZE, GFP_KERNEL); 1583 u8 *buf = kmalloc(EEPROMSIZE, GFP_KERNEL);
1488 if (!buf) 1584 if (!buf)
@@ -1501,10 +1597,11 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
1501static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, 1597static int set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
1502 u8 * data) 1598 u8 * data)
1503{ 1599{
1600 struct port_info *pi = netdev_priv(dev);
1601 struct adapter *adapter = pi->adapter;
1602 u32 aligned_offset, aligned_len, *p;
1504 u8 *buf; 1603 u8 *buf;
1505 int err = 0; 1604 int err = 0;
1506 u32 aligned_offset, aligned_len, *p;
1507 struct adapter *adapter = dev->priv;
1508 1605
1509 if (eeprom->magic != EEPROM_MAGIC) 1606 if (eeprom->magic != EEPROM_MAGIC)
1510 return -EINVAL; 1607 return -EINVAL;
@@ -1592,9 +1689,10 @@ static int in_range(int val, int lo, int hi)
1592 1689
1593static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) 1690static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
1594{ 1691{
1595 int ret; 1692 struct port_info *pi = netdev_priv(dev);
1693 struct adapter *adapter = pi->adapter;
1596 u32 cmd; 1694 u32 cmd;
1597 struct adapter *adapter = dev->priv; 1695 int ret;
1598 1696
1599 if (copy_from_user(&cmd, useraddr, sizeof(cmd))) 1697 if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
1600 return -EFAULT; 1698 return -EFAULT;
@@ -1923,10 +2021,10 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
1923 2021
1924static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd) 2022static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
1925{ 2023{
1926 int ret, mmd;
1927 struct adapter *adapter = dev->priv;
1928 struct port_info *pi = netdev_priv(dev);
1929 struct mii_ioctl_data *data = if_mii(req); 2024 struct mii_ioctl_data *data = if_mii(req);
2025 struct port_info *pi = netdev_priv(dev);
2026 struct adapter *adapter = pi->adapter;
2027 int ret, mmd;
1930 2028
1931 switch (cmd) { 2029 switch (cmd) {
1932 case SIOCGMIIPHY: 2030 case SIOCGMIIPHY:
@@ -1994,9 +2092,9 @@ static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
1994 2092
1995static int cxgb_change_mtu(struct net_device *dev, int new_mtu) 2093static int cxgb_change_mtu(struct net_device *dev, int new_mtu)
1996{ 2094{
1997 int ret;
1998 struct adapter *adapter = dev->priv;
1999 struct port_info *pi = netdev_priv(dev); 2095 struct port_info *pi = netdev_priv(dev);
2096 struct adapter *adapter = pi->adapter;
2097 int ret;
2000 2098
2001 if (new_mtu < 81) /* accommodate SACK */ 2099 if (new_mtu < 81) /* accommodate SACK */
2002 return -EINVAL; 2100 return -EINVAL;
@@ -2013,8 +2111,8 @@ static int cxgb_change_mtu(struct net_device *dev, int new_mtu)
2013 2111
2014static int cxgb_set_mac_addr(struct net_device *dev, void *p) 2112static int cxgb_set_mac_addr(struct net_device *dev, void *p)
2015{ 2113{
2016 struct adapter *adapter = dev->priv;
2017 struct port_info *pi = netdev_priv(dev); 2114 struct port_info *pi = netdev_priv(dev);
2115 struct adapter *adapter = pi->adapter;
2018 struct sockaddr *addr = p; 2116 struct sockaddr *addr = p;
2019 2117
2020 if (!is_valid_ether_addr(addr->sa_data)) 2118 if (!is_valid_ether_addr(addr->sa_data))
@@ -2050,8 +2148,8 @@ static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p)
2050 2148
2051static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp) 2149static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
2052{ 2150{
2053 struct adapter *adapter = dev->priv;
2054 struct port_info *pi = netdev_priv(dev); 2151 struct port_info *pi = netdev_priv(dev);
2152 struct adapter *adapter = pi->adapter;
2055 2153
2056 pi->vlan_grp = grp; 2154 pi->vlan_grp = grp;
2057 if (adapter->params.rev > 0) 2155 if (adapter->params.rev > 0)
@@ -2070,8 +2168,8 @@ static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
2070#ifdef CONFIG_NET_POLL_CONTROLLER 2168#ifdef CONFIG_NET_POLL_CONTROLLER
2071static void cxgb_netpoll(struct net_device *dev) 2169static void cxgb_netpoll(struct net_device *dev)
2072{ 2170{
2073 struct adapter *adapter = dev->priv;
2074 struct port_info *pi = netdev_priv(dev); 2171 struct port_info *pi = netdev_priv(dev);
2172 struct adapter *adapter = pi->adapter;
2075 int qidx; 2173 int qidx;
2076 2174
2077 for (qidx = pi->first_qset; qidx < pi->first_qset + pi->nqsets; qidx++) { 2175 for (qidx = pi->first_qset; qidx < pi->first_qset + pi->nqsets; qidx++) {
@@ -2088,42 +2186,6 @@ static void cxgb_netpoll(struct net_device *dev)
2088} 2186}
2089#endif 2187#endif
2090 2188
2091#define TPSRAM_NAME "t3%c_protocol_sram-%d.%d.%d.bin"
2092int update_tpsram(struct adapter *adap)
2093{
2094 const struct firmware *tpsram;
2095 char buf[64];
2096 struct device *dev = &adap->pdev->dev;
2097 int ret;
2098 char rev;
2099
2100 rev = adap->params.rev == T3_REV_B2 ? 'b' : 'a';
2101
2102 snprintf(buf, sizeof(buf), TPSRAM_NAME, rev,
2103 TP_VERSION_MAJOR, TP_VERSION_MINOR, TP_VERSION_MICRO);
2104
2105 ret = request_firmware(&tpsram, buf, dev);
2106 if (ret < 0) {
2107 dev_err(dev, "could not load TP SRAM: unable to load %s\n",
2108 buf);
2109 return ret;
2110 }
2111
2112 ret = t3_check_tpsram(adap, tpsram->data, tpsram->size);
2113 if (ret)
2114 goto release_tpsram;
2115
2116 ret = t3_set_proto_sram(adap, tpsram->data);
2117 if (ret)
2118 dev_err(dev, "loading protocol SRAM failed\n");
2119
2120release_tpsram:
2121 release_firmware(tpsram);
2122
2123 return ret;
2124}
2125
2126
2127/* 2189/*
2128 * Periodic accumulation of MAC statistics. 2190 * Periodic accumulation of MAC statistics.
2129 */ 2191 */
@@ -2433,6 +2495,7 @@ static int __devinit init_one(struct pci_dev *pdev,
2433 2495
2434 adapter->port[i] = netdev; 2496 adapter->port[i] = netdev;
2435 pi = netdev_priv(netdev); 2497 pi = netdev_priv(netdev);
2498 pi->adapter = adapter;
2436 pi->rx_csum_offload = 1; 2499 pi->rx_csum_offload = 1;
2437 pi->nqsets = 1; 2500 pi->nqsets = 1;
2438 pi->first_qset = i; 2501 pi->first_qset = i;
@@ -2442,7 +2505,6 @@ static int __devinit init_one(struct pci_dev *pdev,
2442 netdev->irq = pdev->irq; 2505 netdev->irq = pdev->irq;
2443 netdev->mem_start = mmio_start; 2506 netdev->mem_start = mmio_start;
2444 netdev->mem_end = mmio_start + mmio_len - 1; 2507 netdev->mem_end = mmio_start + mmio_len - 1;
2445 netdev->priv = adapter;
2446 netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; 2508 netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;
2447 netdev->features |= NETIF_F_LLTX; 2509 netdev->features |= NETIF_F_LLTX;
2448 if (pci_using_dac) 2510 if (pci_using_dac)
@@ -2467,18 +2529,11 @@ static int __devinit init_one(struct pci_dev *pdev,
2467 SET_ETHTOOL_OPS(netdev, &cxgb_ethtool_ops); 2529 SET_ETHTOOL_OPS(netdev, &cxgb_ethtool_ops);
2468 } 2530 }
2469 2531
2470 pci_set_drvdata(pdev, adapter->port[0]); 2532 pci_set_drvdata(pdev, adapter);
2471 if (t3_prep_adapter(adapter, ai, 1) < 0) { 2533 if (t3_prep_adapter(adapter, ai, 1) < 0) {
2472 err = -ENODEV; 2534 err = -ENODEV;
2473 goto out_free_dev; 2535 goto out_free_dev;
2474 } 2536 }
2475
2476 err = t3_check_tpsram_version(adapter);
2477 if (err == -EINVAL)
2478 err = update_tpsram(adapter);
2479
2480 if (err)
2481 goto out_free_dev;
2482 2537
2483 /* 2538 /*
2484 * The card is now ready to go. If any errors occur during device 2539 * The card is now ready to go. If any errors occur during device
@@ -2547,11 +2602,10 @@ out_release_regions:
2547 2602
2548static void __devexit remove_one(struct pci_dev *pdev) 2603static void __devexit remove_one(struct pci_dev *pdev)
2549{ 2604{
2550 struct net_device *dev = pci_get_drvdata(pdev); 2605 struct adapter *adapter = pci_get_drvdata(pdev);
2551 2606
2552 if (dev) { 2607 if (adapter) {
2553 int i; 2608 int i;
2554 struct adapter *adapter = dev->priv;
2555 2609
2556 t3_sge_stop(adapter); 2610 t3_sge_stop(adapter);
2557 sysfs_remove_group(&adapter->port[0]->dev.kobj, 2611 sysfs_remove_group(&adapter->port[0]->dev.kobj,
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index e620ed4c3ff..bdff7baeb59 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -593,6 +593,16 @@ int cxgb3_alloc_stid(struct t3cdev *tdev, struct cxgb3_client *client,
593 593
594EXPORT_SYMBOL(cxgb3_alloc_stid); 594EXPORT_SYMBOL(cxgb3_alloc_stid);
595 595
596/* Get the t3cdev associated with a net_device */
597struct t3cdev *dev2t3cdev(struct net_device *dev)
598{
599 const struct port_info *pi = netdev_priv(dev);
600
601 return (struct t3cdev *)pi->adapter;
602}
603
604EXPORT_SYMBOL(dev2t3cdev);
605
596static int do_smt_write_rpl(struct t3cdev *dev, struct sk_buff *skb) 606static int do_smt_write_rpl(struct t3cdev *dev, struct sk_buff *skb)
597{ 607{
598 struct cpl_smt_write_rpl *rpl = cplhdr(skb); 608 struct cpl_smt_write_rpl *rpl = cplhdr(skb);
@@ -925,7 +935,7 @@ void cxgb_neigh_update(struct neighbour *neigh)
925 struct net_device *dev = neigh->dev; 935 struct net_device *dev = neigh->dev;
926 936
927 if (dev && (is_offloading(dev))) { 937 if (dev && (is_offloading(dev))) {
928 struct t3cdev *tdev = T3CDEV(dev); 938 struct t3cdev *tdev = dev2t3cdev(dev);
929 939
930 BUG_ON(!tdev); 940 BUG_ON(!tdev);
931 t3_l2t_update(tdev, neigh); 941 t3_l2t_update(tdev, neigh);
@@ -973,9 +983,9 @@ void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
973 "device ignored.\n", __FUNCTION__); 983 "device ignored.\n", __FUNCTION__);
974 return; 984 return;
975 } 985 }
976 tdev = T3CDEV(olddev); 986 tdev = dev2t3cdev(olddev);
977 BUG_ON(!tdev); 987 BUG_ON(!tdev);
978 if (tdev != T3CDEV(newdev)) { 988 if (tdev != dev2t3cdev(newdev)) {
979 printk(KERN_WARNING "%s: Redirect to different " 989 printk(KERN_WARNING "%s: Redirect to different "
980 "offload device ignored.\n", __FUNCTION__); 990 "offload device ignored.\n", __FUNCTION__);
981 return; 991 return;
diff --git a/drivers/net/cxgb3/cxgb3_offload.h b/drivers/net/cxgb3/cxgb3_offload.h
index f15446a32ef..7a379138b5a 100644
--- a/drivers/net/cxgb3/cxgb3_offload.h
+++ b/drivers/net/cxgb3/cxgb3_offload.h
@@ -51,6 +51,8 @@ void cxgb3_offload_deactivate(struct adapter *adapter);
51 51
52void cxgb3_set_dummy_ops(struct t3cdev *dev); 52void cxgb3_set_dummy_ops(struct t3cdev *dev);
53 53
54struct t3cdev *dev2t3cdev(struct net_device *dev);
55
54/* 56/*
55 * Client registration. Users of T3 driver must register themselves. 57 * Client registration. Users of T3 driver must register themselves.
56 * The T3 driver will call the add function of every client for each T3 58 * The T3 driver will call the add function of every client for each T3
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index a2cfd68ac75..58a5f60521e 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -1073,7 +1073,7 @@ int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
1073{ 1073{
1074 unsigned int ndesc, pidx, credits, gen, compl; 1074 unsigned int ndesc, pidx, credits, gen, compl;
1075 const struct port_info *pi = netdev_priv(dev); 1075 const struct port_info *pi = netdev_priv(dev);
1076 struct adapter *adap = dev->priv; 1076 struct adapter *adap = pi->adapter;
1077 struct sge_qset *qs = dev2qset(dev); 1077 struct sge_qset *qs = dev2qset(dev);
1078 struct sge_txq *q = &qs->txq[TXQ_ETH]; 1078 struct sge_txq *q = &qs->txq[TXQ_ETH];
1079 1079
@@ -1326,7 +1326,8 @@ static void restart_ctrlq(unsigned long data)
1326 struct sk_buff *skb; 1326 struct sk_buff *skb;
1327 struct sge_qset *qs = (struct sge_qset *)data; 1327 struct sge_qset *qs = (struct sge_qset *)data;
1328 struct sge_txq *q = &qs->txq[TXQ_CTRL]; 1328 struct sge_txq *q = &qs->txq[TXQ_CTRL];
1329 struct adapter *adap = qs->netdev->priv; 1329 const struct port_info *pi = netdev_priv(qs->netdev);
1330 struct adapter *adap = pi->adapter;
1330 1331
1331 spin_lock(&q->lock); 1332 spin_lock(&q->lock);
1332 again:reclaim_completed_tx_imm(q); 1333 again:reclaim_completed_tx_imm(q);
@@ -1531,7 +1532,8 @@ static void restart_offloadq(unsigned long data)
1531 struct sk_buff *skb; 1532 struct sk_buff *skb;
1532 struct sge_qset *qs = (struct sge_qset *)data; 1533 struct sge_qset *qs = (struct sge_qset *)data;
1533 struct sge_txq *q = &qs->txq[TXQ_OFLD]; 1534 struct sge_txq *q = &qs->txq[TXQ_OFLD];
1534 struct adapter *adap = qs->netdev->priv; 1535 const struct port_info *pi = netdev_priv(qs->netdev);
1536 struct adapter *adap = pi->adapter;
1535 1537
1536 spin_lock(&q->lock); 1538 spin_lock(&q->lock);
1537 again:reclaim_completed_tx(adap, q); 1539 again:reclaim_completed_tx(adap, q);
@@ -1675,7 +1677,8 @@ static inline void deliver_partial_bundle(struct t3cdev *tdev,
1675 */ 1677 */
1676static int ofld_poll(struct net_device *dev, int *budget) 1678static int ofld_poll(struct net_device *dev, int *budget)
1677{ 1679{
1678 struct adapter *adapter = dev->priv; 1680 const struct port_info *pi = netdev_priv(dev);
1681 struct adapter *adapter = pi->adapter;
1679 struct sge_qset *qs = dev2qset(dev); 1682 struct sge_qset *qs = dev2qset(dev);
1680 struct sge_rspq *q = &qs->rspq; 1683 struct sge_rspq *q = &qs->rspq;
1681 int work_done, limit = min(*budget, dev->quota), avail = limit; 1684 int work_done, limit = min(*budget, dev->quota), avail = limit;
@@ -2075,7 +2078,8 @@ static inline int is_pure_response(const struct rsp_desc *r)
2075 */ 2078 */
2076static int napi_rx_handler(struct net_device *dev, int *budget) 2079static int napi_rx_handler(struct net_device *dev, int *budget)
2077{ 2080{
2078 struct adapter *adap = dev->priv; 2081 const struct port_info *pi = netdev_priv(dev);
2082 struct adapter *adap = pi->adapter;
2079 struct sge_qset *qs = dev2qset(dev); 2083 struct sge_qset *qs = dev2qset(dev);
2080 int effective_budget = min(*budget, dev->quota); 2084 int effective_budget = min(*budget, dev->quota);
2081 2085
@@ -2205,7 +2209,8 @@ static inline int handle_responses(struct adapter *adap, struct sge_rspq *q)
2205irqreturn_t t3_sge_intr_msix(int irq, void *cookie) 2209irqreturn_t t3_sge_intr_msix(int irq, void *cookie)
2206{ 2210{
2207 struct sge_qset *qs = cookie; 2211 struct sge_qset *qs = cookie;
2208 struct adapter *adap = qs->netdev->priv; 2212 const struct port_info *pi = netdev_priv(qs->netdev);
2213 struct adapter *adap = pi->adapter;
2209 struct sge_rspq *q = &qs->rspq; 2214 struct sge_rspq *q = &qs->rspq;
2210 2215
2211 spin_lock(&q->lock); 2216 spin_lock(&q->lock);
@@ -2224,7 +2229,8 @@ irqreturn_t t3_sge_intr_msix(int irq, void *cookie)
2224irqreturn_t t3_sge_intr_msix_napi(int irq, void *cookie) 2229irqreturn_t t3_sge_intr_msix_napi(int irq, void *cookie)
2225{ 2230{
2226 struct sge_qset *qs = cookie; 2231 struct sge_qset *qs = cookie;
2227 struct adapter *adap = qs->netdev->priv; 2232 const struct port_info *pi = netdev_priv(qs->netdev);
2233 struct adapter *adap = pi->adapter;
2228 struct sge_rspq *q = &qs->rspq; 2234 struct sge_rspq *q = &qs->rspq;
2229 2235
2230 spin_lock(&q->lock); 2236 spin_lock(&q->lock);
@@ -2508,7 +2514,8 @@ static void sge_timer_cb(unsigned long data)
2508{ 2514{
2509 spinlock_t *lock; 2515 spinlock_t *lock;
2510 struct sge_qset *qs = (struct sge_qset *)data; 2516 struct sge_qset *qs = (struct sge_qset *)data;
2511 struct adapter *adap = qs->netdev->priv; 2517 const struct port_info *pi = netdev_priv(qs->netdev);
2518 struct adapter *adap = pi->adapter;
2512 2519
2513 if (spin_trylock(&qs->txq[TXQ_ETH].lock)) { 2520 if (spin_trylock(&qs->txq[TXQ_ETH].lock)) {
2514 reclaim_completed_tx(adap, &qs->txq[TXQ_ETH]); 2521 reclaim_completed_tx(adap, &qs->txq[TXQ_ETH]);
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index dd3149d94ba..b02d15daf5d 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -848,16 +848,15 @@ static int t3_write_flash(struct adapter *adapter, unsigned int addr,
848} 848}
849 849
850/** 850/**
851 * t3_check_tpsram_version - read the tp sram version 851 * t3_get_tp_version - read the tp sram version
852 * @adapter: the adapter 852 * @adapter: the adapter
853 * @vers: where to place the version
853 * 854 *
854 * Reads the protocol sram version from serial eeprom. 855 * Reads the protocol sram version from sram.
855 */ 856 */
856int t3_check_tpsram_version(struct adapter *adapter) 857int t3_get_tp_version(struct adapter *adapter, u32 *vers)
857{ 858{
858 int ret; 859 int ret;
859 u32 vers;
860 unsigned int major, minor;
861 860
862 /* Get version loaded in SRAM */ 861 /* Get version loaded in SRAM */
863 t3_write_reg(adapter, A_TP_EMBED_OP_FIELD0, 0); 862 t3_write_reg(adapter, A_TP_EMBED_OP_FIELD0, 0);
@@ -866,7 +865,32 @@ int t3_check_tpsram_version(struct adapter *adapter)
866 if (ret) 865 if (ret)
867 return ret; 866 return ret;
868 867
869 vers = t3_read_reg(adapter, A_TP_EMBED_OP_FIELD1); 868 *vers = t3_read_reg(adapter, A_TP_EMBED_OP_FIELD1);
869
870 return 0;
871}
872
873/**
874 * t3_check_tpsram_version - read the tp sram version
875 * @adapter: the adapter
876 * @must_load: set to 1 if loading a new microcode image is required
877 *
878 * Reads the protocol sram version from flash.
879 */
880int t3_check_tpsram_version(struct adapter *adapter, int *must_load)
881{
882 int ret;
883 u32 vers;
884 unsigned int major, minor;
885
886 if (adapter->params.rev == T3_REV_A)
887 return 0;
888
889 *must_load = 1;
890
891 ret = t3_get_tp_version(adapter, &vers);
892 if (ret)
893 return ret;
870 894
871 major = G_TP_VERSION_MAJOR(vers); 895 major = G_TP_VERSION_MAJOR(vers);
872 minor = G_TP_VERSION_MINOR(vers); 896 minor = G_TP_VERSION_MINOR(vers);
@@ -874,6 +898,16 @@ int t3_check_tpsram_version(struct adapter *adapter)
874 if (major == TP_VERSION_MAJOR && minor == TP_VERSION_MINOR) 898 if (major == TP_VERSION_MAJOR && minor == TP_VERSION_MINOR)
875 return 0; 899 return 0;
876 900
901 if (major != TP_VERSION_MAJOR)
902 CH_ERR(adapter, "found wrong TP version (%u.%u), "
903 "driver needs version %d.%d\n", major, minor,
904 TP_VERSION_MAJOR, TP_VERSION_MINOR);
905 else {
906 *must_load = 0;
907 CH_ERR(adapter, "found wrong TP version (%u.%u), "
908 "driver compiled for version %d.%d\n", major, minor,
909 TP_VERSION_MAJOR, TP_VERSION_MINOR);
910 }
877 return -EINVAL; 911 return -EINVAL;
878} 912}
879 913
diff --git a/drivers/net/cxgb3/t3cdev.h b/drivers/net/cxgb3/t3cdev.h
index fa4099bc041..77fcc1a4984 100644
--- a/drivers/net/cxgb3/t3cdev.h
+++ b/drivers/net/cxgb3/t3cdev.h
@@ -42,9 +42,6 @@
42 42
43#define T3CNAMSIZ 16 43#define T3CNAMSIZ 16
44 44
45/* Get the t3cdev associated with a net_device */
46#define T3CDEV(netdev) (struct t3cdev *)(netdev->priv)
47
48struct cxgb3_client; 45struct cxgb3_client;
49 46
50enum t3ctype { 47enum t3ctype {
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 3ca1e8ece54..0834ef0eddb 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -48,6 +48,7 @@
48#ifdef CONFIG_SERIAL_8250 48#ifdef CONFIG_SERIAL_8250
49#include <linux/serial_core.h> 49#include <linux/serial_core.h>
50#include <linux/serial_8250.h> 50#include <linux/serial_8250.h>
51#include <linux/serial_reg.h>
51#endif 52#endif
52 53
53#include <linux/netdevice.h> 54#include <linux/netdevice.h>
@@ -1151,13 +1152,41 @@ static int ioc3_is_menet(struct pci_dev *pdev)
1151 * Also look in ip27-pci.c:pci_fixup_ioc3() for some comments on working 1152 * Also look in ip27-pci.c:pci_fixup_ioc3() for some comments on working
1152 * around ioc3 oddities in this respect. 1153 * around ioc3 oddities in this respect.
1153 * 1154 *
1154 * The IOC3 serials use a 22MHz clock rate with an additional divider by 3. 1155 * The IOC3 serials use a 22MHz clock rate with an additional divider which
1156 * can be programmed in the SCR register if the DLAB bit is set.
1157 *
1158 * Register to interrupt zero because we share the interrupt with
1159 * the serial driver which we don't properly support yet.
1160 *
1161 * Can't use UPF_IOREMAP as the whole of IOC3 resources have already been
1162 * registered.
1155 */ 1163 */
1164static void __devinit ioc3_8250_register(struct ioc3_uartregs __iomem *uart)
1165{
1166#define COSMISC_CONSTANT 6
1167
1168 struct uart_port port = {
1169 .irq = 0,
1170 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
1171 .iotype = UPIO_MEM,
1172 .regshift = 0,
1173 .uartclk = (22000000 << 1) / COSMISC_CONSTANT,
1174
1175 .membase = (unsigned char __iomem *) uart,
1176 .mapbase = (unsigned long) uart,
1177 };
1178 unsigned char lcr;
1179
1180 lcr = uart->iu_lcr;
1181 uart->iu_lcr = lcr | UART_LCR_DLAB;
1182 uart->iu_scr = COSMISC_CONSTANT,
1183 uart->iu_lcr = lcr;
1184 uart->iu_lcr;
1185 serial8250_register_port(&port);
1186}
1156 1187
1157static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3) 1188static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
1158{ 1189{
1159 struct uart_port port;
1160
1161 /* 1190 /*
1162 * We need to recognice and treat the fourth MENET serial as it 1191 * We need to recognice and treat the fourth MENET serial as it
1163 * does not have an SuperIO chip attached to it, therefore attempting 1192 * does not have an SuperIO chip attached to it, therefore attempting
@@ -1171,24 +1200,35 @@ static void __devinit ioc3_serial_probe(struct pci_dev *pdev, struct ioc3 *ioc3)
1171 return; 1200 return;
1172 1201
1173 /* 1202 /*
1174 * Register to interrupt zero because we share the interrupt with 1203 * Switch IOC3 to PIO mode. It probably already was but let's be
1175 * the serial driver which we don't properly support yet. 1204 * paranoid
1176 *
1177 * Can't use UPF_IOREMAP as the whole of IOC3 resources have already
1178 * been registered.
1179 */ 1205 */
1180 memset(&port, 0, sizeof(port)); 1206 ioc3->gpcr_s = GPCR_UARTA_MODESEL | GPCR_UARTB_MODESEL;
1181 port.irq = 0; 1207 ioc3->gpcr_s;
1182 port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; 1208 ioc3->gppr_6 = 0;
1183 port.iotype = UPIO_MEM; 1209 ioc3->gppr_6;
1184 port.regshift = 0; 1210 ioc3->gppr_7 = 0;
1185 port.uartclk = 22000000 / 3; 1211 ioc3->gppr_7;
1186 1212 ioc3->sscr_a = ioc3->sscr_a & ~SSCR_DMA_EN;
1187 port.membase = (unsigned char *) &ioc3->sregs.uarta; 1213 ioc3->sscr_a;
1188 serial8250_register_port(&port); 1214 ioc3->sscr_b = ioc3->sscr_b & ~SSCR_DMA_EN;
1189 1215 ioc3->sscr_b;
1190 port.membase = (unsigned char *) &ioc3->sregs.uartb; 1216 /* Disable all SA/B interrupts except for SA/B_INT in SIO_IEC. */
1191 serial8250_register_port(&port); 1217 ioc3->sio_iec &= ~ (SIO_IR_SA_TX_MT | SIO_IR_SA_RX_FULL |
1218 SIO_IR_SA_RX_HIGH | SIO_IR_SA_RX_TIMER |
1219 SIO_IR_SA_DELTA_DCD | SIO_IR_SA_DELTA_CTS |
1220 SIO_IR_SA_TX_EXPLICIT | SIO_IR_SA_MEMERR);
1221 ioc3->sio_iec |= SIO_IR_SA_INT;
1222 ioc3->sscr_a = 0;
1223 ioc3->sio_iec &= ~ (SIO_IR_SB_TX_MT | SIO_IR_SB_RX_FULL |
1224 SIO_IR_SB_RX_HIGH | SIO_IR_SB_RX_TIMER |
1225 SIO_IR_SB_DELTA_DCD | SIO_IR_SB_DELTA_CTS |
1226 SIO_IR_SB_TX_EXPLICIT | SIO_IR_SB_MEMERR);
1227 ioc3->sio_iec |= SIO_IR_SB_INT;
1228 ioc3->sscr_b = 0;
1229
1230 ioc3_8250_register(&ioc3->sregs.uarta);
1231 ioc3_8250_register(&ioc3->sregs.uartb);
1192} 1232}
1193#endif 1233#endif
1194 1234
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h
index 3276866b17e..d72f8f8fcb5 100644
--- a/drivers/net/netxen/netxen_nic_hdr.h
+++ b/drivers/net/netxen/netxen_nic_hdr.h
@@ -649,9 +649,11 @@ enum {
649#define PCIX_INT_VECTOR (0x10100) 649#define PCIX_INT_VECTOR (0x10100)
650#define PCIX_INT_MASK (0x10104) 650#define PCIX_INT_MASK (0x10104)
651 651
652#define PCIX_MN_WINDOW (0x10200) 652#define PCIX_MN_WINDOW_F0 (0x10200)
653#define PCIX_MN_WINDOW(_f) (PCIX_MN_WINDOW_F0 + (0x20 * (_f)))
653#define PCIX_MS_WINDOW (0x10204) 654#define PCIX_MS_WINDOW (0x10204)
654#define PCIX_SN_WINDOW (0x10208) 655#define PCIX_SN_WINDOW_F0 (0x10208)
656#define PCIX_SN_WINDOW(_f) (PCIX_SN_WINDOW_F0 + (0x20 * (_f)))
655#define PCIX_CRB_WINDOW (0x10210) 657#define PCIX_CRB_WINDOW (0x10210)
656#define PCIX_CRB_WINDOW_F0 (0x10210) 658#define PCIX_CRB_WINDOW_F0 (0x10210)
657#define PCIX_CRB_WINDOW_F1 (0x10230) 659#define PCIX_CRB_WINDOW_F1 (0x10230)
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index aac15421bd1..a7b8d7f2325 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -904,11 +904,11 @@ netxen_nic_pci_set_window(struct netxen_adapter *adapter,
904 ddr_mn_window = window; 904 ddr_mn_window = window;
905 writel(window, PCI_OFFSET_SECOND_RANGE(adapter, 905 writel(window, PCI_OFFSET_SECOND_RANGE(adapter,
906 NETXEN_PCIX_PH_REG 906 NETXEN_PCIX_PH_REG
907 (PCIX_MN_WINDOW))); 907 (PCIX_MN_WINDOW(adapter->ahw.pci_func))));
908 /* MUST make sure window is set before we forge on... */ 908 /* MUST make sure window is set before we forge on... */
909 readl(PCI_OFFSET_SECOND_RANGE(adapter, 909 readl(PCI_OFFSET_SECOND_RANGE(adapter,
910 NETXEN_PCIX_PH_REG 910 NETXEN_PCIX_PH_REG
911 (PCIX_MN_WINDOW))); 911 (PCIX_MN_WINDOW(adapter->ahw.pci_func))));
912 } 912 }
913 addr -= (window * NETXEN_WINDOW_ONE); 913 addr -= (window * NETXEN_WINDOW_ONE);
914 addr += NETXEN_PCI_DDR_NET; 914 addr += NETXEN_PCI_DDR_NET;
@@ -929,11 +929,11 @@ netxen_nic_pci_set_window(struct netxen_adapter *adapter,
929 writel((window << 22), 929 writel((window << 22),
930 PCI_OFFSET_SECOND_RANGE(adapter, 930 PCI_OFFSET_SECOND_RANGE(adapter,
931 NETXEN_PCIX_PH_REG 931 NETXEN_PCIX_PH_REG
932 (PCIX_SN_WINDOW))); 932 (PCIX_SN_WINDOW(adapter->ahw.pci_func))));
933 /* MUST make sure window is set before we forge on... */ 933 /* MUST make sure window is set before we forge on... */
934 readl(PCI_OFFSET_SECOND_RANGE(adapter, 934 readl(PCI_OFFSET_SECOND_RANGE(adapter,
935 NETXEN_PCIX_PH_REG 935 NETXEN_PCIX_PH_REG
936 (PCIX_SN_WINDOW))); 936 (PCIX_SN_WINDOW(adapter->ahw.pci_func))));
937 } 937 }
938 addr -= (window * 0x400000); 938 addr -= (window * 0x400000);
939 addr += NETXEN_PCI_QDR_NET; 939 addr += NETXEN_PCI_QDR_NET;
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 08a62acde8b..3122d010163 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -639,10 +639,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
639 NETXEN_CRB_NORMALIZE(adapter, 639 NETXEN_CRB_NORMALIZE(adapter,
640 NETXEN_ROMUSB_GLB_PEGTUNE_DONE)); 640 NETXEN_ROMUSB_GLB_PEGTUNE_DONE));
641 /* Handshake with the card before we register the devices. */ 641 /* Handshake with the card before we register the devices. */
642 writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE));
643 netxen_pinit_from_rom(adapter, 0);
644 msleep(1);
645 netxen_load_firmware(adapter);
646 netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); 642 netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
647 } 643 }
648 644
@@ -750,9 +746,6 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
750 746
751 netxen_nic_disable_int(adapter); 747 netxen_nic_disable_int(adapter);
752 748
753 if (adapter->irq)
754 free_irq(adapter->irq, adapter);
755
756 if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) { 749 if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) {
757 init_firmware_done++; 750 init_firmware_done++;
758 netxen_free_hw_resources(adapter); 751 netxen_free_hw_resources(adapter);
@@ -776,13 +769,8 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
776 } 769 }
777 } 770 }
778 771
779 if (adapter->flags & NETXEN_NIC_MSI_ENABLED)
780 pci_disable_msi(pdev);
781
782 vfree(adapter->cmd_buf_arr); 772 vfree(adapter->cmd_buf_arr);
783 773
784 pci_disable_device(pdev);
785
786 if (adapter->portnum == 0) { 774 if (adapter->portnum == 0) {
787 if (init_firmware_done) { 775 if (init_firmware_done) {
788 i = 100; 776 i = 100;
@@ -833,12 +821,19 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
833 } 821 }
834 } 822 }
835 823
824 if (adapter->irq)
825 free_irq(adapter->irq, adapter);
826
827 if (adapter->flags & NETXEN_NIC_MSI_ENABLED)
828 pci_disable_msi(pdev);
829
836 iounmap(adapter->ahw.db_base); 830 iounmap(adapter->ahw.db_base);
837 iounmap(adapter->ahw.pci_base0); 831 iounmap(adapter->ahw.pci_base0);
838 iounmap(adapter->ahw.pci_base1); 832 iounmap(adapter->ahw.pci_base1);
839 iounmap(adapter->ahw.pci_base2); 833 iounmap(adapter->ahw.pci_base2);
840 834
841 pci_release_regions(pdev); 835 pci_release_regions(pdev);
836 pci_disable_device(pdev);
842 pci_set_drvdata(pdev, NULL); 837 pci_set_drvdata(pdev, NULL);
843 838
844 free_netdev(netdev); 839 free_netdev(netdev);
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 13d1c0a2a25..e5650391843 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -556,7 +556,6 @@ static int gelic_net_stop(struct net_device *netdev)
556{ 556{
557 struct gelic_net_card *card = netdev_priv(netdev); 557 struct gelic_net_card *card = netdev_priv(netdev);
558 558
559 netif_poll_disable(netdev);
560 netif_stop_queue(netdev); 559 netif_stop_queue(netdev);
561 560
562 /* turn off DMA, force end */ 561 /* turn off DMA, force end */
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 58740428dd0..9034a05734e 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.80" 67#define DRV_MODULE_VERSION "3.81"
68#define DRV_MODULE_RELDATE "August 2, 2007" 68#define DRV_MODULE_RELDATE "September 5, 2007"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -7127,6 +7127,10 @@ static int tg3_open(struct net_device *dev)
7127 } else if (pci_enable_msi(tp->pdev) == 0) { 7127 } else if (pci_enable_msi(tp->pdev) == 0) {
7128 u32 msi_mode; 7128 u32 msi_mode;
7129 7129
7130 /* Hardware bug - MSI won't work if INTX disabled. */
7131 if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)
7132 pci_intx(tp->pdev, 1);
7133
7130 msi_mode = tr32(MSGINT_MODE); 7134 msi_mode = tr32(MSGINT_MODE);
7131 tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE); 7135 tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE);
7132 tp->tg3_flags2 |= TG3_FLG2_USING_MSI; 7136 tp->tg3_flags2 |= TG3_FLG2_USING_MSI;
@@ -12172,6 +12176,11 @@ static int tg3_resume(struct pci_dev *pdev)
12172 if (err) 12176 if (err)
12173 return err; 12177 return err;
12174 12178
12179 /* Hardware bug - MSI won't work if INTX disabled. */
12180 if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) &&
12181 (tp->tg3_flags2 & TG3_FLG2_USING_MSI))
12182 pci_intx(tp->pdev, 1);
12183
12175 netif_device_attach(dev); 12184 netif_device_attach(dev);
12176 12185
12177 tg3_full_lock(tp, 0); 12186 tg3_full_lock(tp, 0);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 27e00b2d7b5..171ca712e52 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -285,7 +285,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
285 } 285 }
286} 286}
287 287
288void __devinit pci_read_bridge_bases(struct pci_bus *child) 288void pci_read_bridge_bases(struct pci_bus *child)
289{ 289{
290 struct pci_dev *dev = child->self; 290 struct pci_dev *dev = child->self;
291 u8 io_base_lo, io_limit_lo; 291 u8 io_base_lo, io_limit_lo;
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 2d40f437b9f..7dcaa09b3c2 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -972,8 +972,8 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_ho
972 * 972 *
973 * The SMBus PCI Device can be activated by setting a bit in the ICH LPC 973 * The SMBus PCI Device can be activated by setting a bit in the ICH LPC
974 * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it 974 * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it
975 * becomes necessary to do this tweak in two steps -- I've chosen the Host 975 * becomes necessary to do this tweak in two steps -- the chosen trigger
976 * bridge as trigger. 976 * is either the Host bridge (preferred) or on-board VGA controller.
977 * 977 *
978 * Note that we used to unhide the SMBus that way on Toshiba laptops 978 * Note that we used to unhide the SMBus that way on Toshiba laptops
979 * (Satellite A40 and Tecra M2) but then found that the thermal management 979 * (Satellite A40 and Tecra M2) but then found that the thermal management
@@ -1070,6 +1070,14 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
1070 case 0x0058: /* Compaq Evo N620c */ 1070 case 0x0058: /* Compaq Evo N620c */
1071 asus_hides_smbus = 1; 1071 asus_hides_smbus = 1;
1072 } 1072 }
1073 else if (dev->device == PCI_DEVICE_ID_INTEL_82810_IG3)
1074 switch(dev->subsystem_device) {
1075 case 0xB16C: /* Compaq Deskpro EP 401963-001 (PCA# 010174) */
1076 /* Motherboard doesn't have Host bridge
1077 * subvendor/subdevice IDs, therefore checking
1078 * its on-board VGA controller */
1079 asus_hides_smbus = 1;
1080 }
1073 } 1081 }
1074} 1082}
1075DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845_HB, asus_hides_smbus_hostbridge ); 1083DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82845_HB, asus_hides_smbus_hostbridge );
@@ -1082,6 +1090,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855PM_HB, as
1082DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge ); 1090DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82855GM_HB, asus_hides_smbus_hostbridge );
1083DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge ); 1091DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82915GM_HB, asus_hides_smbus_hostbridge );
1084 1092
1093DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82810_IG3, asus_hides_smbus_hostbridge );
1094
1085static void asus_hides_smbus_lpc(struct pci_dev *dev) 1095static void asus_hides_smbus_lpc(struct pci_dev *dev)
1086{ 1096{
1087 u16 val; 1097 u16 val;
@@ -1099,12 +1109,14 @@ static void asus_hides_smbus_lpc(struct pci_dev *dev)
1099 printk(KERN_INFO "PCI: Enabled i801 SMBus device\n"); 1109 printk(KERN_INFO "PCI: Enabled i801 SMBus device\n");
1100 } 1110 }
1101} 1111}
1112DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, asus_hides_smbus_lpc );
1102DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc ); 1113DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc );
1103DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc ); 1114DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc );
1104DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc ); 1115DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc );
1105DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc ); 1116DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, asus_hides_smbus_lpc );
1106DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc ); 1117DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, asus_hides_smbus_lpc );
1107DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc ); 1118DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, asus_hides_smbus_lpc );
1119DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, asus_hides_smbus_lpc );
1108DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc ); 1120DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, asus_hides_smbus_lpc );
1109DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc ); 1121DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, asus_hides_smbus_lpc );
1110DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc ); 1122DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, asus_hides_smbus_lpc );
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 90755d4cdb9..6b0cf0c2a08 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -107,108 +107,6 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
107 "pnp: SB audio device quirk - increasing port range\n"); 107 "pnp: SB audio device quirk - increasing port range\n");
108} 108}
109 109
110static int quirk_smc_fir_enabled(struct pnp_dev *dev)
111{
112 unsigned long firbase;
113 u8 bank, high, low, chip;
114
115 if (!pnp_port_valid(dev, 1))
116 return 0;
117
118 firbase = pnp_port_start(dev, 1);
119
120 /* Select register bank 3 */
121 bank = inb(firbase + 7);
122 bank &= 0xf0;
123 bank |= 3;
124 outb(bank, firbase + 7);
125
126 high = inb(firbase + 0);
127 low = inb(firbase + 1);
128 chip = inb(firbase + 2);
129
130 /* This corresponds to the check in smsc_ircc_present() */
131 if (high == 0x10 && low == 0xb8 && (chip == 0xf1 || chip == 0xf2))
132 return 1;
133
134 return 0;
135}
136
137static void quirk_smc_enable(struct pnp_dev *dev)
138{
139 struct resource fir, sir, irq;
140
141 pnp_activate_dev(dev);
142 if (quirk_smc_fir_enabled(dev))
143 return;
144
145 /*
146 * Sometimes the BIOS claims the device is enabled, but it reports
147 * the wrong FIR resources or doesn't properly configure ISA or LPC
148 * bridges on the way to the device.
149 *
150 * HP nc6000 and nc8000/nw8000 laptops have known problems like
151 * this. Fortunately, they do fix things up if we auto-configure
152 * the device using its _PRS and _SRS methods.
153 */
154 dev_err(&dev->dev, "%s not responding at SIR 0x%lx, FIR 0x%lx; "
155 "auto-configuring\n", dev->id->id,
156 (unsigned long)pnp_port_start(dev, 0),
157 (unsigned long)pnp_port_start(dev, 1));
158
159 pnp_disable_dev(dev);
160 pnp_init_resource_table(&dev->res);
161 pnp_auto_config_dev(dev);
162 pnp_activate_dev(dev);
163 if (quirk_smc_fir_enabled(dev)) {
164 dev_err(&dev->dev, "responds at SIR 0x%lx, FIR 0x%lx\n",
165 (unsigned long)pnp_port_start(dev, 0),
166 (unsigned long)pnp_port_start(dev, 1));
167 return;
168 }
169
170 /*
171 * The Toshiba Portege 4000 _CRS reports the FIR region first,
172 * followed by the SIR region. The BIOS will configure the bridge,
173 * but only if we call _SRS with SIR first, then FIR. It also
174 * reports the IRQ as active high, when it is really active low.
175 */
176 dev_err(&dev->dev, "not responding at SIR 0x%lx, FIR 0x%lx; "
177 "swapping SIR/FIR and reconfiguring\n",
178 (unsigned long)pnp_port_start(dev, 0),
179 (unsigned long)pnp_port_start(dev, 1));
180
181 /*
182 * Clear IORESOURCE_AUTO so pnp_activate_dev() doesn't reassign
183 * these resources any more.
184 */
185 fir = dev->res.port_resource[0];
186 sir = dev->res.port_resource[1];
187 fir.flags &= ~IORESOURCE_AUTO;
188 sir.flags &= ~IORESOURCE_AUTO;
189
190 irq = dev->res.irq_resource[0];
191 irq.flags &= ~IORESOURCE_AUTO;
192 irq.flags &= ~IORESOURCE_BITS;
193 irq.flags |= IORESOURCE_IRQ_LOWEDGE;
194
195 pnp_disable_dev(dev);
196 dev->res.port_resource[0] = sir;
197 dev->res.port_resource[1] = fir;
198 dev->res.irq_resource[0] = irq;
199 pnp_activate_dev(dev);
200
201 if (quirk_smc_fir_enabled(dev)) {
202 dev_err(&dev->dev, "responds at SIR 0x%lx, FIR 0x%lx\n",
203 (unsigned long)pnp_port_start(dev, 0),
204 (unsigned long)pnp_port_start(dev, 1));
205 return;
206 }
207
208 dev_err(&dev->dev, "giving up; try \"smsc-ircc2.nopnp\" and "
209 "email bjorn.helgaas@hp.com\n");
210}
211
212/* 110/*
213 * PnP Quirks 111 * PnP Quirks
214 * Cards or devices that need some tweaking due to incomplete resource info 112 * Cards or devices that need some tweaking due to incomplete resource info
@@ -229,7 +127,6 @@ static struct pnp_fixup pnp_fixups[] = {
229 {"CTL0043", quirk_sb16audio_resources}, 127 {"CTL0043", quirk_sb16audio_resources},
230 {"CTL0044", quirk_sb16audio_resources}, 128 {"CTL0044", quirk_sb16audio_resources},
231 {"CTL0045", quirk_sb16audio_resources}, 129 {"CTL0045", quirk_sb16audio_resources},
232 {"SMCf010", quirk_smc_enable},
233 {""} 130 {""}
234}; 131};
235 132
diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
index 3b58d3d5d38..a6b572978dc 100644
--- a/drivers/rtc/rtc-v3020.c
+++ b/drivers/rtc/rtc-v3020.c
@@ -26,6 +26,7 @@
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/bcd.h> 27#include <linux/bcd.h>
28#include <linux/rtc-v3020.h> 28#include <linux/rtc-v3020.h>
29#include <linux/delay.h>
29 30
30#include <asm/io.h> 31#include <asm/io.h>
31 32
@@ -47,6 +48,7 @@ static void v3020_set_reg(struct v3020 *chip, unsigned char address,
47 for (i = 0; i < 4; i++) { 48 for (i = 0; i < 4; i++) {
48 writel((tmp & 1) << chip->leftshift, chip->ioaddress); 49 writel((tmp & 1) << chip->leftshift, chip->ioaddress);
49 tmp >>= 1; 50 tmp >>= 1;
51 udelay(1);
50 } 52 }
51 53
52 /* Commands dont have data */ 54 /* Commands dont have data */
@@ -54,6 +56,7 @@ static void v3020_set_reg(struct v3020 *chip, unsigned char address,
54 for (i = 0; i < 8; i++) { 56 for (i = 0; i < 8; i++) {
55 writel((data & 1) << chip->leftshift, chip->ioaddress); 57 writel((data & 1) << chip->leftshift, chip->ioaddress);
56 data >>= 1; 58 data >>= 1;
59 udelay(1);
57 } 60 }
58 } 61 }
59} 62}
@@ -66,12 +69,14 @@ static unsigned char v3020_get_reg(struct v3020 *chip, unsigned char address)
66 for (i = 0; i < 4; i++) { 69 for (i = 0; i < 4; i++) {
67 writel((address & 1) << chip->leftshift, chip->ioaddress); 70 writel((address & 1) << chip->leftshift, chip->ioaddress);
68 address >>= 1; 71 address >>= 1;
72 udelay(1);
69 } 73 }
70 74
71 for (i = 0; i < 8; i++) { 75 for (i = 0; i < 8; i++) {
72 data >>= 1; 76 data >>= 1;
73 if (readl(chip->ioaddress) & (1 << chip->leftshift)) 77 if (readl(chip->ioaddress) & (1 << chip->leftshift))
74 data |= 0x80; 78 data |= 0x80;
79 udelay(1);
75 } 80 }
76 81
77 return data; 82 return data;
@@ -95,7 +100,7 @@ static int v3020_read_time(struct device *dev, struct rtc_time *dt)
95 tmp = v3020_get_reg(chip, V3020_MONTH_DAY); 100 tmp = v3020_get_reg(chip, V3020_MONTH_DAY);
96 dt->tm_mday = BCD2BIN(tmp); 101 dt->tm_mday = BCD2BIN(tmp);
97 tmp = v3020_get_reg(chip, V3020_MONTH); 102 tmp = v3020_get_reg(chip, V3020_MONTH);
98 dt->tm_mon = BCD2BIN(tmp); 103 dt->tm_mon = BCD2BIN(tmp) - 1;
99 tmp = v3020_get_reg(chip, V3020_WEEK_DAY); 104 tmp = v3020_get_reg(chip, V3020_WEEK_DAY);
100 dt->tm_wday = BCD2BIN(tmp); 105 dt->tm_wday = BCD2BIN(tmp);
101 tmp = v3020_get_reg(chip, V3020_YEAR); 106 tmp = v3020_get_reg(chip, V3020_YEAR);
@@ -135,7 +140,7 @@ static int v3020_set_time(struct device *dev, struct rtc_time *dt)
135 v3020_set_reg(chip, V3020_MINUTES, BIN2BCD(dt->tm_min)); 140 v3020_set_reg(chip, V3020_MINUTES, BIN2BCD(dt->tm_min));
136 v3020_set_reg(chip, V3020_HOURS, BIN2BCD(dt->tm_hour)); 141 v3020_set_reg(chip, V3020_HOURS, BIN2BCD(dt->tm_hour));
137 v3020_set_reg(chip, V3020_MONTH_DAY, BIN2BCD(dt->tm_mday)); 142 v3020_set_reg(chip, V3020_MONTH_DAY, BIN2BCD(dt->tm_mday));
138 v3020_set_reg(chip, V3020_MONTH, BIN2BCD(dt->tm_mon)); 143 v3020_set_reg(chip, V3020_MONTH, BIN2BCD(dt->tm_mon + 1));
139 v3020_set_reg(chip, V3020_WEEK_DAY, BIN2BCD(dt->tm_wday)); 144 v3020_set_reg(chip, V3020_WEEK_DAY, BIN2BCD(dt->tm_wday));
140 v3020_set_reg(chip, V3020_YEAR, BIN2BCD(dt->tm_year % 100)); 145 v3020_set_reg(chip, V3020_YEAR, BIN2BCD(dt->tm_year % 100));
141 146
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index ec18bae05df..6d4959807ab 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -1178,9 +1178,9 @@ qeth_ipaddr_to_string(enum qeth_prot_versions proto, const __u8 *addr,
1178 char *buf) 1178 char *buf)
1179{ 1179{
1180 if (proto == QETH_PROT_IPV4) 1180 if (proto == QETH_PROT_IPV4)
1181 return qeth_ipaddr4_to_string(addr, buf); 1181 qeth_ipaddr4_to_string(addr, buf);
1182 else if (proto == QETH_PROT_IPV6) 1182 else if (proto == QETH_PROT_IPV6)
1183 return qeth_ipaddr6_to_string(addr, buf); 1183 qeth_ipaddr6_to_string(addr, buf);
1184} 1184}
1185 1185
1186static inline int 1186static inline int
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 57f69434fbf..f3e6fbeb212 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -561,7 +561,7 @@ qeth_set_offline(struct ccwgroup_device *cgdev)
561} 561}
562 562
563static int 563static int
564qeth_wait_for_threads(struct qeth_card *card, unsigned long threads); 564qeth_threads_running(struct qeth_card *card, unsigned long threads);
565 565
566 566
567static void 567static void
@@ -576,8 +576,7 @@ qeth_remove_device(struct ccwgroup_device *cgdev)
576 if (!card) 576 if (!card)
577 return; 577 return;
578 578
579 if (qeth_wait_for_threads(card, 0xffffffff)) 579 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
580 return;
581 580
582 if (cgdev->state == CCWGROUP_ONLINE){ 581 if (cgdev->state == CCWGROUP_ONLINE){
583 card->use_hard_stop = 1; 582 card->use_hard_stop = 1;
@@ -1542,16 +1541,21 @@ qeth_idx_write_cb(struct qeth_channel *channel, struct qeth_cmd_buffer *iob)
1542 card = CARD_FROM_CDEV(channel->ccwdev); 1541 card = CARD_FROM_CDEV(channel->ccwdev);
1543 1542
1544 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) { 1543 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) {
1545 PRINT_ERR("IDX_ACTIVATE on write channel device %s: negative " 1544 if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == 0x19)
1546 "reply\n", CARD_WDEV_ID(card)); 1545 PRINT_ERR("IDX_ACTIVATE on write channel device %s: "
1546 "adapter exclusively used by another host\n",
1547 CARD_WDEV_ID(card));
1548 else
1549 PRINT_ERR("IDX_ACTIVATE on write channel device %s: "
1550 "negative reply\n", CARD_WDEV_ID(card));
1547 goto out; 1551 goto out;
1548 } 1552 }
1549 memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2); 1553 memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2);
1550 if ((temp & ~0x0100) != qeth_peer_func_level(card->info.func_level)) { 1554 if ((temp & ~0x0100) != qeth_peer_func_level(card->info.func_level)) {
1551 PRINT_WARN("IDX_ACTIVATE on write channel device %s: " 1555 PRINT_WARN("IDX_ACTIVATE on write channel device %s: "
1552 "function level mismatch " 1556 "function level mismatch "
1553 "(sent: 0x%x, received: 0x%x)\n", 1557 "(sent: 0x%x, received: 0x%x)\n",
1554 CARD_WDEV_ID(card), card->info.func_level, temp); 1558 CARD_WDEV_ID(card), card->info.func_level, temp);
1555 goto out; 1559 goto out;
1556 } 1560 }
1557 channel->state = CH_STATE_UP; 1561 channel->state = CH_STATE_UP;
@@ -1597,8 +1601,13 @@ qeth_idx_read_cb(struct qeth_channel *channel, struct qeth_cmd_buffer *iob)
1597 goto out; 1601 goto out;
1598 } 1602 }
1599 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) { 1603 if (!(QETH_IS_IDX_ACT_POS_REPLY(iob->data))) {
1600 PRINT_ERR("IDX_ACTIVATE on read channel device %s: negative " 1604 if (QETH_IDX_ACT_CAUSE_CODE(iob->data) == 0x19)
1601 "reply\n", CARD_RDEV_ID(card)); 1605 PRINT_ERR("IDX_ACTIVATE on read channel device %s: "
1606 "adapter exclusively used by another host\n",
1607 CARD_RDEV_ID(card));
1608 else
1609 PRINT_ERR("IDX_ACTIVATE on read channel device %s: "
1610 "negative reply\n", CARD_RDEV_ID(card));
1602 goto out; 1611 goto out;
1603 } 1612 }
1604 1613
@@ -1613,8 +1622,8 @@ qeth_idx_read_cb(struct qeth_channel *channel, struct qeth_cmd_buffer *iob)
1613 memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2); 1622 memcpy(&temp, QETH_IDX_ACT_FUNC_LEVEL(iob->data), 2);
1614 if (temp != qeth_peer_func_level(card->info.func_level)) { 1623 if (temp != qeth_peer_func_level(card->info.func_level)) {
1615 PRINT_WARN("IDX_ACTIVATE on read channel device %s: function " 1624 PRINT_WARN("IDX_ACTIVATE on read channel device %s: function "
1616 "level mismatch (sent: 0x%x, received: 0x%x)\n", 1625 "level mismatch (sent: 0x%x, received: 0x%x)\n",
1617 CARD_RDEV_ID(card), card->info.func_level, temp); 1626 CARD_RDEV_ID(card), card->info.func_level, temp);
1618 goto out; 1627 goto out;
1619 } 1628 }
1620 memcpy(&card->token.issuer_rm_r, 1629 memcpy(&card->token.issuer_rm_r,
@@ -2496,7 +2505,7 @@ qeth_rebuild_skb_fake_ll_tr(struct qeth_card *card, struct sk_buff *skb,
2496 struct iphdr *ip_hdr; 2505 struct iphdr *ip_hdr;
2497 2506
2498 QETH_DBF_TEXT(trace,5,"skbfktr"); 2507 QETH_DBF_TEXT(trace,5,"skbfktr");
2499 skb_set_mac_header(skb, -QETH_FAKE_LL_LEN_TR); 2508 skb_set_mac_header(skb, (int)-QETH_FAKE_LL_LEN_TR);
2500 /* this is a fake ethernet header */ 2509 /* this is a fake ethernet header */
2501 fake_hdr = tr_hdr(skb); 2510 fake_hdr = tr_hdr(skb);
2502 2511
@@ -2804,13 +2813,16 @@ qeth_queue_input_buffer(struct qeth_card *card, int index)
2804 if (newcount < count) { 2813 if (newcount < count) {
2805 /* we are in memory shortage so we switch back to 2814 /* we are in memory shortage so we switch back to
2806 traditional skb allocation and drop packages */ 2815 traditional skb allocation and drop packages */
2807 if (atomic_cmpxchg(&card->force_alloc_skb, 0, 1)) 2816 if (!atomic_read(&card->force_alloc_skb) &&
2808 printk(KERN_WARNING 2817 net_ratelimit())
2809 "qeth: switch to alloc skb\n"); 2818 PRINT_WARN("Switch to alloc skb\n");
2819 atomic_set(&card->force_alloc_skb, 3);
2810 count = newcount; 2820 count = newcount;
2811 } else { 2821 } else {
2812 if (atomic_cmpxchg(&card->force_alloc_skb, 1, 0)) 2822 if ((atomic_read(&card->force_alloc_skb) == 1) &&
2813 printk(KERN_WARNING "qeth: switch to sg\n"); 2823 net_ratelimit())
2824 PRINT_WARN("Switch to sg\n");
2825 atomic_add_unless(&card->force_alloc_skb, -1, 0);
2814 } 2826 }
2815 2827
2816 /* 2828 /*
@@ -3354,10 +3366,12 @@ out_freeoutq:
3354 while (i > 0) 3366 while (i > 0)
3355 kfree(card->qdio.out_qs[--i]); 3367 kfree(card->qdio.out_qs[--i]);
3356 kfree(card->qdio.out_qs); 3368 kfree(card->qdio.out_qs);
3369 card->qdio.out_qs = NULL;
3357out_freepool: 3370out_freepool:
3358 qeth_free_buffer_pool(card); 3371 qeth_free_buffer_pool(card);
3359out_freeinq: 3372out_freeinq:
3360 kfree(card->qdio.in_q); 3373 kfree(card->qdio.in_q);
3374 card->qdio.in_q = NULL;
3361out_nomem: 3375out_nomem:
3362 atomic_set(&card->qdio.state, QETH_QDIO_UNINITIALIZED); 3376 atomic_set(&card->qdio.state, QETH_QDIO_UNINITIALIZED);
3363 return -ENOMEM; 3377 return -ENOMEM;
@@ -3373,16 +3387,20 @@ qeth_free_qdio_buffers(struct qeth_card *card)
3373 QETH_QDIO_UNINITIALIZED) 3387 QETH_QDIO_UNINITIALIZED)
3374 return; 3388 return;
3375 kfree(card->qdio.in_q); 3389 kfree(card->qdio.in_q);
3390 card->qdio.in_q = NULL;
3376 /* inbound buffer pool */ 3391 /* inbound buffer pool */
3377 qeth_free_buffer_pool(card); 3392 qeth_free_buffer_pool(card);
3378 /* free outbound qdio_qs */ 3393 /* free outbound qdio_qs */
3379 for (i = 0; i < card->qdio.no_out_queues; ++i){ 3394 if (card->qdio.out_qs) {
3380 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) 3395 for (i = 0; i < card->qdio.no_out_queues; ++i) {
3381 qeth_clear_output_buffer(card->qdio.out_qs[i], 3396 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j)
3382 &card->qdio.out_qs[i]->bufs[j]); 3397 qeth_clear_output_buffer(card->qdio.out_qs[i],
3383 kfree(card->qdio.out_qs[i]); 3398 &card->qdio.out_qs[i]->bufs[j]);
3399 kfree(card->qdio.out_qs[i]);
3400 }
3401 kfree(card->qdio.out_qs);
3402 card->qdio.out_qs = NULL;
3384 } 3403 }
3385 kfree(card->qdio.out_qs);
3386} 3404}
3387 3405
3388static void 3406static void
@@ -3393,7 +3411,7 @@ qeth_clear_qdio_buffers(struct qeth_card *card)
3393 QETH_DBF_TEXT(trace, 2, "clearqdbf"); 3411 QETH_DBF_TEXT(trace, 2, "clearqdbf");
3394 /* clear outbound buffers to free skbs */ 3412 /* clear outbound buffers to free skbs */
3395 for (i = 0; i < card->qdio.no_out_queues; ++i) 3413 for (i = 0; i < card->qdio.no_out_queues; ++i)
3396 if (card->qdio.out_qs[i]){ 3414 if (card->qdio.out_qs && card->qdio.out_qs[i]) {
3397 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) 3415 for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j)
3398 qeth_clear_output_buffer(card->qdio.out_qs[i], 3416 qeth_clear_output_buffer(card->qdio.out_qs[i],
3399 &card->qdio.out_qs[i]->bufs[j]); 3417 &card->qdio.out_qs[i]->bufs[j]);
@@ -4553,6 +4571,53 @@ qeth_get_elements_no(struct qeth_card *card, void *hdr,
4553 return elements_needed; 4571 return elements_needed;
4554} 4572}
4555 4573
4574static void qeth_tx_csum(struct sk_buff *skb)
4575{
4576 int tlen;
4577
4578 if (skb->protocol == htons(ETH_P_IP)) {
4579 tlen = ntohs(ip_hdr(skb)->tot_len) - (ip_hdr(skb)->ihl << 2);
4580 switch (ip_hdr(skb)->protocol) {
4581 case IPPROTO_TCP:
4582 tcp_hdr(skb)->check = 0;
4583 tcp_hdr(skb)->check = csum_tcpudp_magic(
4584 ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
4585 tlen, ip_hdr(skb)->protocol,
4586 skb_checksum(skb, skb_transport_offset(skb),
4587 tlen, 0));
4588 break;
4589 case IPPROTO_UDP:
4590 udp_hdr(skb)->check = 0;
4591 udp_hdr(skb)->check = csum_tcpudp_magic(
4592 ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
4593 tlen, ip_hdr(skb)->protocol,
4594 skb_checksum(skb, skb_transport_offset(skb),
4595 tlen, 0));
4596 break;
4597 }
4598 } else if (skb->protocol == htons(ETH_P_IPV6)) {
4599 switch (ipv6_hdr(skb)->nexthdr) {
4600 case IPPROTO_TCP:
4601 tcp_hdr(skb)->check = 0;
4602 tcp_hdr(skb)->check = csum_ipv6_magic(
4603 &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr,
4604 ipv6_hdr(skb)->payload_len,
4605 ipv6_hdr(skb)->nexthdr,
4606 skb_checksum(skb, skb_transport_offset(skb),
4607 ipv6_hdr(skb)->payload_len, 0));
4608 break;
4609 case IPPROTO_UDP:
4610 udp_hdr(skb)->check = 0;
4611 udp_hdr(skb)->check = csum_ipv6_magic(
4612 &ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr,
4613 ipv6_hdr(skb)->payload_len,
4614 ipv6_hdr(skb)->nexthdr,
4615 skb_checksum(skb, skb_transport_offset(skb),
4616 ipv6_hdr(skb)->payload_len, 0));
4617 break;
4618 }
4619 }
4620}
4556 4621
4557static int 4622static int
4558qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) 4623qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
@@ -4638,12 +4703,22 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4638 elements_needed += elems; 4703 elements_needed += elems;
4639 } 4704 }
4640 4705
4706 if ((large_send == QETH_LARGE_SEND_NO) &&
4707 (skb->ip_summed == CHECKSUM_PARTIAL))
4708 qeth_tx_csum(new_skb);
4709
4641 if (card->info.type != QETH_CARD_TYPE_IQD) 4710 if (card->info.type != QETH_CARD_TYPE_IQD)
4642 rc = qeth_do_send_packet(card, queue, new_skb, hdr, 4711 rc = qeth_do_send_packet(card, queue, new_skb, hdr,
4643 elements_needed, ctx); 4712 elements_needed, ctx);
4644 else 4713 else {
4714 if ((skb->protocol == htons(ETH_P_ARP)) &&
4715 (card->dev->flags & IFF_NOARP)) {
4716 __qeth_free_new_skb(skb, new_skb);
4717 return -EPERM;
4718 }
4645 rc = qeth_do_send_packet_fast(card, queue, new_skb, hdr, 4719 rc = qeth_do_send_packet_fast(card, queue, new_skb, hdr,
4646 elements_needed, ctx); 4720 elements_needed, ctx);
4721 }
4647 if (!rc) { 4722 if (!rc) {
4648 card->stats.tx_packets++; 4723 card->stats.tx_packets++;
4649 card->stats.tx_bytes += tx_bytes; 4724 card->stats.tx_bytes += tx_bytes;
@@ -6385,20 +6460,18 @@ qeth_deregister_addr_entry(struct qeth_card *card, struct qeth_ipaddr *addr)
6385static u32 6460static u32
6386qeth_ethtool_get_tx_csum(struct net_device *dev) 6461qeth_ethtool_get_tx_csum(struct net_device *dev)
6387{ 6462{
6388 /* We may need to say that we support tx csum offload if 6463 return (dev->features & NETIF_F_HW_CSUM) != 0;
6389 * we do EDDP or TSO. There are discussions going on to
6390 * enforce rules in the stack and in ethtool that make
6391 * SG and TSO depend on HW_CSUM. At the moment there are
6392 * no such rules....
6393 * If we say yes here, we have to checksum outbound packets
6394 * any time. */
6395 return 0;
6396} 6464}
6397 6465
6398static int 6466static int
6399qeth_ethtool_set_tx_csum(struct net_device *dev, u32 data) 6467qeth_ethtool_set_tx_csum(struct net_device *dev, u32 data)
6400{ 6468{
6401 return -EINVAL; 6469 if (data)
6470 dev->features |= NETIF_F_HW_CSUM;
6471 else
6472 dev->features &= ~NETIF_F_HW_CSUM;
6473
6474 return 0;
6402} 6475}
6403 6476
6404static u32 6477static u32
@@ -7412,7 +7485,8 @@ qeth_start_ipa_tso(struct qeth_card *card)
7412 } 7485 }
7413 if (rc && (card->options.large_send == QETH_LARGE_SEND_TSO)){ 7486 if (rc && (card->options.large_send == QETH_LARGE_SEND_TSO)){
7414 card->options.large_send = QETH_LARGE_SEND_NO; 7487 card->options.large_send = QETH_LARGE_SEND_NO;
7415 card->dev->features &= ~ (NETIF_F_TSO | NETIF_F_SG); 7488 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG |
7489 NETIF_F_HW_CSUM);
7416 } 7490 }
7417 return rc; 7491 return rc;
7418} 7492}
@@ -7552,22 +7626,26 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type)
7552 card->options.large_send = type; 7626 card->options.large_send = type;
7553 switch (card->options.large_send) { 7627 switch (card->options.large_send) {
7554 case QETH_LARGE_SEND_EDDP: 7628 case QETH_LARGE_SEND_EDDP:
7555 card->dev->features |= NETIF_F_TSO | NETIF_F_SG; 7629 card->dev->features |= NETIF_F_TSO | NETIF_F_SG |
7630 NETIF_F_HW_CSUM;
7556 break; 7631 break;
7557 case QETH_LARGE_SEND_TSO: 7632 case QETH_LARGE_SEND_TSO:
7558 if (qeth_is_supported(card, IPA_OUTBOUND_TSO)){ 7633 if (qeth_is_supported(card, IPA_OUTBOUND_TSO)){
7559 card->dev->features |= NETIF_F_TSO | NETIF_F_SG; 7634 card->dev->features |= NETIF_F_TSO | NETIF_F_SG |
7635 NETIF_F_HW_CSUM;
7560 } else { 7636 } else {
7561 PRINT_WARN("TSO not supported on %s. " 7637 PRINT_WARN("TSO not supported on %s. "
7562 "large_send set to 'no'.\n", 7638 "large_send set to 'no'.\n",
7563 card->dev->name); 7639 card->dev->name);
7564 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); 7640 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG |
7641 NETIF_F_HW_CSUM);
7565 card->options.large_send = QETH_LARGE_SEND_NO; 7642 card->options.large_send = QETH_LARGE_SEND_NO;
7566 rc = -EOPNOTSUPP; 7643 rc = -EOPNOTSUPP;
7567 } 7644 }
7568 break; 7645 break;
7569 default: /* includes QETH_LARGE_SEND_NO */ 7646 default: /* includes QETH_LARGE_SEND_NO */
7570 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); 7647 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG |
7648 NETIF_F_HW_CSUM);
7571 break; 7649 break;
7572 } 7650 }
7573 if (card->state == CARD_STATE_UP) 7651 if (card->state == CARD_STATE_UP)
diff --git a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h
index 1d8083c9176..6de2da5ed5f 100644
--- a/drivers/s390/net/qeth_mpc.h
+++ b/drivers/s390/net/qeth_mpc.h
@@ -565,6 +565,7 @@ extern unsigned char IDX_ACTIVATE_WRITE[];
565#define QETH_IDX_ACT_QDIO_DEV_REALADDR(buffer) (buffer+0x20) 565#define QETH_IDX_ACT_QDIO_DEV_REALADDR(buffer) (buffer+0x20)
566#define QETH_IS_IDX_ACT_POS_REPLY(buffer) (((buffer)[0x08]&3)==2) 566#define QETH_IS_IDX_ACT_POS_REPLY(buffer) (((buffer)[0x08]&3)==2)
567#define QETH_IDX_REPLY_LEVEL(buffer) (buffer+0x12) 567#define QETH_IDX_REPLY_LEVEL(buffer) (buffer+0x12)
568#define QETH_IDX_ACT_CAUSE_CODE(buffer) (buffer)[0x09]
568 569
569#define PDU_ENCAPSULATION(buffer) \ 570#define PDU_ENCAPSULATION(buffer) \
570 (buffer + *(buffer + (*(buffer+0x0b)) + \ 571 (buffer + *(buffer + (*(buffer+0x0b)) + \
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index bb0287ad1aa..2cc3f3a0e39 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -1760,10 +1760,10 @@ qeth_remove_device_attributes(struct device *dev)
1760{ 1760{
1761 struct qeth_card *card = dev->driver_data; 1761 struct qeth_card *card = dev->driver_data;
1762 1762
1763 if (card->info.type == QETH_CARD_TYPE_OSN) 1763 if (card->info.type == QETH_CARD_TYPE_OSN) {
1764 return sysfs_remove_group(&dev->kobj, 1764 sysfs_remove_group(&dev->kobj, &qeth_osn_device_attr_group);
1765 &qeth_osn_device_attr_group); 1765 return;
1766 1766 }
1767 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group); 1767 sysfs_remove_group(&dev->kobj, &qeth_device_attr_group);
1768 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group); 1768 sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group);
1769 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group); 1769 sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group);
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index ab5ec1feaf4..90aa53fc4f3 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -1503,7 +1503,7 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool)
1503 data->ct.pool = pool; 1503 data->ct.pool = pool;
1504 } 1504 }
1505 } else { 1505 } else {
1506 data = kmalloc(sizeof(struct zfcp_gid_pn_data), GFP_ATOMIC); 1506 data = kmem_cache_alloc(zfcp_data.gid_pn_cache, GFP_ATOMIC);
1507 } 1507 }
1508 1508
1509 if (NULL == data) 1509 if (NULL == data)
@@ -1531,7 +1531,7 @@ static void zfcp_gid_pn_buffers_free(struct zfcp_gid_pn_data *gid_pn)
1531 if (gid_pn->ct.pool) 1531 if (gid_pn->ct.pool)
1532 mempool_free(gid_pn, gid_pn->ct.pool); 1532 mempool_free(gid_pn, gid_pn->ct.pool);
1533 else 1533 else
1534 kfree(gid_pn); 1534 kmem_cache_free(zfcp_data.gid_pn_cache, gid_pn);
1535} 1535}
1536 1536
1537/** 1537/**
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index 81daa8204bf..c6899efdc8f 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -640,13 +640,9 @@ int
640zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req, 640zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req,
641 unsigned long sbtype, struct scsi_cmnd *scsi_cmnd) 641 unsigned long sbtype, struct scsi_cmnd *scsi_cmnd)
642{ 642{
643 if (scsi_sg_count(scsi_cmnd)) 643 return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, scsi_sglist(scsi_cmnd),
644 return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, 644 scsi_sg_count(scsi_cmnd),
645 scsi_sglist(scsi_cmnd), 645 ZFCP_MAX_SBALS_PER_REQ);
646 scsi_sg_count(scsi_cmnd),
647 ZFCP_MAX_SBALS_PER_REQ);
648 else
649 return 0;
650} 646}
651 647
652/** 648/**
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 0acf6db0a08..ad7eb4a9261 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -764,7 +764,9 @@ zfcp_reset_fc_host_stats(struct Scsi_Host *shost)
764 return; 764 return;
765 765
766 ret = zfcp_fsf_exchange_port_data(NULL, adapter, data); 766 ret = zfcp_fsf_exchange_port_data(NULL, adapter, data);
767 if (ret == 0) { 767 if (ret) {
768 kfree(data);
769 } else {
768 adapter->stats_reset = jiffies/HZ; 770 adapter->stats_reset = jiffies/HZ;
769 old_data = adapter->stats_reset_data; 771 old_data = adapter->stats_reset_data;
770 adapter->stats_reset_data = data; /* finally freed in 772 adapter->stats_reset_data = data; /* finally freed in
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 5606d1e6297..efceed451b4 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -737,12 +737,19 @@ check_mgmt:
737 */ 737 */
738 conn->ctask = list_entry(conn->xmitqueue.next, 738 conn->ctask = list_entry(conn->xmitqueue.next,
739 struct iscsi_cmd_task, running); 739 struct iscsi_cmd_task, running);
740 if (conn->ctask->state == ISCSI_TASK_PENDING) { 740 switch (conn->ctask->state) {
741 case ISCSI_TASK_ABORTING:
742 break;
743 case ISCSI_TASK_PENDING:
741 iscsi_prep_scsi_cmd_pdu(conn->ctask); 744 iscsi_prep_scsi_cmd_pdu(conn->ctask);
742 conn->session->tt->init_cmd_task(conn->ctask); 745 conn->session->tt->init_cmd_task(conn->ctask);
746 /* fall through */
747 default:
748 conn->ctask->state = ISCSI_TASK_RUNNING;
749 break;
743 } 750 }
744 conn->ctask->state = ISCSI_TASK_RUNNING;
745 list_move_tail(conn->xmitqueue.next, &conn->run_list); 751 list_move_tail(conn->xmitqueue.next, &conn->run_list);
752
746 rc = iscsi_xmit_ctask(conn); 753 rc = iscsi_xmit_ctask(conn);
747 if (rc) 754 if (rc)
748 goto again; 755 goto again;
@@ -1049,7 +1056,9 @@ static int iscsi_exec_abort_task(struct scsi_cmnd *sc,
1049 ctask->mtask = __iscsi_conn_send_pdu(conn, (struct iscsi_hdr *)hdr, 1056 ctask->mtask = __iscsi_conn_send_pdu(conn, (struct iscsi_hdr *)hdr,
1050 NULL, 0); 1057 NULL, 0);
1051 if (!ctask->mtask) { 1058 if (!ctask->mtask) {
1059 spin_unlock_bh(&session->lock);
1052 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 1060 iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
1061 spin_lock_bh(&session->lock)
1053 debug_scsi("abort sent failure [itt 0x%x]\n", ctask->itt); 1062 debug_scsi("abort sent failure [itt 0x%x]\n", ctask->itt);
1054 return -EPERM; 1063 return -EPERM;
1055 } 1064 }
@@ -1066,6 +1075,7 @@ static int iscsi_exec_abort_task(struct scsi_cmnd *sc,
1066 debug_scsi("abort set timeout [itt 0x%x]\n", ctask->itt); 1075 debug_scsi("abort set timeout [itt 0x%x]\n", ctask->itt);
1067 } 1076 }
1068 spin_unlock_bh(&session->lock); 1077 spin_unlock_bh(&session->lock);
1078 mutex_unlock(&session->eh_mutex);
1069 scsi_queue_work(session->host, &conn->xmitwork); 1079 scsi_queue_work(session->host, &conn->xmitwork);
1070 1080
1071 /* 1081 /*
@@ -1083,6 +1093,7 @@ static int iscsi_exec_abort_task(struct scsi_cmnd *sc,
1083 if (signal_pending(current)) 1093 if (signal_pending(current))
1084 flush_signals(current); 1094 flush_signals(current);
1085 del_timer_sync(&conn->tmabort_timer); 1095 del_timer_sync(&conn->tmabort_timer);
1096 mutex_lock(&session->eh_mutex);
1086 spin_lock_bh(&session->lock); 1097 spin_lock_bh(&session->lock);
1087 return 0; 1098 return 0;
1088} 1099}
@@ -1158,31 +1169,45 @@ static void fail_command(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask,
1158 __iscsi_put_ctask(ctask); 1169 __iscsi_put_ctask(ctask);
1159} 1170}
1160 1171
1172static void iscsi_suspend_tx(struct iscsi_conn *conn)
1173{
1174 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
1175 scsi_flush_work(conn->session->host);
1176}
1177
1178static void iscsi_start_tx(struct iscsi_conn *conn)
1179{
1180 clear_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
1181 scsi_queue_work(conn->session->host, &conn->xmitwork);
1182}
1183
1161int iscsi_eh_abort(struct scsi_cmnd *sc) 1184int iscsi_eh_abort(struct scsi_cmnd *sc)
1162{ 1185{
1186 struct Scsi_Host *host = sc->device->host;
1187 struct iscsi_session *session = iscsi_hostdata(host->hostdata);
1163 struct iscsi_cmd_task *ctask; 1188 struct iscsi_cmd_task *ctask;
1164 struct iscsi_conn *conn; 1189 struct iscsi_conn *conn;
1165 struct iscsi_session *session;
1166 int rc; 1190 int rc;
1167 1191
1192 mutex_lock(&session->eh_mutex);
1193 spin_lock_bh(&session->lock);
1168 /* 1194 /*
1169 * if session was ISCSI_STATE_IN_RECOVERY then we may not have 1195 * if session was ISCSI_STATE_IN_RECOVERY then we may not have
1170 * got the command. 1196 * got the command.
1171 */ 1197 */
1172 if (!sc->SCp.ptr) { 1198 if (!sc->SCp.ptr) {
1173 debug_scsi("sc never reached iscsi layer or it completed.\n"); 1199 debug_scsi("sc never reached iscsi layer or it completed.\n");
1200 spin_unlock_bh(&session->lock);
1201 mutex_unlock(&session->eh_mutex);
1174 return SUCCESS; 1202 return SUCCESS;
1175 } 1203 }
1176 1204
1177 ctask = (struct iscsi_cmd_task *)sc->SCp.ptr; 1205 ctask = (struct iscsi_cmd_task *)sc->SCp.ptr;
1178 conn = ctask->conn; 1206 conn = ctask->conn;
1179 session = conn->session;
1180 1207
1181 conn->eh_abort_cnt++; 1208 conn->eh_abort_cnt++;
1182 debug_scsi("aborting [sc %p itt 0x%x]\n", sc, ctask->itt); 1209 debug_scsi("aborting [sc %p itt 0x%x]\n", sc, ctask->itt);
1183 1210
1184 spin_lock_bh(&session->lock);
1185
1186 /* 1211 /*
1187 * If we are not logged in or we have started a new session 1212 * If we are not logged in or we have started a new session
1188 * then let the host reset code handle this 1213 * then let the host reset code handle this
@@ -1219,6 +1244,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
1219 switch (conn->tmabort_state) { 1244 switch (conn->tmabort_state) {
1220 case TMABORT_SUCCESS: 1245 case TMABORT_SUCCESS:
1221 spin_unlock_bh(&session->lock); 1246 spin_unlock_bh(&session->lock);
1247 iscsi_suspend_tx(conn);
1222 /* 1248 /*
1223 * clean up task if aborted. grab the recv lock as a writer 1249 * clean up task if aborted. grab the recv lock as a writer
1224 */ 1250 */
@@ -1227,11 +1253,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
1227 fail_command(conn, ctask, DID_ABORT << 16); 1253 fail_command(conn, ctask, DID_ABORT << 16);
1228 spin_unlock(&session->lock); 1254 spin_unlock(&session->lock);
1229 write_unlock_bh(conn->recv_lock); 1255 write_unlock_bh(conn->recv_lock);
1230 /* 1256 iscsi_start_tx(conn);
1231 * make sure xmit thread is not still touching the
1232 * ctask/scsi_cmnd
1233 */
1234 scsi_flush_work(session->host);
1235 goto success_unlocked; 1257 goto success_unlocked;
1236 case TMABORT_NOT_FOUND: 1258 case TMABORT_NOT_FOUND:
1237 if (!ctask->sc) { 1259 if (!ctask->sc) {
@@ -1251,12 +1273,14 @@ success:
1251 spin_unlock_bh(&session->lock); 1273 spin_unlock_bh(&session->lock);
1252success_unlocked: 1274success_unlocked:
1253 debug_scsi("abort success [sc %lx itt 0x%x]\n", (long)sc, ctask->itt); 1275 debug_scsi("abort success [sc %lx itt 0x%x]\n", (long)sc, ctask->itt);
1276 mutex_unlock(&session->eh_mutex);
1254 return SUCCESS; 1277 return SUCCESS;
1255 1278
1256failed: 1279failed:
1257 spin_unlock_bh(&session->lock); 1280 spin_unlock_bh(&session->lock);
1258failed_unlocked: 1281failed_unlocked:
1259 debug_scsi("abort failed [sc %lx itt 0x%x]\n", (long)sc, ctask->itt); 1282 debug_scsi("abort failed [sc %lx itt 0x%x]\n", (long)sc, ctask->itt);
1283 mutex_unlock(&session->eh_mutex);
1260 return FAILED; 1284 return FAILED;
1261} 1285}
1262EXPORT_SYMBOL_GPL(iscsi_eh_abort); 1286EXPORT_SYMBOL_GPL(iscsi_eh_abort);
@@ -1403,6 +1427,7 @@ iscsi_session_setup(struct iscsi_transport *iscsit,
1403 session->max_cmdsn = initial_cmdsn + 1; 1427 session->max_cmdsn = initial_cmdsn + 1;
1404 session->max_r2t = 1; 1428 session->max_r2t = 1;
1405 session->tt = iscsit; 1429 session->tt = iscsit;
1430 mutex_init(&session->eh_mutex);
1406 1431
1407 /* initialize SCSI PDU commands pool */ 1432 /* initialize SCSI PDU commands pool */
1408 if (iscsi_pool_init(&session->cmdpool, session->cmds_max, 1433 if (iscsi_pool_init(&session->cmdpool, session->cmds_max,
@@ -1736,9 +1761,22 @@ static void iscsi_start_session_recovery(struct iscsi_session *session,
1736{ 1761{
1737 int old_stop_stage; 1762 int old_stop_stage;
1738 1763
1764 mutex_lock(&session->eh_mutex);
1739 spin_lock_bh(&session->lock); 1765 spin_lock_bh(&session->lock);
1740 if (conn->stop_stage == STOP_CONN_TERM) { 1766 if (conn->stop_stage == STOP_CONN_TERM) {
1741 spin_unlock_bh(&session->lock); 1767 spin_unlock_bh(&session->lock);
1768 mutex_unlock(&session->eh_mutex);
1769 return;
1770 }
1771
1772 /*
1773 * The LLD either freed/unset the lock on us, or userspace called
1774 * stop but did not create a proper connection (connection was never
1775 * bound or it was unbound then stop was called).
1776 */
1777 if (!conn->recv_lock) {
1778 spin_unlock_bh(&session->lock);
1779 mutex_unlock(&session->eh_mutex);
1742 return; 1780 return;
1743 } 1781 }
1744 1782
@@ -1755,9 +1793,9 @@ static void iscsi_start_session_recovery(struct iscsi_session *session,
1755 old_stop_stage = conn->stop_stage; 1793 old_stop_stage = conn->stop_stage;
1756 conn->stop_stage = flag; 1794 conn->stop_stage = flag;
1757 conn->c_stage = ISCSI_CONN_STOPPED; 1795 conn->c_stage = ISCSI_CONN_STOPPED;
1758 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
1759 spin_unlock_bh(&session->lock); 1796 spin_unlock_bh(&session->lock);
1760 scsi_flush_work(session->host); 1797
1798 iscsi_suspend_tx(conn);
1761 1799
1762 write_lock_bh(conn->recv_lock); 1800 write_lock_bh(conn->recv_lock);
1763 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); 1801 set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx);
@@ -1786,6 +1824,7 @@ static void iscsi_start_session_recovery(struct iscsi_session *session,
1786 fail_all_commands(conn); 1824 fail_all_commands(conn);
1787 flush_control_queues(session, conn); 1825 flush_control_queues(session, conn);
1788 spin_unlock_bh(&session->lock); 1826 spin_unlock_bh(&session->lock);
1827 mutex_unlock(&session->eh_mutex);
1789} 1828}
1790 1829
1791void iscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag) 1830void iscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 563d18f4ff5..c6680348b64 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -2050,21 +2050,18 @@ qla25xx_fw_dump_failed:
2050void 2050void
2051qla2x00_dump_regs(scsi_qla_host_t *ha) 2051qla2x00_dump_regs(scsi_qla_host_t *ha)
2052{ 2052{
2053 int i;
2053 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; 2054 struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
2055 struct device_reg_24xx __iomem *reg24 = &ha->iobase->isp24;
2056 uint16_t __iomem *mbx_reg;
2057
2058 mbx_reg = IS_FWI2_CAPABLE(ha) ? &reg24->mailbox0:
2059 MAILBOX_REG(ha, reg, 0);
2054 2060
2055 printk("Mailbox registers:\n"); 2061 printk("Mailbox registers:\n");
2056 printk("scsi(%ld): mbox 0 0x%04x \n", 2062 for (i = 0; i < 6; i++)
2057 ha->host_no, RD_MAILBOX_REG(ha, reg, 0)); 2063 printk("scsi(%ld): mbox %d 0x%04x \n", ha->host_no, i,
2058 printk("scsi(%ld): mbox 1 0x%04x \n", 2064 RD_REG_WORD(mbx_reg++));
2059 ha->host_no, RD_MAILBOX_REG(ha, reg, 1));
2060 printk("scsi(%ld): mbox 2 0x%04x \n",
2061 ha->host_no, RD_MAILBOX_REG(ha, reg, 2));
2062 printk("scsi(%ld): mbox 3 0x%04x \n",
2063 ha->host_no, RD_MAILBOX_REG(ha, reg, 3));
2064 printk("scsi(%ld): mbox 4 0x%04x \n",
2065 ha->host_no, RD_MAILBOX_REG(ha, reg, 4));
2066 printk("scsi(%ld): mbox 5 0x%04x \n",
2067 ha->host_no, RD_MAILBOX_REG(ha, reg, 5));
2068} 2065}
2069 2066
2070 2067
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 27ae3a532a5..c1964866a42 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1502,7 +1502,6 @@ typedef struct {
1502 uint8_t node_name[WWN_SIZE]; 1502 uint8_t node_name[WWN_SIZE];
1503 uint8_t port_name[WWN_SIZE]; 1503 uint8_t port_name[WWN_SIZE];
1504 uint8_t fabric_port_name[WWN_SIZE]; 1504 uint8_t fabric_port_name[WWN_SIZE];
1505 uint16_t fp_speeds;
1506 uint16_t fp_speed; 1505 uint16_t fp_speed;
1507} sw_info_t; 1506} sw_info_t;
1508 1507
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index b06cbb8580d..a7e23583f89 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -295,6 +295,8 @@ qla2x00_gid_pt(scsi_qla_host_t *ha, sw_info_t *list)
295 list[i].d_id.b.domain = gid_data->port_id[0]; 295 list[i].d_id.b.domain = gid_data->port_id[0];
296 list[i].d_id.b.area = gid_data->port_id[1]; 296 list[i].d_id.b.area = gid_data->port_id[1];
297 list[i].d_id.b.al_pa = gid_data->port_id[2]; 297 list[i].d_id.b.al_pa = gid_data->port_id[2];
298 memset(list[i].fabric_port_name, 0, WWN_SIZE);
299 list[i].fp_speed = PORT_SPEED_UNKNOWN;
298 300
299 /* Last one exit. */ 301 /* Last one exit. */
300 if (gid_data->control_byte & BIT_7) { 302 if (gid_data->control_byte & BIT_7) {
@@ -1707,8 +1709,6 @@ qla2x00_gfpn_id(scsi_qla_host_t *ha, sw_info_t *list)
1707 1709
1708 for (i = 0; i < MAX_FIBRE_DEVICES; i++) { 1710 for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
1709 /* Issue GFPN_ID */ 1711 /* Issue GFPN_ID */
1710 memset(list[i].fabric_port_name, 0, WWN_SIZE);
1711
1712 /* Prepare common MS IOCB */ 1712 /* Prepare common MS IOCB */
1713 ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, 1713 ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GFPN_ID_REQ_SIZE,
1714 GFPN_ID_RSP_SIZE); 1714 GFPN_ID_RSP_SIZE);
@@ -1821,8 +1821,6 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
1821 1821
1822 for (i = 0; i < MAX_FIBRE_DEVICES; i++) { 1822 for (i = 0; i < MAX_FIBRE_DEVICES; i++) {
1823 /* Issue GFPN_ID */ 1823 /* Issue GFPN_ID */
1824 list[i].fp_speeds = list[i].fp_speed = 0;
1825
1826 /* Prepare common MS IOCB */ 1824 /* Prepare common MS IOCB */
1827 ms_pkt = qla24xx_prep_ms_fm_iocb(ha, GPSC_REQ_SIZE, 1825 ms_pkt = qla24xx_prep_ms_fm_iocb(ha, GPSC_REQ_SIZE,
1828 GPSC_RSP_SIZE); 1826 GPSC_RSP_SIZE);
@@ -1858,9 +1856,21 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
1858 } 1856 }
1859 rval = QLA_FUNCTION_FAILED; 1857 rval = QLA_FUNCTION_FAILED;
1860 } else { 1858 } else {
1861 /* Save portname */ 1859 /* Save port-speed */
1862 list[i].fp_speeds = ct_rsp->rsp.gpsc.speeds; 1860 switch (be16_to_cpu(ct_rsp->rsp.gpsc.speed)) {
1863 list[i].fp_speed = ct_rsp->rsp.gpsc.speed; 1861 case BIT_15:
1862 list[i].fp_speed = PORT_SPEED_1GB;
1863 break;
1864 case BIT_14:
1865 list[i].fp_speed = PORT_SPEED_2GB;
1866 break;
1867 case BIT_13:
1868 list[i].fp_speed = PORT_SPEED_4GB;
1869 break;
1870 case BIT_11:
1871 list[i].fp_speed = PORT_SPEED_8GB;
1872 break;
1873 }
1864 1874
1865 DEBUG2_3(printk("scsi(%ld): GPSC ext entry - " 1875 DEBUG2_3(printk("scsi(%ld): GPSC ext entry - "
1866 "fpn %02x%02x%02x%02x%02x%02x%02x%02x speeds=%04x " 1876 "fpn %02x%02x%02x%02x%02x%02x%02x%02x speeds=%04x "
@@ -1873,8 +1883,8 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list)
1873 list[i].fabric_port_name[5], 1883 list[i].fabric_port_name[5],
1874 list[i].fabric_port_name[6], 1884 list[i].fabric_port_name[6],
1875 list[i].fabric_port_name[7], 1885 list[i].fabric_port_name[7],
1876 be16_to_cpu(list[i].fp_speeds), 1886 be16_to_cpu(ct_rsp->rsp.gpsc.speeds),
1877 be16_to_cpu(list[i].fp_speed))); 1887 be16_to_cpu(ct_rsp->rsp.gpsc.speed)));
1878 } 1888 }
1879 1889
1880 /* Last device exit. */ 1890 /* Last device exit. */
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 374abe19b54..1a058ec9bd0 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2079,17 +2079,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
2079 } 2079 }
2080 2080
2081 /* Base iIDMA settings on HBA port speed. */ 2081 /* Base iIDMA settings on HBA port speed. */
2082 switch (ha->link_data_rate) { 2082 fcport->fp_speed = ha->link_data_rate;
2083 case PORT_SPEED_1GB:
2084 fcport->fp_speed = cpu_to_be16(BIT_15);
2085 break;
2086 case PORT_SPEED_2GB:
2087 fcport->fp_speed = cpu_to_be16(BIT_14);
2088 break;
2089 case PORT_SPEED_4GB:
2090 fcport->fp_speed = cpu_to_be16(BIT_13);
2091 break;
2092 }
2093 2083
2094 qla2x00_update_fcport(ha, fcport); 2084 qla2x00_update_fcport(ha, fcport);
2095 2085
@@ -2130,38 +2120,25 @@ static void
2130qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) 2120qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
2131{ 2121{
2132#define LS_UNKNOWN 2 2122#define LS_UNKNOWN 2
2133 static char *link_speeds[5] = { "1", "2", "?", "4" }; 2123 static char *link_speeds[5] = { "1", "2", "?", "4", "8" };
2134 int rval; 2124 int rval;
2135 uint16_t port_speed, mb[6]; 2125 uint16_t mb[6];
2136 2126
2137 if (!IS_IIDMA_CAPABLE(ha)) 2127 if (!IS_IIDMA_CAPABLE(ha))
2138 return; 2128 return;
2139 2129
2140 switch (be16_to_cpu(fcport->fp_speed)) { 2130 if (fcport->fp_speed == PORT_SPEED_UNKNOWN) {
2141 case BIT_15:
2142 port_speed = PORT_SPEED_1GB;
2143 break;
2144 case BIT_14:
2145 port_speed = PORT_SPEED_2GB;
2146 break;
2147 case BIT_13:
2148 port_speed = PORT_SPEED_4GB;
2149 break;
2150 default:
2151 DEBUG2(printk("scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- " 2131 DEBUG2(printk("scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- "
2152 "unsupported FM port operating speed (%04x).\n", 2132 "unsupported FM port operating speed.\n",
2153 ha->host_no, fcport->port_name[0], fcport->port_name[1], 2133 ha->host_no, fcport->port_name[0], fcport->port_name[1],
2154 fcport->port_name[2], fcport->port_name[3], 2134 fcport->port_name[2], fcport->port_name[3],
2155 fcport->port_name[4], fcport->port_name[5], 2135 fcport->port_name[4], fcport->port_name[5],
2156 fcport->port_name[6], fcport->port_name[7], 2136 fcport->port_name[6], fcport->port_name[7]));
2157 be16_to_cpu(fcport->fp_speed)));
2158 port_speed = PORT_SPEED_UNKNOWN;
2159 break;
2160 }
2161 if (port_speed == PORT_SPEED_UNKNOWN)
2162 return; 2137 return;
2138 }
2163 2139
2164 rval = qla2x00_set_idma_speed(ha, fcport->loop_id, port_speed, mb); 2140 rval = qla2x00_set_idma_speed(ha, fcport->loop_id, fcport->fp_speed,
2141 mb);
2165 if (rval != QLA_SUCCESS) { 2142 if (rval != QLA_SUCCESS) {
2166 DEBUG2(printk("scsi(%ld): Unable to adjust iIDMA " 2143 DEBUG2(printk("scsi(%ld): Unable to adjust iIDMA "
2167 "%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n", 2144 "%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n",
@@ -2169,12 +2146,12 @@ qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
2169 fcport->port_name[2], fcport->port_name[3], 2146 fcport->port_name[2], fcport->port_name[3],
2170 fcport->port_name[4], fcport->port_name[5], 2147 fcport->port_name[4], fcport->port_name[5],
2171 fcport->port_name[6], fcport->port_name[7], rval, 2148 fcport->port_name[6], fcport->port_name[7], rval,
2172 port_speed, mb[0], mb[1])); 2149 fcport->fp_speed, mb[0], mb[1]));
2173 } else { 2150 } else {
2174 DEBUG2(qla_printk(KERN_INFO, ha, 2151 DEBUG2(qla_printk(KERN_INFO, ha,
2175 "iIDMA adjusted to %s GB/s on " 2152 "iIDMA adjusted to %s GB/s on "
2176 "%02x%02x%02x%02x%02x%02x%02x%02x.\n", 2153 "%02x%02x%02x%02x%02x%02x%02x%02x.\n",
2177 link_speeds[port_speed], fcport->port_name[0], 2154 link_speeds[fcport->fp_speed], fcport->port_name[0],
2178 fcport->port_name[1], fcport->port_name[2], 2155 fcport->port_name[1], fcport->port_name[2],
2179 fcport->port_name[3], fcport->port_name[4], 2156 fcport->port_name[3], fcport->port_name[4],
2180 fcport->port_name[5], fcport->port_name[6], 2157 fcport->port_name[5], fcport->port_name[6],
@@ -3354,7 +3331,8 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)
3354 3331
3355 spin_lock_irqsave(&ha->hardware_lock, flags); 3332 spin_lock_irqsave(&ha->hardware_lock, flags);
3356 3333
3357 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) { 3334 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha) &&
3335 !IS_QLA25XX(ha)) {
3358 /* 3336 /*
3359 * Disable SRAM, Instruction RAM and GP RAM 3337 * Disable SRAM, Instruction RAM and GP RAM
3360 * parity. 3338 * parity.
@@ -3370,7 +3348,8 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)
3370 3348
3371 spin_lock_irqsave(&ha->hardware_lock, flags); 3349 spin_lock_irqsave(&ha->hardware_lock, flags);
3372 3350
3373 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) { 3351 if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha) &&
3352 !IS_QLA25XX(ha)) {
3374 /* Enable proper parity */ 3353 /* Enable proper parity */
3375 if (IS_QLA2300(ha)) 3354 if (IS_QLA2300(ha))
3376 /* SRAM parity */ 3355 /* SRAM parity */
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 50539da467b..eecae9905ec 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -490,6 +490,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
490 set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags); 490 set_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags);
491 491
492 ha->flags.gpsc_supported = 1; 492 ha->flags.gpsc_supported = 1;
493 ha->flags.management_server_logged_in = 0;
493 break; 494 break;
494 495
495 case MBA_CHG_IN_CONNECTION: /* Change in connection mode */ 496 case MBA_CHG_IN_CONNECTION: /* Change in connection mode */
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 93c0c7e4f08..acca898ce0a 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1564,7 +1564,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1564 struct Scsi_Host *host; 1564 struct Scsi_Host *host;
1565 scsi_qla_host_t *ha; 1565 scsi_qla_host_t *ha;
1566 unsigned long flags = 0; 1566 unsigned long flags = 0;
1567 char pci_info[20]; 1567 char pci_info[30];
1568 char fw_str[30]; 1568 char fw_str[30];
1569 struct scsi_host_template *sht; 1569 struct scsi_host_template *sht;
1570 1570
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index dd1f8ceb79c..18095b9b76f 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,7 +7,7 @@
7/* 7/*
8 * Driver version 8 * Driver version
9 */ 9 */
10#define QLA2XXX_VERSION "8.02.00-k2" 10#define QLA2XXX_VERSION "8.02.00-k3"
11 11
12#define QLA_DRIVER_MAJOR_VER 8 12#define QLA_DRIVER_MAJOR_VER 8
13#define QLA_DRIVER_MINOR_VER 2 13#define QLA_DRIVER_MINOR_VER 2
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index bd66339f7a3..1ea1ed82c35 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -610,7 +610,7 @@ static int pci_netmos_init(struct pci_dev *dev)
610/* enable IO_Space bit */ 610/* enable IO_Space bit */
611#define ITE_887x_POSIO_ENABLE (1 << 31) 611#define ITE_887x_POSIO_ENABLE (1 << 31)
612 612
613static int __devinit pci_ite887x_init(struct pci_dev *dev) 613static int pci_ite887x_init(struct pci_dev *dev)
614{ 614{
615 /* inta_addr are the configuration addresses of the ITE */ 615 /* inta_addr are the configuration addresses of the ITE */
616 static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0, 616 static const short inta_addr[] = { 0x2a0, 0x2c0, 0x220, 0x240, 0x1e0,
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 64ff6a5f6af..81b52b7cca2 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -611,7 +611,7 @@ config SERIAL_BFIN
611 611
612config SERIAL_BFIN_CONSOLE 612config SERIAL_BFIN_CONSOLE
613 bool "Console on Blackfin serial port" 613 bool "Console on Blackfin serial port"
614 depends on SERIAL_BFIN 614 depends on SERIAL_BFIN=y
615 select SERIAL_CORE_CONSOLE 615 select SERIAL_CORE_CONSOLE
616 616
617choice 617choice
@@ -832,10 +832,10 @@ config SERIAL_MUX
832 4. Change the kernel command console parameter to: console=ttyB0 832 4. Change the kernel command console parameter to: console=ttyB0
833 833
834config SERIAL_MUX_CONSOLE 834config SERIAL_MUX_CONSOLE
835 bool "Support for console on serial MUX" 835 bool "Support for console on serial MUX"
836 depends on SERIAL_MUX 836 depends on SERIAL_MUX=y
837 select SERIAL_CORE_CONSOLE 837 select SERIAL_CORE_CONSOLE
838 default y 838 default y
839 839
840config PDC_CONSOLE 840config PDC_CONSOLE
841 bool "PDC software console support" 841 bool "PDC software console support"
diff --git a/drivers/serial/sb1250-duart.c b/drivers/serial/sb1250-duart.c
index 20125375501..2d6c08b3dbc 100644
--- a/drivers/serial/sb1250-duart.c
+++ b/drivers/serial/sb1250-duart.c
@@ -58,6 +58,12 @@
58#define SBD_CTRLREGS(line) A_BCM1480_DUART_CTRLREG((line), 0) 58#define SBD_CTRLREGS(line) A_BCM1480_DUART_CTRLREG((line), 0)
59#define SBD_INT(line) (K_BCM1480_INT_UART_0 + (line)) 59#define SBD_INT(line) (K_BCM1480_INT_UART_0 + (line))
60 60
61#define DUART_CHANREG_SPACING BCM1480_DUART_CHANREG_SPACING
62
63#define R_DUART_IMRREG(line) R_BCM1480_DUART_IMRREG(line)
64#define R_DUART_INCHREG(line) R_BCM1480_DUART_INCHREG(line)
65#define R_DUART_ISRREG(line) R_BCM1480_DUART_ISRREG(line)
66
61#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X) 67#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
62#include <asm/sibyte/sb1250_regs.h> 68#include <asm/sibyte/sb1250_regs.h>
63#include <asm/sibyte/sb1250_int.h> 69#include <asm/sibyte/sb1250_int.h>
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index ad144054da3..b0469749310 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -251,7 +251,7 @@ atmel_spi_dma_map_xfer(struct atmel_spi *as, struct spi_transfer *xfer)
251 xfer->rx_dma = dma_map_single(dev, 251 xfer->rx_dma = dma_map_single(dev,
252 xfer->rx_buf, xfer->len, 252 xfer->rx_buf, xfer->len,
253 DMA_FROM_DEVICE); 253 DMA_FROM_DEVICE);
254 if (dma_mapping_error(xfer->tx_dma)) { 254 if (dma_mapping_error(xfer->rx_dma)) {
255 if (xfer->tx_buf) 255 if (xfer->tx_buf)
256 dma_unmap_single(dev, 256 dma_unmap_single(dev,
257 xfer->tx_dma, xfer->len, 257 xfer->tx_dma, xfer->len,
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index 48587c27050..f540ed77a10 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -1303,8 +1303,9 @@ static int bfin5xx_spi_resume(struct platform_device *pdev)
1303#define bfin5xx_spi_resume NULL 1303#define bfin5xx_spi_resume NULL
1304#endif /* CONFIG_PM */ 1304#endif /* CONFIG_PM */
1305 1305
1306MODULE_ALIAS("bfin-spi-master"); /* for platform bus hotplug */
1306static struct platform_driver bfin5xx_spi_driver = { 1307static struct platform_driver bfin5xx_spi_driver = {
1307 .driver = { 1308 .driver = {
1308 .name = "bfin-spi-master", 1309 .name = "bfin-spi-master",
1309 .owner = THIS_MODULE, 1310 .owner = THIS_MODULE,
1310 }, 1311 },
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index aee9ad6f633..bd9177f51de 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -1735,7 +1735,7 @@ static int spi_imx_resume(struct platform_device *pdev)
1735 1735
1736static struct platform_driver driver = { 1736static struct platform_driver driver = {
1737 .driver = { 1737 .driver = {
1738 .name = "imx-spi", 1738 .name = "spi_imx",
1739 .bus = &platform_bus_type, 1739 .bus = &platform_bus_type,
1740 .owner = THIS_MODULE, 1740 .owner = THIS_MODULE,
1741 }, 1741 },
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 2adf856e44c..32cda77b31c 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -384,11 +384,8 @@ irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data)
384 384
385 mpc83xx_spi->count -= 1; 385 mpc83xx_spi->count -= 1;
386 if (mpc83xx_spi->count) { 386 if (mpc83xx_spi->count) {
387 if (mpc83xx_spi->tx) { 387 u32 word = mpc83xx_spi->get_tx(mpc83xx_spi);
388 u32 word = mpc83xx_spi->get_tx(mpc83xx_spi); 388 mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, word);
389 mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit,
390 word);
391 }
392 } else { 389 } else {
393 complete(&mpc83xx_spi->done); 390 complete(&mpc83xx_spi->done);
394 } 391 }
@@ -530,6 +527,7 @@ static int __devexit mpc83xx_spi_remove(struct platform_device *dev)
530 return 0; 527 return 0;
531} 528}
532 529
530MODULE_ALIAS("mpc83xx_spi"); /* for platform bus hotplug */
533static struct platform_driver mpc83xx_spi_driver = { 531static struct platform_driver mpc83xx_spi_driver = {
534 .probe = mpc83xx_spi_probe, 532 .probe = mpc83xx_spi_probe,
535 .remove = __devexit_p(mpc83xx_spi_remove), 533 .remove = __devexit_p(mpc83xx_spi_remove),
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index 5cf48123e0e..e9b683f7d7b 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -427,6 +427,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
427#define s3c24xx_spi_resume NULL 427#define s3c24xx_spi_resume NULL
428#endif 428#endif
429 429
430MODULE_ALIAS("s3c2410_spi"); /* for platform bus hotplug */
430static struct platform_driver s3c24xx_spidrv = { 431static struct platform_driver s3c24xx_spidrv = {
431 .probe = s3c24xx_spi_probe, 432 .probe = s3c24xx_spi_probe,
432 .remove = s3c24xx_spi_remove, 433 .remove = s3c24xx_spi_remove,
diff --git a/drivers/spi/spi_s3c24xx_gpio.c b/drivers/spi/spi_s3c24xx_gpio.c
index 611ac22b7cd..0fa25e2e80f 100644
--- a/drivers/spi/spi_s3c24xx_gpio.c
+++ b/drivers/spi/spi_s3c24xx_gpio.c
@@ -180,7 +180,7 @@ static struct platform_driver s3c2410_spigpio_drv = {
180 .suspend = s3c2410_spigpio_suspend, 180 .suspend = s3c2410_spigpio_suspend,
181 .resume = s3c2410_spigpio_resume, 181 .resume = s3c2410_spigpio_resume,
182 .driver = { 182 .driver = {
183 .name = "s3c24xx-spi-gpio", 183 .name = "spi_s3c24xx_gpio",
184 .owner = THIS_MODULE, 184 .owner = THIS_MODULE,
185 }, 185 },
186}; 186};
diff --git a/drivers/spi/spi_txx9.c b/drivers/spi/spi_txx9.c
index 08e981c4064..b7f4bb239ea 100644
--- a/drivers/spi/spi_txx9.c
+++ b/drivers/spi/spi_txx9.c
@@ -453,7 +453,7 @@ static int __exit txx9spi_remove(struct platform_device *dev)
453static struct platform_driver txx9spi_driver = { 453static struct platform_driver txx9spi_driver = {
454 .remove = __exit_p(txx9spi_remove), 454 .remove = __exit_p(txx9spi_remove),
455 .driver = { 455 .driver = {
456 .name = "txx9spi", 456 .name = "spi_txx9",
457 .owner = THIS_MODULE, 457 .owner = THIS_MODULE,
458 }, 458 },
459}; 459};
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index f0bf9a68e96..5d04f520c12 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -21,7 +21,7 @@
21 21
22#include <syslib/virtex_devices.h> 22#include <syslib/virtex_devices.h>
23 23
24#define XILINX_SPI_NAME "xspi" 24#define XILINX_SPI_NAME "xilinx_spi"
25 25
26/* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e) 26/* Register definitions as per "OPB Serial Peripheral Interface (SPI) (v1.00e)
27 * Product Specification", DS464 27 * Product Specification", DS464
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index a1ad11d0c47..63b1243a913 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -60,7 +60,7 @@ ssize_t usb_store_new_id(struct usb_dynids *dynids,
60 dynid->id.match_flags = USB_DEVICE_ID_MATCH_DEVICE; 60 dynid->id.match_flags = USB_DEVICE_ID_MATCH_DEVICE;
61 61
62 spin_lock(&dynids->lock); 62 spin_lock(&dynids->lock);
63 list_add_tail(&dynids->list, &dynid->node); 63 list_add_tail(&dynid->node, &dynids->list);
64 spin_unlock(&dynids->lock); 64 spin_unlock(&dynids->lock);
65 65
66 if (get_driver(driver)) { 66 if (get_driver(driver)) {
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 9e467118dc9..7f17d0fd76c 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -28,10 +28,16 @@
28 * devices is broken... 28 * devices is broken...
29 */ 29 */
30static const struct usb_device_id usb_quirk_list[] = { 30static const struct usb_device_id usb_quirk_list[] = {
31 /* CBM - Flash disk */
32 { USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME },
31 /* HP 5300/5370C scanner */ 33 /* HP 5300/5370C scanner */
32 { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, 34 { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 },
33 /* Hewlett-Packard PhotoSmart 720 / PhotoSmart 935 (storage) */ 35 /* Hewlett-Packard PhotoSmart 720 / PhotoSmart 935 (storage) */
34 { USB_DEVICE(0x03f0, 0x4002), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 36 { USB_DEVICE(0x03f0, 0x4002), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
37
38 /* SGS Thomson Microelectronics 4in1 card reader */
39 { USB_DEVICE(0x0483, 0x0321), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
40
35 /* Acer Peripherals Inc. (now BenQ Corp.) Prisa 640BU */ 41 /* Acer Peripherals Inc. (now BenQ Corp.) Prisa 640BU */
36 { USB_DEVICE(0x04a5, 0x207e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 42 { USB_DEVICE(0x04a5, 0x207e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
37 /* Benq S2W 3300U */ 43 /* Benq S2W 3300U */
@@ -66,6 +72,19 @@ static const struct usb_device_id usb_quirk_list[] = {
66 { USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 72 { USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
67 /* Ultima Electronics Corp.*/ 73 /* Ultima Electronics Corp.*/
68 { USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 74 { USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
75
76 /* Genesys USB-to-IDE */
77 { USB_DEVICE(0x0503, 0x0702), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
78
79 /* USB Graphical LCD - EEH Datalink GmbH */
80 { USB_DEVICE(0x060c, 0x04eb), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
81
82 /* INTEL VALUE SSD */
83 { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
84
85 /* M-Systems Flash Disk Pioneers */
86 { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
87
69 /* Agfa Snapscan1212u */ 88 /* Agfa Snapscan1212u */
70 { USB_DEVICE(0x06bd, 0x2061), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 89 { USB_DEVICE(0x06bd, 0x2061), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
71 /* Seagate RSS LLC */ 90 /* Seagate RSS LLC */
@@ -87,6 +106,12 @@ static const struct usb_device_id usb_quirk_list[] = {
87 { USB_DEVICE(0x0fca, 0x0004), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 106 { USB_DEVICE(0x0fca, 0x0004), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
88 { USB_DEVICE(0x0fca, 0x0006), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 107 { USB_DEVICE(0x0fca, 0x0006), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
89 108
109 /* Apple iPhone */
110 { USB_DEVICE(0x05ac, 0x1290), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
111
112 /* SKYMEDI USB_DRIVE */
113 { USB_DEVICE(0x1516, 0x8628), .driver_info = USB_QUIRK_RESET_RESUME },
114
90 { } /* terminating entry must be last */ 115 { } /* terminating entry must be last */
91}; 116};
92 117
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 9cd98e73dc1..ce4d2e09633 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -1691,14 +1691,12 @@ static int gs_setup_class(struct usb_gadget *gadget,
1691 1691
1692 switch (ctrl->bRequest) { 1692 switch (ctrl->bRequest) {
1693 case USB_CDC_REQ_SET_LINE_CODING: 1693 case USB_CDC_REQ_SET_LINE_CODING:
1694 ret = min(wLength, 1694 /* FIXME Submit req to read the data; have its completion
1695 (u16)sizeof(struct usb_cdc_line_coding)); 1695 * handler copy that data to port->port_line_coding (iff
1696 if (port) { 1696 * it's valid) and maybe pass it on. Until then, fail.
1697 spin_lock(&port->port_lock); 1697 */
1698 memcpy(&port->port_line_coding, req->buf, ret); 1698 printk(KERN_WARNING "gs_setup: set_line_coding "
1699 spin_unlock(&port->port_lock); 1699 "unuspported\n");
1700 }
1701 ret = 0;
1702 break; 1700 break;
1703 1701
1704 case USB_CDC_REQ_GET_LINE_CODING: 1702 case USB_CDC_REQ_GET_LINE_CODING:
@@ -1713,11 +1711,18 @@ static int gs_setup_class(struct usb_gadget *gadget,
1713 break; 1711 break;
1714 1712
1715 case USB_CDC_REQ_SET_CONTROL_LINE_STATE: 1713 case USB_CDC_REQ_SET_CONTROL_LINE_STATE:
1716 ret = 0; 1714 /* FIXME Submit req to read the data; have its completion
1715 * handler use that to set the state (iff it's valid) and
1716 * maybe pass it on. Until then, fail.
1717 */
1718 printk(KERN_WARNING "gs_setup: set_control_line_state "
1719 "unuspported\n");
1717 break; 1720 break;
1718 1721
1719 default: 1722 default:
1720 printk(KERN_ERR "gs_setup: unknown class request, type=%02x, request=%02x, value=%04x, index=%04x, length=%d\n", 1723 printk(KERN_ERR "gs_setup: unknown class request, "
1724 "type=%02x, request=%02x, value=%04x, "
1725 "index=%04x, length=%d\n",
1721 ctrl->bRequestType, ctrl->bRequest, 1726 ctrl->bRequestType, ctrl->bRequest,
1722 wValue, wIndex, wLength); 1727 wValue, wIndex, wLength);
1723 break; 1728 break;
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index 9f37ba44c13..b64ca91d9b0 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -3404,6 +3404,7 @@ static void sisusb_disconnect(struct usb_interface *intf)
3404} 3404}
3405 3405
3406static struct usb_device_id sisusb_table [] = { 3406static struct usb_device_id sisusb_table [] = {
3407 { USB_DEVICE(0x0711, 0x0550) },
3407 { USB_DEVICE(0x0711, 0x0900) }, 3408 { USB_DEVICE(0x0711, 0x0900) },
3408 { USB_DEVICE(0x0711, 0x0901) }, 3409 { USB_DEVICE(0x0711, 0x0901) },
3409 { USB_DEVICE(0x0711, 0x0902) }, 3410 { USB_DEVICE(0x0711, 0x0902) },
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index c08a38402b9..a47a24f8820 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -138,7 +138,7 @@ static void free_dynids(struct usb_serial_driver *drv)
138static struct driver_attribute drv_attrs[] = { 138static struct driver_attribute drv_attrs[] = {
139 __ATTR_NULL, 139 __ATTR_NULL,
140}; 140};
141static inline void free_dynids(struct usb_driver *drv) 141static inline void free_dynids(struct usb_serial_driver *drv)
142{ 142{
143} 143}
144#endif 144#endif
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 1370c423d7c..2d045857b18 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -568,6 +568,7 @@ static struct usb_device_id id_table_combined [] = {
568 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) }, 568 { USB_DEVICE(ELEKTOR_VID, ELEKTOR_FT323R_PID) },
569 { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, 569 { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) },
570 { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, 570 { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) },
571 { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) },
571 { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID), 572 { USB_DEVICE(OLIMEX_VID, OLIMEX_ARM_USB_OCD_PID),
572 .driver_info = (kernel_ulong_t)&ftdi_olimex_quirk }, 573 .driver_info = (kernel_ulong_t)&ftdi_olimex_quirk },
573 { }, /* Optional parameter entry */ 574 { }, /* Optional parameter entry */
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index c70e1de6389..b57b90ae9f9 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -534,6 +534,14 @@
534#define OLIMEX_VID 0x15BA 534#define OLIMEX_VID 0x15BA
535#define OLIMEX_ARM_USB_OCD_PID 0x0003 535#define OLIMEX_ARM_USB_OCD_PID 0x0003
536 536
537
538/*
539 * The Mobility Lab (TML)
540 * Submitted by Pierre Castella
541 */
542#define TML_VID 0x1B91 /* Vendor ID */
543#define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */
544
537/* Commands */ 545/* Commands */
538#define FTDI_SIO_RESET 0 /* Reset the port */ 546#define FTDI_SIO_RESET 0 /* Reset the port */
539#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ 547#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 4cb3c165742..a18659e0700 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -108,6 +108,7 @@ static int option_send_setup(struct usb_serial_port *port);
108#define HUAWEI_VENDOR_ID 0x12D1 108#define HUAWEI_VENDOR_ID 0x12D1
109#define HUAWEI_PRODUCT_E600 0x1001 109#define HUAWEI_PRODUCT_E600 0x1001
110#define HUAWEI_PRODUCT_E220 0x1003 110#define HUAWEI_PRODUCT_E220 0x1003
111#define HUAWEI_PRODUCT_E220BIS 0x1004
111 112
112#define NOVATELWIRELESS_VENDOR_ID 0x1410 113#define NOVATELWIRELESS_VENDOR_ID 0x1410
113#define DELL_VENDOR_ID 0x413C 114#define DELL_VENDOR_ID 0x413C
@@ -158,6 +159,7 @@ static struct usb_device_id option_ids[] = {
158 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) }, 159 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) },
159 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 160 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
160 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, 161 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) },
162 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS) },
161 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */ 163 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */
162 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1110) }, /* Novatel Merlin S620 */ 164 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1110) }, /* Novatel Merlin S620 */
163 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1120) }, /* Novatel Merlin EX720 */ 165 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1120) }, /* Novatel Merlin EX720 */
@@ -176,6 +178,7 @@ static struct usb_device_id option_ids[] = {
176 { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */ 178 { 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 */ 179 { 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 */ 180 { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */
181 { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */
179 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, 182 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) },
180 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, 183 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
181 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, 184 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index 833ada47fc5..64f3f66a7a3 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -817,21 +817,6 @@ static int oti6858_ioctl(struct usb_serial_port *port, struct file *file,
817 __FUNCTION__, port->number, cmd, arg); 817 __FUNCTION__, port->number, cmd, arg);
818 818
819 switch (cmd) { 819 switch (cmd) {
820 case TCGETS:
821 if (kernel_termios_to_user_termios((struct ktermios __user *)arg,
822 port->tty->termios))
823 return -EFAULT;
824 return 0;
825
826 case TCSETS:
827 case TCSETSW: /* FIXME: this is not the same! */
828 case TCSETSF: /* FIXME: this is not the same! */
829 if (user_termios_to_kernel_termios(port->tty->termios,
830 (struct ktermios __user *)arg))
831 return -EFAULT;
832 oti6858_set_termios(port, NULL);
833 return 0;
834
835 case TCFLSH: 820 case TCFLSH:
836 /* FIXME */ 821 /* FIXME */
837 return 0; 822 return 0;
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 2d92ce31018..c6b78ba815e 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -348,6 +348,13 @@ UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0101,
348 US_SC_DEVICE, US_PR_DEVICE, NULL, 348 US_SC_DEVICE, US_PR_DEVICE, NULL,
349 US_FL_FIX_CAPACITY), 349 US_FL_FIX_CAPACITY),
350 350
351/* Reported by Ortwin Glueck <odi@odi.ch> */
352UNUSUAL_DEV( 0x04b0, 0x0413, 0x0110, 0x0110,
353 "NIKON",
354 "NIKON DSC D40",
355 US_SC_DEVICE, US_PR_DEVICE, NULL,
356 US_FL_FIX_CAPACITY),
357
351/* BENQ DC5330 358/* BENQ DC5330
352 * Reported by Manuel Fombuena <mfombuena@ya.com> and 359 * Reported by Manuel Fombuena <mfombuena@ya.com> and
353 * Frank Copeland <fjc@thingy.apana.org.au> */ 360 * Frank Copeland <fjc@thingy.apana.org.au> */
@@ -897,6 +904,22 @@ UNUSUAL_DEV( 0x069b, 0x3004, 0x0001, 0x0001,
897 US_SC_DEVICE, US_PR_DEVICE, NULL, 904 US_SC_DEVICE, US_PR_DEVICE, NULL,
898 US_FL_FIX_CAPACITY ), 905 US_FL_FIX_CAPACITY ),
899 906
907/* Reported by Massimiliano Ghilardi <massimiliano.ghilardi@gmail.com>
908 * This USB MP3/AVI player device fails and disconnects if more than 128
909 * sectors (64kB) are read/written in a single command, and may be present
910 * at least in the following products:
911 * "Magnex Digital Video Panel DVP 1800"
912 * "MP4 AIGO 4GB SLOT SD"
913 * "Teclast TL-C260 MP3"
914 * "i.Meizu PMP MP3/MP4"
915 * "Speed MV8 MP4 Audio Player"
916 */
917UNUSUAL_DEV( 0x071b, 0x3203, 0x0100, 0x0100,
918 "RockChip",
919 "ROCK MP3",
920 US_SC_DEVICE, US_PR_DEVICE, NULL,
921 US_FL_MAX_SECTORS_64),
922
900/* Reported by Olivier Blondeau <zeitoun@gmail.com> */ 923/* Reported by Olivier Blondeau <zeitoun@gmail.com> */
901UNUSUAL_DEV( 0x0727, 0x0306, 0x0100, 0x0100, 924UNUSUAL_DEV( 0x0727, 0x0306, 0x0100, 0x0100,
902 "ATMEL", 925 "ATMEL",
@@ -1393,6 +1416,13 @@ UNUSUAL_DEV( 0x0fce, 0xe030, 0x0000, 0x0000,
1393 US_SC_DEVICE, US_PR_DEVICE, NULL, 1416 US_SC_DEVICE, US_PR_DEVICE, NULL,
1394 US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ), 1417 US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ),
1395 1418
1419/* Reported by Ricardo Barberis <ricardo@dattatec.com> */
1420UNUSUAL_DEV( 0x0fce, 0xe092, 0x0000, 0x0000,
1421 "Sony Ericsson",
1422 "P1i",
1423 US_SC_DEVICE, US_PR_DEVICE, NULL,
1424 US_FL_IGNORE_RESIDUE ),
1425
1396/* Reported by Emmanuel Vasilakis <evas@forthnet.gr> */ 1426/* Reported by Emmanuel Vasilakis <evas@forthnet.gr> */
1397UNUSUAL_DEV( 0x0fce, 0xe031, 0x0000, 0x0000, 1427UNUSUAL_DEV( 0x0fce, 0xe031, 0x0000, 0x0000,
1398 "Sony Ericsson", 1428 "Sony Ericsson",
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 5db6b1e489b..a22ccf9485a 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -182,7 +182,7 @@ config FONT_8x8
182 182
183config FONT_8x16 183config FONT_8x16
184 bool "VGA 8x16 font" if FONTS 184 bool "VGA 8x16 font" if FONTS
185 depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE=y || STI_CONSOLE || USB_SISUSBVGA_CON 185 depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE || STI_CONSOLE || USB_SISUSBVGA_CON
186 default y if !SPARC && !FONTS 186 default y if !SPARC && !FONTS
187 help 187 help
188 This is the "high resolution" font for the VGA frame buffer (the one 188 This is the "high resolution" font for the VGA frame buffer (the one
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 16bc8d75e36..b21d0dec928 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -924,10 +924,10 @@ calc_pll_params(int index, int clock, u32 *retm1, u32 *retm2, u32 *retn, u32 *re
924 if (m > pll->max_m) 924 if (m > pll->max_m)
925 m = pll->max_m - 1; 925 m = pll->max_m - 1;
926 for (testm = m - 1; testm <= m; testm++) { 926 for (testm = m - 1; testm <= m; testm++) {
927 f_out = calc_vclock3(index, m, n, p); 927 f_out = calc_vclock3(index, testm, n, p);
928 if (splitm(index, testm, &m1, &m2)) { 928 if (splitm(index, testm, &m1, &m2)) {
929 WRN_MSG("cannot split m = %d\n", m); 929 WRN_MSG("cannot split m = %d\n",
930 n++; 930 testm);
931 continue; 931 continue;
932 } 932 }
933 if (clock > f_out) 933 if (clock > f_out)