Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5463909pxu; Tue, 22 Dec 2020 18:54:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJQpb/tv8xNXDjpzZeRXZxRapepVLXbQLspq5ZNA63Uj+j9ZGIVWseZbfgDeKYS+2iTKGo X-Received: by 2002:a50:d888:: with SMTP id p8mr23056163edj.147.1608692076798; Tue, 22 Dec 2020 18:54:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608692076; cv=none; d=google.com; s=arc-20160816; b=Fjs/GGqC7nycxV1lDFgHGXqle4lfLE7TaOqpeO/7tvr2uhgvMSTHAW7bq1eFmpCvNN yRO9W/ZhKMhkVf7cjayuBYeOAIwyLDMC7tSIZHThq+HLTqityC3t8Hs1qBUaFh8e5E+K r/J4JP0vV/1MTS52lusSDweh9ncHTA7tAAFYjWsYlOwHSED+oGmthaOQa0D1XT08alIz lS+SmWYgVH6/g2GBS7RNXNx53NPLhWbJKUKAHqDOLlWHvXjHCkS+sez1v7zkJxZ9t2bh sPpOQXa0ACDoL8Wd+B0OwFEhyXVfXlo9f64BUofV/2LYWnD1DEPMlnBC+WB40ZkQlzS5 nGzA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JovMptUfzePnI2ZXXKqLqx9lnnw5gdLdHsRHokqaqvA=; b=v2u2O3M1/WagwmXIpYN/WdW8Rj0EI1brCpHCIqUcYtrXWM/Qj4GbNwcK1M7MVPCCqa tU/Bs/e48/eTI1MwPFyMJl3+Uci27lJLrneyoIVao+je5EDOB8gul4STk3AB36sGWba9 /sy87OKFx45zCh41Zi/rhu9NeO3vjauaLgS8reqSYM6O9Kq/0C/ySQM342E9i0b0X2E8 YdyZ7mCTKT6ZyEP1WuOzuflZwpV7E3+6xKqC290CF0ya2uYXqhNQkb+1NbN9I1g2nuKF 7D2ICOmajBu8TJsdmV4W/LY28C2mmLVciBbiyG9buhgIiNJViUfiL2ZpgJQgk6dww8LY Zurg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aEaoj0qi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr22si10076235ejc.411.2020.12.22.18.54.14; Tue, 22 Dec 2020 18:54:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aEaoj0qi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729382AbgLWCVe (ORCPT + 99 others); Tue, 22 Dec 2020 21:21:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:45508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729261AbgLWCVP (ORCPT ); Tue, 22 Dec 2020 21:21:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E2471225AC; Wed, 23 Dec 2020 02:20:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608690056; bh=ByjQs1YoUc/0ujkBrb1y2ptoYeB7i9eLo3wbOY18TCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aEaoj0qiFAqMhS7GT6K1hDHd+EfVEbnJd9HVV1cYysRPHcA4EEwDnT+vjHtHUeodz LZPgdlJPhu2roZRtNrGXYpGumFM1RSNwGdK8xcNbhWzAYmVDOZfQi8kTZHFuPM65Jl +Pfn0MqoFVIlC/XtfDZx3pUo0H0EE97F3UJxLzEXuCIcmbr3/sIxeZv+wMjaZcaGVn EVJ7ScTC4PCJ97Lrkh25msFRIckLFe8PlQCjHD6XQal2vvFq7Om79H4h5Yq1ioLHO7 uuI1QR3yHnFMuwDtMeWHjSUGVFjB0+aJByAfiWFYdggtkJwLf2oUAkjXi4dMt7sxlk sdd7Wh5I6ZEIA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kai Vehmanen , Takashi Iwai , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.4 126/130] ALSA: hda/hdmi: packet buffer index must be set before reading value Date: Tue, 22 Dec 2020 21:18:09 -0500 Message-Id: <20201223021813.2791612-126-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201223021813.2791612-1-sashal@kernel.org> References: <20201223021813.2791612-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kai Vehmanen [ Upstream commit 46c3bbd9827952f92e250fa6ee30a797a4c4e17e ] The check for infoframe transmit status in hdmi_infoframe_uptodate() makes the assumption that packet buffer index is set to zero. Align code with specification and explicitly set the index before AC_VERB_GET_HDMI_DIP_XMIT. The packet index setting affects both DIP-Data and DIP-XmitCtrl verbs. There are no known cases where the old implementation has caused driver to work incorrectly. This change is purely based on code review against the specification (HDA spec rev1.0a). Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20201211131613.3271407-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/hda/patch_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index df4771b9eff24..0faee80e28b66 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -645,11 +645,11 @@ static bool hdmi_infoframe_uptodate(struct hda_codec *codec, hda_nid_t pin_nid, u8 val; int i; + hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0); if (snd_hda_codec_read(codec, pin_nid, 0, AC_VERB_GET_HDMI_DIP_XMIT, 0) != AC_DIPXMIT_BEST) return false; - hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0); for (i = 0; i < size; i++) { val = snd_hda_codec_read(codec, pin_nid, 0, AC_VERB_GET_HDMI_DIP_DATA, 0); -- 2.27.0