Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3268966pxj; Mon, 14 Jun 2021 19:28:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJbmibqtoOT2mbq35E//w8sc7LKNgrMiTTwbt5w3p22V1ii69Dpy4vdV5VIVMwtfG0eWVw X-Received: by 2002:a50:fd13:: with SMTP id i19mr20202640eds.280.1623724096669; Mon, 14 Jun 2021 19:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623724096; cv=none; d=google.com; s=arc-20160816; b=oZFTLDotPGU50X0QeBmOaXUW3kXjX2r0zOPHxq7/FZJZE2VlL03m032HbY+FYdlqnn DTeISeeEcPc83cwpxqxOffxoXXvAxhe4x55Es+liUNUfGZaRfZxPTxLygQdsZR6grAbj MphrPHa9w2+PdMNuJcEGC9p8fuVcs5gykE0zkyRaMam7dvCEjvQM/Yz7wLDBsGuCiN1P wgEtyUIQIhfNfasLtkq++u/0q4IMpEJLmi7Deis4sdj3EgVL2Jexq8rkbrjd3QIk7FuQ YI7qDt1mAa6VbRTm8PmxRWuNzhz2fwYNa09v1EOXOfw79BjqRZw3qYBxb4TeXm9JlAa+ pRaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=oVcZW/NhMjIKbb/5EskJEuyYnbpkb92vyLDQsMrP+YU=; b=IKlmxVxZ8p1mzy8EctTLLLpspUyKA1tQVqw73o8zHyAX5teAodbFgxLLjxHKdOXwaZ oloeFRR3a+O2uijwZAMs2Oz/snXsyWgqBzYpnjxNkD3qw4OvBdr9qYj8AR8TbzL9LoCg AT3fzqPHyu2l9vYhu4ctiym6/MRUKy+hemtU64CLCNIccf3OvYcidIWSPPFi/uqxsNrR hgMBbkedPGW73iVyUaXTe0ZaFyWSXU0UgaTeoqawBDn1zqFoiPiN+8pDfE3P+e2D23X+ yDz/w+CG9Hl6HYvJWu66OfldmxRm4f0faxdV9g0HXQTSyUnKuiMdkqJn1wIJ7idSRjpF tVLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=CD+3ZJLV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si13338175ejo.589.2021.06.14.19.27.54; Mon, 14 Jun 2021 19:28:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=CD+3ZJLV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231833AbhFOCZn (ORCPT + 99 others); Mon, 14 Jun 2021 22:25:43 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:12620 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231738AbhFOCZe (ORCPT ); Mon, 14 Jun 2021 22:25:34 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623723810; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=oVcZW/NhMjIKbb/5EskJEuyYnbpkb92vyLDQsMrP+YU=; b=CD+3ZJLVL9G5y0BxUj69q7ZcCXOaQQgGrenR9UACK0JJOoEzRRy3ODP2ypK2xULYfL6pX+Kr FuuLCiULYvLugJhiX6OZNwTy+IHxCvjCrY9cwA1AP089rSRbtmeLB4f1ayqaaq5Q1aLys7f5 +3Ktpwgctv7TZFcqzTp2bUKwFSo= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 60c80bc22eaeb98b5e0e773c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 15 Jun 2021 02:09:06 GMT Sender: sidgup=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id BD819C43144; Tue, 15 Jun 2021 02:09:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from sidgup-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sidgup) by smtp.codeaurora.org (Postfix) with ESMTPSA id D3926C4360C; Tue, 15 Jun 2021 02:09:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D3926C4360C Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=sidgup@codeaurora.org From: Siddharth Gupta To: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, agross@kernel.org Cc: Siddharth Gupta , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, psodagud@codeaurora.org Subject: [PATCH 2/2] remoteproc: qcom: Add full coredump fallback mechanism Date: Mon, 14 Jun 2021 19:08:50 -0700 Message-Id: <1623722930-29354-3-git-send-email-sidgup@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1623722930-29354-1-git-send-email-sidgup@codeaurora.org> References: <1623722930-29354-1-git-send-email-sidgup@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If a remoteproc's firmware does not support minidump but the driver adds an ID, the minidump driver does not collect any coredumps when the remoteproc crashes. This hinders the purpose of coredump collection. This change adds a fallback mechanism in the event of a crash. Signed-off-by: Siddharth Gupta --- drivers/remoteproc/qcom_common.c | 9 +++++++-- drivers/remoteproc/qcom_q6v5_pas.c | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c index 4b91e3c..1e754dd 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -163,12 +163,17 @@ void qcom_minidump(struct rproc *rproc, unsigned int minidump_id) */ 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->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 b921fc2..9f29619 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -274,6 +274,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, -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project