From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DBFCCA9EBD for ; Sat, 26 Oct 2019 13:31:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 446DB2070B for ; Sat, 26 Oct 2019 13:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572096673; bh=jsZPOx60yyYquX2mfJXeJhv5RdUK3SaV53lgliB4a54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=s8svRwL30Gl819UPDYoesj7uxUw2xQbmfuZZj3tUrG7HvDB5sKALpkVlUVSKJ9uZZ GnxcaEyTwIedzKxNsa0kHp4Tzgm78AMGxsyjRGXQH5FRfsjGO7ZcylXAMVa4hWj/TE QbFkSL7G7ot9MGj40YGZbwPj9/HL5+QvvthWVYMQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728297AbfJZNT3 (ORCPT ); Sat, 26 Oct 2019 09:19:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:41358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726937AbfJZNTY (ORCPT ); Sat, 26 Oct 2019 09:19:24 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C9F3B2070B; Sat, 26 Oct 2019 13:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572095963; bh=jsZPOx60yyYquX2mfJXeJhv5RdUK3SaV53lgliB4a54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mRRpU6J3hi7KZyxOzvWjTxPA0mrysX56toY04EIaIadTIqpq3tQWygUXNp/x7PWzG XuKcMyix2OnZ0ieyLEh09JPkhEoq6YVB7Sj4HqgzaFi7mBhHDJMBM8gw1zPdIwxqDS BTIFvvXppEvJPb0AIcbGxAGGC1pD1L4pElorWylM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Rander Wang , Pierre-Louis Bossart , Takashi Iwai , Sasha Levin Subject: [PATCH AUTOSEL 4.19 09/59] ALSA: hdac: clear link output stream mapping Date: Sat, 26 Oct 2019 09:18:20 -0400 Message-Id: <20191026131910.3435-9-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191026131910.3435-1-sashal@kernel.org> References: <20191026131910.3435-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rander Wang [ Upstream commit 130bce3afbbbbe585cba8604f2124c28e8d86fb0 ] Fix potential DMA hang upon starting playback on devices in HDA mode on Intel platforms (Gemini Lake/Whiskey Lake/Comet Lake/Ice Lake). It doesn't affect platforms before Gemini Lake or any Intel device in non-HDA mode. The reset value for the LOSDIV register is all output streams valid. Clear this register to invalidate non-existent streams when the bus is powered up. Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20190930142945.7805-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- include/sound/hda_register.h | 3 +++ sound/hda/ext/hdac_ext_controller.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/include/sound/hda_register.h b/include/sound/hda_register.h index 2ab39fb52d7a1..b6bb93a641268 100644 --- a/include/sound/hda_register.h +++ b/include/sound/hda_register.h @@ -262,6 +262,9 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; #define AZX_REG_ML_LOUTPAY 0x20 #define AZX_REG_ML_LINPAY 0x30 +/* bit0 is reserved, with BIT(1) mapping to stream1 */ +#define ML_LOSIDV_STREAM_MASK 0xFFFE + #define ML_LCTL_SCF_MASK 0xF #define AZX_MLCTL_SPA (0x1 << 16) #define AZX_MLCTL_CPA (0x1 << 23) diff --git a/sound/hda/ext/hdac_ext_controller.c b/sound/hda/ext/hdac_ext_controller.c index 5bc4a1d587d4f..95cf5cf10ad2e 100644 --- a/sound/hda/ext/hdac_ext_controller.c +++ b/sound/hda/ext/hdac_ext_controller.c @@ -272,6 +272,11 @@ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus, ret = snd_hdac_ext_bus_link_power_up(link); + /* + * clear the register to invalidate all the output streams + */ + snd_hdac_updatew(link->ml_addr, AZX_REG_ML_LOSIDV, + ML_LOSIDV_STREAM_MASK, 0); /* * wait for 521usec for codec to report status * HDA spec section 4.3 - Codec Discovery -- 2.20.1