linux-sg2042/drivers/s390/crypto
Sascha Silbe 121a868d05 s390/zcrypt: Fix initialisation when zcrypt is built-in
ap_bus and zcrypt_api assumed module information to always be present
and initialisation to be done in module loading order (symbol
dependencies). These assumptions don't hold if zcrypt is built-in;
THIS_MODULE will be NULL in this case and init call order is linker
order, i.e. Makefile order.

Fix initialisation order by ordering the object files in the Makefile
according to their dependencies, like the module loader would do.

Fix message type registration by using a dedicated "name" field rather
than piggy-backing on the module ("owner") information. There's no
change to the requirement that module name and msgtype name are
identical. The existing name macros are used.

We don't need any special code for dealing with the drivers being
built-in; the generic module support code already does the right
thing.

Test results:
1. CONFIG_MODULES=y, CONFIG_ZCRYPT=y

   KVM: boots, no /sys/bus/ap (expected)
   LPAR with CEX5: boots, /sys/bus/ap/devices/card*/type present

2. CONFIG_MODULES=y, CONFIG_ZCRYPT=m=:

   KVM: boots, loading zcrypt_cex4 (and ap) fails (expected)
   LPAR with CEX5: boots, loading =zcrypt_cex4= succeeds,
   /sys/bus/ap/devices/card*/type present after explicit module
   loading

3. CONFIG_MODULES unset, CONFIG_ZCRYPT=y:
   KVM: boots, no /sys/bus/ap (expected)
   LPAR with CEX5: boots, /sys/bus/ap/devices/card*/type present

No further testing (user-space functionality) was done.

Fixes: 3b6245fd303f ("s390/zcrypt: Separate msgtype implementation from card modules.")
Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2015-11-11 13:56:34 +01:00
..
Makefile s390/zcrypt: Fix initialisation when zcrypt is built-in 2015-11-11 13:56:34 +01:00
ap_bus.c s390/zcrypt: Fix kernel crash on systems without AP bus support 2015-11-11 13:56:30 +01:00
ap_bus.h s390/zcrypt: introduce state machine for the AP bus 2015-10-14 14:32:23 +02:00
zcrypt_api.c s390/zcrypt: Fix initialisation when zcrypt is built-in 2015-11-11 13:56:34 +01:00
zcrypt_api.h s390/zcrypt: Fix initialisation when zcrypt is built-in 2015-11-11 13:56:34 +01:00
zcrypt_cca_key.h s390/zcrypt: enable odd RSA modulus sizes in CRT format 2015-10-14 14:31:59 +02:00
zcrypt_cex2a.c s390/zcrypt: Separate msgtype implementation from card modules. 2012-09-26 15:44:55 +02:00
zcrypt_cex2a.h s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
zcrypt_cex4.c s390/zcrypt: Fixed reset and interrupt handling of AP queues 2015-06-25 09:39:23 +02:00
zcrypt_cex4.h s390/zcrypt: Add support for CEX4 crypto card 2012-09-26 15:44:56 +02:00
zcrypt_debug.h s390/s390dbf: use debug_level_enabled() where applicable 2013-10-24 17:16:54 +02:00
zcrypt_error.h s390/zcrypt: add support for EP11 coprocessor cards 2013-12-18 17:37:15 +01:00
zcrypt_msgtype6.c s390/zcrypt: Fix initialisation when zcrypt is built-in 2015-11-11 13:56:34 +01:00
zcrypt_msgtype6.h s390/zcrypt: add support for EP11 coprocessor cards 2013-12-18 17:37:15 +01:00
zcrypt_msgtype50.c s390/zcrypt: Fix initialisation when zcrypt is built-in 2015-11-11 13:56:34 +01:00
zcrypt_msgtype50.h s390/zcrypt: msgType50 (RSA-CRT) fix 2012-11-23 11:14:30 +01:00
zcrypt_pcixcc.c s390/zcrypt: use msleep() instead of mdelay() 2015-08-19 10:40:26 +02:00
zcrypt_pcixcc.h s390/zcrypt: Separate msgtype implementation from card modules. 2012-09-26 15:44:55 +02:00