mbox series

[RFC,0/2] usb: typec: ucsi: Check connection on resume

Message ID 20220907115626.21976-1-heikki.krogerus@linux.intel.com (mailing list archive)
Headers show
Series usb: typec: ucsi: Check connection on resume | expand

Message

Heikki Krogerus Sept. 7, 2022, 11:56 a.m. UTC
Hi,

I'm sending these as an RFC first because I'm not done testing.

I made a small modification to my original proposal (in the bug
report). Now also connection during suspend should be covered.

I would appreciate if you guys could test these again. If everything
works, and the bug is fixed, let me know, and I'll add your Tested-by
tags to the patches.

thanks,

Heikki Krogerus (2):
  usb: typec: ucsi: Check the connection on resume
  usb: typec: ucsi: acpi: Add PM hooks

 drivers/usb/typec/ucsi/ucsi.c      | 42 +++++++++++++++++++++---------
 drivers/usb/typec/ucsi/ucsi_acpi.c | 15 +++++++++++
 2 files changed, 44 insertions(+), 13 deletions(-)

Comments

Grzegorz Alibożek Sept. 7, 2022, 9:33 p.m. UTC | #1
Hi,
> Hi,
> 
> I'm sending these as an RFC first because I'm not done testing.
> 
> I made a small modification to my original proposal (in the bug
> report). Now also connection during suspend should be covered.
> 
> I would appreciate if you guys could test these again. If everything
> works, and the bug is fixed, let me know, and I'll add your Tested-by
> tags to the patches.
> 
> thanks,
> 
> Heikki Krogerus (2):
>   usb: typec: ucsi: Check the connection on resume
>   usb: typec: ucsi: acpi: Add PM hooks
> 
>  drivers/usb/typec/ucsi/ucsi.c      | 42 +++++++++++++++++++++---------
>  drivers/usb/typec/ucsi/ucsi_acpi.c | 15 +++++++++++
>  2 files changed, 44 insertions(+), 13 deletions(-)

I have tested this patch on Lenovo T14 Gen2i with ac adapter and everything 
looks good. I applied patch on linux 5.19.7.
Bastian Rieck Sept. 8, 2022, 5:01 a.m. UTC | #2
Dear Heikki,

> I'm sending these as an RFC first because I'm not done testing.
> 
> I made a small modification to my original proposal (in the bug
> report). Now also connection during suspend should be covered.
> 
> I would appreciate if you guys could test these again. If
> everything works, and the bug is fixed, let me know, and I'll add
> your Tested-by tags to the patches.
>

Thanks so much for these changes—that's awesome! I have just finished 
testing this against 5.19.7 (Arch Linux) with a Lenovo X1 (Gen 9).

I am very happy to see that, as far as I can tell, the issue 
disappeared completely!

However, I am receiving additional warnings via `journalctl` that I 
did not receive before; I have attached this trace as an additional 
log file. Nothing in there seems critical and I can confirm that the 
system continues to operate normally. I merely wanted to provide you 
with this additional information in case it is of relevance.

Please let me know if there's anything else I can do here; I really 
appreciate the time you spent on this!

All the best,
  Bastian
Heikki Krogerus Sept. 9, 2022, 6:22 a.m. UTC | #3
On Thu, Sep 08, 2022 at 07:01:34AM +0200, Bastian Rieck wrote:
> Dear Heikki,
> 
> > I'm sending these as an RFC first because I'm not done testing.
> > 
> > I made a small modification to my original proposal (in the bug
> > report). Now also connection during suspend should be covered.
> > 
> > I would appreciate if you guys could test these again. If
> > everything works, and the bug is fixed, let me know, and I'll add
> > your Tested-by tags to the patches.
> >
> 
> Thanks so much for these changes—that's awesome! I have just finished 
> testing this against 5.19.7 (Arch Linux) with a Lenovo X1 (Gen 9).
> 
> I am very happy to see that, as far as I can tell, the issue 
> disappeared completely!
> 
> However, I am receiving additional warnings via `journalctl` that I 
> did not receive before; I have attached this trace as an additional 
> log file. Nothing in there seems critical and I can confirm that the 
> system continues to operate normally. I merely wanted to provide you 
> with this additional information in case it is of relevance.
> 
> Please let me know if there's anything else I can do here; I really 
> appreciate the time you spent on this!

Thank you for the report. That warning certainly needs to be sorted
out before I send the final versions. I'll try to reproduce that.

thanks,
Heikki Krogerus Sept. 16, 2022, 10:46 a.m. UTC | #4
Hi Bastian,

On Fri, Sep 09, 2022 at 09:22:50AM +0300, Heikki Krogerus wrote:
> On Thu, Sep 08, 2022 at 07:01:34AM +0200, Bastian Rieck wrote:
> > Dear Heikki,
> > 
> > > I'm sending these as an RFC first because I'm not done testing.
> > > 
> > > I made a small modification to my original proposal (in the bug
> > > report). Now also connection during suspend should be covered.
> > > 
> > > I would appreciate if you guys could test these again. If
> > > everything works, and the bug is fixed, let me know, and I'll add
> > > your Tested-by tags to the patches.
> > >
> > 
> > Thanks so much for these changes—that's awesome! I have just finished 
> > testing this against 5.19.7 (Arch Linux) with a Lenovo X1 (Gen 9).
> > 
> > I am very happy to see that, as far as I can tell, the issue 
> > disappeared completely!
> > 
> > However, I am receiving additional warnings via `journalctl` that I 
> > did not receive before; I have attached this trace as an additional 
> > log file. Nothing in there seems critical and I can confirm that the 
> > system continues to operate normally. I merely wanted to provide you 
> > with this additional information in case it is of relevance.
> > 
> > Please let me know if there's anything else I can do here; I really 
> > appreciate the time you spent on this!
> 
> Thank you for the report. That warning certainly needs to be sorted
> out before I send the final versions. I'll try to reproduce that.

I'm not getting anywhere with this one. Could you provide me with the
trace output from both module and ucsi events?

To enable those events - assuming debugfs is mounted to
/sys/kernel/debug:

        % echo 1 > /sys/kernel/debug/tracing/events/ucsi/enable
        % echo 1 > /sys/kernel/debug/tracing/events/module/enable

Run the suspend resume cycle, and then dump the trace output to a
file:

        % cat /sys/kernel/debug/tracing/trace > ucsi_trace

thanks,
Bastian Rieck Oct. 7, 2022, 10 a.m. UTC | #5
Dear Heikki, dear all,

I am still unable to reproduce the previous error messages I 
mentioned. In the meantime, the UCSI issues disappeared with 5.19.9 
for me (!). I think this is related to a revert by Takashi Iwai  [1] 
in 5.19.8.

Given these data, would it be useful to test your patch against 
5.19.9 or a more recent version?

Thanks for all your efforts in supporting us here!

All the best,
 Bastian

[1] https://www.spinics.net/lists/linux-usb/msg230368.html

On Friday, September 16, 2022 12:46:47 PM CEST Heikki Krogerus 
wrote:
> Hi Bastian,
> 
> On Fri, Sep 09, 2022 at 09:22:50AM +0300, Heikki Krogerus wrote:
> > On Thu, Sep 08, 2022 at 07:01:34AM +0200, Bastian Rieck wrote:
> > > Dear Heikki,
> > > 
> > > > I'm sending these as an RFC first because I'm not done
> > > > testing.
> > > > 
> > > > I made a small modification to my original proposal (in the
> > > > bug
> > > > report). Now also connection during suspend should be
> > > > covered.
> > > > 
> > > > I would appreciate if you guys could test these again. If
> > > > everything works, and the bug is fixed, let me know, and
> > > > I'll add
> > > > your Tested-by tags to the patches.
> > > 
> > > Thanks so much for these changes—that's awesome! I have just
> > > finished testing this against 5.19.7 (Arch Linux) with a
> > > Lenovo X1 (Gen 9).
> > > 
> > > I am very happy to see that, as far as I can tell, the issue
> > > disappeared completely!
> > > 
> > > However, I am receiving additional warnings via `journalctl`
> > > that I did not receive before; I have attached this trace as
> > > an additional log file. Nothing in there seems critical and I
> > > can confirm that the system continues to operate normally. I
> > > merely wanted to provide you with this additional information
> > > in case it is of relevance.
> > > 
> > > Please let me know if there's anything else I can do here; I
> > > really appreciate the time you spent on this!
> > 
> > Thank you for the report. That warning certainly needs to be
> > sorted out before I send the final versions. I'll try to
> > reproduce that.
> I'm not getting anywhere with this one. Could you provide me with
> the trace output from both module and ucsi events?
> 
> To enable those events - assuming debugfs is mounted to
> /sys/kernel/debug:
> 
>         % echo 1 > /sys/kernel/debug/tracing/events/ucsi/enable
>         % echo 1 > /sys/kernel/debug/tracing/events/module/enable
> 
> Run the suspend resume cycle, and then dump the trace output to a
> file:
> 
>         % cat /sys/kernel/debug/tracing/trace > ucsi_trace
> 
> thanks,
Heikki Krogerus Oct. 7, 2022, 10:04 a.m. UTC | #6
On Fri, Oct 07, 2022 at 12:00:16PM +0200, Bastian Rieck wrote:
> Dear Heikki, dear all,
> 
> I am still unable to reproduce the previous error messages I 
> mentioned. In the meantime, the UCSI issues disappeared with 5.19.9 
> for me (!). I think this is related to a revert by Takashi Iwai  [1] 
> in 5.19.8.
> 
> Given these data, would it be useful to test your patch against 
> 5.19.9 or a more recent version?

No need. I'm just about to resend these.

thanks,