1. 30 Aug, 2016 12 commits
    • David Howells's avatar
      rxrpc: Don't expose skbs to in-kernel users · 14df1aee
      David Howells authored
      Don't expose skbs to in-kernel users, such as the AFS filesystem, but
      instead provide a notification hook the indicates that a call needs
      attention and another that indicates that there's a new call to be
      collected.
      
      This makes the following possibilities more achievable:
      
       (1) Call refcounting can be made simpler if skbs don't hold refs to calls.
      
       (2) skbs referring to non-data events will be able to be freed much sooner
           rather than being queued for AFS to pick up as rxrpc_kernel_recv_data
           will be able to consult the call state.
      
       (3) We can shortcut the receive phase when a call is remotely aborted
           because we don't have to go through all the packets to get to the one
           cancelling the operation.
      
       (4) It makes it easier to do encryption/decryption directly between AFS's
           buffers and sk_buffs.
      
       (5) Encryption/decryption can more easily be done in the AFS's thread
           contexts - usually that of the userspace process that issued a syscall
           - rather than in one of rxrpc's background threads on a workqueue.
      
       (6) AFS will be able to wait synchronously on a call inside AF_RXRPC.
      
      To make this work, the following interface function has been added:
      
           int rxrpc_kernel_recv_data(
      		struct socket *sock, struct rxrpc_call *call,
      		void *buffer, size_t bufsize, size_t *_offset,
      		bool want_more, u32 *_abort_code);
      
      This is the recvmsg equivalent.  It allows the caller to find out about the
      state of a specific call and to transfer received data into a buffer
      piecemeal.
      
      afs_extract_data() and rxrpc_kernel_recv_data() now do all the extraction
      logic between them.  They don't wait synchronously yet because the socket
      lock needs to be dealt with.
      
      Five interface functions have been removed:
      
      	rxrpc_kernel_is_data_last()
          	rxrpc_kernel_get_abort_code()
          	rxrpc_kernel_get_error_number()
          	rxrpc_kernel_free_skb()
          	rxrpc_kernel_data_consumed()
      
      As a temporary hack, sk_buffs going to an in-kernel call are queued on the
      rxrpc_call struct (->knlrecv_queue) rather than being handed over to the
      in-kernel user.  To process the queue internally, a temporary function,
      temp_deliver_data() has been added.  This will be replaced with common code
      between the rxrpc_recvmsg() path and the kernel_rxrpc_recv_data() path in a
      future patch.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      14df1aee
    • David Howells's avatar
      rxrpc: Pass struct socket * to more rxrpc kernel interface functions · 4de48af6
      David Howells authored
      Pass struct socket * to more rxrpc kernel interface functions.  They should
      be starting from this rather than the socket pointer in the rxrpc_call
      struct if they need to access the socket.
      
      I have left:
      
      	rxrpc_kernel_is_data_last()
      	rxrpc_kernel_get_abort_code()
      	rxrpc_kernel_get_error_number()
      	rxrpc_kernel_free_skb()
      	rxrpc_kernel_data_consumed()
      
      unmodified as they're all about to be removed (and, in any case, don't
      touch the socket).
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      4de48af6
    • David Howells's avatar
      rxrpc: Use call->peer rather than going to the connection · ea82aaec
      David Howells authored
      Use call->peer rather than call->conn->params.peer as call->conn may become
      NULL.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      ea82aaec
    • David Howells's avatar
      rxrpc: Provide a way for AFS to ask for the peer address of a call · 8324f0bc
      David Howells authored
      Provide a function so that kernel users, such as AFS, can ask for the peer
      address of a call:
      
         void rxrpc_kernel_get_peer(struct rxrpc_call *call,
      			      struct sockaddr_rxrpc *_srx);
      
      In the future the kernel service won't get sk_buffs to look inside.
      Further, this allows us to hide any canonicalisation inside AF_RXRPC for
      when IPv6 support is added.
      
      Also propagate this through to afs_find_server() and issue a warning if we
      can't handle the address family yet.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      8324f0bc
    • David Howells's avatar
      afs: Need linux/random.h · e0661dfc
      David Howells authored
      We should #include linux/random.h to use get_random().
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      e0661dfc
    • David Howells's avatar
      afs: Miscellaneous simple cleanups · 378c9c96
      David Howells authored
      Remove one #ifndef'd-out variable and a couple of excessive blank lines.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      378c9c96
    • David Howells's avatar
      rxrpc: Trace rxrpc_call usage · e34d4234
      David Howells authored
      Add a trace event for debuging rxrpc_call struct usage.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      e34d4234
    • David Howells's avatar
      rxrpc: Calls should only have one terminal state · f5c17aae
      David Howells authored
      Condense the terminal states of a call state machine to a single state,
      plus a separate completion type value.  The value is then set, along with
      error and abort code values, only when the call is transitioned to the
      completion state.
      
      Helpers are provided to simplify this.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      f5c17aae
    • David Howells's avatar
      rxrpc: Fix a potential NULL-pointer deref in rxrpc_abort_calls · ccbd3dbe
      David Howells authored
      The call pointer in a channel on a connection will be NULL if there's no
      active call on that channel.  rxrpc_abort_calls() needs to check for this
      before trying to take the call's state_lock.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      ccbd3dbe
    • David S. Miller's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 3201a39b
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      100GbE Intel Wired LAN Driver Updates 2016-08-29
      
      This series contains updates to fm10k only.
      
      Jake provides all the changes in this series starting with fixes an issue
      where VF devices may fail during an unbind/bind and we will never zero
      the reference counter for the pci_dev structure.  Updated the hot path
      to use SW counters instead of checking for hardware Tx pending for
      possible transmit hangs, which will improve performance.  Fixed the NAPI
      budget accounting so that fm10k_poll will return actual work done,
      capped at (budget - 1) instead of returning 0.  Added a check to ensure
      that the device is in the normal IO state before continuing to probe,
      which allows us to give a more descriptive message of what is wrong
      in the case of uncorrectable AER error.  In preparation for adding Geneve
      Rx offload support, refactored the current VXLAN offload flow to be a bit
      more generic.  Added support for receive offloads on one Geneve tunnel.
      Ensure that other bits in the RXQCTL register do not get cleared, to
      make sure that bits related to queue ownership are maintained.  Fixed
      an issue in queue ownership assignment which casued a race condition
      between the PF and the VF such that potentially a VF could cause FUM
      fault errors due to normal PF/VF driver behavior.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3201a39b
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 6abdd5f5
      David S. Miller authored
      All three conflicts were cases of simple overlapping
      changes.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6abdd5f5
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-linus-v4.8-rc5' of... · e4e98c46
      Linus Torvalds authored
      Merge tag 'hwmon-for-linus-v4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fix from Guenter Roeck:
       "Add missing sysfs attribute group terminator to it87 driver"
      
      * tag 'hwmon-for-linus-v4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (it87) Add missing sysfs attribute group terminator
      e4e98c46
  2. 29 Aug, 2016 28 commits
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · b8927721
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Fix bugs that could cause kernel deadlocks or file system corruption
        while moving xattrs to expand the extended inode.
      
        Also add some sanity checks to the block group descriptors to make
        sure we don't end up overwriting the superblock"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: avoid deadlock when expanding inode size
        ext4: properly align shifted xattrs when expanding inodes
        ext4: fix xattr shifting when expanding inodes part 2
        ext4: fix xattr shifting when expanding inodes
        ext4: validate that metadata blocks do not overlap superblock
        ext4: reserve xattr index for the Hurd
      b8927721
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 1f6a563e
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Segregate namespaces properly in conntrack dumps, from Liping Zhang.
      
       2) tcp listener refcount fix in netfilter tproxy, from Eric Dumazet.
      
       3) Fix timeouts in qed driver due to xmit_more, from Yuval Mintz.
      
       4) Fix use-after-free in tcp_xmit_retransmit_queue().
      
       5) Userspace header fixups (use of __u32, missing includes, etc.) from
          Mikko Rapeli.
      
       6) Further refinements to fragmentation wrt gso and tunnels, from
          Shmulik Ladkani.
      
       7) Trigger poll correctly for zero length UDP packets, from Eric
          Dumazet.
      
       8) TCP window scaling fix, also from Eric Dumazet.
      
       9) SLAB_DESTROY_BY_RCU is not relevant any more for UDP sockets.
      
      10) Module refcount leak in qdisc_create_dflt(), from Eric Dumazet.
      
      11) Fix deadlock in cp_rx_poll() of 8139cp driver, from Gao Feng.
      
      12) Memory leak in rhashtable's alloc_bucket_locks(), from Eric Dumazet.
      
      13) Add new device ID to alx driver, from Owen Lin.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (83 commits)
        Add Killer E2500 device ID in alx driver.
        net: smc91x: fix SMC accesses
        Documentation: networking: dsa: Remove platform device TODO
        net/mlx5: Increase number of ethtool steering priorities
        net/mlx5: Add error prints when validate ETS failed
        net/mlx5e: Fix memory leak if refreshing TIRs fails
        net/mlx5e: Add ethtool counter for TX xmit_more
        net/mlx5e: Fix ethtool -g/G rx ring parameter report with striding RQ
        net/mlx5e: Don't wait for SQ completions on close
        net/mlx5e: Don't post fragmented MPWQE when RQ is disabled
        net/mlx5e: Don't wait for RQ completions on close
        net/mlx5e: Limit UMR length to the device's limitation
        rhashtable: fix a memory leak in alloc_bucket_locks()
        sfc: fix potential stack corruption from running past stat bitmask
        team: loadbalance: push lacpdus to exact delivery
        net: hns: dereference ppe_cb->ppe_common_cb if it is non-null
        8139cp: Fix one possible deadloop in cp_rx_poll
        i40e: Change some init flow for the client
        Revert "phy: IRQ cannot be shared"
        net: dsa: bcm_sf2: Fix race condition while unmasking interrupts
        ...
      1f6a563e
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v4.8-4' of... · cf4d3779
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v4.8-4' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86
      
      Pull x86 platform driver fixes from Darren Hart:
       "Remove module related code from two drivers that are only configurable
        as built-in: intel_pmic_gpio and platform/olpc"
      
      * tag 'platform-drivers-x86-v4.8-4' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
        intel_pmic_gpio: Make explicitly non-modular
        platform/olpc: Make ec explicitly non-modular
      cf4d3779
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 2a90309e
      Linus Torvalds authored
      Pull powerpc fixes from Ben Herrenschmidt:
       "This was meant to be sent early last week, but I has a change pending
        on one of the fixes and other things made me forget all about.  Ugh.
      
        We have some misc fixes for powerpc 4.8.  Some trivial bits and some
        regressions, and a trivial cleanup or two that I saw no point in
        letting rot in patchwork"
      
      * tag 'powerpc-4.8-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: signals: Discard transaction state from signal frames
        powerpc/powernv : Drop reference added by kset_find_obj()
        powerpc/tm: do not use r13 for tabort_syscall
        powerpc: move hmi.c to arch/powerpc/kvm/
        powerpc: sysdev: cpm: fix gpio save_regs functions
        powerpc/pseries: PACA save area fix for MCE vs MCE
        powerpc/pseries: PACA save area fix for general exception vs MCE
        powerpc/prom: Fix sub-processor option passed to ibm, client-architecture-support
        powerpc, hotplug: Avoid to touch non-existent cpumasks.
        powerpc: migrate exception table users off module.h and onto extable.h
        powerpc/powernv/pci: fix iterator signedness
        powerpc/pseries: use pci_host_bridge.release_fn() to kfree(phb)
        cxl: use pcibios_free_controller_deferred() when removing vPHBs
        powerpc: mpc8349emitx: Delete unnecessary assignment for the field "owner"
        powerpc/512x: Delete unnecessary assignment for the field "owner"
        drivers/macintosh: Delete owner assignment
        powerpc: cputhreads: Add missing include file
      2a90309e
    • Jean Delvare's avatar
      hwmon: (it87) Add missing sysfs attribute group terminator · 3c329263
      Jean Delvare authored
      Attribute array it87_attributes_in lacks its NULL terminator,
      causing random behavior when operating on the attribute group.
      
      Fixes: 52929715 ("hwmon: (it87) Use is_visible for voltage sensors")
      Signed-off-by: default avatarJean Delvare <jdelvare@suse.de>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      3c329263
    • Jacob Keller's avatar
      fm10k: don't re-map queues when a mailbox message suffices · 325782a1
      Jacob Keller authored
      When the PF assigns a new MAC address to a VF it uses the base address
      registers to store the MAC address. This allows a VF which loads after
      this setup the ability to get the initial address without having to wait
      for a mailbox message. Unfortunately to do this, the PF must take queue
      ownership away from the VF, which can cause fault errors when there is
      already an active VF driver.
      
      This queue ownership assignment causes race condition between the PF and
      the VF such that potentially a VF can cause FUM fault errors due to
      normal PF/VF driver behavior.
      
      It is not safe to simply allow the PF to write the base address
      registers without taking queue ownership back as the PF must also
      disable the queues, and this would impact active VF use. The current
      code is safe because the queue ownership will prevent the VF from
      actually writing but does trigger the FUM fault.
      
      We can do better by simply avoiding the register write process when
      a mailbox message suffices. If the message can be sent over the mailbox,
      then we will not perform the queue ownership assignment and we won't
      update the base address to be the same as the MAC address.
      
      We do still have to write the TXQCTL registers in order to update the
      VID of the queue. This is necessary because the TXQCTL register is
      read-only from the VF, and thus the VF cannot do this for itself. This
      register does not need to wait for the Tx queue to be disabled and is
      safe for the PF to write during normal VF operation, so we move this
      write to the top of the function above the mailbox message. Without
      this, the TXQCTL register would be misconfigured and cause the VF to Tx
      hang.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      325782a1
    • Jacob Keller's avatar
      fm10k: don't clear the RXQCTL register when enabling or disabling queues · c689eff1
      Jacob Keller authored
      Ensure that other bits in the RXQCTL register do not get cleared. This
      ensures that bits related to queue ownership are maintained.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      c689eff1
    • Jacob Keller's avatar
    • Jacob Keller's avatar
      fm10k: add support for Rx offloads on one Geneve tunnel · 1ad78292
      Jacob Keller authored
      Similar to how we handle VXLAN offload, enable support for a single
      Geneve tunnel.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1ad78292
    • Jacob Keller's avatar
      fm10k: rework vxlan_port offload before adding geneve support · f92e0e48
      Jacob Keller authored
      In preparation for adding Geneve Rx offload support, refactor the
      current VXLAN offload flow to be a bit more generic so that it will be
      easier to add the new Geneve code. The fm10k hardware supports one VXLAN
      and one Geneve tunnel, so we will eventually treat the VXLAN and Geneve
      tunnels identically. To this end, factor out the code that handles the
      current list so that we can use the generic flow for both tunnels in the
      next patch.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      f92e0e48
    • Jacob Keller's avatar
      fm10k: don't try to stop queues if we've lost hw_addr · 5f45c830
      Jacob Keller authored
      In the event of a surprise remove, we expect the driver to go down,
      which includes calling .stop_hw(). However, this function will return an
      error because the queues won't appear to cleanly disable. Prevent this
      and avoid the unnecessary checks by just returning when
      FM10K_REMOVED(hw->hw_addr) is true.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      5f45c830
    • Jacob Keller's avatar
      fm10k: don't continue probe if PCI device not in normal IO state · 18095937
      Jacob Keller authored
      In the event of an uncorrectable AER error occurring when the driver has
      not loaded, the recovery routines are not done. This is done because
      future loads of the driver may not be aware of the IO state and may not
      be able to recover at all. In this case, when we next load the driver it
      fails due to what appears to be a surprise remove event. Instead, add
      a check to ensure that the device is in the normal IO state before
      continuing to probe. This allows us to give a more descriptive message
      of what is wrong.
      
      Without this change, the driver will attempt to probe up to our first
      call of .reset_hw() which will be unable to read registers and act as if
      a surprise remove event occurred.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      18095937
    • Jacob Keller's avatar
    • Jacob Keller's avatar
      fm10k: NAPI polling routine must return actual work done · e5fbfb78
      Jacob Keller authored
      When fm10k_poll fully cleans rings it returns 0. This is incorrect as it
      messes up the budget accounting in the core NAPI code. Fix this by
      returning actual work done, capped at budget - 1 since the core doesn't
      expect a return of the full budget when the driver modifies the NAPI
      status.
      
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: Venkatesh Srinivas <venkateshs@google.com>
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e5fbfb78
    • Jacob Keller's avatar
      fm10k: prefer READ_ONCE instead of ACCESS_ONCE · ce4dad2c
      Jacob Keller authored
      While technically not needed, as all our uses of ACCESS_ONCE are scalar
      types, we already use READ_ONCE in a few places, and for code
      readability we can swap all the uses of the older ACCESS_ONCE into
      READ_ONCE.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      ce4dad2c
    • Jacob Keller's avatar
      fm10k: remove fm10k_get_reta_size from namespace · 88cdcfec
      Jacob Keller authored
      The function is only used in fm10k_ethtool.c, so make it static.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      88cdcfec
    • Jacob Keller's avatar
    • Jacob Keller's avatar
      fm10k: use software values when checking for Tx hangs in hot path · 5b9e4432
      Jacob Keller authored
      A previous patch added support to check for hardware Tx pending in the
      fm10k_down routine. This support was intended to ensure that we
      accurately check what the hardware state is. However, checking for Tx
      hangs in this manor during the hotpath results in a large performance
      hit. Avoid this by making the hotpath check use the SW counters instead.
      
      Fixes: a0f53cf49cb0 ("fm10k: use actual hardware registers when checking for pending Tx", 2016-06-08)
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      5b9e4432
    • Jacob Keller's avatar
      fm10k: fix PCI device enable_cnt leak in .io_slot_reset · e59a393d
      Jacob Keller authored
      A previous patch removed the pci_disable_device() call in
      .io_error_detected. This call corresponded to a pci_enable_device_mem()
      call within .io_slot_reset handler. Change the call here to
      a pci_reenable_device() so that it does not increment and leak the
      enable_cnt reference count for the device. Without this change, VF
      devices may fail during an unbind/bind, and we'll never zero the
      reference counter for the pci_dev structure.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarKrishneil Singh <Krishneil.k.singh@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e59a393d
    • Paul Gortmaker's avatar
      intel_pmic_gpio: Make explicitly non-modular · da43bf0c
      Paul Gortmaker authored
      The Kconfig entry controlling compilation of this code is:
      
      drivers/platform/x86/Kconfig:config GPIO_INTEL_PMIC
      drivers/platform/x86/Kconfig:   bool "Intel PMIC GPIO support"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the couple traces of modular infrastructure use, so that
      when reading the driver there is no doubt it is builtin-only.
      
      We delete the MODULE_LICENSE tag etc. since all that information
      was (or is now) contained at the top of the file in the comments.
      
      We don't replace module.h with init.h since the file already has that.
      
      Cc: Alek Du <alek.du@intel.com>
      Cc: platform-driver-x86@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
      da43bf0c
    • Paul Gortmaker's avatar
      platform/olpc: Make ec explicitly non-modular · f48d1496
      Paul Gortmaker authored
      The Kconfig entry controlling compilation of this code is:
      
      arch/x86/Kconfig:config OLPC
      arch/x86/Kconfig:       bool "One Laptop Per Child support"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the couple traces of modular infrastructure use, so that
      when reading the driver there is no doubt it is builtin-only.
      
      We delete the MODULE_LICENSE tag etc. since all that information
      was (or is now) contained at the top of the file in the comments.
      
      Cc: platform-driver-x86@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Acked-by: default avatarAndres Salomon <dilinger@queued.net>
      Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
      f48d1496
    • Arnd Bergmann's avatar
      net_sched: fix use of uninitialized ethertype variable in cls_flower · 0b498a52
      Arnd Bergmann authored
      The addition of VLAN support caused a possible use of uninitialized
      data if we encounter a zero TCA_FLOWER_KEY_ETH_TYPE key, as pointed
      out by "gcc -Wmaybe-uninitialized":
      
      net/sched/cls_flower.c: In function 'fl_change':
      net/sched/cls_flower.c:366:22: error: 'ethertype' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      This changes the code to only set the ethertype field if it
      was nonzero, as before the patch.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 9399ae9a ("net_sched: flower: Add vlan support")
      Cc: Hadar Hen Zion <hadarh@mellanox.com>
      Cc: Jiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0b498a52
    • Arnd Bergmann's avatar
      net/xgene: fix error handling during reset · f9dc7074
      Arnd Bergmann authored
      The newly added reset logic uses helper functions for the MMIO that
      may fail. However, when the read operation fails, we end up writing
      back uninitialized data to the register, as gcc warns:
      
      drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c: In function 'xgene_enet_link_state':
      drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c:213:2: error: 'data' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c:209:6: note: 'data' was declared here
        u32 data;
      
      We already print a warning to the console log if that happens,
      the best alternative that I can see is skip the rest of the reset
      sequence if the register value cannot be read: Most likely the
      write would fail as well, and if it succeeded, worse things could
      happen.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 3eb7cb9d ("drivers: net: xgene: XFI PCS reset when link is down")
      Cc: Fushen Chen <fchen@apm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9dc7074
    • Vidya Sagar Ravipati's avatar
      net: ethtool: add support for 1000BaseX and missing 10G link modes · 5711a982
      Vidya Sagar Ravipati authored
      This patch enhances ethtool link mode bitmap to include
      missing interface modes for 1G/10G speeds
      
      Changes:
      1000baseX is the mode introduced to cover all 1G Fiber cases.
      All modes under 1000BaseX i.e. 1000BASE-SX, 1000BASE-LX, 1000BASE-LX10
      and 1000BASE-BX10 are not explicitly defined at this moment.
      10G CR,SR,LR and ER link modes are included for 10G speed..
      
      Issue:
      ethtool on  1G/10G SFP port reports Base-T
      as this port supports 1000baseX,10G CR, SR and LR modes.
      
      root@tor-02$ ethtool swp1
      Settings for swp1:
              Supported ports: [ FIBRE ]
              Supported link modes:   1000baseT/Full
                                      10000baseT/Full
              Supported pause frame use: Symmetric Receive-only
              Supports auto-negotiation: Yes
              Advertised link modes:  1000baseT/Full
              Advertised pause frame use: No
              Advertised auto-negotiation: No
              Speed: 10000Mb/s
              Duplex: Full
              Port: FIBRE
              PHYAD: 0
              Transceiver: external
              Auto-negotiation: off
              Current message level: 0x00000000 (0)
      
              Link detected: yes
      
      After fix:
      root@tor-02$ ethtool swp1
      Settings for swp1:
              Supported ports: [ FIBRE ]
              Supported link modes:   1000baseX/Full
                                      10000baseCR/Full
                                      10000baseSR/Full
                                      10000baseLR/Full
                                      10000baseER/Full
              Supported pause frame use: Symmetric Receive-only
              Supports auto-negotiation: Yes
              Advertised link modes:  1000baseT/Full
              Advertised pause frame use: No
              Advertised auto-negotiation: No
              Speed: 10000Mb/s
              Duplex: Full
              Port: FIBRE
              PHYAD: 0
              Transceiver: external
              Auto-negotiation: off
              Current message level: 0x00000000 (0)
              Link detected: yes
      Signed-off-by: default avatarVidya Sagar Ravipati <vidya@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5711a982
    • James Morse's avatar
      amd-xgbe: Reset running devices after resume from hibernate · a039b638
      James Morse authored
      After resume from hibernate on arm64, any amd-xgbe devices that were
      running when we hibernated are reported as down, even when it is not.
      
      Re-plugging the cables does not cause the interface to come back, the
      link must be marked as down then up via 'ip set link' using the serial
      console.
      
      This happens because the device has been power-cycled and possibly
      re-initialised by firmware, whereas the driver's memory structures have
      been restored from the hibernate image and the two do not agree.
      
      Schedule a restart of the device after powerup in case the world changed
      while we were asleep.
      Signed-off-by: default avatarJames Morse <james.morse@arm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a039b638
    • Owen Lin's avatar
      Add Killer E2500 device ID in alx driver. · b99b43bb
      Owen Lin authored
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b99b43bb
    • Eric Dumazet's avatar
      tcp: add tcp_add_backlog() · c9c33212
      Eric Dumazet authored
      When TCP operates in lossy environments (between 1 and 10 % packet
      losses), many SACK blocks can be exchanged, and I noticed we could
      drop them on busy senders, if these SACK blocks have to be queued
      into the socket backlog.
      
      While the main cause is the poor performance of RACK/SACK processing,
      we can try to avoid these drops of valuable information that can lead to
      spurious timeouts and retransmits.
      
      Cause of the drops is the skb->truesize overestimation caused by :
      
      - drivers allocating ~2048 (or more) bytes as a fragment to hold an
        Ethernet frame.
      
      - various pskb_may_pull() calls bringing the headers into skb->head
        might have pulled all the frame content, but skb->truesize could
        not be lowered, as the stack has no idea of each fragment truesize.
      
      The backlog drops are also more visible on bidirectional flows, since
      their sk_rmem_alloc can be quite big.
      
      Let's add some room for the backlog, as only the socket owner
      can selectively take action to lower memory needs, like collapsing
      receive queues or partial ofo pruning.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c9c33212
    • Russell King's avatar
      net: smc91x: fix SMC accesses · 2fb04fdf
      Russell King authored
      Commit b70661c7 ("net: smc91x: use run-time configuration on all ARM
      machines") broke some ARM platforms through several mistakes.  Firstly,
      the access size must correspond to the following rule:
      
      (a) at least one of 16-bit or 8-bit access size must be supported
      (b) 32-bit accesses are optional, and may be enabled in addition to
          the above.
      
      Secondly, it provides no emulation of 16-bit accesses, instead blindly
      making 16-bit accesses even when the platform specifies that only 8-bit
      is supported.
      
      Reorganise smc91x.h so we can make use of the existing 16-bit access
      emulation already provided - if 16-bit accesses are supported, use
      16-bit accesses directly, otherwise if 8-bit accesses are supported,
      use the provided 16-bit access emulation.  If neither, BUG().  This
      exactly reflects the driver behaviour prior to the commit being fixed.
      
      Since the conversion incorrectly cut down the available access sizes on
      several platforms, we also need to go through every platform and fix up
      the overly-restrictive access size: Arnd assumed that if a platform can
      perform 32-bit, 16-bit and 8-bit accesses, then only a 32-bit access
      size needed to be specified - not so, all available access sizes must
      be specified.
      
      This likely fixes some performance regressions in doing this: if a
      platform does not support 8-bit accesses, 8-bit accesses have been
      emulated by performing a 16-bit read-modify-write access.
      
      Tested on the Intel Assabet/Neponset platform, which supports only 8-bit
      accesses, which was broken by the original commit.
      
      Fixes: b70661c7 ("net: smc91x: use run-time configuration on all ARM machines")
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Tested-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2fb04fdf