Received: by 10.213.65.68 with SMTP id h4csp2764841imn; Mon, 9 Apr 2018 08:40:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx49hf7/X5U8mpP2u6UDbQ0FGZDFgxHi1M16xcvtdv3ymf0gx/rBzOUHod4wBUOea/xbednet X-Received: by 10.98.163.153 with SMTP id q25mr29939316pfl.189.1523288452597; Mon, 09 Apr 2018 08:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523288452; cv=none; d=google.com; s=arc-20160816; b=D32sel2Nj/BKQET9haQxfkoLVvgcPxJ1qtKZp5Tdq2r0ZigU9CX3IADbNpEslK/re5 qOT/r825cu/uS0TSCE+9dwAw8TsIq/rpS3yC4OUzrzhDYKG/sQyWg62kCTxOAcJc6FzB N/+T6B9FujqCBHzOkriGzN9HKl2zYWOIg2bgLZD9xDlrSPxHb5q1azOP8EFrxy8E4q8w ZBm0mykCAdahplgfJW6Evg/pluP4neHaKG4ifdItlcUykBplfRlOIZGQAlpg4STDXruz gnoT/fcMGYKgpOEh99xwX6zipbq5oohOy+2oKI6xhJVVytkn3M9PWo+Ae8v+kS5cwQIV TQjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=XQgDDKe9nkoLI8OFTtrFxJuAIapFSLTmr5CFylwHOdw=; b=U4AWzubapsMYxws3G53EYtptAKkpptMYktuM/41NLylMIJkWRJX1LJRIMPr08flLEp Av8pePeleQzlc6c2DQJebw06N6xSCTzxm9OxMt74CDFS1/G+oisnwDxRkWD1yEZeK+T5 GjLD61lZ6s+0dWYwQE0/dEUsn5JyhgWzkN5az4osUGL7WKdYYr7rz9hl+1IdqvfRXwI3 kQnNmNQo7L68ReIC5vvsai5Z2vo2mWUu6hPRJEkW/OiNznxQ9aX1XL+7V4VXJydO0vwY N4twSOAjcqy/Hu+ELcVEnYiD4KUimAO99Te6AoTB0zmBf3b6ks98q7pVyJPmJdmHfRlY LhqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dW4ESNc4; dkim=pass header.i=@codeaurora.org header.s=default header.b=WKiiWNnO; 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 u1-v6si490262pls.426.2018.04.09.08.40.15; Mon, 09 Apr 2018 08:40:52 -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=dW4ESNc4; dkim=pass header.i=@codeaurora.org header.s=default header.b=WKiiWNnO; 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 S1752909AbeDIPgf (ORCPT + 99 others); Mon, 9 Apr 2018 11:36:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44466 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751623AbeDIPge (ORCPT ); Mon, 9 Apr 2018 11:36:34 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 86F33602B6; Mon, 9 Apr 2018 15:36:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523288193; bh=fH4qHUwjrT7lwLaKQXqUTQnnEmo9Ymac76lVIJGgvJA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dW4ESNc4m6+0LSJG1I+AsoTmlwKuRZmErYXiX9xCk3TbaFN5Re+y20BnWapsCwZwE MMZ3ZQ+F1U4yDF1rmfqmdvOhjdg69CQYSFXRbnd5OmIiNpVUgAWYXKmMN+CQeQtpFt BJGuBn0iKYZQOeNh/dcfLvRx5LkAg+ySxkBTsdD8= 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 localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id B1AD0602B6; Mon, 9 Apr 2018 15:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523288192; bh=fH4qHUwjrT7lwLaKQXqUTQnnEmo9Ymac76lVIJGgvJA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WKiiWNnO5Qn24MdEWL6nylfkAZwDz78rGRL+Bw51oEew9J3jBTQ9rBV91Xr55aSFO /sglW/NXUEqgouJS3uy/e0UKy01dPbOzDdkNk6cbILFAbPMZpOpy25z+cFVBkd9bNk wpXDA5K5dXo7FghMsQZcJ6dE6BHoIf3ZmyvjE5NM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B1AD0602B6 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=ilina@codeaurora.org Date: Mon, 9 Apr 2018 09:36:31 -0600 From: Lina Iyer To: Stephen Boyd Cc: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, evgreen@chromium.org, dianders@chromium.org Subject: Re: [PATCH v5 04/10] drivers: qcom: rpmh: add RPMH helper functions Message-ID: <20180409153631.GB19682@codeaurora.org> References: <20180405161834.3850-1-ilina@codeaurora.org> <20180405161834.3850-5-ilina@codeaurora.org> <152306410070.94378.2738189478665128271@swboyd.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <152306410070.94378.2738189478665128271@swboyd.mtv.corp.google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 06 2018 at 19:21 -0600, Stephen Boyd wrote: >Quoting Lina Iyer (2018-04-05 09:18:28) >> diff --git a/include/soc/qcom/rpmh.h b/include/soc/qcom/rpmh.h >> new file mode 100644 >> index 000000000000..95334d4c1ede >> --- /dev/null >> +++ b/include/soc/qcom/rpmh.h >> @@ -0,0 +1,34 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +/* >> + * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. >> + */ >> + >> +#ifndef __SOC_QCOM_RPMH_H__ >> +#define __SOC_QCOM_RPMH_H__ >> + >> +#include >> +#include >> + >> +struct rpmh_client; >> + >> +#if IS_ENABLED(CONFIG_QCOM_RPMH) >> +int rpmh_write(struct rpmh_client *rc, enum rpmh_state state, >> + const struct tcs_cmd *cmd, u32 n); >> + >> +struct rpmh_client *rpmh_get_client(struct platform_device *pdev); >> + >> +void rpmh_release(struct rpmh_client *rc); > >Please get rid of this 'client' layer and fold it into the rpmh driver. >Everything that uses the rpmh_client is a child device of the rpmh >device so they should be able to just pass in their device pointer as >their 'handle' and have the rpmh driver take that, get the parent device >pointer, and pull an rpmh_drv structure out of there. The 'common' code >can go into the base rpmh driver and get used from there and then we >don't have to hop between two files to see how rpmh is used by the >consumers. Code complexity goes down this way. That would be not be a good idea. This layer is not just providing an API interface. There is resource buffering, handling of memory for requests and downstream quirks and debug going on in this layer. It would be unwise to clobber the hardware centric rpmh-rsc layer. If you look at the series as a whole, you would understand why this is necessary. I plan to build more on top of these patches in the future as we add support for system low power modes. The complexity doesn't go away, it just thrown in to another file, which is already decently sized. I could try to use the device as a handle, and internally work on getting the drv and other information from it, if that helps. But I do not want to clobber these two files together. It doesn't help maintainability. Thanks, Lina