]> git.baikalelectronics.ru Git - kernel.git/commit
net: macb: reduce scope of rx_fs_lock-protected regions
authorJulia Cartwright <julia@ni.com>
Wed, 6 Dec 2017 00:02:49 +0000 (18:02 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Dec 2017 01:08:03 +0000 (20:08 -0500)
commit8ec2df9a40b4670e301059d57f4a4e205e8289b6
tree2180c28b38dbc0945a194ebb597b86ebd079b19b
parent50812a521446c2cccfce2a1b2675e49bab16362a
net: macb: reduce scope of rx_fs_lock-protected regions

Commit 897f87269a04 ("net: macb: Added support for RX filtering")
introduces a lock, rx_fs_lock which is intended to protect the list of
rx_flow items and synchronize access to the hardware rx filtering
registers.

However, the region protected by this lock is overscoped, unnecessarily
including things like slab allocation.  Reduce this lock scope to only
include operations which must be performed atomically: list traversal,
addition, and removal, and hitting the macb filtering registers.

This fixes the use of kmalloc w/ GFP_KERNEL in atomic context.

Fixes: 897f87269a04 ("net: macb: Added support for RX filtering")
Cc: Rafal Ozieblo <rafalo@cadence.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Julia Cartwright <julia@ni.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c