]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix 64-bit doorbell operation on 32-bit kernels
authorMichael Chan <michael.chan@broadcom.com>
Wed, 1 Sep 2021 01:15:23 +0000 (21:15 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Sep 2021 09:37:05 +0000 (10:37 +0100)
commitc6132f6f2e682c958f7022ecfd8bec35723a1a9d
tree40c40646fc415b563589a9737c40bb8a1a23c370
parent9e9fb7655ed585da8f468e29221f0ba194a5f613
bnxt_en: Fix 64-bit doorbell operation on 32-bit kernels

The driver requires 64-bit doorbell writes to be atomic on 32-bit
architectures.  So we redefined writeq as a new macro with spinlock
protection on 32-bit architectures.  This created a new warning when
we added a new file in a recent patchset.  writeq is defined on many
32-bit architectures to do the memory write non-atomically and it
generated a new macro redefined warning.  This warning was fixed
incorrectly in the recent patch.

Fix this properly by adding a new bnxt_writeq() function that will
do the non-atomic write under spinlock on 32-bit systems.  All callers
in the driver will now call bnxt_writeq() instead.

v2: Need to pass in bp to bnxt_writeq()
    Use lo_hi_writeq() [suggested by Florian]

Reported-by: kernel test robot <lkp@intel.com>
Fixes: f9ff578251dc ("bnxt_en: introduce new firmware message API based on DMA pools")
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h