From patchwork Wed Apr 8 22:18:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Gupta X-Patchwork-Id: 11481031 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 383DA81 for ; Wed, 8 Apr 2020 22:18:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 152272078E for ; Wed, 8 Apr 2020 22:18:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="HLGJXgav" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726534AbgDHWS4 (ORCPT ); Wed, 8 Apr 2020 18:18:56 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:44902 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbgDHWSy (ORCPT ); Wed, 8 Apr 2020 18:18:54 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586384333; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=hb1eX7bss06mePS2zUQBRyjgMYc604+/EGTk9RLwCGk=; b=HLGJXgaveMgQ98aE/FT9s4kJOAdJCgj6Cb6/G0/2SzDO5uotA38Kpef66JimggG1eQYYgIgG 0CWX69Z6hZ1S152654G+l1iYM2Vhe6DwYgX7YzMksK9kNgCS+QvG0XDSy2LCxTsxVtpsw/Bs sAMwyZip+Uqa2p/eiQoutnKfPxY= X-Mailgun-Sending-Ip: 104.130.122.26 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 mxa.mailgun.org with ESMTP id 5e8e4dcb.7f4fdbf7df80-smtp-out-n03; Wed, 08 Apr 2020 22:18:51 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 53ACCC43636; Wed, 8 Apr 2020 22:18:51 +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=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable 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 6335DC4478F; Wed, 8 Apr 2020 22:18:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6335DC4478F 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=none smtp.mailfrom=sidgup@codeaurora.org From: Siddharth Gupta To: bjorn.andersson@linaro.org, ohad@wizery.com Cc: Siddharth Gupta , linux-remoteproc@vger.kernel.org, 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 Subject: [PATCH v2 2/2] remoteproc: core: Prevent sleep when rproc crashes Date: Wed, 8 Apr 2020 15:18:25 -0700 Message-Id: <1586384305-7825-3-git-send-email-sidgup@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1586384305-7825-1-git-send-email-sidgup@codeaurora.org> References: <1586384305-7825-1-git-send-email-sidgup@codeaurora.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Remoteproc recovery should be fast and any delay will have an impact on the user-experience. Add a wakeup source to remoteproc which ensures that the system does not go into idle state while a remoteproc is recovering, thus prevent any delays that might occur during system resume. Signed-off-by: Siddharth Gupta Acked-by: Mathieu Poirier --- drivers/remoteproc/qcom_q6v5_pas.c | 1 + drivers/remoteproc/remoteproc_core.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 7a63efb..6bb2c7d 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -401,6 +401,7 @@ static int adsp_probe(struct platform_device *pdev) adsp = (struct qcom_adsp *)rproc->priv; adsp->dev = &pdev->dev; + device_wakeup_enable(adsp->dev); adsp->rproc = rproc; adsp->pas_id = desc->pas_id; adsp->has_aggre2_clk = desc->has_aggre2_clk; diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 9f99fe2..19a360d 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1729,6 +1729,8 @@ static void rproc_crash_handler_work(struct work_struct *work) if (!rproc->recovery_disabled) rproc_trigger_recovery(rproc); + + pm_relax(rproc->dev.parent); } /** @@ -2273,6 +2275,8 @@ void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type) return; } + pm_stay_awake(rproc->dev.parent); + dev_err(&rproc->dev, "crash detected in %s: type %s\n", rproc->name, rproc_crash_to_string(type));