s390/cio: fix ccw_device_start_timeout API
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Tue, 6 Feb 2018 13:59:43 +0000 (14:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:50:29 +0000 (07:50 +0200)
commit9a8c6a26da1351885d2cd64f127102e7eafcb8b3
tree992cf7a39bf3116498b26d346840414833a97efc
parent503b6c0d278dc7bf4b5cf1c9b092b7b461b32e15
s390/cio: fix ccw_device_start_timeout API

[ Upstream commit f97a6b6c47d2f329a24f92cc0ca3c6df5727ba73 ]

There are cases a device driver can't start IO because the device is
currently in use by cio. In this case the device driver is notified
when the device is usable again.

Using ccw_device_start_timeout we would set the timeout (and change
an existing timeout) before we test for internal usage. Worst case
this could lead to an unexpected timer deletion.

Fix this by setting the timeout after we test for internal usage.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/s390/cio/device_ops.c