Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp228812ybg; Tue, 2 Jun 2020 22:28:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn1A8RZYESVuiofhkqtvBkMuFqQQVwfHA8gsfnpqVvUL8Ao9aVr4Dq1BW79t3ItQ0wTrEu X-Received: by 2002:a05:6402:2070:: with SMTP id bd16mr3363752edb.35.1591162101113; Tue, 02 Jun 2020 22:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591162101; cv=none; d=google.com; s=arc-20160816; b=Mn2SkOowdh7Hso+Tu4alVtklFW4HtwtKD99+JRZiEI867Dh9ndt0+3jRMZ/IsbYkrk 7ygxtBY76Uint5mkVOaANZaL/2od4/YIlXDyjmYKOSfJbMuwga/9bViTZD5H2HBN641D MczG367WMJMdNQ09UcYjMUUcHhfuhWlFQ2Imr4k93TDAxeJZREhj7fX61aQCDzvAWPr3 kVYiCxbDLSad5iDpZJmK7ICDctxLihR8Lh8SYDLmhpLaCwiGAbFvsvGIDThim5S/Q1mf JPpJVayC5bZnpo5MxRTfL8XMgZAG5QkO1ukdfpAU8KTMHNt09Hv9BsCvZAKISxUbLr0S lJyg== 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=xRSfnYotyFMam2UqJVm7pynKz54tYIS0KnZkUFTge/Q=; b=Tayz10CM4JkoHtHUohIRGbu9l/d0XVMdOY3OemNUtcRRSHO0eZqlUNPtw9qFFxjrCp 0EcLtYw5yaoLvOwPvJOih5RG/qjCprDHZmXKdnL5IF8AyyjAQffYm6UODhouAxzvp3lN BqIpNnuEROazzeAdaw7BQrxwKCKnr75T4x+2DQ4KbwjroMG9WJ/UXVSWf9RYJ6kXub3c 9ecX1t8+aSdM7l9m6r5T3xpriZ9uGCdiiP5IhsrzrNv1WKcyqMAIoqs8xmcjLLqnqMRI VXY3khHAfYICD9H1gGRQiF9FIoMl0og00FNe/Qo9UwVCk1/OrMk7AayIE8r94a7DylTE zRuw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de22si533667edb.242.2020.06.02.22.27.58; Tue, 02 Jun 2020 22:28:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725905AbgFCF0R (ORCPT + 99 others); Wed, 3 Jun 2020 01:26:17 -0400 Received: from inva021.nxp.com ([92.121.34.21]:60144 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725275AbgFCF0O (ORCPT ); Wed, 3 Jun 2020 01:26:14 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id AFF5E200D21; Wed, 3 Jun 2020 07:26:12 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 4C1A7200D53; Wed, 3 Jun 2020 07:26:09 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id B2687402B1; Wed, 3 Jun 2020 13:26:04 +0800 (SGT) From: Anson Huang To: jassisinghbrar@gmail.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Linux-imx@nxp.com Subject: [PATCH 3/3] mailbox: imx: ONLY IPC MU needs IRQF_NO_SUSPEND flag Date: Wed, 3 Jun 2020 13:15:44 +0800 Message-Id: <1591161344-12885-4-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591161344-12885-1-git-send-email-Anson.Huang@nxp.com> References: <1591161344-12885-1-git-send-email-Anson.Huang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org IPC MU has no power domain assigned and there could be IPC during noirq suspend phase, so IRQF_NO_SUSPEND flag is needed for IPC MU. However, for other MUs, they have power domain assigned and their power will be turned off during noirq suspend phase, but with IRQF_NO_SUSPEND set, their interrupts are NOT disabled even after their power turned off, it will cause system crash when mailbox driver trys to handle pending interrupts but the MU power is already turned off. So, IRQF_NO_SUSPEND flag should ONLY be added to IPC MU which has power domain managed by SCU, then all other MUs' pending interrupts after noirq suspend phase will be handled after system resume. Signed-off-by: Anson Huang --- drivers/mailbox/imx-mailbox.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 080b608..7205b82 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -292,6 +292,7 @@ static int imx_mu_startup(struct mbox_chan *chan) { struct imx_mu_priv *priv = to_imx_mu_priv(chan->mbox); struct imx_mu_con_priv *cp = chan->con_priv; + unsigned long irq_flag = IRQF_SHARED; int ret; pm_runtime_get_sync(priv->dev); @@ -302,8 +303,12 @@ static int imx_mu_startup(struct mbox_chan *chan) return 0; } - ret = request_irq(priv->irq, imx_mu_isr, IRQF_SHARED | - IRQF_NO_SUSPEND, cp->irq_desc, chan); + /* IPC MU should be with IRQF_NO_SUSPEND set */ + if (!priv->dev->pm_domain) + irq_flag |= IRQF_NO_SUSPEND; + + ret = request_irq(priv->irq, imx_mu_isr, irq_flag, + cp->irq_desc, chan); if (ret) { dev_err(priv->dev, "Unable to acquire IRQ %d\n", priv->irq); -- 2.7.4