bnxt_en: Initialize CP doorbell value before ring allocation
authorPrashant Sreedharan <prashant@broadcom.com>
Mon, 28 Mar 2016 23:46:04 +0000 (19:46 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Mar 2016 23:01:32 +0000 (19:01 -0400)
commit33e52d888d0c84a0c66f13357a53113fd9710bd6
tree81c9a6262688fbe34cec77473c56d63c1ecd67d1
parentcb41c997d4446b39dd03b8a74196125739d7c3ac
bnxt_en: Initialize CP doorbell value before ring allocation

The existing code does the following:
    allocate completion ring
    initialize completion ring doorbell
    disable interrupts on this completion ring by writing to the doorbell

We can have a race where firmware sends an asynchronous event to the host
after completion ring allocation and before doorbell is initialized.
When this happens driver can crash while ringing the doorbell using
uninitialized value as part of handling the IRQ/napi request.

Signed-off-by: Prashant Sreedharan <prashant.sreedharan@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c