]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: add async version of mailbox communication
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 11 Jun 2019 04:40:05 +0000 (21:40 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Jun 2019 19:22:27 +0000 (12:22 -0700)
commit8e29c96e5c62970554ba3dcc1057ceddfa9a755d
treed102f6667eb44ca335afd468b0947beef210edab
parent97864b2a287119a8755431e39e4d6eb8c6dd9967
nfp: add async version of mailbox communication

Some control messages must be sent from atomic context.  The mailbox
takes sleeping locks and uses a waitqueue so add a "posted" version
of communication.

Trylock the semaphore and if that's successful kick of the device
communication.  The device communication will be completed from
a workqueue, which will also release the semaphore.

If locks are taken queue the message and return.  Schedule a
different workqueue to take the semaphore and run the communication.
Note that the there are currently no atomic users which would actually
need the return value, so all replies to posted messages are just
freed.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/ccm.h
drivers/net/ethernet/netronome/nfp/ccm_mbox.c
drivers/net/ethernet/netronome/nfp/nfp_net.h
drivers/net/ethernet/netronome/nfp/nfp_net_common.c