Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp433584imm; Tue, 22 May 2018 22:44:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpOFlP2ykrZ1Lfwhh/LNwuRmsJgx6MVZ+8bBp2GrdIgrqWtxEkhMivEbDaL6KCPdzz6MkZz X-Received: by 2002:a62:3c10:: with SMTP id j16-v6mr1468499pfa.7.1527054293236; Tue, 22 May 2018 22:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527054293; cv=none; d=google.com; s=arc-20160816; b=TmwV2QK6k01B4/rfJRLZfRx7YJcXgVprglqRlefSOMjp6rnl/+XWIzesbNUBzITPGQ g/FzC1iQRCkZChL0r7h+dvS/+eQBby5KML3kzvGfB4i0ZV097S59NS2bBexHH4m6hewZ CHuEAAXQkde/0K6ILyLCI10J3yV4BzJLzntidgQoxiPCrmqc2PmdEXBlbFLA36AWFm3p 7CpY0o3GmwNtTiOFKs8dELt0y3P1B7tfKKX+PWXqx7rMl8diRv8Da0H3fqJkyFhu7gkS 8EnXiCcYCV7EUDrqlAq8FSKuWkheTW1C33bGN73afKFwozbFdtEmiPqe74klC6/QQSCg XnJw== 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=TlZW+qGysMOfV3vWh3M349OLV4t23TXW1sRT2SUUkN4=; b=MfLMEYU/1R7zz3mpO0Wj4dQ2RebJx0pSvGfuAuISihdntKMGm6WP/3wXiQKVFwXzON 2ynyeEJGE6UUlqvPKgg0cApH2x03fpVZcrbgDccHDW2MszD4KOEqK8rkOpPeopWkS7xx jx1yebp2CBnelq3DKEYCJWXhgt+PvH25IKpt3mSxPfp8G2owhtN+nn3Vo+ipHJtQTJ5M MsYZmm1Gk0pG329N3LAT04hfKoflGrEuXbQKGldN4E/aUu5XQnMZmVWm0ywYPfjvH7PW 3DVRhiOr2uekxlrSSJWU0aRDOVII3KPzK3VXKTeXBru2XYs0aUAMVn3Hw78BnnMVUO52 lfYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JJa9K9au; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12-v6si6763607pgp.24.2018.05.22.22.44.38; Tue, 22 May 2018 22:44:53 -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=@linaro.org header.s=google header.b=JJa9K9au; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754026AbeEWFoN (ORCPT + 99 others); Wed, 23 May 2018 01:44:13 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:42094 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753852AbeEWFoJ (ORCPT ); Wed, 23 May 2018 01:44:09 -0400 Received: by mail-pl0-f66.google.com with SMTP id u6-v6so12306086pls.9 for ; Tue, 22 May 2018 22:44:09 -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=TlZW+qGysMOfV3vWh3M349OLV4t23TXW1sRT2SUUkN4=; b=JJa9K9aunNyKOfC4rd9CS5JndXJn3af144m7H1oXCvP+MZ/edW7Ym3CP7ylcJPyvpE X9EADMWGUXY+BS2njH2BVtXaSaXrgbutU7vkRvDO54luJaLs0DZZtrGdcJp2OEnCpdIG UKpJ+iwU9IW46696FEB+OGllw3mqEE37RxS7o= 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=TlZW+qGysMOfV3vWh3M349OLV4t23TXW1sRT2SUUkN4=; b=rlIMAGm/ViKVI5aau9cZ/7J1DXA1cjrDdjyyU0f6QqgCgU4B1gmSfjfyqPwM1eOapE BUqDfeoIJg1gX78/UFskCBFQTDHUGp524fCaUymXpeZ5l+pBELCCzgmuhZNMFHeF0mwo VxG2sVYKtCPsKHOk2E5ysz3ABmZ49fQj9Yx+azxYK1+39hayvrX2uQXCfVpbQX9ox3KS TS6OGuiF5Dtf1US30rJcmV3PREfkTmMblQAqG7lCyLX5LhZZ0u/JpnmSC/DfvvEuyVJ/ ZgUP+BxFdT78E5tiVYR1mAmfqg1rgNB2TScGFs6sATx4CgPStU+ij7y573ChZjgLIhZA L8AA== X-Gm-Message-State: ALKqPwccRnIz+BKZWZ+tw6z6ds5jA20K9E9Vyvv1qE9079/W12V1GR99 gKMeC4kqofOVBAvDigFv32xlDB66Fv4= X-Received: by 2002:a17:902:64d0:: with SMTP id y16-v6mr1466920pli.349.1527054248651; Tue, 22 May 2018 22:44:08 -0700 (PDT) Received: from localhost ([122.167.163.112]) by smtp.gmail.com with ESMTPSA id j10-v6sm36092025pfj.7.2018.05.22.22.44.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 22:44:07 -0700 (PDT) Date: Wed, 23 May 2018 11:14:05 +0530 From: Viresh Kumar To: Sudeep Holla Cc: Ilia Lin , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] cpufreq: Add Kryo CPU scaling driver Message-ID: <20180523054405.edj4svjdf5picno2@vireshk-i7> References: <1526729701-8589-1-git-send-email-ilialin@codeaurora.org> <1526988585-21678-1-git-send-email-ilialin@codeaurora.org> <20180522130704.GA31065@e107155-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180522130704.GA31065@e107155-lin> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22-05-18, 14:07, Sudeep Holla wrote: > On Tue, May 22, 2018 at 02:29:45PM +0300, Ilia Lin wrote: > > In Certain QCOM SoCs like apq8096 and msm8996 that have KRYO processors, > > the CPU frequency subset and voltage value of each OPP varies > > based on the silicon variant in use. Qualcomm Process Voltage Scaling Tables > > defines the voltage and frequency value based on the msm-id in SMEM > > and speedbin blown in the efuse combination. > > The qcom-cpufreq-kryo driver reads the msm-id and efuse value from the SoC > > to provide the OPP framework with required information. > > This is used to determine the voltage and frequency value for each OPP of > > operating-points-v2 table when it is parsed by the OPP framework. > > > > Signed-off-by: Ilia Lin > > Acked-by: Viresh Kumar > > [...] > > > + > > + switch (msm8996_version) { > > + case MSM8996_V3: > > + versions = 1 << (unsigned int)(*speedbin); > > + break; > > + case MSM8996_SG: > > + versions = 1 << ((unsigned int)(*speedbin) + 4); > > + break; > > + default: > > + BUG(); > > + break; > > + } > > + > > + for_each_possible_cpu(cpu) { > > + cpu_dev = get_cpu_device(cpu); > > + if (NULL == cpu_dev) { > > + ret = -ENODEV; > > + goto free_opp; > > + } > > + > > + opp_tables[cpu] = dev_pm_opp_set_supported_hw(cpu_dev, > > + &versions, 1); > > Will be not get NULL for all CPUs except 0 ? With my patches, we will get the OPP table again with refcount incremented. And on failures, we need to call put-supported-hw helper only for the CPUs for which it passed previously. -- viresh