Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v9 00/23] perf python: Modernize and extend Python API (Phase 1)
From: Ian Rogers @ 2026-05-25 22:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: namhyung, adrian.hunter, alice.mei.rogers, dapeng1.mi,
	james.clark, leo.yan, linux-arm-kernel, linux-kernel,
	linux-perf-users, mingo, peterz, tmricht
In-Reply-To: <ahSuZCJCQa4tE5aN@x1>

On Mon, May 25, 2026 at 1:17 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> On Mon, May 25, 2026 at 05:14:25PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Fri, May 22, 2026 at 03:04:11PM -0700, Ian Rogers wrote:
> > > This series takes a different approach with some initial implementation posted
> > > as an RFC last October:
> > > https://lore.kernel.org/linux-perf-users/20251029053413.355154-1-irogers@google.com/
> > > with the motivation coming up on the mailing list earlier:
> > > https://lore.kernel.org/lkml/CAP-5=fWDqE8SYfOLZkg_0=4Ayx6E7O+h7uUp4NDeCFkiN4b7-w@mail.gmail.com/
>
> > > The ultimate goal is to remove the embedded libpython and libperl support from
> > > perf entirely, expanding the existing perf Python module to provide full access
> > > to perf data files and events, allowing scripts to be run as standalone Python
> > > applications.
>
> > I tried applying it now and got this:
>
> > Cover: ./v9_20260522_irogers_perf_python_modernize_and_extend_python_api_phase_1.cover
> >  Link: https://lore.kernel.org/r/20260522220435.2378363-1-irogers@google.com
> >  Base: not specified
> >        git am ./v9_20260522_irogers_perf_python_modernize_and_extend_python_api_phase_1.mbx
> > ⬢ [acme@toolbx perf-tools-next2]$        git am ./v9_20260522_irogers_perf_python_modernize_and_extend_python_api_phase_1.mbx
> > Applying: perf arch arm: Sort includes and add missed explicit dependencies
> > Applying: perf arch x86: Sort includes and add missed explicit dependencies
> > Applying: perf tests: Sort includes and add missed explicit dependencies
> > Applying: perf script: Sort includes and add missed explicit dependencies
> > Applying: perf util: Sort includes and add missed explicit dependencies
> > error: patch failed: tools/perf/util/evsel.c:11
> > error: tools/perf/util/evsel.c: patch does not apply
> > Patch failed at 0005 perf util: Sort includes and add missed explicit dependencies
> > hint: Use 'git am --show-current-patch=diff' to see the failed patch
> > hint: When you have resolved this problem, run "git am --continue".
> > hint: If you prefer to skip this patch, run "git am --skip" instead.
> > hint: To restore the original branch and stop patching, run "git am --abort".
> > hint: Disable this message with "git config set advice.mergeConflict false"
> > ⬢ [acme@toolbx perf-tools-next2]$ git am --abort
> > ⬢ [acme@toolbx perf-tools-next2]$ git diff
> > ⬢ [acme@toolbx perf-tools-next2]$
>
> > I agree with the intent and plan on reviewing and testing it.
>
> What I have now is at tmp.perf-tools-next if you wish to rebase from
> there,

Thanks Arnaldo, I'll do that.

Ian

> Regards,
>
> - Arnaldo


^ permalink raw reply

* Re: [PATCH v2] pwm: imx27: Fix variable truncation in .apply()
From: Ronaldo Nunez @ 2026-05-26  0:14 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-pwm, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, imx, linux-arm-kernel, linux-kernel
In-Reply-To: <ahHV_GIwdWvTu-ms@monoceros>

Hi Uwe,

On Sat, May 23, 2026 at 06:55:40PM +0200, Uwe Kleine-König wrote:
> . I haven't made up my mind if I create another pull request to get the
> patches from the pwm/fixes branch into 7.1. If not, it will go into
> 7.2-rc1.

Sounds good, thanks.

> Sashiko found a few more issues in the imx27 driver, would you like to
> address these, too?

Yes, I'm already taking a look on those issues.

Best,
Ronaldo


^ permalink raw reply

* Re: sunxi: Watchdog reboot fails on Allwinner R40 after Linux boot
From: Fabio Estevam @ 2026-05-26  0:24 UTC (permalink / raw)
  To: Guenter Roeck, wens, Jernej Skrabec, Samuel Holland,
	Andre Przywara
  Cc: moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-sunxi, linux-watchdog, Otavio Salvador
In-Reply-To: <CAOMZO5AHK2FF1_wws3wQsJs5ofvjn2JpQmk3of+p1+ExL8h+ew@mail.gmail.com>

On Sun, May 24, 2026 at 9:41 AM Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi,
>
> I am seeing a reboot failure on an Allwinner R40-based board
> (Boardcon EMA40i) running mainline Linux v6.18 or also 7.1.0-rc4-next-20260522.
> This board hasn't been upstreamed yet, but I plan to do so soon.
>
> The board reboots correctly from U-Boot 2026.04 using the sunxi watchdog,
> but Linux fails to reboot even when programming the watchdog
> registers with the exact same values used by U-Boot.

This is solved now. The problem was that the X32KIN R40 pin was not
getting a 32kHz
from the external PCF8563 CLKOUT pin.


^ permalink raw reply

* Re: [PATCH v9 01/23] perf arch arm: Sort includes and add missed explicit dependencies
From: Namhyung Kim @ 2026-05-26  0:34 UTC (permalink / raw)
  To: Ian Rogers
  Cc: acme, adrian.hunter, alice.mei.rogers, dapeng1.mi, james.clark,
	leo.yan, linux-arm-kernel, linux-kernel, linux-perf-users, mingo,
	peterz, tmricht
In-Reply-To: <20260522220435.2378363-2-irogers@google.com>

On Fri, May 22, 2026 at 03:04:12PM -0700, Ian Rogers wrote:
> Fix missing #includes found while cleaning the evsel/evlist header
> files. Sort the remaining header files for consistency with the rest
> of the code.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/arch/arm/util/cs-etm.c | 26 ++++++++++++++------------
>  1 file changed, 14 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
> index b7a839de8707..cdf8e3e60606 100644
> --- a/tools/perf/arch/arm/util/cs-etm.c
> +++ b/tools/perf/arch/arm/util/cs-etm.c
> @@ -3,10 +3,13 @@
>   * Copyright(C) 2015 Linaro Limited. All rights reserved.
>   * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
>   */
> +#include "../../../util/cs-etm.h"
> +
> +#include <errno.h>
> +#include <stdlib.h>
>  
> -#include <api/fs/fs.h>
> -#include <linux/bits.h>
>  #include <linux/bitops.h>
> +#include <linux/bits.h>
>  #include <linux/compiler.h>
>  #include <linux/coresight-pmu.h>
>  #include <linux/kernel.h>
> @@ -14,25 +17,24 @@
>  #include <linux/string.h>
>  #include <linux/types.h>
>  #include <linux/zalloc.h>
> +#include <sys/stat.h>
> +
> +#include <api/fs/fs.h>
> +#include <internal/lib.h> // page_size
>  
> -#include "cs-etm.h"
> -#include "../../../util/debug.h"
> -#include "../../../util/record.h"
>  #include "../../../util/auxtrace.h"
>  #include "../../../util/cpumap.h"
> +#include "../../../util/debug.h"
>  #include "../../../util/event.h"
>  #include "../../../util/evlist.h"
>  #include "../../../util/evsel.h"
> -#include "../../../util/perf_api_probe.h"
>  #include "../../../util/evsel_config.h"
> +#include "../../../util/perf_api_probe.h"
> +#include "../../../util/pmu.h"
>  #include "../../../util/pmus.h"
> -#include "../../../util/cs-etm.h"
> -#include <internal/lib.h> // page_size
> +#include "../../../util/record.h"
>  #include "../../../util/session.h"
> -
> -#include <errno.h>
> -#include <stdlib.h>
> -#include <sys/stat.h>
> +#include "cs-etm.h"
>  
>  struct cs_etm_recording {
>  	struct auxtrace_record	itr;
> -- 
> 2.54.0.794.g4f17f83d09-goog
> 


^ permalink raw reply

* Re: [PATCH v9 02/23] perf arch x86: Sort includes and add missed explicit dependencies
From: Namhyung Kim @ 2026-05-26  0:34 UTC (permalink / raw)
  To: Ian Rogers
  Cc: acme, adrian.hunter, alice.mei.rogers, dapeng1.mi, james.clark,
	leo.yan, linux-arm-kernel, linux-kernel, linux-perf-users, mingo,
	peterz, tmricht
In-Reply-To: <20260522220435.2378363-3-irogers@google.com>

On Fri, May 22, 2026 at 03:04:13PM -0700, Ian Rogers wrote:
> Fix missing #includes found while cleaning the evsel/evlist header
> files. Sort the remaining header files for consistency with the rest
> of the code.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/arch/x86/util/intel-bts.c | 20 +++++++++++--------
>  tools/perf/arch/x86/util/intel-pt.c  | 29 +++++++++++++++-------------
>  2 files changed, 28 insertions(+), 21 deletions(-)
> 
> diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c
> index 85c8186300c8..100a23d27998 100644
> --- a/tools/perf/arch/x86/util/intel-bts.c
> +++ b/tools/perf/arch/x86/util/intel-bts.c
> @@ -4,26 +4,30 @@
>   * Copyright (c) 2013-2015, Intel Corporation.
>   */
>  
> +#include "../../../util/intel-bts.h"
> +
>  #include <errno.h>
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> +
>  #include <linux/bitops.h>
> +#include <linux/kernel.h>
>  #include <linux/log2.h>
> +#include <linux/types.h>
>  #include <linux/zalloc.h>
>  
> +#include <internal/lib.h> // page_size
> +
> +#include "../../../util/auxtrace.h"
>  #include "../../../util/cpumap.h"
> +#include "../../../util/debug.h"
>  #include "../../../util/event.h"
> -#include "../../../util/evsel.h"
>  #include "../../../util/evlist.h"
> +#include "../../../util/evsel.h"
>  #include "../../../util/mmap.h"
> -#include "../../../util/session.h"
> +#include "../../../util/pmu.h"
>  #include "../../../util/pmus.h"
> -#include "../../../util/debug.h"
>  #include "../../../util/record.h"
> +#include "../../../util/session.h"
>  #include "../../../util/tsc.h"
> -#include "../../../util/auxtrace.h"
> -#include "../../../util/intel-bts.h"
> -#include <internal/lib.h> // page_size
>  
>  #define KiB(x) ((x) * 1024)
>  #define MiB(x) ((x) * 1024 * 1024)
> diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
> index c131a727774f..0307ff15d9fc 100644
> --- a/tools/perf/arch/x86/util/intel-pt.c
> +++ b/tools/perf/arch/x86/util/intel-pt.c
> @@ -3,36 +3,39 @@
>   * intel_pt.c: Intel Processor Trace support
>   * Copyright (c) 2013-2015, Intel Corporation.
>   */
> +#include "../../../util/intel-pt.h"
>  
>  #include <errno.h>
>  #include <stdbool.h>
> -#include <linux/kernel.h>
> -#include <linux/types.h>
> +
>  #include <linux/bitops.h>
> +#include <linux/err.h>
> +#include <linux/kernel.h>
>  #include <linux/log2.h>
> +#include <linux/types.h>
>  #include <linux/zalloc.h>
> -#include <linux/err.h>
>  
> -#include "../../../util/session.h"
> +#include <api/fs/fs.h>
> +#include <internal/lib.h> // page_size
> +#include <subcmd/parse-options.h>
> +
> +#include "../../../util/auxtrace.h"
> +#include "../../../util/config.h"
> +#include "../../../util/cpumap.h"
> +#include "../../../util/debug.h"
>  #include "../../../util/event.h"
>  #include "../../../util/evlist.h"
>  #include "../../../util/evsel.h"
>  #include "../../../util/evsel_config.h"
> -#include "../../../util/config.h"
> -#include "../../../util/cpumap.h"
>  #include "../../../util/mmap.h"
> -#include <subcmd/parse-options.h>
>  #include "../../../util/parse-events.h"
> -#include "../../../util/pmus.h"
> -#include "../../../util/debug.h"
> -#include "../../../util/auxtrace.h"
>  #include "../../../util/perf_api_probe.h"
> +#include "../../../util/pmu.h"
> +#include "../../../util/pmus.h"
>  #include "../../../util/record.h"
> +#include "../../../util/session.h"
>  #include "../../../util/target.h"
>  #include "../../../util/tsc.h"
> -#include <internal/lib.h> // page_size
> -#include "../../../util/intel-pt.h"
> -#include <api/fs/fs.h>
>  #include "cpuid.h"
>  
>  #define KiB(x) ((x) * 1024)
> -- 
> 2.54.0.794.g4f17f83d09-goog
> 


^ permalink raw reply

* Re: [PATCH v9 03/23] perf tests: Sort includes and add missed explicit dependencies
From: Namhyung Kim @ 2026-05-26  0:35 UTC (permalink / raw)
  To: Ian Rogers
  Cc: acme, adrian.hunter, alice.mei.rogers, dapeng1.mi, james.clark,
	leo.yan, linux-arm-kernel, linux-kernel, linux-perf-users, mingo,
	peterz, tmricht
In-Reply-To: <20260522220435.2378363-4-irogers@google.com>

On Fri, May 22, 2026 at 03:04:14PM -0700, Ian Rogers wrote:
> Fix missing #includes found while cleaning the evsel/evlist header
> files. Sort the remaining header files for consistency with the rest
> of the code.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/tests/hwmon_pmu.c  | 14 +++++++++-----
>  tools/perf/tests/mmap-basic.c | 18 +++++++++++-------
>  2 files changed, 20 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/perf/tests/hwmon_pmu.c b/tools/perf/tests/hwmon_pmu.c
> index 4aa4aac94f09..ada6e445c4c4 100644
> --- a/tools/perf/tests/hwmon_pmu.c
> +++ b/tools/perf/tests/hwmon_pmu.c
> @@ -1,15 +1,19 @@
>  // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
> -#include "debug.h"
> -#include "evlist.h"
>  #include "hwmon_pmu.h"
> -#include "parse-events.h"
> -#include "tests.h"
> +
>  #include <errno.h>
> +
>  #include <fcntl.h>
> -#include <sys/stat.h>
>  #include <linux/compiler.h>
>  #include <linux/kernel.h>
>  #include <linux/string.h>
> +#include <sys/stat.h>
> +
> +#include "debug.h"
> +#include "evlist.h"
> +#include "parse-events.h"
> +#include "pmus.h"
> +#include "tests.h"
>  
>  static const struct test_event {
>  	const char *name;
> diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
> index a18d84d858aa..a69cd1046e9a 100644
> --- a/tools/perf/tests/mmap-basic.c
> +++ b/tools/perf/tests/mmap-basic.c
> @@ -1,25 +1,29 @@
>  // SPDX-License-Identifier: GPL-2.0
>  #include <errno.h>
> -#include <fcntl.h>
>  #include <inttypes.h>
>  #include <stdlib.h>
> +
> +#include <fcntl.h>
> +#include <linux/err.h>
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +
>  #include <perf/cpumap.h>
> +#include <perf/evlist.h>
> +#include <perf/mmap.h>
>  
>  #include "cpumap.h"
>  #include "debug.h"
>  #include "event.h"
>  #include "evlist.h"
>  #include "evsel.h"
> -#include "thread_map.h"
> +#include "pmu.h"
> +#include "pmus.h"
>  #include "tests.h"
> +#include "thread_map.h"
>  #include "util/affinity.h"
>  #include "util/mmap.h"
>  #include "util/sample.h"
> -#include <linux/err.h>
> -#include <linux/kernel.h>
> -#include <linux/string.h>
> -#include <perf/evlist.h>
> -#include <perf/mmap.h>
>  
>  /*
>   * This test will generate random numbers of calls to some getpid syscalls,
> -- 
> 2.54.0.794.g4f17f83d09-goog
> 


^ permalink raw reply

* Re: [PATCH v9 04/23] perf script: Sort includes and add missed explicit dependencies
From: Namhyung Kim @ 2026-05-26  0:35 UTC (permalink / raw)
  To: Ian Rogers
  Cc: acme, adrian.hunter, alice.mei.rogers, dapeng1.mi, james.clark,
	leo.yan, linux-arm-kernel, linux-kernel, linux-perf-users, mingo,
	peterz, tmricht
In-Reply-To: <20260522220435.2378363-5-irogers@google.com>

On Fri, May 22, 2026 at 03:04:15PM -0700, Ian Rogers wrote:
> Fix missing #include of pmu.h found while cleaning the evsel/evlist
> header files. Sort the remaining header files for consistency with the
> rest of the code. Doing this exposed a missing forward declaration of
> addr_location in print_insn.h, add this and sort the forward
> declarations.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/builtin-script.c  | 111 ++++++++++++++++++-----------------
>  tools/perf/util/print_insn.h |   5 +-
>  2 files changed, 60 insertions(+), 56 deletions(-)
> 
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index c0918006e0ab..e330ae7f725e 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -1,75 +1,78 @@
>  // SPDX-License-Identifier: GPL-2.0
> -#include "builtin.h"
> +#include <errno.h>
> +#include <inttypes.h>
> +#include <signal.h>
> +#include <stdio.h>
> +
> +#include <dirent.h>
> +#include <fcntl.h>
> +#include <linux/bitmap.h>
> +#include <linux/compiler.h>
> +#include <linux/ctype.h>
> +#include <linux/err.h>
> +#include <linux/kernel.h>
> +#include <linux/stringify.h>
> +#include <linux/time64.h>
> +#include <linux/unaligned.h>
> +#include <linux/zalloc.h>
> +#include <sys/param.h>
> +#include <sys/stat.h>
> +#include <sys/types.h>
> +#include <sys/utsname.h>
> +#include <unistd.h>
>  
> +#include <perf/evlist.h>
> +#include <subcmd/exec-cmd.h>
> +#include <subcmd/pager.h>
> +#include <subcmd/parse-options.h>
> +
> +#include "asm/bug.h"
> +#include "builtin.h"
> +#include "perf.h"
> +#include "print_binary.h"
> +#include "print_insn.h"
> +#include "ui/ui.h"
> +#include "util/annotate.h"
> +#include "util/auxtrace.h"
> +#include "util/cgroup.h"
> +#include "util/color.h"
>  #include "util/counts.h"
> +#include "util/cpumap.h"
> +#include "util/data.h"
>  #include "util/debug.h"
> +#include "util/dlfilter.h"
>  #include "util/dso.h"
> -#include <subcmd/exec-cmd.h>
> -#include "util/header.h"
> -#include <subcmd/parse-options.h>
> -#include "util/perf_regs.h"
> -#include "util/session.h"
> -#include "util/tool.h"
> -#include "util/map.h"
> -#include "util/srcline.h"
> -#include "util/symbol.h"
> -#include "util/thread.h"
> -#include "util/trace-event.h"
> +#include "util/dump-insn.h"
>  #include "util/env.h"
> +#include "util/event.h"
>  #include "util/evlist.h"
>  #include "util/evsel.h"
>  #include "util/evsel_fprintf.h"
>  #include "util/evswitch.h"
> +#include "util/header.h"
> +#include "util/map.h"
> +#include "util/mem-events.h"
> +#include "util/mem-info.h"
> +#include "util/metricgroup.h"
> +#include "util/path.h"
> +#include "util/perf_regs.h"
> +#include "util/pmu.h"
> +#include "util/record.h"
> +#include "util/session.h"
>  #include "util/sort.h"
> -#include "util/data.h"
> -#include "util/auxtrace.h"
> -#include "util/cpumap.h"
> -#include "util/thread_map.h"
> +#include "util/srcline.h"
>  #include "util/stat.h"
> -#include "util/color.h"
>  #include "util/string2.h"
> +#include "util/symbol.h"
>  #include "util/thread-stack.h"
> +#include "util/thread.h"
> +#include "util/thread_map.h"
>  #include "util/time-utils.h"
> -#include "util/path.h"
> -#include "util/event.h"
> -#include "util/mem-info.h"
> -#include "util/metricgroup.h"
> -#include "ui/ui.h"
> -#include "print_binary.h"
> -#include "print_insn.h"
> -#include <linux/bitmap.h>
> -#include <linux/compiler.h>
> -#include <linux/kernel.h>
> -#include <linux/stringify.h>
> -#include <linux/time64.h>
> -#include <linux/zalloc.h>
> -#include <linux/unaligned.h>
> -#include <sys/utsname.h>
> -#include "asm/bug.h"
> -#include "util/mem-events.h"
> -#include "util/dump-insn.h"
> -#include <dirent.h>
> -#include <errno.h>
> -#include <inttypes.h>
> -#include <signal.h>
> -#include <stdio.h>
> -#include <sys/param.h>
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <unistd.h>
> -#include <subcmd/pager.h>
> -#include <perf/evlist.h>
> -#include <linux/err.h>
> -#include "util/dlfilter.h"
> -#include "util/record.h"
> +#include "util/tool.h"
> +#include "util/trace-event.h"
>  #include "util/unwind.h"
>  #include "util/util.h"
> -#include "util/cgroup.h"
> -#include "util/annotate.h"
> -#include "perf.h"
>  
> -#include <linux/ctype.h>
>  #ifdef HAVE_LIBTRACEEVENT
>  #include <event-parse.h>
>  #endif
> diff --git a/tools/perf/util/print_insn.h b/tools/perf/util/print_insn.h
> index 07d11af3fc1c..a54f7e858e49 100644
> --- a/tools/perf/util/print_insn.h
> +++ b/tools/perf/util/print_insn.h
> @@ -5,10 +5,11 @@
>  #include <stddef.h>
>  #include <stdio.h>
>  
> -struct perf_sample;
> -struct thread;
> +struct addr_location;
>  struct machine;
>  struct perf_insn;
> +struct perf_sample;
> +struct thread;
>  
>  #define PRINT_INSN_IMM_HEX		(1<<0)
>  
> -- 
> 2.54.0.794.g4f17f83d09-goog
> 


^ permalink raw reply

* Re: [PATCH v9 05/23] perf util: Sort includes and add missed explicit dependencies
From: Namhyung Kim @ 2026-05-26  0:36 UTC (permalink / raw)
  To: Ian Rogers
  Cc: acme, adrian.hunter, alice.mei.rogers, dapeng1.mi, james.clark,
	leo.yan, linux-arm-kernel, linux-kernel, linux-perf-users, mingo,
	peterz, tmricht
In-Reply-To: <20260522220435.2378363-6-irogers@google.com>

On Fri, May 22, 2026 at 03:04:16PM -0700, Ian Rogers wrote:
> Fix missing includes found while cleaning the evsel/evlist header
> files. Sort the remaining header files for consistency with the rest
> of the code.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/util/bpf_off_cpu.c       | 30 +++++-----
>  tools/perf/util/bpf_trace_augment.c |  8 +--
>  tools/perf/util/evlist.c            | 91 +++++++++++++++--------------
>  tools/perf/util/evsel.c             | 75 ++++++++++++------------
>  tools/perf/util/map.h               |  9 ++-
>  tools/perf/util/perf_api_probe.c    | 18 +++---
>  tools/perf/util/s390-sample-raw.c   | 19 +++---
>  tools/perf/util/stat-shadow.c       | 20 ++++---
>  tools/perf/util/stat.c              | 16 +++--
>  9 files changed, 152 insertions(+), 134 deletions(-)


^ permalink raw reply

* Re: [PATCH v9 07/23] perf evsel/evlist: Avoid unnecessary #includes
From: Namhyung Kim @ 2026-05-26  0:38 UTC (permalink / raw)
  To: Ian Rogers
  Cc: acme, adrian.hunter, alice.mei.rogers, dapeng1.mi, james.clark,
	leo.yan, linux-arm-kernel, linux-kernel, linux-perf-users, mingo,
	peterz, tmricht
In-Reply-To: <20260522220435.2378363-8-irogers@google.com>

On Fri, May 22, 2026 at 03:04:18PM -0700, Ian Rogers wrote:
> Use forward declarations and remove unnecessary #includes in
> evsel.h. Sort the forward declarations in evsel.h and evlist.h.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> ---
>  tools/perf/util/evlist.h | 15 +++++++++------
>  tools/perf/util/evsel.h  | 20 +++++++++++---------
>  2 files changed, 20 insertions(+), 15 deletions(-)
> 
> diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
> index e507f5f20ef6..e54761c670b6 100644
> --- a/tools/perf/util/evlist.h
> +++ b/tools/perf/util/evlist.h
> @@ -2,29 +2,32 @@
>  #ifndef __PERF_EVLIST_H
>  #define __PERF_EVLIST_H 1
>  
> +#include <signal.h>
> +
>  #include <linux/compiler.h>
>  #include <linux/kernel.h>
> -#include <linux/refcount.h>
>  #include <linux/list.h>
> +#include <linux/refcount.h>
> +#include <pthread.h>
> +#include <unistd.h>
> +
>  #include <api/fd/array.h>
>  #include <internal/evlist.h>
>  #include <internal/evsel.h>
>  #include <perf/evlist.h>
> +
>  #include "affinity.h"
>  #include "events_stats.h"
>  #include "evsel.h"
>  #include "rblist.h"
> -#include <pthread.h>
> -#include <signal.h>
> -#include <unistd.h>
>  
> -struct pollfd;
> -struct thread_map;
>  struct perf_cpu_map;
>  struct perf_stat_config;
> +struct pollfd;
>  struct record_opts;
>  struct strbuf;
>  struct target;
> +struct thread_map;
>  
>  /*
>   * State machine of bkw_mmap_state:
> diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
> index 927e5b4756cc..2221694bb819 100644
> --- a/tools/perf/util/evsel.h
> +++ b/tools/perf/util/evsel.h
> @@ -2,28 +2,30 @@
>  #ifndef __PERF_EVSEL_H
>  #define __PERF_EVSEL_H 1
>  
> -#include <linux/list.h>
>  #include <stdbool.h>
> -#include <sys/types.h>
> +
> +#include <linux/list.h>
>  #include <linux/perf_event.h>
>  #include <linux/types.h>
> +#include <sys/types.h>
> +
>  #include <internal/evsel.h>
>  #include <perf/evsel.h>
> +
>  #include "symbol_conf.h"
> -#include "pmus.h"
> -#include "pmu.h"
>  
> +struct bperf_follower_bpf;
> +struct bperf_leader_bpf;
> +struct bpf_counter_ops;
>  struct bpf_object;
>  struct cgroup;
> +struct hashmap;
>  struct perf_counts;
> +struct perf_pmu;
>  struct perf_stat_config;
>  struct perf_stat_evsel;
> -union perf_event;
> -struct bpf_counter_ops;
>  struct target;
> -struct hashmap;
> -struct bperf_leader_bpf;
> -struct bperf_follower_bpf;
> +union perf_event;
>  
>  typedef int (evsel__sb_cb_t)(union perf_event *event, void *data);
>  
> -- 
> 2.54.0.794.g4f17f83d09-goog
> 


^ permalink raw reply

* RE: [PATCH 2/5] remoteproc: imx_rpoc: fix carveout name parsing
From: Peng Fan @ 2026-05-26  0:42 UTC (permalink / raw)
  To: Laurentiu Mihalcea, Peng Fan (OSS)
  Cc: Bjorn Andersson, Mathieu Poirier, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
	Fabio Estevam, Pengutronix Kernel Team,
	linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <9fb59c65-8cee-4502-bc10-1375f276e25c@gmail.com>

> Subject: Re: [PATCH 2/5] remoteproc: imx_rpoc: fix carveout name
> parsing
> 
> 
> 
> On 5/24/2026 7:13 PM, Peng Fan wrote:
> > On Fri, May 22, 2026 at 04:18:46AM -0700, Laurentiu Mihalcea
> wrote:
> >> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >>
> >> The imx remoteproc driver assumes that the names of the reserved
> >> memory regions reflect their usage (e.g. "vdevbuffer", "vdev0vring0",
> >> etc.). This conflicts with the devicetree specification's
> >> recommendation, which states that the names of the devicetree
> nodes should be generic.
> >>
> >> Therefore, instead of relying on the node names, use the names
> passed
> >> via the "memory-region-names" property if present. Otherwise,
> keep
> >> the old behavior.
> >>
> >> The definition of imx_rproc_rmem_to_resource() is added to a
> common
> >> place as imx_dsp_rproc.c can also use it given that it suffers from
> >> the same aforementioned problem.
> >>
> >> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> >> ---
> >> drivers/remoteproc/imx_rproc.c |  7 +++++--
> >> drivers/remoteproc/imx_rproc.h | 19 +++++++++++++++++++
> >> 2 files changed, 24 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/remoteproc/imx_rproc.c
> >> b/drivers/remoteproc/imx_rproc.c index
> 7f54322244ac..1ee1c658dcc1
> >> 100644
> >> --- a/drivers/remoteproc/imx_rproc.c
> >> +++ b/drivers/remoteproc/imx_rproc.c
> >> @@ -672,7 +672,7 @@ static int imx_rproc_prepare(struct rproc
> *rproc)
> >> 		int err;
> >> 		struct resource res;
> >>
> >> -		err = of_reserved_mem_region_to_resource(np, i++,
> &res);
> >> +		err = imx_rproc_rmem_to_resource(np, i++, &res);
> >> 		if (err)
> >> 			break;
> >>
> >> @@ -850,11 +850,14 @@ static int imx_rproc_addr_init(struct
> imx_rproc *priv,
> >> 	if (nph <= 0)
> >> 		return 0;
> >>
> >> +	if (!of_property_present(np, "memory-region-names"))
> >> +		dev_warn(dev, "using node names for carveouts
> should be
> >> +avoided\n");
> >
> > Please check 'memory-regions && !memory-region-names', some
> demos may
> > not need to use memory regions.
> >
> > Regards
> > Peng
> >
> 
> What for? You'll not reach this check unless "memory-regions" is
> specified?

Sorry, ignore my last comment.

Thanks,
Peng.


^ permalink raw reply

* Re: [PATCH v8 01/10] dt-bindings: display: rockchip: analogix-dp: Fix hclk as third clock for RK3588
From: Damon Ding @ 2026-05-26  0:54 UTC (permalink / raw)
  To: Conor Dooley
  Cc: hjc, heiko, andy.yan, maarten.lankhorst, mripard, tzimmermann,
	airlied, simona, robh, krzk+dt, conor+dt, andrzej.hajda,
	neil.armstrong, rfoss, Laurent.pinchart, jonas, jernej.skrabec,
	nicolas.frattaroli, cristian.ciocaltea, sebastian.reichel,
	dmitry.baryshkov, luca.ceresoli, dianders, m.szyprowski,
	dri-devel, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel
In-Reply-To: <20260525-ominous-hurling-c24874030f5a@spud>

Hi Conor,

On 5/26/2026 12:54 AM, Conor Dooley wrote:
> On Mon, May 25, 2026 at 08:53:22PM +0800, Damon Ding wrote:
>> RK3588 eDP controller requires HCLK_VO1 to access the VO1 GRF
>> registers and enable the video datapath.
>>
>> Previously, the clock was enabled implicitly via the 'rockchip,vo-grf'
>> phandle reference, which allowed the eDP to work without explicitly
>> managing the hclk_vo1 clock. However, this is not safe or explicit.
>>
>> To make the clock dependency explicit, enforce per-SoC clock-names
>> requirements:
>>   - RK3288: 2 clocks (dp, pclk)
>>   - RK3399: 3 clocks (dp, pclk, grf)
>>   - RK3588: 3 clocks (dp, pclk, hclk)
>>
>> Do not reuse the 'grf' clock name for RK3588 because it represents
>> a different clock with distinct control logic:
>> - The 'grf' clock is only for GRF register access and is toggled
>>    dynamically during register access.
>> - The 'hclk' clock controls both GRF access and video datapath
>>    gating, and must remain enabled during probe.
>>
>> Fixes: f855146263b1 ("dt-bindings: display: rockchip: analogix-dp: Add support for RK3588")
>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>>
>> ---
>>
>> Changes in v4:
>> - Modify the commit msg.
>>
>> Changes in v5:
>> - Enforce the correct third clock name on a per-compatible basis.
>> - Modify the commit msg simultaneously.
>>
>> Changes in v6:
>> - Expand more detail commit msg about using hclk instead of grf clock.
>>
>> Changes in v7:
>> - List all valid clock names at the top level, and constrain the clock
>>    count for each platform with minItems/maxItems in allOf.
>>
>> Changes in v8:
>> - Fix indentation to 10 for enum in clock-names property.
>> ---
>>   .../rockchip/rockchip,analogix-dp.yaml        | 34 ++++++++++++++++++-
>>   1 file changed, 33 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml
>> index d99b23b88cc5..a1ab7a77bdd3 100644
>> --- a/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml
>> +++ b/Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml
>> @@ -26,7 +26,9 @@ properties:
>>       items:
>>         - const: dp
>>         - const: pclk
>> -      - const: grf
>> +      - enum:
>> +          - grf
>> +          - hclk
>>   
>>     power-domains:
>>       maxItems: 1
>> @@ -60,6 +62,32 @@ required:
>>   allOf:
>>     - $ref: /schemas/display/bridge/analogix,dp.yaml#
>>   
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            enum:
>> +              - rockchip,rk3288-dp
>> +    then:
>> +      properties:
>> +        clocks:
>> +          maxItems: 2
>> +        clock-names:
>> +          maxItems: 2
>> +
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            enum:
>> +              - rockchip,rk3399-edp
>> +    then:
>> +      properties:
>> +        clocks:
>> +          minItems: 3
>> +        clock-names:
>> +          minItems: 3
> 
> If you go back to v6, you'll see that I never asked you to remove the
> explict clock-names from here or below. Only the one from the 3288
> section. The minItems was an addition, not a replacement.
> 
> pw-bot: changes-requested
> 

Sorry for the misunderstanding. I will restore the explicit clock-names 
definitions and fix this in next version.

Best regards,
Damon

> 
>> +
>>     - if:
>>         properties:
>>           compatible:
>> @@ -68,6 +96,10 @@ allOf:
>>                 - rockchip,rk3588-edp
>>       then:
>>         properties:
>> +        clocks:
>> +          minItems: 3
>> +        clock-names:
>> +          minItems: 3
>>           resets:
>>             minItems: 2
>>           reset-names:
>> -- 
>> 2.34.1
>>
>>



^ permalink raw reply

* [PATCH] arm64: kernel: Disable CNP on HiSilicon HIP09
From: Zeng Heng @ 2026-05-26  1:57 UTC (permalink / raw)
  To: corbet, kuninori.morimoto.gx, maz, oupton, catalin.marinas,
	lucaswei, yeoreum.yun, skhan, james.clark, broonie, mark.rutland,
	lpieralisi, ryan.roberts, will, tongtiangen, kevin.brodsky,
	yangyicong, miko.lenczewski
  Cc: linux-doc, wangkefeng.wang, linux-kernel, linux-arm-kernel

From: Tong Tiangen <tongtiangen@huawei.com>

HiSilicon HIP09 implements TLB entry matching behavior that deviates
from the ARM architecture specification when the CNP (Common not Private)
bit is set in TTBRx_ELx.

When TTBRx.CNP=1, TLB entries may be incorrectly shared between CPU
cores, leading to TLB conflicts and stale mappings. This affects
coherency and can result in incorrect translations.

Add the hardware erratum workaround (Hisilicon erratum 162100125) to
disable CNP on affected HIP09 cores.

Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
 Documentation/arch/arm64/silicon-errata.rst |  2 ++
 arch/arm64/Kconfig                          | 15 +++++++++++++++
 arch/arm64/kernel/cpu_errata.c              |  7 +++++++
 arch/arm64/kernel/cpufeature.c              |  3 ++-
 arch/arm64/tools/cpucaps                    |  1 +
 5 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst
index 211119ce7adc..cd50059edb85 100644
--- a/Documentation/arch/arm64/silicon-errata.rst
+++ b/Documentation/arch/arm64/silicon-errata.rst
@@ -284,6 +284,8 @@ stable kernels.
 +----------------+-----------------+-----------------+-----------------------------+
 | Hisilicon      | Hip09           | #162100801      | HISILICON_ERRATUM_162100801 |
 +----------------+-----------------+-----------------+-----------------------------+
+| Hisilicon      | Hip09           | #162100125      | HISILICON_ERRATUM_162100125 |
++----------------+-----------------+-----------------+-----------------------------+
 +----------------+-----------------+-----------------+-----------------------------+
 | Qualcomm Tech. | Kryo/Falkor v1  | E1003           | QCOM_FALKOR_ERRATUM_1003    |
 +----------------+-----------------+-----------------+-----------------------------+
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index fe60738e5943..ed6207c75b54 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1273,6 +1273,21 @@ config HISILICON_ERRATUM_162100801
 
 	  If unsure, say Y.
 
+config HISILICON_ERRATUM_162100125
+	bool "Hisilicon erratum 162100125"
+	default y
+	help
+	  On HiSilicon HIP09, TLB entry matching behavior when CNP
+	  (TTBRx.CNP=1) is enabled differs from the ARM architecture
+	  specification.
+
+	  TLB entries may be incorrectly shared between CPUs, potentially
+	  causing TLB conflicts and stale mappings.
+
+	  Disable CNP support for affected HiSilicon HIP09 cores.
+
+	  If unsure, say Y.
+
 config QCOM_FALKOR_ERRATUM_1003
 	bool "Falkor E1003: Incorrect translation due to ASID change"
 	default y
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index 5377e4c2eba2..26d9677a20fc 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -968,6 +968,13 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
 		.matches = has_impdef_pmuv3,
 		.cpu_enable = cpu_enable_impdef_pmuv3_traps,
 	},
+#ifdef CONFIG_HISILICON_ERRATUM_162100125
+	{
+		.desc = "Hisilicon erratum 162100125",
+		.capability = ARM64_WORKAROUND_HISILICON_ERRATUM_162100125,
+		ERRATA_MIDR_ALL_VERSIONS(MIDR_HISI_HIP09),
+	},
+#endif
 	{
 	}
 };
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 6d53bb15cf7b..c4b0db77a58a 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -1785,7 +1785,8 @@ has_useable_cnp(const struct arm64_cpu_capabilities *entry, int scope)
 	if (is_kdump_kernel())
 		return false;
 
-	if (cpus_have_cap(ARM64_WORKAROUND_NVIDIA_CARMEL_CNP))
+	if (cpus_have_cap(ARM64_WORKAROUND_NVIDIA_CARMEL_CNP) ||
+	    cpus_have_cap(ARM64_WORKAROUND_HISILICON_ERRATUM_162100125))
 		return false;
 
 	return has_cpuid_feature(entry, scope);
diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps
index 811c2479e82d..b797d4893adc 100644
--- a/arch/arm64/tools/cpucaps
+++ b/arch/arm64/tools/cpucaps
@@ -128,3 +128,4 @@ WORKAROUND_REPEAT_TLBI
 WORKAROUND_SPECULATIVE_AT
 WORKAROUND_SPECULATIVE_SSBS
 WORKAROUND_SPECULATIVE_UNPRIV_LOAD
+WORKAROUND_HISILICON_ERRATUM_162100125
-- 
2.43.0



^ permalink raw reply related

* Re: [PATCH v3 01/17] ACPI: GTDT: Account for GTDTv3 size when walking the platform timer descriptors
From: Hanjun Guo @ 2026-05-26  2:02 UTC (permalink / raw)
  To: Marc Zyngier, linux-arm-kernel, linux-acpi, linux-kernel,
	devicetree
  Cc: Lorenzo Pieralisi, Sudeep Holla, Catalin Marinas, Will Deacon,
	Rafael J. Wysocki, Mark Rutland, Daniel Lezcano, Thomas Gleixner,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, Ge Gordon,
	BST Linux Kernel Upstream Group, Jesper Nilsson, Lars Persson,
	Alim Akhtar, Ivaylo Ivanov, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dinh Nguyen,
	Matthias Brugger, AngeloGioacchino Del Regno, Thierry Reding,
	Jonathan Hunter, Bjorn Andersson, Konrad Dybcio,
	Andreas Färber, Yu-Chun Lin [林祐君],
	Heiko Stuebner, Shawn Lin, Orson Zhai, Baolin Wang, Michal Simek
In-Reply-To: <20260523140242.586031-2-maz@kernel.org>

On 2026/5/23 22:02, Marc Zyngier wrote:
> Since ARMv8.1, the architecture has grown an EL2-private virtual
> timer. This has been described in ACPI since ACPI v6.3 and revision
> 3 of the GTDT table.
> 
> An aditional structure was added in ACPICA, though in a rather
> bizarre way, and merged in v5.1 as 8f5a14d053100 ("ACPICA: ACPI 6.3:
> add GTDT Revision 3 support").
> 
> Finally plug the table parsing in GTDT, and correct the parsing of
> the platform timer subtables to account for the expanded size of
> the base table. This also comes with some extra sanitisation of
> the table, in the unlikely case someone got it wrong...
> 
> Suggested-by: Sudeep Holla <sudeep.holla@kernel.org>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
>   drivers/acpi/arm64/gtdt.c | 22 ++++++++++++++++++++--
>   1 file changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/arm64/gtdt.c b/drivers/acpi/arm64/gtdt.c
> index ffc867bac2d60..950d5efdf85ea 100644
> --- a/drivers/acpi/arm64/gtdt.c
> +++ b/drivers/acpi/arm64/gtdt.c
> @@ -34,14 +34,25 @@ struct acpi_gtdt_descriptor {
>   	void *platform_timer;
>   };
>   
> +struct gtdt_v3 {
> +	struct acpi_table_gtdt	gtdt_v2;
> +	struct acpi_gtdt_el2	el2_vtimer;
> +};
> +
>   static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
>   
>   static __init bool platform_timer_valid(void *platform_timer)
>   {
>   	struct acpi_gtdt_header *gh = platform_timer;
> +	void *platform_timer_begin;
>   
> -	return (platform_timer >= (void *)(acpi_gtdt_desc.gtdt + 1) &&
> -		platform_timer < acpi_gtdt_desc.gtdt_end &&
> +	if (acpi_gtdt_desc.gtdt->header.revision >= 3)
> +		platform_timer_begin = container_of(acpi_gtdt_desc.gtdt, struct gtdt_v3, gtdt_v2) + 1;
> +	else
> +		platform_timer_begin = acpi_gtdt_desc.gtdt + 1;
> +
> +	return (platform_timer >= platform_timer_begin &&
> +		platform_timer + sizeof(*gh) <= acpi_gtdt_desc.gtdt_end &&
>   		gh->length != 0 &&
>   		platform_timer + gh->length <= acpi_gtdt_desc.gtdt_end);
>   }
> @@ -166,6 +177,13 @@ int __init acpi_gtdt_init(struct acpi_table_header *table,
>   	u32 cnt = 0;
>   
>   	gtdt = container_of(table, struct acpi_table_gtdt, header);
> +
> +	if ((gtdt->header.revision >= 3 && gtdt->header.length < sizeof(struct gtdt_v3)) ||
> +	    (gtdt->header.revision == 2 && gtdt->header.length < sizeof(*gtdt))) {
> +		pr_err(FW_BUG "GTDT with invalid size %d\n", gtdt->header.length);
> +		return -EINVAL;
> +	}
> +
>   	acpi_gtdt_desc.gtdt = gtdt;
>   	acpi_gtdt_desc.gtdt_end = (void *)table + table->length;
>   	acpi_gtdt_desc.platform_timer = NULL;

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>

Thanks
Hanjun


^ permalink raw reply

* Re: [PATCH v3 02/17] ACPI: GTDT: Parse information related to the EL2 virtual timer
From: Hanjun Guo @ 2026-05-26  2:14 UTC (permalink / raw)
  To: Marc Zyngier, linux-arm-kernel, linux-acpi, linux-kernel,
	devicetree
  Cc: Lorenzo Pieralisi, Sudeep Holla, Catalin Marinas, Will Deacon,
	Rafael J. Wysocki, Mark Rutland, Daniel Lezcano, Thomas Gleixner,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, Ge Gordon,
	BST Linux Kernel Upstream Group, Jesper Nilsson, Lars Persson,
	Alim Akhtar, Ivaylo Ivanov, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Dinh Nguyen,
	Matthias Brugger, AngeloGioacchino Del Regno, Thierry Reding,
	Jonathan Hunter, Bjorn Andersson, Konrad Dybcio,
	Andreas Färber, Yu-Chun Lin [林祐君],
	Heiko Stuebner, Shawn Lin, Orson Zhai, Baolin Wang, Michal Simek
In-Reply-To: <20260523140242.586031-3-maz@kernel.org>

On 2026/5/23 22:02, Marc Zyngier wrote:
> Now that we have a way to identify GTDTv3, allow the information
> related to the EL2 virtual timer to be retrieved by the interface
> used by the architected timer driver.
> 
> Reviewed-by: Sudeep Holla <sudeep.holla@kernel.org>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
>   drivers/acpi/arm64/gtdt.c | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/acpi/arm64/gtdt.c b/drivers/acpi/arm64/gtdt.c
> index 950d5efdf85ea..00158c8aa6d90 100644
> --- a/drivers/acpi/arm64/gtdt.c
> +++ b/drivers/acpi/arm64/gtdt.c
> @@ -41,6 +41,14 @@ struct gtdt_v3 {
>   
>   static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata;
>   
> +static __init struct acpi_gtdt_el2 *gtdt_to_el2_vtimer(struct acpi_table_gtdt *gtdt)
> +{
> +	if (gtdt->header.revision < 3)
> +		return NULL;
> +
> +	return &container_of(gtdt, struct gtdt_v3, gtdt_v2)->el2_vtimer;
> +}
> +
>   static __init bool platform_timer_valid(void *platform_timer)
>   {
>   	struct acpi_gtdt_header *gh = platform_timer;
> @@ -112,6 +120,7 @@ static int __init map_gt_gsi(u32 interrupt, u32 flags)
>   int __init acpi_gtdt_map_ppi(int type)
>   {
>   	struct acpi_table_gtdt *gtdt = acpi_gtdt_desc.gtdt;
> +	struct acpi_gtdt_el2 *el2_vtimer = gtdt_to_el2_vtimer(gtdt);
>   
>   	switch (type) {
>   	case ARCH_TIMER_PHYS_NONSECURE_PPI:
> @@ -124,6 +133,12 @@ int __init acpi_gtdt_map_ppi(int type)
>   	case ARCH_TIMER_HYP_PPI:
>   		return map_gt_gsi(gtdt->non_secure_el2_interrupt,
>   				  gtdt->non_secure_el2_flags);
> +	case ARCH_TIMER_HYP_VIRT_PPI:
> +		if (el2_vtimer && el2_vtimer->virtual_el2_timer_gsiv)
> +			return map_gt_gsi(el2_vtimer->virtual_el2_timer_gsiv,
> +					  el2_vtimer->virtual_el2_timer_flags);
> +
> +		return 0;
>   	default:
>   		pr_err("Failed to map timer interrupt: invalid type.\n");
>   	}
> @@ -141,6 +156,7 @@ int __init acpi_gtdt_map_ppi(int type)
>   bool __init acpi_gtdt_c3stop(int type)
>   {
>   	struct acpi_table_gtdt *gtdt = acpi_gtdt_desc.gtdt;
> +	struct acpi_gtdt_el2 *el2_vtimer = gtdt_to_el2_vtimer(gtdt);
>   
>   	switch (type) {
>   	case ARCH_TIMER_PHYS_NONSECURE_PPI:
> @@ -152,6 +168,10 @@ bool __init acpi_gtdt_c3stop(int type)
>   	case ARCH_TIMER_HYP_PPI:
>   		return !(gtdt->non_secure_el2_flags & ACPI_GTDT_ALWAYS_ON);
>   
> +	case ARCH_TIMER_HYP_VIRT_PPI:
> +		return el2_vtimer && el2_vtimer->virtual_el2_timer_gsiv &&
> +		       !(el2_vtimer->virtual_el2_timer_flags & ACPI_GTDT_ALWAYS_ON);
> +
>   	default:
>   		pr_err("Failed to get c3stop info: invalid type.\n");
>   	}

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>

Thanks
Hanjun


^ permalink raw reply

* [PATCH v2] net: stmmac: fix fatal bus error on resume by reinitializing RX buffers
From: Ding Hui @ 2026-05-26  2:26 UTC (permalink / raw)
  To: andrew, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	Russell King (Oracle), Maxime Chevallier, Ding Hui,
	open list:STMMAC ETHERNET DRIVER,
	moderated list:ARM/STM32 ARCHITECTURE,
	moderated list:ARM/STM32 ARCHITECTURE, open list
  Cc: xiasanbo, yangchen11, liuxuanjun

From: Ding Hui <dinghui@lixiang.com>

On suspend, stmmac_suspend() calls stmmac_disable_all_queues() which
stops the RX NAPI, but the RX DMA engine may still be running for a
short window before stmmac_stop_all_dma() takes effect. During that
window the hardware can write incoming frames into the buffers pointed
to by the RX descriptors and write back the descriptors (clearing the
OWN bit and overwriting RDES0/1/2 with status/timestamp data). Because
NAPI is already disabled, the driver never refills these descriptors,
so the RX ring is left in a "consumed but not refilled" state with
stale content in the descriptor buffer-address fields.

On resume, stmmac_clear_descriptors() only re-arms the OWN bit and
does not repopulate the RX buffer address fields. When the DMA is
restarted it dereferences these stale addresses and triggers a fatal
bus error.

Fix this without any allocation by introducing
stmmac_reinit_rx_descriptors(), called from stmmac_resume() before
stmmac_clear_descriptors(). The helper iterates every RX descriptor
slot and re-programs its buffer address fields:

 - For normal (page_pool) queues: restore RDES0/1 from buf->addr and
   RDES2 from buf->sec_addr. The DMA mapping has remained valid across
   suspend/resume because no pages were freed.

 - For AF_XDP zero-copy queues: restore the DMA address from
   xsk_buff_xdp_get_dma(buf->xdp). Slots with buf->xdp == NULL (TX-only
   XSK socket) are skipped to avoid a NULL-pointer dereference.

 - For chain mode: call stmmac_mode_init() to rebuild the des3 next-
   descriptor pointer chain, which hardware may have overwritten with
   a PTP timestamp value (as noted in chain_mode.c:refill_desc3()).

This approach keeps all RX buffers alive across the PM transition and
avoids any allocation in the resume path, eliminating the OOM risk
raised against the previous approach of freeing and re-allocating
buffers.

Signed-off-by: Ding Hui <dinghui@lixiang.com>
---

Changes in v2:
- Introducing stmmac_reinit_rx_descriptors() to reinitializing rx
  buffers without any allocation.
- Modify commit log.
- Link to v1:
  https://lore.kernel.org/netdev/20260515053856.2310369-1-dinghui1111@163.com/
---
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 90 +++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 3591755ea30b..0dc27d8c66a0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1642,6 +1642,79 @@ static void stmmac_clear_descriptors(struct stmmac_priv *priv,
 		stmmac_clear_tx_descriptors(priv, dma_conf, queue);
 }
 
+/**
+ * stmmac_reinit_rx_descriptors - re-program RX descriptors from existing
+ *				   buffers (allocation-free)
+ * @priv: driver private structure
+ * @dma_conf: structure holding the dma data
+ * @queue: RX queue index
+ *
+ * Description: walk rx_q->buf_pool[] and re-program every RX descriptor's
+ * buffer-address fields from the buffers that are already attached to the
+ * queue. This is intended for the resume path: between suspend and resume
+ * the descriptor buffer-address fields may have been overwritten by HW
+ * writeback (RDESx are reused for status/length on completion), but the
+ * underlying RX buffers (page_pool pages or XSK frames) are still alive
+ * in buf_pool[]. By re-using them we avoid any allocation on resume,
+ * which is unsafe under memory pressure.
+ *
+ * This helper is expected to be called only in stmmac_resume.
+ */
+static void stmmac_reinit_rx_descriptors(struct stmmac_priv *priv,
+					 struct stmmac_dma_conf *dma_conf,
+					 u32 queue)
+{
+	struct stmmac_rx_queue *rx_q = &dma_conf->rx_queue[queue];
+	int i;
+
+	for (i = 0; i < dma_conf->dma_rx_size; i++) {
+		struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
+		struct dma_desc *p = stmmac_get_rx_desc(priv, rx_q, i);
+
+		if (rx_q->xsk_pool) {
+			dma_addr_t dma_addr;
+
+			/* The XSK pool may not be fully populated (e.g.
+			 * xdpsock TX-only); skip empty slots.
+			 */
+			if (!buf->xdp)
+				continue;
+
+			dma_addr = xsk_buff_xdp_get_dma(buf->xdp);
+			stmmac_set_desc_addr(priv, p, dma_addr);
+			stmmac_set_desc_sec_addr(priv, p, 0, false);
+		} else {
+			/* Theoretically unreachable: napi_disable() in
+			 * stmmac_suspend() ensures all initialized slots
+			 * have a valid page before we get here.
+			 * Defensive check only.
+			 */
+			if (!buf->page)
+				continue;
+
+			stmmac_set_desc_addr(priv, p, buf->addr);
+			stmmac_set_desc_sec_addr(priv, p, buf->sec_addr,
+						 priv->sph_active &&
+						 buf->sec_page);
+
+			if (dma_conf->dma_buf_sz == BUF_SIZE_16KiB)
+				stmmac_init_desc3(priv, p);
+		}
+	}
+
+	/* Chain mode: re-link descriptor 'next' pointers. This is
+	 * allocation-free; it just rewrites the per-descriptor next
+	 * field which may have been clobbered by HW writeback.
+	 */
+	if (priv->descriptor_mode == STMMAC_CHAIN_MODE) {
+		void *des = priv->extend_desc ? (void *)rx_q->dma_erx
+					      : (void *)rx_q->dma_rx;
+
+		stmmac_mode_init(priv, des, rx_q->dma_rx_phy,
+				 dma_conf->dma_rx_size, priv->extend_desc);
+	}
+}
+
 /**
  * stmmac_init_rx_buffers - init the RX descriptor buffer.
  * @priv: driver private structure
@@ -8272,6 +8345,7 @@ int stmmac_resume(struct device *dev)
 {
 	struct net_device *ndev = dev_get_drvdata(dev);
 	struct stmmac_priv *priv = netdev_priv(ndev);
+	u32 queue;
 	int ret;
 
 	if (priv->plat->resume) {
@@ -8316,6 +8390,22 @@ int stmmac_resume(struct device *dev)
 
 	mutex_lock(&priv->lock);
 
+	/* Re-program the RX descriptors from the buffers that are still
+	 * attached to priv->dma_conf.rx_queue[].buf_pool[]. The buffer-
+	 * address fields of the RX descriptors may have been overwritten
+	 * by HW writeback while the DMA was being stopped on suspend
+	 * (RDESx are reused for status/length on completion), so they
+	 * must be repopulated before the DMA is restarted in
+	 * stmmac_hw_setup() below; otherwise the controller would
+	 * dereference stale addresses and trigger a fatal bus error.
+	 *
+	 * This path is allocation-free: it relies entirely on the RX
+	 * buffers preserved across suspend, which makes the resume path
+	 * safe under memory pressure.
+	 */
+	for (queue = 0; queue < priv->plat->rx_queues_to_use; queue++)
+		stmmac_reinit_rx_descriptors(priv, &priv->dma_conf, queue);
+
 	stmmac_reset_queues_param(priv);
 
 	stmmac_free_tx_skbufs(priv);
-- 
2.34.1



^ permalink raw reply related

* Re: [PATCH v4 2/5] arm_mpam: resctrl: Pre-allocate assignable monitors
From: Koba Ko @ 2026-05-26  2:50 UTC (permalink / raw)
  To: Ben Horgan
  Cc: amitsinght, baisheng.gao, baolin.wang, carl, dave.martin, david,
	dfustini, fenghuay, gshan, james.morse, jic23, lcherian,
	linux-arm-kernel, linux-kernel, peternewman, punit.agrawal,
	quic_jiles, reinette.chatre, rohit.mathew, scott, sdonthineni,
	tan.shaopeng, xhao, zengheng4, x86
In-Reply-To: <20260520212458.1797221-3-ben.horgan@arm.com>


On 5/21/26 05:24, Ben Horgan wrote:
> External email: Use caution opening links or attachments
>
>
> MPAM is able to emulate ABMC, i.e. mbm_event mode, by making memory
> bandwidth monitors assignable. Rather than supporting the 'default'
> mbm_assign_mode always use 'mbm_event' mode even if there are sufficient
> memory bandwidth monitors. The per monitor event configuration is only
> provided by resctrl when in 'mbm_event' mode and so only allowing
> 'mbm_event' mode will make it easier to support per-monitor event
> configuration for MPAM. For the moment, the only event supported is
> mbm_total_event with no bandwidth type configuration. The 'mbm_assign_mode'
> file will still show 'default' when there is no support for memory
> bandwidth monitoring.
>
> The monitors need to be allocated from the driver, and mapped to whichever
> control/monitor group resctrl wants to use them with.
>
> Add a second array to hold the monitor values indexed by resctrl's cntr_id.
>
> When CDP is in use, two monitors are needed so the available number of
> counters halves. Platforms with one monitor will have zero monitors when
> CDP is in use.
>
> Co-developed-by: James Morse <james.morse@arm.com>
> Signed-off-by: James Morse <james.morse@arm.com>
> Signed-off-by: Ben Horgan <ben.horgan@arm.com>
> ---
> Changes since rfc v1:
> abmc enabled even if enough counters
> Helpers from dropped free running commits
> carry on with zero counters if using cdp
> set config bits
> use kmalloc_objs
> drop tags for rework
> Configure mbm_cntr_configurable, mbm_cntr_assign_fixed
>
> Changes since rfc v2:
> Don't set mon->assigned_counters to an error pointer
> Fix mpam_resctrl_teardown_mon()
> Remove free running check
> Separate cleanup allocations, e.g. __free(), from the rest
> Restrict scope on err in mpam_resctrl_monitor_init()
>
> Changes since v3:
> Correct NULL check in mpam_resctrl_teardown_mon() (Shaopeng)
> variable allocation ordering in mpam_resctrl_pick_domain_id() (Shaopeng)
> Move mon.* assignments from mpam_resctrl_monitor_sync_abmc_vals()
> to mpam_resctrl_monitor_init_abmc() counters (Sashiko)
> use kvmalloc_obj() for allocations that may be big on some
> platforms (Sashiko)
> ---
>   drivers/resctrl/mpam_internal.h |   6 +-
>   drivers/resctrl/mpam_resctrl.c  | 139 +++++++++++++++++++++++++++++++-
>   2 files changed, 141 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/resctrl/mpam_internal.h b/drivers/resctrl/mpam_internal.h
> index 1914aefdcba9..7a166b395b5a 100644
> --- a/drivers/resctrl/mpam_internal.h
> +++ b/drivers/resctrl/mpam_internal.h
> @@ -411,7 +411,11 @@ struct mpam_resctrl_res {
>   struct mpam_resctrl_mon {
>          struct mpam_class       *class;
>
> -       /* per-class data that resctrl needs will live here */
> +       /* Array of allocated MBWU monitors, indexed by (closid, rmid). */
> +       int                     *mbwu_idx_to_mon;
> +
> +       /* Array of assigned MBWU monitors, indexed by idx argument. */
> +       int                     *assigned_counters;
>   };
>
>   static inline int mpam_alloc_csu_mon(struct mpam_class *class)
> diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
> index f70fa65d39e4..a13eb232a19d 100644
> --- a/drivers/resctrl/mpam_resctrl.c
> +++ b/drivers/resctrl/mpam_resctrl.c
> @@ -75,6 +75,8 @@ static DECLARE_WAIT_QUEUE_HEAD(wait_cacheinfo_ready);
>    */
>   static bool resctrl_enabled;
>
> +static unsigned int l3_num_allocated_mbwu = ~0;
> +
>   bool resctrl_arch_alloc_capable(void)
>   {
>          struct mpam_resctrl_res *res;
> @@ -140,7 +142,7 @@ int resctrl_arch_cntr_read(struct rdt_resource *r, struct rdt_l3_mon_domain *d,
>
>   bool resctrl_arch_mbm_cntr_assign_enabled(struct rdt_resource *r)
>   {
> -       return false;
> +       return (r == &mpam_resctrl_controls[RDT_RESOURCE_L3].resctrl_res);
>   }
>
>   int resctrl_arch_mbm_cntr_assign_set(struct rdt_resource *r, bool enable)
> @@ -185,6 +187,18 @@ static void resctrl_reset_task_closids(void)
>          read_unlock(&tasklist_lock);
>   }
>
> +static void mpam_resctrl_monitor_sync_abmc_vals(struct rdt_resource *l3)
> +{
> +       l3->mon.num_mbm_cntrs = l3_num_allocated_mbwu;
> +       if (cdp_enabled)
> +               l3->mon.num_mbm_cntrs /= 2;
> +
> +       /*
> +        * Continue as normal even if enabling cdp causes there to be
> +        * zero counters. This avoid giving resctrl mixed messages.
> +        */
> +}
> +
>   int resctrl_arch_set_cdp_enabled(enum resctrl_res_level rid, bool enable)
>   {
>          u32 partid_i = RESCTRL_RESERVED_CLOSID, partid_d = RESCTRL_RESERVED_CLOSID;
> @@ -244,6 +258,7 @@ int resctrl_arch_set_cdp_enabled(enum resctrl_res_level rid, bool enable)
>          WRITE_ONCE(arm64_mpam_global_default, mpam_get_regval(current));
>
>          resctrl_reset_task_closids();
> +       mpam_resctrl_monitor_sync_abmc_vals(l3);
>
>          for_each_possible_cpu(cpu)
>                  mpam_set_cpu_defaults(cpu, partid_d, partid_i, 0, 0);
> @@ -613,6 +628,9 @@ static bool class_has_usable_mbwu(struct mpam_class *class)
>          if (!mpam_has_feature(mpam_feat_msmon_mbwu, cprops))
>                  return false;
>
> +       if (!cprops->num_mbwu_mon)
> +               return false;
> +
>          return true;
>   }
>
> @@ -935,6 +953,52 @@ static void mpam_resctrl_pick_mba(void)
>          }
>   }
>
> +static void __free_mbwu_mon(struct mpam_class *class, int *array,
> +                           u16 num_mbwu_mon)
> +{
> +       for (int i = 0; i < num_mbwu_mon; i++) {
> +               if (array[i] < 0)
> +                       continue;
> +
> +               mpam_free_mbwu_mon(class, array[i]);
> +               array[i] = ~0;
> +       }
> +}
> +
> +static int __alloc_mbwu_mon(struct mpam_class *class, int *array,
> +                           u16 num_mbwu_mon)
> +{
> +       for (int i = 0; i < num_mbwu_mon; i++) {
> +               int mbwu_mon = mpam_alloc_mbwu_mon(class);
> +
> +               if (mbwu_mon < 0) {
> +                       __free_mbwu_mon(class, array, num_mbwu_mon);
> +                       return mbwu_mon;
> +               }
> +               array[i] = mbwu_mon;
> +       }
> +
> +       l3_num_allocated_mbwu = min(l3_num_allocated_mbwu, num_mbwu_mon);
> +
> +       return 0;
> +}
> +
> +static int *__alloc_mbwu_array(struct mpam_class *class, u16 num_mbwu_mon)
> +{
> +       int err;
> +
> +       int *array __free(kvfree) = kvmalloc_objs(*array, num_mbwu_mon);
> +       if (!array)
> +               return ERR_PTR(-ENOMEM);
> +
> +       memset(array, -1, num_mbwu_mon * sizeof(*array));
> +
> +       err = __alloc_mbwu_mon(class, array, num_mbwu_mon);
> +       if (err)
> +               return ERR_PTR(err);
> +       return_ptr(array);
> +}
> +
>   static void counter_update_class(enum resctrl_event_id evt_id,
>                                   struct mpam_class *class)
>   {
> @@ -1089,6 +1153,43 @@ static int mpam_resctrl_pick_domain_id(int cpu, struct mpam_component *comp)
>          return comp->comp_id;
>   }
>
> +/*
> + * This must run after all event counters have been picked so that any free
> + * running counters have already been allocated.
> + */
> +static int mpam_resctrl_monitor_init_abmc(struct mpam_resctrl_mon *mon)
> +{
> +       struct mpam_resctrl_res *res = &mpam_resctrl_controls[RDT_RESOURCE_L3];
> +       size_t num_rmid = resctrl_arch_system_num_rmid_idx();
> +       struct rdt_resource *l3 = &res->resctrl_res;
> +       struct mpam_class *class = mon->class;
> +       u16 num_mbwu_mon;
> +       int *cntrs;
> +
> +       int *rmid_array __free(kvfree) = kvmalloc_objs(*rmid_array, num_rmid);
> +       if (!rmid_array) {
> +               pr_debug("Failed to allocate RMID array\n");
> +               return -ENOMEM;
> +       }
> +       memset(rmid_array, -1, num_rmid * sizeof(*rmid_array));
> +
> +       num_mbwu_mon = class->props.num_mbwu_mon;
> +       cntrs = __alloc_mbwu_array(mon->class, num_mbwu_mon);

hi Ben,
One thing double-checking here.
The allocation path uses class->props.num_mbwu_mon,
but teardown frees using l3_num_allocated_mbwu,
which is the global minimum exposed counter counter.
If classes can have different num_mbwu_mon values, a class with more
monitors than the global minimum may leak the tail of assigned_counters 
during teardown.

koba

> +       if (IS_ERR(cntrs))
> +               return PTR_ERR(cntrs);
> +       mon->assigned_counters = cntrs;
> +       mon->mbwu_idx_to_mon = no_free_ptr(rmid_array);
> +
> +       l3->mon.mbm_cntr_assignable = true;
> +       l3->mon.mbm_assign_on_mkdir = true;
> +       l3->mon.mbm_cntr_configurable = false;
> +       l3->mon.mbm_cntr_assign_fixed = true;
> +
> +       mpam_resctrl_monitor_sync_abmc_vals(l3);
> +
> +       return 0;
> +}
> +
>   static int mpam_resctrl_monitor_init(struct mpam_resctrl_mon *mon,
>                                       enum resctrl_event_id type)
>   {
> @@ -1133,8 +1234,21 @@ static int mpam_resctrl_monitor_init(struct mpam_resctrl_mon *mon,
>           */
>          l3->mon.num_rmid = resctrl_arch_system_num_rmid_idx();
>
> -       if (resctrl_enable_mon_event(type, false, 0, NULL))
> -               l3->mon_capable = true;
> +       if (type == QOS_L3_MBM_TOTAL_EVENT_ID) {
> +               int err;
> +
> +               err = mpam_resctrl_monitor_init_abmc(mon);
> +               if (err)
> +                       return err;
> +
> +               static_assert(MAX_EVT_CONFIG_BITS == 0x7f);
> +               l3->mon.mbm_cfg_mask = MAX_EVT_CONFIG_BITS;
> +       }
> +
> +       if (!resctrl_enable_mon_event(type, false, 0, NULL))
> +               return -EINVAL;
> +
> +       l3->mon_capable = true;
>
>          return 0;
>   }
> @@ -1697,6 +1811,23 @@ void mpam_resctrl_exit(void)
>          resctrl_exit();
>   }
>
> +static void mpam_resctrl_teardown_mon(struct mpam_resctrl_mon *mon, struct mpam_class *class)
> +{
> +       u32 num_mbwu_mon = l3_num_allocated_mbwu;
> +
> +       if (!mon->mbwu_idx_to_mon)
> +               return;
> +
> +       if (mon->assigned_counters) {
> +               __free_mbwu_mon(class, mon->assigned_counters, num_mbwu_mon);
> +               kvfree(mon->assigned_counters);
> +               mon->assigned_counters = NULL;
> +       }
> +
> +       kvfree(mon->mbwu_idx_to_mon);
> +       mon->mbwu_idx_to_mon = NULL;
> +}
> +
>   /*
>    * The driver is detaching an MSC from this class, if resctrl was using it,
>    * pull on resctrl_exit().
> @@ -1719,6 +1850,8 @@ void mpam_resctrl_teardown_class(struct mpam_class *class)
>          for_each_mpam_resctrl_mon(mon, eventid) {
>                  if (mon->class == class) {
>                          mon->class = NULL;
> +
> +                       mpam_resctrl_teardown_mon(mon, class);
>                          break;
>                  }
>          }
> --
> 2.43.0
>


^ permalink raw reply

* RE: [PATCH v5 10/20] dma-direct: make dma_direct_map_phys() honor DMA_ATTR_CC_SHARED
From: Michael Kelley @ 2026-05-26  2:56 UTC (permalink / raw)
  To: Aneesh Kumar K.V (Arm), iommu@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev
  Cc: Robin Murphy, Marek Szyprowski, Will Deacon, Marc Zyngier,
	Steven Price, Suzuki K Poulose, Catalin Marinas, Jiri Pirko,
	Jason Gunthorpe, Mostafa Saleh, Petr Tesarik,
	Alexey Kardashevskiy, Dan Williams, Xu Yilun,
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Alexander Gordeev, Gerald Schaefer,
	Heiko Carstens, Vasily Gorbik, Christian Borntraeger,
	Sven Schnelle, x86@kernel.org, Jiri Pirko
In-Reply-To: <20260522042815.370873-11-aneesh.kumar@kernel.org>

From: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org> Sent: Thursday, May 21, 2026 9:28 PM
> 
> Teach dma_direct_map_phys() to select the DMA address encoding based on
> DMA_ATTR_CC_SHARED.
> 
> Use phys_to_dma_unencrypted() for decrypted mappings and
> phys_to_dma_encrypted() otherwise. If a device requires unencrypted DMA
> but the source physical address is still encrypted, force the mapping
> through swiotlb so the DMA address and backing memory attributes remain
> consistent.
> 
> Update the arm64, x86, s390 and powerpc secure-guest setup to not use
> swiotlb force option
> 
> Tested-by: Jiri Pirko <jiri@nvidia.com>
> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
> ---
> Changes from v3:
> * Handle DMA_ATTR_MMIO
> ---
>  arch/arm64/mm/init.c                 |  4 +--
>  arch/powerpc/platforms/pseries/svm.c |  2 +-
>  arch/s390/mm/init.c                  |  2 +-
>  arch/x86/kernel/pci-dma.c            |  4 +--
>  kernel/dma/direct.c                  |  4 ++-
>  kernel/dma/direct.h                  | 45 +++++++++++++++-------------
>  6 files changed, 31 insertions(+), 30 deletions(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index c1b223e7cc8e..a087ac5b15f7 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -340,10 +340,8 @@ void __init arch_mm_preinit(void)
>  	unsigned int flags = SWIOTLB_VERBOSE;
>  	bool swiotlb = max_pfn > PFN_DOWN(arm64_dma_phys_limit);
> 
> -	if (is_realm_world()) {
> +	if (is_realm_world())
>  		swiotlb = true;
> -		flags |= SWIOTLB_FORCE;
> -	}
> 
>  	if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC) && !swiotlb)
> {
>  		/*
> diff --git a/arch/powerpc/platforms/pseries/svm.c
> b/arch/powerpc/platforms/pseries/svm.c
> index 384c9dc1899a..7a403dbd35ee 100644
> --- a/arch/powerpc/platforms/pseries/svm.c
> +++ b/arch/powerpc/platforms/pseries/svm.c
> @@ -29,7 +29,7 @@ static int __init init_svm(void)
>  	 * need to use the SWIOTLB buffer for DMA even if dma_capable() says
>  	 * otherwise.
>  	 */
> -	ppc_swiotlb_flags |= SWIOTLB_ANY | SWIOTLB_FORCE;
> +	ppc_swiotlb_flags |= SWIOTLB_ANY;
> 
>  	/* Share the SWIOTLB buffer with the host. */
>  	swiotlb_update_mem_attributes();
> diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
> index ad3c6d92b801..581af1483c42 100644
> --- a/arch/s390/mm/init.c
> +++ b/arch/s390/mm/init.c
> @@ -163,7 +163,7 @@ static void __init pv_init(void)
>  	virtio_set_mem_acc_cb(virtio_require_restricted_mem_acc);
> 
>  	/* make sure bounce buffers are shared */
> -	swiotlb_init(true, SWIOTLB_FORCE | SWIOTLB_VERBOSE);
> +	swiotlb_init(true, SWIOTLB_VERBOSE);
>  	swiotlb_update_mem_attributes();
>  }
> 
> diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
> index 6267363e0189..75cf8f6ae8cd 100644
> --- a/arch/x86/kernel/pci-dma.c
> +++ b/arch/x86/kernel/pci-dma.c
> @@ -59,10 +59,8 @@ static void __init pci_swiotlb_detect(void)
>  	 * bounce buffers as the hypervisor can't access arbitrary VM memory
>  	 * that is not explicitly shared with it.
>  	 */
> -	if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) {
> +	if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT))
>  		x86_swiotlb_enable = true;
> -		x86_swiotlb_flags |= SWIOTLB_FORCE;
> -	}

With this patch removing SWIOTLB_FORCE from four places in
kernel code, there are no remaining places where it is set.
The test of SWIOTLB_FORCE could be removed from
swiotlb_init_remap(), and its definition could be deleted
from include/linux/swiotlb.h.

Michael


^ permalink raw reply

* Re: [PATCH v02] mailbox: pcc: report errors for PCC clients
From: lihuisong (C) @ 2026-05-26  3:53 UTC (permalink / raw)
  To: Adam Young, Sudeep Holla
  Cc: Adam Young, Jassi Brar, linux-kernel, linux-hwmon,
	Rafael J . Wysocki, Len Brown, linux-acpi, Andi Shyti,
	Guenter Roeck, MyungJoo Ham, Kyungmin Park, Chanwoo Choi,
	linux-arm-kernel, lihuisong
In-Reply-To: <68f838b9-f3ae-41e4-96a4-667361bdc65e@amperemail.onmicrosoft.com>


On 5/23/2026 12:52 AM, Adam Young wrote:
> I am not getting li hui song's messages, only your (Sudeep's) responses.
>
> On 5/20/26 09:32, Sudeep Holla wrote:
>> On Wed, May 20, 2026 at 07:53:45PM +0800, lihuisong (C) wrote:
>>> On 5/20/2026 12:25 AM, Sudeep Holla wrote:
>>>> On Tue, May 19, 2026 at 09:54:47PM +0800, lihuisong (C) wrote:
>> [...]
>>
>>>>> @Sudeep, I have always had doubts about the addition of this line 
>>>>> of code in
>>>>> the
>>>>>    commit 9c753f7c953c (mailbox: pcc: Mark Tx as complete in PCC 
>>>>> IRQ handler).
>>>>> The patch seems to avoid the timeouts in the mailbox core 
>>>>> according to its
>>>>> commit log.
>>>>> Regardless of whether the command succeeds or fails, each mbox client
>>>>> driver, like cppc_acpi/acpi_pcc,kunpeng_hccs and so on, is 
>>>>> responsible to
>>>>> call mbox_chan_txdone() to tell mailbox core.
>>>> Few controller drivers do have mbox_chan_txdone(), so Tx complete 
>>>> is detected
>>> Which controller driver?
>> git grep mbox_chan_txdone drivers/mailbox/
>
>
> These are the only drivers that have a callback defined so far. IN all 
> cases, they are only doing error reporting, but no change of behavior.
>
>
>     drivers/acpi/cppc_acpi.c
>     drivers/i2c/busses/i2c-xgene-slimpro.c
>     drivers/hwmon/xgene-hwmon.c
>     drivers/soc/hisilicon/kunpeng_hccs.c
>     drivers/devfreq/hisi_uncore_freq.c
>
Need to cleanup for these driver without introducing other issues.
>
>>
>>>> by PCC, so not sure why you think this is not the right place to 
>>>> do. The irq
>>> Because many mbox client drivers call mbox_chan_txdone() after running
>>> rx_callback() in mbox_chan_received_data().
>> OK, but why can't the controller hide that for the clients ? What am 
>> I missing?
>>
>>> These drivers doesn't set chan->cl->tx_block to true.
>>> It seems that the client driver having tx_block need to set
>>> chan->tx_complete in tx_tick().
>>> Do you add this code for them?
>> I don't quite follow you.
>>
>>>> is to indicate the completion. I am confused as why you think 
>>>> otherwise.
>>>> It is defined in include/linux/mailbox_controller.h for the same 
>>>> reason.
>>>>
>>>> The client drivers can you mbox_client_txdone() if they wish to as 
>>>> defined
>>>> in include/linux/mailbox_client.h
>>> mbox_client_txdone() is used in the case that txdone_method is
>>> MBOX_TXDONE_BY_ACK.
>> Yes and agreed.
>
> I could make this path conditional on that being set.  Something like:
>
> rc = pcc_mbox_error_check_and_clear(pchan);
>
>       if (rc  &&   chan->txdone_method & MBOX_TXDONE_BY_POLL)
> -               return IRQ_NONE;
>
> Which lets the ACK and IRQ paths continue.
Client using POLL doesn't reach this code.
>
>
>
>
>>
>>> And mbox clinte driver using IRQ method need to use mbox_chan_txdone().
>> Client doesn't handle IRQ its always controller driver and client 
>> must have
>> no business to do that IMO.
>
> IN the PCC case, an error in handling a packet (PCC message) is 
> returned in the error register and read during the IRQ response. That 
> error message needs to propagate to the MCTP network driver so it can 
> free up the SKB and not leak memory. We cannot free it before that 
> point as it is still in the rbuf/active_request pointer.
The direction you said should be Tx, right?
I understand that your driver needs to wait for this message to be 
processed.
If the driver does not wait for the message, driver will receive timeout 
and can instruct to release the SKB.
>
>>
>>> It seems that all the current client drivers are used in this way.
>>> These interface internal would verify chan->txdone_method.
>>>
>> Yes, sounds wrong to me.
>>
>> drivers/acpi/acpi_pcc.c
>> drivers/acpi/cppc_acpi.c
>> drivers/hwmon/xgene-hwmon.c
>> drivers/i2c/busses/i2c-xgene-slimpro.c
>> drivers/soc/hisilicon/kunpeng_hccs.c
>>
>> It is very clear from the code in mailbox.c, mbox_client_txdone() is for
>> the client drivers and mbox_chan_txdone() is for the controller. We need
>> to fix the above list but I need to check if there is anything I am 
>> missing
>> to understand first. Please let me know.
>>
>>> In addition, I find that you also modify the txdone_irq/poll in the 
>>> commit
>>> 3349f800609e (mailbox: pcc: Set txdone_irq/txdone_poll based on PCCT 
>>> flags).
>>> The txdone_method will change from MBOX_TXDONE_BY_ACK to 
>>> MBOX_TXDONE_BY_POLL
>>> on the platform using poll mode.
>>> This may lead to the original mbox client driver printing exceptions in
>>> mbox_client_txdone.
>>> I haven't observed it based on the latest code yet, it's just code 
>>> analysis.
>> Right, I do remember seeing something and wonder if I moved to
>> mbox_chan_txdone() in drivers/acpi/acpi_pcc.c for that reason. But if 
>> the
>> expectations I have mentioned are correct, then we need to fix the 
>> framework
>> to avoid throwing that warnings.
>>
>


^ permalink raw reply

* Re: [PATCH v2 3/3] ASoC: sunxi: sun4i-spdif: Reorder clock enable sequence
From: Bui Duc Phuc @ 2026-05-26  4:17 UTC (permalink / raw)
  To: wens
  Cc: broonie, codekipper, jernej.skrabec, lgirdwood, linux-arm-kernel,
	linux-kernel, linux-sound, linux-sunxi, nichen, perex, samuel,
	tiwai
In-Reply-To: <CAGb2v644whCr6pRSfGMuQ=5afUMbfC2Y3W_kjdMdp9+5+kJhJA@mail.gmail.com>

Hi Chen-yu,

> Oh, and you could also add that the resume order should (normally) be
> the reverse of the suspend order.

Thank you for the feedback and clarification.

I can certainly rewrite the commit message around the idea that the
resume ordering should normally mirror the suspend ordering.

However, I am still slightly unsure about which ordering should be
considered the preferred one in this case. If the reasoning is purely
based on suspend/resume symmetry, I wonder if changing the suspend
path itself to disable the APB clock before the SPDIF module clock
would be an option, which would then naturally lead to enabling the
SPDIF module clock first during resume.

From the hardware perspective, I originally assumed the APB clock acts
as the prerequisite for register access while the module clock mainly
drives the functional audio logic, which is why the "bus before module"
ordering initially seemed more intuitive to me.

So I would like to better understand which ordering is considered the
preferred model for the Sunxi audio blocks here: preserving the existing
suspend/resume symmetry, or enforcing the bus/module dependency ordering.

Thanks,
Phuc


^ permalink raw reply

* RE: [PATCH v5 00/20] dma-mapping: Use DMA_ATTR_CC_SHARED through direct, pool and swiotlb paths
From: Michael Kelley @ 2026-05-26  4:30 UTC (permalink / raw)
  To: Aneesh Kumar K.V (Arm), iommu@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev
  Cc: Robin Murphy, Marek Szyprowski, Will Deacon, Marc Zyngier,
	Steven Price, Suzuki K Poulose, Catalin Marinas, Jiri Pirko,
	Jason Gunthorpe, Mostafa Saleh, Petr Tesarik,
	Alexey Kardashevskiy, Dan Williams, Xu Yilun,
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Alexander Gordeev, Gerald Schaefer,
	Heiko Carstens, Vasily Gorbik, Christian Borntraeger,
	Sven Schnelle, x86@kernel.org
In-Reply-To: <20260522042815.370873-1-aneesh.kumar@kernel.org>

From: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org> Sent: Thursday, May 21, 2026 9:28 PM
> 
> This series propagates DMA_ATTR_CC_SHARED through the dma-direct,
> dma-pool, and swiotlb paths so that encrypted and decrypted DMA buffers
> are handled consistently.
> 
> Today, the direct DMA path mostly relies on force_dma_unencrypted() for
> shared/decrypted buffer handling. This series consolidates the
> force_dma_unencrypted() checks in the top-level functions and ensures
> that the remaining DMA interfaces use DMA attributes to make the correct
> decisions.
> 
> The series:
> - moves swiotlb-backed allocations out of __dma_direct_alloc_pages(),
> - propagates DMA_ATTR_CC_SHARED through the dma-direct alloc/free
>   paths
> - teaches the atomic DMA pools to track encrypted versus decrypted
>   state
> - tracks swiotlb pool encryption state and enforces strict pool
>   selection
> - centralizes encrypted/decrypted pgprot handling in dma_pgprot() using
>   DMA attributes
> - passes DMA attributes down to dma_capable() so capability checks can
>   validate whether the selected DMA address encoding matches
>   DMA_ATTR_CC_SHARED
> - makes dma_direct_map_phys() choose the DMA address encoding from
>   DMA_ATTR_CC_SHARED and fall back to swiotlb when a shared DMA request
>   cannot use the direct mapping, which lets arm64 and x86 CCA guests stop
>   relying on SWIOTLB_FORCE for DMA mappings
> - use the selected swiotlb pool state to derive the returned DMA
>   address.

[snip]

> 
> 
> Aneesh Kumar K.V (Arm) (20):
>   [DO NOT MERGE] arm64/coco: Add pKVM as a CC platform
>   [DO NOT MERGE] s390: Expose protected virtualization through
>     cc_platform_has()
>   dma-direct: swiotlb: handle swiotlb alloc/free outside
>     __dma_direct_alloc_pages
>   dma-direct: use DMA_ATTR_CC_SHARED in alloc/free paths
>   dma-pool: track decrypted atomic pools and select them via attrs
>   dma: swiotlb: pass mapping attributes by reference
>   dma: swiotlb: track pool encryption state and honor DMA_ATTR_CC_SHARED
>   dma-mapping: make dma_pgprot() honor DMA_ATTR_CC_SHARED
>   dma-direct: pass attrs to dma_capable() for DMA_ATTR_CC_SHARED checks
>   dma-direct: make dma_direct_map_phys() honor DMA_ATTR_CC_SHARED
>   dma-direct: set decrypted flag for remapped DMA allocations
>   dma-direct: select DMA address encoding from DMA_ATTR_CC_SHARED
>   dma-pool: fix page leak in atomic_pool_expand() cleanup
>   dma-direct: rename ret to cpu_addr in alloc helpers
>   dma-direct: return struct page from dma_direct_alloc_from_pool()
>   iommu/dma: Check atomic pool allocation result directly
>   dma: swiotlb: free dynamic pools from process context
>   dma: swiotlb: handle set_memory_decrypted() failures
>   dma: free atomic pool pages by physical address
>   swiotlb: Preserve allocation virtual address for dynamic pools
> 
>  arch/arm64/include/asm/hypervisor.h           |   6 +
>  arch/arm64/include/asm/mem_encrypt.h          |   3 +-
>  arch/arm64/kernel/rsi.c                       |  12 -
>  arch/arm64/mm/init.c                          |  17 +-
>  arch/powerpc/platforms/pseries/svm.c          |   2 +-
>  arch/s390/Kconfig                             |   1 +
>  arch/s390/mm/init.c                           |  16 +-
>  arch/x86/kernel/amd_gart_64.c                 |  30 +-
>  arch/x86/kernel/pci-dma.c                     |   4 +-
>  drivers/iommu/dma-iommu.c                     |  15 +-
>  drivers/virt/coco/pkvm-guest/arm-pkvm-guest.c |   5 +
>  drivers/xen/swiotlb-xen.c                     |   8 +-
>  include/linux/dma-direct.h                    |  20 +-
>  include/linux/dma-map-ops.h                   |   3 +-
>  include/linux/swiotlb.h                       |  20 +-
>  kernel/dma/direct.c                           | 275 +++++++++++++-----
>  kernel/dma/direct.h                           |  47 +--
>  kernel/dma/mapping.c                          |  16 +-
>  kernel/dma/pool.c                             | 221 ++++++++++----
>  kernel/dma/swiotlb.c                          | 270 +++++++++++++----
>  20 files changed, 717 insertions(+), 274 deletions(-)
> 

I tested the series in a linux-next20260518 kernel, running in an
Azure VM on the Hyper-V hypervisor. The physical processor is Intel
XEON(R) PLATINUM 8573C with TDX memory encryption in use, so
this is a Linux CoCo VM. The VM has the usual VMBus synthetic disk
and network devices provided by Hyper-V, plus two PCI NVMe devices
that are directly assigned to the VM. I did basic smoke tests in the
VM, including reading and writing the NVMe devices. The swiotlb is
used as expected for DMA transfers to/from the synthetic and NVMe
devices. The NVMe driver does dma_alloc_coherent() to allocate
memory for control structures that must be decrypted. I did "unbind"
on the NVMe devices, and then rebound them so the dma allocations
would be freed and then reallocated. All looks good.

I'd like to try the same tests in a CoCo VM based on AMD SEV-SNP,
but I need to get quota for that VM size in Azure, and I don't know
how soon that can happen.

So as described above,

Tested-by: Michael Kelley <mhklinux@outlook.com>


^ permalink raw reply

* [PATCH v2] net: stmmac: Improve Tx timer arm logic further
From: muhammad.nazim.amirul.nazle.asmade @ 2026-05-26  5:19 UTC (permalink / raw)
  To: netdev
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, mcoquelin.stm32,
	alexandre.torgue, rmk+kernel, maxime.chevallier, linux-stm32,
	linux-arm-kernel, linux-kernel

From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>

Calling hrtimer_start() on an already-active txtimer is unnecessary
and expensive. Skip the restart if the timer is already active by
adding an hrtimer_active() check before hrtimer_start().

This avoids redundant timer restarts under burst traffic and ensures
NAPI is scheduled within tx_coal_timer microseconds of the first
packet rather than having the window reset on every packet.

There is no race concern: hrtimer_start() is internally serialized and
safe to call on an active timer. In the event of a race between
hrtimer_active() and hrtimer_start(), the worst case is calling
hrtimer_start() on an already-active timer, which is identical to the
pre-patch behaviour. The meaning of tx_coal_timer is unchanged.

Performance on Cyclone V with dwmac-socfpga (iperf3 -u -b 0 -l 64):
  Before: ~45200 pps
  After:  ~52300 pps (~15% improvement)

Additionally, ~10% improvement in UDP throughput observed on Agilex5,
with hrtimer CPU usage reduced from ~8% to ~0.6%.

Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
---
Changes in v2:
 - Expanded commit message to address race condition concern and clarify
   tx_coal_timer semantics (Andrew Lunn)
 - Added performance numbers to commit message (Andrew Lunn)
 - Added Agilex5 performance data with hrtimer CPU usage improvement
 - Added Tested-by and Reviewed-by from Maxime Chevallier
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions()

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 3591755ea30b..35da51c26248 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3341,12 +3341,14 @@ static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue)
 	 * Try to cancel any timer if napi is scheduled, timer will be armed
 	 * again in the next scheduled napi.
 	 */
-	if (unlikely(!napi_is_scheduled(napi)))
-		hrtimer_start(&tx_q->txtimer,
-			      STMMAC_COAL_TIMER(tx_coal_timer),
-			      HRTIMER_MODE_REL);
-	else
+	if (unlikely(!napi_is_scheduled(napi))) {
+		if (unlikely(!(hrtimer_active(&tx_q->txtimer))))
+			hrtimer_start(&tx_q->txtimer,
+				      STMMAC_COAL_TIMER(tx_coal_timer),
+				      HRTIMER_MODE_REL);
+	} else {
 		hrtimer_try_to_cancel(&tx_q->txtimer);
+	}
 }
 
 /**
-- 
2.43.7



^ permalink raw reply related

* [PATCHv2] PCI: mvebu: Use fixed-width interrupt masks
From: Rosen Penev @ 2026-05-26  4:40 UTC (permalink / raw)
  To: linux-pci
  Cc: Thomas Petazzoni, Pali Rohár, Lorenzo Pieralisi, linusw,
	Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
	Bjorn Helgaas,
	moderated list:PCI DRIVER FOR MVEBU (Marvell Armada 370 and Ar...),linusw@kernel.org,
	open list

Use u32-typed BIT and GENMASK helpers for PCIe interrupt register
masks.  This keeps inverted masks in the same width as the registers
and avoids truncation warnings on 64-bit compile-test builds.

Fixes this and similar warnings:

drivers/pci/controller/pci-mvebu.c:316:21: error: implicit conversion from
'unsigned long' to 'u32' (aka 'unsigned int') changes value from
18446744069414584320 to 0 [-Werror,-Wconstant-conversion]
  316 |         mvebu_writel(port, ~PCIE_INT_ALL_MASK, PCIE_INT_UNMASK_OFF);

Assisted-by: Codex:GPT-5.5
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 v2: remove sys_to_pcie change
 drivers/pci/controller/pci-mvebu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c
index e568528bad85..f5a3f7370552 100644
--- a/drivers/pci/controller/pci-mvebu.c
+++ b/drivers/pci/controller/pci-mvebu.c
@@ -57,9 +57,9 @@
 #define PCIE_CONF_DATA_OFF	0x18fc
 #define PCIE_INT_CAUSE_OFF	0x1900
 #define PCIE_INT_UNMASK_OFF	0x1910
-#define  PCIE_INT_INTX(i)		BIT(24+i)
-#define  PCIE_INT_PM_PME		BIT(28)
-#define  PCIE_INT_ALL_MASK		GENMASK(31, 0)
+#define  PCIE_INT_INTX(i)		BIT_U32(24 + (i))
+#define  PCIE_INT_PM_PME		BIT_U32(28)
+#define  PCIE_INT_ALL_MASK		GENMASK_U32(31, 0)
 #define PCIE_CTRL_OFF		0x1a00
 #define  PCIE_CTRL_X1_MODE		0x0001
 #define  PCIE_CTRL_RC_MODE		BIT(1)
-- 
2.54.0



^ permalink raw reply related

* Re: [PATCH] net: stmmac: Improve Tx timer arm logic further
From: Nazle Asmade, Muhammad Nazim Amirul @ 2026-05-26  5:21 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com, rmk+kernel@armlinux.org.uk,
	maxime.chevallier@bootlin.com,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
In-Reply-To: <3766daef-80d0-4657-935a-579bf17a11d4@lunn.ch>

On 25/5/2026 9:46 pm, Andrew Lunn wrote:
> On Sun, May 24, 2026 at 11:16:53PM -0700, muhammad.nazim.amirul.nazle.asmade@altera.com wrote:
>> From: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
>>
>> Currently hrtimer_start is called even if hrtimer is
>> active. This is unnecessary and expensive in some targets.
>> This patch avoids calling hrtimer_start unnecessarily.
>>
>> Signed-off-by: Rohan G Thomas <rohan.g.thomas@intel.com>
>> Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
>> ---
>>   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 12 +++++++-----
>>   1 file changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> index 3591755ea30b..35da51c26248 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
>> @@ -3341,12 +3341,14 @@ static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue)
>>   	 * Try to cancel any timer if napi is scheduled, timer will be armed
>>   	 * again in the next scheduled napi.
>>   	 */
>> -	if (unlikely(!napi_is_scheduled(napi)))
>> -		hrtimer_start(&tx_q->txtimer,
>> -			      STMMAC_COAL_TIMER(tx_coal_timer),
>> -			      HRTIMER_MODE_REL);
>> -	else
>> +	if (unlikely(!napi_is_scheduled(napi))) {
>> +		if (unlikely(!(hrtimer_active(&tx_q->txtimer))))
>> +			hrtimer_start(&tx_q->txtimer,
>> +				      STMMAC_COAL_TIMER(tx_coal_timer),
>> +				      HRTIMER_MODE_REL);
> 
> Is there a race condition here? I've not thought about it enough to
> know if there is/is not.
> 
> Also, does this change the meaning of tx_coal_timer?
> 
> I think the commit message needs expanding, to cover these issues. For
> performance changes, it is also normal to include some performance
> numbers, before/after, in the commit message.
> 
>      Andrew
> 
> ---
> pw-bot: cr
Hi Maxime, Andrew

Thanks for the quick review! I already send out v2 which applied all the 
comments.
https://lore.kernel.org/all/20260526051921.14540-1-muhammad.nazim.amirul.nazle.asmade@altera.com/

^ permalink raw reply

* [PATCH 0/3] ASoC: imx-rpmsg: Add headphone jack detection and driver_name support
From: Chancel Liu @ 2026-05-26  5:38 UTC (permalink / raw)
  To: broonie, lgirdwood, robh, krzk+dt, conor+dt
  Cc: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, perex, tiwai,
	Frank.Li, s.hauer, linux-sound, devicetree, linux-arm-kernel, imx,
	linux-kernel

This series adds two features to the i.MX RPMSG ASoC card:
1. Headphone jack detection via GPIO: Introduce the "hp-det-gpios"
   device tree property and use simple_util_init_jack() to
   register a headphone jack with GPIO-based insertion detection.

2. driver_name assignment: Set driver_name on the snd_soc_card to
   "imx-audio-rpmsg", enabling userspace tools such as UCM to reliably
   identify the card by driver name regardless of the board-specific
   card name.

Chancel Liu (3):
  ASoC: dt-bindings: fsl,rpmsg: Add hp-det-gpios property
  ASoC: imx-rpmsg: Support headphone jack detection
  ASoC: imx-rpmsg: Set driver_name for snd_soc_card

 Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml | 4 ++++
 sound/soc/fsl/imx-rpmsg.c                              | 9 +++++++++
 2 files changed, 13 insertions(+)

--
2.50.1



^ permalink raw reply

* [PATCH 1/3] ASoC: dt-bindings: fsl,rpmsg: Add hp-det-gpios property
From: Chancel Liu @ 2026-05-26  5:38 UTC (permalink / raw)
  To: broonie, lgirdwood, robh, krzk+dt, conor+dt
  Cc: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, perex, tiwai,
	Frank.Li, s.hauer, linux-sound, devicetree, linux-arm-kernel, imx,
	linux-kernel
In-Reply-To: <20260526053815.140008-1-chancel.liu@nxp.com>

Sound cards using the i.MX RPMSG audio interface may connect a
headphone jack with GPIO-based insertion detection. Add the
"hp-det-gpios" property to the fsl,rpmsg binding to support this
configuration.

Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
---
 Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
index 3a32f7517d0c..e3cadb93c183 100644
--- a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
@@ -98,6 +98,10 @@ properties:
       - rpmsg-audio-channel
       - rpmsg-micfil-channel
 
+  hp-det-gpios:
+    maxItems: 1
+    description: The GPIO that detect headphones are plugged in
+
 required:
   - compatible
 
-- 
2.50.1



^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox