From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7A9DC43381 for ; Tue, 26 Feb 2019 22:34:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A851A218A5 for ; Tue, 26 Feb 2019 22:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551220472; bh=IboUflHxCb359juQMeyLW3Xltd178tmZn/LHDEiDD5I=; h=From:To:Cc:Subject:Date:List-ID:From; b=TmtB6dF+/vsRiGvih2DBQpHfUB67xvgs5xN8gA21xDhchkYgcE8S+n35tbp8A3ouQ mO2kXMsQoY1GVgeLSxkgCWGDIDIvDxV4KiJf3sMk4G62UAMMjEGfW5n1V3y2HNL0Uc 9s94HpCDT88ngfgj9IZt0447g5IWuzn/tXEACiGo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729225AbfBZWec (ORCPT ); Tue, 26 Feb 2019 17:34:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:48216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728766AbfBZWec (ORCPT ); Tue, 26 Feb 2019 17:34:32 -0500 Received: from mail.kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 790B22186A; Tue, 26 Feb 2019 22:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551220470; bh=IboUflHxCb359juQMeyLW3Xltd178tmZn/LHDEiDD5I=; h=From:To:Cc:Subject:Date:From; b=1skYq4eVlxwP3y/fcDP3kXomRCGS9hrDMg+M4F1NYTeBkGVDhqKMW5xPLSuY9D+uX 42xL86wuTd77Jg/zFHDSbIy4hOMfDrpdt0YZeAFC+B2d0xLY5IF6cx9SD7NM4W6v6Z MeMDJBBG7QxRoy5swUxavewxslaop9xQoe9JQVPs= From: Stephen Boyd To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Miquel Raynal , Jerome Brunet , Russell King , Jeffrey Hugo , Chen-Yu Tsai Subject: [PATCH v2 0/8] Rewrite clk parent handling Date: Tue, 26 Feb 2019 14:34:21 -0800 Message-Id: <20190226223429.193873-1-sboyd@kernel.org> X-Mailer: git-send-email 2.21.0.rc2.261.ga7da99ff1b-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org There are a couple warts with clk parent handling in the common clk framework. This patch series addresses one of those warts, parent-child linkages. We use strings for all parent-child linkages, and this leads to poorly written code that extracts clk names from struct clk pointers and makes clk provider drivers use clk consumer APIs. Also, clkdev.c has a collection of DT parsing logic in it that is only used when the common clk framework is present but we want to use that same logic for describing parent-child linkages of clk providers via DT. This code should all be moved into the common clk framework and used from there as well as from clkdev.c, so this series changes the way clkdev interacts with the clk framework by having clkdev get struct clk_hw pointers out of DT clk specifiers and then convert those into clk pointers with clk_hw_create_clk(). Splitting the API this way lets us get struct clk_hw pointers for clk providers and skip the struct clk pointer creation phase that we don't need to do when describing parent-child linkages. And finally, we have a few patches in here that lay the groundwork for supporting device links in the common clk framework. We do that by pushing the consuming device pointer through to the clk pointer creation in clk_hw_create_clk(). This wasn't always easy to do when we had __clk_create_clk() called from multiple places, some being deep in the clk registration path. This series simplifies that logic so that we can always attach a consumer device to a clk that we create in one place, instead of making that linkage in multiple places near where we create struct clk pointers. I plan to at least merge the early patches in this series into clk-next so we can clear the way for the later patches. I don't think anything is too controversial until we get to the new way of specifying parents at the end and of course, the sdm845 patch is incomplete so it's not going to be merged. Changes from v1: * Dropped new get_parent_hw, we'll pick it up in a later series * Rebased to v5.0-rc6 to avoid conflicts with clk-fixes * Renamed 'fallback' to 'name' and 'name' to 'fw_name' in parent map * Made sure that clk_hw_get_parent_by_index() never sees an error pointer so that we don't mistakenly try to defer an error pointer * Fixed index passing mistake on of_clk_get_hw_from_clkspec() * Copy over all the data from parent maps and free it correctly too Miquel Raynal (1): clk: core: clarify the check for runtime PM Stephen Boyd (7): clk: Combine __clk_get() and __clk_create_clk() clk: Introduce of_clk_get_hw_from_clkspec() clk: Inform the core about consumer devices clk: Move of_clk_*() APIs into clk.c from clkdev.c clk: Allow parents to be specified without string names clk: qcom: gcc-sdm845: Migrate to DT parent mapping arm64: dts: qcom: Specify XO clk as input to GCC node Cc: Miquel Raynal Cc: Jerome Brunet Cc: Russell King Cc: Jeffrey Hugo Cc: Chen-Yu Tsai arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 + drivers/clk/clk.c | 512 +++++++++++++++++++++------ drivers/clk/clk.h | 23 +- drivers/clk/clkdev.c | 120 +------ drivers/clk/qcom/gcc-sdm845.c | 180 +++++----- include/linux/clk-provider.h | 19 + 6 files changed, 532 insertions(+), 324 deletions(-) base-commit: d13937116f1e82bf508a6325111b322c30c85eb9 -- Sent by a computer through tubes