Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp438966yba; Fri, 3 May 2019 04:54:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaM3KhMDUklU22bApgfNc2zjPYJUPlw51UfMeUrMJmLVhUtqtkLgad0O68O9TwlujbRsgr X-Received: by 2002:a17:902:2702:: with SMTP id c2mr9544446plb.277.1556884450448; Fri, 03 May 2019 04:54:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556884450; cv=none; d=google.com; s=arc-20160816; b=VwwsUZlrq7F00BWJ/vuEDALkdRiBjnFfsIrdQu8DnXGeCM1ka4oKX8I5BsTdJWNyCB 8k3i1H5zx7muTfrwFDxgO8DJrLmhb55BRKti3g1Iedm1jg05brJ+TfrRlJczUVAZXDn5 0TfzyUC1WyZjbbCwZ+qUy3gftCPMekUYF24xcFWx/SfV9St3Bxs+dzrM7cKYHSMRWgqQ 1YWrzkM2dpnqvBkigch9yleIn/RqKreIhnGrvIR7clWALvUJJ6WlEcwPhCwgwpbMw8PV 2JlAZYaTcwBtgk6Bhywly1zKAIGMYWZm0KhQzTpnPscq5L2dCOXIO2SalaCoFkHVf012 zdAQ== 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=uoUzUSzLG42MRzHGtjl4PeOL2gPVQRI+Gp3XFMgu3vLjhJJ7Ptn1/H6PWYPCCLw/Ps rTyZ6rvKxMHE60PhXJ1rgimhy8lCaj2CJbzsm0ZhC93GjRzNtxgOpyhDyV/YTvNf3Wjb 8Op4CqrIPmoLZZZJJutoc+MIedJj+BkmWhw6vHu1L2uBzC7rW7wl4ElkTEhCV4KFe+4Z 9Cd97ZFEb/A81U7+ZXuiahpGP5sId8pA6kXjKf0e2YxQ+aSQ0Px7vnDoLwZx8UaDDkOD BmrbdrtrJQN9HaeY/Gm5wO4+a1r7QfDq1JwjNDkI4Sbr1Nmbvi2jZVia3gsQs5bp7gmE UKiQ== 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 q81si1950049pfa.207.2019.05.03.04.53.51; Fri, 03 May 2019 04:54:10 -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 S1727700AbfECLxq (ORCPT + 99 others); Fri, 3 May 2019 07:53:46 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:58249 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727639AbfECLxq (ORCPT ); Fri, 3 May 2019 07:53:46 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x43BrfuZ000724, 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 x43BrfuZ000724 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NOT); Fri, 3 May 2019 19:53:41 +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 19:53:41 +0800 From: To: CC: Subject: [PATCH v2 3/5] rtw88: pci: check if queue mapping exceeds size of ac_to_hwq Date: Fri, 3 May 2019 19:53:33 +0800 Message-ID: <1556884415-23474-4-git-send-email-yhchuang@realtek.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556884415-23474-1-git-send-email-yhchuang@realtek.com> References: <1556884415-23474-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