Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp672879pxb; Tue, 5 Apr 2022 18:11:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0+Dc/CeU7R8JEg7mXiaN9jfsCuZnuPj5foelwabCAeqJOUHkUQ2zcbEhhNkjFbtSdhgUn X-Received: by 2002:a05:6402:50cb:b0:418:d750:9cba with SMTP id h11-20020a05640250cb00b00418d7509cbamr6464930edb.16.1649207430067; Tue, 05 Apr 2022 18:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649207430; cv=none; d=google.com; s=arc-20160816; b=wcgVVzavJW3DtdjkhiP+2YepjfgIZiV7rwCaY0qYHUMWhitf5AijZk7J22iO//ZN6R LWMH4evKXzwb7T4vC0XbMj09WF5XSnkJb+TnfOCHbS3q/jLCh8Uitxlju8NFOnHKHz+E 0q4U96Hdrx3KJWD87dX98m7psB8bpZEdRJ+SEJwMv0QlIwHgPn9w1ncDpkoc3PaRhfwc N9ykzhrrBqhCqVinFPvX1x9MLR+ZJAPfxnD3QMexiEw5AyYsnCqY19+QHTwvPDwFUYB0 BK+uTAdOECeOoOUcW+v7VQdJJP+8F485R9cEPbvCw71LmTKM0puulU0g0dB0W+COewDq HqUw== 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=FqG9sUyCuVPH7bo2VjwLiOMFGmLC2kUYg64MFJ1T+IejbRn65LVS1oZbZCBBTjBl5l 4ibGn/x2a3DuQL3b6mx9chikjb6UXz8sk0LAFK7Y7M7QTa5z/xmZSEeu6YXtBiGDfJjp Dth6PcBzC5INRPUGbb128sTixkz+sOfNkuBNQzZa18pMcBxzu3c96xjYUW9O9u3o49jY 5IZihCt/ieMGK0hxaeR8skCuhVPidT/N/y0E1yC51uFHE3cG30cCdkpI5KccA7WS85gi Bh9CeCisEu1z1+3pKehhtQqFSgkbw64Eu27trjJMrhl1EaM5r14H9yWPgUBPS6m/f341 aB4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MLKOIZDU; 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 gy3-20020a170906f24300b006e0d34b7daesi10522630ejb.908.2022.04.05.18.10.05; Tue, 05 Apr 2022 18:10:30 -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=MLKOIZDU; 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 S237307AbiDEJbm (ORCPT + 99 others); Tue, 5 Apr 2022 05:31:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239538AbiDEIUN (ORCPT ); Tue, 5 Apr 2022 04:20:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B66611002; Tue, 5 Apr 2022 01:15:37 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5165A60B0B; Tue, 5 Apr 2022 08:15:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62669C385A0; Tue, 5 Apr 2022 08:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146536; bh=q1UeRlLEWK3JLoRsaXN04m0q8F3HuCNVdsPigD7nWpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MLKOIZDUUYsKln3U0g2kjC/7j6tee7hSCt5teuAw5f2nnUpS0m0xRXH+b/1pQnm1L d4wjBLQF7u3uxGHRt6pHZF6SGZ5vI/52A483V079SNBwfWR5WrorVa8x+nMPBmMGk0 0tpOPY9fye8mwu6Dqihz8p2+pLg4r6APdzz4RYmk= 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.17 0761/1126] mailbox: imx: fix crash in resume on i.mx8ulp Date: Tue, 5 Apr 2022 09:25:08 +0200 Message-Id: <20220405070429.919368725@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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