Skip to content
Permalink
Srinivas-Pandr…
Switch branches/tags

Commits on Feb 11, 2022

  1. Documentation/admin-guide/acpi: Add documentation for fine grain control

    Add documentation for the newly added attributes:
    fine_grain_control
    fan_speed_rpm
    
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    spandruvada authored and intel-lab-lkp committed Feb 11, 2022
  2. ACPI / fan: Add additional attributes for fine grain control

    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: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    spandruvada authored and intel-lab-lkp committed Feb 11, 2022
  3. ACPI / fan: Properly handle fine grain control

    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: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    spandruvada authored and intel-lab-lkp committed Feb 11, 2022
  4. ACPI / fan: Optimize struct acpi_fan_fif

    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: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    spandruvada authored and intel-lab-lkp committed Feb 11, 2022
  5. ACPI / fan: Separate file for attributes creation

    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: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    spandruvada authored and intel-lab-lkp committed Feb 11, 2022
  6. ACPI / fan: Fix error reporting to user space

    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: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    spandruvada authored and intel-lab-lkp committed Feb 11, 2022

Commits on Feb 10, 2022

  1. Merge branch 'thermal-hfi' into linux-next

    * thermal-hfi:
      thermal: intel: hfi: INTEL_HFI_THERMAL depends on NET
    rafaeljw committed Feb 10, 2022
  2. thermal: intel: hfi: INTEL_HFI_THERMAL depends on NET

    THERMAL_NETLINK depends on NET and since 'select' does not follow
    any dependency chain, INTEL_HFI_THERMAL also should depend on NET.
    
    Fix one Kconfig warning and 48 subsequent build errors:
    
    WARNING: unmet direct dependencies detected for THERMAL_NETLINK
      Depends on [n]: THERMAL [=y] && NET [=n]
      Selected by [y]:
      - INTEL_HFI_THERMAL [=y] && THERMAL [=y] && (X86 [=y] || X86_INTEL_QUARK [=n] || COMPILE_TEST [=y]) && CPU_SUP_INTEL [=y] && X86_THERMAL_VECTOR [=y]
    
    Fixes: bd30cdf ("thermal: intel: hfi: Notify user space for HFI events")
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    rddunlap authored and rafaeljw committed Feb 10, 2022

Commits on Feb 9, 2022

  1. Merge branch 'acpi-x86' into linux-next

    * acpi-x86:
      x86/PCI: revert "Ignore E820 reservations for bridge windows on newer systems"
    rafaeljw committed Feb 9, 2022
  2. x86/PCI: revert "Ignore E820 reservations for bridge windows on newer…

    … systems"
    
    Commit 7f7b423 ("x86/PCI: Ignore E820 reservations for bridge windows
    on newer systems") fixes the touchpad not working on laptops like
    the Lenovo IdeaPad 3 15IIL05 and the Lenovo IdeaPad 5 14IIL05, as well as
    fixing thunderbolt hotplug issues on the Lenovo Yoga C940.
    
    Unfortunately it turns out that this is causing issues with suspend/resume
    on Lenovo ThinkPad X1 Carbon Gen 2 laptops. So, per the no regressions
    policy, rever this. Note I'm looking into another fix for the issues this
    fixed.
    
    Fixes: 7f7b423 ("x86/PCI: Ignore E820 reservations for bridge windows on newer systems")
    BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2029207
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    jwrdegoede authored and rafaeljw committed Feb 9, 2022

Commits on Feb 8, 2022

  1. Merge branch 'acpi-pm' into linux-next

    * acpi-pm:
      PM: s2idle: ACPI: Fix wakeup interrupts handling
      ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE
      ACPI: PM: Revert "Only mark EC GPE for wakeup on Intel systems"
    rafaeljw committed Feb 8, 2022

Commits on Feb 7, 2022

  1. PM: s2idle: ACPI: Fix wakeup interrupts handling

    After commit e3728b5 ("ACPI: PM: s2idle: Avoid possible race
    related to the EC GPE") wakeup interrupts occurring immediately after
    the one discarded by acpi_s2idle_wake() may be missed.  Moreover, if
    the SCI triggers again immediately after the rearming in
    acpi_s2idle_wake(), that wakeup may be missed too.
    
    The problem is that pm_system_irq_wakeup() only calls pm_system_wakeup()
    when pm_wakeup_irq is 0, but that's not the case any more after the
    interrupt causing acpi_s2idle_wake() to run until pm_wakeup_irq is
    cleared by the pm_wakeup_clear() call in s2idle_loop().  However,
    there may be wakeup interrupts occurring in that time frame and if
    that happens, they will be missed.
    
    To address that issue first move the clearing of pm_wakeup_irq to
    the point at which it is known that the interrupt causing
    acpi_s2idle_wake() to tun will be discarded, before rearming the SCI
    for wakeup.  Moreover, because that only reduces the size of the
    time window in which the issue may manifest itself, allow
    pm_system_irq_wakeup() to register two second wakeup interrupts in
    a row and, when discarding the first one, replace it with the second
    one.  [Of course, this assumes that only one wakeup interrupt can be
    discarded in one go, but currently that is the case and I am not
    aware of any plans to change that.]
    
    Fixes: e3728b5 ("ACPI: PM: s2idle: Avoid possible race related to the EC GPE")
    Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    rafaeljw committed Feb 7, 2022
  2. ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE

    Commit 4a9af6c ("ACPI: EC: Rework flushing of EC work while
    suspended to idle") made acpi_ec_dispatch_gpe() check
    pm_wakeup_pending(), but that is before canceling the SCI wakeup,
    so pm_wakeup_pending() is always true.  This causes the loop in
    acpi_ec_dispatch_gpe() to always terminate after one iteration which
    may not be correct.
    
    Address this issue by canceling the SCI wakeup earlier, from
    acpi_ec_dispatch_gpe() itself.
    
    Fixes: 4a9af6c ("ACPI: EC: Rework flushing of EC work while suspended to idle")
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    rafaeljw committed Feb 7, 2022
  3. ACPI: PM: Revert "Only mark EC GPE for wakeup on Intel systems"

    Testing on various upcoming OEM systems shows commit 7b167c4 ("ACPI:
    PM: Only mark EC GPE for wakeup on Intel systems") was short
    sighted and the symptoms were indicative of other problems. Some OEMs
    do have the dedicated GPIOs for the power button but also rely upon
    an interrupt to the EC SCI to let the lid work.
    
    The original commit showed spurious activity on Lenovo systems:
         * On both Lenovo T14 and P14s the keyboard wakeup doesn't work, and
           sometimes the power button event doesn't work.
    
    This was confirmed on my end at that time.
    
    However further development in the kernel showed that the issue was
    actually the IRQ for the GPIO controller was also shared with the EC SCI.
    This was actually fixed by commit 2d54067 ("pinctrl: amd: Fix
    wakeups when IRQ is shared with SCI").
    
    The original commit also showed problems with AC adapter:
         * On HP 635 G7 detaching or attaching AC during suspend will cause
           the system not to wakeup
         * On Asus vivobook to prevent detaching AC causing resume problems
         * On Lenovo 14ARE05 to prevent detaching AC causing resume problems
         * On HP ENVY x360  to prevent detaching AC causing resume problems
    
    Detaching AC adapter causing problems appears to have been a problem
    because the EC SCI went off to notify the OS of the power adapter change
    but the SCI was ignored and there was no other way to wake up this system
    since GPIO controller wasn't properly enabled.  The wakeups were fixed by
    enabling the GPIO controller in commit acd47b9 ("pinctrl: amd: Handle
    wake-up interrupt").
    
    I've confirmed on a variety of OEM notebooks with the following test
    
     1) echo 1 | sudo tee /sys/power/pm_debug_messages
     2) sudo systemctl suspend
     3) unplug AC adapter, make sure system is still asleep
     4) wake system from lid (which is provided by ACPI SCI on some of them)
     5) dmesg
        a) see the EC GPE dispatched, timekeeping for X seconds (matching ~time
           until AC adapter plug out)
        b) see timekeeping for Y seconds until woke (matching ~time from AC
           adapter until lid event)
     6) Look at /sys/kernel/debug/amd_pmc/s0ix_stats
        "Time (in us) in S0i3" = X + Y - firmware processing time
    
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    superm1 authored and rafaeljw committed Feb 7, 2022
  4. Merge branch 'acpi-tables' into linux-next

    * acpi-tables:
      ACPI: tables: Add CEDT signature to the list of known tables
    rafaeljw committed Feb 7, 2022
  5. Merge branch 'pnp' into linux-next

    * pnp:
      PNP: Replace acpi_bus_get_device()
    rafaeljw committed Feb 7, 2022
  6. Merge branch 'pm-cpufreq' into linux-next

    * pm-cpufreq:
      cpufreq: longhaul: Replace acpi_bus_get_device()
      cpufreq: schedutil: Use to_gov_attr_set() to get the gov_attr_set
      cpufreq: Move to_gov_attr_set() to cpufreq.h
    rafaeljw committed Feb 7, 2022
  7. Merge branches 'thermal-int340x' and 'thermal-powerclamp' into linux-…

    …next
    
    * thermal-int340x:
      thermal: Replace acpi_bus_get_device()
      thermal: int340x: Check for NULL after calling kmemdup()
    
    * thermal-powerclamp:
      thermal: intel_powerclamp: don't use bitmap_weight() in end_power_clamp()
    rafaeljw committed Feb 7, 2022
  8. Merge branch 'pm-tools' into linux-next

    * pm-tools:
      tools/power/cpupower/{ToDo => TODO}: Rename the todo file
      tools: cpupower: fix typo in cpupower-idle-set(1) manpage
    rafaeljw committed Feb 7, 2022
  9. Merge branch 'thermal-hfi' into linux-next

    * thermal-hfi:
      thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub
      thermal: intel: hfi: Notify user space for HFI events
      thermal: netlink: Add a new event to notify CPU capabilities change
      thermal: intel: hfi: Enable notification interrupt
      thermal: intel: hfi: Handle CPU hotplug events
      thermal: intel: hfi: Minimally initialize the Hardware Feedback Interface
      x86/cpu: Add definitions for the Intel Hardware Feedback Interface
      x86/Documentation: Describe the Intel Hardware Feedback Interface
    rafaeljw committed Feb 7, 2022
  10. thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_e…

    …vent() stub
    
    When building with CONFIG_THERMAL_NETLINK=n, there is a spew of warnings
    along the lines of:
    
      In file included from drivers/thermal/thermal_core.c:27:
      In file included from drivers/thermal/thermal_core.h:15:
      drivers/thermal/thermal_netlink.h:113:71: warning: declaration of 'struct cpu_capability' will not be visible outside of this function [-Wvisibility]
      static inline int thermal_genl_cpu_capability_event(int count, struct cpu_capability *caps)
                                                                            ^
      1 warning generated.
    
    'struct cpu_capability' is not forward declared anywhere in the header.
    As it turns out, this should really be 'struct thermal_genl_cpu_caps',
    which silences the warning and makes the parameter types of the stub
    match the full function.
    
    Fixes: e4b1eb2 ("thermal: netlink: Add a new event to notify CPU capabilities change")
    Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    nathanchance authored and rafaeljw committed Feb 7, 2022
  11. Merge branches 'acpica', 'acpi-osl' and 'acpi-properties' into linux-…

    …next
    
    * acpica:
      ACPICA: Use uintptr_t and offsetof() in Linux kernel builds
    
    * acpi-osl:
      ACPI: OSL: Fix and clean up acpi_os_read/write_port()
    
    * acpi-properties:
      ACPI: properties: Consistently return -ENOENT if there are no more references
    rafaeljw committed Feb 7, 2022
  12. Merge branch 'thermal-docs' into linux-next

    * thermal-docs:
      thermal: fix Documentation bullet list warning
    rafaeljw committed Feb 7, 2022

Commits on Feb 6, 2022

  1. Linux 5.17-rc3

    torvalds committed Feb 6, 2022
  2. Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/lin…

    …ux/kernel/git/tytso/ext4
    
    Pull ext4 fixes from Ted Ts'o:
     "Various bug fixes for ext4 fast commit and inline data handling.
    
      Also fix regression introduced as part of moving to the new mount API"
    
    * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
      fs/ext4: fix comments mentioning i_mutex
      ext4: fix incorrect type issue during replay_del_range
      jbd2: fix kernel-doc descriptions for jbd2_journal_shrink_{scan,count}()
      ext4: fix potential NULL pointer dereference in ext4_fill_super()
      jbd2: refactor wait logic for transaction updates into a common function
      jbd2: cleanup unused functions declarations from jbd2.h
      ext4: fix error handling in ext4_fc_record_modified_inode()
      ext4: remove redundant max inline_size check in ext4_da_write_inline_data_begin()
      ext4: fix error handling in ext4_restore_inline_data()
      ext4: fast commit may miss file actions
      ext4: fast commit may not fallback for ineligible commit
      ext4: modify the logic of ext4_mb_new_blocks_simple
      ext4: prevent used blocks from being allocated during fast commit replay
    torvalds committed Feb 6, 2022
  3. Merge tag 'perf-tools-fixes-for-v5.17-2022-02-06' of git://git.kernel…

    ….org/pub/scm/linux/kernel/git/acme/linux
    
    Pull perf tools fixes from Arnaldo Carvalho de Melo:
    
     - Fix display of grouped aliased events in 'perf stat'.
    
     - Add missing branch_sample_type to perf_event_attr__fprintf().
    
     - Apply correct label to user/kernel symbols in branch mode.
    
     - Fix 'perf ftrace' system_wide tracing, it has to be set before
       creating the maps.
    
     - Return error if procfs isn't mounted for PID namespaces when
       synthesizing records for pre-existing processes.
    
     - Set error stream of objdump process for 'perf annotate' TUI, to avoid
       garbling the screen.
    
     - Add missing arm64 support to perf_mmap__read_self(), the kernel part
       got into 5.17.
    
     - Check for NULL pointer before dereference writing debug info about a
       sample.
    
     - Update UAPI copies for asound, perf_event, prctl and kvm headers.
    
     - Fix a typo in bpf_counter_cgroup.c.
    
    * tag 'perf-tools-fixes-for-v5.17-2022-02-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
      perf ftrace: system_wide collection is not effective by default
      libperf: Add arm64 support to perf_mmap__read_self()
      tools include UAPI: Sync sound/asound.h copy with the kernel sources
      perf stat: Fix display of grouped aliased events
      perf tools: Apply correct label to user/kernel symbols in branch mode
      perf bpf: Fix a typo in bpf_counter_cgroup.c
      perf synthetic-events: Return error if procfs isn't mounted for PID namespaces
      perf session: Check for NULL pointer before dereference
      perf annotate: Set error stream of objdump process for TUI
      perf tools: Add missing branch_sample_type to perf_event_attr__fprintf()
      tools headers UAPI: Sync linux/kvm.h with the kernel sources
      tools headers UAPI: Sync linux/prctl.h with the kernel sources
      perf beauty: Make the prctl arg regexp more strict to cope with PR_SET_VMA
      tools headers cpufeatures: Sync with the kernel sources
      tools headers UAPI: Sync linux/perf_event.h with the kernel sources
      tools include UAPI: Sync sound/asound.h copy with the kernel sources
    torvalds committed Feb 6, 2022
  4. Merge tag 'perf_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm…

    …/linux/kernel/git/tip/tip
    
    Pull perf fixes from Borislav Petkov:
    
     - Intel/PT: filters could crash the kernel
    
     - Intel: default disable the PMU for SMM, some new-ish EFI firmware has
       started using CPL3 and the PMU CPL filters don't discriminate against
       SMM, meaning that CPL3 (userspace only) events now also count EFI/SMM
       cycles.
    
     - Fixup for perf_event_attr::sig_data
    
    * tag 'perf_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      perf/x86/intel/pt: Fix crash with stop filters in single-range mode
      perf: uapi: Document perf_event_attr::sig_data truncation on 32 bit architectures
      selftests/perf_events: Test modification of perf_event_attr::sig_data
      perf: Copy perf_event_attr::sig_data on modification
      x86/perf: Default set FREEZE_ON_SMI for all
    torvalds committed Feb 6, 2022
  5. Merge tag 'objtool_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/…

    …scm/linux/kernel/git/tip/tip
    
    Pull objtool fix from Borislav Petkov:
     "Fix a potential truncated string warning triggered by gcc12"
    
    * tag 'objtool_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      objtool: Fix truncated string warning
    torvalds committed Feb 6, 2022
  6. Merge tag 'irq_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/…

    …linux/kernel/git/tip/tip
    
    Pull irq fix from Borislav Petkov:
     "Remove a bogus warning introduced by the recent PCI MSI irq affinity
      overhaul"
    
    * tag 'irq_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
      PCI/MSI: Remove bogus warning in pci_irq_get_affinity()
    torvalds committed Feb 6, 2022
  7. Merge tag 'edac_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm…

    …/linux/kernel/git/ras/ras
    
    Pull EDAC fixes from Borislav Petkov:
     "Fix altera and xgene EDAC drivers to propagate the correct error code
      from platform_get_irq() so that deferred probing still works"
    
    * tag 'edac_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
      EDAC/xgene: Fix deferred probing
      EDAC/altera: Fix deferred probing
    torvalds committed Feb 6, 2022
  8. perf ftrace: system_wide collection is not effective by default

    The ftrace.target.system_wide must be set before invoking
    evlist__create_maps(), otherwise it has no effect.
    
    Fixes: 53be502 ("perf ftrace: Add 'latency' subcommand")
    Signed-off-by: Changbin Du <changbin.du@gmail.com>
    Acked-by: Namhyung Kim <namhyung@gmail.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20220127132010.4836-1-changbin.du@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    changbindu authored and Arnaldo Carvalho de Melo committed Feb 6, 2022
  9. libperf: Add arm64 support to perf_mmap__read_self()

    Add the arm64 variants for read_perf_counter() and read_timestamp().
    Unfortunately the counter number is encoded into the instruction, so the
    code is a bit verbose to enumerate all possible counters.
    
    Tested-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
    Signed-off-by: Rob Herring <robh@kernel.org>
    Acked-by: Jiri Olsa <jolsa@redhat.com>
    Tested-by: John Garry <john.garry@huawei.com>
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Link: https://lore.kernel.org/r/20220201214056.702854-1-robh@kernel.org
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Will Deacon <will@kernel.org>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-perf-users@vger.kernel.org
    robherring authored and Arnaldo Carvalho de Melo committed Feb 6, 2022
  10. tools include UAPI: Sync sound/asound.h copy with the kernel sources

    Picking the changes from:
    
      06feec6 ("ASoC: hdmi-codec: Fix OOB memory accesses")
    
    Which entails no changes in the tooling side as it doesn't introduce new
    SNDRV_PCM_IOCTL_ ioctls.
    
    To silence this perf tools build warning:
    
      Warning: Kernel ABI header at 'tools/include/uapi/sound/asound.h' differs from latest version at 'include/uapi/sound/asound.h'
      diff -u tools/include/uapi/sound/asound.h include/uapi/sound/asound.h
    
    Cc: Dmitry Osipenko <digetx@gmail.com>
    Cc: Mark Brown <broonie@kernel.org>
    Cc: Takashi Iwai <tiwai@suse.de>
    Link: https://lore.kernel.org/lkml/Yf+6OT+2eMrYDEeX@kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Arnaldo Carvalho de Melo committed Feb 6, 2022
  11. perf stat: Fix display of grouped aliased events

    An event may have a number of uncore aliases that when added to the
    evlist are consecutive.
    
    If there are multiple uncore events in a group then
    parse_events__set_leader_for_uncore_aliase will reorder the evlist so
    that events on the same PMU are adjacent.
    
    The collect_all_aliases function assumes that aliases are in blocks so
    that only the first counter is printed and all others are marked merged.
    
    The reordering for groups breaks the assumption and so all counts are
    printed.
    
    This change removes the assumption from collect_all_aliases
    that the events are in blocks and instead processes the entire evlist.
    
    Before:
    
      ```
      $ perf stat -e '{UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE,UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE},duration_time' -a -A -- sleep 1
    
       Performance counter stats for 'system wide':
    
      CPU0                  256,866      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 494,413      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                      967      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,738      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  285,161      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 429,920      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                      955      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,443      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  310,753      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 416,657      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,231      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,573      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  416,067      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 405,966      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,481      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,447      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  312,911      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 408,154      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,086      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,380      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  333,994      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 370,349      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,287      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,335      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  188,107      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 302,423      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                      701      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,070      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  307,221      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 383,642      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,036      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,158      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  318,479      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 821,545      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,028      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   2,550      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  227,618      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 372,272      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                      903      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,456      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  376,783      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 419,827      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,406      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,453      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  286,583      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 429,956      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                      999      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,436      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  313,867      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 370,159      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,114      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,291      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  342,083      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 409,111      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,399      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,684      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  365,828      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 376,037      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,378      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,411      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  382,456      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 621,743      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,232      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,955      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  342,316      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 385,067      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,176      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,268      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  373,588      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 386,163      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,394      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,464      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  381,206      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 546,891      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,266      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,712      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  221,176      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 392,069      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                      831      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,456      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  355,401      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 705,595      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,235      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   2,216      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  371,436      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 428,103      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,306      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,442      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  384,352      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 504,200      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,468      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,860      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  228,856      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 287,976      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                      832      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,060      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  215,121      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 334,162      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                      681      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,026      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  296,179      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 436,083      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,084      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,525      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  262,296      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 416,573      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                      986      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,533      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  285,852      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 359,842      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,073      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,326      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  303,379      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 367,222      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,008      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,156      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  273,487      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 425,449      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                      932      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,367      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  297,596      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 414,793      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,140      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,601      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  342,365      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 360,422      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,291      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,342      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  327,196      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 580,858      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,122      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   2,014      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  296,564      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 452,817      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,087      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,694      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  375,002      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 389,393      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,478      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   1,540      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0                  365,213      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36                 594,685      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                    1,401      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                   2,222      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0            1,000,749,060 ns   duration_time
    
             1.000749060 seconds time elapsed
      ```
    
    After:
    
      ```
       Performance counter stats for 'system wide':
    
      CPU0               20,547,434      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU36              45,202,862      UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE
      CPU0                   82,001      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU36                 159,688      UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE
      CPU0            1,000,464,828 ns   duration_time
    
             1.000464828 seconds time elapsed
      ```
    
    Fixes: 3cdc5c2 ("perf parse-events: Handle uncore event aliases in small groups properly")
    Reviewed-by: Andi Kleen <ak@linux.intel.com>
    Signed-off-by: Ian Rogers <irogers@google.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
    Cc: Asaf Yaffe <asaf.yaffe@intel.com>
    Cc: Caleb Biggers <caleb.biggers@intel.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Clark <james.clark@arm.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: John Garry <john.garry@huawei.com>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Perry Taylor <perry.taylor@intel.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: Vineet Singh <vineet.singh@intel.com>
    Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
    Link: https://lore.kernel.org/r/20220205010941.1065469-1-irogers@google.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    captain5050 authored and Arnaldo Carvalho de Melo committed Feb 6, 2022
  12. perf tools: Apply correct label to user/kernel symbols in branch mode

    In branch mode, the branch symbols were being displayed with incorrect
    cpumode labels. So fix this.
    
    For example, before:
      # perf record -b -a -- sleep 1
      # perf report -b
    
      Overhead  Command  Source Shared Object  Source Symbol               Target Symbol
         0.08%  swapper  [kernel.kallsyms]     [k] rcu_idle_enter          [k] cpuidle_enter_state
     ==> 0.08%  cmd0     [kernel.kallsyms]     [.] psi_group_change        [.] psi_group_change
         0.08%  cmd1     [kernel.kallsyms]     [k] psi_group_change        [k] psi_group_change
    
    After:
      # perf report -b
    
      Overhead  Command  Source Shared Object  Source Symbol               Target Symbol
         0.08%  swapper  [kernel.kallsyms]     [k] rcu_idle_enter          [k] cpuidle_enter_state
         0.08%  cmd0     [kernel.kallsyms]     [k] psi_group_change        [k] pei_group_change
         0.08%  cmd1     [kernel.kallsyms]     [k] psi_group_change        [k] psi_group_change
    
    Reviewed-by: James Clark <james.clark@arm.com>
    Signed-off-by: German Gomez <german.gomez@arm.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: https://lore.kernel.org/r/20220126105927.3411216-1-german.gomez@arm.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    germangb authored and Arnaldo Carvalho de Melo committed Feb 6, 2022
Older