Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp146604ybv; Wed, 19 Feb 2020 18:13:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzm84D6SWzqOhzAgFTyavb+p0xKKr+dVzQrQi8dEVvDzOzkUDrNYwZ9deZa7GwOumwS9c8U X-Received: by 2002:a9d:784b:: with SMTP id c11mr20767517otm.246.1582164780051; Wed, 19 Feb 2020 18:13:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582164780; cv=none; d=google.com; s=arc-20160816; b=bUhNg7UPvnhNcV8pKIAi6Mw3reBacr3c2DMGx+2YCI3PZevSSEMyMfk+KxEVjGHEeV 7pIpMHbbXF5dreP8rxhGVZgOaUJvnRjN+laSCdqRSOAwL6mE6AyRaackantEeQ4Kl9bX KPqloQ47z0zHr7Nrbai76UaWnHpmexT9zqmcJhbhDOJumNfCXz9Jb4K2tj1XwE9PeJ4V uheF/kAsXTgBquj0M031FhIPwWG/x2izz77InylNrtlyy5uT6BFTLC0ynE/67f846KIR P9P60uHSmmi5ZbgIU+zpcrH4Erkr04tOQevE8jMA9ng4V1sP2dXhIZiN+zkrmzkMRUVW YtmQ== 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:dmarc-filter:dkim-signature; bh=t15n6yBKLX2ibvF8ZHGW5Z7Dt9gbYeMrwtq2d0/Wg3w=; b=BIzGGpIFj112phqlw0ASwhYh3IQ17MbE2/4op5nDJ1ooYD1Zx2eY4JF46cMGFOlTgM B0dpRNOj2zI9DK/KX2By20grHSubzB2x2ApA0N7LQN8n80TMUGqpnbnNVW4NQZH4PHgR t21x3dsbvRGrqKHieQ08tC4jL01cD6qz6rHU8lAKSeuC0+prgxgs0ZDsl9jrOc1P42UR Qo+O6YlXAKeFhuvYfmrX0QMNLegMDacc2aneDf2AbKsIy6kWYFUnIpiGG8XAysLKuqfI hPdGs2/baJWndV2ToYdThqEu2kyu7nXbFxb9WdF7O1lR9PhISXtGWamgMw220S1ogM0j kXqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="r/Yxe+YR"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 13si10375277oiy.28.2020.02.19.18.12.48; Wed, 19 Feb 2020 18:13:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="r/Yxe+YR"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727906AbgBTCMO (ORCPT + 99 others); Wed, 19 Feb 2020 21:12:14 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:16745 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727874AbgBTCMO (ORCPT ); Wed, 19 Feb 2020 21:12:14 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1582164733; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=t15n6yBKLX2ibvF8ZHGW5Z7Dt9gbYeMrwtq2d0/Wg3w=; b=r/Yxe+YR4GyO4nxX3jhh/GcPMI0V+CCJ7nGDvDih4rCY/oIQaxaYfxxM3S8fPr6NRCRuFW9Y 3RBgByAYpiHKb3hQLGxNee8K+wHSIfkNGdCM65Lulk407OeZ8m3t2I8rrIiBPUn11+0A5wnG hu+NUTytJEUOZ+dRmQPeMIhx6g0= X-Mailgun-Sending-Ip: 104.130.122.26 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 mxa.mailgun.org with ESMTP id 5e4deaf3.7fc9a66a80a0-smtp-out-n02; Thu, 20 Feb 2020 02:12:03 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 9BC86C447A3; Thu, 20 Feb 2020 02:12:02 +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, URIBL_BLOCKED autolearn=ham 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 E5DE5C447A2; Thu, 20 Feb 2020 02:12:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E5DE5C447A2 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: ohad@wizery.com, bjorn.andersson@linaro.org 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 2/2] remoteproc: core: Prevent sleep when rproc crashes Date: Wed, 19 Feb 2020 18:11:53 -0800 Message-Id: <1582164713-6413-3-git-send-email-sidgup@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582164713-6413-1-git-send-email-sidgup@codeaurora.org> References: <1582164713-6413-1-git-send-email-sidgup@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remoteproc recovery should be fast and any delay will have an impact on the user-experience. Use power management APIs (pm_stay_awake and pm_relax) to ensure that the system does not go to sleep. Signed-off-by: Siddharth Gupta --- drivers/remoteproc/remoteproc_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 5ab65a4..52e318c 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1712,6 +1712,8 @@ static void rproc_crash_handler_work(struct work_struct *work) if (!rproc->recovery_disabled) rproc_trigger_recovery(rproc); + + pm_relax(&rproc->dev); } /** @@ -2242,6 +2244,8 @@ void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type) return; } + pm_stay_awake(&rproc->dev); + dev_err(&rproc->dev, "crash detected in %s: type %s\n", rproc->name, rproc_crash_to_string(type)); -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project