]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
s390/ap: split ap queue state machine state from device state
authorHarald Freudenberger <freude@linux.ibm.com>
Thu, 2 Jul 2020 09:22:01 +0000 (11:22 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 7 Oct 2020 19:49:59 +0000 (21:49 +0200)
commit0b641cbd24445e56073c69dd046be488dcf1965b
tree3e5843837542e091d06687bd94583f6bbd92b7e6
parent0ae88ccf4c160e02316e054db67156230568cf49
s390/ap: split ap queue state machine state from device state

The state machine for each ap queue covered a mixture of
device states and state machine (firmware queue state) states.

This patch splits the device states and the state machine
states into two different enums and variables. The major
state is the device state with currently these values:

  AP_DEV_STATE_UNINITIATED - fresh and virgin, not touched
  AP_DEV_STATE_OPERATING   - queue dev is working normal
  AP_DEV_STATE_SHUTDOWN    - remove/unbind/shutdown in progress
  AP_DEV_STATE_ERROR    - device is in error state

only when the device state is > UNINITIATED the state machine
is run. The state machine represents the states of the firmware
queue:

  AP_SM_STATE_RESET_START - starting point, reset (RAPQ) ap queue
  AP_SM_STATE_RESET_WAIT  - reset triggered, waiting to be finished
    if irqs enabled, set up irq (AQIC)
  AP_SM_STATE_SETIRQ_WAIT - enable irq triggered, waiting to be
    finished, then go to IDLE
  AP_SM_STATE_IDLE   - queue is operational but empty
  AP_SM_STATE_WORKING   - queue is operational, requests are stored
    and replies may wait for getting fetched
  AP_SM_STATE_QUEUE_FULL  - firmware queue is full, so only replies
    can get fetched

For debugging each ap queue shows a sysfs attribute 'states' which
displays the device and state machine state and is only available
when the kernel is build with CONFIG_ZCRYPT_DEBUG enabled.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/crypto/ap_bus.c
drivers/s390/crypto/ap_bus.h
drivers/s390/crypto/ap_queue.c
drivers/s390/crypto/zcrypt_msgtype50.c
drivers/s390/crypto/zcrypt_msgtype6.c