OpenCloudOS-Kernel/drivers/net/ethernet/mellanox/mlx4
Roland Dreier f3d4c89ee4 mlx4_core: Fix crash on uninitialized priv->cmd.slave_sem
On an SR-IOV master device, __mlx4_init_one() calls mlx4_init_hca()
before mlx4_multi_func_init().  However, for unlucky configurations,
mlx4_init_hca() might call mlx4_SENSE_PORT() (via mlx4_dev_cap()), and
that calls mlx4_cmd_imm() with MLX4_CMD_WRAPPED set.

However, on a multifunction device with MLX4_CMD_WRAPPED, __mlx4_cmd()
calls into mlx4_slave_cmd(), and that immediately tries to do

	down(&priv->cmd.slave_sem);

but priv->cmd.slave_sem isn't initialized until mlx4_multi_func_init()
(which we haven't called yet).  The next thing it tries to do is access
priv->mfunc.vhcr, but that hasn't been allocated yet.

Fix this by moving the initialization of slave_sem and vhcr up into
mlx4_cmd_init(). Also, since slave_sem is really just being used as a
mutex, convert it into a slave_cmd_mutex.

Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-09-30 20:33:46 -07:00
..
Kconfig net/mlx4_en: DCB QoS support 2012-04-05 05:08:04 -04:00
Makefile net/mlx4_en: DCB QoS support 2012-04-05 05:08:04 -04:00
alloc.c mlx4_core: Change bitmap allocator to work in round-robin fashion 2012-05-14 13:44:38 -07:00
catas.c mlx4: Add support for EEH error recovery 2012-07-25 15:24:13 -07:00
cmd.c mlx4_core: Fix crash on uninitialized priv->cmd.slave_sem 2012-09-30 20:33:46 -07:00
cq.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00
en_cq.c net/mlx4_en: Add accelerated RFS support 2012-07-19 08:34:37 -07:00
en_dcb_nl.c drivers/net: fix unresolved 64bit math in mellanox/mlx4/en_dcb_nl.c 2012-04-16 02:12:11 -04:00
en_ethtool.c net/mlx4: Move MAC_MASK to a common place 2012-07-19 08:34:37 -07:00
en_main.c mlx4: Use port management change event instead of smp_snoop 2012-07-10 09:47:10 -07:00
en_netdev.c net/mlx4_en: Limit the RFS filter IDs to be < RPS_NO_FILTER 2012-07-26 00:23:55 -07:00
en_port.c mlx4: Ethernet port management modifications 2011-12-13 13:56:07 -05:00
en_port.h net/mlx4_core: set port QoS attributes 2012-04-05 05:08:03 -04:00
en_resources.c net/mlx4_en: Force user priority by QP attribute 2012-04-05 05:08:03 -04:00
en_rx.c net/mlx4_en: loopbacked packets are dropped when SMAC=DMAC 2012-08-03 16:49:02 -07:00
en_selftest.c mlx4_core: Add "native" argument to mlx4_cmd and its callers (where needed) 2011-12-13 13:56:05 -05:00
en_tx.c net/mlx4_en: Fixing TX queue stop/wake flow 2012-08-03 16:49:02 -07:00
eq.c IB/mlx4: Miscellaneous adjustments for SR-IOV IB support 2012-09-30 20:33:41 -07:00
fw.c mlx4_core: Trivial readability fix: "0X30" -> "0x30" 2012-09-30 20:33:45 -07:00
fw.h mlx4: Modify proxy/tunnel QP mechanism so that guests do no calculations 2012-09-30 20:33:43 -07:00
icm.c mlx4_core: Fix integer overflows so 8TBs of memory registration works 2012-09-13 17:52:02 -07:00
icm.h mlx4_core: Fix integer overflows so 8TBs of memory registration works 2012-09-13 17:52:02 -07:00
intf.c mlx4: Use port management change event instead of smp_snoop 2012-07-10 09:47:10 -07:00
main.c mlx4_core: Fix crash on uninitialized priv->cmd.slave_sem 2012-09-30 20:33:46 -07:00
mcg.c net/mlx4_core: Looking for promiscuous entries on the correct port 2012-09-07 12:55:59 -04:00
mlx4.h mlx4_core: Fix crash on uninitialized priv->cmd.slave_sem 2012-09-30 20:33:46 -07:00
mlx4_en.h net/mlx4_en: Fixing TX queue stop/wake flow 2012-08-03 16:49:02 -07:00
mr.c mlx4_core: Clean up buddy bitmap allocation 2012-08-15 21:05:27 -07:00
pd.c net/mlx4_core: Add XRC domains and counters to resource tracker 2012-05-16 00:56:59 -04:00
port.c net/mlx4_core: Adjustments to SET_PORT for IB SR-IOV 2012-09-30 20:33:40 -07:00
profile.c mlx4_core: Fix integer overflow issues around MTT table 2012-08-15 21:05:26 -07:00
qp.c mlx4: Modify proxy/tunnel QP mechanism so that guests do no calculations 2012-09-30 20:33:43 -07:00
reset.c
resource_tracker.c mlx4: Implement QP paravirtualization and maintain phys_pkey_cache for smp_snoop 2012-09-30 20:33:33 -07:00
sense.c net/mlx4_core: Remove port type restrictions 2012-08-03 16:49:40 -07:00
srq.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00