Re: [PATCH] usb: typec: fusb302: Drain the RX FIFO on each PD interrupt

From: Alexey Charkov

Date: Fri Nov 27 2026 - 05:49:00 EST


Hi Sebastian,

On Thu, Nov 12, 2026 at 3:41 AM Sebastian Reichel
<sebastian.reichel@xxxxxxxxxxxxx> wrote:
>
> Hi,
>
> On Mon, Nov 02, 2026 at 04:37:59PM +0400, Alexey Charkov wrote:
> > The driver reads one message from the RX FIFO per GCRCSENT or TX_SUCCESS
> > interrupt, assuming every queued message raises one. The chip, however,
> > queues some messages without acknowledging them or raising any interrupt,
> > e.g. it decodes only the low four bits of the message type and mistakes
> > Get_Source_Cap_Extended (17) for a GoodCRC (1). From then on every read
> > returns the message queued before the one that raised the interrupt, so
> > replies answer the wrong message and a Soft_Reset is never seen. The
> > partner escalates to a Hard Reset, which an Apple Studio Display repeats
> > every 1.5s.
> >
> > Furthermore, two different messages received in quick succession may be
> > queued without raising separate interrupts, causing all subsequent PD
> > communications to be permanently out of sync, which usually also leads to
> > a hard reset eventually.
> >
> > Read messages until the FIFO reports empty, so that each one is handled
> > on the event it arrived with, whatever the chip left unannounced before it.
> >
> > Signed-off-by: Alexey Charkov <alchark@xxxxxxxxxxx>
> > ---
>
> Reviewed-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>

Thank you for your review! I had to rework this patch because I ran
into another issue which sometimes corrupts a properly acknowledged
partner message upon enabling PD, so its new incarnation now builds on
top of that fix. Please consider this one superceded by [1] - it would
be great if you could have a look at that, too.

[1] http://patch.msgid.link/20261127-fusb302-getsourcecap-v2-2-6770eb1e7945@xxxxxxxxxxx

Best regards,
Alexey