Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2629434pxa; Fri, 7 Aug 2020 16:35:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQLjQa0ampo+qWxDFvvqhsJVUKSnIWs0AZNTpi+TlK+nnXCsnHIhBeyUcd+BkV7uvTZAtR X-Received: by 2002:a50:fc82:: with SMTP id f2mr10948646edq.53.1596843350512; Fri, 07 Aug 2020 16:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596843350; cv=none; d=google.com; s=arc-20160816; b=sK7QTt1QeCzku2mv/IsM8/I4ykON5lLohf6g/dvLZTOoi1pRK2AE2k8pszV2pjcdIQ w97FRM0S2QVyO2vfP4aVnmlrmmB3UqKNsjAW8wGUV8vJWVDHtps6ep/6PGPDEa/eLm4Y tAKgC+KNJ3zBNbMYX9X3trXgDbmiWSd2Obck6FeCtNuHfnqjzw4PXjWbcqibDJ3GnWrs UkPO2qPQhsY3kXeqBBBfQmYTBWNZ8Vhu1PsregrkUQcYLpjEO0lHKRdIrDP3TEmdG82p 2Z9K4Y6rwnXhn7lTKDTmysZ1OdHqcNRUAE+odWDVysdd/q3PKPl1fxNCSCjqm4dGQLSG tyVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=8N/ioSfixBiMAmnbO+m60UJOQX5u7FMMKUTlg6A39Yc=; b=fFbl0Q+ymfG5OAg8CkPaaKcoNd7lSVdP54B+Ch2afZ6WfGQjyQGfa59LXCLAIvFj29 WUHh/kbY2dFYcNUy0KXM1qeDzr3MAdLRQL4WvXMGHkFmfPCcwl1dEDiPxvsxhQtymTpW Qi3a/KgVrfIyN8wECOB6caOJjGyvQVf9ubC67f/sbbWNqbVGPFhkQkDqJjFeL3kbPuW1 Ic7kx2rWLw5Xoup/W1kJuVBRWJ2ofIQBWWly7qAV4iAnpfIW+iJqHd7YzVMJPTRnL8p3 xhE/FWAQxtAp7wFX75AwsVAEsxS12SMleAqRfZaz/xiRVoEvroqRifumoVJkC8EaNLvH pr9g== ARC-Authentication-Results: i=1; mx.google.com; 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 p1si5981894edr.10.2020.08.07.16.35.28; Fri, 07 Aug 2020 16:35:50 -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; 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 S1726448AbgHGXc1 (ORCPT + 99 others); Fri, 7 Aug 2020 19:32:27 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:46483 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbgHGXcW (ORCPT ); Fri, 7 Aug 2020 19:32:22 -0400 Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 07 Aug 2020 16:32:21 -0700 Received: from th-lint-015.qualcomm.com ([10.63.177.64]) by ironmsg03-sd.qualcomm.com with ESMTP; 07 Aug 2020 16:32:20 -0700 Received: by th-lint-015.qualcomm.com (Postfix, from userid 2383757) id D5C8D174E; Fri, 7 Aug 2020 16:32:20 -0700 (PDT) From: Gurbir Arora To: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, tsoni@codeaurora.org, psodagud@codeaurora.org, sidgup@codeaurora.org, rishabhb@codeaurora.org, Gurbir Arora Subject: [PATCH 1/3] remoteproc: core: Add coredump to remoteproc ops Date: Fri, 7 Aug 2020 16:31:59 -0700 Message-Id: <1596843121-82576-2-git-send-email-gurbaror@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1596843121-82576-1-git-send-email-gurbaror@codeaurora.org> References: <1596843121-82576-1-git-send-email-gurbaror@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Each remoteproc might have different requirements for coredumps and might want to choose the type of dumps it wants to collect. This change allows remoteproc drivers to specify their own custom dump function to be executed in place of rproc_coredump. If the coredump op is not specified by the remoteproc driver it will be set to rproc_coredump by default. Signed-off-by: Rishabh Bhatnagar Signed-off-by: Siddharth Gupta Signed-off-by: Gurbir Arora --- drivers/remoteproc/remoteproc_core.c | 6 +++++- include/linux/remoteproc.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 7f90eee..283ecb6 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1681,7 +1681,7 @@ int rproc_trigger_recovery(struct rproc *rproc) goto unlock_mutex; /* generate coredump */ - rproc_coredump(rproc); + rproc->ops->coredump(rproc); /* load firmware */ ret = request_firmware(&firmware_p, rproc->firmware, dev); @@ -2113,6 +2113,10 @@ static int rproc_alloc_ops(struct rproc *rproc, const struct rproc_ops *ops) rproc->ops->sanity_check = rproc_elf_sanity_check; rproc->ops->get_boot_addr = rproc_elf_get_boot_addr; + /* Default to rproc_coredump if no coredump functions is specified */ + if (!rproc->ops->coredump) + rproc->ops->coredump = rproc_coredump; + return 0; } diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 2fa68bf..0ed1a2b 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -392,6 +392,7 @@ struct rproc_ops { int (*load)(struct rproc *rproc, const struct firmware *fw); int (*sanity_check)(struct rproc *rproc, const struct firmware *fw); u64 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw); + void (*coredump)(struct rproc *rproc); unsigned long (*panic)(struct rproc *rproc); }; -- 1.9.1