staging: wfx: drop async field from struct hif_cmd
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Mon, 7 Sep 2020 10:15:20 +0000 (12:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2020 07:23:06 +0000 (09:23 +0200)
commit3768c74b3a969b62894667e4b79dd50f58a91ecb
tree41ce6fc70c69e9ef798169206fd3a599b240ed6c
parentc8fb880910bdb2cf118a8a5d0122090ee07b6ce5
staging: wfx: drop async field from struct hif_cmd

The parameter "async" in wfx_cmd_send() allows to send command without
waiting for the reply. In this case, the mutex hif_cmd.lock is released
asynchronously in the context of the receiver workqueue.

However, "kbuild test robot" complains about this architecture[1] since
it is not able to follow the lock duration of hif_cmd.lock (and indeed,
the state of the driver if the hardware wouldn't reply is not well
defined).

Besides, this feature is not really necessary. It is only used by
hif_shutdown(). This function hijack the 'async' flag to run a command
that won't answer.

So, this patch removes the 'async' flag and introduces a 'no_reply' flag.
Thus, the mutex hif_cmd.lock is only acquired/released from
hif_cmd_send(). Therefore:
  - hif_shutdown() does not have to touch the private data of the struct
    hif_cmd
  - Kbuild test robot should be happy
  - the resulting code is simpler

[1] https://lore.kernel.org/driverdev-devel/alpine.DEB.2.21.1910041317381.2992@hadrien/

Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-31-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/hif_rx.c
drivers/staging/wfx/hif_tx.c
drivers/staging/wfx/hif_tx.h