Skip to content

Commit 7ca03ae

Browse files
committed
scsi: smartpqi: Fix smp_processor_id() call trace for preemptible kernels
JIRA: https://issues.redhat.com/browse/RHEL-96279 commit 42d033c Author: Yi Zhang <yi.zhang@redhat.com> Date: Wed Apr 23 13:32:28 2025 -0500 scsi: smartpqi: Fix smp_processor_id() call trace for preemptible kernels Correct kernel call trace when calling smp_processor_id() when called in preemptible kernels by using raw_smp_processor_id(). smp_processor_id() checks to see if preemption is disabled and if not, issue an error message followed by a call to dump_stack(). Brief example of call trace: kernel: check_preemption_disabled: 436 callbacks suppressed kernel: BUG: using smp_processor_id() in preemptible [00000000] code: kworker/u1025:0/2354 kernel: caller is pqi_scsi_queue_command+0x183/0x310 [smartpqi] kernel: CPU: 129 PID: 2354 Comm: kworker/u1025:0 kernel: ... kernel: Workqueue: writeback wb_workfn (flush-253:0) kernel: Call Trace: kernel: <TASK> kernel: dump_stack_lvl+0x34/0x48 kernel: check_preemption_disabled+0xdd/0xe0 kernel: pqi_scsi_queue_command+0x183/0x310 [smartpqi] kernel: ... Fixes: 283dcc1 ("scsi: smartpqi: add counter for parity write stream requests") Reviewed-by: Scott Benesh <scott.benesh@microchip.com> Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com> Tested-by: Don Brace <don.brace@microchip.com> Signed-off-by: Yi Zhang <yi.zhang@redhat.com> Signed-off-by: Don Brace <don.brace@microchip.com> Link: https://lore.kernel.org/r/20250423183229.538572-5-don.brace@microchip.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Don Brace <dbrace@redhat.com>
1 parent 17c6b0b commit 7ca03ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/scsi/smartpqi/smartpqi_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6004,7 +6004,7 @@ static bool pqi_is_parity_write_stream(struct pqi_ctrl_info *ctrl_info,
60046004
pqi_stream_data->next_lba = rmd.first_block +
60056005
rmd.block_cnt;
60066006
pqi_stream_data->last_accessed = jiffies;
6007-
per_cpu_ptr(device->raid_io_stats, smp_processor_id())->write_stream_cnt++;
6007+
per_cpu_ptr(device->raid_io_stats, raw_smp_processor_id())->write_stream_cnt++;
60086008
return true;
60096009
}
60106010

@@ -6083,7 +6083,7 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scm
60836083
rc = pqi_raid_bypass_submit_scsi_cmd(ctrl_info, device, scmd, queue_group);
60846084
if (rc == 0 || rc == SCSI_MLQUEUE_HOST_BUSY) {
60856085
raid_bypassed = true;
6086-
per_cpu_ptr(device->raid_io_stats, smp_processor_id())->raid_bypass_cnt++;
6086+
per_cpu_ptr(device->raid_io_stats, raw_smp_processor_id())->raid_bypass_cnt++;
60876087
}
60886088
}
60896089
if (!raid_bypassed)

0 commit comments

Comments
 (0)