Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5658762rdb; Wed, 13 Dec 2023 15:49:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEU2gvbneY7T4lLhVHMYHkBZzvVfREGwl1z+8iXmQ4udAMhWPHaFn+N33WCSGTCbRExMKl6 X-Received: by 2002:a17:903:244c:b0:1cf:cb80:3fa5 with SMTP id l12-20020a170903244c00b001cfcb803fa5mr11666184pls.23.1702511375499; Wed, 13 Dec 2023 15:49:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702511375; cv=none; d=google.com; s=arc-20160816; b=Vw6jmo8nr7spCN9Gu+wkwopE1PCRQ4kCVZTeJRmhpnyF01lluej8d7qeLcJ6Tu1PX6 IIJ7IVZ8YtMYDaSgiPnlycG9qb7ec1bq0jRlz9VoIq9lI3Xh+lZ8FWPvY6aTRLd7E0kx 8gKMynyRokmdOiRTga2ArH0labE36ifrNvVA7+kv2v41fKpDpJVnvQnU8poylAenyuv4 qtyJbMEVFz3cGA4cfupaIN8jQ6KpWoKWwZsOZyJsUhX7sJUP5i1H/PEU/4gyoiv9kfGj QapTQikkURLEGWeeaNbaGwXNuW8gpkizj8w4wvgMJUjxUfoWmNLiEOx2guf7gTOh5qUa 1FKg== 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 :message-id:date:subject:cc:to:from; bh=EoZSVlzELGA87Bv2uO3m5pvB1VNgc/UsSqczG6KiImk=; fh=AtUyipZqf9Wt3VmKECtwTscIVbxtj0bqEzvKFfEmcRc=; b=VGkruAt+qQQvb4UqKlZUDls1Omjwo+LjkVCDdfShyGEzC1Yy09UhW/N3lyQn1XmSxC STUdQTScsJPU7RQ4AibaD15ozaH/+dTGfaz6rmC2NE6Ngk6N4eLCW/rgFrr57W8AGeyx qhW7/JGXmQbgGq+OVJHQ8aK+4Oja0bh/L6bs6aUA4w0khBGFxdSL3SbMN5KZfgxZx/S7 qZKu3wJEdU/io8Ssvb4eY/Zq3UxKGbGaeGy6k2DNeU78/ng1fTJQ8O2CETdBmCc9J3ix sxPUq0cO0mPAN/y0rcvhephiS51YSYpQTyk2VZEwS0aC0K47YA17Bq16hhf5ifRPqj1b eXDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id b6-20020a170902bd4600b001b7d2b55d8asi9995951plx.626.2023.12.13.15.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:49:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 3F2C48278BA6; Wed, 13 Dec 2023 15:49:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233982AbjLMXtS (ORCPT + 99 others); Wed, 13 Dec 2023 18:49:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbjLMXtR (ORCPT ); Wed, 13 Dec 2023 18:49:17 -0500 Received: from irl.hu (irl.hu [95.85.9.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10414F5; Wed, 13 Dec 2023 15:49:23 -0800 (PST) Received: from fedori.lan (51b690cd.dsl.pool.telekom.hu [::ffff:81.182.144.205]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 0000000000071EA1.00000000657A4302.001284F3; Thu, 14 Dec 2023 00:49:22 +0100 From: Gergo Koteles To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Gergo Koteles , stable@vger.kernel.org Subject: [PATCH] ALSA: hda/tas2781: reset the amp before component_add Date: Thu, 14 Dec 2023 00:49:20 +0100 Message-ID: <4d23bf58558e23ee8097de01f70f1eb8d9de2d15.1702511246.git.soyer@irl.hu> X-Mailer: git-send-email 2.43.0 Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 13 Dec 2023 15:49:33 -0800 (PST) Calling component_add starts loading the firmware, the callback function writes the program to the amplifiers. If the module resets the amplifiers after component_add, it happens that one of the amplifiers does not work because the reset and program writing are interleaving. Call tas2781_reset before component_add to ensure reliable initialization. Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") CC: stable@vger.kernel.org Signed-off-by: Gergo Koteles --- sound/pci/hda/tas2781_hda_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index fb802802939e..0baaaff94c6f 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -675,14 +675,14 @@ static int tas2781_hda_i2c_probe(struct i2c_client *clt) pm_runtime_put_autosuspend(tas_priv->dev); + tas2781_reset(tas_priv); + ret = component_add(tas_priv->dev, &tas2781_hda_comp_ops); if (ret) { dev_err(tas_priv->dev, "Register component failed: %d\n", ret); pm_runtime_disable(tas_priv->dev); - goto err; } - tas2781_reset(tas_priv); err: if (ret) tas2781_hda_remove(&clt->dev); base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa -- 2.43.0