Re: [RFC PATCH] usb: typec: ucsi: ack connector change after all tasks finish

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 27, 2024 at 03:06:28PM +0200, Dmitry Baryshkov wrote:
> On Wed, 27 Mar 2024 at 14:39, Diogo Ivo <diogo.ivo@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > The UCSI specification mentions that when the OPM is notified by the
> > PPM of an asynchronous event it should first send all the commands it
> > needs to get the details of the event and only after acknowledge it by
> > sending ACK_CC_CI with the Connector Change bit set, while the current
> > code sends this ack immediately after scheduling all the partner_tasks.
> > Move this ACK_CC_CI command to the end of all partner_tasks.
> >
> > This fixes a problem with some LG Gram laptops where the PPM sometimes
> > notifies the OPM with the Connector Change Indicator field set in the
> > CCI after an ACK_CC_CI command is sent, causing the UCSI stack to check
> > the connector status indefinitely since the EVENT_PENDING bit is already
> > cleared. This causes an interrupt storm and an artificial high load on
> > these platforms.
> >
> > It would also be interesting to see if we could take this approach and
> > implement the discussion in [1] regarding sending an ACK_CC_CI command
> > that acks both the command completion and the connector change.
> >
> > Signed-off-by: Diogo Ivo <diogo.ivo@xxxxxxxxxxxxxxxxxx>
> >
> > [1]: https://lore.kernel.org/all/20240320073927.1641788-1-lk@xxxxxxx/
> 
> We had similar issue, see
> https://lore.kernel.org/linux-arm-msm/20240313-qcom-ucsi-fixes-v1-1-74d90cb48a00@xxxxxxxxxx/

Hi Dmitry,

I had seen that patch and applied it to see if it fixed the problem but
unfortunately it doesn't. The problem I am seeing is that during the
various partner_tasks the CCI sometimes comes back with the Connector
Change Indicator set after an ACK_CC_CI to ack the commands, for which
the patch you mentioned cannot have an effect.

Besides, there is the question of spec compliance. From my interpretation
of page 14 of the 1.0 spec:

"Once the OPM is notified of either a command completion and/or an
asynchronous event it shall:

1. Read the CCI and optionally the STATUS Data Structures
2. If this was an asynchronous event then it shall send any other commands
it needs to get details on the asynchronous event.
3. Acknowledge the notification via the ACK_CC_CI (Acknowledge Command
Completion and/or Change Indication) command. The only notification that is
not acknowledge by the OPM is the command completion notification for the
ACK_CC_CI or the PPM_RESET command."

we first need to send the commands and only after ACK_CC_CI the connector
change which would be addressed by my proposed change, but please let me
know your thoughts on this/if this makes sense.

Best regards,

Diogo




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux