Skip to content
  1. Oct 28, 2021
  2. Oct 27, 2021
  3. Oct 21, 2021
  4. Oct 20, 2021
    • Greg Kroah-Hartman's avatar
      Linux 5.10.75 · 3a9842b4
      Greg Kroah-Hartman authored
      
      
      Link: https://lore.kernel.org/r/20211018132334.702559133@linuxfoundation.org
      Tested-by: default avatarFox Chen <foxhlchen@gmail.com>
      Tested-by: default avatarPavel Machek (CIP) <pavel@denx.de>
      Tested-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      Tested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
      Tested-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
      Tested-by: default avatarSudip Mukherjee <sudip.mukherjee@codethink.co.uk>
      Tested-by: default avatarSalvatore Bonaccorso <carnil@debian.org>
      Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Tested-by: default avatarHulk Robot <hulkrobot@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      v5.10.75
      3a9842b4
    • Maarten Zanders's avatar
      net: dsa: mv88e6xxx: don't use PHY_DETECT on internal PHY's · 3e287365
      Maarten Zanders authored
      commit 4a3e0aed upstream.
      
      mv88e6xxx_port_ppu_updates() interpretes data in the PORT_STS
      register incorrectly for internal ports (ie no PPU). In these
      cases, the PHY_DETECT bit indicates link status. This results
      in forcing the MAC state whenever the PHY link goes down which
      is not intended. As a side effect, LED's configured to show
      link status stay lit even though the physical link is down.
      
      Add a check in mac_link_down and mac_link_up to see if it
      concerns an external port and only then, look at PPU status.
      
      Fixes: 5d5b231d
      
       (net: dsa: mv88e6xxx: use PHY_DETECT in mac_link_up/mac_link_down)
      Reported-by: default avatarMaarten Zanders <m.zanders@televic.com>
      Reviewed-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: default avatarMaarten Zanders <maarten.zanders@mind.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3e287365
    • Shannon Nelson's avatar
      ionic: don't remove netdev->dev_addr when syncing uc list · 3593fa14
      Shannon Nelson authored
      commit 5c976a56 upstream.
      
      Bridging, and possibly other upper stack gizmos, adds the
      lower device's netdev->dev_addr to its own uc list, and
      then requests it be deleted when the upper bridge device is
      removed.  This delete request also happens with the bridging
      vlan_filtering is enabled and then disabled.
      
      Bonding has a similar behavior with the uc list, but since it
      also uses set_mac to manage netdev->dev_addr, it doesn't have
      the same the failure case.
      
      Because we store our netdev->dev_addr in our uc list, we need
      to ignore the delete request from dev_uc_sync so as to not
      lose the address and all hope of communicating.  Note that
      ndo_set_mac_address is expressly changing netdev->dev_addr,
      so no limitation is set there.
      
      Fixes: 2a654540
      
       ("ionic: Add Rx filter and rx_mode ndo support")
      Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3593fa14
    • Vladimir Oltean's avatar
      net: mscc: ocelot: warn when a PTP IRQ is raised for an unknown skb · f33890d9
      Vladimir Oltean authored
      commit 9fde506e upstream.
      
      When skb_match is NULL, it means we received a PTP IRQ for a timestamp
      ID that the kernel has no idea about, since there is no skb in the
      timestamping queue with that timestamp ID.
      
      This is a grave error and not something to just "continue" over.
      So print a big warning in case this happens.
      
      Also, move the check above ocelot_get_hwtimestamp(), there is no point
      in reading the full 64-bit current PTP time if we're not going to do
      anything with it anyway for this skb.
      
      Fixes: 4e3b0468
      
       ("net: mscc: PTP Hardware Clock (PHC) support")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f33890d9
    • Baowen Zheng's avatar
      nfp: flow_offload: move flow_indr_dev_register from app init to app start · 9c546af1
      Baowen Zheng authored
      commit 60d950f4 upstream.
      
      In commit 74fc4f82 ("net: Fix offloading indirect devices dependency
      on qdisc order creation"), it adds a process to trigger the callback to
      setup the bo callback when the driver regists a callback.
      
      In our current implement, we are not ready to run the callback when nfp
      call the function flow_indr_dev_register, then there will be error
      message as:
      
      kernel: Oops: 0000 [#1] SMP PTI
      kernel: CPU: 0 PID: 14119 Comm: kworker/0:0 Tainted: G
      kernel: Workqueue: events work_for_cpu_fn
      kernel: RIP: 0010:nfp_flower_indr_setup_tc_cb+0x258/0x410
      kernel: RSP: 0018:ffffbc1e02c57bf8 EFLAGS: 00010286
      kernel: RAX: 0000000000000000 RBX: ffff9c761fabc000 RCX: 0000000000000001
      kernel: RDX: 0000000000000001 RSI: fffffffffffffff0 RDI: ffffffffc0be9ef1
      kernel: RBP: ffffbc1e02c57c58 R08: ffffffffc08f33aa R09: ffff9c6db7478800
      kernel: R10: 0000009c003f6e00 R11: ffffbc1e02800000 R12: ffffbc1e000d9000
      kernel: R13: ffffbc1e000db428 R14: ffff9c6db7478800 R15: ffff9c761e884e80
      kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      kernel: CR2: fffffffffffffff0 CR3: 00000009e260a004 CR4: 00000000007706f0
      kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      kernel: PKRU: 55555554
      kernel: Call Trace:
      kernel: ? flow_indr_dev_register+0xab/0x210
      kernel: ? __cond_resched+0x15/0x30
      kernel: ? kmem_cache_alloc_trace+0x44/0x4b0
      kernel: ? nfp_flower_setup_tc+0x1d0/0x1d0 [nfp]
      kernel: flow_indr_dev_register+0x158/0x210
      kernel: ? tcf_block_unbind+0xe0/0xe0
      kernel: nfp_flower_init+0x40b/0x650 [nfp]
      kernel: nfp_net_pci_probe+0x25f/0x960 [nfp]
      kernel: ? nfp_rtsym_read_le+0x76/0x130 [nfp]
      kernel: nfp_pci_probe+0x6a9/0x820 [nfp]
      kernel: local_pci_probe+0x45/0x80
      
      So we need to call flow_indr_dev_register in app start process instead of
      init stage.
      
      Fixes: 74fc4f82
      
       ("net: Fix offloading indirect devices dependency on qdisc order creation")
      Signed-off-by: default avatarBaowen Zheng <baowen.zheng@corigine.com>
      Signed-off-by: default avatarSimon Horman <simon.horman@corigine.com>
      Signed-off-by: default avatarLouis Peens <louis.peens@corigine.com>
      Link: https://lore.kernel.org/r/20211012124850.13025-1-louis.peens@corigine.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9c546af1
    • Vegard Nossum's avatar
      r8152: select CRC32 and CRYPTO/CRYPTO_HASH/CRYPTO_SHA256 · 6da9af2d
      Vegard Nossum authored
      commit 9973a430 upstream.
      
      Fix the following build/link errors by adding a dependency on
      CRYPTO, CRYPTO_HASH, CRYPTO_SHA256 and CRC32:
      
        ld: drivers/net/usb/r8152.o: in function `rtl8152_fw_verify_checksum':
        r8152.c:(.text+0x2b2a): undefined reference to `crypto_alloc_shash'
        ld: r8152.c:(.text+0x2bed): undefined reference to `crypto_shash_digest'
        ld: r8152.c:(.text+0x2c50): undefined reference to `crypto_destroy_tfm'
        ld: drivers/net/usb/r8152.o: in function `_rtl8152_set_rx_mode':
        r8152.c:(.text+0xdcb0): undefined reference to `crc32_le'
      
      Fixes: 9370f2d0 ("r8152: support request_firmware for RTL8153")
      Fixes: ac718b69
      
       ("net/usb: new driver for RTL8152")
      Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6da9af2d
    • chongjiapeng's avatar
      qed: Fix missing error code in qed_slowpath_start() · ecfd4fa1
      chongjiapeng authored
      commit a5a14ea7
      
       upstream.
      
      The error code is missing in this code scenario, add the error code
      '-EINVAL' to the return value 'rc'.
      
      Eliminate the follow smatch warning:
      
      drivers/net/ethernet/qlogic/qed/qed_main.c:1298 qed_slowpath_start()
      warn: missing error code 'rc'.
      
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Fixes: d51e4af5
      
       ("qed: aRFS infrastructure support")
      Signed-off-by: default avatarchongjiapeng <jiapeng.chong@linux.alibaba.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ecfd4fa1
    • Sebastian Andrzej Siewior's avatar
      mqprio: Correct stats in mqprio_dump_class_stats(). · 51f6e72c
      Sebastian Andrzej Siewior authored
      commit 14132690 upstream.
      
      Introduction of lockless subqueues broke the class statistics.
      Before the change stats were accumulated in `bstats' and `qstats'
      on the stack which was then copied to struct gnet_dump.
      
      After the change the `bstats' and `qstats' are initialized to 0
      and never updated, yet still fed to gnet_dump. The code updates
      the global qdisc->cpu_bstats and qdisc->cpu_qstats instead,
      clobbering them. Most likely a copy-paste error from the code in
      mqprio_dump().
      
      __gnet_stats_copy_basic() and __gnet_stats_copy_queue() accumulate
      the values for per-CPU case but for global stats they overwrite
      the value, so only stats from the last loop iteration / tc end up
      in sch->[bq]stats.
      
      Use the on-stack [bq]stats variables again and add the stats manually
      in the global case.
      
      Fixes: ce679e8d
      
       ("net: sched: add support for TCQ_F_NOLOCK subqueues to sch_mqprio")
      Cc: John Fastabend <john.fastabend@gmail.com>
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      https://lore.kernel.org/all/20211007175000.2334713-2-bigeasy@linutronix.de/
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      51f6e72c
    • Prashant Malani's avatar
      platform/x86: intel_scu_ipc: Fix busy loop expiry time · fdaff7f9
      Prashant Malani authored
      commit 41512e4d upstream.
      
      The macro IPC_TIMEOUT is already in jiffies (it is also used like that
      elsewhere in the file when calling wait_for_completion_timeout()). Don’t
      convert it using helper functions for the purposes of calculating the
      busy loop expiry time.
      
      Fixes: e7b7ab38
      
       (“platform/x86: intel_scu_ipc: Sleeping is fine when polling”)
      Signed-off-by: default avatarPrashant Malani <pmalani@chromium.org>
      Cc: Benson Leung <bleung@chromium.org>
      Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Link: https://lore.kernel.org/r/20210928101932.2543937-2-pmalani@chromium.org
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fdaff7f9
    • Jackie Liu's avatar
      acpi/arm64: fix next_platform_timer() section mismatch error · 057ee684
      Jackie Liu authored
      commit 596143e3 upstream.
      
      Fix modpost Section mismatch error in next_platform_timer().
      
        [...]
        WARNING: modpost: vmlinux.o(.text.unlikely+0x26e60): Section mismatch in reference from the function next_platform_timer() to the variable .init.data:acpi_gtdt_desc
        The function next_platform_timer() references
        the variable __initdata acpi_gtdt_desc.
        This is often because next_platform_timer lacks a __initdata
        annotation or the annotation of acpi_gtdt_desc is wrong.
      
        WARNING: modpost: vmlinux.o(.text.unlikely+0x26e64): Section mismatch in reference from the function next_platform_timer() to the variable .init.data:acpi_gtdt_desc
        The function next_platform_timer() references
        the variable __initdata acpi_gtdt_desc.
        This is often because next_platform_timer lacks a __initdata
        annotation or the annotation of acpi_gtdt_desc is wrong.
      
        ERROR: modpost: Section mismatches detected.
        Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.
        make[1]: *** [scripts/Makefile.modpost:59: vmlinux.symvers] Error 1
        make[1]: *** Deleting file 'vmlinux.symvers'
        make: *** [Makefile:1176: vmlinux] Error 2
        [...]
      
      Fixes: a712c3ed
      
       ("acpi/arm64: Add memory-mapped timer support in GTDT driver")
      Signed-off-by: default avatarJackie Liu <liuyun01@kylinos.cn>
      Acked-by: default avatarHanjun Guo <guohanjun@huawei.com>
      Link: https://lore.kernel.org/r/20210823092526.2407526-1-liu.yun@linux.dev
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      057ee684
    • Dan Carpenter's avatar
      drm/msm/dsi: fix off by one in dsi_bus_clk_enable error handling · c6b24000
      Dan Carpenter authored
      commit c8f01ffc upstream.
      
      This disables a lock which wasn't enabled and it does not disable
      the first lock in the array.
      
      Fixes: 6e0eb52e
      
       ("drm/msm/dsi: Parse bus clocks from a list")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Link: https://lore.kernel.org/r/20211001123409.GG2283@kili
      Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c6b24000
    • Dan Carpenter's avatar
      drm/msm/dsi: Fix an error code in msm_dsi_modeset_init() · 2c565871
      Dan Carpenter authored
      commit 739b4e77 upstream.
      
      Return an error code if msm_dsi_manager_validate_current_config().
      Don't return success.
      
      Fixes: 8b03ad30
      
       ("drm/msm/dsi: Use one connector for dual DSI mode")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Link: https://lore.kernel.org/r/20211001123308.GF2283@kili
      Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2c565871
    • Rob Clark's avatar
      drm/msm/a6xx: Track current ctx by seqno · b28586fb
      Rob Clark authored
      commit 14eb0cb4 upstream.
      
      In theory a context can be destroyed and a new one allocated at the same
      address, making the pointer comparision to detect when we don't need to
      update the current pagetables invalid.  Instead assign a sequence number
      to each context on creation, and use this for the check.
      
      Fixes: 84c31ee1
      
       ("drm/msm/a6xx: Add support for per-instance pagetables")
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b28586fb
    • Dmitry Baryshkov's avatar
      drm/msm/mdp5: fix cursor-related warnings · abd11864
      Dmitry Baryshkov authored
      commit c491a0c7 upstream.
      
      Since f35a2a99 ("drm/encoder: make encoder control functions
      optional") drm_mode_config_validate would print warnings if both cursor
      plane and cursor functions are provided. Restore separate set of
      drm_crtc_funcs to be used if separate cursor plane is provided.
      
      [    6.556046] ------------[ cut here ]------------
      [    6.556071] [CRTC:93:crtc-0] must not have both a cursor plane and a cursor_set func
      [    6.556091] WARNING: CPU: 1 PID: 76 at drivers/gpu/drm/drm_mode_config.c:648 drm_mode_config_validate+0x238/0x4d0
      [    6.567453] Modules linked in:
      [    6.577604] CPU: 1 PID: 76 Comm: kworker/u8:2 Not tainted 5.15.0-rc1-dirty #43
      [    6.580557] Hardware name: Qualcomm Technologies, Inc. DB820c (DT)
      [    6.587763] Workqueue: events_unbound deferred_probe_work_func
      [    6.593926] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [    6.599740] pc : drm_mode_config_validate+0x238/0x4d0
      [    6.606596] lr : drm_mode_config_validate+0x238/0x4d0
      [    6.611804] sp : ffff8000121b3980
      [    6.616838] x29: ffff8000121b3990 x28: 0000000000000000 x27: 0000000000000001
      [    6.620140] x26: ffff8000114cde50 x25: ffff8000114cdd40 x24: ffff0000987282d8
      [    6.627258] x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000000001
      [    6.634376] x20: ffff000098728000 x19: ffff000080a39000 x18: ffffffffffffffff
      [    6.641494] x17: 3136564e3631564e x16: 0000000000000324 x15: ffff800011c78709
      [    6.648613] x14: 0000000000000000 x13: ffff800011a22850 x12: 00000000000009ab
      [    6.655730] x11: 0000000000000339 x10: ffff800011a22850 x9 : ffff800011a22850
      [    6.662848] x8 : 00000000ffffefff x7 : ffff800011a7a850 x6 : ffff800011a7a850
      [    6.669966] x5 : 000000000000bff4 x4 : 40000000fffff339 x3 : 0000000000000000
      [    6.677084] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00008093b800
      [    6.684205] Call trace:
      [    6.691319]  drm_mode_config_validate+0x238/0x4d0
      [    6.693577]  drm_dev_register+0x17c/0x210
      [    6.698435]  msm_drm_bind+0x4b4/0x694
      [    6.702429]  try_to_bring_up_master+0x164/0x1d0
      [    6.706075]  __component_add+0xa0/0x170
      [    6.710415]  component_add+0x14/0x20
      [    6.714234]  msm_hdmi_dev_probe+0x1c/0x2c
      [    6.718053]  platform_probe+0x68/0xe0
      [    6.721959]  really_probe.part.0+0x9c/0x30c
      [    6.725606]  __driver_probe_device+0x98/0x144
      [    6.729600]  driver_probe_device+0xc8/0x15c
      [    6.734114]  __device_attach_driver+0xb4/0x120
      [    6.738106]  bus_for_each_drv+0x78/0xd0
      [    6.742619]  __device_attach+0xdc/0x184
      [    6.746351]  device_initial_probe+0x14/0x20
      [    6.750172]  bus_probe_device+0x9c/0xa4
      [    6.754337]  deferred_probe_work_func+0x88/0xc0
      [    6.758158]  process_one_work+0x1d0/0x370
      [    6.762671]  worker_thread+0x2c8/0x470
      [    6.766839]  kthread+0x15c/0x170
      [    6.770483]  ret_from_fork+0x10/0x20
      [    6.773870] ---[ end trace 5884eb76cd26d274 ]---
      [    6.777500] ------------[ cut here ]------------
      [    6.782043] [CRTC:93:crtc-0] must not have both a cursor plane and a cursor_move func
      [    6.782063] WARNING: CPU: 1 PID: 76 at drivers/gpu/drm/drm_mode_config.c:654 drm_mode_config_validate+0x290/0x4d0
      [    6.794362] Modules linked in:
      [    6.804600] CPU: 1 PID: 76 Comm: kworker/u8:2 Tainted: G        W         5.15.0-rc1-dirty #43
      [    6.807555] Hardware name: Qualcomm Technologies, Inc. DB820c (DT)
      [    6.816148] Workqueue: events_unbound deferred_probe_work_func
      [    6.822311] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
      [    6.828126] pc : drm_mode_config_validate+0x290/0x4d0
      [    6.834981] lr : drm_mode_config_validate+0x290/0x4d0
      [    6.840189] sp : ffff8000121b3980
      [    6.845223] x29: ffff8000121b3990 x28: 0000000000000000 x27: 0000000000000001
      [    6.848525] x26: ffff8000114cde50 x25: ffff8000114cdd40 x24: ffff0000987282d8
      [    6.855643] x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000000001
      [    6.862763] x20: ffff000098728000 x19: ffff000080a39000 x18: ffffffffffffffff
      [    6.869879] x17: 3136564e3631564e x16: 0000000000000324 x15: ffff800011c790c2
      [    6.876998] x14: 0000000000000000 x13: ffff800011a22850 x12: 0000000000000a2f
      [    6.884116] x11: 0000000000000365 x10: ffff800011a22850 x9 : ffff800011a22850
      [    6.891234] x8 : 00000000ffffefff x7 : ffff800011a7a850 x6 : ffff800011a7a850
      [    6.898351] x5 : 000000000000bff4 x4 : 40000000fffff365 x3 : 0000000000000000
      [    6.905470] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff00008093b800
      [    6.912590] Call trace:
      [    6.919702]  drm_mode_config_validate+0x290/0x4d0
      [    6.921960]  drm_dev_register+0x17c/0x210
      [    6.926821]  msm_drm_bind+0x4b4/0x694
      [    6.930813]  try_to_bring_up_master+0x164/0x1d0
      [    6.934459]  __component_add+0xa0/0x170
      [    6.938799]  component_add+0x14/0x20
      [    6.942619]  msm_hdmi_dev_probe+0x1c/0x2c
      [    6.946438]  platform_probe+0x68/0xe0
      [    6.950345]  really_probe.part.0+0x9c/0x30c
      [    6.953991]  __driver_probe_device+0x98/0x144
      [    6.957984]  driver_probe_device+0xc8/0x15c
      [    6.962498]  __device_attach_driver+0xb4/0x120
      [    6.966492]  bus_for_each_drv+0x78/0xd0
      [    6.971004]  __device_attach+0xdc/0x184
      [    6.974737]  device_initial_probe+0x14/0x20
      [    6.978556]  bus_probe_device+0x9c/0xa4
      [    6.982722]  deferred_probe_work_func+0x88/0xc0
      [    6.986543]  process_one_work+0x1d0/0x370
      [    6.991057]  worker_thread+0x2c8/0x470
      [    6.995223]  kthread+0x15c/0x170
      [    6.998869]  ret_from_fork+0x10/0x20
      [    7.002255] ---[ end trace 5884eb76cd26d275 ]---
      
      Fixes: aa649e87
      
       ("drm/msm/mdp5: mdp5_crtc: Restore cursor state only if LM cursors are enabled")
      Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Link: https://lore.kernel.org/r/20210925192824.3416259-1-dmitry.baryshkov@linaro.org
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      abd11864
    • Colin Ian King's avatar
      drm/msm: Fix null pointer dereference on pointer edp · 91a34076
      Colin Ian King authored
      commit 2133c4fc upstream.
      
      The initialization of pointer dev dereferences pointer edp before
      edp is null checked, so there is a potential null pointer deference
      issue. Fix this by only dereferencing edp after edp has been null
      checked.
      
      Addresses-Coverity: ("Dereference before null check")
      Fixes: ab5b0107
      
       ("drm/msm: Initial add eDP support in msm drm driver (v5)")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Link: https://lore.kernel.org/r/20210929121857.213922-1-colin.king@canonical.com
      Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      91a34076
    • Douglas Anderson's avatar
      drm/edid: In connector_bad_edid() cap num_of_ext by num_blocks read · a7b45024
      Douglas Anderson authored
      commit 97794170 upstream.
      
      In commit e11f5bd8 ("drm: Add support for DP 1.4 Compliance edid
      corruption test") the function connector_bad_edid() started assuming
      that the memory for the EDID passed to it was big enough to hold
      `edid[0x7e] + 1` blocks of data (1 extra for the base block). It
      completely ignored the fact that the function was passed `num_blocks`
      which indicated how much memory had been allocated for the EDID.
      
      Let's fix this by adding a bounds check.
      
      This is important for handling the case where there's an error in the
      first block of the EDID. In that case we will call
      connector_bad_edid() without having re-allocated memory based on
      `edid[0x7e]`.
      
      Fixes: e11f5bd8
      
       ("drm: Add support for DP 1.4 Compliance edid corruption test")
      Reported-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211005192905.v2.1.Ib059f9c23c2611cb5a9d760e7d0a700c1295928d@changeid
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a7b45024
    • Vegard Nossum's avatar
      drm/panel: olimex-lcd-olinuxino: select CRC32 · d0f0e171
      Vegard Nossum authored
      commit a14bc107 upstream.
      
      Fix the following build/link error by adding a dependency on the CRC32
      routines:
      
        ld: drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.o: in function `lcd_olinuxino_probe':
        panel-olimex-lcd-olinuxino.c:(.text+0x303): undefined reference to `crc32_le'
      
      Fixes: 17fd7a9d
      
       ("drm/panel: Add support for Olimex LCD-OLinuXino panel")
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20211012115242.10325-1-vegard.nossum@oracle.com
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0f0e171
    • Kamal Dasu's avatar
      spi: bcm-qspi: clear MSPI spifie interrupt during probe · a4a37e65
      Kamal Dasu authored
      commit 75b3cb97 upstream.
      
      Intermittent Kernel crash has been observed on probe in
      bcm_qspi_mspi_l2_isr() handler when the MSPI spifie interrupt bit
      has not been cleared before registering for interrupts.
      Fix the driver to move SoC specific custom interrupt handling code
      before we register IRQ in probe. Also clear MSPI interrupt status
      resgiter prior to registering IRQ handlers.
      
      Fixes: cc20a386
      
       ("spi: iproc-qspi: Add Broadcom iProc SoCs support")
      Signed-off-by: default avatarKamal Dasu <kdasu@broadcom.com>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20211008203603.40915-3-kdasu.kdev@gmail.com
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a4a37e65
    • Vadim Pasternak's avatar
      platform/mellanox: mlxreg-io: Fix read access of n-bytes size attributes · d9428f08
      Vadim Pasternak authored
      commit db9cc7d6 upstream.
      
      Fix shift argument for function rol32(). It should be provided in bits,
      while was provided in bytes.
      
      Fixes: 86148190
      
       ("platform/mellanox: mlxreg-io: Add support for complex attributes")
      Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Link: https://lore.kernel.org/r/20210927142214.2613929-3-vadimp@nvidia.com
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d9428f08
    • Vadim Pasternak's avatar
      platform/mellanox: mlxreg-io: Fix argument base in kstrtou32() call · c216cebd
      Vadim Pasternak authored
      commit 9b024201 upstream.
      
      Change kstrtou32() argument 'base' to be zero instead of 'len'.
      It works by chance for setting one bit value, but it is not supposed to
      work in case value passed to mlxreg_io_attr_store() is greater than 1.
      
      It works for example, for:
      echo 1 > /sys/devices/platform/mlxplat/mlxreg-io/hwmon/.../jtag_enable
      But it will fail for:
      echo n > /sys/devices/platform/mlxplat/mlxreg-io/hwmon/.../jtag_enable,
      where n > 1.
      
      The flow for input buffer conversion is as below:
      _kstrtoull(const char *s, unsigned int base, unsigned long long *res)
      calls:
      rv = _parse_integer(s, base, &_res);
      
      For the second case, where n > 1:
      - _parse_integer() converts 's' to 'val'.
        For n=2, 'len' is set to 2 (string buffer is 0x32 0x0a), for n=3
        'len' is set to 3 (string buffer 0x33 0x0a), etcetera.
      - 'base' is equal or greater then '2' (length of input buffer).
      
      As a result, _parse_integer() exits with result zero (rv):
      	rv = 0;
      	while (1) {
      		...
      		if (val >= base)-> (2 >= 2)
      			break;
      		...
      		rv++;
      		...
      	}
      
      And _kstrtoull() in their turn will fail:
      	if (rv == 0)
      		return -EINVAL;
      
      Fixes: 5ec4a8ac
      
       ("platform/mellanox: Introduce support for Mellanox register access driver")
      Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Link: https://lore.kernel.org/r/20210927142214.2613929-2-vadimp@nvidia.com
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c216cebd
    • Ido Schimmel's avatar
      mlxsw: thermal: Fix out-of-bounds memory accesses · e59d8397
      Ido Schimmel authored
      commit 332fdf95 upstream.
      
      Currently, mlxsw allows cooling states to be set above the maximum
      cooling state supported by the driver:
      
       # cat /sys/class/thermal/thermal_zone2/cdev0/type
       mlxsw_fan
       # cat /sys/class/thermal/thermal_zone2/cdev0/max_state
       10
       # echo 18 > /sys/class/thermal/thermal_zone2/cdev0/cur_state
       # echo $?
       0
      
      This results in out-of-bounds memory accesses when thermal state
      transition statistics are enabled (CONFIG_THERMAL_STATISTICS=y), as the
      transition table is accessed with a too large index (state) [1].
      
      According to the thermal maintainer, it is the responsibility of the
      driver to reject such operations [2].
      
      Therefore, return an error when the state to be set exceeds the maximum
      cooling state supported by the driver.
      
      To avoid dead code, as suggested by the thermal maintainer [3],
      partially revert commit a421ce08 ("mlxsw: core: Extend cooling
      device with cooling levels") that tried to interpret these invalid
      cooling states (above the maximum) in a special way. The cooling levels
      array is not removed in order to prevent the fans going below 20% PWM,
      which would cause them to get stuck at 0% PWM.
      
      [1]
      BUG: KASAN: slab-out-of-bounds in thermal_cooling_device_stats_update+0x271/0x290
      Read of size 4 at addr ffff8881052f7bf8 by task kworker/0:0/5
      
      CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.15.0-rc3-custom-45935-gce1adf704b14 #122
      Hardware name: Mellanox Technologies Ltd. "MSN2410-CB2FO"/"SA000874", BIOS 4.6.5 03/08/2016
      Workqueue: events_freezable_power_ thermal_zone_device_check
      Call Trace:
       dump_stack_lvl+0x8b/0xb3
       print_address_description.constprop.0+0x1f/0x140
       kasan_report.cold+0x7f/0x11b
       thermal_cooling_device_stats_update+0x271/0x290
       __thermal_cdev_update+0x15e/0x4e0
       thermal_cdev_update+0x9f/0xe0
       step_wise_throttle+0x770/0xee0
       thermal_zone_device_update+0x3f6/0xdf0
       process_one_work+0xa42/0x1770
       worker_thread+0x62f/0x13e0
       kthread+0x3ee/0x4e0
       ret_from_fork+0x1f/0x30
      
      Allocated by task 1:
       kasan_save_stack+0x1b/0x40
       __kasan_kmalloc+0x7c/0x90
       thermal_cooling_device_setup_sysfs+0x153/0x2c0
       __thermal_cooling_device_register.part.0+0x25b/0x9c0
       thermal_cooling_device_register+0xb3/0x100
       mlxsw_thermal_init+0x5c5/0x7e0
       __mlxsw_core_bus_device_register+0xcb3/0x19c0
       mlxsw_core_bus_device_register+0x56/0xb0
       mlxsw_pci_probe+0x54f/0x710
       local_pci_probe+0xc6/0x170
       pci_device_probe+0x2b2/0x4d0
       really_probe+0x293/0xd10
       __driver_probe_device+0x2af/0x440
       driver_probe_device+0x51/0x1e0
       __driver_attach+0x21b/0x530
       bus_for_each_dev+0x14c/0x1d0
       bus_add_driver+0x3ac/0x650
       driver_register+0x241/0x3d0
       mlxsw_sp_module_init+0xa2/0x174
       do_one_initcall+0xee/0x5f0
       kernel_init_freeable+0x45a/0x4de
       kernel_init+0x1f/0x210
       ret_from_fork+0x1f/0x30
      
      The buggy address belongs to the object at ffff8881052f7800
       which belongs to the cache kmalloc-1k of size 1024
      The buggy address is located 1016 bytes inside of
       1024-byte region [ffff8881052f7800, ffff8881052f7c00)
      The buggy address belongs to the page:
      page:0000000052355272 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1052f0
      head:0000000052355272 order:3 compound_mapcount:0 compound_pincount:0
      flags: 0x200000000010200(slab|head|node=0|zone=2)
      raw: 0200000000010200 ffffea0005034800 0000000300000003 ffff888100041dc0
      raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff8881052f7a80: 00 00 00 00 00 00 04 fc fc fc fc fc fc fc fc fc
       ffff8881052f7b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      >ffff8881052f7b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                                      ^
       ffff8881052f7c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
       ffff8881052f7c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      
      [2] https://lore.kernel.org/linux-pm/9aca37cb-1629-5c67-1895-1fdc45c0244e@linaro.org/
      [3] https://lore.kernel.org/linux-pm/af9857f2-578e-de3a-e62b-6baff7e69fd4@linaro.org/
      
      CC: Daniel Lezcano <daniel.lezcano@linaro.org>
      Fixes: a50c1e35 ("mlxsw: core: Implement thermal zone")
      Fixes: a421ce08
      
       ("mlxsw: core: Extend cooling device with cooling levels")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Tested-by: default avatarVadim Pasternak <vadimp@nvidia.com>
      Link: https://lore.kernel.org/r/20211012174955.472928-1-idosch@idosch.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e59d8397
    • Wang Hai's avatar
      ata: ahci_platform: fix null-ptr-deref in ahci_platform_enable_regulators() · 7eef482d
      Wang Hai authored
      commit 776c7501 upstream.
      
      I got a null-ptr-deref report:
      
      KASAN: null-ptr-deref in range [0x0000000000000090-0x0000000000000097]
      ...
      RIP: 0010:regulator_enable+0x84/0x260
      ...
      Call Trace:
       ahci_platform_enable_regulators+0xae/0x320
       ahci_platform_enable_resources+0x1a/0x120
       ahci_probe+0x4f/0x1b9
       platform_probe+0x10b/0x280
      ...
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      If devm_regulator_get() in ahci_platform_get_resources() fails,
      hpriv->phy_regulator will point to NULL, when enabling or disabling it,
      null-ptr-deref will occur.
      
      ahci_probe()
      	ahci_platform_get_resources()
      		devm_regulator_get(, "phy") // failed, let phy_regulator = NULL
      	ahci_platform_enable_resources()
      		ahci_platform_enable_regulators()
      			regulator_enable(hpriv->phy_regulator) // null-ptr-deref
      
      commit 962399bb ("ata: libahci_platform: Fix regulator_get_optional()
      misuse") replaces devm_regulator_get_optional() with devm_regulator_get(),
      but PHY regulator omits to delete "hpriv->phy_regulator = NULL;" like AHCI.
      Delete it like AHCI regulator to fix this bug.
      
      Fixes: commit 962399bb
      
       ("ata: libahci_platform: Fix regulator_get_optional() misuse")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7eef482d
    • Dan Carpenter's avatar
      pata_legacy: fix a couple uninitialized variable bugs · 116932c0
      Dan Carpenter authored
      commit 01392347 upstream.
      
      The last byte of "pad" is used without being initialized.
      
      Fixes: 55dba312
      
       ("libata: update ->data_xfer hook for ATAPI")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      116932c0
    • Ziyang Xuan's avatar
      NFC: digital: fix possible memory leak in digital_in_send_sdd_req() · 50cb9548
      Ziyang Xuan authored
      commit 291c932f upstream.
      
      'skb' is allocated in digital_in_send_sdd_req(), but not free when
      digital_in_send_cmd() failed, which will cause memory leak. Fix it
      by freeing 'skb' if digital_in_send_cmd() return failed.
      
      Fixes: 2c66daec
      
       ("NFC Digital: Add NFC-A technology support")
      Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      50cb9548
    • Ziyang Xuan's avatar
      NFC: digital: fix possible memory leak in digital_tg_listen_mdaa() · 3f2960b3
      Ziyang Xuan authored
      commit 58e7dcc9 upstream.
      
      'params' is allocated in digital_tg_listen_mdaa(), but not free when
      digital_send_cmd() failed, which will cause memory leak. Fix it by
      freeing 'params' if digital_send_cmd() return failed.
      
      Fixes: 1c7a4c24
      
       ("NFC Digital: Add target NFC-DEP support")
      Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3f2960b3
    • Ziyang Xuan's avatar
      nfc: fix error handling of nfc_proto_register() · 2f21f06a
      Ziyang Xuan authored
      commit 0911ab31 upstream.
      
      When nfc proto id is using, nfc_proto_register() return -EBUSY error
      code, but forgot to unregister proto. Fix it by adding proto_unregister()
      in the error handling case.
      
      Fixes: c7fe3b52
      
       ("NFC: add NFC socket family")
      Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
      Link: https://lore.kernel.org/r/20211013034932.2833737-1-william.xuanziyang@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2f21f06a
    • Cindy Lu's avatar
      vhost-vdpa: Fix the wrong input in config_cb · ba39f559
      Cindy Lu authored
      commit bcef9356 upstream.
      
      Fix the wrong input in for config_cb. In function vhost_vdpa_config_cb,
      the input cb.private was used as struct vhost_vdpa, so the input was
      wrong here, fix this issue
      
      Fixes: 776f3950
      
       ("vhost_vdpa: Support config interrupt in vdpa")
      Signed-off-by: default avatarCindy Lu <lulu@redhat.com>
      Link: https://lore.kernel.org/r/20210929090933.20465-1-lulu@redhat.com
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ba39f559
    • Arnd Bergmann's avatar
      ethernet: s2io: fix setting mac address during resume · 84e0f2fc
      Arnd Bergmann authored
      commit 40507e7a upstream.
      
      After recent cleanups, gcc started warning about a suspicious
      memcpy() call during the s2io_io_resume() function:
      
      In function '__dev_addr_set',
          inlined from 'eth_hw_addr_set' at include/linux/etherdevice.h:318:2,
          inlined from 's2io_set_mac_addr' at drivers/net/ethernet/neterion/s2io.c:5205:2,
          inlined from 's2io_io_resume' at drivers/net/ethernet/neterion/s2io.c:8569:7:
      arch/x86/include/asm/string_32.h:182:25: error: '__builtin_memcpy' accessing 6 bytes at offsets 0 and 2 overlaps 4 bytes at offset 2 [-Werror=restrict]
        182 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
            |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
      include/linux/netdevice.h:4648:9: note: in expansion of macro 'memcpy'
       4648 |         memcpy(dev->dev_addr, addr, len);
            |         ^~~~~~
      
      What apparently happened is that an old cleanup changed the calling
      conventions for s2io_set_mac_addr() from taking an ethernet address
      as a character array to taking a struct sockaddr, but one of the
      callers was not changed at the same time.
      
      Change it to instead call the low-level do_s2io_prog_unicast() function
      that still takes the old argument type.
      
      Fixes: 2fd37688
      
       ("S2io: Added support set_mac_address driver entry point")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20211013143613.2049096-1-arnd@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      84e0f2fc
    • Nanyong Sun's avatar
      net: encx24j600: check error in devm_regmap_init_encx24j600 · e19c10d6
      Nanyong Sun authored
      commit f03dca0c upstream.
      
      devm_regmap_init may return error which caused by like out of memory,
      this will results in null pointer dereference later when reading
      or writing register:
      
      general protection fault in encx24j600_spi_probe
      KASAN: null-ptr-deref in range [0x0000000000000090-0x0000000000000097]
      CPU: 0 PID: 286 Comm: spi-encx24j600- Not tainted 5.15.0-rc2-00142-g9978db750e31-dirty #11 9c53a778c1306b1b02359f3c2bbedc0222cba652
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014
      RIP: 0010:regcache_cache_bypass drivers/base/regmap/regcache.c:540
      Code: 54 41 89 f4 55 53 48 89 fb 48 83 ec 08 e8 26 94 a8 fe 48 8d bb a0 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 4a 03 00 00 4c 8d ab b0 00 00 00 48 8b ab a0 00
      RSP: 0018:ffffc900010476b8 EFLAGS: 00010207
      RAX: dffffc0000000000 RBX: fffffffffffffff4 RCX: 0000000000000000
      RDX: 0000000000000012 RSI: ffff888002de0000 RDI: 0000000000000094
      RBP: ffff888013c9a000 R08: 0000000000000000 R09: fffffbfff3f9cc6a
      R10: ffffc900010476e8 R11: fffffbfff3f9cc69 R12: 0000000000000001
      R13: 000000000000000a R14: ffff888013c9af54 R15: ffff888013c9ad08
      FS:  00007ffa984ab580(0000) GS:ffff88801fe00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000055a6384136c8 CR3: 000000003bbe6003 CR4: 0000000000770ef0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      PKRU: 55555554
      Call Trace:
       encx24j600_spi_probe drivers/net/ethernet/microchip/encx24j600.c:459
       spi_probe drivers/spi/spi.c:397
       really_probe drivers/base/dd.c:517
       __driver_probe_device drivers/base/dd.c:751
       driver_probe_device drivers/base/dd.c:782
       __device_attach_driver drivers/base/dd.c:899
       bus_for_each_drv drivers/base/bus.c:427
       __device_attach drivers/base/dd.c:971
       bus_probe_device drivers/base/bus.c:487
       device_add drivers/base/core.c:3364
       __spi_add_device drivers/spi/spi.c:599
       spi_add_device drivers/spi/spi.c:641
       spi_new_device drivers/spi/spi.c:717
       new_device_store+0x18c/0x1f1 [spi_stub 4e02719357f1ff33f5a43d00630982840568e85e]
       dev_attr_store drivers/base/core.c:2074
       sysfs_kf_write fs/sysfs/file.c:139
       kernfs_fop_write_iter fs/kernfs/file.c:300
       new_sync_write fs/read_write.c:508 (discriminator 4)
       vfs_write fs/read_write.c:594
       ksys_write fs/read_write.c:648
       do_syscall_64 arch/x86/entry/common.c:50
       entry_SYSCALL_64_after_hwframe arch/x86/entry/entry_64.S:113
      
      Add error check in devm_regmap_init_encx24j600 to avoid this situation.
      
      Fixes: 04fbfce7
      
       ("net: Microchip encx24j600 driver")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarNanyong Sun <sunnanyong@huawei.com>
      Link: https://lore.kernel.org/r/20211012125901.3623144-1-sunnanyong@huawei.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e19c10d6
    • Arun Ramadoss's avatar
      net: dsa: microchip: Added the condition for scheduling ksz_mib_read_work · f2e1de07
      Arun Ramadoss authored
      commit ef1100ef upstream.
      
      When the ksz module is installed and removed using rmmod, kernel crashes
      with null pointer dereferrence error. During rmmod, ksz_switch_remove
      function tries to cancel the mib_read_workqueue using
      cancel_delayed_work_sync routine and unregister switch from dsa.
      
      During dsa_unregister_switch it calls ksz_mac_link_down, which in turn
      reschedules the workqueue since mib_interval is non-zero.
      Due to which queue executed after mib_interval and it tries to access
      dp->slave. But the slave is unregistered in the ksz_switch_remove
      function. Hence kernel crashes.
      
      To avoid this crash, before canceling the workqueue, resetted the
      mib_interval to 0.
      
      v1 -> v2:
      -Removed the if condition in ksz_mib_read_work
      
      Fixes: 469b390e
      
       ("net: dsa: microchip: use delayed_work instead of timer + work")
      Signed-off-by: default avatarArun Ramadoss <arun.ramadoss@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f2e1de07
    • Herve Codina's avatar
      net: stmmac: fix get_hw_feature() on old hardware · 9053c5b4
      Herve Codina authored
      commit 075da584 upstream.
      
      Some old IPs do not provide the hardware feature register.
      On these IPs, this register is read 0x00000000.
      
      In old driver version, this feature was handled but a regression came
      with the commit f10a6a35 ("stmmac: rework get_hw_feature function").
      Indeed, this commit removes the return value in dma->get_hw_feature().
      This return value was used to indicate the validity of retrieved
      information and used later on in stmmac_hw_init() to override
      priv->plat data if this hardware feature were valid.
      
      This patch restores the return code in ->get_hw_feature() in order
      to indicate the hardware feature validity and override priv->plat
      data only if this hardware feature is valid.
      
      Fixes: f10a6a35
      
       ("stmmac: rework get_hw_feature function")
      Signed-off-by: default avatarHerve Codina <herve.codina@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9053c5b4
    • Aya Levin's avatar
      net/mlx5e: Mutually exclude RX-FCS and RX-port-timestamp · 12da46cb
      Aya Levin authored
      commit 0bc73ad4 upstream.
      
      Due to current HW arch limitations, RX-FCS (scattering FCS frame field
      to software) and RX-port-timestamp (improved timestamp accuracy on the
      receive side) can't work together.
      RX-port-timestamp is not controlled by the user and it is enabled by
      default when supported by the HW/FW.
      This patch sets RX-port-timestamp opposite to RX-FCS configuration.
      
      Fixes: 102722fc
      
       ("net/mlx5e: Add support for RXFCS feature flag")
      Signed-off-by: default avatarAya Levin <ayal@nvidia.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      12da46cb