]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix soft lockup when HW Timestamping is enabled
authorEran Ben Elisha <eranbe@mellanox.com>
Mon, 29 Feb 2016 19:17:11 +0000 (21:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Mar 2016 19:37:25 +0000 (14:37 -0500)
commit72196b8ddfd1244c96c8586ca5ec9cf70b63884a
treeaf20d6cdd599409d38f18cb31f71155d55a178fc
parentde155be5691dbd85731ed1f6823e71197231e244
net/mlx5e: Fix soft lockup when HW Timestamping is enabled

Readers/Writers lock for SW timecounter was acquired without disabling
interrupts on local CPU.

The problematic scenario:
* HW timestamping is enabled
* Timestamp overflow periodic service task is running on local CPU and
  holding write_lock for SW timecounter
* Completion arrives, triggers interrupt for local CPU.
  Interrupt routine calls napi_schedule(), which triggers rx/tx
  skb process.
  An attempt to read SW timecounter using read_lock is done, which is
  already locked by a writer on the same CPU and cause soft lockup.

Add irqsave/irqrestore for when using the readers/writers lock for
writing.

Fixes: 5bfaa8246922 ('net/mlx5e: Add HW timestamping (TS) support')
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_clock.c