Skip to content

Commit

Permalink
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "Three small fixes, all in drivers.

  The sas one is in an unlikely error leg, the debug one is to make it
  more standards conformant and the ibmvfc one is to fix a user visible
  bug where a failover could lose all paths to the device"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: scsi_debug: Make the READ CAPACITY response compliant with ZBC
  scsi: scsi_transport_sas: Fix error handling in sas_phy_add()
  scsi: ibmvfc: Avoid path failures during live migration
  • Loading branch information
Linus Torvalds committed Nov 12, 2022
2 parents f95077a + ecb8c25 commit fef7fd4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
14 changes: 11 additions & 3 deletions drivers/scsi/ibmvscsi/ibmvfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,13 @@ static void ibmvfc_init_host(struct ibmvfc_host *vhost)
memset(vhost->async_crq.msgs.async, 0, PAGE_SIZE);
vhost->async_crq.cur = 0;

list_for_each_entry(tgt, &vhost->targets, queue)
ibmvfc_del_tgt(tgt);
list_for_each_entry(tgt, &vhost->targets, queue) {
if (vhost->client_migrated)
tgt->need_login = 1;
else
ibmvfc_del_tgt(tgt);
}

scsi_block_requests(vhost->host);
ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_INIT);
vhost->job_step = ibmvfc_npiv_login;
Expand Down Expand Up @@ -3235,9 +3240,12 @@ static void ibmvfc_handle_crq(struct ibmvfc_crq *crq, struct ibmvfc_host *vhost,
/* We need to re-setup the interpartition connection */
dev_info(vhost->dev, "Partition migrated, Re-enabling adapter\n");
vhost->client_migrated = 1;

scsi_block_requests(vhost->host);
ibmvfc_purge_requests(vhost, DID_REQUEUE);
ibmvfc_link_down(vhost, IBMVFC_LINK_DOWN);
ibmvfc_set_host_state(vhost, IBMVFC_LINK_DOWN);
ibmvfc_set_host_action(vhost, IBMVFC_HOST_ACTION_REENABLE);
wake_up(&vhost->work_wait_q);
} else if (crq->format == IBMVFC_PARTNER_FAILED || crq->format == IBMVFC_PARTNER_DEREGISTER) {
dev_err(vhost->dev, "Host partner adapter deregistered or failed (rc=%d)\n", crq->format);
ibmvfc_purge_requests(vhost, DID_ERROR);
Expand Down
7 changes: 7 additions & 0 deletions drivers/scsi/scsi_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1899,6 +1899,13 @@ static int resp_readcap16(struct scsi_cmnd *scp,
arr[14] |= 0x40;
}

/*
* Since the scsi_debug READ CAPACITY implementation always reports the
* total disk capacity, set RC BASIS = 1 for host-managed ZBC devices.
*/
if (devip->zmodel == BLK_ZONED_HM)
arr[12] |= 1 << 4;

arr[15] = sdebug_lowest_aligned & 0xff;

if (have_dif_prot) {
Expand Down
13 changes: 9 additions & 4 deletions drivers/scsi/scsi_transport_sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,12 +722,17 @@ int sas_phy_add(struct sas_phy *phy)
int error;

error = device_add(&phy->dev);
if (!error) {
transport_add_device(&phy->dev);
transport_configure_device(&phy->dev);
if (error)
return error;

error = transport_add_device(&phy->dev);
if (error) {
device_del(&phy->dev);
return error;
}
transport_configure_device(&phy->dev);

return error;
return 0;
}
EXPORT_SYMBOL(sas_phy_add);

Expand Down

0 comments on commit fef7fd4

Please sign in to comment.