1. 15 4月, 2021 8 次提交
  2. 14 4月, 2021 2 次提交
    • M
      xen-netback: Check for hotplug-status existence before watching · 2afeec08
      Michael Brown 提交于
      The logic in connect() is currently written with the assumption that
      xenbus_watch_pathfmt() will return an error for a node that does not
      exist.  This assumption is incorrect: xenstore does allow a watch to
      be registered for a nonexistent node (and will send notifications
      should the node be subsequently created).
      
      As of commit 1f256578 ("xen-netback: remove 'hotplug-status' once it
      has served its purpose"), this leads to a failure when a domU
      transitions into XenbusStateConnected more than once.  On the first
      domU transition into Connected state, the "hotplug-status" node will
      be deleted by the hotplug_status_changed() callback in dom0.  On the
      second or subsequent domU transition into Connected state, the
      hotplug_status_changed() callback will therefore never be invoked, and
      so the backend will remain stuck in InitWait.
      
      This failure prevents scenarios such as reloading the xen-netfront
      module within a domU, or booting a domU via iPXE.  There is
      unfortunately no way for the domU to work around this dom0 bug.
      
      Fix by explicitly checking for existence of the "hotplug-status" node,
      thereby creating the behaviour that was previously assumed to exist.
      Signed-off-by: NMichael Brown <mbrown@fensystems.co.uk>
      Reviewed-by: NPaul Durrant <paul@xen.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2afeec08
    • L
      ibmvnic: correctly use dev_consume/free_skb_irq · ca09bf7b
      Lijun Pan 提交于
      It is more correct to use dev_kfree_skb_irq when packets are dropped,
      and to use dev_consume_skb_irq when packets are consumed.
      
      Fixes: 0d973388 ("ibmvnic: Introduce xmit_more support using batched subCRQ hcalls")
      Suggested-by: NThomas Falcon <tlfalcon@linux.ibm.com>
      Signed-off-by: NLijun Pan <lijunp213@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ca09bf7b
  3. 13 4月, 2021 1 次提交
    • P
      net: phy: marvell: fix detection of PHY on Topaz switches · 1fe976d3
      Pali Rohár 提交于
      Since commit fee2d546 ("net: phy: marvell: mv88e6390 temperature
      sensor reading"), Linux reports the temperature of Topaz hwmon as
      constant -75°C.
      
      This is because switches from the Topaz family (88E6141 / 88E6341) have
      the address of the temperature sensor register different from Peridot.
      
      This address is instead compatible with 88E1510 PHYs, as was used for
      Topaz before the above mentioned commit.
      
      Create a new mapping table between switch family and PHY ID for families
      which don't have a model number. And define PHY IDs for Topaz and Peridot
      families.
      
      Create a new PHY ID and a new PHY driver for Topaz's internal PHY.
      The only difference from Peridot's PHY driver is the HWMON probing
      method.
      
      Prior this change Topaz's internal PHY is detected by kernel as:
      
        PHY [...] driver [Marvell 88E6390] (irq=63)
      
      And afterwards as:
      
        PHY [...] driver [Marvell 88E6341 Family] (irq=63)
      Signed-off-by: NPali Rohár <pali@kernel.org>
      BugLink: https://github.com/globalscaletechnologies/linux/issues/1
      Fixes: fee2d546 ("net: phy: marvell: mv88e6390 temperature sensor reading")
      Reviewed-by: NMarek Behún <kabel@kernel.org>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1fe976d3
  4. 12 4月, 2021 2 次提交
  5. 10 4月, 2021 2 次提交
  6. 09 4月, 2021 8 次提交
    • M
      net: dsa: lantiq_gswip: Configure all remaining GSWIP_MII_CFG bits · 4b592324
      Martin Blumenstingl 提交于
      There are a few more bits in the GSWIP_MII_CFG register for which we
      did rely on the boot-loader (or the hardware defaults) to set them up
      properly.
      
      For some external RMII PHYs we need to select the GSWIP_MII_CFG_RMII_CLK
      bit and also we should un-set it for non-RMII PHYs. The
      GSWIP_MII_CFG_RMII_CLK bit is ignored for other PHY connection modes.
      
      The GSWIP IP also supports in-band auto-negotiation for RGMII PHYs when
      the GSWIP_MII_CFG_RGMII_IBS bit is set. Clear this bit always as there's
      no known hardware which uses this (so it is not tested yet).
      
      Clear the xMII isolation bit when set at initialization time if it was
      previously set by the bootloader. Not doing so could lead to no traffic
      (neither RX nor TX) on a port with this bit set.
      
      While here, also add the GSWIP_MII_CFG_RESET bit. We don't need to
      manage it because this bit is self-clearning when set. We still add it
      here to get a better overview of the GSWIP_MII_CFG register.
      
      Fixes: 14fceff4 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
      Cc: stable@vger.kernel.org
      Suggested-by: NHauke Mehrtens <hauke@hauke-m.de>
      Acked-by: NHauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b592324
    • M
      net: dsa: lantiq_gswip: Don't use PHY auto polling · 3e9005be
      Martin Blumenstingl 提交于
      PHY auto polling on the GSWIP hardware can be used so link changes
      (speed, link up/down, etc.) can be detected automatically. Internally
      GSWIP reads the PHY's registers for this functionality. Based on this
      automatic detection GSWIP can also automatically re-configure it's port
      settings. Unfortunately this auto polling (and configuration) mechanism
      seems to cause various issues observed by different people on different
      devices:
      - FritzBox 7360v2: the two Gbit/s ports (connected to the two internal
        PHY11G instances) are working fine but the two Fast Ethernet ports
        (using an AR8030 RMII PHY) are completely dead (neither RX nor TX are
        received). It turns out that the AR8030 PHY sets the BMSR_ESTATEN bit
        as well as the ESTATUS_1000_TFULL and ESTATUS_1000_XFULL bits. This
        makes the PHY auto polling state machine (rightfully?) think that the
        established link speed (when the other side is Gbit/s capable) is
        1Gbit/s.
      - None of the Ethernet ports on the Zyxel P-2812HNU-F1 (two are
        connected to the internal PHY11G GPHYs while the other three are
        external RGMII PHYs) are working. Neither RX nor TX traffic was
        observed. It is not clear which part of the PHY auto polling state-
        machine caused this.
      - FritzBox 7412 (only one LAN port which is connected to one of the
        internal GPHYs running in PHY22F / Fast Ethernet mode) was seeing
        random disconnects (link down events could be seen). Sometimes all
        traffic would stop after such disconnect. It is not clear which part
        of the PHY auto polling state-machine cauased this.
      - TP-Link TD-W9980 (two ports are connected to the internal GPHYs
        running in PHY11G / Gbit/s mode, the other two are external RGMII
        PHYs) was affected by similar issues as the FritzBox 7412 just without
        the "link down" events
      
      Switch to software based configuration instead of PHY auto polling (and
      letting the GSWIP hardware configure the ports automatically) for the
      following link parameters:
      - link up/down
      - link speed
      - full/half duplex
      - flow control (RX / TX pause)
      
      After a big round of manual testing by various people (who helped test
      this on OpenWrt) it turns out that this fixes all reported issues.
      
      Additionally it can be considered more future proof because any
      "quirk" which is implemented for a PHY on the driver side can now be
      used with the GSWIP hardware as well because Linux is in control of the
      link parameters.
      
      As a nice side-effect this also solves a problem where fixed-links were
      not supported previously because we were relying on the PHY auto polling
      mechanism, which cannot work for fixed-links as there's no PHY from
      where it can read the registers. Configuring the link settings on the
      GSWIP ports means that we now use the settings from device-tree also for
      ports with fixed-links.
      
      Fixes: 14fceff4 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
      Fixes: 3e6fdeb2 ("net: dsa: lantiq_gswip: Let GSWIP automatically set the xMII clock")
      Cc: stable@vger.kernel.org
      Acked-by: NHauke Mehrtens <hauke@hauke-m.de>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3e9005be
    • Y
      ice: fix memory leak of aRFS after resuming from suspend · 1831da7e
      Yongxin Liu 提交于
      In ice_suspend(), ice_clear_interrupt_scheme() is called, and then
      irq_free_descs() will be eventually called to free irq and its descriptor.
      
      In ice_resume(), ice_init_interrupt_scheme() is called to allocate new
      irqs. However, in ice_rebuild_arfs(), struct irq_glue and struct cpu_rmap
      maybe cannot be freed, if the irqs that released in ice_suspend() were
      reassigned to other devices, which makes irq descriptor's affinity_notify
      lost.
      
      So call ice_free_cpu_rx_rmap() before ice_clear_interrupt_scheme(), which
      can make sure all irq_glue and cpu_rmap can be correctly released before
      corresponding irq and descriptor are released.
      
      Fix the following memory leak.
      
      unreferenced object 0xffff95bd951afc00 (size 512):
        comm "kworker/0:1", pid 134, jiffies 4294684283 (age 13051.958s)
        hex dump (first 32 bytes):
          18 00 00 00 18 00 18 00 70 fc 1a 95 bd 95 ff ff  ........p.......
          00 00 ff ff 01 00 ff ff 02 00 ff ff 03 00 ff ff  ................
        backtrace:
          [<0000000072e4b914>] __kmalloc+0x336/0x540
          [<0000000054642a87>] alloc_cpu_rmap+0x3b/0xb0
          [<00000000f220deec>] ice_set_cpu_rx_rmap+0x6a/0x110 [ice]
          [<000000002370a632>] ice_probe+0x941/0x1180 [ice]
          [<00000000d692edba>] local_pci_probe+0x47/0xa0
          [<00000000503934f0>] work_for_cpu_fn+0x1a/0x30
          [<00000000555a9e4a>] process_one_work+0x1dd/0x410
          [<000000002c4b414a>] worker_thread+0x221/0x3f0
          [<00000000bb2b556b>] kthread+0x14c/0x170
          [<00000000ad2cf1cd>] ret_from_fork+0x1f/0x30
      unreferenced object 0xffff95bd81b0a2a0 (size 96):
        comm "kworker/0:1", pid 134, jiffies 4294684283 (age 13051.958s)
        hex dump (first 32 bytes):
          38 00 00 00 01 00 00 00 e0 ff ff ff 0f 00 00 00  8...............
          b0 a2 b0 81 bd 95 ff ff b0 a2 b0 81 bd 95 ff ff  ................
        backtrace:
          [<00000000582dd5c5>] kmem_cache_alloc_trace+0x31f/0x4c0
          [<000000002659850d>] irq_cpu_rmap_add+0x25/0xe0
          [<00000000495a3055>] ice_set_cpu_rx_rmap+0xb4/0x110 [ice]
          [<000000002370a632>] ice_probe+0x941/0x1180 [ice]
          [<00000000d692edba>] local_pci_probe+0x47/0xa0
          [<00000000503934f0>] work_for_cpu_fn+0x1a/0x30
          [<00000000555a9e4a>] process_one_work+0x1dd/0x410
          [<000000002c4b414a>] worker_thread+0x221/0x3f0
          [<00000000bb2b556b>] kthread+0x14c/0x170
          [<00000000ad2cf1cd>] ret_from_fork+0x1f/0x30
      
      Fixes: 769c500d ("ice: Add advanced power mgmt for WoL")
      Signed-off-by: NYongxin Liu <yongxin.liu@windriver.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      1831da7e
    • A
      i40e: Fix sparse warning: missing error code 'err' · 8a1e918d
      Arkadiusz Kubalewski 提交于
      Set proper return values inside error checking if-statements.
      
      Previously following warning was produced when compiling against sparse.
      i40e_main.c:15162 i40e_init_recovery_mode() warn: missing error code 'err'
      
      Fixes: 4ff0ee1a ("i40e: Introduce recovery mode support")
      Signed-off-by: NAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Signed-off-by: NArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Tested-by: NDave Switzer <david.switzer@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      8a1e918d
    • A
      i40e: Fix sparse error: 'vsi->netdev' could be null · 6b5674fe
      Arkadiusz Kubalewski 提交于
      Remove vsi->netdev->name from the trace.
      This is redundant information. With the devinfo trace, the adapter
      is already identifiable.
      
      Previously following error was produced when compiling against sparse.
      i40e_main.c:2571 i40e_sync_vsi_filters() error:
      	we previously assumed 'vsi->netdev' could be null (see line 2323)
      
      Fixes: b603f9dc ("i40e: Log info when PF is entering and leaving Allmulti mode.")
      Signed-off-by: NAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Signed-off-by: NArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Tested-by: NDave Switzer <david.switzer@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      6b5674fe
    • A
      i40e: Fix sparse error: uninitialized symbol 'ring' · d6d04ee6
      Arkadiusz Kubalewski 提交于
      Init pointer with NULL in default switch case statement.
      
      Previously the error was produced when compiling against sparse.
      i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'.
      
      Fixes: 44ea803e ("i40e: introduce new dump desc XDP command")
      Signed-off-by: NAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Signed-off-by: NArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Tested-by: NDave Switzer <david.switzer@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      d6d04ee6
    • A
      i40e: Fix sparse errors in i40e_txrx.c · 12738ac4
      Arkadiusz Kubalewski 提交于
      Remove error handling through pointers. Instead use plain int
      to return value from i40e_run_xdp(...).
      
      Previously:
      - sparse errors were produced during compilation:
      i40e_txrx.c:2338 i40e_run_xdp() error: (-2147483647) too low for ERR_PTR
      i40e_txrx.c:2558 i40e_clean_rx_irq() error: 'skb' dereferencing possible ERR_PTR()
      
      - sk_buff* was used to return value, but it has never had valid
      pointer to sk_buff. Returned value was always int handled as
      a pointer.
      
      Fixes: 0c8493d9 ("i40e: add XDP support for pass and drop actions")
      Fixes: 2e689312 ("i40e: split XDP_TX tail and XDP_REDIRECT map flushing")
      Signed-off-by: NAleksandr Loktionov <aleksandr.loktionov@intel.com>
      Signed-off-by: NArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
      Tested-by: NDave Switzer <david.switzer@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      12738ac4
    • G
      i40e: Fix parameters in aq_get_phy_register() · b2d0efc4
      Grzegorz Siwik 提交于
      Change parameters order in aq_get_phy_register() due to wrong
      statistics in PHY reported by ethtool. Previously all PHY statistics were
      exactly the same for all interfaces
      Now statistics are reported correctly - different for different interfaces
      
      Fixes: 0514db37 ("i40e: Extend PHY access with page change flag")
      Signed-off-by: NGrzegorz Siwik <grzegorz.siwik@intel.com>
      Tested-by: NDave Switzer <david.switzer@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      b2d0efc4
  7. 08 4月, 2021 3 次提交
    • A
      virt_wifi: Return micros for BSS TSF values · b57aa17f
      A. Cody Schuffelen 提交于
      cfg80211_inform_bss expects to receive a TSF value, but is given the
      time since boot in nanoseconds. TSF values are expected to be at
      microsecond scale rather than nanosecond scale.
      Signed-off-by: NA. Cody Schuffelen <schuffelen@google.com>
      Link: https://lore.kernel.org/r/20210318200419.1421034-1-schuffelen@google.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      b57aa17f
    • A
      net: hso: fix null-ptr-deref during tty device unregistration · 8a12f883
      Anirudh Rayabharam 提交于
      Multiple ttys try to claim the same the minor number causing a double
      unregistration of the same device. The first unregistration succeeds
      but the next one results in a null-ptr-deref.
      
      The get_free_serial_index() function returns an available minor number
      but doesn't assign it immediately. The assignment is done by the caller
      later. But before this assignment, calls to get_free_serial_index()
      would return the same minor number.
      
      Fix this by modifying get_free_serial_index to assign the minor number
      immediately after one is found to be and rename it to obtain_minor()
      to better reflect what it does. Similary, rename set_serial_by_index()
      to release_minor() and modify it to free up the minor number of the
      given hso_serial. Every obtain_minor() should have corresponding
      release_minor() call.
      
      Fixes: 72dc1c09 ("HSO: add option hso driver")
      Reported-by: syzbot+c49fe6089f295a05e6f8@syzkaller.appspotmail.com
      Tested-by: syzbot+c49fe6089f295a05e6f8@syzkaller.appspotmail.com
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NAnirudh Rayabharam <mail@anirudhrb.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a12f883
    • D
      ethtool: Remove link_mode param and derive link params from driver · a975d7d8
      Danielle Ratson 提交于
      Some drivers clear the 'ethtool_link_ksettings' struct in their
      get_link_ksettings() callback, before populating it with actual values.
      Such drivers will set the new 'link_mode' field to zero, resulting in
      user space receiving wrong link mode information given that zero is a
      valid value for the field.
      
      Another problem is that some drivers (notably tun) can report random
      values in the 'link_mode' field. This can result in a general protection
      fault when the field is used as an index to the 'link_mode_params' array
      [1].
      
      This happens because such drivers implement their set_link_ksettings()
      callback by simply overwriting their private copy of
      'ethtool_link_ksettings' struct with the one they get from the stack,
      which is not always properly initialized.
      
      Fix these problems by removing 'link_mode' from 'ethtool_link_ksettings'
      and instead have drivers call ethtool_params_from_link_mode() with the
      current link mode. The function will derive the link parameters (e.g.,
      speed) from the link mode and fill them in the 'ethtool_link_ksettings'
      struct.
      
      v3:
      	* Remove link_mode parameter and derive the link parameters in
      	  the driver instead of passing link_mode parameter to ethtool
      	  and derive it there.
      
      v2:
      	* Introduce 'cap_link_mode_supported' instead of adding a
      	  validity field to 'ethtool_link_ksettings' struct.
      
      [1]
      general protection fault, probably for non-canonical address 0xdffffc00f14cc32c: 0000 [#1] PREEMPT SMP KASAN
      KASAN: probably user-memory-access in range [0x000000078a661960-0x000000078a661967]
      CPU: 0 PID: 8452 Comm: syz-executor360 Not tainted 5.11.0-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      RIP: 0010:__ethtool_get_link_ksettings+0x1a3/0x3a0 net/ethtool/ioctl.c:446
      Code: b7 3e fa 83 fd ff 0f 84 30 01 00 00 e8 16 b0 3e fa 48 8d 3c ed 60 d5 69 8a 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 14 02 48 89 f8 83 e0 07 83 c0 03
      +38 d0 7c 08 84 d2 0f 85 b9
      RSP: 0018:ffffc900019df7a0 EFLAGS: 00010202
      RAX: dffffc0000000000 RBX: ffff888026136008 RCX: 0000000000000000
      RDX: 00000000f14cc32c RSI: ffffffff873439ca RDI: 000000078a661960
      RBP: 00000000ffff8880 R08: 00000000ffffffff R09: ffff88802613606f
      R10: ffffffff873439bc R11: 0000000000000000 R12: 0000000000000000
      R13: ffff88802613606c R14: ffff888011d0c210 R15: ffff888011d0c210
      FS:  0000000000749300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000004b60f0 CR3: 00000000185c2000 CR4: 00000000001506f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       linkinfo_prepare_data+0xfd/0x280 net/ethtool/linkinfo.c:37
       ethnl_default_notify+0x1dc/0x630 net/ethtool/netlink.c:586
       ethtool_notify+0xbd/0x1f0 net/ethtool/netlink.c:656
       ethtool_set_link_ksettings+0x277/0x330 net/ethtool/ioctl.c:620
       dev_ethtool+0x2b35/0x45d0 net/ethtool/ioctl.c:2842
       dev_ioctl+0x463/0xb70 net/core/dev_ioctl.c:440
       sock_do_ioctl+0x148/0x2d0 net/socket.c:1060
       sock_ioctl+0x477/0x6a0 net/socket.c:1177
       vfs_ioctl fs/ioctl.c:48 [inline]
       __do_sys_ioctl fs/ioctl.c:753 [inline]
       __se_sys_ioctl fs/ioctl.c:739 [inline]
       __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
       do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: c8907043 ("ethtool: Get link mode in use instead of speed and duplex parameters")
      Signed-off-by: NDanielle Ratson <danieller@nvidia.com>
      Reported-by: NEric Dumazet <eric.dumazet@gmail.com>
      Reviewed-by: NIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a975d7d8
  8. 07 4月, 2021 7 次提交
  9. 06 4月, 2021 7 次提交