From patchwork Wed Apr 6 18:27:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yogesh Lal X-Patchwork-Id: 12804003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D3FCC433F5 for ; Wed, 6 Apr 2022 19:23:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229987AbiDFTZQ (ORCPT ); Wed, 6 Apr 2022 15:25:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbiDFTYi (ORCPT ); Wed, 6 Apr 2022 15:24:38 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7640AED9FD; Wed, 6 Apr 2022 11:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1649269693; x=1680805693; h=from:to:cc:subject:date:message-id:mime-version; bh=Rs79KJhe70Gy0XLPZF0IzThau8hzcUa246qSlKDLfaI=; b=IM+A14nsHYV5nTRgK2huqHhx9t9lUtpDUokFlUHwaLnH/suIjsFmNGDE VUqapIAJJIOshkeyJSQlYTr4/cWWoIbB6NiP+ezTe/qO98Kabel10PZwn E/PnKMheTeZJyVX5JpVeFc4hOiF3jpoGges515i+u4psZJgpfk2LZDt/6 Q=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-02.qualcomm.com with ESMTP; 06 Apr 2022 11:28:13 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2022 11:28:13 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 6 Apr 2022 11:28:12 -0700 Received: from hu-ylal-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 6 Apr 2022 11:28:10 -0700 From: Yogesh Lal To: , CC: , , , Yogesh Lal Subject: [PATCH] remoteproc: qcom: Add fallback mechanism for full coredump collection Date: Wed, 6 Apr 2022 23:57:42 +0530 Message-ID: <1649269662-20338-1-git-send-email-quic_ylal@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org In case remoteproc's firmware missing minidump support, during crash scenario coredump does not collected. This change adds a fallback mechanism for full coredump collection in the event of a crash. Signed-off-by: Yogesh Lal --- drivers/remoteproc/qcom_common.c | 11 ++++++++--- drivers/remoteproc/qcom_q6v5_pas.c | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c index 4b91e3c..68bd0bc 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -162,13 +162,18 @@ void qcom_minidump(struct rproc *rproc, unsigned int minidump_id) * is initialized in memory and encryption status is set. */ if (subsystem->regions_baseptr == 0 || - le32_to_cpu(subsystem->status) != 1 || - le32_to_cpu(subsystem->enabled) != MD_SS_ENABLED || - le32_to_cpu(subsystem->encryption_status) != MD_SS_ENCR_DONE) { + le32_to_cpu(subsystem->status) != 1 || + le32_to_cpu(subsystem->enabled) != MD_SS_ENABLED) { + return rproc_coredump(rproc); + } + + if (le32_to_cpu(subsystem->encryption_status) != MD_SS_ENCR_DONE) { dev_err(&rproc->dev, "Minidump not ready, skipping\n"); return; } + rproc_coredump_cleanup(rproc); + ret = qcom_add_minidump_segments(rproc, subsystem); if (ret) { dev_err(&rproc->dev, "Failed with error: %d while adding minidump entries\n", ret); diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 1ae47cc..40bf747 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -293,6 +293,7 @@ static const struct rproc_ops adsp_minidump_ops = { .start = adsp_start, .stop = adsp_stop, .da_to_va = adsp_da_to_va, + .parse_fw = qcom_register_dump_segments, .load = adsp_load, .panic = adsp_panic, .coredump = adsp_minidump,