Zhang Yubing 5313e1d097 drm/rockchip: logo: add the effect bridge state for atomic state
Some display interface driver will register encoder and bridge.
The analogix edp driver is one of these driver and it will use
the bridge state in atomic_check callback. If no bridge state
get, the atomic_check will return without assign a value to the
crtc_state.output_type.

When enable uboot logo, if no bridge state get for the analogix
edp, the old_crtc_state.output_type will be 0 and the
new_crtc_state.output_type will be DRM_MODE_CONNECTOR_eDP. It
assume that this different will affect nothing. But when the edp
attach to VOPB/L and assign the VOPB/L dclk parent as VPLL, the
crtc atomic_check callback will change the VOPB/L dclk parent
and issue a mode change. this mode change will call the edp driver
encoder_disable callback and reference the encoder.crtc pointer.
This point only assign a value in
drm_atomic_helper_update_legacy_modeset_state(). So a NULL pointer
issue will happen as follow:
[    3.489609] Unable to handle kernel NULL pointer dereference at virtual address 00000000000005c8
[    3.585216] Mem abort info:
[    3.585219]   ESR = 0x0000000096000005
[    3.585223]   EC = 0x25: DABT (current EL), IL = 32 bits
[    3.585227]   SET = 0, FnV = 0
[    3.585230]   EA = 0, S1PTW = 0
[    3.585232]   FSC = 0x05: level 1 translation fault
[    3.585235] Data abort info:
[    3.585237]   ISV = 0, ISS = 0x00000005
[    3.585240]   CM = 0, WnR = 0
[    3.586697] mmcblk0rpmb: mmc0:0001 AJTD4R 4.00 MiB, chardev (235:0)
[    3.587117] [00000000000005c8] user address but active_mm is swapper
[    3.587121] Internal error: Oops: 0000000096000005 [#1] SMP
[    3.592746] Modules linked in:
[    3.593023] CPU: 5 PID: 46 Comm: kworker/u12:1 Not tainted 6.1.99 #517
[    3.593595] Hardware name: Rockchip RK3399 EVB IND LPDDR4 Board edp (Linux) (DT)
[    3.594244] Workqueue: events_unbound deferred_probe_work_func
[    3.594764] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    3.595380] pc : rockchip_dp_drm_encoder_disable+0x20/0x10c
[    3.595874] lr : drm_atomic_helper_commit_modeset_disables+0x1e0/0x670
[    3.596444] sp : ffffffc00a71b6b0
[    3.596741] x29: ffffffc00a71b6b0 x28: ffffff80049ce200 x27: 0000000000000038
[    3.597370] x26: ffffff8003091810 x25: ffffff8004d27c98 x24: 0000000000000000
[    3.597999] x23: 0000000000000000 x22: ffffffc009971ade x21: ffffffc00991a755
[    3.598628] x20: ffffff80049c9c80 x19: ffffff8004d27c98 x18: ffffff8003154090
[    3.599257] x17: 685f63696d6f7461 x16: ffffffffffffffff x15: ffffff800a2f4400
[    3.599885] x14: 0000000000000000 x13: 0000000000000350 x12: 000000000104202a
[    3.600514] x11: 0000000000800000 x10: 0000000000000000 x9 : ffffffc0087ef158
[    3.601143] x8 : 0000000000000000 x7 : 72205d3536353938 x6 : 0000000000000000
[    3.601771] x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffffffc00a71b5a0
[    3.602399] x2 : ffffff8002cac4c0 x1 : ffffff80049c9c80 x0 : ffffff8004d27c98
[    3.603027] Call trace:
[    3.603245]  rockchip_dp_drm_encoder_disable+0x20/0x10c
[    3.603704]  drm_atomic_helper_commit_modeset_disables+0x1e0/0x670
[    3.604250]  rockchip_drm_atomic_helper_commit_tail_rpm+0x4c/0x2d8
[    3.604799]  commit_tail+0xa8/0x154
[    3.605108]  drm_atomic_helper_commit+0x1c8/0x1e4
[    3.605519]  drm_atomic_commit+0xa8/0xd0
[    3.605864]  rockchip_drm_show_logo+0x1a98/0x1c50
[    3.606276]  rockchip_drm_bind+0x1fc/0x2ac
[    3.606643]  try_to_bring_up_aggregate_device+0x1f8/0x28c
[    3.607123]  __component_add+0xc4/0x180
[    3.607467]  component_add+0x18/0x20
[    3.607788]  rockchip_dp_probe+0x41c/0x480
[    3.608154]  platform_probe+0xa8/0xd0
[    3.608476]  really_probe+0x168/0x3f8
[    3.608798]  __driver_probe_device+0xa4/0x164
[    3.609186]  driver_probe_device+0x40/0x210
[    3.609553]  __device_attach_driver+0x12c/0x1c0
[    3.609954]  bus_for_each_drv+0x88/0xd0
[    3.610299]  __device_attach+0xd4/0x1c0
[    3.610642]  device_initial_probe+0x18/0x20
[    3.611009]  bus_probe_device+0x38/0x98
[    3.611354]  deferred_probe_work_func+0xa4/0xf8
[    3.611754]  process_one_work+0x1e0/0x400
[    3.612112]  worker_thread+0x340/0x55c
[    3.612445]  kthread+0xcc/0x204
[    3.612722]  ret_from_fork+0x10/0x20

To avoid this issue, a method is to add the effect bridge state when
show logo.

Fixes: a7620fa846 ("drm/rockchip: analogix_dp: add support for color format yuv444/yuv422")

Change-Id: Ie1f1ce5a8a21809a146acd48f3ee94d1a8879eb6
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
2025-07-07 13:18:53 +00:00
2023-06-15 09:54:33 +01:00

How do I submit patches to Android Common Kernels

  1. BEST: Make all of your changes to upstream Linux. If appropriate, backport to the stable releases. These patches will be merged automatically in the corresponding common kernels. If the patch is already in upstream Linux, post a backport of the patch that conforms to the patch requirements below.

    • Do not send patches upstream that contain only symbol exports. To be considered for upstream Linux, additions of EXPORT_SYMBOL_GPL() require an in-tree modular driver that uses the symbol -- so include the new driver or changes to an existing driver in the same patchset as the export.
    • When sending patches upstream, the commit message must contain a clear case for why the patch is needed and beneficial to the community. Enabling out-of-tree drivers or functionality is not not a persuasive case.
  2. LESS GOOD: Develop your patches out-of-tree (from an upstream Linux point-of-view). Unless these are fixing an Android-specific bug, these are very unlikely to be accepted unless they have been coordinated with kernel-team@android.com. If you want to proceed, post a patch that conforms to the patch requirements below.

Common Kernel patch requirements

  • All patches must conform to the Linux kernel coding standards and pass scripts/checkpatch.pl
  • Patches shall not break gki_defconfig or allmodconfig builds for arm, arm64, x86, x86_64 architectures (see https://source.android.com/setup/build/building-kernels)
  • If the patch is not merged from an upstream branch, the subject must be tagged with the type of patch: UPSTREAM:, BACKPORT:, FROMGIT:, FROMLIST:, or ANDROID:.
  • All patches must have a Change-Id: tag (see https://gerrit-review.googlesource.com/Documentation/user-changeid.html)
  • If an Android bug has been assigned, there must be a Bug: tag.
  • All patches must have a Signed-off-by: tag by the author and the submitter

Additional requirements are listed below based on patch type

Requirements for backports from mainline Linux: UPSTREAM:, BACKPORT:

  • If the patch is a cherry-pick from Linux mainline with no changes at all
    • tag the patch subject with UPSTREAM:.
    • add upstream commit information with a (cherry picked from commit ...) line
    • Example:
      • if the upstream commit message is
        important patch from upstream

        This is the detailed description of the important patch

        Signed-off-by: Fred Jones <fred.jones@foo.org>
  • then Joe Smith would upload the patch for the common kernel as
        UPSTREAM: important patch from upstream

        This is the detailed description of the important patch

        Signed-off-by: Fred Jones <fred.jones@foo.org>

        Bug: 135791357
        Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01
        (cherry picked from commit c31e73121f4c1ec41143423ac6ce3ce6dafdcec1)
        Signed-off-by: Joe Smith <joe.smith@foo.org>
  • If the patch requires any changes from the upstream version, tag the patch with BACKPORT: instead of UPSTREAM:.
    • use the same tags as UPSTREAM:
    • add comments about the changes under the (cherry picked from commit ...) line
    • Example:
        BACKPORT: important patch from upstream

        This is the detailed description of the important patch

        Signed-off-by: Fred Jones <fred.jones@foo.org>

        Bug: 135791357
        Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01
        (cherry picked from commit c31e73121f4c1ec41143423ac6ce3ce6dafdcec1)
        [joe: Resolved minor conflict in drivers/foo/bar.c ]
        Signed-off-by: Joe Smith <joe.smith@foo.org>

Requirements for other backports: FROMGIT:, FROMLIST:,

  • If the patch has been merged into an upstream maintainer tree, but has not yet been merged into Linux mainline
    • tag the patch subject with FROMGIT:
    • add info on where the patch came from as (cherry picked from commit <sha1> <repo> <branch>). This must be a stable maintainer branch (not rebased, so don't use linux-next for example).
    • if changes were required, use BACKPORT: FROMGIT:
    • Example:
      • if the commit message in the maintainer tree is
        important patch from upstream

        This is the detailed description of the important patch

        Signed-off-by: Fred Jones <fred.jones@foo.org>
  • then Joe Smith would upload the patch for the common kernel as
        FROMGIT: important patch from upstream

        This is the detailed description of the important patch

        Signed-off-by: Fred Jones <fred.jones@foo.org>

        Bug: 135791357
        (cherry picked from commit 878a2fd9de10b03d11d2f622250285c7e63deace
         https://git.kernel.org/pub/scm/linux/kernel/git/foo/bar.git test-branch)
        Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01
        Signed-off-by: Joe Smith <joe.smith@foo.org>
  • If the patch has been submitted to LKML, but not accepted into any maintainer tree
    • tag the patch subject with FROMLIST:
    • add a Link: tag with a link to the submittal on lore.kernel.org
    • add a Bug: tag with the Android bug (required for patches not accepted into a maintainer tree)
    • if changes were required, use BACKPORT: FROMLIST:
    • Example:
        FROMLIST: important patch from upstream

        This is the detailed description of the important patch

        Signed-off-by: Fred Jones <fred.jones@foo.org>

        Bug: 135791357
        Link: https://lore.kernel.org/lkml/20190619171517.GA17557@someone.com/
        Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01
        Signed-off-by: Joe Smith <joe.smith@foo.org>

Requirements for Android-specific patches: ANDROID:

  • If the patch is fixing a bug to Android-specific code
    • tag the patch subject with ANDROID:
    • add a Fixes: tag that cites the patch with the bug
    • Example:
        ANDROID: fix android-specific bug in foobar.c

        This is the detailed description of the important fix

        Fixes: 1234abcd2468 ("foobar: add cool feature")
        Change-Id: I4caaaa566ea080fa148c5e768bb1a0b6f7201c01
        Signed-off-by: Joe Smith <joe.smith@foo.org>
  • If the patch is a new feature
    • tag the patch subject with ANDROID:
    • add a Bug: tag with the Android bug (required for android-specific features)
Description
No description provided
Readme 7.9 GiB
Languages
C 97.7%
Assembly 1.6%
Makefile 0.3%
Perl 0.1%