• Andrzej Hajda's avatar
    drm/exynos/mixer: fix MIXER shadow registry synchronisation code · 6a3b45ad
    Andrzej Hajda authored
    MIXER on Exynos5 SoCs uses different synchronisation method than Exynos4
    to update internal state (shadow registers).
    Apparently the driver implements it incorrectly. The rule should be
    as follows:
    - do not request updating registers until previous request was finished,
      ie. MXR_CFG_LAYER_UPDATE_COUNT must be 0.
    - before setting registers synchronisation on VSYNC should be turned off,
      ie. MXR_STATUS_SYNC_ENABLE should be reset,
    - after finishing MXR_STATUS_SYNC_ENABLE should be set again.
    The patch hopefully implements it correctly.
    Below sample kernel log from page fault caused by the bug:
    
    [   25.670038] exynos-sysmmu 14650000.sysmmu: 14450000.mixer: PAGE FAULT occurred at 0x2247b800
    [   25.677888] ------------[ cut here ]------------
    [   25.682164] kernel BUG at ../drivers/iommu/exynos-iommu.c:450!
    [   25.687971] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
    [   25.693778] Modules linked in:
    [   25.696816] CPU: 5 PID: 1553 Comm: f...
    6a3b45ad
exynos_mixer.c 33.7 KB