1. 29 4月, 2022 18 次提交
  2. 28 4月, 2022 22 次提交
    • R
      Merge branch 'thermal-int340x' · a12475f9
      Rafael J. Wysocki 提交于
      Merge a fix for the attr.show callback prototype in the int340x thermal
      driver (Kees Cook).
      
      * thermal-int340x:
        thermal: int340x: Fix attr.show callback prototype
      a12475f9
    • F
      netfilter: nft_socket: only do sk lookups when indev is available · 743b83f1
      Florian Westphal 提交于
      Check if the incoming interface is available and NFT_BREAK
      in case neither skb->sk nor input device are set.
      
      Because nf_sk_lookup_slow*() assume packet headers are in the
      'in' direction, use in postrouting is not going to yield a meaningful
      result.  Same is true for the forward chain, so restrict the use
      to prerouting, input and output.
      
      Use in output work if a socket is already attached to the skb.
      
      Fixes: 554ced0a ("netfilter: nf_tables: add support for native socket matching")
      Reported-and-tested-by: NTopi Miettinen <toiwoton@gmail.com>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      743b83f1
    • R
      Merge branch 'pm-cpuidle' · edbd9772
      Rafael J. Wysocki 提交于
      Merge cpuidle fixes for 5.18-rc5:
      
       - Make intel_idle enable C1E promotion on all CPUs when C1E is
         preferred to C1 (Artem Bityutskiy).
      
       - Make C6 optimization on Sapphire Rapids added recently work as
         expected if both C1E and C1 are "preferred" (Artem Bityutskiy).
      
      * pm-cpuidle:
        intel_idle: Fix SPR C6 optimization
        intel_idle: Fix the 'preferred_cstates' module parameter
      edbd9772
    • A
      gfs2: No short reads or writes upon glock contention · 296abc0d
      Andreas Gruenbacher 提交于
      Commit 00bfe02f ("gfs2: Fix mmap + page fault deadlocks for buffered
      I/O") changed gfs2_file_read_iter() and gfs2_file_buffered_write() to
      allow dropping the inode glock while faulting in user buffers.  When the
      lock was dropped, a short result was returned to indicate that the
      operation was interrupted.
      
      As pointed out by Linus (see the link below), this behavior is broken
      and the operations should always re-acquire the inode glock and resume
      the operation instead.
      
      Link: https://lore.kernel.org/lkml/CAHk-=whaz-g_nOOoo8RRiWNjnv2R+h6_xk2F1J4TuSRxk1MtLw@mail.gmail.com/
      Fixes: 00bfe02f ("gfs2: Fix mmap + page fault deadlocks for buffered I/O")
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      296abc0d
    • P
      Merge tag 'for-net-2022-04-27' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth · febb2d2f
      Paolo Abeni 提交于
      Luiz Augusto von Dentz says:
      
      ====================
      bluetooth pull request for net:
      
       - Fix regression causing some HCI events to be discarded when they
         shouldn't.
      
      * tag 'for-net-2022-04-27' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth:
        Bluetooth: hci_sync: Cleanup hci_conn if it cannot be aborted
        Bluetooth: hci_event: Fix creating hci_conn object on error status
        Bluetooth: hci_event: Fix checking for invalid handle on error status
      ====================
      
      Link: https://lore.kernel.org/r/20220427234031.1257281-1-luiz.dentz@gmail.comSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
      febb2d2f
    • Y
      net: fec: add missing of_node_put() in fec_enet_init_stop_mode() · d2b52ec0
      Yang Yingliang 提交于
      Put device node in error path in fec_enet_init_stop_mode().
      
      Fixes: 8a448bf8 ("net: ethernet: fec: move GPR register offset and bit into DT")
      Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
      Link: https://lore.kernel.org/r/20220426125231.375688-1-yangyingliang@huawei.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      d2b52ec0
    • M
      bnx2x: fix napi API usage sequence · af68656d
      Manish Chopra 提交于
      While handling PCI errors (AER flow) driver tries to
      disable NAPI [napi_disable()] after NAPI is deleted
      [__netif_napi_del()] which causes unexpected system
      hang/crash.
      
      System message log shows the following:
      =======================================
      [ 3222.537510] EEH: Detected PCI bus error on PHB#384-PE#800000 [ 3222.537511] EEH: This PCI device has failed 2 times in the last hour and will be permanently disabled after 5 failures.
      [ 3222.537512] EEH: Notify device drivers to shutdown [ 3222.537513] EEH: Beginning: 'error_detected(IO frozen)'
      [ 3222.537514] EEH: PE#800000 (PCI 0384:80:00.0): Invoking
      bnx2x->error_detected(IO frozen)
      [ 3222.537516] bnx2x: [bnx2x_io_error_detected:14236(eth14)]IO error detected [ 3222.537650] EEH: PE#800000 (PCI 0384:80:00.0): bnx2x driver reports:
      'need reset'
      [ 3222.537651] EEH: PE#800000 (PCI 0384:80:00.1): Invoking
      bnx2x->error_detected(IO frozen)
      [ 3222.537651] bnx2x: [bnx2x_io_error_detected:14236(eth13)]IO error detected [ 3222.537729] EEH: PE#800000 (PCI 0384:80:00.1): bnx2x driver reports:
      'need reset'
      [ 3222.537729] EEH: Finished:'error_detected(IO frozen)' with aggregate recovery state:'need reset'
      [ 3222.537890] EEH: Collect temporary log [ 3222.583481] EEH: of node=0384:80:00.0 [ 3222.583519] EEH: PCI device/vendor: 168e14e4 [ 3222.583557] EEH: PCI cmd/status register: 00100140 [ 3222.583557] EEH: PCI-E capabilities and status follow:
      [ 3222.583744] EEH: PCI-E 00: 00020010 012c8da2 00095d5e 00455c82 [ 3222.583892] EEH: PCI-E 10: 10820000 00000000 00000000 00000000 [ 3222.583893] EEH: PCI-E 20: 00000000 [ 3222.583893] EEH: PCI-E AER capability register set follows:
      [ 3222.584079] EEH: PCI-E AER 00: 13c10001 00000000 00000000 00062030 [ 3222.584230] EEH: PCI-E AER 10: 00002000 000031c0 000001e0 00000000 [ 3222.584378] EEH: PCI-E AER 20: 00000000 00000000 00000000 00000000 [ 3222.584416] EEH: PCI-E AER 30: 00000000 00000000 [ 3222.584416] EEH: of node=0384:80:00.1 [ 3222.584454] EEH: PCI device/vendor: 168e14e4 [ 3222.584491] EEH: PCI cmd/status register: 00100140 [ 3222.584492] EEH: PCI-E capabilities and status follow:
      [ 3222.584677] EEH: PCI-E 00: 00020010 012c8da2 00095d5e 00455c82 [ 3222.584825] EEH: PCI-E 10: 10820000 00000000 00000000 00000000 [ 3222.584826] EEH: PCI-E 20: 00000000 [ 3222.584826] EEH: PCI-E AER capability register set follows:
      [ 3222.585011] EEH: PCI-E AER 00: 13c10001 00000000 00000000 00062030 [ 3222.585160] EEH: PCI-E AER 10: 00002000 000031c0 000001e0 00000000 [ 3222.585309] EEH: PCI-E AER 20: 00000000 00000000 00000000 00000000 [ 3222.585347] EEH: PCI-E AER 30: 00000000 00000000 [ 3222.586872] RTAS: event: 5, Type: Platform Error (224), Severity: 2 [ 3222.586873] EEH: Reset without hotplug activity [ 3224.762767] EEH: Beginning: 'slot_reset'
      [ 3224.762770] EEH: PE#800000 (PCI 0384:80:00.0): Invoking
      bnx2x->slot_reset()
      [ 3224.762771] bnx2x: [bnx2x_io_slot_reset:14271(eth14)]IO slot reset initializing...
      [ 3224.762887] bnx2x 0384:80:00.0: enabling device (0140 -> 0142) [ 3224.768157] bnx2x: [bnx2x_io_slot_reset:14287(eth14)]IO slot reset
      --> driver unload
      
      Uninterruptible tasks
      =====================
      crash> ps | grep UN
           213      2  11  c000000004c89e00  UN   0.0       0      0  [eehd]
           215      2   0  c000000004c80000  UN   0.0       0      0
      [kworker/0:2]
          2196      1  28  c000000004504f00  UN   0.1   15936  11136  wickedd
          4287      1   9  c00000020d076800  UN   0.0    4032   3008  agetty
          4289      1  20  c00000020d056680  UN   0.0    7232   3840  agetty
         32423      2  26  c00000020038c580  UN   0.0       0      0
      [kworker/26:3]
         32871   4241  27  c0000002609ddd00  UN   0.1   18624  11648  sshd
         32920  10130  16  c00000027284a100  UN   0.1   48512  12608  sendmail
         33092  32987   0  c000000205218b00  UN   0.1   48512  12608  sendmail
         33154   4567  16  c000000260e51780  UN   0.1   48832  12864  pickup
         33209   4241  36  c000000270cb6500  UN   0.1   18624  11712  sshd
         33473  33283   0  c000000205211480  UN   0.1   48512  12672  sendmail
         33531   4241  37  c00000023c902780  UN   0.1   18624  11648  sshd
      
      EEH handler hung while bnx2x sleeping and holding RTNL lock
      ===========================================================
      crash> bt 213
      PID: 213    TASK: c000000004c89e00  CPU: 11  COMMAND: "eehd"
        #0 [c000000004d477e0] __schedule at c000000000c70808
        #1 [c000000004d478b0] schedule at c000000000c70ee0
        #2 [c000000004d478e0] schedule_timeout at c000000000c76dec
        #3 [c000000004d479c0] msleep at c0000000002120cc
        #4 [c000000004d479f0] napi_disable at c000000000a06448
                                              ^^^^^^^^^^^^^^^^
        #5 [c000000004d47a30] bnx2x_netif_stop at c0080000018dba94 [bnx2x]
        #6 [c000000004d47a60] bnx2x_io_slot_reset at c0080000018a551c [bnx2x]
        #7 [c000000004d47b20] eeh_report_reset at c00000000004c9bc
        #8 [c000000004d47b90] eeh_pe_report at c00000000004d1a8
        #9 [c000000004d47c40] eeh_handle_normal_event at c00000000004da64
      
      And the sleeping source code
      ============================
      crash> dis -ls c000000000a06448
      FILE: ../net/core/dev.c
      LINE: 6702
      
         6697  {
         6698          might_sleep();
         6699          set_bit(NAPI_STATE_DISABLE, &n->state);
         6700
         6701          while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
      * 6702                  msleep(1);
         6703          while (test_and_set_bit(NAPI_STATE_NPSVC, &n->state))
         6704                  msleep(1);
         6705
         6706          hrtimer_cancel(&n->timer);
         6707
         6708          clear_bit(NAPI_STATE_DISABLE, &n->state);
         6709  }
      
      EEH calls into bnx2x twice based on the system log above, first through
      bnx2x_io_error_detected() and then bnx2x_io_slot_reset(), and executes
      the following call chains:
      
      bnx2x_io_error_detected()
        +-> bnx2x_eeh_nic_unload()
             +-> bnx2x_del_all_napi()
                  +-> __netif_napi_del()
      
      bnx2x_io_slot_reset()
        +-> bnx2x_netif_stop()
             +-> bnx2x_napi_disable()
                  +->napi_disable()
      
      Fix this by correcting the sequence of NAPI APIs usage,
      that is delete the NAPI after disabling it.
      
      Fixes: 7fa6f340 ("bnx2x: AER revised")
      Reported-by: NDavid Christensen <drc@linux.vnet.ibm.com>
      Tested-by: NDavid Christensen <drc@linux.vnet.ibm.com>
      Signed-off-by: NManish Chopra <manishc@marvell.com>
      Signed-off-by: NAriel Elior <aelior@marvell.com>
      Link: https://lore.kernel.org/r/20220426153913.6966-1-manishc@marvell.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      af68656d
    • M
      tls: Skip tls_append_frag on zero copy size · a0df7194
      Maxim Mikityanskiy 提交于
      Calling tls_append_frag when max_open_record_len == record->len might
      add an empty fragment to the TLS record if the call happens to be on the
      page boundary. Normally tls_append_frag coalesces the zero-sized
      fragment to the previous one, but not if it's on page boundary.
      
      If a resync happens then, the mlx5 driver posts dump WQEs in
      tx_post_resync_dump, and the empty fragment may become a data segment
      with byte_count == 0, which will confuse the NIC and lead to a CQE
      error.
      
      This commit fixes the described issue by skipping tls_append_frag on
      zero size to avoid adding empty fragments. The fix is not in the driver,
      because an empty fragment is hardly the desired behavior.
      
      Fixes: e8f69799 ("net/tls: Add generic NIC offload infrastructure")
      Signed-off-by: NMaxim Mikityanskiy <maximmi@nvidia.com>
      Reviewed-by: NTariq Toukan <tariqt@nvidia.com>
      Link: https://lore.kernel.org/r/20220426154949.159055-1-maximmi@nvidia.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      a0df7194
    • J
      Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · 347cb5de
      Jakub Kicinski 提交于
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2022-04-27
      
      We've added 5 non-merge commits during the last 20 day(s) which contain
      a total of 6 files changed, 34 insertions(+), 12 deletions(-).
      
      The main changes are:
      
      1) Fix xsk sockets when rx and tx are separately bound to the same umem, also
         fix xsk copy mode combined with busy poll, from Maciej Fijalkowski.
      
      2) Fix BPF tunnel/collect_md helpers with bpf_xmit lwt hook usage which triggered
         a crash due to invalid metadata_dst access, from Eyal Birger.
      
      3) Fix release of page pool in XDP live packet mode, from Toke Høiland-Jørgensen.
      
      4) Fix potential NULL pointer dereference in kretprobes, from Adam Zabrocki.
      
         (Masami & Steven preferred this small fix to be routed via bpf tree given it's
          follow-up fix to Masami's rethook work that went via bpf earlier, too.)
      
      * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        xsk: Fix possible crash when multiple sockets are created
        kprobes: Fix KRETPROBES when CONFIG_KRETPROBE_ON_RETHOOK is set
        bpf, lwt: Fix crash when using bpf_skb_set_tunnel_key() from bpf_xmit lwt hook
        bpf: Fix release of page_pool in BPF_PROG_RUN in test runner
        xsk: Fix l2fwd for copy mode + busy poll combo
      ====================
      
      Link: https://lore.kernel.org/r/20220427212748.9576-1-daniel@iogearbox.netSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      347cb5de
    • P
      drm/amdgpu: keep mmhub clock gating being enabled during s2idle suspend · fb8cc331
      Prike Liang 提交于
      Without MMHUB clock gating being enabled then MMHUB will not disconnect
      from DF and will result in DF C-state entry can't be accessed during S2idle
      suspend, and eventually s0ix entry will be blocked.
      Signed-off-by: NPrike Liang <Prike.Liang@amd.com>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      fb8cc331
    • E
      drm/amd/pm: fix the deadlock issue observed on SI · a71849cd
      Evan Quan 提交于
      The adev->pm.mutx is already held at the beginning of
      amdgpu_dpm_compute_clocks/amdgpu_dpm_enable_uvd/amdgpu_dpm_enable_vce.
      But on their calling path, amdgpu_display_bandwidth_update will be
      called and thus its sub functions amdgpu_dpm_get_sclk/mclk. They
      will then try to acquire the same adev->pm.mutex and deadlock will
      occur.
      
      By placing amdgpu_display_bandwidth_update outside of adev->pm.mutex
      protection(considering logically they do not need such protection) and
      restructuring the call flow accordingly, we can eliminate the deadlock
      issue. This comes with no real logics change.
      
      Fixes: 3712e7a4 ("drm/amd/pm: unified lock protections in amdgpu_dpm.c")
      Reported-by: NPaul Menzel <pmenzel@molgen.mpg.de>
      Reported-by: NArthur Marsh <arthur.marsh@internode.on.net>
      Link: https://lore.kernel.org/all/9e689fea-6c69-f4b0-8dee-32c4cf7d8f9c@molgen.mpg.de/
      BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1957Signed-off-by: NEvan Quan <evan.quan@amd.com>
      Reviewed-by: NLijo Lazar <lijo.lazar@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      a71849cd
    • M
      drm/amd/display: Fix memory leak in dcn21_clock_source_create · 65e54987
      Miaoqian Lin 提交于
      When dcn20_clk_src_construct() fails, we need to release clk_src.
      
      Fixes: 6f4e6361 ("drm/amd/display: Add Renoir resource (v2)")
      Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      65e54987
    • A
      drm/amdgpu: don't runtime suspend if there are displays attached (v3) · f95af4a9
      Alex Deucher 提交于
      We normally runtime suspend when there are displays attached if they
      are in the DPMS off state, however, if something wakes the GPU
      we send a hotplug event on resume (in case any displays were connected
      while the GPU was in suspend) which can cause userspace to light
      up the displays again soon after they were turned off.
      
      Prior to
      commit 087451f3 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's."),
      the driver took a runtime pm reference when the fbdev emulation was
      enabled because we didn't implement proper shadowing support for
      vram access when the device was off so the device never runtime
      suspended when there was a console bound.  Once that commit landed,
      we now utilize the core fb helper implementation which properly
      handles the emulation, so runtime pm now suspends in cases where it did
      not before.  Ultimately, we need to sort out why runtime suspend in not
      working in this case for some users, but this should restore similar
      behavior to before.
      
      v2: move check into runtime_suspend
      v3: wake ups -> wakeups in comment, retain pm_runtime behavior in
          runtime_idle callback
      
      Fixes: 087451f3 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.")
      Link: https://lore.kernel.org/r/20220403132322.51c90903@darkstar.example.org/Tested-by: NMichele Ballabio <ballabio.m@gmail.com>
      Reviewed-by: NEvan Quan <evan.quan@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      f95af4a9
    • D
      drm/amdkfd: CRIU add support for GWS queues · f567656f
      David Yat Sin 提交于
      Add support to checkpoint/restore GWS (Global Wave Sync) queues.
      Signed-off-by: NDavid Yat Sin <david.yatsin@amd.com>
      Reviewed-by: NFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      f567656f
    • D
      drm/amdkfd: Fix GWS queue count · 7c6b6e18
      David Yat Sin 提交于
      dqm->gws_queue_count and pdd->qpd.mapped_gws_queue need to be updated
      each time the queue gets evicted.
      
      Fixes: b8020b03 ("drm/amdkfd: Enable over-subscription with >1 GWS queue")
      Signed-off-by: NDavid Yat Sin <david.yatsin@amd.com>
      Reviewed-by: NFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      7c6b6e18
    • L
      Merge branch 'akpm' (patches from Andrew) · 8f4dd166
      Linus Torvalds 提交于
      Merge fixes from Andrew Morton:
       "Two patches.
      
        Subsystems affected by this patch series: mm/kasan and mm/debug"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        docs: vm/page_owner: use literal blocks for param description
        kasan: prevent cpu_quarantine corruption when CPU offline and cache shrink occur at same time
      8f4dd166
    • A
      docs: vm/page_owner: use literal blocks for param description · 5603f9bd
      Akira Yokosawa 提交于
      Sphinx generates hard-to-read lists of parameters at the bottom of the
      page.  Fix them by putting literal-block markers of "::" in front of
      them.
      
      Link: https://lkml.kernel.org/r/cfd3bcc0-b51d-0c68-c065-ca1c4c202447@gmail.comSigned-off-by: NAkira Yokosawa <akiyks@gmail.com>
      Fixes: 57f2b54a ("Documentation/vm/page_owner.rst: update the documentation")
      Cc: Shenghong Han <hanshenghong2019@email.szu.edu.cn>
      Cc: Haowen Bai <baihaowen@meizu.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Alex Shi <seakeel@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5603f9bd
    • Z
      kasan: prevent cpu_quarantine corruption when CPU offline and cache shrink occur at same time · 31fa985b
      Zqiang 提交于
      kasan_quarantine_remove_cache() is called in kmem_cache_shrink()/
      destroy().  The kasan_quarantine_remove_cache() call is protected by
      cpuslock in kmem_cache_destroy() to ensure serialization with
      kasan_cpu_offline().
      
      However the kasan_quarantine_remove_cache() call is not protected by
      cpuslock in kmem_cache_shrink().  When a CPU is going offline and cache
      shrink occurs at same time, the cpu_quarantine may be corrupted by
      interrupt (per_cpu_remove_cache operation).
      
      So add a cpu_quarantine offline flags check in per_cpu_remove_cache().
      
      [akpm@linux-foundation.org: add comment, per Zqiang]
      
      Link: https://lkml.kernel.org/r/20220414025925.2423818-1-qiang1.zhang@intel.comSigned-off-by: NZqiang <qiang1.zhang@intel.com>
      Reviewed-by: NDmitry Vyukov <dvyukov@google.com>
      Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Andrey Konovalov <andreyknvl@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      31fa985b
    • A
      intel_idle: Fix SPR C6 optimization · 7eac3bd3
      Artem Bityutskiy 提交于
      The Sapphire Rapids (SPR) C6 optimization was added to the end of the
      'spr_idle_state_table_update()' function. However, the function has a
      'return' which may happen before the optimization has a chance to run.
      And this may prevent the optimization from happening.
      
      This is an unlikely scenario, but possible if user boots with, say,
      the 'intel_idle.preferred_cstates=6' kernel boot option.
      
      This patch fixes the issue by eliminating the problematic 'return'
      statement.
      
      Fixes: 3a9cf77b ("intel_idle: add core C6 optimization for SPR")
      Suggested-by: NJan Beulich <jbeulich@suse.com>
      Reported-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      [ rjw: Minor changelog edits ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7eac3bd3
    • A
      intel_idle: Fix the 'preferred_cstates' module parameter · 39c184a6
      Artem Bityutskiy 提交于
      Problem description.
      
      When user boots kernel up with the 'intel_idle.preferred_cstates=4' option,
      we enable C1E and disable C1 states on Sapphire Rapids Xeon (SPR). In order
      for C1E to work on SPR, we have to enable the C1E promotion bit on all
      CPUs.  However, we enable it only on one CPU.
      
      Fix description.
      
      The 'intel_idle' driver already has the infrastructure for disabling C1E
      promotion on every CPU. This patch uses the same infrastructure for
      enabling C1E promotion on every CPU. It changes the boolean
      'disable_promotion_to_c1e' variable to a tri-state 'c1e_promotion'
      variable.
      
      Tested on a 2-socket SPR system. I verified the following combinations:
      
       * C1E promotion enabled and disabled in BIOS.
       * Booted with and without the 'intel_idle.preferred_cstates=4' kernel
         argument.
      
      In all 4 cases C1E promotion was correctly set on all CPUs.
      
      Also tested on an old Broadwell system, just to make sure it does not cause
      a regression. C1E promotion was correctly disabled on that system, both C1
      and C1E were exposed (as expected).
      
      Fixes: da0e58c0 ("intel_idle: add 'preferred_cstates' module argument")
      Reported-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      [ rjw: Minor changelog edits ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      39c184a6
    • R
      Merge tag 'cpufreq-arm-fixes-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm · 0f03610b
      Rafael J. Wysocki 提交于
      Pull ARM cpufreq fixes for 5.18-rc5 from Viresh Kumar:
      
      "- Fix issues with the Qualcomm's cpufreq driver (Dmitry Baryshkov and
         Vladimir Zapolskiy).
       - Fix memory leak with the Sun501 driver (Xiaobing Luo)."
      
      * tag 'cpufreq-arm-fixes-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm:
        cpufreq: qcom-cpufreq-hw: Clear dcvs interrupts
        cpufreq: fix memory leak in sun50i_cpufreq_nvmem_probe
        cpufreq: qcom-cpufreq-hw: Fix throttle frequency value on EPSS platforms
        cpufreq: qcom-hw: provide online/offline operations
        cpufreq: qcom-hw: fix the opp entries refcounting
        cpufreq: qcom-hw: fix the race between LMH worker and cpuhp
        cpufreq: qcom-hw: drop affinity hint before freeing the IRQ
      0f03610b
    • M
      hex2bin: fix access beyond string end · e4d8a299
      Mikulas Patocka 提交于
      If we pass too short string to "hex2bin" (and the string size without
      the terminating NUL character is even), "hex2bin" reads one byte after
      the terminating NUL character.  This patch fixes it.
      
      Note that hex_to_bin returns -1 on error and hex2bin return -EINVAL on
      error - so we can't just return the variable "hi" or "lo" on error.
      This inconsistency may be fixed in the next merge window, but for the
      purpose of fixing this bug, we just preserve the existing behavior and
      return -1 and -EINVAL.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Fixes: b7804983 ("lib: add error checking to hex2bin")
      Cc: stable@vger.kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e4d8a299