Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1841115pxb; Thu, 16 Sep 2021 17:32:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUJIjHt4oyTw1f+Ax1xEX35ZKz70kHl38ZpB1Sk+X5YZdInGT1I3UM3oMNZ13Z2Apd1/Ht X-Received: by 2002:a17:906:c1d0:: with SMTP id bw16mr9554912ejb.146.1631838773919; Thu, 16 Sep 2021 17:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631838773; cv=none; d=google.com; s=arc-20160816; b=SKV4d6tnDewCZVooQaALNMZAmHF8ezkwUcUDseI+hMZYow0tZSi2R/MNDMTxfrV3uu fOEypH//Gg8ITmLoHlBpr/EQLF8ApVoiiJorUruSKond/NKzHQIActRxeoFkJkb7Tvwu zNCV9YgcJrD8tbHB04Iwk1Kg8A52Gghki91XzppJrjgwDgQwrjhsFmmhP9DeWt/Lwet/ RREsXiEu8VAi0uasaWUx4TsAk/8GrgWUVbH3QctS6BLcSZXe82BWCdI8gQfG91RAQH9g keX39YgY+BMRhS+LDn85WuuYaZbcEQXVwJiAB2o3lZ+QtV3baBvFL/Z/STgnjHOlKQsi 4n/Q== 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=XwdB6lbj2daGMn0cflc2IUEUxdJq4IHtrkKcfpaw7yw=; b=qmEV0bIAAcAzhp5kbO767DHuV7mc6QkYEnoPhP17rOAuT3SaqS3rfzOmyvA+OOHrYL pEixwdRYoz95vWWt33sAzDrNydAeD23Z5z9R3z9VFAios5bAiK8yRs8r758BqfC9os3k Y0Bol0WOs9dWk9c05hqXBpo8CIc2YeQfdiOeg/By2W4awvhxHRUY+7YLylmjbahQwNi5 fa75C9TXzaV8tksWyet4yMiS5XoSWXGV6qWbi1Vit+ZQZ1luNz50ON+Y3i1gDOH8aVCm 4lfLjsiQJzpKhk/43SQF0hXdXCREWBH1Dig9bTgQXpaVDhHz4jD51QTXLsGIRjj35PVv ymRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1gThQKtZ; 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 y13si5399693edp.238.2021.09.16.17.32.30; Thu, 16 Sep 2021 17:32:53 -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=1gThQKtZ; 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 S1348941AbhIPRDV (ORCPT + 99 others); Thu, 16 Sep 2021 13:03:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:55310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346808AbhIPQ4M (ORCPT ); Thu, 16 Sep 2021 12:56:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E72D161AE1; Thu, 16 Sep 2021 16:30:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809848; bh=9foygNpkQDwOr2qCWW90C35W1j1hFTBdaVPZhzHL2Es=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1gThQKtZ2yOlaDe8JyLHzJtEI8Mp5gWa1bKj6F56ccopHyGfbib55XeYCnF46cxOS AnJt7N3W7KPALlj++ZsndCaxOco4MMCLDXCZ3fY2TFtbq2JtN5YeC+wqzzhHTFrmzV 9bxCKLNUTPg3HosYfETUzBkAqXG/RcABTI7XG3OI= 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.13 305/380] ASoC: Intel: Skylake: Fix passing loadable flag for module Date: Thu, 16 Sep 2021 18:01:02 +0200 Message-Id: <20210916155814.435986102@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@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 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