linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Johan Hovold <johan+linaro@kernel.org>,
	Vinod Koul <vkoul@kernel.org>, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 13/15] phy: qcom-qmp-pcie: add support for pipediv2 clock
Date: Thu, 20 Oct 2022 12:49:20 +0200	[thread overview]
Message-ID: <Y1EnsKMhoWo+cIWo@hovoldconsulting.com> (raw)
In-Reply-To: <7eb3fb9a-ce4a-eee0-b6bc-cee6aa6bf37b@linaro.org>

On Thu, Oct 20, 2022 at 12:28:14PM +0300, Dmitry Baryshkov wrote:
> On 20/10/2022 12:05, Johan Hovold wrote:

> > Here's your example diff inline:

> > @@ -2206,12 +2207,17 @@ static int qmp_pcie_parse_dt_legacy(struct qmp_pcie *qmp, struct device_node *np
> >   		}
> >   	}
> >   
> > -	qmp->pipe_clk = devm_get_clk_from_child(dev, np, NULL);
> > -	if (IS_ERR(qmp->pipe_clk)) {
> > -		return dev_err_probe(dev, PTR_ERR(qmp->pipe_clk),
> > +	clk = devm_get_clk_from_child(dev, np, NULL);
> > +	if (IS_ERR(clk)) {
> > +		return dev_err_probe(dev, PTR_ERR(clk),
> >   				     "failed to get pipe clock\n");
> >   	}
> >   
> > +	qmp->num_pipe_clks = 1;
> > +	qmp->pipe_clks = devm_kcalloc(dev, qmp->num_pipe_clks,
> > +				      sizeof(*qmp->pipe_clks), GFP_KERNEL);
> > +	qmp->pipe_clks[0].clk = clk;
> > 
> > So here you're poking at bulk API internals and forgot to set the id
> > string, which the implementation uses.
> 
> I didn't forget, I just skipped setting it. Hmm. I thought that it is 
> used only for clk_bulk_get. But after checking, it seems it's also used 
> for error messages. Mea culpa.
> 
> But it's not that I was poking into the internals. These items are in 
> the public header.

My point is that you're not using the bulk API as it was intended (e.g.
with clk_bulk_get()) and you risk running into issues like the above.

And looking up the actual clock name for this is overkill, even in the
case were it is provided, so we'd need to set it unconditionally to
"pipe" (which is fine).

> > For reasons like this, and the fact that will likely never have a third
> > pipe clock, I'm reluctant to using the bulk API.
> 
> Let's resort to the maintainer opinion then.

I'll take another look at it too.

Johan

  reply	other threads:[~2022-10-20 10:49 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 11:35 [PATCH v2 00/15] phy: qcom-qmp-pcie: add support for sc8280xp Johan Hovold
2022-10-19 11:35 ` [PATCH v2 01/15] phy: qcom-qmp-pcie: sort device-id table Johan Hovold
2022-10-19 12:28   ` Dmitry Baryshkov
2022-10-19 11:35 ` [PATCH v2 02/15] phy: qcom-qmp-pcie: move " Johan Hovold
2022-10-19 12:29   ` Dmitry Baryshkov
2022-10-19 11:35 ` [PATCH v2 03/15] phy: qcom-qmp-pcie: merge driver data Johan Hovold
2022-10-19 13:03   ` Dmitry Baryshkov
2022-10-19 11:35 ` [PATCH v2 04/15] phy: qcom-qmp-pcie: clean up device-tree parsing Johan Hovold
2022-10-19 11:35 ` [PATCH v2 05/15] phy: qcom-qmp-pcie: clean up probe initialisation Johan Hovold
2022-10-19 13:05   ` Dmitry Baryshkov
2022-10-19 11:35 ` [PATCH v2 06/15] phy: qcom-qmp-pcie: rename PHY ops structure Johan Hovold
2022-10-19 13:05   ` Dmitry Baryshkov
2022-10-19 11:35 ` [PATCH v2 07/15] phy: qcom-qmp-pcie: clean up PHY lane init Johan Hovold
2022-10-19 13:45   ` Dmitry Baryshkov
2022-10-19 11:35 ` [PATCH v2 08/15] phy: qcom-qmp-pcie: add register init helper Johan Hovold
2022-10-19 13:12   ` Dmitry Baryshkov
2022-10-19 13:25     ` Johan Hovold
2022-10-19 13:44       ` Dmitry Baryshkov
2022-10-19 13:51         ` Johan Hovold
2022-10-19 11:35 ` [PATCH v2 09/15] dt-bindings: phy: qcom,qmp-pcie: rename current bindings Johan Hovold
2022-10-19 12:39   ` Krzysztof Kozlowski
2022-10-19 11:35 ` [PATCH v2 10/15] dt-bindings: phy: qcom,qmp-pcie: add sc8280xp bindings Johan Hovold
2022-10-19 12:41   ` Krzysztof Kozlowski
2022-10-19 11:35 ` [PATCH v2 11/15] phy: qcom-qmp-pcie: restructure PHY creation Johan Hovold
2022-10-19 13:51   ` Dmitry Baryshkov
2022-10-19 11:35 ` [PATCH v2 12/15] phy: qcom-qmp-pcie: fix initialisation reset Johan Hovold
2022-10-19 13:51   ` Dmitry Baryshkov
2022-10-19 13:52   ` Dmitry Baryshkov
2022-10-21  9:11     ` Johan Hovold
2022-10-19 11:35 ` [PATCH v2 13/15] phy: qcom-qmp-pcie: add support for pipediv2 clock Johan Hovold
2022-10-20  8:31   ` Dmitry Baryshkov
2022-10-20  9:05     ` Johan Hovold
2022-10-20  9:28       ` Dmitry Baryshkov
2022-10-20 10:49         ` Johan Hovold [this message]
2022-10-20 10:53           ` Dmitry Baryshkov
2022-10-19 11:35 ` [PATCH v2 14/15] phy: qcom-qmp-pcie: add support for sc8280xp Johan Hovold
2022-10-19 11:35 ` [PATCH v2 15/15] phy: qcom-qmp-pcie: add support for sc8280xp 4-lane PHYs Johan Hovold
2022-10-20  3:43   ` Dmitry Baryshkov
2022-10-20  6:43     ` Johan Hovold
2022-10-20  9:32       ` Dmitry Baryshkov
2022-10-20 10:59         ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1EnsKMhoWo+cIWo@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=johan+linaro@kernel.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).