]> git.baikalelectronics.ru Git - kernel.git/commit
mwl8k: fix firmware command serialisation
authorLennert Buytenhek <buytenh@wantstofly.org>
Tue, 18 Aug 2009 01:18:01 +0000 (03:18 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 20 Aug 2009 15:38:08 +0000 (11:38 -0400)
commit58f6b2e4250df04e8e83e5f9231082d984bab018
treeea1abbe59b699e423e13c50e970a7195a1ebd304
parent1154c3538170798df67f4a4310388460bfef0f51
mwl8k: fix firmware command serialisation

The current mwl8k_priv->fw_lock spinlock doesn't actually protect
against multiple commands being submitted at once, as it is not kept
held over the entire firmware command submission.  And since waiting
for command completion sleeps, we can't use a spinlock anyway.

To fix mwl8k firmware command serialisation properly, we have the
following requirements:
- Some commands require that the packet transmit path is idle when
  the command is issued.  (For simplicity, we'll just quiesce the
  transmit path for every command.)
- There are certain sequences of commands that need to be issued to
  the hardware sequentially, with no other intervening commands.

This leads to an implementation of a "firmware lock" as a mutex that
can be taken recursively, and which is taken by both the low-level
command submission function (mwl8k_post_cmd) as well as any users of
that function that require issuing of an atomic sequence of commands,
and quiesces the transmit path whenever it's taken.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwl8k.c