Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp626441pxb; Mon, 16 Aug 2021 13:25:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYZiROf78vOgIZBpBeglF6lQ53nreDSAUbCEI1uRo7ANt7eYziFlunmvFbfN3SAIUNVwU3 X-Received: by 2002:a50:d749:: with SMTP id i9mr430651edj.248.1629145500842; Mon, 16 Aug 2021 13:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629145500; cv=none; d=google.com; s=arc-20160816; b=p+t4z3FeVplBeq+25HsRD257RUB4BfMq8VSHGvjmj1OGLOuAJW74ylI7UiK6eJPyhX uYErCEZD+WFay8cHouH/bp6F/Omsto5b0AKYHUrCTayYDYDyHel52vBfHZ72fAiSlEGb EqHHOp1c28y04z3C2PN6QaeCoQ3n7XPAM2l8AY0gkgOhQtSf/GXWweb+ijeWuGR1xsa+ kfMw98hfl4JLgbX1YQN4OPCnNKw9MQiuBXd+ouc7Im8utJ91ZWHBk97kL5+0bA3//A50 jIj/FxWfgJJ8NPp+bu0IPF9ZiMPYNQZZNszR5OXEE1FeTgvOzPPvfQTIcjGRc/wrZaYP lEUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=xtLKLxOTgP0hZbfnKrxJuZxeJBYBtihgXnXMIaAKNcM=; b=EG45v38mD6pUson3OPoju+nMQ6wG4nwrzdjaErYHymlBp8SVqTTCqYlfS7d2ps5aU4 Z3VpU+sFlEuaaYeiMnyH6Mt7HWIwYQWCrihVDnXiR8mQsUV3QVi2f4Nn6V6ABTpwcS6b TObJF4D40mhGA4LpNLbGQxf64cJKWyaAT62vhGN4P8Yo5OWFcJ0nKC9TbTqy+j14azSh Bllc91MlNj5vB4QvuCs/vK1bq6CnuGKfrRzpO57gbjbRiRL83/vxAG0WvWl8/frriG4J ixSfzHNT5KnNdk9B9MGbtdDMm8Z53kXbt2UQpWiApcT4KgrX7+VmNbWkL7Ydt5Ryy76j I+gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NS9zm4DW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w12si243711ejv.389.2021.08.16.13.24.38; Mon, 16 Aug 2021 13:25:00 -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=@chromium.org header.s=google header.b=NS9zm4DW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbhHPUXw (ORCPT + 99 others); Mon, 16 Aug 2021 16:23:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231723AbhHPUXv (ORCPT ); Mon, 16 Aug 2021 16:23:51 -0400 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD190C0613C1 for ; Mon, 16 Aug 2021 13:23:19 -0700 (PDT) Received: by mail-oi1-x230.google.com with SMTP id o185so28429862oih.13 for ; Mon, 16 Aug 2021 13:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=xtLKLxOTgP0hZbfnKrxJuZxeJBYBtihgXnXMIaAKNcM=; b=NS9zm4DWA8M5f8Pu+yOte7iHeGwmI955VvFCfdvRX0FM6D81n9hvnWPwxpJ+nsKxOm Kbr9ARehMrAnrwxvRIiKJlz1Va/LH4O0nkzqq5dAQLYL3ByG7MfP4XovhzjWCWgVYGGQ kwOC15KXnGlVs9aab3Rl/6EMapzkpCn04Cwpw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=xtLKLxOTgP0hZbfnKrxJuZxeJBYBtihgXnXMIaAKNcM=; b=O2dBuVpIwOWeJihS5FeRTQnQlv9iBfRd8nxBDxpd5Z/7KcWL776dnEyifh2831uVJm rmlk2nyCZhoC278kTAz0GDrBOnytrJYwcPcM6O1fJFHSVhlmTsgcaygZgvIdl6jxK01T UVV7OsT///dYU5wvirdHYa9w3hj2hQVpxuHm2aX0FO2dEurfZoktmvJ+DlYECOVYFIHd iqpl0Zxpp6ZmNzroH4Z2YDfUH3c4yQ3BYXlITiDWLzQFx8FDBsSnk8lGVOYH/OaPmYVv QQVR8G49A2BvHvw2k+FWouEtV+VJLg4itNLWJv5G6bezfMtrtUnnMQR50wk1DoaEPGJu glVA== X-Gm-Message-State: AOAM53070AV+IONf0HxdkmutHZPxN2FZLyjBEauE/P/k7W1O6FNsz0Qq 6Yrz5pI9yX7+OAxKvMpsOwB7wmN6vFe0qasPH6Si8Q== X-Received: by 2002:a05:6808:114a:: with SMTP id u10mr433479oiu.19.1629145399251; Mon, 16 Aug 2021 13:23:19 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 16 Aug 2021 13:23:18 -0700 MIME-Version: 1.0 In-Reply-To: <1629108335-23463-1-git-send-email-deesin@codeaurora.org> References: <1629108335-23463-1-git-send-email-deesin@codeaurora.org> From: Stephen Boyd User-Agent: alot/0.9.1 Date: Mon, 16 Aug 2021 13:23:18 -0700 Message-ID: Subject: Re: [PATCH V2 1/1] soc: qcom: smp2p: Add wakeup capability to SMP2P IRQ To: Deepak Kumar Singh , bjorn.andersson@linaro.org, clew@codeaurora.org, sibis@codeaurora.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, Andy Gross Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Deepak Kumar Singh (2021-08-16 03:05:35) > Remote susbsystems notify fatal crash throught smp2p interrupt. > When modem/wifi crashes it can cause soc to come out of low power state > and may not allow again to enter in low power state until crash is handled. > > Mark smp2p interrupt wakeup capable so that interrupt handler is executed > and remote susbsystem crash can be handled in system resume path. > > Signed-off-by: Deepak Kumar Singh > --- > drivers/soc/qcom/smp2p.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c > index 2df4883..646848b 100644 > --- a/drivers/soc/qcom/smp2p.c > +++ b/drivers/soc/qcom/smp2p.c > @@ -18,6 +18,7 @@ > #include > #include > #include > +#include Please sort alphabetically by include name, 'p' before 's'. > > /* > * The Shared Memory Point to Point (SMP2P) protocol facilitates communication > @@ -538,9 +539,20 @@ static int qcom_smp2p_probe(struct platform_device *pdev) > goto unwind_interfaces; > } > > + /* Setup smp2p interrupt as wakeup source */ This comment is bad. Please don't reiterate what the code is doing. Instead, write something like /* * Treat remoteproc crashes as wakeups by default so we handle * them sooner rather than along with the next wakeup (e.g. * power button). This avoids leaving the system in a shallower * suspend power state if a remoteproc crashes during suspend, * but requires userspace to actively suspend the device after * handling the crash, or CONFIG_PM_AUTOSLEEP to be true. */ > + ret = device_init_wakeup(&pdev->dev, true); I still wonder if it's better to leave this off by default and only enable it if the kernel is using autosuspend (PM_AUTOSLEEP). Then userspace is responsible to decide if it can handle the wakeup with the screen off, reload the remoteproc, and go back to suspend if it isn't using autosuspend. > + if (ret) > + goto unwind_interfaces; > +