]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
10 years agomlx4_vnic: always remove child macs in vnic_parent_update remove request
Saeed Mahameed [Wed, 27 Nov 2013 13:50:11 +0000 (15:50 +0200)]
mlx4_vnic: always remove child macs in vnic_parent_update remove request

Child macs are not removed in host admin vnics once the connection
is lost with BX. This caused a loss of connectivity for child vnics
in case of connection restored with the BX, since the BX is not
aware of the old child macs.

Solution is to always remove child macs when vnic_paren_update is
called with remove request.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_vnic: set default moderation values in vnic_alloc_netdev
Saeed Mahameed [Wed, 27 Nov 2013 09:55:07 +0000 (11:55 +0200)]
mlx4_vnic: set default moderation values in vnic_alloc_netdev

vnic_set_default_moder was called from _vnic_open, which caused
to reset all current moderation values to the default every time
the user opens/closes the vnic interface.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4: Handle memory region deregistration failure
Shani Michaeli [Sun, 3 Jun 2012 12:48:32 +0000 (15:48 +0300)]
mlx4: Handle memory region deregistration failure

Memory region deregistration can fail when memory windows
are bound to it. We handle such failures by propagating them
to the user, or by printing a serious warning.

Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Shani Michaeli <shanim@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib_core: More fixes to ib_sa_add_one error flow
Jack Morgenstein [Thu, 14 Nov 2013 15:35:06 +0000 (17:35 +0200)]
ib_core: More fixes to ib_sa_add_one error flow

commit 0e7377eed fixed a resource leak of mad agents in
the ib_sa_add_one error flow.  However, the fix allowed
ib_mad_unregister_agent to be called in a case where the
ib_mad_register_agent request failed (resulting in an
illegal pointer in the agent field).  This caused a kernel
Oops in the error flow.

Fix this by calling ib_unregister_mad_agent only for cases where
ib_register_mad_agent succeeded.

In addition, separate the ib_register_event_handler() call error
flow from the loop error flow. If the call to
ib_register_event_handler fails, the client data must be reset
to NULL, (in case at some point ib_register_event_handler() is
modified so that it may return a non-zero (error) value).

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoIB/ipoib: Set mode only when needed.
Erez Shitrit [Wed, 6 Nov 2013 16:23:48 +0000 (18:23 +0200)]
IB/ipoib: Set mode only when needed.

Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: Use div_u64 to avoid unresolved symbol on 32-bit OSes
Vladimir Sokolovsky [Sun, 27 Oct 2013 12:03:59 +0000 (14:03 +0200)]
mlx4_core: Use div_u64 to avoid unresolved symbol on 32-bit OSes

E.g.: On Xenserver6.1/2:
WARNING: "__udivdi3" [<path>/drivers/net/ethernet/mellanox/mlx4/mlx4_core.ko] undefined!

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib_core: Safely unregister mad agent when necessary.
Majd Dibbiny [Mon, 19 Aug 2013 15:19:23 +0000 (18:19 +0300)]
ib_core: Safely unregister mad agent when necessary.

When the allocation of the receive buffer fails the driver
needs to unregister the mad agent. The function
ib_unregister_mad_agent doesn't check if the pointer of the
mad agent is valid and doesn't contain an error and causes a
Kernel Panic. Therefore, we need to check if the pointer of
the mad agent is valid by calling PTR_ERR and only then
unregister the agent.

Signed-off-by: Majd Dibbiny <majd@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_vnic: use netif_set_real_num_tx_queues to dynamically change tx queue size
Saeed Mahameed [Mon, 30 Sep 2013 11:26:54 +0000 (13:26 +0200)]
mlx4_vnic: use netif_set_real_num_tx_queues to dynamically change tx queue size

When network admin vnics are created the network device is
already registered and it is not allowed to change
dev->real_num_tx_queues directly.

This fixes a bug where the unload of mlx4_vnic hangs with
the following error message: waiting for eth442 to become
free. Usage count = 16

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: Extend num_mtt in dev caps to avoid overflow.
Majd Dibbiny [Tue, 27 Aug 2013 11:07:36 +0000 (14:07 +0300)]
mlx4_core: Extend num_mtt in dev caps to avoid overflow.

Some legitimate combinations of log_num_mtt and log_mtts_per_seg
cause overflow in the calculation of the num_mtt when initializing
the HCA which causes Kernel panic. Changed the variable to be 'u64'
instead of 'int' to avoid the overflow and made the needed changes
to support the new type.

Signed-off-by: Majd Dibbiny <majd@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: fix FMR unmapping to allow remapping afterward
Moshe Lazer [Sun, 8 Sep 2013 06:59:09 +0000 (08:59 +0200)]
mlx4_core: fix FMR unmapping to allow remapping afterward

The FMR common use flow (as implemented in fmr_pool) is:
 - Allocate FMR (ib_alloc_fmr)
 - Use the FMR to remap DMA memory until remaps limit
   exceeded (ib_map_phys_fmr)
 - Unmap the FMR (ib_unmap_fmr)
 - Use the FMR to remap DMA memory until remaps limit
   exceeded (ib_map_phys_fmr)
 - ...

The current implementation of mlx4_fmr_unmap is not following
this use flow since it is using the HW2SW MPT command.
The HW2SW MPT command notifies the FW that the MPT entry is
not used by HW anymore. The FW may act according to this information,
therefore it is not safe for the driver to manipulate the MPT
directly.  The patch fixes this by manipulating the MPT directly
to unmap the memory instead of using the HW2SW MPT command.

Signed-off-by: Moshe Lazer <moshel@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/ipoib: unlock dev_start_xmit() on ipoib_cm_rep_handler()
Tal Alon [Sun, 14 Jul 2013 07:40:17 +0000 (10:40 +0300)]
ib/ipoib: unlock dev_start_xmit() on ipoib_cm_rep_handler()

Signed-off-by: Tal Alon <talal@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib_core: fixed resource leak in case of error
Saeed Mahameed [Sun, 23 Jun 2013 16:26:50 +0000 (19:26 +0300)]
ib_core: fixed resource leak in case of error

Fixed off-by-one bug, we need to decrement the port number only after
we released the resources to the current port.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/ipoib: fix illegal locking on ipoib_cm_rep_handler
Tal Alon [Mon, 8 Jul 2013 08:48:44 +0000 (11:48 +0300)]
ib/ipoib: fix illegal locking on ipoib_cm_rep_handler

Signed-off-by: Tal Alon <talal@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/ipoib: ipoib_cm_rep_handler lock skb queue while dequeue before xmit
Tal Alon [Wed, 26 Jun 2013 08:12:51 +0000 (11:12 +0300)]
ib/ipoib: ipoib_cm_rep_handler lock skb queue while dequeue before xmit

Signed-off-by: Tal Alon <talal@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: resolvs kernel panic when connectx_port_config fail to set ports
Moshe Lazer [Sun, 16 Jun 2013 08:04:17 +0000 (11:04 +0300)]
mlx4_core: resolvs kernel panic when connectx_port_config fail to set ports

When changing ports configutation (e.g. from ib,ib to eth,eth)
the device is disconnected from interfaces and catas error lists
than we change ports config and reconnecting the device.
In case ports config changing fails the device left disconnected.
If we try again to configure the ports the driver retry to
disconnect the device form its lists and crashes in list_del
function.  To aviod this the list_del replaced by list_del_init
(to allow redeleting the device).

Signed-off-by: Moshe Lazer <moshel@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: Avoid setting ports for auto when only one port type is supported
Moshe Lazer [Sun, 28 Apr 2013 14:19:17 +0000 (17:19 +0300)]
mlx4_core: Avoid setting ports for auto when only one port type is supported

When only one port type is supported driver should reject requests
to change mode to auto sense.

Signed-off-by: Moshe Lazer <moshel@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: sysfs, fix usage of log_num_mtt module parameter
Yishai Hadas [Mon, 22 Apr 2013 11:36:43 +0000 (14:36 +0300)]
mlx4_core: sysfs, fix usage of log_num_mtt module parameter

When was auto calculated based on RAM size it wrongly includes
also log_mtts_per_seg.

It's wrong in 2 ways:
First, log_mtts_per_seg should be added by the application itself,
no reason to a have total in log_num_mtt itself.
Second, in case that an extra  NIC exists it may get an invalid
value as it depends on a larger value.
Specifically, it may cause an overflow and later leads on to
kernel panic via mlx4_buddy_init.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: fix ib_uverbs_get_context flow
Yishai Hadas [Wed, 20 Mar 2013 16:00:02 +0000 (18:00 +0200)]
mlx4_core: fix ib_uverbs_get_context flow

Fix flow to prevent kernel panic in case of a failure in copy_to_user.

INIT_IB_EVENT_HANDLER must be called to initialize the event handler
list before releasing filp as part of fput.
Otherwise will get a kernel panic at ib_unregister_event_handler
when calling list_del.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: Fix Coverity issues.
Hadar Hen Zion [Mon, 4 Mar 2013 11:54:27 +0000 (13:54 +0200)]
mlx4_core: Fix Coverity issues.

Signed-off-by: Itai Garbi <igarbi@mellanox.com>
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoIB/mlx4: Fix Coverity issues
Hadar Hen Zion [Mon, 4 Mar 2013 11:53:37 +0000 (13:53 +0200)]
IB/mlx4: Fix Coverity issues

Signed-off-by: Itai Garbi <igarbi@mellanox.com>
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoIB/core: Fix Coverity issues for rdma_cm
Hadar Hen Zion [Mon, 4 Mar 2013 11:48:55 +0000 (13:48 +0200)]
IB/core: Fix Coverity issues for rdma_cm

Signed-off-by: Itai Garbi <igarbi@mellanox.com>
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Derived from(subset of!) Mellanox OFED-2.4 patch
84c6d50a470b4b61ca6b2ed1c718b121870daa37
(IB/core: Fix Coverity issues)

Signed-off-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoRelease Date is updated to __DATE__ instead of a static string
Alex Markuze [Mon, 4 Mar 2013 14:05:23 +0000 (16:05 +0200)]
Release Date is updated to __DATE__ instead of a static string

Signed-off-by: Alex Markuze <markuze@mellanox.com>
(Ported from Mellanox OFED 2.4)
Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: use msi_x module param to limit num of MSI-X irqs
Moshe Lazer [Tue, 5 Mar 2013 12:08:47 +0000 (14:08 +0200)]
mlx4_core: use msi_x module param to limit num of MSI-X irqs

The msi_x module param usage is:
0 - don't use MSI-X
1 - use MSI-X (driver decide the num of MSI-X irqs)
>1 - limit number of MSI-X irqs to msi_x
In case of SRIOV the msi_x>1 treated as msi_x==1

Signed-off-by: Moshe Lazer <moshel@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoSeting ring size to default when module param set incorrectly
Alex Markuze [Tue, 5 Mar 2013 12:22:53 +0000 (14:22 +0200)]
Seting ring size to default when module param set incorrectly

Signed-off-by: Alex Markuze <markuze@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/core: change error prints in cm module to debug prints.
Jack Morgenstein [Mon, 25 Feb 2013 12:04:18 +0000 (14:04 +0200)]
ib/core: change error prints in cm module to debug prints.

commit acd10b49 added prints to the cm module.
These, however, should really be debug prints, to be activated
when it is necessary to track down some cm problem.

To activate the debug mechanism, you need to do the following:
1. mount the debug fs (do this once)
   mount -t debugfs none /sys/kernel/debug/

2. activate debug output for ib_cm:
   echo -n "module ib_cm +p" > /sys/kernel/debug/dynamic_debug/control

3. To de-activate debug output when you are done, do the following
   echo -n "module ib_cm -p" > /sys/kernel/debug/dynamic_debug/control

You will see the debug output in dmesg.

This change was suggested by Moni Shoua (monis@mellanox.com)

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: Add more info to mlx4_cmd_post failure error messages
Jack Morgenstein [Thu, 19 Mar 2015 01:20:31 +0000 (18:20 -0700)]
mlx4_core: Add more info to mlx4_cmd_post failure error messages

To assist in debugging and support, add additional information
to output generated when fail to post a FW command. In addition,
add in_param, in_modifier, and op_modifier values to output
when commands are successfully posted but time out.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: disable mlx4_QP_ATTACH calls from guests if master is doing flow steering.
Jack Morgenstein [Wed, 20 Feb 2013 14:43:59 +0000 (16:43 +0200)]
mlx4_core: disable mlx4_QP_ATTACH calls from guests if master is doing flow steering.

Old upstream kernel guests do not detect if device-enabled flow
steering is activated by the master. If DMFS is activated,
the master should return error to guests which try to use
the B0-steering flow calls (mlx4_QP_ATTACH).

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: change resource quotas to enable supporting upstream-kernel guests
Jack Morgenstein [Mon, 18 Feb 2013 10:34:59 +0000 (12:34 +0200)]
mlx4_core: change resource quotas to enable supporting upstream-kernel guests

The resource-quota code passed non-power-of-2 quotas to guests.
In the upstream kernel (bugs), resource quotas for MPTs and QPs
are assumed to be powers-of-2. In MPT case, mlx4_init_mr_table
checks for num_mpts being a power-of-2 before checking if it
is running as a slave.

In the QP case, procedure mlx4_qp_alloc() assumes that
(num_qps - 1) is a power-of-2 when calling radix_tree_insert()
and radix_tree_delete().

In the MPT case, mlx4_init_mr_table() failed on the guest,
causing abort of the guest driver bringup.

In the QP case, although create-qp succeeded on the
hypervisor, the radix_tree_insert() call failed, resulting
in failure to create QPs with certain qp numbers.

The fix, for both cases, is to round-up the quota to the
next power-of-2 for guests for MPTs and QPs.  This does no
harm, as these two resources were not really meant to be
limited by an upper quota.  The guaranteed resources for QPs
and MPTs per VF/PF are not affected by this change.
The only effect is that no guest will ever be able to
actually reach its max-quota for QPs and MPTs.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: device revision support
Yishai Hadas [Tue, 12 Feb 2013 13:53:46 +0000 (15:53 +0200)]
mlx4_core: device revision support

The device revision field returned by the NodeInfo MAD
is incorrect on ConnectX3 devices.

This patch is driver side handling to complete a FW fix
added at 2.11.1172. INIT_HCA - bit at offset 0x0C.12 is
set to 1 so that FW will report correct device revision.

Older FW versions won't be affected from turning on that bit,
no capability bit is needed.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: print more info when command times out
Jack Morgenstein [Mon, 11 Feb 2013 16:44:14 +0000 (18:44 +0200)]
mlx4_core: print more info when command times out

To assist in diagnosing command timeouts, print the
go-bit status and toggle-bit status in the warning
output.

In addition, print an indication of the pci_bus is offline.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: move out label to the right place
Eugenia Emantayev [Wed, 6 Feb 2013 14:26:56 +0000 (16:26 +0200)]
mlx4_core: move out label to the right place

Add new steering entry for good flow only.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoIB/mlx4: deprecate "failed to alloc bf reg" message from err to debug
Jack Morgenstein [Wed, 30 Jan 2013 08:55:09 +0000 (10:55 +0200)]
IB/mlx4: deprecate "failed to alloc bf reg" message from err to debug

This message is not an error, and qp creation continues
normally -- only without use of blueflame.

For VFs attached to VMs, KVM disables write combining, so
performance is better without BF in this case.  The host driver
therefore intentionally disables BF use for guests. (see upstream
kernel commit b91cb3ebcd).

The message notifying that BF is not available is therefore
deprecated from err to debug.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: Do not allow mlx4_bitmap_init to reserve more slots than available
Amir Vadai [Thu, 4 Aug 2011 12:42:09 +0000 (15:42 +0300)]
mlx4_core: Do not allow mlx4_bitmap_init to reserve more slots than available

Caused a kernel crash when log_num_mac was too big

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/ipoib: Fix deadlock between rmmod and set_mode
Erez Shitrit [Tue, 29 Jan 2013 15:00:49 +0000 (17:00 +0200)]
ib/ipoib: Fix deadlock between rmmod and set_mode

set_mod called from sys/fs, takes sys/fs lock and tries to
take rtnl_lock, rmmod takes rtnl_lock and now tries to take
sys/fs lock, that causes deadlock.
deadloc a->b, b->a

The problem starts when ipoib_set_mod free it's rtnl_lck and
tries to get it after that.

set_mod:

[<ffffffff8104f2bd>] ? check_preempt_curr+0x6d/0x90
[<ffffffff814fee8e>] __mutex_lock_slowpath+0x13e/0x180
[<ffffffff81448655>] ? __rtnl_unlock+0x15/0x20
[<ffffffff814fed2b>] mutex_lock+0x2b/0x50
[<ffffffff81448675>] rtnl_lock+0x15/0x20
[<ffffffffa02ad807>] ipoib_set_mode+0x97/0x160 [ib_ipoib]
[<ffffffffa02b5f5b>] set_mode+0x3b/0x80 [ib_ipoib]
[<ffffffff8134b840>] dev_attr_store+0x20/0x30
[<ffffffff811f0fe5>] sysfs_write_file+0xe5/0x170
[<ffffffff8117b068>] vfs_write+0xb8/0x1a0
[<ffffffff8117ba81>] sys_write+0x51/0x90
[<ffffffff8100b0f2>] system_call_fastpath+0x16/0x1b
INFO: task rmmod:8057 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.

rmmod:
[<ffffffff81279ffc>] ? put_dec+0x10c/0x110
[<ffffffff8127a2ee>] ? number+0x2ee/0x320
[<ffffffff814fe6a5>] schedule_timeout+0x215/0x2e0
[<ffffffff8127cc04>] ? vsnprintf+0x484/0x5f0
[<ffffffff8127b550>] ? string+0x40/0x100
[<ffffffff814fe323>] wait_for_common+0x123/0x180
[<ffffffff81060250>] ? default_wake_function+0x0/0x20
[<ffffffff8119661e>] ? ifind_fast+0x5e/0xb0
[<ffffffff814fe43d>] wait_for_completion+0x1d/0x20
[<ffffffff811f2e68>] sysfs_addrm_finish+0x228/0x270
[<ffffffff811f2fb3>] sysfs_remove_dir+0xa3/0xf0
[<ffffffff81273f66>] kobject_del+0x16/0x40
[<ffffffff8134cd14>] device_del+0x184/0x1e0
[<ffffffff8144e59b>] netdev_unregister_kobject+0xab/0xc0
[<ffffffff8143c05e>] rollback_registered+0xae/0x130
[<ffffffff8143c102>] unregister_netdevice+0x22/0x70
[<ffffffff8143c16e>] unregister_netdev+0x1e/0x30
[<ffffffffa02a91b0>] ipoib_remove_one+0xe0/0x120 [ib_ipoib]
[<ffffffffa01ed95f>] ib_unregister_device+0x4f/0x100 [ib_core]
[<ffffffffa021f5e1>] mlx4_ib_remove+0x41/0x180 [mlx4_ib]
[<ffffffffa01ab771>] mlx4_remove_device+0x71/0x90 [mlx4_core]
[<ffffffffa01ab863>] mlx4_unregister_interface+0x43/0x80 [mlx4_core]
[<ffffffffa02324f3>] __exit_compat+0x15/0x4e [mlx4_ib]
[<ffffffff810addd4>] sys_delete_module+0x194/0x260
[<ffffffff8150326e>] ? do_page_fault+0x3e/0xa0
[<ffffffff8100b0f2>] system_call_fastpath+0x16/0x1b
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/ipoib: getout whenever failed to load port.
Erez Shitrit [Mon, 28 Jan 2013 14:43:06 +0000 (16:43 +0200)]
ib/ipoib: getout whenever failed to load port.

whenever add_one failed to load one of the port, call remove one
after that, otherwise it ends with panic, (many resources are
for all the ports and some actions will be aken over both of them
without considering that one of them failed to load)

Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib_ipoib: Fixing issue with delayed work running after child is killed.
Erez Shitrit [Sun, 27 Jan 2013 10:03:59 +0000 (12:03 +0200)]
ib_ipoib: Fixing issue with delayed work running after child is killed.

This patch addresses a common issues in the ipoib driver.
it has the following form:

        Flow 1:
            1)    if (!test_bit(IPOIB_STOP_NEIGH_GC, &priv->flags))
                     2)  queue_delayed_work(ipoib_workqueue, &priv->neigh_reap_task,
                                                            arp_tbl.gc_interval);
        Flow 2:
              3)   set_bit(IPOIB_STOP_NEIGH_GC, &priv->flags);
              4)   cancel_delayed_work(&priv->neigh_reap_task);

The Linux Kernel (Unlike the ESX Kernel ) is preemptable, which
means that the this sequence of actions is feasible.
        1 flow 1
        3 flow 2
        4 flow 2
        2 flow 1
Now the effect of this sequence is that line #4 has no defacto effect.
The work will be rescheduled and will run once again and only then
will see that the bit value has changed.
In the IPoIB driver this is benign because after each
"set and cancel" sequence, flush is called which waits until the
second run ends.  This is not the case with the neigh_reap_task
which does cancel without flush.

took from 1.5.3 : b7abd8b0b071f0422b0c1018804033ee1b542eca
by Alex Markuze

Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: set device to use extended counters
Yishai Hadas [Mon, 24 Dec 2012 11:22:54 +0000 (13:22 +0200)]
mlx4_core: set device to use extended counters

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-on: http://r-webdev02.lab.mtl.com:8080/479
Tested-by: Redmine Issue
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.com>
Mini-Regression: Yevgeny Petrilin <yevgenyp@mellanox.com>
Reviewed-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/ipoib: debug prints instead of warn in tx_wc function
Erez Shitrit [Wed, 14 Nov 2012 13:06:03 +0000 (15:06 +0200)]
ib/ipoib: debug prints instead of warn in tx_wc function

In IB_WC_RNR_RETRY_EXC_ERR status print debug message else
print error message. IB_WC_RNR_RETRY_EXC_ERR is part of the
CM life cycle.

Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/ipoib: add detailed error message on dev_queue_xmit
Erez Shitrit [Thu, 29 Nov 2012 11:06:37 +0000 (13:06 +0200)]
ib/ipoib: add detailed error message on dev_queue_xmit

whenever calling to requeue packet via __skb_dequeue, add the return
code from the dev_queue_xmit function.

Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/ipoib: Fix removing call for update_pmtu from spin-lock context.
Erez Shitrit [Thu, 29 Nov 2012 07:27:46 +0000 (09:27 +0200)]
ib/ipoib: Fix removing call for update_pmtu from spin-lock context.

    The function ipoib_cm_send can call the function
    ipoib_cm_skb_too_long under spin_lock_irq, the
    ipoib_cm_skb_too_long function calls update_pmtu which also
    tries to get spin_lock, that can cause to a deadlock.
    In order to solve that I took update_pmtu to workqueue that
    it is not under spin_lock.

V2: Adjusted for kernel 3.7-rc4

Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoipoib: fixed NULL dereferencing in case of error flow
Dotan Barak [Tue, 12 Jun 2012 08:01:41 +0000 (11:01 +0300)]
ipoib: fixed NULL dereferencing in case of error flow

In case of failure, result will be equal to zero, which may
lead to NULL dereferencing and having the following kernel panic:

BUG: unable to handle kernel paging request at 00000000000010e8
IP: [<ffffffff8127b814>] __list_add+0x34/0xa0
PGD 116536067 PUD 11bc42067 PMD 0
Oops: 0002 [#1] SMP
last sysfs file: /sys/devices/pci0000:00/0000:00:07.0/infiniband/mlx4_0/node_desc
CPU 1
Modules linked in: ib_ipoib(+)(U) rdma_ucm(U) ib_ucm(U) rdma_cm(U) iw_cm(U) ib_addr(U) ib_cm(U) ib_uverbs(U) ib_umad(U) mlx4_ib(U) ib_sa(U) ib_mad(U) ib_core(U) mlx4_en(U) mlx4_core(U) netconsole configfs nfs fscache nfsd lockd nfs_acl auth_rpcgss exportfs autofs4 sunrpc ipv6 knem(U) microcode virtio_balloon memtrack(U) virtio_net snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore snd_page_alloc i2c_piix4 i2c_core ext3 jbd mbcache virtio_blk virtio_pci virtio_ring virtio pata_acpi ata_generic ata_piix dm_mirror dm_region_hash dm_log dm_mod [last unloaded: ib_ipoib]

Pid: 2387, comm: insmod Not tainted 2.6.32-220.el6.x86_64 #1 Red Hat KVM
RIP: 0010:[<ffffffff8127b814>]  [<ffffffff8127b814>] __list_add+0x34/0xa0
RSP: 0018:ffff88011b409de8  EFLAGS: 00010246
RAX: 0000000000000004 RBX: 00000000000010e8 RCX: ffff88010868e080
RDX: ffff8801192d9e00 RSI: ffff8801192d9e00 RDI: 00000000000010e8
RBP: ffff88011b409e08 R08: ffff8801192d9e00 R09: 0a64656c69616620
R10: 0000000000000002 R11: 0000000000000000 R12: ffff8801192d9e00
R13: ffff8801192d9e00 R14: ffff88010868e6e0 R15: ffff8801192d9e00
FS:  00007f498bf4f700(0000) GS:ffff880028300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00000000000010e8 CR3: 000000011896f000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process insmod (pid: 2387, threadinfo ffff88011b408000, task ffff88010a4ccb40)
Stack:
 0000000000000001 ffff880118990000 0000000000000002 0000000000000000
<0> ffff88011b409eb8 ffffffffa0410daa ffffffffa041cf20 00000000000005e4
<0> ffff8801000000d0 ffffffffa04201c0 ffff88011fc00040 ffff880118990008
Call Trace:
 [<ffffffffa0410daa>] ipoib_add_one+0x1ea/0x350 [ib_ipoib]
 [<ffffffffa03894bd>] ib_register_client+0x7d/0xa0 [ib_core]
 [<ffffffffa0425200>] ipoib_init_module+0x200/0x296 [ib_ipoib]
 [<ffffffffa0425000>] ? ipoib_init_module+0x0/0x296 [ib_ipoib]
 [<ffffffff8100204c>] do_one_initcall+0x3c/0x1d0
 [<ffffffff810af641>] sys_init_module+0xe1/0x250
 [<ffffffff8100b0f2>] system_call_fastpath+0x16/0x1b
Code: 89 5d e8 4c 89 65 f0 48 89 fb 4c 89 6d f8 4c 8b 42 08 49 89 f5 49 89 d4 49 39 f0 75 27 4d 8b 45 00 4d 39 c4 75 40 49 89 5c 24 08 <4c> 89 23 4c 89 6b 08 4c 8b 65 f0 49 89 5d 00 48 8b 5d e8 4c 8b
RIP  [<ffffffff8127b814>] __list_add+0x34/0xa0
 RSP <ffff88011b409de8>
CR2: 00000000000010e8
---[ end trace 2c7c92f924933cec ]---
Kernel panic - not syncing: Fatal exception
Pid: 2387, comm: insmod Tainted: G      D    ----------------   2.6.32-220.el6.x86_64 #1
Call Trace:
 [<ffffffff814ec341>] ? panic+0x78/0x143
 [<ffffffff814f04d4>] ? oops_end+0xe4/0x100
 [<ffffffff8104230b>] ? no_context+0xfb/0x260
 [<ffffffff81042595>] ? __bad_area_nosemaphore+0x125/0x1e0
 [<ffffffff81272b1c>] ? put_dec+0x10c/0x110
 [<ffffffff810426be>] ? bad_area+0x4e/0x60
 [<ffffffff81042dc3>] ? __do_page_fault+0x3c3/0x480
 [<ffffffffa0044e59>] ? memtrack_free+0x119/0x270 [memtrack]
 [<ffffffff81275306>] ? vsnprintf+0x2b6/0x5f0
 [<ffffffff8109694f>] ? up+0x2f/0x50
 [<ffffffffa0044e59>] ? memtrack_free+0x119/0x270 [memtrack]
 [<ffffffff814f248e>] ? do_page_fault+0x3e/0xa0
 [<ffffffff814ef845>] ? page_fault+0x25/0x30
 [<ffffffff8127b814>] ? __list_add+0x34/0xa0
 [<ffffffffa0410daa>] ? ipoib_add_one+0x1ea/0x350 [ib_ipoib]
 [<ffffffffa03894bd>] ? ib_register_client+0x7d/0xa0 [ib_core]
 [<ffffffffa0425200>] ? ipoib_init_module+0x200/0x296 [ib_ipoib]
 [<ffffffffa0425000>] ? ipoib_init_module+0x0/0x296 [ib_ipoib]
 [<ffffffff8100204c>] ? do_one_initcall+0x3c/0x1d0
 [<ffffffff810af641>] ? sys_init_module+0xe1/0x250
 [<ffffffff8100b0f2>] ? system_call_fastpath+0x16/0x1b

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Erez Shitrit <erezsh@mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: Update minimum size for log_num_qp to 18
Moshe Lazer [Sun, 4 Nov 2012 07:08:46 +0000 (09:08 +0200)]
mlx4_core: Update minimum size for log_num_qp to 18

The minimum number of QPs must exceed the number of
reserved QPs. The reserved QPs can be divided to 2 categories
reserved_from_bot and reserved_from_top.

reserved_from_bot is normally less than 2K QPs and can't
exceed 2^16 QPs.

reserved_from_top is the sum of reserved QPs for REGION_ETH_ADDR,
REGION_FC_ADDR and REGION_FC_EXCH.

reserved QPs for REGION_FC_EXCH is 2^16 and for REGION_FC_ADDR and
REGION_ETH_ADDR it can't exceed 2^15.

Therefore:
reserved_from_top <= 2^16 + 2*(2^15) = 2^17
Reserved QPs = reserved_from_bot + reserved_from_top
                                             <= 2^16 + 2^17 < 2^18

To make it simpler I set the minimum qp number to 2^18 even
though 2^17 is acceptable when log_num_mac module parameter
is set to 6 (or lower).

Signed-off-by: Moshe Lazer <moshel@mellanox.co.il>
Reviewed-by: Eli Cohen <eli@mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core, mlx4_ib: Have enough room in steering range for pkey interfaces
Amir Vadai [Tue, 16 Oct 2012 09:25:33 +0000 (11:25 +0200)]
mlx4_core, mlx4_ib: Have enough room in steering range for pkey interfaces

Needed to enlarge default qp bitmap size to have room for such
a big QP numbers block.

Signed-off-by: Amir Vadai <amirv@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agonet/mlx4: return bad error status to caller function in case of error
Dotan Barak [Sun, 14 Oct 2012 07:52:12 +0000 (09:52 +0200)]
net/mlx4: return bad error status to caller function in case of error

Not doing this, may cause kernel oops in flows that comes later.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/core: Remove annoying message.
Erez Shitrit [Thu, 20 Sep 2012 06:25:36 +0000 (09:25 +0300)]
ib/core: Remove annoying message.

Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_ib: fix memory leak if QP creation failed
Dotan Barak [Tue, 4 Sep 2012 06:29:24 +0000 (09:29 +0300)]
mlx4_ib: fix memory leak if QP creation failed

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib/core: add prints to the cm module.
Erez Shitrit [Tue, 28 Aug 2012 07:33:05 +0000 (10:33 +0300)]
ib/core: add prints to the cm module.

control flows, on errors/unexpected events.

V2: replaced printk(KERN_ERR with pr_err()

Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4/IB: add a message print when the logical link goes up/down
Dotan Barak [Wed, 22 Aug 2012 07:37:33 +0000 (10:37 +0300)]
mlx4/IB: add a message print when the logical link goes up/down

This message will help us in debugging issues.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4/ib: clean memory for EQs in case of error flow
Dotan Barak [Tue, 21 Aug 2012 15:46:39 +0000 (18:46 +0300)]
mlx4/ib: clean memory for EQs in case of error flow

This will prevent memory leak.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Shlomo Pongratz <shlomop@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agonet/mlx4_core: set used number of MTTs when using auto-detection
Dotan Barak [Tue, 21 Aug 2012 09:11:31 +0000 (12:11 +0300)]
net/mlx4_core: set used number of MTTs when using auto-detection

Issue 31158.

If we set the number of MTTs automatically by the driver (default
value or auto-detection, by the memory size in the machine), need
to set the used value of the MTTs, so the user will see this value.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agonet/mlx4_core: the number of MTTs should consider log_mtts_per_seg
Dotan Barak [Tue, 21 Aug 2012 08:56:46 +0000 (11:56 +0300)]
net/mlx4_core: the number of MTTs should consider log_mtts_per_seg

No matter how we decided how many MTTs will be used (calculation
from system memory or using default value), we need to consider
the number of MTTs per segment.

This will allow the user to specify how many MTTs will be used
(with log_num_mtt) and how many MTTs will be used per segment
(using log_mtts_per_seg).

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agonet/mlx4_core: limit to 4TB of memory registration
Yishai Hadas [Mon, 19 Nov 2012 18:17:33 +0000 (20:17 +0200)]
net/mlx4_core: limit to 4TB of memory registration

we have a limit of log_num_mtt to 30 -> 4TB mapping.
limit comes from bit map operations which work with int.

V2: removed the change in file icm.c, as the fix was already
upstream.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agonet/mlx4_core: num mtt issues
Yishai Hadas [Mon, 19 Nov 2012 13:59:08 +0000 (15:59 +0200)]
net/mlx4_core: num mtt issues

consider num mtts per segment
use vmalloc only when kmalloc fails

V2: adjusted for kernel 3.7-rc4
use vmalloc only when kmalloc fails -- already in kernel:
see commit 89dd86db7 --mlx4_core: Allow large mlx4_buddy bitmaps

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_vnic: Kconfig and Makefile changes
Qing Huang [Thu, 13 Jun 2013 22:44:57 +0000 (15:44 -0700)]
mlx4_vnic: Kconfig and Makefile changes

Also fixed a potential uninitialized pointer problem in the vnic
driver when the MLX4_VNIC_DEBUG option is selected.

Signed-off-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Signed-off-by: Qing Huang <qing.huang@oracle.com>
10 years agomlx4_vnic: add mlx4_vnic
Saeed Mahameed [Wed, 17 Apr 2013 20:21:12 +0000 (23:21 +0300)]
mlx4_vnic: add mlx4_vnic

Add mlx4_vnic code

Also squash following porting commmits for compilation
of the integrated commit (without squashing they wont compile)

mlx4_vnic: adapt vnic to ofed2 mlx4 implementation
mlx4_vnic: align with OFED2 upstream 3.7 kernel
mlx4_vnic: Fix reference path to hw/mlx4 header files
mlx4_vnic: remove mlx4_vnic_helper module
mlx4_vnic: use ib_modify_cq() in upstream kernel
        We modify code to use ib_modify_cq() in upstream kernel
        (and not use a modified Mellanox version)
mlx4_vnic: removed reference to mlx4_ib_qp->rules_list in vnic_qp.c
        Remove field introduced with Mellanox OFED 2.4 flow
        steering patches which are not in upstream kernel.
mlx4_vnic: used an older version of mlx4_qp_reserve_range()
        Use mlx4_qp_reserve_range() aligned with version
        in Linux 3.18 (We can use the new API when it is
        available upstream)
mlx4_vnic: port to Linux 3.18*
        mlx4_vnic code is based on the original port
        of mlx4_vnic in UEK3. Make changes to compile
        on UEK4 (based on Linux 3.18). Use upstream APIs
        -not Mellanox specific ones - where they are in
        conflict and other changes to make it compile
        on Linux 3.18

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Signed-off-by: Qing Huang <qing.huang@oracle.com>
(Ported from UEK3 and Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_ib: add blue flame support for kernel consumers
Eli Cohen [Mon, 19 Nov 2012 11:33:28 +0000 (13:33 +0200)]
mlx4_ib: add blue flame support for kernel consumers

Using blue flame can improve latency by allowing the HW to more
efficiently access the WQE. A consumer who wants to use blue flame,
has to create the QP with inline support. When posting a send WR,
the consumer has to set IB_SEND_INLINE in the send flags. This
approach is similar to that take in userspace; that is, in order
to use blue flame you must use inline. However, if the send WR is
too large for blue flame, it will only use inline.

A kernel consumer that creates a QP with inline support, will be
allocated a UAR and a blue flame register. All QP doorbells will
be set to the UAR and blue flame posts to the blue flame register.
We make use of all available registers in a blue flame page.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agonet/mlx4_core: add sanity check when creating bitmap structure
Dotan Barak [Thu, 12 Jul 2012 08:40:16 +0000 (11:40 +0300)]
net/mlx4_core: add sanity check when creating bitmap structure

If a user tries to allocate bitmap structure with invalid values, this may
cause a kernel panic.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agonet/mlx4_core: unmap clear register in case of error flow
Dotan Barak [Mon, 19 Nov 2012 10:52:44 +0000 (12:52 +0200)]
net/mlx4_core: unmap clear register in case of error flow

Clear interrupt clear register in case of error flows.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoib_core: fix NULL pointer dereference
Dotan Barak [Tue, 12 Jun 2012 10:34:22 +0000 (13:34 +0300)]
ib_core: fix NULL pointer dereference

If there was a failure in the initial fill of the Pkey/GID cache,
and some other ULP/module will try to query a Pkey/GID, the NULL
pointer will be dereferenced, thing that will lead to the
following kernel panic:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
IP: [<ffffffff814ef21f>] _spin_lock_irqsave+0x1f/0x40
PGD 37b49067 PUD becb3067 PMD 0
Oops: 0002 [#1] SMP
last sysfs file: /sys/module/mlx4_core/initstate
CPU 1
Modules linked in: mlx4_ib(+)(U) ib_sa(U) ib_mad(U) ib_core(U) mlx4_en(U) mlx4_core(U) memtrack(U) netconsole configfs nfs fscache nfsd lockd nfs_acl auth_rpcgss exportfs autofs4 sunrpc ipv6 knem(U) microcode virtio_balloon virtio_net snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore snd_page_alloc i2c_piix4 i2c_core ext3 jbd mbcache virtio_blk virtio_pci virtio_ring virtio pata_acpi ata_generic ata_piix dm_mirror dm_region_hash dm_log dm_mod [last unloaded: memtrack]

Pid: 20715, comm: modprobe Not tainted 2.6.32-220.el6.x86_64 #1 Red Hat KVM
RIP: 0010:[<ffffffff814ef21f>]  [<ffffffff814ef21f>] _spin_lock_irqsave+0x1f/0x40
RSP: 0018:ffff8800bc331d08  EFLAGS: 00010002
RAX: 0000000000010000 RBX: ffff8800bec00088 RCX: 0000000000000000
RDX: 0000000000000202 RSI: 0000000000000046 RDI: 0000000000000058
RBP: ffff8800bc331d08 R08: 0000000000000000 R09: ffff88011bde8050
R10: ffff8800bc3317d8 R11: 0000000000000002 R12: ffff8800b9520000
R13: ffff8800bec00000 R14: 0000000000000000 R15: ffff8800bec02c00
FS:  00007f2f07fcd700(0000) GS:ffff880028300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000058 CR3: 00000000bb708000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process modprobe (pid: 20715, threadinfo ffff8800bc330000, task ffff8801185e0b40)
Stack:
 ffff8800bc331d28 ffffffffa0244ee5 ffff8800bec00000 ffff8800b9520000
<0> ffff8800bc331d68 ffffffffa0246f96 0000000000000370 ffffffffa0359560
<0> ffffffffa024fde0 ffff8800b9520000 ffff8800bec00000 ffff8800bcf36080
Call Trace:
 [<ffffffffa0244ee5>] ib_unregister_event_handler+0x25/0x50 [ib_core]
 [<ffffffffa0246f96>] ib_cache_cleanup_one+0x26/0x1b0 [ib_core]
 [<ffffffffa02450ce>] ib_unregister_device+0x4e/0x1a0 [ib_core]
 [<ffffffffa035fee6>] ? mlx4_ib_mad_init+0xa6/0x170 [mlx4_ib]
 [<ffffffffa0366721>] mlx4_ib_add+0x621/0xb80 [mlx4_ib]
 [<ffffffffa0456e73>] mlx4_add_device+0x73/0x1d0 [mlx4_core]
 [<ffffffffa04570db>] mlx4_register_interface+0x7b/0x100 [mlx4_core]
 [<ffffffffa013112a>] mlx4_ib_init+0x12a/0x188 [mlx4_ib]
 [<ffffffffa0131000>] ? mlx4_ib_init+0x0/0x188 [mlx4_ib]
 [<ffffffff8100204c>] do_one_initcall+0x3c/0x1d0
 [<ffffffff810af641>] sys_init_module+0xe1/0x250
 [<ffffffff8100b0f2>] system_call_fastpath+0x16/0x1b
Code: c9 c3 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 0f 1f 44 00 00 9c 58 0f 1f 44 00 00 48 89 c2 fa 66 0f 1f 44 00 00 b8 00 00 01 00 <f0> 0f c1 07 0f b7 c8 c1 e8 10 39 c1 74 0e f3 90 0f 1f 44 00 00
RIP  [<ffffffff814ef21f>] _spin_lock_irqsave+0x1f/0x40
 RSP <ffff8800bc331d08>
CR2: 0000000000000058
---[ end trace 4cc9b3e738027b7c ]---
Kernel panic - not syncing: Fatal exception
Pid: 20715, comm: modprobe Tainted: G      D    ----------------   2.6.32-220.el6.x86_64 #1
Call Trace:
 [<ffffffff814ec341>] ? panic+0x78/0x143
 [<ffffffff814f04d4>] ? oops_end+0xe4/0x100
 [<ffffffff8104230b>] ? no_context+0xfb/0x260
 [<ffffffffa001a62d>] ? start_xmit+0x5d/0x1d0 [virtio_net]
 [<ffffffff81042595>] ? __bad_area_nosemaphore+0x125/0x1e0
 [<ffffffff810426be>] ? bad_area+0x4e/0x60
 [<ffffffff81042dc3>] ? __do_page_fault+0x3c3/0x480
 [<ffffffffa03d737d>] ? write_msg+0xfd/0x110 [netconsole]
 [<ffffffff81069d15>] ? __call_console_drivers+0x75/0x90
 [<ffffffff8109694f>] ? up+0x2f/0x50
 [<ffffffff81069d7a>] ? _call_console_drivers+0x4a/0x80
 [<ffffffff814f248e>] ? do_page_fault+0x3e/0xa0
 [<ffffffff814ef845>] ? page_fault+0x25/0x30
 [<ffffffff814ef21f>] ? _spin_lock_irqsave+0x1f/0x40
 [<ffffffffa0244ee5>] ? ib_unregister_event_handler+0x25/0x50 [ib_core]
 [<ffffffffa0246f96>] ? ib_cache_cleanup_one+0x26/0x1b0 [ib_core]
 [<ffffffffa02450ce>] ? ib_unregister_device+0x4e/0x1a0 [ib_core]
 [<ffffffffa035fee6>] ? mlx4_ib_mad_init+0xa6/0x170 [mlx4_ib]
 [<ffffffffa0366721>] ? mlx4_ib_add+0x621/0xb80 [mlx4_ib]
 [<ffffffffa0456e73>] ? mlx4_add_device+0x73/0x1d0 [mlx4_core]
 [<ffffffffa04570db>] ? mlx4_register_interface+0x7b/0x100 [mlx4_core]
 [<ffffffffa013112a>] ? mlx4_ib_init+0x12a/0x188 [mlx4_ib]
 [<ffffffffa0131000>] ? mlx4_ib_init+0x0/0x188 [mlx4_ib]
 [<ffffffff8100204c>] ? do_one_initcall+0x3c/0x1d0
 [<ffffffff810af641>] ? sys_init_module+0xe1/0x250
 [<ffffffff8100b0f2>] ? system_call_fastpath+0x16/0x1b

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Eli Cohen <eli@mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_ib: contig support for control objects
Yishai Hadas [Mon, 25 Jun 2012 12:31:12 +0000 (15:31 +0300)]
mlx4_ib: contig support for control objects

Reviewer: Shachar Raindel <raindel@mellanox.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: fix wrong comment about the reason of subtract one from the max_cqes
Dotan Barak [Thu, 24 May 2012 09:00:04 +0000 (12:00 +0300)]
mlx4_core: fix wrong comment about the reason of subtract one from the max_cqes

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoIB/core - Don't modify outgoing DR SMP if first part is LID routed
Ralph Campbell [Wed, 17 Oct 2007 20:07:17 +0000 (13:07 -0700)]
IB/core - Don't modify outgoing DR SMP if first part is LID routed

The code in handle_outgoing_dr_smp() checks to see if the directed
route SMP has an initial LID routed part and correctly does not
modify the hop pointer but it then proceeds to process the packet
as if there was no initial LID routed part.  Instead, if there
is an initial LID routed part, the packet should just be sent on
to the destination and not processed further since it can't be
destined for the local SM/SMA.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agonet/mlx4: adjust initial value of vl_cap in mlx4_SET_PORT
Or Gerlitz [Tue, 20 Mar 2012 10:53:51 +0000 (12:53 +0200)]
net/mlx4: adjust initial value of vl_cap in mlx4_SET_PORT

Adjust the initial value of vl_cap in mlx4_SET_PORT such that
only for CX3 devices we start with 8 VLs, in an attempt to
avoid errors such as:

 mlx4_core 0000:06:00.0: command 0xc failed: fw status = 0x40
 mlx4_core 0000:06:00.0: vhcr command:0xc slave:0 failed with error:0, status -12

to appear in the system log.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Aviad Yehezkel <aviadye@mellanox.co.il>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: Error message on mtt allocation failure
Marcel Apfelbaum [Mon, 19 Mar 2012 12:50:08 +0000 (14:50 +0200)]
mlx4_core: Error message on mtt allocation failure

Add error message if mlx4_mtt_init fails to allocate mtts.

Signed-off-by: Marcel Apfelbaum <marcela@dev.mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoIB/core: Control number of retries for SA to leave an MCG
Dotan Barak [Wed, 16 May 2012 07:56:29 +0000 (10:56 +0300)]
IB/core: Control number of retries for SA to leave an MCG

Add a multicast leave maximum retry setting in:
   sys/module/ib_sa/parameters/mcast_leave_retries.
Add a debug print when the maximum retry count is reached.

Signed-off-by: Nir Muchtar <nirm@voltaire.com>
Reviewed-by: Moni Shoua <monis@voltaire.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
Fixup by adding modifications to changed file from following
commit from Mellanox OFED-2.4 to account for kernel API change
so there are no compiler warnings:
19b33d488938e1667bcc16562a2405d632428db0
(core, srp, mlx4_en: Adjustments to patch set which rebased to kernel 3.7)

Signed-off-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4: reducing wait during SW reset for 500 msecs
Dotan Barak [Tue, 15 May 2012 13:40:56 +0000 (16:40 +0300)]
mlx4: reducing wait during SW reset for 500 msecs

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_ib: Do not enable blueflame sends if write combining is not available
Jack Morgenstein [Thu, 15 Nov 2012 16:01:30 +0000 (18:01 +0200)]
mlx4_ib: Do not enable blueflame sends if write combining is not available

V2: adjusted for Or Gerlitz' 64-byte CQE patch

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoIB/core: Fix create_qp issue relates to qp group type
Yishai Hadas [Tue, 22 May 2012 12:36:41 +0000 (15:36 +0300)]
IB/core: Fix create_qp issue relates to qp group type

qpg_type field of ib_qp_init_attr wasn't initialized properly.
Now it's set to IB_QPG_NONE (=0) as part of attr initialization.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: log_num_mtt handling
Yishai Hadas [Thu, 15 Nov 2012 15:47:11 +0000 (17:47 +0200)]
mlx4_core: log_num_mtt handling

Fixed a bug when calculating based on system RAM size
limit of 25 was fixed - was set to 28

V2: adjusted for rebase to kernel 3.7-rc4.
In this kernel, part of the patch appears as commit 89dd86d

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_ib: Fix the SQ size of an RC QP to support masked atomic operation
Dotan Barak [Wed, 11 Apr 2012 09:54:05 +0000 (12:54 +0300)]
mlx4_ib: Fix the SQ size of an RC QP to support masked atomic operation

When calculating the required size of an RC QP send queue,
leave enough space for masked atomic operation (which requires
more space than "regular" atomic operation).

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_ib: Use optimal numbers of MTT entries.
Yishai Hadas [Sun, 15 Apr 2012 14:57:24 +0000 (17:57 +0300)]
mlx4_ib: Use optimal numbers of MTT entries.

Auto recognition of contiguous physical pages.
Reduce number of MTTs in MPT based on contiguous pages.
Considering alignment issues between virtual address
and physical ones.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_ib: set write-combining flag for userspace blueflame pages
Dotan Barak [Mon, 14 May 2012 03:34:53 +0000 (06:34 +0300)]
mlx4_ib: set write-combining flag for userspace blueflame pages

Supported on i386 and x86_64 for now.

V2: Added support for PPC64, cleaned up warnings for unsupported
platforms.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: limit min profile numbers
Dotan Barak [Wed, 2 May 2012 07:13:20 +0000 (10:13 +0300)]
mlx4_core: limit min profile numbers

We can't use arbitrarily low profile numbers for resources since
the device needs some of its own. The best way to do it is to
query the device and then set the minimum values, but the values
chosen here are good enough and do not complicate the implementation.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: allow to use 0 in log_mtts_per_seg
Dotan Barak [Wed, 2 May 2012 07:11:11 +0000 (10:11 +0300)]
mlx4_core: allow to use 0 in log_mtts_per_seg

This allows us to obtain MTTs starting at any index thus
give better cache utilization.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agomlx4_core: enable changing default max HCA resource limits.
Dotan Barak [Thu, 15 Nov 2012 10:53:40 +0000 (12:53 +0200)]
mlx4_core: enable changing default max HCA resource limits.

Enable module-initialization time modification of default HCA
maximum resource limits via module parameters, as is done in
mthca.

Specify the log of the parameter value, rather than the value
itself to avoid the hidden side-effect of rounding up values
to next power-of-2.

For mtt's, there is a heuristic in place to configure twice
the number of MTTs required to cover host memory.  This heuristic
is modified slightly to guarantee a minimum of 2^20 mtt's, and is
used when the user does not set the log_num_mtts module parameter.

If the log_num_mtt's module parameter is set by the user, the
value set for log_num_mtts will be used as-is (instead of the
heuristic).

V2: Adapted for rebase to kernel 3.7-rc4

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agocma: add module parameter to the response timeout
Arlin Davis [Thu, 15 Nov 2012 10:45:26 +0000 (12:45 +0200)]
cma: add module parameter to the response timeout

OFED 1.2 removed the rdma_set_option call used to adjust
response timeout. We are running into some cases on larger
clusters that require longer timeouts then the default.

V2: Adjusted for rebase to kernel 3.7-rc4

Signed-off by: Arlin Davis <ardavis@ichips.intel.com>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
10 years agoLinux 4.1 v4.1 v4.1test
Linus Torvalds [Mon, 22 Jun 2015 05:05:43 +0000 (22:05 -0700)]
Linux 4.1

10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Linus Torvalds [Sun, 21 Jun 2015 00:26:01 +0000 (17:26 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

Pull scsi target fixes from Nicholas Bellinger:
 "Apologies for the late pull request.

  Here are the outstanding target-pending fixes for v4.1 code.

  The series contains three patches from Sagi + Co that address a few
  iser-target issues that have been uncovered during recent testing at
  Mellanox.

  Patch #1 has a v3.16+ stable tag, and #2-3 have v3.10+ stable tags"

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
  iser-target: Fix possible use-after-free
  iser-target: release stale iser connections
  iser-target: Fix variable-length response error completion

10 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Sat, 20 Jun 2015 20:54:22 +0000 (13:54 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "A smattering of fixes,

  mgag200:
      don't accept modes that aren't aligned properly as hw can't do it

  i915:
      two regression fixes

  radeon:
      one query to allow userspace fixes
      one oops fixer for older hw with new options enabled"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/radeon: don't probe MST on hw we don't support it on
  drm/radeon: Add RADEON_INFO_VA_UNMAP_WORKING query
  drm/mgag200: Reject non-character-cell-aligned mode widths
  Revert "drm/i915: Don't skip request retirement if the active list is empty"
  drm/i915: Always reset vma->ggtt_view.pages cache on unbinding

10 years agoMerge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 19 Jun 2015 17:36:50 +0000 (07:36 -1000)]
Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk fixes from Michael Turquette:
 "Very late clk regression fixes for the ARM-based AT91 platform.

  These went unnoticed by me until recently, hence the late pull
  request"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  clk: at91: fix h32mx prototype inclusion in pmc header
  clk: at91: trivial: typo in peripheral clock description
  clk: at91: fix PERIPHERAL_MAX_SHIFT definition
  clk: at91: pll: fix input range validity check

10 years agoMerge tag 'sound-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Linus Torvalds [Fri, 19 Jun 2015 17:34:14 +0000 (07:34 -1000)]
Merge tag 'sound-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Nothing looks scary, just a few usual HD-audio regression fixes and
  fixup, in addition to a minor Kconfig dependency fix for the old MIPS
  drivers"

* tag 'sound-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Fix unused label skip_i915
  ALSA: hda - Fix noisy outputs on Dell XPS13 (2015 model)
  ALSA: mips: let SND_SGI_O2 select SND_PCM
  ALSA: hda - Fix audio crackles on Dell Latitude E7x40
  ALSA: hda - adding a DAC/pin preference map for a HP Envy TS machine

10 years agoMerge branch 'ccf/atmel-fixes-for-4.1' of https://github.com/bbrezillon/linux-at91...
Michael Turquette [Fri, 19 Jun 2015 14:37:14 +0000 (07:37 -0700)]
Merge branch 'ccf/atmel-fixes-for-4.1' of https://github.com/bbrezillon/linux-at91 into clk-fixes

10 years agoclk: at91: fix h32mx prototype inclusion in pmc header
Nicolas Ferre [Thu, 28 May 2015 13:07:21 +0000 (15:07 +0200)]
clk: at91: fix h32mx prototype inclusion in pmc header

Trivial fix that prevents to compile this pmc clock driver if h32mx clock is
present but smd clock isn't.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Fixes: bcc5fd49a0fd ("clk: at91: add a driver for the h32mx clock")
Cc: <stable@vger.kernel.org> # 3.18+
10 years agoclk: at91: trivial: typo in peripheral clock description
Nicolas Ferre [Wed, 17 Jun 2015 13:22:51 +0000 (15:22 +0200)]
clk: at91: trivial: typo in peripheral clock description

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
10 years agoclk: at91: fix PERIPHERAL_MAX_SHIFT definition
Boris Brezillon [Thu, 28 May 2015 12:01:08 +0000 (14:01 +0200)]
clk: at91: fix PERIPHERAL_MAX_SHIFT definition

Fix the PERIPHERAL_MAX_SHIFT definition (3 instead of 4) and adapt the
round_rate and set_rate logic accordingly.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reported-by: "Wu, Songjun" <Songjun.Wu@atmel.com>
10 years agoclk: at91: pll: fix input range validity check
Boris Brezillon [Fri, 27 Mar 2015 22:53:15 +0000 (23:53 +0100)]
clk: at91: pll: fix input range validity check

The PLL impose a certain input range to work correctly, but it appears that
this input range does not apply on the input clock (or parent clock) but
on the input clock after it has passed the PLL divisor.
Fix the implementation accordingly.

Cc: <stable@vger.kernel.org> # v3.14+
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reported-by: Jonas Andersson <jonas@microbit.se>
10 years agoMerge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Fri, 19 Jun 2015 03:02:27 +0000 (17:02 -1000)]
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c documentation fix from Wolfram Sang:
 "Here is a small documentation fix for I2C.

  We already had a user who unsuccessfully tried to get the new slave
  framework running with the currently broken example.  So, before this
  happens again, I'd like to have this how-to-use section fixed for 4.1
  already.  So that no more hacking time is wasted"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: slave: fix the example how to instantiate from userspace

10 years agorevert "cpumask: don't perform while loop in cpumask_next_and()"
Andrew Morton [Thu, 18 Jun 2015 18:01:11 +0000 (11:01 -0700)]
revert "cpumask: don't perform while loop in cpumask_next_and()"

Revert commit 534b483a86e6 ("cpumask: don't perform while loop in
cpumask_next_and()").

This was a minor optimization, but it puts a `struct cpumask' on the
stack, which consumes too much stack space.

Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Amir Vadai <amirv@mellanox.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoMerge tag 'drm-intel-fixes-2015-06-18' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Fri, 19 Jun 2015 01:58:39 +0000 (11:58 +1000)]
Merge tag 'drm-intel-fixes-2015-06-18' of git://anongit.freedesktop.org/drm-intel into drm-fixes

one fix, one revert
* tag 'drm-intel-fixes-2015-06-18' of git://anongit.freedesktop.org/drm-intel:
  Revert "drm/i915: Don't skip request retirement if the active list is empty"
  drm/i915: Always reset vma->ggtt_view.pages cache on unbinding

10 years agoMerge branch 'drm-fixes-4.1' of git://people.freedesktop.org/~deathsimple/linux into...
Dave Airlie [Fri, 19 Jun 2015 01:55:29 +0000 (11:55 +1000)]
Merge branch 'drm-fixes-4.1' of git://people.freedesktop.org/~deathsimple/linux into drm-fixes

two radeon fixes
one MST fix,
one query addition, destined for stable, and to fix a regression
* 'drm-fixes-4.1' of git://people.freedesktop.org/~deathsimple/linux:
  drm/radeon: don't probe MST on hw we don't support it on
  drm/radeon: Add RADEON_INFO_VA_UNMAP_WORKING query

10 years agodrm/radeon: don't probe MST on hw we don't support it on
Dave Airlie [Thu, 18 Jun 2015 04:29:18 +0000 (14:29 +1000)]
drm/radeon: don't probe MST on hw we don't support it on

If you do radeon.mst=1 on a gpu without mst hw, and then
plug some mst hw it will oops instead of falling back.

So check we have DCE5 at least before proceeding.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agodrm/radeon: Add RADEON_INFO_VA_UNMAP_WORKING query
Michel Dänzer [Tue, 16 Jun 2015 08:28:16 +0000 (17:28 +0900)]
drm/radeon: Add RADEON_INFO_VA_UNMAP_WORKING query

This tells userspace that it's safe to use the RADEON_VA_UNMAP operation
of the DRM_RADEON_GEM_VA ioctl.

Cc: stable@vger.kernel.org
(NOTE: Backporting this commit requires at least backports of commits
26d4d129b6042197b4cbc8341c0618f99231af2f,
48afbd70ac7b6aa62e8d452091023941d8085f8a and
c29c0876ec05d51a93508a39b90b92c29ba6423d as well, otherwise using
RADEON_VA_UNMAP runs into trouble)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agoMerge tag 'trace-fix-filter-4.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 18 Jun 2015 06:56:57 +0000 (20:56 -1000)]
Merge tag 'trace-fix-filter-4.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing filter fix from Steven Rostedt:
 "Vince Weaver reported a warning when he added perf event filters into
  his fuzzer tests.  There's a missing check of balanced operations when
  parenthesis are used, and this triggers a WARN_ON() and when reading
  the failure, the filter reports no failure occurred.

  The operands were not being checked if they match, this adds that"

* tag 'trace-fix-filter-4.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  tracing: Have filter check for balanced ops

10 years agoMerge git://git.kernel.org/pub/scm/virt/kvm/kvm
Linus Torvalds [Thu, 18 Jun 2015 06:54:47 +0000 (20:54 -1000)]
Merge git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm bugfix from Marcelo Tosatti:
 "Rrestore APIC migration functionality"

* git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: x86: fix lapic.timer_mode on restore

10 years agoKconfig: disable Media Controller for DVB
Mauro Carvalho Chehab [Tue, 16 Jun 2015 09:26:59 +0000 (06:26 -0300)]
Kconfig: disable Media Controller for DVB

Since when we start discussions about the usage Media Controller for
complex hardware, one thing become clear: the way it is, MC fails to
map anything different than capture/output/m2m video-only streaming.

The point is that MC has entities named as devnodes, but the only
devnode used (before the DVB patches) is MEDIA_ENT_T_DEVNODE_V4L.
Due to the way MC got implemented, however, this entity actually
doesn't represent the devnode, but the hardware I/O engine that
receives data via DMA.

By coincidence, such DMA is associated with the V4L device node
on webcam hardware, but this is not true even for other V4L2
devices. For example, on USB hardware, the DMA is done via the
USB controller. The data passes though a in-kernel filter that
strips off the URB headers. Other V4L2 devices like radio may not
even have DMA. When it have, the DMA is done via ALSA, and not
via the V4L devnode.

In other words, MC is broken as a whole, but tagging it as BROKEN
right now would do more harm than good.

So, instead, let's mark, for now, the DVB part as broken and
block all new changes to MC while we fix this mess, whith
we hopefully will do for the next Kernel version.

Requested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Thu, 18 Jun 2015 06:49:26 +0000 (20:49 -1000)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:
 "This fixes the following issues:

   - Crash in caam hash due to uninitialised buffer lengths.

   - Alignment issue in caam RNG that may lead to non-random output"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: caam - fix RNG buffer cache alignment
  crypto: caam - improve initalization for context state saves

10 years agomm: shmem_zero_setup skip security check and lockdep conflict with XFS
Hugh Dickins [Sun, 14 Jun 2015 16:48:09 +0000 (09:48 -0700)]
mm: shmem_zero_setup skip security check and lockdep conflict with XFS

It appears that, at some point last year, XFS made directory handling
changes which bring it into lockdep conflict with shmem_zero_setup():
it is surprising that mmap() can clone an inode while holding mmap_sem,
but that has been so for many years.

Since those few lockdep traces that I've seen all implicated selinux,
I'm hoping that we can use the __shmem_file_setup(,,,S_PRIVATE) which
v3.13's commit c7277090927a ("security: shmem: implement kernel private
shmem inodes") introduced to avoid LSM checks on kernel-internal inodes:
the mmap("/dev/zero") cloned inode is indeed a kernel-internal detail.

This also covers the !CONFIG_SHMEM use of ramfs to support /dev/zero
(and MAP_SHARED|MAP_ANONYMOUS).  I thought there were also drivers
which cloned inode in mmap(), but if so, I cannot locate them now.

Reported-and-tested-by: Prarit Bhargava <prarit@redhat.com>
Reported-and-tested-by: Daniel Wagner <wagi@monom.org>
Reported-and-tested-by: Morten Stevens <mstevens@fedoraproject.org>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agoi2c: slave: fix the example how to instantiate from userspace
Wolfram Sang [Mon, 15 Jun 2015 17:51:46 +0000 (19:51 +0200)]
i2c: slave: fix the example how to instantiate from userspace

I copied the wrong shell code into the documentation. Sorry to all who
tried to get sense out of this current example :/ Slight rewording while
we are here.

Reported-by: Tim Bakker <bakkert@mymail.vcu.edu>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
10 years agotracing: Have filter check for balanced ops
Steven Rostedt [Mon, 15 Jun 2015 21:50:25 +0000 (17:50 -0400)]
tracing: Have filter check for balanced ops

When the following filter is used it causes a warning to trigger:

 # cd /sys/kernel/debug/tracing
 # echo "((dev==1)blocks==2)" > events/ext4/ext4_truncate_exit/filter
-bash: echo: write error: Invalid argument
 # cat events/ext4/ext4_truncate_exit/filter
((dev==1)blocks==2)
^
parse_error: No error

 ------------[ cut here ]------------
 WARNING: CPU: 2 PID: 1223 at kernel/trace/trace_events_filter.c:1640 replace_preds+0x3c5/0x990()
 Modules linked in: bnep lockd grace bluetooth  ...
 CPU: 3 PID: 1223 Comm: bash Tainted: G        W       4.1.0-rc3-test+ #450
 Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v02.05 05/07/2012
  0000000000000668 ffff8800c106bc98 ffffffff816ed4f9 ffff88011ead0cf0
  0000000000000000 ffff8800c106bcd8 ffffffff8107fb07 ffffffff8136b46c
  ffff8800c7d81d48 ffff8800d4c2bc00 ffff8800d4d4f920 00000000ffffffea
 Call Trace:
  [<ffffffff816ed4f9>] dump_stack+0x4c/0x6e
  [<ffffffff8107fb07>] warn_slowpath_common+0x97/0xe0
  [<ffffffff8136b46c>] ? _kstrtoull+0x2c/0x80
  [<ffffffff8107fb6a>] warn_slowpath_null+0x1a/0x20
  [<ffffffff81159065>] replace_preds+0x3c5/0x990
  [<ffffffff811596b2>] create_filter+0x82/0xb0
  [<ffffffff81159944>] apply_event_filter+0xd4/0x180
  [<ffffffff81152bbf>] event_filter_write+0x8f/0x120
  [<ffffffff811db2a8>] __vfs_write+0x28/0xe0
  [<ffffffff811dda43>] ? __sb_start_write+0x53/0xf0
  [<ffffffff812e51e0>] ? security_file_permission+0x30/0xc0
  [<ffffffff811dc408>] vfs_write+0xb8/0x1b0
  [<ffffffff811dc72f>] SyS_write+0x4f/0xb0
  [<ffffffff816f5217>] system_call_fastpath+0x12/0x6a
 ---[ end trace e11028bd95818dcd ]---

Worse yet, reading the error message (the filter again) it says that
there was no error, when there clearly was. The issue is that the
code that checks the input does not check for balanced ops. That is,
having an op between a closed parenthesis and the next token.

This would only cause a warning, and fail out before doing any real
harm, but it should still not caues a warning, and the error reported
should work:

 # cd /sys/kernel/debug/tracing
 # echo "((dev==1)blocks==2)" > events/ext4/ext4_truncate_exit/filter
-bash: echo: write error: Invalid argument
 # cat events/ext4/ext4_truncate_exit/filter
((dev==1)blocks==2)
^
parse_error: Meaningless filter expression

And give no kernel warning.

Link: http://lkml.kernel.org/r/20150615175025.7e809215@gandalf.local.home
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: stable@vger.kernel.org # 2.6.31+
Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Tested-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
10 years agoALSA: hda - Fix unused label skip_i915
Takashi Iwai [Tue, 16 Jun 2015 10:23:36 +0000 (12:23 +0200)]
ALSA: hda - Fix unused label skip_i915

When CONFIG_SND_HDA_I915=n, we get a compile warning:
  sound/pci/hda/hda_intel.c: In function ‘azx_probe_continue’:
  sound/pci/hda/hda_intel.c:1882:2: warning: label ‘skip_i915’ defined but not used [-Wunused-label]

Fix it by putting again ifdef to it.  Sigh.

Fixes: bf06848bdbe5 ('ALSA: hda - Continue probing even if i915 binding fails')
Reported-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>