1. 21 Aug, 2020 1 commit
    • Tom Rix's avatar
      net: dsa: b53: check for timeout · 774d977a
      Tom Rix authored
      clang static analysis reports this problem
      
      b53_common.c:1583:13: warning: The left expression of the compound
        assignment is an uninitialized value. The computed value will
        also be garbage
              ent.port &= ~BIT(port);
              ~~~~~~~~ ^
      
      ent is set by a successful call to b53_arl_read().  Unsuccessful
      calls are caught by an switch statement handling specific returns.
      b32_arl_read() calls b53_arl_op_wait() which fails with the
      unhandled -ETIMEDOUT.
      
      So add -ETIMEDOUT to the switch statement.  Because
      b53_arl_op_wait() already prints out a message, do not add another
      one.
      
      Fixes: 1da6df85 ("net: dsa: b53: Implement ARL add/del/dump operations")
      Signed-off-by: default avatarTom Rix <trix@redhat.com>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      774d977a
  2. 20 Aug, 2020 11 commits
  3. 19 Aug, 2020 8 commits
    • Wang Hai's avatar
      net: gemini: Fix missing free_netdev() in error path of gemini_ethernet_port_probe() · cf96d977
      Wang Hai authored
      Replace alloc_etherdev_mq with devm_alloc_etherdev_mqs. In this way,
      when probe fails, netdev can be freed automatically.
      
      Fixes: 4d5ae32f ("net: ethernet: Add a driver for Gemini gigabit ethernet")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cf96d977
    • Sebastian Andrzej Siewior's avatar
      net: atlantic: Use readx_poll_timeout() for large timeout · 9553b62c
      Sebastian Andrzej Siewior authored
      Commit
         8dcf2ad3 ("net: atlantic: add hwmon getter for MAC temperature")
      
      implemented a read callback with an udelay(10000U). This fails to
      compile on ARM because the delay is >1ms. I doubt that it is needed to
      spin for 10ms even if possible on x86.
      
      >From looking at the code, the context appears to be preemptible so using
      usleep() should work and avoid busy spinning.
      
      Use readx_poll_timeout() in the poll loop.
      
      Fixes: 8dcf2ad3 ("net: atlantic: add hwmon getter for MAC temperature")
      Cc: Mark Starovoytov <mstarovoitov@marvell.com>
      Cc: Igor Russkikh <irusskikh@marvell.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9553b62c
    • Min Li's avatar
      ptp: ptp_clockmatrix: use i2c_master_send for i2c write · 957ff427
      Min Li authored
      The old code for i2c write would break on some controllers, which fails
      at handling Repeated Start Condition. So we will just use i2c_master_send
      to handle write in one transanction.
      
      Changes since v1:
      - Remove indentation change
      Signed-off-by: default avatarMin Li <min.li.xe@renesas.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      957ff427
    • Johannes Berg's avatar
      netlink: fix state reallocation in policy export · d1fb5559
      Johannes Berg authored
      Evidently, when I did this previously, we didn't have more than
      10 policies and didn't run into the reallocation path, because
      it's missing a memset() for the unused policies. Fix that.
      
      Fixes: d07dcf9a ("netlink: add infrastructure to expose policies to userspace")
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d1fb5559
    • David S. Miller's avatar
      Merge branch 'Bug-fixes-for-ENA-ethernet-driver' · b4c8998b
      David S. Miller authored
      Shay Agroskin says:
      
      ====================
      Bug fixes for ENA ethernet driver
      
      This series adds the following:
      - Fix undesired call to ena_restore after returning from suspend
      - Fix condition inside a WARN_ON
      - Fix overriding previous value when updating missed_tx statistic
      
      v1->v2:
      - fix bug when calling reset routine after device resources are freed (Jakub)
      
      v2->v3:
      - fix wrong hash in 'Fixes' tag
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4c8998b
    • Shay Agroskin's avatar
      net: ena: Make missed_tx stat incremental · ccd143e5
      Shay Agroskin authored
      Most statistics in ena driver are incremented, meaning that a stat's
      value is a sum of all increases done to it since driver/queue
      initialization.
      
      This patch makes all statistics this way, effectively making missed_tx
      statistic incremental.
      Also added a comment regarding rx_drops and tx_drops to make it
      clearer how these counters are calculated.
      
      Fixes: 11095fdb ("net: ena: add statistics for missed tx packets")
      Signed-off-by: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ccd143e5
    • Shay Agroskin's avatar
      net: ena: Change WARN_ON expression in ena_del_napi_in_range() · 8b147f6f
      Shay Agroskin authored
      The ena_del_napi_in_range() function unregisters the napi handler for
      rings in a given range.
      This function had the following WARN_ON macro:
      
          WARN_ON(ENA_IS_XDP_INDEX(adapter, i) &&
      	    adapter->ena_napi[i].xdp_ring);
      
      This macro prints the call stack if the expression inside of it is
      true [1], but the expression inside of it is the wanted situation.
      The expression checks whether the ring has an XDP queue and its index
      corresponds to a XDP one.
      
      This patch changes the expression to
          !ENA_IS_XDP_INDEX(adapter, i) && adapter->ena_napi[i].xdp_ring
      which indicates an unwanted situation.
      
      Also, change the structure of the function. The napi handler is
      unregistered for all rings, and so there's no need to check whether the
      index is an XDP index or not. By removing this check the code becomes
      much more readable.
      
      Fixes: 548c4940 ("net: ena: Implement XDP_TX action")
      Signed-off-by: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b147f6f
    • Shay Agroskin's avatar
      net: ena: Prevent reset after device destruction · 63d4a4c1
      Shay Agroskin authored
      The reset work is scheduled by the timer routine whenever it
      detects that a device reset is required (e.g. when a keep_alive signal
      is missing).
      When releasing device resources in ena_destroy_device() the driver
      cancels the scheduling of the timer routine without destroying the reset
      work explicitly.
      
      This creates the following bug:
          The driver is suspended and the ena_suspend() function is called
      	-> This function calls ena_destroy_device() to free the net device
      	   resources
      	    -> The driver waits for the timer routine to finish
      	    its execution and then cancels it, thus preventing from it
      	    to be called again.
      
          If, in its final execution, the timer routine schedules a reset,
          the reset routine might be called afterwards,and a redundant call to
          ena_restore_device() would be made.
      
      By changing the reset routine we allow it to read the device's state
      accurately.
      This is achieved by checking whether ENA_FLAG_TRIGGER_RESET flag is set
      before resetting the device and making both the destruction function and
      the flag check are under rtnl lock.
      The ENA_FLAG_TRIGGER_RESET is cleared at the end of the destruction
      routine. Also surround the flag check with 'likely' because
      we expect that the reset routine would be called only when
      ENA_FLAG_TRIGGER_RESET flag is set.
      
      The destruction of the timer and reset services in __ena_shutoff() have to
      stay, even though the timer routine is destroyed in ena_destroy_device().
      This is to avoid a case in which the reset routine is scheduled after
      free_netdev() in __ena_shutoff(), which would create an access to freed
      memory in adapter->flags.
      
      Fixes: 8c5c7abd ("net: ena: add power management ops to the ENA driver")
      Signed-off-by: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      63d4a4c1
  4. 18 Aug, 2020 20 commits