Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp672170pxb; Tue, 5 Apr 2022 18:10:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxA2uktfpovzjVI3weenv21n1By8Hjq/4Zf51BukyIvwcwMwmg7AvDNtEfOgiV2FiiBC0Pt X-Received: by 2002:a17:906:32d8:b0:6ce:d850:f79 with SMTP id k24-20020a17090632d800b006ced8500f79mr5858982ejk.414.1649207428337; Tue, 05 Apr 2022 18:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649207428; cv=none; d=google.com; s=arc-20160816; b=WTlzC7WC2MxGVZq2hU8hwUE40n6v8gg3S1skKo9MWzI1HSbqBe+wGfjS6FKhkDNkGN xnjMtnw25i1JZAvdYYPvECjUuF55ThqfuonyQtHLHsHB7zSKIwq8o55tQYad2l2Aj42+ 4i3NBZQEP0ZKR48GHIU6WFhWffh1I7boyicehBTUqC/uqpmWhIRODS/d7TmVa9W/rJJr QgcGNvQwQidTi0tZJB/PeHeqw4ITfbiS58eKjPJ0IfmFMLBv0jwBi0mEjMYcGQmBgKNX kQGBcT4C1D+BpFvX0zeur+YO358UlvowS3ZG8IBQjcuexYccuF5Fd9vRenyPqfZGcXVk mmQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Bsx48amio1UT8ZHmHVrhHzI/FNOND5Y/WzYHpkX8yRI=; b=koR83+WAaMkGxKk+MFzmGom9VHrhGBayQhdiaC2aJtbw+H106Qa28zfuqFxljXguoF mV/UyvUL/ifhDnPr+NVt9jHbb3b5/1AZ1kcVkBBMiPehNF+C/gSLMUK1zni3IapUkQ7B xfxi/8RFmRWNLubOn6CwtqKVPfhPCctWKuq809KFYnBsChHDqdZEY6UoRJhHjGPsmxK6 YbEikDtf/EDDMWacJv+qoYyvFgwpQR0HZcD83wmPogpe3yBBWl4h+8p9BAKf++nOwZ/J OEaB5c3aApb0X66sYaHAnfG2S2JB7iT1RF7dFEmOUYzsj9XD5Jip9mdOnq06ZWIGI6wK eYxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K6PVNIiv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3-20020a056402430300b00418c2b5bd3asi12433018edc.28.2022.04.05.18.10.02; Tue, 05 Apr 2022 18:10:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K6PVNIiv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353152AbiDENHM (ORCPT + 99 others); Tue, 5 Apr 2022 09:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343996AbiDEJQo (ORCPT ); Tue, 5 Apr 2022 05:16:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A57BC10FFB; Tue, 5 Apr 2022 02:02:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5479FB81BAE; Tue, 5 Apr 2022 09:02:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B352BC385A0; Tue, 5 Apr 2022 09:02:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149371; bh=q1UeRlLEWK3JLoRsaXN04m0q8F3HuCNVdsPigD7nWpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K6PVNIiv82Qe+3nuubNep0Y5mfYkBGt3eZLqgLIAKe+SGQDfpS9p9gmC6ZI1uOL4o TF2N8HTJVR041lzlVxaMkMGRhN+Ygu8u5a3eRCBcqHnstdFh3sZ5lYqnmkIqm+nD8V mP6FTKqYwcygpwQHAqwHL/e/5WEtGhu0JldxDrQ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacky Bai , Robin Gong , Peng Fan , Jassi Brar , Sasha Levin Subject: [PATCH 5.16 0690/1017] mailbox: imx: fix crash in resume on i.mx8ulp Date: Tue, 5 Apr 2022 09:26:43 +0200 Message-Id: <20220405070414.756491194@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Gong [ Upstream commit 8219efd08a0aa1d7944bdb66d84ba57549258968 ] check 'priv->clk' before 'imx_mu_read()' otherwise crash happens on i.mx8ulp, since clock not enabled. Fixes: 4f0b776ef5831 ("mailbox: imx-mailbox: support i.MX8ULP MU") Reviewed-by: Jacky Bai Signed-off-by: Robin Gong Signed-off-by: Peng Fan Signed-off-by: Jassi Brar Signed-off-by: Sasha Levin --- drivers/mailbox/imx-mailbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 544de2db6453..3c9c87b9c872 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -718,7 +718,7 @@ static int __maybe_unused imx_mu_resume_noirq(struct device *dev) * send failed, may lead to system freeze. This issue * is observed by testing freeze mode suspend. */ - if (!imx_mu_read(priv, priv->dcfg->xCR[0]) && !priv->clk) { + if (!priv->clk && !imx_mu_read(priv, priv->dcfg->xCR[0])) { for (i = 0; i < IMX_MU_xCR_MAX; i++) imx_mu_write(priv, priv->xcr[i], priv->dcfg->xCR[i]); } -- 2.34.1