linux/drivers/s390
Harald Freudenberger c3384369bc s390/zcrypt: improve zcrypt retry behavior
This patch reworks and improves the zcrypt retry behavior:
- The zcrypt_rescan_req counter has been removed. This
  counter variable has been increased on some transport
  errors and was used as a gatekeeper for AP bus rescans.
- Rework of the zcrypt_process_rescan() function to not
  use the above counter variable any more. Instead now
  always the ap_bus_force_rescan() function is called
  (as this has been improved with a previous patch).
- As the zcrpyt_process_rescan() function is called in
  all cprb send functions in case of the first attempt
  to send failed with ENODEV now before the next attempt
  to send an cprb is started.
- Introduce a define ZCRYPT_WAIT_BINDINGS_COMPLETE_MS
  for the amount of milliseconds to have the zcrypt API
  wait for AP bindings complete. This amount has been
  reduced to 30s (was 60s). Some playing around showed
  that 30s is a really fair limit.

The result of the above together with the patches to
improve the AP scan bus functions is that after the
first loop of cprb send retries when the result is a
ENODEV the AP bus scan is always triggered (synchronous).
If the AP bus scan detects changes in the configuration,
all the send functions now retry when the first attempt
was failing with ENODEV in the hope that now a suitable
device has appeared.

About concurrency: The ap_bus_force_rescan() uses a mutex
to ensure only one active AP bus scan is running. Another
caller of this function is blocked as long as the scan is
running but does not cause yet another scan. Instead the
result of the 'other' scan is used. This affects only tasks
which run into an initial ENODEV. Tasks with successful
delivery of cprbs will never invoke the bus scan and thus
never get blocked by the mutex.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2024-03-07 14:41:15 +01:00
..
block Quite a lot of kexec work this time around. Many singleton patches in 2024-01-09 11:46:20 -08:00
char s390/switch_to: use generic header file 2024-02-12 15:03:33 +01:00
cio s390/cio: make scm_bus_type const 2024-02-09 13:58:16 +01:00
crypto s390/zcrypt: improve zcrypt retry behavior 2024-03-07 14:41:15 +01:00
net net/smc: manage system EID in SMC stack instead of ISM driver 2023-12-26 20:24:33 +00:00
scsi scsi: zfcp: Replace strlcpy() with strscpy() 2023-12-05 21:01:52 -05:00
virtio s390/airq: remove lsi_mask from airq_struct 2023-08-30 11:03:28 +02:00
Makefile