Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1116552img; Tue, 26 Feb 2019 14:37:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IbRY4NIIZsGtQgZ4gIyZdsFXNwRAsYJBbQo7ArPDItp9Ex267gUFkVSBFGgjjYilBiiUYRv X-Received: by 2002:a62:564d:: with SMTP id k74mr28235269pfb.19.1551220620560; Tue, 26 Feb 2019 14:37:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551220620; cv=none; d=google.com; s=arc-20160816; b=DZqlAv7d3G1wzIrWfGvm+XyaawYfy2C+wNmaMkimGQAKY1HKZHh27Se65i0Cq/aAr6 EPhCWVU5HvNXNJOjwj69yQYiZbhZY0nORcDiZo3BzseMaSooMeVBxkF+qNTiJvoaVHiU varrNZNcDMKp5EbUvK28mRgUSPVejBvaBHi9AbgqZuSqc9VS5mmecESWCPL8UKRY//Hi w6svYW4YifCeKbpyYyHk8/gr6lyVI4lCG1TayOPK1MNXE27C2wFy4qjAp7c5LDvQi6UM mXFzV4h5ev8ytYVxsfwaC5UP84IvOlFo8dbJnSiBqZpOk7zBdlgXFKXygr118/7v0cFI bU6A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ISpxS6pMfuU+dhjpCrXMNeSGqAvxSKMVLgBCd+W2e/k=; b=nmQh+1Zm48OHVmWAUcaTdHJf+i3PBvFwy0pHsu97RfCSf6YLfXKT1GO9jik9Q4nv1e Uh21X7GjQI6Gbptgxt8aYfOD9g0C4uiCTSG1pY+rGTJQK4IhClnvKDk3xZLq7aZBJ4Py xYOQRS4Smw7er2jiPPhVp/IW6v6ZKqJs0nPOLEup8d/ebeaUsx3VmOx69E3JoUcsyLEI EEm7eipA8Us7tj3sTDFiquFV83pEgmWR9B10aQ9firabGja64J+j9/viyh39IhdReSjW vtN4say3kmlv6ZeNYAZA9MccdNKfQKRzV92le0Vfi0QnVC0D9ZlFDmCRULAd1UTRpLpT IVlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1skYq4eV; 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 bc4si13115509plb.119.2019.02.26.14.36.45; Tue, 26 Feb 2019 14:37:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=1skYq4eV; 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 S1729279AbfBZWec (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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