Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3445322ybl; Fri, 20 Dec 2019 09:23:17 -0800 (PST) X-Google-Smtp-Source: APXvYqx5SBIktdJrL5b3PX5tV19HiVRHRUrp6yXz4+d1HwJF6/WnB84DRAUQbCHRwXAtelA4d9L7 X-Received: by 2002:a05:6830:1c85:: with SMTP id v5mr16844994otf.35.1576862597139; Fri, 20 Dec 2019 09:23:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576862597; cv=none; d=google.com; s=arc-20160816; b=dGVGlEJi2bMawqiJxmesg5ggHzDBZliCuuqCB/yodv5zE3kfB/NvvNUPKD2bZkk7Oq AJ32CIK1LIkUXFb8H2wMxpF9otDdquhd4y+n/vooYx7O17m1PhaFsN6unX7ySLqry80+ W4kUr6Z2InBge4dZD6AZV2KqX+RNf3ksgcgmVwrJbMnJjacLcnR9YQiUtmVf4rsWwm0+ 6Cz3Y1HhiCNiky/kfLOMWxWXCEacvtXjtNm16bZ54Qv92OWGSqQSuAiJxcmPnU735Zws Ehkmq25dmanp7zxflrdnxJczDAjsxkPOGmgB/LEyVUWjVP5rjKZC3Mifs9p974uyNdhl FCWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/2DfzHUs0wsHD/N2W+XhWHO23KTYPn9e2s28qhRJzhQ=; b=mx0/7eL+iU9B80rbqoaa9ykaXQQ7s/nHUjtFoP6XUHc2spxLiqwBVI9K/VsMLPGVkq EGRLG9SypNLbzhKqH8KU7xJ2M0YO5O7ZMPCGwIUXx0omAuzThgFo4z+a3QpUwmpow7oB owTKSeMhR3+2yHX23URTxW5b2qSKiAuKY4oqIUppdGtVEWC99aAZNY95VXKY9CZGN6wd xEHQjSvIu1Ra9pmekNggleNEm7YFpaOsatIFY+u1RfmoYSnCxxDUi7feL9GplK+TC16L PleS02b6+UjyQxSga+Mx62avq3qqYMTQ+bw9LJvDHqvlsYtvw8U8S2XsVpi3Y0dtHH1R 2+3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XjJXAYPU; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si5400133ota.19.2019.12.20.09.23.04; Fri, 20 Dec 2019 09:23:17 -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=@linaro.org header.s=google header.b=XjJXAYPU; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727417AbfLTRWR (ORCPT + 99 others); Fri, 20 Dec 2019 12:22:17 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:32950 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727390AbfLTRWR (ORCPT ); Fri, 20 Dec 2019 12:22:17 -0500 Received: by mail-pj1-f67.google.com with SMTP id u63so4109738pjb.0 for ; Fri, 20 Dec 2019 09:22:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/2DfzHUs0wsHD/N2W+XhWHO23KTYPn9e2s28qhRJzhQ=; b=XjJXAYPUZ8YdDmf+jaUqlJRjgwtOxi6VMYlNPJ0TfWrt/80WfT0Y3L48ZzNOY/MWln N/K8E43vURX8cw47TlbrPiDraNNiygcW3fgUCCBT6COyXamPgc2aRq0S7NVcgq31Ib8h 2BnBK804e2tsDcubk2Mm/zs6n9F/MFTOuGSfnLkZGKWUEKGnoJ9azGu1i4DjwQFIzayx zVlAxETeneD0V5NyJ0NURbZVrYMDXW+DaUr7yDi77bVZISgUuEyZMNdKdvjJHnDbh9R1 ZZBqzpxjNALx+HhVBQCgthKpnXIYVa9HhRWNc0m57OlWZHY7OtwX+16kCBF7SeZVLDhD L8wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/2DfzHUs0wsHD/N2W+XhWHO23KTYPn9e2s28qhRJzhQ=; b=qYje0kFQLBAxi5yNr8sWDsbm6Ik655Tj6ALEEF/x9REk+N21EjqwB2hX8jV+Wkvinu fm5liqda5QS7WaS6X9v3e5hyeZZ4ZqCdb7lTIBrIlxohjKFscRas2FK9OMapYJ2aXZ4o qD1nnidIZiySfcL5HvXM5Y8dJX/H+Clne8A4PyHeCeJ+Nmira6GuIIIp3RgKf5/e2gdt +uExKKNSrTl0cJLgf3UkglPdI8XrDFkaNsPetJswPRmtIautjuS4kkhHSLMaumcwB9iu oTIofhoFydFEpiBVe1cD+t45TU1xMUf7xKNUiI+aEOPAgcXCcjzc7dOhGMz3NFViPmuX ZK5Q== X-Gm-Message-State: APjAAAUfXc+Htb+Hj/mWgYkvqdj4JmPfR7EYXKcM237PPM50igxtV/Oa H+oqw5EmhvDiUe1QsK+VojYdf++nv7U= X-Received: by 2002:a17:902:b496:: with SMTP id y22mr16764859plr.158.1576862536707; Fri, 20 Dec 2019 09:22:16 -0800 (PST) Received: from ripper (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id e9sm12572878pgn.49.2019.12.20.09.22.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2019 09:22:16 -0800 (PST) Date: Fri, 20 Dec 2019 09:22:06 -0800 From: Bjorn Andersson To: Stephen Boyd Cc: Andy Gross , Niklas Cassel , linux-arm-msm@vger.kernel.org, amit.kucheria@linaro.org, Michael Turquette , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 7/7] clk: qcom: apcs-msm8916: use clk_parent_data to specify the parent Message-ID: <20191220172206.GB1908628@ripper> References: <20191125135910.679310-1-niklas.cassel@linaro.org> <20191125135910.679310-8-niklas.cassel@linaro.org> <20191219062339.DC0DE21582@mail.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191219062339.DC0DE21582@mail.kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 18 Dec 22:23 PST 2019, Stephen Boyd wrote: > Quoting Niklas Cassel (2019-11-25 05:59:09) > > diff --git a/drivers/clk/qcom/apcs-msm8916.c b/drivers/clk/qcom/apcs-msm8916.c > > index 46061b3d230e..bb91644edc00 100644 > > --- a/drivers/clk/qcom/apcs-msm8916.c > > +++ b/drivers/clk/qcom/apcs-msm8916.c > > @@ -51,6 +51,19 @@ static int qcom_apcs_msm8916_clk_probe(struct platform_device *pdev) > > struct clk_init_data init = { }; > > int ret = -ENODEV; > > > > + /* > > + * This driver is defined by the devicetree binding > > + * Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt, > > + * however, this driver is registered as a platform device by > > + * qcom-apcs-ipc-mailbox.c. Because of this, when this driver > > + * uses dev_get_regmap() and devm_clk_get(), it has to send the parent > > + * device as argument. > > + * When registering with the clock framework, we cannot use this trick, > > + * since the clock framework always looks at dev->of_node when it tries > > + * to find parent clock names using clk_parent_data. > > + */ > > + dev->of_node = parent->of_node; > > This is odd. The clks could be registered with of_clk_hw_register() but > then we lose the device provider information. Maybe we should search up > one level to the parent node and if that has a DT node but the > clk controller device doesn't we should use that instead? > Yeah, we shouldn't have two struct device with the same of_node in the system, and your suggestion looks quite reasonable. Do you mind spinning a patch out of it and we can drop above chunk from Niklas' patch - and afaict merge all the remaining patches to enable CPR on our first target! Thanks, Bjorn > ----8<----- > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > index b68e200829f2..c8745c415c04 100644 > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -3669,7 +3669,7 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw) > if (dev && pm_runtime_enabled(dev)) > core->rpm_enabled = true; > core->dev = dev; > - core->of_node = np; > + core->of_node = np ? : dev_of_node(dev->parent); > if (dev && dev->driver) > core->owner = dev->driver->owner; > core->hw = hw;