cascardo/linux.git
7 years agoMerge branches 'misc' and 'rxe' into k.o/for-4.8-1
Doug Ledford [Thu, 4 Aug 2016 15:13:47 +0000 (11:13 -0400)]
Merge branches 'misc' and 'rxe' into k.o/for-4.8-1

7 years agoSoft RoCE driver
Moni Shoua [Thu, 16 Jun 2016 13:45:23 +0000 (16:45 +0300)]
Soft RoCE driver

Soft RoCE (RXE) - The software RoCE driver

ib_rxe implements the RDMA transport and registers to the RDMA core
device as a kernel verbs provider. It also implements the packet IO
layer. On the other hand ib_rxe registers to the Linux netdev stack
as a udp encapsulating protocol, in that case RDMA, for sending and
receiving packets over any Ethernet device.  This yields a RDMA
transport over the UDP/Ethernet network layer forming a RoCEv2
compatible device.

The configuration procedure of the Soft RoCE drivers requires
binding to any existing Ethernet network device. This is done with
/sys interface.

A userspace Soft RoCE library (librxe) provides user applications
the ability to run with Soft RoCE devices.  The use of rxe verbs ins
user space requires the inclusion of librxe as a device specifics
plug-in to libibverbs. librxe is packaged separately.

Architecture:

     +-----------------------------------------------------------+
     |                          Application                      |
     +-----------------------------------------------------------+
                            +-----------------------------------+
                            |             libibverbs            |
User                        +-----------------------------------+
                            +----------------+ +----------------+
                            | librxe         | | HW RoCE lib    |
                            +----------------+ +----------------+
+---------------------------------------------------------------+
     +--------------+                           +------------+
     | Sockets      |                           | RDMA ULP   |
     +--------------+                           +------------+
     +--------------+                  +---------------------+
     | TCP/IP       |                  | ib_core             |
     +--------------+                  +---------------------+
                             +------------+ +----------------+
Kernel                       | ib_rxe     | | HW RoCE driver |
                             +------------+ +----------------+
     +------------------------------------+
     | NIC driver                         |
     +------------------------------------+

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     +-----------------------------------------------------------+
     |                          Application                      |
     +-----------------------------------------------------------+
                            +-----------------------------------+
                            |             libibverbs            |
User                        +-----------------------------------+
                            +----------------+ +----------------+
                            | librxe         | | HW RoCE lib    |
                            +----------------+ +----------------+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     +--------------+                           +------------+
     | Sockets      |                           | RDMA ULP   |
     +--------------+                           +------------+
     +--------------+                  +---------------------+
     | TCP/IP       |                  | ib_core             |
     +--------------+                  +---------------------+
                             +------------+ +----------------+
Kernel                       | ib_rxe     | | HW RoCE driver |
                             +------------+ +----------------+
     +------------------------------------+
     | NIC driver                         |
     +------------------------------------+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Soft RoCE resources:

[1[ https://github.com/SoftRoCE/librxe-dev librxe - source code in
Github
[2] https://github.com/SoftRoCE/rxe-dev/wiki/rxe-dev:-Home - Soft RoCE
Wiki page
[3] https://github.com/SoftRoCE/librxe-dev - Soft RoCE userspace library

Signed-off-by: Kamal Heib <kamalh@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Reviewed-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/core: Support for CMA multicast join flags
Alex Vesker [Wed, 6 Jul 2016 13:36:35 +0000 (16:36 +0300)]
IB/core: Support for CMA multicast join flags

Added UCMA and CMA support for multicast join flags. Flags are
passed using UCMA CM join command previously reserved fields.
Currently supporting two join flags indicating two different
multicast JoinStates:

1. Full Member:
   The initiator creates the Multicast group(MCG) if it wasn't
   previously created, can send Multicast messages to the group
   and receive messages from the MCG.

2. Send Only Full Member:
   The initiator creates the Multicast group(MCG) if it wasn't
   previously created, can send Multicast messages to the group
   but doesn't receive any messages from the MCG.

   IB: Send Only Full Member requires a query of ClassPortInfo
       to determine if SM/SA supports this option. If SM/SA
       doesn't support Send-Only there will be no join request
       sent and an error will be returned.

   ETH: When Send Only Full Member is requested no IGMP join
will be sent.

Signed-off-by: Alex Vesker <valex@mellanox.com>
Reviewed by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/sa: Add cached attribute containing SM information to SA port
Alex Vesker [Wed, 6 Jul 2016 13:36:34 +0000 (16:36 +0300)]
IB/sa: Add cached attribute containing SM information to SA port

Added a new SA port attribute containing SM ClassPortInfo fields,
(ClassPortInfo fields: Table 126 IB Spec 1.3.). This is useful for
checking SM support for specific features. The attribute is cached
to avoid resending queries, caching is done when a successful
ClassPortInfo reply is received on the port. Invalidation of the
attribute is done on SM change events, SM re-registration events,
and SM LID change events. The fields in ClassPortInfo should not
change during SM runtime without an event.

Signed-off-by: Alex Vesker <valex@mellanox.com>
Reviewed by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/uverbs: Fix race between uverbs_close and remove_one
Jason Gunthorpe [Sun, 3 Jul 2016 12:28:18 +0000 (15:28 +0300)]
IB/uverbs: Fix race between uverbs_close and remove_one

Fixes an oops that might happen if uverbs_close races with
remove_one.

Both contexts may run ib_uverbs_cleanup_ucontext, it depends
on the flow.

Currently, there is no protection for a case that remove_one
didn't make the cleanup it runs to its end, the underlying
ib_device was freed then uverbs_close will call
ib_uverbs_cleanup_ucontext and OOPs.

Above might happen if uverbs_close deleted the file from the list
then remove_one didn't find it and runs to its end.

Fixes to protect against that case by a new cleanup lock so that
ib_uverbs_cleanup_ucontext will be called always before that
remove_one is ended.

Fixes: 35d4a0b63dc0 ("IB/uverbs: Fix race between ib_uverbs_open and remove_one")
Reported-by: Devesh Sharma <devesh.sharma@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mthca: Clean up error unwind flow in mthca_reset()
Markus Elfring [Sat, 23 Jul 2016 09:28:30 +0000 (11:28 +0200)]
IB/mthca: Clean up error unwind flow in mthca_reset()

The kfree() function was called in a few cases by the mthca_reset()
function during error handling even if the passed variables "bridge_header"
and "hca_header" contained a null pointer.

Adjust jump targets according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mthca: NULL arg to pci_dev_put is OK
Markus Elfring [Sat, 23 Jul 2016 08:05:12 +0000 (10:05 +0200)]
IB/mthca: NULL arg to pci_dev_put is OK

The pci_dev_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/hfi1: NULL arg to sc_return_credits is OK
Markus Elfring [Sat, 23 Jul 2016 06:30:52 +0000 (08:30 +0200)]
IB/hfi1: NULL arg to sc_return_credits is OK

The sc_return_credits() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx4: Add diagnostic hardware counters
Mark Bloch [Tue, 19 Jul 2016 17:54:58 +0000 (20:54 +0300)]
IB/mlx4: Add diagnostic hardware counters

Expose IB diagnostic hardware counters.
The counters count IB events and are applicable for IB and RoCE.

The counters can be divided into two groups, per device and per port.
Device counters are always exposed.
Port counters are exposed only if the firmware supports per port counters.

rq_num_dup and sq_num_to are only exposed if we have firmware support
for them, if we do, we expose them per device and per port.
rq_num_udsdprd and num_cqovf are device only counters.

rq - denotes responder.
sq - denotes requester.

|-----------------------|---------------------------------------|
| Name | Description |
|-----------------------|---------------------------------------|
|rq_num_lle | Number of local length errors |
|-----------------------|---------------------------------------|
|sq_num_lle | number of local length errors |
|-----------------------|---------------------------------------|
|rq_num_lqpoe | Number of local QP operation errors |
|-----------------------|---------------------------------------|
|sq_num_lqpoe | Number of local QP operation errors |
|-----------------------|---------------------------------------|
|rq_num_lpe | Number of local protection errors |
|-----------------------|---------------------------------------|
|sq_num_lpe | Number of local protection errors |
|-----------------------|---------------------------------------|
|rq_num_wrfe | Number of CQEs with error |
|-----------------------|---------------------------------------|
|sq_num_wrfe | Number of CQEs with error |
|-----------------------|---------------------------------------|
|sq_num_mwbe | Number of Memory Window bind errors |
|-----------------------|---------------------------------------|
|sq_num_bre | Number of bad response errors |
|-----------------------|---------------------------------------|
|sq_num_rire | Number of Remote Invalid request |
| | errors |
|-----------------------|---------------------------------------|
|rq_num_rire | Number of Remote Invalid request |
| | errors |
|-----------------------|---------------------------------------|
|sq_num_rae | Number of remote access errors |
|-----------------------|---------------------------------------|
|rq_num_rae | Number of remote access errors |
|-----------------------|---------------------------------------|
|sq_num_roe | Number of remote operation errors |
|-----------------------|---------------------------------------|
|sq_num_tree | Number of transport retries exceeded |
| | errors |
|-----------------------|---------------------------------------|
|sq_num_rree | Number of RNR NAK retries exceeded |
| | errors |
|-----------------------|---------------------------------------|
|rq_num_rnr | Number of RNR NAKs sent |
|-----------------------|---------------------------------------|
|sq_num_rnr | Number of RNR NAKs received |
|-----------------------|---------------------------------------|
|rq_num_oos | Number of Out of Sequence requests |
| | received |
|-----------------------|---------------------------------------|
|sq_num_oos | Number of Out of Sequence NAKs |
| | received |
|-----------------------|---------------------------------------|
|rq_num_udsdprd | Number of UD packets silently |
| | discarded on the Receive Queue due to |
| | lack of receive descriptor |
|-----------------------|---------------------------------------|
|rq_num_dup | Number of duplicate requests received |
|-----------------------|---------------------------------------|
|sq_num_to | Number of time out received |
|-----------------------|---------------------------------------|
|num_cqovf | Number of CQ overflows |
|-----------------------|---------------------------------------|

Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agonet/mlx4: Query performance and diagnostics counters
Mark Bloch [Tue, 19 Jul 2016 17:54:57 +0000 (20:54 +0300)]
net/mlx4: Query performance and diagnostics counters

Add a function to query diagnostics counters from the firmware.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agonet/mlx4: Add diagnostic counters capability bit
Mark Bloch [Tue, 19 Jul 2016 17:54:56 +0000 (20:54 +0300)]
net/mlx4: Add diagnostic counters capability bit

Add a bit that indicates if the firmware supports per port
diagnostic counters.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoUse smaller 512 byte messages for portmapper messages
Mustafa Ismail [Mon, 18 Jul 2016 19:21:49 +0000 (14:21 -0500)]
Use smaller 512 byte messages for portmapper messages

Portmapper messages are short and do not occupy more than 512 bytes.
Lower portmapper message size to 512 bytes. This change significantly
reduces the amount of memory needed when trying to establish a large
number of connections simultaneously. The old value is based on page
size.

Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/ipoib: Report SG feature regardless of HW UD CSUM capability
Yuval Shaia [Wed, 20 Jul 2016 08:30:06 +0000 (01:30 -0700)]
IB/ipoib: Report SG feature regardless of HW UD CSUM capability

Decouple SG support from HW ability to do UD checksum.
This coupling is for historical reasons and removed with 'commit
ec5f06156423 ("net: Kill link between CSUM and SG features.")'

During driver load it is assumed that device does not supports SG. The
final decision is taken after creating UD QP based on device capability.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx4: Don't use GFP_ATOMIC for CQ resize struct
Roland Dreier [Fri, 29 Jul 2016 04:58:43 +0000 (21:58 -0700)]
IB/mlx4: Don't use GFP_ATOMIC for CQ resize struct

We allocate a small tracking structure as part of mlx4_ib_resize_cq().
However, we don't need to use GFP_ATOMIC -- immediately after the
allocation, we call mlx4_cq_resize(), which allocates a command
mailbox with GFP_KERNEL and then sleeps on a firmware command, so we
better not be in an atomic context.

This actually has a real impact, because when this GFP_ATOMIC
allocation fails (and GFP_ATOMIC does fail in practice) then a
userspace consumer resizing a CQ will get a spurious failure that we
can easily avoid.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/hfi1: Disable by default
Bart Van Assche [Tue, 19 Jul 2016 17:03:44 +0000 (10:03 -0700)]
IB/hfi1: Disable by default

There is a strict policy in the Linux kernel that new drivers must be
disabled by default. Hence leave out the "default m" line from Kconfig.

Fixes: f48ad614c100 ("IB/hfi1: Move driver out of staging")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Jubin John <jubin.john@intel.com>
Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
Cc: <stable@vger.kernel.org> # v4.7+
Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/rdmavt: Disable by default
Bart Van Assche [Tue, 19 Jul 2016 17:03:17 +0000 (10:03 -0700)]
IB/rdmavt: Disable by default

There is a strict policy in the Linux kernel that new drivers must be
disabled by default. Hence leave out the "default m" line from Kconfig.

Fixes: 0194621b2253 ("IB/rdmavt: Create module framework and handle driver registration")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Jubin John <jubin.john@intel.com>
Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
Cc: <stable@vger.kernel.org> # v4.6+
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoMerge branch 'i40iw' into k.o/for-4.8
Doug Ledford [Thu, 4 Aug 2016 01:00:16 +0000 (21:00 -0400)]
Merge branch 'i40iw' into k.o/for-4.8

7 years agoMerge branches 'cxgb4' and 'mlx5' into k.o/for-4.8
Doug Ledford [Thu, 4 Aug 2016 00:58:45 +0000 (20:58 -0400)]
Merge branches 'cxgb4' and 'mlx5' into k.o/for-4.8

7 years agoIB/mlx5: Fix port counter ID association to QP offset
Alex Vesker [Wed, 13 Jul 2016 13:25:11 +0000 (16:25 +0300)]
IB/mlx5: Fix port counter ID association to QP offset

The q-counter-id is given in modify-QP command associates
the QP with the counter. The offset to which the counter
ID was set is incorrect, causing IB port counters not to
count on QP.

Fixes: 0837e86a7a34 ('IB/mlx5: Add per port counters')
Signed-off-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Tested-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Fix iteration overrun in GSI qps
Slava Shwartsman [Sun, 3 Jul 2016 12:28:19 +0000 (15:28 +0300)]
IB/mlx5: Fix iteration overrun in GSI qps

Number of outstanding_pi may overflow and as a result may indicate that
there are no elements in the queue. The effect of doing this is that the
MAD layer will get stuck waiting for completions. The MAD layer will
think that the QP is full - because it didn't receive these completions.

This fix changes it so the outstanding_pi number is increased
with 32-bit wraparound and is not limited to max_send_wr so
that the difference between outstanding_pi and outstanding_ci will
really indicate the number of outstanding completions.

Cc: Stable <stable@vger.kernel.org>
Fixes: ea6dc2036224 ('IB/mlx5: Reorder GSI completions')
Signed-off-by: Slava Shwartsman <slavash@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Haggai Eran <haggaie@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoi40iw: Add NULL check for puda buffer
Mustafa Ismail [Tue, 12 Jul 2016 16:48:46 +0000 (11:48 -0500)]
i40iw: Add NULL check for puda buffer

i40iw_puda_get_listbuf may return NULL if the list is empty.
Add NULL check prior to accessing the pointer.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoi40iw: Change dup_ack_thresh to u8
Mustafa Ismail [Tue, 12 Jul 2016 16:48:45 +0000 (11:48 -0500)]
i40iw: Change dup_ack_thresh to u8

Change dup_ack_thressh to u8 since it is a 3 bit field.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoi40iw: Remove unnecessary check for moving CQ head
Mustafa Ismail [Tue, 12 Jul 2016 16:48:44 +0000 (11:48 -0500)]
i40iw: Remove unnecessary check for moving CQ head

In i40iw_cq_poll_completion, we always move the tail. So there is
no reason to check for overflow everytime we move the head.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoi40iw: Simplify code to set fragments in SQ WQE
Mustafa Ismail [Tue, 12 Jul 2016 16:48:43 +0000 (11:48 -0500)]
i40iw: Simplify code to set fragments in SQ WQE

Replace a subtract and multiply with an add; while populating fragments
in SQ wqe.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoi40iw: Remove unnecessary parameter to i40iw_cq_poll_completion
Mustafa Ismail [Tue, 12 Jul 2016 16:48:42 +0000 (11:48 -0500)]
i40iw: Remove unnecessary parameter to i40iw_cq_poll_completion

Post_cq parameter passed to i40iw_cq_poll_completion is always
true; so remove.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoi40iw: Do not access pointer after free
Mustafa Ismail [Tue, 12 Jul 2016 16:48:41 +0000 (11:48 -0500)]
i40iw: Do not access pointer after free

Child_listen_node pointer is used in a debug print after kfree.
Move the print before kfree.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoi40iw: Correct and use size parameter to i40iw_reg_phys_mr
Mustafa Ismail [Tue, 12 Jul 2016 16:48:40 +0000 (11:48 -0500)]
i40iw: Correct and use size parameter to i40iw_reg_phys_mr

Fix size parameter passed to i40iw_reg_phys_mr and use it to
register memory.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoi40iw: Fix return codes
Shiraz Saleem [Tue, 12 Jul 2016 16:48:39 +0000 (11:48 -0500)]
i40iw: Fix return codes

Fix incorrect usage of ENOSYS and other return codes.

Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoiw_cm: free cm_id resources on the last deref
Steve Wise [Fri, 29 Jul 2016 18:00:54 +0000 (11:00 -0700)]
iw_cm: free cm_id resources on the last deref

Remove the complicated logic to free the iw_cm_id inside iw_cm
event handlers vs when an application thread destroys the cm_id.
Also remove the block in iw_destroy_cm_id() to block the application
until all references are removed.  This block can cause a deadlock when
disconnecting or destroying cm_ids inside an rdma_cm event handler.
Simply allowing the last deref of the iw_cm_id to free the memory
is cleaner and avoids this potential deadlock. Also a flag is added,
IW_CM_DROP_EVENTS, that is set when the cm_id is marked for destruction.
If any events are pending on this iw_cm_id, then as they are processed
they will be dropped vs posted upstream if IW_CM_DROP_EVENTS is set.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoiw_cxgb4: don't block in destroy_qp awaiting the last deref
Steve Wise [Fri, 29 Jul 2016 18:00:54 +0000 (11:00 -0700)]
iw_cxgb4: don't block in destroy_qp awaiting the last deref

Blocking in c4iw_destroy_qp() causes a deadlock when apps destroy a qp
or disconnect a cm_id from their cm event handler function.  There is
no need to block here anyway, so just replace the refcnt atomic with a
kref object and free the memory on the last put.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoiw_cxgb4: explicitly move the qp to ERROR state during flush
Steve Wise [Fri, 29 Jul 2016 15:38:46 +0000 (08:38 -0700)]
iw_cxgb4: explicitly move the qp to ERROR state during flush

This forces the connection to abort if the application failed to
disconnect before flushing.  This is aligned with how the common
flush services work.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoiw_cxgb4: stop MPA_REPLY timer when disconnecting
Steve Wise [Fri, 29 Jul 2016 15:38:44 +0000 (08:38 -0700)]
iw_cxgb4: stop MPA_REPLY timer when disconnecting

There exists a race where the application can setup a connection
and then disconnect it before iw_cxgb4 processes the fw4_ack
message.  For passive side connections, the fw4_ack message is
used to know when to stop the ep timer for MPA_REPLY messages.

If the application disconnects before the fw4_ack is handled then
c4iw_ep_disconnect() needs to clean up the timer state and stop the
timer before restarting it for the disconnect timer.  Failure to do this
results in a "timer already started" message and a premature stopping
of the disconnect timer.

Fixes: e4b76a2 ("RDMA/iw_cxgb4: stop_ep_timer() after MPA negotiation")

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/core: Add flow control to the portmapper netlink calls
Mustafa Ismail [Thu, 28 Jul 2016 20:02:26 +0000 (15:02 -0500)]
IB/core: Add flow control to the portmapper netlink calls

During connection establishment with a large number of
connections, it is possible that the connection requests
might fail. Adding flow control prevents this failure.
Change ibnl_unicast to use blocking to enable flow control.

Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoRDMA/cxgb3: Use AF_INET for sin_family field
Amitoj Kaur Chawla [Mon, 4 Jul 2016 12:57:45 +0000 (18:27 +0530)]
RDMA/cxgb3: Use AF_INET for sin_family field

Elsewhere the sin_family field holds a value with a name of the form
AF_..., so it seems reasonable to do so here as well.  Also the values
of PF_INET and AF_INET are the same.

The Coccinelle semantic patch that makes this change is as follows:

// <smpl>
@@
struct sockaddr_in sip;
@@

(
sip.sin_family ==
- PF_INET
+ AF_INET
|
sip.sin_family !=
- PF_INET
+ AF_INET
|
sip.sin_family =
- PF_INET
+ AF_INET
)
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoRDMA/iw_cxgb4: Use kfree_skb instead of kfree
Hariprasad S [Thu, 30 Jun 2016 06:14:33 +0000 (11:44 +0530)]
RDMA/iw_cxgb4: Use kfree_skb instead of kfree

The commit 0f8ab0b6e91b4d53 ("RDMA/iw_cxgb4: Low resource fixes for Memory
registration") from Jun 10, 2016, leads to the following static checker
warning:

        drivers/infiniband/hw/cxgb4/mem.c:612 c4iw_alloc_mw()
        error: use kfree_skb() here instead of kfree(mhp->dereg_skb)

Also fixes skb leak in c4iw_dealloc_mw

Fixes: 0f8ab0b6e91b4d53 ("RDMA/iw_cxgb4: Low resource fixes for Memory registration")

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Fix duplicate const warning
Wei Yongjun [Tue, 12 Jul 2016 11:32:47 +0000 (11:32 +0000)]
IB/mlx5: Fix duplicate const warning

Fixes the following sparse warning:

drivers/infiniband/hw/mlx5/main.c:2574:25: warning: duplicate const

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoMerge branches 'cxgb4-4.8', 'mlx5-4.8' and 'fw-version' into k.o/for-4.8
Doug Ledford [Thu, 23 Jun 2016 16:29:26 +0000 (12:29 -0400)]
Merge branches 'cxgb4-4.8', 'mlx5-4.8' and 'fw-version' into k.o/for-4.8

7 years agoIB/hfi1: Add device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:22:08 +0000 (02:22 -0400)]
IB/hfi1: Add device FW version string

Export the firmware version through the core.

Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/core: Export a common fw_ver sysfs entry
Ira Weiny [Wed, 15 Jun 2016 06:22:07 +0000 (02:22 -0400)]
IB/core: Export a common fw_ver sysfs entry

Now that all the devices have stopped exporting their own sysfs
entry points we can have the core export this on their behalf.

Eventually this may be removed but this provides for backwards
compatibility.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/ipoib: Use new device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:22:06 +0000 (02:22 -0400)]
IB/ipoib: Use new device FW version string

Using this allows for devices to specify the format of their
firmware version rather than forcing a format.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/usnic: Support device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:22:05 +0000 (02:22 -0400)]
IB/usnic: Support device FW version string

And remove sysfs file in favor of the common core.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/ocrdma: Support device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:22:04 +0000 (02:22 -0400)]
IB/ocrdma: Support device FW version string

And remove sysfs in favor of the core support.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/nes: Support device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:22:03 +0000 (02:22 -0400)]
IB/nes: Support device FW version string

And remove the sysfs in favor of the core version.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mthca: Supprot device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:22:02 +0000 (02:22 -0400)]
IB/mthca: Supprot device FW version string

And remove the sysfs entry in favor of the core support.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Support device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:22:01 +0000 (02:22 -0400)]
IB/mlx5: Support device FW version string

And remove sysfs entry in favor of the common code.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx4: Support device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:22:00 +0000 (02:22 -0400)]
IB/mlx4: Support device FW version string

And remove the sysfs in favor of common core version.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/i40iw: Support device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:21:59 +0000 (02:21 -0400)]
IB/i40iw: Support device FW version string

And remove sysfs support in favor of the core version.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/cxgb4: Support device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:21:58 +0000 (02:21 -0400)]
IB/cxgb4: Support device FW version string

And remove sysfs fw_ver in favor of the core.

Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/cxgb3: Support device FW version string
Ira Weiny [Wed, 15 Jun 2016 06:21:57 +0000 (02:21 -0400)]
IB/cxgb3: Support device FW version string

Also remove fw_ver sysfs to be replaced by the common core one.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/core: Add get FW version string to the core
Ira Weiny [Wed, 15 Jun 2016 06:21:56 +0000 (02:21 -0400)]
IB/core: Add get FW version string to the core

Allow for a common core function to get firmware version strings
from the individual devices.

In later patches this format can then then be used to pass a
properly formated version string through the IPoIB layer.

The problem with the current code in the IPoIB layer is that it is
specific to certain hardware types.

Furthermore, this gives us a common function through which the core
can provide a common sysfs entry.  Eventually we may want to
remove the sysfs export but this provides for user space backwards
compatibility.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Add port protocol stats
Mark Bloch [Fri, 17 Jun 2016 12:10:56 +0000 (15:10 +0300)]
IB/mlx5: Add port protocol stats

Expose new counters using the get protocol stats callback.
We expose the following counters:

|------------------------------------------------------------------------|
|      Name           | IB | EN |           Description                  |
|------------------------------------------------------------------------|
|rx_write_requests    | +  | -  | Number of received WRITE requests for  |
|                     |    |    | the associated QP.                     |
|------------------------------------------------------------------------|
|rx_read_requests     | +  | -  | Number of received READ requests for   |
|                     |    |    | the associated QP.                     |
|------------------------------------------------------------------------|
|rx_atomic_requests   | +  | -  | Number of received ATOMIC requests for |
|                     |    |    | the associated QP.                     |
|------------------------------------------------------------------------|
|out_of_buffer        | +  | +  | Number of drops occurred due to lack   |
|                     |    |    | of WQE for the associated QPs/RQs.     |
|------------------------------------------------------------------------|
|out_of_sequence      | +  | -  | Number of errors in the packet         |
|                     |    |    | transport sequence number              |
|------------------------------------------------------------------------|
|duplicate_request    | +  | +  | Number of received duplicated packets. |
|                     |    |    | A request that previously executed is  |
|                     |    |    | named duplicated.                      |
|------------------------------------------------------------------------|
|rnr_nak_retry_err    | +  | +  | Number of received RNR NAC packets.    |
|                     |    |    | The QP retry limit did not exceed.     |
|------------------------------------------------------------------------|
|packet_seq_err       | +  | +  | Number of received NAK - sequence error|
|                     |    |    | packets. The QP retry limit did not    |
|                     |    |    | exceed.                                |
|------------------------------------------------------------------------|
|implied_nak_err      | +  | +  | Number of times the requester detected |
|                     |    |    | an ACK with a PSN larger than expected |
|                     |    |    | PSN for RDMA READ or ATOMIC response   |
|                     |    |    | The QP retry limit did not exceed.     |
|------------------------------------------------------------------------|
|local_ack_timeout_err| +  | -  | Number of NO ACK responses from        |
|                     |    |    | responder within timer interval.       |
|                     |    |    | The QP retry limit did not exceed.     |
|------------------------------------------------------------------------|

Counters are available if all of them are supported.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Add per port counters
Mark Bloch [Fri, 17 Jun 2016 12:10:55 +0000 (15:10 +0300)]
IB/mlx5: Add per port counters

In order to support statistics for ports, we attach
each QP to a counter set which is dedicate to this port.

Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years ago{net, IB}/mlx5: Refactor internal SRQ API
Artemy Kovalyov [Fri, 17 Jun 2016 12:33:32 +0000 (15:33 +0300)]
{net, IB}/mlx5: Refactor internal SRQ API

Currently, the SRQ API uses the obsolete mlx5_*_srq_mbox_{in,out}
structs which limit the ability to pass the SRQ attributes between
net and IB parts of the driver.

This patch changes the SRQ API so as to use auto-generated structs
and provides a better way to pass attributes which will be in use by
coming features.

Signed-off-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Fix MODIFY_QP command input structure
Artemy Kovalyov [Fri, 17 Jun 2016 12:33:31 +0000 (15:33 +0300)]
IB/mlx5: Fix MODIFY_QP command input structure

Make MODIFY_QP command input structure compliant to specification

Fixes: e126ba97dba9 ('mlx5: Add driver for Mellanox Connect-IB adapters')
Signed-off-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Report mlx5 TSO capabilities when querying device
Bodong Wang [Fri, 17 Jun 2016 12:02:20 +0000 (15:02 +0300)]
IB/mlx5: Report mlx5 TSO capabilities when querying device

Enable mlx5 based hardware to report TCP segmentation offload (TSO)
capabilities from kernel to user space. A TSO enabled NIC will accept
big chunks of data with sizes greater than MTU for TCP traffic.  The TSO
engine will break the data into separate packets and will insert headers
automatically.

The capabilities are exposed to user space through query_device by uhw
directly. The following capabilities are reported:

1. The maximum payload size in bytes supported for segmentation by TSO
   engine.
2. Bitmap showing which QP types are supported by TSO operation. The bitmap
   is built by members from 'enmu ib_qp_type'. For example, similar code
   should be performed if UD QP is supported:
supported_qpts |= 1 << IB_QPT_UD;

To make user-space library aware of whether kernel supports uhw or not, a
new flag: cmds_supp_uhw will be returned back to user-space through
alloc_ucontext.

Signed-off-by: Bodong Wang <bodong@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Enable flow steering for IPv6 traffic
Maor Gottlieb [Fri, 17 Jun 2016 12:14:51 +0000 (15:14 +0300)]
IB/mlx5: Enable flow steering for IPv6 traffic

Enable flow steering for IPv6 traffic by using an IPv6 spec.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/core: Add IPv6 support to flow steering
Maor Gottlieb [Fri, 17 Jun 2016 12:14:50 +0000 (15:14 +0300)]
IB/core: Add IPv6 support to flow steering

Add IPv6 flow specification support.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Reset flow support for IB kernel ULPs
Maor Gottlieb [Fri, 17 Jun 2016 12:01:38 +0000 (15:01 +0300)]
IB/mlx5: Reset flow support for IB kernel ULPs

The driver exposes interfaces that directly relate to HW state.
Upon fatal error, consumers of these interfaces (ULPs) that rely
on completion of all their posted work-request could hang, thereby
introducing dependencies in shutdown order. To prevent this from
happening, we manage the relevant resources (CQs, QPs) that are used
by the device. Upon a fatal error, we now generate simulated
completions for outstanding WQEs that were not completed at the
time the HW was reset.

It includes invoking the completion event handler for all involved
CQs so that the ULPs will poll those CQs. When polled we return
simulated CQEs with IB_WC_WR_FLUSH_ERR return code enabling ULPs
to clean up their  resources and not wait forever for completions
upon receiving remove_one.

The above change requires an extra check in the data path to make
sure that when device is in error state, the simulated CQEs will
be returned and no further WQEs will be posted.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Implements disassociate_ucontext API
Maor Gottlieb [Fri, 17 Jun 2016 11:56:44 +0000 (14:56 +0300)]
IB/mlx5: Implements disassociate_ucontext API

Implements the IB core disassociate_ucontext API.
The driver detaches the HW resources for a given user context to
prevent a dependency between application termination and device
disconnect. This is done by managing the VMAs that were mapped
to the HW bars such as doorbell and blueflame. When need to detach,
remap them to an arbitrary kernel page returned by the zap API.

Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Add RSS QP support
Yishai Hadas [Mon, 23 May 2016 12:20:56 +0000 (15:20 +0300)]
IB/mlx5: Add RSS QP support

Add support for Raw Ethernet RX HASH QP. Currently, creation and
destruction of such a QP are supported. This QP is implemented as
a simple TIR object which points to the receive RQ indirection table.
The given hashing configuration is used to configure the TIR and by
that it chooses the right RQ from the RQ indirection table.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/uverbs: Extend create QP to get RWQ indirection table
Yishai Hadas [Mon, 23 May 2016 12:20:55 +0000 (15:20 +0300)]
IB/uverbs: Extend create QP to get RWQ indirection table

User applications that want to spread incoming traffic between several WQs
should create a QP which contains an indirection table.

When such a QP is created other receive side parameters are not valid
and should not be given. Its send side is optional and assumed active
based on max_send_wr capability value.

Extend create QP to work accordingly.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/core: Extend create QP to get indirection table
Yishai Hadas [Mon, 23 May 2016 12:20:54 +0000 (15:20 +0300)]
IB/core: Extend create QP to get indirection table

Extend create QP to get Receive Work Queue (WQ) indirection table.

QP can be created with external Receive Work Queue indirection table,
in that case it is ready to receive immediately.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Add Receive Work Queue Indirection table operations
Yishai Hadas [Mon, 23 May 2016 12:20:53 +0000 (15:20 +0300)]
IB/mlx5: Add Receive Work Queue Indirection table operations

Some mlx5 based hardwares support a RQ table object. This RQ table
points to a few RQ objects. We implement the receive work queue
indirection table API (create and destroy) by using this hardware
object.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/uverbs: Introduce RWQ Indirection table
Yishai Hadas [Mon, 23 May 2016 12:20:52 +0000 (15:20 +0300)]
IB/uverbs: Introduce RWQ Indirection table

User applications that want to spread traffic on several WQs, need to
create an indirection table, by using already created WQs.

Adding uverbs API in order to create and destroy this table.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/core: Introduce Receive Work Queue indirection table
Yishai Hadas [Mon, 23 May 2016 12:20:51 +0000 (15:20 +0300)]
IB/core: Introduce Receive Work Queue indirection table

Introduce Receive Work Queue (WQ) indirection table.
This object can be used to spread incoming traffic to different
receive Work Queues.

A Receive WQ indirection table points to variable size of WQs.
This table is given to a QP in downstream patches.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimerg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/mlx5: Add receive Work Queue verbs
Yishai Hadas [Mon, 23 May 2016 12:20:50 +0000 (15:20 +0300)]
IB/mlx5: Add receive Work Queue verbs

A QP can be created without internal WQs "packaged" inside it,
this QP can be configured to use "external" WQ object as its
receive/send queue.

WQ is a necessary component for RSS technology since RSS mechanism
is supposed to distribute the traffic between multiple
Receive Work Queues

Receive WQs are implemented by RQs.

Implement the WQ creation, modification and destruction verbs.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/uverbs: Add WQ support
Yishai Hadas [Mon, 23 May 2016 12:20:49 +0000 (15:20 +0300)]
IB/uverbs: Add WQ support

User space applications which use RSS functionality need to create
a work queue object (WQ). The lifetime of such an object is:
 * Create a WQ
 * Modify the WQ from reset to init state.
 * Use the WQ (by downstream patches).
 * Destroy the WQ.

These commands are added to the uverbs API.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@rimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoIB/core: Introduce Work Queue object and its verbs
Yishai Hadas [Mon, 23 May 2016 12:20:48 +0000 (15:20 +0300)]
IB/core: Introduce Work Queue object and its verbs

Introduce Work Queue object and its create/destroy/modify verbs.

QP can be created without internal WQs "packaged" inside it,
this QP can be configured to use "external" WQ object as its
receive/send queue.
WQ is a necessary component for RSS technology since RSS mechanism
is supposed to distribute the traffic between multiple
Receive Work Queues.

WQ associated (many to one) with Completion Queue and it owns WQ
properties (PD, WQ size, etc.).
WQ has a type, this patch introduces the IB_WQT_RQ (i.e.receive queue),
it may be extend to others such as IB_WQT_SQ. (send queue).
WQ from type IB_WQT_RQ contains receive work requests.

PD is an attribute of a work queue (i.e. send/receive queue), it's used
by the hardware for security validation before scattering to a memory
region which is pointed by the WQ. For that, an external WQ object
needs a PD, letting the hardware makes that validation.

When accessing a memory region that is pointed by the WQ its PD
is used and not the QP's PD, this behavior is similar
to a SRQ and a QP.

WQ context is subject to a well-defined state transitions done by
the modify_wq verb.
When WQ is created its initial state becomes IB_WQS_RESET.
>From IB_WQS_RESET it can be modified to itself or to IB_WQS_RDY.
>From IB_WQS_RDY it can be modified to itself, to IB_WQS_RESET
or to IB_WQS_ERR.
>From IB_WQS_ERR it can be modified to IB_WQS_RESET.

Note: transition to IB_WQS_ERR might occur implicitly in case there
was some HW error.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agonet/mlx5: Export required core functions to support RSS
Yishai Hadas [Mon, 23 May 2016 12:20:47 +0000 (15:20 +0300)]
net/mlx5: Export required core functions to support RSS

In order to support RSS QPs, we need to create Ethernet based objects.
This is done by create_rq, destroy_rq, create_rqt and destroy_rqt
mlx5_core functions. We export these functions.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoRDMA/iw_cxgb4: Low resource fixes for Completion queue
Hariprasad S [Thu, 9 Jun 2016 19:35:17 +0000 (01:05 +0530)]
RDMA/iw_cxgb4: Low resource fixes for Completion queue

Pre-allocate buffers to deallocate completion queue, so that completion
queue is deallocated during RDMA termination when system is running
out of memory.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoRDMA/iw_cxgb4: Low resource fixes for Memory registration
Hariprasad S [Thu, 9 Jun 2016 19:35:16 +0000 (01:05 +0530)]
RDMA/iw_cxgb4: Low resource fixes for Memory registration

Pre-allocate buffers for deregistering memory region and memory window
during RDMA connection close, when system is running out of memory.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoRDMA/iw_cxgb4: Low resource fixes for connection manager
Hariprasad S [Thu, 9 Jun 2016 19:35:15 +0000 (01:05 +0530)]
RDMA/iw_cxgb4: Low resource fixes for connection manager

Pre-allocate buffers for sending various control messages to close
connection, abort connection, etc so that we gracefully handle
connections when system is running out of memory.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoRDMA/iw_cxgb4: Add missing error codes for act open cmd
Hariprasad S [Thu, 9 Jun 2016 19:35:14 +0000 (01:05 +0530)]
RDMA/iw_cxgb4: Add missing error codes for act open cmd

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoRDMA/iw_cxgb4: clean up c4iw_reject_cr()
Hariprasad S [Thu, 9 Jun 2016 19:35:13 +0000 (01:05 +0530)]
RDMA/iw_cxgb4: clean up c4iw_reject_cr()

Get rid of unneeded code, and refactor things a bit.

For MPA version 0 we abort the connection.  For > 0, we attempt to send
an MPA_START/REJECT Reply, and then disconnect gracefully.  If the send
of the MPA message fails, then we abort the connection.  We can ignore
c4iw_ep_disconnect() errors here because it will clean up the endpoint
if there are failures.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoRDMA/iw_cxgb4: allocate enough space for debugfs "qps" dump
Hariprasad S [Thu, 9 Jun 2016 19:35:12 +0000 (01:05 +0530)]
RDMA/iw_cxgb4: allocate enough space for debugfs "qps" dump

With IPv6 addresses, the "qps" debugfs is running out of space and
truncating the output.  Bump the required size accordingly.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoRDMA/iw_cxgb4: only read markers_enabled mod param once
Hariprasad S [Thu, 9 Jun 2016 19:35:11 +0000 (01:05 +0530)]
RDMA/iw_cxgb4: only read markers_enabled mod param once

markers_enabled should be read only once during MPA negotiation.
The present code does read markers_enabled twice during negotiation
which results in setting wrong recv/xmit markers if the markers_enabled is
changed in the middle of negotiation.
With this change the markers_enabled is read only once during MPA
negotiation. recv markers are set based on markers enabled module
parameter and xmit markers are set based on markers flag from the
MPA_START_REQ/MPA_START_REP.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
7 years agoLinux 4.7-rc4 v4.7-rc4
Linus Torvalds [Mon, 20 Jun 2016 04:30:02 +0000 (21:30 -0700)]
Linux 4.7-rc4

7 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Linus Torvalds [Sun, 19 Jun 2016 17:05:14 +0000 (07:05 -1000)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-fs

Pull UDF fixes and a reiserfs fix from Jan Kara:
 "A couple of udf fixes (most notably a bug in parsing UDF partitions
  which led to inability to mount recent Windows installation media) and
  a reiserfs fix for handling kstrdup failure"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  reiserfs: check kstrdup failure
  udf: Use correct partition reference number for metadata
  udf: Use IS_ERR when loading metadata mirror file entry
  udf: Don't BUG on missing metadata partition descriptor

7 years agoMerge tag 'dmaengine-fix-4.7-rc4' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Sun, 19 Jun 2016 16:52:20 +0000 (06:52 -1000)]
Merge tag 'dmaengine-fix-4.7-rc4' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine fixes from Vinod Koul:
 "Some fixes has piled up, so time to send them upstream.

  These fixes include:
   - at_xdmac fixes for residue and other stuff
   - update MAINTAINERS for dma dt bindings
   - mv_xor fix for incorrect offset"

* tag 'dmaengine-fix-4.7-rc4' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: mv_xor: Fix incorrect offset in dma_map_page()
  dmaengine: at_xdmac: double FIFO flush needed to compute residue
  dmaengine: at_xdmac: fix residue corruption
  dmaengine: at_xdmac: align descriptors on 64 bits
  MAINTAINERS: Add file patterns for dma device tree bindings

7 years agoMerge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Linus Torvalds [Sun, 19 Jun 2016 06:36:17 +0000 (20:36 -1000)]
Merge tag 'armsoc-fixes' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "Another batch of fixes for ARM SoC platforms.  Most are smaller fixes.

  Two areas that are worth pointing out are:

   - OMAP had a handful of changes to voltage specs that caused a bit of
     churn, most of volume of change in this branch is due to this.

   - There are a couple of _rcuidle fixes from Paul that touch common
     code and came in through the OMAP tree since they were the ones who
     saw the problems.

 The rest is smaller changes across a handful of platforms"

* tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (36 commits)
  ARM: dts: STi: stih407-family: Disable reserved-memory co-processor nodes
  ARM: dts: am437x-sk-evm: Reduce i2c0 bus speed for tps65218
  ARM: OMAP2+: timer: add probe for clocksources
  ARM: OMAP1: fix ams-delta FIQ handler to work with sparse IRQ
  memory: omap-gpmc: Fix omap gpmc EXTRADELAY timing
  arm: Use _rcuidle for smp_cross_call() tracepoints
  MAINTAINERS: Add myself as reviewer of ARM FSL/NXP
  ARM: OMAP: DRA7: powerdomain data: Remove unused pwrsts_mem_ret
  ARM: OMAP: DRA7: powerdomain data: Remove unused pwrsts_logic_ret
  ARM: OMAP: DRA7: powerdomain data: Set L3init and L4per to ON
  ARM: imx6ul: Fix Micrel PHY mask
  ARM: OMAP2+: Select OMAP_INTERCONNECT for SOC_AM43XX
  ARM: dts: DRA74x: fix DSS PLL2 addresses
  ARM: OMAP2: Enable Errata 430973 for OMAP3
  ARM: dts: socfpga: Add missing PHY phandle
  ARM: dts: exynos: Fix port nodes names for Exynos5420 Peach Pit board
  ARM: dts: exynos: Fix port nodes names for Exynos5250 Snow board
  ARM: dts: sun6i: yones-toptech-bs1078-v2: Drop constraints on dc1sw regulator
  ARM: dts: sun6i: primo81: Drop constraints on dc1sw regulator
  ARM: dts: sunxi: Add OLinuXino Lime2 eMMC to the Makefile
  ...

7 years agoMerge tag 'gpmc-omap-fixes-for-v4.7' of https://github.com/rogerq/linux into fixes
Olof Johansson [Sun, 19 Jun 2016 05:59:07 +0000 (22:59 -0700)]
Merge tag 'gpmc-omap-fixes-for-v4.7' of https://github.com/rogerq/linux into fixes

OMAP-GPMC: Fixes for for v4.7-rc cycle:

- Fix omap gpmc EXTRADELAY timing. The DT provided timings
were wrongly used causing devices requiring extra delay timing
to fail.

* tag 'gpmc-omap-fixes-for-v4.7' of https://github.com/rogerq/linux:
  memory: omap-gpmc: Fix omap gpmc EXTRADELAY timing
  + Linux 4.7-rc3

Signed-off-by: Olof Johansson <olof@lixom.net>
7 years agoMerge tag 'omap-for-v4.7/fixes-powedomain' of git://git.kernel.org/pub/scm/linux...
Olof Johansson [Sun, 19 Jun 2016 05:57:48 +0000 (22:57 -0700)]
Merge tag 'omap-for-v4.7/fixes-powedomain' of git://git./linux/kernel/git/tmlind/linux-omap into fixes

Fixes for omaps for v4.7-rc cycle:

- Fix dra7 for hardware issues limiting L4Per and L3init power domains
  to on state. Without this the devices may not work correctly after
  some time of use because of asymmetric aging. And related to this,
  let's also remove the unusable states.

- Always select omap interconnect for am43x as otherwise the am43x
  only configurations will not boot properly. This can happen easily
  for any product kernels that leave out other SoCs to save memory.

- Fix DSS PLL2 addresses that have gone unused for now

- Select erratum 430973 for omap3, this is now safe to do and can
  save quite a bit of debugging time for people who may have left
  it out.

* tag 'omap-for-v4.7/fixes-powedomain' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP: DRA7: powerdomain data: Remove unused pwrsts_mem_ret
  ARM: OMAP: DRA7: powerdomain data: Remove unused pwrsts_logic_ret
  ARM: OMAP: DRA7: powerdomain data: Set L3init and L4per to ON
  ARM: OMAP2+: Select OMAP_INTERCONNECT for SOC_AM43XX
  ARM: dts: DRA74x: fix DSS PLL2 addresses
  ARM: OMAP2: Enable Errata 430973 for OMAP3
  + Linux 4.7-rc2

Signed-off-by: Olof Johansson <olof@lixom.net>
7 years agoMerge tag 'fixes-rcu-fiq-signed' of git://git.kernel.org/pub/scm/linux/kernel/git...
Olof Johansson [Sun, 19 Jun 2016 05:21:52 +0000 (22:21 -0700)]
Merge tag 'fixes-rcu-fiq-signed' of git://git./linux/kernel/git/tmlind/linux-omap into fixes

Fixes for omaps for v4.7-rc cycle:

- Two boot warning fixes from the RCU tree that should have gotten
  merged several weeks ago already but did not because of issues
  with who merges them. Paul has now split the RCU warning fixes into
  sets for various maintainers.

- Fix ams-delta FIQ regression caused by omap1 sparse IRQ changes

- Fix PM for omap3 boards using timer12 and gptimer, like the
  original beagleboard

- Fix hangs on am437x-sk-evm by lowering the I2C bus speed

* tag 'fixes-rcu-fiq-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: dts: am437x-sk-evm: Reduce i2c0 bus speed for tps65218
  ARM: OMAP2+: timer: add probe for clocksources
  ARM: OMAP1: fix ams-delta FIQ handler to work with sparse IRQ
  arm: Use _rcuidle for smp_cross_call() tracepoints
  arm: Use _rcuidle tracepoint to allow use from idle

Signed-off-by: Olof Johansson <olof@lixom.net>
7 years agoARM: dts: STi: stih407-family: Disable reserved-memory co-processor nodes
Lee Jones [Fri, 17 Jun 2016 11:44:18 +0000 (13:44 +0200)]
ARM: dts: STi: stih407-family: Disable reserved-memory co-processor nodes

This patch fixes a non-booting issue in Mainline.

When booting with a compressed kernel, we need to be careful how we
populate memory close to DDR start.  AUTO_ZRELADDR is enabled by default
in multi-arch enabled configurations, which place some restrictions on
where the kernel is placed and where it will be uncompressed to on boot.

AUTO_ZRELADDR takes the decompressor code's start address and masks out
the bottom 28 bits to obtain an address to uncompress the kernel to
(thus a load address of 0x42000000 means that the kernel will be
uncompressed to 0x40000000 i.e. DDR START on this platform).

Even changing the load address to after the co-processor's shared memory
won't render a booting platform, since the AUTO_ZRELADDR algorithm still
ensures the kernel is uncompressed into memory shared with the first
co-processor (0x40000000).

Another option would be to move loading to 0x4A000000, since this will
mean the decompressor will decompress the kernel to 0x48000000. However,
this would mean a large chunk (0x44000000 => 0x48000000 (64MB)) of
memory would essentially be wasted for no good reason.

Until we can work with ST to find a suitable memory location to
relocate co-processor shared memory, let's disable the shared memory
nodes.  This will ensure a working platform in the mean time.

NB: The more observant of you will notice that we're leaving the DMU
shared memory node enabled; this is because a) it is the only one in
active use at the time of this writing and b) it is not affected by
the current default behaviour which is causing issues.

Fixes: fe135c6 (ARM: dts: STiH407: Move over to using the 'reserved-memory' API for obtaining DMA memory)
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Maxime Coquelin <maxime.coquelin@st.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
7 years agoMerge tag 'imx-fixes-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo...
Olof Johansson [Sun, 19 Jun 2016 05:18:45 +0000 (22:18 -0700)]
Merge tag 'imx-fixes-4.7' of git://git./linux/kernel/git/shawnguo/linux into fixes

The i.MX fixes for 4.7:
 - Correct Micrel PHY mask to fix the issue that i.MX6UL ethernet works
   in U-Boot but not in kernel.

* tag 'imx-fixes-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  ARM: imx6ul: Fix Micrel PHY mask

Signed-off-by: Olof Johansson <olof@lixom.net>
7 years agoMerge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm
Linus Torvalds [Sun, 19 Jun 2016 01:20:15 +0000 (15:20 -1000)]
Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm

Pull ARM fixes from Russell King:
 "A couple of fixes for pmd_mknotpresent()/pmd_present() for LPAE
  systems"

* 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
  ARM: 8579/1: mm: Fix definition of pmd_mknotpresent
  ARM: 8578/1: mm: ensure pmd_present only checks the valid bit

7 years agoMerge tag 'usb-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sat, 18 Jun 2016 16:06:49 +0000 (06:06 -1000)]
Merge tag 'usb-4.7-rc4' of git://git./linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are a bunch (65) of USB fixes for 4.7-rc4.  Sorry about the
  quantity, I've been slow in getting these out.

  The majority are the "normal" gadget, musb, and xhci fixes, that we
  all are used to.  There are also a few other tiny fixes resolving a
  number of reported issues that showed up in 4.7-rc1.

  All of these have been in linux-next"

* tag 'usb-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (65 commits)
  usbip: rate limit get_frame_number message
  usb: musb: sunxi: Remove bogus "Frees glue" comment
  usb: musb: sunxi: Fix NULL ptr deref when gadget is registered before musb
  usb: echi-hcd: Add ehci_setup check before echi_shutdown
  usb: host: ehci-msm: Conditionally call ehci suspend/resume
  MAINTAINERS: Add file patterns for usb device tree bindings
  usb: host: ehci-tegra: Avoid getting the same reset twice
  usb: host: ehci-tegra: Grab the correct UTMI pads reset
  USB: mos7720: delete parport
  USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails
  phy: ti-pipe3: Program the DPLL even if it was already locked
  usb: musb: Stop bulk endpoint while queue is rotated
  usb: musb: Ensure rx reinit occurs for shared_fifo endpoints
  usb: musb: host: correct cppi dma channel for isoch transfer
  usb: musb: only restore devctl when session was set in backup
  usb: phy: Check initial state for twl6030
  usb: musb: Use normal module_init for 2430 glue
  usb: musb: Remove pm_runtime_set_irq_safe
  usb: musb: Remove extra PM runtime calls from 2430 glue layer
  usb: musb: Return error value from musb_mailbox
  ...

7 years agoMerge tag 'staging-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sat, 18 Jun 2016 16:05:28 +0000 (06:05 -1000)]
Merge tag 'staging-4.7-rc4' of git://git./linux/kernel/git/gregkh/staging

Pull IIO and staging fixes from Greg KH:
 "Here are a number of IIO and staging bugfixes for 4.7-rc4.

  Nothing huge, the normal amount of iio driver fixes, and some small
  staging driver bugfixes for some reported problems (2 are reverts of
  patches that went into 4.7-rc1).  All have been in linux-next with no
  reported issues"

* tag 'staging-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (24 commits)
  Revert "Staging: rtl8188eu: rtw_efuse: Use sizeof type *pointer instead of sizeof type."
  Revert "Staging: drivers: rtl8188eu: use sizeof(*ptr) instead of sizeof(struct)"
  staging: lustre: lnet: Don't access NULL NI on failure path
  iio: hudmidity: hdc100x: fix incorrect shifting and scaling
  iio: light apds9960: Add the missing dev.parent
  iio: Fix error handling in iio_trigger_attach_poll_func
  iio: st_sensors: Disable DRDY at init time
  iio: st_sensors: Init trigger before irq request
  iio: st_sensors: switch to a threaded interrupt
  iio: light: bh1780: assign a static name
  iio: bh1780: dereference the client properly
  iio: humidity: hdc100x: fix IIO_TEMP channel reporting
  iio:st_pressure: fix sampling gains (bring inline with ABI)
  iio: proximity: as3935: fix buffer stack trashing
  iio: proximity: as3935: remove triggered buffer processing
  iio: proximity: as3935: correct IIO_CHAN_INFO_RAW output
  max44000: Remove scale from proximity
  iio: humidity: am2315: Remove a stray unlock
  iio: humidity: hdc100x: correct humidity integration time mask
  iio: pressure: bmp280: fix error message for wrong chip id
  ...

7 years agoMerge tag 'driver-core-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sat, 18 Jun 2016 16:04:01 +0000 (06:04 -1000)]
Merge tag 'driver-core-4.7-rc4' of git://git./linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are a small number of debugfs, ISA, and one driver core fix for
  4.7-rc4.

  All of these resolve reported issues.  The ISA ones have spent the
  least amount of time in linux-next, sorry about that, I didn't realize
  they were regressions that needed to get in now (thanks to Thorsten
  for the prodding!) but they do all pass the 0-day bot tests.  The
  others have been in linux-next for a while now.

  Full details about them are in the shortlog below"

* tag 'driver-core-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  isa: Dummy isa_register_driver should return error code
  isa: Call isa_bus_init before dependent ISA bus drivers register
  watchdog: ebc-c384_wdt: Allow build for X86_64
  iio: stx104: Allow build for X86_64
  gpio: Allow PC/104 devices on X86_64
  isa: Allow ISA-style drivers on modern systems
  base: make module_create_drivers_dir race-free
  debugfs: open_proxy_open(): avoid double fops release
  debugfs: full_proxy_open(): free proxy on ->open() failure
  kernel/kcov: unproxify debugfs file's fops

7 years agoMerge tag 'char-misc-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
Linus Torvalds [Sat, 18 Jun 2016 16:02:37 +0000 (06:02 -1000)]
Merge tag 'char-misc-4.7-rc4' of git://git./linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
 "Here are a small number of char and misc driver fixes for 4.7-rc4.

  They resolve some minor issues that have been reported, and have all
  been in linux-next"

* tag 'char-misc-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  coresight: Handle build path error
  coresight: Fix erroneous memset in tmc_read_unprepare_etr
  coresight: Fix tmc_read_unprepare_etr
  coresight: Fix NULL pointer dereference in _coresight_build_path
  extcon: palmas: Fix boot up state of VBUS when using GPIO detection
  mcb: Acquire reference to carrier module in core
  mcb: Acquire reference to device in probe
  mei: don't use wake_up_interruptible for wr_ctrl

7 years agoMerge branch 'for-linus-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
Linus Torvalds [Sat, 18 Jun 2016 15:57:59 +0000 (05:57 -1000)]
Merge branch 'for-linus-4.7' of git://git./linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
 "The most user visible change here is a fix for our recent superblock
  validation checks that were causing problems on non-4k pagesized
  systems"

* 'for-linus-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: btrfs_check_super_valid: Allow 4096 as stripesize
  btrfs: remove build fixup for qgroup_account_snapshot
  btrfs: use new error message helper in qgroup_account_snapshot
  btrfs: avoid blocking open_ctree from cleaner_kthread
  Btrfs: don't BUG_ON() in btrfs_orphan_add
  btrfs: account for non-CoW'd blocks in btrfs_abort_transaction
  Btrfs: check if extent buffer is aligned to sectorsize
  btrfs: Use correct format specifier

7 years agoMerge tag 'acpi-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Sat, 18 Jun 2016 06:22:37 +0000 (20:22 -1000)]
Merge tag 'acpi-4.7-rc4' of git://git./linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
 "Revert a recent ACPICA commit that introduced a suspend-to-RAM
  regression on one system due to incorrect information in its ACPI
  tables that had not been taken into consideration at all before (and
  everything worked), but the commit in question started to use it"

* tag 'acpi-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  Revert "ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support for acpi_hw_write()"

7 years agoMerge tag 'pm-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Linus Torvalds [Sat, 18 Jun 2016 06:08:00 +0000 (20:08 -1000)]
Merge tag 'pm-4.7-rc4' of git://git./linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "Fixes for two recent regressions that may lead to degraded performance
  (operating performance points framework, intel_pstate).

  Specifics:

   - Fix a recent regression in the intel_pstate driver that may lead to
     degraded performance on some systems due to missing turbo state
     entry in the table returned by the ACPI _PSS object (Srinivas
     Pandruvada).

   - Fix a recent regression in the OPP (operating performance points)
     framework that may lead to degraded performance on some systems
     where the OPP table is created too early (Viresh Kumar)"

* tag 'pm-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  PM / OPP: Add 'UNKNOWN' status for shared_opp in struct opp_table
  cpufreq: intel_pstate: Adjust _PSS[0] freqeuency if needed

7 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Sat, 18 Jun 2016 05:27:12 +0000 (19:27 -1000)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jikos/hid

Pull HID subsystem fixes from Jiri Kosina:

 - kernel panic fix in hid-elo from Oliver Neukum

 - Surface Pro 3 device quirk from Benjamin Tissoires

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: multitouch: Add MT_QUIRK_NOT_SEEN_MEANS_UP to Surface Pro 3
  HID: elo: kill not flush the work

7 years agoisa: Dummy isa_register_driver should return error code
William Breathitt Gray [Mon, 9 May 2016 13:39:50 +0000 (09:39 -0400)]
isa: Dummy isa_register_driver should return error code

The inline isa_register_driver stub simply allows compilation on systems
with CONFIG_ISA disabled; the dummy isa_register_driver does not
register an isa_driver at all. The inline isa_register_driver should
return -ENODEV to indicate lack of support when attempting to register
an isa_driver on such a system with CONFIG_ISA disabled.

Cc: Matthew Wilcox <matthew@wil.cx>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Tested-by: Ye Xiaolong
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoisa: Call isa_bus_init before dependent ISA bus drivers register
William Breathitt Gray [Wed, 11 May 2016 21:01:40 +0000 (17:01 -0400)]
isa: Call isa_bus_init before dependent ISA bus drivers register

The isa_bus_init function must be called before drivers which utilize
the ISA bus driver are registered. A race condition for initilization
exists if device_initcall is used (the isa_bus_init callback is placed
in the same initcall level as dependent drivers which use module_init).
This patch ensures that isa_bus_init is called first by utilizing
postcore_initcall in favor of device_initcall.

Fixes: a5117ba7da37 ("[PATCH] Driver model: add ISA bus")
Cc: Rene Herman <rene.herman@keyaccess.nl>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agowatchdog: ebc-c384_wdt: Allow build for X86_64
William Breathitt Gray [Fri, 27 May 2016 22:09:27 +0000 (18:09 -0400)]
watchdog: ebc-c384_wdt: Allow build for X86_64

With the introduction of the ISA_BUS_API Kconfig option, ISA-style
drivers may be built for X86_64 architectures. This patch changes the
ISA Kconfig option dependency of the WinSystems EBC-C384 watchdog timer
driver to ISA_BUS_API, thus allowing it to build for X86_64 as it is
expected to.

Cc: Wim Van Sebroeck <wim@iguana.be>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoiio: stx104: Allow build for X86_64
William Breathitt Gray [Fri, 27 May 2016 22:09:08 +0000 (18:09 -0400)]
iio: stx104: Allow build for X86_64

With the introduction of the ISA_BUS_API Kconfig option, ISA-style
drivers may be built for X86_64 architectures. This patch changes the
ISA Kconfig option dependency of the Apex Embedded Systems STX104 DAC
driver to ISA_BUS_API, thus allowing it to build for X86_64 as it is
expected to.

Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agogpio: Allow PC/104 devices on X86_64
William Breathitt Gray [Fri, 27 May 2016 22:08:56 +0000 (18:08 -0400)]
gpio: Allow PC/104 devices on X86_64

With the introduction of the ISA_BUS_API Kconfig option, ISA-style
drivers may be built for X86_64 architectures. This patch changes the
ISA Kconfig option dependency of the PC/104 drivers to ISA_BUS_API, thus
allowing them to build for X86_64 as they are expected to.

Cc: Alexandre Courbot <gnurou@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoisa: Allow ISA-style drivers on modern systems
William Breathitt Gray [Fri, 27 May 2016 22:08:27 +0000 (18:08 -0400)]
isa: Allow ISA-style drivers on modern systems

Several modern devices, such as PC/104 cards, are expected to run on
modern systems via an ISA bus interface. Since ISA is a legacy interface
for most modern architectures, ISA support should remain disabled in
general. Support for ISA-style drivers should be enabled on a per driver
basis.

To allow ISA-style drivers on modern systems, this patch introduces the
ISA_BUS_API and ISA_BUS Kconfig options. The ISA bus driver will now
build conditionally on the ISA_BUS_API Kconfig option, which defaults to
the legacy ISA Kconfig option. The ISA_BUS Kconfig option allows the
ISA_BUS_API Kconfig option to be selected on architectures which do not
enable ISA (e.g. X86_64).

The ISA_BUS Kconfig option is currently only implemented for X86
architectures. Other architectures may have their own ISA_BUS Kconfig
options added as required.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>