From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 390C2184A for ; Mon, 9 May 2022 02:53:54 +0000 (UTC) Received: by mail-qk1-f171.google.com with SMTP id j9so9905829qkg.1 for ; Sun, 08 May 2022 19:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=LoAV4vKHtDWHYcjx/HccDNScwoaBWI78ZMg1Lhzn0Kc=; b=AV0eCAcM4dwQEL2GYa+8ylnliPw/IllGlpfo370R8veFGqCZINAxqbvS7tANJ2s101 hqpowH7o2P1pFracXHKx/CFSSdKuDTQXovwowr4M2wabCy9szm+KmIlFL3q2XVP9aSFD euwnuzZhA0WJTHPb7z/Uyl6lOIjxAQRO6XfiogAA1qmX/hRLF+RfjujPcVeU9N47JyqJ OyE28U2bGJlE8aYPrC0FVFBZYKdD3vZwr6JNPThX8buSxKqGRR3MZbWEWSvMminsWp6l xjgximImsPkhRHnAnBBDRdfAWOBekT+9n9Dd5qkxMLoEch5PPmEkKAUNCoElVpTo+Kkh SPPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=LoAV4vKHtDWHYcjx/HccDNScwoaBWI78ZMg1Lhzn0Kc=; b=YMrA8074VW/wXBCcKJzKEBFvaj4oLYWcOkc8ZLLUxwfE+uJdqldRaFiPAWildvweK5 SxU0Jbid2bw1c63str+YzeCiVdfQ9P9qIo2G//w0GgqfnM/vlI62Bl4tDAfnKM/Q+I5Z 2ek5hfrYy5lpTCHT+I+yxPj03QALZ08pz1BCbPTNlCByrP1vyxS9F739purmrjr56XJW 2Cn+1k/utiw1kf0h9TIavaxQGZTfey8Me5VdiJDBYLPuAXllaGUq+bMVFD0CuFCi/HnG EU/bxYanaHReGozdi0Xci3kkrUFDi8JeKlg8fFty9Qhb1z3EpbPt4kULd31NKtZWtfmY fE3A== X-Gm-Message-State: AOAM533oRZxuHgwjdtyDq40JPVoFzu4VKYWJvRojvJnTs5bcseOetPUa 3kepWc4Hpq8bnDSYTdllNZpw83xvg3nAT9E7ces= X-Google-Smtp-Source: ABdhPJxcLQ/dM1ItCcc01DCsbquqlE4w8IbwGnFnYAlwRZQbOLCKc6tQdBjxm5j6pTgbELgQk1Va1n/i48Ro1zrORrM= X-Received: by 2002:a37:ad16:0:b0:6a0:1468:4513 with SMTP id f22-20020a37ad16000000b006a014684513mr10207672qkm.96.1652064833037; Sun, 08 May 2022 19:53:53 -0700 (PDT) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220425125546.4129-3-johnson.wang@mediatek.com> <202204271737.oAuTwqZH-lkp@intel.com> In-Reply-To: Reply-To: cwchoi00@gmail.com From: Chanwoo Choi Date: Mon, 9 May 2022 11:53:16 +0900 Message-ID: Subject: Re: [kbuild-all] Re: [PATCH v3 2/2] PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver To: Chen-Yu Tsai Cc: "Chen, Rong A" , Johnson Wang , kernel test robot , Chanwoo Choi , krzk+dt@kernel.org, Rob Herring , Kyungmin Park , llvm@lists.linux.dev, kbuild-all@lists.01.org, Linux PM list , linux-kernel , devicetree , linux-arm-kernel , linux-mediatek@lists.infradead.org, jia-wei.chang@mediatek.com, Project_Global_Chrome_Upstream_Group@mediatek.com Content-Type: text/plain; charset="UTF-8" Hi Chen-Yu, On Mon, May 9, 2022 at 10:53 AM Chen-Yu Tsai wrote: > > On Thu, Apr 28, 2022 at 7:39 PM Chen, Rong A wrote: > > On 4/27/2022 6:11 PM, Johnson Wang wrote: > > > On Wed, 2022-04-27 at 17:25 +0800, kernel test robot wrote: > > >> Hi Johnson, > > >> > > >> Thank you for the patch! Perhaps something to improve: > > >> > > >> [auto build test WARNING on robh/for-next] > > >> [also build test WARNING on linus/master v5.18-rc4 next-20220427] > > >> [If your patch is applied to the wrong git tree, kindly drop us a > > >> note. > > >> And when submitting patch, we suggest to use '--base' as documented > > >> in > > >> > > > https://urldefense.com/v3/__https://git-scm.com/docs/git-format-patch__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMS_s9zEZ$ > > >> ] > > >> > > >> url: > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/commits/Johnson-Wang/Introduce-MediaTek-CCI-devfreq-driver/20220425-205820__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMc1U_tqz$ > > >> > > >> base: > > >> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMUzTprof$ > > >> for-next > > >> config: hexagon-allyesconfig ( > > >> https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20220427/202204271737.oAuTwqZH-lkp@intel.com/config__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMaVRzbSL$ > > >> ) > > >> compiler: clang version 15.0.0 ( > > >> https://urldefense.com/v3/__https://github.com/llvm/llvm-project__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMRqw5IY-$ > > >> $ 1cddcfdc3c683b393df1a5c9063252eb60e52818) > > >> reproduce (this is a W=1 build): > > >> wget > > >> https://urldefense.com/v3/__https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMQLiD-i9$ > > >> -O ~/bin/make.cross > > >> chmod +x ~/bin/make.cross > > >> # > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/commit/98b34c0587837b0e5b880b11a52433f8f0eee19f__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMU5yd7Y2$ > > >> > > >> git remote add linux-review > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMW4ldtnH$ > > >> > > >> git fetch --no-tags linux-review Johnson-Wang/Introduce- > > >> MediaTek-CCI-devfreq-driver/20220425-205820 > > >> git checkout 98b34c0587837b0e5b880b11a52433f8f0eee19f > > >> # save the config file > > >> mkdir build_dir && cp config build_dir/.config > > >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross > > >> W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash block/partitions/ > > >> drivers/devfreq/ drivers/iio/imu/ drivers/misc/lkdtm/ > > >> > > >> If you fix the issue, kindly add following tag as appropriate > > >> Reported-by: kernel test robot > > >> > > >> All warnings (new ones prefixed by >>): > > >> > > >> drivers/devfreq/mtk-cci-devfreq.c:372:16: error: no member named > > >> 'parent_type' in 'struct devfreq_passive_data' > > >> passive_data->parent_type = CPUFREQ_PARENT_DEV; > > >> ~~~~~~~~~~~~ ^ > > >> drivers/devfreq/mtk-cci-devfreq.c:372:30: error: use of undeclared > > >> identifier 'CPUFREQ_PARENT_DEV' > > >> passive_data->parent_type = CPUFREQ_PARENT_DEV; > > >> ^ > > >>>> drivers/devfreq/mtk-cci-devfreq.c:379:4: warning: format > > >>>> specifies type 'int' but the argument has type 'long' [-Wformat] > > >> > > >> PTR_ERR(drv->devfreq)); > > >> ^~~~~~~~~~~~~~~~~~~~~ > > >> include/linux/dev_printk.h:144:65: note: expanded from macro > > >> 'dev_err' > > >> dev_printk_index_wrap(_dev_err, KERN_ERR, dev, > > >> dev_fmt(fmt), ##__VA_ARGS__) > > >> ~~~ > > >> ^~~~~~~~~~~ > > >> include/linux/dev_printk.h:110:23: note: expanded from macro > > >> 'dev_printk_index_wrap' > > >> _p_func(dev, fmt, > > >> ##__VA_ARGS__); \ > > >> ~~~ ^~~~~~~~~~~ > > >> 1 warning and 2 errors generated. > > >> > > >> > > >> vim +379 drivers/devfreq/mtk-cci-devfreq.c > > >> > > >> 255 > > >> 256 static int mtk_ccifreq_probe(struct platform_device > > >> *pdev) > > >> 257 { > > >> 258 struct device *dev = &pdev->dev; > > >> 259 struct mtk_ccifreq_drv *drv; > > >> 260 struct devfreq_passive_data *passive_data; > > >> 261 struct dev_pm_opp *opp; > > >> 262 unsigned long rate, opp_volt; > > >> 263 int ret; > > >> 264 > > >> 265 drv = devm_kzalloc(dev, sizeof(*drv), > > >> GFP_KERNEL); > > >> 266 if (!drv) > > >> 267 return -ENOMEM; > > >> 268 > > >> 269 drv->dev = dev; > > >> 270 drv->soc_data = (const struct > > >> mtk_ccifreq_platform_data *) > > >> 271 of_device_get_match_dat > > >> a(&pdev->dev); > > >> 272 mutex_init(&drv->reg_lock); > > >> 273 platform_set_drvdata(pdev, drv); > > >> 274 > > >> 275 drv->cci_clk = devm_clk_get(dev, "cci"); > > >> 276 if (IS_ERR(drv->cci_clk)) { > > >> 277 ret = PTR_ERR(drv->cci_clk); > > >> 278 return dev_err_probe(dev, ret, > > >> 279 "failed to get cci > > >> clk: %d\n", ret); > > >> 280 } > > >> 281 > > >> 282 drv->inter_clk = devm_clk_get(dev, > > >> "intermediate"); > > >> 283 if (IS_ERR(drv->inter_clk)) { > > >> 284 ret = PTR_ERR(drv->inter_clk); > > >> 285 dev_err_probe(dev, ret, > > >> 286 "failed to get > > >> intermediate clk: %d\n", ret); > > >> 287 goto out_free_resources; > > >> 288 } > > >> 289 > > >> 290 drv->proc_reg = > > >> devm_regulator_get_optional(dev, "proc"); > > >> 291 if (IS_ERR(drv->proc_reg)) { > > >> 292 ret = PTR_ERR(drv->proc_reg); > > >> 293 dev_err_probe(dev, ret, > > >> 294 "failed to get proc > > >> regulator: %d\n", ret); > > >> 295 goto out_free_resources; > > >> 296 } > > >> 297 > > >> 298 ret = regulator_enable(drv->proc_reg); > > >> 299 if (ret) { > > >> 300 dev_err(dev, "failed to enable proc > > >> regulator\n"); > > >> 301 goto out_free_resources; > > >> 302 } > > >> 303 > > >> 304 drv->sram_reg = regulator_get_optional(dev, > > >> "sram"); > > >> 305 if (IS_ERR(drv->sram_reg)) > > >> 306 drv->sram_reg = NULL; > > >> 307 else { > > >> 308 ret = regulator_enable(drv->sram_reg); > > >> 309 if (ret) { > > >> 310 dev_err(dev, "failed to enable > > >> sram regulator\n"); > > >> 311 goto out_free_resources; > > >> 312 } > > >> 313 } > > >> 314 > > >> 315 /* > > >> 316 * We assume min voltage is 0 and tracking > > >> target voltage using > > >> 317 * min_volt_shift for each iteration. > > >> 318 * The retry_max is 3 times of expeted > > >> iteration count. > > >> 319 */ > > >> 320 drv->vtrack_max = 3 * DIV_ROUND_UP(max(drv- > > >>> soc_data->sram_max_volt, > > >> 321 drv- > > >>> soc_data->proc_max_volt), > > >> 322 drv- > > >>> soc_data->min_volt_shift); > > >> 323 > > >> 324 ret = clk_prepare_enable(drv->cci_clk); > > >> 325 if (ret) > > >> 326 goto out_free_resources; > > >> 327 > > >> 328 ret = clk_prepare_enable(drv->inter_clk); > > >> 329 if (ret) > > >> 330 goto out_disable_cci_clk; > > >> 331 > > >> 332 ret = dev_pm_opp_of_add_table(dev); > > >> 333 if (ret) { > > >> 334 dev_err(dev, "failed to add opp table: > > >> %d\n", ret); > > >> 335 goto out_disable_inter_clk; > > >> 336 } > > >> 337 > > >> 338 rate = clk_get_rate(drv->inter_clk); > > >> 339 opp = dev_pm_opp_find_freq_ceil(dev, &rate); > > >> 340 if (IS_ERR(opp)) { > > >> 341 ret = PTR_ERR(opp); > > >> 342 dev_err(dev, "failed to get > > >> intermediate opp: %d\n", ret); > > >> 343 goto out_remove_opp_table; > > >> 344 } > > >> 345 drv->inter_voltage = > > >> dev_pm_opp_get_voltage(opp); > > >> 346 dev_pm_opp_put(opp); > > >> 347 > > >> 348 rate = U32_MAX; > > >> 349 opp = dev_pm_opp_find_freq_floor(drv->dev, > > >> &rate); > > >> 350 if (IS_ERR(opp)) { > > >> 351 dev_err(dev, "failed to get opp\n"); > > >> 352 ret = PTR_ERR(opp); > > >> 353 goto out_remove_opp_table; > > >> 354 } > > >> 355 > > >> 356 opp_volt = dev_pm_opp_get_voltage(opp); > > >> 357 dev_pm_opp_put(opp); > > >> 358 ret = mtk_ccifreq_set_voltage(drv, opp_volt); > > >> 359 if (ret) { > > >> 360 dev_err(dev, "failed to scale to > > >> highest voltage %lu in proc_reg\n", > > >> 361 opp_volt); > > >> 362 goto out_remove_opp_table; > > >> 363 } > > >> 364 > > >> 365 passive_data = devm_kzalloc(dev, sizeof(struct > > >> devfreq_passive_data), > > >> 366 GFP_KERNEL); > > >> 367 if (!passive_data) { > > >> 368 ret = -ENOMEM; > > >> 369 goto out_remove_opp_table; > > >> 370 } > > >> 371 > > >> 372 passive_data->parent_type = CPUFREQ_PARENT_DEV; > > >> 373 drv->devfreq = devm_devfreq_add_device(dev, > > >> &mtk_ccifreq_profile, > > >> 374 DEVFREQ_ > > >> GOV_PASSIVE, > > >> 375 passive_ > > >> data); > > >> 376 if (IS_ERR(drv->devfreq)) { > > >> 377 ret = -EPROBE_DEFER; > > >> 378 dev_err(dev, "failed to add devfreq > > >> device: %d\n", > > >> > 379 PTR_ERR(drv->devfreq)); > > >> 380 goto out_remove_opp_table; > > >> 381 } > > >> 382 > > >> 383 drv->opp_nb.notifier_call = > > >> mtk_ccifreq_opp_notifier; > > >> 384 ret = dev_pm_opp_register_notifier(dev, &drv- > > >>> opp_nb); > > >> 385 if (ret) { > > >> 386 dev_err(dev, "failed to register opp > > >> notifier: %d\n", ret); > > >> 387 goto out_remove_devfreq_device; > > >> 388 } > > >> 389 return 0; > > >> 390 > > >> 391 out_remove_devfreq_device: > > >> 392 devm_devfreq_remove_device(dev, drv->devfreq); > > >> 393 > > >> 394 out_remove_opp_table: > > >> 395 dev_pm_opp_of_remove_table(dev); > > >> 396 > > >> 397 out_disable_inter_clk: > > >> 398 clk_disable_unprepare(drv->inter_clk); > > >> 399 > > >> 400 out_disable_cci_clk: > > >> 401 clk_disable_unprepare(drv->cci_clk); > > >> 402 > > >> 403 out_free_resources: > > >> 404 if (regulator_is_enabled(drv->proc_reg)) > > >> 405 regulator_disable(drv->proc_reg); > > >> 406 if (drv->sram_reg && regulator_is_enabled(drv- > > >>> sram_reg)) > > >> 407 regulator_disable(drv->sram_reg); > > >> 408 > > >> 409 if (!IS_ERR(drv->proc_reg)) > > >> 410 regulator_put(drv->proc_reg); > > >> 411 if (!IS_ERR(drv->sram_reg)) > > >> 412 regulator_put(drv->sram_reg); > > >> 413 if (!IS_ERR(drv->cci_clk)) > > >> 414 clk_put(drv->cci_clk); > > >> 415 if (!IS_ERR(drv->inter_clk)) > > >> 416 clk_put(drv->inter_clk); > > >> 417 > > >> 418 return ret; > > >> 419 } > > >> 420 > > >> > > > > > > Hi "kernel test robot", > > > > > > Thanks for your review. > > > > > > This patch is based on chanwoo/devfreq-testing[1] > > > [1] > > > https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/log/?h=devfreq-testing > > > > Hi Johnson, > > > > Thanks for the feedback, we'll take a look too. > > I think the last patch on that branch might be broken. You mean the patch[1]. Without this patch[1], there are no problems? [1] https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/commit/?h=devfreq-testing&id=ea1011fba665b95fc28f682c9b131799a88b11ae When you tested these patches with patchset[2] without last patch[1] if there are no problems, please reply to patchset[2] with your Tested-by tag. [2] https://patchwork.kernel.org/project/linux-pm/cover/20220507150145.531864-1-cw00.choi@samsung.com/ -- Best Regards, Chanwoo Choi From mboxrd@z Thu Jan 1 00:00:00 1970 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 B9938C433F5 for ; Mon, 9 May 2022 02:54: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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date :From:In-Reply-To:References:MIME-Version:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/erZGJz65mPTJvZQ3Nl7397SW6qSGKiDQm+TdUHYwJ8=; b=NANMCJAm/CwtNn Cdl7NTz5XFRBZL7W/nJM2n728PwFnOvmJ8XauISF+bmNASk5B5KTXrtezHioJoCZCESFRgYC1/0it M1MtZytU/FaYSntZ1bU+sRs7eWtGTBVFtqj6Bdcl1BBPkjP0eQOmhsmNK5NhbF3RHwIi0cxIzyOpn tHPaDsMUIWKyKD74oGRY3Wcb/tvNO+v1NMcJPYPonUOGtK2AzOjKbqCGG0ucsMoMplsM8RSwHisBe Gorr5IwholdFOXSW5YgTZOrQmp+/31jC4Q6WtwoWvuqYTuZYr+R/Tkxfj19YVb7Jd2L/efSmPEVR+ 8P87urM7r5HpRr3g+kdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nntXE-00C6H8-Rq; Mon, 09 May 2022 02:54:08 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nntX1-00C6FN-2q; Mon, 09 May 2022 02:53:57 +0000 Received: by mail-qk1-x72e.google.com with SMTP id a76so9887447qkg.12; Sun, 08 May 2022 19:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=LoAV4vKHtDWHYcjx/HccDNScwoaBWI78ZMg1Lhzn0Kc=; b=AV0eCAcM4dwQEL2GYa+8ylnliPw/IllGlpfo370R8veFGqCZINAxqbvS7tANJ2s101 hqpowH7o2P1pFracXHKx/CFSSdKuDTQXovwowr4M2wabCy9szm+KmIlFL3q2XVP9aSFD euwnuzZhA0WJTHPb7z/Uyl6lOIjxAQRO6XfiogAA1qmX/hRLF+RfjujPcVeU9N47JyqJ OyE28U2bGJlE8aYPrC0FVFBZYKdD3vZwr6JNPThX8buSxKqGRR3MZbWEWSvMminsWp6l xjgximImsPkhRHnAnBBDRdfAWOBekT+9n9Dd5qkxMLoEch5PPmEkKAUNCoElVpTo+Kkh SPPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=LoAV4vKHtDWHYcjx/HccDNScwoaBWI78ZMg1Lhzn0Kc=; b=e7nrnRafv4z5VOLDBmlsPwG4OVWvYClM7nX8hdjb3nFQuz0ZRj0yM4swzrHO+cDM8w JIPTyZgDTqutgi45DBwkna73kqSIYmV09h+HZ/XFgzUsHqo3G+NW/Ezg13DxNL/8yVZ/ EMmAEdFbouLA0LHh0PTBBZn5h+2VmyTFODIYCWRHPBC3njL749PKfAO8BALHHJz3rnbr Hst4ItQUJxVsg4eI+ru0xoyE081dhWVoc5CpOrgX+L+7hx704Vz9AHOTOixcgI9ojFmc DhLqHpqyJc03FMRytYhPX0rf3GIERm2it8o2SnygPRSAfPfpXS9lOsUQFc9P9A3W52Q+ QuNw== X-Gm-Message-State: AOAM530NHZrNojnc+Lmk0gBoMFMSdA4TWoUnGkbBytbjMnPKQ3hbFE/C EYbU9qM6eA1JETWj+s6XlayBEA1ikdudaqUkQdU= X-Google-Smtp-Source: ABdhPJxcLQ/dM1ItCcc01DCsbquqlE4w8IbwGnFnYAlwRZQbOLCKc6tQdBjxm5j6pTgbELgQk1Va1n/i48Ro1zrORrM= X-Received: by 2002:a37:ad16:0:b0:6a0:1468:4513 with SMTP id f22-20020a37ad16000000b006a014684513mr10207672qkm.96.1652064833037; Sun, 08 May 2022 19:53:53 -0700 (PDT) MIME-Version: 1.0 References: <20220425125546.4129-3-johnson.wang@mediatek.com> <202204271737.oAuTwqZH-lkp@intel.com> In-Reply-To: From: Chanwoo Choi Date: Mon, 9 May 2022 11:53:16 +0900 Message-ID: Subject: Re: [kbuild-all] Re: [PATCH v3 2/2] PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver To: Chen-Yu Tsai Cc: "Chen, Rong A" , Johnson Wang , kernel test robot , Chanwoo Choi , krzk+dt@kernel.org, Rob Herring , Kyungmin Park , llvm@lists.linux.dev, kbuild-all@lists.01.org, Linux PM list , linux-kernel , devicetree , linux-arm-kernel , linux-mediatek@lists.infradead.org, jia-wei.chang@mediatek.com, Project_Global_Chrome_Upstream_Group@mediatek.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220508_195355_200951_971B1F1B X-CRM114-Status: GOOD ( 30.16 ) 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: , Reply-To: cwchoi00@gmail.com 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 Hi Chen-Yu, On Mon, May 9, 2022 at 10:53 AM Chen-Yu Tsai wrote: > > On Thu, Apr 28, 2022 at 7:39 PM Chen, Rong A wrote: > > On 4/27/2022 6:11 PM, Johnson Wang wrote: > > > On Wed, 2022-04-27 at 17:25 +0800, kernel test robot wrote: > > >> Hi Johnson, > > >> > > >> Thank you for the patch! Perhaps something to improve: > > >> > > >> [auto build test WARNING on robh/for-next] > > >> [also build test WARNING on linus/master v5.18-rc4 next-20220427] > > >> [If your patch is applied to the wrong git tree, kindly drop us a > > >> note. > > >> And when submitting patch, we suggest to use '--base' as documented > > >> in > > >> > > > https://urldefense.com/v3/__https://git-scm.com/docs/git-format-patch__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMS_s9zEZ$ > > >> ] > > >> > > >> url: > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/commits/Johnson-Wang/Introduce-MediaTek-CCI-devfreq-driver/20220425-205820__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMc1U_tqz$ > > >> > > >> base: > > >> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMUzTprof$ > > >> for-next > > >> config: hexagon-allyesconfig ( > > >> https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20220427/202204271737.oAuTwqZH-lkp@intel.com/config__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMaVRzbSL$ > > >> ) > > >> compiler: clang version 15.0.0 ( > > >> https://urldefense.com/v3/__https://github.com/llvm/llvm-project__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMRqw5IY-$ > > >> $ 1cddcfdc3c683b393df1a5c9063252eb60e52818) > > >> reproduce (this is a W=1 build): > > >> wget > > >> https://urldefense.com/v3/__https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMQLiD-i9$ > > >> -O ~/bin/make.cross > > >> chmod +x ~/bin/make.cross > > >> # > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/commit/98b34c0587837b0e5b880b11a52433f8f0eee19f__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMU5yd7Y2$ > > >> > > >> git remote add linux-review > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMW4ldtnH$ > > >> > > >> git fetch --no-tags linux-review Johnson-Wang/Introduce- > > >> MediaTek-CCI-devfreq-driver/20220425-205820 > > >> git checkout 98b34c0587837b0e5b880b11a52433f8f0eee19f > > >> # save the config file > > >> mkdir build_dir && cp config build_dir/.config > > >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross > > >> W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash block/partitions/ > > >> drivers/devfreq/ drivers/iio/imu/ drivers/misc/lkdtm/ > > >> > > >> If you fix the issue, kindly add following tag as appropriate > > >> Reported-by: kernel test robot > > >> > > >> All warnings (new ones prefixed by >>): > > >> > > >> drivers/devfreq/mtk-cci-devfreq.c:372:16: error: no member named > > >> 'parent_type' in 'struct devfreq_passive_data' > > >> passive_data->parent_type = CPUFREQ_PARENT_DEV; > > >> ~~~~~~~~~~~~ ^ > > >> drivers/devfreq/mtk-cci-devfreq.c:372:30: error: use of undeclared > > >> identifier 'CPUFREQ_PARENT_DEV' > > >> passive_data->parent_type = CPUFREQ_PARENT_DEV; > > >> ^ > > >>>> drivers/devfreq/mtk-cci-devfreq.c:379:4: warning: format > > >>>> specifies type 'int' but the argument has type 'long' [-Wformat] > > >> > > >> PTR_ERR(drv->devfreq)); > > >> ^~~~~~~~~~~~~~~~~~~~~ > > >> include/linux/dev_printk.h:144:65: note: expanded from macro > > >> 'dev_err' > > >> dev_printk_index_wrap(_dev_err, KERN_ERR, dev, > > >> dev_fmt(fmt), ##__VA_ARGS__) > > >> ~~~ > > >> ^~~~~~~~~~~ > > >> include/linux/dev_printk.h:110:23: note: expanded from macro > > >> 'dev_printk_index_wrap' > > >> _p_func(dev, fmt, > > >> ##__VA_ARGS__); \ > > >> ~~~ ^~~~~~~~~~~ > > >> 1 warning and 2 errors generated. > > >> > > >> > > >> vim +379 drivers/devfreq/mtk-cci-devfreq.c > > >> > > >> 255 > > >> 256 static int mtk_ccifreq_probe(struct platform_device > > >> *pdev) > > >> 257 { > > >> 258 struct device *dev = &pdev->dev; > > >> 259 struct mtk_ccifreq_drv *drv; > > >> 260 struct devfreq_passive_data *passive_data; > > >> 261 struct dev_pm_opp *opp; > > >> 262 unsigned long rate, opp_volt; > > >> 263 int ret; > > >> 264 > > >> 265 drv = devm_kzalloc(dev, sizeof(*drv), > > >> GFP_KERNEL); > > >> 266 if (!drv) > > >> 267 return -ENOMEM; > > >> 268 > > >> 269 drv->dev = dev; > > >> 270 drv->soc_data = (const struct > > >> mtk_ccifreq_platform_data *) > > >> 271 of_device_get_match_dat > > >> a(&pdev->dev); > > >> 272 mutex_init(&drv->reg_lock); > > >> 273 platform_set_drvdata(pdev, drv); > > >> 274 > > >> 275 drv->cci_clk = devm_clk_get(dev, "cci"); > > >> 276 if (IS_ERR(drv->cci_clk)) { > > >> 277 ret = PTR_ERR(drv->cci_clk); > > >> 278 return dev_err_probe(dev, ret, > > >> 279 "failed to get cci > > >> clk: %d\n", ret); > > >> 280 } > > >> 281 > > >> 282 drv->inter_clk = devm_clk_get(dev, > > >> "intermediate"); > > >> 283 if (IS_ERR(drv->inter_clk)) { > > >> 284 ret = PTR_ERR(drv->inter_clk); > > >> 285 dev_err_probe(dev, ret, > > >> 286 "failed to get > > >> intermediate clk: %d\n", ret); > > >> 287 goto out_free_resources; > > >> 288 } > > >> 289 > > >> 290 drv->proc_reg = > > >> devm_regulator_get_optional(dev, "proc"); > > >> 291 if (IS_ERR(drv->proc_reg)) { > > >> 292 ret = PTR_ERR(drv->proc_reg); > > >> 293 dev_err_probe(dev, ret, > > >> 294 "failed to get proc > > >> regulator: %d\n", ret); > > >> 295 goto out_free_resources; > > >> 296 } > > >> 297 > > >> 298 ret = regulator_enable(drv->proc_reg); > > >> 299 if (ret) { > > >> 300 dev_err(dev, "failed to enable proc > > >> regulator\n"); > > >> 301 goto out_free_resources; > > >> 302 } > > >> 303 > > >> 304 drv->sram_reg = regulator_get_optional(dev, > > >> "sram"); > > >> 305 if (IS_ERR(drv->sram_reg)) > > >> 306 drv->sram_reg = NULL; > > >> 307 else { > > >> 308 ret = regulator_enable(drv->sram_reg); > > >> 309 if (ret) { > > >> 310 dev_err(dev, "failed to enable > > >> sram regulator\n"); > > >> 311 goto out_free_resources; > > >> 312 } > > >> 313 } > > >> 314 > > >> 315 /* > > >> 316 * We assume min voltage is 0 and tracking > > >> target voltage using > > >> 317 * min_volt_shift for each iteration. > > >> 318 * The retry_max is 3 times of expeted > > >> iteration count. > > >> 319 */ > > >> 320 drv->vtrack_max = 3 * DIV_ROUND_UP(max(drv- > > >>> soc_data->sram_max_volt, > > >> 321 drv- > > >>> soc_data->proc_max_volt), > > >> 322 drv- > > >>> soc_data->min_volt_shift); > > >> 323 > > >> 324 ret = clk_prepare_enable(drv->cci_clk); > > >> 325 if (ret) > > >> 326 goto out_free_resources; > > >> 327 > > >> 328 ret = clk_prepare_enable(drv->inter_clk); > > >> 329 if (ret) > > >> 330 goto out_disable_cci_clk; > > >> 331 > > >> 332 ret = dev_pm_opp_of_add_table(dev); > > >> 333 if (ret) { > > >> 334 dev_err(dev, "failed to add opp table: > > >> %d\n", ret); > > >> 335 goto out_disable_inter_clk; > > >> 336 } > > >> 337 > > >> 338 rate = clk_get_rate(drv->inter_clk); > > >> 339 opp = dev_pm_opp_find_freq_ceil(dev, &rate); > > >> 340 if (IS_ERR(opp)) { > > >> 341 ret = PTR_ERR(opp); > > >> 342 dev_err(dev, "failed to get > > >> intermediate opp: %d\n", ret); > > >> 343 goto out_remove_opp_table; > > >> 344 } > > >> 345 drv->inter_voltage = > > >> dev_pm_opp_get_voltage(opp); > > >> 346 dev_pm_opp_put(opp); > > >> 347 > > >> 348 rate = U32_MAX; > > >> 349 opp = dev_pm_opp_find_freq_floor(drv->dev, > > >> &rate); > > >> 350 if (IS_ERR(opp)) { > > >> 351 dev_err(dev, "failed to get opp\n"); > > >> 352 ret = PTR_ERR(opp); > > >> 353 goto out_remove_opp_table; > > >> 354 } > > >> 355 > > >> 356 opp_volt = dev_pm_opp_get_voltage(opp); > > >> 357 dev_pm_opp_put(opp); > > >> 358 ret = mtk_ccifreq_set_voltage(drv, opp_volt); > > >> 359 if (ret) { > > >> 360 dev_err(dev, "failed to scale to > > >> highest voltage %lu in proc_reg\n", > > >> 361 opp_volt); > > >> 362 goto out_remove_opp_table; > > >> 363 } > > >> 364 > > >> 365 passive_data = devm_kzalloc(dev, sizeof(struct > > >> devfreq_passive_data), > > >> 366 GFP_KERNEL); > > >> 367 if (!passive_data) { > > >> 368 ret = -ENOMEM; > > >> 369 goto out_remove_opp_table; > > >> 370 } > > >> 371 > > >> 372 passive_data->parent_type = CPUFREQ_PARENT_DEV; > > >> 373 drv->devfreq = devm_devfreq_add_device(dev, > > >> &mtk_ccifreq_profile, > > >> 374 DEVFREQ_ > > >> GOV_PASSIVE, > > >> 375 passive_ > > >> data); > > >> 376 if (IS_ERR(drv->devfreq)) { > > >> 377 ret = -EPROBE_DEFER; > > >> 378 dev_err(dev, "failed to add devfreq > > >> device: %d\n", > > >> > 379 PTR_ERR(drv->devfreq)); > > >> 380 goto out_remove_opp_table; > > >> 381 } > > >> 382 > > >> 383 drv->opp_nb.notifier_call = > > >> mtk_ccifreq_opp_notifier; > > >> 384 ret = dev_pm_opp_register_notifier(dev, &drv- > > >>> opp_nb); > > >> 385 if (ret) { > > >> 386 dev_err(dev, "failed to register opp > > >> notifier: %d\n", ret); > > >> 387 goto out_remove_devfreq_device; > > >> 388 } > > >> 389 return 0; > > >> 390 > > >> 391 out_remove_devfreq_device: > > >> 392 devm_devfreq_remove_device(dev, drv->devfreq); > > >> 393 > > >> 394 out_remove_opp_table: > > >> 395 dev_pm_opp_of_remove_table(dev); > > >> 396 > > >> 397 out_disable_inter_clk: > > >> 398 clk_disable_unprepare(drv->inter_clk); > > >> 399 > > >> 400 out_disable_cci_clk: > > >> 401 clk_disable_unprepare(drv->cci_clk); > > >> 402 > > >> 403 out_free_resources: > > >> 404 if (regulator_is_enabled(drv->proc_reg)) > > >> 405 regulator_disable(drv->proc_reg); > > >> 406 if (drv->sram_reg && regulator_is_enabled(drv- > > >>> sram_reg)) > > >> 407 regulator_disable(drv->sram_reg); > > >> 408 > > >> 409 if (!IS_ERR(drv->proc_reg)) > > >> 410 regulator_put(drv->proc_reg); > > >> 411 if (!IS_ERR(drv->sram_reg)) > > >> 412 regulator_put(drv->sram_reg); > > >> 413 if (!IS_ERR(drv->cci_clk)) > > >> 414 clk_put(drv->cci_clk); > > >> 415 if (!IS_ERR(drv->inter_clk)) > > >> 416 clk_put(drv->inter_clk); > > >> 417 > > >> 418 return ret; > > >> 419 } > > >> 420 > > >> > > > > > > Hi "kernel test robot", > > > > > > Thanks for your review. > > > > > > This patch is based on chanwoo/devfreq-testing[1] > > > [1] > > > https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/log/?h=devfreq-testing > > > > Hi Johnson, > > > > Thanks for the feedback, we'll take a look too. > > I think the last patch on that branch might be broken. You mean the patch[1]. Without this patch[1], there are no problems? [1] https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/commit/?h=devfreq-testing&id=ea1011fba665b95fc28f682c9b131799a88b11ae When you tested these patches with patchset[2] without last patch[1] if there are no problems, please reply to patchset[2] with your Tested-by tag. [2] https://patchwork.kernel.org/project/linux-pm/cover/20220507150145.531864-1-cw00.choi@samsung.com/ -- Best Regards, Chanwoo Choi _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 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 728A2C433F5 for ; Mon, 9 May 2022 02:55:22 +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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date :From:In-Reply-To:References:MIME-Version:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6GLJrocuR8bokvREZzpqPjjnv7OWba1oHN8QtvE8lWw=; b=MUzKduuk80oefZ 4VJLOFBkstVBX529i01PtAD3PmaNVF7m6hd+DG/EJYl/TznyH426CNaX8yR8rLSfvTccobSWdzHgm goOaB+InBx9TeNKZCeDdquINcfxObwyoTt6cTkefZu244qgsTwIXMnbmaebahMCGPjgg50F+e30LW R3xfnPl88MQZt9tWQQl2OTdfVwyvMRrfVyaWyZnsp6EgDCwBjDlJwB5aWwv/VgedkLCBhXqFE0ppS qdC3qkhKL7DW9dmw2ghxpyOeUAdeyXiLSKqMpA5bOyjWGGZLD1KYb1w7VDFf97PNr17yweddPdf8j saM92o/94C6U+tG54e6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nntX5-00C6Fz-8j; Mon, 09 May 2022 02:53:59 +0000 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nntX1-00C6FN-2q; Mon, 09 May 2022 02:53:57 +0000 Received: by mail-qk1-x72e.google.com with SMTP id a76so9887447qkg.12; Sun, 08 May 2022 19:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=LoAV4vKHtDWHYcjx/HccDNScwoaBWI78ZMg1Lhzn0Kc=; b=AV0eCAcM4dwQEL2GYa+8ylnliPw/IllGlpfo370R8veFGqCZINAxqbvS7tANJ2s101 hqpowH7o2P1pFracXHKx/CFSSdKuDTQXovwowr4M2wabCy9szm+KmIlFL3q2XVP9aSFD euwnuzZhA0WJTHPb7z/Uyl6lOIjxAQRO6XfiogAA1qmX/hRLF+RfjujPcVeU9N47JyqJ OyE28U2bGJlE8aYPrC0FVFBZYKdD3vZwr6JNPThX8buSxKqGRR3MZbWEWSvMminsWp6l xjgximImsPkhRHnAnBBDRdfAWOBekT+9n9Dd5qkxMLoEch5PPmEkKAUNCoElVpTo+Kkh SPPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=LoAV4vKHtDWHYcjx/HccDNScwoaBWI78ZMg1Lhzn0Kc=; b=e7nrnRafv4z5VOLDBmlsPwG4OVWvYClM7nX8hdjb3nFQuz0ZRj0yM4swzrHO+cDM8w JIPTyZgDTqutgi45DBwkna73kqSIYmV09h+HZ/XFgzUsHqo3G+NW/Ezg13DxNL/8yVZ/ EMmAEdFbouLA0LHh0PTBBZn5h+2VmyTFODIYCWRHPBC3njL749PKfAO8BALHHJz3rnbr Hst4ItQUJxVsg4eI+ru0xoyE081dhWVoc5CpOrgX+L+7hx704Vz9AHOTOixcgI9ojFmc DhLqHpqyJc03FMRytYhPX0rf3GIERm2it8o2SnygPRSAfPfpXS9lOsUQFc9P9A3W52Q+ QuNw== X-Gm-Message-State: AOAM530NHZrNojnc+Lmk0gBoMFMSdA4TWoUnGkbBytbjMnPKQ3hbFE/C EYbU9qM6eA1JETWj+s6XlayBEA1ikdudaqUkQdU= X-Google-Smtp-Source: ABdhPJxcLQ/dM1ItCcc01DCsbquqlE4w8IbwGnFnYAlwRZQbOLCKc6tQdBjxm5j6pTgbELgQk1Va1n/i48Ro1zrORrM= X-Received: by 2002:a37:ad16:0:b0:6a0:1468:4513 with SMTP id f22-20020a37ad16000000b006a014684513mr10207672qkm.96.1652064833037; Sun, 08 May 2022 19:53:53 -0700 (PDT) MIME-Version: 1.0 References: <20220425125546.4129-3-johnson.wang@mediatek.com> <202204271737.oAuTwqZH-lkp@intel.com> In-Reply-To: From: Chanwoo Choi Date: Mon, 9 May 2022 11:53:16 +0900 Message-ID: Subject: Re: [kbuild-all] Re: [PATCH v3 2/2] PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver To: Chen-Yu Tsai Cc: "Chen, Rong A" , Johnson Wang , kernel test robot , Chanwoo Choi , krzk+dt@kernel.org, Rob Herring , Kyungmin Park , llvm@lists.linux.dev, kbuild-all@lists.01.org, Linux PM list , linux-kernel , devicetree , linux-arm-kernel , linux-mediatek@lists.infradead.org, jia-wei.chang@mediatek.com, Project_Global_Chrome_Upstream_Group@mediatek.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220508_195355_200951_971B1F1B X-CRM114-Status: GOOD ( 30.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cwchoi00@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Chen-Yu, On Mon, May 9, 2022 at 10:53 AM Chen-Yu Tsai wrote: > > On Thu, Apr 28, 2022 at 7:39 PM Chen, Rong A wrote: > > On 4/27/2022 6:11 PM, Johnson Wang wrote: > > > On Wed, 2022-04-27 at 17:25 +0800, kernel test robot wrote: > > >> Hi Johnson, > > >> > > >> Thank you for the patch! Perhaps something to improve: > > >> > > >> [auto build test WARNING on robh/for-next] > > >> [also build test WARNING on linus/master v5.18-rc4 next-20220427] > > >> [If your patch is applied to the wrong git tree, kindly drop us a > > >> note. > > >> And when submitting patch, we suggest to use '--base' as documented > > >> in > > >> > > > https://urldefense.com/v3/__https://git-scm.com/docs/git-format-patch__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMS_s9zEZ$ > > >> ] > > >> > > >> url: > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/commits/Johnson-Wang/Introduce-MediaTek-CCI-devfreq-driver/20220425-205820__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMc1U_tqz$ > > >> > > >> base: > > >> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMUzTprof$ > > >> for-next > > >> config: hexagon-allyesconfig ( > > >> https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20220427/202204271737.oAuTwqZH-lkp@intel.com/config__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMaVRzbSL$ > > >> ) > > >> compiler: clang version 15.0.0 ( > > >> https://urldefense.com/v3/__https://github.com/llvm/llvm-project__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMRqw5IY-$ > > >> $ 1cddcfdc3c683b393df1a5c9063252eb60e52818) > > >> reproduce (this is a W=1 build): > > >> wget > > >> https://urldefense.com/v3/__https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMQLiD-i9$ > > >> -O ~/bin/make.cross > > >> chmod +x ~/bin/make.cross > > >> # > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/commit/98b34c0587837b0e5b880b11a52433f8f0eee19f__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMU5yd7Y2$ > > >> > > >> git remote add linux-review > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMW4ldtnH$ > > >> > > >> git fetch --no-tags linux-review Johnson-Wang/Introduce- > > >> MediaTek-CCI-devfreq-driver/20220425-205820 > > >> git checkout 98b34c0587837b0e5b880b11a52433f8f0eee19f > > >> # save the config file > > >> mkdir build_dir && cp config build_dir/.config > > >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross > > >> W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash block/partitions/ > > >> drivers/devfreq/ drivers/iio/imu/ drivers/misc/lkdtm/ > > >> > > >> If you fix the issue, kindly add following tag as appropriate > > >> Reported-by: kernel test robot > > >> > > >> All warnings (new ones prefixed by >>): > > >> > > >> drivers/devfreq/mtk-cci-devfreq.c:372:16: error: no member named > > >> 'parent_type' in 'struct devfreq_passive_data' > > >> passive_data->parent_type = CPUFREQ_PARENT_DEV; > > >> ~~~~~~~~~~~~ ^ > > >> drivers/devfreq/mtk-cci-devfreq.c:372:30: error: use of undeclared > > >> identifier 'CPUFREQ_PARENT_DEV' > > >> passive_data->parent_type = CPUFREQ_PARENT_DEV; > > >> ^ > > >>>> drivers/devfreq/mtk-cci-devfreq.c:379:4: warning: format > > >>>> specifies type 'int' but the argument has type 'long' [-Wformat] > > >> > > >> PTR_ERR(drv->devfreq)); > > >> ^~~~~~~~~~~~~~~~~~~~~ > > >> include/linux/dev_printk.h:144:65: note: expanded from macro > > >> 'dev_err' > > >> dev_printk_index_wrap(_dev_err, KERN_ERR, dev, > > >> dev_fmt(fmt), ##__VA_ARGS__) > > >> ~~~ > > >> ^~~~~~~~~~~ > > >> include/linux/dev_printk.h:110:23: note: expanded from macro > > >> 'dev_printk_index_wrap' > > >> _p_func(dev, fmt, > > >> ##__VA_ARGS__); \ > > >> ~~~ ^~~~~~~~~~~ > > >> 1 warning and 2 errors generated. > > >> > > >> > > >> vim +379 drivers/devfreq/mtk-cci-devfreq.c > > >> > > >> 255 > > >> 256 static int mtk_ccifreq_probe(struct platform_device > > >> *pdev) > > >> 257 { > > >> 258 struct device *dev = &pdev->dev; > > >> 259 struct mtk_ccifreq_drv *drv; > > >> 260 struct devfreq_passive_data *passive_data; > > >> 261 struct dev_pm_opp *opp; > > >> 262 unsigned long rate, opp_volt; > > >> 263 int ret; > > >> 264 > > >> 265 drv = devm_kzalloc(dev, sizeof(*drv), > > >> GFP_KERNEL); > > >> 266 if (!drv) > > >> 267 return -ENOMEM; > > >> 268 > > >> 269 drv->dev = dev; > > >> 270 drv->soc_data = (const struct > > >> mtk_ccifreq_platform_data *) > > >> 271 of_device_get_match_dat > > >> a(&pdev->dev); > > >> 272 mutex_init(&drv->reg_lock); > > >> 273 platform_set_drvdata(pdev, drv); > > >> 274 > > >> 275 drv->cci_clk = devm_clk_get(dev, "cci"); > > >> 276 if (IS_ERR(drv->cci_clk)) { > > >> 277 ret = PTR_ERR(drv->cci_clk); > > >> 278 return dev_err_probe(dev, ret, > > >> 279 "failed to get cci > > >> clk: %d\n", ret); > > >> 280 } > > >> 281 > > >> 282 drv->inter_clk = devm_clk_get(dev, > > >> "intermediate"); > > >> 283 if (IS_ERR(drv->inter_clk)) { > > >> 284 ret = PTR_ERR(drv->inter_clk); > > >> 285 dev_err_probe(dev, ret, > > >> 286 "failed to get > > >> intermediate clk: %d\n", ret); > > >> 287 goto out_free_resources; > > >> 288 } > > >> 289 > > >> 290 drv->proc_reg = > > >> devm_regulator_get_optional(dev, "proc"); > > >> 291 if (IS_ERR(drv->proc_reg)) { > > >> 292 ret = PTR_ERR(drv->proc_reg); > > >> 293 dev_err_probe(dev, ret, > > >> 294 "failed to get proc > > >> regulator: %d\n", ret); > > >> 295 goto out_free_resources; > > >> 296 } > > >> 297 > > >> 298 ret = regulator_enable(drv->proc_reg); > > >> 299 if (ret) { > > >> 300 dev_err(dev, "failed to enable proc > > >> regulator\n"); > > >> 301 goto out_free_resources; > > >> 302 } > > >> 303 > > >> 304 drv->sram_reg = regulator_get_optional(dev, > > >> "sram"); > > >> 305 if (IS_ERR(drv->sram_reg)) > > >> 306 drv->sram_reg = NULL; > > >> 307 else { > > >> 308 ret = regulator_enable(drv->sram_reg); > > >> 309 if (ret) { > > >> 310 dev_err(dev, "failed to enable > > >> sram regulator\n"); > > >> 311 goto out_free_resources; > > >> 312 } > > >> 313 } > > >> 314 > > >> 315 /* > > >> 316 * We assume min voltage is 0 and tracking > > >> target voltage using > > >> 317 * min_volt_shift for each iteration. > > >> 318 * The retry_max is 3 times of expeted > > >> iteration count. > > >> 319 */ > > >> 320 drv->vtrack_max = 3 * DIV_ROUND_UP(max(drv- > > >>> soc_data->sram_max_volt, > > >> 321 drv- > > >>> soc_data->proc_max_volt), > > >> 322 drv- > > >>> soc_data->min_volt_shift); > > >> 323 > > >> 324 ret = clk_prepare_enable(drv->cci_clk); > > >> 325 if (ret) > > >> 326 goto out_free_resources; > > >> 327 > > >> 328 ret = clk_prepare_enable(drv->inter_clk); > > >> 329 if (ret) > > >> 330 goto out_disable_cci_clk; > > >> 331 > > >> 332 ret = dev_pm_opp_of_add_table(dev); > > >> 333 if (ret) { > > >> 334 dev_err(dev, "failed to add opp table: > > >> %d\n", ret); > > >> 335 goto out_disable_inter_clk; > > >> 336 } > > >> 337 > > >> 338 rate = clk_get_rate(drv->inter_clk); > > >> 339 opp = dev_pm_opp_find_freq_ceil(dev, &rate); > > >> 340 if (IS_ERR(opp)) { > > >> 341 ret = PTR_ERR(opp); > > >> 342 dev_err(dev, "failed to get > > >> intermediate opp: %d\n", ret); > > >> 343 goto out_remove_opp_table; > > >> 344 } > > >> 345 drv->inter_voltage = > > >> dev_pm_opp_get_voltage(opp); > > >> 346 dev_pm_opp_put(opp); > > >> 347 > > >> 348 rate = U32_MAX; > > >> 349 opp = dev_pm_opp_find_freq_floor(drv->dev, > > >> &rate); > > >> 350 if (IS_ERR(opp)) { > > >> 351 dev_err(dev, "failed to get opp\n"); > > >> 352 ret = PTR_ERR(opp); > > >> 353 goto out_remove_opp_table; > > >> 354 } > > >> 355 > > >> 356 opp_volt = dev_pm_opp_get_voltage(opp); > > >> 357 dev_pm_opp_put(opp); > > >> 358 ret = mtk_ccifreq_set_voltage(drv, opp_volt); > > >> 359 if (ret) { > > >> 360 dev_err(dev, "failed to scale to > > >> highest voltage %lu in proc_reg\n", > > >> 361 opp_volt); > > >> 362 goto out_remove_opp_table; > > >> 363 } > > >> 364 > > >> 365 passive_data = devm_kzalloc(dev, sizeof(struct > > >> devfreq_passive_data), > > >> 366 GFP_KERNEL); > > >> 367 if (!passive_data) { > > >> 368 ret = -ENOMEM; > > >> 369 goto out_remove_opp_table; > > >> 370 } > > >> 371 > > >> 372 passive_data->parent_type = CPUFREQ_PARENT_DEV; > > >> 373 drv->devfreq = devm_devfreq_add_device(dev, > > >> &mtk_ccifreq_profile, > > >> 374 DEVFREQ_ > > >> GOV_PASSIVE, > > >> 375 passive_ > > >> data); > > >> 376 if (IS_ERR(drv->devfreq)) { > > >> 377 ret = -EPROBE_DEFER; > > >> 378 dev_err(dev, "failed to add devfreq > > >> device: %d\n", > > >> > 379 PTR_ERR(drv->devfreq)); > > >> 380 goto out_remove_opp_table; > > >> 381 } > > >> 382 > > >> 383 drv->opp_nb.notifier_call = > > >> mtk_ccifreq_opp_notifier; > > >> 384 ret = dev_pm_opp_register_notifier(dev, &drv- > > >>> opp_nb); > > >> 385 if (ret) { > > >> 386 dev_err(dev, "failed to register opp > > >> notifier: %d\n", ret); > > >> 387 goto out_remove_devfreq_device; > > >> 388 } > > >> 389 return 0; > > >> 390 > > >> 391 out_remove_devfreq_device: > > >> 392 devm_devfreq_remove_device(dev, drv->devfreq); > > >> 393 > > >> 394 out_remove_opp_table: > > >> 395 dev_pm_opp_of_remove_table(dev); > > >> 396 > > >> 397 out_disable_inter_clk: > > >> 398 clk_disable_unprepare(drv->inter_clk); > > >> 399 > > >> 400 out_disable_cci_clk: > > >> 401 clk_disable_unprepare(drv->cci_clk); > > >> 402 > > >> 403 out_free_resources: > > >> 404 if (regulator_is_enabled(drv->proc_reg)) > > >> 405 regulator_disable(drv->proc_reg); > > >> 406 if (drv->sram_reg && regulator_is_enabled(drv- > > >>> sram_reg)) > > >> 407 regulator_disable(drv->sram_reg); > > >> 408 > > >> 409 if (!IS_ERR(drv->proc_reg)) > > >> 410 regulator_put(drv->proc_reg); > > >> 411 if (!IS_ERR(drv->sram_reg)) > > >> 412 regulator_put(drv->sram_reg); > > >> 413 if (!IS_ERR(drv->cci_clk)) > > >> 414 clk_put(drv->cci_clk); > > >> 415 if (!IS_ERR(drv->inter_clk)) > > >> 416 clk_put(drv->inter_clk); > > >> 417 > > >> 418 return ret; > > >> 419 } > > >> 420 > > >> > > > > > > Hi "kernel test robot", > > > > > > Thanks for your review. > > > > > > This patch is based on chanwoo/devfreq-testing[1] > > > [1] > > > https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/log/?h=devfreq-testing > > > > Hi Johnson, > > > > Thanks for the feedback, we'll take a look too. > > I think the last patch on that branch might be broken. You mean the patch[1]. Without this patch[1], there are no problems? [1] https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/commit/?h=devfreq-testing&id=ea1011fba665b95fc28f682c9b131799a88b11ae When you tested these patches with patchset[2] without last patch[1] if there are no problems, please reply to patchset[2] with your Tested-by tag. [2] https://patchwork.kernel.org/project/linux-pm/cover/20220507150145.531864-1-cw00.choi@samsung.com/ -- Best Regards, Chanwoo Choi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5169979096267771819==" MIME-Version: 1.0 From: Chanwoo Choi To: kbuild-all@lists.01.org Subject: Re: [PATCH v3 2/2] PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver Date: Mon, 09 May 2022 11:53:16 +0900 Message-ID: In-Reply-To: List-Id: --===============5169979096267771819== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Chen-Yu, On Mon, May 9, 2022 at 10:53 AM Chen-Yu Tsai wrote: > > On Thu, Apr 28, 2022 at 7:39 PM Chen, Rong A wr= ote: > > On 4/27/2022 6:11 PM, Johnson Wang wrote: > > > On Wed, 2022-04-27 at 17:25 +0800, kernel test robot wrote: > > >> Hi Johnson, > > >> > > >> Thank you for the patch! Perhaps something to improve: > > >> > > >> [auto build test WARNING on robh/for-next] > > >> [also build test WARNING on linus/master v5.18-rc4 next-20220427] > > >> [If your patch is applied to the wrong git tree, kindly drop us a > > >> note. > > >> And when submitting patch, we suggest to use '--base' as documented > > >> in > > >> > > > https://urldefense.com/v3/__https://git-scm.com/docs/git-format-patch= __;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD= 0cPzbLMS_s9zEZ$ > > >> ] > > >> > > >> url: > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/c= ommits/Johnson-Wang/Introduce-MediaTek-CCI-devfreq-driver/20220425-205820__= ;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0c= PzbLMc1U_tqz$ > > >> > > >> base: > > >> https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/ker= nel/git/robh/linux.git__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Km= h5-xrvU2Rlmb0o-b9tRvCD0cPzbLMUzTprof$ > > >> for-next > > >> config: hexagon-allyesconfig ( > > >> https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/= 20220427/202204271737.oAuTwqZH-lkp(a)intel.com/config__;!!CTRNKA9wMg0ARbw!w= dyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMaVRzbSL$ > > >> ) > > >> compiler: clang version 15.0.0 ( > > >> https://urldefense.com/v3/__https://github.com/llvm/llvm-project__;!= !CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPz= bLMRqw5IY-$ > > >> $ 1cddcfdc3c683b393df1a5c9063252eb60e52818) > > >> reproduce (this is a W=3D1 build): > > >> wget > > >> https://urldefense.com/v3/__https://raw.githubusercontent.com/intel/= lkp-tests/master/sbin/make.cross__;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ= 9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMQLiD-i9$ > > >> -O ~/bin/make.cross > > >> chmod +x ~/bin/make.cross > > >> # > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux/c= ommit/98b34c0587837b0e5b880b11a52433f8f0eee19f__;!!CTRNKA9wMg0ARbw!wdyoWXNL= BcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0cPzbLMU5yd7Y2$ > > >> > > >> git remote add linux-review > > >> https://urldefense.com/v3/__https://github.com/intel-lab-lkp/linux__= ;!!CTRNKA9wMg0ARbw!wdyoWXNLBcYM97vMuNFQXZ9BaajEp-Kmh5-xrvU2Rlmb0o-b9tRvCD0c= PzbLMW4ldtnH$ > > >> > > >> git fetch --no-tags linux-review Johnson-Wang/Introduce- > > >> MediaTek-CCI-devfreq-driver/20220425-205820 > > >> git checkout 98b34c0587837b0e5b880b11a52433f8f0eee19f > > >> # save the config file > > >> mkdir build_dir && cp config build_dir/.config > > >> COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cr= oss > > >> W=3D1 O=3Dbuild_dir ARCH=3Dhexagon SHELL=3D/bin/bash block/partition= s/ > > >> drivers/devfreq/ drivers/iio/imu/ drivers/misc/lkdtm/ > > >> > > >> If you fix the issue, kindly add following tag as appropriate > > >> Reported-by: kernel test robot > > >> > > >> All warnings (new ones prefixed by >>): > > >> > > >> drivers/devfreq/mtk-cci-devfreq.c:372:16: error: no member named > > >> 'parent_type' in 'struct devfreq_passive_data' > > >> passive_data->parent_type =3D CPUFREQ_PARENT_DEV; > > >> ~~~~~~~~~~~~ ^ > > >> drivers/devfreq/mtk-cci-devfreq.c:372:30: error: use of undeclar= ed > > >> identifier 'CPUFREQ_PARENT_DEV' > > >> passive_data->parent_type =3D CPUFREQ_PARENT_DEV; > > >> ^ > > >>>> drivers/devfreq/mtk-cci-devfreq.c:379:4: warning: format > > >>>> specifies type 'int' but the argument has type 'long' [-Wformat] > > >> > > >> PTR_ERR(drv->devfreq)); > > >> ^~~~~~~~~~~~~~~~~~~~~ > > >> include/linux/dev_printk.h:144:65: note: expanded from macro > > >> 'dev_err' > > >> dev_printk_index_wrap(_dev_err, KERN_ERR, dev, > > >> dev_fmt(fmt), ##__VA_ARGS__) > > >> ~= ~~ > > >> ^~~~~~~~~~~ > > >> include/linux/dev_printk.h:110:23: note: expanded from macro > > >> 'dev_printk_index_wrap' > > >> _p_func(dev, fmt, > > >> ##__VA_ARGS__); \ > > >> ~~~ ^~~~~~~~~~~ > > >> 1 warning and 2 errors generated. > > >> > > >> > > >> vim +379 drivers/devfreq/mtk-cci-devfreq.c > > >> > > >> 255 > > >> 256 static int mtk_ccifreq_probe(struct platform_device > > >> *pdev) > > >> 257 { > > >> 258 struct device *dev =3D &pdev->dev; > > >> 259 struct mtk_ccifreq_drv *drv; > > >> 260 struct devfreq_passive_data *passive_data; > > >> 261 struct dev_pm_opp *opp; > > >> 262 unsigned long rate, opp_volt; > > >> 263 int ret; > > >> 264 > > >> 265 drv =3D devm_kzalloc(dev, sizeof(*drv), > > >> GFP_KERNEL); > > >> 266 if (!drv) > > >> 267 return -ENOMEM; > > >> 268 > > >> 269 drv->dev =3D dev; > > >> 270 drv->soc_data =3D (const struct > > >> mtk_ccifreq_platform_data *) > > >> 271 of_device_get_match_dat > > >> a(&pdev->dev); > > >> 272 mutex_init(&drv->reg_lock); > > >> 273 platform_set_drvdata(pdev, drv); > > >> 274 > > >> 275 drv->cci_clk =3D devm_clk_get(dev, "cci"); > > >> 276 if (IS_ERR(drv->cci_clk)) { > > >> 277 ret =3D PTR_ERR(drv->cci_clk); > > >> 278 return dev_err_probe(dev, ret, > > >> 279 "failed to get cci > > >> clk: %d\n", ret); > > >> 280 } > > >> 281 > > >> 282 drv->inter_clk =3D devm_clk_get(dev, > > >> "intermediate"); > > >> 283 if (IS_ERR(drv->inter_clk)) { > > >> 284 ret =3D PTR_ERR(drv->inter_clk); > > >> 285 dev_err_probe(dev, ret, > > >> 286 "failed to get > > >> intermediate clk: %d\n", ret); > > >> 287 goto out_free_resources; > > >> 288 } > > >> 289 > > >> 290 drv->proc_reg =3D > > >> devm_regulator_get_optional(dev, "proc"); > > >> 291 if (IS_ERR(drv->proc_reg)) { > > >> 292 ret =3D PTR_ERR(drv->proc_reg); > > >> 293 dev_err_probe(dev, ret, > > >> 294 "failed to get proc > > >> regulator: %d\n", ret); > > >> 295 goto out_free_resources; > > >> 296 } > > >> 297 > > >> 298 ret =3D regulator_enable(drv->proc_reg); > > >> 299 if (ret) { > > >> 300 dev_err(dev, "failed to enable proc > > >> regulator\n"); > > >> 301 goto out_free_resources; > > >> 302 } > > >> 303 > > >> 304 drv->sram_reg =3D regulator_get_optional(dev, > > >> "sram"); > > >> 305 if (IS_ERR(drv->sram_reg)) > > >> 306 drv->sram_reg =3D NULL; > > >> 307 else { > > >> 308 ret =3D regulator_enable(drv->sram_reg); > > >> 309 if (ret) { > > >> 310 dev_err(dev, "failed to enable > > >> sram regulator\n"); > > >> 311 goto out_free_resources; > > >> 312 } > > >> 313 } > > >> 314 > > >> 315 /* > > >> 316 * We assume min voltage is 0 and tracking > > >> target voltage using > > >> 317 * min_volt_shift for each iteration. > > >> 318 * The retry_max is 3 times of expeted > > >> iteration count. > > >> 319 */ > > >> 320 drv->vtrack_max =3D 3 * DIV_ROUND_UP(max(drv- > > >>> soc_data->sram_max_volt, > > >> 321 drv- > > >>> soc_data->proc_max_volt), > > >> 322 drv- > > >>> soc_data->min_volt_shift); > > >> 323 > > >> 324 ret =3D clk_prepare_enable(drv->cci_clk); > > >> 325 if (ret) > > >> 326 goto out_free_resources; > > >> 327 > > >> 328 ret =3D clk_prepare_enable(drv->inter_clk); > > >> 329 if (ret) > > >> 330 goto out_disable_cci_clk; > > >> 331 > > >> 332 ret =3D dev_pm_opp_of_add_table(dev); > > >> 333 if (ret) { > > >> 334 dev_err(dev, "failed to add opp table: > > >> %d\n", ret); > > >> 335 goto out_disable_inter_clk; > > >> 336 } > > >> 337 > > >> 338 rate =3D clk_get_rate(drv->inter_clk); > > >> 339 opp =3D dev_pm_opp_find_freq_ceil(dev, &rate); > > >> 340 if (IS_ERR(opp)) { > > >> 341 ret =3D PTR_ERR(opp); > > >> 342 dev_err(dev, "failed to get > > >> intermediate opp: %d\n", ret); > > >> 343 goto out_remove_opp_table; > > >> 344 } > > >> 345 drv->inter_voltage =3D > > >> dev_pm_opp_get_voltage(opp); > > >> 346 dev_pm_opp_put(opp); > > >> 347 > > >> 348 rate =3D U32_MAX; > > >> 349 opp =3D dev_pm_opp_find_freq_floor(drv->dev, > > >> &rate); > > >> 350 if (IS_ERR(opp)) { > > >> 351 dev_err(dev, "failed to get opp\n"); > > >> 352 ret =3D PTR_ERR(opp); > > >> 353 goto out_remove_opp_table; > > >> 354 } > > >> 355 > > >> 356 opp_volt =3D dev_pm_opp_get_voltage(opp); > > >> 357 dev_pm_opp_put(opp); > > >> 358 ret =3D mtk_ccifreq_set_voltage(drv, opp_volt); > > >> 359 if (ret) { > > >> 360 dev_err(dev, "failed to scale to > > >> highest voltage %lu in proc_reg\n", > > >> 361 opp_volt); > > >> 362 goto out_remove_opp_table; > > >> 363 } > > >> 364 > > >> 365 passive_data =3D devm_kzalloc(dev, sizeof(struct > > >> devfreq_passive_data), > > >> 366 GFP_KERNEL); > > >> 367 if (!passive_data) { > > >> 368 ret =3D -ENOMEM; > > >> 369 goto out_remove_opp_table; > > >> 370 } > > >> 371 > > >> 372 passive_data->parent_type =3D CPUFREQ_PARENT_DE= V; > > >> 373 drv->devfreq =3D devm_devfreq_add_device(dev, > > >> &mtk_ccifreq_profile, > > >> 374 DEVFREQ_ > > >> GOV_PASSIVE, > > >> 375 passive_ > > >> data); > > >> 376 if (IS_ERR(drv->devfreq)) { > > >> 377 ret =3D -EPROBE_DEFER; > > >> 378 dev_err(dev, "failed to add devfreq > > >> device: %d\n", > > >> > 379 PTR_ERR(drv->devfreq)); > > >> 380 goto out_remove_opp_table; > > >> 381 } > > >> 382 > > >> 383 drv->opp_nb.notifier_call =3D > > >> mtk_ccifreq_opp_notifier; > > >> 384 ret =3D dev_pm_opp_register_notifier(dev, &drv- > > >>> opp_nb); > > >> 385 if (ret) { > > >> 386 dev_err(dev, "failed to register opp > > >> notifier: %d\n", ret); > > >> 387 goto out_remove_devfreq_device; > > >> 388 } > > >> 389 return 0; > > >> 390 > > >> 391 out_remove_devfreq_device: > > >> 392 devm_devfreq_remove_device(dev, drv->devfreq); > > >> 393 > > >> 394 out_remove_opp_table: > > >> 395 dev_pm_opp_of_remove_table(dev); > > >> 396 > > >> 397 out_disable_inter_clk: > > >> 398 clk_disable_unprepare(drv->inter_clk); > > >> 399 > > >> 400 out_disable_cci_clk: > > >> 401 clk_disable_unprepare(drv->cci_clk); > > >> 402 > > >> 403 out_free_resources: > > >> 404 if (regulator_is_enabled(drv->proc_reg)) > > >> 405 regulator_disable(drv->proc_reg); > > >> 406 if (drv->sram_reg && regulator_is_enabled(drv- > > >>> sram_reg)) > > >> 407 regulator_disable(drv->sram_reg); > > >> 408 > > >> 409 if (!IS_ERR(drv->proc_reg)) > > >> 410 regulator_put(drv->proc_reg); > > >> 411 if (!IS_ERR(drv->sram_reg)) > > >> 412 regulator_put(drv->sram_reg); > > >> 413 if (!IS_ERR(drv->cci_clk)) > > >> 414 clk_put(drv->cci_clk); > > >> 415 if (!IS_ERR(drv->inter_clk)) > > >> 416 clk_put(drv->inter_clk); > > >> 417 > > >> 418 return ret; > > >> 419 } > > >> 420 > > >> > > > > > > Hi "kernel test robot", > > > > > > Thanks for your review. > > > > > > This patch is based on chanwoo/devfreq-testing[1] > > > [1] > > > https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/log= /?h=3Ddevfreq-testing > > > > Hi Johnson, > > > > Thanks for the feedback, we'll take a look too. > > I think the last patch on that branch might be broken. You mean the patch[1]. Without this patch[1], there are no problems? [1] https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/commi= t/?h=3Ddevfreq-testing&id=3Dea1011fba665b95fc28f682c9b131799a88b11ae When you tested these patches with patchset[2] without last patch[1] if there are no problems, please reply to patchset[2] with your Tested-by t= ag. [2] https://patchwork.kernel.org/project/linux-pm/cover/20220507150145.5318= 64-1-cw00.choi(a)samsung.com/ -- Best Regards, Chanwoo Choi --===============5169979096267771819==--