From patchwork Wed Dec 13 23:49:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gergo Koteles X-Patchwork-Id: 178377 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8169883dys; Wed, 13 Dec 2023 15:49:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4D7vrazoe3zXqRd+ZIAJYeZLSwx9strDrBejrpZUrQSknp6sBvh/H3Es2WLE4spj1PhpA X-Received: by 2002:a17:902:a511:b0:1d0:6ffd:6112 with SMTP id s17-20020a170902a51100b001d06ffd6112mr8137043plq.52.1702511372319; Wed, 13 Dec 2023 15:49:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702511372; cv=none; d=google.com; s=arc-20160816; b=ePxybx1dkP5Qa3Ih0LKtRZQR8bn+ae50zUHc3my0ElMtJwiopKZ4jvmyqqcHpbwVsI i2f1tJdMen6eBySFkNRXfZEjs6FejpYmVn0ZCD//zreKRthZsG09XxBfdss0bmxeCqeo SGwL73N7Z2ELXOeC7Oj3pTe3KTcvm16ebG//4xuIQHTCdG7oUzR6+aUZjaia+/0ucWsH ruv6XKGVwICpZweTt1qR2fQo3S8U3ErzKJm62QerW9qpOh1L/CrWDHJZ9w9MIZn0YceT R3lnUMQcQ3Y3ns0tQYpj5b3OpbWzbWLpRsDQJVfbO0XEXGw3e5l9hJbUy6x0pXvs3kNH ctMA== 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 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id m8-20020a1709026bc800b001cfce833b63si10130235plt.83.2023.12.13.15.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:49:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 678978278BA6; Wed, 13 Dec 2023 15:49:29 -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 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:29 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785212565024467430 X-GMAIL-MSGID: 1785212565024467430 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(-) base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa 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);