Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp685877yba; Fri, 12 Apr 2019 11:34:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwb4l73BEhJJEHG5ZNGbwkzymlmBtlr51wqMG9+uPfhc6R0NEAUPEQy444f+QZ/tP3PdM2u X-Received: by 2002:a17:902:6949:: with SMTP id k9mr58634967plt.59.1555094051202; Fri, 12 Apr 2019 11:34:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555094051; cv=none; d=google.com; s=arc-20160816; b=uJ3hYNz6z4Sk5vMidTzQ7suu/+IJNloxTiKW7eOTdQSsCSRaDoTQCJT+rNrtJDvrZa QxB5FRlCComuSKDqi5LNZcLriugfssKCxpRlH9yHDpwWpltjt2bKydh0t25blF5UhjBg ywsVf0R9UPiOBfSsiY54Iio39gpepdMOrvqZ/Zkkr1UaN4q5r2lTntS47b3wNU/bf6XM wD2JGtF8FjoNv7HRL2Pi5BjR/usVq3Yj/qzplLu4B8UAqPyBDsVt+5cAxMOTyfDiPINH 91Ff4wnAsoVEeuNBB3gKh9HSJpDSqznCwHFU2R4ye1wv/sgeDh8w4vdsbogMNFkKx3Ks +JfQ== 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=5Q+rsve4nDcdN90TVJWeC6N9nRN7FrpSbQlkbPcrPjg=; b=n8fln9p7EcAx7F7g2Hhm68EK3AnwV0m/d+nETl6SwMuBbf1qHiDrZUrQOrl5fog4c9 oASlUeq7rouhx7gluNXizxBiu3B+ESLY43S7Gz+dUmeX4QJUY3k2ekSTJ3pUGwYng2aB Gwi9BD9SniIUYj7erZHuDHYhIJ2GqPTUguLDmqqyqy+0sHVaxCF9w7QVu7cmOKXzhK0G owowDFTwhvMoeZYLiHqM3YONvnMs6jzzrBOQ2alqazA9Z3Vkim2mtTvnApBzJn/CdKVI AY1oE0Bh5xfkKGlFvhWJUapowMAgqVwuh611GbcJojmnZQ6NNPbq1nGoKw+D9v1bdDrq 8hdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xF4GNv8N; 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 w125si39651578pfw.137.2019.04.12.11.33.55; Fri, 12 Apr 2019 11:34:11 -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=xF4GNv8N; 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 S1727280AbfDLSce (ORCPT + 99 others); Fri, 12 Apr 2019 14:32:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:50288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726798AbfDLSbw (ORCPT ); Fri, 12 Apr 2019 14:31:52 -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 0053B20818; Fri, 12 Apr 2019 18:31:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555093911; bh=zFwgN1sOMDea7TNovxIY+gAobjB9y0e2myeBcykA46s=; h=From:To:Cc:Subject:Date:From; b=xF4GNv8Nl+uviNc3A31GjGkwdCJZeJ402GCjEHUkgbrxskZqkwrVmQcBeNFWxts5y ZkuzOXzBg7A+/KQNRbbSqmydHZ6AVOsGejGhoHSi62XCMqPjVx+aNSA08Y/6kxJzP9 q8a+z26L4Dr0C2wUTr6nL8WmrfaOhNvhqRzOxE2U= From: Stephen Boyd To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Chen-Yu Tsai , Greg Kroah-Hartman , Jeffrey Hugo , Jerome Brunet , Matti Vaittinen , Miquel Raynal , Rob Herring , Russell King Subject: [PATCH v4 0/9] Rewrite clk parent handling Date: Fri, 12 Apr 2019 11:31:41 -0700 Message-Id: <20190412183150.102131-1-sboyd@kernel.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-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. 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 v3: * Split clkdev patch into two * New patch to let dev_of_node() accept NULL * Use dev_of_node() in of_clk_hw_register() to avoid NULL deref 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 Cc: Chen-Yu Tsai Cc: Greg Kroah-Hartman Cc: Jeffrey Hugo Cc: Jerome Brunet Cc: Matti Vaittinen Cc: Michael Turquette Cc: Miquel Raynal Cc: Rob Herring Cc: Russell King Stephen Boyd (9): clkdev: Hold clocks_mutex while iterating clocks list clkdev: Move clk creation outside of 'clocks_mutex' clk: Prepare for clk registration API that uses DT nodes driver core: Let dev_of_node() accept a NULL dev 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 drivers/clk/clk-fixed-factor.c | 53 ++++-- drivers/clk/clk.c | 326 +++++++++++++++++++++++++-------- drivers/clk/clk.h | 2 + drivers/clk/clkdev.c | 30 +-- include/linux/clk-provider.h | 22 +++ include/linux/device.h | 2 +- 6 files changed, 327 insertions(+), 108 deletions(-) base-commit: 9e98c678c2d6ae3a17cb2de55d17f69dddaa231b -- Sent by a computer through tubes