From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Linus Walleij <linusw@kernel.org>
Cc: Dmitry Guzman <Dmitry.Guzman@mobileye.com>,
Andi Shyti <andi.shyti@kernel.org>,
srinidhi kasagar <srinidhi.kasagar@stericsson.com>,
Ben Dooks <ben-linux@fluff.org>,
Andrea Gallo <andrea.gallo@stericsson.com>,
linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/8] i2c: nomadik: handle pm_runtime errors
Date: Thu, 5 Nov 2026 10:51:07 +0200 [thread overview]
Message-ID: <auxDe0lmVCDu_iXA@shikoro> (raw)
In-Reply-To: <CAD++jLm+m+YNhTaUnTm=dwO4p8xYe8OjZ7qhQ9_u15dnxURiVQ@mail.gmail.com>
On Thu, Nov 05, 2026 at 09:42:02AM +0100, Linus Walleij wrote:
> On Tue, Nov 3, 2026 at 9:30 AM Dmitry Guzman <Dmitry.Guzman@mobileye.com> wrote:
>
> > In nmk_i2c_xfer(), pm_runtime_get_sync() is called on start and then
> > the controller registers are accessed without checking the return value.
> > If pm_runtime_get_sync() fails, access to the register of the device that
> > was not correctly powered on may cause a bus fault or other unpredictable
> > system behavior.
> >
> > Check the return value of pm_runtime_get_sync() and it if is not 0,
> > return the error immediately.
> >
> > Signed-off-by: Dmitry Guzman <Dmitry.Guzman@mobileye.com>
> (...)
> > - pm_runtime_get_sync(&priv->adev->dev);
> > + i = pm_runtime_get_sync(&priv->adev->dev);
> > + if (i)
> > + return i;
>
> It's a bit odd to reuse the i (= iterator...) variable for this.
> I would just add an int ret or int err for this.
Yes, please.
next prev parent reply other threads:[~2026-11-05 8:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 8:29 [PATCH 0/8] i2c: nomadik: fix several issues in fault handling, optimize layout Dmitry Guzman
2026-11-03 8:29 ` [PATCH 1/8] i2c: nomadik: optimize struct layout, change unsigned char into u8 Dmitry Guzman
2026-11-03 8:29 ` [PATCH 2/8] i2c: nomadik: do not try to retransmit I2C message series on errors Dmitry Guzman
2026-11-03 8:29 ` [PATCH 3/8] i2c: nomadik: return proper fault codes Dmitry Guzman
2026-11-03 8:29 ` [PATCH 4/8] i2c: nomadik: change print level for fault messages to debug Dmitry Guzman
2026-11-03 8:29 ` [PATCH 5/8] i2c: nomadik: add quirks max_len=2047 and no_zero_len_read Dmitry Guzman
2026-11-05 8:40 ` Linus Walleij
2026-11-03 8:29 ` [PATCH 6/8] i2c: nomadik: handle pm_runtime errors Dmitry Guzman
2026-11-05 8:42 ` Linus Walleij
2026-11-05 8:51 ` Wolfram Sang [this message]
2026-11-03 8:29 ` [PATCH 7/8] i2c: nomadik: fix race condition with interrupt handler Dmitry Guzman
2026-11-05 8:42 ` Linus Walleij
2026-11-03 8:29 ` [PATCH 8/8] i2c: nomadik: reduce FIFO flush timeout to avoid long interrupt handling Dmitry Guzman
2026-11-05 8:44 ` Linus Walleij
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=auxDe0lmVCDu_iXA@shikoro \
--to=wsa+renesas@sang-engineering.com \
--cc=Dmitry.Guzman@mobileye.com \
--cc=andi.shyti@kernel.org \
--cc=andrea.gallo@stericsson.com \
--cc=ben-linux@fluff.org \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=srinidhi.kasagar@stericsson.com \
/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
all inboxes | Powered by JetHome®