diff options
author | David S. Miller <davem@davemloft.net> | 2013-04-22 20:32:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-22 20:32:51 -0400 |
commit | 6e0895c2ea326cc4bb11e8fa2f654628d5754c31 (patch) | |
tree | 7089303ac11a12edc43a8c4fa1b23974e10937ea /drivers | |
parent | 55fbbe46e9eb3cbe6c335503f5550855a1128dce (diff) | |
parent | 60d509fa6a9c4653a86ad830e4c4b30360b23f0e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/emulex/benet/be_main.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
include/net/scm.h
net/batman-adv/routing.c
net/ipv4/tcp_input.c
The e{uid,gid} --> {uid,gid} credentials fix conflicted with the
cleanup in net-next to now pass cred structs around.
The be2net driver had a bug fix in 'net' that overlapped with the VLAN
interface changes by Patrick McHardy in net-next.
An IGB conflict existed because in 'net' the build_skb() support was
reverted, and in 'net-next' there was a comment style fix within that
code.
Several batman-adv conflicts were resolved by making sure that all
calls to batadv_is_my_mac() are changed to have a new bat_priv first
argument.
Eric Dumazet's TS ECR fix in TCP in 'net' conflicted with the F-RTO
rewrite in 'net-next', mostly overlapping changes.
Thanks to Stephen Rothwell and Antonio Quartulli for help with several
of these merge resolutions.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
106 files changed, 1336 insertions, 1038 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 5ff173066127..6ae5e440436e 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -415,7 +415,6 @@ static int acpi_pci_root_add(struct acpi_device *device, | |||
415 | struct acpi_pci_root *root; | 415 | struct acpi_pci_root *root; |
416 | struct acpi_pci_driver *driver; | 416 | struct acpi_pci_driver *driver; |
417 | u32 flags, base_flags; | 417 | u32 flags, base_flags; |
418 | bool is_osc_granted = false; | ||
419 | 418 | ||
420 | root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); | 419 | root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); |
421 | if (!root) | 420 | if (!root) |
@@ -476,6 +475,30 @@ static int acpi_pci_root_add(struct acpi_device *device, | |||
476 | flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT; | 475 | flags = base_flags = OSC_PCI_SEGMENT_GROUPS_SUPPORT; |
477 | acpi_pci_osc_support(root, flags); | 476 | acpi_pci_osc_support(root, flags); |
478 | 477 | ||
478 | /* | ||
479 | * TBD: Need PCI interface for enumeration/configuration of roots. | ||
480 | */ | ||
481 | |||
482 | mutex_lock(&acpi_pci_root_lock); | ||
483 | list_add_tail(&root->node, &acpi_pci_roots); | ||
484 | mutex_unlock(&acpi_pci_root_lock); | ||
485 | |||
486 | /* | ||
487 | * Scan the Root Bridge | ||
488 | * -------------------- | ||
489 | * Must do this prior to any attempt to bind the root device, as the | ||
490 | * PCI namespace does not get created until this call is made (and | ||
491 | * thus the root bridge's pci_dev does not exist). | ||
492 | */ | ||
493 | root->bus = pci_acpi_scan_root(root); | ||
494 | if (!root->bus) { | ||
495 | printk(KERN_ERR PREFIX | ||
496 | "Bus %04x:%02x not present in PCI namespace\n", | ||
497 | root->segment, (unsigned int)root->secondary.start); | ||
498 | result = -ENODEV; | ||
499 | goto out_del_root; | ||
500 | } | ||
501 | |||
479 | /* Indicate support for various _OSC capabilities. */ | 502 | /* Indicate support for various _OSC capabilities. */ |
480 | if (pci_ext_cfg_avail()) | 503 | if (pci_ext_cfg_avail()) |
481 | flags |= OSC_EXT_PCI_CONFIG_SUPPORT; | 504 | flags |= OSC_EXT_PCI_CONFIG_SUPPORT; |
@@ -494,6 +517,7 @@ static int acpi_pci_root_add(struct acpi_device *device, | |||
494 | flags = base_flags; | 517 | flags = base_flags; |
495 | } | 518 | } |
496 | } | 519 | } |
520 | |||
497 | if (!pcie_ports_disabled | 521 | if (!pcie_ports_disabled |
498 | && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { | 522 | && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) { |
499 | flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL | 523 | flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL |
@@ -514,54 +538,28 @@ static int acpi_pci_root_add(struct acpi_device *device, | |||
514 | status = acpi_pci_osc_control_set(device->handle, &flags, | 538 | status = acpi_pci_osc_control_set(device->handle, &flags, |
515 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); | 539 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); |
516 | if (ACPI_SUCCESS(status)) { | 540 | if (ACPI_SUCCESS(status)) { |
517 | is_osc_granted = true; | ||
518 | dev_info(&device->dev, | 541 | dev_info(&device->dev, |
519 | "ACPI _OSC control (0x%02x) granted\n", flags); | 542 | "ACPI _OSC control (0x%02x) granted\n", flags); |
543 | if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) { | ||
544 | /* | ||
545 | * We have ASPM control, but the FADT indicates | ||
546 | * that it's unsupported. Clear it. | ||
547 | */ | ||
548 | pcie_clear_aspm(root->bus); | ||
549 | } | ||
520 | } else { | 550 | } else { |
521 | is_osc_granted = false; | ||
522 | dev_info(&device->dev, | 551 | dev_info(&device->dev, |
523 | "ACPI _OSC request failed (%s), " | 552 | "ACPI _OSC request failed (%s), " |
524 | "returned control mask: 0x%02x\n", | 553 | "returned control mask: 0x%02x\n", |
525 | acpi_format_exception(status), flags); | 554 | acpi_format_exception(status), flags); |
555 | pr_info("ACPI _OSC control for PCIe not granted, " | ||
556 | "disabling ASPM\n"); | ||
557 | pcie_no_aspm(); | ||
526 | } | 558 | } |
527 | } else { | 559 | } else { |
528 | dev_info(&device->dev, | 560 | dev_info(&device->dev, |
529 | "Unable to request _OSC control " | 561 | "Unable to request _OSC control " |
530 | "(_OSC support mask: 0x%02x)\n", flags); | 562 | "(_OSC support mask: 0x%02x)\n", flags); |
531 | } | ||
532 | |||
533 | /* | ||
534 | * TBD: Need PCI interface for enumeration/configuration of roots. | ||
535 | */ | ||
536 | |||
537 | mutex_lock(&acpi_pci_root_lock); | ||
538 | list_add_tail(&root->node, &acpi_pci_roots); | ||
539 | mutex_unlock(&acpi_pci_root_lock); | ||
540 | |||
541 | /* | ||
542 | * Scan the Root Bridge | ||
543 | * -------------------- | ||
544 | * Must do this prior to any attempt to bind the root device, as the | ||
545 | * PCI namespace does not get created until this call is made (and | ||
546 | * thus the root bridge's pci_dev does not exist). | ||
547 | */ | ||
548 | root->bus = pci_acpi_scan_root(root); | ||
549 | if (!root->bus) { | ||
550 | printk(KERN_ERR PREFIX | ||
551 | "Bus %04x:%02x not present in PCI namespace\n", | ||
552 | root->segment, (unsigned int)root->secondary.start); | ||
553 | result = -ENODEV; | ||
554 | goto out_del_root; | ||
555 | } | ||
556 | |||
557 | /* ASPM setting */ | ||
558 | if (is_osc_granted) { | ||
559 | if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) | ||
560 | pcie_clear_aspm(root->bus); | ||
561 | } else { | ||
562 | pr_info("ACPI _OSC control for PCIe not granted, " | ||
563 | "disabling ASPM\n"); | ||
564 | pcie_no_aspm(); | ||
565 | } | 563 | } |
566 | 564 | ||
567 | pci_acpi_add_bus_pm_notifier(device, root->bus); | 565 | pci_acpi_add_bus_pm_notifier(device, root->bus); |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index ffdd32d22602..2f48123d74c4 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -150,6 +150,7 @@ enum piix_controller_ids { | |||
150 | tolapai_sata, | 150 | tolapai_sata, |
151 | piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */ | 151 | piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */ |
152 | ich8_sata_snb, | 152 | ich8_sata_snb, |
153 | ich8_2port_sata_snb, | ||
153 | }; | 154 | }; |
154 | 155 | ||
155 | struct piix_map_db { | 156 | struct piix_map_db { |
@@ -304,7 +305,7 @@ static const struct pci_device_id piix_pci_tbl[] = { | |||
304 | /* SATA Controller IDE (Lynx Point) */ | 305 | /* SATA Controller IDE (Lynx Point) */ |
305 | { 0x8086, 0x8c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, | 306 | { 0x8086, 0x8c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, |
306 | /* SATA Controller IDE (Lynx Point) */ | 307 | /* SATA Controller IDE (Lynx Point) */ |
307 | { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, | 308 | { 0x8086, 0x8c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_snb }, |
308 | /* SATA Controller IDE (Lynx Point) */ | 309 | /* SATA Controller IDE (Lynx Point) */ |
309 | { 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, | 310 | { 0x8086, 0x8c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
310 | /* SATA Controller IDE (Lynx Point-LP) */ | 311 | /* SATA Controller IDE (Lynx Point-LP) */ |
@@ -439,6 +440,7 @@ static const struct piix_map_db *piix_map_db_table[] = { | |||
439 | [ich8m_apple_sata] = &ich8m_apple_map_db, | 440 | [ich8m_apple_sata] = &ich8m_apple_map_db, |
440 | [tolapai_sata] = &tolapai_map_db, | 441 | [tolapai_sata] = &tolapai_map_db, |
441 | [ich8_sata_snb] = &ich8_map_db, | 442 | [ich8_sata_snb] = &ich8_map_db, |
443 | [ich8_2port_sata_snb] = &ich8_2port_map_db, | ||
442 | }; | 444 | }; |
443 | 445 | ||
444 | static struct pci_bits piix_enable_bits[] = { | 446 | static struct pci_bits piix_enable_bits[] = { |
@@ -1242,6 +1244,16 @@ static struct ata_port_info piix_port_info[] = { | |||
1242 | .udma_mask = ATA_UDMA6, | 1244 | .udma_mask = ATA_UDMA6, |
1243 | .port_ops = &piix_sata_ops, | 1245 | .port_ops = &piix_sata_ops, |
1244 | }, | 1246 | }, |
1247 | |||
1248 | [ich8_2port_sata_snb] = | ||
1249 | { | ||
1250 | .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR | ||
1251 | | PIIX_FLAG_PIO16, | ||
1252 | .pio_mask = ATA_PIO4, | ||
1253 | .mwdma_mask = ATA_MWDMA2, | ||
1254 | .udma_mask = ATA_UDMA6, | ||
1255 | .port_ops = &piix_sata_ops, | ||
1256 | }, | ||
1245 | }; | 1257 | }; |
1246 | 1258 | ||
1247 | #define AHCI_PCI_BAR 5 | 1259 | #define AHCI_PCI_BAR 5 |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 497adea1f0d6..63c743baf920 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -2329,7 +2329,7 @@ int ata_dev_configure(struct ata_device *dev) | |||
2329 | * from SATA Settings page of Identify Device Data Log. | 2329 | * from SATA Settings page of Identify Device Data Log. |
2330 | */ | 2330 | */ |
2331 | if (ata_id_has_devslp(dev->id)) { | 2331 | if (ata_id_has_devslp(dev->id)) { |
2332 | u8 sata_setting[ATA_SECT_SIZE]; | 2332 | u8 *sata_setting = ap->sector_buf; |
2333 | int i, j; | 2333 | int i, j; |
2334 | 2334 | ||
2335 | dev->flags |= ATA_DFLAG_DEVSLP; | 2335 | dev->flags |= ATA_DFLAG_DEVSLP; |
@@ -2439,6 +2439,9 @@ int ata_dev_configure(struct ata_device *dev) | |||
2439 | dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, | 2439 | dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, |
2440 | dev->max_sectors); | 2440 | dev->max_sectors); |
2441 | 2441 | ||
2442 | if (dev->horkage & ATA_HORKAGE_MAX_SEC_LBA48) | ||
2443 | dev->max_sectors = ATA_MAX_SECTORS_LBA48; | ||
2444 | |||
2442 | if (ap->ops->dev_config) | 2445 | if (ap->ops->dev_config) |
2443 | ap->ops->dev_config(dev); | 2446 | ap->ops->dev_config(dev); |
2444 | 2447 | ||
@@ -4100,6 +4103,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
4100 | /* Weird ATAPI devices */ | 4103 | /* Weird ATAPI devices */ |
4101 | { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 }, | 4104 | { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 }, |
4102 | { "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA }, | 4105 | { "QUANTUM DAT DAT72-000", NULL, ATA_HORKAGE_ATAPI_MOD16_DMA }, |
4106 | { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, | ||
4103 | 4107 | ||
4104 | /* Devices we expect to fail diagnostics */ | 4108 | /* Devices we expect to fail diagnostics */ |
4105 | 4109 | ||
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 318b41358187..ff44787e5a45 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -532,8 +532,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) | |||
532 | struct scsi_sense_hdr sshdr; | 532 | struct scsi_sense_hdr sshdr; |
533 | scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, | 533 | scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, |
534 | &sshdr); | 534 | &sshdr); |
535 | if (sshdr.sense_key == 0 && | 535 | if (sshdr.sense_key == RECOVERED_ERROR && |
536 | sshdr.asc == 0 && sshdr.ascq == 0) | 536 | sshdr.asc == 0 && sshdr.ascq == 0x1d) |
537 | cmd_result &= ~SAM_STAT_CHECK_CONDITION; | 537 | cmd_result &= ~SAM_STAT_CHECK_CONDITION; |
538 | } | 538 | } |
539 | 539 | ||
@@ -618,8 +618,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) | |||
618 | struct scsi_sense_hdr sshdr; | 618 | struct scsi_sense_hdr sshdr; |
619 | scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, | 619 | scsi_normalize_sense(sensebuf, SCSI_SENSE_BUFFERSIZE, |
620 | &sshdr); | 620 | &sshdr); |
621 | if (sshdr.sense_key == 0 && | 621 | if (sshdr.sense_key == RECOVERED_ERROR && |
622 | sshdr.asc == 0 && sshdr.ascq == 0) | 622 | sshdr.asc == 0 && sshdr.ascq == 0x1d) |
623 | cmd_result &= ~SAM_STAT_CHECK_CONDITION; | 623 | cmd_result &= ~SAM_STAT_CHECK_CONDITION; |
624 | } | 624 | } |
625 | 625 | ||
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index d34adef1e63e..58cfb3232428 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c | |||
@@ -943,7 +943,8 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg, | |||
943 | unsigned int ival; | 943 | unsigned int ival; |
944 | int val_bytes = map->format.val_bytes; | 944 | int val_bytes = map->format.val_bytes; |
945 | for (i = 0; i < val_len / val_bytes; i++) { | 945 | for (i = 0; i < val_len / val_bytes; i++) { |
946 | ival = map->format.parse_val(val + (i * val_bytes)); | 946 | memcpy(map->work_buf, val + (i * val_bytes), val_bytes); |
947 | ival = map->format.parse_val(map->work_buf); | ||
947 | ret = regcache_write(map, reg + (i * map->reg_stride), | 948 | ret = regcache_write(map, reg + (i * map->reg_stride), |
948 | ival); | 949 | ival); |
949 | if (ret) { | 950 | if (ret) { |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 2c127f9c3f3b..dfe758382eaf 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
@@ -1051,29 +1051,12 @@ static int loop_clr_fd(struct loop_device *lo) | |||
1051 | lo->lo_state = Lo_unbound; | 1051 | lo->lo_state = Lo_unbound; |
1052 | /* This is safe: open() is still holding a reference. */ | 1052 | /* This is safe: open() is still holding a reference. */ |
1053 | module_put(THIS_MODULE); | 1053 | module_put(THIS_MODULE); |
1054 | if (lo->lo_flags & LO_FLAGS_PARTSCAN && bdev) | ||
1055 | ioctl_by_bdev(bdev, BLKRRPART, 0); | ||
1054 | lo->lo_flags = 0; | 1056 | lo->lo_flags = 0; |
1055 | if (!part_shift) | 1057 | if (!part_shift) |
1056 | lo->lo_disk->flags |= GENHD_FL_NO_PART_SCAN; | 1058 | lo->lo_disk->flags |= GENHD_FL_NO_PART_SCAN; |
1057 | mutex_unlock(&lo->lo_ctl_mutex); | 1059 | mutex_unlock(&lo->lo_ctl_mutex); |
1058 | |||
1059 | /* | ||
1060 | * Remove all partitions, since BLKRRPART won't remove user | ||
1061 | * added partitions when max_part=0 | ||
1062 | */ | ||
1063 | if (bdev) { | ||
1064 | struct disk_part_iter piter; | ||
1065 | struct hd_struct *part; | ||
1066 | |||
1067 | mutex_lock_nested(&bdev->bd_mutex, 1); | ||
1068 | invalidate_partition(bdev->bd_disk, 0); | ||
1069 | disk_part_iter_init(&piter, bdev->bd_disk, | ||
1070 | DISK_PITER_INCL_EMPTY); | ||
1071 | while ((part = disk_part_iter_next(&piter))) | ||
1072 | delete_partition(bdev->bd_disk, part->partno); | ||
1073 | disk_part_iter_exit(&piter); | ||
1074 | mutex_unlock(&bdev->bd_mutex); | ||
1075 | } | ||
1076 | |||
1077 | /* | 1060 | /* |
1078 | * Need not hold lo_ctl_mutex to fput backing file. | 1061 | * Need not hold lo_ctl_mutex to fput backing file. |
1079 | * Calling fput holding lo_ctl_mutex triggers a circular | 1062 | * Calling fput holding lo_ctl_mutex triggers a circular |
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 92250af84e7d..32c678028e53 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
@@ -81,12 +81,17 @@ | |||
81 | /* Device instance number, incremented each time a device is probed. */ | 81 | /* Device instance number, incremented each time a device is probed. */ |
82 | static int instance; | 82 | static int instance; |
83 | 83 | ||
84 | struct list_head online_list; | ||
85 | struct list_head removing_list; | ||
86 | spinlock_t dev_lock; | ||
87 | |||
84 | /* | 88 | /* |
85 | * Global variable used to hold the major block device number | 89 | * Global variable used to hold the major block device number |
86 | * allocated in mtip_init(). | 90 | * allocated in mtip_init(). |
87 | */ | 91 | */ |
88 | static int mtip_major; | 92 | static int mtip_major; |
89 | static struct dentry *dfs_parent; | 93 | static struct dentry *dfs_parent; |
94 | static struct dentry *dfs_device_status; | ||
90 | 95 | ||
91 | static u32 cpu_use[NR_CPUS]; | 96 | static u32 cpu_use[NR_CPUS]; |
92 | 97 | ||
@@ -243,40 +248,31 @@ static inline void release_slot(struct mtip_port *port, int tag) | |||
243 | /* | 248 | /* |
244 | * Reset the HBA (without sleeping) | 249 | * Reset the HBA (without sleeping) |
245 | * | 250 | * |
246 | * Just like hba_reset, except does not call sleep, so can be | ||
247 | * run from interrupt/tasklet context. | ||
248 | * | ||
249 | * @dd Pointer to the driver data structure. | 251 | * @dd Pointer to the driver data structure. |
250 | * | 252 | * |
251 | * return value | 253 | * return value |
252 | * 0 The reset was successful. | 254 | * 0 The reset was successful. |
253 | * -1 The HBA Reset bit did not clear. | 255 | * -1 The HBA Reset bit did not clear. |
254 | */ | 256 | */ |
255 | static int hba_reset_nosleep(struct driver_data *dd) | 257 | static int mtip_hba_reset(struct driver_data *dd) |
256 | { | 258 | { |
257 | unsigned long timeout; | 259 | unsigned long timeout; |
258 | 260 | ||
259 | /* Chip quirk: quiesce any chip function */ | ||
260 | mdelay(10); | ||
261 | |||
262 | /* Set the reset bit */ | 261 | /* Set the reset bit */ |
263 | writel(HOST_RESET, dd->mmio + HOST_CTL); | 262 | writel(HOST_RESET, dd->mmio + HOST_CTL); |
264 | 263 | ||
265 | /* Flush */ | 264 | /* Flush */ |
266 | readl(dd->mmio + HOST_CTL); | 265 | readl(dd->mmio + HOST_CTL); |
267 | 266 | ||
268 | /* | 267 | /* Spin for up to 2 seconds, waiting for reset acknowledgement */ |
269 | * Wait 10ms then spin for up to 1 second | 268 | timeout = jiffies + msecs_to_jiffies(2000); |
270 | * waiting for reset acknowledgement | 269 | do { |
271 | */ | 270 | mdelay(10); |
272 | timeout = jiffies + msecs_to_jiffies(1000); | 271 | if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)) |
273 | mdelay(10); | 272 | return -1; |
274 | while ((readl(dd->mmio + HOST_CTL) & HOST_RESET) | ||
275 | && time_before(jiffies, timeout)) | ||
276 | mdelay(1); | ||
277 | 273 | ||
278 | if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)) | 274 | } while ((readl(dd->mmio + HOST_CTL) & HOST_RESET) |
279 | return -1; | 275 | && time_before(jiffies, timeout)); |
280 | 276 | ||
281 | if (readl(dd->mmio + HOST_CTL) & HOST_RESET) | 277 | if (readl(dd->mmio + HOST_CTL) & HOST_RESET) |
282 | return -1; | 278 | return -1; |
@@ -481,7 +477,7 @@ static void mtip_restart_port(struct mtip_port *port) | |||
481 | dev_warn(&port->dd->pdev->dev, | 477 | dev_warn(&port->dd->pdev->dev, |
482 | "PxCMD.CR not clear, escalating reset\n"); | 478 | "PxCMD.CR not clear, escalating reset\n"); |
483 | 479 | ||
484 | if (hba_reset_nosleep(port->dd)) | 480 | if (mtip_hba_reset(port->dd)) |
485 | dev_err(&port->dd->pdev->dev, | 481 | dev_err(&port->dd->pdev->dev, |
486 | "HBA reset escalation failed.\n"); | 482 | "HBA reset escalation failed.\n"); |
487 | 483 | ||
@@ -527,6 +523,26 @@ static void mtip_restart_port(struct mtip_port *port) | |||
527 | 523 | ||
528 | } | 524 | } |
529 | 525 | ||
526 | static int mtip_device_reset(struct driver_data *dd) | ||
527 | { | ||
528 | int rv = 0; | ||
529 | |||
530 | if (mtip_check_surprise_removal(dd->pdev)) | ||
531 | return 0; | ||
532 | |||
533 | if (mtip_hba_reset(dd) < 0) | ||
534 | rv = -EFAULT; | ||
535 | |||
536 | mdelay(1); | ||
537 | mtip_init_port(dd->port); | ||
538 | mtip_start_port(dd->port); | ||
539 | |||
540 | /* Enable interrupts on the HBA. */ | ||
541 | writel(readl(dd->mmio + HOST_CTL) | HOST_IRQ_EN, | ||
542 | dd->mmio + HOST_CTL); | ||
543 | return rv; | ||
544 | } | ||
545 | |||
530 | /* | 546 | /* |
531 | * Helper function for tag logging | 547 | * Helper function for tag logging |
532 | */ | 548 | */ |
@@ -632,7 +648,7 @@ static void mtip_timeout_function(unsigned long int data) | |||
632 | if (cmdto_cnt) { | 648 | if (cmdto_cnt) { |
633 | print_tags(port->dd, "timed out", tagaccum, cmdto_cnt); | 649 | print_tags(port->dd, "timed out", tagaccum, cmdto_cnt); |
634 | if (!test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) { | 650 | if (!test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags)) { |
635 | mtip_restart_port(port); | 651 | mtip_device_reset(port->dd); |
636 | wake_up_interruptible(&port->svc_wait); | 652 | wake_up_interruptible(&port->svc_wait); |
637 | } | 653 | } |
638 | clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags); | 654 | clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags); |
@@ -1283,11 +1299,11 @@ static int mtip_exec_internal_command(struct mtip_port *port, | |||
1283 | int rv = 0, ready2go = 1; | 1299 | int rv = 0, ready2go = 1; |
1284 | struct mtip_cmd *int_cmd = &port->commands[MTIP_TAG_INTERNAL]; | 1300 | struct mtip_cmd *int_cmd = &port->commands[MTIP_TAG_INTERNAL]; |
1285 | unsigned long to; | 1301 | unsigned long to; |
1302 | struct driver_data *dd = port->dd; | ||
1286 | 1303 | ||
1287 | /* Make sure the buffer is 8 byte aligned. This is asic specific. */ | 1304 | /* Make sure the buffer is 8 byte aligned. This is asic specific. */ |
1288 | if (buffer & 0x00000007) { | 1305 | if (buffer & 0x00000007) { |
1289 | dev_err(&port->dd->pdev->dev, | 1306 | dev_err(&dd->pdev->dev, "SG buffer is not 8 byte aligned\n"); |
1290 | "SG buffer is not 8 byte aligned\n"); | ||
1291 | return -EFAULT; | 1307 | return -EFAULT; |
1292 | } | 1308 | } |
1293 | 1309 | ||
@@ -1300,23 +1316,21 @@ static int mtip_exec_internal_command(struct mtip_port *port, | |||
1300 | mdelay(100); | 1316 | mdelay(100); |
1301 | } while (time_before(jiffies, to)); | 1317 | } while (time_before(jiffies, to)); |
1302 | if (!ready2go) { | 1318 | if (!ready2go) { |
1303 | dev_warn(&port->dd->pdev->dev, | 1319 | dev_warn(&dd->pdev->dev, |
1304 | "Internal cmd active. new cmd [%02X]\n", fis->command); | 1320 | "Internal cmd active. new cmd [%02X]\n", fis->command); |
1305 | return -EBUSY; | 1321 | return -EBUSY; |
1306 | } | 1322 | } |
1307 | set_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags); | 1323 | set_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags); |
1308 | port->ic_pause_timer = 0; | 1324 | port->ic_pause_timer = 0; |
1309 | 1325 | ||
1310 | if (fis->command == ATA_CMD_SEC_ERASE_UNIT) | 1326 | clear_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags); |
1311 | clear_bit(MTIP_PF_SE_ACTIVE_BIT, &port->flags); | 1327 | clear_bit(MTIP_PF_DM_ACTIVE_BIT, &port->flags); |
1312 | else if (fis->command == ATA_CMD_DOWNLOAD_MICRO) | ||
1313 | clear_bit(MTIP_PF_DM_ACTIVE_BIT, &port->flags); | ||
1314 | 1328 | ||
1315 | if (atomic == GFP_KERNEL) { | 1329 | if (atomic == GFP_KERNEL) { |
1316 | if (fis->command != ATA_CMD_STANDBYNOW1) { | 1330 | if (fis->command != ATA_CMD_STANDBYNOW1) { |
1317 | /* wait for io to complete if non atomic */ | 1331 | /* wait for io to complete if non atomic */ |
1318 | if (mtip_quiesce_io(port, 5000) < 0) { | 1332 | if (mtip_quiesce_io(port, 5000) < 0) { |
1319 | dev_warn(&port->dd->pdev->dev, | 1333 | dev_warn(&dd->pdev->dev, |
1320 | "Failed to quiesce IO\n"); | 1334 | "Failed to quiesce IO\n"); |
1321 | release_slot(port, MTIP_TAG_INTERNAL); | 1335 | release_slot(port, MTIP_TAG_INTERNAL); |
1322 | clear_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags); | 1336 | clear_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags); |
@@ -1361,58 +1375,84 @@ static int mtip_exec_internal_command(struct mtip_port *port, | |||
1361 | /* Issue the command to the hardware */ | 1375 | /* Issue the command to the hardware */ |
1362 | mtip_issue_non_ncq_command(port, MTIP_TAG_INTERNAL); | 1376 | mtip_issue_non_ncq_command(port, MTIP_TAG_INTERNAL); |
1363 | 1377 | ||
1364 | /* Poll if atomic, wait_for_completion otherwise */ | ||
1365 | if (atomic == GFP_KERNEL) { | 1378 | if (atomic == GFP_KERNEL) { |
1366 | /* Wait for the command to complete or timeout. */ | 1379 | /* Wait for the command to complete or timeout. */ |
1367 | if (wait_for_completion_timeout( | 1380 | if (wait_for_completion_interruptible_timeout( |
1368 | &wait, | 1381 | &wait, |
1369 | msecs_to_jiffies(timeout)) == 0) { | 1382 | msecs_to_jiffies(timeout)) <= 0) { |
1370 | dev_err(&port->dd->pdev->dev, | 1383 | if (rv == -ERESTARTSYS) { /* interrupted */ |
1371 | "Internal command did not complete [%d] " | 1384 | dev_err(&dd->pdev->dev, |
1372 | "within timeout of %lu ms\n", | 1385 | "Internal command [%02X] was interrupted after %lu ms\n", |
1373 | atomic, timeout); | 1386 | fis->command, timeout); |
1374 | if (mtip_check_surprise_removal(port->dd->pdev) || | 1387 | rv = -EINTR; |
1388 | goto exec_ic_exit; | ||
1389 | } else if (rv == 0) /* timeout */ | ||
1390 | dev_err(&dd->pdev->dev, | ||
1391 | "Internal command did not complete [%02X] within timeout of %lu ms\n", | ||
1392 | fis->command, timeout); | ||
1393 | else | ||
1394 | dev_err(&dd->pdev->dev, | ||
1395 | "Internal command [%02X] wait returned code [%d] after %lu ms - unhandled\n", | ||
1396 | fis->command, rv, timeout); | ||
1397 | |||
1398 | if (mtip_check_surprise_removal(dd->pdev) || | ||
1375 | test_bit(MTIP_DDF_REMOVE_PENDING_BIT, | 1399 | test_bit(MTIP_DDF_REMOVE_PENDING_BIT, |
1376 | &port->dd->dd_flag)) { | 1400 | &dd->dd_flag)) { |
1401 | dev_err(&dd->pdev->dev, | ||
1402 | "Internal command [%02X] wait returned due to SR\n", | ||
1403 | fis->command); | ||
1377 | rv = -ENXIO; | 1404 | rv = -ENXIO; |
1378 | goto exec_ic_exit; | 1405 | goto exec_ic_exit; |
1379 | } | 1406 | } |
1407 | mtip_device_reset(dd); /* recover from timeout issue */ | ||
1380 | rv = -EAGAIN; | 1408 | rv = -EAGAIN; |
1409 | goto exec_ic_exit; | ||
1381 | } | 1410 | } |
1382 | } else { | 1411 | } else { |
1412 | u32 hba_stat, port_stat; | ||
1413 | |||
1383 | /* Spin for <timeout> checking if command still outstanding */ | 1414 | /* Spin for <timeout> checking if command still outstanding */ |
1384 | timeout = jiffies + msecs_to_jiffies(timeout); | 1415 | timeout = jiffies + msecs_to_jiffies(timeout); |
1385 | while ((readl(port->cmd_issue[MTIP_TAG_INTERNAL]) | 1416 | while ((readl(port->cmd_issue[MTIP_TAG_INTERNAL]) |
1386 | & (1 << MTIP_TAG_INTERNAL)) | 1417 | & (1 << MTIP_TAG_INTERNAL)) |
1387 | && time_before(jiffies, timeout)) { | 1418 | && time_before(jiffies, timeout)) { |
1388 | if (mtip_check_surprise_removal(port->dd->pdev)) { | 1419 | if (mtip_check_surprise_removal(dd->pdev)) { |
1389 | rv = -ENXIO; | 1420 | rv = -ENXIO; |
1390 | goto exec_ic_exit; | 1421 | goto exec_ic_exit; |
1391 | } | 1422 | } |
1392 | if ((fis->command != ATA_CMD_STANDBYNOW1) && | 1423 | if ((fis->command != ATA_CMD_STANDBYNOW1) && |
1393 | test_bit(MTIP_DDF_REMOVE_PENDING_BIT, | 1424 | test_bit(MTIP_DDF_REMOVE_PENDING_BIT, |
1394 | &port->dd->dd_flag)) { | 1425 | &dd->dd_flag)) { |
1395 | rv = -ENXIO; | 1426 | rv = -ENXIO; |
1396 | goto exec_ic_exit; | 1427 | goto exec_ic_exit; |
1397 | } | 1428 | } |
1398 | if (readl(port->mmio + PORT_IRQ_STAT) & PORT_IRQ_ERR) { | 1429 | port_stat = readl(port->mmio + PORT_IRQ_STAT); |
1399 | atomic_inc(&int_cmd->active); /* error */ | 1430 | if (!port_stat) |
1400 | break; | 1431 | continue; |
1432 | |||
1433 | if (port_stat & PORT_IRQ_ERR) { | ||
1434 | dev_err(&dd->pdev->dev, | ||
1435 | "Internal command [%02X] failed\n", | ||
1436 | fis->command); | ||
1437 | mtip_device_reset(dd); | ||
1438 | rv = -EIO; | ||
1439 | goto exec_ic_exit; | ||
1440 | } else { | ||
1441 | writel(port_stat, port->mmio + PORT_IRQ_STAT); | ||
1442 | hba_stat = readl(dd->mmio + HOST_IRQ_STAT); | ||
1443 | if (hba_stat) | ||
1444 | writel(hba_stat, | ||
1445 | dd->mmio + HOST_IRQ_STAT); | ||
1401 | } | 1446 | } |
1447 | break; | ||
1402 | } | 1448 | } |
1403 | } | 1449 | } |
1404 | 1450 | ||
1405 | if (atomic_read(&int_cmd->active) > 1) { | ||
1406 | dev_err(&port->dd->pdev->dev, | ||
1407 | "Internal command [%02X] failed\n", fis->command); | ||
1408 | rv = -EIO; | ||
1409 | } | ||
1410 | if (readl(port->cmd_issue[MTIP_TAG_INTERNAL]) | 1451 | if (readl(port->cmd_issue[MTIP_TAG_INTERNAL]) |
1411 | & (1 << MTIP_TAG_INTERNAL)) { | 1452 | & (1 << MTIP_TAG_INTERNAL)) { |
1412 | rv = -ENXIO; | 1453 | rv = -ENXIO; |
1413 | if (!test_bit(MTIP_DDF_REMOVE_PENDING_BIT, | 1454 | if (!test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)) { |
1414 | &port->dd->dd_flag)) { | 1455 | mtip_device_reset(dd); |
1415 | mtip_restart_port(port); | ||
1416 | rv = -EAGAIN; | 1456 | rv = -EAGAIN; |
1417 | } | 1457 | } |
1418 | } | 1458 | } |
@@ -1724,7 +1764,8 @@ static int mtip_get_smart_attr(struct mtip_port *port, unsigned int id, | |||
1724 | * -EINVAL Invalid parameters passed in, trim not supported | 1764 | * -EINVAL Invalid parameters passed in, trim not supported |
1725 | * -EIO Error submitting trim request to hw | 1765 | * -EIO Error submitting trim request to hw |
1726 | */ | 1766 | */ |
1727 | static int mtip_send_trim(struct driver_data *dd, unsigned int lba, unsigned int len) | 1767 | static int mtip_send_trim(struct driver_data *dd, unsigned int lba, |
1768 | unsigned int len) | ||
1728 | { | 1769 | { |
1729 | int i, rv = 0; | 1770 | int i, rv = 0; |
1730 | u64 tlba, tlen, sect_left; | 1771 | u64 tlba, tlen, sect_left; |
@@ -1811,45 +1852,6 @@ static bool mtip_hw_get_capacity(struct driver_data *dd, sector_t *sectors) | |||
1811 | } | 1852 | } |
1812 | 1853 | ||
1813 | /* | 1854 | /* |
1814 | * Reset the HBA. | ||
1815 | * | ||
1816 | * Resets the HBA by setting the HBA Reset bit in the Global | ||
1817 | * HBA Control register. After setting the HBA Reset bit the | ||
1818 | * function waits for 1 second before reading the HBA Reset | ||
1819 | * bit to make sure it has cleared. If HBA Reset is not clear | ||
1820 | * an error is returned. Cannot be used in non-blockable | ||
1821 | * context. | ||
1822 | * | ||
1823 | * @dd Pointer to the driver data structure. | ||
1824 | * | ||
1825 | * return value | ||
1826 | * 0 The reset was successful. | ||
1827 | * -1 The HBA Reset bit did not clear. | ||
1828 | */ | ||
1829 | static int mtip_hba_reset(struct driver_data *dd) | ||
1830 | { | ||
1831 | mtip_deinit_port(dd->port); | ||
1832 | |||
1833 | /* Set the reset bit */ | ||
1834 | writel(HOST_RESET, dd->mmio + HOST_CTL); | ||
1835 | |||
1836 | /* Flush */ | ||
1837 | readl(dd->mmio + HOST_CTL); | ||
1838 | |||
1839 | /* Wait for reset to clear */ | ||
1840 | ssleep(1); | ||
1841 | |||
1842 | /* Check the bit has cleared */ | ||
1843 | if (readl(dd->mmio + HOST_CTL) & HOST_RESET) { | ||
1844 | dev_err(&dd->pdev->dev, | ||
1845 | "Reset bit did not clear.\n"); | ||
1846 | return -1; | ||
1847 | } | ||
1848 | |||
1849 | return 0; | ||
1850 | } | ||
1851 | |||
1852 | /* | ||
1853 | * Display the identify command data. | 1855 | * Display the identify command data. |
1854 | * | 1856 | * |
1855 | * @port Pointer to the port data structure. | 1857 | * @port Pointer to the port data structure. |
@@ -2710,6 +2712,100 @@ static ssize_t mtip_hw_show_status(struct device *dev, | |||
2710 | 2712 | ||
2711 | static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL); | 2713 | static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL); |
2712 | 2714 | ||
2715 | /* debugsfs entries */ | ||
2716 | |||
2717 | static ssize_t show_device_status(struct device_driver *drv, char *buf) | ||
2718 | { | ||
2719 | int size = 0; | ||
2720 | struct driver_data *dd, *tmp; | ||
2721 | unsigned long flags; | ||
2722 | char id_buf[42]; | ||
2723 | u16 status = 0; | ||
2724 | |||
2725 | spin_lock_irqsave(&dev_lock, flags); | ||
2726 | size += sprintf(&buf[size], "Devices Present:\n"); | ||
2727 | list_for_each_entry_safe(dd, tmp, &online_list, online_list) { | ||
2728 | if (dd->pdev) { | ||
2729 | if (dd->port && | ||
2730 | dd->port->identify && | ||
2731 | dd->port->identify_valid) { | ||
2732 | strlcpy(id_buf, | ||
2733 | (char *) (dd->port->identify + 10), 21); | ||
2734 | status = *(dd->port->identify + 141); | ||
2735 | } else { | ||
2736 | memset(id_buf, 0, 42); | ||
2737 | status = 0; | ||
2738 | } | ||
2739 | |||
2740 | if (dd->port && | ||
2741 | test_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags)) { | ||
2742 | size += sprintf(&buf[size], | ||
2743 | " device %s %s (ftl rebuild %d %%)\n", | ||
2744 | dev_name(&dd->pdev->dev), | ||
2745 | id_buf, | ||
2746 | status); | ||
2747 | } else { | ||
2748 | size += sprintf(&buf[size], | ||
2749 | " device %s %s\n", | ||
2750 | dev_name(&dd->pdev->dev), | ||
2751 | id_buf); | ||
2752 | } | ||
2753 | } | ||
2754 | } | ||
2755 | |||
2756 | size += sprintf(&buf[size], "Devices Being Removed:\n"); | ||
2757 | list_for_each_entry_safe(dd, tmp, &removing_list, remove_list) { | ||
2758 | if (dd->pdev) { | ||
2759 | if (dd->port && | ||
2760 | dd->port->identify && | ||
2761 | dd->port->identify_valid) { | ||
2762 | strlcpy(id_buf, | ||
2763 | (char *) (dd->port->identify+10), 21); | ||
2764 | status = *(dd->port->identify + 141); | ||
2765 | } else { | ||
2766 | memset(id_buf, 0, 42); | ||
2767 | status = 0; | ||
2768 | } | ||
2769 | |||
2770 | if (dd->port && | ||
2771 | test_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags)) { | ||
2772 | size += sprintf(&buf[size], | ||
2773 | " device %s %s (ftl rebuild %d %%)\n", | ||
2774 | dev_name(&dd->pdev->dev), | ||
2775 | id_buf, | ||
2776 | status); | ||
2777 | } else { | ||
2778 | size += sprintf(&buf[size], | ||
2779 | " device %s %s\n", | ||
2780 | dev_name(&dd->pdev->dev), | ||
2781 | id_buf); | ||
2782 | } | ||
2783 | } | ||
2784 | } | ||
2785 | spin_unlock_irqrestore(&dev_lock, flags); | ||
2786 | |||
2787 | return size; | ||
2788 | } | ||
2789 | |||
2790 | static ssize_t mtip_hw_read_device_status(struct file *f, char __user *ubuf, | ||
2791 | size_t len, loff_t *offset) | ||
2792 | { | ||
2793 | int size = *offset; | ||
2794 | char buf[MTIP_DFS_MAX_BUF_SIZE]; | ||
2795 | |||
2796 | if (!len || *offset) | ||
2797 | return 0; | ||
2798 | |||
2799 | size += show_device_status(NULL, buf); | ||
2800 | |||
2801 | *offset = size <= len ? size : len; | ||
2802 | size = copy_to_user(ubuf, buf, *offset); | ||
2803 | if (size) | ||
2804 | return -EFAULT; | ||
2805 | |||
2806 | return *offset; | ||
2807 | } | ||
2808 | |||
2713 | static ssize_t mtip_hw_read_registers(struct file *f, char __user *ubuf, | 2809 | static ssize_t mtip_hw_read_registers(struct file *f, char __user *ubuf, |
2714 | size_t len, loff_t *offset) | 2810 | size_t len, loff_t *offset) |
2715 | { | 2811 | { |
@@ -2804,6 +2900,13 @@ static ssize_t mtip_hw_read_flags(struct file *f, char __user *ubuf, | |||
2804 | return *offset; | 2900 | return *offset; |
2805 | } | 2901 | } |
2806 | 2902 | ||
2903 | static const struct file_operations mtip_device_status_fops = { | ||
2904 | .owner = THIS_MODULE, | ||
2905 | .open = simple_open, | ||
2906 | .read = mtip_hw_read_device_status, | ||
2907 | .llseek = no_llseek, | ||
2908 | }; | ||
2909 | |||
2807 | static const struct file_operations mtip_regs_fops = { | 2910 | static const struct file_operations mtip_regs_fops = { |
2808 | .owner = THIS_MODULE, | 2911 | .owner = THIS_MODULE, |
2809 | .open = simple_open, | 2912 | .open = simple_open, |
@@ -4161,6 +4264,7 @@ static int mtip_pci_probe(struct pci_dev *pdev, | |||
4161 | const struct cpumask *node_mask; | 4264 | const struct cpumask *node_mask; |
4162 | int cpu, i = 0, j = 0; | 4265 | int cpu, i = 0, j = 0; |
4163 | int my_node = NUMA_NO_NODE; | 4266 | int my_node = NUMA_NO_NODE; |
4267 | unsigned long flags; | ||
4164 | 4268 | ||
4165 | /* Allocate memory for this devices private data. */ | 4269 | /* Allocate memory for this devices private data. */ |
4166 | my_node = pcibus_to_node(pdev->bus); | 4270 | my_node = pcibus_to_node(pdev->bus); |
@@ -4218,6 +4322,9 @@ static int mtip_pci_probe(struct pci_dev *pdev, | |||
4218 | dd->pdev = pdev; | 4322 | dd->pdev = pdev; |
4219 | dd->numa_node = my_node; | 4323 | dd->numa_node = my_node; |
4220 | 4324 | ||
4325 | INIT_LIST_HEAD(&dd->online_list); | ||
4326 | INIT_LIST_HEAD(&dd->remove_list); | ||
4327 | |||
4221 | memset(dd->workq_name, 0, 32); | 4328 | memset(dd->workq_name, 0, 32); |
4222 | snprintf(dd->workq_name, 31, "mtipq%d", dd->instance); | 4329 | snprintf(dd->workq_name, 31, "mtipq%d", dd->instance); |
4223 | 4330 | ||
@@ -4305,6 +4412,14 @@ static int mtip_pci_probe(struct pci_dev *pdev, | |||
4305 | instance++; | 4412 | instance++; |
4306 | if (rv != MTIP_FTL_REBUILD_MAGIC) | 4413 | if (rv != MTIP_FTL_REBUILD_MAGIC) |
4307 | set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag); | 4414 | set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag); |
4415 | else | ||
4416 | rv = 0; /* device in rebuild state, return 0 from probe */ | ||
4417 | |||
4418 | /* Add to online list even if in ftl rebuild */ | ||
4419 | spin_lock_irqsave(&dev_lock, flags); | ||
4420 | list_add(&dd->online_list, &online_list); | ||
4421 | spin_unlock_irqrestore(&dev_lock, flags); | ||
4422 | |||
4308 | goto done; | 4423 | goto done; |
4309 | 4424 | ||
4310 | block_initialize_err: | 4425 | block_initialize_err: |
@@ -4338,9 +4453,15 @@ static void mtip_pci_remove(struct pci_dev *pdev) | |||
4338 | { | 4453 | { |
4339 | struct driver_data *dd = pci_get_drvdata(pdev); | 4454 | struct driver_data *dd = pci_get_drvdata(pdev); |
4340 | int counter = 0; | 4455 | int counter = 0; |
4456 | unsigned long flags; | ||
4341 | 4457 | ||
4342 | set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag); | 4458 | set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag); |
4343 | 4459 | ||
4460 | spin_lock_irqsave(&dev_lock, flags); | ||
4461 | list_del_init(&dd->online_list); | ||
4462 | list_add(&dd->remove_list, &removing_list); | ||
4463 | spin_unlock_irqrestore(&dev_lock, flags); | ||
4464 | |||
4344 | if (mtip_check_surprise_removal(pdev)) { | 4465 | if (mtip_check_surprise_removal(pdev)) { |
4345 | while (!test_bit(MTIP_DDF_CLEANUP_BIT, &dd->dd_flag)) { | 4466 | while (!test_bit(MTIP_DDF_CLEANUP_BIT, &dd->dd_flag)) { |
4346 | counter++; | 4467 | counter++; |
@@ -4366,6 +4487,10 @@ static void mtip_pci_remove(struct pci_dev *pdev) | |||
4366 | 4487 | ||
4367 | pci_disable_msi(pdev); | 4488 | pci_disable_msi(pdev); |
4368 | 4489 | ||
4490 | spin_lock_irqsave(&dev_lock, flags); | ||
4491 | list_del_init(&dd->remove_list); | ||
4492 | spin_unlock_irqrestore(&dev_lock, flags); | ||
4493 | |||
4369 | kfree(dd); | 4494 | kfree(dd); |
4370 | pcim_iounmap_regions(pdev, 1 << MTIP_ABAR); | 4495 | pcim_iounmap_regions(pdev, 1 << MTIP_ABAR); |
4371 | } | 4496 | } |
@@ -4513,6 +4638,11 @@ static int __init mtip_init(void) | |||
4513 | 4638 | ||
4514 | pr_info(MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n"); | 4639 | pr_info(MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n"); |
4515 | 4640 | ||
4641 | spin_lock_init(&dev_lock); | ||
4642 | |||
4643 | INIT_LIST_HEAD(&online_list); | ||
4644 | INIT_LIST_HEAD(&removing_list); | ||
4645 | |||
4516 | /* Allocate a major block device number to use with this driver. */ | 4646 | /* Allocate a major block device number to use with this driver. */ |
4517 | error = register_blkdev(0, MTIP_DRV_NAME); | 4647 | error = register_blkdev(0, MTIP_DRV_NAME); |
4518 | if (error <= 0) { | 4648 | if (error <= 0) { |
@@ -4522,11 +4652,18 @@ static int __init mtip_init(void) | |||
4522 | } | 4652 | } |
4523 | mtip_major = error; | 4653 | mtip_major = error; |
4524 | 4654 | ||
4525 | if (!dfs_parent) { | 4655 | dfs_parent = debugfs_create_dir("rssd", NULL); |
4526 | dfs_parent = debugfs_create_dir("rssd", NULL); | 4656 | if (IS_ERR_OR_NULL(dfs_parent)) { |
4527 | if (IS_ERR_OR_NULL(dfs_parent)) { | 4657 | pr_warn("Error creating debugfs parent\n"); |
4528 | pr_warn("Error creating debugfs parent\n"); | 4658 | dfs_parent = NULL; |
4529 | dfs_parent = NULL; | 4659 | } |
4660 | if (dfs_parent) { | ||
4661 | dfs_device_status = debugfs_create_file("device_status", | ||
4662 | S_IRUGO, dfs_parent, NULL, | ||
4663 | &mtip_device_status_fops); | ||
4664 | if (IS_ERR_OR_NULL(dfs_device_status)) { | ||
4665 | pr_err("Error creating device_status node\n"); | ||
4666 | dfs_device_status = NULL; | ||
4530 | } | 4667 | } |
4531 | } | 4668 | } |
4532 | 4669 | ||
diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h index 3bffff5f670c..8e8334c9dd0f 100644 --- a/drivers/block/mtip32xx/mtip32xx.h +++ b/drivers/block/mtip32xx/mtip32xx.h | |||
@@ -129,9 +129,9 @@ enum { | |||
129 | MTIP_PF_EH_ACTIVE_BIT = 1, /* error handling */ | 129 | MTIP_PF_EH_ACTIVE_BIT = 1, /* error handling */ |
130 | MTIP_PF_SE_ACTIVE_BIT = 2, /* secure erase */ | 130 | MTIP_PF_SE_ACTIVE_BIT = 2, /* secure erase */ |
131 | MTIP_PF_DM_ACTIVE_BIT = 3, /* download microcde */ | 131 | MTIP_PF_DM_ACTIVE_BIT = 3, /* download microcde */ |
132 | MTIP_PF_PAUSE_IO = ((1 << MTIP_PF_IC_ACTIVE_BIT) | \ | 132 | MTIP_PF_PAUSE_IO = ((1 << MTIP_PF_IC_ACTIVE_BIT) | |
133 | (1 << MTIP_PF_EH_ACTIVE_BIT) | \ | 133 | (1 << MTIP_PF_EH_ACTIVE_BIT) | |
134 | (1 << MTIP_PF_SE_ACTIVE_BIT) | \ | 134 | (1 << MTIP_PF_SE_ACTIVE_BIT) | |
135 | (1 << MTIP_PF_DM_ACTIVE_BIT)), | 135 | (1 << MTIP_PF_DM_ACTIVE_BIT)), |
136 | 136 | ||
137 | MTIP_PF_SVC_THD_ACTIVE_BIT = 4, | 137 | MTIP_PF_SVC_THD_ACTIVE_BIT = 4, |
@@ -144,9 +144,9 @@ enum { | |||
144 | MTIP_DDF_REMOVE_PENDING_BIT = 1, | 144 | MTIP_DDF_REMOVE_PENDING_BIT = 1, |
145 | MTIP_DDF_OVER_TEMP_BIT = 2, | 145 | MTIP_DDF_OVER_TEMP_BIT = 2, |
146 | MTIP_DDF_WRITE_PROTECT_BIT = 3, | 146 | MTIP_DDF_WRITE_PROTECT_BIT = 3, |
147 | MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) | \ | 147 | MTIP_DDF_STOP_IO = ((1 << MTIP_DDF_REMOVE_PENDING_BIT) | |
148 | (1 << MTIP_DDF_SEC_LOCK_BIT) | \ | 148 | (1 << MTIP_DDF_SEC_LOCK_BIT) | |
149 | (1 << MTIP_DDF_OVER_TEMP_BIT) | \ | 149 | (1 << MTIP_DDF_OVER_TEMP_BIT) | |
150 | (1 << MTIP_DDF_WRITE_PROTECT_BIT)), | 150 | (1 << MTIP_DDF_WRITE_PROTECT_BIT)), |
151 | 151 | ||
152 | MTIP_DDF_CLEANUP_BIT = 5, | 152 | MTIP_DDF_CLEANUP_BIT = 5, |
@@ -180,7 +180,7 @@ struct mtip_work { | |||
180 | 180 | ||
181 | #define MTIP_TRIM_TIMEOUT_MS 240000 | 181 | #define MTIP_TRIM_TIMEOUT_MS 240000 |
182 | #define MTIP_MAX_TRIM_ENTRIES 8 | 182 | #define MTIP_MAX_TRIM_ENTRIES 8 |
183 | #define MTIP_MAX_TRIM_ENTRY_LEN 0xfff8 | 183 | #define MTIP_MAX_TRIM_ENTRY_LEN 0xfff8 |
184 | 184 | ||
185 | struct mtip_trim_entry { | 185 | struct mtip_trim_entry { |
186 | u32 lba; /* starting lba of region */ | 186 | u32 lba; /* starting lba of region */ |
@@ -501,6 +501,10 @@ struct driver_data { | |||
501 | atomic_t irq_workers_active; | 501 | atomic_t irq_workers_active; |
502 | 502 | ||
503 | int isr_binding; | 503 | int isr_binding; |
504 | |||
505 | struct list_head online_list; /* linkage for online list */ | ||
506 | |||
507 | struct list_head remove_list; /* linkage for removing list */ | ||
504 | }; | 508 | }; |
505 | 509 | ||
506 | #endif | 510 | #endif |
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index f556f8a8b3f9..b7b7a88d9f68 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -1742,9 +1742,10 @@ static int rbd_img_request_submit(struct rbd_img_request *img_request) | |||
1742 | struct rbd_device *rbd_dev = img_request->rbd_dev; | 1742 | struct rbd_device *rbd_dev = img_request->rbd_dev; |
1743 | struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc; | 1743 | struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc; |
1744 | struct rbd_obj_request *obj_request; | 1744 | struct rbd_obj_request *obj_request; |
1745 | struct rbd_obj_request *next_obj_request; | ||
1745 | 1746 | ||
1746 | dout("%s: img %p\n", __func__, img_request); | 1747 | dout("%s: img %p\n", __func__, img_request); |
1747 | for_each_obj_request(img_request, obj_request) { | 1748 | for_each_obj_request_safe(img_request, obj_request, next_obj_request) { |
1748 | int ret; | 1749 | int ret; |
1749 | 1750 | ||
1750 | obj_request->callback = rbd_img_obj_callback; | 1751 | obj_request->callback = rbd_img_obj_callback; |
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index e3f9a99b8522..d784650d14f0 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -373,26 +373,14 @@ static int hpet_mmap(struct file *file, struct vm_area_struct *vma) | |||
373 | struct hpet_dev *devp; | 373 | struct hpet_dev *devp; |
374 | unsigned long addr; | 374 | unsigned long addr; |
375 | 375 | ||
376 | if (((vma->vm_end - vma->vm_start) != PAGE_SIZE) || vma->vm_pgoff) | ||
377 | return -EINVAL; | ||
378 | |||
379 | devp = file->private_data; | 376 | devp = file->private_data; |
380 | addr = devp->hd_hpets->hp_hpet_phys; | 377 | addr = devp->hd_hpets->hp_hpet_phys; |
381 | 378 | ||
382 | if (addr & (PAGE_SIZE - 1)) | 379 | if (addr & (PAGE_SIZE - 1)) |
383 | return -ENOSYS; | 380 | return -ENOSYS; |
384 | 381 | ||
385 | vma->vm_flags |= VM_IO; | ||
386 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 382 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
387 | 383 | return vm_iomap_memory(vma, addr, PAGE_SIZE); | |
388 | if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT, | ||
389 | PAGE_SIZE, vma->vm_page_prot)) { | ||
390 | printk(KERN_ERR "%s: io_remap_pfn_range failed\n", | ||
391 | __func__); | ||
392 | return -EAGAIN; | ||
393 | } | ||
394 | |||
395 | return 0; | ||
396 | #else | 384 | #else |
397 | return -ENOSYS; | 385 | return -ENOSYS; |
398 | #endif | 386 | #endif |
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index ad72922919ed..6133ef5cf671 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -502,7 +502,6 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu) | |||
502 | 502 | ||
503 | sample_time = cpu->pstate_policy->sample_rate_ms; | 503 | sample_time = cpu->pstate_policy->sample_rate_ms; |
504 | delay = msecs_to_jiffies(sample_time); | 504 | delay = msecs_to_jiffies(sample_time); |
505 | delay -= jiffies % delay; | ||
506 | mod_timer_pinned(&cpu->timer, jiffies + delay); | 505 | mod_timer_pinned(&cpu->timer, jiffies + delay); |
507 | } | 506 | } |
508 | 507 | ||
diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index 8bc5fef07e7a..22c9063e0120 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c | |||
@@ -1750,7 +1750,7 @@ static struct platform_driver cryp_driver = { | |||
1750 | .shutdown = ux500_cryp_shutdown, | 1750 | .shutdown = ux500_cryp_shutdown, |
1751 | .driver = { | 1751 | .driver = { |
1752 | .owner = THIS_MODULE, | 1752 | .owner = THIS_MODULE, |
1753 | .name = "cryp1" | 1753 | .name = "cryp1", |
1754 | .pm = &ux500_cryp_pm, | 1754 | .pm = &ux500_cryp_pm, |
1755 | } | 1755 | } |
1756 | }; | 1756 | }; |
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 6e13f262139a..88cfc61329d2 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
@@ -310,8 +310,6 @@ static void atc_complete_all(struct at_dma_chan *atchan) | |||
310 | 310 | ||
311 | dev_vdbg(chan2dev(&atchan->chan_common), "complete all\n"); | 311 | dev_vdbg(chan2dev(&atchan->chan_common), "complete all\n"); |
312 | 312 | ||
313 | BUG_ON(atc_chan_is_enabled(atchan)); | ||
314 | |||
315 | /* | 313 | /* |
316 | * Submit queued descriptors ASAP, i.e. before we go through | 314 | * Submit queued descriptors ASAP, i.e. before we go through |
317 | * the completed ones. | 315 | * the completed ones. |
@@ -368,6 +366,9 @@ static void atc_advance_work(struct at_dma_chan *atchan) | |||
368 | { | 366 | { |
369 | dev_vdbg(chan2dev(&atchan->chan_common), "advance_work\n"); | 367 | dev_vdbg(chan2dev(&atchan->chan_common), "advance_work\n"); |
370 | 368 | ||
369 | if (atc_chan_is_enabled(atchan)) | ||
370 | return; | ||
371 | |||
371 | if (list_empty(&atchan->active_list) || | 372 | if (list_empty(&atchan->active_list) || |
372 | list_is_singular(&atchan->active_list)) { | 373 | list_is_singular(&atchan->active_list)) { |
373 | atc_complete_all(atchan); | 374 | atc_complete_all(atchan); |
@@ -1078,9 +1079,7 @@ static void atc_issue_pending(struct dma_chan *chan) | |||
1078 | return; | 1079 | return; |
1079 | 1080 | ||
1080 | spin_lock_irqsave(&atchan->lock, flags); | 1081 | spin_lock_irqsave(&atchan->lock, flags); |
1081 | if (!atc_chan_is_enabled(atchan)) { | 1082 | atc_advance_work(atchan); |
1082 | atc_advance_work(atchan); | ||
1083 | } | ||
1084 | spin_unlock_irqrestore(&atchan->lock, flags); | 1083 | spin_unlock_irqrestore(&atchan->lock, flags); |
1085 | } | 1084 | } |
1086 | 1085 | ||
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index c4b4fd2acc42..08b43bf37158 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c | |||
@@ -276,12 +276,20 @@ static void omap_dma_issue_pending(struct dma_chan *chan) | |||
276 | 276 | ||
277 | spin_lock_irqsave(&c->vc.lock, flags); | 277 | spin_lock_irqsave(&c->vc.lock, flags); |
278 | if (vchan_issue_pending(&c->vc) && !c->desc) { | 278 | if (vchan_issue_pending(&c->vc) && !c->desc) { |
279 | struct omap_dmadev *d = to_omap_dma_dev(chan->device); | 279 | /* |
280 | spin_lock(&d->lock); | 280 | * c->cyclic is used only by audio and in this case the DMA need |
281 | if (list_empty(&c->node)) | 281 | * to be started without delay. |
282 | list_add_tail(&c->node, &d->pending); | 282 | */ |
283 | spin_unlock(&d->lock); | 283 | if (!c->cyclic) { |
284 | tasklet_schedule(&d->task); | 284 | struct omap_dmadev *d = to_omap_dma_dev(chan->device); |
285 | spin_lock(&d->lock); | ||
286 | if (list_empty(&c->node)) | ||
287 | list_add_tail(&c->node, &d->pending); | ||
288 | spin_unlock(&d->lock); | ||
289 | tasklet_schedule(&d->task); | ||
290 | } else { | ||
291 | omap_dma_start_desc(c); | ||
292 | } | ||
285 | } | 293 | } |
286 | spin_unlock_irqrestore(&c->vc.lock, flags); | 294 | spin_unlock_irqrestore(&c->vc.lock, flags); |
287 | } | 295 | } |
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 718153122759..5dbc5946c4c3 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
@@ -2882,7 +2882,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
2882 | { | 2882 | { |
2883 | struct dma_pl330_platdata *pdat; | 2883 | struct dma_pl330_platdata *pdat; |
2884 | struct dma_pl330_dmac *pdmac; | 2884 | struct dma_pl330_dmac *pdmac; |
2885 | struct dma_pl330_chan *pch; | 2885 | struct dma_pl330_chan *pch, *_p; |
2886 | struct pl330_info *pi; | 2886 | struct pl330_info *pi; |
2887 | struct dma_device *pd; | 2887 | struct dma_device *pd; |
2888 | struct resource *res; | 2888 | struct resource *res; |
@@ -2984,7 +2984,16 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
2984 | ret = dma_async_device_register(pd); | 2984 | ret = dma_async_device_register(pd); |
2985 | if (ret) { | 2985 | if (ret) { |
2986 | dev_err(&adev->dev, "unable to register DMAC\n"); | 2986 | dev_err(&adev->dev, "unable to register DMAC\n"); |
2987 | goto probe_err2; | 2987 | goto probe_err3; |
2988 | } | ||
2989 | |||
2990 | if (adev->dev.of_node) { | ||
2991 | ret = of_dma_controller_register(adev->dev.of_node, | ||
2992 | of_dma_pl330_xlate, pdmac); | ||
2993 | if (ret) { | ||
2994 | dev_err(&adev->dev, | ||
2995 | "unable to register DMA to the generic DT DMA helpers\n"); | ||
2996 | } | ||
2988 | } | 2997 | } |
2989 | 2998 | ||
2990 | dev_info(&adev->dev, | 2999 | dev_info(&adev->dev, |
@@ -2995,16 +3004,21 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) | |||
2995 | pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan, | 3004 | pi->pcfg.data_bus_width / 8, pi->pcfg.num_chan, |
2996 | pi->pcfg.num_peri, pi->pcfg.num_events); | 3005 | pi->pcfg.num_peri, pi->pcfg.num_events); |
2997 | 3006 | ||
2998 | ret = of_dma_controller_register(adev->dev.of_node, | ||
2999 | of_dma_pl330_xlate, pdmac); | ||
3000 | if (ret) { | ||
3001 | dev_err(&adev->dev, | ||
3002 | "unable to register DMA to the generic DT DMA helpers\n"); | ||
3003 | goto probe_err2; | ||
3004 | } | ||
3005 | |||
3006 | return 0; | 3007 | return 0; |
3008 | probe_err3: | ||
3009 | amba_set_drvdata(adev, NULL); | ||
3007 | 3010 | ||
3011 | /* Idle the DMAC */ | ||
3012 | list_for_each_entry_safe(pch, _p, &pdmac->ddma.channels, | ||
3013 | chan.device_node) { | ||
3014 | |||
3015 | /* Remove the channel */ | ||
3016 | list_del(&pch->chan.device_node); | ||
3017 | |||
3018 | /* Flush the channel */ | ||
3019 | pl330_control(&pch->chan, DMA_TERMINATE_ALL, 0); | ||
3020 | pl330_free_chan_resources(&pch->chan); | ||
3021 | } | ||
3008 | probe_err2: | 3022 | probe_err2: |
3009 | pl330_del(pi); | 3023 | pl330_del(pi); |
3010 | probe_err1: | 3024 | probe_err1: |
@@ -3023,8 +3037,10 @@ static int pl330_remove(struct amba_device *adev) | |||
3023 | if (!pdmac) | 3037 | if (!pdmac) |
3024 | return 0; | 3038 | return 0; |
3025 | 3039 | ||
3026 | of_dma_controller_free(adev->dev.of_node); | 3040 | if (adev->dev.of_node) |
3041 | of_dma_controller_free(adev->dev.of_node); | ||
3027 | 3042 | ||
3043 | dma_async_device_unregister(&pdmac->ddma); | ||
3028 | amba_set_drvdata(adev, NULL); | 3044 | amba_set_drvdata(adev, NULL); |
3029 | 3045 | ||
3030 | /* Idle the DMAC */ | 3046 | /* Idle the DMAC */ |
diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c index cdae207028a7..6c3fca97d346 100644 --- a/drivers/eisa/pci_eisa.c +++ b/drivers/eisa/pci_eisa.c | |||
@@ -19,10 +19,10 @@ | |||
19 | /* There is only *one* pci_eisa device per machine, right ? */ | 19 | /* There is only *one* pci_eisa device per machine, right ? */ |
20 | static struct eisa_root_device pci_eisa_root; | 20 | static struct eisa_root_device pci_eisa_root; |
21 | 21 | ||
22 | static int __init pci_eisa_init(struct pci_dev *pdev, | 22 | static int __init pci_eisa_init(struct pci_dev *pdev) |
23 | const struct pci_device_id *ent) | ||
24 | { | 23 | { |
25 | int rc; | 24 | int rc, i; |
25 | struct resource *res, *bus_res = NULL; | ||
26 | 26 | ||
27 | if ((rc = pci_enable_device (pdev))) { | 27 | if ((rc = pci_enable_device (pdev))) { |
28 | printk (KERN_ERR "pci_eisa : Could not enable device %s\n", | 28 | printk (KERN_ERR "pci_eisa : Could not enable device %s\n", |
@@ -30,9 +30,30 @@ static int __init pci_eisa_init(struct pci_dev *pdev, | |||
30 | return rc; | 30 | return rc; |
31 | } | 31 | } |
32 | 32 | ||
33 | /* | ||
34 | * The Intel 82375 PCI-EISA bridge is a subtractive-decode PCI | ||
35 | * device, so the resources available on EISA are the same as those | ||
36 | * available on the 82375 bus. This works the same as a PCI-PCI | ||
37 | * bridge in subtractive-decode mode (see pci_read_bridge_bases()). | ||
38 | * We assume other PCI-EISA bridges are similar. | ||
39 | * | ||
40 | * eisa_root_register() can only deal with a single io port resource, | ||
41 | * so we use the first valid io port resource. | ||
42 | */ | ||
43 | pci_bus_for_each_resource(pdev->bus, res, i) | ||
44 | if (res && (res->flags & IORESOURCE_IO)) { | ||
45 | bus_res = res; | ||
46 | break; | ||
47 | } | ||
48 | |||
49 | if (!bus_res) { | ||
50 | dev_err(&pdev->dev, "No resources available\n"); | ||
51 | return -1; | ||
52 | } | ||
53 | |||
33 | pci_eisa_root.dev = &pdev->dev; | 54 | pci_eisa_root.dev = &pdev->dev; |
34 | pci_eisa_root.res = pdev->bus->resource[0]; | 55 | pci_eisa_root.res = bus_res; |
35 | pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start; | 56 | pci_eisa_root.bus_base_addr = bus_res->start; |
36 | pci_eisa_root.slots = EISA_MAX_SLOTS; | 57 | pci_eisa_root.slots = EISA_MAX_SLOTS; |
37 | pci_eisa_root.dma_mask = pdev->dma_mask; | 58 | pci_eisa_root.dma_mask = pdev->dma_mask; |
38 | dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root); | 59 | dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root); |
@@ -45,22 +66,26 @@ static int __init pci_eisa_init(struct pci_dev *pdev, | |||
45 | return 0; | 66 | return 0; |
46 | } | 67 | } |
47 | 68 | ||
48 | static struct pci_device_id pci_eisa_pci_tbl[] = { | 69 | /* |
49 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 70 | * We have to call pci_eisa_init_early() before pnpacpi_init()/isapnp_init(). |
50 | PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 }, | 71 | * Otherwise pnp resource will get enabled early and could prevent eisa |
51 | { 0, } | 72 | * to be initialized. |
52 | }; | 73 | * Also need to make sure pci_eisa_init_early() is called after |
74 | * x86/pci_subsys_init(). | ||
75 | * So need to use subsys_initcall_sync with it. | ||
76 | */ | ||
77 | static int __init pci_eisa_init_early(void) | ||
78 | { | ||
79 | struct pci_dev *dev = NULL; | ||
80 | int ret; | ||
53 | 81 | ||
54 | static struct pci_driver __refdata pci_eisa_driver = { | 82 | for_each_pci_dev(dev) |
55 | .name = "pci_eisa", | 83 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_EISA) { |
56 | .id_table = pci_eisa_pci_tbl, | 84 | ret = pci_eisa_init(dev); |
57 | .probe = pci_eisa_init, | 85 | if (ret) |
58 | }; | 86 | return ret; |
87 | } | ||
59 | 88 | ||
60 | static int __init pci_eisa_init_module (void) | 89 | return 0; |
61 | { | ||
62 | return pci_register_driver (&pci_eisa_driver); | ||
63 | } | 90 | } |
64 | 91 | subsys_initcall_sync(pci_eisa_init_early); | |
65 | device_initcall(pci_eisa_init_module); | ||
66 | MODULE_DEVICE_TABLE(pci, pci_eisa_pci_tbl); | ||
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 42c759a4d047..3e532002e4d1 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig | |||
@@ -39,6 +39,7 @@ config FIRMWARE_MEMMAP | |||
39 | config EFI_VARS | 39 | config EFI_VARS |
40 | tristate "EFI Variable Support via sysfs" | 40 | tristate "EFI Variable Support via sysfs" |
41 | depends on EFI | 41 | depends on EFI |
42 | select UCS2_STRING | ||
42 | default n | 43 | default n |
43 | help | 44 | help |
44 | If you say Y here, you are able to get EFI (Extensible Firmware | 45 | If you say Y here, you are able to get EFI (Extensible Firmware |
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 7acafb80fd4c..182ce9471175 100644 --- a/drivers/firmware/efivars.c +++ b/drivers/firmware/efivars.c | |||
@@ -80,6 +80,7 @@ | |||
80 | #include <linux/slab.h> | 80 | #include <linux/slab.h> |
81 | #include <linux/pstore.h> | 81 | #include <linux/pstore.h> |
82 | #include <linux/ctype.h> | 82 | #include <linux/ctype.h> |
83 | #include <linux/ucs2_string.h> | ||
83 | 84 | ||
84 | #include <linux/fs.h> | 85 | #include <linux/fs.h> |
85 | #include <linux/ramfs.h> | 86 | #include <linux/ramfs.h> |
@@ -172,51 +173,6 @@ static void efivar_update_sysfs_entries(struct work_struct *); | |||
172 | static DECLARE_WORK(efivar_work, efivar_update_sysfs_entries); | 173 | static DECLARE_WORK(efivar_work, efivar_update_sysfs_entries); |
173 | static bool efivar_wq_enabled = true; | 174 | static bool efivar_wq_enabled = true; |
174 | 175 | ||
175 | /* Return the number of unicode characters in data */ | ||
176 | static unsigned long | ||
177 | utf16_strnlen(efi_char16_t *s, size_t maxlength) | ||
178 | { | ||
179 | unsigned long length = 0; | ||
180 | |||
181 | while (*s++ != 0 && length < maxlength) | ||
182 | length++; | ||
183 | return length; | ||
184 | } | ||
185 | |||
186 | static inline unsigned long | ||
187 | utf16_strlen(efi_char16_t *s) | ||
188 | { | ||
189 | return utf16_strnlen(s, ~0UL); | ||
190 | } | ||
191 | |||
192 | /* | ||
193 | * Return the number of bytes is the length of this string | ||
194 | * Note: this is NOT the same as the number of unicode characters | ||
195 | */ | ||
196 | static inline unsigned long | ||
197 | utf16_strsize(efi_char16_t *data, unsigned long maxlength) | ||
198 | { | ||
199 | return utf16_strnlen(data, maxlength/sizeof(efi_char16_t)) * sizeof(efi_char16_t); | ||
200 | } | ||
201 | |||
202 | static inline int | ||
203 | utf16_strncmp(const efi_char16_t *a, const efi_char16_t *b, size_t len) | ||
204 | { | ||
205 | while (1) { | ||
206 | if (len == 0) | ||
207 | return 0; | ||
208 | if (*a < *b) | ||
209 | return -1; | ||
210 | if (*a > *b) | ||
211 | return 1; | ||
212 | if (*a == 0) /* implies *b == 0 */ | ||
213 | return 0; | ||
214 | a++; | ||
215 | b++; | ||
216 | len--; | ||
217 | } | ||
218 | } | ||
219 | |||
220 | static bool | 176 | static bool |
221 | validate_device_path(struct efi_variable *var, int match, u8 *buffer, | 177 | validate_device_path(struct efi_variable *var, int match, u8 *buffer, |
222 | unsigned long len) | 178 | unsigned long len) |
@@ -268,7 +224,7 @@ validate_load_option(struct efi_variable *var, int match, u8 *buffer, | |||
268 | u16 filepathlength; | 224 | u16 filepathlength; |
269 | int i, desclength = 0, namelen; | 225 | int i, desclength = 0, namelen; |
270 | 226 | ||
271 | namelen = utf16_strnlen(var->VariableName, sizeof(var->VariableName)); | 227 | namelen = ucs2_strnlen(var->VariableName, sizeof(var->VariableName)); |
272 | 228 | ||
273 | /* Either "Boot" or "Driver" followed by four digits of hex */ | 229 | /* Either "Boot" or "Driver" followed by four digits of hex */ |
274 | for (i = match; i < match+4; i++) { | 230 | for (i = match; i < match+4; i++) { |
@@ -291,7 +247,7 @@ validate_load_option(struct efi_variable *var, int match, u8 *buffer, | |||
291 | * There's no stored length for the description, so it has to be | 247 | * There's no stored length for the description, so it has to be |
292 | * found by hand | 248 | * found by hand |
293 | */ | 249 | */ |
294 | desclength = utf16_strsize((efi_char16_t *)(buffer + 6), len - 6) + 2; | 250 | desclength = ucs2_strsize((efi_char16_t *)(buffer + 6), len - 6) + 2; |
295 | 251 | ||
296 | /* Each boot entry must have a descriptor */ | 252 | /* Each boot entry must have a descriptor */ |
297 | if (!desclength) | 253 | if (!desclength) |
@@ -436,24 +392,12 @@ static efi_status_t | |||
436 | check_var_size_locked(struct efivars *efivars, u32 attributes, | 392 | check_var_size_locked(struct efivars *efivars, u32 attributes, |
437 | unsigned long size) | 393 | unsigned long size) |
438 | { | 394 | { |
439 | u64 storage_size, remaining_size, max_size; | ||
440 | efi_status_t status; | ||
441 | const struct efivar_operations *fops = efivars->ops; | 395 | const struct efivar_operations *fops = efivars->ops; |
442 | 396 | ||
443 | if (!efivars->ops->query_variable_info) | 397 | if (!efivars->ops->query_variable_store) |
444 | return EFI_UNSUPPORTED; | 398 | return EFI_UNSUPPORTED; |
445 | 399 | ||
446 | status = fops->query_variable_info(attributes, &storage_size, | 400 | return fops->query_variable_store(attributes, size); |
447 | &remaining_size, &max_size); | ||
448 | |||
449 | if (status != EFI_SUCCESS) | ||
450 | return status; | ||
451 | |||
452 | if (!storage_size || size > remaining_size || size > max_size || | ||
453 | (remaining_size - size) < (storage_size / 2)) | ||
454 | return EFI_OUT_OF_RESOURCES; | ||
455 | |||
456 | return status; | ||
457 | } | 401 | } |
458 | 402 | ||
459 | 403 | ||
@@ -593,7 +537,7 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count) | |||
593 | spin_lock_irq(&efivars->lock); | 537 | spin_lock_irq(&efivars->lock); |
594 | 538 | ||
595 | status = check_var_size_locked(efivars, new_var->Attributes, | 539 | status = check_var_size_locked(efivars, new_var->Attributes, |
596 | new_var->DataSize + utf16_strsize(new_var->VariableName, 1024)); | 540 | new_var->DataSize + ucs2_strsize(new_var->VariableName, 1024)); |
597 | 541 | ||
598 | if (status == EFI_SUCCESS || status == EFI_UNSUPPORTED) | 542 | if (status == EFI_SUCCESS || status == EFI_UNSUPPORTED) |
599 | status = efivars->ops->set_variable(new_var->VariableName, | 543 | status = efivars->ops->set_variable(new_var->VariableName, |
@@ -771,7 +715,7 @@ static ssize_t efivarfs_file_write(struct file *file, | |||
771 | * QueryVariableInfo() isn't supported by the firmware. | 715 | * QueryVariableInfo() isn't supported by the firmware. |
772 | */ | 716 | */ |
773 | 717 | ||
774 | varsize = datasize + utf16_strsize(var->var.VariableName, 1024); | 718 | varsize = datasize + ucs2_strsize(var->var.VariableName, 1024); |
775 | status = check_var_size(efivars, attributes, varsize); | 719 | status = check_var_size(efivars, attributes, varsize); |
776 | 720 | ||
777 | if (status != EFI_SUCCESS) { | 721 | if (status != EFI_SUCCESS) { |
@@ -1223,7 +1167,7 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) | |||
1223 | 1167 | ||
1224 | inode = NULL; | 1168 | inode = NULL; |
1225 | 1169 | ||
1226 | len = utf16_strlen(entry->var.VariableName); | 1170 | len = ucs2_strlen(entry->var.VariableName); |
1227 | 1171 | ||
1228 | /* name, plus '-', plus GUID, plus NUL*/ | 1172 | /* name, plus '-', plus GUID, plus NUL*/ |
1229 | name = kmalloc(len + 1 + GUID_LEN + 1, GFP_ATOMIC); | 1173 | name = kmalloc(len + 1 + GUID_LEN + 1, GFP_ATOMIC); |
@@ -1481,8 +1425,8 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, | |||
1481 | 1425 | ||
1482 | if (efi_guidcmp(entry->var.VendorGuid, vendor)) | 1426 | if (efi_guidcmp(entry->var.VendorGuid, vendor)) |
1483 | continue; | 1427 | continue; |
1484 | if (utf16_strncmp(entry->var.VariableName, efi_name, | 1428 | if (ucs2_strncmp(entry->var.VariableName, efi_name, |
1485 | utf16_strlen(efi_name))) { | 1429 | ucs2_strlen(efi_name))) { |
1486 | /* | 1430 | /* |
1487 | * Check if an old format, | 1431 | * Check if an old format, |
1488 | * which doesn't support holding | 1432 | * which doesn't support holding |
@@ -1494,8 +1438,8 @@ static int efi_pstore_erase(enum pstore_type_id type, u64 id, int count, | |||
1494 | for (i = 0; i < DUMP_NAME_LEN; i++) | 1438 | for (i = 0; i < DUMP_NAME_LEN; i++) |
1495 | efi_name_old[i] = name_old[i]; | 1439 | efi_name_old[i] = name_old[i]; |
1496 | 1440 | ||
1497 | if (utf16_strncmp(entry->var.VariableName, efi_name_old, | 1441 | if (ucs2_strncmp(entry->var.VariableName, efi_name_old, |
1498 | utf16_strlen(efi_name_old))) | 1442 | ucs2_strlen(efi_name_old))) |
1499 | continue; | 1443 | continue; |
1500 | } | 1444 | } |
1501 | 1445 | ||
@@ -1573,8 +1517,8 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, | |||
1573 | * Does this variable already exist? | 1517 | * Does this variable already exist? |
1574 | */ | 1518 | */ |
1575 | list_for_each_entry_safe(search_efivar, n, &efivars->list, list) { | 1519 | list_for_each_entry_safe(search_efivar, n, &efivars->list, list) { |
1576 | strsize1 = utf16_strsize(search_efivar->var.VariableName, 1024); | 1520 | strsize1 = ucs2_strsize(search_efivar->var.VariableName, 1024); |
1577 | strsize2 = utf16_strsize(new_var->VariableName, 1024); | 1521 | strsize2 = ucs2_strsize(new_var->VariableName, 1024); |
1578 | if (strsize1 == strsize2 && | 1522 | if (strsize1 == strsize2 && |
1579 | !memcmp(&(search_efivar->var.VariableName), | 1523 | !memcmp(&(search_efivar->var.VariableName), |
1580 | new_var->VariableName, strsize1) && | 1524 | new_var->VariableName, strsize1) && |
@@ -1590,7 +1534,7 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, | |||
1590 | } | 1534 | } |
1591 | 1535 | ||
1592 | status = check_var_size_locked(efivars, new_var->Attributes, | 1536 | status = check_var_size_locked(efivars, new_var->Attributes, |
1593 | new_var->DataSize + utf16_strsize(new_var->VariableName, 1024)); | 1537 | new_var->DataSize + ucs2_strsize(new_var->VariableName, 1024)); |
1594 | 1538 | ||
1595 | if (status && status != EFI_UNSUPPORTED) { | 1539 | if (status && status != EFI_UNSUPPORTED) { |
1596 | spin_unlock_irq(&efivars->lock); | 1540 | spin_unlock_irq(&efivars->lock); |
@@ -1614,7 +1558,7 @@ static ssize_t efivar_create(struct file *filp, struct kobject *kobj, | |||
1614 | 1558 | ||
1615 | /* Create the entry in sysfs. Locking is not required here */ | 1559 | /* Create the entry in sysfs. Locking is not required here */ |
1616 | status = efivar_create_sysfs_entry(efivars, | 1560 | status = efivar_create_sysfs_entry(efivars, |
1617 | utf16_strsize(new_var->VariableName, | 1561 | ucs2_strsize(new_var->VariableName, |
1618 | 1024), | 1562 | 1024), |
1619 | new_var->VariableName, | 1563 | new_var->VariableName, |
1620 | &new_var->VendorGuid); | 1564 | &new_var->VendorGuid); |
@@ -1644,8 +1588,8 @@ static ssize_t efivar_delete(struct file *filp, struct kobject *kobj, | |||
1644 | * Does this variable already exist? | 1588 | * Does this variable already exist? |
1645 | */ | 1589 | */ |
1646 | list_for_each_entry_safe(search_efivar, n, &efivars->list, list) { | 1590 | list_for_each_entry_safe(search_efivar, n, &efivars->list, list) { |
1647 | strsize1 = utf16_strsize(search_efivar->var.VariableName, 1024); | 1591 | strsize1 = ucs2_strsize(search_efivar->var.VariableName, 1024); |
1648 | strsize2 = utf16_strsize(del_var->VariableName, 1024); | 1592 | strsize2 = ucs2_strsize(del_var->VariableName, 1024); |
1649 | if (strsize1 == strsize2 && | 1593 | if (strsize1 == strsize2 && |
1650 | !memcmp(&(search_efivar->var.VariableName), | 1594 | !memcmp(&(search_efivar->var.VariableName), |
1651 | del_var->VariableName, strsize1) && | 1595 | del_var->VariableName, strsize1) && |
@@ -1691,9 +1635,9 @@ static bool variable_is_present(efi_char16_t *variable_name, efi_guid_t *vendor) | |||
1691 | unsigned long strsize1, strsize2; | 1635 | unsigned long strsize1, strsize2; |
1692 | bool found = false; | 1636 | bool found = false; |
1693 | 1637 | ||
1694 | strsize1 = utf16_strsize(variable_name, 1024); | 1638 | strsize1 = ucs2_strsize(variable_name, 1024); |
1695 | list_for_each_entry_safe(entry, n, &efivars->list, list) { | 1639 | list_for_each_entry_safe(entry, n, &efivars->list, list) { |
1696 | strsize2 = utf16_strsize(entry->var.VariableName, 1024); | 1640 | strsize2 = ucs2_strsize(entry->var.VariableName, 1024); |
1697 | if (strsize1 == strsize2 && | 1641 | if (strsize1 == strsize2 && |
1698 | !memcmp(variable_name, &(entry->var.VariableName), | 1642 | !memcmp(variable_name, &(entry->var.VariableName), |
1699 | strsize2) && | 1643 | strsize2) && |
@@ -2131,7 +2075,7 @@ efivars_init(void) | |||
2131 | ops.get_variable = efi.get_variable; | 2075 | ops.get_variable = efi.get_variable; |
2132 | ops.set_variable = efi.set_variable; | 2076 | ops.set_variable = efi.set_variable; |
2133 | ops.get_next_variable = efi.get_next_variable; | 2077 | ops.get_next_variable = efi.get_next_variable; |
2134 | ops.query_variable_info = efi.query_variable_info; | 2078 | ops.query_variable_store = efi_query_variable_store; |
2135 | 2079 | ||
2136 | error = register_efivars(&__efivars, &ops, efi_kobj); | 2080 | error = register_efivars(&__efivars, &ops, efi_kobj); |
2137 | if (error) | 2081 | if (error) |
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 24059462c87f..9391cf16e990 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c | |||
@@ -575,7 +575,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, | |||
575 | chip->gpio_chip.ngpio, | 575 | chip->gpio_chip.ngpio, |
576 | irq_base, | 576 | irq_base, |
577 | &pca953x_irq_simple_ops, | 577 | &pca953x_irq_simple_ops, |
578 | NULL); | 578 | chip); |
579 | if (!chip->domain) | 579 | if (!chip->domain) |
580 | return -ENODEV; | 580 | return -ENODEV; |
581 | 581 | ||
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 59d6b9bf204b..892ff9f95975 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
@@ -1544,10 +1544,10 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) | |||
1544 | if (!fb_helper->fb) | 1544 | if (!fb_helper->fb) |
1545 | return 0; | 1545 | return 0; |
1546 | 1546 | ||
1547 | drm_modeset_lock_all(dev); | 1547 | mutex_lock(&fb_helper->dev->mode_config.mutex); |
1548 | if (!drm_fb_helper_is_bound(fb_helper)) { | 1548 | if (!drm_fb_helper_is_bound(fb_helper)) { |
1549 | fb_helper->delayed_hotplug = true; | 1549 | fb_helper->delayed_hotplug = true; |
1550 | drm_modeset_unlock_all(dev); | 1550 | mutex_unlock(&fb_helper->dev->mode_config.mutex); |
1551 | return 0; | 1551 | return 0; |
1552 | } | 1552 | } |
1553 | DRM_DEBUG_KMS("\n"); | 1553 | DRM_DEBUG_KMS("\n"); |
@@ -1558,9 +1558,11 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) | |||
1558 | 1558 | ||
1559 | count = drm_fb_helper_probe_connector_modes(fb_helper, max_width, | 1559 | count = drm_fb_helper_probe_connector_modes(fb_helper, max_width, |
1560 | max_height); | 1560 | max_height); |
1561 | mutex_unlock(&fb_helper->dev->mode_config.mutex); | ||
1562 | |||
1563 | drm_modeset_lock_all(dev); | ||
1561 | drm_setup_crtcs(fb_helper); | 1564 | drm_setup_crtcs(fb_helper); |
1562 | drm_modeset_unlock_all(dev); | 1565 | drm_modeset_unlock_all(dev); |
1563 | |||
1564 | drm_fb_helper_set_par(fb_helper->fbdev); | 1566 | drm_fb_helper_set_par(fb_helper->fbdev); |
1565 | 1567 | ||
1566 | return 0; | 1568 | return 0; |
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index fe22bb780e1d..78d8e919509f 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c | |||
@@ -751,8 +751,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
751 | int i; | 751 | int i; |
752 | unsigned char misc = 0; | 752 | unsigned char misc = 0; |
753 | unsigned char ext_vga[6]; | 753 | unsigned char ext_vga[6]; |
754 | unsigned char ext_vga_index24; | ||
755 | unsigned char dac_index90 = 0; | ||
756 | u8 bppshift; | 754 | u8 bppshift; |
757 | 755 | ||
758 | static unsigned char dacvalue[] = { | 756 | static unsigned char dacvalue[] = { |
@@ -803,7 +801,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
803 | option2 = 0x0000b000; | 801 | option2 = 0x0000b000; |
804 | break; | 802 | break; |
805 | case G200_ER: | 803 | case G200_ER: |
806 | dac_index90 = 0; | ||
807 | break; | 804 | break; |
808 | } | 805 | } |
809 | 806 | ||
@@ -852,10 +849,8 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
852 | WREG_DAC(i, dacvalue[i]); | 849 | WREG_DAC(i, dacvalue[i]); |
853 | } | 850 | } |
854 | 851 | ||
855 | if (mdev->type == G200_ER) { | 852 | if (mdev->type == G200_ER) |
856 | WREG_DAC(0x90, dac_index90); | 853 | WREG_DAC(0x90, 0); |
857 | } | ||
858 | |||
859 | 854 | ||
860 | if (option) | 855 | if (option) |
861 | pci_write_config_dword(dev->pdev, PCI_MGA_OPTION, option); | 856 | pci_write_config_dword(dev->pdev, PCI_MGA_OPTION, option); |
@@ -952,8 +947,6 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
952 | if (mdev->type == G200_WB) | 947 | if (mdev->type == G200_WB) |
953 | ext_vga[1] |= 0x88; | 948 | ext_vga[1] |= 0x88; |
954 | 949 | ||
955 | ext_vga_index24 = 0x05; | ||
956 | |||
957 | /* Set pixel clocks */ | 950 | /* Set pixel clocks */ |
958 | misc = 0x2d; | 951 | misc = 0x2d; |
959 | WREG8(MGA_MISC_OUT, misc); | 952 | WREG8(MGA_MISC_OUT, misc); |
@@ -965,7 +958,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
965 | } | 958 | } |
966 | 959 | ||
967 | if (mdev->type == G200_ER) | 960 | if (mdev->type == G200_ER) |
968 | WREG_ECRT(24, ext_vga_index24); | 961 | WREG_ECRT(0x24, 0x5); |
969 | 962 | ||
970 | if (mdev->type == G200_EV) { | 963 | if (mdev->type == G200_EV) { |
971 | WREG_ECRT(6, 0); | 964 | WREG_ECRT(6, 0); |
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c index e816f06637a7..0e2c1a4f1659 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c | |||
@@ -248,6 +248,22 @@ nouveau_bios_shadow_pci(struct nouveau_bios *bios) | |||
248 | } | 248 | } |
249 | } | 249 | } |
250 | 250 | ||
251 | static void | ||
252 | nouveau_bios_shadow_platform(struct nouveau_bios *bios) | ||
253 | { | ||
254 | struct pci_dev *pdev = nv_device(bios)->pdev; | ||
255 | size_t size; | ||
256 | |||
257 | void __iomem *rom = pci_platform_rom(pdev, &size); | ||
258 | if (rom && size) { | ||
259 | bios->data = kmalloc(size, GFP_KERNEL); | ||
260 | if (bios->data) { | ||
261 | memcpy_fromio(bios->data, rom, size); | ||
262 | bios->size = size; | ||
263 | } | ||
264 | } | ||
265 | } | ||
266 | |||
251 | static int | 267 | static int |
252 | nouveau_bios_score(struct nouveau_bios *bios, const bool writeable) | 268 | nouveau_bios_score(struct nouveau_bios *bios, const bool writeable) |
253 | { | 269 | { |
@@ -288,6 +304,7 @@ nouveau_bios_shadow(struct nouveau_bios *bios) | |||
288 | { "PROM", nouveau_bios_shadow_prom, false, 0, 0, NULL }, | 304 | { "PROM", nouveau_bios_shadow_prom, false, 0, 0, NULL }, |
289 | { "ACPI", nouveau_bios_shadow_acpi, true, 0, 0, NULL }, | 305 | { "ACPI", nouveau_bios_shadow_acpi, true, 0, 0, NULL }, |
290 | { "PCIROM", nouveau_bios_shadow_pci, true, 0, 0, NULL }, | 306 | { "PCIROM", nouveau_bios_shadow_pci, true, 0, 0, NULL }, |
307 | { "PLATFORM", nouveau_bios_shadow_platform, true, 0, 0, NULL }, | ||
291 | {} | 308 | {} |
292 | }; | 309 | }; |
293 | struct methods *mthd, *best; | 310 | struct methods *mthd, *best; |
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 7f0e6c3f37d1..1ddc03e51bf4 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -479,7 +479,7 @@ nv50_display_flip_wait(void *data) | |||
479 | { | 479 | { |
480 | struct nv50_display_flip *flip = data; | 480 | struct nv50_display_flip *flip = data; |
481 | if (nouveau_bo_rd32(flip->disp->sync, flip->chan->addr / 4) == | 481 | if (nouveau_bo_rd32(flip->disp->sync, flip->chan->addr / 4) == |
482 | flip->chan->data); | 482 | flip->chan->data) |
483 | return true; | 483 | return true; |
484 | usleep_range(1, 2); | 484 | usleep_range(1, 2); |
485 | return false; | 485 | return false; |
diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c index b8015913d382..fa3c56fba294 100644 --- a/drivers/gpu/drm/radeon/radeon_bios.c +++ b/drivers/gpu/drm/radeon/radeon_bios.c | |||
@@ -99,6 +99,29 @@ static bool radeon_read_bios(struct radeon_device *rdev) | |||
99 | return true; | 99 | return true; |
100 | } | 100 | } |
101 | 101 | ||
102 | static bool radeon_read_platform_bios(struct radeon_device *rdev) | ||
103 | { | ||
104 | uint8_t __iomem *bios; | ||
105 | size_t size; | ||
106 | |||
107 | rdev->bios = NULL; | ||
108 | |||
109 | bios = pci_platform_rom(rdev->pdev, &size); | ||
110 | if (!bios) { | ||
111 | return false; | ||
112 | } | ||
113 | |||
114 | if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) { | ||
115 | return false; | ||
116 | } | ||
117 | rdev->bios = kmemdup(bios, size, GFP_KERNEL); | ||
118 | if (rdev->bios == NULL) { | ||
119 | return false; | ||
120 | } | ||
121 | |||
122 | return true; | ||
123 | } | ||
124 | |||
102 | #ifdef CONFIG_ACPI | 125 | #ifdef CONFIG_ACPI |
103 | /* ATRM is used to get the BIOS on the discrete cards in | 126 | /* ATRM is used to get the BIOS on the discrete cards in |
104 | * dual-gpu systems. | 127 | * dual-gpu systems. |
@@ -620,6 +643,9 @@ bool radeon_get_bios(struct radeon_device *rdev) | |||
620 | if (r == false) { | 643 | if (r == false) { |
621 | r = radeon_read_disabled_bios(rdev); | 644 | r = radeon_read_disabled_bios(rdev); |
622 | } | 645 | } |
646 | if (r == false) { | ||
647 | r = radeon_read_platform_bios(rdev); | ||
648 | } | ||
623 | if (r == false || rdev->bios == NULL) { | 649 | if (r == false || rdev->bios == NULL) { |
624 | DRM_ERROR("Unable to locate a BIOS ROM\n"); | 650 | DRM_ERROR("Unable to locate a BIOS ROM\n"); |
625 | rdev->bios = NULL; | 651 | rdev->bios = NULL; |
diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c index fe5cdbcf2636..b44d548c56f8 100644 --- a/drivers/gpu/drm/udl/udl_connector.c +++ b/drivers/gpu/drm/udl/udl_connector.c | |||
@@ -61,6 +61,10 @@ static int udl_get_modes(struct drm_connector *connector) | |||
61 | int ret; | 61 | int ret; |
62 | 62 | ||
63 | edid = (struct edid *)udl_get_edid(udl); | 63 | edid = (struct edid *)udl_get_edid(udl); |
64 | if (!edid) { | ||
65 | drm_mode_connector_update_edid_property(connector, NULL); | ||
66 | return 0; | ||
67 | } | ||
64 | 68 | ||
65 | /* | 69 | /* |
66 | * We only read the main block, but if the monitor reports extension | 70 | * We only read the main block, but if the monitor reports extension |
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index db713c0dfba4..461a0d739d75 100644 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c | |||
@@ -416,6 +416,8 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock) | |||
416 | ret = pm_runtime_get_sync(dev); | 416 | ret = pm_runtime_get_sync(dev); |
417 | if (ret < 0) { | 417 | if (ret < 0) { |
418 | dev_err(dev, "%s: can't power on device\n", __func__); | 418 | dev_err(dev, "%s: can't power on device\n", __func__); |
419 | pm_runtime_put_noidle(dev); | ||
420 | module_put(dev->driver->owner); | ||
419 | return ret; | 421 | return ret; |
420 | } | 422 | } |
421 | 423 | ||
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 5d6675013864..1a38dd7dfe4e 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
@@ -465,6 +465,7 @@ static const struct x86_cpu_id intel_idle_ids[] = { | |||
465 | ICPU(0x3c, idle_cpu_hsw), | 465 | ICPU(0x3c, idle_cpu_hsw), |
466 | ICPU(0x3f, idle_cpu_hsw), | 466 | ICPU(0x3f, idle_cpu_hsw), |
467 | ICPU(0x45, idle_cpu_hsw), | 467 | ICPU(0x45, idle_cpu_hsw), |
468 | ICPU(0x46, idle_cpu_hsw), | ||
468 | {} | 469 | {} |
469 | }; | 470 | }; |
470 | MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids); | 471 | MODULE_DEVICE_TABLE(x86cpu, intel_idle_ids); |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 1daa97913b7d..0bfd8cf25200 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -359,7 +359,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) | |||
359 | case 0x802: /* Intuos4 General Pen */ | 359 | case 0x802: /* Intuos4 General Pen */ |
360 | case 0x804: /* Intuos4 Marker Pen */ | 360 | case 0x804: /* Intuos4 Marker Pen */ |
361 | case 0x40802: /* Intuos4 Classic Pen */ | 361 | case 0x40802: /* Intuos4 Classic Pen */ |
362 | case 0x18803: /* DTH2242 Grip Pen */ | 362 | case 0x18802: /* DTH2242 Grip Pen */ |
363 | case 0x022: | 363 | case 0x022: |
364 | wacom->tool[idx] = BTN_TOOL_PEN; | 364 | wacom->tool[idx] = BTN_TOOL_PEN; |
365 | break; | 365 | break; |
@@ -1912,7 +1912,7 @@ static const struct wacom_features wacom_features_0xBB = | |||
1912 | { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047, | 1912 | { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047, |
1913 | 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1913 | 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
1914 | static const struct wacom_features wacom_features_0xBC = | 1914 | static const struct wacom_features wacom_features_0xBC = |
1915 | { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, | 1915 | { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40640, 25400, 2047, |
1916 | 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1916 | 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
1917 | static const struct wacom_features wacom_features_0x26 = | 1917 | static const struct wacom_features wacom_features_0x26 = |
1918 | { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, | 1918 | { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, |
@@ -2144,7 +2144,7 @@ const struct usb_device_id wacom_ids[] = { | |||
2144 | { USB_DEVICE_WACOM(0x44) }, | 2144 | { USB_DEVICE_WACOM(0x44) }, |
2145 | { USB_DEVICE_WACOM(0x45) }, | 2145 | { USB_DEVICE_WACOM(0x45) }, |
2146 | { USB_DEVICE_WACOM(0x59) }, | 2146 | { USB_DEVICE_WACOM(0x59) }, |
2147 | { USB_DEVICE_WACOM(0x5D) }, | 2147 | { USB_DEVICE_DETAILED(0x5D, USB_CLASS_HID, 0, 0) }, |
2148 | { USB_DEVICE_WACOM(0xB0) }, | 2148 | { USB_DEVICE_WACOM(0xB0) }, |
2149 | { USB_DEVICE_WACOM(0xB1) }, | 2149 | { USB_DEVICE_WACOM(0xB1) }, |
2150 | { USB_DEVICE_WACOM(0xB2) }, | 2150 | { USB_DEVICE_WACOM(0xB2) }, |
@@ -2209,7 +2209,7 @@ const struct usb_device_id wacom_ids[] = { | |||
2209 | { USB_DEVICE_WACOM(0x47) }, | 2209 | { USB_DEVICE_WACOM(0x47) }, |
2210 | { USB_DEVICE_WACOM(0xF4) }, | 2210 | { USB_DEVICE_WACOM(0xF4) }, |
2211 | { USB_DEVICE_WACOM(0xF8) }, | 2211 | { USB_DEVICE_WACOM(0xF8) }, |
2212 | { USB_DEVICE_WACOM(0xF6) }, | 2212 | { USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) }, |
2213 | { USB_DEVICE_WACOM(0xFA) }, | 2213 | { USB_DEVICE_WACOM(0xFA) }, |
2214 | { USB_DEVICE_LENOVO(0x6004) }, | 2214 | { USB_DEVICE_LENOVO(0x6004) }, |
2215 | { } | 2215 | { } |
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index a32e0d5aa45f..fc6aebf1e4b2 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -236,7 +236,8 @@ static int gic_retrigger(struct irq_data *d) | |||
236 | if (gic_arch_extn.irq_retrigger) | 236 | if (gic_arch_extn.irq_retrigger) |
237 | return gic_arch_extn.irq_retrigger(d); | 237 | return gic_arch_extn.irq_retrigger(d); |
238 | 238 | ||
239 | return -ENXIO; | 239 | /* the genirq layer expects 0 if we can't retrigger in hardware */ |
240 | return 0; | ||
240 | } | 241 | } |
241 | 242 | ||
242 | #ifdef CONFIG_SMP | 243 | #ifdef CONFIG_SMP |
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 66120bd46d15..10744091e6ca 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | #include "dm.h" | 7 | #include "dm.h" |
8 | #include "dm-bio-prison.h" | 8 | #include "dm-bio-prison.h" |
9 | #include "dm-bio-record.h" | ||
9 | #include "dm-cache-metadata.h" | 10 | #include "dm-cache-metadata.h" |
10 | 11 | ||
11 | #include <linux/dm-io.h> | 12 | #include <linux/dm-io.h> |
@@ -201,10 +202,15 @@ struct per_bio_data { | |||
201 | unsigned req_nr:2; | 202 | unsigned req_nr:2; |
202 | struct dm_deferred_entry *all_io_entry; | 203 | struct dm_deferred_entry *all_io_entry; |
203 | 204 | ||
204 | /* writethrough fields */ | 205 | /* |
206 | * writethrough fields. These MUST remain at the end of this | ||
207 | * structure and the 'cache' member must be the first as it | ||
208 | * is used to determine the offsetof the writethrough fields. | ||
209 | */ | ||
205 | struct cache *cache; | 210 | struct cache *cache; |
206 | dm_cblock_t cblock; | 211 | dm_cblock_t cblock; |
207 | bio_end_io_t *saved_bi_end_io; | 212 | bio_end_io_t *saved_bi_end_io; |
213 | struct dm_bio_details bio_details; | ||
208 | }; | 214 | }; |
209 | 215 | ||
210 | struct dm_cache_migration { | 216 | struct dm_cache_migration { |
@@ -513,16 +519,28 @@ static void save_stats(struct cache *cache) | |||
513 | /*---------------------------------------------------------------- | 519 | /*---------------------------------------------------------------- |
514 | * Per bio data | 520 | * Per bio data |
515 | *--------------------------------------------------------------*/ | 521 | *--------------------------------------------------------------*/ |
516 | static struct per_bio_data *get_per_bio_data(struct bio *bio) | 522 | |
523 | /* | ||
524 | * If using writeback, leave out struct per_bio_data's writethrough fields. | ||
525 | */ | ||
526 | #define PB_DATA_SIZE_WB (offsetof(struct per_bio_data, cache)) | ||
527 | #define PB_DATA_SIZE_WT (sizeof(struct per_bio_data)) | ||
528 | |||
529 | static size_t get_per_bio_data_size(struct cache *cache) | ||
530 | { | ||
531 | return cache->features.write_through ? PB_DATA_SIZE_WT : PB_DATA_SIZE_WB; | ||
532 | } | ||
533 | |||
534 | static struct per_bio_data *get_per_bio_data(struct bio *bio, size_t data_size) | ||
517 | { | 535 | { |
518 | struct per_bio_data *pb = dm_per_bio_data(bio, sizeof(struct per_bio_data)); | 536 | struct per_bio_data *pb = dm_per_bio_data(bio, data_size); |
519 | BUG_ON(!pb); | 537 | BUG_ON(!pb); |
520 | return pb; | 538 | return pb; |
521 | } | 539 | } |
522 | 540 | ||
523 | static struct per_bio_data *init_per_bio_data(struct bio *bio) | 541 | static struct per_bio_data *init_per_bio_data(struct bio *bio, size_t data_size) |
524 | { | 542 | { |
525 | struct per_bio_data *pb = get_per_bio_data(bio); | 543 | struct per_bio_data *pb = get_per_bio_data(bio, data_size); |
526 | 544 | ||
527 | pb->tick = false; | 545 | pb->tick = false; |
528 | pb->req_nr = dm_bio_get_target_bio_nr(bio); | 546 | pb->req_nr = dm_bio_get_target_bio_nr(bio); |
@@ -556,7 +574,8 @@ static void remap_to_cache(struct cache *cache, struct bio *bio, | |||
556 | static void check_if_tick_bio_needed(struct cache *cache, struct bio *bio) | 574 | static void check_if_tick_bio_needed(struct cache *cache, struct bio *bio) |
557 | { | 575 | { |
558 | unsigned long flags; | 576 | unsigned long flags; |
559 | struct per_bio_data *pb = get_per_bio_data(bio); | 577 | size_t pb_data_size = get_per_bio_data_size(cache); |
578 | struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size); | ||
560 | 579 | ||
561 | spin_lock_irqsave(&cache->lock, flags); | 580 | spin_lock_irqsave(&cache->lock, flags); |
562 | if (cache->need_tick_bio && | 581 | if (cache->need_tick_bio && |
@@ -635,7 +654,7 @@ static void defer_writethrough_bio(struct cache *cache, struct bio *bio) | |||
635 | 654 | ||
636 | static void writethrough_endio(struct bio *bio, int err) | 655 | static void writethrough_endio(struct bio *bio, int err) |
637 | { | 656 | { |
638 | struct per_bio_data *pb = get_per_bio_data(bio); | 657 | struct per_bio_data *pb = get_per_bio_data(bio, PB_DATA_SIZE_WT); |
639 | bio->bi_end_io = pb->saved_bi_end_io; | 658 | bio->bi_end_io = pb->saved_bi_end_io; |
640 | 659 | ||
641 | if (err) { | 660 | if (err) { |
@@ -643,6 +662,7 @@ static void writethrough_endio(struct bio *bio, int err) | |||
643 | return; | 662 | return; |
644 | } | 663 | } |
645 | 664 | ||
665 | dm_bio_restore(&pb->bio_details, bio); | ||
646 | remap_to_cache(pb->cache, bio, pb->cblock); | 666 | remap_to_cache(pb->cache, bio, pb->cblock); |
647 | 667 | ||
648 | /* | 668 | /* |
@@ -662,11 +682,12 @@ static void writethrough_endio(struct bio *bio, int err) | |||
662 | static void remap_to_origin_then_cache(struct cache *cache, struct bio *bio, | 682 | static void remap_to_origin_then_cache(struct cache *cache, struct bio *bio, |
663 | dm_oblock_t oblock, dm_cblock_t cblock) | 683 | dm_oblock_t oblock, dm_cblock_t cblock) |
664 | { | 684 | { |
665 | struct per_bio_data *pb = get_per_bio_data(bio); | 685 | struct per_bio_data *pb = get_per_bio_data(bio, PB_DATA_SIZE_WT); |
666 | 686 | ||
667 | pb->cache = cache; | 687 | pb->cache = cache; |
668 | pb->cblock = cblock; | 688 | pb->cblock = cblock; |
669 | pb->saved_bi_end_io = bio->bi_end_io; | 689 | pb->saved_bi_end_io = bio->bi_end_io; |
690 | dm_bio_record(&pb->bio_details, bio); | ||
670 | bio->bi_end_io = writethrough_endio; | 691 | bio->bi_end_io = writethrough_endio; |
671 | 692 | ||
672 | remap_to_origin_clear_discard(pb->cache, bio, oblock); | 693 | remap_to_origin_clear_discard(pb->cache, bio, oblock); |
@@ -1035,7 +1056,8 @@ static void defer_bio(struct cache *cache, struct bio *bio) | |||
1035 | 1056 | ||
1036 | static void process_flush_bio(struct cache *cache, struct bio *bio) | 1057 | static void process_flush_bio(struct cache *cache, struct bio *bio) |
1037 | { | 1058 | { |
1038 | struct per_bio_data *pb = get_per_bio_data(bio); | 1059 | size_t pb_data_size = get_per_bio_data_size(cache); |
1060 | struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size); | ||
1039 | 1061 | ||
1040 | BUG_ON(bio->bi_size); | 1062 | BUG_ON(bio->bi_size); |
1041 | if (!pb->req_nr) | 1063 | if (!pb->req_nr) |
@@ -1107,7 +1129,8 @@ static void process_bio(struct cache *cache, struct prealloc *structs, | |||
1107 | dm_oblock_t block = get_bio_block(cache, bio); | 1129 | dm_oblock_t block = get_bio_block(cache, bio); |
1108 | struct dm_bio_prison_cell *cell_prealloc, *old_ocell, *new_ocell; | 1130 | struct dm_bio_prison_cell *cell_prealloc, *old_ocell, *new_ocell; |
1109 | struct policy_result lookup_result; | 1131 | struct policy_result lookup_result; |
1110 | struct per_bio_data *pb = get_per_bio_data(bio); | 1132 | size_t pb_data_size = get_per_bio_data_size(cache); |
1133 | struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size); | ||
1111 | bool discarded_block = is_discarded_oblock(cache, block); | 1134 | bool discarded_block = is_discarded_oblock(cache, block); |
1112 | bool can_migrate = discarded_block || spare_migration_bandwidth(cache); | 1135 | bool can_migrate = discarded_block || spare_migration_bandwidth(cache); |
1113 | 1136 | ||
@@ -1881,7 +1904,6 @@ static int cache_create(struct cache_args *ca, struct cache **result) | |||
1881 | 1904 | ||
1882 | cache->ti = ca->ti; | 1905 | cache->ti = ca->ti; |
1883 | ti->private = cache; | 1906 | ti->private = cache; |
1884 | ti->per_bio_data_size = sizeof(struct per_bio_data); | ||
1885 | ti->num_flush_bios = 2; | 1907 | ti->num_flush_bios = 2; |
1886 | ti->flush_supported = true; | 1908 | ti->flush_supported = true; |
1887 | 1909 | ||
@@ -1890,6 +1912,7 @@ static int cache_create(struct cache_args *ca, struct cache **result) | |||
1890 | ti->discard_zeroes_data_unsupported = true; | 1912 | ti->discard_zeroes_data_unsupported = true; |
1891 | 1913 | ||
1892 | memcpy(&cache->features, &ca->features, sizeof(cache->features)); | 1914 | memcpy(&cache->features, &ca->features, sizeof(cache->features)); |
1915 | ti->per_bio_data_size = get_per_bio_data_size(cache); | ||
1893 | 1916 | ||
1894 | cache->callbacks.congested_fn = cache_is_congested; | 1917 | cache->callbacks.congested_fn = cache_is_congested; |
1895 | dm_table_add_target_callbacks(ti->table, &cache->callbacks); | 1918 | dm_table_add_target_callbacks(ti->table, &cache->callbacks); |
@@ -2092,6 +2115,7 @@ static int cache_map(struct dm_target *ti, struct bio *bio) | |||
2092 | 2115 | ||
2093 | int r; | 2116 | int r; |
2094 | dm_oblock_t block = get_bio_block(cache, bio); | 2117 | dm_oblock_t block = get_bio_block(cache, bio); |
2118 | size_t pb_data_size = get_per_bio_data_size(cache); | ||
2095 | bool can_migrate = false; | 2119 | bool can_migrate = false; |
2096 | bool discarded_block; | 2120 | bool discarded_block; |
2097 | struct dm_bio_prison_cell *cell; | 2121 | struct dm_bio_prison_cell *cell; |
@@ -2108,7 +2132,7 @@ static int cache_map(struct dm_target *ti, struct bio *bio) | |||
2108 | return DM_MAPIO_REMAPPED; | 2132 | return DM_MAPIO_REMAPPED; |
2109 | } | 2133 | } |
2110 | 2134 | ||
2111 | pb = init_per_bio_data(bio); | 2135 | pb = init_per_bio_data(bio, pb_data_size); |
2112 | 2136 | ||
2113 | if (bio->bi_rw & (REQ_FLUSH | REQ_FUA | REQ_DISCARD)) { | 2137 | if (bio->bi_rw & (REQ_FLUSH | REQ_FUA | REQ_DISCARD)) { |
2114 | defer_bio(cache, bio); | 2138 | defer_bio(cache, bio); |
@@ -2193,7 +2217,8 @@ static int cache_end_io(struct dm_target *ti, struct bio *bio, int error) | |||
2193 | { | 2217 | { |
2194 | struct cache *cache = ti->private; | 2218 | struct cache *cache = ti->private; |
2195 | unsigned long flags; | 2219 | unsigned long flags; |
2196 | struct per_bio_data *pb = get_per_bio_data(bio); | 2220 | size_t pb_data_size = get_per_bio_data_size(cache); |
2221 | struct per_bio_data *pb = get_per_bio_data(bio, pb_data_size); | ||
2197 | 2222 | ||
2198 | if (pb->tick) { | 2223 | if (pb->tick) { |
2199 | policy_tick(cache->policy); | 2224 | policy_tick(cache->policy); |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 7e469260fe5e..9a0bdad9ad8f 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -611,6 +611,7 @@ static void dec_pending(struct dm_io *io, int error) | |||
611 | queue_io(md, bio); | 611 | queue_io(md, bio); |
612 | } else { | 612 | } else { |
613 | /* done with normal IO or empty flush */ | 613 | /* done with normal IO or empty flush */ |
614 | trace_block_bio_complete(md->queue, bio, io_error); | ||
614 | bio_endio(bio, io_error); | 615 | bio_endio(bio, io_error); |
615 | } | 616 | } |
616 | } | 617 | } |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 24909eb13fec..f4e87bfc7567 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -184,6 +184,8 @@ static void return_io(struct bio *return_bi) | |||
184 | return_bi = bi->bi_next; | 184 | return_bi = bi->bi_next; |
185 | bi->bi_next = NULL; | 185 | bi->bi_next = NULL; |
186 | bi->bi_size = 0; | 186 | bi->bi_size = 0; |
187 | trace_block_bio_complete(bdev_get_queue(bi->bi_bdev), | ||
188 | bi, 0); | ||
187 | bio_endio(bi, 0); | 189 | bio_endio(bi, 0); |
188 | bi = return_bi; | 190 | bi = return_bi; |
189 | } | 191 | } |
@@ -3914,6 +3916,8 @@ static void raid5_align_endio(struct bio *bi, int error) | |||
3914 | rdev_dec_pending(rdev, conf->mddev); | 3916 | rdev_dec_pending(rdev, conf->mddev); |
3915 | 3917 | ||
3916 | if (!error && uptodate) { | 3918 | if (!error && uptodate) { |
3919 | trace_block_bio_complete(bdev_get_queue(raid_bi->bi_bdev), | ||
3920 | raid_bi, 0); | ||
3917 | bio_endio(raid_bi, 0); | 3921 | bio_endio(raid_bi, 0); |
3918 | if (atomic_dec_and_test(&conf->active_aligned_reads)) | 3922 | if (atomic_dec_and_test(&conf->active_aligned_reads)) |
3919 | wake_up(&conf->wait_for_stripe); | 3923 | wake_up(&conf->wait_for_stripe); |
@@ -4382,6 +4386,8 @@ static void make_request(struct mddev *mddev, struct bio * bi) | |||
4382 | if ( rw == WRITE ) | 4386 | if ( rw == WRITE ) |
4383 | md_write_end(mddev); | 4387 | md_write_end(mddev); |
4384 | 4388 | ||
4389 | trace_block_bio_complete(bdev_get_queue(bi->bi_bdev), | ||
4390 | bi, 0); | ||
4385 | bio_endio(bi, 0); | 4391 | bio_endio(bi, 0); |
4386 | } | 4392 | } |
4387 | } | 4393 | } |
@@ -4758,8 +4764,11 @@ static int retry_aligned_read(struct r5conf *conf, struct bio *raid_bio) | |||
4758 | handled++; | 4764 | handled++; |
4759 | } | 4765 | } |
4760 | remaining = raid5_dec_bi_active_stripes(raid_bio); | 4766 | remaining = raid5_dec_bi_active_stripes(raid_bio); |
4761 | if (remaining == 0) | 4767 | if (remaining == 0) { |
4768 | trace_block_bio_complete(bdev_get_queue(raid_bio->bi_bdev), | ||
4769 | raid_bio, 0); | ||
4762 | bio_endio(raid_bio, 0); | 4770 | bio_endio(raid_bio, 0); |
4771 | } | ||
4763 | if (atomic_dec_and_test(&conf->active_aligned_reads)) | 4772 | if (atomic_dec_and_test(&conf->active_aligned_reads)) |
4764 | wake_up(&conf->wait_for_stripe); | 4773 | wake_up(&conf->wait_for_stripe); |
4765 | return handled; | 4774 | return handled; |
diff --git a/drivers/misc/vmw_vmci/Kconfig b/drivers/misc/vmw_vmci/Kconfig index 39c2ecadb273..ea98f7e9ccd1 100644 --- a/drivers/misc/vmw_vmci/Kconfig +++ b/drivers/misc/vmw_vmci/Kconfig | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | config VMWARE_VMCI | 5 | config VMWARE_VMCI |
6 | tristate "VMware VMCI Driver" | 6 | tristate "VMware VMCI Driver" |
7 | depends on X86 && PCI | 7 | depends on X86 && PCI && NET |
8 | help | 8 | help |
9 | This is VMware's Virtual Machine Communication Interface. It enables | 9 | This is VMware's Virtual Machine Communication Interface. It enables |
10 | high-speed communication between host and guest in a virtual | 10 | high-speed communication between host and guest in a virtual |
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 92ab30ab00dc..dc571ebc1aa0 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -1123,33 +1123,6 @@ static unsigned long mtdchar_get_unmapped_area(struct file *file, | |||
1123 | } | 1123 | } |
1124 | #endif | 1124 | #endif |
1125 | 1125 | ||
1126 | static inline unsigned long get_vm_size(struct vm_area_struct *vma) | ||
1127 | { | ||
1128 | return vma->vm_end - vma->vm_start; | ||
1129 | } | ||
1130 | |||
1131 | static inline resource_size_t get_vm_offset(struct vm_area_struct *vma) | ||
1132 | { | ||
1133 | return (resource_size_t) vma->vm_pgoff << PAGE_SHIFT; | ||
1134 | } | ||
1135 | |||
1136 | /* | ||
1137 | * Set a new vm offset. | ||
1138 | * | ||
1139 | * Verify that the incoming offset really works as a page offset, | ||
1140 | * and that the offset and size fit in a resource_size_t. | ||
1141 | */ | ||
1142 | static inline int set_vm_offset(struct vm_area_struct *vma, resource_size_t off) | ||
1143 | { | ||
1144 | pgoff_t pgoff = off >> PAGE_SHIFT; | ||
1145 | if (off != (resource_size_t) pgoff << PAGE_SHIFT) | ||
1146 | return -EINVAL; | ||
1147 | if (off + get_vm_size(vma) - 1 < off) | ||
1148 | return -EINVAL; | ||
1149 | vma->vm_pgoff = pgoff; | ||
1150 | return 0; | ||
1151 | } | ||
1152 | |||
1153 | /* | 1126 | /* |
1154 | * set up a mapping for shared memory segments | 1127 | * set up a mapping for shared memory segments |
1155 | */ | 1128 | */ |
@@ -1159,45 +1132,17 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma) | |||
1159 | struct mtd_file_info *mfi = file->private_data; | 1132 | struct mtd_file_info *mfi = file->private_data; |
1160 | struct mtd_info *mtd = mfi->mtd; | 1133 | struct mtd_info *mtd = mfi->mtd; |
1161 | struct map_info *map = mtd->priv; | 1134 | struct map_info *map = mtd->priv; |
1162 | resource_size_t start, off; | ||
1163 | unsigned long len, vma_len; | ||
1164 | 1135 | ||
1165 | /* This is broken because it assumes the MTD device is map-based | 1136 | /* This is broken because it assumes the MTD device is map-based |
1166 | and that mtd->priv is a valid struct map_info. It should be | 1137 | and that mtd->priv is a valid struct map_info. It should be |
1167 | replaced with something that uses the mtd_get_unmapped_area() | 1138 | replaced with something that uses the mtd_get_unmapped_area() |
1168 | operation properly. */ | 1139 | operation properly. */ |
1169 | if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/) { | 1140 | if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/) { |
1170 | off = get_vm_offset(vma); | ||
1171 | start = map->phys; | ||
1172 | len = PAGE_ALIGN((start & ~PAGE_MASK) + map->size); | ||
1173 | start &= PAGE_MASK; | ||
1174 | vma_len = get_vm_size(vma); | ||
1175 | |||
1176 | /* Overflow in off+len? */ | ||
1177 | if (vma_len + off < off) | ||
1178 | return -EINVAL; | ||
1179 | /* Does it fit in the mapping? */ | ||
1180 | if (vma_len + off > len) | ||
1181 | return -EINVAL; | ||
1182 | |||
1183 | off += start; | ||
1184 | /* Did that overflow? */ | ||
1185 | if (off < start) | ||
1186 | return -EINVAL; | ||
1187 | if (set_vm_offset(vma, off) < 0) | ||
1188 | return -EINVAL; | ||
1189 | vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; | ||
1190 | |||
1191 | #ifdef pgprot_noncached | 1141 | #ifdef pgprot_noncached |
1192 | if (file->f_flags & O_DSYNC || off >= __pa(high_memory)) | 1142 | if (file->f_flags & O_DSYNC || map->phys >= __pa(high_memory)) |
1193 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | 1143 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); |
1194 | #endif | 1144 | #endif |
1195 | if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, | 1145 | return vm_iomap_memory(vma, map->phys, map->size); |
1196 | vma->vm_end - vma->vm_start, | ||
1197 | vma->vm_page_prot)) | ||
1198 | return -EAGAIN; | ||
1199 | |||
1200 | return 0; | ||
1201 | } | 1146 | } |
1202 | return -ENOSYS; | 1147 | return -ENOSYS; |
1203 | #else | 1148 | #else |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 5e22126c7a26..532153db1f9c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -848,8 +848,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, | |||
848 | if (bond->dev->flags & IFF_ALLMULTI) | 848 | if (bond->dev->flags & IFF_ALLMULTI) |
849 | dev_set_allmulti(old_active->dev, -1); | 849 | dev_set_allmulti(old_active->dev, -1); |
850 | 850 | ||
851 | netif_addr_lock_bh(bond->dev); | ||
851 | netdev_for_each_mc_addr(ha, bond->dev) | 852 | netdev_for_each_mc_addr(ha, bond->dev) |
852 | dev_mc_del(old_active->dev, ha->addr); | 853 | dev_mc_del(old_active->dev, ha->addr); |
854 | netif_addr_unlock_bh(bond->dev); | ||
853 | } | 855 | } |
854 | 856 | ||
855 | if (new_active) { | 857 | if (new_active) { |
@@ -860,8 +862,10 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, | |||
860 | if (bond->dev->flags & IFF_ALLMULTI) | 862 | if (bond->dev->flags & IFF_ALLMULTI) |
861 | dev_set_allmulti(new_active->dev, 1); | 863 | dev_set_allmulti(new_active->dev, 1); |
862 | 864 | ||
865 | netif_addr_lock_bh(bond->dev); | ||
863 | netdev_for_each_mc_addr(ha, bond->dev) | 866 | netdev_for_each_mc_addr(ha, bond->dev) |
864 | dev_mc_add(new_active->dev, ha->addr); | 867 | dev_mc_add(new_active->dev, ha->addr); |
868 | netif_addr_unlock_bh(bond->dev); | ||
865 | } | 869 | } |
866 | } | 870 | } |
867 | 871 | ||
@@ -1903,11 +1907,29 @@ err_dest_symlinks: | |||
1903 | bond_destroy_slave_symlinks(bond_dev, slave_dev); | 1907 | bond_destroy_slave_symlinks(bond_dev, slave_dev); |
1904 | 1908 | ||
1905 | err_detach: | 1909 | err_detach: |
1910 | if (!USES_PRIMARY(bond->params.mode)) { | ||
1911 | netif_addr_lock_bh(bond_dev); | ||
1912 | bond_mc_list_flush(bond_dev, slave_dev); | ||
1913 | netif_addr_unlock_bh(bond_dev); | ||
1914 | } | ||
1915 | bond_del_vlans_from_slave(bond, slave_dev); | ||
1906 | write_lock_bh(&bond->lock); | 1916 | write_lock_bh(&bond->lock); |
1907 | bond_detach_slave(bond, new_slave); | 1917 | bond_detach_slave(bond, new_slave); |
1918 | if (bond->primary_slave == new_slave) | ||
1919 | bond->primary_slave = NULL; | ||
1908 | write_unlock_bh(&bond->lock); | 1920 | write_unlock_bh(&bond->lock); |
1921 | if (bond->curr_active_slave == new_slave) { | ||
1922 | read_lock(&bond->lock); | ||
1923 | write_lock_bh(&bond->curr_slave_lock); | ||
1924 | bond_change_active_slave(bond, NULL); | ||
1925 | bond_select_active_slave(bond); | ||
1926 | write_unlock_bh(&bond->curr_slave_lock); | ||
1927 | read_unlock(&bond->lock); | ||
1928 | } | ||
1929 | slave_disable_netpoll(new_slave); | ||
1909 | 1930 | ||
1910 | err_close: | 1931 | err_close: |
1932 | slave_dev->priv_flags &= ~IFF_BONDING; | ||
1911 | dev_close(slave_dev); | 1933 | dev_close(slave_dev); |
1912 | 1934 | ||
1913 | err_unset_master: | 1935 | err_unset_master: |
@@ -3172,11 +3194,20 @@ static int bond_slave_netdev_event(unsigned long event, | |||
3172 | struct net_device *slave_dev) | 3194 | struct net_device *slave_dev) |
3173 | { | 3195 | { |
3174 | struct slave *slave = bond_slave_get_rtnl(slave_dev); | 3196 | struct slave *slave = bond_slave_get_rtnl(slave_dev); |
3175 | struct bonding *bond = slave->bond; | 3197 | struct bonding *bond; |
3176 | struct net_device *bond_dev = slave->bond->dev; | 3198 | struct net_device *bond_dev; |
3177 | u32 old_speed; | 3199 | u32 old_speed; |
3178 | u8 old_duplex; | 3200 | u8 old_duplex; |
3179 | 3201 | ||
3202 | /* A netdev event can be generated while enslaving a device | ||
3203 | * before netdev_rx_handler_register is called in which case | ||
3204 | * slave will be NULL | ||
3205 | */ | ||
3206 | if (!slave) | ||
3207 | return NOTIFY_DONE; | ||
3208 | bond_dev = slave->bond->dev; | ||
3209 | bond = slave->bond; | ||
3210 | |||
3180 | switch (event) { | 3211 | switch (event) { |
3181 | case NETDEV_UNREGISTER: | 3212 | case NETDEV_UNREGISTER: |
3182 | if (bond->setup_by_slave) | 3213 | if (bond->setup_by_slave) |
@@ -3290,20 +3321,22 @@ static int bond_xmit_hash_policy_l2(struct sk_buff *skb, int count) | |||
3290 | */ | 3321 | */ |
3291 | static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count) | 3322 | static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count) |
3292 | { | 3323 | { |
3293 | struct ethhdr *data = (struct ethhdr *)skb->data; | 3324 | const struct ethhdr *data; |
3294 | struct iphdr *iph; | 3325 | const struct iphdr *iph; |
3295 | struct ipv6hdr *ipv6h; | 3326 | const struct ipv6hdr *ipv6h; |
3296 | u32 v6hash; | 3327 | u32 v6hash; |
3297 | __be32 *s, *d; | 3328 | const __be32 *s, *d; |
3298 | 3329 | ||
3299 | if (skb->protocol == htons(ETH_P_IP) && | 3330 | if (skb->protocol == htons(ETH_P_IP) && |
3300 | skb_network_header_len(skb) >= sizeof(*iph)) { | 3331 | pskb_network_may_pull(skb, sizeof(*iph))) { |
3301 | iph = ip_hdr(skb); | 3332 | iph = ip_hdr(skb); |
3333 | data = (struct ethhdr *)skb->data; | ||
3302 | return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^ | 3334 | return ((ntohl(iph->saddr ^ iph->daddr) & 0xffff) ^ |
3303 | (data->h_dest[5] ^ data->h_source[5])) % count; | 3335 | (data->h_dest[5] ^ data->h_source[5])) % count; |
3304 | } else if (skb->protocol == htons(ETH_P_IPV6) && | 3336 | } else if (skb->protocol == htons(ETH_P_IPV6) && |
3305 | skb_network_header_len(skb) >= sizeof(*ipv6h)) { | 3337 | pskb_network_may_pull(skb, sizeof(*ipv6h))) { |
3306 | ipv6h = ipv6_hdr(skb); | 3338 | ipv6h = ipv6_hdr(skb); |
3339 | data = (struct ethhdr *)skb->data; | ||
3307 | s = &ipv6h->saddr.s6_addr32[0]; | 3340 | s = &ipv6h->saddr.s6_addr32[0]; |
3308 | d = &ipv6h->daddr.s6_addr32[0]; | 3341 | d = &ipv6h->daddr.s6_addr32[0]; |
3309 | v6hash = (s[1] ^ d[1]) ^ (s[2] ^ d[2]) ^ (s[3] ^ d[3]); | 3342 | v6hash = (s[1] ^ d[1]) ^ (s[2] ^ d[2]) ^ (s[3] ^ d[3]); |
@@ -3322,33 +3355,36 @@ static int bond_xmit_hash_policy_l23(struct sk_buff *skb, int count) | |||
3322 | static int bond_xmit_hash_policy_l34(struct sk_buff *skb, int count) | 3355 | static int bond_xmit_hash_policy_l34(struct sk_buff *skb, int count) |
3323 | { | 3356 | { |
3324 | u32 layer4_xor = 0; | 3357 | u32 layer4_xor = 0; |
3325 | struct iphdr *iph; | 3358 | const struct iphdr *iph; |
3326 | struct ipv6hdr *ipv6h; | 3359 | const struct ipv6hdr *ipv6h; |
3327 | __be32 *s, *d; | 3360 | const __be32 *s, *d; |
3328 | __be16 *layer4hdr; | 3361 | const __be16 *l4 = NULL; |
3362 | __be16 _l4[2]; | ||
3363 | int noff = skb_network_offset(skb); | ||
3364 | int poff; | ||
3329 | 3365 | ||
3330 | if (skb->protocol == htons(ETH_P_IP) && | 3366 | if (skb->protocol == htons(ETH_P_IP) && |
3331 | skb_network_header_len(skb) >= sizeof(*iph)) { | 3367 | pskb_may_pull(skb, noff + sizeof(*iph))) { |
3332 | iph = ip_hdr(skb); | 3368 | iph = ip_hdr(skb); |
3333 | if (!ip_is_fragment(iph) && | 3369 | poff = proto_ports_offset(iph->protocol); |
3334 | (iph->protocol == IPPROTO_TCP || | 3370 | |
3335 | iph->protocol == IPPROTO_UDP) && | 3371 | if (!ip_is_fragment(iph) && poff >= 0) { |
3336 | (skb_headlen(skb) - skb_network_offset(skb) >= | 3372 | l4 = skb_header_pointer(skb, noff + (iph->ihl << 2) + poff, |
3337 | iph->ihl * sizeof(u32) + sizeof(*layer4hdr) * 2)) { | 3373 | sizeof(_l4), &_l4); |
3338 | layer4hdr = (__be16 *)((u32 *)iph + iph->ihl); | 3374 | if (l4) |
3339 | layer4_xor = ntohs(*layer4hdr ^ *(layer4hdr + 1)); | 3375 | layer4_xor = ntohs(l4[0] ^ l4[1]); |
3340 | } | 3376 | } |
3341 | return (layer4_xor ^ | 3377 | return (layer4_xor ^ |
3342 | ((ntohl(iph->saddr ^ iph->daddr)) & 0xffff)) % count; | 3378 | ((ntohl(iph->saddr ^ iph->daddr)) & 0xffff)) % count; |
3343 | } else if (skb->protocol == htons(ETH_P_IPV6) && | 3379 | } else if (skb->protocol == htons(ETH_P_IPV6) && |
3344 | skb_network_header_len(skb) >= sizeof(*ipv6h)) { | 3380 | pskb_may_pull(skb, noff + sizeof(*ipv6h))) { |
3345 | ipv6h = ipv6_hdr(skb); | 3381 | ipv6h = ipv6_hdr(skb); |
3346 | if ((ipv6h->nexthdr == IPPROTO_TCP || | 3382 | poff = proto_ports_offset(ipv6h->nexthdr); |
3347 | ipv6h->nexthdr == IPPROTO_UDP) && | 3383 | if (poff >= 0) { |
3348 | (skb_headlen(skb) - skb_network_offset(skb) >= | 3384 | l4 = skb_header_pointer(skb, noff + sizeof(*ipv6h) + poff, |
3349 | sizeof(*ipv6h) + sizeof(*layer4hdr) * 2)) { | 3385 | sizeof(_l4), &_l4); |
3350 | layer4hdr = (__be16 *)(ipv6h + 1); | 3386 | if (l4) |
3351 | layer4_xor = ntohs(*layer4hdr ^ *(layer4hdr + 1)); | 3387 | layer4_xor = ntohs(l4[0] ^ l4[1]); |
3352 | } | 3388 | } |
3353 | s = &ipv6h->saddr.s6_addr32[0]; | 3389 | s = &ipv6h->saddr.s6_addr32[0]; |
3354 | d = &ipv6h->daddr.s6_addr32[0]; | 3390 | d = &ipv6h->daddr.s6_addr32[0]; |
@@ -4882,9 +4918,18 @@ static int __net_init bond_net_init(struct net *net) | |||
4882 | static void __net_exit bond_net_exit(struct net *net) | 4918 | static void __net_exit bond_net_exit(struct net *net) |
4883 | { | 4919 | { |
4884 | struct bond_net *bn = net_generic(net, bond_net_id); | 4920 | struct bond_net *bn = net_generic(net, bond_net_id); |
4921 | struct bonding *bond, *tmp_bond; | ||
4922 | LIST_HEAD(list); | ||
4885 | 4923 | ||
4886 | bond_destroy_sysfs(bn); | 4924 | bond_destroy_sysfs(bn); |
4887 | bond_destroy_proc_dir(bn); | 4925 | bond_destroy_proc_dir(bn); |
4926 | |||
4927 | /* Kill off any bonds created after unregistering bond rtnl ops */ | ||
4928 | rtnl_lock(); | ||
4929 | list_for_each_entry_safe(bond, tmp_bond, &bn->dev_list, bond_list) | ||
4930 | unregister_netdevice_queue(bond->dev, &list); | ||
4931 | unregister_netdevice_many(&list); | ||
4932 | rtnl_unlock(); | ||
4888 | } | 4933 | } |
4889 | 4934 | ||
4890 | static struct pernet_operations bond_net_ops = { | 4935 | static struct pernet_operations bond_net_ops = { |
@@ -4938,8 +4983,8 @@ static void __exit bonding_exit(void) | |||
4938 | 4983 | ||
4939 | bond_destroy_debugfs(); | 4984 | bond_destroy_debugfs(); |
4940 | 4985 | ||
4941 | unregister_pernet_subsys(&bond_net_ops); | ||
4942 | rtnl_link_unregister(&bond_link_ops); | 4986 | rtnl_link_unregister(&bond_link_ops); |
4987 | unregister_pernet_subsys(&bond_net_ops); | ||
4943 | 4988 | ||
4944 | #ifdef CONFIG_NET_POLL_CONTROLLER | 4989 | #ifdef CONFIG_NET_POLL_CONTROLLER |
4945 | /* | 4990 | /* |
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c index 55033dd57afb..8cda23bf0614 100644 --- a/drivers/net/can/mcp251x.c +++ b/drivers/net/can/mcp251x.c | |||
@@ -929,6 +929,7 @@ static int mcp251x_open(struct net_device *net) | |||
929 | struct mcp251x_priv *priv = netdev_priv(net); | 929 | struct mcp251x_priv *priv = netdev_priv(net); |
930 | struct spi_device *spi = priv->spi; | 930 | struct spi_device *spi = priv->spi; |
931 | struct mcp251x_platform_data *pdata = spi->dev.platform_data; | 931 | struct mcp251x_platform_data *pdata = spi->dev.platform_data; |
932 | unsigned long flags; | ||
932 | int ret; | 933 | int ret; |
933 | 934 | ||
934 | ret = open_candev(net); | 935 | ret = open_candev(net); |
@@ -945,9 +946,14 @@ static int mcp251x_open(struct net_device *net) | |||
945 | priv->tx_skb = NULL; | 946 | priv->tx_skb = NULL; |
946 | priv->tx_len = 0; | 947 | priv->tx_len = 0; |
947 | 948 | ||
949 | flags = IRQF_ONESHOT; | ||
950 | if (pdata->irq_flags) | ||
951 | flags |= pdata->irq_flags; | ||
952 | else | ||
953 | flags |= IRQF_TRIGGER_FALLING; | ||
954 | |||
948 | ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist, | 955 | ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist, |
949 | pdata->irq_flags ? pdata->irq_flags : IRQF_TRIGGER_FALLING, | 956 | flags, DEVICE_NAME, priv); |
950 | DEVICE_NAME, priv); | ||
951 | if (ret) { | 957 | if (ret) { |
952 | dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq); | 958 | dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq); |
953 | if (pdata->transceiver_enable) | 959 | if (pdata->transceiver_enable) |
diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c index 6433b81256cd..8e0c4a001939 100644 --- a/drivers/net/can/sja1000/sja1000_of_platform.c +++ b/drivers/net/can/sja1000/sja1000_of_platform.c | |||
@@ -96,8 +96,8 @@ static int sja1000_ofp_probe(struct platform_device *ofdev) | |||
96 | struct net_device *dev; | 96 | struct net_device *dev; |
97 | struct sja1000_priv *priv; | 97 | struct sja1000_priv *priv; |
98 | struct resource res; | 98 | struct resource res; |
99 | const u32 *prop; | 99 | u32 prop; |
100 | int err, irq, res_size, prop_size; | 100 | int err, irq, res_size; |
101 | void __iomem *base; | 101 | void __iomem *base; |
102 | 102 | ||
103 | err = of_address_to_resource(np, 0, &res); | 103 | err = of_address_to_resource(np, 0, &res); |
@@ -138,27 +138,27 @@ static int sja1000_ofp_probe(struct platform_device *ofdev) | |||
138 | priv->read_reg = sja1000_ofp_read_reg; | 138 | priv->read_reg = sja1000_ofp_read_reg; |
139 | priv->write_reg = sja1000_ofp_write_reg; | 139 | priv->write_reg = sja1000_ofp_write_reg; |
140 | 140 | ||
141 | prop = of_get_property(np, "nxp,external-clock-frequency", &prop_size); | 141 | err = of_property_read_u32(np, "nxp,external-clock-frequency", &prop); |
142 | if (prop && (prop_size == sizeof(u32))) | 142 | if (!err) |
143 | priv->can.clock.freq = *prop / 2; | 143 | priv->can.clock.freq = prop / 2; |
144 | else | 144 | else |
145 | priv->can.clock.freq = SJA1000_OFP_CAN_CLOCK; /* default */ | 145 | priv->can.clock.freq = SJA1000_OFP_CAN_CLOCK; /* default */ |
146 | 146 | ||
147 | prop = of_get_property(np, "nxp,tx-output-mode", &prop_size); | 147 | err = of_property_read_u32(np, "nxp,tx-output-mode", &prop); |
148 | if (prop && (prop_size == sizeof(u32))) | 148 | if (!err) |
149 | priv->ocr |= *prop & OCR_MODE_MASK; | 149 | priv->ocr |= prop & OCR_MODE_MASK; |
150 | else | 150 | else |
151 | priv->ocr |= OCR_MODE_NORMAL; /* default */ | 151 | priv->ocr |= OCR_MODE_NORMAL; /* default */ |
152 | 152 | ||
153 | prop = of_get_property(np, "nxp,tx-output-config", &prop_size); | 153 | err = of_property_read_u32(np, "nxp,tx-output-config", &prop); |
154 | if (prop && (prop_size == sizeof(u32))) | 154 | if (!err) |
155 | priv->ocr |= (*prop << OCR_TX_SHIFT) & OCR_TX_MASK; | 155 | priv->ocr |= (prop << OCR_TX_SHIFT) & OCR_TX_MASK; |
156 | else | 156 | else |
157 | priv->ocr |= OCR_TX0_PULLDOWN; /* default */ | 157 | priv->ocr |= OCR_TX0_PULLDOWN; /* default */ |
158 | 158 | ||
159 | prop = of_get_property(np, "nxp,clock-out-frequency", &prop_size); | 159 | err = of_property_read_u32(np, "nxp,clock-out-frequency", &prop); |
160 | if (prop && (prop_size == sizeof(u32)) && *prop) { | 160 | if (!err && prop) { |
161 | u32 divider = priv->can.clock.freq * 2 / *prop; | 161 | u32 divider = priv->can.clock.freq * 2 / prop; |
162 | 162 | ||
163 | if (divider > 1) | 163 | if (divider > 1) |
164 | priv->cdr |= divider / 2 - 1; | 164 | priv->cdr |= divider / 2 - 1; |
@@ -168,8 +168,7 @@ static int sja1000_ofp_probe(struct platform_device *ofdev) | |||
168 | priv->cdr |= CDR_CLK_OFF; /* default */ | 168 | priv->cdr |= CDR_CLK_OFF; /* default */ |
169 | } | 169 | } |
170 | 170 | ||
171 | prop = of_get_property(np, "nxp,no-comparator-bypass", NULL); | 171 | if (!of_property_read_bool(np, "nxp,no-comparator-bypass")) |
172 | if (!prop) | ||
173 | priv->cdr |= CDR_CBP; /* default */ | 172 | priv->cdr |= CDR_CBP; /* default */ |
174 | 173 | ||
175 | priv->irq_flags = IRQF_SHARED; | 174 | priv->irq_flags = IRQF_SHARED; |
diff --git a/drivers/net/ethernet/8390/ax88796.c b/drivers/net/ethernet/8390/ax88796.c index cab306a9888e..e1d26433d619 100644 --- a/drivers/net/ethernet/8390/ax88796.c +++ b/drivers/net/ethernet/8390/ax88796.c | |||
@@ -828,7 +828,7 @@ static int ax_probe(struct platform_device *pdev) | |||
828 | struct ei_device *ei_local; | 828 | struct ei_device *ei_local; |
829 | struct ax_device *ax; | 829 | struct ax_device *ax; |
830 | struct resource *irq, *mem, *mem2; | 830 | struct resource *irq, *mem, *mem2; |
831 | resource_size_t mem_size, mem2_size = 0; | 831 | unsigned long mem_size, mem2_size = 0; |
832 | int ret = 0; | 832 | int ret = 0; |
833 | 833 | ||
834 | dev = ax__alloc_ei_netdev(sizeof(struct ax_device)); | 834 | dev = ax__alloc_ei_netdev(sizeof(struct ax_device)); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 6b50443d3456..d72bd8c40aa1 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -2615,6 +2615,9 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
2615 | } | 2615 | } |
2616 | } | 2616 | } |
2617 | 2617 | ||
2618 | /* initialize FW coalescing state machines in RAM */ | ||
2619 | bnx2x_update_coalesce(bp); | ||
2620 | |||
2618 | /* setup the leading queue */ | 2621 | /* setup the leading queue */ |
2619 | rc = bnx2x_setup_leading(bp); | 2622 | rc = bnx2x_setup_leading(bp); |
2620 | if (rc) { | 2623 | if (rc) { |
@@ -4737,11 +4740,11 @@ static void storm_memset_hc_disable(struct bnx2x *bp, u8 port, | |||
4737 | u32 enable_flag = disable ? 0 : (1 << HC_INDEX_DATA_HC_ENABLED_SHIFT); | 4740 | u32 enable_flag = disable ? 0 : (1 << HC_INDEX_DATA_HC_ENABLED_SHIFT); |
4738 | u32 addr = BAR_CSTRORM_INTMEM + | 4741 | u32 addr = BAR_CSTRORM_INTMEM + |
4739 | CSTORM_STATUS_BLOCK_DATA_FLAGS_OFFSET(fw_sb_id, sb_index); | 4742 | CSTORM_STATUS_BLOCK_DATA_FLAGS_OFFSET(fw_sb_id, sb_index); |
4740 | u16 flags = REG_RD16(bp, addr); | 4743 | u8 flags = REG_RD8(bp, addr); |
4741 | /* clear and set */ | 4744 | /* clear and set */ |
4742 | flags &= ~HC_INDEX_DATA_HC_ENABLED; | 4745 | flags &= ~HC_INDEX_DATA_HC_ENABLED; |
4743 | flags |= enable_flag; | 4746 | flags |= enable_flag; |
4744 | REG_WR16(bp, addr, flags); | 4747 | REG_WR8(bp, addr, flags); |
4745 | DP(NETIF_MSG_IFUP, | 4748 | DP(NETIF_MSG_IFUP, |
4746 | "port %x fw_sb_id %d sb_index %d disable %d\n", | 4749 | "port %x fw_sb_id %d sb_index %d disable %d\n", |
4747 | port, fw_sb_id, sb_index, disable); | 4750 | port, fw_sb_id, sb_index, disable); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 1e60c5d139d1..86d13870399e 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -4959,7 +4959,7 @@ static void bnx2x_after_function_update(struct bnx2x *bp) | |||
4959 | q); | 4959 | q); |
4960 | } | 4960 | } |
4961 | 4961 | ||
4962 | if (!NO_FCOE(bp)) { | 4962 | if (!NO_FCOE(bp) && CNIC_ENABLED(bp)) { |
4963 | fp = &bp->fp[FCOE_IDX(bp)]; | 4963 | fp = &bp->fp[FCOE_IDX(bp)]; |
4964 | queue_params.q_obj = &bnx2x_sp_obj(bp, fp).q_obj; | 4964 | queue_params.q_obj = &bnx2x_sp_obj(bp, fp).q_obj; |
4965 | 4965 | ||
@@ -9946,6 +9946,10 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp) | |||
9946 | REG_RD(bp, NIG_REG_NIG_INT_STS_CLR_0); | 9946 | REG_RD(bp, NIG_REG_NIG_INT_STS_CLR_0); |
9947 | } | 9947 | } |
9948 | } | 9948 | } |
9949 | if (!CHIP_IS_E1x(bp)) | ||
9950 | /* block FW from writing to host */ | ||
9951 | REG_WR(bp, PGLUE_B_REG_INTERNAL_PFID_ENABLE_MASTER, 0); | ||
9952 | |||
9949 | /* wait until BRB is empty */ | 9953 | /* wait until BRB is empty */ |
9950 | tmp_reg = REG_RD(bp, BRB1_REG_NUM_OF_FULL_BLOCKS); | 9954 | tmp_reg = REG_RD(bp, BRB1_REG_NUM_OF_FULL_BLOCKS); |
9951 | while (timer_count) { | 9955 | while (timer_count) { |
@@ -13450,6 +13454,7 @@ static int bnx2x_unregister_cnic(struct net_device *dev) | |||
13450 | RCU_INIT_POINTER(bp->cnic_ops, NULL); | 13454 | RCU_INIT_POINTER(bp->cnic_ops, NULL); |
13451 | mutex_unlock(&bp->cnic_mutex); | 13455 | mutex_unlock(&bp->cnic_mutex); |
13452 | synchronize_rcu(); | 13456 | synchronize_rcu(); |
13457 | bp->cnic_enabled = false; | ||
13453 | kfree(bp->cnic_kwq); | 13458 | kfree(bp->cnic_kwq); |
13454 | bp->cnic_kwq = NULL; | 13459 | bp->cnic_kwq = NULL; |
13455 | 13460 | ||
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 21808680b91f..654e7820daa0 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -772,8 +772,9 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter, | |||
772 | 772 | ||
773 | if (vlan_tx_tag_present(skb)) { | 773 | if (vlan_tx_tag_present(skb)) { |
774 | vlan_tag = be_get_tx_vlan_tag(adapter, skb); | 774 | vlan_tag = be_get_tx_vlan_tag(adapter, skb); |
775 | __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); | 775 | skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag); |
776 | skb->vlan_tci = 0; | 776 | if (skb) |
777 | skb->vlan_tci = 0; | ||
777 | } | 778 | } |
778 | 779 | ||
779 | return skb; | 780 | return skb; |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 20890874ead7..2451ab1b5a83 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -997,6 +997,7 @@ static void fec_enet_adjust_link(struct net_device *ndev) | |||
997 | } else { | 997 | } else { |
998 | if (fep->link) { | 998 | if (fep->link) { |
999 | fec_stop(ndev); | 999 | fec_stop(ndev); |
1000 | fep->link = phy_dev->link; | ||
1000 | status_change = 1; | 1001 | status_change = 1; |
1001 | } | 1002 | } |
1002 | } | 1003 | } |
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c index ec800b093e7e..d2bea3f07c73 100644 --- a/drivers/net/ethernet/intel/e100.c +++ b/drivers/net/ethernet/intel/e100.c | |||
@@ -870,7 +870,7 @@ err_unlock: | |||
870 | } | 870 | } |
871 | 871 | ||
872 | static int e100_exec_cb(struct nic *nic, struct sk_buff *skb, | 872 | static int e100_exec_cb(struct nic *nic, struct sk_buff *skb, |
873 | void (*cb_prepare)(struct nic *, struct cb *, struct sk_buff *)) | 873 | int (*cb_prepare)(struct nic *, struct cb *, struct sk_buff *)) |
874 | { | 874 | { |
875 | struct cb *cb; | 875 | struct cb *cb; |
876 | unsigned long flags; | 876 | unsigned long flags; |
@@ -888,10 +888,13 @@ static int e100_exec_cb(struct nic *nic, struct sk_buff *skb, | |||
888 | nic->cbs_avail--; | 888 | nic->cbs_avail--; |
889 | cb->skb = skb; | 889 | cb->skb = skb; |
890 | 890 | ||
891 | err = cb_prepare(nic, cb, skb); | ||
892 | if (err) | ||
893 | goto err_unlock; | ||
894 | |||
891 | if (unlikely(!nic->cbs_avail)) | 895 | if (unlikely(!nic->cbs_avail)) |
892 | err = -ENOSPC; | 896 | err = -ENOSPC; |
893 | 897 | ||
894 | cb_prepare(nic, cb, skb); | ||
895 | 898 | ||
896 | /* Order is important otherwise we'll be in a race with h/w: | 899 | /* Order is important otherwise we'll be in a race with h/w: |
897 | * set S-bit in current first, then clear S-bit in previous. */ | 900 | * set S-bit in current first, then clear S-bit in previous. */ |
@@ -1091,7 +1094,7 @@ static void e100_get_defaults(struct nic *nic) | |||
1091 | nic->mii.mdio_write = mdio_write; | 1094 | nic->mii.mdio_write = mdio_write; |
1092 | } | 1095 | } |
1093 | 1096 | ||
1094 | static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb) | 1097 | static int e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb) |
1095 | { | 1098 | { |
1096 | struct config *config = &cb->u.config; | 1099 | struct config *config = &cb->u.config; |
1097 | u8 *c = (u8 *)config; | 1100 | u8 *c = (u8 *)config; |
@@ -1181,6 +1184,7 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb) | |||
1181 | netif_printk(nic, hw, KERN_DEBUG, nic->netdev, | 1184 | netif_printk(nic, hw, KERN_DEBUG, nic->netdev, |
1182 | "[16-23]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", | 1185 | "[16-23]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", |
1183 | c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]); | 1186 | c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]); |
1187 | return 0; | ||
1184 | } | 1188 | } |
1185 | 1189 | ||
1186 | /************************************************************************* | 1190 | /************************************************************************* |
@@ -1331,7 +1335,7 @@ static const struct firmware *e100_request_firmware(struct nic *nic) | |||
1331 | return fw; | 1335 | return fw; |
1332 | } | 1336 | } |
1333 | 1337 | ||
1334 | static void e100_setup_ucode(struct nic *nic, struct cb *cb, | 1338 | static int e100_setup_ucode(struct nic *nic, struct cb *cb, |
1335 | struct sk_buff *skb) | 1339 | struct sk_buff *skb) |
1336 | { | 1340 | { |
1337 | const struct firmware *fw = (void *)skb; | 1341 | const struct firmware *fw = (void *)skb; |
@@ -1358,6 +1362,7 @@ static void e100_setup_ucode(struct nic *nic, struct cb *cb, | |||
1358 | cb->u.ucode[min_size] |= cpu_to_le32((BUNDLESMALL) ? 0xFFFF : 0xFF80); | 1362 | cb->u.ucode[min_size] |= cpu_to_le32((BUNDLESMALL) ? 0xFFFF : 0xFF80); |
1359 | 1363 | ||
1360 | cb->command = cpu_to_le16(cb_ucode | cb_el); | 1364 | cb->command = cpu_to_le16(cb_ucode | cb_el); |
1365 | return 0; | ||
1361 | } | 1366 | } |
1362 | 1367 | ||
1363 | static inline int e100_load_ucode_wait(struct nic *nic) | 1368 | static inline int e100_load_ucode_wait(struct nic *nic) |
@@ -1400,18 +1405,20 @@ static inline int e100_load_ucode_wait(struct nic *nic) | |||
1400 | return err; | 1405 | return err; |
1401 | } | 1406 | } |
1402 | 1407 | ||
1403 | static void e100_setup_iaaddr(struct nic *nic, struct cb *cb, | 1408 | static int e100_setup_iaaddr(struct nic *nic, struct cb *cb, |
1404 | struct sk_buff *skb) | 1409 | struct sk_buff *skb) |
1405 | { | 1410 | { |
1406 | cb->command = cpu_to_le16(cb_iaaddr); | 1411 | cb->command = cpu_to_le16(cb_iaaddr); |
1407 | memcpy(cb->u.iaaddr, nic->netdev->dev_addr, ETH_ALEN); | 1412 | memcpy(cb->u.iaaddr, nic->netdev->dev_addr, ETH_ALEN); |
1413 | return 0; | ||
1408 | } | 1414 | } |
1409 | 1415 | ||
1410 | static void e100_dump(struct nic *nic, struct cb *cb, struct sk_buff *skb) | 1416 | static int e100_dump(struct nic *nic, struct cb *cb, struct sk_buff *skb) |
1411 | { | 1417 | { |
1412 | cb->command = cpu_to_le16(cb_dump); | 1418 | cb->command = cpu_to_le16(cb_dump); |
1413 | cb->u.dump_buffer_addr = cpu_to_le32(nic->dma_addr + | 1419 | cb->u.dump_buffer_addr = cpu_to_le32(nic->dma_addr + |
1414 | offsetof(struct mem, dump_buf)); | 1420 | offsetof(struct mem, dump_buf)); |
1421 | return 0; | ||
1415 | } | 1422 | } |
1416 | 1423 | ||
1417 | static int e100_phy_check_without_mii(struct nic *nic) | 1424 | static int e100_phy_check_without_mii(struct nic *nic) |
@@ -1581,7 +1588,7 @@ static int e100_hw_init(struct nic *nic) | |||
1581 | return 0; | 1588 | return 0; |
1582 | } | 1589 | } |
1583 | 1590 | ||
1584 | static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb) | 1591 | static int e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb) |
1585 | { | 1592 | { |
1586 | struct net_device *netdev = nic->netdev; | 1593 | struct net_device *netdev = nic->netdev; |
1587 | struct netdev_hw_addr *ha; | 1594 | struct netdev_hw_addr *ha; |
@@ -1596,6 +1603,7 @@ static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb) | |||
1596 | memcpy(&cb->u.multi.addr[i++ * ETH_ALEN], &ha->addr, | 1603 | memcpy(&cb->u.multi.addr[i++ * ETH_ALEN], &ha->addr, |
1597 | ETH_ALEN); | 1604 | ETH_ALEN); |
1598 | } | 1605 | } |
1606 | return 0; | ||
1599 | } | 1607 | } |
1600 | 1608 | ||
1601 | static void e100_set_multicast_list(struct net_device *netdev) | 1609 | static void e100_set_multicast_list(struct net_device *netdev) |
@@ -1756,11 +1764,18 @@ static void e100_watchdog(unsigned long data) | |||
1756 | round_jiffies(jiffies + E100_WATCHDOG_PERIOD)); | 1764 | round_jiffies(jiffies + E100_WATCHDOG_PERIOD)); |
1757 | } | 1765 | } |
1758 | 1766 | ||
1759 | static void e100_xmit_prepare(struct nic *nic, struct cb *cb, | 1767 | static int e100_xmit_prepare(struct nic *nic, struct cb *cb, |
1760 | struct sk_buff *skb) | 1768 | struct sk_buff *skb) |
1761 | { | 1769 | { |
1770 | dma_addr_t dma_addr; | ||
1762 | cb->command = nic->tx_command; | 1771 | cb->command = nic->tx_command; |
1763 | 1772 | ||
1773 | dma_addr = pci_map_single(nic->pdev, | ||
1774 | skb->data, skb->len, PCI_DMA_TODEVICE); | ||
1775 | /* If we can't map the skb, have the upper layer try later */ | ||
1776 | if (pci_dma_mapping_error(nic->pdev, dma_addr)) | ||
1777 | return -ENOMEM; | ||
1778 | |||
1764 | /* | 1779 | /* |
1765 | * Use the last 4 bytes of the SKB payload packet as the CRC, used for | 1780 | * Use the last 4 bytes of the SKB payload packet as the CRC, used for |
1766 | * testing, ie sending frames with bad CRC. | 1781 | * testing, ie sending frames with bad CRC. |
@@ -1777,11 +1792,10 @@ static void e100_xmit_prepare(struct nic *nic, struct cb *cb, | |||
1777 | cb->u.tcb.tcb_byte_count = 0; | 1792 | cb->u.tcb.tcb_byte_count = 0; |
1778 | cb->u.tcb.threshold = nic->tx_threshold; | 1793 | cb->u.tcb.threshold = nic->tx_threshold; |
1779 | cb->u.tcb.tbd_count = 1; | 1794 | cb->u.tcb.tbd_count = 1; |
1780 | cb->u.tcb.tbd.buf_addr = cpu_to_le32(pci_map_single(nic->pdev, | 1795 | cb->u.tcb.tbd.buf_addr = cpu_to_le32(dma_addr); |
1781 | skb->data, skb->len, PCI_DMA_TODEVICE)); | ||
1782 | /* check for mapping failure? */ | ||
1783 | cb->u.tcb.tbd.size = cpu_to_le16(skb->len); | 1796 | cb->u.tcb.tbd.size = cpu_to_le16(skb->len); |
1784 | skb_tx_timestamp(skb); | 1797 | skb_tx_timestamp(skb); |
1798 | return 0; | ||
1785 | } | 1799 | } |
1786 | 1800 | ||
1787 | static netdev_tx_t e100_xmit_frame(struct sk_buff *skb, | 1801 | static netdev_tx_t e100_xmit_frame(struct sk_buff *skb, |
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h index c92115e71ebe..9d6c075e232d 100644 --- a/drivers/net/ethernet/intel/igb/igb.h +++ b/drivers/net/ethernet/intel/igb/igb.h | |||
@@ -293,18 +293,10 @@ struct igb_q_vector { | |||
293 | enum e1000_ring_flags_t { | 293 | enum e1000_ring_flags_t { |
294 | IGB_RING_FLAG_RX_SCTP_CSUM, | 294 | IGB_RING_FLAG_RX_SCTP_CSUM, |
295 | IGB_RING_FLAG_RX_LB_VLAN_BSWAP, | 295 | IGB_RING_FLAG_RX_LB_VLAN_BSWAP, |
296 | IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, | ||
297 | IGB_RING_FLAG_TX_CTX_IDX, | 296 | IGB_RING_FLAG_TX_CTX_IDX, |
298 | IGB_RING_FLAG_TX_DETECT_HANG | 297 | IGB_RING_FLAG_TX_DETECT_HANG |
299 | }; | 298 | }; |
300 | 299 | ||
301 | #define ring_uses_build_skb(ring) \ | ||
302 | test_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags) | ||
303 | #define set_ring_build_skb_enabled(ring) \ | ||
304 | set_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags) | ||
305 | #define clear_ring_build_skb_enabled(ring) \ | ||
306 | clear_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags) | ||
307 | |||
308 | #define IGB_TXD_DCMD (E1000_ADVTXD_DCMD_EOP | E1000_ADVTXD_DCMD_RS) | 300 | #define IGB_TXD_DCMD (E1000_ADVTXD_DCMD_EOP | E1000_ADVTXD_DCMD_RS) |
309 | 301 | ||
310 | #define IGB_RX_DESC(R, i) \ | 302 | #define IGB_RX_DESC(R, i) \ |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 9bf08b977daa..dcaa35481dd7 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -3387,20 +3387,6 @@ void igb_configure_rx_ring(struct igb_adapter *adapter, | |||
3387 | wr32(E1000_RXDCTL(reg_idx), rxdctl); | 3387 | wr32(E1000_RXDCTL(reg_idx), rxdctl); |
3388 | } | 3388 | } |
3389 | 3389 | ||
3390 | static void igb_set_rx_buffer_len(struct igb_adapter *adapter, | ||
3391 | struct igb_ring *rx_ring) | ||
3392 | { | ||
3393 | #define IGB_MAX_BUILD_SKB_SIZE \ | ||
3394 | (SKB_WITH_OVERHEAD(IGB_RX_BUFSZ) - \ | ||
3395 | (NET_SKB_PAD + NET_IP_ALIGN + IGB_TS_HDR_LEN)) | ||
3396 | |||
3397 | /* set build_skb flag */ | ||
3398 | if (adapter->max_frame_size <= IGB_MAX_BUILD_SKB_SIZE) | ||
3399 | set_ring_build_skb_enabled(rx_ring); | ||
3400 | else | ||
3401 | clear_ring_build_skb_enabled(rx_ring); | ||
3402 | } | ||
3403 | |||
3404 | /** | 3390 | /** |
3405 | * igb_configure_rx - Configure receive Unit after Reset | 3391 | * igb_configure_rx - Configure receive Unit after Reset |
3406 | * @adapter: board private structure | 3392 | * @adapter: board private structure |
@@ -3421,11 +3407,8 @@ static void igb_configure_rx(struct igb_adapter *adapter) | |||
3421 | /* Setup the HW Rx Head and Tail Descriptor Pointers and | 3407 | /* Setup the HW Rx Head and Tail Descriptor Pointers and |
3422 | * the Base and Length of the Rx Descriptor Ring | 3408 | * the Base and Length of the Rx Descriptor Ring |
3423 | */ | 3409 | */ |
3424 | for (i = 0; i < adapter->num_rx_queues; i++) { | 3410 | for (i = 0; i < adapter->num_rx_queues; i++) |
3425 | struct igb_ring *rx_ring = adapter->rx_ring[i]; | 3411 | igb_configure_rx_ring(adapter, adapter->rx_ring[i]); |
3426 | igb_set_rx_buffer_len(adapter, rx_ring); | ||
3427 | igb_configure_rx_ring(adapter, rx_ring); | ||
3428 | } | ||
3429 | } | 3412 | } |
3430 | 3413 | ||
3431 | /** | 3414 | /** |
@@ -6238,78 +6221,6 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring, | |||
6238 | return igb_can_reuse_rx_page(rx_buffer, page, truesize); | 6221 | return igb_can_reuse_rx_page(rx_buffer, page, truesize); |
6239 | } | 6222 | } |
6240 | 6223 | ||
6241 | static struct sk_buff *igb_build_rx_buffer(struct igb_ring *rx_ring, | ||
6242 | union e1000_adv_rx_desc *rx_desc) | ||
6243 | { | ||
6244 | struct igb_rx_buffer *rx_buffer; | ||
6245 | struct sk_buff *skb; | ||
6246 | struct page *page; | ||
6247 | void *page_addr; | ||
6248 | unsigned int size = le16_to_cpu(rx_desc->wb.upper.length); | ||
6249 | #if (PAGE_SIZE < 8192) | ||
6250 | unsigned int truesize = IGB_RX_BUFSZ; | ||
6251 | #else | ||
6252 | unsigned int truesize = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) + | ||
6253 | SKB_DATA_ALIGN(NET_SKB_PAD + | ||
6254 | NET_IP_ALIGN + | ||
6255 | size); | ||
6256 | #endif | ||
6257 | |||
6258 | /* If we spanned a buffer we have a huge mess so test for it */ | ||
6259 | BUG_ON(unlikely(!igb_test_staterr(rx_desc, E1000_RXD_STAT_EOP))); | ||
6260 | |||
6261 | rx_buffer = &rx_ring->rx_buffer_info[rx_ring->next_to_clean]; | ||
6262 | page = rx_buffer->page; | ||
6263 | prefetchw(page); | ||
6264 | |||
6265 | page_addr = page_address(page) + rx_buffer->page_offset; | ||
6266 | |||
6267 | /* prefetch first cache line of first page */ | ||
6268 | prefetch(page_addr + NET_SKB_PAD + NET_IP_ALIGN); | ||
6269 | #if L1_CACHE_BYTES < 128 | ||
6270 | prefetch(page_addr + L1_CACHE_BYTES + NET_SKB_PAD + NET_IP_ALIGN); | ||
6271 | #endif | ||
6272 | |||
6273 | /* build an skb to around the page buffer */ | ||
6274 | skb = build_skb(page_addr, truesize); | ||
6275 | if (unlikely(!skb)) { | ||
6276 | rx_ring->rx_stats.alloc_failed++; | ||
6277 | return NULL; | ||
6278 | } | ||
6279 | |||
6280 | /* we are reusing so sync this buffer for CPU use */ | ||
6281 | dma_sync_single_range_for_cpu(rx_ring->dev, | ||
6282 | rx_buffer->dma, | ||
6283 | rx_buffer->page_offset, | ||
6284 | IGB_RX_BUFSZ, | ||
6285 | DMA_FROM_DEVICE); | ||
6286 | |||
6287 | /* update pointers within the skb to store the data */ | ||
6288 | skb_reserve(skb, NET_IP_ALIGN + NET_SKB_PAD); | ||
6289 | __skb_put(skb, size); | ||
6290 | |||
6291 | /* pull timestamp out of packet data */ | ||
6292 | if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP)) { | ||
6293 | igb_ptp_rx_pktstamp(rx_ring->q_vector, skb->data, skb); | ||
6294 | __skb_pull(skb, IGB_TS_HDR_LEN); | ||
6295 | } | ||
6296 | |||
6297 | if (igb_can_reuse_rx_page(rx_buffer, page, truesize)) { | ||
6298 | /* hand second half of page back to the ring */ | ||
6299 | igb_reuse_rx_page(rx_ring, rx_buffer); | ||
6300 | } else { | ||
6301 | /* we are not reusing the buffer so unmap it */ | ||
6302 | dma_unmap_page(rx_ring->dev, rx_buffer->dma, | ||
6303 | PAGE_SIZE, DMA_FROM_DEVICE); | ||
6304 | } | ||
6305 | |||
6306 | /* clear contents of buffer_info */ | ||
6307 | rx_buffer->dma = 0; | ||
6308 | rx_buffer->page = NULL; | ||
6309 | |||
6310 | return skb; | ||
6311 | } | ||
6312 | |||
6313 | static struct sk_buff *igb_fetch_rx_buffer(struct igb_ring *rx_ring, | 6224 | static struct sk_buff *igb_fetch_rx_buffer(struct igb_ring *rx_ring, |
6314 | union e1000_adv_rx_desc *rx_desc, | 6225 | union e1000_adv_rx_desc *rx_desc, |
6315 | struct sk_buff *skb) | 6226 | struct sk_buff *skb) |
@@ -6719,10 +6630,7 @@ static bool igb_clean_rx_irq(struct igb_q_vector *q_vector, const int budget) | |||
6719 | rmb(); | 6630 | rmb(); |
6720 | 6631 | ||
6721 | /* retrieve a buffer from the ring */ | 6632 | /* retrieve a buffer from the ring */ |
6722 | if (ring_uses_build_skb(rx_ring)) | 6633 | skb = igb_fetch_rx_buffer(rx_ring, rx_desc, skb); |
6723 | skb = igb_build_rx_buffer(rx_ring, rx_desc); | ||
6724 | else | ||
6725 | skb = igb_fetch_rx_buffer(rx_ring, rx_desc, skb); | ||
6726 | 6634 | ||
6727 | /* exit if we failed to retrieve a buffer */ | 6635 | /* exit if we failed to retrieve a buffer */ |
6728 | if (!skb) | 6636 | if (!skb) |
@@ -6808,14 +6716,6 @@ static bool igb_alloc_mapped_page(struct igb_ring *rx_ring, | |||
6808 | return true; | 6716 | return true; |
6809 | } | 6717 | } |
6810 | 6718 | ||
6811 | static inline unsigned int igb_rx_offset(struct igb_ring *rx_ring) | ||
6812 | { | ||
6813 | if (ring_uses_build_skb(rx_ring)) | ||
6814 | return NET_SKB_PAD + NET_IP_ALIGN; | ||
6815 | else | ||
6816 | return 0; | ||
6817 | } | ||
6818 | |||
6819 | /** | 6719 | /** |
6820 | * igb_alloc_rx_buffers - Replace used receive buffers; packet split | 6720 | * igb_alloc_rx_buffers - Replace used receive buffers; packet split |
6821 | * @adapter: address of board private structure | 6721 | * @adapter: address of board private structure |
@@ -6841,9 +6741,7 @@ void igb_alloc_rx_buffers(struct igb_ring *rx_ring, u16 cleaned_count) | |||
6841 | /* Refresh the desc even if buffer_addrs didn't change | 6741 | /* Refresh the desc even if buffer_addrs didn't change |
6842 | * because each write-back erases this info. | 6742 | * because each write-back erases this info. |
6843 | */ | 6743 | */ |
6844 | rx_desc->read.pkt_addr = cpu_to_le64(bi->dma + | 6744 | rx_desc->read.pkt_addr = cpu_to_le64(bi->dma + bi->page_offset); |
6845 | bi->page_offset + | ||
6846 | igb_rx_offset(rx_ring)); | ||
6847 | 6745 | ||
6848 | rx_desc++; | 6746 | rx_desc++; |
6849 | bi++; | 6747 | bi++; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index 2d4bdcc4fdbe..1e7d587c4e57 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | |||
@@ -1052,6 +1052,12 @@ int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos) | |||
1052 | if ((vf >= adapter->num_vfs) || (vlan > 4095) || (qos > 7)) | 1052 | if ((vf >= adapter->num_vfs) || (vlan > 4095) || (qos > 7)) |
1053 | return -EINVAL; | 1053 | return -EINVAL; |
1054 | if (vlan || qos) { | 1054 | if (vlan || qos) { |
1055 | if (adapter->vfinfo[vf].pf_vlan) | ||
1056 | err = ixgbe_set_vf_vlan(adapter, false, | ||
1057 | adapter->vfinfo[vf].pf_vlan, | ||
1058 | vf); | ||
1059 | if (err) | ||
1060 | goto out; | ||
1055 | err = ixgbe_set_vf_vlan(adapter, true, vlan, vf); | 1061 | err = ixgbe_set_vf_vlan(adapter, true, vlan, vf); |
1056 | if (err) | 1062 | if (err) |
1057 | goto out; | 1063 | goto out; |
diff --git a/drivers/net/ethernet/marvell/Kconfig b/drivers/net/ethernet/marvell/Kconfig index 0051f0ef3cd0..a49e81bdf8e8 100644 --- a/drivers/net/ethernet/marvell/Kconfig +++ b/drivers/net/ethernet/marvell/Kconfig | |||
@@ -33,6 +33,7 @@ config MV643XX_ETH | |||
33 | 33 | ||
34 | config MVMDIO | 34 | config MVMDIO |
35 | tristate "Marvell MDIO interface support" | 35 | tristate "Marvell MDIO interface support" |
36 | select PHYLIB | ||
36 | ---help--- | 37 | ---help--- |
37 | This driver supports the MDIO interface found in the network | 38 | This driver supports the MDIO interface found in the network |
38 | interface units of the Marvell EBU SoCs (Kirkwood, Orion5x, | 39 | interface units of the Marvell EBU SoCs (Kirkwood, Orion5x, |
@@ -43,7 +44,6 @@ config MVMDIO | |||
43 | config MVNETA | 44 | config MVNETA |
44 | tristate "Marvell Armada 370/XP network interface support" | 45 | tristate "Marvell Armada 370/XP network interface support" |
45 | depends on MACH_ARMADA_370_XP | 46 | depends on MACH_ARMADA_370_XP |
46 | select PHYLIB | ||
47 | select MVMDIO | 47 | select MVMDIO |
48 | ---help--- | 48 | ---help--- |
49 | This driver supports the network interface units in the | 49 | This driver supports the network interface units in the |
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index e48261e468f3..c96678555233 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c | |||
@@ -374,7 +374,6 @@ static int rxq_number = 8; | |||
374 | static int txq_number = 8; | 374 | static int txq_number = 8; |
375 | 375 | ||
376 | static int rxq_def; | 376 | static int rxq_def; |
377 | static int txq_def; | ||
378 | 377 | ||
379 | #define MVNETA_DRIVER_NAME "mvneta" | 378 | #define MVNETA_DRIVER_NAME "mvneta" |
380 | #define MVNETA_DRIVER_VERSION "1.0" | 379 | #define MVNETA_DRIVER_VERSION "1.0" |
@@ -1475,7 +1474,8 @@ error: | |||
1475 | static int mvneta_tx(struct sk_buff *skb, struct net_device *dev) | 1474 | static int mvneta_tx(struct sk_buff *skb, struct net_device *dev) |
1476 | { | 1475 | { |
1477 | struct mvneta_port *pp = netdev_priv(dev); | 1476 | struct mvneta_port *pp = netdev_priv(dev); |
1478 | struct mvneta_tx_queue *txq = &pp->txqs[txq_def]; | 1477 | u16 txq_id = skb_get_queue_mapping(skb); |
1478 | struct mvneta_tx_queue *txq = &pp->txqs[txq_id]; | ||
1479 | struct mvneta_tx_desc *tx_desc; | 1479 | struct mvneta_tx_desc *tx_desc; |
1480 | struct netdev_queue *nq; | 1480 | struct netdev_queue *nq; |
1481 | int frags = 0; | 1481 | int frags = 0; |
@@ -1485,7 +1485,7 @@ static int mvneta_tx(struct sk_buff *skb, struct net_device *dev) | |||
1485 | goto out; | 1485 | goto out; |
1486 | 1486 | ||
1487 | frags = skb_shinfo(skb)->nr_frags + 1; | 1487 | frags = skb_shinfo(skb)->nr_frags + 1; |
1488 | nq = netdev_get_tx_queue(dev, txq_def); | 1488 | nq = netdev_get_tx_queue(dev, txq_id); |
1489 | 1489 | ||
1490 | /* Get a descriptor for the first part of the packet */ | 1490 | /* Get a descriptor for the first part of the packet */ |
1491 | tx_desc = mvneta_txq_next_desc_get(txq); | 1491 | tx_desc = mvneta_txq_next_desc_get(txq); |
@@ -2679,7 +2679,7 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2679 | return -EINVAL; | 2679 | return -EINVAL; |
2680 | } | 2680 | } |
2681 | 2681 | ||
2682 | dev = alloc_etherdev_mq(sizeof(struct mvneta_port), 8); | 2682 | dev = alloc_etherdev_mqs(sizeof(struct mvneta_port), txq_number, rxq_number); |
2683 | if (!dev) | 2683 | if (!dev) |
2684 | return -ENOMEM; | 2684 | return -ENOMEM; |
2685 | 2685 | ||
@@ -2761,16 +2761,17 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2761 | 2761 | ||
2762 | netif_napi_add(dev, &pp->napi, mvneta_poll, pp->weight); | 2762 | netif_napi_add(dev, &pp->napi, mvneta_poll, pp->weight); |
2763 | 2763 | ||
2764 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM; | ||
2765 | dev->hw_features |= NETIF_F_SG | NETIF_F_IP_CSUM; | ||
2766 | dev->vlan_features |= NETIF_F_SG | NETIF_F_IP_CSUM; | ||
2767 | dev->priv_flags |= IFF_UNICAST_FLT; | ||
2768 | |||
2764 | err = register_netdev(dev); | 2769 | err = register_netdev(dev); |
2765 | if (err < 0) { | 2770 | if (err < 0) { |
2766 | dev_err(&pdev->dev, "failed to register\n"); | 2771 | dev_err(&pdev->dev, "failed to register\n"); |
2767 | goto err_deinit; | 2772 | goto err_deinit; |
2768 | } | 2773 | } |
2769 | 2774 | ||
2770 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM; | ||
2771 | dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM; | ||
2772 | dev->priv_flags |= IFF_UNICAST_FLT; | ||
2773 | |||
2774 | netdev_info(dev, "mac: %pM\n", dev->dev_addr); | 2775 | netdev_info(dev, "mac: %pM\n", dev->dev_addr); |
2775 | 2776 | ||
2776 | platform_set_drvdata(pdev, pp->dev); | 2777 | platform_set_drvdata(pdev, pp->dev); |
@@ -2833,4 +2834,3 @@ module_param(rxq_number, int, S_IRUGO); | |||
2833 | module_param(txq_number, int, S_IRUGO); | 2834 | module_param(txq_number, int, S_IRUGO); |
2834 | 2835 | ||
2835 | module_param(rxq_def, int, S_IRUGO); | 2836 | module_param(rxq_def, int, S_IRUGO); |
2836 | module_param(txq_def, int, S_IRUGO); | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c index 32a95c105e4e..fd0829c2839d 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | |||
@@ -1619,6 +1619,12 @@ int qlcnic_83xx_loopback_test(struct net_device *netdev, u8 mode) | |||
1619 | } | 1619 | } |
1620 | } while ((adapter->ahw->linkup && ahw->has_link_events) != 1); | 1620 | } while ((adapter->ahw->linkup && ahw->has_link_events) != 1); |
1621 | 1621 | ||
1622 | /* Make sure carrier is off and queue is stopped during loopback */ | ||
1623 | if (netif_running(netdev)) { | ||
1624 | netif_carrier_off(netdev); | ||
1625 | netif_stop_queue(netdev); | ||
1626 | } | ||
1627 | |||
1622 | ret = qlcnic_do_lb_test(adapter, mode); | 1628 | ret = qlcnic_do_lb_test(adapter, mode); |
1623 | 1629 | ||
1624 | qlcnic_83xx_clear_lb_mode(adapter, mode); | 1630 | qlcnic_83xx_clear_lb_mode(adapter, mode); |
@@ -2944,6 +2950,7 @@ static u64 *qlcnic_83xx_fill_stats(struct qlcnic_adapter *adapter, | |||
2944 | void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data) | 2950 | void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data) |
2945 | { | 2951 | { |
2946 | struct qlcnic_cmd_args cmd; | 2952 | struct qlcnic_cmd_args cmd; |
2953 | struct net_device *netdev = adapter->netdev; | ||
2947 | int ret = 0; | 2954 | int ret = 0; |
2948 | 2955 | ||
2949 | qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_GET_STATISTICS); | 2956 | qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_GET_STATISTICS); |
@@ -2953,7 +2960,7 @@ void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data) | |||
2953 | data = qlcnic_83xx_fill_stats(adapter, &cmd, data, | 2960 | data = qlcnic_83xx_fill_stats(adapter, &cmd, data, |
2954 | QLC_83XX_STAT_TX, &ret); | 2961 | QLC_83XX_STAT_TX, &ret); |
2955 | if (ret) { | 2962 | if (ret) { |
2956 | dev_info(&adapter->pdev->dev, "Error getting MAC stats\n"); | 2963 | netdev_err(netdev, "Error getting Tx stats\n"); |
2957 | goto out; | 2964 | goto out; |
2958 | } | 2965 | } |
2959 | /* Get MAC stats */ | 2966 | /* Get MAC stats */ |
@@ -2963,8 +2970,7 @@ void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data) | |||
2963 | data = qlcnic_83xx_fill_stats(adapter, &cmd, data, | 2970 | data = qlcnic_83xx_fill_stats(adapter, &cmd, data, |
2964 | QLC_83XX_STAT_MAC, &ret); | 2971 | QLC_83XX_STAT_MAC, &ret); |
2965 | if (ret) { | 2972 | if (ret) { |
2966 | dev_info(&adapter->pdev->dev, | 2973 | netdev_err(netdev, "Error getting MAC stats\n"); |
2967 | "Error getting Rx stats\n"); | ||
2968 | goto out; | 2974 | goto out; |
2969 | } | 2975 | } |
2970 | /* Get Rx stats */ | 2976 | /* Get Rx stats */ |
@@ -2974,8 +2980,7 @@ void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data) | |||
2974 | data = qlcnic_83xx_fill_stats(adapter, &cmd, data, | 2980 | data = qlcnic_83xx_fill_stats(adapter, &cmd, data, |
2975 | QLC_83XX_STAT_RX, &ret); | 2981 | QLC_83XX_STAT_RX, &ret); |
2976 | if (ret) | 2982 | if (ret) |
2977 | dev_info(&adapter->pdev->dev, | 2983 | netdev_err(netdev, "Error getting Rx stats\n"); |
2978 | "Error getting Tx stats\n"); | ||
2979 | out: | 2984 | out: |
2980 | qlcnic_free_mbx_args(&cmd); | 2985 | qlcnic_free_mbx_args(&cmd); |
2981 | } | 2986 | } |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c index 356859b9f21c..d3f8797efcc3 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | |||
@@ -362,8 +362,7 @@ set_flags: | |||
362 | memcpy(&first_desc->eth_addr, skb->data, ETH_ALEN); | 362 | memcpy(&first_desc->eth_addr, skb->data, ETH_ALEN); |
363 | } | 363 | } |
364 | opcode = TX_ETHER_PKT; | 364 | opcode = TX_ETHER_PKT; |
365 | if ((adapter->netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) && | 365 | if (skb_is_gso(skb)) { |
366 | skb_shinfo(skb)->gso_size > 0) { | ||
367 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); | 366 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
368 | first_desc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); | 367 | first_desc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); |
369 | first_desc->total_hdr_length = hdr_len; | 368 | first_desc->total_hdr_length = hdr_len; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c index c77675da671f..4e22e794a186 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | |||
@@ -198,10 +198,10 @@ beacon_err: | |||
198 | } | 198 | } |
199 | 199 | ||
200 | err = qlcnic_config_led(adapter, b_state, b_rate); | 200 | err = qlcnic_config_led(adapter, b_state, b_rate); |
201 | if (!err) | 201 | if (!err) { |
202 | err = len; | 202 | err = len; |
203 | else | ||
204 | ahw->beacon_state = b_state; | 203 | ahw->beacon_state = b_state; |
204 | } | ||
205 | 205 | ||
206 | if (test_and_clear_bit(__QLCNIC_DIAG_RES_ALLOC, &adapter->state)) | 206 | if (test_and_clear_bit(__QLCNIC_DIAG_RES_ALLOC, &adapter->state)) |
207 | qlcnic_diag_free_res(adapter->netdev, max_sds_rings); | 207 | qlcnic_diag_free_res(adapter->netdev, max_sds_rings); |
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge.h b/drivers/net/ethernet/qlogic/qlge/qlge.h index a131d7b5d2fe..7e8d68263963 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge.h +++ b/drivers/net/ethernet/qlogic/qlge/qlge.h | |||
@@ -18,7 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | #define DRV_NAME "qlge" | 19 | #define DRV_NAME "qlge" |
20 | #define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver " | 20 | #define DRV_STRING "QLogic 10 Gigabit PCI-E Ethernet Driver " |
21 | #define DRV_VERSION "v1.00.00.31" | 21 | #define DRV_VERSION "v1.00.00.32" |
22 | 22 | ||
23 | #define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */ | 23 | #define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */ |
24 | 24 | ||
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c b/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c index 6f316ab23257..0780e039b271 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c | |||
@@ -379,13 +379,13 @@ static int ql_get_settings(struct net_device *ndev, | |||
379 | 379 | ||
380 | ecmd->supported = SUPPORTED_10000baseT_Full; | 380 | ecmd->supported = SUPPORTED_10000baseT_Full; |
381 | ecmd->advertising = ADVERTISED_10000baseT_Full; | 381 | ecmd->advertising = ADVERTISED_10000baseT_Full; |
382 | ecmd->autoneg = AUTONEG_ENABLE; | ||
383 | ecmd->transceiver = XCVR_EXTERNAL; | 382 | ecmd->transceiver = XCVR_EXTERNAL; |
384 | if ((qdev->link_status & STS_LINK_TYPE_MASK) == | 383 | if ((qdev->link_status & STS_LINK_TYPE_MASK) == |
385 | STS_LINK_TYPE_10GBASET) { | 384 | STS_LINK_TYPE_10GBASET) { |
386 | ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg); | 385 | ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg); |
387 | ecmd->advertising |= (ADVERTISED_TP | ADVERTISED_Autoneg); | 386 | ecmd->advertising |= (ADVERTISED_TP | ADVERTISED_Autoneg); |
388 | ecmd->port = PORT_TP; | 387 | ecmd->port = PORT_TP; |
388 | ecmd->autoneg = AUTONEG_ENABLE; | ||
389 | } else { | 389 | } else { |
390 | ecmd->supported |= SUPPORTED_FIBRE; | 390 | ecmd->supported |= SUPPORTED_FIBRE; |
391 | ecmd->advertising |= ADVERTISED_FIBRE; | 391 | ecmd->advertising |= ADVERTISED_FIBRE; |
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index 44cf72ac2489..87463bc701a6 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c | |||
@@ -1432,11 +1432,13 @@ map_error: | |||
1432 | } | 1432 | } |
1433 | 1433 | ||
1434 | /* Categorizing receive firmware frame errors */ | 1434 | /* Categorizing receive firmware frame errors */ |
1435 | static void ql_categorize_rx_err(struct ql_adapter *qdev, u8 rx_err) | 1435 | static void ql_categorize_rx_err(struct ql_adapter *qdev, u8 rx_err, |
1436 | struct rx_ring *rx_ring) | ||
1436 | { | 1437 | { |
1437 | struct nic_stats *stats = &qdev->nic_stats; | 1438 | struct nic_stats *stats = &qdev->nic_stats; |
1438 | 1439 | ||
1439 | stats->rx_err_count++; | 1440 | stats->rx_err_count++; |
1441 | rx_ring->rx_errors++; | ||
1440 | 1442 | ||
1441 | switch (rx_err & IB_MAC_IOCB_RSP_ERR_MASK) { | 1443 | switch (rx_err & IB_MAC_IOCB_RSP_ERR_MASK) { |
1442 | case IB_MAC_IOCB_RSP_ERR_CODE_ERR: | 1444 | case IB_MAC_IOCB_RSP_ERR_CODE_ERR: |
@@ -1472,6 +1474,12 @@ static void ql_process_mac_rx_gro_page(struct ql_adapter *qdev, | |||
1472 | struct bq_desc *lbq_desc = ql_get_curr_lchunk(qdev, rx_ring); | 1474 | struct bq_desc *lbq_desc = ql_get_curr_lchunk(qdev, rx_ring); |
1473 | struct napi_struct *napi = &rx_ring->napi; | 1475 | struct napi_struct *napi = &rx_ring->napi; |
1474 | 1476 | ||
1477 | /* Frame error, so drop the packet. */ | ||
1478 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) { | ||
1479 | ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring); | ||
1480 | put_page(lbq_desc->p.pg_chunk.page); | ||
1481 | return; | ||
1482 | } | ||
1475 | napi->dev = qdev->ndev; | 1483 | napi->dev = qdev->ndev; |
1476 | 1484 | ||
1477 | skb = napi_get_frags(napi); | 1485 | skb = napi_get_frags(napi); |
@@ -1525,6 +1533,12 @@ static void ql_process_mac_rx_page(struct ql_adapter *qdev, | |||
1525 | addr = lbq_desc->p.pg_chunk.va; | 1533 | addr = lbq_desc->p.pg_chunk.va; |
1526 | prefetch(addr); | 1534 | prefetch(addr); |
1527 | 1535 | ||
1536 | /* Frame error, so drop the packet. */ | ||
1537 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) { | ||
1538 | ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring); | ||
1539 | goto err_out; | ||
1540 | } | ||
1541 | |||
1528 | /* The max framesize filter on this chip is set higher than | 1542 | /* The max framesize filter on this chip is set higher than |
1529 | * MTU since FCoE uses 2k frames. | 1543 | * MTU since FCoE uses 2k frames. |
1530 | */ | 1544 | */ |
@@ -1608,6 +1622,13 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev, | |||
1608 | memcpy(skb_put(new_skb, length), skb->data, length); | 1622 | memcpy(skb_put(new_skb, length), skb->data, length); |
1609 | skb = new_skb; | 1623 | skb = new_skb; |
1610 | 1624 | ||
1625 | /* Frame error, so drop the packet. */ | ||
1626 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) { | ||
1627 | ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring); | ||
1628 | dev_kfree_skb_any(skb); | ||
1629 | return; | ||
1630 | } | ||
1631 | |||
1611 | /* loopback self test for ethtool */ | 1632 | /* loopback self test for ethtool */ |
1612 | if (test_bit(QL_SELFTEST, &qdev->flags)) { | 1633 | if (test_bit(QL_SELFTEST, &qdev->flags)) { |
1613 | ql_check_lb_frame(qdev, skb); | 1634 | ql_check_lb_frame(qdev, skb); |
@@ -1913,6 +1934,13 @@ static void ql_process_mac_split_rx_intr(struct ql_adapter *qdev, | |||
1913 | return; | 1934 | return; |
1914 | } | 1935 | } |
1915 | 1936 | ||
1937 | /* Frame error, so drop the packet. */ | ||
1938 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) { | ||
1939 | ql_categorize_rx_err(qdev, ib_mac_rsp->flags2, rx_ring); | ||
1940 | dev_kfree_skb_any(skb); | ||
1941 | return; | ||
1942 | } | ||
1943 | |||
1916 | /* The max framesize filter on this chip is set higher than | 1944 | /* The max framesize filter on this chip is set higher than |
1917 | * MTU since FCoE uses 2k frames. | 1945 | * MTU since FCoE uses 2k frames. |
1918 | */ | 1946 | */ |
@@ -1994,12 +2022,6 @@ static unsigned long ql_process_mac_rx_intr(struct ql_adapter *qdev, | |||
1994 | 2022 | ||
1995 | QL_DUMP_IB_MAC_RSP(ib_mac_rsp); | 2023 | QL_DUMP_IB_MAC_RSP(ib_mac_rsp); |
1996 | 2024 | ||
1997 | /* Frame error, so drop the packet. */ | ||
1998 | if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) { | ||
1999 | ql_categorize_rx_err(qdev, ib_mac_rsp->flags2); | ||
2000 | return (unsigned long)length; | ||
2001 | } | ||
2002 | |||
2003 | if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) { | 2025 | if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) { |
2004 | /* The data and headers are split into | 2026 | /* The data and headers are split into |
2005 | * separate buffers. | 2027 | * separate buffers. |
diff --git a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c index 0c74a702d461..50617c5a0bdb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c | |||
@@ -149,6 +149,7 @@ void dwmac_mmc_intr_all_mask(void __iomem *ioaddr) | |||
149 | { | 149 | { |
150 | writel(MMC_DEFAULT_MASK, ioaddr + MMC_RX_INTR_MASK); | 150 | writel(MMC_DEFAULT_MASK, ioaddr + MMC_RX_INTR_MASK); |
151 | writel(MMC_DEFAULT_MASK, ioaddr + MMC_TX_INTR_MASK); | 151 | writel(MMC_DEFAULT_MASK, ioaddr + MMC_TX_INTR_MASK); |
152 | writel(MMC_DEFAULT_MASK, ioaddr + MMC_RX_IPC_INTR_MASK); | ||
152 | } | 153 | } |
153 | 154 | ||
154 | /* This reads the MAC core counters (if actaully supported). | 155 | /* This reads the MAC core counters (if actaully supported). |
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 5cf8d03b8cae..25c364209a21 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -1520,7 +1520,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
1520 | memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN); | 1520 | memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN); |
1521 | 1521 | ||
1522 | if (data->dual_emac) { | 1522 | if (data->dual_emac) { |
1523 | if (of_property_read_u32(node, "dual_emac_res_vlan", | 1523 | if (of_property_read_u32(slave_node, "dual_emac_res_vlan", |
1524 | &prop)) { | 1524 | &prop)) { |
1525 | pr_err("Missing dual_emac_res_vlan in DT.\n"); | 1525 | pr_err("Missing dual_emac_res_vlan in DT.\n"); |
1526 | slave_data->dual_emac_res_vlan = i+1; | 1526 | slave_data->dual_emac_res_vlan = i+1; |
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 1cd77483da50..f5f0f09e4cc5 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c | |||
@@ -470,8 +470,10 @@ static void netvsc_send_completion(struct hv_device *device, | |||
470 | packet->trans_id; | 470 | packet->trans_id; |
471 | 471 | ||
472 | /* Notify the layer above us */ | 472 | /* Notify the layer above us */ |
473 | nvsc_packet->completion.send.send_completion( | 473 | if (nvsc_packet) |
474 | nvsc_packet->completion.send.send_completion_ctx); | 474 | nvsc_packet->completion.send.send_completion( |
475 | nvsc_packet->completion.send. | ||
476 | send_completion_ctx); | ||
475 | 477 | ||
476 | num_outstanding_sends = | 478 | num_outstanding_sends = |
477 | atomic_dec_return(&net_device->num_outstanding_sends); | 479 | atomic_dec_return(&net_device->num_outstanding_sends); |
@@ -498,6 +500,7 @@ int netvsc_send(struct hv_device *device, | |||
498 | int ret = 0; | 500 | int ret = 0; |
499 | struct nvsp_message sendMessage; | 501 | struct nvsp_message sendMessage; |
500 | struct net_device *ndev; | 502 | struct net_device *ndev; |
503 | u64 req_id; | ||
501 | 504 | ||
502 | net_device = get_outbound_net_device(device); | 505 | net_device = get_outbound_net_device(device); |
503 | if (!net_device) | 506 | if (!net_device) |
@@ -518,20 +521,24 @@ int netvsc_send(struct hv_device *device, | |||
518 | 0xFFFFFFFF; | 521 | 0xFFFFFFFF; |
519 | sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0; | 522 | sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0; |
520 | 523 | ||
524 | if (packet->completion.send.send_completion) | ||
525 | req_id = (u64)packet; | ||
526 | else | ||
527 | req_id = 0; | ||
528 | |||
521 | if (packet->page_buf_cnt) { | 529 | if (packet->page_buf_cnt) { |
522 | ret = vmbus_sendpacket_pagebuffer(device->channel, | 530 | ret = vmbus_sendpacket_pagebuffer(device->channel, |
523 | packet->page_buf, | 531 | packet->page_buf, |
524 | packet->page_buf_cnt, | 532 | packet->page_buf_cnt, |
525 | &sendMessage, | 533 | &sendMessage, |
526 | sizeof(struct nvsp_message), | 534 | sizeof(struct nvsp_message), |
527 | (unsigned long)packet); | 535 | req_id); |
528 | } else { | 536 | } else { |
529 | ret = vmbus_sendpacket(device->channel, &sendMessage, | 537 | ret = vmbus_sendpacket(device->channel, &sendMessage, |
530 | sizeof(struct nvsp_message), | 538 | sizeof(struct nvsp_message), |
531 | (unsigned long)packet, | 539 | req_id, |
532 | VM_PKT_DATA_INBAND, | 540 | VM_PKT_DATA_INBAND, |
533 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); | 541 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); |
534 | |||
535 | } | 542 | } |
536 | 543 | ||
537 | if (ret == 0) { | 544 | if (ret == 0) { |
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 4559bb8115bf..088c55496191 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -241,13 +241,11 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj, | |||
241 | 241 | ||
242 | if (status == 1) { | 242 | if (status == 1) { |
243 | netif_carrier_on(net); | 243 | netif_carrier_on(net); |
244 | netif_wake_queue(net); | ||
245 | ndev_ctx = netdev_priv(net); | 244 | ndev_ctx = netdev_priv(net); |
246 | schedule_delayed_work(&ndev_ctx->dwork, 0); | 245 | schedule_delayed_work(&ndev_ctx->dwork, 0); |
247 | schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20)); | 246 | schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20)); |
248 | } else { | 247 | } else { |
249 | netif_carrier_off(net); | 248 | netif_carrier_off(net); |
250 | netif_tx_disable(net); | ||
251 | } | 249 | } |
252 | } | 250 | } |
253 | 251 | ||
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 2b657d4d63a8..0775f0aefd1e 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c | |||
@@ -61,9 +61,6 @@ struct rndis_request { | |||
61 | 61 | ||
62 | static void rndis_filter_send_completion(void *ctx); | 62 | static void rndis_filter_send_completion(void *ctx); |
63 | 63 | ||
64 | static void rndis_filter_send_request_completion(void *ctx); | ||
65 | |||
66 | |||
67 | 64 | ||
68 | static struct rndis_device *get_rndis_device(void) | 65 | static struct rndis_device *get_rndis_device(void) |
69 | { | 66 | { |
@@ -241,10 +238,7 @@ static int rndis_filter_send_request(struct rndis_device *dev, | |||
241 | packet->page_buf[0].len; | 238 | packet->page_buf[0].len; |
242 | } | 239 | } |
243 | 240 | ||
244 | packet->completion.send.send_completion_ctx = req;/* packet; */ | 241 | packet->completion.send.send_completion = NULL; |
245 | packet->completion.send.send_completion = | ||
246 | rndis_filter_send_request_completion; | ||
247 | packet->completion.send.send_completion_tid = (unsigned long)dev; | ||
248 | 242 | ||
249 | ret = netvsc_send(dev->net_dev->dev, packet); | 243 | ret = netvsc_send(dev->net_dev->dev, packet); |
250 | return ret; | 244 | return ret; |
@@ -999,9 +993,3 @@ static void rndis_filter_send_completion(void *ctx) | |||
999 | /* Pass it back to the original handler */ | 993 | /* Pass it back to the original handler */ |
1000 | filter_pkt->completion(filter_pkt->completion_ctx); | 994 | filter_pkt->completion(filter_pkt->completion_ctx); |
1001 | } | 995 | } |
1002 | |||
1003 | |||
1004 | static void rndis_filter_send_request_completion(void *ctx) | ||
1005 | { | ||
1006 | /* Noop */ | ||
1007 | } | ||
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 316c759bd988..66109a2ad886 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1594,7 +1594,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) | |||
1594 | 1594 | ||
1595 | if (tun->flags & TUN_TAP_MQ && | 1595 | if (tun->flags & TUN_TAP_MQ && |
1596 | (tun->numqueues + tun->numdisabled > 1)) | 1596 | (tun->numqueues + tun->numdisabled > 1)) |
1597 | return err; | 1597 | return -EBUSY; |
1598 | } | 1598 | } |
1599 | else { | 1599 | else { |
1600 | char *name; | 1600 | char *name; |
diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c index cc6dfe4102fd..c96454434f7b 100644 --- a/drivers/net/usb/cdc_mbim.c +++ b/drivers/net/usb/cdc_mbim.c | |||
@@ -134,7 +134,7 @@ static struct sk_buff *cdc_mbim_tx_fixup(struct usbnet *dev, struct sk_buff *skb | |||
134 | goto error; | 134 | goto error; |
135 | 135 | ||
136 | if (skb) { | 136 | if (skb) { |
137 | if (skb->len <= sizeof(ETH_HLEN)) | 137 | if (skb->len <= ETH_HLEN) |
138 | goto error; | 138 | goto error; |
139 | 139 | ||
140 | /* mapping VLANs to MBIM sessions: | 140 | /* mapping VLANs to MBIM sessions: |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 968d5d50751d..2a3579f67910 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/netdevice.h> | 14 | #include <linux/netdevice.h> |
15 | #include <linux/ethtool.h> | 15 | #include <linux/ethtool.h> |
16 | #include <linux/etherdevice.h> | ||
16 | #include <linux/mii.h> | 17 | #include <linux/mii.h> |
17 | #include <linux/usb.h> | 18 | #include <linux/usb.h> |
18 | #include <linux/usb/cdc.h> | 19 | #include <linux/usb/cdc.h> |
@@ -52,6 +53,96 @@ struct qmi_wwan_state { | |||
52 | struct usb_interface *data; | 53 | struct usb_interface *data; |
53 | }; | 54 | }; |
54 | 55 | ||
56 | /* default ethernet address used by the modem */ | ||
57 | static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; | ||
58 | |||
59 | /* Make up an ethernet header if the packet doesn't have one. | ||
60 | * | ||
61 | * A firmware bug common among several devices cause them to send raw | ||
62 | * IP packets under some circumstances. There is no way for the | ||
63 | * driver/host to know when this will happen. And even when the bug | ||
64 | * hits, some packets will still arrive with an intact header. | ||
65 | * | ||
66 | * The supported devices are only capably of sending IPv4, IPv6 and | ||
67 | * ARP packets on a point-to-point link. Any packet with an ethernet | ||
68 | * header will have either our address or a broadcast/multicast | ||
69 | * address as destination. ARP packets will always have a header. | ||
70 | * | ||
71 | * This means that this function will reliably add the appropriate | ||
72 | * header iff necessary, provided our hardware address does not start | ||
73 | * with 4 or 6. | ||
74 | * | ||
75 | * Another common firmware bug results in all packets being addressed | ||
76 | * to 00:a0:c6:00:00:00 despite the host address being different. | ||
77 | * This function will also fixup such packets. | ||
78 | */ | ||
79 | static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | ||
80 | { | ||
81 | __be16 proto; | ||
82 | |||
83 | /* usbnet rx_complete guarantees that skb->len is at least | ||
84 | * hard_header_len, so we can inspect the dest address without | ||
85 | * checking skb->len | ||
86 | */ | ||
87 | switch (skb->data[0] & 0xf0) { | ||
88 | case 0x40: | ||
89 | proto = htons(ETH_P_IP); | ||
90 | break; | ||
91 | case 0x60: | ||
92 | proto = htons(ETH_P_IPV6); | ||
93 | break; | ||
94 | case 0x00: | ||
95 | if (is_multicast_ether_addr(skb->data)) | ||
96 | return 1; | ||
97 | /* possibly bogus destination - rewrite just in case */ | ||
98 | skb_reset_mac_header(skb); | ||
99 | goto fix_dest; | ||
100 | default: | ||
101 | /* pass along other packets without modifications */ | ||
102 | return 1; | ||
103 | } | ||
104 | if (skb_headroom(skb) < ETH_HLEN) | ||
105 | return 0; | ||
106 | skb_push(skb, ETH_HLEN); | ||
107 | skb_reset_mac_header(skb); | ||
108 | eth_hdr(skb)->h_proto = proto; | ||
109 | memset(eth_hdr(skb)->h_source, 0, ETH_ALEN); | ||
110 | fix_dest: | ||
111 | memcpy(eth_hdr(skb)->h_dest, dev->net->dev_addr, ETH_ALEN); | ||
112 | return 1; | ||
113 | } | ||
114 | |||
115 | /* very simplistic detection of IPv4 or IPv6 headers */ | ||
116 | static bool possibly_iphdr(const char *data) | ||
117 | { | ||
118 | return (data[0] & 0xd0) == 0x40; | ||
119 | } | ||
120 | |||
121 | /* disallow addresses which may be confused with IP headers */ | ||
122 | static int qmi_wwan_mac_addr(struct net_device *dev, void *p) | ||
123 | { | ||
124 | int ret; | ||
125 | struct sockaddr *addr = p; | ||
126 | |||
127 | ret = eth_prepare_mac_addr_change(dev, p); | ||
128 | if (ret < 0) | ||
129 | return ret; | ||
130 | if (possibly_iphdr(addr->sa_data)) | ||
131 | return -EADDRNOTAVAIL; | ||
132 | eth_commit_mac_addr_change(dev, p); | ||
133 | return 0; | ||
134 | } | ||
135 | |||
136 | static const struct net_device_ops qmi_wwan_netdev_ops = { | ||
137 | .ndo_open = usbnet_open, | ||
138 | .ndo_stop = usbnet_stop, | ||
139 | .ndo_start_xmit = usbnet_start_xmit, | ||
140 | .ndo_tx_timeout = usbnet_tx_timeout, | ||
141 | .ndo_change_mtu = usbnet_change_mtu, | ||
142 | .ndo_set_mac_address = qmi_wwan_mac_addr, | ||
143 | .ndo_validate_addr = eth_validate_addr, | ||
144 | }; | ||
145 | |||
55 | /* using a counter to merge subdriver requests with our own into a combined state */ | 146 | /* using a counter to merge subdriver requests with our own into a combined state */ |
56 | static int qmi_wwan_manage_power(struct usbnet *dev, int on) | 147 | static int qmi_wwan_manage_power(struct usbnet *dev, int on) |
57 | { | 148 | { |
@@ -229,6 +320,18 @@ next_desc: | |||
229 | usb_driver_release_interface(driver, info->data); | 320 | usb_driver_release_interface(driver, info->data); |
230 | } | 321 | } |
231 | 322 | ||
323 | /* Never use the same address on both ends of the link, even | ||
324 | * if the buggy firmware told us to. | ||
325 | */ | ||
326 | if (!compare_ether_addr(dev->net->dev_addr, default_modem_addr)) | ||
327 | eth_hw_addr_random(dev->net); | ||
328 | |||
329 | /* make MAC addr easily distinguishable from an IP header */ | ||
330 | if (possibly_iphdr(dev->net->dev_addr)) { | ||
331 | dev->net->dev_addr[0] |= 0x02; /* set local assignment bit */ | ||
332 | dev->net->dev_addr[0] &= 0xbf; /* clear "IP" bit */ | ||
333 | } | ||
334 | dev->net->netdev_ops = &qmi_wwan_netdev_ops; | ||
232 | err: | 335 | err: |
233 | return status; | 336 | return status; |
234 | } | 337 | } |
@@ -307,6 +410,7 @@ static const struct driver_info qmi_wwan_info = { | |||
307 | .bind = qmi_wwan_bind, | 410 | .bind = qmi_wwan_bind, |
308 | .unbind = qmi_wwan_unbind, | 411 | .unbind = qmi_wwan_unbind, |
309 | .manage_power = qmi_wwan_manage_power, | 412 | .manage_power = qmi_wwan_manage_power, |
413 | .rx_fixup = qmi_wwan_rx_fixup, | ||
310 | }; | 414 | }; |
311 | 415 | ||
312 | #define HUAWEI_VENDOR_ID 0x12D1 | 416 | #define HUAWEI_VENDOR_ID 0x12D1 |
diff --git a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h index 28fd99203f64..bdee2ed67219 100644 --- a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h +++ b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h | |||
@@ -519,7 +519,7 @@ static const u32 ar9580_1p0_mac_core[][2] = { | |||
519 | {0x00008258, 0x00000000}, | 519 | {0x00008258, 0x00000000}, |
520 | {0x0000825c, 0x40000000}, | 520 | {0x0000825c, 0x40000000}, |
521 | {0x00008260, 0x00080922}, | 521 | {0x00008260, 0x00080922}, |
522 | {0x00008264, 0x9bc00010}, | 522 | {0x00008264, 0x9d400010}, |
523 | {0x00008268, 0xffffffff}, | 523 | {0x00008268, 0xffffffff}, |
524 | {0x0000826c, 0x0000ffff}, | 524 | {0x0000826c, 0x0000ffff}, |
525 | {0x00008270, 0x00000000}, | 525 | {0x00008270, 0x00000000}, |
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c index 467b60014b7b..73fe8d6db566 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c +++ b/drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c | |||
@@ -143,14 +143,14 @@ channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq) | |||
143 | u32 sz, i; | 143 | u32 sz, i; |
144 | struct channel_detector *cd; | 144 | struct channel_detector *cd; |
145 | 145 | ||
146 | cd = kmalloc(sizeof(*cd), GFP_KERNEL); | 146 | cd = kmalloc(sizeof(*cd), GFP_ATOMIC); |
147 | if (cd == NULL) | 147 | if (cd == NULL) |
148 | goto fail; | 148 | goto fail; |
149 | 149 | ||
150 | INIT_LIST_HEAD(&cd->head); | 150 | INIT_LIST_HEAD(&cd->head); |
151 | cd->freq = freq; | 151 | cd->freq = freq; |
152 | sz = sizeof(cd->detectors) * dpd->num_radar_types; | 152 | sz = sizeof(cd->detectors) * dpd->num_radar_types; |
153 | cd->detectors = kzalloc(sz, GFP_KERNEL); | 153 | cd->detectors = kzalloc(sz, GFP_ATOMIC); |
154 | if (cd->detectors == NULL) | 154 | if (cd->detectors == NULL) |
155 | goto fail; | 155 | goto fail; |
156 | 156 | ||
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c index 91b8dceeadb1..5e48c5515b8c 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c +++ b/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c | |||
@@ -218,7 +218,7 @@ static bool pulse_queue_enqueue(struct pri_detector *pde, u64 ts) | |||
218 | { | 218 | { |
219 | struct pulse_elem *p = pool_get_pulse_elem(); | 219 | struct pulse_elem *p = pool_get_pulse_elem(); |
220 | if (p == NULL) { | 220 | if (p == NULL) { |
221 | p = kmalloc(sizeof(*p), GFP_KERNEL); | 221 | p = kmalloc(sizeof(*p), GFP_ATOMIC); |
222 | if (p == NULL) { | 222 | if (p == NULL) { |
223 | DFS_POOL_STAT_INC(pulse_alloc_error); | 223 | DFS_POOL_STAT_INC(pulse_alloc_error); |
224 | return false; | 224 | return false; |
@@ -299,7 +299,7 @@ static bool pseq_handler_create_sequences(struct pri_detector *pde, | |||
299 | ps.deadline_ts = ps.first_ts + ps.dur; | 299 | ps.deadline_ts = ps.first_ts + ps.dur; |
300 | new_ps = pool_get_pseq_elem(); | 300 | new_ps = pool_get_pseq_elem(); |
301 | if (new_ps == NULL) { | 301 | if (new_ps == NULL) { |
302 | new_ps = kmalloc(sizeof(*new_ps), GFP_KERNEL); | 302 | new_ps = kmalloc(sizeof(*new_ps), GFP_ATOMIC); |
303 | if (new_ps == NULL) { | 303 | if (new_ps == NULL) { |
304 | DFS_POOL_STAT_INC(pseq_alloc_error); | 304 | DFS_POOL_STAT_INC(pseq_alloc_error); |
305 | return false; | 305 | return false; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 716058b67557..a47f5e05fc04 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -796,7 +796,7 @@ static int ath9k_init_firmware_version(struct ath9k_htc_priv *priv) | |||
796 | * required version. | 796 | * required version. |
797 | */ | 797 | */ |
798 | if (priv->fw_version_major != MAJOR_VERSION_REQ || | 798 | if (priv->fw_version_major != MAJOR_VERSION_REQ || |
799 | priv->fw_version_minor != MINOR_VERSION_REQ) { | 799 | priv->fw_version_minor < MINOR_VERSION_REQ) { |
800 | dev_err(priv->dev, "ath9k_htc: Please upgrade to FW version %d.%d\n", | 800 | dev_err(priv->dev, "ath9k_htc: Please upgrade to FW version %d.%d\n", |
801 | MAJOR_VERSION_REQ, MINOR_VERSION_REQ); | 801 | MAJOR_VERSION_REQ, MINOR_VERSION_REQ); |
802 | return -EINVAL; | 802 | return -EINVAL; |
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index f9339e7ea6af..63cca9c2bf97 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -5161,7 +5161,8 @@ static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid) | |||
5161 | #endif | 5161 | #endif |
5162 | #ifdef CONFIG_B43_SSB | 5162 | #ifdef CONFIG_B43_SSB |
5163 | case B43_BUS_SSB: | 5163 | case B43_BUS_SSB: |
5164 | /* FIXME */ | 5164 | ssb_pmu_spuravoid_pllupdate(&dev->dev->sdev->bus->chipco, |
5165 | avoid); | ||
5165 | break; | 5166 | break; |
5166 | #endif | 5167 | #endif |
5167 | } | 5168 | } |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 62699203869d..e4f1f3c9575a 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -4078,10 +4078,6 @@ static const struct ieee80211_iface_limit brcmf_iface_limits[] = { | |||
4078 | }, | 4078 | }, |
4079 | { | 4079 | { |
4080 | .max = 1, | 4080 | .max = 1, |
4081 | .types = BIT(NL80211_IFTYPE_P2P_DEVICE) | ||
4082 | }, | ||
4083 | { | ||
4084 | .max = 1, | ||
4085 | .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | | 4081 | .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | |
4086 | BIT(NL80211_IFTYPE_P2P_GO) | 4082 | BIT(NL80211_IFTYPE_P2P_GO) |
4087 | }, | 4083 | }, |
@@ -4142,8 +4138,7 @@ static struct wiphy *brcmf_setup_wiphy(struct device *phydev) | |||
4142 | BIT(NL80211_IFTYPE_ADHOC) | | 4138 | BIT(NL80211_IFTYPE_ADHOC) | |
4143 | BIT(NL80211_IFTYPE_AP) | | 4139 | BIT(NL80211_IFTYPE_AP) | |
4144 | BIT(NL80211_IFTYPE_P2P_CLIENT) | | 4140 | BIT(NL80211_IFTYPE_P2P_CLIENT) | |
4145 | BIT(NL80211_IFTYPE_P2P_GO) | | 4141 | BIT(NL80211_IFTYPE_P2P_GO); |
4146 | BIT(NL80211_IFTYPE_P2P_DEVICE); | ||
4147 | wiphy->iface_combinations = brcmf_iface_combos; | 4142 | wiphy->iface_combinations = brcmf_iface_combos; |
4148 | wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos); | 4143 | wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos); |
4149 | wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz; | 4144 | wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz; |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c index cd837860cd42..c837be242cba 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | |||
@@ -276,6 +276,130 @@ static void brcms_set_basic_rate(struct brcm_rateset *rs, u16 rate, bool is_br) | |||
276 | } | 276 | } |
277 | } | 277 | } |
278 | 278 | ||
279 | /** | ||
280 | * This function frees the WL per-device resources. | ||
281 | * | ||
282 | * This function frees resources owned by the WL device pointed to | ||
283 | * by the wl parameter. | ||
284 | * | ||
285 | * precondition: can both be called locked and unlocked | ||
286 | * | ||
287 | */ | ||
288 | static void brcms_free(struct brcms_info *wl) | ||
289 | { | ||
290 | struct brcms_timer *t, *next; | ||
291 | |||
292 | /* free ucode data */ | ||
293 | if (wl->fw.fw_cnt) | ||
294 | brcms_ucode_data_free(&wl->ucode); | ||
295 | if (wl->irq) | ||
296 | free_irq(wl->irq, wl); | ||
297 | |||
298 | /* kill dpc */ | ||
299 | tasklet_kill(&wl->tasklet); | ||
300 | |||
301 | if (wl->pub) { | ||
302 | brcms_debugfs_detach(wl->pub); | ||
303 | brcms_c_module_unregister(wl->pub, "linux", wl); | ||
304 | } | ||
305 | |||
306 | /* free common resources */ | ||
307 | if (wl->wlc) { | ||
308 | brcms_c_detach(wl->wlc); | ||
309 | wl->wlc = NULL; | ||
310 | wl->pub = NULL; | ||
311 | } | ||
312 | |||
313 | /* virtual interface deletion is deferred so we cannot spinwait */ | ||
314 | |||
315 | /* wait for all pending callbacks to complete */ | ||
316 | while (atomic_read(&wl->callbacks) > 0) | ||
317 | schedule(); | ||
318 | |||
319 | /* free timers */ | ||
320 | for (t = wl->timers; t; t = next) { | ||
321 | next = t->next; | ||
322 | #ifdef DEBUG | ||
323 | kfree(t->name); | ||
324 | #endif | ||
325 | kfree(t); | ||
326 | } | ||
327 | } | ||
328 | |||
329 | /* | ||
330 | * called from both kernel as from this kernel module (error flow on attach) | ||
331 | * precondition: perimeter lock is not acquired. | ||
332 | */ | ||
333 | static void brcms_remove(struct bcma_device *pdev) | ||
334 | { | ||
335 | struct ieee80211_hw *hw = bcma_get_drvdata(pdev); | ||
336 | struct brcms_info *wl = hw->priv; | ||
337 | |||
338 | if (wl->wlc) { | ||
339 | wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, false); | ||
340 | wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy); | ||
341 | ieee80211_unregister_hw(hw); | ||
342 | } | ||
343 | |||
344 | brcms_free(wl); | ||
345 | |||
346 | bcma_set_drvdata(pdev, NULL); | ||
347 | ieee80211_free_hw(hw); | ||
348 | } | ||
349 | |||
350 | /* | ||
351 | * Precondition: Since this function is called in brcms_pci_probe() context, | ||
352 | * no locking is required. | ||
353 | */ | ||
354 | static void brcms_release_fw(struct brcms_info *wl) | ||
355 | { | ||
356 | int i; | ||
357 | for (i = 0; i < MAX_FW_IMAGES; i++) { | ||
358 | release_firmware(wl->fw.fw_bin[i]); | ||
359 | release_firmware(wl->fw.fw_hdr[i]); | ||
360 | } | ||
361 | } | ||
362 | |||
363 | /* | ||
364 | * Precondition: Since this function is called in brcms_pci_probe() context, | ||
365 | * no locking is required. | ||
366 | */ | ||
367 | static int brcms_request_fw(struct brcms_info *wl, struct bcma_device *pdev) | ||
368 | { | ||
369 | int status; | ||
370 | struct device *device = &pdev->dev; | ||
371 | char fw_name[100]; | ||
372 | int i; | ||
373 | |||
374 | memset(&wl->fw, 0, sizeof(struct brcms_firmware)); | ||
375 | for (i = 0; i < MAX_FW_IMAGES; i++) { | ||
376 | if (brcms_firmwares[i] == NULL) | ||
377 | break; | ||
378 | sprintf(fw_name, "%s-%d.fw", brcms_firmwares[i], | ||
379 | UCODE_LOADER_API_VER); | ||
380 | status = request_firmware(&wl->fw.fw_bin[i], fw_name, device); | ||
381 | if (status) { | ||
382 | wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n", | ||
383 | KBUILD_MODNAME, fw_name); | ||
384 | return status; | ||
385 | } | ||
386 | sprintf(fw_name, "%s_hdr-%d.fw", brcms_firmwares[i], | ||
387 | UCODE_LOADER_API_VER); | ||
388 | status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device); | ||
389 | if (status) { | ||
390 | wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n", | ||
391 | KBUILD_MODNAME, fw_name); | ||
392 | return status; | ||
393 | } | ||
394 | wl->fw.hdr_num_entries[i] = | ||
395 | wl->fw.fw_hdr[i]->size / (sizeof(struct firmware_hdr)); | ||
396 | } | ||
397 | wl->fw.fw_cnt = i; | ||
398 | status = brcms_ucode_data_init(wl, &wl->ucode); | ||
399 | brcms_release_fw(wl); | ||
400 | return status; | ||
401 | } | ||
402 | |||
279 | static void brcms_ops_tx(struct ieee80211_hw *hw, | 403 | static void brcms_ops_tx(struct ieee80211_hw *hw, |
280 | struct ieee80211_tx_control *control, | 404 | struct ieee80211_tx_control *control, |
281 | struct sk_buff *skb) | 405 | struct sk_buff *skb) |
@@ -308,6 +432,14 @@ static int brcms_ops_start(struct ieee80211_hw *hw) | |||
308 | if (!blocked) | 432 | if (!blocked) |
309 | wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy); | 433 | wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy); |
310 | 434 | ||
435 | if (!wl->ucode.bcm43xx_bomminor) { | ||
436 | err = brcms_request_fw(wl, wl->wlc->hw->d11core); | ||
437 | if (err) { | ||
438 | brcms_remove(wl->wlc->hw->d11core); | ||
439 | return -ENOENT; | ||
440 | } | ||
441 | } | ||
442 | |||
311 | spin_lock_bh(&wl->lock); | 443 | spin_lock_bh(&wl->lock); |
312 | /* avoid acknowledging frames before a non-monitor device is added */ | 444 | /* avoid acknowledging frames before a non-monitor device is added */ |
313 | wl->mute_tx = true; | 445 | wl->mute_tx = true; |
@@ -856,129 +988,6 @@ void brcms_dpc(unsigned long data) | |||
856 | wake_up(&wl->tx_flush_wq); | 988 | wake_up(&wl->tx_flush_wq); |
857 | } | 989 | } |
858 | 990 | ||
859 | /* | ||
860 | * Precondition: Since this function is called in brcms_pci_probe() context, | ||
861 | * no locking is required. | ||
862 | */ | ||
863 | static int brcms_request_fw(struct brcms_info *wl, struct bcma_device *pdev) | ||
864 | { | ||
865 | int status; | ||
866 | struct device *device = &pdev->dev; | ||
867 | char fw_name[100]; | ||
868 | int i; | ||
869 | |||
870 | memset(&wl->fw, 0, sizeof(struct brcms_firmware)); | ||
871 | for (i = 0; i < MAX_FW_IMAGES; i++) { | ||
872 | if (brcms_firmwares[i] == NULL) | ||
873 | break; | ||
874 | sprintf(fw_name, "%s-%d.fw", brcms_firmwares[i], | ||
875 | UCODE_LOADER_API_VER); | ||
876 | status = request_firmware(&wl->fw.fw_bin[i], fw_name, device); | ||
877 | if (status) { | ||
878 | wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n", | ||
879 | KBUILD_MODNAME, fw_name); | ||
880 | return status; | ||
881 | } | ||
882 | sprintf(fw_name, "%s_hdr-%d.fw", brcms_firmwares[i], | ||
883 | UCODE_LOADER_API_VER); | ||
884 | status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device); | ||
885 | if (status) { | ||
886 | wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n", | ||
887 | KBUILD_MODNAME, fw_name); | ||
888 | return status; | ||
889 | } | ||
890 | wl->fw.hdr_num_entries[i] = | ||
891 | wl->fw.fw_hdr[i]->size / (sizeof(struct firmware_hdr)); | ||
892 | } | ||
893 | wl->fw.fw_cnt = i; | ||
894 | return brcms_ucode_data_init(wl, &wl->ucode); | ||
895 | } | ||
896 | |||
897 | /* | ||
898 | * Precondition: Since this function is called in brcms_pci_probe() context, | ||
899 | * no locking is required. | ||
900 | */ | ||
901 | static void brcms_release_fw(struct brcms_info *wl) | ||
902 | { | ||
903 | int i; | ||
904 | for (i = 0; i < MAX_FW_IMAGES; i++) { | ||
905 | release_firmware(wl->fw.fw_bin[i]); | ||
906 | release_firmware(wl->fw.fw_hdr[i]); | ||
907 | } | ||
908 | } | ||
909 | |||
910 | /** | ||
911 | * This function frees the WL per-device resources. | ||
912 | * | ||
913 | * This function frees resources owned by the WL device pointed to | ||
914 | * by the wl parameter. | ||
915 | * | ||
916 | * precondition: can both be called locked and unlocked | ||
917 | * | ||
918 | */ | ||
919 | static void brcms_free(struct brcms_info *wl) | ||
920 | { | ||
921 | struct brcms_timer *t, *next; | ||
922 | |||
923 | /* free ucode data */ | ||
924 | if (wl->fw.fw_cnt) | ||
925 | brcms_ucode_data_free(&wl->ucode); | ||
926 | if (wl->irq) | ||
927 | free_irq(wl->irq, wl); | ||
928 | |||
929 | /* kill dpc */ | ||
930 | tasklet_kill(&wl->tasklet); | ||
931 | |||
932 | if (wl->pub) { | ||
933 | brcms_debugfs_detach(wl->pub); | ||
934 | brcms_c_module_unregister(wl->pub, "linux", wl); | ||
935 | } | ||
936 | |||
937 | /* free common resources */ | ||
938 | if (wl->wlc) { | ||
939 | brcms_c_detach(wl->wlc); | ||
940 | wl->wlc = NULL; | ||
941 | wl->pub = NULL; | ||
942 | } | ||
943 | |||
944 | /* virtual interface deletion is deferred so we cannot spinwait */ | ||
945 | |||
946 | /* wait for all pending callbacks to complete */ | ||
947 | while (atomic_read(&wl->callbacks) > 0) | ||
948 | schedule(); | ||
949 | |||
950 | /* free timers */ | ||
951 | for (t = wl->timers; t; t = next) { | ||
952 | next = t->next; | ||
953 | #ifdef DEBUG | ||
954 | kfree(t->name); | ||
955 | #endif | ||
956 | kfree(t); | ||
957 | } | ||
958 | } | ||
959 | |||
960 | /* | ||
961 | * called from both kernel as from this kernel module (error flow on attach) | ||
962 | * precondition: perimeter lock is not acquired. | ||
963 | */ | ||
964 | static void brcms_remove(struct bcma_device *pdev) | ||
965 | { | ||
966 | struct ieee80211_hw *hw = bcma_get_drvdata(pdev); | ||
967 | struct brcms_info *wl = hw->priv; | ||
968 | |||
969 | if (wl->wlc) { | ||
970 | brcms_led_unregister(wl); | ||
971 | wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, false); | ||
972 | wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy); | ||
973 | ieee80211_unregister_hw(hw); | ||
974 | } | ||
975 | |||
976 | brcms_free(wl); | ||
977 | |||
978 | bcma_set_drvdata(pdev, NULL); | ||
979 | ieee80211_free_hw(hw); | ||
980 | } | ||
981 | |||
982 | static irqreturn_t brcms_isr(int irq, void *dev_id) | 991 | static irqreturn_t brcms_isr(int irq, void *dev_id) |
983 | { | 992 | { |
984 | struct brcms_info *wl; | 993 | struct brcms_info *wl; |
@@ -1120,18 +1129,8 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev) | |||
1120 | spin_lock_init(&wl->lock); | 1129 | spin_lock_init(&wl->lock); |
1121 | spin_lock_init(&wl->isr_lock); | 1130 | spin_lock_init(&wl->isr_lock); |
1122 | 1131 | ||
1123 | /* prepare ucode */ | ||
1124 | if (brcms_request_fw(wl, pdev) < 0) { | ||
1125 | wiphy_err(wl->wiphy, "%s: Failed to find firmware usually in " | ||
1126 | "%s\n", KBUILD_MODNAME, "/lib/firmware/brcm"); | ||
1127 | brcms_release_fw(wl); | ||
1128 | brcms_remove(pdev); | ||
1129 | return NULL; | ||
1130 | } | ||
1131 | |||
1132 | /* common load-time initialization */ | 1132 | /* common load-time initialization */ |
1133 | wl->wlc = brcms_c_attach((void *)wl, pdev, unit, false, &err); | 1133 | wl->wlc = brcms_c_attach((void *)wl, pdev, unit, false, &err); |
1134 | brcms_release_fw(wl); | ||
1135 | if (!wl->wlc) { | 1134 | if (!wl->wlc) { |
1136 | wiphy_err(wl->wiphy, "%s: attach() failed with code %d\n", | 1135 | wiphy_err(wl->wiphy, "%s: attach() failed with code %d\n", |
1137 | KBUILD_MODNAME, err); | 1136 | KBUILD_MODNAME, err); |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index dee5dddaa292..5147c210df52 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -53,14 +53,15 @@ static void pci_acpi_wake_dev(acpi_handle handle, u32 event, void *context) | |||
53 | return; | 53 | return; |
54 | } | 54 | } |
55 | 55 | ||
56 | if (!pci_dev->pm_cap || !pci_dev->pme_support | 56 | /* Clear PME Status if set. */ |
57 | || pci_check_pme_status(pci_dev)) { | 57 | if (pci_dev->pme_support) |
58 | if (pci_dev->pme_poll) | 58 | pci_check_pme_status(pci_dev); |
59 | pci_dev->pme_poll = false; | ||
60 | 59 | ||
61 | pci_wakeup_event(pci_dev); | 60 | if (pci_dev->pme_poll) |
62 | pm_runtime_resume(&pci_dev->dev); | 61 | pci_dev->pme_poll = false; |
63 | } | 62 | |
63 | pci_wakeup_event(pci_dev); | ||
64 | pm_runtime_resume(&pci_dev->dev); | ||
64 | 65 | ||
65 | if (pci_dev->subordinate) | 66 | if (pci_dev->subordinate) |
66 | pci_pme_wakeup_bus(pci_dev->subordinate); | 67 | pci_pme_wakeup_bus(pci_dev->subordinate); |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 1fa1e482a999..79277fb36c6b 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -390,9 +390,10 @@ static void pci_device_shutdown(struct device *dev) | |||
390 | 390 | ||
391 | /* | 391 | /* |
392 | * Turn off Bus Master bit on the device to tell it to not | 392 | * Turn off Bus Master bit on the device to tell it to not |
393 | * continue to do DMA | 393 | * continue to do DMA. Don't touch devices in D3cold or unknown states. |
394 | */ | 394 | */ |
395 | pci_clear_master(pci_dev); | 395 | if (pci_dev->current_state <= PCI_D3hot) |
396 | pci_clear_master(pci_dev); | ||
396 | } | 397 | } |
397 | 398 | ||
398 | #ifdef CONFIG_PM | 399 | #ifdef CONFIG_PM |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 08c243ab034e..ed4d09498337 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -185,14 +185,6 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = { | |||
185 | #endif /* !PM */ | 185 | #endif /* !PM */ |
186 | 186 | ||
187 | /* | 187 | /* |
188 | * PCIe port runtime suspend is broken for some chipsets, so use a | ||
189 | * black list to disable runtime PM for these chipsets. | ||
190 | */ | ||
191 | static const struct pci_device_id port_runtime_pm_black_list[] = { | ||
192 | { /* end: all zeroes */ } | ||
193 | }; | ||
194 | |||
195 | /* | ||
196 | * pcie_portdrv_probe - Probe PCI-Express port devices | 188 | * pcie_portdrv_probe - Probe PCI-Express port devices |
197 | * @dev: PCI-Express port device being probed | 189 | * @dev: PCI-Express port device being probed |
198 | * | 190 | * |
@@ -225,16 +217,11 @@ static int pcie_portdrv_probe(struct pci_dev *dev, | |||
225 | * it by default. | 217 | * it by default. |
226 | */ | 218 | */ |
227 | dev->d3cold_allowed = false; | 219 | dev->d3cold_allowed = false; |
228 | if (!pci_match_id(port_runtime_pm_black_list, dev)) | ||
229 | pm_runtime_put_noidle(&dev->dev); | ||
230 | |||
231 | return 0; | 220 | return 0; |
232 | } | 221 | } |
233 | 222 | ||
234 | static void pcie_portdrv_remove(struct pci_dev *dev) | 223 | static void pcie_portdrv_remove(struct pci_dev *dev) |
235 | { | 224 | { |
236 | if (!pci_match_id(port_runtime_pm_black_list, dev)) | ||
237 | pm_runtime_get_noresume(&dev->dev); | ||
238 | pcie_port_device_remove(dev); | 225 | pcie_port_device_remove(dev); |
239 | pci_disable_device(dev); | 226 | pci_disable_device(dev); |
240 | } | 227 | } |
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c index b41ac7756a4b..c5d0a08a8747 100644 --- a/drivers/pci/rom.c +++ b/drivers/pci/rom.c | |||
@@ -100,27 +100,6 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size) | |||
100 | return min((size_t)(image - rom), size); | 100 | return min((size_t)(image - rom), size); |
101 | } | 101 | } |
102 | 102 | ||
103 | static loff_t pci_find_rom(struct pci_dev *pdev, size_t *size) | ||
104 | { | ||
105 | struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; | ||
106 | loff_t start; | ||
107 | |||
108 | /* assign the ROM an address if it doesn't have one */ | ||
109 | if (res->parent == NULL && pci_assign_resource(pdev, PCI_ROM_RESOURCE)) | ||
110 | return 0; | ||
111 | start = pci_resource_start(pdev, PCI_ROM_RESOURCE); | ||
112 | *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); | ||
113 | |||
114 | if (*size == 0) | ||
115 | return 0; | ||
116 | |||
117 | /* Enable ROM space decodes */ | ||
118 | if (pci_enable_rom(pdev)) | ||
119 | return 0; | ||
120 | |||
121 | return start; | ||
122 | } | ||
123 | |||
124 | /** | 103 | /** |
125 | * pci_map_rom - map a PCI ROM to kernel space | 104 | * pci_map_rom - map a PCI ROM to kernel space |
126 | * @pdev: pointer to pci device struct | 105 | * @pdev: pointer to pci device struct |
@@ -135,7 +114,7 @@ static loff_t pci_find_rom(struct pci_dev *pdev, size_t *size) | |||
135 | void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) | 114 | void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) |
136 | { | 115 | { |
137 | struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; | 116 | struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; |
138 | loff_t start = 0; | 117 | loff_t start; |
139 | void __iomem *rom; | 118 | void __iomem *rom; |
140 | 119 | ||
141 | /* | 120 | /* |
@@ -154,21 +133,21 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) | |||
154 | return (void __iomem *)(unsigned long) | 133 | return (void __iomem *)(unsigned long) |
155 | pci_resource_start(pdev, PCI_ROM_RESOURCE); | 134 | pci_resource_start(pdev, PCI_ROM_RESOURCE); |
156 | } else { | 135 | } else { |
157 | start = pci_find_rom(pdev, size); | 136 | /* assign the ROM an address if it doesn't have one */ |
158 | } | 137 | if (res->parent == NULL && |
159 | } | 138 | pci_assign_resource(pdev,PCI_ROM_RESOURCE)) |
139 | return NULL; | ||
140 | start = pci_resource_start(pdev, PCI_ROM_RESOURCE); | ||
141 | *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); | ||
142 | if (*size == 0) | ||
143 | return NULL; | ||
160 | 144 | ||
161 | /* | 145 | /* Enable ROM space decodes */ |
162 | * Some devices may provide ROMs via a source other than the BAR | 146 | if (pci_enable_rom(pdev)) |
163 | */ | 147 | return NULL; |
164 | if (!start && pdev->rom && pdev->romlen) { | 148 | } |
165 | *size = pdev->romlen; | ||
166 | return phys_to_virt(pdev->rom); | ||
167 | } | 149 | } |
168 | 150 | ||
169 | if (!start) | ||
170 | return NULL; | ||
171 | |||
172 | rom = ioremap(start, *size); | 151 | rom = ioremap(start, *size); |
173 | if (!rom) { | 152 | if (!rom) { |
174 | /* restore enable if ioremap fails */ | 153 | /* restore enable if ioremap fails */ |
@@ -202,8 +181,7 @@ void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom) | |||
202 | if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) | 181 | if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) |
203 | return; | 182 | return; |
204 | 183 | ||
205 | if (!pdev->rom || !pdev->romlen) | 184 | iounmap(rom); |
206 | iounmap(rom); | ||
207 | 185 | ||
208 | /* Disable again before continuing, leave enabled if pci=rom */ | 186 | /* Disable again before continuing, leave enabled if pci=rom */ |
209 | if (!(res->flags & (IORESOURCE_ROM_ENABLE | IORESOURCE_ROM_SHADOW))) | 187 | if (!(res->flags & (IORESOURCE_ROM_ENABLE | IORESOURCE_ROM_SHADOW))) |
@@ -227,7 +205,24 @@ void pci_cleanup_rom(struct pci_dev *pdev) | |||
227 | } | 205 | } |
228 | } | 206 | } |
229 | 207 | ||
208 | /** | ||
209 | * pci_platform_rom - provides a pointer to any ROM image provided by the | ||
210 | * platform | ||
211 | * @pdev: pointer to pci device struct | ||
212 | * @size: pointer to receive size of pci window over ROM | ||
213 | */ | ||
214 | void __iomem *pci_platform_rom(struct pci_dev *pdev, size_t *size) | ||
215 | { | ||
216 | if (pdev->rom && pdev->romlen) { | ||
217 | *size = pdev->romlen; | ||
218 | return phys_to_virt((phys_addr_t)pdev->rom); | ||
219 | } | ||
220 | |||
221 | return NULL; | ||
222 | } | ||
223 | |||
230 | EXPORT_SYMBOL(pci_map_rom); | 224 | EXPORT_SYMBOL(pci_map_rom); |
231 | EXPORT_SYMBOL(pci_unmap_rom); | 225 | EXPORT_SYMBOL(pci_unmap_rom); |
232 | EXPORT_SYMBOL_GPL(pci_enable_rom); | 226 | EXPORT_SYMBOL_GPL(pci_enable_rom); |
233 | EXPORT_SYMBOL_GPL(pci_disable_rom); | 227 | EXPORT_SYMBOL_GPL(pci_disable_rom); |
228 | EXPORT_SYMBOL(pci_platform_rom); | ||
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 45cacf79f3a7..1a779bbfb87d 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -134,7 +134,6 @@ static const struct key_entry hp_wmi_keymap[] = { | |||
134 | { KE_KEY, 0x2142, { KEY_MEDIA } }, | 134 | { KE_KEY, 0x2142, { KEY_MEDIA } }, |
135 | { KE_KEY, 0x213b, { KEY_INFO } }, | 135 | { KE_KEY, 0x213b, { KEY_INFO } }, |
136 | { KE_KEY, 0x2169, { KEY_DIRECTION } }, | 136 | { KE_KEY, 0x2169, { KEY_DIRECTION } }, |
137 | { KE_KEY, 0x216a, { KEY_SETUP } }, | ||
138 | { KE_KEY, 0x231b, { KEY_HELP } }, | 137 | { KE_KEY, 0x231b, { KEY_HELP } }, |
139 | { KE_END, 0 } | 138 | { KE_END, 0 } |
140 | }; | 139 | }; |
@@ -925,9 +924,6 @@ static int __init hp_wmi_init(void) | |||
925 | err = hp_wmi_input_setup(); | 924 | err = hp_wmi_input_setup(); |
926 | if (err) | 925 | if (err) |
927 | return err; | 926 | return err; |
928 | |||
929 | //Enable magic for hotkeys that run on the SMBus | ||
930 | ec_write(0xe6,0x6e); | ||
931 | } | 927 | } |
932 | 928 | ||
933 | if (bios_capable) { | 929 | if (bios_capable) { |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 9a907567f41e..edec135b1685 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -1964,9 +1964,6 @@ struct tp_nvram_state { | |||
1964 | /* kthread for the hotkey poller */ | 1964 | /* kthread for the hotkey poller */ |
1965 | static struct task_struct *tpacpi_hotkey_task; | 1965 | static struct task_struct *tpacpi_hotkey_task; |
1966 | 1966 | ||
1967 | /* Acquired while the poller kthread is running, use to sync start/stop */ | ||
1968 | static struct mutex hotkey_thread_mutex; | ||
1969 | |||
1970 | /* | 1967 | /* |
1971 | * Acquire mutex to write poller control variables as an | 1968 | * Acquire mutex to write poller control variables as an |
1972 | * atomic block. | 1969 | * atomic block. |
@@ -2462,8 +2459,6 @@ static int hotkey_kthread(void *data) | |||
2462 | unsigned int poll_freq; | 2459 | unsigned int poll_freq; |
2463 | bool was_frozen; | 2460 | bool was_frozen; |
2464 | 2461 | ||
2465 | mutex_lock(&hotkey_thread_mutex); | ||
2466 | |||
2467 | if (tpacpi_lifecycle == TPACPI_LIFE_EXITING) | 2462 | if (tpacpi_lifecycle == TPACPI_LIFE_EXITING) |
2468 | goto exit; | 2463 | goto exit; |
2469 | 2464 | ||
@@ -2523,7 +2518,6 @@ static int hotkey_kthread(void *data) | |||
2523 | } | 2518 | } |
2524 | 2519 | ||
2525 | exit: | 2520 | exit: |
2526 | mutex_unlock(&hotkey_thread_mutex); | ||
2527 | return 0; | 2521 | return 0; |
2528 | } | 2522 | } |
2529 | 2523 | ||
@@ -2533,9 +2527,6 @@ static void hotkey_poll_stop_sync(void) | |||
2533 | if (tpacpi_hotkey_task) { | 2527 | if (tpacpi_hotkey_task) { |
2534 | kthread_stop(tpacpi_hotkey_task); | 2528 | kthread_stop(tpacpi_hotkey_task); |
2535 | tpacpi_hotkey_task = NULL; | 2529 | tpacpi_hotkey_task = NULL; |
2536 | mutex_lock(&hotkey_thread_mutex); | ||
2537 | /* at this point, the thread did exit */ | ||
2538 | mutex_unlock(&hotkey_thread_mutex); | ||
2539 | } | 2530 | } |
2540 | } | 2531 | } |
2541 | 2532 | ||
@@ -3234,7 +3225,6 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
3234 | mutex_init(&hotkey_mutex); | 3225 | mutex_init(&hotkey_mutex); |
3235 | 3226 | ||
3236 | #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL | 3227 | #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL |
3237 | mutex_init(&hotkey_thread_mutex); | ||
3238 | mutex_init(&hotkey_thread_data_mutex); | 3228 | mutex_init(&hotkey_thread_data_mutex); |
3239 | #endif | 3229 | #endif |
3240 | 3230 | ||
diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig index cc1f7bf53fd0..c6d77e20622c 100644 --- a/drivers/remoteproc/Kconfig +++ b/drivers/remoteproc/Kconfig | |||
@@ -4,7 +4,7 @@ menu "Remoteproc drivers" | |||
4 | config REMOTEPROC | 4 | config REMOTEPROC |
5 | tristate | 5 | tristate |
6 | depends on HAS_DMA | 6 | depends on HAS_DMA |
7 | select FW_CONFIG | 7 | select FW_LOADER |
8 | select VIRTIO | 8 | select VIRTIO |
9 | 9 | ||
10 | config OMAP_REMOTEPROC | 10 | config OMAP_REMOTEPROC |
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 29387df4bfc9..8edb4aed5d36 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c | |||
@@ -217,7 +217,7 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i) | |||
217 | * TODO: support predefined notifyids (via resource table) | 217 | * TODO: support predefined notifyids (via resource table) |
218 | */ | 218 | */ |
219 | ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL); | 219 | ret = idr_alloc(&rproc->notifyids, rvring, 0, 0, GFP_KERNEL); |
220 | if (ret) { | 220 | if (ret < 0) { |
221 | dev_err(dev, "idr_alloc failed: %d\n", ret); | 221 | dev_err(dev, "idr_alloc failed: %d\n", ret); |
222 | dma_free_coherent(dev->parent, size, va, dma); | 222 | dma_free_coherent(dev->parent, size, va, dma); |
223 | return ret; | 223 | return ret; |
@@ -366,10 +366,12 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, | |||
366 | /* it is now safe to add the virtio device */ | 366 | /* it is now safe to add the virtio device */ |
367 | ret = rproc_add_virtio_dev(rvdev, rsc->id); | 367 | ret = rproc_add_virtio_dev(rvdev, rsc->id); |
368 | if (ret) | 368 | if (ret) |
369 | goto free_rvdev; | 369 | goto remove_rvdev; |
370 | 370 | ||
371 | return 0; | 371 | return 0; |
372 | 372 | ||
373 | remove_rvdev: | ||
374 | list_del(&rvdev->node); | ||
373 | free_rvdev: | 375 | free_rvdev: |
374 | kfree(rvdev); | 376 | kfree(rvdev); |
375 | return ret; | 377 | return ret; |
diff --git a/drivers/remoteproc/ste_modem_rproc.c b/drivers/remoteproc/ste_modem_rproc.c index a7743c069339..fb95c4220052 100644 --- a/drivers/remoteproc/ste_modem_rproc.c +++ b/drivers/remoteproc/ste_modem_rproc.c | |||
@@ -240,6 +240,8 @@ static int sproc_drv_remove(struct platform_device *pdev) | |||
240 | 240 | ||
241 | /* Unregister as remoteproc device */ | 241 | /* Unregister as remoteproc device */ |
242 | rproc_del(sproc->rproc); | 242 | rproc_del(sproc->rproc); |
243 | dma_free_coherent(sproc->rproc->dev.parent, SPROC_FW_SIZE, | ||
244 | sproc->fw_addr, sproc->fw_dma_addr); | ||
243 | rproc_put(sproc->rproc); | 245 | rproc_put(sproc->rproc); |
244 | 246 | ||
245 | mdev->drv_data = NULL; | 247 | mdev->drv_data = NULL; |
@@ -297,10 +299,13 @@ static int sproc_probe(struct platform_device *pdev) | |||
297 | /* Register as a remoteproc device */ | 299 | /* Register as a remoteproc device */ |
298 | err = rproc_add(rproc); | 300 | err = rproc_add(rproc); |
299 | if (err) | 301 | if (err) |
300 | goto free_rproc; | 302 | goto free_mem; |
301 | 303 | ||
302 | return 0; | 304 | return 0; |
303 | 305 | ||
306 | free_mem: | ||
307 | dma_free_coherent(rproc->dev.parent, SPROC_FW_SIZE, | ||
308 | sproc->fw_addr, sproc->fw_dma_addr); | ||
304 | free_rproc: | 309 | free_rproc: |
305 | /* Reset device data upon error */ | 310 | /* Reset device data upon error */ |
306 | mdev->drv_data = NULL; | 311 | mdev->drv_data = NULL; |
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index ab4d2861ef3c..c4f392d5db4c 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h | |||
@@ -769,6 +769,7 @@ struct qeth_card { | |||
769 | unsigned long thread_start_mask; | 769 | unsigned long thread_start_mask; |
770 | unsigned long thread_allowed_mask; | 770 | unsigned long thread_allowed_mask; |
771 | unsigned long thread_running_mask; | 771 | unsigned long thread_running_mask; |
772 | struct task_struct *recovery_task; | ||
772 | spinlock_t ip_lock; | 773 | spinlock_t ip_lock; |
773 | struct list_head ip_list; | 774 | struct list_head ip_list; |
774 | struct list_head *ip_tbd_list; | 775 | struct list_head *ip_tbd_list; |
@@ -862,6 +863,8 @@ extern struct qeth_card_list_struct qeth_core_card_list; | |||
862 | extern struct kmem_cache *qeth_core_header_cache; | 863 | extern struct kmem_cache *qeth_core_header_cache; |
863 | extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS]; | 864 | extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS]; |
864 | 865 | ||
866 | void qeth_set_recovery_task(struct qeth_card *); | ||
867 | void qeth_clear_recovery_task(struct qeth_card *); | ||
865 | void qeth_set_allowed_threads(struct qeth_card *, unsigned long , int); | 868 | void qeth_set_allowed_threads(struct qeth_card *, unsigned long , int); |
866 | int qeth_threads_running(struct qeth_card *, unsigned long); | 869 | int qeth_threads_running(struct qeth_card *, unsigned long); |
867 | int qeth_wait_for_threads(struct qeth_card *, unsigned long); | 870 | int qeth_wait_for_threads(struct qeth_card *, unsigned long); |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index a86ce07736ef..6cd0fc1b203a 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -177,6 +177,23 @@ const char *qeth_get_cardname_short(struct qeth_card *card) | |||
177 | return "n/a"; | 177 | return "n/a"; |
178 | } | 178 | } |
179 | 179 | ||
180 | void qeth_set_recovery_task(struct qeth_card *card) | ||
181 | { | ||
182 | card->recovery_task = current; | ||
183 | } | ||
184 | EXPORT_SYMBOL_GPL(qeth_set_recovery_task); | ||
185 | |||
186 | void qeth_clear_recovery_task(struct qeth_card *card) | ||
187 | { | ||
188 | card->recovery_task = NULL; | ||
189 | } | ||
190 | EXPORT_SYMBOL_GPL(qeth_clear_recovery_task); | ||
191 | |||
192 | static bool qeth_is_recovery_task(const struct qeth_card *card) | ||
193 | { | ||
194 | return card->recovery_task == current; | ||
195 | } | ||
196 | |||
180 | void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads, | 197 | void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads, |
181 | int clear_start_mask) | 198 | int clear_start_mask) |
182 | { | 199 | { |
@@ -205,6 +222,8 @@ EXPORT_SYMBOL_GPL(qeth_threads_running); | |||
205 | 222 | ||
206 | int qeth_wait_for_threads(struct qeth_card *card, unsigned long threads) | 223 | int qeth_wait_for_threads(struct qeth_card *card, unsigned long threads) |
207 | { | 224 | { |
225 | if (qeth_is_recovery_task(card)) | ||
226 | return 0; | ||
208 | return wait_event_interruptible(card->wait_q, | 227 | return wait_event_interruptible(card->wait_q, |
209 | qeth_threads_running(card, threads) == 0); | 228 | qeth_threads_running(card, threads) == 0); |
210 | } | 229 | } |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 2d425416b0a1..ec8ccdae7aba 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -1144,6 +1144,7 @@ static int qeth_l2_recover(void *ptr) | |||
1144 | QETH_CARD_TEXT(card, 2, "recover2"); | 1144 | QETH_CARD_TEXT(card, 2, "recover2"); |
1145 | dev_warn(&card->gdev->dev, | 1145 | dev_warn(&card->gdev->dev, |
1146 | "A recovery process has been started for the device\n"); | 1146 | "A recovery process has been started for the device\n"); |
1147 | qeth_set_recovery_task(card); | ||
1147 | __qeth_l2_set_offline(card->gdev, 1); | 1148 | __qeth_l2_set_offline(card->gdev, 1); |
1148 | rc = __qeth_l2_set_online(card->gdev, 1); | 1149 | rc = __qeth_l2_set_online(card->gdev, 1); |
1149 | if (!rc) | 1150 | if (!rc) |
@@ -1154,6 +1155,7 @@ static int qeth_l2_recover(void *ptr) | |||
1154 | dev_warn(&card->gdev->dev, "The qeth device driver " | 1155 | dev_warn(&card->gdev->dev, "The qeth device driver " |
1155 | "failed to recover an error on the device\n"); | 1156 | "failed to recover an error on the device\n"); |
1156 | } | 1157 | } |
1158 | qeth_clear_recovery_task(card); | ||
1157 | qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); | 1159 | qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); |
1158 | qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); | 1160 | qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); |
1159 | return 0; | 1161 | return 0; |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 449676e48fd0..c1b0b2761f8d 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -3520,6 +3520,7 @@ static int qeth_l3_recover(void *ptr) | |||
3520 | QETH_CARD_TEXT(card, 2, "recover2"); | 3520 | QETH_CARD_TEXT(card, 2, "recover2"); |
3521 | dev_warn(&card->gdev->dev, | 3521 | dev_warn(&card->gdev->dev, |
3522 | "A recovery process has been started for the device\n"); | 3522 | "A recovery process has been started for the device\n"); |
3523 | qeth_set_recovery_task(card); | ||
3523 | __qeth_l3_set_offline(card->gdev, 1); | 3524 | __qeth_l3_set_offline(card->gdev, 1); |
3524 | rc = __qeth_l3_set_online(card->gdev, 1); | 3525 | rc = __qeth_l3_set_online(card->gdev, 1); |
3525 | if (!rc) | 3526 | if (!rc) |
@@ -3530,6 +3531,7 @@ static int qeth_l3_recover(void *ptr) | |||
3530 | dev_warn(&card->gdev->dev, "The qeth device driver " | 3531 | dev_warn(&card->gdev->dev, "The qeth device driver " |
3531 | "failed to recover an error on the device\n"); | 3532 | "failed to recover an error on the device\n"); |
3532 | } | 3533 | } |
3534 | qeth_clear_recovery_task(card); | ||
3533 | qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); | 3535 | qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); |
3534 | qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); | 3536 | qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); |
3535 | return 0; | 3537 | return 0; |
diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c index 1a9d1e3ce64c..c1441ed282eb 100644 --- a/drivers/sbus/char/bbc_i2c.c +++ b/drivers/sbus/char/bbc_i2c.c | |||
@@ -282,7 +282,7 @@ static irqreturn_t bbc_i2c_interrupt(int irq, void *dev_id) | |||
282 | return IRQ_HANDLED; | 282 | return IRQ_HANDLED; |
283 | } | 283 | } |
284 | 284 | ||
285 | static void __init reset_one_i2c(struct bbc_i2c_bus *bp) | 285 | static void reset_one_i2c(struct bbc_i2c_bus *bp) |
286 | { | 286 | { |
287 | writeb(I2C_PCF_PIN, bp->i2c_control_regs + 0x0); | 287 | writeb(I2C_PCF_PIN, bp->i2c_control_regs + 0x0); |
288 | writeb(bp->own, bp->i2c_control_regs + 0x1); | 288 | writeb(bp->own, bp->i2c_control_regs + 0x1); |
@@ -291,7 +291,7 @@ static void __init reset_one_i2c(struct bbc_i2c_bus *bp) | |||
291 | writeb(I2C_PCF_IDLE, bp->i2c_control_regs + 0x0); | 291 | writeb(I2C_PCF_IDLE, bp->i2c_control_regs + 0x0); |
292 | } | 292 | } |
293 | 293 | ||
294 | static struct bbc_i2c_bus * __init attach_one_i2c(struct platform_device *op, int index) | 294 | static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int index) |
295 | { | 295 | { |
296 | struct bbc_i2c_bus *bp; | 296 | struct bbc_i2c_bus *bp; |
297 | struct device_node *dp; | 297 | struct device_node *dp; |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index a044f593e8b9..d0fa4b6c551f 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -1899,8 +1899,8 @@ static int ibmvscsi_slave_configure(struct scsi_device *sdev) | |||
1899 | sdev->allow_restart = 1; | 1899 | sdev->allow_restart = 1; |
1900 | blk_queue_rq_timeout(sdev->request_queue, 120 * HZ); | 1900 | blk_queue_rq_timeout(sdev->request_queue, 120 * HZ); |
1901 | } | 1901 | } |
1902 | scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun); | ||
1903 | spin_unlock_irqrestore(shost->host_lock, lock_flags); | 1902 | spin_unlock_irqrestore(shost->host_lock, lock_flags); |
1903 | scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun); | ||
1904 | return 0; | 1904 | return 0; |
1905 | } | 1905 | } |
1906 | 1906 | ||
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index f328089a1060..2197b57fb225 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -5148,7 +5148,7 @@ static int ipr_cancel_op(struct scsi_cmnd *scsi_cmd) | |||
5148 | ipr_trace; | 5148 | ipr_trace; |
5149 | } | 5149 | } |
5150 | 5150 | ||
5151 | list_add_tail(&ipr_cmd->queue, &hrrq->hrrq_free_q); | 5151 | list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); |
5152 | if (!ipr_is_naca_model(res)) | 5152 | if (!ipr_is_naca_model(res)) |
5153 | res->needs_sync_complete = 1; | 5153 | res->needs_sync_complete = 1; |
5154 | 5154 | ||
@@ -9349,7 +9349,10 @@ static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev) | |||
9349 | int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg); | 9349 | int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg); |
9350 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | 9350 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); |
9351 | 9351 | ||
9352 | rc = request_irq(pdev->irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg); | 9352 | if (ioa_cfg->intr_flag == IPR_USE_MSIX) |
9353 | rc = request_irq(ioa_cfg->vectors_info[0].vec, ipr_test_intr, 0, IPR_NAME, ioa_cfg); | ||
9354 | else | ||
9355 | rc = request_irq(pdev->irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg); | ||
9353 | if (rc) { | 9356 | if (rc) { |
9354 | dev_err(&pdev->dev, "Can not assign irq %d\n", pdev->irq); | 9357 | dev_err(&pdev->dev, "Can not assign irq %d\n", pdev->irq); |
9355 | return rc; | 9358 | return rc; |
@@ -9371,7 +9374,10 @@ static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev) | |||
9371 | 9374 | ||
9372 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | 9375 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); |
9373 | 9376 | ||
9374 | free_irq(pdev->irq, ioa_cfg); | 9377 | if (ioa_cfg->intr_flag == IPR_USE_MSIX) |
9378 | free_irq(ioa_cfg->vectors_info[0].vec, ioa_cfg); | ||
9379 | else | ||
9380 | free_irq(pdev->irq, ioa_cfg); | ||
9375 | 9381 | ||
9376 | LEAVE; | 9382 | LEAVE; |
9377 | 9383 | ||
@@ -9722,6 +9728,7 @@ static void __ipr_remove(struct pci_dev *pdev) | |||
9722 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags); | 9728 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, host_lock_flags); |
9723 | wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload); | 9729 | wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload); |
9724 | flush_work(&ioa_cfg->work_q); | 9730 | flush_work(&ioa_cfg->work_q); |
9731 | INIT_LIST_HEAD(&ioa_cfg->used_res_q); | ||
9725 | spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags); | 9732 | spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags); |
9726 | 9733 | ||
9727 | spin_lock(&ipr_driver_lock); | 9734 | spin_lock(&ipr_driver_lock); |
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index aec2e0da5016..55cbd0180159 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
@@ -235,6 +235,17 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) | |||
235 | linkrate = phy->linkrate; | 235 | linkrate = phy->linkrate; |
236 | memcpy(sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE); | 236 | memcpy(sas_addr, phy->attached_sas_addr, SAS_ADDR_SIZE); |
237 | 237 | ||
238 | /* Handle vacant phy - rest of dr data is not valid so skip it */ | ||
239 | if (phy->phy_state == PHY_VACANT) { | ||
240 | memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); | ||
241 | phy->attached_dev_type = NO_DEVICE; | ||
242 | if (!test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) { | ||
243 | phy->phy_id = phy_id; | ||
244 | goto skip; | ||
245 | } else | ||
246 | goto out; | ||
247 | } | ||
248 | |||
238 | phy->attached_dev_type = to_dev_type(dr); | 249 | phy->attached_dev_type = to_dev_type(dr); |
239 | if (test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) | 250 | if (test_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state)) |
240 | goto out; | 251 | goto out; |
@@ -272,6 +283,7 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id, void *rsp) | |||
272 | phy->phy->maximum_linkrate = dr->pmax_linkrate; | 283 | phy->phy->maximum_linkrate = dr->pmax_linkrate; |
273 | phy->phy->negotiated_linkrate = phy->linkrate; | 284 | phy->phy->negotiated_linkrate = phy->linkrate; |
274 | 285 | ||
286 | skip: | ||
275 | if (new_phy) | 287 | if (new_phy) |
276 | if (sas_phy_add(phy->phy)) { | 288 | if (sas_phy_add(phy->phy)) { |
277 | sas_phy_free(phy->phy); | 289 | sas_phy_free(phy->phy); |
@@ -388,7 +400,7 @@ int sas_ex_phy_discover(struct domain_device *dev, int single) | |||
388 | if (!disc_req) | 400 | if (!disc_req) |
389 | return -ENOMEM; | 401 | return -ENOMEM; |
390 | 402 | ||
391 | disc_resp = alloc_smp_req(DISCOVER_RESP_SIZE); | 403 | disc_resp = alloc_smp_resp(DISCOVER_RESP_SIZE); |
392 | if (!disc_resp) { | 404 | if (!disc_resp) { |
393 | kfree(disc_req); | 405 | kfree(disc_req); |
394 | return -ENOMEM; | 406 | return -ENOMEM; |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 74b67d98e952..d43faf34c1e2 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -438,11 +438,12 @@ lpfc_sli4_rq_put(struct lpfc_queue *hq, struct lpfc_queue *dq, | |||
438 | struct lpfc_rqe *temp_hrqe; | 438 | struct lpfc_rqe *temp_hrqe; |
439 | struct lpfc_rqe *temp_drqe; | 439 | struct lpfc_rqe *temp_drqe; |
440 | struct lpfc_register doorbell; | 440 | struct lpfc_register doorbell; |
441 | int put_index = hq->host_index; | 441 | int put_index; |
442 | 442 | ||
443 | /* sanity check on queue memory */ | 443 | /* sanity check on queue memory */ |
444 | if (unlikely(!hq) || unlikely(!dq)) | 444 | if (unlikely(!hq) || unlikely(!dq)) |
445 | return -ENOMEM; | 445 | return -ENOMEM; |
446 | put_index = hq->host_index; | ||
446 | temp_hrqe = hq->qe[hq->host_index].rqe; | 447 | temp_hrqe = hq->qe[hq->host_index].rqe; |
447 | temp_drqe = dq->qe[dq->host_index].rqe; | 448 | temp_drqe = dq->qe[dq->host_index].rqe; |
448 | 449 | ||
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 1d82eef4e1eb..b3db9dcc2619 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1938,11 +1938,6 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) | |||
1938 | "Timer for the VP[%d] has stopped\n", vha->vp_idx); | 1938 | "Timer for the VP[%d] has stopped\n", vha->vp_idx); |
1939 | } | 1939 | } |
1940 | 1940 | ||
1941 | /* No pending activities shall be there on the vha now */ | ||
1942 | if (ql2xextended_error_logging & ql_dbg_user) | ||
1943 | msleep(random32()%10); /* Just to see if something falls on | ||
1944 | * the net we have placed below */ | ||
1945 | |||
1946 | BUG_ON(atomic_read(&vha->vref_count)); | 1941 | BUG_ON(atomic_read(&vha->vref_count)); |
1947 | 1942 | ||
1948 | qla2x00_free_fcports(vha); | 1943 | qla2x00_free_fcports(vha); |
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 1626de52e32a..fbc305f1c87c 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -15,6 +15,7 @@ | |||
15 | * | Mailbox commands | 0x115b | 0x111a-0x111b | | 15 | * | Mailbox commands | 0x115b | 0x111a-0x111b | |
16 | * | | | 0x112c-0x112e | | 16 | * | | | 0x112c-0x112e | |
17 | * | | | 0x113a | | 17 | * | | | 0x113a | |
18 | * | | | 0x1155-0x1158 | | ||
18 | * | Device Discovery | 0x2087 | 0x2020-0x2022, | | 19 | * | Device Discovery | 0x2087 | 0x2020-0x2022, | |
19 | * | | | 0x2016 | | 20 | * | | | 0x2016 | |
20 | * | Queue Command and IO tracing | 0x3031 | 0x3006-0x300b | | 21 | * | Queue Command and IO tracing | 0x3031 | 0x3006-0x300b | |
@@ -401,7 +402,7 @@ qla2xxx_copy_atioqueues(struct qla_hw_data *ha, void *ptr, | |||
401 | void *ring; | 402 | void *ring; |
402 | } aq, *aqp; | 403 | } aq, *aqp; |
403 | 404 | ||
404 | if (!ha->tgt.atio_q_length) | 405 | if (!ha->tgt.atio_ring) |
405 | return ptr; | 406 | return ptr; |
406 | 407 | ||
407 | num_queues = 1; | 408 | num_queues = 1; |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c6509911772b..65c5ff75936b 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -863,7 +863,6 @@ typedef struct { | |||
863 | #define MBX_1 BIT_1 | 863 | #define MBX_1 BIT_1 |
864 | #define MBX_0 BIT_0 | 864 | #define MBX_0 BIT_0 |
865 | 865 | ||
866 | #define RNID_TYPE_SET_VERSION 0x9 | ||
867 | #define RNID_TYPE_ASIC_TEMP 0xC | 866 | #define RNID_TYPE_ASIC_TEMP 0xC |
868 | 867 | ||
869 | /* | 868 | /* |
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index eb3ca21a7f17..b310fa97b545 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -358,9 +358,6 @@ extern int | |||
358 | qla2x00_disable_fce_trace(scsi_qla_host_t *, uint64_t *, uint64_t *); | 358 | qla2x00_disable_fce_trace(scsi_qla_host_t *, uint64_t *, uint64_t *); |
359 | 359 | ||
360 | extern int | 360 | extern int |
361 | qla2x00_set_driver_version(scsi_qla_host_t *, char *); | ||
362 | |||
363 | extern int | ||
364 | qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint8_t *, | 361 | qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint8_t *, |
365 | uint16_t, uint16_t, uint16_t, uint16_t); | 362 | uint16_t, uint16_t, uint16_t, uint16_t); |
366 | 363 | ||
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index edf4d14a1335..b59203393cb2 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -619,8 +619,6 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha) | |||
619 | if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) | 619 | if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)) |
620 | qla24xx_read_fcp_prio_cfg(vha); | 620 | qla24xx_read_fcp_prio_cfg(vha); |
621 | 621 | ||
622 | qla2x00_set_driver_version(vha, QLA2XXX_VERSION); | ||
623 | |||
624 | return (rval); | 622 | return (rval); |
625 | } | 623 | } |
626 | 624 | ||
@@ -1399,7 +1397,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) | |||
1399 | mq_size += ha->max_rsp_queues * | 1397 | mq_size += ha->max_rsp_queues * |
1400 | (rsp->length * sizeof(response_t)); | 1398 | (rsp->length * sizeof(response_t)); |
1401 | } | 1399 | } |
1402 | if (ha->tgt.atio_q_length) | 1400 | if (ha->tgt.atio_ring) |
1403 | mq_size += ha->tgt.atio_q_length * sizeof(request_t); | 1401 | mq_size += ha->tgt.atio_q_length * sizeof(request_t); |
1404 | /* Allocate memory for Fibre Channel Event Buffer. */ | 1402 | /* Allocate memory for Fibre Channel Event Buffer. */ |
1405 | if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha) && !IS_QLA83XX(ha)) | 1403 | if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha) && !IS_QLA83XX(ha)) |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 186dd59ce4fa..43345af56431 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -3866,64 +3866,6 @@ qla81xx_restart_mpi_firmware(scsi_qla_host_t *vha) | |||
3866 | return rval; | 3866 | return rval; |
3867 | } | 3867 | } |
3868 | 3868 | ||
3869 | int | ||
3870 | qla2x00_set_driver_version(scsi_qla_host_t *vha, char *version) | ||
3871 | { | ||
3872 | int rval; | ||
3873 | mbx_cmd_t mc; | ||
3874 | mbx_cmd_t *mcp = &mc; | ||
3875 | int len; | ||
3876 | uint16_t dwlen; | ||
3877 | uint8_t *str; | ||
3878 | dma_addr_t str_dma; | ||
3879 | struct qla_hw_data *ha = vha->hw; | ||
3880 | |||
3881 | if (!IS_FWI2_CAPABLE(ha) || IS_QLA82XX(ha)) | ||
3882 | return QLA_FUNCTION_FAILED; | ||
3883 | |||
3884 | ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1155, | ||
3885 | "Entered %s.\n", __func__); | ||
3886 | |||
3887 | str = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &str_dma); | ||
3888 | if (!str) { | ||
3889 | ql_log(ql_log_warn, vha, 0x1156, | ||
3890 | "Failed to allocate driver version param.\n"); | ||
3891 | return QLA_MEMORY_ALLOC_FAILED; | ||
3892 | } | ||
3893 | |||
3894 | memcpy(str, "\x7\x3\x11\x0", 4); | ||
3895 | dwlen = str[0]; | ||
3896 | len = dwlen * sizeof(uint32_t) - 4; | ||
3897 | memset(str + 4, 0, len); | ||
3898 | if (len > strlen(version)) | ||
3899 | len = strlen(version); | ||
3900 | memcpy(str + 4, version, len); | ||
3901 | |||
3902 | mcp->mb[0] = MBC_SET_RNID_PARAMS; | ||
3903 | mcp->mb[1] = RNID_TYPE_SET_VERSION << 8 | dwlen; | ||
3904 | mcp->mb[2] = MSW(LSD(str_dma)); | ||
3905 | mcp->mb[3] = LSW(LSD(str_dma)); | ||
3906 | mcp->mb[6] = MSW(MSD(str_dma)); | ||
3907 | mcp->mb[7] = LSW(MSD(str_dma)); | ||
3908 | mcp->out_mb = MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; | ||
3909 | mcp->in_mb = MBX_0; | ||
3910 | mcp->tov = MBX_TOV_SECONDS; | ||
3911 | mcp->flags = 0; | ||
3912 | rval = qla2x00_mailbox_command(vha, mcp); | ||
3913 | |||
3914 | if (rval != QLA_SUCCESS) { | ||
3915 | ql_dbg(ql_dbg_mbx, vha, 0x1157, | ||
3916 | "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); | ||
3917 | } else { | ||
3918 | ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1158, | ||
3919 | "Done %s.\n", __func__); | ||
3920 | } | ||
3921 | |||
3922 | dma_pool_free(ha->s_dma_pool, str, str_dma); | ||
3923 | |||
3924 | return rval; | ||
3925 | } | ||
3926 | |||
3927 | static int | 3869 | static int |
3928 | qla2x00_read_asic_temperature(scsi_qla_host_t *vha, uint16_t *temp) | 3870 | qla2x00_read_asic_temperature(scsi_qla_host_t *vha, uint16_t *temp) |
3929 | { | 3871 | { |
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 2b6e478d9e33..ec54036d1e12 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.04.00.08-k" | 10 | #define QLA2XXX_VERSION "8.04.00.13-k" |
11 | 11 | ||
12 | #define QLA_DRIVER_MAJOR_VER 8 | 12 | #define QLA_DRIVER_MAJOR_VER 8 |
13 | #define QLA_DRIVER_MINOR_VER 4 | 13 | #define QLA_DRIVER_MINOR_VER 4 |
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 86974471af68..2a32036a9404 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -4112,6 +4112,10 @@ static int st_probe(struct device *dev) | |||
4112 | tpnt->disk = disk; | 4112 | tpnt->disk = disk; |
4113 | disk->private_data = &tpnt->driver; | 4113 | disk->private_data = &tpnt->driver; |
4114 | disk->queue = SDp->request_queue; | 4114 | disk->queue = SDp->request_queue; |
4115 | /* SCSI tape doesn't register this gendisk via add_disk(). Manually | ||
4116 | * take queue reference that release_disk() expects. */ | ||
4117 | if (!blk_get_queue(disk->queue)) | ||
4118 | goto out_put_disk; | ||
4115 | tpnt->driver = &st_template; | 4119 | tpnt->driver = &st_template; |
4116 | 4120 | ||
4117 | tpnt->device = SDp; | 4121 | tpnt->device = SDp; |
@@ -4185,7 +4189,7 @@ static int st_probe(struct device *dev) | |||
4185 | idr_preload_end(); | 4189 | idr_preload_end(); |
4186 | if (error < 0) { | 4190 | if (error < 0) { |
4187 | pr_warn("st: idr allocation failed: %d\n", error); | 4191 | pr_warn("st: idr allocation failed: %d\n", error); |
4188 | goto out_put_disk; | 4192 | goto out_put_queue; |
4189 | } | 4193 | } |
4190 | tpnt->index = error; | 4194 | tpnt->index = error; |
4191 | sprintf(disk->disk_name, "st%d", tpnt->index); | 4195 | sprintf(disk->disk_name, "st%d", tpnt->index); |
@@ -4211,6 +4215,8 @@ out_remove_devs: | |||
4211 | spin_lock(&st_index_lock); | 4215 | spin_lock(&st_index_lock); |
4212 | idr_remove(&st_index_idr, tpnt->index); | 4216 | idr_remove(&st_index_idr, tpnt->index); |
4213 | spin_unlock(&st_index_lock); | 4217 | spin_unlock(&st_index_lock); |
4218 | out_put_queue: | ||
4219 | blk_put_queue(disk->queue); | ||
4214 | out_put_disk: | 4220 | out_put_disk: |
4215 | put_disk(disk); | 4221 | put_disk(disk); |
4216 | kfree(tpnt); | 4222 | kfree(tpnt); |
diff --git a/drivers/ssb/driver_chipcommon_pmu.c b/drivers/ssb/driver_chipcommon_pmu.c index 791da2c0d8f6..23c5dbfea115 100644 --- a/drivers/ssb/driver_chipcommon_pmu.c +++ b/drivers/ssb/driver_chipcommon_pmu.c | |||
@@ -670,3 +670,32 @@ u32 ssb_pmu_get_controlclock(struct ssb_chipcommon *cc) | |||
670 | return 0; | 670 | return 0; |
671 | } | 671 | } |
672 | } | 672 | } |
673 | |||
674 | void ssb_pmu_spuravoid_pllupdate(struct ssb_chipcommon *cc, int spuravoid) | ||
675 | { | ||
676 | u32 pmu_ctl = 0; | ||
677 | |||
678 | switch (cc->dev->bus->chip_id) { | ||
679 | case 0x4322: | ||
680 | ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL0, 0x11100070); | ||
681 | ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL1, 0x1014140a); | ||
682 | ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL5, 0x88888854); | ||
683 | if (spuravoid == 1) | ||
684 | ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL2, 0x05201828); | ||
685 | else | ||
686 | ssb_chipco_pll_write(cc, SSB_PMU1_PLLCTL2, 0x05001828); | ||
687 | pmu_ctl = SSB_CHIPCO_PMU_CTL_PLL_UPD; | ||
688 | break; | ||
689 | case 43222: | ||
690 | /* TODO: BCM43222 requires updating PLLs too */ | ||
691 | return; | ||
692 | default: | ||
693 | ssb_printk(KERN_ERR PFX | ||
694 | "Unknown spuravoidance settings for chip 0x%04X, not changing PLL\n", | ||
695 | cc->dev->bus->chip_id); | ||
696 | return; | ||
697 | } | ||
698 | |||
699 | chipco_set32(cc, SSB_CHIPCO_PMU_CTL, pmu_ctl); | ||
700 | } | ||
701 | EXPORT_SYMBOL_GPL(ssb_pmu_spuravoid_pllupdate); | ||
diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index ff1c5ee352cb..cbe48ab41745 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c | |||
@@ -409,6 +409,7 @@ static inline int core_alua_state_standby( | |||
409 | case REPORT_LUNS: | 409 | case REPORT_LUNS: |
410 | case RECEIVE_DIAGNOSTIC: | 410 | case RECEIVE_DIAGNOSTIC: |
411 | case SEND_DIAGNOSTIC: | 411 | case SEND_DIAGNOSTIC: |
412 | return 0; | ||
412 | case MAINTENANCE_IN: | 413 | case MAINTENANCE_IN: |
413 | switch (cdb[1] & 0x1f) { | 414 | switch (cdb[1] & 0x1f) { |
414 | case MI_REPORT_TARGET_PGS: | 415 | case MI_REPORT_TARGET_PGS: |
@@ -451,6 +452,7 @@ static inline int core_alua_state_unavailable( | |||
451 | switch (cdb[0]) { | 452 | switch (cdb[0]) { |
452 | case INQUIRY: | 453 | case INQUIRY: |
453 | case REPORT_LUNS: | 454 | case REPORT_LUNS: |
455 | return 0; | ||
454 | case MAINTENANCE_IN: | 456 | case MAINTENANCE_IN: |
455 | switch (cdb[1] & 0x1f) { | 457 | switch (cdb[1] & 0x1f) { |
456 | case MI_REPORT_TARGET_PGS: | 458 | case MI_REPORT_TARGET_PGS: |
@@ -491,6 +493,7 @@ static inline int core_alua_state_transition( | |||
491 | switch (cdb[0]) { | 493 | switch (cdb[0]) { |
492 | case INQUIRY: | 494 | case INQUIRY: |
493 | case REPORT_LUNS: | 495 | case REPORT_LUNS: |
496 | return 0; | ||
494 | case MAINTENANCE_IN: | 497 | case MAINTENANCE_IN: |
495 | switch (cdb[1] & 0x1f) { | 498 | switch (cdb[1] & 0x1f) { |
496 | case MI_REPORT_TARGET_PGS: | 499 | case MI_REPORT_TARGET_PGS: |
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 484b6a3c9b03..302909ccf183 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c | |||
@@ -2643,9 +2643,9 @@ static int mxser_probe(struct pci_dev *pdev, | |||
2643 | mxvar_sdriver, brd->idx + i, &pdev->dev); | 2643 | mxvar_sdriver, brd->idx + i, &pdev->dev); |
2644 | if (IS_ERR(tty_dev)) { | 2644 | if (IS_ERR(tty_dev)) { |
2645 | retval = PTR_ERR(tty_dev); | 2645 | retval = PTR_ERR(tty_dev); |
2646 | for (i--; i >= 0; i--) | 2646 | for (; i > 0; i--) |
2647 | tty_unregister_device(mxvar_sdriver, | 2647 | tty_unregister_device(mxvar_sdriver, |
2648 | brd->idx + i); | 2648 | brd->idx + i - 1); |
2649 | goto err_relbrd; | 2649 | goto err_relbrd; |
2650 | } | 2650 | } |
2651 | } | 2651 | } |
@@ -2751,9 +2751,9 @@ static int __init mxser_module_init(void) | |||
2751 | tty_dev = tty_port_register_device(&brd->ports[i].port, | 2751 | tty_dev = tty_port_register_device(&brd->ports[i].port, |
2752 | mxvar_sdriver, brd->idx + i, NULL); | 2752 | mxvar_sdriver, brd->idx + i, NULL); |
2753 | if (IS_ERR(tty_dev)) { | 2753 | if (IS_ERR(tty_dev)) { |
2754 | for (i--; i >= 0; i--) | 2754 | for (; i > 0; i--) |
2755 | tty_unregister_device(mxvar_sdriver, | 2755 | tty_unregister_device(mxvar_sdriver, |
2756 | brd->idx + i); | 2756 | brd->idx + i - 1); |
2757 | for (i = 0; i < brd->info->nports; i++) | 2757 | for (i = 0; i < brd->info->nports; i++) |
2758 | tty_port_destroy(&brd->ports[i].port); | 2758 | tty_port_destroy(&brd->ports[i].port); |
2759 | free_irq(brd->irq, brd); | 2759 | free_irq(brd->irq, brd); |
diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c index b3455a970a1d..35d9ab95c5cb 100644 --- a/drivers/tty/serial/8250/8250_pnp.c +++ b/drivers/tty/serial/8250/8250_pnp.c | |||
@@ -429,7 +429,6 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | |||
429 | { | 429 | { |
430 | struct uart_8250_port uart; | 430 | struct uart_8250_port uart; |
431 | int ret, line, flags = dev_id->driver_data; | 431 | int ret, line, flags = dev_id->driver_data; |
432 | struct resource *res = NULL; | ||
433 | 432 | ||
434 | if (flags & UNKNOWN_DEV) { | 433 | if (flags & UNKNOWN_DEV) { |
435 | ret = serial_pnp_guess_board(dev); | 434 | ret = serial_pnp_guess_board(dev); |
@@ -440,12 +439,11 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | |||
440 | memset(&uart, 0, sizeof(uart)); | 439 | memset(&uart, 0, sizeof(uart)); |
441 | if (pnp_irq_valid(dev, 0)) | 440 | if (pnp_irq_valid(dev, 0)) |
442 | uart.port.irq = pnp_irq(dev, 0); | 441 | uart.port.irq = pnp_irq(dev, 0); |
443 | if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) | 442 | if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) { |
444 | res = pnp_get_resource(dev, IORESOURCE_IO, 2); | 443 | uart.port.iobase = pnp_port_start(dev, 2); |
445 | else if (pnp_port_valid(dev, 0)) | 444 | uart.port.iotype = UPIO_PORT; |
446 | res = pnp_get_resource(dev, IORESOURCE_IO, 0); | 445 | } else if (pnp_port_valid(dev, 0)) { |
447 | if (pnp_resource_enabled(res)) { | 446 | uart.port.iobase = pnp_port_start(dev, 0); |
448 | uart.port.iobase = res->start; | ||
449 | uart.port.iotype = UPIO_PORT; | 447 | uart.port.iotype = UPIO_PORT; |
450 | } else if (pnp_mem_valid(dev, 0)) { | 448 | } else if (pnp_mem_valid(dev, 0)) { |
451 | uart.port.mapbase = pnp_mem_start(dev, 0); | 449 | uart.port.mapbase = pnp_mem_start(dev, 0); |
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 4dc41408ecb7..30d4f7a783cd 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c | |||
@@ -886,6 +886,17 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, | |||
886 | serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR); | 886 | serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR); |
887 | /* FIFO ENABLE, DMA MODE */ | 887 | /* FIFO ENABLE, DMA MODE */ |
888 | 888 | ||
889 | up->scr |= OMAP_UART_SCR_RX_TRIG_GRANU1_MASK; | ||
890 | /* | ||
891 | * NOTE: Setting OMAP_UART_SCR_RX_TRIG_GRANU1_MASK | ||
892 | * sets Enables the granularity of 1 for TRIGGER RX | ||
893 | * level. Along with setting RX FIFO trigger level | ||
894 | * to 1 (as noted below, 16 characters) and TLR[3:0] | ||
895 | * to zero this will result RX FIFO threshold level | ||
896 | * to 1 character, instead of 16 as noted in comment | ||
897 | * below. | ||
898 | */ | ||
899 | |||
889 | /* Set receive FIFO threshold to 16 characters and | 900 | /* Set receive FIFO threshold to 16 characters and |
890 | * transmit FIFO threshold to 16 spaces | 901 | * transmit FIFO threshold to 16 spaces |
891 | */ | 902 | */ |
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 8189cb6a86af..7abc5c81af2c 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c | |||
@@ -346,6 +346,7 @@ static long vfio_pci_ioctl(void *device_data, | |||
346 | 346 | ||
347 | if (!(hdr.flags & VFIO_IRQ_SET_DATA_NONE)) { | 347 | if (!(hdr.flags & VFIO_IRQ_SET_DATA_NONE)) { |
348 | size_t size; | 348 | size_t size; |
349 | int max = vfio_pci_get_irq_count(vdev, hdr.index); | ||
349 | 350 | ||
350 | if (hdr.flags & VFIO_IRQ_SET_DATA_BOOL) | 351 | if (hdr.flags & VFIO_IRQ_SET_DATA_BOOL) |
351 | size = sizeof(uint8_t); | 352 | size = sizeof(uint8_t); |
@@ -355,7 +356,7 @@ static long vfio_pci_ioctl(void *device_data, | |||
355 | return -EINVAL; | 356 | return -EINVAL; |
356 | 357 | ||
357 | if (hdr.argsz - minsz < hdr.count * size || | 358 | if (hdr.argsz - minsz < hdr.count * size || |
358 | hdr.count > vfio_pci_get_irq_count(vdev, hdr.index)) | 359 | hdr.start >= max || hdr.start + hdr.count > max) |
359 | return -EINVAL; | 360 | return -EINVAL; |
360 | 361 | ||
361 | data = memdup_user((void __user *)(arg + minsz), | 362 | data = memdup_user((void __user *)(arg + minsz), |
diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 2968b4934659..957a0b98a5d9 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c | |||
@@ -74,9 +74,8 @@ enum { | |||
74 | 74 | ||
75 | struct vhost_scsi { | 75 | struct vhost_scsi { |
76 | /* Protected by vhost_scsi->dev.mutex */ | 76 | /* Protected by vhost_scsi->dev.mutex */ |
77 | struct tcm_vhost_tpg *vs_tpg[VHOST_SCSI_MAX_TARGET]; | 77 | struct tcm_vhost_tpg **vs_tpg; |
78 | char vs_vhost_wwpn[TRANSPORT_IQN_LEN]; | 78 | char vs_vhost_wwpn[TRANSPORT_IQN_LEN]; |
79 | bool vs_endpoint; | ||
80 | 79 | ||
81 | struct vhost_dev dev; | 80 | struct vhost_dev dev; |
82 | struct vhost_virtqueue vqs[VHOST_SCSI_MAX_VQ]; | 81 | struct vhost_virtqueue vqs[VHOST_SCSI_MAX_VQ]; |
@@ -579,9 +578,27 @@ static void tcm_vhost_submission_work(struct work_struct *work) | |||
579 | } | 578 | } |
580 | } | 579 | } |
581 | 580 | ||
581 | static void vhost_scsi_send_bad_target(struct vhost_scsi *vs, | ||
582 | struct vhost_virtqueue *vq, int head, unsigned out) | ||
583 | { | ||
584 | struct virtio_scsi_cmd_resp __user *resp; | ||
585 | struct virtio_scsi_cmd_resp rsp; | ||
586 | int ret; | ||
587 | |||
588 | memset(&rsp, 0, sizeof(rsp)); | ||
589 | rsp.response = VIRTIO_SCSI_S_BAD_TARGET; | ||
590 | resp = vq->iov[out].iov_base; | ||
591 | ret = __copy_to_user(resp, &rsp, sizeof(rsp)); | ||
592 | if (!ret) | ||
593 | vhost_add_used_and_signal(&vs->dev, vq, head, 0); | ||
594 | else | ||
595 | pr_err("Faulted on virtio_scsi_cmd_resp\n"); | ||
596 | } | ||
597 | |||
582 | static void vhost_scsi_handle_vq(struct vhost_scsi *vs, | 598 | static void vhost_scsi_handle_vq(struct vhost_scsi *vs, |
583 | struct vhost_virtqueue *vq) | 599 | struct vhost_virtqueue *vq) |
584 | { | 600 | { |
601 | struct tcm_vhost_tpg **vs_tpg; | ||
585 | struct virtio_scsi_cmd_req v_req; | 602 | struct virtio_scsi_cmd_req v_req; |
586 | struct tcm_vhost_tpg *tv_tpg; | 603 | struct tcm_vhost_tpg *tv_tpg; |
587 | struct tcm_vhost_cmd *tv_cmd; | 604 | struct tcm_vhost_cmd *tv_cmd; |
@@ -590,8 +607,16 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, | |||
590 | int head, ret; | 607 | int head, ret; |
591 | u8 target; | 608 | u8 target; |
592 | 609 | ||
593 | /* Must use ioctl VHOST_SCSI_SET_ENDPOINT */ | 610 | /* |
594 | if (unlikely(!vs->vs_endpoint)) | 611 | * We can handle the vq only after the endpoint is setup by calling the |
612 | * VHOST_SCSI_SET_ENDPOINT ioctl. | ||
613 | * | ||
614 | * TODO: Check that we are running from vhost_worker which acts | ||
615 | * as read-side critical section for vhost kind of RCU. | ||
616 | * See the comments in struct vhost_virtqueue in drivers/vhost/vhost.h | ||
617 | */ | ||
618 | vs_tpg = rcu_dereference_check(vq->private_data, 1); | ||
619 | if (!vs_tpg) | ||
595 | return; | 620 | return; |
596 | 621 | ||
597 | mutex_lock(&vq->mutex); | 622 | mutex_lock(&vq->mutex); |
@@ -661,23 +686,11 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, | |||
661 | 686 | ||
662 | /* Extract the tpgt */ | 687 | /* Extract the tpgt */ |
663 | target = v_req.lun[1]; | 688 | target = v_req.lun[1]; |
664 | tv_tpg = vs->vs_tpg[target]; | 689 | tv_tpg = ACCESS_ONCE(vs_tpg[target]); |
665 | 690 | ||
666 | /* Target does not exist, fail the request */ | 691 | /* Target does not exist, fail the request */ |
667 | if (unlikely(!tv_tpg)) { | 692 | if (unlikely(!tv_tpg)) { |
668 | struct virtio_scsi_cmd_resp __user *resp; | 693 | vhost_scsi_send_bad_target(vs, vq, head, out); |
669 | struct virtio_scsi_cmd_resp rsp; | ||
670 | |||
671 | memset(&rsp, 0, sizeof(rsp)); | ||
672 | rsp.response = VIRTIO_SCSI_S_BAD_TARGET; | ||
673 | resp = vq->iov[out].iov_base; | ||
674 | ret = __copy_to_user(resp, &rsp, sizeof(rsp)); | ||
675 | if (!ret) | ||
676 | vhost_add_used_and_signal(&vs->dev, | ||
677 | vq, head, 0); | ||
678 | else | ||
679 | pr_err("Faulted on virtio_scsi_cmd_resp\n"); | ||
680 | |||
681 | continue; | 694 | continue; |
682 | } | 695 | } |
683 | 696 | ||
@@ -690,22 +703,13 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, | |||
690 | if (IS_ERR(tv_cmd)) { | 703 | if (IS_ERR(tv_cmd)) { |
691 | vq_err(vq, "vhost_scsi_allocate_cmd failed %ld\n", | 704 | vq_err(vq, "vhost_scsi_allocate_cmd failed %ld\n", |
692 | PTR_ERR(tv_cmd)); | 705 | PTR_ERR(tv_cmd)); |
693 | break; | 706 | goto err_cmd; |
694 | } | 707 | } |
695 | pr_debug("Allocated tv_cmd: %p exp_data_len: %d, data_direction" | 708 | pr_debug("Allocated tv_cmd: %p exp_data_len: %d, data_direction" |
696 | ": %d\n", tv_cmd, exp_data_len, data_direction); | 709 | ": %d\n", tv_cmd, exp_data_len, data_direction); |
697 | 710 | ||
698 | tv_cmd->tvc_vhost = vs; | 711 | tv_cmd->tvc_vhost = vs; |
699 | tv_cmd->tvc_vq = vq; | 712 | tv_cmd->tvc_vq = vq; |
700 | |||
701 | if (unlikely(vq->iov[out].iov_len != | ||
702 | sizeof(struct virtio_scsi_cmd_resp))) { | ||
703 | vq_err(vq, "Expecting virtio_scsi_cmd_resp, got %zu" | ||
704 | " bytes, out: %d, in: %d\n", | ||
705 | vq->iov[out].iov_len, out, in); | ||
706 | break; | ||
707 | } | ||
708 | |||
709 | tv_cmd->tvc_resp = vq->iov[out].iov_base; | 713 | tv_cmd->tvc_resp = vq->iov[out].iov_base; |
710 | 714 | ||
711 | /* | 715 | /* |
@@ -725,7 +729,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, | |||
725 | " exceeds SCSI_MAX_VARLEN_CDB_SIZE: %d\n", | 729 | " exceeds SCSI_MAX_VARLEN_CDB_SIZE: %d\n", |
726 | scsi_command_size(tv_cmd->tvc_cdb), | 730 | scsi_command_size(tv_cmd->tvc_cdb), |
727 | TCM_VHOST_MAX_CDB_SIZE); | 731 | TCM_VHOST_MAX_CDB_SIZE); |
728 | break; /* TODO */ | 732 | goto err_free; |
729 | } | 733 | } |
730 | tv_cmd->tvc_lun = ((v_req.lun[2] << 8) | v_req.lun[3]) & 0x3FFF; | 734 | tv_cmd->tvc_lun = ((v_req.lun[2] << 8) | v_req.lun[3]) & 0x3FFF; |
731 | 735 | ||
@@ -738,7 +742,7 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, | |||
738 | data_direction == DMA_TO_DEVICE); | 742 | data_direction == DMA_TO_DEVICE); |
739 | if (unlikely(ret)) { | 743 | if (unlikely(ret)) { |
740 | vq_err(vq, "Failed to map iov to sgl\n"); | 744 | vq_err(vq, "Failed to map iov to sgl\n"); |
741 | break; /* TODO */ | 745 | goto err_free; |
742 | } | 746 | } |
743 | } | 747 | } |
744 | 748 | ||
@@ -759,6 +763,13 @@ static void vhost_scsi_handle_vq(struct vhost_scsi *vs, | |||
759 | } | 763 | } |
760 | 764 | ||
761 | mutex_unlock(&vq->mutex); | 765 | mutex_unlock(&vq->mutex); |
766 | return; | ||
767 | |||
768 | err_free: | ||
769 | vhost_scsi_free_cmd(tv_cmd); | ||
770 | err_cmd: | ||
771 | vhost_scsi_send_bad_target(vs, vq, head, out); | ||
772 | mutex_unlock(&vq->mutex); | ||
762 | } | 773 | } |
763 | 774 | ||
764 | static void vhost_scsi_ctl_handle_kick(struct vhost_work *work) | 775 | static void vhost_scsi_ctl_handle_kick(struct vhost_work *work) |
@@ -780,6 +791,20 @@ static void vhost_scsi_handle_kick(struct vhost_work *work) | |||
780 | vhost_scsi_handle_vq(vs, vq); | 791 | vhost_scsi_handle_vq(vs, vq); |
781 | } | 792 | } |
782 | 793 | ||
794 | static void vhost_scsi_flush_vq(struct vhost_scsi *vs, int index) | ||
795 | { | ||
796 | vhost_poll_flush(&vs->dev.vqs[index].poll); | ||
797 | } | ||
798 | |||
799 | static void vhost_scsi_flush(struct vhost_scsi *vs) | ||
800 | { | ||
801 | int i; | ||
802 | |||
803 | for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) | ||
804 | vhost_scsi_flush_vq(vs, i); | ||
805 | vhost_work_flush(&vs->dev, &vs->vs_completion_work); | ||
806 | } | ||
807 | |||
783 | /* | 808 | /* |
784 | * Called from vhost_scsi_ioctl() context to walk the list of available | 809 | * Called from vhost_scsi_ioctl() context to walk the list of available |
785 | * tcm_vhost_tpg with an active struct tcm_vhost_nexus | 810 | * tcm_vhost_tpg with an active struct tcm_vhost_nexus |
@@ -790,8 +815,10 @@ static int vhost_scsi_set_endpoint( | |||
790 | { | 815 | { |
791 | struct tcm_vhost_tport *tv_tport; | 816 | struct tcm_vhost_tport *tv_tport; |
792 | struct tcm_vhost_tpg *tv_tpg; | 817 | struct tcm_vhost_tpg *tv_tpg; |
818 | struct tcm_vhost_tpg **vs_tpg; | ||
819 | struct vhost_virtqueue *vq; | ||
820 | int index, ret, i, len; | ||
793 | bool match = false; | 821 | bool match = false; |
794 | int index, ret; | ||
795 | 822 | ||
796 | mutex_lock(&vs->dev.mutex); | 823 | mutex_lock(&vs->dev.mutex); |
797 | /* Verify that ring has been setup correctly. */ | 824 | /* Verify that ring has been setup correctly. */ |
@@ -803,6 +830,15 @@ static int vhost_scsi_set_endpoint( | |||
803 | } | 830 | } |
804 | } | 831 | } |
805 | 832 | ||
833 | len = sizeof(vs_tpg[0]) * VHOST_SCSI_MAX_TARGET; | ||
834 | vs_tpg = kzalloc(len, GFP_KERNEL); | ||
835 | if (!vs_tpg) { | ||
836 | mutex_unlock(&vs->dev.mutex); | ||
837 | return -ENOMEM; | ||
838 | } | ||
839 | if (vs->vs_tpg) | ||
840 | memcpy(vs_tpg, vs->vs_tpg, len); | ||
841 | |||
806 | mutex_lock(&tcm_vhost_mutex); | 842 | mutex_lock(&tcm_vhost_mutex); |
807 | list_for_each_entry(tv_tpg, &tcm_vhost_list, tv_tpg_list) { | 843 | list_for_each_entry(tv_tpg, &tcm_vhost_list, tv_tpg_list) { |
808 | mutex_lock(&tv_tpg->tv_tpg_mutex); | 844 | mutex_lock(&tv_tpg->tv_tpg_mutex); |
@@ -817,14 +853,15 @@ static int vhost_scsi_set_endpoint( | |||
817 | tv_tport = tv_tpg->tport; | 853 | tv_tport = tv_tpg->tport; |
818 | 854 | ||
819 | if (!strcmp(tv_tport->tport_name, t->vhost_wwpn)) { | 855 | if (!strcmp(tv_tport->tport_name, t->vhost_wwpn)) { |
820 | if (vs->vs_tpg[tv_tpg->tport_tpgt]) { | 856 | if (vs->vs_tpg && vs->vs_tpg[tv_tpg->tport_tpgt]) { |
821 | mutex_unlock(&tv_tpg->tv_tpg_mutex); | 857 | mutex_unlock(&tv_tpg->tv_tpg_mutex); |
822 | mutex_unlock(&tcm_vhost_mutex); | 858 | mutex_unlock(&tcm_vhost_mutex); |
823 | mutex_unlock(&vs->dev.mutex); | 859 | mutex_unlock(&vs->dev.mutex); |
860 | kfree(vs_tpg); | ||
824 | return -EEXIST; | 861 | return -EEXIST; |
825 | } | 862 | } |
826 | tv_tpg->tv_tpg_vhost_count++; | 863 | tv_tpg->tv_tpg_vhost_count++; |
827 | vs->vs_tpg[tv_tpg->tport_tpgt] = tv_tpg; | 864 | vs_tpg[tv_tpg->tport_tpgt] = tv_tpg; |
828 | smp_mb__after_atomic_inc(); | 865 | smp_mb__after_atomic_inc(); |
829 | match = true; | 866 | match = true; |
830 | } | 867 | } |
@@ -835,12 +872,27 @@ static int vhost_scsi_set_endpoint( | |||
835 | if (match) { | 872 | if (match) { |
836 | memcpy(vs->vs_vhost_wwpn, t->vhost_wwpn, | 873 | memcpy(vs->vs_vhost_wwpn, t->vhost_wwpn, |
837 | sizeof(vs->vs_vhost_wwpn)); | 874 | sizeof(vs->vs_vhost_wwpn)); |
838 | vs->vs_endpoint = true; | 875 | for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) { |
876 | vq = &vs->vqs[i]; | ||
877 | /* Flushing the vhost_work acts as synchronize_rcu */ | ||
878 | mutex_lock(&vq->mutex); | ||
879 | rcu_assign_pointer(vq->private_data, vs_tpg); | ||
880 | vhost_init_used(vq); | ||
881 | mutex_unlock(&vq->mutex); | ||
882 | } | ||
839 | ret = 0; | 883 | ret = 0; |
840 | } else { | 884 | } else { |
841 | ret = -EEXIST; | 885 | ret = -EEXIST; |
842 | } | 886 | } |
843 | 887 | ||
888 | /* | ||
889 | * Act as synchronize_rcu to make sure access to | ||
890 | * old vs->vs_tpg is finished. | ||
891 | */ | ||
892 | vhost_scsi_flush(vs); | ||
893 | kfree(vs->vs_tpg); | ||
894 | vs->vs_tpg = vs_tpg; | ||
895 | |||
844 | mutex_unlock(&vs->dev.mutex); | 896 | mutex_unlock(&vs->dev.mutex); |
845 | return ret; | 897 | return ret; |
846 | } | 898 | } |
@@ -851,6 +903,8 @@ static int vhost_scsi_clear_endpoint( | |||
851 | { | 903 | { |
852 | struct tcm_vhost_tport *tv_tport; | 904 | struct tcm_vhost_tport *tv_tport; |
853 | struct tcm_vhost_tpg *tv_tpg; | 905 | struct tcm_vhost_tpg *tv_tpg; |
906 | struct vhost_virtqueue *vq; | ||
907 | bool match = false; | ||
854 | int index, ret, i; | 908 | int index, ret, i; |
855 | u8 target; | 909 | u8 target; |
856 | 910 | ||
@@ -862,9 +916,14 @@ static int vhost_scsi_clear_endpoint( | |||
862 | goto err_dev; | 916 | goto err_dev; |
863 | } | 917 | } |
864 | } | 918 | } |
919 | |||
920 | if (!vs->vs_tpg) { | ||
921 | mutex_unlock(&vs->dev.mutex); | ||
922 | return 0; | ||
923 | } | ||
924 | |||
865 | for (i = 0; i < VHOST_SCSI_MAX_TARGET; i++) { | 925 | for (i = 0; i < VHOST_SCSI_MAX_TARGET; i++) { |
866 | target = i; | 926 | target = i; |
867 | |||
868 | tv_tpg = vs->vs_tpg[target]; | 927 | tv_tpg = vs->vs_tpg[target]; |
869 | if (!tv_tpg) | 928 | if (!tv_tpg) |
870 | continue; | 929 | continue; |
@@ -886,10 +945,27 @@ static int vhost_scsi_clear_endpoint( | |||
886 | } | 945 | } |
887 | tv_tpg->tv_tpg_vhost_count--; | 946 | tv_tpg->tv_tpg_vhost_count--; |
888 | vs->vs_tpg[target] = NULL; | 947 | vs->vs_tpg[target] = NULL; |
889 | vs->vs_endpoint = false; | 948 | match = true; |
890 | mutex_unlock(&tv_tpg->tv_tpg_mutex); | 949 | mutex_unlock(&tv_tpg->tv_tpg_mutex); |
891 | } | 950 | } |
951 | if (match) { | ||
952 | for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) { | ||
953 | vq = &vs->vqs[i]; | ||
954 | /* Flushing the vhost_work acts as synchronize_rcu */ | ||
955 | mutex_lock(&vq->mutex); | ||
956 | rcu_assign_pointer(vq->private_data, NULL); | ||
957 | mutex_unlock(&vq->mutex); | ||
958 | } | ||
959 | } | ||
960 | /* | ||
961 | * Act as synchronize_rcu to make sure access to | ||
962 | * old vs->vs_tpg is finished. | ||
963 | */ | ||
964 | vhost_scsi_flush(vs); | ||
965 | kfree(vs->vs_tpg); | ||
966 | vs->vs_tpg = NULL; | ||
892 | mutex_unlock(&vs->dev.mutex); | 967 | mutex_unlock(&vs->dev.mutex); |
968 | |||
893 | return 0; | 969 | return 0; |
894 | 970 | ||
895 | err_tpg: | 971 | err_tpg: |
@@ -899,6 +975,24 @@ err_dev: | |||
899 | return ret; | 975 | return ret; |
900 | } | 976 | } |
901 | 977 | ||
978 | static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features) | ||
979 | { | ||
980 | if (features & ~VHOST_SCSI_FEATURES) | ||
981 | return -EOPNOTSUPP; | ||
982 | |||
983 | mutex_lock(&vs->dev.mutex); | ||
984 | if ((features & (1 << VHOST_F_LOG_ALL)) && | ||
985 | !vhost_log_access_ok(&vs->dev)) { | ||
986 | mutex_unlock(&vs->dev.mutex); | ||
987 | return -EFAULT; | ||
988 | } | ||
989 | vs->dev.acked_features = features; | ||
990 | smp_wmb(); | ||
991 | vhost_scsi_flush(vs); | ||
992 | mutex_unlock(&vs->dev.mutex); | ||
993 | return 0; | ||
994 | } | ||
995 | |||
902 | static int vhost_scsi_open(struct inode *inode, struct file *f) | 996 | static int vhost_scsi_open(struct inode *inode, struct file *f) |
903 | { | 997 | { |
904 | struct vhost_scsi *s; | 998 | struct vhost_scsi *s; |
@@ -939,38 +1033,6 @@ static int vhost_scsi_release(struct inode *inode, struct file *f) | |||
939 | return 0; | 1033 | return 0; |
940 | } | 1034 | } |
941 | 1035 | ||
942 | static void vhost_scsi_flush_vq(struct vhost_scsi *vs, int index) | ||
943 | { | ||
944 | vhost_poll_flush(&vs->dev.vqs[index].poll); | ||
945 | } | ||
946 | |||
947 | static void vhost_scsi_flush(struct vhost_scsi *vs) | ||
948 | { | ||
949 | int i; | ||
950 | |||
951 | for (i = 0; i < VHOST_SCSI_MAX_VQ; i++) | ||
952 | vhost_scsi_flush_vq(vs, i); | ||
953 | vhost_work_flush(&vs->dev, &vs->vs_completion_work); | ||
954 | } | ||
955 | |||
956 | static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features) | ||
957 | { | ||
958 | if (features & ~VHOST_SCSI_FEATURES) | ||
959 | return -EOPNOTSUPP; | ||
960 | |||
961 | mutex_lock(&vs->dev.mutex); | ||
962 | if ((features & (1 << VHOST_F_LOG_ALL)) && | ||
963 | !vhost_log_access_ok(&vs->dev)) { | ||
964 | mutex_unlock(&vs->dev.mutex); | ||
965 | return -EFAULT; | ||
966 | } | ||
967 | vs->dev.acked_features = features; | ||
968 | smp_wmb(); | ||
969 | vhost_scsi_flush(vs); | ||
970 | mutex_unlock(&vs->dev.mutex); | ||
971 | return 0; | ||
972 | } | ||
973 | |||
974 | static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl, | 1036 | static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl, |
975 | unsigned long arg) | 1037 | unsigned long arg) |
976 | { | 1038 | { |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 7c254084b6a0..86291dcd964a 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -1373,15 +1373,12 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) | |||
1373 | { | 1373 | { |
1374 | struct fb_info *info = file_fb_info(file); | 1374 | struct fb_info *info = file_fb_info(file); |
1375 | struct fb_ops *fb; | 1375 | struct fb_ops *fb; |
1376 | unsigned long off; | 1376 | unsigned long mmio_pgoff; |
1377 | unsigned long start; | 1377 | unsigned long start; |
1378 | u32 len; | 1378 | u32 len; |
1379 | 1379 | ||
1380 | if (!info) | 1380 | if (!info) |
1381 | return -ENODEV; | 1381 | return -ENODEV; |
1382 | if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) | ||
1383 | return -EINVAL; | ||
1384 | off = vma->vm_pgoff << PAGE_SHIFT; | ||
1385 | fb = info->fbops; | 1382 | fb = info->fbops; |
1386 | if (!fb) | 1383 | if (!fb) |
1387 | return -ENODEV; | 1384 | return -ENODEV; |
@@ -1393,32 +1390,24 @@ fb_mmap(struct file *file, struct vm_area_struct * vma) | |||
1393 | return res; | 1390 | return res; |
1394 | } | 1391 | } |
1395 | 1392 | ||
1396 | /* frame buffer memory */ | 1393 | /* |
1394 | * Ugh. This can be either the frame buffer mapping, or | ||
1395 | * if pgoff points past it, the mmio mapping. | ||
1396 | */ | ||
1397 | start = info->fix.smem_start; | 1397 | start = info->fix.smem_start; |
1398 | len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len); | 1398 | len = info->fix.smem_len; |
1399 | if (off >= len) { | 1399 | mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT; |
1400 | /* memory mapped io */ | 1400 | if (vma->vm_pgoff >= mmio_pgoff) { |
1401 | off -= len; | 1401 | vma->vm_pgoff -= mmio_pgoff; |
1402 | if (info->var.accel_flags) { | ||
1403 | mutex_unlock(&info->mm_lock); | ||
1404 | return -EINVAL; | ||
1405 | } | ||
1406 | start = info->fix.mmio_start; | 1402 | start = info->fix.mmio_start; |
1407 | len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len); | 1403 | len = info->fix.mmio_len; |
1408 | } | 1404 | } |
1409 | mutex_unlock(&info->mm_lock); | 1405 | mutex_unlock(&info->mm_lock); |
1410 | start &= PAGE_MASK; | 1406 | |
1411 | if ((vma->vm_end - vma->vm_start + off) > len) | ||
1412 | return -EINVAL; | ||
1413 | off += start; | ||
1414 | vma->vm_pgoff = off >> PAGE_SHIFT; | ||
1415 | /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by io_remap_pfn_range()*/ | ||
1416 | vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); | 1407 | vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); |
1417 | fb_pgprotect(file, vma, off); | 1408 | fb_pgprotect(file, vma, start); |
1418 | if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, | 1409 | |
1419 | vma->vm_end - vma->vm_start, vma->vm_page_prot)) | 1410 | return vm_iomap_memory(vma, start, len); |
1420 | return -EAGAIN; | ||
1421 | return 0; | ||
1422 | } | 1411 | } |
1423 | 1412 | ||
1424 | static int | 1413 | static int |
diff --git a/drivers/video/mmp/core.c b/drivers/video/mmp/core.c index 9ed83419038b..84de2632857a 100644 --- a/drivers/video/mmp/core.c +++ b/drivers/video/mmp/core.c | |||
@@ -252,7 +252,5 @@ void mmp_unregister_path(struct mmp_path *path) | |||
252 | 252 | ||
253 | kfree(path); | 253 | kfree(path); |
254 | mutex_unlock(&disp_lock); | 254 | mutex_unlock(&disp_lock); |
255 | |||
256 | dev_info(path->dev, "de-register %s\n", path->name); | ||
257 | } | 255 | } |
258 | EXPORT_SYMBOL_GPL(mmp_unregister_path); | 256 | EXPORT_SYMBOL_GPL(mmp_unregister_path); |
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 9fcc70c11cea..e89fc3133972 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -117,7 +117,7 @@ config ARM_SP805_WATCHDOG | |||
117 | 117 | ||
118 | config AT91RM9200_WATCHDOG | 118 | config AT91RM9200_WATCHDOG |
119 | tristate "AT91RM9200 watchdog" | 119 | tristate "AT91RM9200 watchdog" |
120 | depends on ARCH_AT91 | 120 | depends on ARCH_AT91RM9200 |
121 | help | 121 | help |
122 | Watchdog timer embedded into AT91RM9200 chips. This will reboot your | 122 | Watchdog timer embedded into AT91RM9200 chips. This will reboot your |
123 | system when the timeout is reached. | 123 | system when the timeout is reached. |
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index aa85881d17b2..2647ad8e1f19 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -1316,7 +1316,7 @@ static void __xen_evtchn_do_upcall(void) | |||
1316 | { | 1316 | { |
1317 | int start_word_idx, start_bit_idx; | 1317 | int start_word_idx, start_bit_idx; |
1318 | int word_idx, bit_idx; | 1318 | int word_idx, bit_idx; |
1319 | int i; | 1319 | int i, irq; |
1320 | int cpu = get_cpu(); | 1320 | int cpu = get_cpu(); |
1321 | struct shared_info *s = HYPERVISOR_shared_info; | 1321 | struct shared_info *s = HYPERVISOR_shared_info; |
1322 | struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); | 1322 | struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); |
@@ -1324,6 +1324,8 @@ static void __xen_evtchn_do_upcall(void) | |||
1324 | 1324 | ||
1325 | do { | 1325 | do { |
1326 | xen_ulong_t pending_words; | 1326 | xen_ulong_t pending_words; |
1327 | xen_ulong_t pending_bits; | ||
1328 | struct irq_desc *desc; | ||
1327 | 1329 | ||
1328 | vcpu_info->evtchn_upcall_pending = 0; | 1330 | vcpu_info->evtchn_upcall_pending = 0; |
1329 | 1331 | ||
@@ -1335,6 +1337,17 @@ static void __xen_evtchn_do_upcall(void) | |||
1335 | * selector flag. xchg_xen_ulong must contain an | 1337 | * selector flag. xchg_xen_ulong must contain an |
1336 | * appropriate barrier. | 1338 | * appropriate barrier. |
1337 | */ | 1339 | */ |
1340 | if ((irq = per_cpu(virq_to_irq, cpu)[VIRQ_TIMER]) != -1) { | ||
1341 | int evtchn = evtchn_from_irq(irq); | ||
1342 | word_idx = evtchn / BITS_PER_LONG; | ||
1343 | pending_bits = evtchn % BITS_PER_LONG; | ||
1344 | if (active_evtchns(cpu, s, word_idx) & (1ULL << pending_bits)) { | ||
1345 | desc = irq_to_desc(irq); | ||
1346 | if (desc) | ||
1347 | generic_handle_irq_desc(irq, desc); | ||
1348 | } | ||
1349 | } | ||
1350 | |||
1338 | pending_words = xchg_xen_ulong(&vcpu_info->evtchn_pending_sel, 0); | 1351 | pending_words = xchg_xen_ulong(&vcpu_info->evtchn_pending_sel, 0); |
1339 | 1352 | ||
1340 | start_word_idx = __this_cpu_read(current_word_idx); | 1353 | start_word_idx = __this_cpu_read(current_word_idx); |
@@ -1343,7 +1356,6 @@ static void __xen_evtchn_do_upcall(void) | |||
1343 | word_idx = start_word_idx; | 1356 | word_idx = start_word_idx; |
1344 | 1357 | ||
1345 | for (i = 0; pending_words != 0; i++) { | 1358 | for (i = 0; pending_words != 0; i++) { |
1346 | xen_ulong_t pending_bits; | ||
1347 | xen_ulong_t words; | 1359 | xen_ulong_t words; |
1348 | 1360 | ||
1349 | words = MASK_LSBS(pending_words, word_idx); | 1361 | words = MASK_LSBS(pending_words, word_idx); |
@@ -1372,8 +1384,7 @@ static void __xen_evtchn_do_upcall(void) | |||
1372 | 1384 | ||
1373 | do { | 1385 | do { |
1374 | xen_ulong_t bits; | 1386 | xen_ulong_t bits; |
1375 | int port, irq; | 1387 | int port; |
1376 | struct irq_desc *desc; | ||
1377 | 1388 | ||
1378 | bits = MASK_LSBS(pending_bits, bit_idx); | 1389 | bits = MASK_LSBS(pending_bits, bit_idx); |
1379 | 1390 | ||