Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp31041imm; Wed, 30 May 2018 16:59:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKuGntjPVplTmmhhOenShuCG5Svx3qvNEc8U8p6jXLfP/HX4kq+HPWL6UChBH6CwIdsV4n6 X-Received: by 2002:a65:4805:: with SMTP id h5-v6mr3726332pgs.96.1527724788565; Wed, 30 May 2018 16:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527724788; cv=none; d=google.com; s=arc-20160816; b=upBVRi/bpN9jK+gZFZaA4a6tgjNhX1xyDdsb2/2Lb5l6saK0kl6IJH4U5pbVG6rDMc K0drOKDg0/yeydv9RsuwNKifwkWD+kWdHsT5H0Tc8t6gwaqDCvGz37gzoh8m5hZ7hn2i tHjvI1XsrS74KO/SVc8YKx7UAiYHoz3hnF6EnnX5VxLtzWm/IBCXnAFWfPpXKEqVECM7 Shk1ElomOjov6gVE3Y5Pao1jFtGFBOcPXGnsTttlD0Mz68D/vCDKOUF+X6z/EaoWgJKy fE3TvkGoIoiy/X4hPyx4bwoPX5CJuye/F5Ztq90Les+iNfoYvZKIvjLdksTPEPepQfH9 c91g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=+W4rZqI4yq80gRUTJidQBfWhHQ1PCSmpg7aVTdXEFHc=; b=W/JJjDLOOKer0QAsVpSzj3/EIR1PMrxrdh8n3dE1BwaVuBKe3xNM9GVPcIx8NaQaOv Hgtn23Q11YRWhOCS0dCutf9K0Nzjb3UvI6ZCypKsHCKcxrY0JlKZG5WEfeY/DfgZ2r2B HKdApg28lZuLxw6+LROMlXpqbXlXuG1Re99NN3e33YMgObwqyiu4SrTLZIBYD72Y/nLW gfsTPegC3Qkm7ejfZtg+BXGqiLzuqh7zvNcykBmlXu4y6oPDOf2tsWNSJkO+xkKCmNVY C8kM/ELme4F0UGOPrA8qWcGQls5nXLIHRNalTYYgriKJ8LGGy1fdAsMMh3CFgoqWWAwB Abfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=fzJAjvS6; dkim=pass header.i=@codeaurora.org header.s=default header.b=JwnrDRBi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m79-v6si35283269pfi.236.2018.05.30.16.59.34; Wed, 30 May 2018 16:59:48 -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=@codeaurora.org header.s=default header.b=fzJAjvS6; dkim=pass header.i=@codeaurora.org header.s=default header.b=JwnrDRBi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932548AbeE3X67 (ORCPT + 99 others); Wed, 30 May 2018 19:58:59 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33832 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932091AbeE3X64 (ORCPT ); Wed, 30 May 2018 19:58:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4C8836075A; Wed, 30 May 2018 23:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527724736; bh=XKiYViJ2xy9QfB+GeKXsGKtCLZ6wlSO2WMmFmC+Dz3k=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=fzJAjvS6LR/OQrBOCMwUxhqfKcFoML6q9tfMBAal4PEvyM9XOSgmNwmv/2nouaTDs Gf2Sk1zFUbGUgf1J2LGygii+CplimhqtfnISqP9KDIrp61P4mFnQuClXDT5sBwSlMT /pHMQyX+oPpuY8rnQTLKXBYQHtHWKjAW8U29k4u8= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.46.160.165] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: collinsd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D62FD6063F; Wed, 30 May 2018 23:58:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527724735; bh=XKiYViJ2xy9QfB+GeKXsGKtCLZ6wlSO2WMmFmC+Dz3k=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=JwnrDRBiEnY57QQX1yuFf/mFqgq+zrPkAaiopFYD7CcfmOqO9oPFmJRxsojjYLNCl jnZ62wvpZbY4Rsb9RkvJ+QtlpdwMdTClyxiOcd8XxdxDZ6s7FDPjfX9DMXP6Cgd4h4 0Lu8RJkNs4ajTpqVhPWn8C6OG1Z+c6UDAvC8RBaU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D62FD6063F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=collinsd@codeaurora.org Subject: Re: [PATCH v4 2/2] regulator: add QCOM RPMh regulator driver To: Doug Anderson Cc: Mark Brown , Liam Girdwood , Rob Herring , Mark Rutland , linux-arm-msm@vger.kernel.org, Linux ARM , devicetree@vger.kernel.org, LKML , Rajendra Nayak , Stephen Boyd References: <7489cd65fedb8a31488cf8188885759bcd4820ce.1527040878.git.collinsd@codeaurora.org> From: David Collins Message-ID: <5e65b713-6d45-4b33-d05e-6ebe2c6b6cec@codeaurora.org> Date: Wed, 30 May 2018 16:58:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Doug, On 05/29/2018 10:32 PM, Doug Anderson wrote: > On Tue, May 22, 2018 at 7:43 PM, David Collins wrote: >> + * @ever_enabled: Boolean indicating that the regulator has been >> + * explicitly enabled at least once. Voltage >> + * requests should be cached when this flag is not >> + * set. > > Do you really need this extra boolean? Can't you just check if > "enabled" is still "-EINVAL"? If it is then you don't pass the > voltage along. > > ...this would mean that you'd also need to send the voltage vote when > the regulator core tries to disable unused regulators at the end of > bootup, but that should be OK right? If we never touched a regulator > anywhere at probe time and we're about to vote to disable it, we know > there's nobody requiring it to still be on. We can vote for the > voltage now without fear of messing up a vote that the BIOS left in > place. > > In theory this should also allow you to assert your vote about the > voltage of a regulator that has never been enabled, which (if I > understand correctly) you consider to be a feature. Removing 'ever_enabled' and caching the voltage when 'enabled == -EINVAL' seems workable. I'm a little concerned about this resulting in voltage = regulator-min-microvolt requests being sent for all regulators that are not explicitly enabled by Linux consumers before late_initcall_sync(). Theoretically all of the boot loader hand-off cases should be taken care of by this point so it should be safe. I'll make this change. Take care, David -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project