Skip to content

Commit 4f6cee6

Browse files
Merge branch '6.6/scsi-staging' into 6.6/scsi-fixes
Pull in staged fixes for 6.6. Signed-off-by: Martin K. Petersen <[email protected]>
2 parents 0bb80ec + d32533d commit 4f6cee6

File tree

14 files changed

+63
-55
lines changed

14 files changed

+63
-55
lines changed

drivers/scsi/megaraid/megaraid_sas.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2332,7 +2332,7 @@ struct megasas_instance {
23322332
u32 support_morethan256jbod; /* FW support for more than 256 PD/JBOD */
23332333
bool use_seqnum_jbod_fp; /* Added for PD sequence */
23342334
bool smp_affinity_enable;
2335-
spinlock_t crashdump_lock;
2335+
struct mutex crashdump_lock;
23362336

23372337
struct megasas_register_set __iomem *reg_set;
23382338
u32 __iomem *reply_post_host_index_addr[MR_MAX_MSIX_REG_ARRAY];

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3271,14 +3271,13 @@ fw_crash_buffer_store(struct device *cdev,
32713271
struct megasas_instance *instance =
32723272
(struct megasas_instance *) shost->hostdata;
32733273
int val = 0;
3274-
unsigned long flags;
32753274

32763275
if (kstrtoint(buf, 0, &val) != 0)
32773276
return -EINVAL;
32783277

3279-
spin_lock_irqsave(&instance->crashdump_lock, flags);
3278+
mutex_lock(&instance->crashdump_lock);
32803279
instance->fw_crash_buffer_offset = val;
3281-
spin_unlock_irqrestore(&instance->crashdump_lock, flags);
3280+
mutex_unlock(&instance->crashdump_lock);
32823281
return strlen(buf);
32833282
}
32843283

@@ -3293,24 +3292,23 @@ fw_crash_buffer_show(struct device *cdev,
32933292
unsigned long dmachunk = CRASH_DMA_BUF_SIZE;
32943293
unsigned long chunk_left_bytes;
32953294
unsigned long src_addr;
3296-
unsigned long flags;
32973295
u32 buff_offset;
32983296

3299-
spin_lock_irqsave(&instance->crashdump_lock, flags);
3297+
mutex_lock(&instance->crashdump_lock);
33003298
buff_offset = instance->fw_crash_buffer_offset;
33013299
if (!instance->crash_dump_buf ||
33023300
!((instance->fw_crash_state == AVAILABLE) ||
33033301
(instance->fw_crash_state == COPYING))) {
33043302
dev_err(&instance->pdev->dev,
33053303
"Firmware crash dump is not available\n");
3306-
spin_unlock_irqrestore(&instance->crashdump_lock, flags);
3304+
mutex_unlock(&instance->crashdump_lock);
33073305
return -EINVAL;
33083306
}
33093307

33103308
if (buff_offset > (instance->fw_crash_buffer_size * dmachunk)) {
33113309
dev_err(&instance->pdev->dev,
33123310
"Firmware crash dump offset is out of range\n");
3313-
spin_unlock_irqrestore(&instance->crashdump_lock, flags);
3311+
mutex_unlock(&instance->crashdump_lock);
33143312
return 0;
33153313
}
33163314

@@ -3322,7 +3320,7 @@ fw_crash_buffer_show(struct device *cdev,
33223320
src_addr = (unsigned long)instance->crash_buf[buff_offset / dmachunk] +
33233321
(buff_offset % dmachunk);
33243322
memcpy(buf, (void *)src_addr, size);
3325-
spin_unlock_irqrestore(&instance->crashdump_lock, flags);
3323+
mutex_unlock(&instance->crashdump_lock);
33263324

33273325
return size;
33283326
}
@@ -3347,7 +3345,6 @@ fw_crash_state_store(struct device *cdev,
33473345
struct megasas_instance *instance =
33483346
(struct megasas_instance *) shost->hostdata;
33493347
int val = 0;
3350-
unsigned long flags;
33513348

33523349
if (kstrtoint(buf, 0, &val) != 0)
33533350
return -EINVAL;
@@ -3361,9 +3358,9 @@ fw_crash_state_store(struct device *cdev,
33613358
instance->fw_crash_state = val;
33623359

33633360
if ((val == COPIED) || (val == COPY_ERROR)) {
3364-
spin_lock_irqsave(&instance->crashdump_lock, flags);
3361+
mutex_lock(&instance->crashdump_lock);
33653362
megasas_free_host_crash_buffer(instance);
3366-
spin_unlock_irqrestore(&instance->crashdump_lock, flags);
3363+
mutex_unlock(&instance->crashdump_lock);
33673364
if (val == COPY_ERROR)
33683365
dev_info(&instance->pdev->dev, "application failed to "
33693366
"copy Firmware crash dump\n");
@@ -7422,7 +7419,7 @@ static inline void megasas_init_ctrl_params(struct megasas_instance *instance)
74227419
init_waitqueue_head(&instance->int_cmd_wait_q);
74237420
init_waitqueue_head(&instance->abort_cmd_wait_q);
74247421

7425-
spin_lock_init(&instance->crashdump_lock);
7422+
mutex_init(&instance->crashdump_lock);
74267423
spin_lock_init(&instance->mfi_pool_lock);
74277424
spin_lock_init(&instance->hba_lock);
74287425
spin_lock_init(&instance->stream_lock);

drivers/scsi/ppa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ static int ppa_out(ppa_struct *dev, char *buffer, int len)
307307
case PPA_EPP_8:
308308
epp_reset(ppb);
309309
w_ctr(ppb, 0x4);
310-
if (dev->mode == PPA_EPP_32 && !(((long) buffer | len) & 0x01))
310+
if (dev->mode == PPA_EPP_32 && !(((long) buffer | len) & 0x03))
311311
outsl(ppb + 4, buffer, len >> 2);
312-
else if (dev->mode == PPA_EPP_16 && !(((long) buffer | len) & 0x03))
312+
else if (dev->mode == PPA_EPP_16 && !(((long) buffer | len) & 0x01))
313313
outsw(ppb + 4, buffer, len >> 1);
314314
else
315315
outsb(ppb + 4, buffer, len);

drivers/scsi/qedf/qedf_io.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,24 +1904,28 @@ int qedf_initiate_abts(struct qedf_ioreq *io_req, bool return_scsi_cmd_on_abts)
19041904
goto drop_rdata_kref;
19051905
}
19061906

1907+
spin_lock_irqsave(&fcport->rport_lock, flags);
19071908
if (!test_bit(QEDF_CMD_OUTSTANDING, &io_req->flags) ||
19081909
test_bit(QEDF_CMD_IN_CLEANUP, &io_req->flags) ||
19091910
test_bit(QEDF_CMD_IN_ABORT, &io_req->flags)) {
19101911
QEDF_ERR(&qedf->dbg_ctx,
19111912
"io_req xid=0x%x sc_cmd=%p already in cleanup or abort processing or already completed.\n",
19121913
io_req->xid, io_req->sc_cmd);
19131914
rc = 1;
1915+
spin_unlock_irqrestore(&fcport->rport_lock, flags);
19141916
goto drop_rdata_kref;
19151917
}
19161918

1919+
/* Set the command type to abort */
1920+
io_req->cmd_type = QEDF_ABTS;
1921+
spin_unlock_irqrestore(&fcport->rport_lock, flags);
1922+
19171923
kref_get(&io_req->refcount);
19181924

19191925
xid = io_req->xid;
19201926
qedf->control_requests++;
19211927
qedf->packet_aborts++;
19221928

1923-
/* Set the command type to abort */
1924-
io_req->cmd_type = QEDF_ABTS;
19251929
io_req->return_scsi_cmd_on_abts = return_scsi_cmd_on_abts;
19261930

19271931
set_bit(QEDF_CMD_IN_ABORT, &io_req->flags);
@@ -2210,7 +2214,9 @@ int qedf_initiate_cleanup(struct qedf_ioreq *io_req,
22102214
refcount, fcport, fcport->rdata->ids.port_id);
22112215

22122216
/* Cleanup cmds re-use the same TID as the original I/O */
2217+
spin_lock_irqsave(&fcport->rport_lock, flags);
22132218
io_req->cmd_type = QEDF_CLEANUP;
2219+
spin_unlock_irqrestore(&fcport->rport_lock, flags);
22142220
io_req->return_scsi_cmd_on_abts = return_scsi_cmd_on_abts;
22152221

22162222
init_completion(&io_req->cleanup_done);

drivers/scsi/qedf/qedf_main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2805,6 +2805,8 @@ void qedf_process_cqe(struct qedf_ctx *qedf, struct fcoe_cqe *cqe)
28052805
struct qedf_ioreq *io_req;
28062806
struct qedf_rport *fcport;
28072807
u32 comp_type;
2808+
u8 io_comp_type;
2809+
unsigned long flags;
28082810

28092811
comp_type = (cqe->cqe_data >> FCOE_CQE_CQE_TYPE_SHIFT) &
28102812
FCOE_CQE_CQE_TYPE_MASK;
@@ -2838,11 +2840,14 @@ void qedf_process_cqe(struct qedf_ctx *qedf, struct fcoe_cqe *cqe)
28382840
return;
28392841
}
28402842

2843+
spin_lock_irqsave(&fcport->rport_lock, flags);
2844+
io_comp_type = io_req->cmd_type;
2845+
spin_unlock_irqrestore(&fcport->rport_lock, flags);
28412846

28422847
switch (comp_type) {
28432848
case FCOE_GOOD_COMPLETION_CQE_TYPE:
28442849
atomic_inc(&fcport->free_sqes);
2845-
switch (io_req->cmd_type) {
2850+
switch (io_comp_type) {
28462851
case QEDF_SCSI_CMD:
28472852
qedf_scsi_completion(qedf, cqe, io_req);
28482853
break;

drivers/scsi/qla2xxx/qla_dfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ qla2x00_dfs_create_rport(scsi_qla_host_t *vha, struct fc_port *fp)
116116

117117
sprintf(wwn, "pn-%016llx", wwn_to_u64(fp->port_name));
118118
fp->dfs_rport_dir = debugfs_create_dir(wwn, vha->dfs_rport_root);
119-
if (!fp->dfs_rport_dir)
119+
if (IS_ERR(fp->dfs_rport_dir))
120120
return;
121121
if (NVME_TARGET(vha->hw, fp))
122122
debugfs_create_file("dev_loss_tmo", 0600, fp->dfs_rport_dir,
@@ -708,14 +708,14 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha)
708708
if (IS_QLA27XX(ha) || IS_QLA83XX(ha) || IS_QLA28XX(ha)) {
709709
ha->tgt.dfs_naqp = debugfs_create_file("naqp",
710710
0400, ha->dfs_dir, vha, &dfs_naqp_ops);
711-
if (!ha->tgt.dfs_naqp) {
711+
if (IS_ERR(ha->tgt.dfs_naqp)) {
712712
ql_log(ql_log_warn, vha, 0xd011,
713713
"Unable to create debugFS naqp node.\n");
714714
goto out;
715715
}
716716
}
717717
vha->dfs_rport_root = debugfs_create_dir("rports", ha->dfs_dir);
718-
if (!vha->dfs_rport_root) {
718+
if (IS_ERR(vha->dfs_rport_root)) {
719719
ql_log(ql_log_warn, vha, 0xd012,
720720
"Unable to create debugFS rports node.\n");
721721
goto out;

drivers/scsi/qla2xxx/qla_inline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ fcport_is_bigger(fc_port_t *fcport)
577577
static inline struct qla_qpair *
578578
qla_mapq_nvme_select_qpair(struct qla_hw_data *ha, struct qla_qpair *qpair)
579579
{
580-
int cpuid = smp_processor_id();
580+
int cpuid = raw_smp_processor_id();
581581

582582
if (qpair->cpuid != cpuid &&
583583
ha->qp_cpu_map[cpuid]) {

drivers/scsi/qla2xxx/qla_isr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3965,7 +3965,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
39653965
if (!ha->flags.fw_started)
39663966
return;
39673967

3968-
if (rsp->qpair->cpuid != smp_processor_id() || !rsp->qpair->rcv_intr) {
3968+
if (rsp->qpair->cpuid != raw_smp_processor_id() || !rsp->qpair->rcv_intr) {
39693969
rsp->qpair->rcv_intr = 1;
39703970

39713971
if (!rsp->qpair->cpu_mapped)
@@ -4468,7 +4468,7 @@ qla2xxx_msix_rsp_q(int irq, void *dev_id)
44684468
}
44694469
ha = qpair->hw;
44704470

4471-
queue_work_on(smp_processor_id(), ha->wq, &qpair->q_work);
4471+
queue_work(ha->wq, &qpair->q_work);
44724472

44734473
return IRQ_HANDLED;
44744474
}
@@ -4494,7 +4494,7 @@ qla2xxx_msix_rsp_q_hs(int irq, void *dev_id)
44944494
wrt_reg_dword(&reg->hccr, HCCRX_CLR_RISC_INT);
44954495
spin_unlock_irqrestore(&ha->hardware_lock, flags);
44964496

4497-
queue_work_on(smp_processor_id(), ha->wq, &qpair->q_work);
4497+
queue_work(ha->wq, &qpair->q_work);
44984498

44994499
return IRQ_HANDLED;
45004500
}

drivers/scsi/qla2xxx/qla_nvme.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,14 +399,14 @@ static int qla_nvme_xmt_ls_rsp(struct nvme_fc_local_port *lport,
399399
nvme->u.nvme.dl = 0;
400400
nvme->u.nvme.timeout_sec = 0;
401401
nvme->u.nvme.cmd_dma = fd_resp->rspdma;
402-
nvme->u.nvme.cmd_len = fd_resp->rsplen;
402+
nvme->u.nvme.cmd_len = cpu_to_le32(fd_resp->rsplen);
403403
nvme->u.nvme.rsp_len = 0;
404404
nvme->u.nvme.rsp_dma = 0;
405405
nvme->u.nvme.exchange_address = uctx->exchange_address;
406406
nvme->u.nvme.nport_handle = uctx->nport_handle;
407407
nvme->u.nvme.ox_id = uctx->ox_id;
408408
dma_sync_single_for_device(&ha->pdev->dev, nvme->u.nvme.cmd_dma,
409-
le32_to_cpu(fd_resp->rsplen), DMA_TO_DEVICE);
409+
fd_resp->rsplen, DMA_TO_DEVICE);
410410

411411
ql_dbg(ql_dbg_unsol, vha, 0x2122,
412412
"Unsol lsreq portid=%06x %8phC exchange_address 0x%x ox_id 0x%x hdl 0x%x\n",
@@ -504,13 +504,13 @@ static int qla_nvme_ls_req(struct nvme_fc_local_port *lport,
504504
nvme->u.nvme.desc = fd;
505505
nvme->u.nvme.dir = 0;
506506
nvme->u.nvme.dl = 0;
507-
nvme->u.nvme.cmd_len = fd->rqstlen;
508-
nvme->u.nvme.rsp_len = fd->rsplen;
507+
nvme->u.nvme.cmd_len = cpu_to_le32(fd->rqstlen);
508+
nvme->u.nvme.rsp_len = cpu_to_le32(fd->rsplen);
509509
nvme->u.nvme.rsp_dma = fd->rspdma;
510510
nvme->u.nvme.timeout_sec = fd->timeout;
511511
nvme->u.nvme.cmd_dma = fd->rqstdma;
512512
dma_sync_single_for_device(&ha->pdev->dev, nvme->u.nvme.cmd_dma,
513-
le32_to_cpu(fd->rqstlen), DMA_TO_DEVICE);
513+
fd->rqstlen, DMA_TO_DEVICE);
514514

515515
rval = qla2x00_start_sp(sp);
516516
if (rval != QLA_SUCCESS) {

drivers/scsi/qla2xxx/qla_target.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4425,8 +4425,7 @@ static int qlt_handle_cmd_for_atio(struct scsi_qla_host *vha,
44254425
queue_work_on(cmd->se_cmd.cpuid, qla_tgt_wq, &cmd->work);
44264426
} else if (ha->msix_count) {
44274427
if (cmd->atio.u.isp24.fcp_cmnd.rddata)
4428-
queue_work_on(smp_processor_id(), qla_tgt_wq,
4429-
&cmd->work);
4428+
queue_work(qla_tgt_wq, &cmd->work);
44304429
else
44314430
queue_work_on(cmd->se_cmd.cpuid, qla_tgt_wq,
44324431
&cmd->work);

0 commit comments

Comments
 (0)