Re: [PATCH v14 0/3] Move backlight helper functions from tinydrm-helpers to linux/backlight

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Den 11.12.2017 15.58, skrev Meghana Madhyastha:
On Mon, Dec 11, 2017 at 03:12:06PM +0100, Noralf Trønnes wrote:
Den 11.12.2017 14.17, skrev Meghana Madhyastha:
On Sat, Dec 09, 2017 at 03:09:28PM +0100, Noralf Trønnes wrote:
Den 21.10.2017 13.55, skrev Meghana Madhyastha:
Changes in v14:
- s/backlight_get/of_find_backlight/ in patch 2/3
- Change commit message in patch 3/3 from requiring to acquiring

Meghana Madhyastha (3):
   drm/tinydrm: Move helper functions from tinydrm-helpers to backlight.h
   drm/tinydrm: Move tinydrm_of_find_backlight to backlight.c
   drm/tinydrm: Add devres versions of of_find_backlight
I tried the patchset and this is what I got:

[    8.057792] Unable to handle kernel paging request at virtual address
fffffe6b
[    8.069118] pgd = 93817cf7
[    8.075704] [fffffe6b] *pgd=1bfd7861, *pte=00000000, *ppte=00000000
[    8.086047] Internal error: Oops: 37 [#1] ARM
[    8.094285] Modules linked in: mi0283qt(+) mipi_dbi tinydrm backlight
bcm2835_rng rng_core
[    8.110535] CPU: 0 PID: 121 Comm: systemd-udevd Not tainted 4.15.0-rc2+
#2
[    8.121531] Hardware name: BCM2835
[    8.128964] task: 85dc6e21 task.stack: 4d8f2d19
[    8.137482] PC is at kobject_put+0x18/0x1dc
[    8.145556] LR is at put_device+0x24/0x28
[    8.153312] pc : [<c076a1b4>]    lr : [<c048edb8>] psr: a0000013
[    8.163321] sp : d6d33c18  ip : d6d33c40  fp : d6d33c3c
[    8.172238] r10: c0496d38  r9 : 00000000  r8 : d6e46680
[    8.181108] r7 : 00000004  r6 : d766bc00  r5 : d6d33c70  r4 : fffffe4b
[    8.191237] r3 : bf0113b8  r2 : d766bd2c  r1 : d6e46710  r0 : fffffe4b
[    8.201248] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM Segment
none
[    8.211869] Control: 00c5387d  Table: 16d20008  DAC: 00000051
[    8.221141] Process systemd-udevd (pid: 121, stack limit = 0xa0ab0c84)
[    8.231264] Stack: (0xd6d33c18 to 0xd6d34000)
[    8.239228] 3c00:
bf011858 c049728c
[    8.254539] 3c20: d7737010 d6e46700 d6d33c70 d766bc00 d6d33c4c d6d33c40
c048edb8 c076a1a8
[    8.270045] 3c40: d6d33c5c d6d33c50 bf0113dc c048eda0 d6d33c6c d6d33c60
c0496fc4 bf0113c4
[    8.285883] 3c60: d6d33ca4 d6d33c70 c04979f0 c0496fb4 d7737000 d6e46700
d6d33c9c d766bc00
[    8.301819] 3c80: 00000000 bf030100 c0d369dc c0d369e0 0000000e fffffdfb
d6d33cb4 d6d33ca8
[    8.317917] 3ca0: c0497ad0 c0497858 d6d33cec d6d33cb8 c0493efc c0497a94
c057e738 c057d26c
[    8.334043] 3cc0: d6d33cec d766bc00 d766bc34 bf030100 c0c4a5d8 00000001
d6e46464 00000028
[    8.350344] 3ce0: d6d33d0c d6d33cf0 c049414c c0493c4c 00000001 00000000
bf030100 c04940b0
[    8.367036] 3d00: d6d33d34 d6d33d10 c0492018 c04940bc d754f28c d76afbb0
d6dca534 bf030100
[    8.383997] 3d20: 00000000 d6dca500 d6d33d44 d6d33d38 c0493750 c0491fa8
d6d33d6c d6d33d48
[    8.401301] 3d40: c0493124 c0493734 bf02f4d6 d6d33d58 bf030100 bf033000
c0c04048 00000000
[    8.418938] 3d60: d6d33d84 d6d33d70 c0494954 c0493048 bf030140 bf033000
d6d33d94 d6d33d88
[    8.436692] 3d80: c04c8794 c04948b4 d6d33da4 d6d33d98 bf033020 c04c8748
d6d33e1c d6d33da8
[    8.454638] 3da0: c0101a30 bf03300c d6d33dcc d6d33db8 c01013f4 c03f7c64
c0221690 60000013
[    8.472918] 3dc0: d6d33e44 d6d33dd0 c010d04c c01013e0 d7401e40 014000c0
0000000c c0221770
[    8.491185] 3de0: d6d33e1c d6d33df0 c0221770 c021e29c 00000001 fc36740d
bf030140 00000001
[    8.509455] 3e00: d6e46500 d6e46440 00000001 d6e46464 d6d33e44 d6d33e20
c0178628 c0101978
[    8.527727] 3e20: bf030140 d6e46440 d6d33e44 d6d33f40 00000001 bf030140
d6d33f1c d6d33e48
[    8.546000] 3e40: c0177810 c01785c8 bf03014c 00007fff bf030140 c0174ae8
d6d33f38 d6d33eb8
[    8.564264] 3e60: d6d33e9c b6d4f004 dcb059a4 c0c1619c bf030324 d6e46448
bf030188 dcad6000
[    8.582529] 3e80: 00000000 d6ca3e40 00000000 00000000 00000000 00000000
00000000 00000000
[    8.600797] 3ea0: 00000000 00000000 00000000 00000000 6e72656b 00006c65
00000000 00000000
[    8.619065] 3ec0: 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000
[    8.637319] 3ee0: 00000000 00000000 00000000 fc36740d 7fffffff 00000000
b6d4f004 0000000d
[    8.655582] 3f00: 0000017b c0108044 d6d32000 00000000 d6d33fa4 d6d33f20
c0177f94 c0175d00
[    8.673835] 3f20: 7fffffff 00000000 00000003 00000000 00000000 dcad6000
0002f9f4 00000000
[    8.692093] 3f40: dcad6b80 dcad6000 0002f9f4 dcb05274 dcaf9e6a dcafa860
00003000 00003240
[    8.710350] 3f60: 00000000 00000000 00000000 00001e34 0000002e 0000002f
00000019 00000000
[    8.728612] 3f80: 00000013 00000000 00000000 1ef80900 00000000 00000000
00000000 d6d33fa8
[    8.746870] 3fa0: c0107e60 c0177f04 1ef80900 00000000 0000000d b6d4f004
00000000 b6d4f928
[    8.765132] 3fc0: 1ef80900 00000000 00000000 0000017b b6d4f004 00020000
00af6e18 00000000
[    8.783394] 3fe0: bec95200 bec951f0 b6d4709c b6ea3c40 60000010 0000000d
00000000 00000000
[    8.801685] [<c076a1b4>] (kobject_put) from [<c048edb8>]
(put_device+0x24/0x28)
[    8.814234] [<c048edb8>] (put_device) from [<bf0113dc>]
(devm_backlight_put+0x24/0x28 [backlight])
[    8.833323] [<bf0113dc>] (devm_backlight_put [backlight]) from
[<c0496fc4>] (devm_action_release+0x1c/0x20)
[    8.853182] [<c0496fc4>] (devm_action_release) from [<c04979f0>]
(release_nodes+0x1a4/0x1cc)
[    8.871702] [<c04979f0>] (release_nodes) from [<c0497ad0>]
(devres_release_all+0x48/0x54)
[    8.889956] [<c0497ad0>] (devres_release_all) from [<c0493efc>]
(driver_probe_device+0x2bc/0x470)
[    8.908937] [<c0493efc>] (driver_probe_device) from [<c049414c>]
(__driver_attach+0x9c/0x100)
[    8.927557] [<c049414c>] (__driver_attach) from [<c0492018>]
(bus_for_each_dev+0x7c/0xa0)
[    8.945822] [<c0492018>] (bus_for_each_dev) from [<c0493750>]
(driver_attach+0x28/0x30)
[    8.963916] [<c0493750>] (driver_attach) from [<c0493124>]
(bus_add_driver+0xe8/0x240)
[    8.981929] [<c0493124>] (bus_add_driver) from [<c0494954>]
(driver_register+0xac/0xf0)
[    9.000048] [<c0494954>] (driver_register) from [<c04c8794>]
(__spi_register_driver+0x58/0x6c)
[    9.018823] [<c04c8794>] (__spi_register_driver) from [<bf033020>]
(mi0283qt_spi_driver_init+0x20/0x1000 [mi0283qt])
[    9.039575] [<bf033020>] (mi0283qt_spi_driver_init [mi0283qt]) from
[<c0101a30>] (do_one_initcall+0xc4/0x184)
[    9.059727] [<c0101a30>] (do_one_initcall) from [<c0178628>]
(do_init_module+0x6c/0x1fc)
[    9.078036] [<c0178628>] (do_init_module) from [<c0177810>]
(load_module+0x1b1c/0x2090)
[    9.096248] [<c0177810>] (load_module) from [<c0177f94>]
(SyS_finit_module+0x9c/0xcc)
[    9.114284] [<c0177f94>] (SyS_finit_module) from [<c0107e60>]
(ret_fast_syscall+0x0/0x54)
[    9.132673] Code: e24cb004 e24dd00c e2504000 0a00005e (e5d43020)
[    9.144181] ---[ end trace 149c05934b6a6dcc ]---
Is the reason possibly because we have omitted error checking on the
return value of backlight_enable function ? tinydrm_enable_backlight and
tinydrm_disable_baclight do this.
Eg.
ret = backlight_update_status(backlight);
if (ret)
	DRM_ERROR("Failed to enable backlight %d\n", ret);

I'm not sure, just asking whether this could be a possible reason
for the above trace.
The crash happens during probe.
I guess you'll figure this out when you get some hw to test on.
I have set up the raspberry pi and have built and boot into the custom kernel
but I am waiting for the panel to arrive. Meanwhile, any thoughts on
error message ? Sorry for the trivial question, but I did not quite
understand the crash message and how to replicate it.

of_find_backlight() can return an error pointer (-EPROBE_DEFER):

diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 4bb7bf3ee443..57370c5d51f0 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -635,8 +635,8 @@ struct backlight_device *devm_of_find_backlight(struct device *dev)
        int ret;

        bd = of_find_backlight(dev);
-       if (!bd)
-               return NULL;
+       if (IS_ERR_OR_NULL(bd))
+               return bd;

        ret = devm_add_action(dev, devm_backlight_put, bd);
        if (ret) {

That solved the crash, but the backlight didn't turn on.
I had to do this as well:

diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index 5c441d4c049c..6f9925f10a7c 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -139,6 +139,8 @@ static inline int backlight_enable(struct backlight_device *bd)
        if (!bd)
                return 0;

+       if (!bd->props.brightness)
+               bd->props.brightness = bd->props.max_brightness;
        bd->props.power = FB_BLANK_UNBLANK;
        bd->props.state &= ~BL_CORE_FBBLANK;

This is my backlight node[1]:

backlight: backlight {
    compatible = "gpio-backlight";
    gpios = <&gpio 18 0>; // GPIO_ACTIVE_HIGH
};

Not certain that this is the "correct" solution, but I can't use the
gpio-backlight property default-on, because that would turn on backlight
before the pipeline is enabled.

You can dry-run the driver without a panel connected, it can work
without being able to read from the controller.

Noralf.

[1] https://github.com/notro/tinydrm/blob/master/rpi-overlays/rpi-display-overlay.dts

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux