]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit558a9daafe88df4621b4a7603f98c615e8e523b4
tree81c9a6262688fbe34cec77473c56d63c1ecd67d1
parent08d197e2489f2f59b112ca587554a7f48a8f2a02
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