diff options
author | Tyrel Datwyler <tyreld@linux.vnet.ibm.com> | 2019-05-02 20:50:58 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-06-18 19:46:22 -0400 |
commit | aa343c695aa59f03f31a2f989b8c977a727e46e3 (patch) | |
tree | c1185d4850dd3bed1e43607d53d8d0d845d49fb0 | |
parent | 6e40de8b6b3cfa7288bb4a1fee2c7173f53b7345 (diff) |
scsi: ibmvscsi: fix tripping of blk_mq_run_hw_queue WARN_ON
After a successful SRP login response we call scsi_unblock_requests() to
kick any pending IOs. The callback to process this SRP response happens in
a tasklet and therefore is in softirq context. The result of such is that
when blk-mq is enabled, it is no longer safe to call scsi_unblock_requests()
from this context. The result of duing so triggers the following WARN_ON
splat in dmesg after a host reset or CRQ reenablement.
WARNING: CPU: 0 PID: 0 at block/blk-mq.c:1375 __blk_mq_run_hw_queue+0x120/0x180
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.0.0-rc8 #4
NIP [c0000000009771e0] __blk_mq_run_hw_queue+0x120/0x180
LR [c000000000977484] __blk_mq_delay_run_hw_queue+0x244/0x250
Call Trace:
__blk_mq_delay_run_hw_queue+0x244/0x250
blk_mq_run_hw_queue+0x8c/0x1c0
blk_mq_run_hw_queues+0x60/0x90
scsi_run_queue+0x1e4/0x3b0
scsi_run_host_queues+0x48/0x80
login_rsp+0xb0/0x100
ibmvscsi_handle_crq+0x30c/0x3e0
ibmvscsi_task+0x54/0xe0
tasklet_action_common.isra.3+0xc4/0x1a0
__do_softirq+0x174/0x3f4
irq_exit+0xf0/0x120
__do_irq+0xb0/0x210
call_do_irq+0x14/0x24
do_IRQ+0x9c/0x130
hardware_interrupt_common+0x14c/0x150
This patch fixes the issue by introducing a new host action for unblocking
the scsi requests in our seperate work thread.
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 5 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 8df82c58e7b9..727c31dc11a0 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -1179,7 +1179,8 @@ static void login_rsp(struct srp_event_struct *evt_struct) | |||
1179 | be32_to_cpu(evt_struct->xfer_iu->srp.login_rsp.req_lim_delta)); | 1179 | be32_to_cpu(evt_struct->xfer_iu->srp.login_rsp.req_lim_delta)); |
1180 | 1180 | ||
1181 | /* If we had any pending I/Os, kick them */ | 1181 | /* If we had any pending I/Os, kick them */ |
1182 | scsi_unblock_requests(hostdata->host); | 1182 | hostdata->action = IBMVSCSI_HOST_ACTION_UNBLOCK; |
1183 | wake_up(&hostdata->work_wait_q); | ||
1183 | } | 1184 | } |
1184 | 1185 | ||
1185 | /** | 1186 | /** |
@@ -2123,6 +2124,7 @@ static void ibmvscsi_do_work(struct ibmvscsi_host_data *hostdata) | |||
2123 | spin_lock_irqsave(hostdata->host->host_lock, flags); | 2124 | spin_lock_irqsave(hostdata->host->host_lock, flags); |
2124 | switch (hostdata->action) { | 2125 | switch (hostdata->action) { |
2125 | case IBMVSCSI_HOST_ACTION_NONE: | 2126 | case IBMVSCSI_HOST_ACTION_NONE: |
2127 | case IBMVSCSI_HOST_ACTION_UNBLOCK: | ||
2126 | break; | 2128 | break; |
2127 | case IBMVSCSI_HOST_ACTION_RESET: | 2129 | case IBMVSCSI_HOST_ACTION_RESET: |
2128 | spin_unlock_irqrestore(hostdata->host->host_lock, flags); | 2130 | spin_unlock_irqrestore(hostdata->host->host_lock, flags); |
@@ -2164,6 +2166,7 @@ static int __ibmvscsi_work_to_do(struct ibmvscsi_host_data *hostdata) | |||
2164 | return 0; | 2166 | return 0; |
2165 | case IBMVSCSI_HOST_ACTION_RESET: | 2167 | case IBMVSCSI_HOST_ACTION_RESET: |
2166 | case IBMVSCSI_HOST_ACTION_REENABLE: | 2168 | case IBMVSCSI_HOST_ACTION_REENABLE: |
2169 | case IBMVSCSI_HOST_ACTION_UNBLOCK: | ||
2167 | default: | 2170 | default: |
2168 | break; | 2171 | break; |
2169 | } | 2172 | } |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.h b/drivers/scsi/ibmvscsi/ibmvscsi.h index 04bcbc832dc9..d9bf502334ba 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.h +++ b/drivers/scsi/ibmvscsi/ibmvscsi.h | |||
@@ -92,6 +92,7 @@ enum ibmvscsi_host_action { | |||
92 | IBMVSCSI_HOST_ACTION_NONE = 0, | 92 | IBMVSCSI_HOST_ACTION_NONE = 0, |
93 | IBMVSCSI_HOST_ACTION_RESET, | 93 | IBMVSCSI_HOST_ACTION_RESET, |
94 | IBMVSCSI_HOST_ACTION_REENABLE, | 94 | IBMVSCSI_HOST_ACTION_REENABLE, |
95 | IBMVSCSI_HOST_ACTION_UNBLOCK, | ||
95 | }; | 96 | }; |
96 | 97 | ||
97 | /* all driver data associated with a host adapter */ | 98 | /* all driver data associated with a host adapter */ |