Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5456811pxu; Tue, 22 Dec 2020 18:36:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3D8ksAcHi0y//H1pHJef+5vso9TrrNGP7D+mm9RsgE6DlV7jVa7X0xr+Z49mv94NmBZGM X-Received: by 2002:a05:6402:407:: with SMTP id q7mr22867193edv.312.1608691014496; Tue, 22 Dec 2020 18:36:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608691014; cv=none; d=google.com; s=arc-20160816; b=yRjTh1xIvLRJbNcehxPdozHXaKWSalHTzVTDTGIX1oGDixQnSZ3mXJactoA6w+fTyE UNBImuoACk9lSPZK/OCf015O9lfjLgCjgN3UP1zCCUULwkIlXad48OdB0BPlxGQmit5U PJiabGHnB7h/eVYX9+xQT2uk54NzGZH2M+0VksEpXjb2BSH6LsBUXj/qIi125UvXdnV+ eESVutPFolsn+qLdpS32Yhkw0zvZVSZW70qUra5rK5++sxtyYcJI5Y9ZfrJpi67jrzoO 7QD9Ebx+yCNxhdIqMlYMpz1015PngHadGD6bC01+X+DPeQriBpe5o3cOU1+PrCG65YD5 GBNA== 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=MyGcrGqmeqC+W4mDz5MY1nRFkjWkYk88a1ijsio+Oi4=; b=Lio9v8pk2PCBNGcSy5T10LSLRcjl2j7PPcwjRxbQwskT8KbskFDAdtEkKpKPKYsa9q mgdjEyMPNIEiNMn3I+RIJ50O3yj3BFp7G2xCOfOl7Ogji9j7VZ6eXxabFQWm3klQXtDc SGliWpHvN4p8hfBlbBEI9J6RokmlG2RDoYCa7CbZLTz9S9LYllyLTEzgD5xAM+AyUA5G +dqJINusLXp1P5iNM+6AiNi4qSTJmIcCd9Ppkle8BcvP/0EECvJ8mt+4/nE/ZGLwbSD1 AwKDs4Nr52/Eqo9fZwNvA/Vpv8EBwtonl6bmPfsZKz4LWkdcaSr16UVQOUg7KLlZ2OIR 46Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MiW4HIQI; 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 a6si11303754ejy.167.2020.12.22.18.36.32; Tue, 22 Dec 2020 18:36:54 -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=MiW4HIQI; 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 S1730328AbgLWCg0 (ORCPT + 99 others); Tue, 22 Dec 2020 21:36:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:52758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730238AbgLWCYa (ORCPT ); Tue, 22 Dec 2020 21:24:30 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E2D6223137; Wed, 23 Dec 2020 02:24:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608690254; bh=+wJUFYaFYeKD3BKxzQ9mNJZkS6nkCiu7oo1clnzeQVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MiW4HIQIMmJhX6mPh5LsDTL9N5/+zGRxMiJM2Xd76AQNGGs1baQgcFBdV7rKfDK9E MH0LFAmfMrWSIv3mbE3IJwvNDlcLa9nqtUrBAJCXJCpCr+ZNE9Ii/AUq4M0IyACZk6 76phY020Z87F0kuN5Iry8+6t45UjGgJRPmxbIDvqz0NhU00hLAATF+RVAvC3ff1efu asjGJC2TbpsTrdjQyaQ7JREXqOMat1jBE/mxUnVvO0s0P0ZJxz+e0WPaafBr/a+Sy+ /J7antnXyD3EONcOggZaP/h7ody3ThCnNH7hbdkXgwSriem4fkfjJep0Mb2yX7RIqd bmKdsinGiszuA== 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 4.14 65/66] ALSA: hda/hdmi: packet buffer index must be set before reading value Date: Tue, 22 Dec 2020 21:22:51 -0500 Message-Id: <20201223022253.2793452-65-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201223022253.2793452-1-sashal@kernel.org> References: <20201223022253.2793452-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 21d9b7d96eb0f..35da926507ac3 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -642,11 +642,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