Skip to content

Commit 2ff07b5

Browse files
Yihang Limartinkpetersen
authored andcommitted
scsi: hisi_sas: Directly call register snapshot instead of using workqueue
Currently, register information dump is performed via workqueue, regardless of the trigger mode (automatic or manual). There is a delay in dumping register through workqueue, the exact register information at trigger time cannot be obtained. Call register snapshot directly instead of through a workqueue. Signed-off-by: Yihang Li <[email protected]> Signed-off-by: Xiang Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 6de426f commit 2ff07b5

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

drivers/scsi/hisi_sas/hisi_sas.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ struct hisi_hba {
451451
const struct hisi_sas_hw *hw; /* Low level hw interface */
452452
unsigned long sata_dev_bitmap[BITS_TO_LONGS(HISI_SAS_MAX_DEVICES)];
453453
struct work_struct rst_work;
454-
struct work_struct debugfs_work;
455454
u32 phy_state;
456455
u32 intr_coal_ticks; /* Time of interrupt coalesce in us */
457456
u32 intr_coal_count; /* Interrupt count to coalesce */

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,8 +1958,11 @@ static bool hisi_sas_internal_abort_timeout(struct sas_task *task,
19581958
struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
19591959
struct hisi_sas_internal_abort_data *timeout = data;
19601960

1961-
if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct)
1962-
queue_work(hisi_hba->wq, &hisi_hba->debugfs_work);
1961+
if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct) {
1962+
down(&hisi_hba->sem);
1963+
hisi_hba->hw->debugfs_snapshot_regs(hisi_hba);
1964+
up(&hisi_hba->sem);
1965+
}
19631966

19641967
if (task->task_state_flags & SAS_TASK_STATE_DONE) {
19651968
pr_err("Internal abort: timeout %016llx\n",

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,6 @@ static int experimental_iopoll_q_cnt;
558558
module_param(experimental_iopoll_q_cnt, int, 0444);
559559
MODULE_PARM_DESC(experimental_iopoll_q_cnt, "number of queues to be used as poll mode, def=0");
560560

561-
static void debugfs_work_handler_v3_hw(struct work_struct *work);
562561
static void debugfs_snapshot_regs_v3_hw(struct hisi_hba *hisi_hba);
563562

564563
static u32 hisi_sas_read32(struct hisi_hba *hisi_hba, u32 off)
@@ -3388,7 +3387,6 @@ hisi_sas_shost_alloc_pci(struct pci_dev *pdev)
33883387
hisi_hba = shost_priv(shost);
33893388

33903389
INIT_WORK(&hisi_hba->rst_work, hisi_sas_rst_work_handler);
3391-
INIT_WORK(&hisi_hba->debugfs_work, debugfs_work_handler_v3_hw);
33923390
hisi_hba->hw = &hisi_sas_v3_hw;
33933391
hisi_hba->pci_dev = pdev;
33943392
hisi_hba->dev = dev;
@@ -3910,7 +3908,9 @@ static ssize_t debugfs_trigger_dump_v3_hw_write(struct file *file,
39103908
if (buf[0] != '1')
39113909
return -EFAULT;
39123910

3913-
queue_work(hisi_hba->wq, &hisi_hba->debugfs_work);
3911+
down(&hisi_hba->sem);
3912+
debugfs_snapshot_regs_v3_hw(hisi_hba);
3913+
up(&hisi_hba->sem);
39143914

39153915
return count;
39163916
}
@@ -4661,14 +4661,6 @@ static void debugfs_fifo_init_v3_hw(struct hisi_hba *hisi_hba)
46614661
}
46624662
}
46634663

4664-
static void debugfs_work_handler_v3_hw(struct work_struct *work)
4665-
{
4666-
struct hisi_hba *hisi_hba =
4667-
container_of(work, struct hisi_hba, debugfs_work);
4668-
4669-
debugfs_snapshot_regs_v3_hw(hisi_hba);
4670-
}
4671-
46724664
static void debugfs_release_v3_hw(struct hisi_hba *hisi_hba, int dump_index)
46734665
{
46744666
struct device *dev = hisi_hba->dev;

0 commit comments

Comments
 (0)