Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1539579pxb; Thu, 16 Sep 2021 09:30:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYVZkPkKiGKJpTkxLTrf1yBHEFdP5yumRTtZZ1k1zlH1zhMjdethIcgflWxNjHaom+Cazz X-Received: by 2002:a05:6e02:1d83:: with SMTP id h3mr4691574ila.274.1631809849319; Thu, 16 Sep 2021 09:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809849; cv=none; d=google.com; s=arc-20160816; b=SlQgduwKgwytwqscgNuM0EcT4dr7eEtj1fOpAXL9FYEZJYTeiC/+SPmi09CSe9lrSH Bw+x4kYtj+oI1iu2r1k0FAh2wHLAazf+umsHJQAix7fnG+6dn2+MJUnIi0aiK3dKgZJP uFPVsmstXlVcbEwhyOFvUEmM0nHi+nDflU8gHgLP9VCdROwLQ4FXPTbGEqVTu3t8vVKw St944OvSxrAOyLGlkekum0+3T5mKXJAteRUbVvQAZlTNYRPmuXTQHRicA64PwybkE4X3 GnhcY/Xw4QZBGX0LnRq/ouoSXKgRBmoJnIVHXAoh4Uv9PPieBxWTd7Xcx6Zb+SvuJe8D c17w== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VPQpRDw/8ZDtyQXerT63eF3F8Ra8N3gbJCdp13mYRVU=; b=pgSLfDw2UnmtXiYE697/JqEm4uGpYQRIpJbyIP7DPewN2V639Yr1WAJWSELz+mHn4h +O3JuibT0TGTmpDQ8U4tcxtJEo/K8YzXENfj6xW947035l/kTPrrm2wbXjH64zsr6oMz +o66zO19NriGxP0w5pO1aTc+YSDwHwShN4xsP/gK0mCVYjWy4kWe9YoK6sesNAYm5V1K biryoyYtguGaL9VVFwQGmnkE87fuYeko94VL73WIiW7qhZ45i5s5SGcu4ye4DU4xRw9E FvWvRCH8b3U/7Zqj3FHfJ5Xzc92mr0sBkhBECBjLvqZd8mPZTJ7stRda2hph1yG9zDjB ujkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wb6r9Gue; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c184si3358483iof.111.2021.09.16.09.30.36; Thu, 16 Sep 2021 09:30:49 -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=@linuxfoundation.org header.s=korg header.b=wb6r9Gue; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243006AbhIPQ3x (ORCPT + 99 others); Thu, 16 Sep 2021 12:29:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:59936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240527AbhIPQUb (ORCPT ); Thu, 16 Sep 2021 12:20:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 75FF6613A5; Thu, 16 Sep 2021 16:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808869; bh=voVTCfJr60HLCN+IptdOiXs63lq9BY/fZ7rtt3PnHS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wb6r9GueTOJDm36W/YZLdkHn0fXAT2qgfRFqYwPx2Kepzj3utRAbTVdOUrD2fRROX 5msQPPtBU3mZbql8jKBVg6ECxxsoN3ouQFdmV40cnLjlXeRQxXBWaeR0jzhNJDTIw0 BthbLwlwlxx/dio4E245F/L48w/VrUlaJ4HVlNXA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gustaw Lewandowski , Cezary Rojewski , Lukasz Majczak , Mark Brown , Sasha Levin Subject: [PATCH 5.10 245/306] ASoC: Intel: Skylake: Fix passing loadable flag for module Date: Thu, 16 Sep 2021 17:59:50 +0200 Message-Id: <20210916155802.414763444@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 bbe8d782e0af..b1897a057397 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -1318,21 +1318,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; @@ -1342,10 +1327,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)) @@ -1359,7 +1352,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