Received: by 10.192.165.148 with SMTP id m20csp5123621imm; Tue, 24 Apr 2018 14:12:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx48W2PHXJzcfNyaNwWkaRcszj5uWFf8vRBl9BZ09jhzXMw41D9XjZUIVNxVEVW85LeUr3uaD X-Received: by 10.99.178.3 with SMTP id x3mr21389116pge.266.1524604350371; Tue, 24 Apr 2018 14:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524604350; cv=none; d=google.com; s=arc-20160816; b=UHCSPydVR53hJjhJ80Fw75uUb3H3NoZJGXjcYeDf47fc3pu29hbIyybdsvvgz6vWzX jTMUVSZCcTpSl0SFaJjAOXGzeIrGkt6nzs5D5u8CrGBIS4SRrK5g0VUXEE9KysH8gOK7 FLMzv1KKa7DpRSzhn+pd5UbpldGunBPs8jiK3GFMd1t2cBmBQ1DtuXj2aI1Tdu+ODSjw N4gZeTDaqCl7+zlw/BOam4gyYLr4qxAzUOyOeLd9Tn8M7FcyBFuVi6UIT5hqpCLEjeZ+ XVMFOVfiJ0RsiEfJ3oQnH62g/33Fz3mNgFUvoyEfazwgCsAF+/X8KZPwDRlbocb/yvdd SgyA== 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=GELXHx7g5wK2CmyTzjhNG4E51sipFfFfF0iWHKkxDms=; b=JgrtrcD4GrBzqYBfWwZjPga25TPpeZB10v7CC9PZio43ORDRWYGX+vVFb5rd401NXQ eeASJilPUVZrooJ2LJIDZBdcaDlJXXh5DXYOoYEQNpf8ZkdpgYvoT+4i2pfLc3NidgsR LECFo1nDY+sZES/V0RUWk64YQOpEgw99wIaPe8PrX/yN1WMoeTbUe4xHA0bOztA05zJG K0EfEtfHRdPwT/IJEstCriMvzARMtlu1xFiPpLRzw13FR0kMxSvooEjnFCb1910WmRRZ 8CkqQCw4TFOgRksq8I6k673zyFtpEfkrCcyCRZZ1JKGVF8H4c6EiiIWezNp9XPv+PaQn ZOjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=ZWMcqeXA; dkim=pass header.i=@codeaurora.org header.s=default header.b=BIMNfvvn; 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 16si14440450pfh.354.2018.04.24.14.12.15; Tue, 24 Apr 2018 14:12:30 -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=ZWMcqeXA; dkim=pass header.i=@codeaurora.org header.s=default header.b=BIMNfvvn; 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 S1751242AbeDXVJw (ORCPT + 99 others); Tue, 24 Apr 2018 17:09:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44048 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750846AbeDXVJt (ORCPT ); Tue, 24 Apr 2018 17:09:49 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3435F60807; Tue, 24 Apr 2018 21:09:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1524604189; bh=5gWeq8PYWTLcVqSBqkPDxnn+f3D/yqS220vqWIQsQYg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ZWMcqeXAoBh6zVkPscyspIaUUMJ1vxJWdDbQhTbUNlDx7QilFxbKa8wlLG5MEArT/ ljmU6SgMoZJtgsY5KWbTSEgo1S68EsSuhkpuugJJJWK1G6l8z9C5wcEBkUOZoBec85 4IJP46KVlX2xWRllyuR6NmW9IzRsRi9I4yJ+ODHM= 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.164.143] (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 E8EA5601CF; Tue, 24 Apr 2018 21:09:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1524604188; bh=5gWeq8PYWTLcVqSBqkPDxnn+f3D/yqS220vqWIQsQYg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=BIMNfvvnZTcVm3m5uPcBDMtZp+Wxv6vXAxiB1rg2GsGjhMoaM/Xo+/01U6t+qHwhi W2h+E6NjUeJ3fyzFeOJXUD1H0K4dNzGjf+hyEiGvuCyk6zjKN+3nItRFCF0NAqZCpy B/jn2pTrmD4HctKXxrwiBFj9jRI0nCXatU2cer18= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E8EA5601CF 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 v2 2/2] regulator: add QCOM RPMh regulator driver To: Mark Brown Cc: Doug Anderson , Liam Girdwood , Rob Herring , Mark Rutland , linux-arm-msm@vger.kernel.org, Linux ARM , devicetree@vger.kernel.org, LKML , Rajendra Nayak , Stephen Boyd , Matthias Kaehlcke References: <4b45f41996ea3344340e44fab2dc9e487572e209.1523673467.git.collinsd@codeaurora.org> <4e3353fe-ebb5-46bb-aa58-49ad04c4d9db@codeaurora.org> <132ab845-52d6-6192-4d8c-5a9c95410688@codeaurora.org> <20180424174507.GI22073@sirena.org.uk> From: David Collins Message-ID: <20a8f736-2687-f14f-eaa1-2b2c06eed629@codeaurora.org> Date: Tue, 24 Apr 2018 14:09:47 -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: <20180424174507.GI22073@sirena.org.uk> Content-Type: text/plain; charset=windows-1252 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 On 04/24/2018 10:45 AM, Mark Brown wrote: >>> You'd need to ask Mark if he's OK with it, but a option #3 is to add a >>> patch to your series fix the regulator framework to try setting the >>> voltage if _regulator_get_voltage() fails. Presumably in >>> machine_constraints_voltage() you'd now do something like: >>> >>> int target_min, target_max; >>> int current_uV = _regulator_get_voltage(rdev); >>> if (current_uV < 0) { >>> /* Maybe this regulator's hardware can't be read and needs to be initted */ >>> _regulator_do_set_voltage( >>> rdev, rdev->constraints->min_uV, rdev->constraints->min_uV); >>> current_uV = _regulator_get_voltage(rdev); >>> } >>> if (current_uV < 0) { >>> rdev_err(rdev, >>> "failed to get the current voltage(%d)\n", >>> current_uV); >>> return current_uV; >>> } > >>> If Mark doesn't like that then I guess I'd be OK w/ initting it to 0 >>> but this needs to be documented _somewhere_ (unlike for bypass it's >>> not obvious, so you need to find someplace to put it). I'd rather not >>> hack the DT to deal with our software limitations. > >> I'm not opposed to your option #3 though it does seem a little hacky and >> tailored to the qcom_rpmh-regulator specific case. Note that I think it >> would be better to vote for min_uV to max_uV than min_uV to min_uV though. > >> Mark, what are your thoughts on the best way to handle this situation? > > I think that's probably only OK if we have a specific error code for the > regulator being limited in this way otherwise our error handling for I/O > problems involves us trying to reconfigure supplies which seems like it > would be risky. Would you be ok with -EAGAIN being used for this purpose? Thanks, David -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project