Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp219964pxb; Mon, 13 Sep 2021 17:29:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJAHpUD7OAzGxuPejx5vlqDSYQsGqdLB8lzjh7qFnq9bB3jg4QjWcdiE5ykv3fXLgWKI0V X-Received: by 2002:a05:6638:2405:: with SMTP id z5mr444515jat.124.1631579373906; Mon, 13 Sep 2021 17:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631579373; cv=none; d=google.com; s=arc-20160816; b=o8s+2Suc6nLofShYu2CaaobkB52WKy03qvv3FQRTD5fOYnmbgNDea1Sph8bkN7ou2X 8a+DNm4SzGJrQMM+qreh34BtoxMXlnDfg8kh/W22m7/+ffz6tMiLLnGgJXBm2ezNQyMw wwCvyNkJ/FozcNJc3TwFUntpyupRm2A986IACeYmTjkB/KeRx+8FUDiX7kGPRD6cUvuP XDpcOkbkx6KxHDfrTWhpEh3qy+8/Dr6HlTYCoEy2UAOX1wZhn9ZjPSqvzR+zZm2dDerl A23KMcmzRacL7L79/8tcdLiW7qRqxLwMZAwxnPuiT3ssqdF8hqfvw6xL4RL+UWPZjkdK Mf2g== 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=P3MvTPI9o7NNx9WMdcXZNAxqFIDqcMRR16u7yyAGjXo=; b=I4NYh+eiytZ5ekS87mcC4tph7734shiLLOD7DS124UGq7BzNSiNnZQ86TliBRwRj1Q aXiQIJ9jC6j4y2S4Lhed90ejn/XL1Q+r7IefcFtCocHEkjBBXyqo3I4XXMk3A/ybGnpa s5Fp5BMtOQhLBGbnqqSXpzlARQxiK5Z+xd9jRyQlHQhR15/UIp7aAK6SCilUBu46+qcj gYvIZAfqFXhASqzCnVN5WOUTLnPIknfB6i66jIAmzmLGashUFMUGHiwAifdR6ucJan6x iJAPTkkdsuEqyky3sQ5y+/g4ibzDsfmIgefEEFcAm9sKs5AFHnPPq61ve8L3XrjoHVB8 vfrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j77sY0Wr; 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 a3si8004006ioc.79.2021.09.13.17.29.21; Mon, 13 Sep 2021 17:29:33 -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=j77sY0Wr; 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 S1344896AbhIMOPf (ORCPT + 99 others); Mon, 13 Sep 2021 10:15:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:59956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244768AbhIMOMB (ORCPT ); Mon, 13 Sep 2021 10:12:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2E07661ACD; Mon, 13 Sep 2021 13:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540552; bh=lsBeOQle0FMt7DA7v9vVSvkCMTbyo2tcnMyKV6yi++U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j77sY0Wr1APAFrGIDQftiBYUPO/EMKQ0gf0o4uMKHj87dTrX2SrlvdT44pIqvM7j4 npAhQhakipM5sZNTSzj65ZIG0TvscP4xADw25J0CB0xtcimFzUAWjokWu3blkNd04x 0cKEsLtsKxv3uuFEtJsq9GncjiJv9Si6cWmOx0vw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Abhishek Naik , Luca Coelho , Sasha Levin Subject: [PATCH 5.13 241/300] iwlwifi: skip first element in the WTAS ACPI table Date: Mon, 13 Sep 2021 15:15:02 +0200 Message-Id: <20210913131117.495907685@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@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: Abhishek Naik [ Upstream commit 19426d54302e199b3fd2d575f926a13af66be2b9 ] By mistake we were considering the first element of the WTAS wifi package as part of the data we want to rid, but that element is the wifi package signature (always 0x07), so it should be skipped. Change the code to read the data starting from element 1 instead. Signed-off-by: Abhishek Naik Fixes: 28dd7ccdc56f ("iwlwifi: acpi: read TAS table from ACPI and send it to the FW") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20210805141826.ff8148197b15.I70636c04e37b2b57a5df3ce611511f62203d27a7@changeid Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c index e31bba836c6f..dfa4047f97a0 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -243,7 +243,7 @@ int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt, goto out_free; } - enabled = !!wifi_pkg->package.elements[0].integer.value; + enabled = !!wifi_pkg->package.elements[1].integer.value; if (!enabled) { *block_list_size = -1; @@ -252,15 +252,15 @@ int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt, goto out_free; } - if (wifi_pkg->package.elements[1].type != ACPI_TYPE_INTEGER || - wifi_pkg->package.elements[1].integer.value > + if (wifi_pkg->package.elements[2].type != ACPI_TYPE_INTEGER || + wifi_pkg->package.elements[2].integer.value > APCI_WTAS_BLACK_LIST_MAX) { IWL_DEBUG_RADIO(fwrt, "TAS invalid array size %llu\n", wifi_pkg->package.elements[1].integer.value); ret = -EINVAL; goto out_free; } - *block_list_size = wifi_pkg->package.elements[1].integer.value; + *block_list_size = wifi_pkg->package.elements[2].integer.value; IWL_DEBUG_RADIO(fwrt, "TAS array size %d\n", *block_list_size); if (*block_list_size > APCI_WTAS_BLACK_LIST_MAX) { @@ -273,15 +273,15 @@ int iwl_acpi_get_tas(struct iwl_fw_runtime *fwrt, for (i = 0; i < *block_list_size; i++) { u32 country; - if (wifi_pkg->package.elements[2 + i].type != + if (wifi_pkg->package.elements[3 + i].type != ACPI_TYPE_INTEGER) { IWL_DEBUG_RADIO(fwrt, - "TAS invalid array elem %d\n", 2 + i); + "TAS invalid array elem %d\n", 3 + i); ret = -EINVAL; goto out_free; } - country = wifi_pkg->package.elements[2 + i].integer.value; + country = wifi_pkg->package.elements[3 + i].integer.value; block_list_array[i] = cpu_to_le32(country); IWL_DEBUG_RADIO(fwrt, "TAS block list country %d\n", country); } -- 2.30.2