Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp944071imm; Fri, 1 Jun 2018 12:20:42 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJpfSKapKVoLO9pVXe1a3vJYsEin03koUQ7Pq0Q7I5Xh9U+k42RSRLDCzjHWR92TgCby/qK X-Received: by 2002:a62:5754:: with SMTP id l81-v6mr12055238pfb.56.1527880842413; Fri, 01 Jun 2018 12:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527880842; cv=none; d=google.com; s=arc-20160816; b=E26qXTW0uecYdzUNsF4yvmYVLOQ6ZOdtE7KZyCEO4cE6aLt58vxqCRs44Pmpqunp/Q vMjkfZZrrbqD/aPpqXkQgvZbL+6mketg9qMhjAnyQuH5Dan67f2vWgNZdJ+nSy7bDWt0 u4+fEtH12c509b78XE+NcxAwBgwMxojtCU2ICkURoXpSjpTl7QaHBhQMI2+y5EE/Tewm /dGsqGUJPHRKVUnATfrFc1vhuo8A4MCcj2Co3n9/J7AMcH34eBPelykLVwtU7FrcnyMU v5cB/9UJhjExyxg789vDgYLSDreT8hOcqZZ6dOk20+aYzQip4P8UJOkPFC9tBMwgbdJi 4Hsw== 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=CqW+Hueq/RdtsPZyWbCHAktF5uVj3F3FOuQBfpR9VRo=; b=yR6roveW5YSD1Dig76eyJFLjHbY59m3jvKbALikDxG9b6Icv6vthJOKGFlsbIpsLYn nt/H/+jhaWwNkXkhDV+GsNuaIH/lPd3+Lwl1iX6Ln8xAY3L+l+zcj0jia9nznkCZJajx 682vT3rSFFedhoVMy08JG798wvSSS08toYo1SkW4XYHth0YNrzERCRqKdi1Cz7/koUSH wljnY0410Az7xYJt/81nGmaO4TmGiZ7xPmIeNGgnrK4a4YqI4LaN3SYaM3m+7izFrFxV Rq5hOLsBu5s0V3YN3k7RqhHe7nhU8V55hSZP/BYDkm0sJcWsVcTkIKU2jAznNIZ8AIJf Gqxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=kRnQsTeb; dkim=pass header.i=@codeaurora.org header.s=default header.b=fJvpRr7n; 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 c7-v6si11540934pgu.535.2018.06.01.12.20.28; Fri, 01 Jun 2018 12:20:42 -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=kRnQsTeb; dkim=pass header.i=@codeaurora.org header.s=default header.b=fJvpRr7n; 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 S1753682AbeFATTw (ORCPT + 99 others); Fri, 1 Jun 2018 15:19:52 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52240 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753420AbeFATTo (ORCPT ); Fri, 1 Jun 2018 15:19:44 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 162C2606FA; Fri, 1 Jun 2018 19:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527880784; bh=0oDDNf2NtDobiqw4sJcn+2eoU7s55Qft+74W7O9WI+M=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=kRnQsTeb73hNZ/3F5xYftAG5Qj4WGOknlgDXW0A+NohBtnjONYuaLdSTi1XCIMpaZ a8D3lnhFwZ9hTgLhjyj2nAZCnVHwjWpsYcwYPRZ6YRaGaf/2qkPN4CmBhEyV6LB2Ps plsLJaMWd+0zgnjGdXBewUNXMrQ7bflmyzm0K1pc= 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 5A01960249; Fri, 1 Jun 2018 19:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527880783; bh=0oDDNf2NtDobiqw4sJcn+2eoU7s55Qft+74W7O9WI+M=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=fJvpRr7nNxONhYDiCqNPcGHM5nlpthL4yJLDUMRCi+qJ/Qw+RwJ61u3ofXc0Bcl3k F2JUbZ9YjwLLlcvUKpbkc+f1PejM/0wETuzc7xzMJCwYvchmGFkL8I4ikXr9fAP9dX r3VVJ7mT9RVGIL5PyEMM0Cu2odvBkcPzSKSByFdk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5A01960249 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 5/6] soc: qcom: rpmh powerdomain driver To: Rajendra Nayak , 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> <6817acaf-9a68-5cd5-4dd0-ebe12a9aa057@codeaurora.org> From: David Collins Message-ID: <6075eeb8-ffb4-e7af-03a8-deed0444cb8c@codeaurora.org> Date: Fri, 1 Jun 2018 12:19:42 -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: <6817acaf-9a68-5cd5-4dd0-ebe12a9aa057@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 Hello Rajendra, On 06/01/2018 01:48 AM, Rajendra Nayak wrote: > 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? Yes, rpmh_write_async() can always be used for RPMH_SLEEP_STATE and RPMH_WAKE_ONLY_STATE. The rpmh_write() vs rpmh_write_async() distinction only matters for RPMH_ACTIVE_ONLY_STATE. Take care, David -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project