From: Yang Xingui <yangxingui(a)huawei.com>
driver inclusion
category: bugfix
bugzilla: NA
CVE: NA
Call down() at RCU Read-Side Critical Secrion sometimes may
caugh a RCU preempt Calltrace.
[ 3506.800288] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
[ 3506.806357] rcu: Tasks blocked on level-1 rcu_node (CPUs 0-15): P22895/1:b..l
[ 3506.813556] (detected by 108, t=162805 jiffies, g=124209, q=59192378)
[ 3506.820056] kworker/0:1H D 0 22895 2 0x00000228
[ 3506.825524] Workqueue: kblockd blk_mq_run_work_fn
[ 3506.830207] Call trace:
[ 3506.832644] __switch_to+0xf0/0x140
[ 3506.836118] __schedule+0x890/0xdc8
[ 3506.839590] schedule+0x80/0x120
[ 3506.842804] schedule_timeout+0x22c/0x328
[ 3506.846796] __down+0x74/0xc8
[ 3506.849751] down+0x54/0x70
[ 3506.852539] hisi_sas_task_exec.isra.25+0x840/0xf28 [hisi_sas_main]
[ 3506.858780] hisi_sas_queue_command+0x40/0x84 [hisi_sas_main]
[ 3506.864502] sas_queuecommand+0x144/0x1c8 [libsas]
[ 3506.869271] scsi_queue_rq+0x72c/0xa20
[ 3506.873005] blk_mq_dispatch_rq_list+0x110/0x680
[ 3506.877601] blk_mq_do_dispatch_sched+0x108/0x148
[ 3506.882285] __blk_mq_sched_dispatch_requests+0x120/0x1b8
[ 3506.887659] blk_mq_sched_dispatch_requests+0x40/0x78
[ 3506.892688] __blk_mq_run_hw_queue+0xb8/0x138
[ 3506.897026] blk_mq_run_work_fn+0x28/0x38
Actually it's no need for keeping IO stopping here to wait for
controller reset complete. We can directly return error code.
Signed-off-by: Yang Xingui <yangxingui(a)huawei.com>
Reviewed-by: Zhu Xiongxiong <zhuxiongxiong(a)huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang(a)huawei.com>
---
drivers/scsi/hisi_sas/hisi_sas_main.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 124aa26fa4b8..0128c547e4c8 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -611,19 +611,9 @@ static int hisi_sas_task_exec(struct sas_task *task, gfp_t gfp_flags,
hisi_hba = dev_to_hisi_hba(device);
dev = hisi_hba->dev;
- if (unlikely(test_bit(HISI_SAS_REJECT_CMD_BIT, &hisi_hba->flags))) {
- /*
- * For IOs from upper layer, it may already disable preempt
- * in the IO path, if disable preempt again in down(),
- * function schedule() will report schedule_bug(), so check
- * preemptible() before goto down().
- */
- if (!preemptible())
- return -EINVAL;
+ if (unlikely(test_bit(HISI_SAS_REJECT_CMD_BIT, &hisi_hba->flags)))
+ return -EINVAL;
- down(&hisi_hba->sem);
- up(&hisi_hba->sem);
- }
/* protect task_prep and start_delivery sequence */
rc = hisi_sas_task_prep(task, is_tmf, tmf, &pass, &dq);
--
2.25.1