Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Failures with latest kernel updates, the Chronicles of RK3288 #98

Open
Tonymac32 opened this issue May 31, 2018 · 17 comments
Open

Comments

@Tonymac32
Copy link
Contributor

Tonymac32 commented May 31, 2018

Placeholder for current of issues:

  • MIDGARD_FOR_ANDROID requires mali build as module and/or MALI_PWRSOFT_765=y
  • MIDGARD_FOR_LINUX is too outdated to use with Rockchip user drivers
  • Error loading Mali driver (see below)
  • Many dw_hdmi errors in dmesg

This was a perfectly functioning kernel config only 2 weeks ago with the Rockchip source, it is now unbootable (in fact it did not even build initially, as soon as these updates went live on github)

@Tonymac32
Copy link
Contributor Author

Also, if using "Midgard for Linux" we get a version mismatch of kernel 10.4, user 10.6 with the rockchip user driver.

@Tonymac32
Copy link
Contributor Author

Tonymac32 commented Jun 1, 2018

OK, it was determined selecting CONFIG_MALI_PWRSOFT_765=y makes it compile, but there were still some other issues. Is there a config recommendation as that has obviously been affected?

  • edit: compile but no boot.

@Tonymac32
Copy link
Contributor Author

OK: Midgard for Android
Config mali as module or else everything explodes
CONFIG_MALI_PWRSOFT_765=y

boots. But, no serial console on HDMI, no HDMI output at all until X starts.

also:

[    4.453675] mali ffa30000.gpu: Failed to get leakage
[    4.453722] mali ffa30000.gpu: Failed to get pvtm
[    4.454086] W : [File] : drivers/gpu/arm/midgard/platform/rk/mali_kbase_config_rk.c; [Line] : 113; [Func] : kbase_platform_rk_init(); power-off-delay-ms not available.
[    4.454958] mali ffa30000.gpu: GPU identified as 0x0750 r0p0 status 1
[    4.455114] mali ffa30000.gpu: Protected mode not available
[    4.455386] ERROR: Bad of_node_put() on /gpu@ffa30000
[    4.455395] CPU: 3 PID: 159 Comm: systemd-udevd Not tainted 4.4.135-rockchip #46
[    4.455399] Hardware name: Rockchip (Device Tree)
[    4.455423] [<c0110104>] (unwind_backtrace) from [<c010bde0>] (show_stack+0x20/0x24)
[    4.455435] [<c010bde0>] (show_stack) from [<c05ab490>] (dump_stack+0x84/0xa4)
[    4.455447] [<c05ab490>] (dump_stack) from [<c0930658>] (of_node_release+0x34/0x9c)
[    4.455458] [<c0930658>] (of_node_release) from [<c05ad514>] (kobject_put+0xbc/0xdc)
[    4.455466] [<c05ad514>] (kobject_put) from [<c092fd1c>] (of_node_put+0x24/0x28)
[    4.455475] [<c092fd1c>] (of_node_put) from [<c092c718>] (of_find_compatible_node+0x48/0x98)
[    4.455553] [<c092c718>] (of_find_compatible_node) from [<bf0209e4>] (get_model_dt_node+0x4c/0x90 [midgard_kbase])
[    4.455689] [<bf0209e4>] (get_model_dt_node [midgard_kbase]) from [<bf020d5c>] (kbase_ipa_model_add_param_string+0x34/0xdc [midgard_kbase])
[    4.455822] [<bf020d5c>] (kbase_ipa_model_add_param_string [midgard_kbase]) from [<bf0208e8>] (kbase_simple_power_model_init+0xbc/0xdc [midgard_kbase])
[    4.455955] [<bf0208e8>] (kbase_simple_power_model_init [midgard_kbase]) from [<bf020eb4>] (kbase_ipa_init_model+0x6c/0xb4 [midgard_kbase])
[    4.456087] [<bf020eb4>] (kbase_ipa_init_model [midgard_kbase]) from [<bf020fb4>] (kbase_ipa_init+0xb8/0x17c [midgard_kbase])
[    4.456218] [<bf020fb4>] (kbase_ipa_init [midgard_kbase]) from [<bf02bf8c>] (kbase_devfreq_init+0x3fc/0x4e0 [midgard_kbase])
[    4.456348] [<bf02bf8c>] (kbase_devfreq_init [midgard_kbase]) from [<bf0189d8>] (kbase_platform_device_probe+0x5e0/0xae0 [midgard_kbase])
[    4.456422] [<bf0189d8>] (kbase_platform_device_probe [midgard_kbase]) from [<c06c335c>] (platform_drv_probe+0x60/0xac)
[    4.456433] [<c06c335c>] (platform_drv_probe) from [<c06c16a0>] (driver_probe_device+0x1a8/0x298)
[    4.456442] [<c06c16a0>] (driver_probe_device) from [<c06c17ec>] (__driver_attach+0x5c/0x9c)
[    4.456451] [<c06c17ec>] (__driver_attach) from [<c06bfb84>] (bus_for_each_dev+0x90/0xa0)
[    4.456459] [<c06bfb84>] (bus_for_each_dev) from [<c06c1128>] (driver_attach+0x28/0x30)
[    4.456466] [<c06c1128>] (driver_attach) from [<c06c0d64>] (bus_add_driver+0x184/0x1ec)
[    4.456475] [<c06c0d64>] (bus_add_driver) from [<c06c2354>] (driver_register+0xb0/0xf0)
[    4.456482] [<c06c2354>] (driver_register) from [<c06c329c>] (__platform_driver_register+0x40/0x54)
[    4.456549] [<c06c329c>] (__platform_driver_register) from [<bf054018>] (kbase_platform_driver_init+0x18/0x1000 [midgard_kbase])
[    4.456617] [<bf054018>] (kbase_platform_driver_init [midgard_kbase]) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    4.456629] [<c0101ba8>] (do_one_initcall) from [<c01ecabc>] (do_init_module+0x6c/0x3a8)
[    4.456641] [<c01ecabc>] (do_init_module) from [<c01a5668>] (load_module+0x1d48/0x1d94)
[    4.456651] [<c01a5668>] (load_module) from [<c01a5880>] (SyS_finit_module+0x70/0x78)
[    4.456660] [<c01a5880>] (SyS_finit_module) from [<c0107600>] (ret_fast_syscall+0x0/0x48)
[    4.456691] mali ffa30000.gpu: Using configured power model mali-simple-power-model, and fallback mali-simple-power-model
[    4.456812] I : [File] : drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c; [Line] : 399; [Func] : kbase_devfreq_init(); success initing power_model_simple.
[    4.457789] mali ffa30000.gpu: Probed as mali0
[    4.470893] devfreq ffa30000.gpu: Couldn't update frequency transition information.

I also get a heap of


[   85.943087] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[   85.943112] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[   85.943124] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[   85.943145] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[   85.943156] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[   85.943168] [drm:dw_hdmi_rockchip_set_property] *ERROR* failed to set rockchip hdmi connector property
[   85.943574] rockchip-vop ff930000.vop: [drm:vop_crtc_enable] Update mode to 1920x1080p0, type: 11

I'm reading through commits to try to get a feel of what's going on.

@Tonymac32 Tonymac32 changed the title Build failure after recent update to Mali Midgard Driver Multiple Failures with latest kernel updates, the Chronicles of RK3288 Jun 8, 2018
@Tonymac32
Copy link
Contributor Author

I will be updating as I resolve/uncover more issues or until intervention.

@Ntemis
Copy link

Ntemis commented Jun 8, 2018

Will bring out the big guns

@Tonymac32
Copy link
Contributor Author

@Ntemis your config updates brought back the framebuffer console, cheers!

@Ntemis
Copy link

Ntemis commented Jun 8, 2018

rk3288 do not support hdr metadata so your dmesg log about DW HDMI error messages is normal

@Tonymac32
Copy link
Contributor Author

Didn't think of that

@Ntemis
Copy link

Ntemis commented Jun 9, 2018

btw on armbian rockchip-default http://dpaste.com/37Y884R
and MiQi supports HDR Metadata Detected HDMI TX controller v2.01a with HDCP (DWC HDMI 2.0 TX PHY)

@Tonymac32
Copy link
Contributor Author

btw on armbian rockchip-default http://dpaste.com/37Y884R

What? Mine isn't showing that, are you saying they should be 755 or are 755? (should be 644)

@Ntemis
Copy link

Ntemis commented Jun 9, 2018

somehow they were locked to root

@Tonymac32
Copy link
Contributor Author

interesting. I'll clone it to another machine and see what I get.

@chwe17
Copy link

chwe17 commented Jun 11, 2018

CONFIG_OF_OVERLAY=y leeds to a conflict with your ISP1 driver, see dmesg:

root@tinkerboard:~# dmesg | grep isp
[    1.877338] iommu: Adding device ff910000.isp to group 0
[    2.387517] rockchip-drm display-subsystem: devfreq is not set
[    2.389212] rockchip-drm display-subsystem: bound ff940000.vop (ops 0xc0c761d4)
[    2.390343] rockchip-drm display-subsystem: bound ff930000.vop (ops 0xc0c761d4)
[    2.392101] rockchip-drm display-subsystem: bound ff980000.hdmi (ops 0xc0c6ed78)
[    2.392331] rockchip-drm display-subsystem: failed to parse display resources
[    2.392389] rockchip-drm display-subsystem: No connectors reported connected with modes
[    2.434774] rockchip-drm display-subsystem: fb0:  frame buffer device
[    2.788622] ERROR: Bad of_node_put() on /isp@ff910000/port
[    2.788955] [<c0818fdc>] (v4l2_async_notifier_parse_fwnode_endpoints) from [<c08507f4>] (rkisp1_plat_probe+0x2bc/0x440)
[    2.788977] [<c08507f4>] (rkisp1_plat_probe) from [<c06a5fbc>] (platform_drv_probe+0x60/0xac)
[    2.789152] [<c06a5efc>] (__platform_driver_register) from [<c103bf1c>] (rkisp1_plat_drv_init+0x18/0x20)
[    2.789174] [<c103bf1c>] (rkisp1_plat_drv_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.789678] [<c0818fdc>] (v4l2_async_notifier_parse_fwnode_endpoints) from [<c08507f4>] (rkisp1_plat_probe+0x2bc/0x440)
[    2.789698] [<c08507f4>] (rkisp1_plat_probe) from [<c06a5fbc>] (platform_drv_probe+0x60/0xac)
[    2.789867] [<c06a5efc>] (__platform_driver_register) from [<c103bf1c>] (rkisp1_plat_drv_init+0x18/0x20)
[    2.789888] [<c103bf1c>] (rkisp1_plat_drv_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.789993] ERROR: Bad of_node_put() on /isp@ff910000/port
[    2.790304] [<c0818fdc>] (v4l2_async_notifier_parse_fwnode_endpoints) from [<c08507f4>] (rkisp1_plat_probe+0x2bc/0x440)
[    2.790325] [<c08507f4>] (rkisp1_plat_probe) from [<c06a5fbc>] (platform_drv_probe+0x60/0xac)
[    2.790493] [<c06a5efc>] (__platform_driver_register) from [<c103bf1c>] (rkisp1_plat_drv_init+0x18/0x20)
[    2.790514] [<c103bf1c>] (rkisp1_plat_drv_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.790609] ERROR: Bad of_node_put() on /isp@ff910000/port
[    2.790940] [<c0818fdc>] (v4l2_async_notifier_parse_fwnode_endpoints) from [<c08507f4>] (rkisp1_plat_probe+0x2bc/0x440)
[    2.790960] [<c08507f4>] (rkisp1_plat_probe) from [<c06a5fbc>] (platform_drv_probe+0x60/0xac)
[    2.791130] [<c06a5efc>] (__platform_driver_register) from [<c103bf1c>] (rkisp1_plat_drv_init+0x18/0x20)
[    2.791151] [<c103bf1c>] (rkisp1_plat_drv_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.792857] [<c06a5efc>] (__platform_driver_register) from [<c103bf3c>] (rockchip_isp_mipidphy_driver_init+0x18/0x20)
[    2.792880] [<c103bf3c>] (rockchip_isp_mipidphy_driver_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.793427] [<c06a5efc>] (__platform_driver_register) from [<c103bf3c>] (rockchip_isp_mipidphy_driver_init+0x18/0x20)
[    2.793450] [<c103bf3c>] (rockchip_isp_mipidphy_driver_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.794055] [<c06a5efc>] (__platform_driver_register) from [<c103bf3c>] (rockchip_isp_mipidphy_driver_init+0x18/0x20)
[    2.794078] [<c103bf3c>] (rockchip_isp_mipidphy_driver_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.794668] [<c06a5efc>] (__platform_driver_register) from [<c103bf3c>] (rockchip_isp_mipidphy_driver_init+0x18/0x20)
[    2.794691] [<c103bf3c>] (rockchip_isp_mipidphy_driver_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.795235] [<c06a5efc>] (__platform_driver_register) from [<c103bf3c>] (rockchip_isp_mipidphy_driver_init+0x18/0x20)
[    2.795258] [<c103bf3c>] (rockchip_isp_mipidphy_driver_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.795867] [<c06a5efc>] (__platform_driver_register) from [<c103bf3c>] (rockchip_isp_mipidphy_driver_init+0x18/0x20)
[    2.795889] [<c103bf3c>] (rockchip_isp_mipidphy_driver_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.796499] [<c06a5efc>] (__platform_driver_register) from [<c103bf3c>] (rockchip_isp_mipidphy_driver_init+0x18/0x20)
[    2.796522] [<c103bf3c>] (rockchip_isp_mipidphy_driver_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.797078] [<c06a5efc>] (__platform_driver_register) from [<c103bf3c>] (rockchip_isp_mipidphy_driver_init+0x18/0x20)
[    2.797100] [<c103bf3c>] (rockchip_isp_mipidphy_driver_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)
[    2.797657] [<c06a5efc>] (__platform_driver_register) from [<c103bf3c>] (rockchip_isp_mipidphy_driver_init+0x18/0x20)
[    2.797680] [<c103bf3c>] (rockchip_isp_mipidphy_driver_init) from [<c0101ba8>] (do_one_initcall+0x1a0/0x1d4)

and:

root@tinkerboard:~# dmesg | grep ff910000
[    1.877338] iommu: Adding device ff910000.isp to group 0
[    2.788622] ERROR: Bad of_node_put() on /isp@ff910000/port
[    2.789993] ERROR: Bad of_node_put() on /isp@ff910000/port
[    2.790609] ERROR: Bad of_node_put() on /isp@ff910000/port

@Tonymac32
Copy link
Contributor Author

27 days open, I had to take a break due to some other issues outside the software world. I noticed @Ntemis my framebuffer console quit working again, so that will need looked at again. (it's been a couple weeks since I built a kernel)

@Tonymac32
Copy link
Contributor Author

Ah, I forgot the dtsi with the ugly "chosen" stuff was changed, I'll have to retool my patchset and try again.

@skyway22
Copy link

So, is there a solution?

@Tonymac32
Copy link
Contributor Author

A stable point is used in Rockchip 4.4 kernel, it builds fine now.

0lvin pushed a commit to free-z4u/roc-rk3328-cc-official that referenced this issue Oct 5, 2019
Trivial fix to remove the following sparse warnings:

  arch/powerpc/kernel/module_32.c:112:74: warning: Using plain integer as NULL pointer
  arch/powerpc/kernel/module_32.c:117:74: warning: Using plain integer as NULL pointer
  drivers/macintosh/via-pmu.c:1155:28: warning: Using plain integer as NULL pointer
  drivers/macintosh/via-pmu.c:1230:20: warning: Using plain integer as NULL pointer
  drivers/macintosh/via-pmu.c:1385:36: warning: Using plain integer as NULL pointer
  drivers/macintosh/via-pmu.c:1752:23: warning: Using plain integer as NULL pointer
  drivers/macintosh/via-pmu.c:2084:19: warning: Using plain integer as NULL pointer
  drivers/macintosh/via-pmu.c:2110:32: warning: Using plain integer as NULL pointer
  drivers/macintosh/via-pmu.c:2167:19: warning: Using plain integer as NULL pointer
  drivers/macintosh/via-pmu.c:2183:19: warning: Using plain integer as NULL pointer
  drivers/macintosh/via-pmu.c:277:20: warning: Using plain integer as NULL pointer
  arch/powerpc/platforms/powermac/setup.c:155:67: warning: Using plain integer as NULL pointer
  arch/powerpc/platforms/powermac/setup.c:247:27: warning: Using plain integer as NULL pointer
  arch/powerpc/platforms/powermac/setup.c:249:27: warning: Using plain integer as NULL pointer
  arch/powerpc/platforms/powermac/setup.c:252:37: warning: Using plain integer as NULL pointer
  arch/powerpc/mm/tlb_hash32.c:127:21: warning: Using plain integer as NULL pointer
  arch/powerpc/mm/tlb_hash32.c:148:21: warning: Using plain integer as NULL pointer
  arch/powerpc/mm/tlb_hash32.c:44:21: warning: Using plain integer as NULL pointer
  arch/powerpc/mm/tlb_hash32.c:57:21: warning: Using plain integer as NULL pointer
  arch/powerpc/mm/tlb_hash32.c:87:21: warning: Using plain integer as NULL pointer
  arch/powerpc/kernel/btext.c:160:31: warning: Using plain integer as NULL pointer
  arch/powerpc/kernel/btext.c:167:22: warning: Using plain integer as NULL pointer
  arch/powerpc/kernel/btext.c:274:21: warning: Using plain integer as NULL pointer
  arch/powerpc/kernel/btext.c:285:31: warning: Using plain integer as NULL pointer
  arch/powerpc/include/asm/hugetlb.h:204:16: warning: Using plain integer as NULL pointer
  arch/powerpc/mm/ppc_mmu_32.c:170:21: warning: Using plain integer as NULL pointer
  arch/powerpc/platforms/powermac/pci.c:1227:23: warning: Using plain integer as NULL pointer
  arch/powerpc/platforms/powermac/pci.c:65:24: warning: Using plain integer as NULL pointer

Also use `--fix` command line option from `script/checkpatch --strict` to
remove the following:

  CHECK: Comparison to NULL could be written "!dispDeviceBase"
  rockchip-linux#72: FILE: arch/powerpc/kernel/btext.c:160:
  +	if (dispDeviceBase == NULL)

  CHECK: Comparison to NULL could be written "!vbase"
  rockchip-linux#80: FILE: arch/powerpc/kernel/btext.c:167:
  +	if (vbase == NULL)

  CHECK: Comparison to NULL could be written "!base"
  rockchip-linux#89: FILE: arch/powerpc/kernel/btext.c:274:
  +	if (base == NULL)

  CHECK: Comparison to NULL could be written "!dispDeviceBase"
  rockchip-linux#98: FILE: arch/powerpc/kernel/btext.c:285:
  +	if (dispDeviceBase == NULL)

  CHECK: Comparison to NULL could be written "strstr"
  rockchip-linux#117: FILE: arch/powerpc/kernel/module_32.c:117:
  +		if (strstr(secstrings + sechdrs[i].sh_name, ".debug") != NULL)

  CHECK: Comparison to NULL could be written "!Hash"
  rockchip-linux#130: FILE: arch/powerpc/mm/ppc_mmu_32.c:170:
  +	if (Hash == NULL)

  CHECK: Comparison to NULL could be written "Hash"
  rockchip-linux#143: FILE: arch/powerpc/mm/tlb_hash32.c:44:
  +	if (Hash != NULL) {

  CHECK: Comparison to NULL could be written "!Hash"
  rockchip-linux#152: FILE: arch/powerpc/mm/tlb_hash32.c:57:
  +	if (Hash == NULL) {

  CHECK: Comparison to NULL could be written "!Hash"
  rockchip-linux#161: FILE: arch/powerpc/mm/tlb_hash32.c:87:
  +	if (Hash == NULL) {

  CHECK: Comparison to NULL could be written "!Hash"
  rockchip-linux#170: FILE: arch/powerpc/mm/tlb_hash32.c:127:
  +	if (Hash == NULL) {

  CHECK: Comparison to NULL could be written "!Hash"
  rockchip-linux#179: FILE: arch/powerpc/mm/tlb_hash32.c:148:
  +	if (Hash == NULL) {

  ERROR: space required after that ';' (ctx:VxV)
  rockchip-linux#192: FILE: arch/powerpc/platforms/powermac/pci.c:65:
  +	for (; node != NULL;node = node->sibling) {

  CHECK: Comparison to NULL could be written "node"
  rockchip-linux#192: FILE: arch/powerpc/platforms/powermac/pci.c:65:
  +	for (; node != NULL;node = node->sibling) {

  CHECK: Comparison to NULL could be written "!region"
  rockchip-linux#201: FILE: arch/powerpc/platforms/powermac/pci.c:1227:
  +	if (region == NULL)

  CHECK: Comparison to NULL could be written "of_get_property"
  rockchip-linux#214: FILE: arch/powerpc/platforms/powermac/setup.c:155:
  +		if (of_get_property(np, "cache-unified", NULL) != NULL && dc) {

  CHECK: Comparison to NULL could be written "!np"
  rockchip-linux#223: FILE: arch/powerpc/platforms/powermac/setup.c:247:
  +		if (np == NULL)

  CHECK: Comparison to NULL could be written "np"
  rockchip-linux#226: FILE: arch/powerpc/platforms/powermac/setup.c:249:
  +		if (np != NULL) {

  CHECK: Comparison to NULL could be written "l2cr"
  rockchip-linux#230: FILE: arch/powerpc/platforms/powermac/setup.c:252:
  +			if (l2cr != NULL) {

  CHECK: Comparison to NULL could be written "via"
  rockchip-linux#243: FILE: drivers/macintosh/via-pmu.c:277:
  +	if (via != NULL)

  CHECK: Comparison to NULL could be written "current_req"
  rockchip-linux#252: FILE: drivers/macintosh/via-pmu.c:1155:
  +	if (current_req != NULL) {

  CHECK: Comparison to NULL could be written "!req"
  rockchip-linux#261: FILE: drivers/macintosh/via-pmu.c:1230:
  +	if (req == NULL || pmu_state != idle

  CHECK: Comparison to NULL could be written "!req"
  rockchip-linux#270: FILE: drivers/macintosh/via-pmu.c:1385:
  +			if (req == NULL) {

  CHECK: Comparison to NULL could be written "!pp"
  rockchip-linux#288: FILE: drivers/macintosh/via-pmu.c:2084:
  +	if (pp == NULL)

  CHECK: Comparison to NULL could be written "!pp"
  rockchip-linux#297: FILE: drivers/macintosh/via-pmu.c:2110:
  +	if (count < 1 || pp == NULL)

  CHECK: Comparison to NULL could be written "!pp"
  rockchip-linux#306: FILE: drivers/macintosh/via-pmu.c:2167:
  +	if (pp == NULL)

  CHECK: Comparison to NULL could be written "pp"
  rockchip-linux#315: FILE: drivers/macintosh/via-pmu.c:2183:
  +	if (pp != NULL) {

Link: https://github.com/linuxppc/linux/issues/37
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
friendlyarm pushed a commit to friendlyarm/kernel-rockchip that referenced this issue Nov 17, 2020
[ Upstream commit f2d0505 ]

Lockdep complains at boot:

=============================
[ BUG: Invalid wait context ]
5.7.0-05093-g46d91ecd597b rockchip-linux#98 Not tainted
-----------------------------
swapper/1 is trying to lock:
0000000060931b98 (&desc[i].request_mutex){+.+.}-{3:3}, at: __setup_irq+0x11d/0x623
other info that might help us debug this:
context-{4:4}
1 lock held by swapper/1:
 #0: 000000006074fed8 (sigio_spinlock){+.+.}-{2:2}, at: sigio_lock+0x1a/0x1c
stack backtrace:
CPU: 0 PID: 1 Comm: swapper Not tainted 5.7.0-05093-g46d91ecd597b rockchip-linux#98
Stack:
 7fa4fab0 6028dfd1 0000002a 6008bea5
 7fa50700 7fa50040 7fa4fac0 6028e016
 7fa4fb50 6007f6da 60959c18 00000000
Call Trace:
 [<60023a0e>] show_stack+0x13b/0x155
 [<6028e016>] dump_stack+0x2a/0x2c
 [<6007f6da>] __lock_acquire+0x515/0x15f2
 [<6007eb50>] lock_acquire+0x245/0x273
 [<6050d9f1>] __mutex_lock+0xbd/0x325
 [<6050dc76>] mutex_lock_nested+0x1d/0x1f
 [<6008e27e>] __setup_irq+0x11d/0x623
 [<6008e8ed>] request_threaded_irq+0x169/0x1a6
 [<60021eb0>] um_request_irq+0x1ee/0x24b
 [<600234ee>] write_sigio_irq+0x3b/0x76
 [<600383ca>] sigio_broken+0x146/0x2e4
 [<60020bd8>] do_one_initcall+0xde/0x281

Because we hold sigio_spinlock and then get into requesting
an interrupt with a mutex.

Change the spinlock to a mutex to avoid that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Kwiboo pushed a commit to Kwiboo/linux-rockchip that referenced this issue Nov 29, 2020
[ Upstream commit f2d0505 ]

Lockdep complains at boot:

=============================
[ BUG: Invalid wait context ]
5.7.0-05093-g46d91ecd597b rockchip-linux#98 Not tainted
-----------------------------
swapper/1 is trying to lock:
0000000060931b98 (&desc[i].request_mutex){+.+.}-{3:3}, at: __setup_irq+0x11d/0x623
other info that might help us debug this:
context-{4:4}
1 lock held by swapper/1:
 #0: 000000006074fed8 (sigio_spinlock){+.+.}-{2:2}, at: sigio_lock+0x1a/0x1c
stack backtrace:
CPU: 0 PID: 1 Comm: swapper Not tainted 5.7.0-05093-g46d91ecd597b rockchip-linux#98
Stack:
 7fa4fab0 6028dfd1 0000002a 6008bea5
 7fa50700 7fa50040 7fa4fac0 6028e016
 7fa4fb50 6007f6da 60959c18 00000000
Call Trace:
 [<60023a0e>] show_stack+0x13b/0x155
 [<6028e016>] dump_stack+0x2a/0x2c
 [<6007f6da>] __lock_acquire+0x515/0x15f2
 [<6007eb50>] lock_acquire+0x245/0x273
 [<6050d9f1>] __mutex_lock+0xbd/0x325
 [<6050dc76>] mutex_lock_nested+0x1d/0x1f
 [<6008e27e>] __setup_irq+0x11d/0x623
 [<6008e8ed>] request_threaded_irq+0x169/0x1a6
 [<60021eb0>] um_request_irq+0x1ee/0x24b
 [<600234ee>] write_sigio_irq+0x3b/0x76
 [<600383ca>] sigio_broken+0x146/0x2e4
 [<60020bd8>] do_one_initcall+0xde/0x281

Because we hold sigio_spinlock and then get into requesting
an interrupt with a mutex.

Change the spinlock to a mutex to avoid that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Kwiboo pushed a commit to Kwiboo/linux-rockchip that referenced this issue Dec 30, 2020
[ Upstream commit f2d0505 ]

Lockdep complains at boot:

=============================
[ BUG: Invalid wait context ]
5.7.0-05093-g46d91ecd597b rockchip-linux#98 Not tainted
-----------------------------
swapper/1 is trying to lock:
0000000060931b98 (&desc[i].request_mutex){+.+.}-{3:3}, at: __setup_irq+0x11d/0x623
other info that might help us debug this:
context-{4:4}
1 lock held by swapper/1:
 #0: 000000006074fed8 (sigio_spinlock){+.+.}-{2:2}, at: sigio_lock+0x1a/0x1c
stack backtrace:
CPU: 0 PID: 1 Comm: swapper Not tainted 5.7.0-05093-g46d91ecd597b rockchip-linux#98
Stack:
 7fa4fab0 6028dfd1 0000002a 6008bea5
 7fa50700 7fa50040 7fa4fac0 6028e016
 7fa4fb50 6007f6da 60959c18 00000000
Call Trace:
 [<60023a0e>] show_stack+0x13b/0x155
 [<6028e016>] dump_stack+0x2a/0x2c
 [<6007f6da>] __lock_acquire+0x515/0x15f2
 [<6007eb50>] lock_acquire+0x245/0x273
 [<6050d9f1>] __mutex_lock+0xbd/0x325
 [<6050dc76>] mutex_lock_nested+0x1d/0x1f
 [<6008e27e>] __setup_irq+0x11d/0x623
 [<6008e8ed>] request_threaded_irq+0x169/0x1a6
 [<60021eb0>] um_request_irq+0x1ee/0x24b
 [<600234ee>] write_sigio_irq+0x3b/0x76
 [<600383ca>] sigio_broken+0x146/0x2e4
 [<60020bd8>] do_one_initcall+0xde/0x281

Because we hold sigio_spinlock and then get into requesting
an interrupt with a mutex.

Change the spinlock to a mutex to avoid that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scpcom pushed a commit to scpcom/linux that referenced this issue Feb 6, 2021
[ Upstream commit a61df3c ]

syzkaller found the following JFFS2 splat:

  Unable to handle kernel paging request at virtual address dfffa00000000001
  Mem abort info:
    ESR = 0x96000004
    EC = 0x25: DABT (current EL), IL = 32 bits
    SET = 0, FnV = 0
    EA = 0, S1PTW = 0
  Data abort info:
    ISV = 0, ISS = 0x00000004
    CM = 0, WnR = 0
  [dfffa00000000001] address between user and kernel address ranges
  Internal error: Oops: 96000004 [#1] SMP
  Dumping ftrace buffer:
     (ftrace buffer empty)
  Modules linked in:
  CPU: 0 PID: 12745 Comm: syz-executor.5 Tainted: G S                5.9.0-rc8+ rockchip-linux#98
  Hardware name: linux,dummy-virt (DT)
  pstate: 20400005 (nzCv daif +PAN -UAO BTYPE=--)
  pc : jffs2_parse_param+0x138/0x308 fs/jffs2/super.c:206
  lr : jffs2_parse_param+0x108/0x308 fs/jffs2/super.c:205
  sp : ffff000022a57910
  x29: ffff000022a57910 x28: 0000000000000000
  x27: ffff000057634008 x26: 000000000000d800
  x25: 000000000000d800 x24: ffff0000271a9000
  x23: ffffa0001adb5dc0 x22: ffff000023fdcf00
  x21: 1fffe0000454af2c x20: ffff000024cc9400
  x19: 0000000000000000 x18: 0000000000000000
  x17: 0000000000000000 x16: ffffa000102dbdd0
  x15: 0000000000000000 x14: ffffa000109e44bc
  x13: ffffa00010a3a26c x12: ffff80000476e0b3
  x11: 1fffe0000476e0b2 x10: ffff80000476e0b2
  x9 : ffffa00010a3ad60 x8 : ffff000023b70593
  x7 : 0000000000000003 x6 : 00000000f1f1f1f1
  x5 : ffff000023fdcf00 x4 : 0000000000000002
  x3 : ffffa00010000000 x2 : 0000000000000001
  x1 : dfffa00000000000 x0 : 0000000000000008
  Call trace:
   jffs2_parse_param+0x138/0x308 fs/jffs2/super.c:206
   vfs_parse_fs_param+0x234/0x4e8 fs/fs_context.c:117
   vfs_parse_fs_string+0xe8/0x148 fs/fs_context.c:161
   generic_parse_monolithic+0x17c/0x208 fs/fs_context.c:201
   parse_monolithic_mount_data+0x7c/0xa8 fs/fs_context.c:649
   do_new_mount fs/namespace.c:2871 [inline]
   path_mount+0x548/0x1da8 fs/namespace.c:3192
   do_mount+0x124/0x138 fs/namespace.c:3205
   __do_sys_mount fs/namespace.c:3413 [inline]
   __se_sys_mount fs/namespace.c:3390 [inline]
   __arm64_sys_mount+0x164/0x238 fs/namespace.c:3390
   __invoke_syscall arch/arm64/kernel/syscall.c:36 [inline]
   invoke_syscall arch/arm64/kernel/syscall.c:48 [inline]
   el0_svc_common.constprop.0+0x15c/0x598 arch/arm64/kernel/syscall.c:149
   do_el0_svc+0x60/0x150 arch/arm64/kernel/syscall.c:195
   el0_svc+0x34/0xb0 arch/arm64/kernel/entry-common.c:226
   el0_sync_handler+0xc8/0x5b4 arch/arm64/kernel/entry-common.c:236
   el0_sync+0x15c/0x180 arch/arm64/kernel/entry.S:663
  Code: d2d40001 f2fbffe1 91002260 d343fc02 (38e16841)
  ---[ end trace 4edf690313deda44 ]---

This is because since ec10a24, the option parsing happens before
fill_super and so the MTD device isn't associated with the filesystem.
Defer the size check until there is a valid association.

Fixes: ec10a24 ("vfs: Convert jffs2 to use the new mount API")
Cc: <stable@vger.kernel.org>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Jamie Iles <jamie@nuviainc.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Kwiboo pushed a commit to Kwiboo/linux-rockchip that referenced this issue Aug 23, 2023
We get the following warning even though the phy drivers are builtin:
[    1.667394]  [0:   kworker/u8:0:    7] WARNING: CPU: 0 PID: 7 at kernel/kmod.c:137 __request_module+0x1ec/0x458
[    1.667408]  [0:   kworker/u8:0:    7] CPU: 0 PID: 7 Comm: kworker/u8:0 Not tainted 4.19.232 rockchip-linux#98
[    1.667412]  [0:   kworker/u8:0:    7] Hardware name: Rockchip RK3528 EVB1 DDR4 V10 Board (DT)
[    1.667431]  [0:   kworker/u8:0:    7] Workqueue: events_unbound async_run_entry_fn
[    1.667439]  [0:   kworker/u8:0:    7] pstate: 00400005 (nzcv daif +PAN -UAO)
[    1.667445]  [0:   kworker/u8:0:    7] pc : __request_module+0x1ec/0x458
[    1.667461]  [0:   kworker/u8:0:    7] lr : __request_module+0x1e4/0x458
...
[    1.667736]  [0:   kworker/u8:0:    7] Call trace:
[    1.667752]  [0:   kworker/u8:0:    7]  __request_module+0x1ec/0x458
[    1.667772]  [0:   kworker/u8:0:    7]  phy_device_create+0x29c/0x2f8
[    1.667785]  [0:   kworker/u8:0:    7]  of_mdiobus_register_phy+0x198/0x1a8
[    1.667795]  [0:   kworker/u8:0:    7]  of_mdiobus_register+0x120/0x320
[    1.667807]  [0:   kworker/u8:0:    7]  stmmac_mdio_register+0xec/0x258
[    1.667818]  [0:   kworker/u8:0:    7]  stmmac_dvr_probe+0x620/0xb98
[    1.667830]  [0:   kworker/u8:0:    7]  rk_gmac_probe+0x6d0/0x7c0
[    1.667841]  [0:   kworker/u8:0:    7]  platform_drv_probe+0x50/0xa8
[    1.667853]  [0:   kworker/u8:0:    7]  really_probe+0x228/0x2a0
[    1.667864]  [0:   kworker/u8:0:    7]  driver_probe_device+0x58/0x100
[    1.667875]  [0:   kworker/u8:0:    7]  __driver_attach_async_helper+0x5c/0x60
[    1.667886]  [0:   kworker/u8:0:    7]  async_run_entry_fn+0x44/0x120
[    1.667898]  [0:   kworker/u8:0:    7]  process_one_work+0x1a0/0x418
[    1.667909]  [0:   kworker/u8:0:    7]  worker_thread+0x4c/0x3e0
[    1.667920]  [0:   kworker/u8:0:    7]  kthread+0x12c/0x158
[    1.667931]  [0:   kworker/u8:0:    7]  ret_from_fork+0x10/0x18

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I947a3267838a4c351d4c646f8b638740779a8712
scpcom pushed a commit to scpcom/linux that referenced this issue Jun 5, 2024
[ Upstream commit 244296c ]

There are several places where either chan->lock or chan->vchan.lock was
not held. Add appropriate locking. This fixes lockdep warnings like

[   31.077578] ------------[ cut here ]------------
[   31.077831] WARNING: CPU: 2 PID: 40 at drivers/dma/xilinx/xilinx_dpdma.c:834 xilinx_dpdma_chan_queue_transfer+0x274/0x5e0
[   31.077953] Modules linked in:
[   31.078019] CPU: 2 PID: 40 Comm: kworker/u12:1 Not tainted 6.6.20+ rockchip-linux#98
[   31.078102] Hardware name: xlnx,zynqmp (DT)
[   31.078169] Workqueue: events_unbound deferred_probe_work_func
[   31.078272] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   31.078377] pc : xilinx_dpdma_chan_queue_transfer+0x274/0x5e0
[   31.078473] lr : xilinx_dpdma_chan_queue_transfer+0x270/0x5e0
[   31.078550] sp : ffffffc083bb2e10
[   31.078590] x29: ffffffc083bb2e10 x28: 0000000000000000 x27: ffffff880165a168
[   31.078754] x26: ffffff880164e920 x25: ffffff880164eab8 x24: ffffff880164d480
[   31.078920] x23: ffffff880165a148 x22: ffffff880164e988 x21: 0000000000000000
[   31.079132] x20: ffffffc082aa3000 x19: ffffff880164e880 x18: 0000000000000000
[   31.079295] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[   31.079453] x14: 0000000000000000 x13: ffffff8802263dc0 x12: 0000000000000001
[   31.079613] x11: 0001ffc083bb2e34 x10: 0001ff880164e98f x9 : 0001ffc082aa3def
[   31.079824] x8 : 0001ffc082aa3dec x7 : 0000000000000000 x6 : 0000000000000516
[   31.079982] x5 : ffffffc7f8d43000 x4 : ffffff88003c9c40 x3 : ffffffffffffffff
[   31.080147] x2 : ffffffc7f8d43000 x1 : 00000000000000c0 x0 : 0000000000000000
[   31.080307] Call trace:
[   31.080340]  xilinx_dpdma_chan_queue_transfer+0x274/0x5e0
[   31.080518]  xilinx_dpdma_issue_pending+0x11c/0x120
[   31.080595]  zynqmp_disp_layer_update+0x180/0x3ac
[   31.080712]  zynqmp_dpsub_plane_atomic_update+0x11c/0x21c
[   31.080825]  drm_atomic_helper_commit_planes+0x20c/0x684
[   31.080951]  drm_atomic_helper_commit_tail+0x5c/0xb0
[   31.081139]  commit_tail+0x234/0x294
[   31.081246]  drm_atomic_helper_commit+0x1f8/0x210
[   31.081363]  drm_atomic_commit+0x100/0x140
[   31.081477]  drm_client_modeset_commit_atomic+0x318/0x384
[   31.081634]  drm_client_modeset_commit_locked+0x8c/0x24c
[   31.081725]  drm_client_modeset_commit+0x34/0x5c
[   31.081812]  __drm_fb_helper_restore_fbdev_mode_unlocked+0x104/0x168
[   31.081899]  drm_fb_helper_set_par+0x50/0x70
[   31.081971]  fbcon_init+0x538/0xc48
[   31.082047]  visual_init+0x16c/0x23c
[   31.082207]  do_bind_con_driver.isra.0+0x2d0/0x634
[   31.082320]  do_take_over_console+0x24c/0x33c
[   31.082429]  do_fbcon_takeover+0xbc/0x1b0
[   31.082503]  fbcon_fb_registered+0x2d0/0x34c
[   31.082663]  register_framebuffer+0x27c/0x38c
[   31.082767]  __drm_fb_helper_initial_config_and_unlock+0x5c0/0x91c
[   31.082939]  drm_fb_helper_initial_config+0x50/0x74
[   31.083012]  drm_fbdev_dma_client_hotplug+0xb8/0x108
[   31.083115]  drm_client_register+0xa0/0xf4
[   31.083195]  drm_fbdev_dma_setup+0xb0/0x1cc
[   31.083293]  zynqmp_dpsub_drm_init+0x45c/0x4e0
[   31.083431]  zynqmp_dpsub_probe+0x444/0x5e0
[   31.083616]  platform_probe+0x8c/0x13c
[   31.083713]  really_probe+0x258/0x59c
[   31.083793]  __driver_probe_device+0xc4/0x224
[   31.083878]  driver_probe_device+0x70/0x1c0
[   31.083961]  __device_attach_driver+0x108/0x1e0
[   31.084052]  bus_for_each_drv+0x9c/0x100
[   31.084125]  __device_attach+0x100/0x298
[   31.084207]  device_initial_probe+0x14/0x20
[   31.084292]  bus_probe_device+0xd8/0xdc
[   31.084368]  deferred_probe_work_func+0x11c/0x180
[   31.084451]  process_one_work+0x3ac/0x988
[   31.084643]  worker_thread+0x398/0x694
[   31.084752]  kthread+0x1bc/0x1c0
[   31.084848]  ret_from_fork+0x10/0x20
[   31.084932] irq event stamp: 64549
[   31.084970] hardirqs last  enabled at (64548): [<ffffffc081adf35c>] _raw_spin_unlock_irqrestore+0x80/0x90
[   31.085157] hardirqs last disabled at (64549): [<ffffffc081adf010>] _raw_spin_lock_irqsave+0xc0/0xdc
[   31.085277] softirqs last  enabled at (64503): [<ffffffc08001071c>] __do_softirq+0x47c/0x500
[   31.085390] softirqs last disabled at (64498): [<ffffffc080017134>] ____do_softirq+0x10/0x1c
[   31.085501] ---[ end trace 0000000000000000 ]---

Fixes: 7cbb0c6 ("dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver")
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20240308210034.3634938-2-sean.anderson@linux.dev
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scpcom pushed a commit to scpcom/linux that referenced this issue Jun 5, 2024
[ Upstream commit 244296c ]

There are several places where either chan->lock or chan->vchan.lock was
not held. Add appropriate locking. This fixes lockdep warnings like

[   31.077578] ------------[ cut here ]------------
[   31.077831] WARNING: CPU: 2 PID: 40 at drivers/dma/xilinx/xilinx_dpdma.c:834 xilinx_dpdma_chan_queue_transfer+0x274/0x5e0
[   31.077953] Modules linked in:
[   31.078019] CPU: 2 PID: 40 Comm: kworker/u12:1 Not tainted 6.6.20+ rockchip-linux#98
[   31.078102] Hardware name: xlnx,zynqmp (DT)
[   31.078169] Workqueue: events_unbound deferred_probe_work_func
[   31.078272] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   31.078377] pc : xilinx_dpdma_chan_queue_transfer+0x274/0x5e0
[   31.078473] lr : xilinx_dpdma_chan_queue_transfer+0x270/0x5e0
[   31.078550] sp : ffffffc083bb2e10
[   31.078590] x29: ffffffc083bb2e10 x28: 0000000000000000 x27: ffffff880165a168
[   31.078754] x26: ffffff880164e920 x25: ffffff880164eab8 x24: ffffff880164d480
[   31.078920] x23: ffffff880165a148 x22: ffffff880164e988 x21: 0000000000000000
[   31.079132] x20: ffffffc082aa3000 x19: ffffff880164e880 x18: 0000000000000000
[   31.079295] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[   31.079453] x14: 0000000000000000 x13: ffffff8802263dc0 x12: 0000000000000001
[   31.079613] x11: 0001ffc083bb2e34 x10: 0001ff880164e98f x9 : 0001ffc082aa3def
[   31.079824] x8 : 0001ffc082aa3dec x7 : 0000000000000000 x6 : 0000000000000516
[   31.079982] x5 : ffffffc7f8d43000 x4 : ffffff88003c9c40 x3 : ffffffffffffffff
[   31.080147] x2 : ffffffc7f8d43000 x1 : 00000000000000c0 x0 : 0000000000000000
[   31.080307] Call trace:
[   31.080340]  xilinx_dpdma_chan_queue_transfer+0x274/0x5e0
[   31.080518]  xilinx_dpdma_issue_pending+0x11c/0x120
[   31.080595]  zynqmp_disp_layer_update+0x180/0x3ac
[   31.080712]  zynqmp_dpsub_plane_atomic_update+0x11c/0x21c
[   31.080825]  drm_atomic_helper_commit_planes+0x20c/0x684
[   31.080951]  drm_atomic_helper_commit_tail+0x5c/0xb0
[   31.081139]  commit_tail+0x234/0x294
[   31.081246]  drm_atomic_helper_commit+0x1f8/0x210
[   31.081363]  drm_atomic_commit+0x100/0x140
[   31.081477]  drm_client_modeset_commit_atomic+0x318/0x384
[   31.081634]  drm_client_modeset_commit_locked+0x8c/0x24c
[   31.081725]  drm_client_modeset_commit+0x34/0x5c
[   31.081812]  __drm_fb_helper_restore_fbdev_mode_unlocked+0x104/0x168
[   31.081899]  drm_fb_helper_set_par+0x50/0x70
[   31.081971]  fbcon_init+0x538/0xc48
[   31.082047]  visual_init+0x16c/0x23c
[   31.082207]  do_bind_con_driver.isra.0+0x2d0/0x634
[   31.082320]  do_take_over_console+0x24c/0x33c
[   31.082429]  do_fbcon_takeover+0xbc/0x1b0
[   31.082503]  fbcon_fb_registered+0x2d0/0x34c
[   31.082663]  register_framebuffer+0x27c/0x38c
[   31.082767]  __drm_fb_helper_initial_config_and_unlock+0x5c0/0x91c
[   31.082939]  drm_fb_helper_initial_config+0x50/0x74
[   31.083012]  drm_fbdev_dma_client_hotplug+0xb8/0x108
[   31.083115]  drm_client_register+0xa0/0xf4
[   31.083195]  drm_fbdev_dma_setup+0xb0/0x1cc
[   31.083293]  zynqmp_dpsub_drm_init+0x45c/0x4e0
[   31.083431]  zynqmp_dpsub_probe+0x444/0x5e0
[   31.083616]  platform_probe+0x8c/0x13c
[   31.083713]  really_probe+0x258/0x59c
[   31.083793]  __driver_probe_device+0xc4/0x224
[   31.083878]  driver_probe_device+0x70/0x1c0
[   31.083961]  __device_attach_driver+0x108/0x1e0
[   31.084052]  bus_for_each_drv+0x9c/0x100
[   31.084125]  __device_attach+0x100/0x298
[   31.084207]  device_initial_probe+0x14/0x20
[   31.084292]  bus_probe_device+0xd8/0xdc
[   31.084368]  deferred_probe_work_func+0x11c/0x180
[   31.084451]  process_one_work+0x3ac/0x988
[   31.084643]  worker_thread+0x398/0x694
[   31.084752]  kthread+0x1bc/0x1c0
[   31.084848]  ret_from_fork+0x10/0x20
[   31.084932] irq event stamp: 64549
[   31.084970] hardirqs last  enabled at (64548): [<ffffffc081adf35c>] _raw_spin_unlock_irqrestore+0x80/0x90
[   31.085157] hardirqs last disabled at (64549): [<ffffffc081adf010>] _raw_spin_lock_irqsave+0xc0/0xdc
[   31.085277] softirqs last  enabled at (64503): [<ffffffc08001071c>] __do_softirq+0x47c/0x500
[   31.085390] softirqs last disabled at (64498): [<ffffffc080017134>] ____do_softirq+0x10/0x1c
[   31.085501] ---[ end trace 0000000000000000 ]---

Fixes: 7cbb0c6 ("dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver")
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20240308210034.3634938-2-sean.anderson@linux.dev
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scpcom pushed a commit to scpcom/linux that referenced this issue Jun 5, 2024
[ Upstream commit 244296c ]

There are several places where either chan->lock or chan->vchan.lock was
not held. Add appropriate locking. This fixes lockdep warnings like

[   31.077578] ------------[ cut here ]------------
[   31.077831] WARNING: CPU: 2 PID: 40 at drivers/dma/xilinx/xilinx_dpdma.c:834 xilinx_dpdma_chan_queue_transfer+0x274/0x5e0
[   31.077953] Modules linked in:
[   31.078019] CPU: 2 PID: 40 Comm: kworker/u12:1 Not tainted 6.6.20+ rockchip-linux#98
[   31.078102] Hardware name: xlnx,zynqmp (DT)
[   31.078169] Workqueue: events_unbound deferred_probe_work_func
[   31.078272] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[   31.078377] pc : xilinx_dpdma_chan_queue_transfer+0x274/0x5e0
[   31.078473] lr : xilinx_dpdma_chan_queue_transfer+0x270/0x5e0
[   31.078550] sp : ffffffc083bb2e10
[   31.078590] x29: ffffffc083bb2e10 x28: 0000000000000000 x27: ffffff880165a168
[   31.078754] x26: ffffff880164e920 x25: ffffff880164eab8 x24: ffffff880164d480
[   31.078920] x23: ffffff880165a148 x22: ffffff880164e988 x21: 0000000000000000
[   31.079132] x20: ffffffc082aa3000 x19: ffffff880164e880 x18: 0000000000000000
[   31.079295] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[   31.079453] x14: 0000000000000000 x13: ffffff8802263dc0 x12: 0000000000000001
[   31.079613] x11: 0001ffc083bb2e34 x10: 0001ff880164e98f x9 : 0001ffc082aa3def
[   31.079824] x8 : 0001ffc082aa3dec x7 : 0000000000000000 x6 : 0000000000000516
[   31.079982] x5 : ffffffc7f8d43000 x4 : ffffff88003c9c40 x3 : ffffffffffffffff
[   31.080147] x2 : ffffffc7f8d43000 x1 : 00000000000000c0 x0 : 0000000000000000
[   31.080307] Call trace:
[   31.080340]  xilinx_dpdma_chan_queue_transfer+0x274/0x5e0
[   31.080518]  xilinx_dpdma_issue_pending+0x11c/0x120
[   31.080595]  zynqmp_disp_layer_update+0x180/0x3ac
[   31.080712]  zynqmp_dpsub_plane_atomic_update+0x11c/0x21c
[   31.080825]  drm_atomic_helper_commit_planes+0x20c/0x684
[   31.080951]  drm_atomic_helper_commit_tail+0x5c/0xb0
[   31.081139]  commit_tail+0x234/0x294
[   31.081246]  drm_atomic_helper_commit+0x1f8/0x210
[   31.081363]  drm_atomic_commit+0x100/0x140
[   31.081477]  drm_client_modeset_commit_atomic+0x318/0x384
[   31.081634]  drm_client_modeset_commit_locked+0x8c/0x24c
[   31.081725]  drm_client_modeset_commit+0x34/0x5c
[   31.081812]  __drm_fb_helper_restore_fbdev_mode_unlocked+0x104/0x168
[   31.081899]  drm_fb_helper_set_par+0x50/0x70
[   31.081971]  fbcon_init+0x538/0xc48
[   31.082047]  visual_init+0x16c/0x23c
[   31.082207]  do_bind_con_driver.isra.0+0x2d0/0x634
[   31.082320]  do_take_over_console+0x24c/0x33c
[   31.082429]  do_fbcon_takeover+0xbc/0x1b0
[   31.082503]  fbcon_fb_registered+0x2d0/0x34c
[   31.082663]  register_framebuffer+0x27c/0x38c
[   31.082767]  __drm_fb_helper_initial_config_and_unlock+0x5c0/0x91c
[   31.082939]  drm_fb_helper_initial_config+0x50/0x74
[   31.083012]  drm_fbdev_dma_client_hotplug+0xb8/0x108
[   31.083115]  drm_client_register+0xa0/0xf4
[   31.083195]  drm_fbdev_dma_setup+0xb0/0x1cc
[   31.083293]  zynqmp_dpsub_drm_init+0x45c/0x4e0
[   31.083431]  zynqmp_dpsub_probe+0x444/0x5e0
[   31.083616]  platform_probe+0x8c/0x13c
[   31.083713]  really_probe+0x258/0x59c
[   31.083793]  __driver_probe_device+0xc4/0x224
[   31.083878]  driver_probe_device+0x70/0x1c0
[   31.083961]  __device_attach_driver+0x108/0x1e0
[   31.084052]  bus_for_each_drv+0x9c/0x100
[   31.084125]  __device_attach+0x100/0x298
[   31.084207]  device_initial_probe+0x14/0x20
[   31.084292]  bus_probe_device+0xd8/0xdc
[   31.084368]  deferred_probe_work_func+0x11c/0x180
[   31.084451]  process_one_work+0x3ac/0x988
[   31.084643]  worker_thread+0x398/0x694
[   31.084752]  kthread+0x1bc/0x1c0
[   31.084848]  ret_from_fork+0x10/0x20
[   31.084932] irq event stamp: 64549
[   31.084970] hardirqs last  enabled at (64548): [<ffffffc081adf35c>] _raw_spin_unlock_irqrestore+0x80/0x90
[   31.085157] hardirqs last disabled at (64549): [<ffffffc081adf010>] _raw_spin_lock_irqsave+0xc0/0xdc
[   31.085277] softirqs last  enabled at (64503): [<ffffffc08001071c>] __do_softirq+0x47c/0x500
[   31.085390] softirqs last disabled at (64498): [<ffffffc080017134>] ____do_softirq+0x10/0x1c
[   31.085501] ---[ end trace 0000000000000000 ]---

Fixes: 7cbb0c6 ("dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver")
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://lore.kernel.org/r/20240308210034.3634938-2-sean.anderson@linux.dev
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants