public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Peng Fan <van.freenix@gmail.com>, <linux-kernel@vger.kernel.org>,
	<xen-devel@lists.xenproject.org>
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Julien Grall <julien.grall@citrix.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	<linux-clk@vger.kernel.org>
Subject: Re: [Xen-devel] [RFC/WIP] xen: clk: introudce pvclk for device passthrough
Date: Mon, 18 Jan 2016 11:24:08 +0000	[thread overview]
Message-ID: <569CCB58.5040904@citrix.com> (raw)
In-Reply-To: <1452921760-21294-1-git-send-email-van.freenix@gmail.com>

On 16/01/16 05:22, Peng Fan wrote:
> This patch was just a initial patch, not sure whether this way
> is ok from you side for handlding clk when doing platform device
> passhthrough. Any comments are appreciated, and your comments may
> give me a better direction.

There's no documentation on the interface, which makes it difficult to
review.  At a first look it looks very specific to the particular Linux
implementation of a clk subsystem.

> --- /dev/null
> +++ b/include/xen/interface/io/clkif.h
> @@ -0,0 +1,41 @@
> +/*
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */

ABIs should be under a more permissive license so they can be used by
other (non-GPLv2) operating systems.

> +
> +#ifndef __XEN_PUBLIC_IO_CLKIF_H__
> +#define __XEN_PUBLIC_IO_CLKIF_H__
> +
> +#include <xen/interface/io/ring.h>
> +#include <xen/interface/grant_table.h>
> +
> +/**/
> +enum {
> +	XENCLK_PREPARE,		/* clk_prepare_enable */
> +	XENCLK_UNPREPARE,	/* clk_unprepare_disable */
> +	XENCLK_GET_RATE,	/* clk_get_rate */
> +	XENCLK_SET_RATE,	/* clk_set_rate */
> +	XENCLK_END,
> +};
> +
> +struct xen_clkif_request {
> +	int id;

You should use fixed width types so the ABI is the same on 32-bit and
64-bit guests.

> +	unsigned long rate;
> +	char clk_name[32];

Where does the frontend get these names from?  31 character names seems
rather limiting.

> +};
> +
> +struct xen_clkif_response {
> +	int id;
> +	int success;
> +	unsigned long rate;
> +	char clk_name[32];
> +};

I don't think you need to the name in the response.  The id will tie the
response to the request.

> +
> +DEFINE_RING_TYPES(xen_clkif, struct xen_clkif_request, struct xen_clkif_response);
> +#define XEN_CLK_RING_SIZE __CONST_RING_SIZE(xen_clkif, PAGE_SIZE)
> +
> +#endif
> 

  parent reply	other threads:[~2016-01-18 11:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-16  5:22 [RFC/WIP] xen: clk: introudce pvclk for device passthrough Peng Fan
2016-01-18 11:22 ` [Xen-devel] " George Dunlap
2016-01-19  1:18   ` Peng Fan
2016-01-18 11:24 ` David Vrabel [this message]
2016-01-18 12:41   ` Ian Campbell
2016-01-19  2:43     ` Peng Fan
2016-01-19 10:06       ` Ian Campbell
2016-01-19  1:33   ` Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=569CCB58.5040904@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ian.campbell@citrix.com \
    --cc=julien.grall@citrix.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=van.freenix@gmail.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox