s390/zcrypt: use new state UNBOUND during queue driver rebind
authorHarald Freudenberger <freude@linux.ibm.com>
Tue, 5 Feb 2019 16:22:36 +0000 (17:22 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 13 Feb 2019 07:27:44 +0000 (08:27 +0100)
commitb1af7528d27e450a1a4492678454b15177398a26
tree6546e4303c4bf211a58a9fade03abb7ed3602b11
parentb96027d3b760184d48b819983f13b318dabbf95c
s390/zcrypt: use new state UNBOUND during queue driver rebind

When an alternate driver (vfio-ap) has bound an ap queue and this
binding is revised the ap queue device is in an intermittent
state not bound to any driver. The internal state variable
covered this with the state AP_STATE_BORKED which is also used to
reflect broken devices. When now an ap bus scan runs such a
device is destroyed and on the next scan reconstructed.

So a stress test with high frequency switching the queue driver
between the default and the vfio-ap driver hit this gap and the
queue was removed until the next ap bus scan. This fix now
introduces another state for the in-between condition for a queue
momentary not bound to a driver and so the ap bus scan function
skips this device instead of removing it.

Also some very slight but maybe helpful debug feature messages
come with this patch - in particular a message showing that a
broken card/queue device will get removed.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/crypto/ap_bus.c
drivers/s390/crypto/ap_bus.h
drivers/s390/crypto/ap_queue.c