Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp345593imm; Fri, 1 Jun 2018 01:49:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJNcrGS2HhAOIbuWQiyin7ZsVDo4oHh98Hz0ZfDCSPnIIXpT61p9JtYa4q4hVMKIYyp28/h X-Received: by 2002:a17:902:7248:: with SMTP id c8-v6mr3541322pll.128.1527842975894; Fri, 01 Jun 2018 01:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527842975; cv=none; d=google.com; s=arc-20160816; b=0hmM4/MK7HIwezwazFI5WQFqljLUhprFKkFZKppPLmXjCe8sSRBBBGpuNEnuCYBe3E 6QCL1E8DHBfiEyk4cPQV3fhXCphYLRA7iLfcfbpk15YaljpwIW3IzQ7UhSZS1jys2QhM ncnFX3s+QX9//4olixubcZ3r/CWRwVYRdL+aSdGvyRTnzKtEpYbNQXNuApjglwd4N44i E++f+mQh0iKg2MGeKQmoba5nPySjPGy9zeAervtfvO6LH+hSlOyyevpteGofqX3Ws4yI gCnBCfNHeGePT4Uv2ceh5VamIS62wM9XrDw5SgIpp6KbanY+oCGy4eZEOf+t+jy/NcHz LJZQ== 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=MIt2XEjRES3PnvEn4Hd7QjMgUmQK+BNFEY5MZv4nSIM=; b=cTya4tltMDGzLjcGbL6bPqUMWKsoqcqKXSCXzMVfLvm+7TWSy3SubRG1+OARJIp7Uv UaYYksKa73DcfJ2sIForNGQsXYxZcdrfUNxhF4c0OFpbiMpFdNcz8Wb24Hhr64arwi6z 5NzvAjns1vWmdyS9q0hjSiwLHCXlIKR5cmGf2Hge0IwXcCJRzEr/dJ7wT+Oi84dLdpBA reeuaHaBmsNHSgrLJlh61QDMN2cExB5MwdsZeFJaC784B38DaJGu79Fnex5TcnqdtHAf PnrhFrtMPCf2tUQ9axzdpp8Bud6JVoNnSwsQ3rnJwXGmYpbxyrxouaBLhNUPgzwR+iqJ XBlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=X4zOS+HG; dkim=pass header.i=@codeaurora.org header.s=default header.b=YEZQKKvk; 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 b66-v6si39588068plb.107.2018.06.01.01.49.21; Fri, 01 Jun 2018 01:49:35 -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=X4zOS+HG; dkim=pass header.i=@codeaurora.org header.s=default header.b=YEZQKKvk; 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 S1750916AbeFAIs5 (ORCPT + 99 others); Fri, 1 Jun 2018 04:48:57 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53542 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750770AbeFAIsw (ORCPT ); Fri, 1 Jun 2018 04:48:52 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EF8B160708; Fri, 1 Jun 2018 08:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527842932; bh=ejhiwaMKuqpIQXFFhdEBsAbCOh9ZWu2kFs5e05n0CZM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=X4zOS+HGu17dlpvDTGHBQauMWsBX83LWylZ3nb3HrF+JyubFlm7nRNEZgOiv0BuMQ hUEQMCJg85bIh8LOfHwxnZLxChiGKAqPxgFdJhHtKMCLGDqigIsvASmhHwS7bsDfJe Tbxcd3KxHD2u/AoyBSlYsK6b7EgLq2Yq1I9hQMrk= 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.79.40.88] (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@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 26CBB601A1; Fri, 1 Jun 2018 08:48:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527842931; bh=ejhiwaMKuqpIQXFFhdEBsAbCOh9ZWu2kFs5e05n0CZM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=YEZQKKvk8yIQbURORJk8KJR3iR/+d3U+Ml4gUYy+Z9v9OOR5rvmT1BoZYOkhtOYw0 tff1iswqzxRwyWiwn4WY/PUB1gj2ICpeTbO8Obq2feS+VSa8H2Vu2RYduCwc6Z8pQq 9fHPCwTPTDpEuUoCLiHp6DY2W3/vM1nBaddISqiU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 26CBB601A1 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=rnayak@codeaurora.org Subject: Re: [PATCH v2 5/6] soc: qcom: rpmh powerdomain driver To: David Collins , viresh.kumar@linaro.org, sboyd@kernel.org, andy.gross@linaro.org, ulf.hansson@linaro.org Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Lina Iyer References: <20180525100121.28214-1-rnayak@codeaurora.org> <20180525100121.28214-6-rnayak@codeaurora.org> <215deee5-6472-d587-9a90-f7158162ed82@codeaurora.org> From: Rajendra Nayak Message-ID: <6817acaf-9a68-5cd5-4dd0-ebe12a9aa057@codeaurora.org> Date: Fri, 1 Jun 2018 14:18:46 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <215deee5-6472-d587-9a90-f7158162ed82@codeaurora.org> 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 Hi David, On 05/26/2018 06:38 AM, David Collins wrote: > >> + [1] = &sdm845_mx, >> + [2] = &sdm845_mx_ao, >> + [3] = &sdm845_cx, >> + [4] = &sdm845_cx_ao, >> + [5] = &sdm845_lmx, >> + [6] = &sdm845_lcx, >> + [7] = &sdm845_gfx, >> + [8] = &sdm845_mss, >> +}; >> + >> +static const struct rpmhpd_desc sdm845_desc = { >> + .rpmhpds = sdm845_rpmhpds, >> + .num_pds = ARRAY_SIZE(sdm845_rpmhpds), >> +}; >> + >> +static const struct of_device_id rpmhpd_match_table[] = { >> + { .compatible = "qcom,sdm845-rpmhpd", .data = &sdm845_desc }, >> + { } >> +}; >> +MODULE_DEVICE_TABLE(of, rpmhpd_match_table); >> + >> +static int rpmhpd_send_corner(struct rpmhpd *pd, int state, unsigned int corner) >> +{ >> + struct tcs_cmd cmd = { >> + .addr = pd->addr, >> + .data = corner, >> + }; >> + >> + return rpmh_write(pd->dev, state, &cmd, 1); > This can be optimized by calling rpmh_write_async() whenever the corner > being sent is smaller than the last value sent. That way, no time is > wasted waiting for an ACK when decreasing voltage. Would you mind adding > the necessary check and previous request caching for this? is it safe to assume all sleep votes can be sent as async always? and only active votes could be sync/async depending on the last value sent? regards, Rajendra -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation