Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7647002rwl; Thu, 23 Mar 2023 07:05:31 -0700 (PDT) X-Google-Smtp-Source: AK7set+VOBri2R55yTDYaam4OchWdPIv7WrS8nxfYZo4KyALnFsFCmqjstjudKcNp1Wr+Dh+99gF X-Received: by 2002:a17:903:d2:b0:19e:6e00:4676 with SMTP id x18-20020a17090300d200b0019e6e004676mr5132702plc.61.1679580331434; Thu, 23 Mar 2023 07:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679580331; cv=none; d=google.com; s=arc-20160816; b=UuUwgSFYkn8tRBgtz6x0BMSWW/VXx7x/fEOb937k82Alio9qFGeraOh8q6+cx7fSlT NyCBg8/ylLUeg7nqwmAtI9T71csuvVaM1g8YyokDi0MGt8vk99MNhVFeaDFBkp/ISkBy 6g1M6O+UJZB86R07DqeEiCGZsVb2Rw4xokt4McId8V5NxSfwA/uE9C4lLkOFrBYfOxrR lkyt9WOGMLv/JRJrfDqtJ05dtUBuxeuN2VeChwcXumGxwInEJ5jUJOMvngY65sh2Y6Ks L0YqmrqlmjwvXyHFefrVZdapV+kBoiJ0Fkv6ngjTB1WehLRuwD/cvkWcsmyOoIcFcmai HhLA== 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:from:in-reply-to :references:mime-version:dkim-signature; bh=0UGsNG9W2UNoFjKyA3o9SiIejcO47eu8yFQSpE9OdRs=; b=ZlIjQlIAp2vXc/1FowfvUGC0KtI9bg7hIWNgx7VUG9JMAltvd9mDf2taCpF+Zd2qh5 RWD0Megdy244TSGcetITE5r9kf0FoiCfA/QixjoumO4RKBVirSjMbqvnCkc1WiZqLCAL HJK/LnrSQXEEzApNka0S6sxEvRol6JN8nbq3W2Gy2h2VEjlDHuzxw/nQiHbUStIxP0IF Mee89q6/rfLVwUAJZqNpWJNt2hgbSXuluu/sfCGsvWqS7CBA+oQB76cpuKd0fCMy6Eay MHGYmINAUXbwLF1nM4H/36Yzf29O2ZP/PaSxQWCUdpeKFePrOWyn2aY74kBJanXxwc1C ks5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PzDrElI8; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r21-20020a170902e3d500b001a1f6d61e0fsi3194859ple.134.2023.03.23.07.05.17; Thu, 23 Mar 2023 07:05:31 -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=@linaro.org header.s=google header.b=PzDrElI8; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230418AbjCWN5a (ORCPT + 99 others); Thu, 23 Mar 2023 09:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjCWN52 (ORCPT ); Thu, 23 Mar 2023 09:57:28 -0400 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F98F2D69 for ; Thu, 23 Mar 2023 06:57:26 -0700 (PDT) Received: by mail-qt1-x82a.google.com with SMTP id bz27so14816793qtb.1 for ; Thu, 23 Mar 2023 06:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679579845; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0UGsNG9W2UNoFjKyA3o9SiIejcO47eu8yFQSpE9OdRs=; b=PzDrElI8d//E88KzlNQY0S7DnaQI6jMaVTRjxQG2/24vqEDUl3v8eOFIFLbEhlMiCY xbKk/iVjjqH17t43fDNG9ZxrXsA0fOomC6/jDawCYMHxOB9Y7gIKhYanOa0NdgQd0Tir AP0ntaA0L5934i17YnX7azpE4YgRy7QRCNYTnWIWpvwmfCTMzxM/vU+LnRalrf4ykVQO ++YP02zeGsmVJtvlXStzv3aQwkBQUAsCOTXqo3HDlOI3ohkDjPhv+JClrKOxx6zCvw9n wpLRmjvaOhwjGJPe2E6CL+RS1Hn1k3pBWn0ufI+CQEN8t4zfATsciu3w+r2fbK6xcjZv nVoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679579845; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0UGsNG9W2UNoFjKyA3o9SiIejcO47eu8yFQSpE9OdRs=; b=Kz/g5kKM67YxDnw4scDrGYim4yQzIWiwr8CYPPrHHzXbojD2JjwRAJGFAaWqzbfGk+ fGNLOVScl3Qxwem9K4oddmA/xeEEs7dQMmsjvVmF3MeqGtzcWXaEyaVvlKW+8ExgglIK TFrxChSblUOL93FFyCUCx1HPDclB90Y3NVXvcCnXAYwo62ek9fUVoetqsPtf9eJDYhKJ Y+U3D1qg/NJwgJjFr4z8nMUB8CmlaaBq0jeCHkr5bC9WU50wpue3xidWkYpbjSTqyEfL V/JWGpQclR1QI/NYZZzQJt3xnzB25Cn3K2Kj7N47qm7bDv5x1CKlJfWAY5dlfGT2wpXS SeOQ== X-Gm-Message-State: AO0yUKVcsC9hXQPm437NbGX3I0HSSUF4i04Q1eKCnWh06Lyb4oG5jYYr G3iZaiYoGwmYDhl2H5WwAO+GzuV/t8UmHZFlc9zpU1yK0ed7L3Ks X-Received: by 2002:a05:622a:34d:b0:3e3:8a0e:495f with SMTP id r13-20020a05622a034d00b003e38a0e495fmr2368502qtw.13.1679579845233; Thu, 23 Mar 2023 06:57:25 -0700 (PDT) MIME-Version: 1.0 References: <20230323110125.23790-1-srinivas.kandagatla@linaro.org> In-Reply-To: <20230323110125.23790-1-srinivas.kandagatla@linaro.org> From: Amit Pundir Date: Thu, 23 Mar 2023 19:26:49 +0530 Message-ID: Subject: Re: [RESEND PATCH] ASoC: codecs: lpass: fix the order or clks turn off during suspend To: Srinivas Kandagatla Cc: broonie@kernel.org, perex@perex.cz, tiwai@suse.com, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, stable Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Thu, 23 Mar 2023 at 16:31, Srinivas Kandagatla wrote: > > The order in which clocks are stopped matters as some of the clock > like NPL are derived from MCLK. > > Without this patch, Dragonboard RB5 DSP would crash with below error: > qcom_q6v5_pas 17300000.remoteproc: fatal error received: > ABT_dal.c:278:ABTimeout: AHB Bus hang is detected, > Number of bus hang detected := 2 , addr0 = 0x3370000 , addr1 = 0x0!!! > > Turn off fsgen first, followed by npl and then finally mclk, which is exactly > the opposite order of enable sequence. > Tested-by: Amit Pundir CC: stable@vger.kernel.org # v6.1.y > Fixes: 1dc3459009c3 ("ASoC: codecs: lpass: register mclk after runtime pm") > Reported-by: Amit Pundir > Signed-off-by: Srinivas Kandagatla > --- > > Sorry for noise, resending this one, as I missed the asoc mailing list in my previous send. > > > sound/soc/codecs/lpass-rx-macro.c | 4 ++-- > sound/soc/codecs/lpass-tx-macro.c | 4 ++-- > sound/soc/codecs/lpass-wsa-macro.c | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c > index 9e0a4e8a46c3..372bea8b3525 100644 > --- a/sound/soc/codecs/lpass-rx-macro.c > +++ b/sound/soc/codecs/lpass-rx-macro.c > @@ -3668,9 +3668,9 @@ static int __maybe_unused rx_macro_runtime_suspend(struct device *dev) > regcache_cache_only(rx->regmap, true); > regcache_mark_dirty(rx->regmap); > > - clk_disable_unprepare(rx->mclk); > - clk_disable_unprepare(rx->npl); > clk_disable_unprepare(rx->fsgen); > + clk_disable_unprepare(rx->npl); > + clk_disable_unprepare(rx->mclk); > > return 0; > } > diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c > index b044c9c6f89b..d9318799f6b7 100644 > --- a/sound/soc/codecs/lpass-tx-macro.c > +++ b/sound/soc/codecs/lpass-tx-macro.c > @@ -2096,9 +2096,9 @@ static int __maybe_unused tx_macro_runtime_suspend(struct device *dev) > regcache_cache_only(tx->regmap, true); > regcache_mark_dirty(tx->regmap); > > - clk_disable_unprepare(tx->mclk); > - clk_disable_unprepare(tx->npl); > clk_disable_unprepare(tx->fsgen); > + clk_disable_unprepare(tx->npl); > + clk_disable_unprepare(tx->mclk); > > return 0; > } > diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c > index 728f26d12ab0..6484c335bd5d 100644 > --- a/sound/soc/codecs/lpass-wsa-macro.c > +++ b/sound/soc/codecs/lpass-wsa-macro.c > @@ -2504,9 +2504,9 @@ static int __maybe_unused wsa_macro_runtime_suspend(struct device *dev) > regcache_cache_only(wsa->regmap, true); > regcache_mark_dirty(wsa->regmap); > > - clk_disable_unprepare(wsa->mclk); > - clk_disable_unprepare(wsa->npl); > clk_disable_unprepare(wsa->fsgen); > + clk_disable_unprepare(wsa->npl); > + clk_disable_unprepare(wsa->mclk); > > return 0; > } > -- > 2.21.0 >