Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1214758ybx; Thu, 7 Nov 2019 08:52:09 -0800 (PST) X-Google-Smtp-Source: APXvYqziFqzUg6O7i8OTO03lTtONrcXOAd/JTkTX3M+SGua6/7ZPKsDsCp85nUt8C0GQbHgGa7FE X-Received: by 2002:a50:8dc5:: with SMTP id s5mr4637720edh.115.1573145529118; Thu, 07 Nov 2019 08:52:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573145529; cv=none; d=google.com; s=arc-20160816; b=KSBfOidYWIGj3bnTDU5bAaycE4bo7/YnXtwTsWIb38eIYJGafsMN9vkfHmbz3pkQXF hUGXDf4nQ01oE77UXTvaIY6CScUgYSwcQynPGsp+hoTrVZX6MzExWyqMnzeKB2ZeP4fV El1ZShU1MW7rDNGnhgnLJKVYOL25QIPBj/XA5l9v8fwdjmjO9yULplfeRcOzCHT9Z1qg pBo3fDihVH5F9kq3yQBEXU2INwxcBO8VhgyPqz9x/jZiIz24Abg3Jz43xKm65jGWLiiq 9H551Flz7yvu7R61pNFjrSv8H/HsowTymrb7QkHmxTi3UwCXcHDieVVPMaHDqHZsr3vX L7dw== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=cBq5pj62cMOVqw9hHfHttlqVx5Nq3NvjTX5npIA6XJA=; b=wO3zgjjAQKjCqcXgTF1RICDWeL8BpYEtTDFXxM2Lp09wq4ZnRsz2M4AY6D8JzND9ga XfRRQevugFhNtAUUFPpUFMC49rz+Tra9sBEkkpkOn3yZvelCLI+7tOtbtTvYFyJstjVs hzOj5F0EsIhMRnN8GasiQms2jPkDPvElIcz7ZkvuwculKzF5S7Hd5EIEH6Pis4o1of39 NU9Yk/RFqCWY1drlakXS1Ia8xDt//vJvr65s9Pt+1Aw+ZI4rfzJUtb8RMXlH6mApfNGd /W2FrIsasvRRafVl5DVePAKPzFYtLAU0TXgvfsqPhknjgJ0TBcGW0D8J/WHMTwrEqDIg yE2Q== 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 u22si1235103edt.172.2019.11.07.08.51.44; Thu, 07 Nov 2019 08:52:09 -0800 (PST) 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 S1729871AbfKGQtx (ORCPT + 99 others); Thu, 7 Nov 2019 11:49:53 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:47761 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbfKGQtw (ORCPT ); Thu, 7 Nov 2019 11:49:52 -0500 Received: from litschi.hi.pengutronix.de ([2001:67c:670:100:feaa:14ff:fe6a:8db5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iSkyR-0001OE-Fq; Thu, 07 Nov 2019 17:49:31 +0100 Date: Thu, 7 Nov 2019 17:49:28 +0100 From: Michael Tretter To: Rajan Vaja Cc: mturquette@baylibre.com, sboyd@kernel.org, michal.simek@xilinx.com, jolly.shah@xilinx.com, dan.carpenter@oracle.com, gustavo@embeddedor.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH] clk: zynqmp: Add support for custom type flags Message-ID: <20191107174928.71a921f0@litschi.hi.pengutronix.de> In-Reply-To: <1573117086-7405-1-git-send-email-rajan.vaja@xilinx.com> References: <1573117086-7405-1-git-send-email-rajan.vaja@xilinx.com> Organization: Pengutronix X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:feaa:14ff:fe6a:8db5 X-SA-Exim-Mail-From: m.tretter@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 07 Nov 2019 00:58:06 -0800, Rajan Vaja wrote: > Store extra custom type flags received from firmware. > > Signed-off-by: Rajan Vaja > Signed-off-by: Jolly Shah > Signed-off-by: Michal Simek > --- > drivers/clk/zynqmp/clkc.c | 8 +++++++- > drivers/clk/zynqmp/divider.c | 4 ++-- > 2 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c > index a11f93e..0dea55e 100644 > --- a/drivers/clk/zynqmp/clkc.c > +++ b/drivers/clk/zynqmp/clkc.c > @@ -2,7 +2,7 @@ > /* > * Zynq UltraScale+ MPSoC clock controller > * > - * Copyright (C) 2016-2018 Xilinx > + * Copyright (C) 2016-2019 Xilinx > * > * Based on drivers/clk/zynq/clkc.c > */ > @@ -86,6 +86,8 @@ struct topology_resp { > #define CLK_TOPOLOGY_TYPE GENMASK(3, 0) > #define CLK_TOPOLOGY_FLAGS GENMASK(23, 8) > #define CLK_TOPOLOGY_TYPE_FLAGS GENMASK(31, 24) > +#define CLK_TOPOLOGY_TYPE_FLAG2 GENMASK(7, 4) What kind of function do these flags indicate? The name is really not obvious to me. I would prefer if the defines are kept in the order of the bits in the field, i.e., the new define should go between CLK_TOPOLOGY_TYPE and CLK_TOPOLOGY_FLAGS. > +#define CLK_TOPOLOGY_TYPE_FLAG_BITS 8 > u32 topology[CLK_GET_TOPOLOGY_RESP_WORDS]; > }; > > @@ -396,6 +398,10 @@ static int __zynqmp_clock_get_topology(struct clock_topology *topology, > topology[*nnodes].type_flag = > FIELD_GET(CLK_TOPOLOGY_TYPE_FLAGS, > response->topology[i]); > + topology[*nnodes].type_flag |= > + FIELD_GET(CLK_TOPOLOGY_TYPE_FLAG2, > + response->topology[i]) << > + CLK_TOPOLOGY_TYPE_FLAG_BITS; Shifting the new flags into the existing type_flag field seems like a source for code that is really difficult to read. Maybe use a new field in the topology for the new flags with a proper name? > (*nnodes)++; > } > > diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c > index d8f5b70d..d376529 100644 > --- a/drivers/clk/zynqmp/divider.c > +++ b/drivers/clk/zynqmp/divider.c > @@ -2,7 +2,7 @@ > /* > * Zynq UltraScale+ MPSoC Divider support > * > - * Copyright (C) 2016-2018 Xilinx > + * Copyright (C) 2016-2019 Xilinx > * > * Adjustable divider clock implementation > */ > @@ -37,7 +37,7 @@ > */ > struct zynqmp_clk_divider { > struct clk_hw hw; > - u8 flags; > + u16 flags; This change looks unrelated to the remaining patch. Michael > bool is_frac; > u32 clk_id; > u32 div_type;