Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3113713rwb; Mon, 15 Aug 2022 18:26:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR6UWhRrmXUmY3cDRh37e976+viVHhsQ+joWplVHdh/ioAjzt0SUe0X5BGullW5BXsAUrJpz X-Received: by 2002:a17:906:9bdd:b0:730:5b04:7298 with SMTP id de29-20020a1709069bdd00b007305b047298mr12558989ejc.180.1660613187120; Mon, 15 Aug 2022 18:26:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613187; cv=none; d=google.com; s=arc-20160816; b=hOriDgiFI/wpt6L6UhdVXiq6CHLw/Jwi7nKWWBv6LoLYRNJ00kOw9Xm9Gw2kyXLBuN bQt+hYORGJCgSqC7KsLUloykeZkiPHcosu0odLQ6ozttQ7YlJ1J1QCMXFvVWdehFzO8O 2kS5vpD2N8r0TXK5+VI4mGGJVwq8HR/N1roWJXnKOzPd67RH++ZUxbpbHWJrfNhl+k6w XZive92lq5iZSC2zbpXyPvsiTCkP/uTnlf1xhK9TAREuXP5aNQvIuL+dci49c6wgTmVB sXyJBtoGzkMNDJGRLkcCuWTcWfa9PjLIO/9PKAM84MlLKvwULkto8opkG5racgsV+Sk+ a9ig== 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=/JLAlvYoS3rqcyS8aV99vI/pYTrfh6oTKMYhiYKHERI=; b=SmR8S8u+GjT4hnqNChlIJz56l64gPiM1w/Mh3vXp8XvOmFJIbYdA7x9YmOGQ9bDuQQ fFlTg+6fjVPOnL+JUvR0+6666qpTVHTGgVfmblVDCZ9qOjY5h/YYpPuOWZanthJEpkmj s//b6NPzoqhbaGowFAz6ttZG4CYa/ct7r3YWmT/kjiBW+uq3aOgpD5gjClS0ogBBsgQM V9mLNkS3I84o+5mizKYJ724Hx2AU9xgSPJ18JYXVq3rJ5vq8F/DmOFJ0rKngBAgia97c FUfW6dyT+NfWxEZoaB4Ho9RV3lyoQugvawFIhi2xxPmah9UdwFaZRFCls/lJ5q0wqNIN SGMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OVQ1igbg; 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 cr10-20020a056402222a00b0043cc4d599f8si7486979edb.161.2022.08.15.18.25.52; Mon, 15 Aug 2022 18:26:27 -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=OVQ1igbg; 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 S1354886AbiHOXqn (ORCPT + 99 others); Mon, 15 Aug 2022 19:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354316AbiHOXlw (ORCPT ); Mon, 15 Aug 2022 19:41:52 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EBB82C64F; Mon, 15 Aug 2022 13:12:21 -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 sin.source.kernel.org (Postfix) with ESMTPS id 001B7CE12EB; Mon, 15 Aug 2022 20:12:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FBA4C433C1; Mon, 15 Aug 2022 20:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594338; bh=Wfw8rRoaZ6N/NdQxj2mH6K/qXFAUdGxq9Vm0O0/U+n4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OVQ1igbglSrvhoudwneHyLJWbr2aVKop/xNnAUE7helzN0hCSUyBFWpYuEWo1rddY Fu/f42y35EybUfMB4Qx2Ei6lwszlym43zZJTWJiBjCJ17nN7HFewF3Bj+NUAWY7D8c iaLotyDVpuaAdLwjgi/xcb1TCGYAgH0ncFCPH8tE= 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.19 0416/1157] drm/vc4: hdmi: Clear unused infoframe packet RAM registers Date: Mon, 15 Aug 2022 19:56:12 +0200 Message-Id: <20220815180456.289106333@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 e314e0a4c4c3..ecd49214bd92 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -461,9 +461,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; @@ -499,6 +501,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