03 Dec, 2018

3 commits


28 Nov, 2018

5 commits

  • This is a work-around for the shifted display issue when using DCSS with
    the DDR self-refresh disabled.

    Also, make sure it works with LCDIF as well.

    Increasing VSYNC length gives DCSS more time to fetch the data from RAM
    before the next frame kicks in.

    Signed-off-by: Laurentiu Palcu
    (cherry picked from commit 3c53532c466add234ac3ca2e70cefe80ea308b4f)

    Laurentiu Palcu
     
  • When the master imx-drm-core binding fails, component_bind_all()
    in imx-drm-core ->bind() callback will unbind all bound components
    first and then call drm_mode_config_cleanup(). Since the encoder
    and connector(located in imx_ldb.imx_ldb_channel) are freed after
    the ldb ->unbind() callback, drm_mode_config_cleanup() would
    accidentally access the freed encoder and connector again. To fix
    this issue, we should cleanup the encoder and connector, i.e.,
    remove them from the global encoder and connector lists, in the
    ->unbind() callback, so that, drm_mode_config_cleanup() won't find
    them again in the lists. However, we have to make sure they exist
    before the cleanup in the ->unbind() callback, because imx-drm-core
    ->unbind() calls drm_mode_config_cleanup() first and then unbinds
    all components via component_unbind_all(). Moreover, the connector
    isn't created at the first place if a bridge exists, so the check
    before the cleanup makes sense for this reason as well.

    Signed-off-by: Liu Ying
    (cherry picked from commit 6d3fd1316d67ff0e62fae4067b61fd3f2809dfa5)

    Liu Ying
     
  • When the master imx-drm-core binding fails, component_bind_all()
    in imx-drm-core ->bind() callback will unbind all bound components
    first and then call drm_mode_config_cleanup(). Since the crtc as
    a member(base) of dpu_crtc is freed after the dpu crtc ->unbind()
    callback, drm_mode_config_cleanup() would accidentally access the
    freed crtc again. To fix this issue, we should cleanup the crtc,
    i.e., remove the crtc from the global crtc list, in the ->unbind()
    callback, so that drm_mode_config_cleanup() won't find the crtc
    again in the list. However, we have to make sure the crtc exists
    before the cleanup in the ->unbind() callback, because imx-drm-core
    ->unbind() calls drm_mode_config_cleanup() first and then unbinds
    all components via component_unbind_all().

    There is a probe deferral caused by the LDB component(later probed
    GPIO resource) on some platforms(e.g., i.MX8QXP MEK), which causes
    multiple times to try binding and triggers the issue described above.

    This patch may fix the issue reported by KASAN:
    [ 3.217996] BUG: KASAN: use-after-free in drm_mode_config_cleanup+0x220/0x448
    [ 3.225149] Read of size 8 at addr ffff80000ad719b0 by task swapper/0/1
    [ 3.231769]
    [ 3.233279] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.14.78-05529-ge53ea0dba88e-dirty #43
    [ 3.241642] Hardware name: Freescale i.MX8QXP MEK (DT)
    [ 3.246793] Call trace:
    [ 3.249270] [] dump_backtrace+0x0/0x390
    [ 3.254690] [] show_stack+0x14/0x20
    [ 3.259769] [] dump_stack+0xf8/0x158
    [ 3.264932] [] print_address_description+0x60/0x270
    [ 3.271396] [] kasan_report+0x210/0x2f0
    [ 3.276818] [] __asan_load8+0x84/0xa8
    [ 3.282065] [] drm_mode_config_cleanup+0x220/0x448
    [ 3.288447] [] imx_drm_bind+0x2b4/0x358
    [ 3.293863] [] try_to_bring_up_master+0x20c/0x278
    [ 3.300148] [] component_add+0x180/0x300
    [ 3.305653] [] dpu_bliteng_probe+0x30/0x48
    [ 3.311339] [] platform_drv_probe+0x74/0x108
    [ 3.317198] [] driver_probe_device+0x3a0/0x4a8
    [ 3.323226] [] __driver_attach+0xd0/0xd8
    [ 3.328735] [] bus_for_each_dev+0xc0/0x140
    [ 3.334419] [] driver_attach+0x30/0x40
    [ 3.339749] [] bus_add_driver+0x2a8/0x320
    [ 3.345344] [] driver_register+0xb4/0x190
    [ 3.350941] [] __platform_driver_register+0x7c/0x88
    [ 3.357410] [] dpu_bliteng_driver_init+0x1c/0x24
    [ 3.363613] [] do_one_initcall+0xe0/0x260
    [ 3.369211] [] kernel_init_freeable+0x230/0x2d8
    [ 3.375330] [] kernel_init+0x10/0x118
    [ 3.380574] [] ret_from_fork+0x10/0x18
    [ 3.385894]
    [ 3.387393] Allocated by task 1:
    [ 3.390642] kasan_kmalloc+0xd0/0x180
    [ 3.394322] kasan_slab_alloc+0x14/0x20
    [ 3.398174] __kmalloc_node_track_caller+0x1ec/0x278
    [ 3.403157] devm_kmalloc+0x8c/0x128
    [ 3.406753] dpu_crtc_bind+0x38/0xbe0
    [ 3.410434] component_bind_all+0x254/0x438
    [ 3.414638] imx_drm_bind+0x1b0/0x358
    [ 3.418314] try_to_bring_up_master+0x20c/0x278
    [ 3.422857] component_add+0x180/0x300
    [ 3.426622] dpu_bliteng_probe+0x30/0x48
    [ 3.430559] platform_drv_probe+0x74/0x108
    [ 3.434676] driver_probe_device+0x3a0/0x4a8
    [ 3.438966] __driver_attach+0xd0/0xd8
    [ 3.442730] bus_for_each_dev+0xc0/0x140
    [ 3.446663] driver_attach+0x30/0x40
    [ 3.450251] bus_add_driver+0x2a8/0x320
    [ 3.454103] driver_register+0xb4/0x190
    [ 3.457960] __platform_driver_register+0x7c/0x88
    [ 3.462687] dpu_bliteng_driver_init+0x1c/0x24
    [ 3.467147] do_one_initcall+0xe0/0x260
    [ 3.470997] kernel_init_freeable+0x230/0x2d8
    [ 3.475366] kernel_init+0x10/0x118
    [ 3.478867] ret_from_fork+0x10/0x18
    [ 3.482447]
    [ 3.483941] Freed by task 1:
    [ 3.486837] kasan_slab_free+0x88/0x198
    [ 3.490691] kfree+0x70/0x210
    [ 3.493672] release_nodes+0x538/0x5c0
    [ 3.497432] devres_release_group+0x164/0x200
    [ 3.501801] component_unbind.isra.4+0x98/0xb8
    [ 3.506257] component_bind_all+0x3c8/0x438
    [ 3.510456] imx_drm_bind+0x1b0/0x358
    [ 3.514131] try_to_bring_up_master+0x20c/0x278
    [ 3.518671] component_add+0x180/0x300
    [ 3.522434] dpu_bliteng_probe+0x30/0x48
    [ 3.526375] platform_drv_probe+0x74/0x108
    [ 3.530490] driver_probe_device+0x3a0/0x4a8
    [ 3.534781] __driver_attach+0xd0/0xd8
    [ 3.538551] bus_for_each_dev+0xc0/0x140
    [ 3.542488] driver_attach+0x30/0x40
    [ 3.546083] bus_add_driver+0x2a8/0x320
    [ 3.549941] driver_register+0xb4/0x190
    [ 3.553793] __platform_driver_register+0x7c/0x88
    [ 3.558519] dpu_bliteng_driver_init+0x1c/0x24
    [ 3.562979] do_one_initcall+0xe0/0x260
    [ 3.566827] kernel_init_freeable+0x230/0x2d8
    [ 3.571199] kernel_init+0x10/0x118
    [ 3.574698] ret_from_fork+0x10/0x18
    [ 3.578277]
    [ 3.579783] The buggy address belongs to the object at ffff80000ad71980
    [ 3.579783] which belongs to the cache kmalloc-2048 of size 2048
    [ 3.592501] The buggy address is located 48 bytes inside of
    [ 3.592501] 2048-byte region [ffff80000ad71980, ffff80000ad72180)
    [ 3.604258] The buggy address belongs to the page:
    [ 3.609072] page:ffff7e00002b5c00 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0
    [ 3.618926] flags: 0xfffc00000008100(slab|head)
    [ 3.623484] raw: 0fffc00000008100 0000000000000000 0000000000000000 00000001800f000f
    [ 3.631252] raw: dead000000000100 dead000000000200 ffff800010703400 0000000000000000
    [ 3.639007] page dumped because: kasan: bad access detected
    [ 3.644590]
    [ 3.646086] Memory state around the buggy address:
    [ 3.650898] ffff80000ad71880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
    [ 3.658134] ffff80000ad71900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
    [ 3.665370] >ffff80000ad71980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    [ 3.672599] ^
    [ 3.677402] ffff80000ad71a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    [ 3.684641] ffff80000ad71a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb

    Signed-off-by: Liu Ying
    (cherry picked from commit 5fc482dbf423fff005214db5ac4ac2dcd5cae028)

    Liu Ying
     
  • The dpu_plane is allocated with kzalloc() in dpu_plane_init().
    In case, dpu_plane_init() fails after that allocation, the bailout path
    should free the dpu_plane, otherwise, there will be memory leakage.

    Signed-off-by: Liu Ying
    (cherry picked from commit 99cb80f855aafbe524519db635c3d03bd4cc8d85)

    Liu Ying
     
  • When an atomic commit contains an active CRTC with no plane,
    it may cause two potential issues:

    First, this CRTC will fetch its last attached plane data
    or has no data can be fetched depending on the plane
    driver's atomic_disable() implementation.

    Second, this CRTC's 'plane_changed' will be false during
    the whole commit tail stage, and this will make vblank
    wait to be bypassed which directly causes the later wait
    flip done timeout.

    So add this commit case check to the LCDIF CRTC's atomic
    check to block this kind of commits.

    Signed-off-by: Fancy Fang
    (cherry picked from commit 67ced65259a4dbf040ce4a931325be6ba97e5131)

    Fancy Fang
     

27 Nov, 2018

1 commit

  • When pixel combiner is used, it turns out that on-the-fly switch from
    tile framebuffer to linear framebuffer would cause hardware malfunction
    - right half display would be missing and master&slave content shadow
    load done event won't come. Thus, go for a full modeset as a workaround.
    Note that we check if the original framebuffer is tile or not for both
    primary and overlay planes. So, this could be over-kill. The issue was
    found when we use 32bit GPU super tile as the original framebuffer on the
    primary plane(restart Weston frequently). However, since we usually
    don't do this kind of switch in real graphics, it should be fine.

    Signed-off-by: Liu Ying
    (cherry picked from commit 9245bbf650fdeb79ebf869d48b6bd1b43c2bcf3b)

    Liu Ying
     

20 Nov, 2018

1 commit


15 Nov, 2018

2 commits


13 Nov, 2018

4 commits


12 Nov, 2018

4 commits

  • The video mode tmp_m, as a local variable in tcon_cfg_videomode(),
    is uninitialized and used to store a copy instance from the real
    video mode. tcon_cfg_videomode() would change the timing of it if
    side_by_side mode is enabled. Theoretically, there should be no
    problem even if we don't initialize tmp_m. However, coverity
    reports that tmp_m is an uninitialized scalar variable when the copy
    is being done(CID 5233067: Uninitialized scalar variable (UNINIT)).
    This patch fixes the issue reported by coverity.

    Signed-off-by: Liu Ying

    Liu Ying
     
  • The logic in function h/vscaler_pixengcfg_dynamic_src_sel() to avoid
    overrunning array src_sel[i][j] is wrong. The correct one is to check
    on the index i which should be less than the array size of h/vs_id_array[].
    This patch fixes the potential array overrunning issue, that is,
    out-of-bounds array read issue. The issue is reported by coverity -
    CID 1477349 and CID 1477345.

    Signed-off-by: Liu Ying

    Liu Ying
     
  • The callers of dpu_{unit}_init() might provide an invalid id as
    the parameter, it may cause overrunning dpu->{unit}_priv[] and
    cf_shdlreqs[] arrays and out-of-bound array access. Although
    the current only caller is dpu_submodules_init() and it always
    provides valid ids, it would be good to fix the potential issue.
    This patch fixes several issues reported by coverity - CID 1477330,
    CID 1477335, CID 1477348, CID 1477346, CID 3298619, CID 1477347,
    CID 5233021 and CID 1477321.

    Signed-off-by: Liu Ying

    Liu Ying
     
  • The function get_xval() returns the C_XVAL and L_XVAL fields of
    the CURPIXELCNT and LASTPIXELCNT registers. They are 16bit and
    sit in the low 16bit of the registers. This patch fixes the way
    we mask the register and read the fields out.

    Signed-off-by: Liu Ying

    Liu Ying
     

09 Nov, 2018

2 commits


08 Nov, 2018

12 commits

  • If an RGB buffer is fed to channel-0, the output will have one line
    shifted down, with the last line appearing on top.

    Using the 7-tap filter will fix the issue. The 5-tap filter code will be
    removed completely.

    Signed-off-by: Dzung Hoang
    Signed-off-by: Laurentiu Palcu

    Dzung Hoang
     
  • The brightness, when REC709 was used in the configuration of the pipes,
    was lower than expected.

    The reason was the HDR10 configuration application that was used to
    create the tables had a parameter that was wrongly set.

    The tables were re-generated with the proper setting.

    Signed-off-by: Laurentiu Palcu

    Laurentiu Palcu
     
  • Currently, the enable of the axi clock return status is ignored, causing
    issues when the enable fails then we try to disable it. Therefore, it is
    better to check the return status and disable it only when enable
    succeeded.
    Also, remove the helper functions around clk_axi, since we can directly
    use the clk API function for enable/disable the clock. Those functions
    are already checking for NULL clk and returning 0 if that's the case.

    Signed-off-by: Robert Chiras i
    Acked-by: Leonard Crestez

    Robert Chiras
     
  • Patches related to suspend/resume have been backported from upstream
    kernel, therefore some of the mxsfb_drm_private members are no longer
    needed, so remove them, among with the code around them.

    Signed-off-by: Robert Chiras
    Acked-by: Leonard Crestez

    Robert Chiras
     
  • The lcdif block is only powered on when display is active so plane
    updates when not enabled are not valid. Writing to an unpowered IP block
    is mostly ignored but can trigger bus errors on some chips.

    Prevent this situation by switching to drm_atomic_helper_commit_tail_rpm
    and having the drm core ensure atomic_plane_update is only called while
    the crtc is active. This avoids having to keep track of "enabled" bits
    inside the mxsfb driver.

    This also requires handling the vblank event for disable from
    mxsfb_pipe_disable.

    Signed-off-by: Leonard Crestez
    Suggested-by: Stefan Agner
    Reviewed-by: Stefan Agner
    Reviewed-by: Sean Paul
    Signed-off-by: Stefan Agner
    Link: https://patchwork.freedesktop.org/patch/msgid/c19c0c00ed42e8e8f7965aa4821ac295abc5cd05.1537191359.git.leonard.crestez@nxp.com

    Leonard Crestez
     
  • Since power to the lcdif block can be lost on suspend implement
    PM_SLEEP_OPS using drm_mode_config_helper_suspend/resume to save/restore
    the current mode.

    Signed-off-by: Leonard Crestez
    Reviewed-by: Stefan Agner
    Reviewed-by: Sean Paul
    Signed-off-by: Stefan Agner
    Link: https://patchwork.freedesktop.org/patch/msgid/cfa1a4083eefd112362e640deeb2e120584ac3f5.1537191359.git.leonard.crestez@nxp.com

    Leonard Crestez
     
  • Add drm_mode_config_helper_suspend/resume() which takes care of
    atomic modeset suspend/resume for simple use cases.
    The suspend state is stored in struct drm_mode_config.

    Signed-off-by: Noralf Trønnes
    Reviewed-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20171106191812.38927-3-noralf@tronnes.org

    Noralf Trønnes
     
  • drm_fb_helper is *the* way of doing fbdev emulation so add a pointer to
    struct drm_device. This makes it possible to add callback helpers for
    .last_close and .output_poll_changed further reducing fbdev emulation
    footprint in drivers. The pointer is set by drm_fb_helper_init() and
    cleared by drm_fb_helper_fini().

    Signed-off-by: Noralf Trønnes
    Reviewed-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/20171030153951.56269-3-noralf@tronnes.org

    Noralf Trønnes
     
  • Adding lcdif nodes to a power domain currently results in
    black/corrupted screens or hangs because power is not correctly enabled
    when required.

    Ensure power is on when display is active by adding
    pm_runtime_get/put_sync to mxsfb_pipe_enable/disable.

    Signed-off-by: Leonard Crestez
    Reviewed-by: Stefan Agner
    Reviewed-by: Sean Paul
    Signed-off-by: Stefan Agner
    Link: https://patchwork.freedesktop.org/patch/msgid/ee88148399c63494cda4129b05444b0ac331b7a7.1537191359.git.leonard.crestez@nxp.com

    Leonard Crestez
     
  • LCDIF will repeatedly display data from CUR_BUF and set CUR_BUF to
    NEXT_BUF when done. Since we are only ever writing to NEXT_BUF the
    display will show an initial corrupt frame.

    Fix by writing the FB paddr to both CUR_BUF and NEXT_BUF when
    activating the CRTC.

    Signed-off-by: Leonard Crestez
    Tested-by: Philipp Zabel
    Reviewed-by: Stefan Agner
    Reviewed-by: Sean Paul
    Signed-off-by: Stefan Agner
    Link: https://patchwork.freedesktop.org/patch/msgid/7cdac9c064cc2b8a3d237934f186da98cefe6cb3.1537191359.git.leonard.crestez@nxp.com

    Leonard Crestez
     
  • The main axi clk is disabled at the end of mxsfb_crtc_mode_set_nofb and
    immediately reenabled in mxsfb_enable_controller.

    Avoid this by moving the handling of axi clk one level up to
    mxsfb_crtc_enable. Do the same for mxsfb_crtc_disable for symmetry.

    This shouldn't have any functional effect.

    Signed-off-by: Leonard Crestez
    Reviewed-by: Stefan Agner
    Reviewed-by: Sean Paul
    Signed-off-by: Stefan Agner
    Link: https://patchwork.freedesktop.org/patch/msgid/985c1f1cad250bd9ca154b3e4b3f913c310eeabd.1537191359.git.leonard.crestez@nxp.com

    Leonard Crestez
     
  • Cadence allow customer release these source code as followed copyright.

    * Copyright (C) 2016-2017 Cadence Design Systems, Inc.
    * All rights reserved worldwide.
    *
    * Redistribution and use in source and binary forms, with or without modification,
    * are permitted provided that the following conditions are met:
    *
    * 1. Redistributions of source code must retain the above copyright notice,
    * this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright notice,
    * this list of conditions and the following disclaimer in the documentation and/or
    * other materials provided with the distribution.
    *
    * 3. Neither the name of the copyright holder nor the names of its contributors
    * may be used to endorse or promote products derived from this software without
    * specific prior written permission.
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
    * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
    * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
    * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
    * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Signed-off-by: Sandor Yu

    Sandor Yu
     

07 Nov, 2018

1 commit

  • Unlike i.MX6qdl and i.MX53 LDB variants, the i.MX8 LDB variants(i.MX8qxp
    and i.MX8qm) in existence don't have frontend mux, thus, we should split
    the logic to program the ch0/1_mode for variants w/wo the mux. It turns
    out LDB_CH0_MODE_EN_TO_DI0 can be used for channel0 in both LDB single
    mode and LDB split mode for the i.MX8 LDB variants. However, based on
    test results, for i.MX8qm LDB channel1, LDB_CH1_MODE_EN_TO_DI1 has to be
    used in single mode, while, i.MX8qxp may work with LDB_CH1_MODE_EN_TO_DI0
    or LDB_CH1_MODE_EN_TO_DI1. With LDB_CH1_MODE_EN_TO_DI0, i.MX8qm LDB
    channel1 would output wrong image in single mode(it looks like color
    is wrong based on test results). The i.MX8 LDB variants channel1 mode
    can still be LDB_CH1_MODE_EN_TO_DI0 in split mode(the patch doesn't
    touch this). In essence, this patch fixes the channel1 single mode for
    i.MX8qm LDB by correcting the ch1_mode, while all other features
    should work as before. Note that due to hardware issue, we didn't test
    the channel1 single mode for i.MX8qm. We need to populate several
    resistors to enable the connectors driven by channel1 in single mode
    for either ARM2 platform or MEK board. Tests are done with IT6263
    LVDS to HDMI transmitter driven by LDB0 channel1 after r206, r207, r208
    and r209 are populated on the i.MX8qm MEK board.

    Signed-off-by: Liu Ying

    Liu Ying
     

30 Oct, 2018

1 commit


29 Oct, 2018

4 commits

  • Pixel clock and vrefresh are important information for a video mode.
    This patch adds debug information for them in ->mode_set_nofb.

    Signed-off-by: Liu Ying

    Liu Ying
     
  • After activating CONFIG_DEBUG_SPINLOCK, the following warning was thrown
    in kernel log:

    [ 1.261079] BUG: spinlock bad magic on CPU#0, kworker/0:2/1285
    [ 1.266928] lock: 0xffff8000b92f0190, .magic: 00000000, .owner: /-1, .owner_cpu: 0
    [ 1.275113] CPU: 0 PID: 1285 Comm: kworker/0:2 Not tainted 4.14.62-05296-gd695a5b #460
    [ 1.283032] Hardware name: Freescale i.MX8MQ EVK (DT)
    [ 1.288094] Workqueue: pm pm_runtime_work
    [ 1.292111] Call trace:
    [ 1.294567] [] dump_backtrace+0x0/0x3d8
    [ 1.299974] [] show_stack+0x14/0x20
    [ 1.305032] [] dump_stack+0x8c/0xac
    [ 1.310091] [] spin_dump+0x70/0x90
    [ 1.315060] [] do_raw_spin_lock+0xc0/0x108
    [ 1.320726] [] _raw_spin_lock_irqsave+0x28/0x38
    [ 1.326825] [] dcss_ctxld_kick+0x2c/0x200
    [ 1.332402] [] dcss_ctxld_suspend+0x1c/0xa0
    [ 1.338153] [] dcss_runtime_suspend+0x18/0x68
    [ 1.344079] [] pm_generic_runtime_suspend+0x28/0x40
    [ 1.350523] [] __rpm_callback+0xe0/0x268
    [ 1.356015] [] rpm_callback+0x20/0x80
    [ 1.361246] [] rpm_suspend+0xf4/0x4b8
    [ 1.366474] [] rpm_idle+0x124/0x168
    [ 1.371531] [] pm_runtime_work+0xa0/0xb8
    [ 1.377025] [] process_one_work+0x1d4/0x360
    [ 1.382774] [] worker_thread+0x48/0x478
    [ 1.388180] [] kthread+0x138/0x140
    [ 1.393151] [] ret_from_fork+0x10/0x18

    The reason was an uninitialized spinlock.

    Signed-off-by: Laurentiu Palcu

    Laurentiu Palcu
     
  • Activating CONFIG_SLEEP_ATOMIC_SLEEP detected a couple of potential sleeps
    inside IRQ context:

    [ 23.609203] BUG: sleeping function called from invalid context at kernel/irq/manage.c:112
    [ 23.617437] in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/2
    [ 23.624229] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G W 4.14.62-05295-gf2fa7e6 #454
    [ 23.632927] Hardware name: Freescale i.MX8MQ EVK (DT)
    [ 23.637980] Call trace:
    [ 23.640433] [] dump_backtrace+0x0/0x3d8
    [ 23.645834] [] show_stack+0x14/0x20
    [ 23.650891] [] dump_stack+0x9c/0xbc
    [ 23.655946] [] ___might_sleep+0xf4/0x118
    [ 23.661433] [] __might_sleep+0x50/0x88
    [ 23.666750] [] synchronize_irq+0x30/0x98
    [ 23.672237] [] disable_irq+0x20/0x30
    [ 23.677378] [] dcss_dpr_irq_enable+0x78/0x98
    [ 23.683211] [] dcss_dtg_vblank_irq_enable+0x40/0x78
    [ 23.689652] [] dcss_vblank_irq_enable+0xc/0x18
    [ 23.695661] [] dcss_disable_vblank+0x30/0x50
    [ 23.701496] [] drm_vblank_disable_and_save+0xd4/0xe8
    [ 23.708023] [] vblank_disable_fn+0x88/0xa8
    [ 23.713685] [] call_timer_fn.isra.5+0x24/0x80
    [ 23.719603] [] expire_timers+0xa4/0xb0
    [ 23.724914] [] run_timer_softirq+0xb8/0x170
    [ 23.730660] [] __do_softirq+0x12c/0x228
    [ 23.736062] [] irq_exit+0xc4/0x100
    [ 23.741025] [] __handle_domain_irq+0x60/0xb8
    [ 23.746857] [] gic_handle_irq+0x78/0x17c

    These sleep warnings were generated because disable_irq() may sleep. Use
    disable_irq_nosync() instead.

    Signed-off-by: Laurentiu Palcu

    Laurentiu Palcu
     
  • After link train completes the link status needs to be checked.
    If the link is not "good", then link training must be retried.

    Signed-off-by: Oliver Brown

    Oliver Brown