qed: Don't allocate SBs using main PTT
authorMintz, Yuval <Yuval.Mintz@cavium.com>
Mon, 20 Feb 2017 20:43:38 +0000 (22:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Feb 2017 22:11:54 +0000 (17:11 -0500)
commit85750d74fba5a7c31309c038c5f9f019edc6ea31
treee3194d9387b34055cd809dc412b194f460f8c049
parentafe981d664aeeebc8d1bcbd7d2070b5432edaecb
qed: Don't allocate SBs using main PTT

Flows accessing registers require the flow to hold a PTT entry.
To protect 'major' load/unload flows a main_ptt is pre-allocated
to guarantee such flows wouldn't be blocked by PTT being
unavailable.

Status block initialization currently uses the main_ptt which
is incorrect, as this flow might run concurrently to others
[E.g., loading qedr while toggling qede]. That would have dire
effects as it means registers' access to device breaks and further
read/writes might access incorrect addresses.

Instead, when initializing status blocks acquire/release a PTT
as part of the flow.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_main.c