linux/drivers/infiniband/ulp/opa_vnic
Vishwanathapura, Niranjana a379d69f00 IB/opa_vnic: Use spinlock instead of mutex for stats_lock
Stats can be read from atomic context, hence make stats_lock as
a spinlock.

Fix the following trace with debug kernel.

BUG: sleeping function called from invalid context at
kernel/locking/mutex.c:238
in_atomic(): 1, irqs_disabled(): 0, pid: 6487, name: sadc
Call Trace:
 dump_stack+0x63/0x90
 ___might_sleep+0xda/0x130
 __might_sleep+0x4a/0x90
 mutex_lock+0x20/0x50
 opa_vnic_get_stats64+0x56/0x140 [opa_vnic]
 dev_get_stats+0x74/0x130
 dev_seq_printf_stats+0x37/0x120
 dev_seq_show+0x14/0x30
 seq_read+0x26d/0x3d0

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-06-29 12:43:52 -04:00
..
Kconfig
Makefile IB/opa-vnic: VNIC Ethernet Management Agent (VEMA) function 2017-04-20 12:01:38 -04:00
opa_vnic_encap.c IB/opa-vnic: VNIC MAC table support 2017-04-20 12:01:38 -04:00
opa_vnic_encap.h IB/opa-vnic: VNIC Ethernet Management Agent (VEMA) interface 2017-04-20 12:01:38 -04:00
opa_vnic_ethtool.c IB/opa_vnic: Use spinlock instead of mutex for stats_lock 2017-06-29 12:43:52 -04:00
opa_vnic_internal.h IB/opa_vnic: Use spinlock instead of mutex for stats_lock 2017-06-29 12:43:52 -04:00
opa_vnic_netdev.c IB/opa_vnic: Use spinlock instead of mutex for stats_lock 2017-06-29 12:43:52 -04:00
opa_vnic_vema_iface.c IB/opa_vnic: Use spinlock instead of mutex for stats_lock 2017-06-29 12:43:52 -04:00
opa_vnic_vema.c IB/opa_vnic: Use GFP_ATOMIC while sending trap 2017-06-29 12:43:52 -04:00