Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3027331rwb; Mon, 15 Aug 2022 16:25:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR78q5xRF5SmyIGS+WOtYfLpu1jgfY5XVP//GhVSXVsCoeF0/HmeE0giDSIypdB3KmQfCmas X-Received: by 2002:a63:8849:0:b0:41c:4216:10a7 with SMTP id l70-20020a638849000000b0041c421610a7mr15109106pgd.549.1660605842754; Mon, 15 Aug 2022 16:24:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605842; cv=none; d=google.com; s=arc-20160816; b=R3YK1S5jMZlPRy0Sz6HV7uvV07ERHtsRoqFofeVTIi5ml71n8K8SGFCciUj2828Ibo pNPu37aBkvU58aFhJzC/ycckv/Mon/3VLaaka72vY93tmgC2GZeEzSzOzaXokMY2SmWu xehE4Nr8AHpIafv62o9ecZLRFQrThHpDwN2yq29hQ/0b2kQKi1WWLNKMlLoCFOmuTeQW GB+gIKWqOLFVHakEnBUsD/Vbh0o0IqTAYOLtbL2l9mXhHG6uGZIbSqdR8mFgRuscy0XK osdLRnnI1JECoQCH4IYPJ0hMc+RU2JLI4hDKHyn7wrY2NXDD9BsBsB+SS/08N+SP9/zn ougQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tDW3nIbopE+simzq0TlzyIUopeXlApo8jx5OgN41vGE=; b=RQneDSQwmp0fZ38nuiXIFjeC3U+UjT2SCDQ54Y8KXXlmNjpqfFo1L1tlaAg0wp1oKw 21rkbY8qRKmqAC148eomiSe4YsrvvMTcHewOH6UQz1tBdAnj4Bd86ZDujrYAQalCqbj/ 4lwSbgxSKUEycubzb8LPFAdYtjdlr/KU+CVdtRMT0aT+U+hoBgjDdl9xAYf0Upr7loHx 05HeNJkBIsAuZOcEC4gjwUmfpJt1YfDngKIeGo/mS32CJg6Bd+tf+3+dc96VBRvmjSuw fsMdQSUvtSGrSyvrt4/py3qNm183mvZ0r45IeDEYReQVN3oVN3Q4XEJ76wTjTbMB/fkp 1Drw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JygA0IXL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a65614d000000b0041a529bb4ccsi6879713pgv.554.2022.08.15.16.23.49; Mon, 15 Aug 2022 16:24:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JygA0IXL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245200AbiHOVFg (ORCPT + 99 others); Mon, 15 Aug 2022 17:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245501AbiHOVDN (ORCPT ); Mon, 15 Aug 2022 17:03:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7596D51439; Mon, 15 Aug 2022 12:14:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C70F2B81115; Mon, 15 Aug 2022 19:14:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00D18C433D6; Mon, 15 Aug 2022 19:14:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590861; bh=ezz1QrZMZah4z8XFs+tXhhTISclPhpkXp32xMw1dyyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JygA0IXLX3e8KrO6mAcd4PQ5Uufe9DnlnfNHenBDGkJyQ3iFp0YqRg1LirhlYN+vI WJOKf6RceeEySfhz16in0qH6+XqFdbaRUZ7ww2X0nnB7DYlchzUIdTCwh+2wHCwD20 3meTnIwMlGyxsXiOkz+BnvpI/gxthUVF6xPD8HM8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dom Cobley , Maxime Ripard , Sasha Levin Subject: [PATCH 5.18 0393/1095] drm/vc4: hdmi: Clear unused infoframe packet RAM registers Date: Mon, 15 Aug 2022 19:56:32 +0200 Message-Id: <20220815180445.956193355@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dom Cobley [ Upstream commit b6079d1578dc4b4b8050d613a5449a63def7d1dd ] Using a hdmi analyser the bytes in packet ram registers beyond the length were visible in the infoframes and it flagged the checksum as invalid. Zeroing unused words of packet RAM avoids this Fixes: 21317b3fba54 ("drm/vc4: Set up the AVI and SPD infoframes.") Signed-off-by: Dom Cobley Link: https://lore.kernel.org/r/20220613144800.326124-20-maxime@cerno.tech Signed-off-by: Maxime Ripard Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_hdmi.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 2ff53482d5d1..0fe04b1f9782 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -439,9 +439,11 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, const struct vc4_hdmi_register *ram_packet_start = &vc4_hdmi->variant->registers[HDMI_RAM_PACKET_START]; u32 packet_reg = ram_packet_start->offset + VC4_HDMI_PACKET_STRIDE * packet_id; + u32 packet_reg_next = ram_packet_start->offset + + VC4_HDMI_PACKET_STRIDE * (packet_id + 1); void __iomem *base = __vc4_hdmi_get_field_base(vc4_hdmi, ram_packet_start->reg); - uint8_t buffer[VC4_HDMI_PACKET_STRIDE]; + uint8_t buffer[VC4_HDMI_PACKET_STRIDE] = {}; unsigned long flags; ssize_t len, i; int ret; @@ -477,6 +479,13 @@ static void vc4_hdmi_write_infoframe(struct drm_encoder *encoder, packet_reg += 4; } + /* + * clear remainder of packet ram as it's included in the + * infoframe and triggers a checksum error on hdmi analyser + */ + for (; packet_reg < packet_reg_next; packet_reg += 4) + writel(0, base + packet_reg); + HDMI_WRITE(HDMI_RAM_PACKET_CONFIG, HDMI_READ(HDMI_RAM_PACKET_CONFIG) | BIT(packet_id)); -- 2.35.1