From patchwork Sun Feb 5 17:30:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9556249 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 61413602B1 for ; Sun, 5 Feb 2017 17:30:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53BC725F31 for ; Sun, 5 Feb 2017 17:30:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 482BB2654B; Sun, 5 Feb 2017 17:30:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C7B726419 for ; Sun, 5 Feb 2017 17:30:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751845AbdBERaf (ORCPT ); Sun, 5 Feb 2017 12:30:35 -0500 Received: from mail-oi0-f65.google.com ([209.85.218.65]:33345 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbdBERad (ORCPT ); Sun, 5 Feb 2017 12:30:33 -0500 Received: by mail-oi0-f65.google.com with SMTP id j15so4979487oih.0; Sun, 05 Feb 2017 09:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=+RcJ6laafAu8+yORhrc9+KpyD0Fk155x4vbPPlrPXPk=; b=tJNc0K5Y+oofW1ATptDIl8eS/tBqVnczAZo2flmbvhx8iV4qnj+CcOZ4uf2QPltNJf MWV8/+TQKKjWihi/6VFufmtwWAbGroiZXyij+FkWDtrkH2fHoeH6H/UwzK+AFEZBPCOL UupxBu8mPvMCcR8TZSFmz41cgZsnCzaW9QgyzES53+4ooi3toL4nHOBjXQScGXHKvRwv JIJJf3HYbBmeMKx+UqichT/IjHX0gbZkNEPcJdP4A5fiRDfOHNszP95Ot4GvFpDD5Lfz kzekjuuXct7I3W0irsMGSCsdTcPZ7FXXzv4JpqWqUVk6wKP81Aat/MzD+16asxMev61f cl/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to; bh=+RcJ6laafAu8+yORhrc9+KpyD0Fk155x4vbPPlrPXPk=; b=UNlf3Xd7VRa78nWWjFHHFB7HHSi5dcrdYdjAhcE1EIFe7Nxoa1+ovQtqMdvSDo7Drd MqsYqBhvnMjyIHgWcAtLrUwmQuIv8iRKo2yFlEGf2bGJgelmNUmyY0DYD4nZT/+hS/2F 1ft07BTs2bkXeXFZ0w85STp7PxEzz4ralA7nf67EQ2agnePUd+c8zSYL3glYwSsj1/rt fOPMHveHVC05Iahaws13wS8xIeR+bR+IU9X0BZI79DM79umETavGOPjmC/5/ipO4SaG7 nsr2ZauTAEb1+Qh1eFTkMMNiVILwnEyXBmGfE9poh7x8OJ+r7hQ54emgnigPwCku0k33 Uhag== X-Gm-Message-State: AMke39nUakt7AkgloiBn1QXlVVudvm3PEYQVrwuvEMtmIOsBZU7UIx3xY1NFOJDK2iQ4bg== X-Received: by 10.202.239.135 with SMTP id n129mr3403444oih.11.1486315832415; Sun, 05 Feb 2017 09:30:32 -0800 (PST) Received: from linux-4v1g.suse (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id m33sm17942734otd.11.2017.02.05.09.30.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Feb 2017 09:30:31 -0800 (PST) Subject: Re: rtlwifi: rtl8192c_common: "BUG: KASAN: slab-out-of-bounds" To: Dmitry Osipenko References: <3f1ad9bc-c065-4f1f-be78-70c0702867b4@lwfinger.net> <03153d2a-abfd-78b4-4365-b80ec718e3e1@gmail.com> Cc: linux-wireless@vger.kernel.org, Linux Kernel Mailing List From: Larry Finger Message-ID: <92f6dcb7-bbee-533a-7d49-21670286a3f3@lwfinger.net> Date: Sun, 5 Feb 2017 11:30:30 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <03153d2a-abfd-78b4-4365-b80ec718e3e1@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 02/05/2017 05:34 AM, Dmitry Osipenko wrote: > BTW, I have an issue with the 8192cu: WiFi stops to work after a while (3-15 > minutes) if I enable WMM QoS on the AP. There is nothing suspicious in KMSG, > connection is up but no packets go in/out. I tried to enable debug messages in > the driver, so when the WiFi stops to work I see that some "temperature/led" > notify still going on in the driver, but nothing happens when I try to initiate > a transfer (say to open a web page) - the log is silent, like the requests are > getting stuck/dropped somewhere before reaching the driver. Is it a known issue? > With the QoS disabled everything works hunky-dory, however I get 2x-4x faster > download speed with QoS enabled (while it works.) > > I noticed that rtl92c_init_edca_param() isn't wired in the driver, so I suppose > the QoS isn't implemented yet, right? > > If it is an expected behaviour, I think at least printing a warning message in > the KMSG like "QoS unimplemented, you may expect problems" should be good enough > to avoid confusion. As you have already seen, I decided to defer the more invasive patch. When backporting to stable, the smaller the change the better. I have no knowledge of the internals of the RTL8192CU chip. As a result, the kinds of changes I can make are limited. I do know that the chip does implement QoS. I also noticed that the set_qos() callback routine was very different in rtl8192ce than in rtl8192cu. Attached is an untested patch to make the CU routine look like the CE version. Please see if it makes a difference. Driver rtl8192cu has never been maintained by Realtek, and it will likely be removed from the kernel in the next few cycles. As you are running a new kernel, I would recommend rtl8xxxu instead. That driver has high reliability, and the speed is improving. Your other option would be a driver offered by the vendor of your particular device. Realtek used to have these drivers on their web site, but they now seem to have been removed. If your vendor does not have a driver, http://www.edimax.com/edimax/mw/cufiles/files/download/Driver_Utility/transfer/Wireless/NIC/EW-7811Un/EW-7811Un_Linux_driver_v1.0.0.5.zip should work. Larry diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c index 1b124ea..1fcf570 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/mac.c @@ -387,7 +387,23 @@ void rtl92c_set_qos(struct ieee80211_hw *hw, int aci) struct rtl_priv *rtlpriv = rtl_priv(hw); rtl92c_dm_init_edca_turbo(hw); - rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AC_PARAM, (u8 *)&aci); + switch (aci) { + case AC1_BK: + rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, 0xa44f); + break; + case AC0_BE: + /* rtl_write_dword(rtlpriv, REG_EDCA_BE_PARAM, u4b_ac_param); */ + break; + case AC2_VI: + rtl_write_dword(rtlpriv, REG_EDCA_VI_PARAM, 0x5e4322); + break; + case AC3_VO: + rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222); + break; + default: + WARN_ONCE(true, "rtl8192ce: invalid aci: %d !\n", aci); + break; + } } void rtl92c_init_driver_info_size(struct ieee80211_hw *hw, u8 size)