From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Richard Cochran <richardcochran@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"DavidS. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v5 2/3] ptp: Add driver for R-Car Gen4
Date: Tue, 28 Jul 2026 15:42:39 +0200 [thread overview]
Message-ID: <20260728134239.GB2187218@ragnatech.se> (raw)
In-Reply-To: <1ee51bd7-3667-4184-b018-8a8cf29512c0@redhat.com>
Hi Paolo,
Thanks for your feedback.
On 2026-07-28 13:18:59 +0200, Paolo Abeni wrote:
> On 7/21/26 3:29 PM, Niklas Söderlund wrote:
> > +static int ptp_rcar_gen4_probe(struct platform_device *pdev)
> > +{
> > + struct ptp_rcar_gen4_priv *priv;
> > + struct device *dev = &pdev->dev;
> > + unsigned long rate;
> > +
> > + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> > + if (!priv)
> > + return -ENOMEM;
> > +
> > + platform_set_drvdata(pdev, priv);
> > +
> > + priv->base = devm_platform_ioremap_resource(pdev, 0);
> > + if (IS_ERR(priv->base))
> > + return PTR_ERR(priv->base);
> > +
> > + priv->clk = devm_clk_get(dev, NULL);
> > + if (IS_ERR(priv->clk))
> > + return PTR_ERR(priv->clk);
> > +
> > + rate = clk_get_rate(priv->clk);
> > + if (!rate)
> > + return -ENODEV;
> > +
> > + spin_lock_init(&priv->lock);
> > +
> > + priv->info = ptp_rcar_gen4_info;
> > +
> > + /* Default timer increment in ns.
> > + * bit[31:27] - integer
> > + * bit[26:0] - decimal
> > + * increment[ns] = perid[ns] * 2^27 => (1ns * 2^27) / rate[hz]
> > + */
> > +
> > + priv->default_addend = div_s64(1000000000LL << 27, rate);
> > +
> > + pm_runtime_enable(dev);
> > + pm_runtime_get_sync(dev);
>
> Both sashikos agrees pm_runtime_resume_and_get() should be used instead.
> This was already raised in v4, with no reply.
Ahh now I get it. The sashikos reply says that the return value of
pm_runtime_get_sync() is not checked, not to use
pm_runtime_resume_and_get().
I only greped for other users of pm_runtime_get_sync() and saw none of
them checked the return value and ignored the sashikos reply. Will fix
in a new version.
>
> /P
>
--
Kind Regards,
Niklas Söderlund
next prev parent reply other threads:[~2026-07-28 13:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 13:29 [PATCH net-next v5 0/3] ptp: Add driver for R-Car Gen4 Niklas Söderlund
2026-07-21 13:29 ` [PATCH net-next v5 1/3] dt-bindings: ptp: renesas,rcar-gen4-gptp: Add " Niklas Söderlund
2026-07-21 13:29 ` [PATCH net-next v5 2/3] ptp: Add driver for " Niklas Söderlund
2026-07-21 14:36 ` Vadim Fedorenko
2026-07-28 11:18 ` Paolo Abeni
2026-07-28 13:42 ` Niklas Söderlund [this message]
2026-07-21 13:29 ` [PATCH net-next v5 3/3] arm64: dts: renesas: r8a779g0: Add gPTP node Niklas Söderlund
2026-07-28 11:12 ` Paolo Abeni
2026-07-28 13:37 ` Niklas Söderlund
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=20260728134239.GB2187218@ragnatech.se \
--to=niklas.soderlund+renesas@ragnatech.se \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
--cc=vadim.fedorenko@linux.dev \
/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