Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp151386imm; Mon, 21 May 2018 03:55:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp9n54zl20Q59CCAR6dIO5Hjp4yphuriaYKQf+hKet/JEBrnzDIxMBUETMsv3Bx6NW6KSDb X-Received: by 2002:a65:4c05:: with SMTP id u5-v6mr15022228pgq.388.1526900108982; Mon, 21 May 2018 03:55:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526900108; cv=none; d=google.com; s=arc-20160816; b=SoPrVFcEUEuDYhbn95moVjgfti0OoQjVAVuFCbCwt7ooAQfvoN3ij/SNHik/41tBFb Q7q6MaCoJpZPYHpJ4o0ynC4QxjY9D4sZkUYwYklZES57dgg6tIv1NXjknzrT+vv0PNNc 22X3+O1I1GvHsn0mUOzr851ZDi80Iw2lh9RdxNLVxx7Hj8y3C5A8g1mUKX5hSqLSLrK9 unMYyfbEUcuCojnDEnDsixebGVzK5e+NKI0S0aynOrsBJrlDKxZ96udOrPYjBwiHNabN FVMcHiDVQzyZFnBIgT/ko/WieLhuuG1zda0iesUnIAD1NuGhdqG6z8Z8Q4iyNu4a+R4s QejQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=8v+cG8jLiVjmiQZ7XqSwlIE6UIHOoKy8zCBK+2c/H1k=; b=QGzhuQBRjreVos5zfWq2+wHzHooIUSkjS3eBugDEm6vgLDlF8xmj1N3NQDrbT0lDcY XynSGBwi85+RF9uI/xXL0KRuNWAnvbj3yzQTyHVRm4IuR1Pxt4K0moDNetdft2vNESnk Yvn1tuFflqD6a3o/NJxKumfSr6T6PtbvpTjrT0i30pbvCo4lmTH95HtJpJq85Q89t/5c gPsenq67Sf8Pw3CwHf3Vld5XiVbHmgo5f0VXBGptve4TDMuoKcMqnFQRnOSCtzoIH20b wvVLHDpWD1lvm/rglD+RCSJnB2rCTU77vUZkyTU8u19YU5Jb9JHoo8k9hy+xHNY47WYJ orfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=fUKRzTUS; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r39-v6si14242143pld.249.2018.05.21.03.54.54; Mon, 21 May 2018 03:55:08 -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=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=fUKRzTUS; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669AbeEUKyn (ORCPT + 99 others); Mon, 21 May 2018 06:54:43 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:37746 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751078AbeEUKyi (ORCPT ); Mon, 21 May 2018 06:54:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8v+cG8jLiVjmiQZ7XqSwlIE6UIHOoKy8zCBK+2c/H1k=; b=fUKRzTUSVZJAPp04z2bYT2LaB cyV9NQyO5kxqdyvCPdlSxLDVt+XFKZv+1nW0/0eemBTPPpXfbo7FhD+XhltUeL2WmIsY5elEUhktu +7itAJ3P59cs3SjUxlmmZrHqy2rDwEWrTTxP6pszqsSe+UyMCSw6QbHSHgzdbmRxkUlWs=; Received: from n2100.armlinux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:57050) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1fKiSW-0005tE-DP; Mon, 21 May 2018 11:54:32 +0100 Received: from linux by n2100.armlinux.org.uk with local (Exim 4.90_1) (envelope-from ) id 1fKiST-0007KL-My; Mon, 21 May 2018 11:54:29 +0100 Date: Mon, 21 May 2018 11:54:28 +0100 From: Russell King - ARM Linux 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 Message-ID: <20180521105428.GM17671@n2100.armlinux.org.uk> References: <1526555955-29960-11-git-send-email-ilialin@codeaurora.org> <1526898690-4018-1-git-send-email-ilialin@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1526898690-4018-1-git-send-email-ilialin@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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