Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3376274pxk; Mon, 28 Sep 2020 16:16:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9+eQFCGHVnglPZ3+EUVERuzKqxhcS6gXP85XHTNUIxjJdZmmTbT0r4pbMTvKfxdv6u9Km X-Received: by 2002:a17:906:375a:: with SMTP id e26mr1049720ejc.552.1601334968151; Mon, 28 Sep 2020 16:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601334968; cv=none; d=google.com; s=arc-20160816; b=iKAt3VuarCJpgPtY7SZMDU9w2FcrYBYvqFI0TM+PraKEhB/29gGtASzHS5HR6LhoYc hx4Eovkhw4JYmS9c6q3zSY0+dcIbVf7fOet0PT+zBMUWDrKW5iRh3ZHWztTSb5RPGtnj UDc9YfYRypEgmUvxpyCB5Qk/lNcGVmItSuG9M5XO2Q9ZDsgLiCeFWBmUS+MZ1LIeGh43 TNCb9VwAqqqboQex1n8xmI2RyLB+Xx5k6Q7nsOUnzQFPV7ZTZ8H3Tv5GGQcG5hIaObPK NRYR3AuJL9+3LntYgdnQcdmeFX9JCPSIVlQFq70+AgWnUb/p+nwbiVLIoAbckV2IQ+Nc 62Fg== 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=Jp2gsWi6s/o74F0XHkp2qi6LFuommnCdwk87KdIJ9Kw=; b=Cn1+mLc7K1s0GwlFQb58MwN2yHBcO7bdA96SmTcTCiyrNfMPaBOkQoQFMAOgHJadDM yijqkH26xG9fEgQIG1IwtqD2kRfSnqv31Nz7lLG0n6/DKMv3PlWvZN7SVLZ/pyIAPbDP WEUFePX6+3QpCZtEhYt4pE0uBl8FTqvEwS7JhgCF6sxJw4uJ/J74HxgfqANLJXhelu9F zl/q+uE8du5XflE71jla5sOxewVDYcXPh00qf3mQZI+aDAl3F0owaoqLKEhNaX4V3Xz1 k3xbxUFfLs3AeLHnY2XBL/xlcSlJutpG4KWUtiOpvBTUJr4Tj0E1jqT3JY3irvlHHC9t uwqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=rqPpHxG0; 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 n12si1614528ejr.182.2020.09.28.16.15.12; Mon, 28 Sep 2020 16:16:08 -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=rqPpHxG0; 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 S1726396AbgI1XM5 (ORCPT + 99 others); Mon, 28 Sep 2020 19:12:57 -0400 Received: from m42-4.mailgun.net ([69.72.42.4]:57722 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725272AbgI1XM5 (ORCPT ); Mon, 28 Sep 2020 19:12:57 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1601334775; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=Jp2gsWi6s/o74F0XHkp2qi6LFuommnCdwk87KdIJ9Kw=; b=rqPpHxG04tmOsCehzwxEdUxN2yMn22jl2QArWFi1CQaS6B8dizeAu7aPHGxTRWb9HJyoeFQ2 VHrSC4DVJzCsAAcKbH84wHylLkPZPzbi6OLaCYZodVyoQAMlEkleiUG03R6/G590W59AOPT/ P3jzEaegSxFkwY535jaeWkuTaSo= 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-n01.prod.us-east-1.postgun.com with SMTP id 5f7261122892e2043e87ad50 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 28 Sep 2020 22:17:54 GMT Sender: rishabhb=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id BB24AC433F1; Mon, 28 Sep 2020 22:17:53 +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, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from rishabhb-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: rishabhb) by smtp.codeaurora.org (Postfix) with ESMTPSA id DA85BC433C8; Mon, 28 Sep 2020 22:17:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DA85BC433C8 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=rishabhb@codeaurora.org From: Rishabh Bhatnagar To: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org Cc: tsoni@codeaurora.org, psodagud@codeaurora.org, sidgup@codeaurora.org, Rishabh Bhatnagar Subject: [PATCH v6 3/3] remoteproc: Change default dump configuration to "disabled" Date: Mon, 28 Sep 2020 15:17:36 -0700 Message-Id: <1601331456-20432-4-git-send-email-rishabhb@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601331456-20432-1-git-send-email-rishabhb@codeaurora.org> References: <1601331456-20432-1-git-send-email-rishabhb@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Disable the coredump collection by default as doing so makes sense for production devices. Also rename the "default" configuration option to "enabled" to avoid confusion. Signed-off-by: Rishabh Bhatnagar --- Documentation/ABI/testing/sysfs-class-remoteproc | 10 ++++++---- drivers/remoteproc/remoteproc_coredump.c | 6 +++--- drivers/remoteproc/remoteproc_sysfs.c | 10 +++++----- include/linux/remoteproc.h | 8 ++++---- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-class-remoteproc b/Documentation/ABI/testing/sysfs-class-remoteproc index 7368b50..dec1686 100644 --- a/Documentation/ABI/testing/sysfs-class-remoteproc +++ b/Documentation/ABI/testing/sysfs-class-remoteproc @@ -67,11 +67,14 @@ Description: Remote processor coredump configuration Reports the coredump configuration of the remote processor, which will be one of: - "default" - "inline" "disabled" + "enabled" + "inline" + + "disabled" means no dump will be collected. This is the + default remoteproc coredump configuration. - "default" means when the remote processor's coredump is + "enabled" means when the remote processor's coredump is collected it will be copied to a separate buffer and that buffer is exposed to userspace. @@ -81,7 +84,6 @@ Description: Remote processor coredump configuration copy the dump. Also recovery process will not proceed until all data is read by usersapce. - "disabled" means no dump will be collected. What: /sys/class/remoteproc/.../recovery Date: July 2020 diff --git a/drivers/remoteproc/remoteproc_coredump.c b/drivers/remoteproc/remoteproc_coredump.c index bb15a29..34530dc 100644 --- a/drivers/remoteproc/remoteproc_coredump.c +++ b/drivers/remoteproc/remoteproc_coredump.c @@ -257,7 +257,7 @@ void rproc_coredump(struct rproc *rproc) * directly read from device memory. */ data_size += elf_size_of_phdr(class); - if (dump_conf == RPROC_COREDUMP_DEFAULT) + if (dump_conf == RPROC_COREDUMP_ENABLED) data_size += segment->size; phnum++; @@ -297,14 +297,14 @@ void rproc_coredump(struct rproc *rproc) elf_phdr_set_p_flags(class, phdr, PF_R | PF_W | PF_X); elf_phdr_set_p_align(class, phdr, 0); - if (dump_conf == RPROC_COREDUMP_DEFAULT) + if (dump_conf == RPROC_COREDUMP_ENABLED) rproc_copy_segment(rproc, data + offset, segment, 0, segment->size); offset += elf_phdr_get_p_filesz(class, phdr); phdr += elf_size_of_phdr(class); } - if (dump_conf == RPROC_COREDUMP_DEFAULT) { + if (dump_conf == RPROC_COREDUMP_ENABLED) { dev_coredumpv(&rproc->dev, data, data_size, GFP_KERNEL); return; } diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c index e60a014..eb98ed2 100644 --- a/drivers/remoteproc/remoteproc_sysfs.c +++ b/drivers/remoteproc/remoteproc_sysfs.c @@ -68,12 +68,12 @@ static DEVICE_ATTR_RW(recovery); /* * A coredump-configuration-to-string lookup table, for exposing a * human readable configuration via sysfs. Always keep in sync with - * enum rproc_coredump_mechanism + * enum rproc_dump_mechanism */ static const char * const rproc_coredump_str[] = { - [RPROC_COREDUMP_DEFAULT] = "default", - [RPROC_COREDUMP_INLINE] = "inline", [RPROC_COREDUMP_DISABLED] = "disabled", + [RPROC_COREDUMP_ENABLED] = "enabled", + [RPROC_COREDUMP_INLINE] = "inline", }; /* Expose the current coredump configuration via debugfs */ @@ -115,10 +115,10 @@ static ssize_t coredump_store(struct device *dev, if (sysfs_streq(buf, "disabled")) { rproc->dump_conf = RPROC_COREDUMP_DISABLED; + } else if (sysfs_streq(buf, "enabled")) { + rproc->dump_conf = RPROC_COREDUMP_ENABLED; } else if (sysfs_streq(buf, "inline")) { rproc->dump_conf = RPROC_COREDUMP_INLINE; - } else if (sysfs_streq(buf, "default")) { - rproc->dump_conf = RPROC_COREDUMP_DEFAULT; } else { dev_err(&rproc->dev, "Invalid coredump configuration\n"); return -EINVAL; diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 2fa68bf..3fa3ba6 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -442,16 +442,16 @@ enum rproc_crash_type { /** * enum rproc_dump_mechanism - Coredump options for core - * @RPROC_COREDUMP_DEFAULT: Copy dump to separate buffer and carry on with + * @RPROC_COREDUMP_DISABLED: Don't perform any dump + * @RPROC_COREDUMP_ENABLED: Copy dump to separate buffer and carry on with recovery * @RPROC_COREDUMP_INLINE: Read segments directly from device memory. Stall recovery until all segments are read - * @RPROC_COREDUMP_DISABLED: Don't perform any dump */ enum rproc_dump_mechanism { - RPROC_COREDUMP_DEFAULT, - RPROC_COREDUMP_INLINE, RPROC_COREDUMP_DISABLED, + RPROC_COREDUMP_ENABLED, + RPROC_COREDUMP_INLINE, }; /** -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project