Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp411263imm; Thu, 5 Jul 2018 02:28:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf64qEDerwG8UAqhIEOTjwt1v2APbMnB0s5mrxrYkeiTkcUs81RYbXEOemwKYEz4oal6xgv X-Received: by 2002:a63:3444:: with SMTP id b65-v6mr4815362pga.396.1530782905102; Thu, 05 Jul 2018 02:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530782905; cv=none; d=google.com; s=arc-20160816; b=pHq+mddNAXLxi3waRGWkqWGui/QCxJicKnji4Yjo3I1PvDJcJET10A5FGIjM8Cujae 598Z50zUk7Ty+SBgl4p/hzMMF6NaLwhq21E9h728/2okCRO9PYqJr+Y6br6YwWER/nKU 9nucm1yfBMpEwHJ9wyxI/l+jtWvQCYzzdvC7xOfdhPqviPTTzpFr8mBps7CeV923Ius/ oiYQhYIQMgaFmMEi13nGUGxNO8mZA7Qq4TsU/bka7DwXe15Ldn2vK0X9/pzePXhVi/TZ 3L6h8fgYjd1wiGMZk3rsPnXhHYSI6dZ6UIp2hqTYbHtcggTii2Z/hTEp/j49aWCWeNvY XSqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=iYGC+RgXN5Gc5wQm/QP5qWotMEwC1/WViQXLpQzrUg8=; b=h5gRgPcUSdGM85dn29JYVnTguOlkKc3K0HaGx+J3c4wnWiqz/fF02oiaPHYeCrQGPu 2mLxWB7TXL9OA5FfNkLbJMlCOfF4eB0ftbx/sp0jWmnvv70g29dBMq4Uav30MpyWI3Ud uxSZzLqhN1cCBIf2cn3gR1DFdcPp35hGUPqt2k8qVEvzezi61RI4b8He7drhv76YKo2L axay0L20+OGt+Uf2zXa7eCGZxdqsBjyUesEqX2KHH3blVgUBQL+2IHqhQpit1todVDD4 L4vbOM+3YV0noMW/EyFBNXw0M3IXksJd+UsDj/RaCNbAdiA2XYR8OOEU0JzOVUmDsvx6 SKxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=yc8QFZGv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m26-v6si5443730pgb.91.2018.07.05.02.28.10; Thu, 05 Jul 2018 02:28:25 -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=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=yc8QFZGv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753493AbeGEJ0c (ORCPT + 99 others); Thu, 5 Jul 2018 05:26:32 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:45170 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753372AbeGEJ03 (ORCPT ); Thu, 5 Jul 2018 05:26:29 -0400 Received: by mail-io0-f193.google.com with SMTP id l25-v6so7120198ioh.12 for ; Thu, 05 Jul 2018 02:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=iYGC+RgXN5Gc5wQm/QP5qWotMEwC1/WViQXLpQzrUg8=; b=yc8QFZGvJHkBp7FpTxft03c1gVE3k4xl6tLZpbYprwqKRPVsEsUNTGL+d5J6M6f9N1 ScCXUEv4h6Mv9JCyeGylmilIQVtEo5y8LgHdFIXuiLB64HtZSCoUp3wLrx9irSK+IQdo BOUjSn/R1IP3hSi5yVhjZxDk1SUCQC5i/WdjCUtXnKJOXIr6ivbhFiBaNKogcAi6HxB2 REOo7EYKAEwbBkews5TDN7lSDmgdak0XbY29l4o3hPxlRIlkJfZM5NnBA05kg5abh+/d qFGTCm6Ck27iLRZgEm5qjVtmb/YCV9Gm4C0kzD3RaKdaxSKoLYDH8GgyJ0dpRqbSi9UN ihdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iYGC+RgXN5Gc5wQm/QP5qWotMEwC1/WViQXLpQzrUg8=; b=QXaPAjtyaiUzT9tGMFQ/sk/M0+S6HFNQRWNzZGAUAGNTq1Mn5ltVE2rR71MlM+nyLk dcWD8S938v2tZxUzLt46eVa1i8J/g7NgRxTjX8kvRNLvVqqKZxN+nZXmwwM8PPrH/aQh 7p0vOirMHSfyqXCp1hEfOUwfhr/9Y+3RhudZ4q3gVNV1O9kFZ6Ny3V1JdNgUzLROYJHQ vlQcNdsbQ5S/+hdxpjv5aErPDQGDmWFU1/J9aEINB3nkuVfJWv7r6wH/RBj3lw/KNCOk +6hWEYbNmSZHLcmF07XaebvwaQNqrGdLqkx+T+vG6DqlzA3ryZK/jkqZ6Fc5P/90wwtH BQkQ== X-Gm-Message-State: APt69E20cYDd8ljP85x7MdSX/dda63MLd3sChhd47IljYTQ1KbK3T7Av T7nB7TIMa6TdFSbyEsm3HMc6SZXKRdz9uyB4zmLIuw== X-Received: by 2002:a6b:3a89:: with SMTP id h131-v6mr4036890ioa.263.1530782788785; Thu, 05 Jul 2018 02:26:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:7391:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 02:26:28 -0700 (PDT) In-Reply-To: <1530776154.4156.12.camel@realtek.com> References: <20180704140933.3dk2ylbntltz6jqd@mwanda> <7e95bd6a-97bc-b030-26ce-83da66e5f279@lwfinger.net> <1530776154.4156.12.camel@realtek.com> From: Jian-Hong Pan Date: Thu, 5 Jul 2018 17:26:28 +0800 Message-ID: Subject: Re: [BUG] staging: r8822be: RTL8822be can't find any wireless AP To: Pkshih Cc: "Larry.Finger@lwfinger.net" , "drake@endlessm.com" , Shaofu , "linux-kernel@vger.kernel.org" , "dan.carpenter@oracle.com" , "colin.king@canonical.com" , "devel@driverdev.osuosl.org" , Birming Chiu , "kvalo@codeaurora.org" , "frank@generalsoftwareinc.com" , "gregkh@linuxfoundation.org" , "linux@endlessm.com" , Steven Ting , Tony Chuang , "arnd@arndb.de" , "sgruszka@redhat.com" , "linux-wireless@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-07-05 15:36 GMT+08:00 Pkshih : > On Wed, 2018-07-04 at 10:33 -0500, Daniel Drake wrote: >> On Wed, Jul 4, 2018 at 10:13 AM, Larry Finger wrote: >> > We will have to agree to disagree. >> > >> > I have no idea what the vendors are doing that cause some motherboards to >> > need a different aspm value. What I do know is that we have had to live with >> > the idiocy of some vendors saving a few pennies by only including a single >> > antenna, rather than two, and then making a problem by miscoding the EFUSE >> > bit that indicates which connector is actually in use. As we have no means >> > that I know about to detect which boxes have the problem, a module parameter >> > was created, just as in this case. >> > >> > I agree that drivers should work "out of the box", but finite resources and >> > lack of vendor cooperation make this a goal that may not be attainable. >> >> As you touched on, the ideal situation is that Realtek solve the >> issue. Ping-Ke Shih is on CC and I am adding a few more contacts from >> the commit log. The context is that the r8822 driver fails on several >> platforms unless setting aspm=0 (the default is 1). > > It's hard to have all laptop or motherboards and all rtl8822be modules in my side, > so what I can do is to analyze the issue when user encountered. > >> >> https://gist.github.com/dsd/20c05f0c6d66ee2ef9bfbb17f93f18ba >> https://bugzilla.kernel.org/show_bug.cgi?id=199651 >> >> >> If we don't get a timely fix from Realtek though, I think there is a >> key difference between the antenna selection headache and this one. In >> the antenna case, there isn't a good value that you can set that will >> work on all systems. If you change the default behaviour you will >> solve the issue for some users while simultanously introducing the >> problem on other systems that were previously fine. >> >> However in this case, it's highly likely that setting aspm=0 (off) by >> default would work for everyone. It has the disadvantage of using a >> bit more power, but especially with the indications that this issue >> affects a significant number of systems, I think that having the >> driver working out of the box everywhere is more important. The module >> parameter can be left in place so that unaffected users that want to >> save power can set aspm=1. >> > > I think this issue may be due to L1 latency, so below patch would be > helpful but not sure because I don't have the same laptop. > Is there anyone can help to test? I do not know why I cannot apply this patch directly. So, I apply each line manually. However, here is a good news. I tested this fix, and it works correctly on ASUS X530UN. System can scan and get the access points list. Finally, it also connects to the access point. Maybe, you can have a formal patch for this. Thanks, Jian-Hong Pan > > diff --git a/drivers/staging/rtlwifi/rtl8822be/hw.c b/drivers/staging/rtlwifi/rtl8822be/hw.c > index 7947edb239a1..88ba5b2fea6a 100644 > --- a/drivers/staging/rtlwifi/rtl8822be/hw.c > +++ b/drivers/staging/rtlwifi/rtl8822be/hw.c > @@ -803,7 +803,7 @@ static void _rtl8822be_enable_aspm_back_door(struct ieee80211_hw *hw) > return; > > pci_read_config_byte(rtlpci->pdev, 0x70f, &tmp); > - pci_write_config_byte(rtlpci->pdev, 0x70f, tmp | BIT(7)); > + pci_write_config_byte(rtlpci->pdev, 0x70f, tmp | ASPM_L1_LATENCY << 3); > > pci_read_config_byte(rtlpci->pdev, 0x719, &tmp); > pci_write_config_byte(rtlpci->pdev, 0x719, tmp | BIT(3) | BIT(4)); > diff --git a/drivers/staging/rtlwifi/wifi.h b/drivers/staging/rtlwifi/wifi.h > index 012fb618840b..a45f0eb69d3f 100644 > --- a/drivers/staging/rtlwifi/wifi.h > +++ b/drivers/staging/rtlwifi/wifi.h > @@ -88,6 +88,7 @@ > #define RTL_USB_MAX_RX_COUNT 100 > #define QBSS_LOAD_SIZE 5 > #define MAX_WMMELE_LENGTH 64 > +#define ASPM_L1_LATENCY 7 > > #define TOTAL_CAM_ENTRY 32 > > > --- > PK >