Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp375933yba; Fri, 3 May 2019 03:38:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqw09JSbyJmyq4NyYP2H+IrK8tWVy0bgw5nO+jYqyiqV9G4FVhErGE7cHi94DqNYOGMnRDC2 X-Received: by 2002:a63:1701:: with SMTP id x1mr9290207pgl.153.1556879887186; Fri, 03 May 2019 03:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556879887; cv=none; d=google.com; s=arc-20160816; b=TKOSvhVhBVc5ybVL2qIVMe2W0z5hdUukL3lLiB7rE61e5J8Knfpt/6t0/7s75P5QEM WcKP4Kq27jzE4GXZrKVDTLYhaQey/+Sv5yv5rt18BJauqoZhj67KWISsTKlI1rCthb1w PJtnDfAoGTe2FUH2+EpsrRT07ofsopy/wHVNP5PELz2tsUNJo2ZDsAPwlKks9+fH+x1P rF+S3ycU8pmnZwsLqJAQUMJaowRMRydv8wMOH2pHK2JEIdSrO05fimlFHKLe5WTSGxvD itHMaw1AeNeMxY2BqmqpXtEz0YEAyD8Kk6Nk6d6VehUi5nfFTBj6aoOQ+A1xJJSZed01 dCwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:authenticated-by; bh=98i0YLmFYpcCf0vfzUKdoCn06dlnDPUfl5I1AqCrp9U=; b=mpWCcNqnLyTUfdQ/5C2PmWnI+xafCzRfeifVYkqgPRHEMyYo1vfnPoUrLI9dDUI0fG l6rJw7ltr5ERjS68n0c3LzftEIy+aXi/HnANdN/Zcys+EXSqU2nDbM4DSYAjuXlWfWdF 2x8h+9LussjADxrg230F1xCMaf62sYTcAkVcWfx7CMDj7ucGeo2IFG4iYrWCN4tCb8wn sNbyShzZ8CJ8PRwBUASjK4bjGMMwvb5wGkCDPQ5hbaH1edt9/h/pkuoBiwqSN9KwXBM3 d4vQk8aU3YrcVWUSMNLgXAnkOOWZ+tuSqYVhIDf3UuoOPvj5ibvfV4eEk7D/cpxEGTrN 0Nzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si1736777pgq.74.2019.05.03.03.37.52; Fri, 03 May 2019 03:38:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727435AbfECKcV (ORCPT + 99 others); Fri, 3 May 2019 06:32:21 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:48815 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727033AbfECKcV (ORCPT ); Fri, 3 May 2019 06:32:21 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x43AWF8A012116, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtitcasv01.realtek.com.tw[172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x43AWF8A012116 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NOT); Fri, 3 May 2019 18:32:15 +0800 Received: from localhost.localdomain (172.21.68.126) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.408.0; Fri, 3 May 2019 18:32:14 +0800 From: To: CC: Subject: [PATCH 3/6] rtw88: pci: check if queue mapping exceeds size of ac_to_hwq Date: Fri, 3 May 2019 18:31:39 +0800 Message-ID: <1556879502-16211-4-git-send-email-yhchuang@realtek.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556879502-16211-1-git-send-email-yhchuang@realtek.com> References: <1556879502-16211-1-git-send-email-yhchuang@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.126] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Yan-Hsuan Chuang Dump warning messages when we get a q_mapping larger than the AC numbers. And pick BE queue as default. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c index 87bfcb3..353871c 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.c +++ b/drivers/net/wireless/realtek/rtw88/pci.c @@ -504,6 +504,8 @@ static u8 rtw_hw_queue_mapping(struct sk_buff *skb) queue = RTW_TX_QUEUE_BCN; else if (unlikely(ieee80211_is_mgmt(fc) || ieee80211_is_ctl(fc))) queue = RTW_TX_QUEUE_MGMT; + else if (WARN_ON_ONCE(q_mapping >= ARRAY_SIZE(ac_to_hwq))) + queue = ac_to_hwq[IEEE80211_AC_BE]; else queue = ac_to_hwq[q_mapping]; -- 2.7.4