Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp162604imm; Mon, 21 May 2018 04:06:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpYnYwFQFGEAs1qBdIz5tB6Kr0aQUUmcgDLfu9EVBPrjD0N9c3kRKD7kEfCysNVFAQE88m7 X-Received: by 2002:a17:902:8d8c:: with SMTP id v12-v6mr19882836plo.366.1526900774254; Mon, 21 May 2018 04:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526900774; cv=none; d=google.com; s=arc-20160816; b=aoDnEBUNXNAxTdlf86A4q+mPbMwcs4+UsXnupPzBuxxLkcITvgm+zMp1t0iyF22YCd T6DKrig9SvO4GwqkFX+bE7IzENZWKScs2Vbb1/Gg6I2QwfpCp4NA+4+05jqNnXZTUrRg MJWga+3RX37ethPK+9QMDEQDL2kVc0GEZiRU8nRRoCZ6SMmVctw8rI/8Td3Ztyq2RVio P2/kxj8X1wKWuBOy5s27eDxXxlycJDEol5Egg0dCvJeNJRKCwY46B4lN0MtqB2z0G+Qx gfAl/5+BCGWDG8rKWHae4NNGXqhN3ljJEHiMh0v37bgPgeW41HMHMTZ65RZDeg7AaXlU Logg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=KUec9IvK370xzwgua8Wl7y5mtZXF6d0wdBoh3xvVm40=; b=qLAArbijxi7254qrDRNDuujSG4TcZX8r7yb/awd0Y1mE+5C5rOxJUT2VkTGhqGK+yu Op7R5YNdHfoPiQCoH23EwUg+iyL+OQmvtV6ngvi0WyBvrd1jcrxx0VmpkXkcuxz25Nco 5j8ZfcUcFeuRTQQF4kXvUmyLG+HQoluUYl7Trl5SQnhCdhS2iBL8rWPHjTZ5N/ae4C2I fDiPjp1mwjBSRRv8sK4XzokrhN3yd9JiX7eRdQw/Vr1BdhJS9JHd0ak4uQL1Uq628GHu +aSUIheraZqNZm7nR0GMdCtMxSIS5MEQMPvsC3eMh9FNYohvDilLmcTgPMwAaEe6/Zxp UAvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=njeGrtKA; dkim=pass header.i=@codeaurora.org header.s=default header.b=MJMAKmb4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11-v6si13639593pll.15.2018.05.21.04.05.57; Mon, 21 May 2018 04:06:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=njeGrtKA; dkim=pass header.i=@codeaurora.org header.s=default header.b=MJMAKmb4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751895AbeEULFt (ORCPT + 99 others); Mon, 21 May 2018 07:05:49 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52570 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbeEULFr (ORCPT ); Mon, 21 May 2018 07:05:47 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 99FDE601E6; Mon, 21 May 2018 11:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526900746; bh=ekXZvgY+v8XAynciEqHDCdviovBfDN/BCgrGYIfiHm8=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=njeGrtKAj5V/a16oAkdW8Z1k125FnZASdMp4TL7P2lvUsCFUFJVwV0AvuBSogyEMT lPbx5d8ns1GcbVV063T0si78FwxY+KLdPj2jjBzIFX07kE+ch5LNuTzX4nlLmjnsdm bocU0hVhseHyhJ2UYnJy/cdfUPcFK2/DWmDACz/s= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from ilial (unknown [185.23.60.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilialin@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7C85660314; Mon, 21 May 2018 11:05:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526900745; bh=ekXZvgY+v8XAynciEqHDCdviovBfDN/BCgrGYIfiHm8=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=MJMAKmb4fTmRmh1AagFJLInbbrDgNqC4tFlUpkA0TpZE9pLIOKFPHt7yzHgvaRE5g zFkMTHGaUaVDykhDiO52NUdxdcFMSmyYeRA7r9HS6veSxKSo9RNs9AWe/MdLAdZP2u GYRNNbiZ4SVxBJIBa0LgBh5gaN2Zco7XT3sThFxQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7C85660314 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilialin@codeaurora.org From: To: "'Russell King - ARM Linux'" Cc: , , , , , , , References: <1526555955-29960-11-git-send-email-ilialin@codeaurora.org> <1526898690-4018-1-git-send-email-ilialin@codeaurora.org> <20180521105428.GM17671@n2100.armlinux.org.uk> In-Reply-To: <20180521105428.GM17671@n2100.armlinux.org.uk> Subject: RE: [PATCH] cpufreq: Add Kryo CPU scaling driver Date: Mon, 21 May 2018 14:05:41 +0300 Message-ID: <000b01d3f0f3$aa961cc0$ffc25640$@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQF4oTaoNxz6XIk2qh8MCLQUCquwggKwu+X3AuWN43ekw/JeUA== Content-Language: en-us Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org You are right. cpu_dev_silver != cpu_dev_gold, and I found this with my tests as well. Thank you. > -----Original Message----- > From: Russell King - ARM Linux > Sent: Monday, May 21, 2018 13:54 > To: Ilia Lin > Cc: viresh.kumar@linaro.org; devicetree@vger.kernel.org; linux- > pm@vger.kernel.org; linux-arm-msm@vger.kernel.org; linux- > kernel@vger.kernel.org; linux-soc@vger.kernel.org; linux- > clk@vger.kernel.org; linux-arm-kernel@lists.infradead.org > Subject: Re: [PATCH] cpufreq: Add Kryo CPU scaling driver > > On Mon, May 21, 2018 at 01:31:30PM +0300, Ilia Lin wrote: > > +#define SILVER_LEAD 0 > > +#define GOLD_LEAD 2 > > Okay, two different values here, but "GOLD_LEAD" appears unused. > > > + cpu_dev_silver = get_cpu_device(SILVER_LEAD); > > + if (NULL == cpu_dev_silver) > > + return -ENODEV; > > + > > + cpu_dev_gold = get_cpu_device(SILVER_LEAD); > > + if (NULL == cpu_dev_gold) > > + return -ENODEV; > > get_cpu_device() takes the logical CPU number. So the above gets CPU 0 > each time, and so cpu_dev_silver == cpu_dev_gold here. So what's the > point of the second get_cpu_device() ? If it's supposed to be: > > cpu_dev_gold = get_cpu_device(GOLD_LEAD); > > That would get CPU 2, but in terms of these defines, it doesn't make that > much sense. What exactly does "silver lead" and "gold lead" refer to in these > definitions? > > > + opp_silver = > dev_pm_opp_set_supported_hw(cpu_dev_silver,&versions,1); > > + if (IS_ERR(opp_silver)) { > > + dev_err(cpu_dev_silver, "Failed to set supported > hardware\n"); > > + ret = PTR_ERR(opp_silver); > > + goto free_np; > > + } > > + > > + opp_gold = > dev_pm_opp_set_supported_hw(cpu_dev_gold,&versions,1); > > + if (IS_ERR(opp_gold)) { > > + dev_err(cpu_dev_gold, "Failed to set supported > hardware\n"); > > + ret = PTR_ERR(opp_gold); > > + goto free_opp_silver; > > + } > > Given that cpu_dev_silver == cpu_dev_gold, doesn't the second call to > dev_pm_opp_set_supported_hw() always fail, as opp_table- > >supported_hw will be set by the first call? > > To me, this driver looks completely useless as it will always fail to initialise, > and I question whether this code has even been runtime tested. > > -- > RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ > FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps > up According to speedtest.net: 8.21Mbps down 510kbps up