Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B25F5C433F5 for ; Mon, 11 Apr 2022 11:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:CC:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3N1qjy+JerSS19p37qtttyVq7aTBYuNQTU5Hizv8YjI=; b=pGPljDz86jXA/5 peVaqn6lP3/wnWkvhdRJ01mHhp4vKxgKVYT+C3Peg4FLGtwI8hrtQw1+KQ8rat2WUSZawNK4jeeqQ BoKaJJrUKxS8P19x7RV4H2DeU6sbYvVr9xa8Co1g9Au/A9U/Br8zW7R2K1agUVEdNbmBAHZoLw0wV cCn3u8x168YmV9Z0Ziz8o0mQSlpIHYf6k7z+HlPxF0LBDiBnJq1CI7271hhxUsGD+wA+WouA1RshL Tv97exV8Nbo0z6Yosm2EArsvP1oGnYYRC8W6xpL5hzDq+Aiow3EtS0ALRvqeH9AsYoGz9RPaWPB1Q O6xvBs+LPPtdQAuvCGSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndsFH-008hZ4-DQ; Mon, 11 Apr 2022 11:30:11 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndsEm-008hM7-8x; Mon, 11 Apr 2022 11:29:41 +0000 X-UUID: 76bb4422e1654ddea7544f79f0fe6f68-20220411 X-UUID: 76bb4422e1654ddea7544f79f0fe6f68-20220411 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 300111046; Mon, 11 Apr 2022 04:29:36 -0700 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 11 Apr 2022 04:29:35 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 11 Apr 2022 19:29:33 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 11 Apr 2022 19:29:33 +0800 Message-ID: <3b7bf25a3da6c8f780c87784c1f796bf1e464238.camel@mediatek.com> Subject: Re: [PATCH V2 07/15] cpufreq: mediatek: Add opp notification for SVS support From: Rex-BC Chen To: Kevin Hilman , , , , CC: , , , , , , , , , , Andrew-sh.Cheng Date: Mon, 11 Apr 2022 19:29:33 +0800 In-Reply-To: <7hsfqn5nft.fsf@baylibre.com> References: <20220408045908.21671-1-rex-bc.chen@mediatek.com> <20220408045908.21671-8-rex-bc.chen@mediatek.com> <7hsfqn5nft.fsf@baylibre.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220411_042940_399013_07B432D4 X-CRM114-Status: GOOD ( 16.99 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Fri, 2022-04-08 at 13:29 -0700, Kevin Hilman wrote: > Rex-BC Chen writes: > > > From: "Andrew-sh.Cheng" > > > > The Smart Voltage Scaling (SVS) is a hardware which calculates > > suitable > > SVS bank voltages to OPP voltage table. > > > > When the SVS is enabled, cpufreq should listen to opp notification > > and do > > proper actions when receiving events of disable and voltage > > adjustment. > > So listenting for OPP notifications should be done only when SVS is > enabled... > Hello Kevin, Thanks for your review. Yes, the OPP notification is only called from MediaTek SVS. > [...] > > > static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, > > int cpu) > > { > > struct device *cpu_dev; > > @@ -392,6 +455,17 @@ static int mtk_cpu_dvfs_info_init(struct > > mtk_cpu_dvfs_info *info, int cpu) > > info->intermediate_voltage = dev_pm_opp_get_voltage(opp); > > dev_pm_opp_put(opp); > > > > + info->opp_cpu = cpu; > > + info->opp_nb.notifier_call = mtk_cpufreq_opp_notifier; > > + ret = dev_pm_opp_register_notifier(cpu_dev, &info->opp_nb); > > ...but here youlisten to OPP notifications unconditionally. Seems > there > should be a check whether SVS is enabled before deciding to register. > > Kevin Do you think it's ok that we wrap it with the SVS Kconfig define? like #ifdef CONFIG_MTK_SVS mtk_cpufreq_opp_notifier() ... dev_pm_opp_register_notifier() #endif SVS series: message-id:20220221063939.14969-4-roger.lu@mediatek.com BRs, Rex _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek