[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5d4cf5bff7733421c8a031493742ba6a21e98583.camel@pengutronix.de>
Date: Mon, 30 Jun 2025 10:38:21 +0200
From: Philipp Zabel <p.zabel@...gutronix.de>
To: Clément Le Goffic <clement.legoffic@...s.st.com>,
Will Deacon <will@...nel.org>, Mark Rutland <mark.rutland@....com>, Rob
Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor
Dooley <conor+dt@...nel.org>, Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>, Jonathan Corbet
<corbet@....net>, Gatien Chevallier <gatien.chevallier@...s.st.com>,
Michael Turquette <mturquette@...libre.com>, Stephen Boyd
<sboyd@...nel.org>, Gabriel Fernandez <gabriel.fernandez@...s.st.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-perf-users@...r.kernel.org,
devicetree@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-clk@...r.kernel.org
Subject: Re: [PATCH 06/13] perf: stm32: introduce DDRPERFM driver
On Mo, 2025-06-23 at 11:27 +0200, Clément Le Goffic wrote:
> Introduce the driver for the DDR Performance Monitor available on
> STM32MPU SoC.
>
> On STM32MP2 platforms, the DDRPERFM allows to monitor up to 8 DDR events
> that come from the DDR Controller such as read or write events.
>
> On STM32MP1 platforms, the DDRPERFM cannot monitor any event on any
> counter, there is a notion of set of events.
> Events from different sets cannot be monitored at the same time.
> The first chosen event selects the set.
> The set is coded in the first two bytes of the config value which is on 4
> bytes.
>
> On STM32MP25x series, the DDRPERFM clock is shared with the DDR controller
> and may be secured by bootloaders.
> Access controllers allow to check access to a resource. Use the access
> controller defined in the devicetree to know about the access to the
> DDRPERFM clock.
>
> Signed-off-by: Clément Le Goffic <clement.legoffic@...s.st.com>
> ---
> drivers/perf/Kconfig | 11 +
> drivers/perf/Makefile | 1 +
> drivers/perf/stm32_ddr_pmu.c | 893 +++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 905 insertions(+)
>
[...]
> diff --git a/drivers/perf/stm32_ddr_pmu.c b/drivers/perf/stm32_ddr_pmu.c
> new file mode 100644
> index 000000000000..c0bce1f446a0
> --- /dev/null
> +++ b/drivers/perf/stm32_ddr_pmu.c
> @@ -0,0 +1,893 @@
[...]
> + if (of_property_present(pdev->dev.of_node, "resets")) {
> + rst = devm_reset_control_get(&pdev->dev, NULL);
Use devm_reset_control_get_optional_exclusive() instead. It returns
NULL if the device tree doesn't contain a resets property.
> + if (IS_ERR(rst)) {
> + dev_err(&pdev->dev, "Failed to get reset\n");
Please consider using dev_err_probe() instead.
> + ret = PTR_ERR(rst);
> + goto err_clk;
> + }
> + reset_control_assert(rst);
> + reset_control_deassert(rst);
These can be done unconditionally, as they are no-ops for rst == NULL.
regards
Philipp
Powered by blists - more mailing lists