1. 31 Jan, 2017 2 commits
    • Daniel Kurtz's avatar
      spi: mediatek: Only do dma for 4-byte aligned buffers · 1ce24864
      Daniel Kurtz authored
      Mediatek SPI DMA only works when tx and rx buffer addresses are 4-byte
      aligned.
      
      Unaligned DMA transactions appeared to work previously, since we the
      spi core was incorrectly using the spi_master device for dma, which
      had a 0 dma_mask, and therefore the swiotlb dma map operations were
      falling back to using bounce buffers.  Since each DMA transaction would
      use its own buffer, the mapped starting address of each transaction was
      always aligned.  When doing real DMA, the mapped address will share the
      alignment of the raw tx/rx buffer provided by the SPI user, which may or
      may not be aligned.
      
      If a buffer is not aligned, we cannot use DMA, and must use FIFO based
      transaction instead.
      
      So, this patch implements a scheme that allows using the FIFO for
      arbitrary length transactions (larger than the 32-byte FIFO size) by
      reloading the FIFO in the interrupt handler.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Cc: Leilk Liu <leilk.liu@mediatek.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      1ce24864
    • Daniel Kurtz's avatar
      spi: When no dma_chan map buffers with spi_master's parent · 88b0aa54
      Daniel Kurtz authored
      Back before commit 1dccb598 ("arm64: simplify dma_get_ops"), for
      arm64, devices for which dma_ops were not explicitly set were automatically
      configured to use swiotlb_dma_ops, since this was hard-coded as the
      global "dma_ops" in arm64_dma_init().
      
      Now that global "dma_ops" has been removed, all devices much have their
      dma_ops explicitly set by a call to arch_setup_dma_ops(), otherwise the
      device is assigned dummy_dma_ops, and thus calls to map_sg for such a
      device will fail (return 0).
      
      Mediatek SPI uses DMA but does not use a dma channel.  Support for this
      was added by commit c37f45b5 ("spi: support spi without dma channel
      to use can_dma()"), which uses the master_spi dev to DMA map buffers.
      
      The master_spi device is not a platform device, rather it is created
      in spi_alloc_device(), and therefore its dma_ops are never set.
      
      Therefore, when the mediatek SPI driver when it does DMA (for large SPI
      transactions > 32 bytes), SPI will use spi_map_buf()->dma_map_sg() to
      map the buffer for use in DMA.  But dma_map_sg()->dma_map_sg_attrs() returns
      0, because ops->map_sg is dummy_dma_ops->__dummy_map_sg, and hence
      spi_map_buf() returns -ENOMEM (-12).
      
      Fix this by using the real spi_master's parent device which should be a
      real physical device with DMA properties.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Fixes: c37f45b5 ("spi: support spi without dma channel to use can_dma()")
      Cc: Leilk Liu <leilk.liu@mediatek.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      88b0aa54
  2. 12 Dec, 2016 9 commits
  3. 11 Dec, 2016 4 commits
  4. 10 Dec, 2016 5 commits
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 04516981
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
       "This fixes the following issues:
      
         - Fix pointer size when caam is used with AArch64 boot loader on
           AArch32 kernel.
      
         - Fix ahash state corruption in marvell driver.
      
         - Fix buggy algif_aed tag handling.
      
         - Prevent mcryptd from being used with incompatible algorithms which
           can cause crashes"
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: algif_aead - fix uninitialized variable warning
        crypto: mcryptd - Check mcryptd algorithm compatibility
        crypto: algif_aead - fix AEAD tag memory handling
        crypto: caam - fix pointer size for AArch64 boot loader, AArch32 kernel
        crypto: marvell - Don't corrupt state of an STD req for re-stepped ahash
        crypto: marvell - Don't copy hash operation twice into the SRAM
      04516981
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · cd662895
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Limit the number of can filters to avoid > MAX_ORDER allocations.
          Fix from Marc Kleine-Budde.
      
       2) Limit GSO max size in netvsc driver to avoid problems with NVGRE
          configurations. From Stephen Hemminger.
      
       3) Return proper error when memory allocation fails in
          ser_gigaset_init(), from Dan Carpenter.
      
       4) Missing linkage undo in error paths of ipvlan_link_new(), from Gao
          Feng.
      
       5) Missing necessayr SET_NETDEV_DEV in lantiq and cpmac drivers, from
          Florian Fainelli.
      
       6) Handle probe deferral properly in smsc911x driver.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        net: mlx5: Fix Kconfig help text
        net: smsc911x: back out silently on probe deferrals
        ibmveth: set correct gso_size and gso_type
        net: ethernet: cpmac: Call SET_NETDEV_DEV()
        net: ethernet: lantiq_etop: Call SET_NETDEV_DEV()
        vhost-vsock: fix orphan connection reset
        cxgb4/cxgb4vf: Assign netdev->dev_port with port ID
        driver: ipvlan: Unlink the upper dev when ipvlan_link_new failed
        ser_gigaset: return -ENOMEM on error instead of success
        NET: usb: cdc_mbim: add quirk for supporting Telit LE922A
        can: peak: fix bad memory access and free sequence
        phy: Don't increment MDIO bus refcount unless it's a different owner
        netvsc: reduce maximum GSO size
        drivers: net: cpsw-phy-sel: Clear RGMII_IDMODE on "rgmii" links
        can: raw: raw_setsockopt: limit number of can_filter that can be set
      cd662895
    • Christopher Covington's avatar
      net: mlx5: Fix Kconfig help text · d33695fb
      Christopher Covington authored
      Since the following commit, Infiniband and Ethernet have not been
      mutually exclusive.
      
      Fixes: 4aa17b28 mlx5: Enable mutual support for IB and Ethernet
      Signed-off-by: default avatarChristopher Covington <cov@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d33695fb
    • Linus Walleij's avatar
      net: smsc911x: back out silently on probe deferrals · ab4e4c07
      Linus Walleij authored
      When trying to get a regulator we may get deferred and we see
      this noise:
      
      smsc911x 1b800000.ethernet-ebi2 (unnamed net_device) (uninitialized):
         couldn't get regulators -517
      
      Then the driver continues anyway. Which means that the regulator
      may not be properly retrieved and reference counted, and may be
      switched off in case noone else is using it.
      
      Fix this by returning silently on deferred probe and let the
      system work it out.
      
      Cc: Jeremy Linton <jeremy.linton@arm.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ab4e4c07
    • Thomas Falcon's avatar
      ibmveth: set correct gso_size and gso_type · 7b596738
      Thomas Falcon authored
      This patch is based on an earlier one submitted
      by Jon Maxwell with the following commit message:
      
      "We recently encountered a bug where a few customers using ibmveth on the
      same LPAR hit an issue where a TCP session hung when large receive was
      enabled. Closer analysis revealed that the session was stuck because the
      one side was advertising a zero window repeatedly.
      
      We narrowed this down to the fact the ibmveth driver did not set gso_size
      which is translated by TCP into the MSS later up the stack. The MSS is
      used to calculate the TCP window size and as that was abnormally large,
      it was calculating a zero window, even although the sockets receive buffer
      was completely empty."
      
      We rely on the Virtual I/O Server partition in a pseries
      environment to provide the MSS through the TCP header checksum
      field. The stipulation is that users should not disable checksum
      offloading if rx packet aggregation is enabled through VIOS.
      
      Some firmware offerings provide the MSS in the RX buffer.
      This is signalled by a bit in the RX queue descriptor.
      Reviewed-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Reviewed-by: default avatarPradeep Satyanarayana <pradeeps@linux.vnet.ibm.com>
      Reviewed-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Reviewed-by: default avatarJonathan Maxwell <jmaxwell37@gmail.com>
      Reviewed-by: default avatarDavid Dai <zdai@us.ibm.com>
      Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b596738
  5. 09 Dec, 2016 11 commits
  6. 08 Dec, 2016 9 commits