Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6317182ybh; Wed, 7 Aug 2019 21:48:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBUC2rQSr1JVGLpjIRLrc9mLel9tGidDX6eFKp8erU14iohZjZTzrn8mRG+xeY11ce6eMw X-Received: by 2002:a17:90a:d814:: with SMTP id a20mr2015981pjv.48.1565239738467; Wed, 07 Aug 2019 21:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565239738; cv=none; d=google.com; s=arc-20160816; b=moKkzKfqraxHWTp5HdKG5CvzXQYlVO9uAE7/q5gysl56aVMMpywZLMUv0npB++dth3 /Bu2YFpSeRqz+Bg9QOEBBgWD+5PsRBA607zTGpOJc9+P2pQVkTv06ibmBGGxMlKBR2tV n88ZiRnfrc+7whE0f89BqWdFvwAlSZgi+3lHs8NYzhwQznIjc04BRadNpuZil4+jxwYv 88j3JInt+jVt2tK9d2OnBjkbfpTwo+pOJKKFtCyGWUCXc5tSsfHrsr87PMtX2lZl5Jpi A2VCWvt5MXbNgTdj4pe4CZ4InGVbdpJUtrpBjt697EiJ5a9HtFt2k3PQH+oL09d4lHRZ QWVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:user-agent:subject:to:cc :from:references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=TYqJYnFKVkoekMRBa4Z1Isc4vfaiNcOCycaSrvci3jU=; b=Czs8LvcKzzUCeCmkLgU4hVnAJ3/5PSGiPTaJ7svYaDNcVLkgye/zIhD5TZbj1XFpXU EsTfD7FR02S1QeXrr7QQvHy5G/Z004NG+LmYkyOifswSp38C0v/uiu1QMW1lUSsScaOI Zfc3KZaC4GauUV69Sb/XotXl0PGeq7iYgN+PC+xqYRPbfL+tuwx6hpqZbDHuTO66ZB9w KijhKmWUFN3v1vxC1ZWzLxlGr1/hgYrnqmicRKX9D/42nCXQH9Se99aoM4yJPxwk0Uet eQt1jehJiT/WxsOkEC+ItYbHmPoIN1/qwV9HtEH6h79u0v7bp2LC/JSJrvvaDHh+cjLH HtQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=heRTJYGb; 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 n123si34148399pgn.151.2019.08.07.21.48.42; Wed, 07 Aug 2019 21:48:58 -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=heRTJYGb; 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 S1730723AbfHHEri (ORCPT + 99 others); Thu, 8 Aug 2019 00:47:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:45908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbfHHErh (ORCPT ); Thu, 8 Aug 2019 00:47:37 -0400 Received: from kernel.org (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 A4E83217D7; Thu, 8 Aug 2019 04:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565239656; bh=y0710HmReVsBMWZ/XfSor0U2soY0toxlrShfhv6D9iA=; h=In-Reply-To:References:From:Cc:To:Subject:Date:From; b=heRTJYGb+MKnfdifsw1aaCQ5Te73E3T+adwWyB2Qh8LsxkzkNb2+gHXK1Y9y7VVdO ttEq4DZqadJi6JBJlRK984Me6oF7tc8yhfyHyjYw7UuSPc0c970anKM8dtH2P9Tfdl W/A0NQDTkGsu91OWcxft8zXa33tPBgskXOJ37lzY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1j36iewvdo.fsf@starbuckisacylon.baylibre.com> References: <20190731084019.8451-1-narmstrong@baylibre.com> <20190731084019.8451-2-narmstrong@baylibre.com> <1j36iewvdo.fsf@starbuckisacylon.baylibre.com> From: Stephen Boyd Cc: Neil Armstrong , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Martin Blumenstingl To: Jerome Brunet , Neil Armstrong Subject: Re: [PATCH v2 1/4] clk: core: introduce clk_hw_set_parent() User-Agent: alot/0.8.1 Date: Wed, 07 Aug 2019 21:47:35 -0700 Message-Id: <20190808044736.A4E83217D7@mail.kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Jerome Brunet (2019-08-06 01:28:19) > On Wed 31 Jul 2019 at 10:40, Neil Armstrong wro= te: >=20 > > Introduce the clk_hw_set_parent() provider call to change parent of > > a clock by using the clk_hw pointers. > > > > This eases the clock reparenting from clock rate notifiers and > > implementing DVFS with simpler code avoiding the boilerplates > > functions as __clk_lookup(clk_hw_get_name()) then clk_set_parent(). > > > > Signed-off-by: Neil Armstrong > > Acked-by: Martin Blumenstingl >=20 > Looks ok to me but we will obviously need Stephen's ack to apply it Acked-by: Stephen Boyd >=20 > > --- > > drivers/clk/clk.c | 6 ++++++ > > include/linux/clk-provider.h | 1 + > > 2 files changed, 7 insertions(+) > > > > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > > index c0990703ce54..c11b1781d24a 100644 > > --- a/drivers/clk/clk.c > > +++ b/drivers/clk/clk.c > > @@ -2487,6 +2487,12 @@ static int clk_core_set_parent_nolock(struct clk= _core *core, > > return ret; > > } > > =20 > > +int clk_hw_set_parent(struct clk_hw *hw, struct clk_hw *parent) > > +{ > > + return clk_core_set_parent_nolock(hw->core, parent->core); I wonder if you really want to call all those things in clk_core_set_parent_nolock(). For example, do you want notifiers to run again and for rates to be speculated? Maybe all you want to do is overwrite some value for the clk's parent by calling into the ops for the clk and generically parse the value that's passed as the "parent" here. I ask because it may be good to avoid doing all that work and updating bookkeeping when we're deep in a notifier. If we can clearly understand what the driver wants to do from the notifier then it's simpler to change in the future to use things such as the coordinated clk rate vaporware.