anholt / linux

Other
134 stars 24 forks source link

vc4: dsi: Leaks with 4.15-rc2 and Raspberry Pi Touch #124

Closed lategoodbye closed 4 years ago

lategoodbye commented 6 years ago

I connected the official Raspberry Pi touch panel (7 inch) and my Raspberry Pi 2 and noticed some memory leaks. I was using tag 4.15-rc2 and applied

drm/vc4: Fix false positive WARN() backtrace on refcount_inc() usage
ARM: dts: bcm2835: Enable the Raspberry Pi touchscreen panel.
Revert: "drm/vc4: Account for interrupts in flight"

My configuration based on multi_v7_defconfig and following settings:

CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m
CONFIG_DRM_VC4=m
CONFIG_DRM_VC4_HDMI_CEC=y
CONFIG_I2C_GPIO=m

Here is relevant dmesg:

[    7.608814] gpio-2022 (?): enforced open drain please flag it properly in DT/ACPI DSDT/board file
[    7.608953] gpio-2023 (?): enforced open drain please flag it properly in DT/ACPI DSDT/board file
[    7.646263] i2c-gpio soc:i2c: using lines 2022 (SDA) and 2023 (SCL)
[    7.969828] vc4_hdmi 3f902000.hdmi: vc4-hdmi-hifi <-> 3f902000.hdmi mapping ok
[    7.969906] vc4_hdmi 3f902000.hdmi: ASoC: no DMI vendor name!
[    7.998999] vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_hdmi_ops [vc4])
[    8.002471] vc4-drm soc:gpu: bound 3f806000.vec (ops vc4_vec_ops [vc4])
[    8.015466] vc4-drm soc:gpu: failed to bind 3f700000.dsi (ops vc4_dsi_ops [vc4]): -517
[    8.026284] vc4-drm soc:gpu: master bind failed: -517
[    8.951745] vc4_hdmi 3f902000.hdmi: vc4-hdmi-hifi <-> 3f902000.hdmi mapping ok
[    8.951818] vc4_hdmi 3f902000.hdmi: ASoC: no DMI vendor name!
[    8.957696] vc4-drm soc:gpu: bound 3f902000.hdmi (ops vc4_drm_unregister [vc4])
[    8.959528] vc4-drm soc:gpu: bound 3f806000.vec (ops vc4_drm_unregister [vc4])
[    8.971540] vc4-drm soc:gpu: bound 3f700000.dsi (ops vc4_drm_unregister [vc4])
[    8.971918] vc4-drm soc:gpu: bound 3f400000.hvs (ops vc4_drm_unregister [vc4])
[    8.973618] vc4-drm soc:gpu: bound 3f206000.pixelvalve (ops vc4_drm_unregister [vc4])
[    8.975304] vc4-drm soc:gpu: bound 3f207000.pixelvalve (ops vc4_drm_unregister [vc4])
[    8.976948] vc4-drm soc:gpu: bound 3f807000.pixelvalve (ops vc4_drm_unregister [vc4])
[    9.030380] vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_drm_unregister [vc4])
[    9.030437] checking generic (3db3f000 bb800) vs hw (0 ffffffff)
[    9.030444] fb: switching to vc4drmfb from simple
[    9.031098] Console: switching to colour dummy device 80x30
[    9.043811] [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0
[    9.043867] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    9.043874] [drm] Driver supports precise vblank timestamp query.
[    9.502136] Console: switching to colour frame buffer device 100x30
[    9.518471] vc4-drm soc:gpu: fb0:  frame buffer device

Here are the leaks, which are possibly related to the probe defer:

unreferenced object 0xee587430 (size 300):
  comm "systemd-udevd", pid 125, jiffies 4294938047 (age 1291.300s)
  hex dump (first 32 bytes):
    00 00 28 00 00 00 00 00 14 7a 81 ee 3c 74 58 ee  ..(......z..<tX.
    3c 74 58 ee 00 00 00 00 88 3a a7 ec 08 3a a7 ec  <tX......:...:..
  backtrace:
    [<9584871a>] idr_get_free_cmn+0x29c/0x2f8
    [<d82df61e>] idr_alloc_cmn+0x58/0xf0
    [<5c10035f>] __drm_mode_object_add+0x54/0x94
    [<6d4392d9>] drm_mode_object_add+0x18/0x20
    [<9ef5e7ac>] drm_property_create+0x88/0x140
    [<4f583f12>] drm_connector_create_standard_properties+0x1c/0x108
    [<eb668204>] drm_mode_config_init+0xec/0x4b0
    [<b31a5abc>] vc4_drm_bind+0x64/0x130 [vc4]
    [<d73eb45c>] try_to_bring_up_master+0x13c/0x184
    [<0866adcc>] component_master_add_with_match+0x80/0xb8
    [<0ff2a3e9>] vc4_platform_drm_probe+0x90/0xa8 [vc4]
    [<709f5d73>] platform_drv_probe+0x4c/0xac
    [<28c474bc>] driver_probe_device+0x234/0x338
    [<c7186409>] __driver_attach+0xac/0xb0
    [<18e427f6>] bus_for_each_dev+0x64/0x94
    [<73d89841>] bus_add_driver+0x184/0x20c
unreferenced object 0xece3be80 (size 64):
  comm "systemd-udevd", pid 125, jiffies 4294938048 (age 1291.290s)
  hex dump (first 32 bytes):
    70 69 78 65 6c 00 00 00 00 00 00 00 00 00 00 00  pixel...........
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<d3b59f03>] __clk_create_clk+0x4c/0xa4
    [<c7eb8806>] __of_clk_get_from_provider+0xa8/0xf0
    [<65c41483>] __of_clk_get.part.0+0x40/0x60
    [<4d21516c>] __of_clk_get_by_name+0x78/0xcc
    [<ae9666f3>] clk_get+0x2c/0x5c
    [<a191774c>] devm_clk_get+0x34/0x78
    [<24959c32>] vc4_hdmi_bind+0x90/0x66c [vc4]
    [<42a08e85>] component_bind_all+0xe8/0x21c
    [<69eb8c2d>] vc4_drm_bind+0x78/0x130 [vc4]
    [<d73eb45c>] try_to_bring_up_master+0x13c/0x184
    [<0866adcc>] component_master_add_with_match+0x80/0xb8
    [<0ff2a3e9>] vc4_platform_drm_probe+0x90/0xa8 [vc4]
    [<709f5d73>] platform_drv_probe+0x4c/0xac
    [<28c474bc>] driver_probe_device+0x234/0x338
    [<c7186409>] __driver_attach+0xac/0xb0
    [<18e427f6>] bus_for_each_dev+0x64/0x94
unreferenced object 0xece3bf40 (size 64):
  comm "systemd-udevd", pid 125, jiffies 4294938048 (age 1291.290s)
  hex dump (first 32 bytes):
    68 64 6d 69 00 00 00 00 00 00 00 00 00 00 00 00  hdmi............
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<d3b59f03>] __clk_create_clk+0x4c/0xa4
    [<c7eb8806>] __of_clk_get_from_provider+0xa8/0xf0
    [<65c41483>] __of_clk_get.part.0+0x40/0x60
    [<4d21516c>] __of_clk_get_by_name+0x78/0xcc
    [<ae9666f3>] clk_get+0x2c/0x5c
    [<a191774c>] devm_clk_get+0x34/0x78
    [<ebd64903>] vc4_hdmi_bind+0xa8/0x66c [vc4]
    [<42a08e85>] component_bind_all+0xe8/0x21c
    [<69eb8c2d>] vc4_drm_bind+0x78/0x130 [vc4]
    [<d73eb45c>] try_to_bring_up_master+0x13c/0x184
    [<0866adcc>] component_master_add_with_match+0x80/0xb8
    [<0ff2a3e9>] vc4_platform_drm_probe+0x90/0xa8 [vc4]
    [<709f5d73>] platform_drv_probe+0x4c/0xac
    [<28c474bc>] driver_probe_device+0x234/0x338
    [<c7186409>] __driver_attach+0xac/0xb0
    [<18e427f6>] bus_for_each_dev+0x64/0x94
unreferenced object 0xeca9c180 (size 64):
  comm "systemd-udevd", pid 125, jiffies 4294938054 (age 1291.250s)
  hex dump (first 32 bytes):
    65 73 63 61 70 65 00 00 00 00 00 00 00 00 00 00  escape..........
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<d3b59f03>] __clk_create_clk+0x4c/0xa4
    [<c7eb8806>] __of_clk_get_from_provider+0xa8/0xf0
    [<65c41483>] __of_clk_get.part.0+0x40/0x60
    [<4d21516c>] __of_clk_get_by_name+0x78/0xcc
    [<ae9666f3>] clk_get+0x2c/0x5c
    [<a191774c>] devm_clk_get+0x34/0x78
    [<77f5db23>] vc4_dsi_bind+0x35c/0x7cc [vc4]
    [<42a08e85>] component_bind_all+0xe8/0x21c
    [<69eb8c2d>] vc4_drm_bind+0x78/0x130 [vc4]
    [<d73eb45c>] try_to_bring_up_master+0x13c/0x184
    [<0866adcc>] component_master_add_with_match+0x80/0xb8
    [<0ff2a3e9>] vc4_platform_drm_probe+0x90/0xa8 [vc4]
    [<709f5d73>] platform_drv_probe+0x4c/0xac
    [<28c474bc>] driver_probe_device+0x234/0x338
    [<c7186409>] __driver_attach+0xac/0xb0
    [<18e427f6>] bus_for_each_dev+0x64/0x94
unreferenced object 0xeca9c240 (size 64):
  comm "systemd-udevd", pid 125, jiffies 4294938054 (age 1291.250s)
  hex dump (first 32 bytes):
    70 68 79 00 00 00 00 00 00 00 00 00 00 00 00 00  phy.............
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<d3b59f03>] __clk_create_clk+0x4c/0xa4
    [<c7eb8806>] __of_clk_get_from_provider+0xa8/0xf0
    [<65c41483>] __of_clk_get.part.0+0x40/0x60
    [<4d21516c>] __of_clk_get_by_name+0x78/0xcc
    [<ae9666f3>] clk_get+0x2c/0x5c
    [<a191774c>] devm_clk_get+0x34/0x78
    [<a13cda79>] vc4_dsi_bind+0x378/0x7cc [vc4]
    [<42a08e85>] component_bind_all+0xe8/0x21c
    [<69eb8c2d>] vc4_drm_bind+0x78/0x130 [vc4]
    [<d73eb45c>] try_to_bring_up_master+0x13c/0x184
    [<0866adcc>] component_master_add_with_match+0x80/0xb8
    [<0ff2a3e9>] vc4_platform_drm_probe+0x90/0xa8 [vc4]
    [<709f5d73>] platform_drv_probe+0x4c/0xac
    [<28c474bc>] driver_probe_device+0x234/0x338
    [<c7186409>] __driver_attach+0xac/0xb0
    [<18e427f6>] bus_for_each_dev+0x64/0x94
unreferenced object 0xeca9c300 (size 64):
  comm "systemd-udevd", pid 125, jiffies 4294938054 (age 1291.250s)
  hex dump (first 32 bytes):
    70 69 78 65 6c 00 00 00 00 00 00 00 00 00 00 00  pixel...........
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<d3b59f03>] __clk_create_clk+0x4c/0xa4
    [<c7eb8806>] __of_clk_get_from_provider+0xa8/0xf0
    [<65c41483>] __of_clk_get.part.0+0x40/0x60
    [<4d21516c>] __of_clk_get_by_name+0x78/0xcc
    [<ae9666f3>] clk_get+0x2c/0x5c
    [<a191774c>] devm_clk_get+0x34/0x78
    [<fc6d0bd6>] vc4_dsi_bind+0x394/0x7cc [vc4]
    [<42a08e85>] component_bind_all+0xe8/0x21c
    [<69eb8c2d>] vc4_drm_bind+0x78/0x130 [vc4]
    [<d73eb45c>] try_to_bring_up_master+0x13c/0x184
    [<0866adcc>] component_master_add_with_match+0x80/0xb8
    [<0ff2a3e9>] vc4_platform_drm_probe+0x90/0xa8 [vc4]
    [<709f5d73>] platform_drv_probe+0x4c/0xac
    [<28c474bc>] driver_probe_device+0x234/0x338
    [<c7186409>] __driver_attach+0xac/0xb0
    [<18e427f6>] bus_for_each_dev+0x64/0x94