Received: by 10.192.165.148 with SMTP id m20csp1202333imm; Thu, 10 May 2018 07:11:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqL+mPdf2rOI99D5znJTYWZge6AGULc+LyobSBb1AIH8tA8Imin46QHLLpNopa6uzE7YN/G X-Received: by 2002:a63:ae49:: with SMTP id e9-v6mr1283888pgp.38.1525961478285; Thu, 10 May 2018 07:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525961478; cv=none; d=google.com; s=arc-20160816; b=bIb9mlKfr62uyZPjezl2ImCIgA2yV3d/lAPiH6riyUOmYPcChU0TnHWIFGN9YFVICs DWIo9bwrqjxlb7kyN1ABOzqxObeXgjzrgUOQViH1psN9D9ibIvfsPmqCOgjb8ZT0k0bi 9QTY1eXfyxCiCMFpzaOnzLUcN6q27pQ8Kmepl9Q41aztn4iA08BA/tSWvmriIkteqnS6 kEOFcn91SSCqB/dp9lm9paF/hiF95VaNJQGH6bRQuYybqkJrZLAsf+f5Zn09HYT9Z2G/ BZDLHD06mG2NpMroqolHdNYph3QKcAq7Q9keoqoivIL7x8a0LEjYyCiRhBm2BUDK0ikF ITmA== 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=LR3QIpThfFVy8/4i0OmO4GDo8UP4JPfw0sBw5rwUe9Y=; b=rPVnnNuOEVzvuPcgZuwXLyORn05f6t187uOi+iGRKWkT3+ANzwTz7aCKQsSP8FzEf/ vWNnjpdVoLCLUTWeB+e68ZqSI1lYwSF5L9oVvDINzsh0CfYjqnVW4OKg6vZ2kQxwXlxN IOfS1mhUb6Do9iIr1RHCcgDC2ShsI2stR4P/GWYE2dGzN8Vs6tJUYSSVMqQVmbxEfypi vGBUbUwoXdZy2cZdBLW/GZ5OJZyFvj8SkJGb3LDjeRqqAGrZL6Ly3CA5ciTu9tGPirx5 nz+LtW3UylftF7ElMrfWuZ/7PaZCokwdLOwupzQEDHZgtJNVqHUzS92Oy531e1m4B9zz fCkQ== 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 l6-v6si787468pgs.121.2018.05.10.07.11.03; Thu, 10 May 2018 07:11:18 -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 S935661AbeEJOJT (ORCPT + 99 others); Thu, 10 May 2018 10:09:19 -0400 Received: from foss.arm.com ([217.140.101.70]:56322 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934609AbeEJOJR (ORCPT ); Thu, 10 May 2018 10:09:17 -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 888FE15AB; Thu, 10 May 2018 07:09:17 -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 EC9293F236; Thu, 10 May 2018 07:09:13 -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 03/11] firmware: xilinx: Add zynqmp IOCTL API for device control 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-4-git-send-email-jollys@xilinx.com> From: Sudeep Holla Organization: ARM Message-ID: Date: Thu, 10 May 2018 15:09:12 +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-4-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 ZynqMP firmware IOCTL API to control and configure > devices like PLLs, SD, Gem, etc. > > Signed-off-by: Rajan Vaja > Signed-off-by: Jolly Shah > --- > drivers/firmware/xilinx/zynqmp.c | 20 ++++++++++++++++++++ > include/linux/firmware/xlnx-zynqmp.h | 2 ++ > 2 files changed, 22 insertions(+) > > diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c > index 490561a..44b43fa 100644 > --- a/drivers/firmware/xilinx/zynqmp.c > +++ b/drivers/firmware/xilinx/zynqmp.c > @@ -239,8 +239,28 @@ static int get_set_conduit_method(struct device_node *np) > return 0; > } > > +/** > + * zynqmp_pm_ioctl() - PM IOCTL API for device control and configs > + * @node_id: Node ID of the device > + * @ioctl_id: ID of the requested IOCTL > + * @arg1: Argument 1 to requested IOCTL call > + * @arg2: Argument 2 to requested IOCTL call > + * @out: Returned output value > + * > + * This function calls IOCTL to firmware for device control and configuration. > + * > + * Return: Returns status, either success or error+reason > + */ > +static int zynqmp_pm_ioctl(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, > + u32 *out) > +{ > + return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, ioctl_id, > + arg1, arg2, out); > +} > + > static const struct zynqmp_eemi_ops eemi_ops = { > .get_api_version = zynqmp_pm_get_api_version, > + .ioctl = zynqmp_pm_ioctl, > }; > > /** > diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h > index cb63bed..2eec6e7 100644 > --- a/include/linux/firmware/xlnx-zynqmp.h > +++ b/include/linux/firmware/xlnx-zynqmp.h > @@ -34,6 +34,7 @@ > > enum pm_api_id { > PM_GET_API_VERSION = 1, > + PM_IOCTL = 34, I am not for this API. IIUC there are more fined grained well defined APIs(if I am not wrong from enum 2 upto 33). This is open ended API which allows user to do whatever setting it needs. And that defeats the purpose of other APIs. I will look through the series for the usage of this to understand this better, but I am guessing how it can be (ab)used. -- Regards, Sudeep