Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp719378pxx; Wed, 28 Oct 2020 15:28:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys3uCA0Y/0noAW2SRT3TiMAhrSB/NV9D9S6kyM4F9jfMtfANQ+FB/E9l7RyXOeZlkEY8rg X-Received: by 2002:aa7:d1d5:: with SMTP id g21mr1099017edp.388.1603924109552; Wed, 28 Oct 2020 15:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603924109; cv=none; d=google.com; s=arc-20160816; b=SFS0+JDiIcGn+yZPEQBnIQzZ/CXoIoINm5rbG5qL1Wx9tHa4p6IAPveofRJWhFkucw rKlD+uDMtf9NNbW4nil4E38cadHscLp9+W4zvV1EHg0oxffHEiF1rRr/4jTmNc9HzWIQ Of+dDKfqhGMJTnx7qhttoahU9x70bKMHTqEfyF/FIwomM7CNcaMW2lcDHvIEmMu4meNC gSKs8irpQqFCFUwLZoOH9QGUJPXjW8JnGyq2925lepc/VXAuePcw6cfaND9u+S7O8WaB Pi7Tdh4fc/2CS+rIdTrZLZfVvXO3Ig+f8EreFc8UhKIpoCbZl8KAR8Whfyla9N0XeI33 7YiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=y1LWszpu+vsLMIpACNI5RkrNJ8vWcuOeT19ouqrL6dk=; b=MXF1bkx0+OkrzpPPjJ9u3WQ8YWrssD5E4G546vMvhE7MK3mYQSqrqWhq167TDrykCO JoyEzjxhKf8mfliU9/0JSNizB3uK9aTPJfIPvuQ6CpdPQJkn09pvTuq3GLkcU5on8VCB JcSzZJcoV+yt4NZGiMOm71vjFS6G1+vDjqUDO6aDVIMcq4aIg9gB0xsIK6Hi+Wvvjict 4MaVNso8RJTVBGpHwHiKupkakakJpYQyMuqSYeAEWwAccAJPdtQRly/11rg4a6YIGTxX 3SHGnnC/A16bOIP49XqMd2ngMmErHAvaPD1+bS1Ob8za97QXt3o7H3d+ZP5JvWzE2SQ7 mvjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gpPJEJdl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e26si889258edr.55.2020.10.28.15.28.07; Wed, 28 Oct 2020 15:28:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gpPJEJdl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1733070AbgJ1W0q (ORCPT + 99 others); Wed, 28 Oct 2020 18:26:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732757AbgJ1WYw (ORCPT ); Wed, 28 Oct 2020 18:24:52 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 789A6C0613CF for ; Wed, 28 Oct 2020 15:24:52 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id t6so314841plq.11 for ; Wed, 28 Oct 2020 15:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=y1LWszpu+vsLMIpACNI5RkrNJ8vWcuOeT19ouqrL6dk=; b=gpPJEJdlqQvuf7lgouP6T0cH/F3YsFETEII2GLxOqmupmhhd/zDEgP9m7YmaDU+2fE BRh+AVJrnvfFEeUXeO+ZTG1CyWDCQUNwDXqYw/rymDc+gFe6V6ePxgTMTVcovhmPiz0K MeeFJkT47pkh+ETSai+YNPK4O9/uJxLroJM8OrVV1M1MWjh6zNUmSYbTN06maru3SA8A NT0Y33s/jghoVW3zroaN0zI7oFht2+3WIX/IN3s+6fjFH2HwCkYeZTHa7OElHKVhkhgo yJh3dpv6C/LRH0HfIHG5XFtieR/iJ040ucqzQXRm1arx6YLXOB307smvC14KY2ahEC4Y 0nGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=y1LWszpu+vsLMIpACNI5RkrNJ8vWcuOeT19ouqrL6dk=; b=Sp8sQkNE1V2WI/4P9iZVEgDY8cXjHwD9+On2fZXgiCbcuOlVihfefeA6TgP8FXkr9B BufO6STZf5YaJTtJgDso9C3FZcocHzeUKeL801NhlCYZ+/b/o5/RiAnME/Q+amZYwlPK GNYy4ulbF1M5eQpbPiaH4Hc0RQaSFPk+Jgl2GiPLifNmcxsDLMlU+o6IF7THJX+/fvnn IiSJtNMVV4VQgiUHutjuEO/33oYZF1ggKu7mIGspAnnQdXXxhyQkv1ib7zx76xoiElKA moa9wQYsjeoDjZr2nTPEMexOF77PQrISweMV/A1c/Bkd2m9fy0AF8NVi+OOQwbuTAVQr 7LyQ== X-Gm-Message-State: AOAM532Dn9qClX2zq3bPNqYY141qaPoSgWVyJqVD6PFjN+DJwQFsfnH5 g80hC+1r3BxLcqfv7vFyBcARlNcfcZQdSg== X-Received: by 2002:aa7:9555:0:b029:152:4b0b:cca with SMTP id w21-20020aa795550000b02901524b0b0ccamr6448373pfq.16.1603878762417; Wed, 28 Oct 2020 02:52:42 -0700 (PDT) Received: from localhost ([122.181.54.133]) by smtp.gmail.com with ESMTPSA id f125sm5090344pfg.149.2020.10.28.02.52.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Oct 2020 02:52:41 -0700 (PDT) Date: Wed, 28 Oct 2020 15:22:39 +0530 From: Viresh Kumar To: Geert Uytterhoeven Cc: Stephan Gerhold , Ulf Hansson , "Rafael J. Wysocki" , Liam Girdwood , Mark Brown , Linux PM list , Vincent Guittot , Stephen Boyd , Nishanth Menon , nks@flawful.org, Georgi Djakov , Linux Kernel Mailing List , Wolfram Sang , Linux I2C , Linux-Renesas Subject: Re: [PATCH V2 2/2] cpufreq: dt: Refactor initialization to handle probe deferral properly Message-ID: <20201028095239.prouhriqr3sykikg@vireshk-i7> References: <20201013095613.mbgmjwzojg5wxmau@vireshk-i7> <20201016050347.ers54itzmxgijzsy@vireshk-i7> <20201016080730.h7u3jmlyjbyhqn3t@vireshk-i7> <20201028054829.42zckdtwvj67tcfl@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28-10-20, 10:49, Geert Uytterhoeven wrote: > Hi Viresh, > > On Wed, Oct 28, 2020 at 6:48 AM Viresh Kumar wrote: > > On 27-10-20, 17:29, Geert Uytterhoeven wrote: > > > On plain v5.9, with #define DEBUG and a few extra debug prints > > > added, I get: > > > > > > cpufreq_dt: cpufreq_init:164: policy->cpu = 0 > > > cpufreq_dt: cpufreq_init:165: policy->cpus = 0 > > > cpufreq_dt: cpufreq_init:166: policy->related_cpus = > > > cpufreq_dt: cpufreq_init:167: policy->real_cpus = > > > cpu cpu0: dev_pm_opp_of_get_sharing_cpus: Couldn't find opp node. > > > of: dev_pm_opp_of_cpumask_add_table:1049 > > > of: dev_pm_opp_of_cpumask_add_table:1054: cpu 0 > > > cpu cpu0: dev_pm_opp_of_add_table:954 > > > cpu cpu0: dev_pm_opp_of_add_table:956: > > > dev_pm_opp_get_opp_table_indexed() returned (ptrval) > > > cpu cpu0: _of_add_opp_table_v1:891 > > > cpu cpu0: _of_add_opp_table_v1:893: _find_opp_table() returned (ptrval) > > > cpu cpu0: _of_add_opp_table_v1:909: 6 entries > > > cpu cpu0: dev_pm_opp_get_opp_count:331 > > > cpu cpu0: dev_pm_opp_get_opp_count:333: _find_opp_table() returned (ptrval) > > > cpu cpu0: dev_pm_opp_get_opp_count:342: _get_opp_count() returned 6 > > > cpu cpu0: dev_pm_opp_get_opp_count:331 > > > cpu cpu0: dev_pm_opp_get_opp_count:333: _find_opp_table() returned (ptrval) > > > cpu cpu0: dev_pm_opp_get_opp_count:342: _get_opp_count() returned 6 > > > cpu cpu0: dev_pm_opp_get_opp_count:331 > > > cpu cpu0: dev_pm_opp_get_opp_count:333: _find_opp_table() returned (ptrval) > > > cpu cpu0: dev_pm_opp_get_opp_count:342: _get_opp_count() returned 6 > > > cpu cpu0: Couldn't find proper 'dynamic-power-coefficient' in DT > > > cpu cpu0: Couldn't register Energy Model -22 > > > > > > This happens quite late in the boot sequence, long after cpu1 has been > > > brought online. > > > So it finds the v1 opp table for cpu0, which has 6 entries. > > > The last two messages should be harmless, right? > > > > Yes. > > > > > So you say cpufreq is not working? How can I verify that? > > > > I said it because your earlier logs showed that we defered probed > > again or the count was 0 and we failed. Something like that. > > > > Give output of this to verify if cpufreq is working or not: > > > > grep . /sys/devices/system/cpu/cpufreq/policy*/* > > > > This will be empty if there is no cpufreq. > > /sys/devices/system/cpu/cpufreq/policy0/affected_cpus:0 1 > /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq:375000 > /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_max_freq:1500000 > /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_min_freq:375000 > /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_transition_latency:300000 > /sys/devices/system/cpu/cpufreq/policy0/related_cpus:0 1 > /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequencies:375000 > 750000 937500 1125000 1312500 1500000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_available_governors:conservative > ondemand userspace powersave performance schedutil > /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq:375000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_driver:cpufreq-dt > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor:schedutil > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq:1500000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq:375000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_setspeed: > > So it works in v5.9, but not in v5.10-rc1. > > Bisection says it was broken by commit 90d46d71cce279d8 ("opp: Handle > multiple calls for same OPP table in _of_add_opp_table_v1()"). > > > > cpu cpu0: dev_pm_opp_get_opp_count:331 > > > cpu cpu0: dev_pm_opp_get_opp_count:333: _find_opp_table() returned (ptrval) > > > cpu cpu0: dev_pm_opp_get_opp_count:342: _get_opp_count() returned 0 > > > cpu cpu0: OPP table can't be empty > > > > > > Wait, _get_opp_count() returns 0? > > > > Does this fix it for you as well ? > > > > https://lore.kernel.org/lkml/2c73ab54717ef358b118ea0cfb727b1427e7730a.1602648719.git.viresh.kumar@linaro.org/ > > Thanks, it does. I had arrived at the same conclusion after bisection. > > > I didn't point you to this earlier as your logs said something else. > > All my logs said _get_opp_count() returns 0. > > > > During s2ram, v5.10-rc1, it redoes most of the above, incl. touching the > > > PMIC, which it shouldn't due in this phase of system resume: > > > > > > Disabling non-boot CPUs ... > > > Enabling non-boot CPUs ... > > > cpufreq_dt: cpufreq_init:112: policy->cpu = 1 > > > cpufreq_dt: cpufreq_init:113: policy->cpus = 1 > > > cpufreq_dt: cpufreq_init:114: policy->related_cpus = > > > cpufreq_dt: cpufreq_init:115: policy->real_cpus = > > > of: dev_pm_opp_of_cpumask_add_table:1075 > > > of: dev_pm_opp_of_cpumask_add_table:1080: cpu 0 > > > cpu cpu0: dev_pm_opp_of_add_table:980 > > > cpu cpu0: dev_pm_opp_of_add_table:982: > > > dev_pm_opp_get_opp_table_indexed() returned f680980b > > > cpu cpu0: _of_add_opp_table_v1:914 > > > cpu cpu0: _of_add_opp_table_v1:916: _find_opp_table() returned a4afd426 > > > cpu cpu0: _of_add_opp_table_v1:937: 6 entries > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > > > > The i2c controller is suspended, this could go boom... > > > > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > of: dev_pm_opp_of_cpumask_add_table:1080: cpu 1 > > > cpu cpu1: dev_pm_opp_of_add_table:980 > > > cpu cpu1: dev_pm_opp_of_add_table:982: > > > dev_pm_opp_get_opp_table_indexed() returned f680980b > > > cpu cpu1: _of_add_opp_table_v1:914 > > > cpu cpu1: _of_add_opp_table_v1:916: _find_opp_table() returned 9087c76d > > > cpu cpu1: _of_add_opp_table_v1:937: 6 entries > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > i2c-sh_mobile e60b0000.i2c: Transfer request timed out > > > cpu cpu0: dev_pm_opp_get_opp_count:331 > > > cpu cpu0: dev_pm_opp_get_opp_count:333: _find_opp_table() returned f680980b > > > cpu cpu0: dev_pm_opp_get_opp_count:342: _get_opp_count() returned 0 > > > cpu cpu0: OPP table can't be empty > > > CPU1 is up > > > > Lets make the normal boot work first and see about this later. > > This is also fixed by your patch: the PMIC is no longer accessed while > suspended. Ah finally. Thanks, everything worked as expected :) -- viresh