Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp457376pxb; Thu, 9 Sep 2021 05:03:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV1gvjsCdk1UlFvB1RvihizAu+DdyYLli7wjOjCWZC/uBavkFMbv/fgjNLQzQsm3LveNoQ X-Received: by 2002:a05:6402:1d1b:: with SMTP id dg27mr2848641edb.59.1631188988605; Thu, 09 Sep 2021 05:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188988; cv=none; d=google.com; s=arc-20160816; b=Xg6KUnge47ff1upA16ap9SLx81HsHaCQwTD8pc2HgzMXAbKTPCAAGlsUETL4BOBbQC YC9oPG4Onpj8o/G1/sQzk9f/pwqUQZAVDdHGz7Ez3+Nf5qqmmMYNO+IurcMJbuTYEEAM WjoJNoAYnKjN3BdSlMAqxPRQ4Tm0fysNOr7y5FRVWvOXM4OiFlwqsXcrk0ut2VAmqVJP vrbqTvw6xZjeybMKDVx9Cz30GS0LBAaRV0yHQXj8AB8tMZg029Vo9YAFsfDMFweD40EO o3PjJKL8ogYEWzPn7s0JyncjNBzDX96p6zRF8JJ4Tiya/Q7Fv6AzK2YD94WKI61OWPPf O6bQ== 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=XwdB6lbj2daGMn0cflc2IUEUxdJq4IHtrkKcfpaw7yw=; b=h+Tx4KFH0IahuNlFt06e9t7hhH4SivQxTYEa8MlxQwamCWUKz/YH1UL/TdFdMyNTtH 7Hlw82NTu5hh7cRXejC6xLqMyHc5wdQzvbJOYrWDTtzuqhLxRWOuJcUB+CUq8X3kWV27 PpT/wUBD0hP14/o/wdwuTzUHYuev/CIRsgSqRhlY3Me7GpN1+VAHjkIwbljszC+EqEpA ItmuZQY2fKrwKtFK1q7grD37auuXOFyEw2v7NCq5Zx6ugLRpzf6iOxM/n5H16+uFGFee FsImagJF+Xuzuka+7zGwmtw2PWq0mFasHLqnOxoFgvmVoezi9XB3UUWxF35oI3CSUrOg JpqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QOAUrWWn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y16si1763590edd.386.2021.09.09.05.02.25; Thu, 09 Sep 2021 05:03:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QOAUrWWn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241716AbhIIMBb (ORCPT + 99 others); Thu, 9 Sep 2021 08:01:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:34926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245626AbhIIL5C (ORCPT ); Thu, 9 Sep 2021 07:57:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A8111613AB; Thu, 9 Sep 2021 11:45:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187928; bh=9foygNpkQDwOr2qCWW90C35W1j1hFTBdaVPZhzHL2Es=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QOAUrWWn4wp3bpgrybbgUKkgAP9bCjYqwemN9l3srp5BRhc2lj+U+h8qjJrKihXiA uTm9xu5NLfr5LyQknNVew2frLVps3QD9x7T2jOzEoJwSTe/Yljwtv4HLJ2XLFMgO8w F7PX31DMcmQBdakM9SJXnzssxtxndCms36bm25I16+AHiZY7TaAaUwrea6HavZx3Y8 aYjJTYdYZvCeZXaKf7kgkVZ7BQeyVvwbM435FSDhyVDfpnh9SqO/4IfFEeYZcVjRpz TZmeHYmv8w9r2ePb/SKLOz3SWW6NoqLG4vYg99X/2D35UUoWImqI9FJm7DTuUGUo+D GOACj5aAz06vg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Gustaw Lewandowski , Cezary Rojewski , Lukasz Majczak , Mark Brown , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.14 201/252] ASoC: Intel: Skylake: Fix passing loadable flag for module Date: Thu, 9 Sep 2021 07:40:15 -0400 Message-Id: <20210909114106.141462-201-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gustaw Lewandowski [ Upstream commit c5ed9c547cba1dc1238c6e8a0c290fd62ee6e127 ] skl_get_module_info() tries to set mconfig->module->loadable before mconfig->module has been assigned thus flag was always set to false and driver did not try to load module binaries. Signed-off-by: Gustaw Lewandowski Signed-off-by: Cezary Rojewski Tested-by: Lukasz Majczak Link: https://lore.kernel.org/r/20210818075742.1515155-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/skylake/skl-pcm.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index b1ca64d2f7ea..031d5dc7e660 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -1317,21 +1317,6 @@ static int skl_get_module_info(struct skl_dev *skl, return -EIO; } - list_for_each_entry(module, &skl->uuid_list, list) { - if (guid_equal(uuid_mod, &module->uuid)) { - mconfig->id.module_id = module->id; - if (mconfig->module) - mconfig->module->loadable = module->is_loadable; - ret = 0; - break; - } - } - - if (ret) - return ret; - - uuid_mod = &module->uuid; - ret = -EIO; for (i = 0; i < skl->nr_modules; i++) { skl_module = skl->modules[i]; uuid_tplg = &skl_module->uuid; @@ -1341,10 +1326,18 @@ static int skl_get_module_info(struct skl_dev *skl, break; } } + if (skl->nr_modules && ret) return ret; + ret = -EIO; list_for_each_entry(module, &skl->uuid_list, list) { + if (guid_equal(uuid_mod, &module->uuid)) { + mconfig->id.module_id = module->id; + mconfig->module->loadable = module->is_loadable; + ret = 0; + } + for (i = 0; i < MAX_IN_QUEUE; i++) { pin_id = &mconfig->m_in_pin[i].id; if (guid_equal(&pin_id->mod_uuid, &module->uuid)) @@ -1358,7 +1351,7 @@ static int skl_get_module_info(struct skl_dev *skl, } } - return 0; + return ret; } static int skl_populate_modules(struct skl_dev *skl) -- 2.30.2