diff options
Diffstat (limited to 'drivers/scsi')
| -rw-r--r-- | drivers/scsi/aic94xx/aic94xx_init.c | 8 | ||||
| -rw-r--r-- | drivers/scsi/cxlflash/main.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/libfc/fc_rport.c | 1 | ||||
| -rw-r--r-- | drivers/scsi/libiscsi.c | 6 | ||||
| -rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 4 | ||||
| -rw-r--r-- | drivers/scsi/scsi_lib.c | 1 | ||||
| -rw-r--r-- | drivers/scsi/sd.c | 12 | ||||
| -rw-r--r-- | drivers/scsi/sd_zbc.c | 20 |
9 files changed, 39 insertions, 17 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c index f83f79b07b50..07efcb9b5b94 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c | |||
| @@ -280,7 +280,7 @@ static ssize_t asd_show_dev_rev(struct device *dev, | |||
| 280 | return snprintf(buf, PAGE_SIZE, "%s\n", | 280 | return snprintf(buf, PAGE_SIZE, "%s\n", |
| 281 | asd_dev_rev[asd_ha->revision_id]); | 281 | asd_dev_rev[asd_ha->revision_id]); |
| 282 | } | 282 | } |
| 283 | static DEVICE_ATTR(revision, S_IRUGO, asd_show_dev_rev, NULL); | 283 | static DEVICE_ATTR(aic_revision, S_IRUGO, asd_show_dev_rev, NULL); |
| 284 | 284 | ||
| 285 | static ssize_t asd_show_dev_bios_build(struct device *dev, | 285 | static ssize_t asd_show_dev_bios_build(struct device *dev, |
| 286 | struct device_attribute *attr,char *buf) | 286 | struct device_attribute *attr,char *buf) |
| @@ -477,7 +477,7 @@ static int asd_create_dev_attrs(struct asd_ha_struct *asd_ha) | |||
| 477 | { | 477 | { |
| 478 | int err; | 478 | int err; |
| 479 | 479 | ||
| 480 | err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_revision); | 480 | err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_aic_revision); |
| 481 | if (err) | 481 | if (err) |
| 482 | return err; | 482 | return err; |
| 483 | 483 | ||
| @@ -499,13 +499,13 @@ err_update_bios: | |||
| 499 | err_biosb: | 499 | err_biosb: |
| 500 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_bios_build); | 500 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_bios_build); |
| 501 | err_rev: | 501 | err_rev: |
| 502 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_revision); | 502 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_aic_revision); |
| 503 | return err; | 503 | return err; |
| 504 | } | 504 | } |
| 505 | 505 | ||
| 506 | static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha) | 506 | static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha) |
| 507 | { | 507 | { |
| 508 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_revision); | 508 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_aic_revision); |
| 509 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_bios_build); | 509 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_bios_build); |
| 510 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_pcba_sn); | 510 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_pcba_sn); |
| 511 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_update_bios); | 511 | device_remove_file(&asd_ha->pcidev->dev, &dev_attr_update_bios); |
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index bfa13e3b191c..c8bad2c093b8 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c | |||
| @@ -3687,6 +3687,7 @@ static int cxlflash_probe(struct pci_dev *pdev, | |||
| 3687 | host->max_cmd_len = CXLFLASH_MAX_CDB_LEN; | 3687 | host->max_cmd_len = CXLFLASH_MAX_CDB_LEN; |
| 3688 | 3688 | ||
| 3689 | cfg = shost_priv(host); | 3689 | cfg = shost_priv(host); |
| 3690 | cfg->state = STATE_PROBING; | ||
| 3690 | cfg->host = host; | 3691 | cfg->host = host; |
| 3691 | rc = alloc_mem(cfg); | 3692 | rc = alloc_mem(cfg); |
| 3692 | if (rc) { | 3693 | if (rc) { |
| @@ -3775,6 +3776,7 @@ out: | |||
| 3775 | return rc; | 3776 | return rc; |
| 3776 | 3777 | ||
| 3777 | out_remove: | 3778 | out_remove: |
| 3779 | cfg->state = STATE_PROBED; | ||
| 3778 | cxlflash_remove(pdev); | 3780 | cxlflash_remove(pdev); |
| 3779 | goto out; | 3781 | goto out; |
| 3780 | } | 3782 | } |
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index 9192a1d9dec6..dfba4921b265 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c | |||
| @@ -184,7 +184,6 @@ void fc_rport_destroy(struct kref *kref) | |||
| 184 | struct fc_rport_priv *rdata; | 184 | struct fc_rport_priv *rdata; |
| 185 | 185 | ||
| 186 | rdata = container_of(kref, struct fc_rport_priv, kref); | 186 | rdata = container_of(kref, struct fc_rport_priv, kref); |
| 187 | WARN_ON(!list_empty(&rdata->peers)); | ||
| 188 | kfree_rcu(rdata, rcu); | 187 | kfree_rcu(rdata, rcu); |
| 189 | } | 188 | } |
| 190 | EXPORT_SYMBOL(fc_rport_destroy); | 189 | EXPORT_SYMBOL(fc_rport_destroy); |
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index b8d325ce8754..120fc520f27a 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
| @@ -1459,7 +1459,13 @@ static int iscsi_xmit_task(struct iscsi_conn *conn) | |||
| 1459 | if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) | 1459 | if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) |
| 1460 | return -ENODATA; | 1460 | return -ENODATA; |
| 1461 | 1461 | ||
| 1462 | spin_lock_bh(&conn->session->back_lock); | ||
| 1463 | if (conn->task == NULL) { | ||
| 1464 | spin_unlock_bh(&conn->session->back_lock); | ||
| 1465 | return -ENODATA; | ||
| 1466 | } | ||
| 1462 | __iscsi_get_task(task); | 1467 | __iscsi_get_task(task); |
| 1468 | spin_unlock_bh(&conn->session->back_lock); | ||
| 1463 | spin_unlock_bh(&conn->session->frwd_lock); | 1469 | spin_unlock_bh(&conn->session->frwd_lock); |
| 1464 | rc = conn->session->tt->xmit_task(task); | 1470 | rc = conn->session->tt->xmit_task(task); |
| 1465 | spin_lock_bh(&conn->session->frwd_lock); | 1471 | spin_lock_bh(&conn->session->frwd_lock); |
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 17eb4185f29d..f21c93bbb35c 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
| @@ -828,6 +828,7 @@ static struct domain_device *sas_ex_discover_end_dev( | |||
| 828 | rphy = sas_end_device_alloc(phy->port); | 828 | rphy = sas_end_device_alloc(phy->port); |
| 829 | if (!rphy) | 829 | if (!rphy) |
| 830 | goto out_free; | 830 | goto out_free; |
| 831 | rphy->identify.phy_identifier = phy_id; | ||
| 831 | 832 | ||
| 832 | child->rphy = rphy; | 833 | child->rphy = rphy; |
| 833 | get_device(&rphy->dev); | 834 | get_device(&rphy->dev); |
| @@ -854,6 +855,7 @@ static struct domain_device *sas_ex_discover_end_dev( | |||
| 854 | 855 | ||
| 855 | child->rphy = rphy; | 856 | child->rphy = rphy; |
| 856 | get_device(&rphy->dev); | 857 | get_device(&rphy->dev); |
| 858 | rphy->identify.phy_identifier = phy_id; | ||
| 857 | sas_fill_in_rphy(child, rphy); | 859 | sas_fill_in_rphy(child, rphy); |
| 858 | 860 | ||
| 859 | list_add_tail(&child->disco_list_node, &parent->port->disco_list); | 861 | list_add_tail(&child->disco_list_node, &parent->port->disco_list); |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index aeeb0144bd55..8d1acc802a67 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
| @@ -1785,13 +1785,13 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun, | |||
| 1785 | 1785 | ||
| 1786 | /* Issue Marker IOCB */ | 1786 | /* Issue Marker IOCB */ |
| 1787 | qla2x00_marker(vha, vha->hw->req_q_map[0], | 1787 | qla2x00_marker(vha, vha->hw->req_q_map[0], |
| 1788 | vha->hw->rsp_q_map[0], sp->fcport->loop_id, lun, | 1788 | vha->hw->rsp_q_map[0], fcport->loop_id, lun, |
| 1789 | flags == TCF_LUN_RESET ? MK_SYNC_ID_LUN : MK_SYNC_ID); | 1789 | flags == TCF_LUN_RESET ? MK_SYNC_ID_LUN : MK_SYNC_ID); |
| 1790 | } | 1790 | } |
| 1791 | 1791 | ||
| 1792 | done_free_sp: | 1792 | done_free_sp: |
| 1793 | sp->free(sp); | 1793 | sp->free(sp); |
| 1794 | sp->fcport->flags &= ~FCF_ASYNC_SENT; | 1794 | fcport->flags &= ~FCF_ASYNC_SENT; |
| 1795 | done: | 1795 | done: |
| 1796 | return rval; | 1796 | return rval; |
| 1797 | } | 1797 | } |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 6d65ac584eba..f8d51c3d5582 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
| @@ -655,6 +655,7 @@ static blk_status_t scsi_result_to_blk_status(struct scsi_cmnd *cmd, int result) | |||
| 655 | set_host_byte(cmd, DID_OK); | 655 | set_host_byte(cmd, DID_OK); |
| 656 | return BLK_STS_TARGET; | 656 | return BLK_STS_TARGET; |
| 657 | case DID_NEXUS_FAILURE: | 657 | case DID_NEXUS_FAILURE: |
| 658 | set_host_byte(cmd, DID_OK); | ||
| 658 | return BLK_STS_NEXUS; | 659 | return BLK_STS_NEXUS; |
| 659 | case DID_ALLOC_FAILURE: | 660 | case DID_ALLOC_FAILURE: |
| 660 | set_host_byte(cmd, DID_OK); | 661 | set_host_byte(cmd, DID_OK); |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index b2da8a00ec33..5464d467e23e 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
| @@ -2951,9 +2951,6 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) | |||
| 2951 | if (rot == 1) { | 2951 | if (rot == 1) { |
| 2952 | blk_queue_flag_set(QUEUE_FLAG_NONROT, q); | 2952 | blk_queue_flag_set(QUEUE_FLAG_NONROT, q); |
| 2953 | blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q); | 2953 | blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q); |
| 2954 | } else { | ||
| 2955 | blk_queue_flag_clear(QUEUE_FLAG_NONROT, q); | ||
| 2956 | blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q); | ||
| 2957 | } | 2954 | } |
| 2958 | 2955 | ||
| 2959 | if (sdkp->device->type == TYPE_ZBC) { | 2956 | if (sdkp->device->type == TYPE_ZBC) { |
| @@ -3090,6 +3087,15 @@ static int sd_revalidate_disk(struct gendisk *disk) | |||
| 3090 | if (sdkp->media_present) { | 3087 | if (sdkp->media_present) { |
| 3091 | sd_read_capacity(sdkp, buffer); | 3088 | sd_read_capacity(sdkp, buffer); |
| 3092 | 3089 | ||
| 3090 | /* | ||
| 3091 | * set the default to rotational. All non-rotational devices | ||
| 3092 | * support the block characteristics VPD page, which will | ||
| 3093 | * cause this to be updated correctly and any device which | ||
| 3094 | * doesn't support it should be treated as rotational. | ||
| 3095 | */ | ||
| 3096 | blk_queue_flag_clear(QUEUE_FLAG_NONROT, q); | ||
| 3097 | blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q); | ||
| 3098 | |||
| 3093 | if (scsi_device_supports_vpd(sdp)) { | 3099 | if (scsi_device_supports_vpd(sdp)) { |
| 3094 | sd_read_block_provisioning(sdkp); | 3100 | sd_read_block_provisioning(sdkp); |
| 3095 | sd_read_block_limits(sdkp); | 3101 | sd_read_block_limits(sdkp); |
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 83365b29a4d8..a340af797a85 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c | |||
| @@ -142,10 +142,12 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector, | |||
| 142 | return -EOPNOTSUPP; | 142 | return -EOPNOTSUPP; |
| 143 | 143 | ||
| 144 | /* | 144 | /* |
| 145 | * Get a reply buffer for the number of requested zones plus a header. | 145 | * Get a reply buffer for the number of requested zones plus a header, |
| 146 | * For ATA, buffers must be aligned to 512B. | 146 | * without exceeding the device maximum command size. For ATA disks, |
| 147 | * buffers must be aligned to 512B. | ||
| 147 | */ | 148 | */ |
| 148 | buflen = roundup((nrz + 1) * 64, 512); | 149 | buflen = min(queue_max_hw_sectors(disk->queue) << 9, |
| 150 | roundup((nrz + 1) * 64, 512)); | ||
| 149 | buf = kmalloc(buflen, gfp_mask); | 151 | buf = kmalloc(buflen, gfp_mask); |
| 150 | if (!buf) | 152 | if (!buf) |
| 151 | return -ENOMEM; | 153 | return -ENOMEM; |
| @@ -462,12 +464,16 @@ int sd_zbc_read_zones(struct scsi_disk *sdkp, unsigned char *buf) | |||
| 462 | sdkp->device->use_10_for_rw = 0; | 464 | sdkp->device->use_10_for_rw = 0; |
| 463 | 465 | ||
| 464 | /* | 466 | /* |
| 465 | * If something changed, revalidate the disk zone bitmaps once we have | 467 | * Revalidate the disk zone bitmaps once the block device capacity is |
| 466 | * the capacity, that is on the second revalidate execution during disk | 468 | * set on the second revalidate execution during disk scan and if |
| 467 | * scan and always during normal revalidate. | 469 | * something changed when executing a normal revalidate. |
| 468 | */ | 470 | */ |
| 469 | if (sdkp->first_scan) | 471 | if (sdkp->first_scan) { |
| 472 | sdkp->zone_blocks = zone_blocks; | ||
| 473 | sdkp->nr_zones = nr_zones; | ||
| 470 | return 0; | 474 | return 0; |
| 475 | } | ||
| 476 | |||
| 471 | if (sdkp->zone_blocks != zone_blocks || | 477 | if (sdkp->zone_blocks != zone_blocks || |
| 472 | sdkp->nr_zones != nr_zones || | 478 | sdkp->nr_zones != nr_zones || |
| 473 | disk->queue->nr_zones != nr_zones) { | 479 | disk->queue->nr_zones != nr_zones) { |
