]> www.infradead.org Git - users/jedix/linux-maple.git/commit
qed: Change locking scheme for VF channel
authorYuval Mintz <Yuval.Mintz@qlogic.com>
Mon, 22 Aug 2016 10:25:12 +0000 (13:25 +0300)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 04:59:39 +0000 (20:59 -0800)
commit41176afd8cdbc667381c09a1a988ef8ca324132b
treee97cbcdf7a0a7496cc6f8f596d3f5c52b09bb3eb
parent3399580848fc74cf33855c3e46649d1858fead1f
qed: Change locking scheme for VF channel

Orabug: 25477939

Each VF employees a lock that's supposed to serialize its usage of the
HW channel for communication with its PF, but the critical section is
ill-defined:

  - VFs currently release the lock whenever the PF response arrives,
    prior to actually processing the reply buffer [which was also supposed
    to have been protected by same lock].

  - The lock would be released on first response, ignoring the possibilty
    the sw flow isn't over [as might be the case of the acquisition flow].
    As a result, the flow would run unprotected and would cause a double
    mutex release [as the additional message completion would release it
    while its actually already free].

Change the flow to have a dedicated function to be called at end of each
flow and release the lock.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b0bccb69eba3629949eaa28017be56c8b1319b45)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/qlogic/qed/qed_vf.c