[PATCH] soc: apple: rtkit: Pass the crashlog to the crashed() callback

Sven Peter sven at svenpeter.dev
Sun Feb 2 07:06:46 PST 2025



> 
> On 2. Feb 2025, at 14:49, Asahi Lina <lina at 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 at asahilina.net>
> ---
Reviewed-by: Sven Peter <sven at 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




More information about the Linux-nvme mailing list