Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/r/20250202-rtkit-crashdump-v1-1-9d38615b4e12@asahilina.net
Signed-off-by: Sven Peter <sven@svenpeter.dev>

authored by

Asahi Lina and committed by
Sven Peter
bf8b4e49 ca0272d8

+3 -3
+1 -1
drivers/nvme/host/apple.c
··· 221 221 return APPLE_ANS_MAX_QUEUE_DEPTH; 222 222 } 223 223 224 - static void apple_nvme_rtkit_crashed(void *cookie) 224 + static void apple_nvme_rtkit_crashed(void *cookie, const void *crashlog, size_t crashlog_size) 225 225 { 226 226 struct apple_nvme *anv = cookie; 227 227
+1 -1
drivers/soc/apple/rtkit.c
··· 378 378 379 379 rtk->crashed = true; 380 380 if (rtk->ops->crashed) 381 - rtk->ops->crashed(rtk->cookie); 381 + rtk->ops->crashed(rtk->cookie, bfr, rtk->crashlog_buffer.size); 382 382 } 383 383 384 384 static void apple_rtkit_ioreport_rx(struct apple_rtkit *rtk, u64 msg)
+1 -1
include/linux/soc/apple/rtkit.h
··· 56 56 * context. 57 57 */ 58 58 struct apple_rtkit_ops { 59 - void (*crashed)(void *cookie); 59 + void (*crashed)(void *cookie, const void *crashlog, size_t crashlog_size); 60 60 void (*recv_message)(void *cookie, u8 endpoint, u64 message); 61 61 bool (*recv_message_early)(void *cookie, u8 endpoint, u64 message); 62 62 int (*shmem_setup)(void *cookie, struct apple_rtkit_shmem *bfr);