Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2038956imm; Mon, 16 Jul 2018 00:39:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpct+D2PLI83G8Us/e2q14e95lLnGJCKqFzRIoVLCIPGtia/9qnh4daMR15GeMr0rIfu2ewT X-Received: by 2002:a63:d10c:: with SMTP id k12-v6mr14839222pgg.49.1531726783621; Mon, 16 Jul 2018 00:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726783; cv=none; d=google.com; s=arc-20160816; b=0ZJQjm9GbeVjh23QJdB70XlMna/9DntuWTH7/NYFn2BHUZMFa6sWGaan/Mk4FbC3SY hRVA1O5mNm70AO0dfkzq4/ygRnL4MkQIdIiode9IsBdfQ8pJUJH0sU1/10ii82FEvVOV Fm9Qkw/9/om4EPBjIUZ0jYwbDmp/q/XfAlIkreNPYQLYkj8ZINGfw25q5lLPB4RV/DNk Jn/JSIq1PlQ0uiQnGi3TjutGh8lOHKmvHBiOWMvVy+KJ6zsffKN6Qp3p7GA3fRRLfVn3 VAz3snnO33q6zzb0E9Q85my3b5kGFFduR6GnhLbK14z+k1cpTW0ETsUCV+NtCNNg/F72 ywMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=AbLxufhBN3HemJfsIMCfZ0DA2Lx+BQboQDQZ2hcG9+Q=; b=z0Yl1y6DsXd//jMM+NBIoI+uT9ZjkmMc2eoDSDn4r01XFZM2b4xfl5FyPwpzrk6sx2 NexL7Etg8Mkbn+P7TJlHxsNruJQt1WuO5JSq0rnBl3kLUhtCJr5Qaeak4H95ZjL1Do+f gZm5LwS/98Mh9hwddBUuKaiJXy8wn8NPCmwkhMiufWOaW/JzvdjyhvLuCYlEfiTDwh3m c5mu12RR/dQJEa/QtFfUGZ9Bmtkm2ZKg9GSjuJY9OTYiTTo80zcrtpZjka2ub7OdlE2v msuSXa8Mu+Aofh2W4zabRbXv43YZYsqqIXoaJDQe7NXyFMvejWX69E/7KHnNrKJPpwIs 1eWw== ARC-Authentication-Results: i=1; mx.google.com; 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 q9-v6si21108833pgc.685.2018.07.16.00.39.28; Mon, 16 Jul 2018 00:39:43 -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; 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 S1731713AbeGPIDe (ORCPT + 99 others); Mon, 16 Jul 2018 04:03:34 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46724 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731618AbeGPIDd (ORCPT ); Mon, 16 Jul 2018 04:03:33 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 120D4C03; Mon, 16 Jul 2018 07:37:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian-Hong Pan , Ping-Ke Shih Subject: [PATCH 4.17 14/67] staging: r8822be: Fix RTL8822be cant find any wireless AP Date: Mon, 16 Jul 2018 09:34:43 +0200 Message-Id: <20180716073445.248021389@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ping-Ke Shih commit d59d2f9995d28974877750f429e821324bd603c7 upstream. RTL8822be can't bring up properly on ASUS X530UN, and dmesg says: [ 8.591333] r8822be: module is from the staging directory, the quality is unknown, you have been warned. [ 8.593122] r8822be 0000:02:00.0: enabling device (0000 -> 0003) [ 8.669163] r8822be: Using firmware rtlwifi/rtl8822befw.bin [ 9.289939] r8822be: rtlwifi: wireless switch is on [ 10.056426] r8822be 0000:02:00.0 wlp2s0: renamed from wlan0 ... [ 11.952534] r8822be: halmac_init_hal failed [ 11.955933] r8822be: halmac_init_hal failed [ 11.956227] r8822be: halmac_init_hal failed [ 22.007942] r8822be: halmac_init_hal failed Jian-Hong reported it works if turn off ASPM with module parameter aspm=0. In order to fix this problem kindly, this commit don't turn off aspm but enlarge ASPM L1 latency to 7. Reported-by: Jian-Hong Pan Tested-by: Jian-Hong Pan Signed-off-by: Ping-Ke Shih Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtlwifi/rtl8822be/hw.c | 2 +- drivers/staging/rtlwifi/wifi.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) --- a/drivers/staging/rtlwifi/rtl8822be/hw.c +++ b/drivers/staging/rtlwifi/rtl8822be/hw.c @@ -814,7 +814,7 @@ static void _rtl8822be_enable_aspm_back_ 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)); --- a/drivers/staging/rtlwifi/wifi.h +++ b/drivers/staging/rtlwifi/wifi.h @@ -99,6 +99,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