All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: alsa-devel@alsa-project.org
Cc: Cezary Rojewski <cezary.rojewski@intel.com>,
	jairaj.arava@intel.com, upstream@semihalf.com,
	harshapriya.n@intel.com, cujomalainey@google.com, tiwai@suse.com,
	pierre-louis.bossart@linux.intel.com,
	Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>,
	hdegoede@redhat.com, broonie@kernel.org, jenny.tc@intel.com,
	lma@semihalf.com, vamshi.krishna.gopal@intel.com
Subject: [PATCH 06/11] ASoC: Intel: Skylake: Fix passing loadable flag for module
Date: Wed, 18 Aug 2021 09:57:37 +0200	[thread overview]
Message-ID: <20210818075742.1515155-7-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20210818075742.1515155-1-cezary.rojewski@intel.com>

From: Gustaw Lewandowski <gustaw.lewandowski@linux.intel.com>

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 <gustaw.lewandowski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 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 c604200de80e..9ecaf6a1e847 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -1310,21 +1310,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;
@@ -1334,10 +1319,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))
@@ -1351,7 +1344,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.25.1


  parent reply	other threads:[~2021-08-18  7:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18  7:57 [PATCH 00/11] ASoC: Intel: Skylake: Fix and support complex Cezary Rojewski
2021-08-18  7:57 ` [PATCH 01/11] ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373 Cezary Rojewski
2021-08-18  7:57 ` [PATCH 02/11] ASoC: Intel: Skylake: Leave data as is when invoking TLV IPCs Cezary Rojewski
2021-08-18  7:57 ` [PATCH 03/11] ASoC: Intel: Skylake: Select proper format for NHLT blob Cezary Rojewski
2021-08-18  7:57 ` [PATCH 04/11] ASoC: Intel: Skylake: Fix module resource and format selection Cezary Rojewski
2021-08-18  7:57 ` [PATCH 05/11] ASoC: Intel: Skylake: Fix module configuration for KPB and MIXER Cezary Rojewski
2021-08-18  7:57 ` Cezary Rojewski [this message]
2021-08-18  7:57 ` [PATCH 07/11] ASoC: Intel: Skylake: Simplify m_state for loadable modules Cezary Rojewski
2021-08-18  7:57 ` [PATCH 08/11] ASoC: Intel: Skylake: Support multiple format configs Cezary Rojewski
2021-08-18  7:57 ` [PATCH 09/11] ASoC: Intel: Skylake: Support modules with generic extension Cezary Rojewski
2021-08-18  7:57 ` [PATCH 10/11] ASoC: Intel: Skylake: Properly configure " Cezary Rojewski
2021-08-18  7:57 ` [PATCH 11/11] ASoC: Intel: Skylake: Select first entry for singular pipe config arrays Cezary Rojewski
2021-08-18 11:08 ` [PATCH 00/11] ASoC: Intel: Skylake: Fix and support complex Lukasz Majczak
2021-08-23 17:37 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210818075742.1515155-7-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cujomalainey@google.com \
    --cc=gustaw.lewandowski@linux.intel.com \
    --cc=harshapriya.n@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=jairaj.arava@intel.com \
    --cc=jenny.tc@intel.com \
    --cc=lma@semihalf.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    --cc=upstream@semihalf.com \
    --cc=vamshi.krishna.gopal@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.