Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp739717rwb; Tue, 29 Nov 2022 04:56:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf5K6maB7UA7MFHoaBoAH8auqG2L4An/5B2r92qXO0PlmannWpOq4nSxF7OndSIuF79pxyy/ X-Received: by 2002:a17:90a:fb49:b0:219:4a5f:a61f with SMTP id iq9-20020a17090afb4900b002194a5fa61fmr4681533pjb.178.1669726582880; Tue, 29 Nov 2022 04:56:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669726582; cv=none; d=google.com; s=arc-20160816; b=VygxXzkZUFmaWCqTzTTgZ/mr0Da2ioAJSoRGd3qLQyCGjzPaKxF5Zc+axTqRChH9w1 8hTclNCMTd+YJdn9hTDsTHSaluut/jAr0h4uguBQrjHDPb3Ka+HDYDkN47m2wr/gJKwX 1YORZErSS0XNx0/9iheYMcB4jBxhiJEtAO/7sDmqa/Axo4qURDOw89I1vSmP3bYekW+m KKjMqVrQWyE3dQk+caNOfIO3LYqIOYD+2Rz3N8iR6/2nDWCCOdgDQNNsYOKYRe+4TdI8 lgcXvlAPETUVrokA0vLb5bOF+S6ztxJ8Y7giOQMQQ//855KBzD0Jz83p2cimrCNHJUX0 l9gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=I40a5ByKq7CdAhmobGTA6XOo+3wRW6w4vIWUZTm1huQ=; b=y9iaReb5/5a9gWTn1NoroHnzbHl770m2bcEkEfBxq6REqOGGK0tseDLQ9Rq5tYAEqg j6Eqfbe+DvzjMTS/AJq5tE2tAOXVCN13Aef0sID/aTWpfnS1mf6hrpWzQ7YKpvQ71YBy Ch9nEG4idqE+CIMu3iAer7OPzYgO1AuVVmgeUf2YRfBuZQV2UWANyokqiWZqzF+8117t 01hYrQUZngTTxEh6iJjPsrJKOukLjviYRLx1dKPv/iEWrd9UKMXZtKO/RENX1xcQDCXY RQMFqWJlBGUco49N3T6+zDfdlR/IwatanJKb6q1HNWxCbw69av585ply4FI3GktCzJG8 zbZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=OOmZ36t9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u38-20020a631426000000b0046fb2a57348si14336967pgl.84.2022.11.29.04.56.11; Tue, 29 Nov 2022 04:56:22 -0800 (PST) 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=@microchip.com header.s=mchp header.b=OOmZ36t9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233589AbiK2MO6 (ORCPT + 83 others); Tue, 29 Nov 2022 07:14:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232344AbiK2MO4 (ORCPT ); Tue, 29 Nov 2022 07:14:56 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F6F459868; Tue, 29 Nov 2022 04:14:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669724095; x=1701260095; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=VB01RoMecb1fnZrCwPJYgm/ivTMxFqaFVHgPsPPtEQU=; b=OOmZ36t9vnqCMW+yM6gJFH5SburRiIEHqeQaXLJHUuy4WNPOmhKUshwE 3AsKM5FB488Z2/Fnz0urVI2Xq5F0l/KroI+r8akr9vopuh3Zw32M13vVA UnyFeWqSPaZCutnysHlXsq9pCzuHubmZcJdN1FvC2/dfSEUx3MpNAYUnu nw28p17GuX5YKX+uDn7yQhQmTp/QsMScbeTeHtTUNZL3iGNYlTFCNU8pI X2nT8nPHHLu4/UZb3eoSAbJfEI5E/l50e/nIanpbOmL4W8hMjubQtOtS1 QASpDbjHICwmajmZCpoTDJXd1iafaxWZVXpMcuaGQhIYbFSeU5IeHtcIM w==; X-IronPort-AV: E=Sophos;i="5.96,203,1665471600"; d="scan'208";a="201836035" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 29 Nov 2022 05:14:54 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Tue, 29 Nov 2022 05:14:54 -0700 Received: from wendy (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12 via Frontend Transport; Tue, 29 Nov 2022 05:14:51 -0700 Date: Tue, 29 Nov 2022 12:14:32 +0000 From: Conor Dooley To: Geert Uytterhoeven CC: Srinivasa Rao Mandadapu , , , , , , , , , , , , , , , , , Subject: Re: [PATCH] ASoC: qcom: lpass-sc7180: Add system suspend/resume PM ops Message-ID: References: <1669621742-28524-1-git-send-email-quic_srivasam@quicinc.com> <3b00c04c-cb6d-9e9a-ba0c-0ce093b4a3fb@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 On Tue, Nov 29, 2022 at 11:53:10AM +0100, Geert Uytterhoeven wrote: > Hi Srinivasa, > > On Tue, Nov 29, 2022 at 11:36 AM Srinivasa Rao Mandadapu > wrote: > > On 11/29/2022 1:23 PM, Geert Uytterhoeven wrote: > > > On Mon, Nov 28, 2022 at 8:50 AM Srinivasa Rao Mandadapu > > > wrote: > > >> Update lpass sc7180 platform driver with PM ops, such as > > >> system supend and resume callbacks. > > >> This update is required to disable clocks during supend and > > >> avoid XO shutdown issue. > > >> > > >> Signed-off-by: Srinivasa Rao Mandadapu > > >> Tested-by: Rahul Ajmeriya > > > Thanks for your patch, which is now commit 2d68148f8f85ca5a ("ASoC: > > > qcom: lpass-sc7180: Add system suspend/resume PM ops") in next-20221129. > > > > > >> --- a/sound/soc/qcom/lpass-sc7180.c > > >> +++ b/sound/soc/qcom/lpass-sc7180.c > > >> @@ -12,6 +12,7 @@ > > >> #include > > >> #include > > >> #include > > >> +#include > > >> #include > > >> #include > > >> #include > > >> @@ -156,10 +157,34 @@ static int sc7180_lpass_exit(struct platform_device *pdev) > > >> struct lpass_data *drvdata = platform_get_drvdata(pdev); > > >> > > >> clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); > > >> + return 0; > > >> +} > > >> + > > >> +static int sc7180_lpass_dev_resume(struct device *dev) > > >> +{ > > >> + int ret = 0; > > >> + struct lpass_data *drvdata = dev_get_drvdata(dev); > > >> > > >> + ret = clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks); > > >> + if (ret) { > > >> + dev_err(dev, "sc7180 clk prepare and enable failed\n"); > > >> + return ret; > > >> + } > > >> + return ret; > > >> +} > > >> + > > >> +static int sc7180_lpass_dev_suspend(struct device *dev) > > >> +{ > > >> + struct lpass_data *drvdata = dev_get_drvdata(dev); > > >> + > > >> + clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); > > >> return 0; > > >> } > > > noreply@ellerman.id.au reports for e.g. m68k-allmodconfig: > > > > > > sound/soc/qcom/lpass-sc7180.c:179:12: error: > > > 'sc7180_lpass_dev_suspend' defined but not used > > > [-Werror=unused-function] > > > sound/soc/qcom/lpass-sc7180.c:166:12: error: > > > 'sc7180_lpass_dev_resume' defined but not used > > > [-Werror=unused-function] > > > > > >> +static const struct dev_pm_ops sc7180_lpass_pm_ops = { > > >> + SET_SYSTEM_SLEEP_PM_OPS(sc7180_lpass_dev_suspend, sc7180_lpass_dev_resume) > > >> +}; > > > Please use DEFINE_SIMPLE_DEV_PM_OPS()... > > Actually, we need to use this patch in in previous kernels 5.4 and 5.15. > > I think these changes won't apply on previous kernel. > > Hence ignoring for now and will take care next time. > > In that case you should add __maybe_unused tags to > sc7180_lpass_dev_suspend() and sc7180_lpass_dev_resume() first, so it > can be backported to 5.4 and 5.15, and do the DEFINE_SIMPLE_DEV_PM_OPS() > conversion later. FWIW, this is now breaking allmodconfig on RISC-V for this reason: make[2]: *** [../scripts/Makefile.build:504: lib] Error 2 ../sound/soc/qcom/lpass-sc7180.c:179:12: error: 'sc7180_lpass_dev_suspend' defined but not used [-Werror=unused-function] 179 | static int sc7180_lpass_dev_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~ ../sound/soc/qcom/lpass-sc7180.c:166:12: error: 'sc7180_lpass_dev_resume' defined but not used [-Werror=unused-function] 166 | static int sc7180_lpass_dev_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Thanks, Conor.