linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Jolly Shah <jolly.shah@xilinx.com>,
	arm@kernel.org, linux-clk@vger.kernel.org,
	michal.simek@xilinx.com, mturquette@baylibre.com, olof@lixom.net,
	sboyd@codeaurora.org
Cc: rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Jolly Shah <jolly.shah@xilinx.com>,
	Rajan Vaja <rajan.vaja@xilinx.com>,
	Tejas Patel <tejasp@xilinx.com>,
	Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>,
	Jolly Shah <jollys@xilinx.com>
Subject: Re: [PATCH v5 4/4] drivers: clk: Add ZynqMP clock driver
Date: Sun, 07 Oct 2018 19:27:50 -0700	[thread overview]
Message-ID: <153896567067.119890.7785076104115447392@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <1538173080-7597-5-git-send-email-jollys@xilinx.com>

Quoting Jolly Shah (2018-09-28 15:18:00)
> diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c
> new file mode 100644
> index 0000000..1b07d77
> --- /dev/null
> +++ b/drivers/clk/zynqmp/clkc.c
> @@ -0,0 +1,716 @@
[...]
> + * @type:      Clock type: CLK_TYPE_OUTPUT or CLK_TYPE_EXTERNAL
> + *
> + * Return: 0 on success else error code
> + */
> +static int zynqmp_get_clock_type(u32 clk_id, u32 *type)
> +{
> +       int ret;
> +
> +       ret = zynqmp_is_valid_clock(clk_id);
> +       if (ret == 1) {
> +               *type = clock[clk_id].type;
> +               return 0;
> +       }
> +
> +       return ret == 0 ? -EINVAL : ret;
> +}
> +
> +/**
> + * zynqmp_pm_clock_get_num_clocks() - Get number of clocks in system
> + * @nclocks:   Number of clocks in system/board.
> + *
> + * Call firmware API to get number of clocks.
> + *
> + * Return: 0 on success else error code.
> + */
> +static int zynqmp_pm_clock_get_num_clocks(u32 *nclocks)
> +{
> +       struct zynqmp_pm_query_data qdata = {0};
> +       __le32 ret_payload[PAYLOAD_ARG_CNT];

I asked about endianess but this isn't the right fix. Just marking
something as __le32 but then not using that type and just passing it to
some function that takes a u32 pointer doesn't work. So is the firmware
side always little endian? If so, maybe the ioctls can do the byte swap
and then the kernel API can be native CPU endian while the firmware
layer can be aware that things may need swapping. I'm suggesting that
this type is just u32 and then the eemi_ops functions accept u32 and do
the swapping themselves.

If you put back u32 here and elsewhere in this patch you can have my

Reviewed-by: Stephen Boyd <sboyd@kernel.org>

The fix to the underlying ops for endian correctness can come later, so
don't feel like it needs to be fixed right now.


  reply	other threads:[~2018-10-08  2:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-28 22:17 [PATCH v5 0/4] drivers: clk: Add ZynqMP clock driver support Jolly Shah
2018-09-28 22:17 ` [PATCH v5 1/4] Documentation: xilinx: Add documentation for eemi APIs Jolly Shah
2018-09-28 22:17 ` [PATCH v5 2/4] firmware: xilinx: Add zynqmp IOCTL API for device control Jolly Shah
2018-09-28 22:17 ` [PATCH v5 3/4] dt-bindings: clock: Add bindings for ZynqMP clock driver Jolly Shah
2018-09-28 22:18 ` [PATCH v5 4/4] drivers: clk: Add " Jolly Shah
2018-10-08  2:27   ` Stephen Boyd [this message]
2018-10-08 18:27     ` Jolly Shah

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=153896567067.119890.7785076104115447392@swboyd.mtv.corp.google.com \
    --to=sboyd@kernel.org \
    --cc=arm@kernel.org \
    --cc=jolly.shah@xilinx.com \
    --cc=jollys@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=mturquette@baylibre.com \
    --cc=olof@lixom.net \
    --cc=rajan.vaja@xilinx.com \
    --cc=rajanv@xilinx.com \
    --cc=sboyd@codeaurora.org \
    --cc=shubhrajyoti.datta@xilinx.com \
    --cc=tejasp@xilinx.com \
    /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;
as well as URLs for NNTP newsgroup(s).