Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp790258ybe; Fri, 13 Sep 2019 06:26:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/AyDLBZ531pPJmBXDxEocVUQPixKCRuhKVDXt7X6Ax0YKqeaDEYRJCtELguVuxgh09nxc X-Received: by 2002:aa7:c6ca:: with SMTP id b10mr47558158eds.233.1568381173593; Fri, 13 Sep 2019 06:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568381173; cv=none; d=google.com; s=arc-20160816; b=CZ7HZgXnr+MMmmUaBByRc9DCzcdG1jmvIedWcHx28M1IdG2/gmqrwocVATkhtkCZBz Yy4Cj57S3rbo4p0qRlU8hMfRCO37LKygm+7v6UMVKH270SFSHR2F4S1h/2DmCjtyC5mt +jpY5QHa3RsRFHH0AHydGLo5mKxguHkBxq1JFt+LP3SEJqJuJyD+kvjV95yYqMcJ1KZ0 218qjLttR1PLMyIV17Djs4CBEzRuV5h1VTzGLvJtlE4V6GfKp1JrsK/2RPQW9ert6e5/ OsQNSAST+QyYwvHPPLGVoxZzLMaUqv6iYr6j4qikgj5jxyDwyZH8jPhT7nzUFr0NaP6v FY+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kPXfjMTTNPQD9UCgDsgpnhsNEoBADvRiWeI5cf7/uy8=; b=PEB2uaGvWdnlFECPZQFM3lPyMiXAjbSWRyYL1JJCpleHJzsnbFpC/QLCN4Nkx4EbZX n/6CC4+jETbvd7ZWFYUA02RsllAETMmdaoE6xf8+z4TQsF3Ccs8mNRj/NFfMTsn4oC0/ lZ/yhf14gMQCdOJUtk0SWBlHo4KXqVd3JMPZUXge6swx0L191WY5dV/8yYC7hlHTkzBe 93Z3zpEoT0CZJaGQkkBxh98xfHneFyUVy019W95SiumpLnKqfMVvBoACg3hjFV4hoBOp zYCWIvF1EPGfC86SYMG3ft4Td98OSv4jVMcjV6tm6CD0EdDPmN2CC1VgtoTGvU7PdyLh e0tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QGAz9Ybg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i23si1352052edr.269.2019.09.13.06.25.48; Fri, 13 Sep 2019 06:26:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QGAz9Ybg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390708AbfIMNVA (ORCPT + 99 others); Fri, 13 Sep 2019 09:21:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:50296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390696AbfIMNU6 (ORCPT ); Fri, 13 Sep 2019 09:20:58 -0400 Received: from localhost (unknown [104.132.45.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 71E5820CC7; Fri, 13 Sep 2019 13:20:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568380857; bh=xg52qG7g97LSXManPfMAUbyJH1M8/Lu+e13unSKBHRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QGAz9YbgSayxzzD6Kr0KaZvEmd6vHE4ypRcu+oMvY3UEtVXu5k3rv6ZW4NiBFjYRg 09FoCzkC9f1A8trF2+PaX/G1mr24eMq6OuIyfudTSc6nncoyHrhDAA7RvJpW/lDYpn 0K+GmcbqiP3/sg1P9skL56MWw8ABsGgrJw4NYHBw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai Subject: [PATCH 5.2 04/37] ALSA: hda/realtek - Fix overridden device-specific initialization Date: Fri, 13 Sep 2019 14:07:09 +0100 Message-Id: <20190913130511.843613979@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190913130510.727515099@linuxfoundation.org> References: <20190913130510.727515099@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit 89781d0806c2c4f29072d3f00cb2dd4274aabc3d upstream. The recent change to shuffle the codec initialization procedure for Realtek via commit 607ca3bd220f ("ALSA: hda/realtek - EAPD turn on later") caused the silent output on some machines. This change was supposed to be safe, but it isn't actually; some devices have quirk setups to override the EAPD via COEF or BTL in the additional verb table, which is applied at the beginning of snd_hda_gen_init(). And this EAPD setup is again overridden in alc_auto_init_amp(). For recovering from the regression, tell snd_hda_gen_init() not to apply the verbs there by a new flag, then apply the verbs in alc_init(). BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204727 Fixes: 607ca3bd220f ("ALSA: hda/realtek - EAPD turn on later") Cc: Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/hda_generic.c | 3 ++- sound/pci/hda/hda_generic.h | 1 + sound/pci/hda/patch_realtek.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -6009,7 +6009,8 @@ int snd_hda_gen_init(struct hda_codec *c if (spec->init_hook) spec->init_hook(codec); - snd_hda_apply_verbs(codec); + if (!spec->skip_verbs) + snd_hda_apply_verbs(codec); init_multi_out(codec); init_extra_out(codec); --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h @@ -243,6 +243,7 @@ struct hda_gen_spec { unsigned int indep_hp_enabled:1; /* independent HP enabled */ unsigned int have_aamix_ctl:1; unsigned int hp_mic_jack_modes:1; + unsigned int skip_verbs:1; /* don't apply verbs at snd_hda_gen_init() */ /* additional mute flags (only effective with auto_mute_via_amp=1) */ u64 mute_bits; --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -837,9 +837,11 @@ static int alc_init(struct hda_codec *co if (spec->init_hook) spec->init_hook(codec); + spec->gen.skip_verbs = 1; /* applied in below */ snd_hda_gen_init(codec); alc_fix_pll(codec); alc_auto_init_amp(codec, spec->init_amp); + snd_hda_apply_verbs(codec); /* apply verbs here after own init */ snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);