OSDN Git Service

s390/zcrypt: make sysfs reset attribute trigger queue reset
authorHarald Freudenberger <freude@linux.ibm.com>
Mon, 26 Nov 2018 14:50:04 +0000 (15:50 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 13 Dec 2018 09:42:26 +0000 (10:42 +0100)
commit42a87d4103ae365e18c3be1333592ab583b8ad9d
tree0ee25e594ab56b2345bc811393e65f9e18f7a0db
parent98dfd32620e970eb576ebce5ea39d905cb005e72
s390/zcrypt: make sysfs reset attribute trigger queue reset

Until now there is no way to reset a AP queue or card. Driving a card
or queue offline and online again does only toggle the 'software'
online state. The only way to trigger a (hardware) reset is by running
hot-unplug/hot-plug for example on the HMC.

This patch makes the queue reset attribute in sysfs writable.
Writing into this attribute triggers a reset on the AP queue's state
machine. So the AP queue is flushed and state machine runs through the
initial states which cause a reset (PQAP(RAPQ)) and a re-registration
to interrupts (PQAP(AQIC)) if available.

The reset sysfs attribute is writable by root only. So only an
administrator is allowed to initiate a reset of AP queues. Please note
that the queue's counter values are left untouched by the reset.

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