[bug report] drm/mediatek: dp: Audio support for MT8195

Guillaume Ranquet granquet at baylibre.com
Thu Apr 20 09:05:54 PDT 2023


On Wed, 19 Apr 2023 16:30, Dan Carpenter <dan.carpenter at linaro.org> wrote:
>Hello Guillaume Ranquet,
>
>The patch e71a8ebbe086: "drm/mediatek: dp: Audio support for MT8195"
>from Sep 1, 2022, leads to the following Smatch static checker
>warning:
>
>drivers/gpu/drm/mediatek/mtk_dp.c:680 mtk_dp_disable_sdp_aui() warn: odd binop '0x30a8 & 0x3'
>drivers/gpu/drm/mediatek/mtk_dp.c:692 mtk_dp_setup_sdp_aui() warn: odd binop '0x30a8 & 0x3'
>
>drivers/gpu/drm/mediatek/mtk_dp.c
>    676 static void mtk_dp_disable_sdp_aui(struct mtk_dp *mtk_dp)
>    677 {
>    678         /* Disable periodic send */
>    679         mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_30A8 & 0xfffc, 0,
>--> 680                            0xff << ((MTK_DP_ENC0_P0_30A8 & 3) * 8));
>
>MTK_DP_ENC0_P0_30A8 is 0x30a8 as the name implies.  So 0x30a8 & 3 is
>always zero.  It's not clear what's happening here.
>

Hello Dan,

I wasn't able to get a datasheet for these IPs, so I'm unsure of what
was the intent here.
I've checked quickly and this is not part of the code Markus submitted
originally, so its
not a direct port from the original driver.

I've CC'ed Rex and Tommy from mediatek who might have answers and a
fix for this.

HTH,
Guillaume.

>    681 }
>
>regards,
>dan carpenter



More information about the Linux-mediatek mailing list