Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2367608lqp; Sun, 24 Mar 2024 16:06:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXN6uG5y8dEoVMPUcQoWsTVugg5zLmj8IEzKZAyepS1UlvS+hj+X/H5b2a8uXc2Qr5CD71vkd3T/igMMBhbbw6EJHa2VrimU59dii2kGw== X-Google-Smtp-Source: AGHT+IFtdGG5XkOtUbqpRDJhGGtdPyOmFzpmtvAhZqq7k4QHVSd5YzFCxXrVsTbADvSVfLIKTQKK X-Received: by 2002:a19:7417:0:b0:513:aef9:7159 with SMTP id v23-20020a197417000000b00513aef97159mr3548061lfe.39.1711321564742; Sun, 24 Mar 2024 16:06:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711321564; cv=pass; d=google.com; s=arc-20160816; b=vECPdYv6vITcA6wF7VnefkCsvg54M8eJPASsfJE/shtEjKPakXivDDUqE8gRqo6Eg0 lB2DknIcmRJLIrq+tJkpZBZzlQcwWERH9eToom/01N4GVjmCBAPYp4cx2195BfnBttoJ U+Fio2iJk7OibRWnDPxWKNIyqpJGc6oeGMR/ynbmv5ZxViYCH9j4SvRKTplSOL0O1yDB k0yOkXajVhNoBKQOC8pSAjTeh6u1oOmk/nA0XNTWeNx/kM6venywcFFCwfguA0UMJ9F3 wYUUdnQMbkg0Lsr0+Bf+JN2fZPNtgb2KBaM4ZpqF/YNKL8VM3oIz7vKGn0sDmdmsbtFg 054g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=39mSVQV3udSjm1UBXObDEowhHzi2hucSX3mKtr23vyM=; fh=kjyg2rkBK2r1u7Vz5RR0Ol83qrSurJy2kO4VY0vfms4=; b=GpoVf0QnN7IH7jJqme3PsJPd42PyESfq9tHvCDzb9tIIH4KAw1MgY0b6BA0QokjJwq SL8WLz6kZ2eXnSTZZyLbMco/1V3qyW3ZkgPUN1pw2dcW/5iN6RjxdTpisvWEPk7HJHnl pKAaCfLrLFA7GkJTYamYROgUrnfGNvn5ffFlP4+Fp8fRLQM7Hgg4hqpw726gpjoIGpTA YWrhng5tWlVeUSk5ZQSGDlzGKFPLtj2MEf2jnLw+r1ScyBsXe2DGx9iu44bk6f030Cka N0hb6343RG2HbpZgbQQaO5Q8p/WHUsvu100S0JiUwFVWh9bNLZIqWKtBS9Ju7P71tvD5 6qUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fjed9SvL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113020-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113020-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g8-20020a17090669c800b00a4493bc18b3si1874206ejs.403.2024.03.24.16.06.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:06:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113020-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fjed9SvL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113020-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113020-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 722BA1F26231 for ; Sun, 24 Mar 2024 23:06:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED4CB137C39; Sun, 24 Mar 2024 22:37:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Fjed9SvL" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FDE113793D; Sun, 24 Mar 2024 22:37:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319831; cv=none; b=Tbm40qHgc8LMFLscDgFFCbvvKRsB3td+Xln8lsuzM6QvHCLNvGtOtFOMQvDoUxeIiRr3jNbPhobb4ti71Rt+RBMrlKco4SnZjjFu2K0Jbt3afdYa5B7jSPWDzvy7l94InaPqq0h/iQwSv29v2soAcU6Ln/060Bh4tCiCPNbhlg0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319831; c=relaxed/simple; bh=R5MgffQAqsovV9p+t6iCvXpyZJGJXls0j6QgS0aphW8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IydbbqI4A1ABKm3ZeXtovjvKnDfKL5cipIaVvjYbL1jjivBS680JryV4sqwuSMZgvEYhoqEn6qcNycX7jKrUN/mt8o4t71qUg7fiITUi+6K/7g+rnIVfEZsMHBu7UTbDqwh6g77eBPXyVUpuj+BQtPBtBblueY4s/z6pwlLiHm4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fjed9SvL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38A39C433B2; Sun, 24 Mar 2024 22:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319830; bh=R5MgffQAqsovV9p+t6iCvXpyZJGJXls0j6QgS0aphW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fjed9SvLHpCit5qCPkiJ7G32p7ypxB+7OdjpchehUAKOjUufS5FchDh9ig0CyAkj+ o6dNNBw53ZquHre/dexowUqJTAvQoIY9GknjtN4o054BokXkZJ21qTjorZdWHH8EJY v+AKX04pnH04MtesUqxy46QZjRRvZur2iXCFU1pFd0FpK+EmpAQbCsrfGz6W6+TpqN n62wFzjJnQOJ71ouV0YcD+eX7YchvAZ/Y1DJUjz99cPKLEf0fggObEz9lRjG4psMp6 AaSTlkaNQFjpYCux+mIFYjOsNb6YajZR8H4N2t12i4ly00QUl0MG/YzmHe2BXxqrPf S4DN4QNOdDoSA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Miri Korenblit , Gregory Greenman , Johannes Berg , Sasha Levin Subject: [PATCH 6.8 133/715] wifi: iwlwifi: read BIOS PNVM only for non-Intel SKU Date: Sun, 24 Mar 2024 18:25:12 -0400 Message-ID: <20240324223455.1342824-134-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Miri Korenblit [ Upstream commit c868a189ecfe8cc0b3173c2eaa7f0b659326c151 ] The driver is supposed to read the PNVM from BIOS only for non-Intel SKUs. For Intel SKUs the OEM ID will be 0. Read BIOS PNVM only when a non-Intel SKU is indicated. Fixes: b99e32cbfdf6 ("wifi: iwlwifi: Take loading and setting of pnvm image out of parsing part") Signed-off-by: Miri Korenblit Reviewed-by: Gregory Greenman Link: https://msgid.link/20240131091413.3625cf1223d3.Ieffda5f506713b1c979388dd7a0e1c1a0145cfca@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 30 ++++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c index 650e4bde9c17b..56ee0ceed78ab 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c @@ -255,21 +255,27 @@ static u8 *iwl_get_pnvm_image(struct iwl_trans *trans_p, size_t *len) struct pnvm_sku_package *package; u8 *image = NULL; - /* First attempt to get the PNVM from BIOS */ - package = iwl_uefi_get_pnvm(trans_p, len); - if (!IS_ERR_OR_NULL(package)) { - if (*len >= sizeof(*package)) { - /* we need only the data */ - *len -= sizeof(*package); - image = kmemdup(package->data, *len, GFP_KERNEL); + /* Get PNVM from BIOS for non-Intel SKU */ + if (trans_p->sku_id[2]) { + package = iwl_uefi_get_pnvm(trans_p, len); + if (!IS_ERR_OR_NULL(package)) { + if (*len >= sizeof(*package)) { + /* we need only the data */ + *len -= sizeof(*package); + image = kmemdup(package->data, + *len, GFP_KERNEL); + } + /* + * free package regardless of whether kmemdup + * succeeded + */ + kfree(package); + if (image) + return image; } - /* free package regardless of whether kmemdup succeeded */ - kfree(package); - if (image) - return image; } - /* If it's not available, try from the filesystem */ + /* If it's not available, or for Intel SKU, try from the filesystem */ if (iwl_pnvm_get_from_fs(trans_p, &image, len)) return NULL; return image; -- 2.43.0