public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] soc: apple: rtkit: Pass the crashlog to the crashed() callback
@ 2025-02-02 13:48 Asahi Lina
  2025-02-02 15:05 ` Jens Axboe
  2025-02-18 17:05 ` Sven Peter
  0 siblings, 2 replies; 4+ messages in thread
From: Asahi Lina @ 2025-02-02 13:48 UTC (permalink / raw)
  To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Keith Busch,
	Jens Axboe, Christoph Hellwig, Sagi Grimberg, Janne Grunau
  Cc: asahi, linux-arm-kernel, linux-nvme, linux-kernel, Asahi Lina

Client drivers might want a copy of the crashlog to stash into a
devcoredump blob. Since device memory management can be very variable,
the actual devcoredump implementation is left to client drivers. Pass
the raw crashlog buffer to the client callback so it can use it if
desired.

Signed-off-by: Asahi Lina <lina@asahilina.net>
---
 drivers/nvme/host/apple.c       | 2 +-
 drivers/soc/apple/rtkit.c       | 2 +-
 include/linux/soc/apple/rtkit.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c
index 4319ab50c10d11ed81dcc002275f190e053c1be6..f46b3f179a00dad054c24ccaa0c578d64ca75ec9 100644
--- a/drivers/nvme/host/apple.c
+++ b/drivers/nvme/host/apple.c
@@ -221,7 +221,7 @@ static unsigned int apple_nvme_queue_depth(struct apple_nvme_queue *q)
 	return APPLE_ANS_MAX_QUEUE_DEPTH;
 }
 
-static void apple_nvme_rtkit_crashed(void *cookie)
+static void apple_nvme_rtkit_crashed(void *cookie, const void *crashlog, size_t crashlog_size)
 {
 	struct apple_nvme *anv = cookie;
 
diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c
index e6d940292c9fbdfc4cd42020e89aca2662c5cdce..4b0783091a92324a707a0e1cd16d36dd6d984678 100644
--- a/drivers/soc/apple/rtkit.c
+++ b/drivers/soc/apple/rtkit.c
@@ -368,7 +368,7 @@ static void apple_rtkit_crashlog_rx(struct apple_rtkit *rtk, u64 msg)
 
 	rtk->crashed = true;
 	if (rtk->ops->crashed)
-		rtk->ops->crashed(rtk->cookie);
+		rtk->ops->crashed(rtk->cookie, bfr, rtk->crashlog_buffer.size);
 }
 
 static void apple_rtkit_ioreport_rx(struct apple_rtkit *rtk, u64 msg)
diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
index c06d17599ae7e3d37d99495e4296932b1de3a3c7..736f530180179bd144cf85eb0f0bd93844d7188a 100644
--- a/include/linux/soc/apple/rtkit.h
+++ b/include/linux/soc/apple/rtkit.h
@@ -56,7 +56,7 @@ struct apple_rtkit_shmem {
  *                 context.
  */
 struct apple_rtkit_ops {
-	void (*crashed)(void *cookie);
+	void (*crashed)(void *cookie, const void *crashlog, size_t crashlog_size);
 	void (*recv_message)(void *cookie, u8 endpoint, u64 message);
 	bool (*recv_message_early)(void *cookie, u8 endpoint, u64 message);
 	int (*shmem_setup)(void *cookie, struct apple_rtkit_shmem *bfr);

---
base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04
change-id: 20250202-rtkit-crashdump-e848547dad67

Cheers,
~~ Lina



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] soc: apple: rtkit: Pass the crashlog to the crashed() callback
  2025-02-02 13:48 [PATCH] soc: apple: rtkit: Pass the crashlog to the crashed() callback Asahi Lina
@ 2025-02-02 15:05 ` Jens Axboe
  2025-02-18 17:05 ` Sven Peter
  1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2025-02-02 15:05 UTC (permalink / raw)
  To: Asahi Lina, Hector Martin, Sven Peter, Alyssa Rosenzweig,
	Keith Busch, Christoph Hellwig, Sagi Grimberg, Janne Grunau
  Cc: asahi, linux-arm-kernel, linux-nvme, linux-kernel

On 2/2/25 6:48 AM, Asahi Lina wrote:
> Client drivers might want a copy of the crashlog to stash into a
> devcoredump blob. Since device memory management can be very variable,
> the actual devcoredump implementation is left to client drivers. Pass
> the raw crashlog buffer to the client callback so it can use it if
> desired.

Reviewed-by: Jens Axboe <axboe@kernel.dk>

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] soc: apple: rtkit: Pass the crashlog to the crashed() callback
@ 2025-02-02 15:06 Sven Peter
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Peter @ 2025-02-02 15:06 UTC (permalink / raw)
  To: Lina Asahi
  Cc: Hector Martin, Alyssa Rosenzweig, Keith Busch, Jens Axboe,
	Christoph Hellwig, Sagi Grimberg, Janne Grunau, asahi,
	linux-arm-kernel, linux-nvme, linux-kernel, Lina Asahi


> 
> On 2. Feb 2025, at 14:49, Asahi Lina <lina@asahilina.net> wrote:
> 
> Client drivers might want a copy of the crashlog to stash into a
> devcoredump blob. Since device memory management can be very variable,
> the actual devcoredump implementation is left to client drivers. Pass
> the raw crashlog buffer to the client callback so it can use it if
> desired.
> 
> Signed-off-by: Asahi Lina <lina@asahilina.net>
> ---
Reviewed-by: Sven Peter <sven@svenpeter.dev>


> drivers/nvme/host/apple.c       | 2 +-
> drivers/soc/apple/rtkit.c       | 2 +-
> include/linux/soc/apple/rtkit.h | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c
> index 4319ab50c10d11ed81dcc002275f190e053c1be6..f46b3f179a00dad054c24ccaa0c578d64ca75ec9 100644
> --- a/drivers/nvme/host/apple.c
> +++ b/drivers/nvme/host/apple.c
> @@ -221,7 +221,7 @@ static unsigned int apple_nvme_queue_depth(struct apple_nvme_queue *q)
>   return APPLE_ANS_MAX_QUEUE_DEPTH;
> }
> 
> -static void apple_nvme_rtkit_crashed(void *cookie)
> +static void apple_nvme_rtkit_crashed(void *cookie, const void *crashlog, size_t crashlog_size)
> {
>   struct apple_nvme *anv = cookie;
> 
> diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c
> index e6d940292c9fbdfc4cd42020e89aca2662c5cdce..4b0783091a92324a707a0e1cd16d36dd6d984678 100644
> --- a/drivers/soc/apple/rtkit.c
> +++ b/drivers/soc/apple/rtkit.c
> @@ -368,7 +368,7 @@ static void apple_rtkit_crashlog_rx(struct apple_rtkit *rtk, u64 msg)
> 
>   rtk->crashed = true;
>   if (rtk->ops->crashed)
> -        rtk->ops->crashed(rtk->cookie);
> +        rtk->ops->crashed(rtk->cookie, bfr, rtk->crashlog_buffer.size);
> }
> 
> static void apple_rtkit_ioreport_rx(struct apple_rtkit *rtk, u64 msg)
> diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
> index c06d17599ae7e3d37d99495e4296932b1de3a3c7..736f530180179bd144cf85eb0f0bd93844d7188a 100644
> --- a/include/linux/soc/apple/rtkit.h
> +++ b/include/linux/soc/apple/rtkit.h
> @@ -56,7 +56,7 @@ struct apple_rtkit_shmem {
> *                 context.
> */
> struct apple_rtkit_ops {
> -    void (*crashed)(void *cookie);
> +    void (*crashed)(void *cookie, const void *crashlog, size_t crashlog_size);
>   void (*recv_message)(void *cookie, u8 endpoint, u64 message);
>   bool (*recv_message_early)(void *cookie, u8 endpoint, u64 message);
>   int (*shmem_setup)(void *cookie, struct apple_rtkit_shmem *bfr);
> 
> ---
> base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04
> change-id: 20250202-rtkit-crashdump-e848547dad67
> 
> Cheers,
> ~~ Lina



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] soc: apple: rtkit: Pass the crashlog to the crashed() callback
  2025-02-02 13:48 [PATCH] soc: apple: rtkit: Pass the crashlog to the crashed() callback Asahi Lina
  2025-02-02 15:05 ` Jens Axboe
@ 2025-02-18 17:05 ` Sven Peter
  1 sibling, 0 replies; 4+ messages in thread
From: Sven Peter @ 2025-02-18 17:05 UTC (permalink / raw)
  To: Hector Martin, Alyssa Rosenzweig, Keith Busch, Jens Axboe,
	Christoph Hellwig, Sagi Grimberg, Janne Grunau, Asahi Lina
  Cc: Sven Peter, asahi, linux-arm-kernel, linux-nvme, linux-kernel


On Sun, 02 Feb 2025 22:48:47 +0900, Asahi Lina wrote:
> Client drivers might want a copy of the crashlog to stash into a
> devcoredump blob. Since device memory management can be very variable,
> the actual devcoredump implementation is left to client drivers. Pass
> the raw crashlog buffer to the client callback so it can use it if
> desired.
> 
> 
> [...]

Applied, thanks!

[1/1] soc: apple: rtkit: Pass the crashlog to the crashed() callback
      commit: bf8b4e49777d944f84cf7d47360fe80dd3f69d96

Best regards,
-- 
Sven Peter <sven@svenpeter.dev>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-18 17:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-02 13:48 [PATCH] soc: apple: rtkit: Pass the crashlog to the crashed() callback Asahi Lina
2025-02-02 15:05 ` Jens Axboe
2025-02-18 17:05 ` Sven Peter
  -- strict thread matches above, loose matches on Subject: below --
2025-02-02 15:06 Sven Peter

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