1. 08 Sep, 2016 12 commits
    • Sriharsha Basavapatna's avatar
      be2net: Support UE recovery in BEx/Skyhawk adapters · 710f3e59
      Sriharsha Basavapatna authored
      This patch supports recovery from UEs caused due to Transient Parity
      Errors (TPE), in BE2, BE3 and Skyhawk adapters. This change avoids
      system reboot when such errors occur. The driver recovers from these
      errors such that the adapter resumes full operational status as prior
      to the UE.
      
      Following is the list of changes in the driver to support this:
      
      o The driver registers its UE recoverable capability with ARM FW at init
      time. This also allows the driver to know if the feature is supported in
      the FW.
      
      o As the UE recovery requires precise time bound processing, the driver
      creates its own error recovery work queue with a single worker thread (per
      module, shared across functions).
      
      o Each function runs an error detection task at an interval of 1 second as
      required by the FW. The error detection logic already exists for BEx/SH,
      but it now runs in the context of a separate worker thread.
      
      o When an error is detected by the task, if it is recoverable, the PF0
      driver instance initiates a soft reset, while other PF driver instances
      wait for the reset to complete and the chip to become ready. Once
      the chip is ready, all driver instances including PF0, resume to
      reinitialize the respective functions.
      
      o The PF0 driver checks for some recovery criteria, to determine if the
      recovery can be initiated. If the criteria is not met, the PF0 driver does
      not initiate a soft reset, it retains the existing behavior to stop
      further processing and requires a reboot to get the chip to operational
      state again.
      
      o To allow each function to share the workq, while also making progress in
      its recovery process, a per-function recovery state machine is used.
      The per-function tasks avoid blocking operations like msleep() while in
      this state machine (until reinit state) and instead reschedule for the
      required delay.
      
      o With these changes, the existing error recovery code for Lancer also
      runs in the context of the new worker thread.
      Signed-off-by: default avatarSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      710f3e59
    • Linus Walleij's avatar
      net: smsc911x: request and deassert optional RESET GPIO · dd0cb7db
      Linus Walleij authored
      On some systems (such as the Qualcomm APQ8060 Dragonboard) the
      RESET signal of the SMSC911x is not pulled up by a resistor (or
      the internal pull-up that will pull it up if the pin is not
      even connected) but instead connected to a GPIO line, so that
      the operating system must explicitly deassert RESET before use.
      
      Support this in the SMSC911x driver so this ethernet connector
      can be used on such targets.
      
      Notice that we request the line to go logical low (deassert)
      whilst the line on the actual component is active low. This
      is managed in the respective hardware description when
      specifying the GPIO line with e.g. device tree or ACPI. With
      device tree it looks like this in one case:
      
        reset-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>;
      
      Which means that logically requesting the RESET line to be
      deasserted will result in the line being driven high, taking
      the device out of reset.
      
      Cc: Jeremy Linton <jeremy.linton@arm.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarJeremy Linton <jeremy.linton@arm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dd0cb7db
    • Linus Walleij's avatar
      net: smsc911x: augment device tree bindings · 216559d9
      Linus Walleij authored
      This adds device tree bindings for:
      
      - An optional GPIO line for releasing the RESET signal to the
        SMSC911x devices
      
      - An optional PME (power management event) interrupt line that
        can be utilized to wake up the system on network activity.
        This signal exist on all the SMSC911x devices, it is just not
        very often routed.
      
      Both these lines are routed to the SoC on the Qualcomm APQ8060
      Dragonboard and thus needs to be bound in the device tree.
      
      Cc: devicetree@vger.kernel.org
      Cc: Jeremy Linton <jeremy.linton@arm.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      216559d9
    • David S. Miller's avatar
      Merge branch 'qed-debug-data-collection' · e6f3f120
      David S. Miller authored
      Tomer Tayar says:
      
      ====================
      qed*: Debug data collection
      
      This patch series adds the support of debug data collection in the qed driver,
      and the means to extract it in the qede driver via the get_regs operation.
      
      Changes from V1:
      - Respin of the series after rebasing next-next.
      - Remove the first patch as it seems that its V1 version was already applied
        (commit '4102426f').
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6f3f120
    • Tomer Tayar's avatar
    • Tomer Tayar's avatar
      qed: Add support for debug data collection · c965db44
      Tomer Tayar authored
      This patch adds the support for dumping and formatting the HW/FW debug data.
      Signed-off-by: default avatarTomer Tayar <Tomer.Tayar@qlogic.com>
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c965db44
    • Oliver Neukum's avatar
      kaweth: remove obsolete debugging statements · 936f0600
      Oliver Neukum authored
      SOme statements in the driver only served to inform
      which functions were entered. Ftrace can do that just as good without
      needing memory. Remove the statements.
      Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      936f0600
    • Baoyou Xie's avatar
      qed: add missing header dependencies · 72e8d5fd
      Baoyou Xie authored
      We get 4 warnings when building kernel with W=1:
      drivers/net/ethernet/qlogic/qed/qed_selftest.c:6:5: warning: no previous prototype for 'qed_selftest_memory' [-Wmissing-prototypes]
      drivers/net/ethernet/qlogic/qed/qed_selftest.c:19:5: warning: no previous prototype for 'qed_selftest_interrupt' [-Wmissing-prototypes]
      drivers/net/ethernet/qlogic/qed/qed_selftest.c:32:5: warning: no previous prototype for 'qed_selftest_register' [-Wmissing-prototypes]
      drivers/net/ethernet/qlogic/qed/qed_selftest.c:55:5: warning: no previous prototype for 'qed_selftest_clock' [-Wmissing-prototypes]
      
      In fact, these functions are declared in qed_selftest.h, so this patch
      add missing header dependencies.
      Signed-off-by: default avatarBaoyou Xie <baoyou.xie@linaro.org>
      Acked-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      72e8d5fd
    • Lorenzo Colitti's avatar
      net: diag: make udp_diag_destroy work for mapped addresses. · f95bf346
      Lorenzo Colitti authored
      udp_diag_destroy does look up the IPv4 UDP hashtable for mapped
      addresses, but it gets the IPv4 address to look up from the
      beginning of the IPv6 address instead of the end.
      
      Tested: https://android-review.googlesource.com/269874
      Fixes: 5d77dca8 ("net: diag: support SOCK_DESTROY for UDP sockets")
      Signed-off-by: default avatarLorenzo Colitti <lorenzo@google.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f95bf346
    • Andrey Vagin's avatar
      netlink: don't forget to release a rhashtable_iter structure · 733ade23
      Andrey Vagin authored
      This bug was detected by kmemleak:
      unreferenced object 0xffff8804269cc3c0 (size 64):
        comm "criu", pid 1042, jiffies 4294907360 (age 13.713s)
        hex dump (first 32 bytes):
          a0 32 cc 2c 04 88 ff ff 00 00 00 00 00 00 00 00  .2.,............
          00 01 00 00 00 00 ad de 00 02 00 00 00 00 ad de  ................
        backtrace:
          [<ffffffff8184dffa>] kmemleak_alloc+0x4a/0xa0
          [<ffffffff8124720f>] kmem_cache_alloc_trace+0x10f/0x280
          [<ffffffffa02864cc>] __netlink_diag_dump+0x26c/0x290 [netlink_diag]
      
      v2: don't remove a reference on a rhashtable_iter structure to
          release it from netlink_diag_dump_done
      
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Fixes: ad202074 ("netlink: Use rhashtable walk interface in diag dump")
      Signed-off-by: default avatarAndrei Vagin <avagin@openvz.org>
      Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      733ade23
    • David S. Miller's avatar
      Merge tag 'rxrpc-rewrite-20160907-2' of... · 457b4139
      David S. Miller authored
      Merge tag 'rxrpc-rewrite-20160907-2' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
      
      David Howells says:
      
      ====================
      rxrpc: Local abort tracepoint
      
      Here are two patches.  They need to be applied on top of the just-posted
      call refcount overhaul patch:
      
       (1) Fix the return value of some call completion helpers.
      
       (2) Add a tracepoint that allows local aborts to be debugged.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      457b4139
    • David S. Miller's avatar
      Merge tag 'rxrpc-rewrite-20160907-1' of... · 9103e04b
      David S. Miller authored
      Merge tag 'rxrpc-rewrite-20160907-1' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
      
      David Howells says:
      
      ====================
      rxrpc: Overhaul call refcounting
      
      Here's a set of mostly small patches leading up to one big one.
      
      The big patch at the end of the series overhauls how rxrpc_call refcounting
      is handled, making it more sane so that calls bound to user IDs are _only_
      released from socket operations or kernel API functions.  Further, the
      patch stops calls from holding refs on their parent socket - which can
      prevent the socket from being cleaned up.
      
      The second largest patch improves the call tracking tracepoint by providing
      extra information about the situation in which gets and puts occur.  This
      allows distinctions to be drawn between refs held by the socket user ID
      tree, refs held by the work queue (to be implemented by a future patch) and
      other refs.
      
      The other patches include a couple of cleanups and some simple alterations
      to avoid NULL pointer dereferences in the big patch.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9103e04b
  2. 07 Sep, 2016 10 commits
    • David Howells's avatar
      rxrpc: Add tracepoint for working out where aborts happen · 5a42976d
      David Howells authored
      Add a tracepoint for working out where local aborts happen.  Each
      tracepoint call is labelled with a 3-letter code so that they can be
      distinguished - and the DATA sequence number is added too where available.
      
      rxrpc_kernel_abort_call() also takes a 3-letter code so that AFS can
      indicate the circumstances when it aborts a call.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      5a42976d
    • David Howells's avatar
      rxrpc: Fix returns of call completion helpers · e8d6bbb0
      David Howells authored
      rxrpc_set_call_completion() returns bool, not int, so the ret variable
      should match this.
      
      rxrpc_call_completed() and __rxrpc_call_completed() should return the value
      of rxrpc_set_call_completion().
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      e8d6bbb0
    • David Howells's avatar
      rxrpc: Calls shouldn't hold socket refs · 8d94aa38
      David Howells authored
      rxrpc calls shouldn't hold refs on the sock struct.  This was done so that
      the socket wouldn't go away whilst the call was in progress, such that the
      call could reach the socket's queues.
      
      However, we can mark the socket as requiring an RCU release and rely on the
      RCU read lock.
      
      To make this work, we do:
      
       (1) rxrpc_release_call() removes the call's call user ID.  This is now
           only called from socket operations and not from the call processor:
      
      	rxrpc_accept_call() / rxrpc_kernel_accept_call()
      	rxrpc_reject_call() / rxrpc_kernel_reject_call()
      	rxrpc_kernel_end_call()
      	rxrpc_release_calls_on_socket()
      	rxrpc_recvmsg()
      
           Though it is also called in the cleanup path of
           rxrpc_accept_incoming_call() before we assign a user ID.
      
       (2) Pass the socket pointer into rxrpc_release_call() rather than getting
           it from the call so that we can get rid of uninitialised calls.
      
       (3) Fix call processor queueing to pass a ref to the work queue and to
           release that ref at the end of the processor function (or to pass it
           back to the work queue if we have to requeue).
      
       (4) Skip out of the call processor function asap if the call is complete
           and don't requeue it if the call is complete.
      
       (5) Clean up the call immediately that the refcount reaches 0 rather than
           trying to defer it.  Actual deallocation is deferred to RCU, however.
      
       (6) Don't hold socket refs for allocated calls.
      
       (7) Use the RCU read lock when queueing a message on a socket and treat
           the call's socket pointer according to RCU rules and check it for
           NULL.
      
           We also need to use the RCU read lock when viewing a call through
           procfs.
      
       (8) Transmit the final ACK/ABORT to a client call in rxrpc_release_call()
           if this hasn't been done yet so that we can then disconnect the call.
           Once the call is disconnected, it won't have any access to the
           connection struct and the UDP socket for the call work processor to be
           able to send the ACK.  Terminal retransmission will be handled by the
           connection processor.
      
       (9) Release all calls immediately on the closing of a socket rather than
           trying to defer this.  Incomplete calls will be aborted.
      
      The call refcount model is much simplified.  Refs are held on the call by:
      
       (1) A socket's user ID tree.
      
       (2) A socket's incoming call secureq and acceptq.
      
       (3) A kernel service that has a call in progress.
      
       (4) A queued call work processor.  We have to take care to put any call
           that we failed to queue.
      
       (5) sk_buffs on a socket's receive queue.  A future patch will get rid of
           this.
      
      Whilst we're at it, we can do:
      
       (1) Get rid of the RXRPC_CALL_EV_RELEASE event.  Release is now done
           entirely from the socket routines and never from the call's processor.
      
       (2) Get rid of the RXRPC_CALL_DEAD state.  Calls now end in the
           RXRPC_CALL_COMPLETE state.
      
       (3) Get rid of the rxrpc_call::destroyer work item.  Calls are now torn
           down when their refcount reaches 0 and then handed over to RCU for
           final cleanup.
      
       (4) Get rid of the rxrpc_call::deadspan timer.  Calls are cleaned up
           immediately they're finished with and don't hang around.
           Post-completion retransmission is handled by the connection processor
           once the call is disconnected.
      
       (5) Get rid of the dead call expiry setting as there's no longer a timer
           to set.
      
       (6) rxrpc_destroy_all_calls() can just check that the call list is empty.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      8d94aa38
    • David Howells's avatar
      rxrpc: Use rxrpc_is_service_call() rather than rxrpc_conn_is_service() · 6543ac52
      David Howells authored
      Use rxrpc_is_service_call() rather than rxrpc_conn_is_service() if the call
      is available just in case call->conn is NULL.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      6543ac52
    • David Howells's avatar
      rxrpc: Pass the connection pointer to rxrpc_post_packet_to_call() · 8b7fac50
      David Howells authored
      Pass the connection pointer to rxrpc_post_packet_to_call() as the call
      might get disconnected whilst we're looking at it, but the connection
      pointer determined by rxrpc_data_read() is guaranteed by RCU for the
      duration of the call.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      8b7fac50
    • David Howells's avatar
      rxrpc: Cache the security index in the rxrpc_call struct · 278ac0cd
      David Howells authored
      Cache the security index in the rxrpc_call struct so that we can get at it
      even when the call has been disconnected and the connection pointer
      cleared.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      278ac0cd
    • David Howells's avatar
      rxrpc: Use call->peer rather than call->conn->params.peer · f4fdb352
      David Howells authored
      Use call->peer rather than call->conn->params.peer to avoid the possibility
      of call->conn being NULL and, whilst we're at it, check it for NULL before we
      access it.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      f4fdb352
    • David Howells's avatar
      rxrpc: Improve the call tracking tracepoint · fff72429
      David Howells authored
      Improve the call tracking tracepoint by showing more differentiation
      between some of the put and get events, including:
      
        (1) Getting and putting refs for the socket call user ID tree.
      
        (2) Getting and putting refs for queueing and failing to queue the call
            processor work item.
      
      Note that these aren't necessarily used in this patch, but will be taken
      advantage of in future patches.
      
      An enum is added for the event subtype numbers rather than coding them
      directly as decimal numbers and a table of 3-letter strings is provided
      rather than a sequence of ?: operators.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      fff72429
    • David Howells's avatar
      rxrpc: Delete unused rxrpc_kernel_free_skb() · e796cb41
      David Howells authored
      Delete rxrpc_kernel_free_skb() as it's unused.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      e796cb41
    • David Howells's avatar
      rxrpc: Whitespace cleanup · 71a17de3
      David Howells authored
      Remove some whitespace.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      71a17de3
  3. 06 Sep, 2016 18 commits