Skip to content
  1. Dec 06, 2023
  2. Dec 05, 2023
    • Zhipeng Lu's avatar
      octeontx2-af: fix a use-after-free in rvu_npa_register_reporters · 3c91c909
      Zhipeng Lu authored
      The rvu_dl will be freed in rvu_npa_health_reporters_destroy(rvu_dl)
      after the create_workqueue fails, and after that free, the rvu_dl will
      be translate back through rvu_npa_health_reporters_create,
      rvu_health_reporters_create, and rvu_register_dl. Finally it goes to the
      err_dl_health label, being freed again in
      rvu_health_reporters_destroy(rvu) by rvu_npa_health_reporters_destroy.
      In the second calls of rvu_npa_health_reporters_destroy, however,
      it uses rvu_dl->rvu_npa_health_reporter, which is already freed at
      the end of rvu_npa_health_reporters_destroy in the first call.
      
      So this patch prevents the first destroy by instantly returning -ENONMEN
      when create_workqueue fails. In addition, since the failure of
      create_workqueue is the only entrence of label err, it has been
      integrated into the error-handling path of create_workqueue.
      
      Fixes: f1168d1e
      
       ("octeontx2-af: Add devlink health reporters for NPA")
      Signed-off-by: default avatarZhipeng Lu <alexious@zju.edu.cn>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Acked-by: default avatarGeethasowjanya Akula <gakula@marvell.com>
      Link: https://lore.kernel.org/r/20231202095902.3264863-1-alexious@zju.edu.cn
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      3c91c909
    • Jianheng Zhang's avatar
      net: stmmac: fix FPE events losing · 37e4b8df
      Jianheng Zhang authored
      The status bits of register MAC_FPE_CTRL_STS are clear on read. Using
      32-bit read for MAC_FPE_CTRL_STS in dwmac5_fpe_configure() and
      dwmac5_fpe_send_mpacket() clear the status bits. Then the stmmac interrupt
      handler missing FPE event status and leads to FPE handshaking failure and
      retries.
      To avoid clear status bits of MAC_FPE_CTRL_STS in dwmac5_fpe_configure()
      and dwmac5_fpe_send_mpacket(), add fpe_csr to stmmac_fpe_cfg structure to
      cache the control bits of MAC_FPE_CTRL_STS and to avoid reading
      MAC_FPE_CTRL_STS in those methods.
      
      Fixes: 5a558611
      
       ("net: stmmac: support FPE link partner hand-shaking procedure")
      Reviewed-by: default avatarSerge Semin <fancer.lancer@gmail.com>
      Signed-off-by: default avatarJianheng Zhang <Jianheng.Zhang@synopsys.com>
      Link: https://lore.kernel.org/r/CY5PR12MB637225A7CF529D5BE0FBE59CBF81A@CY5PR12MB6372.namprd12.prod.outlook.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      37e4b8df
    • Naveen Mamindlapalli's avatar
      octeontx2-pf: consider both Rx and Tx packet stats for adaptive interrupt coalescing · adbf100f
      Naveen Mamindlapalli authored
      The current adaptive interrupt coalescing code updates only rx
      packet stats for dim algorithm. This patch also updates tx packet
      stats which will be useful when there is only tx traffic.
      Also moved configuring hardware adaptive interrupt setting to
      driver dim callback.
      
      Fixes: 6e144b47
      
       ("octeontx2-pf: Add support for adaptive interrupt coalescing")
      Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
      Signed-off-by: default avatarSuman Ghosh <sumang@marvell.com>
      Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Link: https://lore.kernel.org/r/20231201053330.3903694-1-sumang@marvell.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      adbf100f
    • Thomas Reichinger's avatar
      arcnet: restoring support for multiple Sohard Arcnet cards · 6b17a597
      Thomas Reichinger authored
      Probe of Sohard Arcnet cards fails,
      if 2 or more cards are installed in a system.
      See kernel log:
      [    2.759203] arcnet: arcnet loaded
      [    2.763648] arcnet:com20020: COM20020 chipset support (by David Woodhouse et al.)
      [    2.770585] arcnet:com20020_pci: COM20020 PCI support
      [    2.772295] com20020 0000:02:00.0: enabling device (0000 -> 0003)
      [    2.772354] (unnamed net_device) (uninitialized): PLX-PCI Controls
      ...
      [    3.071301] com20020 0000:02:00.0 arc0-0 (uninitialized): PCI COM20020: station FFh found at F080h, IRQ 101.
      [    3.071305] com20020 0000:02:00.0 arc0-0 (uninitialized): Using CKP 64 - data rate 2.5 Mb/s
      [    3.071534] com20020 0000:07:00.0: enabling device (0000 -> 0003)
      [    3.071581] (unnamed net_device) (uninitialized): PLX-PCI Controls
      ...
      [    3.369501] com20020 0000:07:00.0: Led pci:green:tx:0-0 renamed to pci:green:tx:0-0_1 due to name collision
      [    3.369535] com20020 0000:07:00.0: Led pci:red:recon:0-0 renamed to pci:red:recon:0-0_1 due to name collision
      [    3.370586] com20020 0000:07:00.0 arc0-0 (uninitialized): PCI COM20020: station E1h found at C000h, IRQ 35.
      [    3.370589] com20020 0000:07:00.0 arc0-0 (uninitialized): Using CKP 64 - data rate 2.5 Mb/s
      [    3.370608] com20020: probe of 0000:07:00.0 failed with error -5
      
      commit 5ef216c1
      
       ("arcnet: com20020-pci: add rotary index support")
      changes the device name of all COM20020 based PCI cards,
      even if only some cards support this:
      	snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i);
      
      The error happens because all Sohard Arcnet cards would be called arc0-0,
      since the Sohard Arcnet cards don't have a PLX rotary coder.
      I.e. EAE Arcnet cards have a PLX rotary coder,
      which sets the first decimal, ensuring unique devices names.
      
      This patch adds two new card feature flags to indicate
      which cards support LEDs and the PLX rotary coder.
      For EAE based cards the names still depend on the PLX rotary coder
      (untested, since missing EAE hardware).
      For Sohard based cards, this patch will result in devices
      being called arc0, arc1, ... (tested).
      
      Signed-off-by: default avatarThomas Reichinger <thomas.reichinger@sohard.de>
      Fixes: 5ef216c1
      
       ("arcnet: com20020-pci: add rotary index support")
      Link: https://lore.kernel.org/r/20231130113503.6812-1-thomas.reichinger@sohard.de
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6b17a597
    • Daniel Borkmann's avatar
      packet: Move reference count in packet_sock to atomic_long_t · db3fadac
      Daniel Borkmann authored
      
      
      In some potential instances the reference count on struct packet_sock
      could be saturated and cause overflows which gets the kernel a bit
      confused. To prevent this, move to a 64-bit atomic reference count on
      64-bit architectures to prevent the possibility of this type to overflow.
      
      Because we can not handle saturation, using refcount_t is not possible
      in this place. Maybe someday in the future if it changes it could be
      used. Also, instead of using plain atomic64_t, use atomic_long_t instead.
      32-bit machines tend to be memory-limited (i.e. anything that increases
      a reference uses so much memory that you can't actually get to 2**32
      references). 32-bit architectures also tend to have serious problems
      with 64-bit atomics. Hence, atomic_long_t is the more natural solution.
      
      Reported-by: default avatar"The UK's National Cyber Security Centre (NCSC)" <security@ncsc.gov.uk>
      Co-developed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: stable@kernel.org
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20231201131021.19999-1-daniel@iogearbox.net
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      db3fadac
  3. Dec 04, 2023
  4. Dec 03, 2023
    • ChunHao Lin's avatar
      r8169: fix rtl8125b PAUSE frames blasting when suspended · 4b0768b6
      ChunHao Lin authored
      When FIFO reaches near full state, device will issue pause frame.
      If pause slot is enabled(set to 1), in this time, device will issue
      pause frame only once. But if pause slot is disabled(set to 0), device
      will keep sending pause frames until FIFO reaches near empty state.
      
      When pause slot is disabled, if there is no one to handle receive
      packets, device FIFO will reach near full state and keep sending
      pause frames. That will impact entire local area network.
      
      This issue can be reproduced in Chromebox (not Chromebook) in
      developer mode running a test image (and v5.10 kernel):
      1) ping -f $CHROMEBOX (from workstation on same local network)
      2) run "powerd_dbus_suspend" from command line on the $CHROMEBOX
      3) ping $ROUTER (wait until ping fails from workstation)
      
      Takes about ~20-30 seconds after step 2 for the local network to
      stop working.
      
      Fix this issue by enabling pause slot to only send pause frame once
      when FIFO reaches near full state.
      
      Fixes: f1bce4ad
      
       ("r8169: add support for RTL8125")
      Reported-by: default avatarGrant Grundler <grundler@chromium.org>
      Tested-by: default avatarGrant Grundler <grundler@chromium.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarChunHao Lin <hau@realtek.com>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Link: https://lore.kernel.org/r/20231129155350.5843-1-hau@realtek.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4b0768b6
  5. Dec 02, 2023
    • Randy Dunlap's avatar
      hv_netvsc: rndis_filter needs to select NLS · 6c89f499
      Randy Dunlap authored
      rndis_filter uses utf8s_to_utf16s() which is provided by setting
      NLS, so select NLS to fix the build error:
      
      ERROR: modpost: "utf8s_to_utf16s" [drivers/net/hyperv/hv_netvsc.ko] undefined!
      
      Fixes: 1ce09e89
      
       ("hyperv: Add support for setting MAC from within guests")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: K. Y. Srinivasan <kys@microsoft.com>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Dexuan Cui <decui@microsoft.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Tested-by: Simon Horman <horms@kernel.org> # build-tested
      Reviewed-by: default avatarMichael Kelley <mikelley@microsoft.com>
      Link: https://lore.kernel.org/r/20231130055853.19069-1-rdunlap@infradead.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6c89f499
    • Thinh Tran's avatar
      net/tg3: fix race condition in tg3_reset_task() · 16b55b1f
      Thinh Tran authored
      
      
      When an EEH error is encountered by a PCI adapter, the EEH driver
      modifies the PCI channel's state as shown below:
      
         enum {
            /* I/O channel is in normal state */
            pci_channel_io_normal = (__force pci_channel_state_t) 1,
      
            /* I/O to channel is blocked */
            pci_channel_io_frozen = (__force pci_channel_state_t) 2,
      
            /* PCI card is dead */
            pci_channel_io_perm_failure = (__force pci_channel_state_t) 3,
         };
      
      If the same EEH error then causes the tg3 driver's transmit timeout
      logic to execute, the tg3_tx_timeout() function schedules a reset
      task via tg3_reset_task_schedule(), which may cause a race condition
      between the tg3 and EEH driver as both attempt to recover the HW via
      a reset action.
      
      EEH driver gets error event
      --> eeh_set_channel_state()
          and set device to one of
          error state above           scheduler: tg3_reset_task() get
                                      returned error from tg3_init_hw()
                                   --> dev_close() shuts down the interface
      tg3_io_slot_reset() and
      tg3_io_resume() fail to
      reset/resume the device
      
      To resolve this issue, we avoid the race condition by checking the PCI
      channel state in the tg3_reset_task() function and skip the tg3 driver
      initiated reset when the PCI channel is not in the normal state.  (The
      driver has no access to tg3 device registers at this point and cannot
      even complete the reset task successfully without external assistance.)
      We'll leave the reset procedure to be managed by the EEH driver which
      calls the tg3_io_error_detected(), tg3_io_slot_reset() and
      tg3_io_resume() functions as appropriate.
      
      Adding the same checking in tg3_dump_state() to avoid dumping all
      device registers when the PCI channel is not in the normal state.
      
      Signed-off-by: default avatarThinh Tran <thinhtr@linux.vnet.ibm.com>
      Tested-by: default avatarVenkata Sai Duggi <venkata.sai.duggi@ibm.com>
      Reviewed-by: default avatarDavid Christensen <drc@linux.vnet.ibm.com>
      Reviewed-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Link: https://lore.kernel.org/r/20231201001911.656-1-thinhtr@linux.vnet.ibm.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      16b55b1f
  6. Dec 01, 2023
    • Subbaraya Sundeep's avatar
      octeontx2-af: Check return value of nix_get_nixlf before using nixlf · 830139e7
      Subbaraya Sundeep authored
      If a NIXLF is not attached to a PF/VF device then
      nix_get_nixlf function fails and returns proper error
      code. But npc_get_default_entry_action does not check it
      and uses garbage value in subsequent calls. Fix this
      by cheking the return value of nix_get_nixlf.
      
      Fixes: 967db352
      
       ("octeontx2-af: add support for multicast/promisc packet replication feature")
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      830139e7
    • Subbaraya Sundeep's avatar
      octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam · 9572c949
      Subbaraya Sundeep authored
      All the mailbox messages sent to AF needs to be guarded
      by mutex lock. Add the missing lock in otx2_get_pauseparam
      function.
      
      Fixes: 75f36270
      
       ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
      Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9572c949
    • Jakub Kicinski's avatar
      MAINTAINERS: exclude 9p from networking · cf50b5ca
      Jakub Kicinski authored
      
      
      We don't have much to say about 9p, even tho it lives under net/.
      Avoid CCing netdev.
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cf50b5ca
    • Eric Dumazet's avatar
      ipv6: fix potential NULL deref in fib6_add() · 75475bb5
      Eric Dumazet authored
      If fib6_find_prefix() returns NULL, we should silently fallback
      using fib6_null_entry regardless of RT6_DEBUG value.
      
      syzbot reported:
      
      WARNING: CPU: 0 PID: 5477 at net/ipv6/ip6_fib.c:1516 fib6_add+0x310d/0x3fa0 net/ipv6/ip6_fib.c:1516
      Modules linked in:
      CPU: 0 PID: 5477 Comm: syz-executor.0 Not tainted 6.7.0-rc2-syzkaller-00029-g9b6de136b5f0 #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
      RIP: 0010:fib6_add+0x310d/0x3fa0 net/ipv6/ip6_fib.c:1516
      Code: 00 48 8b 54 24 68 e8 42 22 00 00 48 85 c0 74 14 49 89 c6 e8 d5 d3 c2 f7 eb 5d e8 ce d3 c2 f7 e9 ca 00 00 00 e8 c4 d3 c2 f7 90 <0f> 0b 90 48 b8 00 00 00 00 00 fc ff df 48 8b 4c 24 38 80 3c 01 00
      RSP: 0018:ffffc90005067740 EFLAGS: 00010293
      RAX: ffffffff89cba5bc RBX: ffffc90005067ab0 RCX: ffff88801a2e9dc0
      RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
      RBP: ffffc90005067980 R08: ffffffff89cbca85 R09: 1ffff110040d4b85
      R10: dffffc0000000000 R11: ffffed10040d4b86 R12: 00000000ffffffff
      R13: 1ffff110051c3904 R14: ffff8880206a5c00 R15: ffff888028e1c820
      FS: 00007f763783c6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
      CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007f763783bff8 CR3: 000000007f74d000 CR4: 00000000003506f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
      <TASK>
      __ip6_ins_rt net/ipv6/route.c:1303 [inline]
      ip6_route_add+0x88/0x120 net/ipv6/route.c:3847
      ipv6_route_ioctl+0x525/0x7b0 net/ipv6/route.c:4467
      inet6_ioctl+0x21a/0x270 net/ipv6/af_inet6.c:575
      sock_do_ioctl+0x152/0x460 net/socket.c:1220
      sock_ioctl+0x615/0x8c0 net/socket.c:1339
      vfs_ioctl fs/ioctl.c:51 [inline]
      __do_sys_ioctl fs/ioctl.c:871 [inline]
      __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857
      do_syscall_x64 arch/x86/entry/common.c:51 [inline]
      do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82
      
      Fixes: 7bbfe00e
      
       ("ipv6: fix general protection fault in fib6_add()")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Wei Wang <weiwan@google.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Link: https://lore.kernel.org/r/20231129160630.3509216-1-edumazet@google.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      75475bb5
    • Linus Torvalds's avatar
      Merge tag 'net-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 6172a518
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from bpf and wifi.
      
        Current release - regressions:
      
         - neighbour: fix __randomize_layout crash in struct neighbour
      
         - r8169: fix deadlock on RTL8125 in jumbo mtu mode
      
        Previous releases - regressions:
      
         - wifi:
             - mac80211: fix warning at station removal time
             - cfg80211: fix CQM for non-range use
      
         - tools: ynl-gen: fix unexpected response handling
      
         - octeontx2-af: fix possible buffer overflow
      
         - dpaa2: recycle the RX buffer only after all processing done
      
         - rswitch: fix missing dev_kfree_skb_any() in error path
      
        Previous releases - always broken:
      
         - ipv4: fix uaf issue when receiving igmp query packet
      
         - wifi: mac80211: fix debugfs deadlock at device removal time
      
         - bpf:
             - sockmap: af_unix stream sockets need to hold ref for pair sock
             - netdevsim: don't accept device bound programs
      
         - selftests: fix a char signedness issue
      
         - dsa: mv88e6xxx: fix marvell 6350 probe crash
      
         - octeontx2-pf: restore TC ingress police rules when interface is up
      
         - wangxun: fix memory leak on msix entry
      
         - ravb: keep reverse order of operations in ravb_remove()"
      
      * tag 'net-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (51 commits)
        net: ravb: Keep reverse order of operations in ravb_remove()
        net: ravb: Stop DMA in case of failures on ravb_open()
        net: ravb: Start TX queues after HW initialization succeeded
        net: ravb: Make write access to CXR35 first before accessing other EMAC registers
        net: ravb: Use pm_runtime_resume_and_get()
        net: ravb: Check return value of reset_control_deassert()
        net: libwx: fix memory leak on msix entry
        ice: Fix VF Reset paths when interface in a failed over aggregate
        bpf, sockmap: Add af_unix test with both sockets in map
        bpf, sockmap: af_unix stream sockets need to hold ref for pair sock
        tools: ynl-gen: always construct struct ynl_req_state
        ethtool: don't propagate EOPNOTSUPP from dumps
        ravb: Fix races between ravb_tx_timeout_work() and net related ops
        r8169: prevent potential deadlock in rtl8169_close
        r8169: fix deadlock on RTL8125 in jumbo mtu mode
        neighbour: Fix __randomize_layout crash in struct neighbour
        octeontx2-pf: Restore TC ingress police rules when interface is up
        octeontx2-pf: Fix adding mbox work queue entry when num_vfs > 64
        net: stmmac: xgmac: Disable FPE MMC interrupts
        octeontx2-af: Fix possible buffer overflow
        ...
      6172a518
    • Linus Torvalds's avatar
      Merge tag 'pmdomain-v6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm · e8f60209
      Linus Torvalds authored
      Pull pmdomain fix from Ulf Hansson:
      
       - Avoid polling for the scmi_perf_domain on arm
      
      * tag 'pmdomain-v6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
        pmdomain: arm: Avoid polling for scmi_perf_domain
      e8f60209
    • Linus Torvalds's avatar
      Merge tag 'mmc-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 09443a14
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - Fix CQE error recovery path
      
        MMC host:
         - cqhci: Fix CQE error recovery path
         - sdhci-pci-gli: Fix initialization of LPM
         - sdhci-sprd: Fix enabling/disabling of the vqmmc regulator"
      
      * tag 'mmc-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: sdhci-sprd: Fix vqmmc not shutting down after the card was pulled
        mmc: sdhci-pci-gli: Disable LPM during initialization
        mmc: cqhci: Fix task clearing in CQE error recovery
        mmc: cqhci: Warn of halt or task clear failure
        mmc: block: Retry commands in CQE error recovery
        mmc: block: Be sure to wait while busy in CQE error recovery
        mmc: cqhci: Increase recovery halt timeout
        mmc: block: Do not lose cache flush during CQE error recovery
      09443a14
    • Linus Torvalds's avatar
      Merge tag 'leds-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds · 16864755
      Linus Torvalds authored
      Pull LED fix from Lee Jones:
      
       - Remove duplicate sysfs entry 'color' from LEDs class
      
      * tag 'leds-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds:
        leds: class: Don't expose color sysfs entry
      16864755
    • Linus Torvalds's avatar
      Merge tag 'efi-urgent-for-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi · 9d3eac3c
      Linus Torvalds authored
      Pull EFI fix from Ard Biesheuvel:
      
       - Fix for EFI unaccepted memory handling
      
      * tag 'efi-urgent-for-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
        efi/unaccepted: Fix off-by-one when checking for overlapping ranges
      9d3eac3c
  7. Nov 30, 2023
    • Paolo Abeni's avatar
      Merge branch 'net-ravb-fixes-for-the-ravb-driver' · 777f245e
      Paolo Abeni authored
      
      
      Claudiu Beznea says:
      
      ====================
      net: ravb: Fixes for the ravb driver
      
      This series adds some fixes for ravb driver. Patches in this series
      were initilly part of series at [1].
      
      Changes in v2:
      - in description of patch 1/6 documented the addition of
        out_free_netdev goto label
      - collected tags
      - s/out_runtime_disable/out_rpm_disable in patch 2/6
      - fixed typos in description of patch 6/6
      
      Changes since [1]:
      - addressed review comments
      - added patch 6/6
      
      [1] https://lore.kernel.org/all/20231120084606.4083194-1-claudiu.beznea.uj@bp.renesas.com/
      ====================
      
      Link: https://lore.kernel.org/r/20231128080439.852467-1-claudiu.beznea.uj@bp.renesas.com
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      777f245e
    • Claudiu Beznea's avatar
      net: ravb: Keep reverse order of operations in ravb_remove() · edf9bc39
      Claudiu Beznea authored
      On RZ/G3S SMARC Carrier II board having RGMII connections b/w Ethernet
      MACs and PHYs it has been discovered that doing unbind/bind for ravb
      driver in a loop leads to wrong speed and duplex for Ethernet links and
      broken connectivity (the connectivity cannot be restored even with
      bringing interface down/up). Before doing unbind/bind the Ethernet
      interfaces were configured though systemd. The sh instructions used to
      do unbind/bind were:
      
      $ cd /sys/bus/platform/drivers/ravb/
      $ while :; do echo 11c30000.ethernet > unbind ; \
        echo 11c30000.ethernet > bind; done
      
      It has been discovered that there is a race b/w IOCTLs initialized by
      systemd at the response of success binding and the
      "ravb_write(ndev, CCC_OPC_RESET, CCC)" call in ravb_remove() as
      follows:
      
      1/ as a result of bind success the user space open/configures the
         interfaces tough an IOCTL; the following stack trace has been
         identified on RZ/G3S:
      
      Call trace:
      dump_backtrace+0x9c/0x100
      show_stack+0x20/0x38
      dump_stack_lvl+0x48/0x60
      dump_stack+0x18/0x28
      ravb_open+0x70/0xa58
      __dev_open+0xf4/0x1e8
      __dev_change_flags+0x198/0x218
      dev_change_flags+0x2c/0x80
      devinet_ioctl+0x640/0x708
      inet_ioctl+0x1e4/0x200
      sock_do_ioctl+0x50/0x108
      sock_ioctl+0x240/0x358
      __arm64_sys_ioctl+0xb0/0x100
      invoke_syscall+0x50/0x128
      el0_svc_common.constprop.0+0xc8/0xf0
      do_el0_svc+0x24/0x38
      el0_svc+0x34/0xb8
      el0t_64_sync_handler+0xc0/0xc8
      el0t_64_sync+0x190/0x198
      
      2/ this call may execute concurrently with ravb_remove() as the
         unbind/bind operation was executed in a loop
      3/ if the operation mode is changed to RESET (through
         ravb_write(ndev, CCC_OPC_RESET, CCC) call in ravb_remove())
         while the above ravb_open() is in progress it may lead to MAC
         (or PHY, or MAC-PHY connection, the right point hasn't been identified
         at the moment) to be broken, thus the Ethernet connectivity fails to
         restore.
      
      The simple fix for this is to move ravb_write(ndev, CCC_OPC_RESET, CCC))
      after unregister_netdev() to avoid resetting the controller while the
      netdev interface is still registered.
      
      To avoid future issues in ravb_remove(), the patch follows the proper order
      of operations in ravb_remove(): reverse order compared with ravb_probe().
      This avoids described races as the IOCTLs as well as unregister_netdev()
      (called now at the beginning of ravb_remove()) calls rtnl_lock() before
      continuing and IOCTLs check (though devinet_ioctl()) if device is still
      registered just after taking the lock:
      
      int devinet_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr)
      {
      	// ...
      
              rtnl_lock();
      
              ret = -ENODEV;
              dev = __dev_get_by_name(net, ifr->ifr_name);
              if (!dev)
                      goto done;
      
      	// ...
      done:
              rtnl_unlock();
      out:
              return ret;
      }
      
      Fixes: c156633f
      
       ("Renesas Ethernet AVB driver proper")
      Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      edf9bc39
    • Claudiu Beznea's avatar
      net: ravb: Stop DMA in case of failures on ravb_open() · eac16a73
      Claudiu Beznea authored
      In case ravb_phy_start() returns with error the settings applied in
      ravb_dmac_init() are not reverted (e.g. config mode). For this call
      ravb_stop_dma() on failure path of ravb_open().
      
      Fixes: a0d2f206
      
       ("Renesas Ethernet AVB PTP clock driver")
      Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      eac16a73
    • Claudiu Beznea's avatar
      net: ravb: Start TX queues after HW initialization succeeded · 6f32c086
      Claudiu Beznea authored
      ravb_phy_start() may fail. If that happens, the TX queues will remain
      started. Thus, move the netif_tx_start_all_queues() after PHY is
      successfully initialized.
      
      Fixes: c156633f
      
       ("Renesas Ethernet AVB driver proper")
      Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
      Reviewed-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      6f32c086
    • Claudiu Beznea's avatar
      net: ravb: Make write access to CXR35 first before accessing other EMAC registers · d78c0ced
      Claudiu Beznea authored
      Hardware manual of RZ/G3S (and RZ/G2L) specifies the following on the
      description of CXR35 register (chapter "PHY interface select register
      (CXR35)"): "After release reset, make write-access to this register before
      making write-access to other registers (except MDIOMOD). Even if not need
      to change the value of this register, make write-access to this register
      at least one time. Because RGMII/MII MODE is recognized by accessing this
      register".
      
      The setup procedure for EMAC module (chapter "Setup procedure" of RZ/G3S,
      RZ/G2L manuals) specifies the E-MAC.CXR35 register is the first EMAC
      register that is to be configured.
      
      Note [A] from chapter "PHY interface select register (CXR35)" specifies
      the following:
      [A] The case which CXR35 SEL_XMII is used for the selection of RGMII/MII
      in APB Clock 100 MHz.
      (1) To use RGMII interface, Set ‘H’03E8_0000’ to this register.
      (2) To use MII interface, Set ‘H’03E8_0002’ to this register.
      
      Take into account these indication.
      
      Fixes: 1089877a
      
       ("ravb: Add RZ/G2L MII interface support")
      Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      d78c0ced
    • Claudiu Beznea's avatar
      net: ravb: Use pm_runtime_resume_and_get() · 88b74831
      Claudiu Beznea authored
      pm_runtime_get_sync() may return an error. In case it returns with an error
      dev->power.usage_count needs to be decremented. pm_runtime_resume_and_get()
      takes care of this. Thus use it.
      
      Fixes: c156633f
      
       ("Renesas Ethernet AVB driver proper")
      Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      88b74831
    • Claudiu Beznea's avatar
      net: ravb: Check return value of reset_control_deassert() · d8eb6ea4
      Claudiu Beznea authored
      reset_control_deassert() could return an error. Some devices cannot work
      if reset signal de-assert operation fails. To avoid this check the return
      code of reset_control_deassert() in ravb_probe() and take proper action.
      
      Along with it, the free_netdev() call from the error path was moved after
      reset_control_assert() on its own label (out_free_netdev) to free
      netdev in case reset_control_deassert() fails.
      
      Fixes: 0d13a1a4
      
       ("ravb: Add reset support")
      Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
      Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      d8eb6ea4
    • Jiawen Wu's avatar
      net: libwx: fix memory leak on msix entry · 91fdb30d
      Jiawen Wu authored
      Since pci_free_irq_vectors() set pdev->msix_enabled as 0 in the
      calling of pci_msix_shutdown(), wx->msix_entries is never freed.
      Reordering the lines to fix the memory leak.
      
      Cc: stable@vger.kernel.org
      Fixes: 3f703186
      
       ("net: libwx: Add irq flow functions")
      Signed-off-by: default avatarJiawen Wu <jiawenwu@trustnetic.com>
      Reviewed-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
      Link: https://lore.kernel.org/r/20231128095928.1083292-1-jiawenwu@trustnetic.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      91fdb30d