提交 1f5bd384 编写于 作者: P Peter Oberparleiter 提交者: Martin Schwidefsky

[S390] cio: ensure proper locking during device recognition

Device recognition needs to be started with the ccw device lock
held to prevent race conditions between I/O starting and interrupt
reception.
Signed-off-by: NPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 7c4d964f
...@@ -488,7 +488,9 @@ static int online_store_recog_and_online(struct ccw_device *cdev) ...@@ -488,7 +488,9 @@ static int online_store_recog_and_online(struct ccw_device *cdev)
{ {
/* Do device recognition, if needed. */ /* Do device recognition, if needed. */
if (cdev->private->state == DEV_STATE_BOXED) { if (cdev->private->state == DEV_STATE_BOXED) {
spin_lock_irq(cdev->ccwlock);
ccw_device_recognition(cdev); ccw_device_recognition(cdev);
spin_unlock_irq(cdev->ccwlock);
wait_event(cdev->private->wait_q, wait_event(cdev->private->wait_q,
cdev->private->flags.recog_done); cdev->private->flags.recog_done);
if (cdev->private->state != DEV_STATE_OFFLINE) if (cdev->private->state != DEV_STATE_OFFLINE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册