04 Dec, 2020
1 commit
-
The pixel clock of display controller lcdifv3 source from hdmi phy.
When hdmi cable plugout irq trigger,
hdmi phy will be poweroff immediately in hdmi controller driver.
But DRM and user app may still working until they received plugout event.
For such case, the kernel will dump.[ 89.707045] ------------[ cut here ]------------
[ 89.711705] [CRTC:39:crtc-2] vblank wait timed out
[ 89.716563] WARNING: CPU: 2 PID: 7 at drivers/gpu/drm/drm_atomic_helper.c:1467 drm_atomic_helper_wait_for_vblanks.part.0+0x274/0x290
[ 89.728472] Modules linked in:
[ 89.731533] CPU: 2 PID: 7 Comm: kworker/u8:0 Not tainted 5.4.70-00041-g631cb8d6e2b2-dirty #23
[ 89.740055] Hardware name: NXP i.MX8MPlus EVK board (DT)
[Playing (No Repeated)][Vol=1.0][ 89.745372] Workqueue: events_unbound commit_work
[00:00:04/00:02:18][ 89.752939] pstate: 40000005 (nZcv daif -PAN -UAO)
[ 89.759376] pc : drm_atomic_helper_wait_for_vblanks.part.0+0x274/0x290
[ 89.765905] lr : drm_atomic_helper_wait_for_vblanks.part.0+0x274/0x290
[ 89.772431] sp : ffff800011c43ca0
[ 89.775744] x29: ffff800011c43ca0 x28: 0000000000000000
[ 89.781054] x27: 000000000000055f x26: 0000000000000070
[ 89.786363] x25: ffff00017786b800 x24: 0000000000000001
[ 89.791674] x23: 0000000000000038 x22: 0000000000000004
[ 89.796983] x21: ffff00016a375400 x20: ffff00017786b088
[ 89.802293] x19: 0000000000000002 x18: 0000000000000010
[ 89.807604] x17: 0000000000000000 x16: 0000000000000000
[ 89.812913] x15: ffff0001760c5870 x14: ffffffffffffffff
[ 89.818225] x13: ffff800091c439f7 x12: ffff800011c439ff
[ 89.823537] x11: ffff800011a11000 x10: ffff800011b36328
[ 89.828847] x9 : 0000000000000000 x8 : ffff800011b37000
[ 89.834158] x7 : ffff80001069fc68 x6 : 0000000000000341
[ 89.839469] x5 : 0000000000000000 x4 : ffff00017f3a0188
[ 89.844778] x3 : ffff00017f3a6f20 x2 : ffff00017f3a0188
[ 89.850088] x1 : 4d8823010d259700 x0 : 0000000000000000
[ 89.855404] Call trace:
[ 89.857854] drm_atomic_helper_wait_for_vblanks.part.0+0x274/0x290
[ 89.864033] drm_atomic_helper_wait_for_vblanks+0x14/0x20
[ 89.869433] lcdifv3_drm_atomic_commit_tail+0x64/0x7c
[ 89.874484] commit_tail+0x9c/0x138
[ 89.877970] commit_work+0x10/0x18
[ 89.881372] process_one_work+0x198/0x320
[ 89.885382] worker_thread+0x48/0x420
[ 89.889042] kthread+0x138/0x158
[ 89.892272] ret_from_fork+0x10/0x1c
[ 89.895847] ---[ end trace ed53d661901a6437 ]---Keep hdmi phy in poweron status when cable plugout to workaround the issue.
HDMI phy power off function will be move to lcdifv3 or hdmi phy driver
later.Signed-off-by: Sandor Yu
Reviewed-by: Robby Cai
20 Nov, 2020
1 commit
-
Adjust the LDO trim value based upon the fuse trim value.
Signed-off-by: Oliver Brown
Reviewed-by: Laurentiu Palcu
19 Nov, 2020
3 commits
-
The 'lcdif_crtc' allocated by devm_kzalloc() in bind() will
be freed automatically during unbind() stage if any other
component bind failed and this will cause use-after-free
issue in drm_mode_config_cleanup().Kasan reports below error related with this issue:
[ 2.188122] ==================================================================
[ 2.195370] BUG: KASAN: use-after-free in drm_mode_config_cleanup+0x274/0x478
[ 2.202524] Read of size 8 at addr ffff000069c1e098 by task swapper/0/1
[ 2.209145]
[ 2.210659] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.4.70-00056-g8e43cd16c8bb-dirty #139
[ 2.219020] Hardware name: FSL i.MX8MM EVK board (DT)
[ 2.224080] Call trace:
[ 2.226546] dump_backtrace+0x0/0x1e8
[ 2.230220] show_stack+0x14/0x20
[ 2.233554] dump_stack+0xe0/0x14c
[ 2.236981] print_address_description.isra.0+0x68/0x34c
[ 2.242311] __kasan_report+0x118/0x220
[ 2.246165] kasan_report+0xc/0x18
[ 2.249587] __asan_load8+0x94/0xb8
[ 2.253090] drm_mode_config_cleanup+0x274/0x478
[ 2.257728] imx_drm_bind+0xd8/0x1b0
[ 2.261324] try_to_bring_up_master+0x24c/0x2c8
[ 2.265870] __component_add+0x110/0x258
[ 2.269812] component_add+0x10/0x18
[ 2.273407] imx_sec_dsim_probe+0x74/0xa0
[ 2.277438] platform_drv_probe+0x6c/0xc8
[ 2.281462] really_probe+0x148/0x440
[ 2.285140] driver_probe_device+0x74/0x130
[ 2.289340] device_driver_attach+0x94/0xa0
[ 2.293537] __driver_attach+0x70/0x110
[ 2.297390] bus_for_each_dev+0xe4/0x158
[ 2.301329] driver_attach+0x30/0x40
[ 2.304918] bus_add_driver+0x21c/0x2b8
[ 2.308771] driver_register+0xbc/0x1d0
[ 2.312627] __platform_driver_register+0x7c/0x88
[ 2.317350] imx_sec_dsim_driver_init+0x18/0x20
[ 2.321897] do_one_initcall+0xa4/0x24c
[ 2.325751] kernel_init_freeable+0x238/0x2e8
[ 2.330128] kernel_init+0x10/0x114
[ 2.333635] ret_from_fork+0x10/0x1c
[ 2.337215]
[ 2.338717] Allocated by task 1:
[ 2.341963] save_stack+0x24/0xb0
[ 2.345296] __kasan_kmalloc.isra.0+0xc0/0xe0
[ 2.349671] kasan_slab_alloc+0x14/0x20
[ 2.353525] __kmalloc_node_track_caller+0x118/0x2c8
[ 2.358512] devm_kmalloc+0x48/0xc8
[ 2.362016] lcdif_crtc_bind+0x38/0x278
[ 2.365868] component_bind_all+0x1c0/0x3c8
[ 2.370070] imx_drm_bind+0x104/0x1b0
[ 2.373750] try_to_bring_up_master+0x24c/0x2c8
[ 2.378298] __component_add+0x110/0x258
[ 2.382235] component_add+0x10/0x18
[ 2.385827] imx_sec_dsim_probe+0x74/0xa0
[ 2.389854] platform_drv_probe+0x6c/0xc8
[ 2.393877] really_probe+0x148/0x440
[ 2.397555] driver_probe_device+0x74/0x130
[ 2.401757] device_driver_attach+0x94/0xa0
[ 2.405954] __driver_attach+0x70/0x110
[ 2.409803] bus_for_each_dev+0xe4/0x158
[ 2.413740] driver_attach+0x30/0x40
[ 2.417330] bus_add_driver+0x21c/0x2b8
[ 2.421180] driver_register+0xbc/0x1d0
[ 2.425035] __platform_driver_register+0x7c/0x88
[ 2.429754] imx_sec_dsim_driver_init+0x18/0x20
[ 2.434300] do_one_initcall+0xa4/0x24c
[ 2.438150] kernel_init_freeable+0x238/0x2e8
[ 2.442526] kernel_init+0x10/0x114
[ 2.446031] ret_from_fork+0x10/0x1c
[ 2.449612]
[ 2.451112] Freed by task 1:
[ 2.454010] save_stack+0x24/0xb0
[ 2.457343] __kasan_slab_free+0x108/0x180
[ 2.461456] kasan_slab_free+0x10/0x18
[ 2.465219] kfree+0x80/0x298
[ 2.468207] release_nodes+0x358/0x3e8
[ 2.471975] devres_release_group+0xd0/0x140
[ 2.476261] component_unbind.isra.0+0x98/0xb8
[ 2.480724] component_bind_all+0x25c/0x3c8
[ 2.484924] imx_drm_bind+0x104/0x1b0
[ 2.488605] try_to_bring_up_master+0x24c/0x2c8
[ 2.493153] __component_add+0x110/0x258
[ 2.497090] component_add+0x10/0x18
[ 2.500682] imx_sec_dsim_probe+0x74/0xa0
[ 2.504707] platform_drv_probe+0x6c/0xc8
[ 2.508732] really_probe+0x148/0x440
[ 2.512411] driver_probe_device+0x74/0x130
[ 2.516610] device_driver_attach+0x94/0xa0
[ 2.520807] __driver_attach+0x70/0x110
[ 2.524657] bus_for_each_dev+0xe4/0x158
[ 2.528594] driver_attach+0x30/0x40
[ 2.532183] bus_add_driver+0x21c/0x2b8
[ 2.536036] driver_register+0xbc/0x1d0
[ 2.539889] __platform_driver_register+0x7c/0x88
[ 2.544608] imx_sec_dsim_driver_init+0x18/0x20
[ 2.549152] do_one_initcall+0xa4/0x24c
[ 2.553006] kernel_init_freeable+0x238/0x2e8
[ 2.557380] kernel_init+0x10/0x114
[ 2.560884] ret_from_fork+0x10/0x1c
[ 2.564464]
[ 2.565972] The buggy address belongs to the object at ffff000069c1e000
[ 2.565972] which belongs to the cache kmalloc-2k of size 2048
[ 2.578510] The buggy address is located 152 bytes inside of
[ 2.578510] 2048-byte region [ffff000069c1e000, ffff000069c1e800)
[ 2.590343] The buggy address belongs to the page:
[ 2.595154] page:fffffe0001870600 refcount:1 mapcount:0 mapping:ffff000068003400 index:0x0 compound_mapcount: 0
[ 2.605260] flags: 0xffff00000010200(slab|head)
[ 2.609820] raw: 0ffff00000010200 dead000000000100 dead000000000122 ffff000068003400
[ 2.617583] raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000
[ 2.625339] page dumped because: kasan: bad access detected
[ 2.630917]
[ 2.632417] Memory state around the buggy address:
[ 2.637225] ffff000069c1df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[ 2.644463] ffff000069c1e000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[ 2.651700] >ffff000069c1e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[ 2.658931] ^
[ 2.662954] ffff000069c1e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[ 2.670193] ffff000069c1e180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[ 2.677421] ==================================================================Signed-off-by: Fancy Fang
Reported-by: Bo Zhang
(cherry picked from commit 6c91a51df9425a93157409546feca7107baaf4dd) -
Add mode_valid() implementation for CRTC to filter out any
mode which cannot be supported by LCDIFv3. Only check the
CEA and DMT modes for pixel clock round rate is same with
the value from mode.Signed-off-by: Fancy Fang
Reviewed-by: Liu Ying
(cherry picked from commit f252a44da9f90951614c0bf513df6bd4d145e76e) -
After using osc_24m for MIPI PHY reference clock source,
the default PHY reference clock rate should be changed
also accordingly. Here choose 12MHz rate for this since
below usual DSI output DDR clock rates can be derived
from 12MHz reference:891000,
810000,
792000,
648000,
472500,
445500,
390000,
297000,
240000,
189000,Signed-off-by: Fancy Fang
Reviewed-by: Liu Ying
(cherry picked from commit b3a420c9cf3fe40c408d4eb58841a0d047c186a4)
06 Nov, 2020
1 commit
-
Even though this panel uses 24bit input data mode, the connector from
8DXL-EVK board uses only 18bit data mode, so need to correct this in
panel driver.Signed-off-by: Robert Chiras
Acked-by: Laurentiu Palcu
26 Oct, 2020
2 commits
-
Only non_pcm, 32bit, 192kHz, 8channel streams be recognized as
HBR streams.In order to support this feature, need to enhance the API in
dw-hdmi driver.The test command is:
$iecset -c 4 audio off
$aplay -Dhw:4 -r 192000 -c 8 -f S32_LE out_put.spd.iec958
$iecset -c 4 audio onSigned-off-by: Shengjiu Wang
Reviewed-by: Viorel Suman -
Fix eld copy length issue which cause the eld not correct.
Signed-off-by: Shengjiu Wang
Reviewed-by: Viorel Suman
20 Oct, 2020
2 commits
-
OF_DYNAMIC is a must config in it6263 driver and adv7511 driver,
they will read some info like input/output endpoint in dts.Signed-off-by: Jindong
Reviewed-by: Robert Chiras -
Moving LCDIF panic low/high threshold from code to dts to
set differnt value for differnt DDR type.Signed-off-by: Jian Li
Reviewed-by: Fancy Fang
08 Oct, 2020
1 commit
-
* tag 'v5.4.70': (3051 commits)
Linux 5.4.70
netfilter: ctnetlink: add a range check for l3/l4 protonum
ep_create_wakeup_source(): dentry name can change under you...
...Conflicts:
arch/arm/mach-imx/pm-imx6.c
arch/arm64/boot/dts/freescale/imx8mm-evk.dts
arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts
drivers/crypto/caam/caamalg.c
drivers/gpu/drm/imx/dw_hdmi-imx.c
drivers/gpu/drm/imx/imx-ldb.c
drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
drivers/net/ethernet/freescale/enetc/enetc.c
drivers/net/ethernet/freescale/enetc/enetc_pf.c
drivers/thermal/imx_thermal.c
drivers/usb/cdns3/ep0.c
drivers/xen/swiotlb-xen.c
sound/soc/fsl/fsl_esai.c
sound/soc/fsl/fsl_sai.cSigned-off-by: Jason Liu
07 Oct, 2020
2 commits
-
[ Upstream commit 74ea06164cda81dc80e97790164ca533fd7e3087 ]
Better guess. Secondary CSC registers are from 0xF0000.
Signed-off-by: Martin Cerveny
Reviewed-by: Jernej Skrabec
Signed-off-by: Maxime Ripard
Link: https://patchwork.freedesktop.org/patch/msgid/20200906162140.5584-3-m.cerveny@computer.org
Signed-off-by: Sasha Levin -
commit a39d0d7bdf8c21ac7645c02e9676b5cb2b804c31 upstream.
A recent attempt to fix a ref count leak in
amdgpu_display_crtc_set_config() turned out to be doing too much and
"fixed" an intended decrease as if it were a leak. Undo that part to
restore the proper balance. This is the very nature of this function
to increase or decrease the power reference count depending on the
situation.Consequences of this bug is that the power reference would
eventually get down to 0 while the display was still in use,
resulting in that display switching off unexpectedly.Signed-off-by: Jean Delvare
Fixes: e008fa6fb415 ("drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config")
Cc: stable@vger.kernel.org
Cc: Navid Emamdoost
Cc: Alex Deucher
Signed-off-by: Alex Deucher
Signed-off-by: Greg Kroah-Hartman
01 Oct, 2020
27 commits
-
[ Upstream commit cab4c03b4ba54c8d9378298cacb8bc0fd74ceece ]
"Allwinner V3s" has secondary video layer (VI).
Decoded video is displayed in wrong colors until
secondary CSC registers are programmed correctly.Fixes: 883029390550 ("drm/sun4i: Add DE2 CSC library")
Signed-off-by: Martin Cerveny
Reviewed-by: Jernej Skrabec
Signed-off-by: Maxime Ripard
Link: https://patchwork.freedesktop.org/patch/msgid/20200906162140.5584-2-m.cerveny@computer.org
Signed-off-by: Sasha Levin -
[ Upstream commit ec653df2a0cbc306a4bfcb0e3484d318fa779002 ]
card->owner is a required property and since commit 81033c6b584b ("ALSA:
core: Warn on empty module") a warning is issued if it is empty. Fix lack
of it. This fixes following warning observed on RaspberryPi 3B board
with ARM 32bit kernel and multi_v7_defconfig:------------[ cut here ]------------
WARNING: CPU: 1 PID: 210 at sound/core/init.c:207 snd_card_new+0x378/0x398 [snd]
Modules linked in: vc4(+) snd_soc_core ac97_bus snd_pcm_dmaengine bluetooth snd_pcm snd_timer crc32_arm_ce raspberrypi_hwmon snd soundcore ecdh_generic ecc bcm2835_thermal phy_generic
CPU: 1 PID: 210 Comm: systemd-udevd Not tainted 5.8.0-rc1-00027-g81033c6b584b #1087
Hardware name: BCM2835
[] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[] (show_stack) from [] (dump_stack+0xd4/0xe8)
[] (dump_stack) from [] (__warn+0xdc/0xf4)
[] (__warn) from [] (warn_slowpath_fmt+0xb0/0xb8)
[] (warn_slowpath_fmt) from [] (snd_card_new+0x378/0x398 [snd])
[] (snd_card_new [snd]) from [] (snd_soc_bind_card+0x280/0x99c [snd_soc_core])
[] (snd_soc_bind_card [snd_soc_core]) from [] (devm_snd_soc_register_card+0x34/0x6c [snd_soc_core])
[] (devm_snd_soc_register_card [snd_soc_core]) from [] (vc4_hdmi_bind+0x43c/0x5f4 [vc4])
[] (vc4_hdmi_bind [vc4]) from [] (component_bind_all+0xec/0x24c)
[] (component_bind_all) from [] (vc4_drm_bind+0xd4/0x174 [vc4])
[] (vc4_drm_bind [vc4]) from [] (try_to_bring_up_master+0x160/0x1b0)
[] (try_to_bring_up_master) from [] (component_master_add_with_match+0xd0/0x104)
[] (component_master_add_with_match) from [] (vc4_platform_drm_probe+0x9c/0xbc [vc4])
[] (vc4_platform_drm_probe [vc4]) from [] (platform_drv_probe+0x6c/0xa4)
[] (platform_drv_probe) from [] (really_probe+0x210/0x350)
[] (really_probe) from [] (driver_probe_device+0x5c/0xb4)
[] (driver_probe_device) from [] (device_driver_attach+0x58/0x60)
[] (device_driver_attach) from [] (__driver_attach+0x80/0xbc)
[] (__driver_attach) from [] (bus_for_each_dev+0x68/0xb4)
[] (bus_for_each_dev) from [] (bus_add_driver+0x130/0x1e8)
[] (bus_add_driver) from [] (driver_register+0x78/0x110)
[] (driver_register) from [] (do_one_initcall+0x50/0x220)
[] (do_one_initcall) from [] (do_init_module+0x60/0x210)
[] (do_init_module) from [] (load_module+0x1e34/0x2338)
[] (load_module) from [] (sys_finit_module+0xac/0xbc)
[] (sys_finit_module) from [] (ret_fast_syscall+0x0/0x54)
Exception stack(0xeded9fa8 to 0xeded9ff0)
...
---[ end trace 6414689569c2bc08 ]---Fixes: bb7d78568814 ("drm/vc4: Add HDMI audio support")
Suggested-by: Takashi Iwai
Signed-off-by: Marek Szyprowski
Tested-by: Stefan Wahren
Signed-off-by: Maxime Ripard
Link: https://patchwork.freedesktop.org/patch/msgid/20200701073949.28941-1-m.szyprowski@samsung.com
Signed-off-by: Sasha Levin -
[ Upstream commit 2f228aab21bbc74e90e267a721215ec8be51daf7 ]
Don't check drm_crtc_state::active for this either, per its
documentation in include/drm/drm_crtc.h:* Hence drivers must not consult @active in their various
* &drm_mode_config_funcs.atomic_check callback to reject an atomic
* commit.atomic_remove_fb disables the CRTC as needed for disabling the primary
plane.This prevents at least the following problems if the primary plane gets
disabled (e.g. due to destroying the FB assigned to the primary plane,
as happens e.g. with mutter in Wayland mode):* The legacy cursor ioctl returned EINVAL for a non-0 cursor FB ID
(which enables the cursor plane).
* If the cursor plane was enabled, changing the legacy DPMS property
value from off to on returned EINVAL.v2:
* Minor changes to code comment and commit log, per review feedback.GitLab: https://gitlab.gnome.org/GNOME/mutter/-/issues/1108
GitLab: https://gitlab.gnome.org/GNOME/mutter/-/issues/1165
GitLab: https://gitlab.gnome.org/GNOME/mutter/-/issues/1344
Suggested-by: Daniel Vetter
Acked-by: Daniel Vetter
Reviewed-by: Nicholas Kazlauskas
Signed-off-by: Michel Dänzer
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit c4790a8894232f39c25c7c546c06efe074e63384 ]
[why]
Recent characterization shows increased stutter latencies on some SKUs,
leading to underflow.[how]
Update SOC params to account for this worst case latency.Signed-off-by: Jun Lei
Acked-by: Aurabindo Pillai
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit 087d764159996ae378b08c0fdd557537adfd6899 ]
In the resume stage of GPU recovery, start_cpsch will call pm_init
which set pm->allocated as false, cause the next pm_release_ib has
no chance to release ib memory.Add pm_release_ib in stop_cpsch which will be called in the suspend
stage of GPU recovery.Reviewed-by: Felix Kuehling
Signed-off-by: Dennis Li
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit dc455f4c888365595c0a13da445e092422d55b8d ]
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.Signed-off-by: Dinghao Liu
Signed-off-by: Ben Skeggs
Signed-off-by: Sasha Levin -
[ Upstream commit d7372dfb3f7f1602b87e0663e8b8646da23ebca7 ]
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.Signed-off-by: Dinghao Liu
Signed-off-by: Ben Skeggs
Signed-off-by: Sasha Levin -
[ Upstream commit 00583fbe8031f69bba8b0a9a861efb75fb7131af ]
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.Signed-off-by: Dinghao Liu
Signed-off-by: Ben Skeggs
Signed-off-by: Sasha Levin -
[ Upstream commit f7646585a30ed8ef5ab300d4dc3b0c1d6afbe71d ]
In free memory of gpu path, remove bo from validate_list to make sure
restore worker don't access the BO any more, then unregister bo MMU
interval notifier. Otherwise, the restore worker will crash in the
middle of validating BO user pages if MMU interval notifer is gone.Signed-off-by: Philip Yang
Reviewed-by: Felix Kuehling
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit 547a7348633b1f9923551f94ac3157a613d2c9f2 ]
'exynos_dsi_parse_dt()' takes a reference to 'dsi->in_bridge_node'.
This must be released in the error handling path.In order to do that, add an error handling path and move the
'exynos_dsi_parse_dt()' call from the beginning to the end of the probe
function to ease the error handling path.
This function only sets some variables which are used only in the
'transfer' function.The call chain is:
.transfer
--> exynos_dsi_host_transfer
--> exynos_dsi_init
--> exynos_dsi_enable_clock (use burst_clk_rate and esc_clk_rate)
--> exynos_dsi_set_pll (use pll_clk_rate)While at it, also handle cases where 'component_add()' fails.
This patch is similar to commit 70505c2ef94b ("drm/exynos: dsi: Remove bridge node reference in removal")
which fixed the issue in the remove function.Signed-off-by: Christophe JAILLET
Signed-off-by: Inki Dae
Signed-off-by: Sasha Levin -
[ Upstream commit 04bef61e5da18c2b301c629a209ccdba4d4c6fbb ]
kfd_pre_reset will free mem_objs allocated by kfd_gtt_sa_allocate
Without this change, sriov tdr code path will never free those allocated
memories and get memory leak.v2:add a bugfix for kiq ring test fail
Signed-off-by: Jack Zhang
Reviewed-by: Monk Liu
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit ef563ff403404ef2f234abe79bdd9f04ab6481c9 ]
Add vcn dpg harware synchronization to fix race condition
issue between vcn driver and hardware.Signed-off-by: James Zhu
Reviewed-by: Leo Liu
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit 72e0ef0e5f067fd991f702f0b2635d911d0cf208 ]
On some EFI systems, the video BIOS is provided by the EFI firmware. The
boot stub code stores the physical address of the ROM image in pdev->rom.
Currently we attempt to access this pointer using phys_to_virt(), which
doesn't work with CONFIG_HIGHMEM.On these systems, attempting to load the radeon module on a x86_32 kernel
can result in the following:BUG: unable to handle page fault for address: 3e8ed03c
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
*pde = 00000000
Oops: 0000 [#1] PREEMPT SMP
CPU: 0 PID: 317 Comm: systemd-udevd Not tainted 5.6.0-rc3-next-20200228 #2
Hardware name: Apple Computer, Inc. MacPro1,1/Mac-F4208DC8, BIOS MP11.88Z.005C.B08.0707021221 07/02/07
EIP: radeon_get_bios+0x5ed/0xe50 [radeon]
Code: 00 00 84 c0 0f 85 12 fd ff ff c7 87 64 01 00 00 00 00 00 00 8b 47 08 8b 55 b0 e8 1e 83 e1 d6 85 c0 74 1a 8b 55 c0 85 d2 74 13 38 55 75 0e 80 78 01 aa 0f 84 a4 03 00 00 8d 74 26 00 68 dc 06
EAX: 3e8ed03c EBX: 00000000 ECX: 3e8ed03c EDX: 00010000
ESI: 00040000 EDI: eec04000 EBP: eef3fc60 ESP: eef3fbe0
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 EFLAGS: 00010206
CR0: 80050033 CR2: 3e8ed03c CR3: 2ec77000 CR4: 000006d0
Call Trace:
r520_init+0x26/0x240 [radeon]
radeon_device_init+0x533/0xa50 [radeon]
radeon_driver_load_kms+0x80/0x220 [radeon]
drm_dev_register+0xa7/0x180 [drm]
radeon_pci_probe+0x10f/0x1a0 [radeon]
pci_device_probe+0xd4/0x140Fix the issue by updating all drivers which can access a platform provided
ROM. Instead of calling the helper function pci_platform_rom() which uses
phys_to_virt(), call ioremap() directly on the pdev->rom.radeon_read_platform_bios() previously directly accessed an __iomem
pointer. Avoid this by calling memcpy_fromio() instead of kmemdup().pci_platform_rom() now has no remaining callers, so remove it.
Link: https://lore.kernel.org/r/20200319021623.5426-1-mikel@mikelr.com
Signed-off-by: Mikel Rychliski
Signed-off-by: Bjorn Helgaas
Acked-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit 0478b4fc5f37f4d494245fe7bcce3f531cf380e9 ]
If the opp table specifies opp-supported-hw as a property but the driver
has not set a supported hardware value the OPP subsystem will reject
all the table entries.Set a "default" value that will match the default table entries but not
conflict with any possible real bin values. Also fix a small memory leak
and free the buffer allocated by nvmem_cell_read().Signed-off-by: Jordan Crouse
Reviewed-by: Eric Anholt
Signed-off-by: Rob Clark
Signed-off-by: Sasha Levin -
[ Upstream commit 66be340f827554cb1c8a1ed7dea97920b4085af2 ]
We should free resources in unlikely case of allocation failure.
Signed-off-by: Pavel Machek
Signed-off-by: Rob Clark
Signed-off-by: Sasha Levin -
[ Upstream commit a0e40018dcc3f59a10ca21d58f8ea8ceb1b035ac ]
Raven provides retimer feature support that requires i2c interaction in
order to make it work well, all settings required for this configuration
are loaded from the Atom bios which include the i2c address. If the
retimer feature is not available, we should abort the attempt to set
this feature, otherwise, it makes the following line return
I2C_CHANNEL_OPERATION_NO_RESPONSE:i2c_success = i2c_write(pipe_ctx, slave_address, buffer, sizeof(buffer));
...
if (!i2c_success)
ASSERT(i2c_success);This ends up causing problems with hotplugging HDMI displays on Raven,
and causes retimer settings to warn like so:WARNING: CPU: 1 PID: 429 at
drivers/gpu/drm/amd/amdgpu/../dal/dc/core/dc_link.c:1998
write_i2c_retimer_setting+0xc2/0x3c0 [amdgpu] Modules linked in:
edac_mce_amd ccp kvm irqbypass binfmt_misc crct10dif_pclmul crc32_pclmul
ghash_clmulni_intel snd_hda_codec_realtek snd_hda_codec_generic
ledtrig_audio snd_hda_codec_hdmi snd_hda_intel amdgpu(+) snd_hda_codec
snd_hda_core snd_hwdep snd_pcm snd_seq_midi snd_seq_midi_event
snd_rawmidi aesni_intel snd_seq amd_iommu_v2 gpu_sched aes_x86_64
crypto_simd cryptd glue_helper snd_seq_device ttm drm_kms_helper
snd_timer eeepc_wmi wmi_bmof asus_wmi sparse_keymap drm mxm_wmi snd
k10temp fb_sys_fops syscopyarea sysfillrect sysimgblt soundcore joydev
input_leds mac_hid sch_fq_codel parport_pc ppdev lp parport ip_tables
x_tables autofs4 igb i2c_algo_bit hid_generic usbhid i2c_piix4 dca ahci
hid libahci video wmi gpio_amdpt gpio_generic CPU: 1 PID: 429 Comm:
systemd-udevd Tainted: G W 5.2.0-rc1sept162019+ #1
Hardware name: System manufacturer System Product Name/ROG STRIX B450-F
GAMING, BIOS 2605 08/06/2019
RIP: 0010:write_i2c_retimer_setting+0xc2/0x3c0 [amdgpu]
Code: ff 0f b6 4d ce 44 0f b6 45 cf 44 0f b6 c8 45 89 cf 44 89 e2 48 c7
c6 f0 34 bc c0 bf 04 00 00 00 e8 63 b0 90 ff 45 84 ff 75 02 0b 42
0f b6 04 73 8d 50 f6 80 fa 02 77 8c 3c 0a 0f 85 c8 00 00 RSP:
0018:ffffa99d02726fd0 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffffa99d02727035 RCX: 0000000000000006
RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff976acc857440
RBP: ffffa99d02727018 R08: 0000000000000002 R09: 000000000002a600
R10: ffffe90610193680 R11: 00000000000005e3 R12: 000000000000005d
R13: ffff976ac4b201b8 R14: 0000000000000001 R15: 0000000000000000
FS: 00007f14f99e1680(0000) GS:ffff976acc840000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fdf212843b8 CR3: 0000000408906000 CR4: 00000000003406e0
Call Trace:
core_link_enable_stream+0x626/0x680 [amdgpu]
dce110_apply_ctx_to_hw+0x414/0x4e0 [amdgpu]
dc_commit_state+0x331/0x5e0 [amdgpu]
? drm_calc_timestamping_constants+0xf9/0x150 [drm]
amdgpu_dm_atomic_commit_tail+0x395/0x1e00 [amdgpu]
? dm_plane_helper_prepare_fb+0x20c/0x280 [amdgpu]
commit_tail+0x42/0x70 [drm_kms_helper]
drm_atomic_helper_commit+0x10c/0x120 [drm_kms_helper]
amdgpu_dm_atomic_commit+0x95/0xa0 [amdgpu]
drm_atomic_commit+0x4a/0x50 [drm]
restore_fbdev_mode_atomic+0x1c0/0x1e0 [drm_kms_helper]
restore_fbdev_mode+0x4c/0x160 [drm_kms_helper]
? _cond_resched+0x19/0x40
drm_fb_helper_restore_fbdev_mode_unlocked+0x4e/0xa0 [drm_kms_helper]
drm_fb_helper_set_par+0x2d/0x50 [drm_kms_helper]
fbcon_init+0x471/0x630
visual_init+0xd5/0x130
do_bind_con_driver+0x20a/0x430
do_take_over_console+0x7d/0x1b0
do_fbcon_takeover+0x5c/0xb0
fbcon_event_notify+0x6cd/0x8a0
notifier_call_chain+0x4c/0x70
blocking_notifier_call_chain+0x43/0x60
fb_notifier_call_chain+0x1b/0x20
register_framebuffer+0x254/0x360
__drm_fb_helper_initial_config_and_unlock+0x2c5/0x510 [drm_kms_helper]
drm_fb_helper_initial_config+0x35/0x40 [drm_kms_helper]
amdgpu_fbdev_init+0xcd/0x100 [amdgpu]
amdgpu_device_init+0x1156/0x1930 [amdgpu]
amdgpu_driver_load_kms+0x8d/0x2e0 [amdgpu]
drm_dev_register+0x12b/0x1c0 [drm]
amdgpu_pci_probe+0xd3/0x160 [amdgpu]
local_pci_probe+0x47/0xa0
pci_device_probe+0x142/0x1b0
really_probe+0xf5/0x3d0
driver_probe_device+0x11b/0x130
device_driver_attach+0x58/0x60
__driver_attach+0xa3/0x140
? device_driver_attach+0x60/0x60
? device_driver_attach+0x60/0x60
bus_for_each_dev+0x74/0xb0
? kmem_cache_alloc_trace+0x1a3/0x1c0
driver_attach+0x1e/0x20
bus_add_driver+0x147/0x220
? 0xffffffffc0cb9000
driver_register+0x60/0x100
? 0xffffffffc0cb9000
__pci_register_driver+0x5a/0x60
amdgpu_init+0x74/0x83 [amdgpu]
do_one_initcall+0x4a/0x1fa
? _cond_resched+0x19/0x40
? kmem_cache_alloc_trace+0x3f/0x1c0
? __vunmap+0x1cc/0x200
do_init_module+0x5f/0x227
load_module+0x2330/0x2b40
__do_sys_finit_module+0xfc/0x120
? __do_sys_finit_module+0xfc/0x120
__x64_sys_finit_module+0x1a/0x20
do_syscall_64+0x5a/0x130
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f14f9500839
Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89
f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 3d 01
f0 ff ff 73 01 c3 48 8b 0d 1f f6 2c 00 f7 d8 64 89 01 48
RSP: 002b:00007fff9bc4f5a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
RAX: ffffffffffffffda RBX: 000055afb5abce30 RCX: 00007f14f9500839
RDX: 0000000000000000 RSI: 000055afb5ace0f0 RDI: 0000000000000017
RBP: 000055afb5ace0f0 R08: 0000000000000000 R09: 000000000000000a
R10: 0000000000000017 R11: 0000000000000246 R12: 0000000000000000
R13: 000055afb5aad800 R14: 0000000000020000 R15: 0000000000000000
---[ end trace c286e96563966f08 ]---This commit reworks the way that we handle i2c write for retimer in the
way that we abort this configuration if the feature is not available in
the device. For debug sake, we kept a simple log message in case the
retimer is not available.Signed-off-by: Rodrigo Siqueira
Reviewed-by: Hersen Wu
Acked-by: Rodrigo Siqueira
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit 1b3460a8b19688ad3033b75237d40fa580a5a953 ]
mitigates race condition on BACO reset between GPU bootcode and driver reload
Reviewed-by: Hawking Zhang
Signed-off-by: John Clements
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit df8e34ac27e8a0d8dce364628226c5619693c3fd ]
[why]
When combining two or more pipes in DSC mode, there will always be more
than 1 slice per line. In this case, as per DSC rules, the sink device
is expecting that the ICH is reset at the end of each slice line (i.e.
ICH_RESET_AT_END_OF_LINE must be configured based on the number of
slices at the output of ODM). It is recommended that software set
ICH_RESET_AT_END_OF_LINE = 0xF for each DSC in the ODM combine. However
the current code only set ICH_RESET_AT_END_OF_LINE = 0xF when number of
slice per DSC engine is greater than 1 instead of number of slice per
output after ODM combine.[how]
Add is_odm in dsc config. Set ICH_RESET_AT_END_OF_LINE = 0xF if either
is_odm or number of slice per DSC engine is greater than 1.Signed-off-by: Wenjing Liu
Reviewed-by: Nikola Cornij
Acked-by: Rodrigo Siqueira
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit 2a0a3ae17d36fa86dcf7c8e8d7b7f056ebd6c064 ]
When the DSS initialises its output DPI and SDI ports, failures don't
clean up previous successfully initialised ports. This can lead to
resource leak or memory corruption. Fix it.Reported-by: Hans Verkuil
Signed-off-by: Laurent Pinchart
Reviewed-by: Tomi Valkeinen
Acked-by: Sam Ravnborg
Tested-by: Sebastian Reichel
Reviewed-by: Sebastian Reichel
Signed-off-by: Tomi Valkeinen
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-22-laurent.pinchart@ideasonboard.com
Signed-off-by: Sasha Levin -
[ Upstream commit 6a6c4a4d459ecacc9013c45dcbf2bc9747fdbdbd ]
[Why]
Since the i2c payload allocation can fail need to check return codes[How]
Clean up i2c payload allocations and check for errorsSigned-off-by: Aric Cyr
Reviewed-by: Joshua Aberback
Acked-by: Rodrigo Siqueira
Acked-by: Harry Wentland
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit 47340e46f34a3b1d80e40b43ae3d7a8da34a3541 ]
The call to of_find_matching_node returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.Detected by coccinelle with the following warnings:
drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c:212:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 209, but without a corresponding object release within this function.
drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c:237:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 209, but without a corresponding object release within this function.Signed-off-by: Wen Yang
Reviewed-by: Laurent Pinchart
Reviewed-by: Mukesh Ojha
Cc: Tomi Valkeinen
Cc: David Airlie
Cc: Daniel Vetter
Cc: Sebastian Reichel
Cc: Laurent Pinchart
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: Markus Elfring
Signed-off-by: Tomi Valkeinen
Link: https://patchwork.freedesktop.org/patch/msgid/1554692313-28882-2-git-send-email-wen.yang99@zte.com.cn
Signed-off-by: Sasha Levin -
[ Upstream commit 85e148fb963d27152a14e6d399a47aed9bc99c15 ]
[Why]
these registers should have been double buffered. SW workaround we will have SW program the more aggressive (lower) values
whenever we are upating this register, so we will not have underflow at expense of less optimzal request pattern.[How]
there is a driver bug where we don't check for 0, which is uninitialzed HW default. since 0 is smaller than any value we need to program,
driver end up with not programming these registersSigned-off-by: Tony Cheng
Reviewed-by: Yongqiang Sun
Acked-by: Bhawanpreet Lakha
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit b6adc57cff616da18ff8cff028d2ddf585c97334 ]
For DSC MST, sometimes monitors would break out
in full-screen static. The issue traced back to the
PPS generation code, where these variables were being used
uninitialized and were picking up garbage.memset to 0 to avoid this
Reviewed-by: Nicholas Kazlauskas
Signed-off-by: David Francis
Signed-off-by: Mikita Lipski
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit 135517d3565b48f4def3b1b82008bc17eb5d1c90 ]
Problem:
Due to a race between drm_sched_cleanup_jobs in sched thread and
drm_sched_job_timedout in timeout work there is a possiblity that
bad job was already freed while still being accessed from the
timeout thread.Fix:
Instead of just peeking at the bad job in the mirror list
remove it from the list under lock and then put it back later when
we are garanteed no race with main sched thread is possible which
is after the thread is parked.v2: Lock around processing ring_mirror_list in drm_sched_cleanup_jobs.
v3: Rebase on top of drm-misc-next. v2 is not needed anymore as
drm_sched_get_cleanup_job already has a lock there.v4: Fix comments to relfect latest code in drm-misc.
Signed-off-by: Andrey Grodzovsky
Reviewed-by: Christian König
Reviewed-by: Emily Deng
Tested-by: Emily Deng
Signed-off-by: Christian König
Link: https://patchwork.freedesktop.org/patch/342356
Signed-off-by: Sasha Levin -
[ Upstream commit 97de863673f07f424dd0666aefb4b6ecaba10171 ]
Disabling the display using MCDE currently results in a warning
together with a delay caused by some timeouts:mcde a0350000.mcde: MCDE display is disabled
------------[ cut here ]------------
WARNING: CPU: 0 PID: 20 at drivers/gpu/drm/drm_atomic_helper.c:2258 drm_atomic_helper_commit_hw_done+0xe0/0xe4
Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support)
Workqueue: events drm_mode_rmfb_work_fn
[] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[] (show_stack) from [] (dump_stack+0x84/0x98)
[] (dump_stack) from [] (__warn+0xb8/0xd4)
[] (__warn) from [] (warn_slowpath_fmt+0x64/0xc4)
[] (warn_slowpath_fmt) from [] (drm_atomic_helper_commit_hw_done+0xe0/0xe4)
[] (drm_atomic_helper_commit_hw_done) from [] (drm_atomic_helper_commit_tail_rpm+0x44/0x6c)
[] (drm_atomic_helper_commit_tail_rpm) from [] (commit_tail+0x50/0x10c)
[] (commit_tail) from [] (drm_atomic_helper_commit+0xbc/0x128)
[] (drm_atomic_helper_commit) from [] (drm_framebuffer_remove+0x390/0x428)
[] (drm_framebuffer_remove) from [] (drm_mode_rmfb_work_fn+0x38/0x48)
[] (drm_mode_rmfb_work_fn) from [] (process_one_work+0x1f0/0x43c)
[] (process_one_work) from [] (worker_thread+0x254/0x55c)
[] (worker_thread) from [] (kthread+0x124/0x150)
[] (kthread) from [] (ret_from_fork+0x14/0x2c)
Exception stack(0xeb14dfb0 to 0xeb14dff8)
dfa0: 00000000 00000000 00000000 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
---[ end trace 314909bcd4c7d50c ]---
[drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CRTC:32:crtc-0] flip_done timed out
[drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [CONNECTOR:34:DSI-1] flip_done timed out
[drm:drm_atomic_helper_wait_for_dependencies] *ERROR* [PLANE:31:plane-0] flip_done timed outThe reason for this is that there is a vblank event pending, but we
never handle it after disabling the vblank interrupts.Check if there is an vblank event pending when disabling the display,
and clear it by sending a fake vblank event in that case.Signed-off-by: Stephan Gerhold
Tested-by: Linus Walleij
Reviewed-by: Linus Walleij
Signed-off-by: Linus Walleij
Link: https://patchwork.freedesktop.org/patch/msgid/20191106165835.2863-8-stephan@gerhold.net
Signed-off-by: Sasha Levin -
[ Upstream commit 82a829dc8c2bb03cc9b7e5beb1c5479aa3ba7831 ]
issue:
kernel would report a warning from a double unpin
during the driver unloading on the CSB bowhy:
we unpin it during hw_fini, and there will be another
unpin in sw_fini on CSB bo.fix:
actually we don't need to pin/unpin it during
hw_init/fini since it is created with kernel pinned,
we only need to fullfill the CSB again during hw_init
to prevent CSB/VRAM lost after S3v2:
get_csb in init_rlc so hw_init() will make CSIB content
back even after reset or s3v3:
use bo_create_kernel instead of bo_create_reserved for CSB
otherwise the bo_free_kernel() on CSB is not aligned and
would lead to its internal reserve pending there forevertake care of gfx7/8 as well
Signed-off-by: Monk Liu
Reviewed-by: Hawking Zhang
Reviewed-by: Xiaojie Yuan
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin -
[ Upstream commit 901245624c7812b6c95d67177bae850e783b5212 ]
When a custom powerplay table is provided, we need to update
the OD VDDC flag to avoid AVFS being enabled when it shouldn't be.Bug: https://bugzilla.kernel.org/show_bug.cgi?id=205393
Reviewed-by: Evan Quan
Signed-off-by: Alex Deucher
Signed-off-by: Sasha Levin