From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7AE7C4363D for ; Thu, 24 Sep 2020 23:52:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 947FD221E2 for ; Thu, 24 Sep 2020 23:52:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="XqqIyi1/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726808AbgIXXwT (ORCPT ); Thu, 24 Sep 2020 19:52:19 -0400 Received: from z5.mailgun.us ([104.130.96.5]:46671 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726676AbgIXXwS (ORCPT ); Thu, 24 Sep 2020 19:52:18 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1600991538; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=84Zm6i7Jvic5qpawkUmAOufJMHIQOCTsiMPn8kZct3k=; b=XqqIyi1/UOO24t9fd/+SYpL28kZfTkcftbTPdTwhc9i6dVYQLc7qXuPnuOkW856IvNjMrcxQ Rm5aVMU4BaNF8cBr/TO7B0P2ThjYgOblMA6nDMzGMHu0EDlrSHbqHGwqbZFkWniSy+p9IW+M rnIWPmE9qTxI0p9gwalbLpogc9w= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyI4ZWZiZiIsICJsaW51eC1yZW1vdGVwcm9jQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== 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 5f6d310c89f51cb4f12e93cf (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) 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-remoteproc@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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A70AFC4727E for ; Thu, 24 Sep 2020 23:54:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56B5E2071E for ; Thu, 24 Sep 2020 23:54:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fH/fIYJp"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="XqqIyi1/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56B5E2071E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=mB1Gqq3+G2qAx75s0wIQ9v34kt8+Mn//oRLFbIqAoVE=; b=fH/fIYJpUibM4fx+WhVxtKj689 UYn/5Y6o1tm37U3esT3NSEQiExDYjX878ar0jkC1KpHMPV45+rYLo3MDAGlTSaCEFa9O0fPzvCEyB 59QytA/it4CWCklxuO/4mUXKY5ozwyBbuuA8zxe3n8/jKPVW8NIG2hKyeiMQAx58LNSinT1iNCPKf Nb2Dc44SHkOFUYsyl0N9fLtkK52BmxGsBuYmL/wtH1RvPiQJNc+kZ3DpwaWoCd0shyjEAWc74oZgx 8QvaPsy9swjcWWFGG3jloebL+QMiHKN/pSMQ/wr1oW+esw6hWvKHMX+to0Bu3OPebSDOkWb2N7dzb wjrS/B5g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLb2J-0005TU-Qs; Thu, 24 Sep 2020 23:52:27 +0000 Received: from z5.mailgun.us ([104.130.96.5]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLb28-0005Pv-DH for linux-arm-kernel@lists.infradead.org; Thu, 24 Sep 2020 23:52:19 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1600991538; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=84Zm6i7Jvic5qpawkUmAOufJMHIQOCTsiMPn8kZct3k=; b=XqqIyi1/UOO24t9fd/+SYpL28kZfTkcftbTPdTwhc9i6dVYQLc7qXuPnuOkW856IvNjMrcxQ Rm5aVMU4BaNF8cBr/TO7B0P2ThjYgOblMA6nDMzGMHu0EDlrSHbqHGwqbZFkWniSy+p9IW+M rnIWPmE9qTxI0p9gwalbLpogc9w= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyJiYzAxZiIsICJsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5f6d310bb51786209cbafa76 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 24 Sep 2020 23:51:39 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7965EC433CA; Thu, 24 Sep 2020 23:51:38 +0000 (UTC) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200924_195218_661986_DC634634 X-CRM114-Status: GOOD ( 15.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tsoni@codeaurora.org, linux-doc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, rishabhb@codeaurora.org, Siddharth Gupta , psodagud@codeaurora.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel