Path: blob/main/sys/contrib/dev/athk/ath12k/coredump.c
178703 views
// SPDX-License-Identifier: BSD-3-Clause-Clear1/*2* Copyright (c) 2020 The Linux Foundation. All rights reserved.3* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.4*/5#include <linux/devcoredump.h>6#include "hif.h"7#include "coredump.h"8#include "debug.h"910enum11ath12k_fw_crash_dump_type ath12k_coredump_get_dump_type(enum ath12k_qmi_target_mem type)12{13enum ath12k_fw_crash_dump_type dump_type;1415switch (type) {16case HOST_DDR_REGION_TYPE:17dump_type = FW_CRASH_DUMP_REMOTE_MEM_DATA;18break;19case M3_DUMP_REGION_TYPE:20dump_type = FW_CRASH_DUMP_M3_DUMP;21break;22case PAGEABLE_MEM_REGION_TYPE:23dump_type = FW_CRASH_DUMP_PAGEABLE_DATA;24break;25case BDF_MEM_REGION_TYPE:26case CALDB_MEM_REGION_TYPE:27dump_type = FW_CRASH_DUMP_NONE;28break;29case MLO_GLOBAL_MEM_REGION_TYPE:30dump_type = FW_CRASH_DUMP_MLO_GLOBAL_DATA;31break;32default:33dump_type = FW_CRASH_DUMP_TYPE_MAX;34break;35}3637return dump_type;38}3940void ath12k_coredump_upload(struct work_struct *work)41{42struct ath12k_base *ab = container_of(work, struct ath12k_base, dump_work);4344ath12k_info(ab, "Uploading coredump\n");45/* dev_coredumpv() takes ownership of the buffer */46dev_coredumpv(ab->dev, ab->dump_data, ab->ath12k_coredump_len, GFP_KERNEL);47ab->dump_data = NULL;48}4950void ath12k_coredump_collect(struct ath12k_base *ab)51{52ath12k_hif_coredump_download(ab);53}545556