* [PATCH] spi: axi-spi-engine: Emit trace events for spi transfers
@ 2024-10-31 11:16 Uwe Kleine-König
2024-10-31 16:49 ` David Lechner
2024-11-01 13:15 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2024-10-31 11:16 UTC (permalink / raw)
To: Michael Hennerich, Nuno Sá, Mark Brown, Steven Rostedt,
Masami Hiramatsu
Cc: David Lechner, Mathieu Desnoyers, linux-trace-kernel, linux-spi
As this spi host controller driver implements the
.transfer_one_message() callback, it has to care about these traces
it-self. With the transfers being compiled it's difficult to determine
where handling of one transfer ends and the next begins, so just
generate the start events in batch before the hardware fifo is fed and
the end events when their completion triggered.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/spi/spi-axi-spi-engine.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index 2dff95d2b3f5..7c252126b33e 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -15,6 +15,7 @@
#include <linux/overflow.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
+#include <trace/events/spi.h>
#define SPI_ENGINE_REG_RESET 0x40
@@ -590,6 +591,13 @@ static int spi_engine_transfer_one_message(struct spi_controller *host,
reinit_completion(&spi_engine->msg_complete);
+ if (trace_spi_transfer_start_enabled()) {
+ struct spi_transfer *xfer;
+
+ list_for_each_entry(xfer, &msg->transfers, transfer_list)
+ trace_spi_transfer_start(msg, xfer);
+ }
+
spin_lock_irqsave(&spi_engine->lock, flags);
if (spi_engine_write_cmd_fifo(spi_engine, msg))
@@ -617,6 +625,13 @@ static int spi_engine_transfer_one_message(struct spi_controller *host,
msg->status = -ETIMEDOUT;
}
+ if (trace_spi_transfer_stop_enabled()) {
+ struct spi_transfer *xfer;
+
+ list_for_each_entry(xfer, &msg->transfers, transfer_list)
+ trace_spi_transfer_stop(msg, xfer);
+ }
+
spi_finalize_current_message(host);
return msg->status;
base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: axi-spi-engine: Emit trace events for spi transfers
2024-10-31 11:16 [PATCH] spi: axi-spi-engine: Emit trace events for spi transfers Uwe Kleine-König
@ 2024-10-31 16:49 ` David Lechner
2024-11-01 13:15 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: David Lechner @ 2024-10-31 16:49 UTC (permalink / raw)
To: Uwe Kleine-König, Michael Hennerich, Nuno Sá,
Mark Brown, Steven Rostedt, Masami Hiramatsu
Cc: Mathieu Desnoyers, linux-trace-kernel, linux-spi
On 10/31/24 6:16 AM, Uwe Kleine-König wrote:
> As this spi host controller driver implements the
> .transfer_one_message() callback, it has to care about these traces
> it-self. With the transfers being compiled it's difficult to determine
> where handling of one transfer ends and the next begins, so just
> generate the start events in batch before the hardware fifo is fed and
> the end events when their completion triggered.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
Reviewed-by: David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: axi-spi-engine: Emit trace events for spi transfers
2024-10-31 11:16 [PATCH] spi: axi-spi-engine: Emit trace events for spi transfers Uwe Kleine-König
2024-10-31 16:49 ` David Lechner
@ 2024-11-01 13:15 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2024-11-01 13:15 UTC (permalink / raw)
To: Michael Hennerich, Nuno Sá, Steven Rostedt, Masami Hiramatsu,
Uwe Kleine-König
Cc: David Lechner, Mathieu Desnoyers, linux-trace-kernel, linux-spi
On Thu, 31 Oct 2024 12:16:45 +0100, Uwe Kleine-König wrote:
> As this spi host controller driver implements the
> .transfer_one_message() callback, it has to care about these traces
> it-self. With the transfers being compiled it's difficult to determine
> where handling of one transfer ends and the next begins, so just
> generate the start events in batch before the hardware fifo is fed and
> the end events when their completion triggered.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: axi-spi-engine: Emit trace events for spi transfers
commit: e36eba413b8e841e9e36e93188d82674ec7c79d1
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-01 13:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-31 11:16 [PATCH] spi: axi-spi-engine: Emit trace events for spi transfers Uwe Kleine-König
2024-10-31 16:49 ` David Lechner
2024-11-01 13:15 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox