linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
       [not found] <ZR0P278MB0773545F02B32FAF648F968AEB319@ZR0P278MB0773.CHEP278.PROD.OUTLOOK.COM>
@ 2022-10-25 12:19 ` Christian Bach
  2022-10-25 12:37   ` Greg KH
  0 siblings, 1 reply; 10+ messages in thread
From: Christian Bach @ 2022-10-25 12:19 UTC (permalink / raw)
  To: stable; +Cc: regressions, linux, linux-usb

Hello

For a few weeks now I am trying to make the PTN5110 chip work with the new Kernel 5.15.74. The same hardware setup was working with the 4.19.72 Kernel. The steps I took so far are as follows:
1. Study the Documentation and look at example Device Tree's in the Kernel
2. Try out different Device Tree configurations derived from the Documentation and examples
3. I did look on Stackoverflow, the NXP and other forums for any similar issue but could not find any
4. Updating the Kernel to the newest Version I was able to find: 5.15.74 (Hash: f0bee94053065c7cb8eacadfdd6bf739a2042b35 in Repo: git://git.yoctoproject.org/linux-yocto.git;branch=v5.15/standard/base)
5. Downgrade to the earliest Kernel possible: v5.10-rc1 (Hash: 3650b228f83adda7e5ee532e2b90429c03f7b9ec in Repo: git://git.yoctoproject.org/linux-yocto.git;branch=v5.15/standard/base)

None of those steps had any effect. Every time I plug in a USB-A to USB-C cable the Kernel gets stuck in the ISR until I unplug the cable. (Attaching a full USB-PD capable Power Source over a USB-C cable works fine)
This results in an unreasonable high CPU usage (most of the times the CPU gets blocked completely).

I did analyze the I2C bus and found that the old Kernel did change many configurations after the A-C cable got attached while the new Kernel does nothing (please see logs below).
I also did compare what happens on the I2C bus during chip initialization but did not find any mentionable differences.

My HW setup is an i.mx6ul with the PTN5110 attached on I2C4.

=================================================
My device tree looks like this:
/ {
         regulators {
                 compatible = "simple-bus";
                 #address-cells = <1>;
                 #size-cells = <0>;

                 reg_usb_otg1_vbus: regulator@2 {
                          compatible = "regulator-fixed";
                          reg = <2>;
                          regulator-name = "usb_otg1_vbus";
                          pinctrl-names = "default";
                          pinctrl-0 = <&pinctrl_usb_otg1_vbus>;
                          regulator-min-microvolt = <5000000>;
                          regulator-max-microvolt = <5000000>;
                          gpio = <&gpio2 8 GPIO_ACTIVE_HIGH>;
                          enable-active-high;
                          status = "okay";
                 };
         };
};

&usbotg1 {
         /*pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_usbotg1>;*/
         dr_mode = "otg";
         status = "okay";
         disable-over-current;
         vbus-supply = <&reg_usb_otg1_vbus>;
};

&i2c4 {
         clock-frequency = <100000>;
         pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_i2c4>;
         status = "okay";

         usb_pd: ptn5110@50 {
                 compatible = "nxp,ptn5110";
                 reg = <0x50>;
                 pinctrl-names = "default";
                 pinctrl-0 = <&pinctrl_usb_pd>;
                 interrupt-parent = <&gpio2>;
                 interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
                 wakeup-source;

                 usb_con: connector {
                          compatible = "usb-c-connector";
                          label = "USB-C";
                          data-role = "dual";
                          power-role = "dual";
                          try-power-role = "sink";
                          source-pdos = <PDO_FIXED(VSAFE5V, 2000, PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE)>;
                          sink-pdos = <PDO_FIXED(VSAFE5V, 2000, PDO_FIXED_USB_COMM | PDO_FIXED_DUAL_ROLE)
                                     //PDO_FIXED(VSAFE5V, 3000, 0)
                                     //PDO_FIXED(9000, 3000, 0)
                                     PDO_FIXED(12000, 3000, 0)
                                     PDO_FIXED(20000, 3000, 0)>;
                                     //PDO_FIXED(20000, 5000, 0)>;
                          op-sink-microwatt = <10000000>;

                 };
         };
};

&iomuxc {
         pinctrl_i2c4: i2c4grp {
                 fsl,pins = <
                          MX6UL_PAD_UART2_TX_DATA__I2C4_SCL 0x4001b8b0
                          MX6UL_PAD_UART2_RX_DATA__I2C4_SDA 0x4001b8b0
                 >;
         };

         pinctrl_usb_pd: usbpdgrp {
                 fsl,pins = <
                          MX6UL_PAD_ENET2_TX_DATA0__GPIO2_IO11      0x0001b020 /* Alert Interrupt */
                          MX6UL_PAD_ENET2_TX_CLK__GPIO2_IO14        0x0001b020 /* Fault Interrupt */
                 >;
         };

         pinctrl_usb_otg1_vbus: usbotg1 {
                 fsl,pins = <
                          MX6UL_PAD_ENET2_RX_DATA0__GPIO2_IO08      0x000000b9
                          MX6UL_PAD_ENET2_RX_DATA1__USB_OTG1_OC     0x000010b0
                 >;
         };
};

=================================================
I2C Log on plug in event of Kernel 5.15.68:
Direction  | Address  | Data
-------------------------------
Read       | 10       | 02 22
Write      | 10       | 02 22
Read       | 14       | 04
Read       | 10       | 02 02
Write      | 10       | 02 02
Read       | 1E       | 0C
Read       | 14       | 04
Read       | 10       | 03 02
Write      | 10       | 03 02
Read       | 1E       | 0C
Read       | 1A       | 4A
Read       | 14       | 04
Read       | 1D       | 11
Read       | 1E       | 0C

Pause for 200ms

Read       | 1A       | 4A
Read       | 1A       | 4A
Read       | 1D       | 11
Write      | 1A       | 0E
Write      | 19       | 00
Write      | 2E       | 02
Write      | 23       | 66
Write      | 23       | 55
Write      | 2F       | 21

Pause for 300ms

Write      | 51       | 02
Write      | 52       | 00 00
Write      | 50       | 25
Read       | 10       | 50 02
Write      | 10       | 50 02
Read       | 10       | 00 02
Write      | 10       | 00 02
Write      | 72       | 8C 00
Read       | 1C       | 60
Read       | 10       | 00 02
Write      | 10       | 00 02
Write      | 2F       | 00
Read       | 1C       | 60
Read       | 10       | 00 02
Write      | 10       | 00 02
Write      | 2E       | 02
Read       | 10       | 00 02
Write      | 10       | 00 02
Read       | 10       | 00 02
Write      | 10       | 00 02
Read       | 10       | 00 02
Write      | 10       | 00 02
Read       | 10       | 00 02
Write      | 10       | 00 02
(It will loop like this until the cable gets detached)


I2C Log on plug in event of Kernel 5.15.68:
Direction  | Address  | Data
-------------------------------
Read       | 10       | 02 22
Write      | 10       | 02 22
Read       | 14       | 04
Read       | 10       | 02 02
Write      | 10       | 02 02
Read       | 1E       | 0C
Read       | 14       | 04
Read       | 10       | 02 02
Write      | 10       | 02 02
Read       | 1E       | 0C
Read       | 14       | 04
Read       | 1E       | 0C

Pause for 200ms

Read       | 10       | 01 02
Write      | 10       | 01 02
Read       | 1D       | 11

Pause for 250ms

Read       | 1A       | 4A
Write      | 1A       | 4E
Write      | 19       | 00
Write      | 2E       | 02
Write      | 23       | 66
Write      | 23       | 55
Write      | 2F       | 21

Pause for 4ms

Write      | 51       | 02
Write      | 52       | 00 00
Write      | 50       | 35
Read       | 10       | 50 02
Write      | 10       | 50 02
Read       | 10       | 00 02
Write      | 10       | 00 02
Write      | 2F       | 00
Read       | 10       | 00 02
Write      | 10       | 00 02
Read       | 1C       | 60
Read       | 10       | 00 02
Write      | 10       | 00 02
Write      | 23       | 66
Read       | 10       | 02 02
Write      | 10       | 02 02
Write      | 23       | 44
Read       | 14       | FF
Write      | 2E       | 02
Read       | 1E       | 0C
Write      | 10       | FF FF
Write      | 14       | 04
Write      | 23       | 33
Write      | 12       | 7F 00
Write      | 2F       | 00
Write      | 23       | 66
Write      | 23       | 44
Read       | 1C       | 60
Read       | 1A       | 4E
Write      | 1A       | 4E
Write      | 19       | 00
Write      | 2E       | 02
Read       | 1E       | 0C
Read       | 1D       | 11
Write      | 2F       | 00
Write      | 23       | 66
Write      | 23       | 44
Read       | 1C       | 60
Read       | 1A       | 4E
Write      | 1A       | 4E
Write      | 19       | 00
Write      | 2E       | 02
Write      | 1A       | 0F
Read       | 10       | 01 02
Write      | 10       | 01 02
Read       | 1D       | 00
Write      | 1A       | 4A
Write      | 23       | 99
Read       | 10       | 01 02
Write      | 10       | 01 02
Read       | 1D       | 11
(no more communication after this point)

-- 
Dipl. El-Ing. FH Christian Bach, Projektleiter
Direct +41 43 456 16 96  .  http://www.scs.ch
Supercomputing Systems AG  .  Technoparkstrasse 1  .  CH-8005 Zürich 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
  2022-10-25 12:19 ` tcpci module in Kernel 5.15.74 with PTN5110 not working correctly Christian Bach
@ 2022-10-25 12:37   ` Greg KH
  2022-10-25 12:48     ` AW: " Christian Bach
  2023-02-20 16:45     ` Christian Bach
  0 siblings, 2 replies; 10+ messages in thread
From: Greg KH @ 2022-10-25 12:37 UTC (permalink / raw)
  To: Christian Bach; +Cc: stable, regressions, linux, linux-usb

On Tue, Oct 25, 2022 at 12:19:39PM +0000, Christian Bach wrote:
> Hello
> 
> For a few weeks now I am trying to make the PTN5110 chip work with the new Kernel 5.15.74. The same hardware setup was working with the 4.19.72 Kernel. The steps I took so far are as follows:

That is a huge jump.  Why not use 'git bisect'?

Or start with a smaller jump.  Why not go to 5.4.y first, that's only a
year's worth of changes, instead of 4 years of changes.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* AW: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
  2022-10-25 12:37   ` Greg KH
@ 2022-10-25 12:48     ` Christian Bach
  2022-10-25 13:36       ` Guenter Roeck
  2023-02-20 16:45     ` Christian Bach
  1 sibling, 1 reply; 10+ messages in thread
From: Christian Bach @ 2022-10-25 12:48 UTC (permalink / raw)
  To: Greg KH; +Cc: stable, regressions, linux, linux-usb

Thank you for answering. I did try a Kernel from 1 year ago (11. December 2020 - with the Hash b5206275b46c30a8236feb34a1dc247fa3683d83). But this Kernel had the exact same behavior. 
I even wanted to go back further the when the tcpm module got it's own subdirectory (v4.20 - 20. September 2018 - Hash ae8a2ca8a2215c7e31e6d874f7303801bb15fbbc) to see if it still worked at that time but my build system was not able to build it.

-----Ursprüngliche Nachricht-----
Von: Greg KH <gregkh@linuxfoundation.org> 
Gesendet: Dienstag, 25. Oktober 2022 14:38
An: Christian Bach <christian.bach@scs.ch>
Cc: stable@vger.kernel.org; regressions@lists.linux.dev; linux@roeck-us.net; linux-usb@vger.kernel.org
Betreff: Re: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly

[You don't often get email from gregkh@linuxfoundation.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

On Tue, Oct 25, 2022 at 12:19:39PM +0000, Christian Bach wrote:
> Hello
>
> For a few weeks now I am trying to make the PTN5110 chip work with the new Kernel 5.15.74. The same hardware setup was working with the 4.19.72 Kernel. The steps I took so far are as follows:

That is a huge jump.  Why not use 'git bisect'?

Or start with a smaller jump.  Why not go to 5.4.y first, that's only a year's worth of changes, instead of 4 years of changes.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: AW: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
  2022-10-25 12:48     ` AW: " Christian Bach
@ 2022-10-25 13:36       ` Guenter Roeck
  2022-10-25 16:17         ` AW: " Christian Bach
  0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2022-10-25 13:36 UTC (permalink / raw)
  To: Christian Bach, Greg KH; +Cc: stable, regressions, linux-usb

Hi,

On 10/25/22 05:48, Christian Bach wrote:
> Thank you for answering. I did try a Kernel from 1 year ago (11. December 2020 - with the Hash b5206275b46c30a8236feb34a1dc247fa3683d83). But this Kernel had the exact same behavior.
> I even wanted to go back further the when the tcpm module got it's own subdirectory (v4.20 - 20. September 2018 - Hash ae8a2ca8a2215c7e31e6d874f7303801bb15fbbc) to see if it still worked at that time but my build system was not able to build it.
> 

Greg asked for you to test with a v5.4.y kernel. ae8a2ca8a221..b5206275b46c30a82
is again a pretty large step with more than 100 commits in the drivers/usb/typec/tcpm/
directory.

Also, it might be useful to provide the respective kernel logs.

Thanks,
Guenter

> -----Ursprüngliche Nachricht-----
> Von: Greg KH <gregkh@linuxfoundation.org>
> Gesendet: Dienstag, 25. Oktober 2022 14:38
> An: Christian Bach <christian.bach@scs.ch>
> Cc: stable@vger.kernel.org; regressions@lists.linux.dev; linux@roeck-us.net; linux-usb@vger.kernel.org
> Betreff: Re: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
> 
> [You don't often get email from gregkh@linuxfoundation.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> On Tue, Oct 25, 2022 at 12:19:39PM +0000, Christian Bach wrote:
>> Hello
>>
>> For a few weeks now I am trying to make the PTN5110 chip work with the new Kernel 5.15.74. The same hardware setup was working with the 4.19.72 Kernel. The steps I took so far are as follows:
> 
> That is a huge jump.  Why not use 'git bisect'?
> 
> Or start with a smaller jump.  Why not go to 5.4.y first, that's only a year's worth of changes, instead of 4 years of changes.
> 
> thanks,
> 
> greg k-h


^ permalink raw reply	[flat|nested] 10+ messages in thread

* AW: AW: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
  2022-10-25 13:36       ` Guenter Roeck
@ 2022-10-25 16:17         ` Christian Bach
  2022-10-25 17:16           ` Guenter Roeck
  0 siblings, 1 reply; 10+ messages in thread
From: Christian Bach @ 2022-10-25 16:17 UTC (permalink / raw)
  To: Guenter Roeck, Greg KH; +Cc: stable, regressions, linux-usb

Ok

I now tested the whole thing also with some of the v5.4.y kernels. Just to avoid misunderstandings I listed all my tests below:

Kernel    | Hash                                       | Bug     | Comment
Version   | (date)                                     | present |
----------|--------------------------------------------|---------|--------------
v4.19.72  | ee809c7e08956d737cb66454f5b6ca32cc0d9f26   | No      | This is the old system we are trying to replace
          | (10. September 2019)                       |         |  with the new Kernel 5.15
----------|--------------------------------------------|---------|--------------
v4.20     | ae8a2ca8a2215c7e31e6d874f7303801bb15fbbc   | ?       | This kernel has never been tested as our build
          | (20. September 2018)                       |         |  can not build this kernel, but I mentioned it 
          |                                            |         |  because it is the first kernel where the tcpm
          |                                            |         |  module has been moved to its own subdirectory
----------|--------------------------------------------|---------|--------------
v5.15.74  | f0bee94053065c7cb8eacadfdd6bf739a2042b35   | Yes     | This is the Kernel we would like to use for the
          | (19. October 2022)                         |         |  new system. 
          |                                            |         |  It is working with with a USB-PD capable power-
          |                                            |         |  supply but connecting a USB-A to USB-C cable
          |                                            |         |  provokes the bug.
----------|--------------------------------------------|---------|--------------
v5.11     | b5206275b46c30a8236feb34a1dc247fa3683d83   | Yes     | This kernel behaves exactly like 5.15.74
          | (11. December 2020)                        |         |
----------|--------------------------------------------|---------|--------------
v5.10-rc1 | 3650b228f83adda7e5ee532e2b90429c03f7b9ec   | Yes     | This kernel behaves exactly like 5.15.74
          | (25. October 2020)                         |         |
----------|--------------------------------------------|---------|--------------
v5.4.219  | 35826e154ee014b64ccfa0d1f12d36b8f8a75939   | Yes     | This kernel performs segnificantly worse in
          | (19. October 2022)                         | worse   |  nagotiating with the USP-PD power-supply and
          |                                            |         |  even crashes about 50% of the tries. It then
          |                                            |         |  gets stuck in the ISR just as it does 100%
          |                                            |         |  of the time when connecting the USB-A to USB-C
          |                                            |         |  cable. (and even when disconnecting the cable)
----------|--------------------------------------------|---------|--------------
v5.4.1    | 79438f37a69a80822333c86acb06a71abce1bce3   | ?       | The build system was unable to compile the kernel 
          | (29. November 2019)                        |         |  scripts/dtc/dtc-parser.tab.o:(.bss+0x20): 
          |                                            |         |  multiple definition of `yylloc'; 
          |                                            |         |  scripts/dtc/dtc-lexer.lex.o:(.bss+0x0)
----------|--------------------------------------------|---------|--------------
v5.4.110  | 59c8e332926875d337f426fde14fec986faab414   | Yes     | Same behaviour as 5.4.219
          | (7. April 2021)                            |         |
----------|--------------------------------------------|---------|--------------
v5.4.55   | 169b93899c7dfb93a2b57da8e3505da9b2afcf5c   | Yes     | Same behaviour as 5.4.219
          | (31. July 2020)                            |         |
----------|--------------------------------------------|---------|--------------
v5.4.28   | 462afcd6e7ea94a7027a96a3bb12d0140b0b4216   | ?       | The build system was unable to compile the kernel 
          | (25. April 2020)                           |         |  scripts/dtc/dtc-parser.tab.o:(.bss+0x20): 
          |                                            |         |  multiple definition of `yylloc'; 
          |                                            |         |  scripts/dtc/dtc-lexer.lex.o:(.bss+0x0)

I would love to send some kernel logs but I can not see any entry in dmesg. Can you instruct me how to get the corresponding kernel logs?


-----Ursprüngliche Nachricht-----
Von: Guenter Roeck <groeck7@gmail.com> Im Auftrag von Guenter Roeck
Gesendet: Dienstag, 25. Oktober 2022 15:37
An: Christian Bach <christian.bach@scs.ch>; Greg KH <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org; regressions@lists.linux.dev; linux-usb@vger.kernel.org
Betreff: Re: AW: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly

Hi,

On 10/25/22 05:48, Christian Bach wrote:
> Thank you for answering. I did try a Kernel from 1 year ago (11. December 2020 - with the Hash b5206275b46c30a8236feb34a1dc247fa3683d83). But this Kernel had the exact same behavior.
> I even wanted to go back further the when the tcpm module got it's own subdirectory (v4.20 - 20. September 2018 - Hash ae8a2ca8a2215c7e31e6d874f7303801bb15fbbc) to see if it still worked at that time but my build system was not able to build it.
> 

Greg asked for you to test with a v5.4.y kernel. ae8a2ca8a221..b5206275b46c30a82 is again a pretty large step with more than 100 commits in the drivers/usb/typec/tcpm/ directory.

Also, it might be useful to provide the respective kernel logs.

Thanks,
Guenter

> -----Ursprüngliche Nachricht-----
> Von: Greg KH <gregkh@linuxfoundation.org>
> Gesendet: Dienstag, 25. Oktober 2022 14:38
> An: Christian Bach <christian.bach@scs.ch>
> Cc: stable@vger.kernel.org; regressions@lists.linux.dev; 
> linux@roeck-us.net; linux-usb@vger.kernel.org
> Betreff: Re: tcpci module in Kernel 5.15.74 with PTN5110 not working 
> correctly
> 
> [You don't often get email from gregkh@linuxfoundation.org. Learn why 
> this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> On Tue, Oct 25, 2022 at 12:19:39PM +0000, Christian Bach wrote:
>> Hello
>>
>> For a few weeks now I am trying to make the PTN5110 chip work with the new Kernel 5.15.74. The same hardware setup was working with the 4.19.72 Kernel. The steps I took so far are as follows:
> 
> That is a huge jump.  Why not use 'git bisect'?
> 
> Or start with a smaller jump.  Why not go to 5.4.y first, that's only a year's worth of changes, instead of 4 years of changes.
> 
> thanks,
> 
> greg k-h


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: AW: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
  2022-10-25 16:17         ` AW: " Christian Bach
@ 2022-10-25 17:16           ` Guenter Roeck
  2022-10-28  9:31             ` AW: " Christian Bach
  0 siblings, 1 reply; 10+ messages in thread
From: Guenter Roeck @ 2022-10-25 17:16 UTC (permalink / raw)
  To: Christian Bach; +Cc: Greg KH, stable, regressions, linux-usb

On Tue, Oct 25, 2022 at 04:17:27PM +0000, Christian Bach wrote:
> Ok
> 
> I now tested the whole thing also with some of the v5.4.y kernels. Just to avoid misunderstandings I listed all my tests below:
> 
> Kernel    | Hash                                       | Bug     | Comment
> Version   | (date)                                     | present |
> ----------|--------------------------------------------|---------|--------------

> ----------|--------------------------------------------|---------|--------------
> v5.10-rc1 | 3650b228f83adda7e5ee532e2b90429c03f7b9ec   | Yes     | This kernel behaves exactly like 5.15.74
>           | (25. October 2020)                         |         |
> ----------|--------------------------------------------|---------|--------------
> v5.4.219  | 35826e154ee014b64ccfa0d1f12d36b8f8a75939   | Yes     | This kernel performs segnificantly worse in
>           | (19. October 2022)                         | worse   |  nagotiating with the USP-PD power-supply and
>           |                                            |         |  even crashes about 50% of the tries. It then
>           |                                            |         |  gets stuck in the ISR just as it does 100%
>           |                                            |         |  of the time when connecting the USB-A to USB-C
>           |                                            |         |  cable. (and even when disconnecting the cable)

Thanks a lot for the detailed report. It would be great if you can
send actual crash logs. Maybe that problem is fixable in v5.4.y.

Can you also test v5.0 .. v5.3 ? Mainline would be best (not v5.0.x but v5.0) ?

> I would love to send some kernel logs but I can not see any entry in dmesg. Can you instruct me how to get the corresponding kernel logs?
> 

This won't be in dmesg; that would be way too noisy since it logs
each state machine action.

You should find the logs in /sys/debug/kernel/usb/tcpm-<index>.
In older kernels it is just a file, in more recent kernels it is a
directory with files in it. In really old kernels it is
/sys/debug/kernel/tcpm/tcpm-<index>. If you don't immediately find
the file(s), just search for files with "tcpm" in the name in
/sys/kernel/debug.

Hope this helps,

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 10+ messages in thread

* AW: AW: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
  2022-10-25 17:16           ` Guenter Roeck
@ 2022-10-28  9:31             ` Christian Bach
  0 siblings, 0 replies; 10+ messages in thread
From: Christian Bach @ 2022-10-28  9:31 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Greg KH, stable, regressions, linux-usb

> Can you also test v5.0 .. v5.3 ? Mainline would be best (not v5.0.x but v5.0) ?

I was unable to build those Kernels with my build-system:

Kernel    | Hash                                       | Bug     | Comment
Version   | (date)                                     | present |
----------|--------------------------------------------|---------|--------------
v5.0      | 1c163f4c7b3f621efff9b28a47abb36f7378d783   |         | git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
          | (3. March 2019)                            |         |  The build system was unable to compile the kernel 
          |                                            |         |  scripts/dtc/dtc-parser.tab.o:(.bss+0x20): 
          |                                            |         |  multiple definition of `yylloc'; 
          |                                            |         |  scripts/dtc/dtc-lexer.lex.o:(.bss+0x0)
----------|--------------------------------------------|---------|--------------
v5.3      | 4d856f72c10ecb060868ed10ff1b1453943fc6c8   |         | git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
          | (15. September 2019)                       |         |  The build system was unable to compile the kernel 
          |                                            |         |  scripts/dtc/dtc-parser.tab.o:(.bss+0x20): 
          |                                            |         |  multiple definition of `yylloc'; 
          |                                            |         |  scripts/dtc/dtc-lexer.lex.o:(.bss+0x0)
----------|--------------------------------------------|---------|--------------

> You should find the logs in /sys/debug/kernel/usb/tcpm-<index>.

I was able to retrieve these Logs for the 5.15.74 and 4.19.72 Kernel. Unfortunately I am not familiar enough with this subsystem to find the problem myself.
Regardless, what stands out to me (as it already did when I posted the I2C communication) is that the module in the old kernel is doing much more things when a cable gets attached. To me it seams as if a vital handling method is not being called in case a non-PD capable cable gets attached. As you can see in the log at the end the PD-capable power supplies work just fine.

=============================================================================
First the log from the old Kernel 4.19.72:
USB-PD Init:
------------

[    2.381046] Setting voltage/current limit 0 mV 0 mA
[    2.381069] polarity 0
[    2.383125] Requesting mux state 0, usb-role 0, orientation 0
[    2.384739] state change INVALID_STATE -> SNK_UNATTACHED
[    2.385636] CC1: 0 -> 0, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, disconnected]
[    2.385759] 3-0050: registered
[    2.390858] Setting voltage/current limit 0 mV 0 mA
[    2.390875] polarity 0
[    2.405734] Requesting mux state 0, usb-role 0, orientation 0
[    2.406435] cc:=0
[    2.407098] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms
[    2.408069] CC1: 0 -> 0, CC2: 0 -> 0 [state PORT_RESET, polarity 0, disconnected]
[    2.408098] state change PORT_RESET -> SNK_UNATTACHED
[    2.408139] Start DRP toggling
[    2.411694] CC1: 0 -> 0, CC2: 0 -> 0 [state DRP_TOGGLING, polarity 0, disconnected]


USB-A to USB-C Cable attach event:
----------------------------------

[  565.271076] VBUS on
[  565.274567] VBUS on
[  565.276331] VBUS on
[  565.362693] CC1: 0 -> 3, CC2: 0 -> 0 [state DRP_TOGGLING, polarity 0, connected]
[  565.362731] state change DRP_TOGGLING -> SNK_ATTACH_WAIT
[  565.362775] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms
[  565.565761] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  565.565797] state change SNK_DEBOUNCED -> SNK_ATTACHED
[  565.565807] polarity 0
[  565.567832] Requesting mux state 1, usb-role 2, orientation 1
[  565.568544] state change SNK_ATTACHED -> SNK_STARTUP
[  565.568567] state change SNK_STARTUP -> SNK_DISCOVERY
[  565.568591] Setting voltage/current limit 5000 mV 0 mA
[  565.568602] vbus=0 charge:=1
[  565.569961] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES
[  565.570651] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 240 ms
[  565.813787] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND [delayed 240 ms]
[  565.813817] PD TX, type: 0x5
[  565.818135] PD TX complete, status: 0
[  565.818238] state change HARD_RESET_SEND -> HARD_RESET_START
[  565.820586] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF
[  565.820611] vconn:=0
[  565.823265] vbus=0 charge:=0
[  565.828697] Requesting mux state 1, usb-role 2, orientation 1
[  565.830910] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms
[  565.837525] Setting voltage/current limit 0 mV 0 mA
[  565.837673] polarity 0
[  565.839715] Requesting mux state 0, usb-role 0, orientation 0
[  565.841235] state change SNK_HARD_RESET_SINK_OFF -> SNK_UNATTACHED
[  565.842167] CC1: 3 -> 3, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  565.842188] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT
[  565.842221] state change SNK_ATTACH_WAIT -> PORT_RESET
[  565.848450] Setting voltage/current limit 0 mV 0 mA
[  565.848475] polarity 0
[  565.850847] Requesting mux state 0, usb-role 0, orientation 0
[  565.851570] cc:=0
[  565.852307] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms
[  565.855180] CC1: 3 -> 0, CC2: 0 -> 0 [state PORT_RESET, polarity 0, disconnected]
[  565.855214] state change PORT_RESET -> SNK_UNATTACHED
[  565.855253] Start DRP toggling
[  565.860451] CC1: 0 -> 3, CC2: 0 -> 0 [state DRP_TOGGLING, polarity 0, connected]
[  565.860480] state change DRP_TOGGLING -> SNK_ATTACH_WAIT
[  565.860520] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms
[  566.061736] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  566.061767] state change SNK_DEBOUNCED -> SNK_ATTACHED
[  566.061775] polarity 0
[  566.063833] Requesting mux state 1, usb-role 2, orientation 1
[  566.064551] state change SNK_ATTACHED -> SNK_STARTUP
[  566.064570] state change SNK_STARTUP -> SNK_DISCOVERY
[  566.064581] Setting voltage/current limit 5000 mV 0 mA
[  566.064590] vbus=0 charge:=1
[  566.065949] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES
[  566.066641] pending state change SNK_WAIT_CAPABILITIES -> SOFT_RESET_SEND @ 240 ms
[  566.309824] state change SNK_WAIT_CAPABILITIES -> SOFT_RESET_SEND [delayed 240 ms]
[  566.309854] PD TX, header: 0x8d
[  566.319938] PD TX complete, status: 2
[  566.320007] state change SOFT_RESET_SEND -> HARD_RESET_SEND
[  566.320019] PD TX, type: 0x5
[  566.324321] PD TX complete, status: 0
[  566.324430] state change HARD_RESET_SEND -> HARD_RESET_START
[  566.326885] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF
[  566.326909] vconn:=0
[  566.329797] vbus=0 charge:=0
[  566.335128] Requesting mux state 1, usb-role 2, orientation 1
[  566.336565] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms
[  566.342930] Setting voltage/current limit 0 mV 0 mA
[  566.342956] polarity 0
[  566.344941] Requesting mux state 0, usb-role 0, orientation 0
[  566.346586] state change SNK_HARD_RESET_SINK_OFF -> SNK_UNATTACHED
[  566.347405] CC1: 3 -> 3, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  566.347432] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT
[  566.347465] state change SNK_ATTACH_WAIT -> PORT_RESET
[  566.352157] Setting voltage/current limit 0 mV 0 mA
[  566.352182] polarity 0
[  566.354530] Requesting mux state 0, usb-role 0, orientation 0
[  566.355274] cc:=0
[  566.356035] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms
[  566.359164] CC1: 3 -> 0, CC2: 0 -> 0 [state PORT_RESET, polarity 0, disconnected]
[  566.359198] state change PORT_RESET -> SNK_UNATTACHED
[  566.359240] Start DRP toggling
[  566.364575] CC1: 0 -> 3, CC2: 0 -> 0 [state DRP_TOGGLING, polarity 0, connected]
[  566.364607] state change DRP_TOGGLING -> SNK_ATTACH_WAIT
[  566.364646] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms
[  566.565769] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  566.565797] state change SNK_DEBOUNCED -> SNK_ATTACHED
[  566.565806] polarity 0
[  566.568370] Requesting mux state 1, usb-role 2, orientation 1
[  566.569046] state change SNK_ATTACHED -> SNK_STARTUP
[  566.569064] state change SNK_STARTUP -> SNK_DISCOVERY
[  566.569074] Setting voltage/current limit 5000 mV 0 mA
[  566.569083] vbus=0 charge:=1
[  566.570939] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES
[  566.571660] pending state change SNK_WAIT_CAPABILITIES -> SOFT_RESET_SEND @ 240 ms
[  566.813804] state change SNK_WAIT_CAPABILITIES -> SOFT_RESET_SEND [delayed 240 ms]
[  566.813834] PD TX, header: 0x8d
[  566.824392] PD TX complete, status: 2
[  566.824461] state change SOFT_RESET_SEND -> SNK_UNATTACHED
[  566.827325] Setting voltage/current limit 0 mV 0 mA
[  566.827349] polarity 0
[  566.829479] Requesting mux state 0, usb-role 0, orientation 0
[  566.830186] Start DRP toggling
[  566.834009] state change SNK_UNATTACHED -> DRP_TOGGLING
[  566.837862] CC1: 3 -> 3, CC2: 0 -> 0 [state DRP_TOGGLING, polarity 0, connected]
[  566.837895] state change DRP_TOGGLING -> SNK_ATTACH_WAIT
[  566.837936] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms
[  567.041827] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  567.041856] state change SNK_DEBOUNCED -> SNK_ATTACHED
[  567.041865] polarity 0
[  567.043932] Requesting mux state 1, usb-role 2, orientation 1
[  567.045164] state change SNK_ATTACHED -> SNK_STARTUP
[  567.045187] state change SNK_STARTUP -> SNK_DISCOVERY
[  567.045199] Setting voltage/current limit 5000 mV 0 mA
[  567.045208] vbus=0 charge:=1
[  567.046615] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES
[  567.047289] pending state change SNK_WAIT_CAPABILITIES -> SNK_READY @ 240 ms
[  567.289820] state change SNK_WAIT_CAPABILITIES -> SNK_READY [delayed 240 ms]



=============================================================================
Now the log from the new Kernel 5.15.74:
USB-PD Init:
------------

[  256.784494] Setting usb_comm capable false
[  256.791647] Setting voltage/current limit 0 mV 0 mA
[  256.794207] polarity 0
[  256.809727] Requesting mux state 0, usb-role 0, orientation 0
[  256.837483] state change INVALID_STATE -> SNK_UNATTACHED [rev1 NONE_AMS]
[  256.846618] CC1: 0 -> 0, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, disconnected]
[  256.846836] Setting usb_comm capable false
[  256.846766] 3-0050: registered
[  256.856301] Setting voltage/current limit 0 mV 0 mA
[  256.857922] polarity 0
[  256.865372] Requesting mux state 0, usb-role 0, orientation 0
[  256.872658] cc:=0
[  256.875081] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev1 NONE_AMS]
[  256.876241] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[  256.876283] state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED [rev1 NONE_AMS]
[  256.876306] Start toggling
[  256.893542] CC1: 0 -> 0, CC2: 0 -> 0 [state TOGGLING, polarity 0, disconnected]


USB-A to USB-C Cable attach event:
----------------------------------

[  446.745172] IPv6: ADDRCONF(NETDEV_CHANGE): usb1: link becomes ready
[  446.347606] VBUS on
[  446.359827] VBUS on
[  446.365643] VBUS on
[  446.443772] CC1: 0 -> 3, CC2: 0 -> 0 [state TOGGLING, polarity 0, connected]
[  446.443853] state change TOGGLING -> SNK_ATTACH_WAIT [rev1 NONE_AMS]
[  446.443975] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms [rev1 NONE_AMS]
[  446.647478] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  446.647634] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev1 NONE_AMS]
[  446.647687] polarity 0
[  446.660017] Requesting mux state 1, usb-role 2, orientation 1
[  446.665130] state change SNK_ATTACHED -> SNK_STARTUP [rev1 NONE_AMS]
[  446.665218] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  446.665635] Setting voltage/current limit 5000 mV 0 mA
[  446.665810] vbus=0 charge:=1
[  446.670562] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  446.672741] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  446.983091] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND [delayed 310 ms]
[  446.983189] AMS HARD_RESET start
[  446.983210] PD TX, type: 0x5
[  446.992857] PD TX complete, status: 0
[  446.994940] state change HARD_RESET_SEND -> HARD_RESET_START [rev3 HARD_RESET]
[  447.007365] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  447.007412] vconn:=0
[  447.008918] Requesting mux state 1, usb-role 2, orientation 1
[  447.014308] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  447.664993] state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON [delayed 650 ms]
[  447.665082] AMS HARD_RESET finished
[  447.671853] state change SNK_HARD_RESET_SINK_ON -> SNK_STARTUP [rev3 NONE_AMS]
[  447.671932] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  447.671987] Setting voltage/current limit 5000 mV 0 mA
[  447.672176] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  447.674498] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  447.985276] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND [delayed 310 ms]
[  447.985359] AMS HARD_RESET start
[  447.985406] PD TX, type: 0x5
[  448.010616] PD TX complete, status: 0
[  448.011377] state change HARD_RESET_SEND -> HARD_RESET_START [rev3 HARD_RESET]
[  448.031719] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  448.031797] vconn:=0
[  448.034634] Requesting mux state 1, usb-role 2, orientation 1
[  448.044759] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  448.695410] state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON [delayed 650 ms]
[  448.695503] AMS HARD_RESET finished
[  448.702988] state change SNK_HARD_RESET_SINK_ON -> SNK_STARTUP [rev3 NONE_AMS]
[  448.703071] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  448.703123] Setting voltage/current limit 5000 mV 0 mA
[  448.703257] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  448.705602] pending state change SNK_WAIT_CAPABILITIES -> SNK_READY @ 310 ms [rev3 NONE_AMS]
[  449.016365] state change SNK_WAIT_CAPABILITIES -> SNK_READY [delayed 310 ms]

### ISR is blocking the system at this point. Only after detaching the cable was I able to read the log

[  463.230666] CC1: 3 -> 0, CC2: 0 -> 0 [state SNK_READY, polarity 0, disconnected]
[  463.230768] state change SNK_READY -> SNK_UNATTACHED [rev3 NONE_AMS]
[  463.292143] Start toggling
[  463.352318] CC1: 0 -> 0, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, disconnected]
[  463.353156] Setting usb_comm capable false
[  463.368588] Setting voltage/current limit 0 mV 0 mA
[  463.368710] polarity 0
[  463.381744] Requesting mux state 0, usb-role 0, orientation 0
[  463.390057] cc:=0
[  463.395516] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS]
[  463.395680] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[  463.395733] state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  463.395786] Start toggling
[  463.412692] CC1: 0 -> 0, CC2: 0 -> 0 [state TOGGLING, polarity 0, disconnected]
[  463.418218] CC1: 0 -> 0, CC2: 0 -> 0 [state TOGGLING, polarity 0, disconnected]


USB-PD capable power supply attach event:
-----------------------------------------

[  826.768426] CC1: 0 -> 5, CC2: 0 -> 0 [state TOGGLING, polarity 0, connected]
[  826.768509] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 HARD_RESET]
[  826.768627] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms [rev3 HARD_RESET]
[  826.893156] VBUS on
[  826.904557] VBUS on
[  826.910508] VBUS on
[  826.971690] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  826.971726] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev3 HARD_RESET]
[  826.971741] polarity 0
[  826.980352] Requesting mux state 1, usb-role 2, orientation 1
[  826.981887] state change SNK_ATTACHED -> SNK_STARTUP [rev3 HARD_RESET]
[  826.981917] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 HARD_RESET]
[  826.981935] Setting voltage/current limit 5000 mV 3000 mA
[  826.982003] vbus=0 charge:=1
[  826.984458] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 HARD_RESET]
[  826.985671] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 HARD_RESET]
[  827.108627] PD RX, header: 0x61a1 [1]
[  827.108711]  PDO 0: type 0, 5000 mV, 3000 mA [DE]
[  827.108760]  PDO 1: type 0, 9000 mV, 3000 mA []
[  827.108801]  PDO 2: type 0, 12000 mV, 3000 mA []
[  827.108841]  PDO 3: type 0, 15000 mV, 3000 mA []
[  827.108881]  PDO 4: type 0, 18900 mV, 3000 mA []
[  827.108921]  PDO 5: type 0, 20000 mV, 3000 mA []
[  827.108957] state change SNK_WAIT_CAPABILITIES -> SNK_NEGOTIATE_CAPABILITIES [rev3 POWER_NEGOTIATION]
[  827.109079] Setting usb_comm capable false
[  827.109216] cc=0 cc1=5 cc2=0 vbus=0 vconn=sink polarity=0
[  827.109263] Requesting PDO 5: 20000 mV, 3000 mA
[  827.109298] PD TX, header: 0x1082
[  827.159596] Setting usb_comm capable false
[  827.169005] Setting voltage/current limit 0 mV 0 mA
[  827.169099] polarity 0
[  827.182015] Requesting mux state 0, usb-role 0, orientation 0
[  827.192980] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_UNATTACHED [rev3 NONE_AMS]
[  827.198398] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  827.198464] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  827.198499] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  827.198540] PD TX complete, status: 2
[  827.198852] state change PORT_RESET -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  827.201434] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  827.201597] Received hard reset
[  827.201625] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  827.209157] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  827.209224] vconn:=0
[  827.212481] Requesting mux state 1, usb-role 2, orientation 1
[  827.215281] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  827.868854] state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON [delayed 650 ms]
[  827.868923] AMS HARD_RESET finished
[  827.871858] state change SNK_HARD_RESET_SINK_ON -> SNK_STARTUP [rev3 NONE_AMS]
[  827.871918] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  827.871956] pending state change SNK_DISCOVERY -> HARD_RESET_SEND @ 10000 ms [rev3 NONE_AMS]
[  827.961711] VBUS on
[  827.961769] state change SNK_DISCOVERY -> SNK_DISCOVERY [rev3 NONE_AMS]
[  827.961898] Setting voltage/current limit 5000 mV 3000 mA
[  827.962048] vbus=0 charge:=1
[  827.972701] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  827.975008] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  827.983446] VBUS on
[  827.986223] VBUS on
[  827.997210] VBUS on
[  828.175355] PD RX, header: 0x61a1 [0]
[  828.181699] Received hard reset
[  828.181749] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  828.202553] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  828.202621] vconn:=0
[  828.205308] Requesting mux state 1, usb-role 2, orientation 1
[  828.214671] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  828.229807] Setting usb_comm capable false
[  828.239381] Setting voltage/current limit 0 mV 0 mA
[  828.239534] polarity 0
[  828.252334] Requesting mux state 0, usb-role 0, orientation 0
[  828.263656] state change SNK_HARD_RESET_SINK_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  828.269095] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  828.269159] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  828.269218] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  828.269522] Setting usb_comm capable false
[  828.279409] Setting voltage/current limit 0 mV 0 mA
[  828.279506] polarity 0
[  828.292304] Requesting mux state 0, usb-role 0, orientation 0
[  828.300793] cc:=0
[  828.305888] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS]
[  828.306038] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[  828.306079] state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  828.306117] Start toggling
[  828.310980] state change SNK_UNATTACHED -> TOGGLING [rev3 NONE_AMS]
[  828.322643] CC1: 5 -> 5, CC2: 0 -> 0 [state TOGGLING, polarity 0, connected]
[  828.322713] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  828.322837] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms [rev3 NONE_AMS]
[  828.526334] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  829.027912] VBUS on
[  829.027969] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev3 NONE_AMS]
[  829.028081] polarity 0
[  829.052206] Requesting mux state 1, usb-role 2, orientation 1
[  829.055175] state change SNK_ATTACHED -> SNK_STARTUP [rev3 NONE_AMS]
[  829.055233] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  829.055273] Setting voltage/current limit 5000 mV 3000 mA
[  829.055419] vbus=0 charge:=1
[  829.059645] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  829.062077] pending state change SNK_WAIT_CAPABILITIES -> SNK_READY @ 310 ms [rev3 NONE_AMS]
[  829.064903] VBUS on
[  829.241900] PD RX, header: 0x61a1 [1]
[  829.241980]  PDO 0: type 0, 5000 mV, 3000 mA [DE]
[  829.242025]  PDO 1: type 0, 9000 mV, 3000 mA []
[  829.242066]  PDO 2: type 0, 12000 mV, 3000 mA []
[  829.242107]  PDO 3: type 0, 15000 mV, 3000 mA []
[  829.242147]  PDO 4: type 0, 18900 mV, 3000 mA []
[  829.242187]  PDO 5: type 0, 20000 mV, 3000 mA []
[  829.242223] state change SNK_WAIT_CAPABILITIES -> SNK_NEGOTIATE_CAPABILITIES [rev3 POWER_NEGOTIATION]
[  829.242346] Setting usb_comm capable false
[  829.242487] cc=0 cc1=5 cc2=0 vbus=0 vconn=sink polarity=0
[  829.242531] Requesting PDO 5: 20000 mV, 3000 mA
[  829.242567] PD TX, header: 0x1082
[  829.293636] Setting usb_comm capable false
[  829.303004] Setting voltage/current limit 0 mV 0 mA
[  829.303099] polarity 0
[  829.315711] Requesting mux state 0, usb-role 0, orientation 0
[  829.326763] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_UNATTACHED [rev3 NONE_AMS]
[  829.332550] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  829.332619] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  829.332654] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  829.332692] PD TX complete, status: 2
[  829.333002] state change PORT_RESET -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  829.335248] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  829.335405] Received hard reset
[  829.335433] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  829.343489] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  829.343548] vconn:=0
[  829.346261] Requesting mux state 1, usb-role 2, orientation 1
[  829.349054] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  830.002616] state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON [delayed 650 ms]
[  830.002685] AMS HARD_RESET finished
[  830.005098] state change SNK_HARD_RESET_SINK_ON -> SNK_STARTUP [rev3 NONE_AMS]
[  830.005156] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  830.005197] pending state change SNK_DISCOVERY -> HARD_RESET_SEND @ 10000 ms [rev3 NONE_AMS]
[  830.092822] VBUS on
[  830.092880] state change SNK_DISCOVERY -> SNK_DISCOVERY [rev3 NONE_AMS]
[  830.093011] Setting voltage/current limit 5000 mV 3000 mA
[  830.093162] vbus=0 charge:=1
[  830.103484] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  830.105769] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  830.114579] VBUS on
[  830.117251] VBUS on
[  830.128552] VBUS on
[  830.308729] PD RX, header: 0x61a1 [0]
[  830.315066] Received hard reset
[  830.315115] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  830.335975] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  830.336043] vconn:=0
[  830.338846] Requesting mux state 1, usb-role 2, orientation 1
[  830.348224] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  830.363848] Setting usb_comm capable false
[  830.373342] Setting voltage/current limit 0 mV 0 mA
[  830.373492] polarity 0
[  830.386127] Requesting mux state 0, usb-role 0, orientation 0
[  830.397083] state change SNK_HARD_RESET_SINK_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  830.402808] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  830.402878] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  830.402936] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  830.403243] Setting usb_comm capable false
[  830.412686] Setting voltage/current limit 0 mV 0 mA
[  830.412787] polarity 0
[  830.425143] Requesting mux state 0, usb-role 0, orientation 0
[  830.433883] cc:=0
[  830.438861] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS]
[  830.439010] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[  830.439050] state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  830.439087] Start toggling
[  830.444098] state change SNK_UNATTACHED -> TOGGLING [rev3 NONE_AMS]
[  830.455846] CC1: 5 -> 5, CC2: 0 -> 0 [state TOGGLING, polarity 0, connected]
[  830.455917] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  830.456045] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms [rev3 NONE_AMS]
[  830.659546] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  831.160863] VBUS on
[  831.160920] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev3 NONE_AMS]
[  831.161028] polarity 0
[  831.185034] Requesting mux state 1, usb-role 2, orientation 1
[  831.188004] state change SNK_ATTACHED -> SNK_STARTUP [rev3 NONE_AMS]
[  831.188062] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  831.188102] Setting voltage/current limit 5000 mV 3000 mA
[  831.188250] vbus=0 charge:=1
[  831.192929] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  831.195063] pending state change SNK_WAIT_CAPABILITIES -> SNK_READY @ 310 ms [rev3 NONE_AMS]
[  831.197744] VBUS on
[  831.374580] PD RX, header: 0x61a1 [1]
[  831.374660]  PDO 0: type 0, 5000 mV, 3000 mA [DE]
[  831.374707]  PDO 1: type 0, 9000 mV, 3000 mA []
[  831.374748]  PDO 2: type 0, 12000 mV, 3000 mA []
[  831.374790]  PDO 3: type 0, 15000 mV, 3000 mA []
[  831.374830]  PDO 4: type 0, 18900 mV, 3000 mA []
[  831.374870]  PDO 5: type 0, 20000 mV, 3000 mA []
[  831.374906] state change SNK_WAIT_CAPABILITIES -> SNK_NEGOTIATE_CAPABILITIES [rev3 POWER_NEGOTIATION]
[  831.375032] Setting usb_comm capable false
[  831.375177] cc=0 cc1=5 cc2=0 vbus=0 vconn=sink polarity=0
[  831.375221] Requesting PDO 5: 20000 mV, 3000 mA
[  831.375258] PD TX, header: 0x1082
[  831.426768] Setting usb_comm capable false
[  831.436181] Setting voltage/current limit 0 mV 0 mA
[  831.436279] polarity 0
[  831.448776] Requesting mux state 0, usb-role 0, orientation 0
[  831.459690] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_UNATTACHED [rev3 NONE_AMS]
[  831.465398] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  831.465468] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  831.465503] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  831.465541] PD TX complete, status: 2
[  831.465853] state change PORT_RESET -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  831.468123] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  831.468279] Received hard reset
[  831.468308] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  831.476495] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  831.476558] vconn:=0
[  831.479360] Requesting mux state 1, usb-role 2, orientation 1
[  831.482403] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  832.135981] state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON [delayed 650 ms]
[  832.136053] AMS HARD_RESET finished
[  832.138377] state change SNK_HARD_RESET_SINK_ON -> SNK_STARTUP [rev3 NONE_AMS]
[  832.138433] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  832.138472] pending state change SNK_DISCOVERY -> HARD_RESET_SEND @ 10000 ms [rev3 NONE_AMS]
[  832.228209] VBUS on
[  832.228265] state change SNK_DISCOVERY -> SNK_DISCOVERY [rev3 NONE_AMS]
[  832.228395] Setting voltage/current limit 5000 mV 3000 mA
[  832.228544] vbus=0 charge:=1
[  832.239282] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  832.241912] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  832.250466] VBUS on
[  832.253173] VBUS on
[  832.264235] VBUS on
[  832.442716] PD RX, header: 0x61a1 [0]
[  832.448663] Received hard reset
[  832.448708] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  832.469385] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  832.469449] vconn:=0
[  832.472224] Requesting mux state 1, usb-role 2, orientation 1
[  832.481771] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  832.496945] Setting usb_comm capable false
[  832.506399] Setting voltage/current limit 0 mV 0 mA
[  832.506554] polarity 0
[  832.519367] Requesting mux state 0, usb-role 0, orientation 0
[  832.530881] state change SNK_HARD_RESET_SINK_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  832.536387] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  832.536452] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  832.536510] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  832.536812] Setting usb_comm capable false
[  832.546428] Setting voltage/current limit 0 mV 0 mA
[  832.546527] polarity 0
[  832.559025] Requesting mux state 0, usb-role 0, orientation 0
[  832.567562] cc:=0
[  832.572992] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS]
[  832.573138] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[  832.573179] state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  832.573219] Start toggling
[  832.577847] state change SNK_UNATTACHED -> TOGGLING [rev3 NONE_AMS]
[  832.589556] CC1: 5 -> 5, CC2: 0 -> 0 [state TOGGLING, polarity 0, connected]
[  832.589625] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  832.589754] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms [rev3 NONE_AMS]
[  832.793127] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  833.292447] VBUS on
[  833.292505] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev3 NONE_AMS]
[  833.292615] polarity 0
[  833.316496] Requesting mux state 1, usb-role 2, orientation 1
[  833.319533] state change SNK_ATTACHED -> SNK_STARTUP [rev3 NONE_AMS]
[  833.319592] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  833.319630] Setting voltage/current limit 5000 mV 3000 mA
[  833.319781] vbus=0 charge:=1
[  833.324316] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  833.326456] pending state change SNK_WAIT_CAPABILITIES -> SNK_READY @ 310 ms [rev3 NONE_AMS]
[  833.329106] VBUS on
[  833.508682] PD RX, header: 0x61a1 [1]
[  833.508766]  PDO 0: type 0, 5000 mV, 3000 mA [DE]
[  833.508813]  PDO 1: type 0, 9000 mV, 3000 mA []
[  833.508855]  PDO 2: type 0, 12000 mV, 3000 mA []
[  833.508895]  PDO 3: type 0, 15000 mV, 3000 mA []
[  833.508935]  PDO 4: type 0, 18900 mV, 3000 mA []
[  833.508975]  PDO 5: type 0, 20000 mV, 3000 mA []
[  833.509011] state change SNK_WAIT_CAPABILITIES -> SNK_NEGOTIATE_CAPABILITIES [rev3 POWER_NEGOTIATION]
[  833.509133] Setting usb_comm capable false
[  833.509274] cc=0 cc1=5 cc2=0 vbus=0 vconn=sink polarity=0
[  833.509319] Requesting PDO 5: 20000 mV, 3000 mA
[  833.509356] PD TX, header: 0x1082
[  833.559278] Setting usb_comm capable false
[  833.568621] Setting voltage/current limit 0 mV 0 mA
[  833.568715] polarity 0
[  833.581360] Requesting mux state 0, usb-role 0, orientation 0
[  833.592425] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_UNATTACHED [rev3 NONE_AMS]
[  833.597768] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  833.597832] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  833.597866] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  833.597907] PD TX complete, status: 2
[  833.598219] state change PORT_RESET -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  833.600853] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  833.601013] Received hard reset
[  833.601042] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  833.608667] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  833.608724] vconn:=0
[  833.611758] Requesting mux state 1, usb-role 2, orientation 1
[  833.614525] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  834.268087] state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON [delayed 650 ms]
[  834.268158] AMS HARD_RESET finished
[  834.270888] state change SNK_HARD_RESET_SINK_ON -> SNK_STARTUP [rev3 NONE_AMS]
[  834.270942] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  834.270978] pending state change SNK_DISCOVERY -> HARD_RESET_SEND @ 10000 ms [rev3 NONE_AMS]
[  834.361893] VBUS on
[  834.361950] state change SNK_DISCOVERY -> SNK_DISCOVERY [rev3 NONE_AMS]
[  834.362079] Setting voltage/current limit 5000 mV 3000 mA
[  834.362232] vbus=0 charge:=1
[  834.373148] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  834.375423] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  834.383993] VBUS on
[  834.386675] VBUS on
[  834.397691] VBUS on
[  834.576163] PD RX, header: 0x61a1 [0]
[  834.582359] Received hard reset
[  834.582406] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  834.602442] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  834.602503] vconn:=0
[  834.605196] Requesting mux state 1, usb-role 2, orientation 1
[  834.614511] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  834.629493] Setting usb_comm capable false
[  834.638823] Setting voltage/current limit 0 mV 0 mA
[  834.638994] polarity 0
[  834.651863] Requesting mux state 0, usb-role 0, orientation 0
[  834.662953] state change SNK_HARD_RESET_SINK_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  834.668385] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  834.668462] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  834.668523] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  834.668852] Setting usb_comm capable false
[  834.678503] Setting voltage/current limit 0 mV 0 mA
[  834.678600] polarity 0
[  834.691321] Requesting mux state 0, usb-role 0, orientation 0
[  834.699426] cc:=0
[  834.704750] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS]
[  834.704893] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[  834.704933] state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  834.704972] Start toggling
[  834.709557] state change SNK_UNATTACHED -> TOGGLING [rev3 NONE_AMS]
[  834.721353] CC1: 5 -> 5, CC2: 0 -> 0 [state TOGGLING, polarity 0, connected]
[  834.721424] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  834.721553] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms [rev3 NONE_AMS]
[  834.925070] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  835.428159] VBUS on
[  835.428217] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev3 NONE_AMS]
[  835.428345] polarity 0
[  835.452702] Requesting mux state 1, usb-role 2, orientation 1
[  835.455663] state change SNK_ATTACHED -> SNK_STARTUP [rev3 NONE_AMS]
[  835.455720] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  835.455759] Setting voltage/current limit 5000 mV 3000 mA
[  835.455910] vbus=0 charge:=1
[  835.460564] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  835.462704] pending state change SNK_WAIT_CAPABILITIES -> SNK_READY @ 310 ms [rev3 NONE_AMS]
[  835.465371] VBUS on
[  835.642076] PD RX, header: 0x61a1 [1]
[  835.642159]  PDO 0: type 0, 5000 mV, 3000 mA [DE]
[  835.642205]  PDO 1: type 0, 9000 mV, 3000 mA []
[  835.642247]  PDO 2: type 0, 12000 mV, 3000 mA []
[  835.642287]  PDO 3: type 0, 15000 mV, 3000 mA []
[  835.642328]  PDO 4: type 0, 18900 mV, 3000 mA []
[  835.642368]  PDO 5: type 0, 20000 mV, 3000 mA []
[  835.642405] state change SNK_WAIT_CAPABILITIES -> SNK_NEGOTIATE_CAPABILITIES [rev3 POWER_NEGOTIATION]
[  835.642528] Setting usb_comm capable false
[  835.642671] cc=0 cc1=5 cc2=0 vbus=0 vconn=sink polarity=0
[  835.642716] Requesting PDO 5: 20000 mV, 3000 mA
[  835.642751] PD TX, header: 0x1082
[  835.693384] Setting usb_comm capable false
[  835.702717] Setting voltage/current limit 0 mV 0 mA
[  835.702814] polarity 0
[  835.715221] Requesting mux state 0, usb-role 0, orientation 0
[  835.726392] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_UNATTACHED [rev3 NONE_AMS]
[  835.732286] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  835.732362] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  835.732403] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  835.732449] PD TX complete, status: 2
[  835.732791] state change PORT_RESET -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  835.735053] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  835.735209] Received hard reset
[  835.735237] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  835.743140] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  835.743198] vconn:=0
[  835.745877] Requesting mux state 1, usb-role 2, orientation 1
[  835.748830] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  836.402423] state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON [delayed 650 ms]
[  836.402492] AMS HARD_RESET finished
[  836.404809] state change SNK_HARD_RESET_SINK_ON -> SNK_STARTUP [rev3 NONE_AMS]
[  836.404861] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  836.404899] pending state change SNK_DISCOVERY -> HARD_RESET_SEND @ 10000 ms [rev3 NONE_AMS]
[  836.492168] VBUS on
[  836.492229] state change SNK_DISCOVERY -> SNK_DISCOVERY [rev3 NONE_AMS]
[  836.492376] Setting voltage/current limit 5000 mV 3000 mA
[  836.492535] vbus=0 charge:=1
[  836.503274] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  836.505544] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  836.514069] VBUS on
[  836.516750] VBUS on
[  836.527817] VBUS on
[  836.707649] PD RX, header: 0x61a1 [0]
[  836.713553] Received hard reset
[  836.713599] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  836.733083] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  836.733145] vconn:=0
[  836.735857] Requesting mux state 1, usb-role 2, orientation 1
[  836.744888] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  836.760542] Setting usb_comm capable false
[  836.769399] Setting voltage/current limit 0 mV 0 mA
[  836.769563] polarity 0
[  836.782089] Requesting mux state 0, usb-role 0, orientation 0
[  836.792748] state change SNK_HARD_RESET_SINK_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  836.798194] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  836.798260] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  836.798318] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  836.798617] Setting usb_comm capable false
[  836.807762] Setting voltage/current limit 0 mV 0 mA
[  836.807855] polarity 0
[  836.819915] Requesting mux state 0, usb-role 0, orientation 0
[  836.828230] cc:=0
[  836.833634] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS]
[  836.833789] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[  836.833829] state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  836.833868] Start toggling
[  836.838410] state change SNK_UNATTACHED -> TOGGLING [rev3 NONE_AMS]
[  836.849857] CC1: 5 -> 5, CC2: 0 -> 0 [state TOGGLING, polarity 0, connected]
[  836.849929] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  836.850061] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms [rev3 NONE_AMS]
[  837.053117] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  837.561556] VBUS on
[  837.561614] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev3 NONE_AMS]
[  837.561721] polarity 0
[  837.585787] Requesting mux state 1, usb-role 2, orientation 1
[  837.588793] state change SNK_ATTACHED -> SNK_STARTUP [rev3 NONE_AMS]
[  837.588852] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  837.588891] Setting voltage/current limit 5000 mV 3000 mA
[  837.589041] vbus=0 charge:=1
[  837.593658] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  837.595772] pending state change SNK_WAIT_CAPABILITIES -> SNK_READY @ 310 ms [rev3 NONE_AMS]
[  837.598462] VBUS on
[  837.776218] PD RX, header: 0x61a1 [1]
[  837.776298]  PDO 0: type 0, 5000 mV, 3000 mA [DE]
[  837.776345]  PDO 1: type 0, 9000 mV, 3000 mA []
[  837.776387]  PDO 2: type 0, 12000 mV, 3000 mA []
[  837.776428]  PDO 3: type 0, 15000 mV, 3000 mA []
[  837.776468]  PDO 4: type 0, 18900 mV, 3000 mA []
[  837.776508]  PDO 5: type 0, 20000 mV, 3000 mA []
[  837.776543] state change SNK_WAIT_CAPABILITIES -> SNK_NEGOTIATE_CAPABILITIES [rev3 POWER_NEGOTIATION]
[  837.776665] Setting usb_comm capable false
[  837.776800] cc=0 cc1=5 cc2=0 vbus=0 vconn=sink polarity=0
[  837.776844] Requesting PDO 5: 20000 mV, 3000 mA
[  837.776879] PD TX, header: 0x1082
[  837.825886] Setting usb_comm capable false
[  837.835072] Setting voltage/current limit 0 mV 0 mA
[  837.835173] polarity 0
[  837.847308] Requesting mux state 0, usb-role 0, orientation 0
[  837.858190] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_UNATTACHED [rev3 NONE_AMS]
[  837.863918] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  837.863988] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  837.864023] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  837.864063] PD TX complete, status: 2
[  837.864374] state change PORT_RESET -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  837.866579] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  837.866735] Received hard reset
[  837.866764] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  837.874698] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  837.874766] vconn:=0
[  837.877384] Requesting mux state 1, usb-role 2, orientation 1
[  837.880541] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  838.533408] state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON [delayed 650 ms]
[  838.533476] AMS HARD_RESET finished
[  838.536041] state change SNK_HARD_RESET_SINK_ON -> SNK_STARTUP [rev3 NONE_AMS]
[  838.536096] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  838.536132] pending state change SNK_DISCOVERY -> HARD_RESET_SEND @ 10000 ms [rev3 NONE_AMS]
[  838.625719] VBUS on
[  838.625777] state change SNK_DISCOVERY -> SNK_DISCOVERY [rev3 NONE_AMS]
[  838.625909] Setting voltage/current limit 5000 mV 3000 mA
[  838.626117] vbus=0 charge:=1
[  838.636737] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  838.638997] pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms [rev3 NONE_AMS]
[  838.647388] VBUS on
[  838.650058] VBUS on
[  838.661358] VBUS on
[  838.841466] PD RX, header: 0x61a1 [0]
[  838.847267] Received hard reset
[  838.847310] state change SNK_WAIT_CAPABILITIES -> HARD_RESET_START [rev3 HARD_RESET]
[  838.867145] state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF [rev3 HARD_RESET]
[  838.867209] vconn:=0
[  838.869904] Requesting mux state 1, usb-role 2, orientation 1
[  838.879143] pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms [rev3 HARD_RESET]
[  838.894564] Setting usb_comm capable false
[  838.903822] Setting voltage/current limit 0 mV 0 mA
[  838.903978] polarity 0
[  838.916640] Requesting mux state 0, usb-role 0, orientation 0
[  838.927675] state change SNK_HARD_RESET_SINK_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  838.933416] CC1: 5 -> 5, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[  838.933486] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  838.933545] state change SNK_ATTACH_WAIT -> PORT_RESET [rev3 NONE_AMS]
[  838.933854] Setting usb_comm capable false
[  838.943491] Setting voltage/current limit 0 mV 0 mA
[  838.943597] polarity 0
[  838.956130] Requesting mux state 0, usb-role 0, orientation 0
[  838.964257] cc:=0
[  838.969176] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS]
[  838.969321] state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[  838.969361] state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED [rev3 NONE_AMS]
[  838.969399] Start toggling
[  838.974114] state change SNK_UNATTACHED -> TOGGLING [rev3 NONE_AMS]
[  838.985743] CC1: 5 -> 5, CC2: 0 -> 0 [state TOGGLING, polarity 0, connected]
[  838.985816] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS]
[  838.985953] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms [rev3 NONE_AMS]
[  839.189282] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[  839.695231] VBUS on
[  839.695287] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev3 NONE_AMS]
[  839.695395] polarity 0
[  839.719424] Requesting mux state 1, usb-role 2, orientation 1
[  839.722649] state change SNK_ATTACHED -> SNK_STARTUP [rev3 NONE_AMS]
[  839.722708] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS]
[  839.722747] Setting voltage/current limit 5000 mV 3000 mA
[  839.722899] vbus=0 charge:=1
[  839.727145] state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES [rev3 NONE_AMS]
[  839.729327] pending state change SNK_WAIT_CAPABILITIES -> SNK_READY @ 310 ms [rev3 NONE_AMS]
[  839.732221] VBUS on
[  839.894447] PD RX, header: 0x61a1 [1]
[  839.894486]  PDO 0: type 0, 5000 mV, 3000 mA [DE]
[  839.894509]  PDO 1: type 0, 9000 mV, 3000 mA []
[  839.894526]  PDO 2: type 0, 12000 mV, 3000 mA []
[  839.894542]  PDO 3: type 0, 15000 mV, 3000 mA []
[  839.894558]  PDO 4: type 0, 18900 mV, 3000 mA []
[  839.894573]  PDO 5: type 0, 20000 mV, 3000 mA []
[  839.894592] state change SNK_WAIT_CAPABILITIES -> SNK_NEGOTIATE_CAPABILITIES [rev3 POWER_NEGOTIATION]
[  839.894646] Setting usb_comm capable false
[  839.894750] cc=0 cc1=5 cc2=0 vbus=0 vconn=sink polarity=0
[  839.894772] Requesting PDO 5: 20000 mV, 3000 mA
[  839.894787] PD TX, header: 0x1082
[  839.905398] PD TX complete, status: 0
[  839.905668] pending state change SNK_NEGOTIATE_CAPABILITIES -> HARD_RESET_SEND @ 60 ms [rev3 POWER_NEGOTIATION]
[  839.914091] PD RX, header: 0x3a3 [1]
[  839.914126] state change SNK_NEGOTIATE_CAPABILITIES -> SNK_TRANSITION_SINK [rev3 POWER_NEGOTIATION]
[  839.914181] Setting standby current 5000 mV @ 500 mA
[  839.914195] Setting voltage/current limit 5000 mV 500 mA
[  839.914299] pending state change SNK_TRANSITION_SINK -> HARD_RESET_SEND @ 500 ms [rev3 POWER_NEGOTIATION]
[  840.189160] PD RX, header: 0x5a6 [1]
[  840.189224] Setting voltage/current limit 20000 mV 3000 mA
[  840.189362] state change SNK_TRANSITION_SINK -> SNK_READY [rev3 POWER_NEGOTIATION]
[  840.192758] AMS POWER_NEGOTIATION finished
[  840.193054] AMS DISCOVER_IDENTITY start
[  840.193140] PD TX, header: 0x128f
[  840.211568] PD TX complete, status: 0
[  840.234728] PD RX, header: 0x47af [1]
[  840.234788] Rx VDM cmd 0xff00a041 type 1 cmd 1 len 4
[  840.234871] AMS DISCOVER_IDENTITY finished
[  840.235846] Identity: 03f0:0000.f603
[  840.236012] AMS DISCOVER_SVIDS start
[  840.236097] PD TX, header: 0x148f
[  840.266351] PD TX complete, status: 0
[  840.266753] PD RX, header: 0x19af [1]
[  840.266799] Rx VDM cmd 0xff00a081 type 2 cmd 1 len 1
[  840.266881] AMS DISCOVER_SVIDS finished
[  840.293192] AMS GET_SINK_CAPABILITIES start
[  840.293222] state change SNK_READY -> AMS_START [rev3 GET_SINK_CAPABILITIES]
[  840.293262] state change AMS_START -> GET_SINK_CAP [rev3 GET_SINK_CAPABILITIES]
[  840.293279] PD TX, header: 0x688
[  840.301621] PD TX complete, status: 0
[  840.301892] pending state change GET_SINK_CAP -> GET_SINK_CAP_TIMEOUT @ 60 ms [rev3 GET_SINK_CAPABILITIES]
[  840.309127] PD RX, header: 0xbb0 [1]
[  840.309161] state change GET_SINK_CAP -> SNK_READY [rev3 GET_SINK_CAPABILITIES]
[  840.309226] AMS GET_SINK_CAPABILITIES finished

^ permalink raw reply	[flat|nested] 10+ messages in thread

* AW: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
  2022-10-25 12:37   ` Greg KH
  2022-10-25 12:48     ` AW: " Christian Bach
@ 2023-02-20 16:45     ` Christian Bach
  2023-02-20 18:54       ` Greg KH
  1 sibling, 1 reply; 10+ messages in thread
From: Christian Bach @ 2023-02-20 16:45 UTC (permalink / raw)
  To: Greg KH
  Cc: stable, regressions, linux, linux-usb,
	cy_huang(黃啟原)

Hello everyone

We finally found a solution to the problem we had with the PTN5110 Chip and the Kernel Module tcpci that manages this chip in 5.15.xx Kernel. NXP Patched their Kernel a while ago (https://source.codeaurora.org/external/imx/linux-imx/commit/drivers/usb/typec/tcpm/tcpci.c?h=lf-5.15.y&id=2a263f918b25725e0434afa9ff3b83b1bc18ef74) and we reimplemented the NXP patch for the Kernel 5.15.91. I attached my reworked patch below:

diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
index 5340a3a3a81b..0d715e091b78 100644
--- a/drivers/usb/typec/tcpm/tcpci.c
+++ b/drivers/usb/typec/tcpm/tcpci.c
@@ -628,6 +628,9 @@ static int tcpci_init(struct tcpc_dev *tcpc)
        if (ret < 0)
                return ret;

+       /* Clear fault condition */
+       regmap_write(tcpci->regmap, TCPC_FAULT_STATUS, 0x80);
+
        if (tcpci->controls_vbus)
                reg = TCPC_POWER_STATUS_VBUS_PRES;
        else
@@ -644,7 +647,8 @@ static int tcpci_init(struct tcpc_dev *tcpc)

        reg = TCPC_ALERT_TX_SUCCESS | TCPC_ALERT_TX_FAILED |
                TCPC_ALERT_TX_DISCARDED | TCPC_ALERT_RX_STATUS |
-               TCPC_ALERT_RX_HARD_RST | TCPC_ALERT_CC_STATUS;
+               TCPC_ALERT_RX_HARD_RST | TCPC_ALERT_CC_STATUS |
+               TCPC_ALERT_V_ALARM_LO | TCPC_ALERT_FAULT;
        if (tcpci->controls_vbus)
                reg |= TCPC_ALERT_POWER_STATUS;
        /* Enable VSAFE0V status interrupt when detecting VSAFE0V is supported */
@@ -728,6 +732,13 @@ irqreturn_t tcpci_irq(struct tcpci *tcpci)
                        tcpm_vbus_change(tcpci->port);
        }

+       /* Clear the fault status anyway */
+       if (status & TCPC_ALERT_FAULT) {
+               regmap_read(tcpci->regmap, TCPC_FAULT_STATUS, &raw);
+               regmap_write(tcpci->regmap, TCPC_FAULT_STATUS,
+                               raw | TCPC_FAULT_STATUS_MASK);
+       }
+
        if (status & TCPC_ALERT_RX_HARD_RST)
                tcpm_pd_hard_reset(tcpci->port);








^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: AW: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
  2023-02-20 16:45     ` Christian Bach
@ 2023-02-20 18:54       ` Greg KH
  2023-02-21 18:59         ` Guenter Roeck
  0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2023-02-20 18:54 UTC (permalink / raw)
  To: Christian Bach
  Cc: stable, regressions, linux, linux-usb,
	cy_huang(黃啟原)

On Mon, Feb 20, 2023 at 04:45:32PM +0000, Christian Bach wrote:
> Hello everyone
> 
> We finally found a solution to the problem we had with the PTN5110 Chip and the Kernel Module tcpci that manages this chip in 5.15.xx Kernel. NXP Patched their Kernel a while ago (https://source.codeaurora.org/external/imx/linux-imx/commit/drivers/usb/typec/tcpm/tcpci.c?h=lf-5.15.y&id=2a263f918b25725e0434afa9ff3b83b1bc18ef74) and we reimplemented the NXP patch for the Kernel 5.15.91. I attached my reworked patch below:
> 
> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
> index 5340a3a3a81b..0d715e091b78 100644
> --- a/drivers/usb/typec/tcpm/tcpci.c
> +++ b/drivers/usb/typec/tcpm/tcpci.c
> @@ -628,6 +628,9 @@ static int tcpci_init(struct tcpc_dev *tcpc)
>         if (ret < 0)
>                 return ret;
> 
> +       /* Clear fault condition */
> +       regmap_write(tcpci->regmap, TCPC_FAULT_STATUS, 0x80);
> +
>         if (tcpci->controls_vbus)
>                 reg = TCPC_POWER_STATUS_VBUS_PRES;
>         else
> @@ -644,7 +647,8 @@ static int tcpci_init(struct tcpc_dev *tcpc)
> 
>         reg = TCPC_ALERT_TX_SUCCESS | TCPC_ALERT_TX_FAILED |
>                 TCPC_ALERT_TX_DISCARDED | TCPC_ALERT_RX_STATUS |
> -               TCPC_ALERT_RX_HARD_RST | TCPC_ALERT_CC_STATUS;
> +               TCPC_ALERT_RX_HARD_RST | TCPC_ALERT_CC_STATUS |
> +               TCPC_ALERT_V_ALARM_LO | TCPC_ALERT_FAULT;
>         if (tcpci->controls_vbus)
>                 reg |= TCPC_ALERT_POWER_STATUS;
>         /* Enable VSAFE0V status interrupt when detecting VSAFE0V is supported */
> @@ -728,6 +732,13 @@ irqreturn_t tcpci_irq(struct tcpci *tcpci)
>                         tcpm_vbus_change(tcpci->port);
>         }
> 
> +       /* Clear the fault status anyway */
> +       if (status & TCPC_ALERT_FAULT) {
> +               regmap_read(tcpci->regmap, TCPC_FAULT_STATUS, &raw);
> +               regmap_write(tcpci->regmap, TCPC_FAULT_STATUS,
> +                               raw | TCPC_FAULT_STATUS_MASK);
> +       }
> +
>         if (status & TCPC_ALERT_RX_HARD_RST)
>                 tcpm_pd_hard_reset(tcpci->port);
> 
> 
> 
> 
> 
> 
> 

Can you submit this as a real fix so that we can apply it properly?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: AW: tcpci module in Kernel 5.15.74 with PTN5110 not working correctly
  2023-02-20 18:54       ` Greg KH
@ 2023-02-21 18:59         ` Guenter Roeck
  0 siblings, 0 replies; 10+ messages in thread
From: Guenter Roeck @ 2023-02-21 18:59 UTC (permalink / raw)
  To: Greg KH, Christian Bach
  Cc: stable, regressions, linux-usb, cy_huang(黃啟原)

On 2/20/23 10:54, Greg KH wrote:
> On Mon, Feb 20, 2023 at 04:45:32PM +0000, Christian Bach wrote:
>> Hello everyone
>>
>> We finally found a solution to the problem we had with the PTN5110 Chip and the Kernel Module tcpci that manages this chip in 5.15.xx Kernel. NXP Patched their Kernel a while ago (https://source.codeaurora.org/external/imx/linux-imx/commit/drivers/usb/typec/tcpm/tcpci.c?h=lf-5.15.y&id=2a263f918b25725e0434afa9ff3b83b1bc18ef74) and we reimplemented the NXP patch for the Kernel 5.15.91. I attached my reworked patch below:
>>
>> diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
>> index 5340a3a3a81b..0d715e091b78 100644
>> --- a/drivers/usb/typec/tcpm/tcpci.c
>> +++ b/drivers/usb/typec/tcpm/tcpci.c
>> @@ -628,6 +628,9 @@ static int tcpci_init(struct tcpc_dev *tcpc)
>>          if (ret < 0)
>>                  return ret;
>>
>> +       /* Clear fault condition */
>> +       regmap_write(tcpci->regmap, TCPC_FAULT_STATUS, 0x80);
>> +

This should probably clear all fault bits. Also, the specification
suggests to clear the fault bits prior to clearing fault alert event.

>>          if (tcpci->controls_vbus)
>>                  reg = TCPC_POWER_STATUS_VBUS_PRES;
>>          else
>> @@ -644,7 +647,8 @@ static int tcpci_init(struct tcpc_dev *tcpc)
>>
>>          reg = TCPC_ALERT_TX_SUCCESS | TCPC_ALERT_TX_FAILED |
>>                  TCPC_ALERT_TX_DISCARDED | TCPC_ALERT_RX_STATUS |
>> -               TCPC_ALERT_RX_HARD_RST | TCPC_ALERT_CC_STATUS;
>> +               TCPC_ALERT_RX_HARD_RST | TCPC_ALERT_CC_STATUS |
>> +               TCPC_ALERT_V_ALARM_LO | TCPC_ALERT_FAULT;
>>          if (tcpci->controls_vbus)
>>                  reg |= TCPC_ALERT_POWER_STATUS;
>>          /* Enable VSAFE0V status interrupt when detecting VSAFE0V is supported */
>> @@ -728,6 +732,13 @@ irqreturn_t tcpci_irq(struct tcpci *tcpci)
>>                          tcpm_vbus_change(tcpci->port);
>>          }
>>
>> +       /* Clear the fault status anyway */
>> +       if (status & TCPC_ALERT_FAULT) {
>> +               regmap_read(tcpci->regmap, TCPC_FAULT_STATUS, &raw);
>> +               regmap_write(tcpci->regmap, TCPC_FAULT_STATUS,
>> +                               raw | TCPC_FAULT_STATUS_MASK);

TCPC_FAULT_STATUS_MASK is a register address, so this doesn't really
make sense. If the idea is to reset all active fault bits, just write
0xff. However, if faults are not really handled, it might be better
to set TCPC_FAULT_STATUS_MASK to 0 instead of enabling fault alerts.

It would probably be better to actually handle faults, but that may
be more complex, and someone would have tho be able to test any
changes.

Guenter

>> +       }
>> +
>>          if (status & TCPC_ALERT_RX_HARD_RST)
>>                  tcpm_pd_hard_reset(tcpci->port);
>>
>>
>>
>>
>>
>>
>>
> 
> Can you submit this as a real fix so that we can apply it properly?
> 
> thanks,
> 
> greg k-h


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-02-21 18:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ZR0P278MB0773545F02B32FAF648F968AEB319@ZR0P278MB0773.CHEP278.PROD.OUTLOOK.COM>
2022-10-25 12:19 ` tcpci module in Kernel 5.15.74 with PTN5110 not working correctly Christian Bach
2022-10-25 12:37   ` Greg KH
2022-10-25 12:48     ` AW: " Christian Bach
2022-10-25 13:36       ` Guenter Roeck
2022-10-25 16:17         ` AW: " Christian Bach
2022-10-25 17:16           ` Guenter Roeck
2022-10-28  9:31             ` AW: " Christian Bach
2023-02-20 16:45     ` Christian Bach
2023-02-20 18:54       ` Greg KH
2023-02-21 18:59         ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).