Received: by 10.192.165.148 with SMTP id m20csp1227487imm; Thu, 10 May 2018 07:33:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr7RWnLOA9jNjQ5osc9ETxN5rvPE8FUJ6rcsn20ejTgwYe33VJ3a7fnwFbGlEds4q+flO1l X-Received: by 2002:a65:4189:: with SMTP id a9-v6mr1368475pgq.118.1525962789931; Thu, 10 May 2018 07:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525962789; cv=none; d=google.com; s=arc-20160816; b=EiCQJV9ENs6i53ooVaveS4eGmC1GlXkOtcYJBgNdc/q6DwYqkdSi+D2cBWdgxdy+0f xSdAwR5ciciny8ulvd6/Fq2o0EesnQQ9gVwSLmYNsZUcs6hA0extx670rh+O0TPTvd+I 8RPjNwMaueiKv3ikHxdt++gMEK4c+8VB/y2fJGDoH0zsm+wArhpqC1N1jvxHI3fYdwFY L+H28uDcQi2HW2B83NHaufYxFRwL3irPemIwAFbJw5G5XWQEra31G4zE8wmjmsJJCB6M RYPFdT92BwhJcGQySRITLEhLcKhOlopRN4XWPk2K7uBJtdrMFaglK8SfiJzi6o2zkfXX dDsw== 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:organization:from:references:to:subject:cc :arc-authentication-results; bh=fvXCLjTM2yZxZ7oydiCS+o789WN3/WIjko/8PENChiA=; b=FE7mndZkCpZBewoV1s0XHia9i4rJDYhWzM/+Dokg3fwKNN92JHZMZpG0Ws+g5JimzR Mljs4lJRCCE7gZ+Rbavb6ec+5hUoDwZmcyKhLzDR9OMc1tGLLVX1DS/8TK8iiLxCPsTx dbYPBKhkqMD2GAX0XpN/i2jV/+zehdH4knCYeH7k11vQqCdxpGRJRH1OfxoByE8hAmJ4 JnwyTTBaJjGqFfIhz4ESYV43YCsAoYL7RK8o3iCxn09+i5/blEIG+jBBETuPepR3R0st gzp2rqa1e+/Wu0KxU5FrIKo05XfCfHpVDauFfS+rf9+nVhtoG4/93slWW/B/95jrl4FH I9ZA== ARC-Authentication-Results: i=1; mx.google.com; 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 94-v6si930137ple.56.2018.05.10.07.32.51; Thu, 10 May 2018 07:33:09 -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; 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 S966047AbeEJOb0 (ORCPT + 99 others); Thu, 10 May 2018 10:31:26 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56898 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965516AbeEJObY (ORCPT ); Thu, 10 May 2018 10:31:24 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3F67B15AB; Thu, 10 May 2018 07:31:24 -0700 (PDT) Received: from [10.1.210.28] (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 42B933F23C; Thu, 10 May 2018 07:31:20 -0700 (PDT) Cc: Sudeep Holla , rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jolly Shah Subject: Re: [PATCH v6 09/11] firmware: xilinx: Add debugfs for clock control APIs To: Jolly Shah , ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, mturquette@baylibre.com, sboyd@codeaurora.org, michal.simek@xilinx.com, robh+dt@kernel.org, mark.rutland@arm.com, linux-clk@vger.kernel.org References: <1523389127-14243-1-git-send-email-jollys@xilinx.com> <1523389127-14243-10-git-send-email-jollys@xilinx.com> From: Sudeep Holla Organization: ARM Message-ID: <5bcc47f7-3352-f0e6-29c5-78d5be96c1d1@arm.com> Date: Thu, 10 May 2018 15:31:18 +0100 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: <1523389127-14243-10-git-send-email-jollys@xilinx.com> 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 On 10/04/18 20:38, Jolly Shah wrote: > From: Rajan Vaja > > Add debugfs file to control clocks using firmware APIs > through debugfs interface. > > Signed-off-by: Rajan Vaja > Signed-off-by: Jolly Shah > --- > drivers/firmware/xilinx/zynqmp-debug.c | 48 ++++++++++++++++++++++++++++++++++ > 1 file changed, 48 insertions(+) > > diff --git a/drivers/firmware/xilinx/zynqmp-debug.c b/drivers/firmware/xilinx/zynqmp-debug.c > index 1cb69f7..837fcd1 100644 > --- a/drivers/firmware/xilinx/zynqmp-debug.c > +++ b/drivers/firmware/xilinx/zynqmp-debug.c > @@ -34,6 +34,15 @@ static struct pm_api_info pm_api_list[] = { > PM_API(PM_GET_API_VERSION), > PM_API(PM_IOCTL), > PM_API(PM_QUERY_DATA), > + PM_API(PM_CLOCK_ENABLE), > + PM_API(PM_CLOCK_DISABLE), > + PM_API(PM_CLOCK_GETSTATE), > + PM_API(PM_CLOCK_SETDIVIDER), > + PM_API(PM_CLOCK_GETDIVIDER), > + PM_API(PM_CLOCK_SETRATE), > + PM_API(PM_CLOCK_GETRATE), > + PM_API(PM_CLOCK_SETPARENT), > + PM_API(PM_CLOCK_GETPARENT), > }; > > /** > @@ -87,6 +96,7 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret) > const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); > u32 pm_api_version; > int ret; > + u64 rate; > > if (!eemi_ops) > return -ENXIO; > @@ -132,6 +142,44 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret) > pm_api_ret[2], pm_api_ret[3]); > break; > } > + case PM_CLOCK_ENABLE: > + ret = eemi_ops->clock_enable(pm_api_arg[0]); > + break; As I mentioned in earlier patch, I don't see the need for this debugfs interface. Clock lay has read-only interface in debugfs already. Also if you want to debug clocks, you can do so using the driver which uses these clocks. Do you really want to manage clocks in user-space ? The whole idea of EEMI kind of interface is to abstract and hide the fine details even from non-trusted rich OS like Linux kernel, but by providing this you are doing exactly opposite. -- Regards, Sudeep