Skip to content

Fixes for apple-gmux and runtime support

Atharva Tiwari amd-gfx dri-devel linux-pci lkml platform-driver-x86 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/212 patches 1 replyIn review
  2. v2 posting 1/22 of 12 patches 2 repliesSuperseded
  3. v113 patches 8 repliesSuperseded

Changes in v2 from the cover letter · 22 lines

- Check the discrete pdev config before GFX0 restore (01/13)
- Don't save bridges state when state is VGA_SWITCHEROO_OFF (01/13)
- Fixes discrete_pdev initialization (01/13)
- Used PWRD on 15,1 and 15,3 aswell
- Add quirk to 0x7360 PCI id aswell (02/13)
- Add 15,1 and 15,3 and its gpu's aswell
- Removed ignore_access code (02/13)
- Initialized val in read functions (03/13)
- Fixed permanent mutex block on failure (03/13)
- Only resumed when pm_runtime is available (skipping on iMacs) (04/13)
- Corrected ordering of interrupt_work (04/13)
- Notified drm about hotplug change (04/13)
- Checked if EFI_RT_SUPPORTED_SET_VARIABLE is available before writing gpu-active (05/13)
- Wrote gpu-active on shutdown aswell (05/13)
- Dropped boot-gpu parameter (06/13)
- Checked if vga_switcheroo has been initialized (09/13)
- Added additional pci_is_thunderbolt_attached check to amdgpu_device_supports_gmux (09/13)
- Removed duplicate check (10/13)
- Renamed gmux_off to runpm_active
- Checked if adev->dev exists in dm_dp_aux_transfer to fix null ptr deref (11/13)
- Removed GMUX specific code (12/13)
- Initialized edp_sink_present in testing code (13/13)

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12platform/apple-gmux: Fix power for MMIO systemsdrivers/platform/x86/apple-gmux.c+152 -70 replies
2/12PCI: Disable pcie port on specific amd devicesarch/x86/pci/fixup.c drivers/pci/pcie/portdrv.c include/linux/pci.h+45 -10 replies
3/12platform/apple-gmux: Fix MMIO interfacedrivers/platform/x86/apple-gmux.c+34 -260 replies
4/12platform/apple-gmux: Fix Interrupts for MMIO systemsdrivers/platform/x86/apple-gmux.c+88 -130 replies
5/12platform/apple-gmux: Write switch state to EFI on MMIO devicesdrivers/platform/x86/Kconfig drivers/platform/x86/apple-gmux.c+41 -00 replies
6/12platform/apple-gmux: Add check to detect FSSdrivers/platform/x86/apple-gmux.c include/linux/apple-gmux.h+3 -00 replies
7/12platform/apple-gmux: Add documentation about iMacsdrivers/platform/x86/apple-gmux.c+5 -00 replies
8/12drm/amdgpu: Add Apple GMUX runtime PM supportdrivers/gpu/drm/amd/amdgpu/amdgpu.h drivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 more+97 -190 replies
9/12drm/amdgpu: Catch register access while GMUX keeps the GPU offdrivers/gpu/drm/amd/amdgpu/amdgpu.h drivers/gpu/drm/amd/amdgpu/amdgpu_device.c drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 more+35 -01 reply
10/12drm/amd/display: Refuse DP AUX while GMUX keeps the GPU offdrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+17 -20 replies
11/12drm/amdgpu: Skip AC/DC notification while the GPU is runtime suspendeddrivers/gpu/drm/amd/pm/amdgpu_dpm.c+14 -50 replies
12/12drm/amd/display: Skip panel power savings on eDP links without a paneldrivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_backlight.c drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_backlight_test.c+4 -00 replies

Reviews trailers per patch

None of the 12 patches has a Reviewed-by or Acked-by.

PatchSebastian ZygadloYossef Osman
1/12T-b T-b
2/12T-b T-b
3/12T-b T-b
4/12T-b T-b
5/12T-b T-b
6/12T-b T-b
7/12
8/12T-b T-b
9/12T-b T-b
10/12T-b T-b
11/12T-b T-b
12/12T-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/12] Fixes for apple-gmux and runtime support

This series fixes apple-gmux on T2 Macs (2018-2020):

- Fix interrupt handling
- Automatically turn on dGPU when a external monitor connects.
- Fix base register read/write
- Fix power handling
- Improve documentation
- New module parameter to toggle boot GPU.

It also adds vga_switcheroo runtime power management for T2 Macs, built on gmux power control, so the dGPU is powered off automatically when idle and users no longer need to toggle it manually.

Changes in v2:
- Check the discrete pdev config before GFX0 restore (01/13)
- Don't save bridges state when state is VGA_SWITCHEROO_OFF (01/13)
- Fixes discrete_pdev initialization (01/13)
- Used PWRD on 15,1 and 15,3 aswell
- Add quirk to 0x7360 PCI id aswell (02/13)
- Add 15,1 and 15,3 and its gpu's aswell
- Removed ignore_access code (02/13)
- Initialized val in read functions (03/13)
- Fixed permanent mutex block on failure (03/13)
- Only resumed when pm_runtime is available (skipping on iMacs) (04/13)
- Corrected ordering of interrupt_work (04/13)
- Notified drm about hotplug change (04/13)
- Checked if EFI_RT_SUPPORTED_SET_VARIABLE is available before writing gpu-active (05/13)
- Wrote gpu-active on shutdown aswell (05/13)
- Dropped boot-gpu parameter (06/13)
- Checked if vga_switcheroo has been initialized (09/13)
- Added additional pci_is_thunderbolt_attached check to amdgpu_device_supports_gmux (09/13)
- Removed duplicate check (10/13)
- Renamed gmux_off to runpm_active
- Checked if adev->dev exists in dm_dp_aux_transfer to fix null ptr deref (11/13)
- Removed GMUX specific code (12/13)
- Initialized edp_sink_present in testing code (13/13)

Link to v1:
https://lore.kernel.org/all/[email protected]/

Andre Eikmeyer (6):
platform/apple-gmux: Write switch state to EFI on MMIO devices drm/amdgpu: Add Apple GMUX runtime PM support
drm/amdgpu: Catch register access while GMUX keeps the GPU off drm/amd/display: Refuse DP AUX while GMUX keeps the GPU off drm/amdgpu: Skip AC/DC notification while the GPU is runtime suspended drm/amd/display: Skip panel power savings on eDP links without a panel

Atharva Tiwari (6):
platform/apple-gmux: Fix power for MMIO systems
PCI: Disable pcie port on specific amd devices platform/apple-gmux: Fix MMIO interface platform/apple-gmux: Fix Interrupts for MMIO systems platform/apple-gmux: Add check to detect FSS platform/apple-gmux: Add documentation about iMacs

 arch/x86/pci/fixup.c                          |  43 +++
 drivers/gpu/drm/amd/amdgpu/amdgpu.h           |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    |  61 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |  48 ++-
 .../gpu/drm/amd/amdgpu/amdgpu_reg_access.c    |  24 ++
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  14 +
 .../display/amdgpu_dm/amdgpu_dm_backlight.c   |   3 +
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |  19 +-
 .../tests/amdgpu_dm_backlight_test.c          |   1 +
 drivers/gpu/drm/amd/pm/amdgpu_dpm.c           |  19 +-
 drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h       |   1 +
 drivers/pci/pcie/portdrv.c                    |   2 +-
 drivers/platform/x86/Kconfig                  |   1 +
 drivers/platform/x86/apple-gmux.c             | 365 +++++++++++++++---
 include/linux/apple-gmux.h                    |   1 +
 include/linux/pci.h                           |   1 +
 16 files changed, 534 insertions(+), 72 deletions(-)
Signature · 1 line
2.55.0