]> git.baikalelectronics.ru Git - kernel.git/commit
s390/ap: introduce new ap function ap_get_qdev()
authorHarald Freudenberger <freude@linux.ibm.com>
Fri, 8 May 2020 13:51:19 +0000 (15:51 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 20 May 2020 08:22:51 +0000 (10:22 +0200)
commit2de616da9bc0a74aef1eae30189357e6b6a3211f
tree97aba2dd14759acde3f150e3436c667f8df5fd47
parent3e1b06a0af63efc12c6bfa29e62679be9ced825c
s390/ap: introduce new ap function ap_get_qdev()

Provide a new interface function to be used by the ap drivers:
  struct ap_queue *ap_get_qdev(ap_qid_t qid);
Returns ptr to the struct ap_queue device or NULL if there
was no ap_queue device with this qid found. When something is
found, the reference count of the embedded device is increased.
So the caller has to decrease the reference count after use
with a call to put_device(&aq->ap_dev.device).

With this patch also the ap_card_list is removed from the
ap core code and a new hashtable is introduced which stores
hnodes of all the ap queues known to the ap bus.

The hashtable approach and a first implementation of this
interface comes from a previous patch from
Anthony Krowiak and an idea from Halil Pasic.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Suggested-by: Tony Krowiak <akrowiak@linux.ibm.com>
Suggested-by: Halil Pasic <pasic@linux.ibm.com>
Reviewed-by: Tony Krowiak <akrowiak@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_card.c
drivers/s390/crypto/ap_queue.c