From patchwork Thu Apr 4 21:53:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 10886377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA19D1390 for ; Thu, 4 Apr 2019 21:53:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94FE528AF2 for ; Thu, 4 Apr 2019 21:53:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 883B828AFB; Thu, 4 Apr 2019 21:53:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8C1028AF2 for ; Thu, 4 Apr 2019 21:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730317AbfDDVxq (ORCPT ); Thu, 4 Apr 2019 17:53:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:48008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729714AbfDDVxq (ORCPT ); Thu, 4 Apr 2019 17:53:46 -0400 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 46C4820882; Thu, 4 Apr 2019 21:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554414825; bh=xZLj/dM4yvsxxAOduPfGFuMxFMUwm2DjGIt71EuyvGI=; h=From:To:Cc:Subject:Date:From; b=q0MoGxANnXlWbJ6m1CiOKEXsTDi6hTNn8PFvBgmnY2hCQ5WFAOh53FQCyu8s+2MHu DCpD6UqdC7k8bYbBKYqTIopI3LXM9efYLXRQDdyVcyGdX3QB9GMkA2xvlBO+miDBgr Kloe7yBEXhmFU01WETw7NrHWyhWbtgxNgoO6Fkgc= 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 , Matti Vaittinen Subject: [PATCH v3 0/7] Rewrite clk parent handling Date: Thu, 4 Apr 2019 14:53:37 -0700 Message-Id: <20190404215344.6330-1-sboyd@kernel.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. I've converted the fixed factor clk and I'm looking at converting users of other "basic" clk types in follow-up patches so we can start moving drivers away from string matching in the clk namespace. Changes from v2: * Dropped patches that got merged into v5.1-rc1 * Introduced a new function of_clk_hw_register() * Introduced 'index' into clk_parent_data structure * Converted fixed-factor basic type to new design * Fixed some bugs in a recent patch to clkdev, leading to an essential API for clkdev based lookups working 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 Stephen Boyd (7): clkdev: Hold clocks_mutex while iterating clocks list clk: Prepare for clk registration API that uses DT nodes clk: Add of_clk_hw_register() API for early clk drivers clk: Allow parents to be specified without string names clk: Look for parents with clkdev based clk_lookups clk: Allow parents to be specified via clkspec index clk: fixed-factor: Let clk framework find parent Cc: Miquel Raynal Cc: Jerome Brunet Cc: Russell King Cc: Jeffrey Hugo Cc: Chen-Yu Tsai Cc: Matti Vaittinen drivers/clk/clk-fixed-factor.c | 53 ++++-- drivers/clk/clk.c | 326 +++++++++++++++++++++++++-------- drivers/clk/clk.h | 2 + drivers/clk/clkdev.c | 38 ++-- include/linux/clk-provider.h | 22 +++ 5 files changed, 334 insertions(+), 107 deletions(-) base-commit: 9e98c678c2d6ae3a17cb2de55d17f69dddaa231b