Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4712700rwb; Mon, 31 Jul 2023 10:58:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlEqu7llbg9Jw7IHDaJx+6TS/SgS6184kVXcHir6udfC5/OikpLBlefMs4nTzC3l9CLsSDsh X-Received: by 2002:a17:90a:de92:b0:268:13c4:b7fe with SMTP id n18-20020a17090ade9200b0026813c4b7femr12477260pjv.5.1690826283112; Mon, 31 Jul 2023 10:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690826283; cv=none; d=google.com; s=arc-20160816; b=tjkzacFoo042li1vjbHZ+mRRVbCwb1L+A/NPzqFKloytim06B1pZZ9agsFpIXg1k5Z ErXpUTIicEwrTrjwWD7KB2yRpgCFF8KdSMnAWPz6unE3BviERV5MrDWg1xqiUYsq9Dpg CYu3URZzZN2Ffsi5eNXEJBV1aaDv5HrVSznvT9T30hrbeEFv+DuGDfth3DX+27LSZFgN bPY45IbLntqh+lo9ev65HNP4TlySB8B7OzQDuIeG0w7R52PSM1WUYh2+AJzL9uvPAMJZ jiAdWB5jvpw5NHzrufYC7vJqPGeEmT6dbIMCgiPqOXoIIfyjoFWOPOgbprZM7fHik59q xTeA== 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=7tXYtuHPujqaVHNe1XUnRwtzdST6xCvteK767YL3cjc=; fh=++3DPgNRpClAYl/wOqcu6GdLXzb+wGOgYMictO4+73w=; b=wcJfKpOlbxTk0hwtoh369BTGXcRpitnOiGhgmFAHk3SJWigQVYWBTDatvztUnRytcM qGf2xvq+ob5Imi10Aj5OUsA6iO/vl+ojPfbe15xHlGaX5s9aIWqnvDoil5zX+lgK8vDh nzQRqfXeNpJVdHdgRPQ+uaxQd7ij1OdTqGSD3sDSPlcuwD3KD2OrK41LvO1vACLNNdVQ Jq2j9CMAQVXHDxIx61FUtXmRGBsjLxZVLbx3YuTzxFId44XQ5bn1mGbxOU3U/9BmlXTr YqfxlGbsFapBoIOuBFQ8RJQCkFGtSBxNW9kalaMvIYTgMIsUdZcVVb1qBuMedCLGim7y Ay8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=WejIqFMA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id li8-20020a170903294800b001b000b3f132si2603859plb.298.2023.07.31.10.57.50; Mon, 31 Jul 2023 10:58:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=WejIqFMA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233516AbjGaQ6X (ORCPT + 99 others); Mon, 31 Jul 2023 12:58:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233735AbjGaQ54 (ORCPT ); Mon, 31 Jul 2023 12:57:56 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB46B1FDA for ; Mon, 31 Jul 2023 09:57:43 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36V5lNJJ017071; Mon, 31 Jul 2023 11:57:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=7tXYtuHPujqaVHNe1XUnRwtzdST6xCvteK767YL3cjc=; b= WejIqFMAROEQlAOXVyi1lqXeaNMgfmBqJXKhpNwtVcwr4zPSjSjQ6xO8PsyeHmNl +SG5J4Ux85UvpCZRHN8OL6Di8RufFUclI7+3k219Mjhl3gLNEOT7sD7qIze9QFMg A+ciAKy/vMbnKLTvWDNFks2Cf2t0XFRJgpfbNvJUcRbQL/wMgXNWyZzItTt6kVZz DWQ4wF0oR4i1yzfAWP15sB8Ul59vSZawA0/4ZSAzRdeglm7rjjpNqtWEMbyaav0t TZNkZ2PoLYnKBBMR8TpTQxqceGfXs5NOKt+kph/JNARNMgheJRQWl/Bk3aAYLCis gWEyjlXbYSJs01U5i0dGIg== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3s5gk1sg45-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jul 2023 11:57:32 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Mon, 31 Jul 2023 17:57:30 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.30 via Frontend Transport; Mon, 31 Jul 2023 17:57:30 +0100 Received: from EDIN4L06LR3.ad.cirrus.com (EDIN4L06LR3.ad.cirrus.com [198.61.64.107]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 013A7475; Mon, 31 Jul 2023 16:57:29 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , , Richard Fitzgerald Subject: [PATCH 1/9] ALSA: hda/cs35l56: Complete firmware reboot before calling cs_dsp_run() Date: Mon, 31 Jul 2023 17:57:18 +0100 Message-ID: <20230731165726.7940-2-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230731165726.7940-1-rf@opensource.cirrus.com> References: <20230731165726.7940-1-rf@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: 25uoaoNGsvz6CN9TtIiilzY2EMDVF4nX X-Proofpoint-ORIG-GUID: 25uoaoNGsvz6CN9TtIiilzY2EMDVF4nX X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the call to cs_dsp_run() in cs35l56_hda_fw_load() so that it is after the CS35L56 has been reset/reinit'd and the regmap cache has been synced. cs_dsp_run() syncs up ALSA control cache values with the DSP memory so this must not be done until the firmware has reinitialized. Signed-off-by: Richard Fitzgerald --- sound/pci/hda/cs35l56_hda.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c index 4c3279f61b94..c3acda2daeeb 100644 --- a/sound/pci/hda/cs35l56_hda.c +++ b/sound/pci/hda/cs35l56_hda.c @@ -562,12 +562,6 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56) if (coeff_filename) dev_dbg(cs35l56->base.dev, "Loaded Coefficients: %s\n", coeff_filename); - ret = cs_dsp_run(&cs35l56->cs_dsp); - if (ret) { - dev_dbg(cs35l56->base.dev, "%s: cs_dsp_run ret %d\n", __func__, ret); - goto err; - } - if (cs35l56->base.secured) { ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_AUDIO_REINIT); if (ret) @@ -591,6 +585,11 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56) regmap_clear_bits(cs35l56->base.regmap, CS35L56_PROTECTION_STATUS, CS35L56_FIRMWARE_MISSING); cs35l56->base.fw_patched = true; + + ret = cs_dsp_run(&cs35l56->cs_dsp); + if (ret) + dev_dbg(cs35l56->base.dev, "%s: cs_dsp_run ret %d\n", __func__, ret); + err: pm_runtime_put(cs35l56->base.dev); mutex_unlock(&cs35l56->base.irq_lock); -- 2.30.2