Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp124170pxv; Wed, 7 Jul 2021 22:09:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+z/3swzryet0dSIQFy2l4sKcJ+AYCC+rR7BAaViNGMpTw1SGI/bNJBUoZNpoAXciU7F35 X-Received: by 2002:a17:906:a2da:: with SMTP id by26mr12664880ejb.232.1625720990935; Wed, 07 Jul 2021 22:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625720990; cv=none; d=google.com; s=arc-20160816; b=aqOtKuLR3KfEPnLXQNU94K7zp43n7+EuOnaGpbBj0gbRw4iLx5nADp2UDhJQggpdNU RNZoMu3Rp7u7wYVi9fXYny5NfKUdjRQ50AjDSFZFQJFcWiqUcQ8Bd0sZPaO33cMccUeU cLg6K5tKQFg7OHXyW3HM1hT3exfTvMyOam7fM5IlP9bzRHH5hqAqZuhGzmvoBYYDUqBU LtMgBhdEn31V+eW7hD9Nh8OkfWSR2aTmLp4MKbQP0BWigw1pRrh8avzqgJYb0MPcJPMm HRT7bBy3NXvnoRO+AeCoL4A6/QIuTmXat71cSZA2v+ZklvSSjBhZazwZ8th6FB4nOxkv YzSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=Bmtb2+dcXVz0RPexDRJ8WNuL5FB2CDC6OCQ8750mwHo=; b=k6t+CvSNfPf11iaI1DbcKkJsFtGWGongZNqOC88cAuBQC4umNPYYQrZmXUOGdWVN7E rRR24pNslDq/xM126YzjA+mIP90pRUB5za6zKYDE/lea1IeBONWKMd7UH0JruXAJTXVk IX02PSaK9Hqq7koQa4jPQxxmV45cyNTExeQHFHbtOm/8BSN5QzS0yIq8V7lyEWh34iKr VrIwasjWwEkEgNHjSilk6GVijeaEaEJ3AnsWSxNt/NkO1oUfvFpHyJqeMLqp9JKxx/Cc EuGfYqkLDcSeg0hYZGarZxDwMPbJs3Te/VI0pRLRbiRwk5FiZiv6zWiR8yRw45a/Gli8 sXcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="LQg+/Snr"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t5si1562322edd.285.2021.07.07.22.09.28; Wed, 07 Jul 2021 22:09:50 -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=@mg.codeaurora.org header.s=smtp header.b="LQg+/Snr"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbhGHFGm (ORCPT + 99 others); Thu, 8 Jul 2021 01:06:42 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:28358 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbhGHFGl (ORCPT ); Thu, 8 Jul 2021 01:06:41 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1625720640; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=Bmtb2+dcXVz0RPexDRJ8WNuL5FB2CDC6OCQ8750mwHo=; b=LQg+/SnrZtYtT1a6rbgukWm+UUWKuRhOhaBdNfwiM6hxigJMbppC32Lp+nK9AI8w/d5rQS0u D790KJvB+kF7eRxnlVFESVaWawyIoZ11z7Xtw30hAiNQKzsLPqTkuqcCVCjHvNvlHA4gGv9U mIhlPfCLzxU2+7PsHpw4xw5D1lM= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-east-1.postgun.com with SMTP id 60e68740ec0b18a7452eff86 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 08 Jul 2021 05:04:00 GMT Sender: rnayak=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 4B7F6C433D3; Thu, 8 Jul 2021 05:03:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.50.35.89] (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak) by smtp.codeaurora.org (Postfix) with ESMTPSA id 464CFC433D3; Thu, 8 Jul 2021 05:03:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 464CFC433D3 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=rnayak@codeaurora.org Subject: Re: [PATCH 1/2] soc: qcom: rpmhpd: Use corner in power_off To: Bjorn Andersson , Stephen Boyd Cc: Andy Gross , Dmitry Baryshkov , Ulf Hansson , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210703005416.2668319-1-bjorn.andersson@linaro.org> <20210703005416.2668319-2-bjorn.andersson@linaro.org> From: Rajendra Nayak Message-ID: <8da6e99f-ae80-b9a5-4fe9-6cc467ea65d0@codeaurora.org> Date: Thu, 8 Jul 2021 10:33:53 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/8/2021 10:05 AM, Bjorn Andersson wrote: > On Wed 07 Jul 19:21 CDT 2021, Stephen Boyd wrote: > >> Quoting Bjorn Andersson (2021-07-02 17:54:15) >>> rpmhpd_aggregate_corner() takes a corner as parameter, but in >>> rpmhpd_power_off() the code requests the level of the first corner >>> instead. >>> >>> In all (known) current cases the first corner has level 0, so this >>> change should be a nop, but in case that there's a power domain with a >>> non-zero lowest level this makes sure that rpmhpd_power_off() actually >>> requests the lowest level - which is the closest to "power off" we can >>> get. >>> >>> While touching the code, also skip the unnecessary zero-initialization >>> of "ret". >>> >>> Fixes: 279b7e8a62cc ("soc: qcom: rpmhpd: Add RPMh power domain driver") >>> Signed-off-by: Bjorn Andersson >>> --- >> >> I think this is why qcom folks talk about "virtual corner" and "physical >> corner" because there's the one in command DB and the one in hardware. > > I think the driver uses "level" and "corner" to denote the two different > number spaces, so I think we're good...now that we after this patch > don't pass a "level" as "corner" during power_off ;) > >> Maybe we should change rpmhpd_aggregate_corner() to call the argument >> 'vcorner'? > > So "virtual corner" is "corner" and "physical corner" is level? I.e. 256 > is a "physical corner"? I haven't heard of anything called a 'physical corner'. These were always referred to as virtual corners, on older platforms it was just one contiguous number space, on newer ones we added another higher level sparse number space just for more fun :) Command DB refers to these as hlvl and vlvl, I haven;t yet figured out what their full forms are :/ > > Or did you get the suggestion backwards? > >> Unfortunately we can't really build a type system here to >> make this problem easy to catch with a mismatched type, unless there's >> some sort of typedef trick we can play? >> > > s/i/corner/ in rpmhpd_set_performance_state() would further enforce the > naming scheme used and reduce the risk for future confusion. > > But we did just squash the final bug... ;) > >> Reviewed-by: Stephen Boyd > > Thanks, > Bjorn > -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation