1. 14 Jul, 2022 1 commit
  2. 12 Jul, 2022 1 commit
  3. 08 Jul, 2022 1 commit
    • Greg Kroah-Hartman's avatar
      Merge tag 'arch-cache-topo-5.20' of... · 2c8f7ef4
      Greg Kroah-Hartman authored
      Merge tag 'arch-cache-topo-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into driver-core-next
      
      Sudeep writes:
      
      cacheinfo and arch_topology updates for v5.20
      
      These are updates to fix some discrepancies we have in the CPU topology
      parsing from the device tree /cpu-map node and the divergence from the
      behaviour on a ACPI enabled platform. The expectation is that both DT
      and ACPI enabled systems must present consistent view of the CPU topology.
      
      The current assignment of generated cluster count as the physical package
      identifier for each CPU is wrong. The device tree bindings for CPU
      topology supports sockets to infer the socket or physical package
      identifier for a given CPU. It is now being made use of you address the
      issue. These updates also assigns the cluster identifier as parsed from
      the device tree cluster nodes within /cpu-map without support for
      nesting of the clusters as there are no such reported/known platforms.
      
      In order to be on par with ACPI PPTT physical package/socket support,
      these updates also include support for socket nodes in /cpu-map.
      
      The only exception is that the last level cache id information can be
      inferred from the same ACPI PPTT while we need to parse CPU cache nodes
      in the device tree. The cacheinfo changes here is to enable the re-use
      of the cacheinfo to detect the cache attributes for all the CPU quite
      early even before the scondardaries are booted so that the information
      can be used to build the schedular domains especially the last level
      cache(LLC).
      
      * tag 'arch-cache-topo-5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (21 commits)
        ACPI: Remove the unused find_acpi_cpu_cache_topology()
        arch_topology: Warn that topology for nested clusters is not supported
        arch_topology: Add support for parsing sockets in /cpu-map
        arch_topology: Set cluster identifier in each core/thread from /cpu-map
        arch_topology: Limit span of cpu_clustergroup_mask()
        arch_topology: Don't set cluster identifier as physical package identifier
        arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found
        arch_topology: Check for non-negative value rather than -1 for IDs validity
        arch_topology: Set thread sibling cpumask only within the cluster
        arch_topology: Drop LLC identifier stash from the CPU topology
        arm64: topology: Remove redundant setting of llc_id in CPU topology
        arch_topology: Use the last level cache information from the cacheinfo
        arch_topology: Add support to parse and detect cache attributes
        cacheinfo: Align checks in cache_shared_cpu_map_{setup,remove} for readability
        cacheinfo: Use cache identifiers to check if the caches are shared if available
        cacheinfo: Allow early detection and population of cache attributes
        cacheinfo: Add support to check if last level cache(LLC) is valid or shared
        cacheinfo: Move cache_leaves_are_shared out of CONFIG_OF
        cacheinfo: Add helper to access any cache index for a given CPU
        cacheinfo: Use of_cpu_device_node_get instead cpu_dev->of_node
        ...
      2c8f7ef4
  4. 06 Jul, 2022 1 commit
  5. 04 Jul, 2022 21 commits
  6. 01 Jul, 2022 2 commits
  7. 27 Jun, 2022 12 commits
  8. 21 Jun, 2022 1 commit
    • Duoming Zhou's avatar
      mwifiex: fix sleep in atomic context bugs caused by dev_coredumpv · a52ed486
      Duoming Zhou authored
      There are sleep in atomic context bugs when uploading device dump
      data in mwifiex. The root cause is that dev_coredumpv could not
      be used in atomic contexts, because it calls dev_set_name which
      include operations that may sleep. The call tree shows execution
      paths that could lead to bugs:
      
         (Interrupt context)
      fw_dump_timer_fn
        mwifiex_upload_device_dump
          dev_coredumpv(..., GFP_KERNEL)
            dev_coredumpm()
              kzalloc(sizeof(*devcd), gfp); //may sleep
              dev_set_name
                kobject_set_name_vargs
                  kvasprintf_const(GFP_KERNEL, ...); //may sleep
                  kstrdup(s, GFP_KERNEL); //may sleep
      
      The corresponding fail log is shown below:
      
      [  135.275938] usb 1-1: == mwifiex dump information to /sys/class/devcoredump start
      [  135.281029] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265
      ...
      [  135.293613] Call Trace:
      [  135.293613]  <IRQ>
      [  135.293613]  dump_stack_lvl+0x57/0x7d
      [  135.293613]  __might_resched.cold+0x138/0x173
      [  135.293613]  ? dev_coredumpm+0xca/0x2e0
      [  135.293613]  kmem_cache_alloc_trace+0x189/0x1f0
      [  135.293613]  ? devcd_match_failing+0x30/0x30
      [  135.293613]  dev_coredumpm+0xca/0x2e0
      [  135.293613]  ? devcd_freev+0x10/0x10
      [  135.293613]  dev_coredumpv+0x1c/0x20
      [  135.293613]  ? devcd_match_failing+0x30/0x30
      [  135.293613]  mwifiex_upload_device_dump+0x65/0xb0
      [  135.293613]  ? mwifiex_dnld_fw+0x1b0/0x1b0
      [  135.293613]  call_timer_fn+0x122/0x3d0
      [  135.293613]  ? msleep_interruptible+0xb0/0xb0
      [  135.293613]  ? lock_downgrade+0x3c0/0x3c0
      [  135.293613]  ? __next_timer_interrupt+0x13c/0x160
      [  135.293613]  ? lockdep_hardirqs_on_prepare+0xe/0x220
      [  135.293613]  ? mwifiex_dnld_fw+0x1b0/0x1b0
      [  135.293613]  __run_timers.part.0+0x3f8/0x540
      [  135.293613]  ? call_timer_fn+0x3d0/0x3d0
      [  135.293613]  ? arch_restore_msi_irqs+0x10/0x10
      [  135.293613]  ? lapic_next_event+0x31/0x40
      [  135.293613]  run_timer_softirq+0x4f/0xb0
      [  135.293613]  __do_softirq+0x1c2/0x651
      ...
      [  135.293613] RIP: 0010:default_idle+0xb/0x10
      [  135.293613] RSP: 0018:ffff888006317e68 EFLAGS: 00000246
      [  135.293613] RAX: ffffffff82ad8d10 RBX: ffff888006301cc0 RCX: ffffffff82ac90e1
      [  135.293613] RDX: ffffed100d9ff1b4 RSI: ffffffff831ad140 RDI: ffffffff82ad8f20
      [  135.293613] RBP: 0000000000000003 R08: 0000000000000000 R09: ffff88806cff8d9b
      [  135.293613] R10: ffffed100d9ff1b3 R11: 0000000000000001 R12: ffffffff84593410
      [  135.293613] R13: 0000000000000000 R14: 0000000000000000 R15: 1ffff11000c62fd2
      ...
      [  135.389205] usb 1-1: == mwifiex dump information to /sys/class/devcoredump end
      
      This patch uses delayed work to replace timer and moves the operations
      that may sleep into a delayed work in order to mitigate bugs, it was
      tested on Marvell 88W8801 chip whose port is usb and the firmware is
      usb8801_uapsta.bin. The following is the result after using delayed
      work to replace timer.
      
      [  134.936453] usb 1-1: == mwifiex dump information to /sys/class/devcoredump start
      [  135.043344] usb 1-1: == mwifiex dump information to /sys/class/devcoredump end
      
      As we can see, there is no bug now.
      
      Fixes: f5ecd02a ("mwifiex: device dump support for usb interface")
      Reviewed-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarDuoming Zhou <duoming@zju.edu.cn>
      Link: https://lore.kernel.org/r/b63b77fc84ed3e8a6bef02378e17c7c71a0bc3be.1654569290.git.duoming@zju.edu.cnSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a52ed486