1. 25 3月, 2020 8 次提交
    • A
      net: axienet: Improve DMA error handling · e7fea0b9
      Andre Przywara 提交于
      Since 0 is a valid DMA address, we cannot use the physical address to
      check whether a TX descriptor is valid and is holding a DMA mapping.
      
      Use the "cntrl" member of the descriptor to make this decision, as it
      contains at least the length of the buffer, so 0 points to an
      uninitialised buffer.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: NRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e7fea0b9
    • A
      net: axienet: Fix DMA descriptor cleanup path · f26667a3
      Andre Przywara 提交于
      When axienet_dma_bd_init() bails out during the initialisation process,
      it might do so with parts of the structure already allocated and
      initialised, while other parts have not been touched yet. Before
      returning in this case, we call axienet_dma_bd_release(), which does not
      take care of this corner case.
      This is most obvious by the first loop happily dereferencing
      lp->rx_bd_v, which we actually check to be non NULL *afterwards*.
      
      Make sure we only unmap or free already allocated structures, by:
      - directly returning with -ENOMEM if nothing has been allocated at all
      - checking for lp->rx_bd_v to be non-NULL *before* using it
      - only unmapping allocated DMA RX regions
      
      This avoids NULL pointer dereferences when initialisation fails.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f26667a3
    • A
      net: axienet: Propagate failure of DMA descriptor setup · ee44d0b7
      Andre Przywara 提交于
      When we fail allocating the DMA buffers in axienet_dma_bd_init(), we
      report this error, but carry on with initialisation nevertheless.
      
      This leads to a kernel panic when the driver later wants to send a
      packet, as it uses uninitialised data structures.
      
      Make the axienet_device_reset() routine return an error value, as it
      contains the DMA buffer initialisation. Make sure we propagate the error
      up the chain and eventually fail the driver initialisation, to avoid
      relying on non-initialised buffers.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: NRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ee44d0b7
    • A
      net: axienet: Convert DMA error handler to a work queue · 24201a64
      Andre Przywara 提交于
      The DMA error handler routine is currently a tasklet, scheduled to run
      after the DMA error IRQ was handled.
      However it needs to take the MDIO mutex, which is not allowed to do in a
      tasklet. A kernel (with debug options) complains consequently:
      [  614.050361] net eth0: DMA Tx error 0x174019
      [  614.064002] net eth0: Current BD is at: 0x8f84aa0ce
      [  614.080195] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935
      [  614.109484] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 40, name: kworker/u4:4
      [  614.135428] 3 locks held by kworker/u4:4/40:
      [  614.149075]  #0: ffff000879863328 ((wq_completion)rpciod){....}, at: process_one_work+0x1f0/0x6a8
      [  614.177528]  #1: ffff80001251bdf8 ((work_completion)(&task->u.tk_work)){....}, at: process_one_work+0x1f0/0x6a8
      [  614.209033]  #2: ffff0008784e0110 (sk_lock-AF_INET-RPC){....}, at: tcp_sendmsg+0x24/0x58
      [  614.235429] CPU: 0 PID: 40 Comm: kworker/u4:4 Not tainted 5.6.0-rc3-00926-g4a165a9d5921 #26
      [  614.260854] Hardware name: ARM Test FPGA (DT)
      [  614.274734] Workqueue: rpciod rpc_async_schedule
      [  614.289022] Call trace:
      [  614.296871]  dump_backtrace+0x0/0x1a0
      [  614.308311]  show_stack+0x14/0x20
      [  614.318751]  dump_stack+0xbc/0x100
      [  614.329403]  ___might_sleep+0xf0/0x140
      [  614.341018]  __might_sleep+0x4c/0x80
      [  614.352201]  __mutex_lock+0x5c/0x8a8
      [  614.363348]  mutex_lock_nested+0x1c/0x28
      [  614.375654]  axienet_dma_err_handler+0x38/0x388
      [  614.389999]  tasklet_action_common.isra.15+0x160/0x1a8
      [  614.405894]  tasklet_action+0x24/0x30
      [  614.417297]  efi_header_end+0xe0/0x494
      [  614.429020]  irq_exit+0xd0/0xd8
      [  614.439047]  __handle_domain_irq+0x60/0xb0
      [  614.451877]  gic_handle_irq+0xdc/0x2d0
      [  614.463486]  el1_irq+0xcc/0x180
      [  614.473451]  __tcp_transmit_skb+0x41c/0xb58
      [  614.486513]  tcp_write_xmit+0x224/0x10a0
      [  614.498792]  __tcp_push_pending_frames+0x38/0xc8
      [  614.513126]  tcp_rcv_established+0x41c/0x820
      [  614.526301]  tcp_v4_do_rcv+0x8c/0x218
      [  614.537784]  __release_sock+0x5c/0x108
      [  614.549466]  release_sock+0x34/0xa0
      [  614.560318]  tcp_sendmsg+0x40/0x58
      [  614.571053]  inet_sendmsg+0x40/0x68
      [  614.582061]  sock_sendmsg+0x18/0x30
      [  614.593074]  xs_sendpages+0x218/0x328
      [  614.604506]  xs_tcp_send_request+0xa0/0x1b8
      [  614.617461]  xprt_transmit+0xc8/0x4f0
      [  614.628943]  call_transmit+0x8c/0xa0
      [  614.640028]  __rpc_execute+0xbc/0x6f8
      [  614.651380]  rpc_async_schedule+0x28/0x48
      [  614.663846]  process_one_work+0x298/0x6a8
      [  614.676299]  worker_thread+0x40/0x490
      [  614.687687]  kthread+0x134/0x138
      [  614.697804]  ret_from_fork+0x10/0x18
      [  614.717319] xilinx_axienet 7fe00000.ethernet eth0: Link is Down
      [  615.748343] xilinx_axienet 7fe00000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
      
      Since tasklets are not really popular anymore anyway, lets convert this
      over to a work queue, which can sleep and thus can take the MDIO mutex.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24201a64
    • A
      net: xilinx: temac: Relax Kconfig dependencies · e8b6c54f
      Andre Przywara 提交于
      Similar to axienet, the temac driver is now architecture agnostic, and
      can be at least compiled for several architectures.
      Especially the fact that this is a soft IP for implementing in FPGAs
      makes the current restriction rather pointless, as it could literally
      appear on any architecture, as long as an FPGA is connected to the bus.
      
      The driver hasn't been actually tried on any hardware, it is just a
      drive-by patch when doing the same for axienet (a similar patch for
      axienet is already merged).
      
      This (temac and axienet) have been compile-tested for:
      alpha hppa64 microblaze mips64 powerpc powerpc64 riscv64 s390 sparc64
      (using kernel.org cross compilers).
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: NRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8b6c54f
    • V
      ethtool: fix incorrect tx-checksumming settings reporting · 9d648fb5
      Vladyslav Tarasiuk 提交于
      Currently, ethtool feature mask for checksum command is ORed with
      NETIF_F_FCOE_CRC_BIT, which is bit's position number, instead of the
      actual feature bit - NETIF_F_FCOE_CRC.
      
      The invalid bitmask here might affect unrelated features when toggling
      TX checksumming. For example, TX checksumming is always mistakenly
      reported as enabled on the netdevs tested (mlx5, virtio_net).
      
      Fixes: f70bb065 ("ethtool: update mapping of features to legacy ioctl requests")
      Signed-off-by: NVladyslav Tarasiuk <vladyslavt@mellanox.com>
      Reviewed-by: NMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9d648fb5
    • D
      net: phy: mdio-mux-bcm-iproc: use readl_poll_timeout() to simplify code · c9c1fd62
      Dejin Zheng 提交于
      use readl_poll_timeout() to replace the poll codes for simplify
      iproc_mdio_wait_for_idle() function
      Signed-off-by: NDejin Zheng <zhengdejin5@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c9c1fd62
    • D
      Merge tag 'wireless-drivers-next-2020-03-24' of... · 5ef8c665
      David S. Miller 提交于
      Merge tag 'wireless-drivers-next-2020-03-24' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
      
      Kalle Valo says:
      
      ====================
      wireless-drivers-next patches for v5.7
      
      Second set of patches for v5.7. Lots of cleanup patches this time, but
      of course various new features as well fixes.
      
      When merging with wireless-drivers this pull request has a conflict in:
      
      drivers/net/wireless/intel/iwlwifi/pcie/drv.c
      
      To solve that just drop the changes from commit cf52c8a7 in
      wireless-drivers and take the hunk from wireless-drivers-next as is.
      The list of specific subsystem device IDs are not necessary after
      commit d6f2134a (in wireless-drivers-next) anymore, the detection
      is based on other characteristics of the devices.
      
      Major changes:
      
      qtnfmac
      
      * support WPA3 SAE and OWE in AP mode
      
      ath10k
      
      * support for getting btcoex settings from Device Tree
      
      * support QCA9377 SDIO device
      
      ath11k
      
      * add HE rate accounting
      
      * add thermal sensor and cooling devices
      
      mt76
      
      * MT7663 support for the MT7615 driver
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ef8c665
  2. 24 3月, 2020 32 次提交