From patchwork Fri Jan 29 17:54:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 8165681 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 227B4BEEE5 for ; Fri, 29 Jan 2016 17:54:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60D78200F4 for ; Fri, 29 Jan 2016 17:54:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8492520154 for ; Fri, 29 Jan 2016 17:54:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756624AbcA2RyO (ORCPT ); Fri, 29 Jan 2016 12:54:14 -0500 Received: from mail-oi0-f42.google.com ([209.85.218.42]:36759 "EHLO mail-oi0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932671AbcA2RyM (ORCPT ); Fri, 29 Jan 2016 12:54:12 -0500 Received: by mail-oi0-f42.google.com with SMTP id o124so51886835oia.3; Fri, 29 Jan 2016 09:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type; bh=IFA7LlvjwooUts3Cn19e68ZVjnv9S5MkL9mXg5axtfE=; b=mvU+6KjAr3fO9Q7unh3sRgi+feq7gydciygIvvX8misPQJJkJOgftyqlLHM6n9KCPM 7Ut7UM94kwlyJr8yQcUZqnrMX6Y6hbG8QU3UfhaeCcjkNN5QE++0VxYS/Vb+T0WdZF+M S3TNiaf3HtMFFPDpa99NW4BB0cjZiZM09nOCxsAI9HKnkzIBaNk6gIq2m2atZI1x3T8x +NN768SDx3oUsasYGcm3fOtCI1T72GEgFgLmzf8utVYdZGhAvsEOGnUs+ChryUIeBQ9p lBOIZo82JjyK8jkzODMKlEtjW6d76R+Ifo/q6L6ltphEujtDJ3y0S7nrwJ0HelUIgoZd 3HPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-type; bh=IFA7LlvjwooUts3Cn19e68ZVjnv9S5MkL9mXg5axtfE=; b=l7+QnjMdOMvoIiyVIn9ksthq9Uc+QT4ccrunLLmdXngyMh2AA4h0rVHUJJ2gewo0nF GE8VlveYXhLIM2FY9SaEVwHdApxZsOHcczbiLgnyeyYSzFj5Pluf6CeaaopHaM53NbT0 wZ9PBUEvdXbPKG+YdqeEI2g7kIrAYX32X25ivS8X6hi5XzFZLhKDEJIDX/T83AtrKc51 9wCL7VNtVIC93JSieaIk3xVZ/Otro0QvxdUC4H6cQQizXSljpt1qaLVuHyRWtN4WNEYI voKXEsLv6aeGHRF9YOnv9t7igeVbJA+gDy/uDKNlC/DS+WG3gk1Tqc+0qzKD8hojaJ5p pXkg== X-Gm-Message-State: AG10YORnKNh9BP9EN1+kvD9MkHDhmaXs488euOx0GHkkjRxP40b2dBAD5tTbNL+v5icNvA== X-Received: by 10.202.179.70 with SMTP id c67mr6702744oif.12.1454090051590; Fri, 29 Jan 2016 09:54:11 -0800 (PST) Received: from linux.site (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id t74sm8300979oie.21.2016.01.29.09.54.09 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 09:54:10 -0800 (PST) Subject: Re: WARNING at net/mac80211/rate.c:513 ieee80211_get_tx_rates [mac80211] To: Linus Torvalds References: <1453983185.2217.12.camel@sipsolutions.net> <1454013625.2332.9.camel@sipsolutions.net> <1454019155.2332.15.camel@sipsolutions.net> <56AAC66C.1080800@lwfinger.net> <1454056380.3369.2.camel@sipsolutions.net> <1454084146.2800.0.camel@sipsolutions.net> Cc: Johannes Berg , Chaoming Li , Kalle Valo , David Miller , Linux Wireless List , Network Development From: Larry Finger Message-ID: <56ABA73C.1060504@lwfinger.net> Date: Fri, 29 Jan 2016 11:54:04 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1454084146.2800.0.camel@sipsolutions.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,T_TVD_MIME_EPI, UNPARSEABLE_RELAY,URIBL_BLACK autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Linus, Attached is a trial patch that fixes the problem on my system. As I told Johannes earlier, my AP was not configured to use VHT, thus I did not see the problem. The test patch that Johannes sent earlier was close. The section needed to add VHT rates is: Larry From bd34ac0c3caa9ff982194256b0e96772a17e719d Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Fri, 29 Jan 2016 11:29:10 -0600 Subject: [PATCH] rtlwifi: Fix warning from ieee80211_get_tx_rates() when using 5G To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org When using a 5G-capable device with VHT rates enabled, the following warning results: WARNING: CPU: 3 PID: 2253 at net/mac80211/rate.c:625 ieee80211_get_tx_rates+0x22e/0x620 [mac80211]() Modules linked in: rtl8821ae btcoexist rtl_pci rtlwifi fuse drbg ansi_cprng ctr ccm bnep bluetooth af_packet nfs fscache vboxpci(O) vboxnetadp(O) vboxne tflt(O) vboxdrv(O) arc4 snd_hda_codec_generic x86_pkg_temp_thermal rtsx_pci_sdmmc mmc_core rtsx_pci_ms kvm_intel memstick iwlmvm kvm mac80211 snd_hda_intel snd_hda_cod ec snd_hwdep snd_hda_core irqbypass snd_pcm iwlwifi crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel aes_x86_64 snd_timer lrw gf128mul glue_h elper ablk_helper cryptd snd cfg80211 pcspkr serio_raw e1000e rtsx_pci lpc_ich ptp xhci_pci mfd_core pps_core xhci_hcd soundcore toshiba_acpi thermal sparse_keymap wmi toshiba_bluetooth rfkill acpi_cpufreq battery ac processor dm_mod i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm sr_mod cdrom video button sg autofs4 [last unloaded: rtlwifi] CPU: 3 PID: 2253 Comm: Timer Tainted: G W O 4.5.0-rc1-wl+ #79 Hardware name: TOSHIBA TECRA A50-A/TECRA A50-A, BIOS Version 4.20 04/17/2014 ffffffffa05c4be6 ffff8802262036d8 ffffffff813d7912 0000000000000000 ffff880226203710 ffffffff8106bcb6 ffff8800c6831300 ffff8800c6831330 0000000000000000 ffff8800c683133c ffff880065923638 ffff880226203720 Call Trace: [] dump_stack+0x4b/0x79 [] warn_slowpath_common+0x86/0xc0 [] warn_slowpath_null+0x1a/0x20 [] ieee80211_get_tx_rates+0x22e/0x620 [mac80211] [] ? rtl_is_special_data+0x32/0x240 [rtlwifi] [] ? rate_control_get_rate+0xce/0x150 [mac80211] [] ? trace_hardirqs_on+0xd/0x10 [] ? __local_bh_enable_ip+0x65/0xd0 --- traceback terminated here --- The problem is that IEEE80211_TX_RC_VHT_MCS is not set in the rate flags. Reported-by: Linus Torvalds Cc: Johannes Berg Signed-off-by: Larry Finger Cc: Stable --- drivers/net/wireless/realtek/rtlwifi/rc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/rc.c b/drivers/net/wireless/realtek/rtlwifi/rc.c index 74c14ce..e7eae63 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rc.c +++ b/drivers/net/wireless/realtek/rtlwifi/rc.c @@ -138,6 +138,9 @@ static void _rtl_rc_rate_set_series(struct rtl_priv *rtlpriv, ((wireless_mode == WIRELESS_MODE_N_5G) || (wireless_mode == WIRELESS_MODE_N_24G))) rate->flags |= IEEE80211_TX_RC_MCS; + if (sta && sta->vht_cap.vht_supported && + (wireless_mode == WIRELESS_MODE_AC_5G)) + rate->flags |= IEEE80211_TX_RC_VHT_MCS; } } -- 2.1.4