Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4733547rwb; Mon, 31 Jul 2023 11:15:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlHeMfmyiV+j+R3KLxNkE7H4ZfsB23lMd9Rlmiv1JrYe3HnUYwRRDN94V0Q9C31jjnDZRtnM X-Received: by 2002:a05:6a00:b44:b0:687:1a86:7a83 with SMTP id p4-20020a056a000b4400b006871a867a83mr10341270pfo.1.1690827332803; Mon, 31 Jul 2023 11:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690827332; cv=none; d=google.com; s=arc-20160816; b=iVaPbtSgFlBOHsOC+EbX0JXmRosPpVuUmPc40p22pC7nCyZv8zgUBFRV/NdpRQOxx3 R6/jDW5hfgQVtr0GCMPSPNR6jJP3hck7e6jJKmpFtcG2+7Va8g/UZHhw6ReJKq8UX9xX YEtw1i0Py0rznFLmIFzhDW52KrSmwPMU3OsbUIccneowRf+L5x8cgHCnxzrPk4wTHDJI TRNw3rFddTKIctp5jsyzdR5OleOmi8v0BPU1c/XylLrx0Aylc/jEfIQDhy0GBHAJkY6U D23mTOxod3uP2iEAmrEhU1sBKqeQyGZ4xdflJ+C8QjlCsgBW2oPeH8sH8DI8pLZOY+DN a5XA== 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=R7ZjjUfa6yJOj++gCN2+TabvdRaWxzaSedPyz17+U0k=; fh=++3DPgNRpClAYl/wOqcu6GdLXzb+wGOgYMictO4+73w=; b=Nmxj/owQmOqo3zXNqU0aNf9o+8nJUQf4R0llrUBocf+tScc8rqTadhRtk3BBokcSKa MNRK5dBY38WitdCyoMaNke4HSZilnHhqbXylYhF79FLL0QUseKUe0mGKfciEnq6fV9D/ K0wqyqC1SEKhjfxqCIVKO8wNfU+fO53gQJdCcjk1IxW0woxEjfLFcRpgvp8cJMQUS0Xu H1kiJjCx573a+lNB5cqlPSayeRj1NaU3IHicMtn0cDJDtsF4S7AkXlm0YjEduJ47VkHS Wm1tDYvOaSeB0GqW4/WEnzYaFKf5Deggfsq9F2DRntw5OpdYugfAxcxQyC9SggRrGYu8 Ki2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=oLjutGfm; 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 b20-20020a639314000000b00563faf044e0si7436684pge.840.2023.07.31.11.15.19; Mon, 31 Jul 2023 11:15:32 -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=oLjutGfm; 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 S233745AbjGaQ6g (ORCPT + 99 others); Mon, 31 Jul 2023 12:58:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233751AbjGaQ55 (ORCPT ); Mon, 31 Jul 2023 12:57:57 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FE68213D for ; Mon, 31 Jul 2023 09:57:50 -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 36V5lNJN017071; Mon, 31 Jul 2023 11:57:36 -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=R7ZjjUfa6yJOj++gCN2+TabvdRaWxzaSedPyz17+U0k=; b= oLjutGfmin0E7RLlySjbfdbDa+44PhaRSXLZYdAAMUmSF/GvUGRRZHgdsOCafOCl Ejgrk3ZW+tSrGQtFR58CvV4+cRNPxDInLVviCiSoxB1yS0RaAikpyq6nrjnpChj9 l0DWmBOPSRd3QZGBxkEbeYtjICZRznrlzTtnwiVLUzendX95Mdrkm7eVrOcLUI3N 2nrSFdKBzm5MjPIbPoLkw+AOaGYkUPz+dvZSI8fOgcPUQCuzH9gOuhASUcLLlCte kUJQ5+LnjPaIz/UPrCiA3ODrfYWJ637+Qsbl97SEFUZNf07e0ftbazJDSeEoXYkt keMuQKhUl435GnYzWxW9MQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3s5gk1sg45-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jul 2023 11:57:35 -0500 (CDT) Received: from ediex01.ad.cirrus.com (198.61.84.80) 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:32 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.30 via Frontend Transport; Mon, 31 Jul 2023 17:57:32 +0100 Received: from EDIN4L06LR3.ad.cirrus.com (EDIN4L06LR3.ad.cirrus.com [198.61.64.107]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id CEA4E45D; Mon, 31 Jul 2023 16:57:31 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , , Richard Fitzgerald Subject: [PATCH 6/9] ALSA: hda/cs35l56: cs_dsp_power_down() on cs35l56_hda_fw_load() error path Date: Mon, 31 Jul 2023 17:57:23 +0100 Message-ID: <20230731165726.7940-7-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: bB_xhwoyVLFnhBvAfJRqahOqp3F2rvgI X-Proofpoint-ORIG-GUID: bB_xhwoyVLFnhBvAfJRqahOqp3F2rvgI 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 If cs35l56_hda_fw_load() successfully called cs_dsp_power_up() the error path must balance that with a call to cs_dsp_power_down(). Signed-off-by: Richard Fitzgerald --- sound/pci/hda/cs35l56_hda.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c index e8c41a4a0c40..803fa2da9ea4 100644 --- a/sound/pci/hda/cs35l56_hda.c +++ b/sound/pci/hda/cs35l56_hda.c @@ -567,20 +567,20 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56) if (cs35l56->base.secured) { ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_AUDIO_REINIT); if (ret) - goto err; + goto err_powered_up; } else if (wmfw_firmware || coeff_firmware) { /* If we downloaded firmware, reset the device and wait for it to boot */ cs35l56_system_reset(&cs35l56->base, false); regcache_mark_dirty(cs35l56->base.regmap); ret = cs35l56_wait_for_firmware_boot(&cs35l56->base); if (ret) - goto err; + goto err_powered_up; } /* Disable auto-hibernate so that runtime_pm has control */ ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_PREVENT_AUTO_HIBERNATE); if (ret) - goto err; + goto err_powered_up; regcache_sync(cs35l56->base.regmap); @@ -592,6 +592,9 @@ static int cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56) if (ret) dev_dbg(cs35l56->base.dev, "%s: cs_dsp_run ret %d\n", __func__, ret); +err_powered_up: + if (!cs35l56->base.fw_patched) + cs_dsp_power_down(&cs35l56->cs_dsp); err: pm_runtime_put(cs35l56->base.dev); mutex_unlock(&cs35l56->base.irq_lock); -- 2.30.2