1. 26 2月, 2022 5 次提交
    • S
      ACPI: fan: Add additional attributes for fine grain control · f1197343
      Srinivas Pandruvada 提交于
      Add additional attributes, which helps in implementing algorithm in
      the user space to optimize fan control. These attributes are presented
      in the same directory as the existing performance state attributes.
      
      Additional attributes:
      
      1. Support of fine grain control
      Publish support of presence of fine grain control so that fan speed
      can be tuned correctly. This attribute is called "fine_grain_control".
      
      2. fan speed
      Publish the actual fan rpm in sysfs. Knowing fan rpm is helpful to
      reduce noise level and use passive control instead. Also fan performance
      may not be same over time, so the same control value may not be enough
      to run the fan at a speed. So a feedback value of speed is helpful. This
      sysfs attribute is called "fan_speed_rpm".
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f1197343
    • S
      ACPI: fan: Properly handle fine grain control · bea2d986
      Srinivas Pandruvada 提交于
      When _FIF object specifies support for fine grain control, then fan speed
      can be set from 0 to 100% with the recommended minimum "step size" via
      _FSL object. Here the control value doesn't need to match any value from
      _FPS object.
      
      Currently we have a simple solution implemented which just pick maximum
      control value from _FPS to display the actual state, but this is not
      optimal when there is a big window between two control values in
      _FPS. Also there is no way to set to any speed which doesn't match
      control values in _FPS. The system firmware can start the fan at speed
      which doesn't match any control value.
      
      To support fine grain control (when supported) via thermal sysfs:
      - cooling device max state is not _FPS state count but it will be
      100 / _FIF.step_size
      Step size can be from 1 to 9.
      - cooling device current state is _FST.control / _FIF.step_size
      - cooling device set state will set the control value
      cdev.curr_state * _FIF.step_size plus any adjustment for 100%.
      By the spec, when control value do not sum to 100% because of
      _FIF.step_size, OSPM may select an appropriate ending Level increment
      to reach 100%.
      
      There is no rounding during calculation. For example if step size
      is 6:
      thermal sysfs cooling device max_state = 100/6 = 16
      So user can set any value from 0-16.
      
      If the system boots with a _FST.control which is not multiples
      of step_size, the thermal sysfs cur_state will be based on the
      range. For example for step size = 6:
      _FST.control	thermal sysfs cur_state
      ------------------------------------------------
      0-5		0
      6-11		1
      ..
      ..
      90-95		15
      96-100		16
      
      While setting the _FST.control, the compensation will be at
      the last step for cur_state = 16, which will set the _FST.control
      to 100.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bea2d986
    • S
      ACPI: fan: Optimize struct acpi_fan_fif · d445571f
      Srinivas Pandruvada 提交于
      We don't need u64 to store the information about _FIF. There are two
      booleans (fine_grain_ctrl and low_speed_notification) and one field
      step_size which can take value from 1-9. There are no internal users
      of revision field. So convert all fields to u8, by not directly
      extracting the _FIF info the struct. Use an intermediate buffer to
      extract and assign.
      
      This will help to do u32 math using these fields. No functional
      changes are expected.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d445571f
    • S
      ACPI: fan: Separate file for attributes creation · 00ae053a
      Srinivas Pandruvada 提交于
      Move the functionality of creation of sysfs attributes under acpi device
      to a new file fan_attr.c. This cleans up the core fan code, which just
      use thermal sysfs interface. The original fan.c is renamed to
      fan_core.c.
      
      No functional changes are expected.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      00ae053a
    • S
      ACPI: fan: Fix error reporting to user space · 9ddb00a2
      Srinivas Pandruvada 提交于
      When user get/set cur_state fails, it should be some negative error
      value instead of whatever returned by acpi_evaluate_object() or from
      acpi_execute_simple_method(). The return value from these apis is
      some positive values greater than 0. For example if AE_NOT_FOUND
      is returned it will be "5".
      
      In other ACPI drivers, -ENODEV is returned when ACPI_FAILURE(status)
      is true. Do the same thing here for thermal sysfs callbacks for
      get and set for failures.
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9ddb00a2
  2. 21 2月, 2022 13 次提交
  3. 19 2月, 2022 13 次提交
  4. 18 2月, 2022 9 次提交
    • A
      x86/ptrace: Fix xfpregs_set()'s incorrect xmm clearing · 44cad52c
      Andy Lutomirski 提交于
      xfpregs_set() handles 32-bit REGSET_XFP and 64-bit REGSET_FP. The actual
      code treats these regsets as modern FX state (i.e. the beginning part of
      XSTATE). The declarations of the regsets thought they were the legacy
      i387 format. The code thought they were the 32-bit (no xmm8..15) variant
      of XSTATE and, for good measure, made the high bits disappear by zeroing
      the wrong part of the buffer. The latter broke ptrace, and everything
      else confused anyone trying to understand the code. In particular, the
      nonsense definitions of the regsets confused me when I wrote this code.
      
      Clean this all up. Change the declarations to match reality (which
      shouldn't change the generated code, let alone the ABI) and fix
      xfpregs_set() to clear the correct bits and to only do so for 32-bit
      callers.
      
      Fixes: 6164331d ("x86/fpu: Rewrite xfpregs_set()")
      Reported-by: NLuís Ferreira <contact@lsferreira.net>
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: <stable@vger.kernel.org>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=215524
      Link: https://lore.kernel.org/r/YgpFnZpF01WwR8wU@zn.tnic
      44cad52c
    • R
      i2c: brcmstb: fix support for DSL and CM variants · 834cea3a
      Rafał Miłecki 提交于
      DSL and CM (Cable Modem) support 8 B max transfer size and have a custom
      DT binding for that reason. This driver was checking for a wrong
      "compatible" however which resulted in an incorrect setup.
      
      Fixes: e2e5a2c6 ("i2c: brcmstb: Adding support for CM and DSL SoCs")
      Signed-off-by: NRafał Miłecki <rafal@milecki.pl>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NWolfram Sang <wsa@kernel.org>
      834cea3a
    • L
      Merge tag 'linux-kselftest-fixes-5.17-rc5' of... · 9195e5e0
      Linus Torvalds 提交于
      Merge tag 'linux-kselftest-fixes-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull Kselftest fixes from Shuah Khan:
       "Fixes to ftrace, exec, and seccomp tests build, run-time and install
        bugs. These bugs are in the way of running the tests"
      
      * tag 'linux-kselftest-fixes-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests/ftrace: Do not trace do_softirq because of PREEMPT_RT
        selftests/seccomp: Fix seccomp failure by adding missing headers
        selftests/exec: Add non-regular to TEST_GEN_PROGS
      9195e5e0
    • L
      Merge tag 'drm-fixes-2022-02-18' of git://anongit.freedesktop.org/drm/drm · b3d971ec
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "Regular fixes for rc5, nothing really stands out, mostly some amdgpu
        and i915 fixes with mediatek, radeon and some misc fixes.
      
        cma-helper:
         - set VM_DONTEXPAND
      
        atomic:
         - error handling fix
      
        mediatek:
         - fix probe defer loop with external bridge
      
        amdgpu:
         - Stable pstate clock fixes for Dimgrey Cavefish and Beige Goby
         - S0ix SDMA fix
         - Yellow Carp GPU reset fix
      
        radeon:
         - Backlight fix for iMac 12,1
      
        i915:
         - GVT kerneldoc cleanup.
         - GVT Kconfig should depend on X86
         - Prevent out of range access in SWSCI display code
         - Fix mbus join and dbuf slice config lookup
         - Fix inverted priority selection in the TTM backend
         - Fix FBC plane end Y offset check"
      
      * tag 'drm-fixes-2022-02-18' of git://anongit.freedesktop.org/drm/drm:
        drm/atomic: Don't pollute crtc_state->mode_blob with error pointers
        drm/radeon: Fix backlight control on iMac 12,1
        drm/amd/pm: correct the sequence of sending gpu reset msg
        drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.
        drm/amd/pm: correct UMD pstate clocks for Dimgrey Cavefish and Beige Goby
        drm/i915/fbc: Fix the plane end Y offset check
        drm/i915/opregion: check port number bounds for SWSCI display power state
        drm/i915/ttm: tweak priority hint selection
        drm/i915: Fix mbus join config lookup
        drm/i915: Fix dbuf slice config lookup
        drm/cma-helper: Set VM_DONTEXPAND for mmap
        drm/mediatek: mtk_dsi: Avoid EPROBE_DEFER loop with external bridge
        drm/i915/gvt: Make DRM_I915_GVT depend on X86
        drm/i915/gvt: clean up kernel-doc in gtt.c
      b3d971ec
    • D
      Merge tag 'drm-intel-fixes-2022-02-17' of... · 5666b610
      Dave Airlie 提交于
      Merge tag 'drm-intel-fixes-2022-02-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
      
      - GVT kerneldoc cleanup. (Randy Dunlap)
      - GVT Kconfig should depend on X86. (Siva Mullati)
      - Prevent out of range access in SWSCI display code. (Jani Nikula)
      - Fix mbus join and dbuf slice config lookup. (Ville Syrjälä)
      - Fix inverted priority selection in the TTM backend. (Matthew Auld)
      - Fix FBC plane end Y offset check. (Ville Syrjälä)
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/Yg4lA6k8+xp8u3aB@tursulin-mobl2
      5666b610
    • D
      Merge tag 'drm-misc-fixes-2022-02-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · babb1fc3
      Dave Airlie 提交于
       * drm/cma-helper: Set VM_DONTEXPAND
       * drm/atomic: Fix error handling in drm_atomic_set_mode_for_crtc()
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/Yg4mzQALMX69UmA3@linux-uq9g
      babb1fc3
    • L
      Merge tag 'net-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 8b97cae3
      Linus Torvalds 提交于
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from wireless and netfilter.
      
        Current release - regressions:
      
         - dsa: lantiq_gswip: fix use after free in gswip_remove()
      
         - smc: avoid overwriting the copies of clcsock callback functions
      
        Current release - new code bugs:
      
         - iwlwifi:
            - fix use-after-free when no FW is present
            - mei: fix the pskb_may_pull check in ipv4
            - mei: retry mapping the shared area
            - mvm: don't feed the hardware RFKILL into iwlmei
      
        Previous releases - regressions:
      
         - ipv6: mcast: use rcu-safe version of ipv6_get_lladdr()
      
         - tipc: fix wrong publisher node address in link publications
      
         - iwlwifi: mvm: don't send SAR GEO command for 3160 devices, avoid FW
           assertion
      
         - bgmac: make idm and nicpm resource optional again
      
         - atl1c: fix tx timeout after link flap
      
        Previous releases - always broken:
      
         - vsock: remove vsock from connected table when connect is
           interrupted by a signal
      
         - ping: change destination interface checks to match raw sockets
      
         - crypto: af_alg - get rid of alg_memory_allocated to avoid confusing
           semantics (and null-deref) after SO_RESERVE_MEM was added
      
         - ipv6: make exclusive flowlabel checks per-netns
      
         - bonding: force carrier update when releasing slave
      
         - sched: limit TC_ACT_REPEAT loops
      
         - bridge: multicast: notify switchdev driver whenever MC processing
           gets disabled because of max entries reached
      
         - wifi: brcmfmac: fix crash in brcm_alt_fw_path when WLAN not found
      
         - iwlwifi: fix locking when "HW not ready"
      
         - phy: mediatek: remove PHY mode check on MT7531
      
         - dsa: mv88e6xxx: flush switchdev FDB workqueue before removing VLAN
      
         - dsa: lan9303:
            - fix polarity of reset during probe
            - fix accelerated VLAN handling"
      
      * tag 'net-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (65 commits)
        bonding: force carrier update when releasing slave
        nfp: flower: netdev offload check for ip6gretap
        ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt
        ipv4: fix data races in fib_alias_hw_flags_set
        net: dsa: lan9303: add VLAN IDs to master device
        net: dsa: lan9303: handle hwaccel VLAN tags
        vsock: remove vsock from connected table when connect is interrupted by a signal
        Revert "net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname"
        ping: fix the dif and sdif check in ping_lookup
        net: usb: cdc_mbim: avoid altsetting toggling for Telit FN990
        net: sched: limit TC_ACT_REPEAT loops
        tipc: fix wrong notification node addresses
        net: dsa: lantiq_gswip: fix use after free in gswip_remove()
        ipv6: per-netns exclusive flowlabel checks
        net: bridge: multicast: notify switchdev driver whenever MC processing gets disabled
        CDC-NCM: avoid overflow in sanity checking
        mctp: fix use after free
        net: mscc: ocelot: fix use-after-free in ocelot_vlan_del()
        bonding: fix data-races around agg_select_timer
        dpaa2-eth: Initialize mutex used in one step timestamping path
        ...
      8b97cae3
    • Z
      bonding: force carrier update when releasing slave · a6ab75ce
      Zhang Changzhong 提交于
      In __bond_release_one(), bond_set_carrier() is only called when bond
      device has no slave. Therefore, if we remove the up slave from a master
      with two slaves and keep the down slave, the master will remain up.
      
      Fix this by moving bond_set_carrier() out of if (!bond_has_slaves(bond))
      statement.
      
      Reproducer:
      $ insmod bonding.ko mode=0 miimon=100 max_bonds=2
      $ ifconfig bond0 up
      $ ifenslave bond0 eth0 eth1
      $ ifconfig eth0 down
      $ ifenslave -d bond0 eth1
      $ cat /proc/net/bonding/bond0
      
      Fixes: ff59c456 ("[PATCH] bonding: support carrier state for master")
      Signed-off-by: NZhang Changzhong <zhangchangzhong@huawei.com>
      Acked-by: NJay Vosburgh <jay.vosburgh@canonical.com>
      Link: https://lore.kernel.org/r/1645021088-38370-1-git-send-email-zhangchangzhong@huawei.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      a6ab75ce
    • R
      x86/sgx: Fix missing poison handling in reclaimer · e5733d8c
      Reinette Chatre 提交于
      The SGX reclaimer code lacks page poison handling in its main
      free path. This can lead to avoidable machine checks if a
      poisoned page is freed and reallocated instead of being
      isolated.
      
      A troublesome scenario is:
       1. Machine check (#MC) occurs (asynchronous, !MF_ACTION_REQUIRED)
       2. arch_memory_failure() is eventually called
       3. (SGX) page->poison set to 1
       4. Page is reclaimed
       5. Page added to normal free lists by sgx_reclaim_pages()
          ^ This is the bug (poison pages should be isolated on the
          sgx_poison_page_list instead)
       6. Page is reallocated by some innocent enclave, a second (synchronous)
          in-kernel #MC is induced, probably during EADD instruction.
          ^ This is the fallout from the bug
      
      (6) is unfortunate and can be avoided by replacing the open coded
      enclave page freeing code in the reclaimer with sgx_free_epc_page()
      to obtain support for poison page handling that includes placing the
      poisoned page on the correct list.
      
      Fixes: d6d261bd ("x86/sgx: Add new sgx_epc_page flag bit to mark free pages")
      Fixes: 992801ae ("x86/sgx: Initial poison handling for dirty and free pages")
      Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: NDave Hansen <dave.hansen@linux.intel.com>
      Reviewed-by: NJarkko Sakkinen <jarkko@kernel.org>
      Link: https://lkml.kernel.org/r/dcc95eb2aaefb042527ac50d0a50738c7c160dac.1643830353.git.reinette.chatre@intel.com
      e5733d8c