Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2238629yba; Fri, 19 Apr 2019 15:14:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCSDWuOAFTAFTHnecdT2TtgI9XCHKrscsG5VYTkTotmfQKmDLAPQZGAP2b1H8xLEXRbLup X-Received: by 2002:a63:2c09:: with SMTP id s9mr6009046pgs.411.1555712056645; Fri, 19 Apr 2019 15:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555712056; cv=none; d=google.com; s=arc-20160816; b=fqe1LaHoEbHNiep9q7Tp8EmpgqxvmqShQWG3cFtfi1Suc4qSLUNzR6EcFjjX4MR2pl FrUNqrGf5y/QDiCXLV7SPx3FRE7ER/vMGY2QX4HhfFLbVIUn0ea0vUMRM1xSvFrfg0N8 1e9Kr7esx+SrWc9Ei9uUGEFsdojzMHjTESnkMqMULLDf//Ct5DC9ZntPm5+hP0WbwI5X 9FOxo2tka3ipB2+9llIlkObMqxUjggRLPP1Ki1ZOWaZDR1A9pOnzQuR4e+rVdI2uyiuU 0hyOq8DLDmVStgF5xbMzud2ayEUEgekH7VC3VsfM12sabQsMnIwK0OODSJzLR0bEguIg BvyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:user-agent:message-id:to:subject :from:cc:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=c+Udkk6XwM3nSVWr5ejmePZqVb8CRlM6RLRqSyxaBbo=; b=pMLX5JDBLvQIiLLq3Zh5Kpvc7o507x1w0as3nvPTsidsnYRs5Ouod8+gJKlz+t4esf xP276S1yVxxCKWjnKUGo/uj58ZlqQfJTi9cKcp90/w3ek8XFGruovtDcPcOPjbrPF6I7 BrKUdfUeyaeSTQ1VSMzVpMDCWX1mgG80ZW0jFbWojzi2aXy9RhxOlTUxive2gh5CT5lt zGqCbM6aj3ImBbLTT1LOcTYlTy9QpXEo7ryVMePxjkKZZyWEbFF3rXkp4EAp3DmGVMQo lYP3y+WzHUsPwhwIPS00qNvd7Xs2G6MDisW6bmOfgcqTvKhBsu18bPEI40guBQQZdeHC dPJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1pFH4+lN; 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 d3si6634642pfc.278.2019.04.19.15.14.01; Fri, 19 Apr 2019 15:14:16 -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=1pFH4+lN; 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 S1727472AbfDSWNA (ORCPT + 99 others); Fri, 19 Apr 2019 18:13:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:45252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbfDSWNA (ORCPT ); Fri, 19 Apr 2019 18:13:00 -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 78A1121736; Fri, 19 Apr 2019 22:12:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555711978; bh=HadehC56ec5z0Uf8TAWu+BcUsNoCex0LFt8UIfCru4M=; h=In-Reply-To:References:Cc:From:Subject:To:Date:From; b=1pFH4+lN2GIUkA7m18O7en7uQ4K2/t6z3Ewm0ISNpQgM2tvXtbyAj384GMWAVO37e Ox0g/HwsAiPdYUhscqOnozMcbZ6k7CYCsKRBnb0S3aM2mtXwnTqB7yZ5QwCyn+38w4 2hKW4oQ0mU+P9IBSuP5hm73udV+dMQ/KrozXJyOc= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190412183150.102131-7-sboyd@kernel.org> References: <20190412183150.102131-1-sboyd@kernel.org> <20190412183150.102131-7-sboyd@kernel.org> Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Miquel Raynal , Jerome Brunet , Russell King , Jeffrey Hugo , Chen-Yu Tsai , Rob Herring From: Stephen Boyd Subject: Re: [PATCH v4 6/9] clk: Allow parents to be specified without string names To: Michael Turquette , Stephen Boyd Message-ID: <155571197779.15276.7804294833146212666@swboyd.mtv.corp.google.com> User-Agent: alot/0.8 Date: Fri, 19 Apr 2019 15:12:57 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Stephen Boyd (2019-04-12 11:31:47) > The common clk framework is lacking in ability to describe the clk > topology without specifying strings for every possible parent-child > link. There are a few drawbacks to the current approach: >=20 > 1) String comparisons are used for everything, including describing > topologies that are 'local' to a single clock controller. >=20 > 2) clk providers (e.g. i2c clk drivers) need to create globally unique > clk names to avoid collisions in the clk namespace, leading to awkward > name generation code in various clk drivers. >=20 > 3) DT bindings may not fully describe the clk topology and linkages > between clk controllers because drivers can easily rely on globally uniq= ue > strings to describe connections between clks. >=20 > This leads to confusing DT bindings, complicated clk name generation > code, and inefficient string comparisons during clk registration just so > that the clk framework can detect the topology of the clk tree. > Furthermore, some drivers call clk_get() and then __clk_get_name() to > extract the globally unique clk name just so they can specify the parent > of the clk they're registering. We have of_clk_parent_fill() but that > mostly only works for single clks registered from a DT node, which isn't > the norm. Let's simplify this all by introducing two new ways of > specifying clk parents. >=20 > The first method is an array of pointers to clk_hw structures > corresponding to the parents at that index. This works for clks that are > registered when we have access to all the clk_hw pointers for the > parents. >=20 > The second method is a mix of clk_hw pointers and strings of local and > global parent clk names. If the .fw_name member of the map is set we'll > look for that clk by performing a DT based lookup of the device the clk > is registered with and the .name specified in the map. If that fails, > we'll fallback to the .name member and perform a global clk name lookup > like we've always done before. >=20 > Using either one of these new methods is entirely optional. Existing > drivers will continue to work, and they can migrate to this new approach > as they see fit. Eventually, we'll want to get rid of the 'parent_names' > array in struct clk_init_data and use one of these new methods instead. >=20 > Cc: Miquel Raynal > Cc: Jerome Brunet > Cc: Russell King > Cc: Michael Turquette > Cc: Jeffrey Hugo > Cc: Chen-Yu Tsai > Cc: Rob Herring > Signed-off-by: Stephen Boyd > --- Applied to clk-next