mirror_ubuntu-kernels/drivers/gpu/drm
Douglas Anderson b9364eed92 drm/msm/dpu: Move min BW request and full BW disable back to mdss
In commit a670ff578f ("drm/msm/dpu: always use mdp device to scale
bandwidth") we fully moved interconnect stuff to the DPU driver. This
had no change for sc7180 but _did_ have an impact for other SoCs. It
made them match the sc7180 scheme.

Unfortunately, the sc7180 scheme seems like it was a bit broken.
Specifically the interconnect needs to be on for more than just the
DPU driver's AXI bus. In the very least it also needs to be on for the
DSI driver's AXI bus. This can be seen fairly easily by doing this on
a ChromeOS sc7180-trogdor class device:

  set_power_policy --ac_screen_dim_delay=5 --ac_screen_off_delay=10
  sleep 10
  cd /sys/bus/platform/devices/ae94000.dsi/power
  echo on > control

When you do that, you'll get a warning splat in the logs about
"gcc_disp_hf_axi_clk status stuck at 'off'".

One could argue that perhaps what I have done above is "illegal" and
that it can't happen naturally in the system because in normal system
usage the DPU is pretty much always on when DSI is on. That being
said:
* In official ChromeOS builds (admittedly a 5.4 kernel with backports)
  we have seen that splat at bootup.
* Even though we don't use "autosuspend" for these components, we
  don't use the "put_sync" variants. Thus plausibly the DSI could stay
  "runtime enabled" past when the DPU is enabled. Techncially we
  shouldn't do that if the DPU's suspend ends up yanking our clock.

Let's change things such that the "bare minimum" request for the
interconnect happens in the mdss driver again. That means that all of
the children can assume that the interconnect is on at the minimum
bandwidth. We'll then let the DPU request the higher amount that it
wants.

It should be noted that this isn't as hacky of a solution as it might
initially appear. Specifically:
* Since MDSS and DPU individually get their own references to the
  interconnect then the framework will actually handle aggregating
  them. The two drivers are _not_ clobbering each other.
* When the Qualcomm interconnect driver aggregates it takes the max of
  all the peaks. Thus having MDSS request a peak, as we're doing here,
  won't actually change the total interconnect bandwidth (it won't be
  added to the request for the DPU). This perhaps explains why the
  "average" requested in MDSS was historically 0 since that one
  _would_ be added in.

NOTE also that in the downstream ChromeOS 5.4 and 5.15 kernels, we're
also seeing some RPMH hangs that are addressed by this fix. These
hangs are showing up in the field and on _some_ devices with enough
stress testing of suspend/resume. Specifically right at suspend time
with a stack crawl that looks like this (from chromeos-5.15 tree):
  rpmh_write_batch+0x19c/0x240
  qcom_icc_bcm_voter_commit+0x210/0x420
  qcom_icc_set+0x28/0x38
  apply_constraints+0x70/0xa4
  icc_set_bw+0x150/0x24c
  dpu_runtime_resume+0x50/0x1c4
  pm_generic_runtime_resume+0x30/0x44
  __genpd_runtime_resume+0x68/0x7c
  genpd_runtime_resume+0x12c/0x20c
  __rpm_callback+0x98/0x138
  rpm_callback+0x30/0x88
  rpm_resume+0x370/0x4a0
  __pm_runtime_resume+0x80/0xb0
  dpu_kms_enable_commit+0x24/0x30
  msm_atomic_commit_tail+0x12c/0x630
  commit_tail+0xac/0x150
  drm_atomic_helper_commit+0x114/0x11c
  drm_atomic_commit+0x68/0x78
  drm_atomic_helper_disable_all+0x158/0x1c8
  drm_atomic_helper_suspend+0xc0/0x1c0
  drm_mode_config_helper_suspend+0x2c/0x60
  msm_pm_prepare+0x2c/0x40
  pm_generic_prepare+0x30/0x44
  genpd_prepare+0x80/0xd0
  device_prepare+0x78/0x17c
  dpm_prepare+0xb0/0x384
  dpm_suspend_start+0x34/0xc0

We don't completely understand all the mechanisms in play, but the
hang seemed to come and go with random factors. It's not terribly
surprising that the hang is gone after this patch since the line of
code that was failing is no longer present in the kernel.

Fixes: a670ff578f ("drm/msm/dpu: always use mdp device to scale bandwidth")
Fixes: c33b7c0389 ("drm/msm/dpu: add support for clk and bw scaling for display")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Tested-by: Jessica Zhang <quic_jesszhan@quicinc.com> # RB3 (sdm845) and
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/487884/
Link: https://lore.kernel.org/r/20220531160059.v2.1.Ie7f6d4bf8cce28131da31a43354727e417cae98d@changeid
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
2022-06-01 16:16:19 -07:00
..
amd Merge tag 'amd-drm-fixes-5.18-2022-04-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes 2022-04-07 10:23:23 +10:00
arm drm: allow passing possible_crtcs to drm_writeback_connector_init() 2022-05-02 02:12:59 +03:00
armada Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
aspeed drm/aspeed: Add AST2600 chip support 2022-03-03 09:08:35 +10:30
ast drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
atmel-hlcdc drm/atmel-hlcdc: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:46 +01:00
bridge drm for 5.18-rc1 2022-03-24 16:19:43 -07:00
dp drm-misc-next for v5.18: 2022-03-04 13:41:57 +10:00
etnaviv Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
exynos Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
fsl-dcu drm/fsl-dcu: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:46 +01:00
gma500 drm/gma500: Add support for the nomodeset kernel parameter 2022-01-27 19:15:48 +01:00
gud dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
hisilicon Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
hyperv drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
i2c
i810
i915 drm fixes for 5.18-rc1 2022-03-25 14:57:47 -07:00
imx drm/imx: dw_hdmi-imx: Fix bailout in error cases of probe 2022-04-04 09:37:42 +02:00
ingenic Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
kmb drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
lib drm/selftests: add drm buddy alloc range testcase 2022-02-23 10:44:43 +01:00
lima drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
mcde Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
mediatek Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
meson Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
mga drm/mga/mga_ioc32: Use struct_group() for memcpy() region 2021-09-25 08:20:48 -07:00
mgag200 drm for 5.18-rc1 2022-03-24 16:19:43 -07:00
msm drm/msm/dpu: Move min BW request and full BW disable back to mdss 2022-06-01 16:16:19 -07:00
mxsfb drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
nouveau Merge drm/drm-fixes into drm-misc-fixes 2022-04-05 11:37:03 +02:00
omapdrm Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
panel * drm/panel/ili9341: Fix optional regulator handling 2022-04-07 10:22:43 +10:00
panfrost drm-misc-next for v5.18: 2022-03-04 13:41:57 +10:00
pl111 drm: Remove CONFIG_DRM_KMS_CMA_HELPER option 2021-11-30 11:10:03 +01:00
qxl drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
r128 Linux 5.15-rc7 2021-10-28 14:59:38 +10:00
radeon drm/radeon: Use drm_mode_copy() 2022-03-15 15:01:12 -04:00
rcar-du drm: allow passing possible_crtcs to drm_writeback_connector_init() 2022-05-02 02:12:59 +03:00
rockchip Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
savage
scheduler drm/sched: Add device pointer to drm_gpu_scheduler 2022-02-23 10:04:14 +01:00
selftests drm/selftest: plane_helper: Put test structures in static storage 2022-03-21 11:05:05 +01:00
shmobile drm/shmobile: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:47 +01:00
sis
solomon drm-misc-next for v5.18: 2022-03-04 13:41:57 +10:00
sprd Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
sti Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
stm drm/stm: ltdc: add support for CRC hashing feature 2022-02-25 14:14:28 +01:00
sun4i Driver core changes for 5.18-rc1 2022-03-28 12:41:28 -07:00
tdfx
tegra drm-misc-next for v5.18: 2022-03-04 13:41:57 +10:00
tidss drm/tidss: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:47 +01:00
tilcdc drm/tilcdc: Add support for the nomodeset kernel parameter 2022-01-27 19:15:50 +01:00
tiny drm for 5.18-rc1 2022-03-24 16:19:43 -07:00
ttm drm/ttm: Fix a kernel oops due to an invalid read 2022-03-21 10:46:57 +01:00
tve200 drm/tve200: Use drm_module_platform_driver() to register the driver 2022-01-27 19:15:48 +01:00
udl dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
v3d drm/v3d: centralize error handling when init scheduler fails 2022-03-01 22:37:13 -01:00
vboxvideo drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
vc4 drm: allow passing possible_crtcs to drm_writeback_connector_init() 2022-05-02 02:12:59 +03:00
vgem drm: Return error codes from struct drm_driver.gem_create_object 2021-12-02 11:12:39 +01:00
via
virtio drm/gem-shmem: Set vm_ops in static initializer 2022-02-14 09:42:01 +01:00
vkms drm: allow passing possible_crtcs to drm_writeback_connector_init() 2022-05-02 02:12:59 +03:00
vmwgfx Merge remote-tracking branch 'drm/drm-next' into drm-misc-next 2022-02-07 17:03:24 +01:00
xen xen: branch for v5.18-rc1 2022-03-28 14:32:39 -07:00
xlnx Merge remote-tracking branch 'drm/drm-next' into drm-misc-next 2022-02-07 17:03:24 +01:00
drm_agpsupport.c
drm_aperture.c
drm_atomic_helper.c drm: fix error found in some cases after the patch d1af5cd86997 2022-01-14 14:31:54 +01:00
drm_atomic_state_helper.c drm/object: Add default color encoding and range value at reset 2022-02-25 17:57:14 +01:00
drm_atomic_uapi.c drm/atomic: Don't pollute crtc_state->mode_blob with error pointers 2022-02-16 12:32:07 +02:00
drm_atomic.c Merge drm/drm-fixes into drm-misc-fixes 2022-01-26 09:40:24 +01:00
drm_auth.c drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_a*.c 2021-11-26 16:45:22 +01:00
drm_blend.c
drm_bridge_connector.c drm: Plumb debugfs_init through to panels 2022-02-15 15:25:18 -08:00
drm_bridge.c drm/bridge: Document the probe issue with MIPI-DSI bridges 2021-09-24 19:25:23 +02:00
drm_buddy.c drm/selftests: add drm buddy alloc range testcase 2022-02-23 10:44:43 +01:00
drm_bufs.c
drm_cache.c drm for 5.18-rc1 2022-03-24 16:19:43 -07:00
drm_client_modeset.c drm: Convert open-coded yes/no strings to yesno() 2022-02-07 13:04:25 -08:00
drm_client.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_color_mgmt.c drm/docs: Document where the C8 color lut is stored 2022-01-25 09:36:20 +01:00
drm_connector.c drm/vrr: Set VRR capable prop only if it is attached to connector 2022-03-01 11:37:21 -08:00
drm_context.c
drm_crtc_helper_internal.h drm/dp: Move DP declarations into separate header file 2022-01-17 11:25:44 +01:00
drm_crtc_helper.c Revert "drm: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" 2021-10-04 09:34:57 -04:00
drm_crtc_internal.h drm/connector: Add drm_connector_find_by_fwnode() function (v3) 2021-08-20 12:35:59 +02:00
drm_crtc.c
drm_damage_helper.c
drm_debugfs_crc.c
drm_debugfs.c drm: Plumb debugfs_init through to panels 2022-02-15 15:25:18 -08:00
drm_displayid.c
drm_dma.c
drm_drv.c drm: fix null-ptr-deref in drm_dev_init_release() 2021-10-14 21:39:02 +02:00
drm_dsc.c drm/dp: Move public DisplayPort headers into dp/ 2022-01-17 11:25:44 +01:00
drm_dumb_buffers.c
drm_edid_load.c
drm_edid.c drm/edid: fix CEA extension byte #3 parsing 2022-03-24 11:41:14 +02:00
drm_encoder_slave.c
drm_encoder.c
drm_fb_cma_helper.c
drm_fb_helper.c drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
drm_file.c
drm_flip_work.c
drm_format_helper.c drm/format-helper: Add drm_fb_xrgb8888_to_mono_reversed() 2022-02-16 13:29:04 +01:00
drm_fourcc.c drm/fourcc: Add packed 10bit YUV 4:2:0 format 2021-12-16 11:23:22 +01:00
drm_framebuffer.c drm: introduce fb_modifiers_not_supported flag in mode_config 2022-01-31 21:45:23 +01:00
drm_gem_atomic_helper.c drm: use new iterator in drm_gem_plane_helper_prepare_fb v3 2021-10-25 09:33:22 +02:00
drm_gem_cma_helper.c Linux 5.17-rc6 2022-02-28 14:57:14 +10:00
drm_gem_framebuffer_helper.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_gem_shmem_helper.c drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
drm_gem_ttm_helper.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_gem_vram_helper.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_gem.c drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
drm_hashtab.c drm: Declare hashtable as legacy 2021-11-30 09:41:28 +01:00
drm_hdcp.c
drm_internal.h dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_ioc32.c drm: Copy drm_wait_vblank to user before returning 2021-08-17 13:56:03 -04:00
drm_ioctl.c drm: introduce fb_modifiers_not_supported flag in mode_config 2022-01-31 21:45:23 +01:00
drm_irq.c drm: Build drm_irq.o only if CONFIG_DRM_LEGACY has been set 2021-10-22 16:20:12 +02:00
drm_kms_helper_common.c drm/dp: Move DisplayPort helpers into separate helper module 2022-01-17 11:25:44 +01:00
drm_lease.c drm/lease: allow empty leases 2021-10-01 15:55:47 +02:00
drm_legacy_misc.c
drm_legacy.h drm: Declare hashtable as legacy 2021-11-30 09:41:28 +01:00
drm_lock.c
drm_managed.c
drm_memory.c
drm_mipi_dbi.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_mipi_dsi.c drm/mipi-dsi: Create devm device attachment 2021-09-24 19:25:33 +02:00
drm_mm.c lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() 2022-01-22 08:33:37 +02:00
drm_mode_config.c
drm_mode_object.c drm/object: Add drm_object_property_get_default_value() function 2022-02-25 17:55:42 +01:00
drm_modes.c drm/modes: Add of_get_drm_panel_display_mode() 2022-02-28 10:29:33 +01:00
drm_modeset_helper.c
drm_modeset_lock.c lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() 2022-01-22 08:33:37 +02:00
drm_nomodeset.c drm: Fix build error caused by missing drm_nomodeset.o 2021-11-27 21:05:58 +01:00
drm_of.c drm-misc-next-fixes for v5.18-rc2: 2022-04-08 09:13:38 +10:00
drm_panel_orientation_quirks.c Merge drm/drm-next into drm-intel-next 2022-01-31 13:19:33 -05:00
drm_panel.c
drm_pci.c
drm_plane_helper.c drm/plane-helper: fix uninitialized variable reference 2021-10-07 12:24:44 +02:00
drm_plane.c drm: add support modifiers for drivers whose planes only support linear layout 2022-01-31 21:45:24 +01:00
drm_prime.c dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
drm_print.c isystem: ship and use stdarg.h 2021-08-19 09:02:55 +09:00
drm_privacy_screen_x86.c drm-misc-next for v5.18: 2022-02-01 19:02:41 +10:00
drm_privacy_screen.c drm-misc-next for v5.18: 2022-02-25 05:50:18 +10:00
drm_probe_helper.c drm/probe-helper: use drm_kms_helper_connector_hotplug_event 2021-11-02 14:27:14 +01:00
drm_property.c drm: property: Replace strncpy() with strscpy_pad() 2021-10-07 05:42:13 +03:00
drm_rect.c
drm_scatter.c
drm_scdc_helper.c
drm_self_refresh_helper.c
drm_simple_kms_helper.c
drm_syncobj.c drm/syncobj: flatten dma_fence_chains on transfer 2022-02-11 11:30:01 +01:00
drm_sysfs.c drm/sysfs: introduce drm_sysfs_connector_hotplug_event 2021-11-02 14:27:06 +01:00
drm_trace_points.c
drm_trace.h
drm_vblank_work.c
drm_vblank.c
drm_vm.c
drm_vma_manager.c
drm_writeback.c drm: introduce drm_writeback_connector_init_with_encoder() API 2022-05-02 02:12:59 +03:00
Kconfig drm/selftests: Move i915 buddy selftests into drm 2022-02-23 10:43:25 +01:00
Makefile drm: Add driver for Solomon SSD130x OLED displays 2022-02-16 13:29:04 +01:00