Skip to content

Commit 7234e2e

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Four small fixes, three in drivers and one in the FC transport class to add idempotence to state setting" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: scsi_transport_fc: Allow setting rport state to current state scsi: wd33c93: Don't use stale scsi_pointer value scsi: fnic: Move flush_work initialization out of if block scsi: ufs: Use pre-calculated offsets in ufshcd_init_lrb()
2 parents 05749ec + d539a87 commit 7234e2e

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

drivers/scsi/fnic/fnic_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
830830
spin_lock_init(&fnic->vlans_lock);
831831
INIT_WORK(&fnic->fip_frame_work, fnic_handle_fip_frame);
832832
INIT_WORK(&fnic->event_work, fnic_handle_event);
833-
INIT_WORK(&fnic->flush_work, fnic_flush_tx);
834833
skb_queue_head_init(&fnic->fip_frame_queue);
835834
INIT_LIST_HEAD(&fnic->evlist);
836835
INIT_LIST_HEAD(&fnic->vlans);
@@ -948,6 +947,7 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
948947

949948
INIT_WORK(&fnic->link_work, fnic_handle_link);
950949
INIT_WORK(&fnic->frame_work, fnic_handle_frame);
950+
INIT_WORK(&fnic->flush_work, fnic_flush_tx);
951951
skb_queue_head_init(&fnic->frame_queue);
952952
skb_queue_head_init(&fnic->tx_queue);
953953

drivers/scsi/scsi_transport_fc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev,
12501250
*/
12511251
if (rport->port_state == FC_PORTSTATE_ONLINE)
12521252
rport->port_state = port_state;
1253-
else
1253+
else if (port_state != rport->port_state)
12541254
return -EINVAL;
12551255
} else if (port_state == FC_PORTSTATE_ONLINE) {
12561256
/*
@@ -1260,7 +1260,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev,
12601260
*/
12611261
if (rport->port_state == FC_PORTSTATE_MARGINAL)
12621262
rport->port_state = port_state;
1263-
else
1263+
else if (port_state != rport->port_state)
12641264
return -EINVAL;
12651265
} else
12661266
return -EINVAL;

drivers/scsi/wd33c93.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ wd33c93_intr(struct Scsi_Host *instance)
831831
/* construct an IDENTIFY message with correct disconnect bit */
832832

833833
hostdata->outgoing_msg[0] = IDENTIFY(0, cmd->device->lun);
834-
if (scsi_pointer->phase)
834+
if (WD33C93_scsi_pointer(cmd)->phase)
835835
hostdata->outgoing_msg[0] |= 0x40;
836836

837837
if (hostdata->sync_stat[cmd->device->id] == SS_FIRST) {

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,9 +2933,8 @@ static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i)
29332933
struct utp_transfer_req_desc *utrdlp = hba->utrdl_base_addr;
29342934
dma_addr_t cmd_desc_element_addr = hba->ucdl_dma_addr +
29352935
i * ufshcd_get_ucd_size(hba);
2936-
u16 response_offset = offsetof(struct utp_transfer_cmd_desc,
2937-
response_upiu);
2938-
u16 prdt_offset = offsetof(struct utp_transfer_cmd_desc, prd_table);
2936+
u16 response_offset = le16_to_cpu(utrdlp[i].response_upiu_offset);
2937+
u16 prdt_offset = le16_to_cpu(utrdlp[i].prd_table_offset);
29392938

29402939
lrb->utr_descriptor_ptr = utrdlp + i;
29412940
lrb->utrd_dma_addr = hba->utrdl_dma_addr +

0 commit comments

Comments
 (0)