s390/zcrypt: rework ap scan bus code
authorHarald Freudenberger <freude@linux.ibm.com>
Thu, 29 Nov 2018 10:50:16 +0000 (11:50 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 13 Dec 2018 09:42:27 +0000 (10:42 +0100)
commita7b1868a5f473fb93d912a618883cef0d43653b9
tree80e949b49d809d4d07866bc56a45d68eb9dea6a1
parent42a87d4103ae365e18c3be1333592ab583b8ad9d
s390/zcrypt: rework ap scan bus code

Rework of the AP bus scan code. The ap_scan_bus() function
is large, so this patch splits the code by introducing a new
new function _ap_scan_bus_adapter() which deals with just
one adapter and thus reduces the scan function code complexity.

Now the AP bus scan can handle a type change of an crypto
adapter on the fly (e.g. from CEX5 to CEX6). This may be
the case with newer versions of zVM where the card may
be pure virtual and a type change is just one click.
However a type or function change requires to unregister
all queue devices and the card device and re-register them.

Comments around the AP bus scan code have been added and/or
improved to provide some hopefully useful hints about what
the code is actually doing.

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