From: Julien Masson Date: Mon, 24 Jun 2019 14:47:56 +0000 (+0200) Subject: drm: meson: mask value when writing bits relaxed X-Git-Tag: v5.15~303^2~28^2~4660 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f237bf2de82eafd224eb981c6c0bca8a9e039af6;p=platform%2Fkernel%2Flinux-starfive.git drm: meson: mask value when writing bits relaxed The value used in the macro writel_bits_relaxed has to be masked since we don't want change the bits outside the mask. Signed-off-by: Julien Masson Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/86y31r82fo.fsf@baylibre.com --- diff --git a/drivers/gpu/drm/meson/meson_registers.h b/drivers/gpu/drm/meson/meson_registers.h index 057453ce..f8dd1be 100644 --- a/drivers/gpu/drm/meson/meson_registers.h +++ b/drivers/gpu/drm/meson/meson_registers.h @@ -12,7 +12,7 @@ #define _REG(reg) ((reg) << 2) #define writel_bits_relaxed(mask, val, addr) \ - writel_relaxed((readl_relaxed(addr) & ~(mask)) | (val), addr) + writel_relaxed((readl_relaxed(addr) & ~(mask)) | ((val) & (mask)), addr) /* vpp2 */ #define VPP2_DUMMY_DATA 0x1900