]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: apple: rtkit: Pass the crashlog to the crashed() callback
authorAsahi Lina <lina@asahilina.net>
Sun, 2 Feb 2025 13:48:47 +0000 (22:48 +0900)
committerSven Peter <sven@svenpeter.dev>
Tue, 18 Feb 2025 16:59:11 +0000 (17:59 +0100)
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>
drivers/nvme/host/apple.c
drivers/soc/apple/rtkit.c
include/linux/soc/apple/rtkit.h

index 1de11b722f049abbc96a6bb62b072ac973b8c4aa..d1b8ecca3333b3f6745d4554e36e7f2162273035 100644 (file)
@@ -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;
 
index f8077a1ec3a42265eb9565a0ea1ca6a4cf7e79dc..f190619674592bfc7b303b0779bb8754bb12c5b1 100644 (file)
@@ -378,7 +378,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)
index c06d17599ae7e3d37d99495e4296932b1de3a3c7..736f530180179bd144cf85eb0f0bd93844d7188a 100644 (file)
@@ -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);