Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1044493ybb; Wed, 8 Apr 2020 15:20:39 -0700 (PDT) X-Google-Smtp-Source: APiQypLTBZhfzN7ukMqeP6BxzbhexrRoUGy31zPl5f9cBxNnr9yMbvVPOqIA2kGlTo3FtE+XuaCK X-Received: by 2002:a4a:a226:: with SMTP id m38mr1623569ool.94.1586384439160; Wed, 08 Apr 2020 15:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586384439; cv=none; d=google.com; s=arc-20160816; b=QigXl4im7daVSs0jvwoSVYYklRGhqvW10O74jsBNJiTYGUe2b5oBg/cdI0Yv6MIbR9 +nu4//sq3z0lUbCyZQeSTEoMVPYV8kt2dMDymdCOyQzfGgdEAnuJ//n541a5hEbUE5VM T3ZV58y/A4Fi19O5k24GugtxKZJNX0iE716NT3clReN6cr4KIJbmvqaAQGGaTZ9zxC4z SMtsc6z0gVSgvuCggSyRLaLlAe8Nfry+ezeJ4ZE5Oi6TTGBuXyEKM2mzFXnwFMv1GKf6 ajnVgyp9BLArqqw6vKCWKtcAg64bnHFztQEflARx4Jk1TnkUpPBfRwoanOgyEmEK5Q10 SsZw== 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=hb1eX7bss06mePS2zUQBRyjgMYc604+/EGTk9RLwCGk=; b=p2un5v5465itEZt1zkJo3Dk9a1k/7JJ1MCKNbeGm1+5vvF5XNusmoGpKdHIwC+djgP kyCZKNJwyHaeb3Kh1n70IJuijhHfu8r+qE7AXxhqcvcRUgc9Ajq/YJNzGF9hDL54J+u0 7N7qnU5tkixFIoXpPNJ5aRjyEzDfUunLkvpgGzcF895gXqrTWqkU1V1AZk7ssUq6TIOS pWmHgvuPgclDQCK92AIQMA1m2qFwV/+BLPsygRbc8LOc28pNb2EKmyRjoIljMqIoZJwb +dmJduiEUi3OhDgHE5xL/D+LqXtGiyMMqlZgEUl/19bN4eeV0mMQogcw5YEESBKnDxOG WbNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=KSnd93Bp; 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 r11si3011642otd.26.2020.04.08.15.20.24; Wed, 08 Apr 2020 15:20:39 -0700 (PDT) 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=KSnd93Bp; 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 S1726552AbgDHWSw (ORCPT + 99 others); Wed, 8 Apr 2020 18:18:52 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:58982 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726469AbgDHWSw (ORCPT ); Wed, 8 Apr 2020 18:18:52 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586384331; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=hb1eX7bss06mePS2zUQBRyjgMYc604+/EGTk9RLwCGk=; b=KSnd93BpaTfLvoTQj4FBgWNMB3w6J31sUTDAo1wRQgLiFgSjl5T12siJwgH+u68vnH9knQCG rcd87+2N/snrLop2H9wOcVBd2Y5jPT3jcFqA+CDmJ0TL6XG0bjRwT1I9aWg6d4ybnQkbZcVb PH9QJRHOOqBTQMTxhVm13iu+yN0= 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 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-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. 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 --- 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)); -- Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project