Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3072101imm; Sun, 7 Oct 2018 19:28:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV622bTPQeh2gC0M6skZZoHBybZpPO20Z93ledA+FHfv5Fbrv891lFlUCLIG4TvKsx4tZXs1l X-Received: by 2002:a62:fcd8:: with SMTP id e207-v6mr22661683pfh.132.1538965730781; Sun, 07 Oct 2018 19:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538965730; cv=none; d=google.com; s=arc-20160816; b=MJGrPw/1KRfF4YMkJy+AonkoR4ZAQGPcXdFXPVRVnFsEOqiWSxsLSVZdDECt7nLSDQ 5y2zzRq+U3MgjdGTELXYqvAel434dKJX56DgFNhFQZPqTbPmoMu2NnWXIABJsv4ytIbZ zbs0ttSpHoZp3XRTvrqGm7RuhMDBn/8Av3katkQVxoWuj0U0tDSVFiuppCTYTxR7WOxB h3rHYhRyFdMTFDhJHi5heQ5m2B14pnJ9GxAKyf2dXFuyhmdYEM37ArZ/zau+xbTdI101 e6EmSbvKLzJSNPMt4PX0x7jJb79Pm41I/27znXBsAbxjHigAZxS1pb2wRYjs5r+EyzvK sYoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature; bh=XLm0bhXeFYLv7MaZL5J+b4CaCCJyhqQVK8+/GHyovyk=; b=hpG1hCNJMO0vmHNd7k6sIFuivuYzDan9eMqiob3iE4FNHZwMfaVOfJ8bd+RY89L4mT BMche/cIFYqsw4ljwIncemsRQChguV3+Pmkn+T/xgQqsnWY0xhViXH2JYIEOiaX6+exa vZycL++r+5M9tSwAFM1DmEl5pH06De4ELQy3S9i+j1Pd8b5ZuuJ/6SFw74n6dXgaKZ3q 6UCURHFqtCZv5iAQFs5c1Hw2ic7ZAoqq8RHKtVWgutGp6wgcLUnf12tfM66O/EZlVw+4 WyKI0aOJOwpFyqyGtwBsTZw0hNBH1zgLiXbuAI5IEY3A15Mbs4+kvX7ssNUSyuu5mSh8 XVbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EbkvAipr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l30-v6si16851288plg.179.2018.10.07.19.28.35; Sun, 07 Oct 2018 19:28:50 -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=@kernel.org header.s=default header.b=EbkvAipr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726341AbeJHJhM (ORCPT + 99 others); Mon, 8 Oct 2018 05:37:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:56938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725760AbeJHJhM (ORCPT ); Mon, 8 Oct 2018 05:37:12 -0400 Received: from localhost (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 60F9C2075C; Mon, 8 Oct 2018 02:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538965671; bh=Cln9UcDm7MwB+k7Bo+IayuVRQSpPJkJm7yVlSqa5NLM=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=EbkvAiprKiYN5onJPd8APDgcGuLvVdnWQV99aD1fLxuFujR/87CD5dAdgEYI7k666 NmEj1WqqsLF8p+S/990rijvPfZHfkMYgZzZ9+OnhRe4ogGzg+ePsUBlO0b6vIpHWvr IoFhcq0PwJY9x+ivyGuDasXl121jkv0PZrP6h1u4= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Jolly Shah , arm@kernel.org, linux-clk@vger.kernel.org, michal.simek@xilinx.com, mturquette@baylibre.com, olof@lixom.net, sboyd@codeaurora.org From: Stephen Boyd In-Reply-To: <1538173080-7597-5-git-send-email-jollys@xilinx.com> Cc: rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jolly Shah , Rajan Vaja , Tejas Patel , Shubhrajyoti Datta , Jolly Shah References: <1538173080-7597-1-git-send-email-jollys@xilinx.com> <1538173080-7597-5-git-send-email-jollys@xilinx.com> Message-ID: <153896567067.119890.7785076104115447392@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH v5 4/4] drivers: clk: Add ZynqMP clock driver Date: Sun, 07 Oct 2018 19:27:50 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 =3D zynqmp_is_valid_clock(clk_id); > + if (ret =3D=3D 1) { > + *type =3D clock[clk_id].type; > + return 0; > + } > + > + return ret =3D=3D 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 =3D {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 The fix to the underlying ops for endian correctness can come later, so don't feel like it needs to be fixed right now.