From patchwork Wed Apr 22 23:40:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 6259341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2EB599F389 for ; Wed, 22 Apr 2015 23:43:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AF3720380 for ; Wed, 22 Apr 2015 23:43:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0416D20303 for ; Wed, 22 Apr 2015 23:43:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yl4GT-00084K-BL; Wed, 22 Apr 2015 23:41:09 +0000 Received: from mail-pd0-f169.google.com ([209.85.192.169]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yl4GO-0007yZ-0P for linux-arm-kernel@lists.infradead.org; Wed, 22 Apr 2015 23:41:05 +0000 Received: by pdbnk13 with SMTP id nk13so1944273pdb.0 for ; Wed, 22 Apr 2015 16:40:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=6a1cWj0JrSg8v7xJJqFLGkmaYLc9Ht2Az3eIHAOBzgQ=; b=nMVStnr1PVDgMsKpbyuEENCU1//ikkLF840oOr5XXl3LaGr+3WESUrWKejSyu5Hkk7 wUKwJXpZWoIQkzNZrjYTISPVMFboXPlq30DQpk73+8M13LZk88K0NQelRpfBUtutM/sv lO98ctTL3uNfseax6LQ9gg6reYZipUvKVgiYCRAX6YTLGSp/7kdkOds/EbX3vW2Lnc7v mJErRvz5wbLZpNnhKQ/29GkiZIY43v7Lex4h4E3PCgJCCmES52tt70COt4lgSv49gemb v/dlxMNBndQ783Mbda4N3mp+eV8+xQ70W1tyih5oLbdWkwROjJEKqp4MjaqpyQ4naZLx UeZw== X-Gm-Message-State: ALoCoQm/87IQLs0jmqU14CLv0Ysq9cjmvfMRAYJKAnCuzYFxJ+NXiXgBWkdcirc18ji1yXgZNmsT X-Received: by 10.70.91.37 with SMTP id cb5mr3318pdb.151.1429746041237; Wed, 22 Apr 2015 16:40:41 -0700 (PDT) Received: from localhost (c-67-160-101-93.hsd1.wa.comcast.net. [67.160.101.93]) by mx.google.com with ESMTPSA id lb1sm4108589pab.39.2015.04.22.16.40.38 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 22 Apr 2015 16:40:39 -0700 (PDT) From: Kevin Hilman To: Bartlomiej Zolnierkiewicz Subject: Re: [PATCH 0/4] cpufreq: use generic cpufreq drivers for Exynos5250 platform References: <1428946441-17058-1-git-send-email-b.zolnierkie@samsung.com> <5439319.JYC6t7bzy4@amdc1032> <7hsibtavuz.fsf@deeprootsystems.com> <4008289.pQOxzKW0Ir@amdc1032> Date: Wed, 22 Apr 2015 16:40:37 -0700 In-Reply-To: <4008289.pQOxzKW0Ir@amdc1032> (Bartlomiej Zolnierkiewicz's message of "Wed, 22 Apr 2015 19:37:43 +0200") Message-ID: <7hegnb91fu.fsf@deeprootsystems.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150422_164104_116842_C44E34B3 X-CRM114-Status: GOOD ( 23.39 ) X-Spam-Score: -1.0 (-) Cc: linux-arm-kernel@lists.infradead.org, Lukasz Majewski , Kukjin Kim , Mike Turquette , Heiko Stuebner , linux-pm@vger.kernel.org, Viresh Kumar , Tomasz Figa , linux-kernel@vger.kernel.org, Chanwoo Choi , Thomas Abraham , Kukjin Kim , Sylwester Nawrocki , Javier Martinez Canillas , linux-samsung-soc@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Bartlomiej Zolnierkiewicz writes: [...] >> However, with the default governor set to userspace it boots fine until >> my userspace (ubuntu) tries to enable the ondemand governor, and then it >> hangs. >> >> For it to boot, I have to disable the ondemand governor, and set the >> default governor to userspace. > > I've tried with ARM big.LITTLE cpuidle support enabled (I've just noticed > that it is not turned on in exynos_defconfig) and my ODROID-XU3 board > fails to boot. This happens even with cpufreq support disabled (hard > lockup happens during mmc initialization which is done just after cpufreq > initialization). Right, the XU3 has broken secure firmware such that MCPM cannot properly control CCI, so CPUidle will hang when trying to hit low power states, so you have to disable CCI by adding something like this to the end of your XU3 .dts file: &cci { status = "disabled"; }; > Could you please check if disabling cpuidle support helps? For now, I've disabled CPUidle so we have a similar setup, but it doesn't change anything on exynos5800-peach-pi >> As I reported earlier on Thomas' series, I suspect this is related to >> the fact that the higher OPPs aren't really functional without voltage >> scaling also supported. > > Part #4 contains voltage scaling support for arm_big_little[_dt] driver > so this should not be a problem any longer. > > You may try next-20150330-generic-cpufreq-exynos5420-5800-v2-debug > branch from my github (with cpufreq debugging printks enabled) to check > whether the voltage scaling is indeed done on your board. > >> I'm also seeing the wait_until_divider_stable errors when switching >> between the available A7 OPPs. I'd reported this one earlier as well, >> along with the script to reproduce it. > > I've tried your script and it works fine for me (I only needed to change > cpu4 to cpu0 as on ODROID-XU3 CPUs 0,5,6,7 are A7 and 1,2,3,4 are A15). Then it seems something isn't quite right for exynos5800-peach-pi. Below is the script[1] I'm using on exynos which also checks the voltage by quering the regulator fwk (and optionally checking the INA2xx sensors on odroid-xu3 if that support is enabled) On your debug branch, it just gives -1 for all the voltages, so the regulator voltage never changes: # ./dvfs CPU regulator: cpu0, vdd_arm, /sys/class/regulator/regulator.18 [ 45.691483] arm_big_little: bL_cpufreq_set_rate: cpu: 0, old cluster: 0, new cluster: 0, freq: 200000 [ 45.699581] arm_big_little: bL_cpufreq_set_rate_cluster: cpu 0, cluster: 0, 400 MHz, -1 mV --> 200 MHz, -1 mV current freq: 200000 current voltage: 1262500 [ 46.969821] arm_big_little: bL_cpufreq_set_rate: cpu: 0, old cluster: 0, new cluster: 0, freq: 300000 [ 46.978272] arm_big_little: bL_cpufreq_set_rate_cluster: cpu 0, cluster: 0, 200 MHz, -1 mV --> 300 MHz, -1 mV current freq: 300000 current voltage: 1262500 I added a bit more debug to the cpufreq driver[1] and found that the regulator_get_optional is failing: [ 3.407295] cpu cpu0: Unable to get regulator cpu-cluster.0 [ 3.458282] cpu cpu4: Unable to get regulator cpu-cluster.1 Kevin [1] #!/bin/sh if [ ! -d /sys/devices/system/cpu/cpu0/cpufreq ]; then echo "CPUfreq not enabled in kernel." exit 1 fi # NOTE: odroid-xu3: CPU0 = A7.0, CPU1 = A15.0 cpu=cpu0 reg_name=vdd_arm hwmon=hwmon0 #cpu=cpu4 #reg_name=vdd_kfc #hwmon=hwmon3 cpu_reg=$(dirname `find /sys/class/regulator/regulator.*/ -name name -exec grep -l $reg_name {} \;`) echo CPU regulator: $cpu, $reg_name, $cpu_reg # Cycle through frequencies (and check voltage) cd /sys/devices/system/cpu/$cpu/cpufreq echo userspace > scaling_governor for freq in `cat scaling_available_frequencies`; do echo ${freq} > scaling_setspeed sleep 0.2 echo -n "current freq: " cat scaling_cur_freq echo -n "current voltage: " cat ${cpu_reg}/microvolts # odroid-xu3 INA231 monitors if [ ! -z $hwmon ]; then if [ -e /sys/class/hwmon/$hwmon/in1_input ]; then echo -n "current voltage (ina2xx)": cat /sys/class/hwmon/$hwmon/in1_input fi fi sleep 1 done [2] ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table[cluster]); diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index 024f185b2154..4108f909cc9c 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -16,6 +16,7 @@ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ +#define DEBUG #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -446,6 +447,8 @@ static int _get_cluster_clk_and_freq_table(struct device *cpu_dev) ret = regulator_set_voltage_time(reg[cluster], min_uV, max_uV); if (ret > 0) transition_latencies[cluster] = ret * 1000; + } else { + dev_warn(cpu_dev, "Unable to get regulator %s", name); }