Skip to content

Commit

Permalink
qla2x00t-32gbit: Use raw_smp_processor_id() instead of smp_processor_…
Browse files Browse the repository at this point in the history
…id()

The following call trace was observed:

localhost kernel: nvme nvme0: NVME-FC{0}: controller connect complete
localhost kernel: BUG: using smp_processor_id() in preemptible [00000000] code: kworker/u129:4/75092
localhost kernel: nvme nvme0: NVME-FC{0}: new ctrl: NQN "nqn.1992-08.com.netapp:sn.b42d198afb4d11ecad6d00a098d6abfa:subsystem.PR_Channel2022_RH84_subsystem_291"
localhost kernel: caller is qla_nvme_post_cmd+0x216/0x1380 [qla2xxx]
localhost kernel: CPU: 6 PID: 75092 Comm: kworker/u129:4 Kdump: loaded Tainted: G    B   W  OE    --------- ---  5.14.0-70.22.1.el9_0.x86_64+debug #1
localhost kernel: Hardware name: HPE ProLiant XL420 Gen10/ProLiant XL420 Gen10, BIOS U39 01/13/2022
localhost kernel: Workqueue: nvme-wq nvme_async_event_work [nvme_core]
localhost kernel: Call Trace:
localhost kernel: dump_stack_lvl+0x57/0x7d
localhost kernel: check_preemption_disabled+0xc8/0xd0
localhost kernel: qla_nvme_post_cmd+0x216/0x1380 [qla2xxx]

Use raw_smp_processor_id() instead of smp_processor_id().

Also use queue_work() across the driver instead of queue_work_on() thus
avoiding usage of smp_processor_id() when CONFIG_DEBUG_PREEMPT is enabled.

Cc: stable@vger.kernel.org
Suggested-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20230831112146.32595-2-njavali@marvell.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 59f10a05b5c7 upstream ]
  • Loading branch information
lnocturno committed Oct 10, 2023
1 parent 9d61b66 commit e325d95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion qla2x00t-32gbit/qla_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ fcport_is_bigger(fc_port_t *fcport)
static inline struct qla_qpair *
qla_mapq_nvme_select_qpair(struct qla_hw_data *ha, struct qla_qpair *qpair)
{
int cpuid = smp_processor_id();
int cpuid = raw_smp_processor_id();

if (qpair->cpuid != cpuid &&
ha->qp_cpu_map[cpuid]) {
Expand Down
4 changes: 2 additions & 2 deletions qla2x00t-32gbit/qla_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4349,7 +4349,7 @@ qla2xxx_msix_rsp_q(int irq, void *dev_id)
}
ha = qpair->hw;

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

return IRQ_HANDLED;
}
Expand All @@ -4375,7 +4375,7 @@ qla2xxx_msix_rsp_q_hs(int irq, void *dev_id)
wrt_reg_dword(&reg->hccr, HCCRX_CLR_RISC_INT);
spin_unlock_irqrestore(&ha->hardware_lock, flags);

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

return IRQ_HANDLED;
}
Expand Down
3 changes: 1 addition & 2 deletions qla2x00t-32gbit/qla_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -4481,8 +4481,7 @@ static int qlt_handle_cmd_for_atio(struct scsi_qla_host *vha,
#endif
} else if (ha->msix_count) {
if (cmd->atio.u.isp24.fcp_cmnd.rddata)
queue_work_on(raw_smp_processor_id(), qla_tgt_wq,
&cmd->work);
queue_work(qla_tgt_wq, &cmd->work);
else
#if HAVE_SE_CMD_CPUID
queue_work_on(cmd->se_cmd.cpuid, qla_tgt_wq,
Expand Down

0 comments on commit e325d95

Please sign in to comment.