Re: [PATCH 12/19] usb: typec: tcpci: don't act on unread alerts
From: Greg Kroah-Hartman
Date: Tue Dec 01 2026 - 05:57:24 EST
On Mon, Nov 02, 2026 at 02:23:57PM -0800, Amit Sunil Dhamne wrote:
> > +/*
> > + * An edge triggered ALERT# does not fire again while an alert is pending, so
> > + * don't give up after one failed transfer. No alert if it cannot be read.
> > + */
> > +static u16 tcpci_read_alert(struct tcpci *tcpci)
> > +{
> > + u16 status;
> > + int i;
> > +
> > + for (i = 0; i < 3; i++)
> > + if (!tcpci_read16(tcpci, TCPC_ALERT, &status))
> > + return status;
>
> Retrying immediately on a transient bus failure is unlikely to help. Add a
> small delay before retrying. Please keep in mind the Type-C/PD deadlines
> when selecting a delay value.
And what are those deadlines, 25–195 microseconds? I'll put in a short
delay here and see if that does anything...
> > +
>
> Please add some error log here to indicate consecutive alert read failures.
Really? We don't want the kernel log to be spammed by broken hardware.
What is an error here going to help with? I'll put in a debugging
message, but that should be all that is needed.
> > - /* Read complete, clear RX status alert bit */
> > +rx_done:
>
> Worth logging when you're dropping RX packets (due to ret!=0) given that the
> tcpc has already sent a GoodCRC.
Ok, will add a debug log message here too.
thanks,
greg k-h