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

drm/bridge: sec-dsim: Set orientation from panel #9

Open
wants to merge 1 commit into
base: lf-6.1.y
Choose a base branch
from

Conversation

matuszpd
Copy link
Contributor

@matuszpd matuszpd commented Jul 24, 2023

Since 5e41b01a7808 ("drm/panel: Add an API to allow drm to set orientation from panel") it is possible to use panel get_orientation callback rather than calling drm_connector_set_panel_orientation() from within a panel driver that leads to:

[    3.261557] WARNING: CPU: 2 PID: 298 at drivers/gpu/drm/drm_mode_object.c:45 drm_mode_object_add+0x88/0x90
[    3.261578] Modules linked in: btmrvl_sdio btmrvl mwifiex_sdio mwifiex cryptodev(O)
[    3.261599] CPU: 2 PID: 298 Comm: weston Tainted: G        W  O      5.15.71-lts-5.15.y #1
[    3.261605] Hardware name: StreamMagic XXX (DT)
[    3.261609] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    3.261615] pc : drm_mode_object_add+0x88/0x90
[    3.261622] lr : drm_property_create+0xdc/0x1ac
[    3.261627] sp : ffff8000099bb990
[    3.261630] x29: ffff8000099bb990 x28: 0000000000000023 x27: ffff8000099bbd48
[    3.261639] x26: 0000000000000780 x25: 00000000000000a7 x24: ffff80000947a430
[    3.261648] x23: ffff800008fd84b8 x22: 0000000000000004 x21: 00000000b0b0b0b0
[    3.261656] x20: ffff0000057c6a10 x19: ffff0000052a6800 x18: ffffffffffffffff
[    3.261665] x17: 0000000000000000 x16: 0000000000000000 x15: ffff000004beda1c
[    3.261674] x14: 00000000000001e3 x13: 0000000000000001 x12: 0000000000000000
[    3.261682] x11: 0000000000000000 x10: 00000000000009e0 x9 : 0000000000000000
[    3.261691] x8 : ffff0000057c6b80 x7 : 0000000000000000 x6 : 000000000000003f
[    3.261699] x5 : 0000000000000040 x4 : ffff8000099bb9b0 x3 : 0000000000000001
[    3.261708] x2 : 00000000b0b0b0b0 x1 : ffff0000057c6a10 x0 : 0000000000000001
[    3.261717] Call trace:
[    3.261720]  drm_mode_object_add+0x88/0x90
[    3.261727]  drm_property_create+0xdc/0x1ac
[    3.261731]  drm_property_create_enum+0x2c/0x94
[    3.261737]  drm_connector_set_panel_orientation+0x98/0xc0
[    3.261743]  ili9881c_get_modes+0x54/0x14c
[    3.261752]  drm_panel_get_modes+0x24/0x40
[    3.261757]  sec_mipi_dsim_connector_get_modes+0x1c/0x34
[    3.261763]  drm_helper_probe_single_connector_modes+0x1ac/0x790
[    3.261771]  drm_mode_getconnector+0x2ac/0x570
[    3.261778]  drm_ioctl_kernel+0xc4/0x114
[    3.261783]  drm_ioctl+0x214/0x44c
[    3.261788]  __arm64_sys_ioctl+0xa8/0xf0
[    3.261796]  invoke_syscall+0x48/0x114
[    3.261803]  el0_svc_common.constprop.0+0x44/0xfc
[    3.261809]  do_el0_svc+0x28/0x90
[    3.261815]  el0_svc+0x28/0x80
[    3.261821]  el0t_64_sync_handler+0xa4/0x130
[    3.261827]  el0t_64_sync+0x1a0/0x1a4
[    3.261833] ---[ end trace d008dc3dcf118dfe ]---
[    3.261883] ------------[ cut here ]------------
[    3.261888] WARNING: CPU: 2 PID: 298 at drivers/gpu/drm/drm_mode_object.c:242 drm_object_attach_property+0x6c/0xb0
[    3.261899] Modules linked in: btmrvl_sdio btmrvl mwifiex_sdio mwifiex cryptodev(O)
[    3.261914] CPU: 2 PID: 298 Comm: weston Tainted: G        W  O      5.15.71-lts-5.15.y #1
[    3.261920] Hardware name: StreamMagic XXX (DT)
[    3.261923] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    3.261929] pc : drm_object_attach_property+0x6c/0xb0
[    3.261936] lr : drm_connector_set_panel_orientation+0x5c/0xc0
[    3.261942] sp : ffff8000099bba30
[    3.261944] x29: ffff8000099bba30 x28: 0000000000000023 x27: ffff8000099bbd48
[    3.261953] x26: 0000000000000780 x25: 00000000000000a7 x24: ffff80000947a430
[    3.261962] x23: 0000000000000000 x22: ffff00000540b008 x21: ffff0000052a6800
[    3.261971] x20: ffff0000052a78a0 x19: ffff0000052a78a0 x18: ffffffffffffffff
[    3.261980] x17: 0000000000000000 x16: 0000000000000000 x15: ffff000004beda1c
[    3.261988] x14: 00000000000001e3 x13: 0000000000000001 x12: 0000000000000000
[    3.261997] x11: 0000000000000000 x10: 00000000000009e0 x9 : 0000000000000000
[    3.262005] x8 : ffff0000057c6700 x7 : 00000000c0c0c0c0 x6 : 00000000c0c0c0c0
[    3.262014] x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000006
[    3.262022] x2 : 0000000000000003 x1 : ffff0000057c6a00 x0 : ffff0000052a78c8
[    3.262030] Call trace:
[    3.262033]  drm_object_attach_property+0x6c/0xb0
[    3.262039]  ili9881c_get_modes+0x54/0x14c
[    3.262047]  drm_panel_get_modes+0x24/0x40
[    3.262052]  sec_mipi_dsim_connector_get_modes+0x1c/0x34
[    3.262057]  drm_helper_probe_single_connector_modes+0x1ac/0x790
[    3.262065]  drm_mode_getconnector+0x2ac/0x570
[    3.262071]  drm_ioctl_kernel+0xc4/0x114
[    3.262077]  drm_ioctl+0x214/0x44c
[    3.262081]  __arm64_sys_ioctl+0xa8/0xf0
[    3.262087]  invoke_syscall+0x48/0x114
[    3.262093]  el0_svc_common.constprop.0+0x44/0xfc
[    3.262099]  do_el0_svc+0x28/0x90
[    3.262104]  el0_svc+0x28/0x80
[    3.262109]  el0t_64_sync_handler+0xa4/0x130
[    3.262115]  el0t_64_sync+0x1a0/0x1a4
[    3.262120] ---[ end trace d008dc3dcf118dff ]---

Some panels drivers have already been updated to implement the callback, so it makes sense to add support for this functionality here, which this patch does.

If implemented, use panel get_orientation callback rather than calling
drm_connector_set_panel_orientation() from within a panel driver that
leads to a WARN().

Signed-off-by: Matus Gajdos <[email protected]>
sebastient pushed a commit to MaivinAI/linux-maivin that referenced this pull request Aug 3, 2023
commit c3ed222 upstream.

Send along the already-allocated fattr along with nfs4_fs_locations, and
drop the memcpy of fattr.  We end up growing two more allocations, but this
fixes up a crash as:

PID: 790    TASK: ffff88811b43c000  CPU: 0   COMMAND: "ls"
 #0 [ffffc90000857920] panic at ffffffff81b9bfde
 nxp-imx#1 [ffffc900008579c0] do_trap at ffffffff81023a9b
 nxp-imx#2 [ffffc90000857a10] do_error_trap at ffffffff81023b78
 nxp-imx#3 [ffffc90000857a58] exc_stack_segment at ffffffff81be1f45
 nxp-imx#4 [ffffc90000857a80] asm_exc_stack_segment at ffffffff81c009de
 nxp-imx#5 [ffffc90000857b08] nfs_lookup at ffffffffa0302322 [nfs]
 nxp-imx#6 [ffffc90000857b70] __lookup_slow at ffffffff813a4a5f
 nxp-imx#7 [ffffc90000857c60] walk_component at ffffffff813a86c4
 nxp-imx#8 [ffffc90000857cb8] path_lookupat at ffffffff813a9553
 nxp-imx#9 [ffffc90000857cf0] filename_lookup at ffffffff813ab86b

Suggested-by: Trond Myklebust <[email protected]>
Fixes: 9558a00 ("NFS: Remove the label from the nfs4_lookup_res struct")
Signed-off-by: Benjamin Coddington <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
sebastient pushed a commit to MaivinAI/linux-maivin that referenced this pull request Aug 3, 2023
commit 4f40a5b upstream.

This was missed in c3ed222 ("NFSv4: Fix free of uninitialized
nfs4_label on referral lookup.") and causes a panic when mounting
with '-o trunkdiscovery':

PID: 1604   TASK: ffff93dac3520000  CPU: 3   COMMAND: "mount.nfs"
 #0 [ffffb79140f738f8] machine_kexec at ffffffffaec64bee
 nxp-imx#1 [ffffb79140f73950] __crash_kexec at ffffffffaeda67fd
 nxp-imx#2 [ffffb79140f73a18] crash_kexec at ffffffffaeda76ed
 nxp-imx#3 [ffffb79140f73a30] oops_end at ffffffffaec2658d
 nxp-imx#4 [ffffb79140f73a50] general_protection at ffffffffaf60111e
    [exception RIP: nfs_fattr_init+0x5]
    RIP: ffffffffc0c18265  RSP: ffffb79140f73b08  RFLAGS: 00010246
    RAX: 0000000000000000  RBX: ffff93dac304a800  RCX: 0000000000000000
    RDX: ffffb79140f73bb0  RSI: ffff93dadc8cbb40  RDI: d03ee11cfaf6bd50
    RBP: ffffb79140f73be8   R8: ffffffffc0691560   R9: 0000000000000006
    R10: ffff93db3ffd3df8  R11: 0000000000000000  R12: ffff93dac4040000
    R13: ffff93dac2848e00  R14: ffffb79140f73b60  R15: ffffb79140f73b30
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 nxp-imx#5 [ffffb79140f73b08] _nfs41_proc_get_locations at ffffffffc0c73d53 [nfsv4]
 nxp-imx#6 [ffffb79140f73bf0] nfs4_proc_get_locations at ffffffffc0c83e90 [nfsv4]
 nxp-imx#7 [ffffb79140f73c60] nfs4_discover_trunking at ffffffffc0c83fb7 [nfsv4]
 nxp-imx#8 [ffffb79140f73cd8] nfs_probe_fsinfo at ffffffffc0c0f95f [nfs]
 nxp-imx#9 [ffffb79140f73da0] nfs_probe_server at ffffffffc0c1026a [nfs]
    RIP: 00007f6254fce26e  RSP: 00007ffc69496ac8  RFLAGS: 00000246
    RAX: ffffffffffffffda  RBX: 0000000000000000  RCX: 00007f6254fce26e
    RDX: 00005600220a82a0  RSI: 00005600220a64d0  RDI: 00005600220a6520
    RBP: 00007ffc69496c50   R8: 00005600220a8710   R9: 003035322e323231
    R10: 0000000000000000  R11: 0000000000000246  R12: 00007ffc69496c50
    R13: 00005600220a8440  R14: 0000000000000010  R15: 0000560020650ef9
    ORIG_RAX: 00000000000000a5  CS: 0033  SS: 002b

Fixes: c3ed222 ("NFSv4: Fix free of uninitialized nfs4_label on referral lookup.")
Signed-off-by: Scott Mayhew <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
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

Successfully merging this pull request may close these issues.

1 participant