Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp103703pxv; Wed, 7 Jul 2021 21:36:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwT+2hHVFvOv2tSyO8woBNyK6b2nhvKTz4QIhPFmHNHkUddWvu+VVB+YA/oG6Ca+vxhcCqb X-Received: by 2002:a5d:9b9a:: with SMTP id r26mr14679249iom.34.1625718992519; Wed, 07 Jul 2021 21:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625718992; cv=none; d=google.com; s=arc-20160816; b=IX+WbDSS3t+A2g9lK3buEoojVz5vLaGV/z8DJ4QzoOCYWHBnFxZmlpj6ezZjqY2RDx 5xKFFHXx81M2SaWW372m7E5N0wy2kpKxhz3p2CuQRzF7HxRoJLP0VjFpoikL+L8YmN2+ yKFOcQJf1B34l/fPF7QyhJOIWmEqdO1uFynDaw/mvCiR4o+C3ldEXDT0Fco+ozCD0FRD UirVA8H+UaCV+PPVOKCXy2mpw14dUGhOylvhKabq/shrCGAorKOBVnEr1jmudKwSY3FM Pfw818RWkuK0gP1PB7bhFuEPT3Hm7b1sRWbyhEilvn4VO1e84pP5rXrbRa9KfXuThzjF 3OuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IfQ8PSVhuZ6L8Wdvtm/o1xt0WVv9JVjQWBs6sIfflpw=; b=E/V7W/4fsUaAO86V/qa/K6lygAIzZ4Ejd5GYvIpmwh3JE2P/kXuPYU7dWohBXLeSI+ uR4XezuV7tBc38M9pxElZdJkeHX28O1do3HZSH2DcoJXorha/n7xsujsyXMlZ+UuhCXQ A4ekvFFvQm7jop/MCVlujzkLL05VayflAvRLBjjprkZAKji0/qzS/EYwTtdYjhWJLPuB EK/oQIs0oDefY7WX4lPVfmg/7oJOYhJ6s70Oxkde+1gjBg0jT/hWQSVYJC23mg2ZVSSy VHV/bilhr2ljk8J/Z3H1qShF2t2qtNazPFEKL75a6szybYRshKwSW3GNOwMvgtWlQGDG +5Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=czj3Bg3U; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w35si1267969jal.82.2021.07.07.21.36.20; Wed, 07 Jul 2021 21:36:32 -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=@linaro.org header.s=google header.b=czj3Bg3U; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229595AbhGHEih (ORCPT + 99 others); Thu, 8 Jul 2021 00:38:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbhGHEih (ORCPT ); Thu, 8 Jul 2021 00:38:37 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCA05C061574 for ; Wed, 7 Jul 2021 21:35:55 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id z18-20020a9d7a520000b02904b28bda1885so3148283otm.7 for ; Wed, 07 Jul 2021 21:35:55 -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; bh=IfQ8PSVhuZ6L8Wdvtm/o1xt0WVv9JVjQWBs6sIfflpw=; b=czj3Bg3UkwAJ2FaKsXlvtboq/0UeWCjH+oJ7zB7j5BstzyX9WhzCvWnhb2S7es2gf/ qDYrKfpA1nCggf6H1R5Bx6DWE5jMNvHeIiWuet8vmoUGB6t3+JsdZbQom+aQhFirYIlw lk5k94QPLJXXCSi9P3ZutSP7sC4+t6g39imBzZcY/TKdeDUEkg2AXjYD9zj1A5HLQgTq cvTYB9hlVkZ7VN9Rhg/HJtIrSoGMzVIjOc7YDQkNmAqGdyZgJrXTcAlbhd6Z1KWjNLVv odpNJfg1EFnQcdJFvXpCKm19UXyToFmeNmvTEf9KM7qSyLa3ccLHvJzQTl2ndJNgd6ri csNA== 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; bh=IfQ8PSVhuZ6L8Wdvtm/o1xt0WVv9JVjQWBs6sIfflpw=; b=G2SbMhPbuwKPUItHmZ2r5jjAq79syTrDjQIJtmKtSS3JufFhVI6cVK0/MttpMvpvWJ i+muE3O9cdW0XFYx8EbIv27PcagfzTsuukHPSMsZ2x41dGEUDE5ZAHnzuJirc/TEyqMo 6bDc/d24ECXuOPl9xm7Tlyz6lGWwCXVqnnL0r3lm2hgpqLG2SeAKMpiWgQiXtdwvxYUN DYPpCv68OCgxJFNvGxorvh/RfA+JI/dcWP6S2kBXGPlhSdrVXDSmHprhWZIU2lJ8sOvw O9W5qqvqdvNzbpL0SR0IhtmFip7DzemJKp5gOZR6J87hftuv+tPUi+Hf0qOXE5jxPgea fjAg== X-Gm-Message-State: AOAM531g5SvOUxkrEss1PX3uvaagxztynZLsvq0cgb/SYvBTkQaNpQ9G 0UAEMo3ybCr7t28l1sA/XpJcXYmNKAU2tA== X-Received: by 2002:a9d:634d:: with SMTP id y13mr22566972otk.294.1625718955094; Wed, 07 Jul 2021 21:35:55 -0700 (PDT) Received: from yoga (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id o26sm325734oic.12.2021.07.07.21.35.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 21:35:54 -0700 (PDT) Date: Wed, 7 Jul 2021 23:35:52 -0500 From: Bjorn Andersson To: Stephen Boyd Cc: Andy Gross , Dmitry Baryshkov , Rajendra Nayak , Ulf Hansson , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] soc: qcom: rpmhpd: Use corner in power_off Message-ID: References: <20210703005416.2668319-1-bjorn.andersson@linaro.org> <20210703005416.2668319-2-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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"? 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