mbox series

[v2,00/12,SRU,OEM-5.14] Fix i915 TypeC disconnect problems for Intel ADL-P

Message ID 20211125101025.20214-1-chris.chiu@canonical.com
Headers show
Series Fix i915 TypeC disconnect problems for Intel ADL-P | expand

Message

Chris Chiu Nov. 25, 2021, 10:10 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1952041

[Impact]
When the ADL-P system connects the external display via TypeC port, it will hang after unplugging the TypeC connector. The system will never come back until reboot.

[Fix]
Intel has released a patch set to fix the TypeC PHY connect/disconnect logic. The shift for ownership of PHY and power domain will be handled correctly for ADL-P.

[Test]
The ADL-P system will no longer freeze and the ownership will shift correctly after disconnecting the external display connects via TypeC port.

[Where problem could occur]
It's kind of a big refactor for the i915 TypeC PHY handling logic. Don't know if there's any problems on older platforms. Targeting only on Jammy/Unstable and latest OEM kernel for lower risk.

v2: remove SRU for U since #4 of this series should be cleanly cherry-picked to U and J.

Imre Deak (12):
  drm/i915/adlp/tc: Fix PHY connected check for Thunderbolt mode
  drm/i915/tc: Remove waiting for PHY complete during releasing
    ownership
  drm/i915/tc: Check for DP-alt, legacy sinks before taking PHY
    ownership
  drm/i915/tc: Add/use helpers to retrieve TypeC port properties
  drm/i915/tc: Don't keep legacy TypeC ports in connected state w/o a
    sink
  drm/i915/tc: Add a mode for the TypeC PHY's disconnected state
  drm/i915/tc: Refactor TC-cold block/unblock helpers
  drm/i915/tc: Avoid using legacy AUX PW in TBT mode
  drm/i915/icl/tc: Remove the ICL special casing during TC-cold blocking
  drm/i915/tc: Fix TypeC PHY connect/disconnect logic on ADL-P
  drm/i915/tc: Drop extra TC cold blocking from
    intel_tc_port_connected()
  drm/i915/tc: Fix system hang on ADL-P during TypeC PHY disconnect

 drivers/gpu/drm/i915/display/intel_ddi.c      |  34 +-
 drivers/gpu/drm/i915/display/intel_display.c  |   6 +-
 drivers/gpu/drm/i915/display/intel_display.h  |   1 +
 .../drm/i915/display/intel_display_power.c    |   4 +-
 .../drm/i915/display/intel_display_types.h    |   3 +
 drivers/gpu/drm/i915/display/intel_dp_aux.c   |   6 +-
 drivers/gpu/drm/i915/display/intel_dpll_mgr.c |   5 +-
 drivers/gpu/drm/i915/display/intel_tc.c       | 290 ++++++++++++------
 drivers/gpu/drm/i915/display/intel_tc.h       |   6 +-
 9 files changed, 224 insertions(+), 131 deletions(-)

Comments

Andrea Righi Nov. 26, 2021, 7:55 a.m. UTC | #1
On Thu, Nov 25, 2021 at 06:10:13PM +0800, Chris Chiu wrote:
> BugLink: https://bugs.launchpad.net/bugs/1952041
> 
> [Impact]
> When the ADL-P system connects the external display via TypeC port, it will hang after unplugging the TypeC connector. The system will never come back until reboot.
> 
> [Fix]
> Intel has released a patch set to fix the TypeC PHY connect/disconnect logic. The shift for ownership of PHY and power domain will be handled correctly for ADL-P.
> 
> [Test]
> The ADL-P system will no longer freeze and the ownership will shift correctly after disconnecting the external display connects via TypeC port.
> 
> [Where problem could occur]
> It's kind of a big refactor for the i915 TypeC PHY handling logic. Don't know if there's any problems on older platforms. Targeting only on Jammy/Unstable and latest OEM kernel for lower risk.
> 
> v2: remove SRU for U since #4 of this series should be cleanly cherry-picked to U and J.

I was considering to apply this also to jammy:linux, but "big refactor"
is a little worrying in terms of maintainability of the i915 code, that
always gets problematic due to the inevitable custom patches that we
usually apply...

Do you think there's any chance that we get this via the regular updates
from stable? Maybe if it wasn't not done already we should try to ask to
apply this to stable.

Thanks,
-Andrea
Chris Chiu Nov. 26, 2021, 8:04 a.m. UTC | #2
On Fri, Nov 26, 2021 at 3:55 PM Andrea Righi <andrea.righi@canonical.com> wrote:
>
> On Thu, Nov 25, 2021 at 06:10:13PM +0800, Chris Chiu wrote:
> > BugLink: https://bugs.launchpad.net/bugs/1952041
> >
> > [Impact]
> > When the ADL-P system connects the external display via TypeC port, it will hang after unplugging the TypeC connector. The system will never come back until reboot.
> >
> > [Fix]
> > Intel has released a patch set to fix the TypeC PHY connect/disconnect logic. The shift for ownership of PHY and power domain will be handled correctly for ADL-P.
> >
> > [Test]
> > The ADL-P system will no longer freeze and the ownership will shift correctly after disconnecting the external display connects via TypeC port.
> >
> > [Where problem could occur]
> > It's kind of a big refactor for the i915 TypeC PHY handling logic. Don't know if there's any problems on older platforms. Targeting only on Jammy/Unstable and latest OEM kernel for lower risk.
> >
> > v2: remove SRU for U since #4 of this series should be cleanly cherry-picked to U and J.
>
> I was considering to apply this also to jammy:linux, but "big refactor"
> is a little worrying in terms of maintainability of the i915 code, that
> always gets problematic due to the inevitable custom patches that we
> usually apply...
>
> Do you think there's any chance that we get this via the regular updates
> from stable? Maybe if it wasn't not done already we should try to ask to
> apply this to stable.
>
> Thanks,
> -Andrea

The patch set is in 5.15.0-rc4 now so the regular update would also get
these patches applied.  My major concern is these patches are too new
for older platforms (ex. TGL) which we haven't yet time for verification and
I don't want to incur huge impact on older kernels for this.
Andrea Righi Nov. 26, 2021, 8:08 a.m. UTC | #3
On Fri, Nov 26, 2021 at 04:04:31PM +0800, Chris Chiu wrote:
> On Fri, Nov 26, 2021 at 3:55 PM Andrea Righi <andrea.righi@canonical.com> wrote:
> >
> > On Thu, Nov 25, 2021 at 06:10:13PM +0800, Chris Chiu wrote:
> > > BugLink: https://bugs.launchpad.net/bugs/1952041
> > >
> > > [Impact]
> > > When the ADL-P system connects the external display via TypeC port, it will hang after unplugging the TypeC connector. The system will never come back until reboot.
> > >
> > > [Fix]
> > > Intel has released a patch set to fix the TypeC PHY connect/disconnect logic. The shift for ownership of PHY and power domain will be handled correctly for ADL-P.
> > >
> > > [Test]
> > > The ADL-P system will no longer freeze and the ownership will shift correctly after disconnecting the external display connects via TypeC port.
> > >
> > > [Where problem could occur]
> > > It's kind of a big refactor for the i915 TypeC PHY handling logic. Don't know if there's any problems on older platforms. Targeting only on Jammy/Unstable and latest OEM kernel for lower risk.
> > >
> > > v2: remove SRU for U since #4 of this series should be cleanly cherry-picked to U and J.
> >
> > I was considering to apply this also to jammy:linux, but "big refactor"
> > is a little worrying in terms of maintainability of the i915 code, that
> > always gets problematic due to the inevitable custom patches that we
> > usually apply...
> >
> > Do you think there's any chance that we get this via the regular updates
> > from stable? Maybe if it wasn't not done already we should try to ask to
> > apply this to stable.
> >
> > Thanks,
> > -Andrea
> 
> The patch set is in 5.15.0-rc4 now so the regular update would also get
> these patches applied.  My major concern is these patches are too new
> for older platforms (ex. TGL) which we haven't yet time for verification and
> I don't want to incur huge impact on older kernels for this.

Ok, in that case I'd suggest to hold on a little bit for jammy:linux
(since we're pushing to get a kernel promoted to the release pocket). If
we get these patches with the regular updates fine, otherwise we can
apply these patches once we have a "more stable" jammy:linux.

Thanks,
-Andrea
Timo Aaltonen Dec. 2, 2021, 6:22 p.m. UTC | #4
On 25.11.2021 12.10, Chris Chiu wrote:
> BugLink: https://bugs.launchpad.net/bugs/1952041
> 
> [Impact]
> When the ADL-P system connects the external display via TypeC port, it will hang after unplugging the TypeC connector. The system will never come back until reboot.
> 
> [Fix]
> Intel has released a patch set to fix the TypeC PHY connect/disconnect logic. The shift for ownership of PHY and power domain will be handled correctly for ADL-P.
> 
> [Test]
> The ADL-P system will no longer freeze and the ownership will shift correctly after disconnecting the external display connects via TypeC port.
> 
> [Where problem could occur]
> It's kind of a big refactor for the i915 TypeC PHY handling logic. Don't know if there's any problems on older platforms. Targeting only on Jammy/Unstable and latest OEM kernel for lower risk.
> 
> v2: remove SRU for U since #4 of this series should be cleanly cherry-picked to U and J.
> 
> Imre Deak (12):
>    drm/i915/adlp/tc: Fix PHY connected check for Thunderbolt mode
>    drm/i915/tc: Remove waiting for PHY complete during releasing
>      ownership
>    drm/i915/tc: Check for DP-alt, legacy sinks before taking PHY
>      ownership
>    drm/i915/tc: Add/use helpers to retrieve TypeC port properties
>    drm/i915/tc: Don't keep legacy TypeC ports in connected state w/o a
>      sink
>    drm/i915/tc: Add a mode for the TypeC PHY's disconnected state
>    drm/i915/tc: Refactor TC-cold block/unblock helpers
>    drm/i915/tc: Avoid using legacy AUX PW in TBT mode
>    drm/i915/icl/tc: Remove the ICL special casing during TC-cold blocking
>    drm/i915/tc: Fix TypeC PHY connect/disconnect logic on ADL-P
>    drm/i915/tc: Drop extra TC cold blocking from
>      intel_tc_port_connected()
>    drm/i915/tc: Fix system hang on ADL-P during TypeC PHY disconnect
> 
>   drivers/gpu/drm/i915/display/intel_ddi.c      |  34 +-
>   drivers/gpu/drm/i915/display/intel_display.c  |   6 +-
>   drivers/gpu/drm/i915/display/intel_display.h  |   1 +
>   .../drm/i915/display/intel_display_power.c    |   4 +-
>   .../drm/i915/display/intel_display_types.h    |   3 +
>   drivers/gpu/drm/i915/display/intel_dp_aux.c   |   6 +-
>   drivers/gpu/drm/i915/display/intel_dpll_mgr.c |   5 +-
>   drivers/gpu/drm/i915/display/intel_tc.c       | 290 ++++++++++++------
>   drivers/gpu/drm/i915/display/intel_tc.h       |   6 +-
>   9 files changed, 224 insertions(+), 131 deletions(-)
> 

as it looks this will get in jammy kernel too, it's safe to add to 
oem-5.14 without risking to regress on upgrade to hwe-5.15