Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1739385rwi; Thu, 3 Nov 2022 08:33:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4M2Me3zzkWltHPj2L2wQ2j23KAEYq+S478925keRkpc3F1XCj3Pqhxhk9o77AZOYQv2qfC X-Received: by 2002:a05:6402:5483:b0:45c:1336:6d9b with SMTP id fg3-20020a056402548300b0045c13366d9bmr31352121edb.100.1667489597822; Thu, 03 Nov 2022 08:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667489597; cv=none; d=google.com; s=arc-20160816; b=njy8QYGUul7mQPrmaf36TMsqQBzxUrqXlg+ubAmCnEtk1wBZMk5ocVQtcuhfKQNRlB +zruHdF4UpZhSycJUA5CLd1NMVQp0bhrBIZhCtpfzkcBk3UgkGIvwLsTTBXprQ/cdrv0 LxA4O78gpAaO2MzcomhabqJ+VAPp6uJ83acx0yMn7Z+KZZf59jWo77TSfBErGMclDZUL tJyk0mnPXkL9QzxOd3gEo8QRL3dE3Zf7c+E4gHfSYPo173+qXinRfVPYA3x/1MdS4wwS DDgg58bTUE8Cx27OK+jhwSX3DKeWHhhJsrSLT32R+KuprpL1d78xC7Z9FJrlKQfJembx AkEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vSr+j5NVKiaQKfyexBjniTj+hsGjZmECfoeuhtqx5oY=; b=BjHb+qsPAgKccCKHgBn66y2rr604UL4pZPZMQPATVwSi6DVZ6/wbXc0Uqq9Byt4MWK XcY2jtbKMxkirzdPn0AVFPcrtSSCQzgR1M4vgaUgeZMtl0qdk2h6zL3EOQd7sGv7lLYJ GMZ9DyI+Y6lh8bQOD7KKmQ1FQSNoeg7qXoNMUfgpTavhYqhnSN9RqukvpmAr8TWVUSbn nSDWecvNN2jg2tbCqGurMkOWGbz0mbCrxGFv1hRviJGqgsX+EPZ3+/LBQunoRJi2AG4J RDiTnTpheXJ0xF2jSmWaVbvLp0yoGWFy45EhIWSq5c4T/kBQYdqWueozb/dj4DKXjzy8 kh+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nl4hwAxg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb36-20020a1709071ca400b0078db517075fsi1879557ejc.659.2022.11.03.08.32.46; Thu, 03 Nov 2022 08:33:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nl4hwAxg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232142AbiKCPXj (ORCPT + 98 others); Thu, 3 Nov 2022 11:23:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232137AbiKCPXg (ORCPT ); Thu, 3 Nov 2022 11:23:36 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E1181A395; Thu, 3 Nov 2022 08:23:31 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id l22-20020a17090a3f1600b00212fbbcfb78so5503598pjc.3; Thu, 03 Nov 2022 08:23:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vSr+j5NVKiaQKfyexBjniTj+hsGjZmECfoeuhtqx5oY=; b=nl4hwAxgDCnkbT375+YvDFPmdZC3EW9i3B3Jg+zGv4ZoeuK62Hh/mB12NqYbf8eEdm sp/ZzZNFUfNvOvfY4XkHngC/Hbx8vbax8DZG43MXeB2Ueo9CULssj+KMJ1eXrGN7w0EZ URG+n8Rw8YzN4f2hqbk2bg0Vj2J8TWcNw59Aw1LDU8p/DvScQExJv35AXd3u31w8HRow zaXC3oK1DRUc6wfQ9W9Gdnkr6xH6HtR52g5lKsgMtedJZ2SFNDeN3iZb0DT9vaqkl+Tp Oq5e3YCMw4TikRBCR5lT83eDrocswsyYA49q8X0nEzGMdLwwEqf3SvbTd0moaql5MgCZ wU8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vSr+j5NVKiaQKfyexBjniTj+hsGjZmECfoeuhtqx5oY=; b=URyDnNf0CsCH47v7ltXOBeFNweZYdsxD+S/40dvTuFYG6mPGDFV2Qd45yDQGh0DjtR FN/1N9LcZZbkGx5hnOppG2owmcOwh5rsx+mA1FSQru1tPS4vnd2hK2frlVzohuCcq9Hf 8fPY0IVG5UV2VIRcg0a013C/xbQXWb9xYQTSRJ/4ncFVeav4h6PDlSBbLiqgmcpcuKLn EUpR1MWtuuAoOF7CYu69U09KrlneD2yOiho82PRqF2VjyVG5qgaL6JdlVdEq/BbYAnu1 ld6NsPW7lDY1Lr+RgZR0jBdF71f6asA+diBcaQoHfKbrCXZElCMZbsZ3D62s1y3emjzH Qlcg== X-Gm-Message-State: ACrzQf1pDKKwNm24voqK1G6T2MBoqGxy9iu9YHbgcZhYHcKoJRrWeVUB Zlli5QMFtVOKLnfzeUZjYsU= X-Received: by 2002:a17:902:da8a:b0:187:3d6:4c60 with SMTP id j10-20020a170902da8a00b0018703d64c60mr30669393plx.117.1667489010643; Thu, 03 Nov 2022 08:23:30 -0700 (PDT) Received: from makoto.localnet (2403-580a-80ed--ccac-899b.ip6.aussiebb.net. [2403:580a:80ed::ccac:899b]) by smtp.gmail.com with ESMTPSA id p28-20020aa79e9c000000b00562f6df42f1sm856729pfq.152.2022.11.03.08.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 08:23:30 -0700 (PDT) From: James Calligeros To: James Calligeros , Viresh Kumar Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, nm@ti.com, rafael@kernel.org, sboyd@kernel.org, vincent.guittot@linaro.org, vireshk@kernel.org Subject: Re: [PATCH V2 5/5] OPP: decouple dt properties in opp_parse_supplies() Date: Fri, 04 Nov 2022 01:23:23 +1000 Message-ID: <2379445.NG923GbCHz@makoto> In-Reply-To: <20221103131051.2ivkhibbsdarbewt@vireshk-i7> References: <3519763.iIbC2pHGDl@makoto> <20221103131051.2ivkhibbsdarbewt@vireshk-i7> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, 3 November 2022 11:10:51 PM AEST Viresh Kumar wrote: > On 03-11-22, 22:24, James Calligeros wrote: > > On Thursday, 3 November 2022 9:01:08 PM AEST Viresh Kumar wrote: > > > > > @@ -674,7 +677,7 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev, > > > bool triplet; > > > > > > microvolt = opp_parse_microvolt(opp, dev, opp_table, &triplet); > > > - if (IS_ERR_OR_NULL(microvolt)) > > > + if (IS_ERR(microvolt)) > > > return PTR_ERR(microvolt); > > > > Erroring out here will still block EM registration on platforms without > > the opp-microvolt prop so we're back to square one, which means the > > patch does not do what the description says it does. It behaves > > almost identically to the current code. > > I am confused. > > With the current code, the following will work: > - all three available > - microvolt available and nothing else. > - only microamp available > - only microwatt available > - both microamp and microwatt available but no microvolt > - and other combinations > > Isn't this all we want ? You're right, I misinterpreted an error. Details as below. > What did you test exactly ? As I thought you will be testing the only microwatt > case here and you say it won't work. > > Sorry, I just got a little bit confused :( > I did test on the Apple machine with only opp-microwatt, but I misinterpreted the error. We end up here upon parsing the second OPP: >if (list_empty(&opp_table->opp_list) && > opp_table->regulator_count > 0) { > dev_err(dev, "%s: opp-microvolt missing although OPP managing regulators\n", > __func__); > return ERR_PTR(-EINVAL); >} When this path is removed, things work as expected. Could it be that opp_list has not been updated by the time we're parsing the next OPP? Seems unlikely, but at the same time if we're ending up taking this branch then there's not much else that could have gone wrong. - James