From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Alexey Charkov <alchark@flipper.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Guenter Roeck <linux@roeck-us.net>,
Yueyao Zhu <yueyao@google.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: typec: fusb302: Keep interrupt flags across a failed register read
Date: Fri, 20 Nov 2026 16:13:11 +0100 [thread overview]
Message-ID: <awBjhxTQmoj-MzHq@black.igk.intel.com> (raw)
In-Reply-To: <CAKTNdwES7sRRDjvgFdGttesY9dppOkfBjNhwsJuwUWN1T9DFvA@mail.gmail.com>
On Fri, Nov 20, 2026 at 05:52:45PM +0400, Alexey Charkov wrote:
> Hi Heikki,
>
> On Fri, Nov 20, 2026 at 5:04 PM Heikki Krogerus
> <heikki.krogerus@linux.intel.com> wrote:
> >
> > Hi Alexey,
> >
> > On Tue, Nov 17, 2026 at 12:25:31PM +0400, Alexey Charkov wrote:
> > > Reading INTERRUPT, INTERRUPTA or INTERRUPTB clears its flags in the chip,
> > > so bailing out on an I2C error in a later read loses the flags already
> > > read. On Flipper One, a NACK on INTERRUPTB just as a source raised VBUS
> > > lost VBUSOK. The driver kept treating VBUS as off, so TCPM never attached
> > > as a sink and left every Source_Capabilities unanswered.
> > >
> > > Keep the flags pending until they are handled, and retry the reads a few
> > > times, as such errors pass. Otherwise a flag left pending waits for the
> > > next interrupt.
> >
> > I did not quite understand this. What's the i2c error? Shouldn't the
> > i2c adapter driver take care of the retries?
>
> Any I2C transactions can fail - that's why the accessors return status
> codes. And they do, e.g. if another device on a shared bus misbehaves
> and hogs the bus down, or if there's any intermittent interference,
> etc. The I2C controller won't rerun the failed transaction and will
> propagate the error code to the caller instead. In my case it was
> -ENXIO when another device on the bus interfered with reading the
> interrupt status registers midway, causing the irq_work function to
> exit early and drop the flags it has already read without acting on
> them. The result was a permanently desynchronized TCPM state machine
> vs. what the partner saw on the wire.
Okay, got it.
> > > Fixes: c034a43e72dd ("staging: typec: Fairchild FUSB302 Type-c chip driver")
> > > Signed-off-by: Alexey Charkov <alchark@flipper.net>
> >
> > No stable?
>
> Cc: stable would make sense; my oversight. Thanks for spotting that.
> Shall I resend with it added?
Yes, please send v2 with it added.
Thanks,
--
heikki
prev parent reply other threads:[~2026-11-20 15:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 8:25 [PATCH] usb: typec: fusb302: Keep interrupt flags across a failed register read Alexey Charkov
2026-11-17 8:31 ` sashiko-bot
2026-11-20 13:04 ` Heikki Krogerus
2026-11-20 13:52 ` Alexey Charkov
2026-11-20 15:13 ` Heikki Krogerus [this message]
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=awBjhxTQmoj-MzHq@black.igk.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=alchark@flipper.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=sebastian.reichel@collabora.com \
--cc=yueyao@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.