Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp173489imd; Wed, 31 Oct 2018 16:48:05 -0700 (PDT) X-Google-Smtp-Source: AJdET5fTH5znVXg9+XZ8r994J2iZYPmpWrSkcDArRTrjK0wAuPYpQV1NSAPxDM7LJNu/KOTEEpc5 X-Received: by 2002:a62:d084:: with SMTP id p126-v6mr5597734pfg.147.1541029685928; Wed, 31 Oct 2018 16:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029685; cv=none; d=google.com; s=arc-20160816; b=cfDQrzO4+2i1lWCFjw0ORAMISRPyqGb52FXrJZVUjB1Mr53a20ZZNd8Ko7SyL++xbR ZgsVWFpvp9Fd7KP7E1pkf4OMWYa9QivdpYcjtL6u3IRsDXuQnC2ObY4vNPI5kbHMrnMF cgBuBjA+ulcFu1GJRI78Pk9l/CHbY/ok7HcrG0h95WdDfISea+Q7CSMO++pWTUjAq5No TRr1rqsLn/2pw0HO5OrtsPtHz3zpqArbhl6mWIWFrU5PIeDBrQQR+z1xQdSd+NXbzFLX j908J5ggN5bazALOXRr+IRndgh/gSbaD4cT7MqdL33A58waVBjB+ErQvRcoFvplOqHJQ qT8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=kNfDsRZ+96kBTKY9uZuECzHNeTzaots5DCg04Puhw24=; b=TKL2gK0RDNaIpRaDcJ23vj6kvEu6VLq3v9aPgmhqDzrMe3wDYcLs/FGI0UjhpbM5UG 9/UWW8Z4PvLJzXBBl+QQaANinobwTiFJS0va1y+kke+MjPh75y77JZiWlkWoy2IGXZbh SwZC2UYDUDWZEK86+dAIouaCM3cPhPqOwwPD/4AN1D585BHcYbpDwj+qxHPXAuKgmioN E+M3o1H9F0sJ7f41Rpz6wu1avmsKx8ebxYmpsI9yU4lQCmeIn/Z3chTndVHD6rARmA6W uw88PdyvHRCzdBQI6isRtv2dd7t7iu1rZbju5MBbd2zx8IWTqmYIM3p8v9oYdp1f2QLU m1dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oSEOKkUK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q22-v6si18585708pgb.368.2018.10.31.16.47.50; Wed, 31 Oct 2018 16:48:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oSEOKkUK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728576AbeKAIHD (ORCPT + 99 others); Thu, 1 Nov 2018 04:07:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:54462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728533AbeKAIHD (ORCPT ); Thu, 1 Nov 2018 04:07:03 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B618920823; Wed, 31 Oct 2018 23:06:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027212; bh=+n7ZDG8QYndBhDshQ1CluhLqFF07Cj9TFZz/kJW3NOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oSEOKkUKRsUGH0LMN7pzRJLoCYj3v80cw5hKwSruFY1dMpffFIKTlt0SMcGqyqXVP jdTsFlJqf8MTXTLTfJc/WFfykeIcPoZdQ89GVO85lCxiz+ecOXY7OrJGs7tCN190LT j8q7mVCTBLY7IvFvhaVKE8BhSLaDJtKMPOlJN4f4= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sara Sharon , Luca Coelho , Sasha Levin Subject: [PATCH AUTOSEL 4.19 076/146] iwlwifi: mvm: fix BAR seq ctrl reporting Date: Wed, 31 Oct 2018 19:04:31 -0400 Message-Id: <20181031230541.28822-76-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sara Sharon [ Upstream commit 941ab4eb66c10bc5c7234e83a7a858b2806ed151 ] There is a bug in FW where the sequence control may be incorrect, and the driver overrides it with the value of the ieee80211 header. However, in BAR there is no sequence control in the header, which result with arbitrary sequence. This access to an unknown location is bad and it makes the logs very confusing - so fix it. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index ff193dca2020..2d21f0a1fa00 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -1405,6 +1405,7 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, while (!skb_queue_empty(&skbs)) { struct sk_buff *skb = __skb_dequeue(&skbs); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_hdr *hdr = (void *)skb->data; bool flushed = false; skb_freed++; @@ -1449,11 +1450,11 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; info->flags &= ~IEEE80211_TX_CTL_AMPDU; - /* W/A FW bug: seq_ctl is wrong when the status isn't success */ - if (status != TX_STATUS_SUCCESS) { - struct ieee80211_hdr *hdr = (void *)skb->data; + /* W/A FW bug: seq_ctl is wrong upon failure / BAR frame */ + if (ieee80211_is_back_req(hdr->frame_control)) + seq_ctl = 0; + else if (status != TX_STATUS_SUCCESS) seq_ctl = le16_to_cpu(hdr->seq_ctrl); - } if (unlikely(!seq_ctl)) { struct ieee80211_hdr *hdr = (void *)skb->data; -- 2.17.1