Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp707025pxk; Thu, 24 Sep 2020 16:54:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5pSctWKiPIEjKTP+1OgCnr9R4F+YTrTYAA2vR4HdkSk2Dpt1YSuuqQBZnCcP63dqwfD1N X-Received: by 2002:a17:906:8695:: with SMTP id g21mr101820ejx.504.1600991694559; Thu, 24 Sep 2020 16:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600991694; cv=none; d=google.com; s=arc-20160816; b=DfleoEGCMWuHUOnJPN4TbM+tj4/NwpmHfglEf9yVAbsOjzb5/+FAgj21dSdpxK6fpf /RcwZsLDdZpsLLlCyOFfLL++w/5K6q0jaexBk+kZc93QMW4r0rU/PZ7rU5i1T9jhRVsU EWR6j09dAii3lEG3j0ZktOVlHbGue6U1RyQKQBWqqySaRwxlKUNPPbIVsvMiC+2Y8s/g Y1hdweozGmisPQu0/33is4ZjXRqKIHO5WEgEHXeZSnhMlTDyQ7P7YhGnf6cb5JQLiTMh pTe7dd/qQYk223xIe7adCCbgbi0htgr0FQkDGBZfc0Qhlxk4nUids9mQepAGOJAKngxz BKDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=84Zm6i7Jvic5qpawkUmAOufJMHIQOCTsiMPn8kZct3k=; b=0wShRSUGnEbq+xxwBaWrWIZaiegIQ/iWGhE2AYHtkjQ51OVR0wQOUcjtl0LfHUGgX5 tbmGHYio8rNZz2A/8ucnVTItGxFOpzhG6Y7ahwjNmIlDGxKUfaGkxki7WXH0oJMRpJKa pOyqXTv5Bry5OraCfxhvaqx7XAJ1pqDr7c5wu9mnNNUByod+X+MWOg2hfW7AmBP4qdvR OG6sDxV3ndeCasW3FkZolDRc8ICE/8fXtq3agR5PaniJHyE04o9ZvD7mQ4621WoRwkrs UDO1hwx9I4aiPo25OUHLeDE0P8Luo80LUafrVXe2+V8bsD6o2TofX2KN3CldMuwar93o X7rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=fbenATTA; 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 cc16si698900edb.65.2020.09.24.16.54.31; Thu, 24 Sep 2020 16:54:54 -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=fbenATTA; 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 S1726676AbgIXXwT (ORCPT + 99 others); Thu, 24 Sep 2020 19:52:19 -0400 Received: from m42-4.mailgun.net ([69.72.42.4]:48328 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726704AbgIXXwR (ORCPT ); Thu, 24 Sep 2020 19:52:17 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1600991536; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=84Zm6i7Jvic5qpawkUmAOufJMHIQOCTsiMPn8kZct3k=; b=fbenATTA8f72IBgyhOYSSK15mgCn0kLgH067bFdIbsl/1sTmFW6elMprTaB6NhY36ipOIUOz ECFRrKnaaBhGeSq2/OaBom9gemcka6ALhMn9CGp41vONiaAwIIGB0YTygPSHR9aSQXABJN9m byC90B4HIP+g6Tp991l6bYxPK1g= X-Mailgun-Sending-Ip: 69.72.42.4 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-n07.prod.us-east-1.postgun.com with SMTP id 5f6d310c89f51cb4f12e93ce (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 24 Sep 2020 23:51:39 GMT Sender: sidgup=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 6EC06C433F1; Thu, 24 Sep 2020 23:51:38 +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 4F6E3C433C8; Thu, 24 Sep 2020 23:51:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4F6E3C433C8 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: agross@kernel.org, bjorn.andersson@linaro.org, ohad@wizery.com, linux-remoteproc@vger.kernel.org Cc: Siddharth Gupta , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tsoni@codeaurora.org, psodagud@codeaurora.org, rishabhb@codeaurora.org, linux-doc@vger.kernel.org Subject: [PATCH v5 0/3] Introduce mini-dump support for remoteproc Date: Thu, 24 Sep 2020 16:51:25 -0700 Message-Id: <1600991488-17877-1-git-send-email-sidgup@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sometimes firmware sizes can be in tens of MB's and reading all the memory during coredump can consume lot of time and memory. Introducing support for mini-dumps. Mini-dump contains smallest amount of useful information, that could help to debug subsystem crashes. During bootup memory is allocated in SMEM (Shared memory) in the form of a table that contains the physical addresses and sizes of the regions that are supposed to be collected during coredump. This memory is shared amongst all processors in a Qualcomm platform, so all remoteprocs fill in their entry in the global table once they are out of reset. This patch series adds support for parsing the global minidump table and uses the current coredump frameork to expose this memory to userspace during remoteproc's recovery. This patch series also integrates the patch: https://patchwork.kernel.org/patch/11695541/ sent by Siddharth. Changelog: v4 -> v5: - Fixed adsp_add_minidump_segments to read IO memory using appropriate functions. v3 -> v4: - Made adsp_priv_cleanup a static function. v2 -> v3: - Refactored code to remove dependency on Qualcomm configs. - Renamed do_rproc_minidump to rproc_minidump and marked as exported symbol. v1 -> v2: - 3 kernel test robot warnings have been resolved. - Introduced priv_cleanup op in order to making the cleaning of private elements used by the remoteproc more readable. - Removed rproc_cleanup_priv as it is no longer needed. - Switched to if/else format for rproc_alloc in order to keep the static const decalaration of adsp_minidump_ops. Siddharth Gupta (3): remoteproc: core: Add ops to enable custom coredump functionality remoteproc: qcom: Add capability to collect minidumps remoteproc: qcom: Add minidump id for sm8150 modem remoteproc drivers/remoteproc/qcom_minidump.h | 64 +++++++++++++ drivers/remoteproc/qcom_q6v5_pas.c | 107 ++++++++++++++++++++- drivers/remoteproc/remoteproc_core.c | 6 +- drivers/remoteproc/remoteproc_coredump.c | 138 ++++++++++++++++++++++++++++ drivers/remoteproc/remoteproc_elf_helpers.h | 27 ++++++ include/linux/remoteproc.h | 5 + 6 files changed, 344 insertions(+), 3 deletions(-) create mode 100644 drivers/remoteproc/qcom_minidump.h -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project