Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11818308pjo; Thu, 2 Jan 2020 14:49:35 -0800 (PST) X-Google-Smtp-Source: APXvYqyv46leRF1dOUGr0Tw0Cvxlgxs4vICXdt792HwC9mu6Qh6zNopbldTESGavFQR/fhZJJas/ X-Received: by 2002:a9d:7757:: with SMTP id t23mr98702059otl.315.1578005375365; Thu, 02 Jan 2020 14:49:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005375; cv=none; d=google.com; s=arc-20160816; b=Qra8z+ryGE6KWFESxoOv4c+/bjwLksj/AgUY85MugTss8XmujnN/db3QCVySQzS58x 3ssudL04vxKosaGN3dnierojYOroBJ5OVLQWR5eSxvnAc6YLMEA3z9G7/4zhgi8+mMls BT+RKTOnZeABtCAGO5+YluC/T7AhE4M1MU/cS+kctD4u7eTTNuS6zkB6wCSizyk9gJgs l41H1+l6JcoKeZfMXGchq/G25PlNMptrvJIR9A9C+SG0RCjG1dSBSyoxvPa/D1AEfMAV zNiFtj+wV7jL7E2MUISkmf7IrYMxi9zmsuGztJZrVZL/7aIYG0dp2Nc+pcLvMHr8ctlN UjVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rbJG8EGZqABl/iTw5ymxpc3LmNaGOMLkalaNtZCxZ+0=; b=P5rPHfbCdrNjUWIkVh5+dWUlIM2pdHzMzUVu/tBdiFOcCBFXUxV5+aPnGxLz5k1Ift gX37RunmS1Dq81TDRWYMQPi60wap6U/whnh2kVUQ/TVXIER0HxWLNFGQSjgIwYFNvsKQ EdjcbOoT3NqHdIvoALwHuaxPzzHN+m2q90My1t/Y3nvC3HEXm886kgrmFw/G9BEozT9U bQoDByluGCeHcJAnn53NtdHuz/aGSFYmbCfNmBqqAbjtL/+2A/KguAbZbRvxN3+7+7wV njpVUM2VaN8hpI5V8chqKOgo6Ovx/AldeWBEglLbM3HLP2KpqqIDEnxX2szxdUpeQymH Wg2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R1Jwp2JK; 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 p5si16716323otl.13.2020.01.02.14.49.23; Thu, 02 Jan 2020 14:49:35 -0800 (PST) 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=@kernel.org header.s=default header.b=R1Jwp2JK; 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 S1729990AbgABWsT (ORCPT + 99 others); Thu, 2 Jan 2020 17:48:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:58274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729867AbgABW22 (ORCPT ); Thu, 2 Jan 2020 17:28:28 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8A4A021835; Thu, 2 Jan 2020 22:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004108; bh=gn4Dwm6ilXM8y8DJXcystWpVTJVTceOPjVD5ByPFPKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R1Jwp2JKhzDxciNB4qnWPmtlTb307hUWRGZXhLEm0R9qrQNs45Zs/Yqpo+OBgettb OuNix1qQW+rN9jZSGKkLG07CnA9Xceszp8aZARfHZjcnv58ulnZz5P9WiIYtltgiNZ 4wAMo3sO/V/gyG+e/XfYadmwggCqTkFFq84aF+YU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Chiu , Jes Sorensen , Kalle Valo , Sasha Levin Subject: [PATCH 4.9 040/171] rtl8xxxu: fix RTL8723BU connection failure issue after warm reboot Date: Thu, 2 Jan 2020 23:06:11 +0100 Message-Id: <20200102220552.562528125@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.960200039@linuxfoundation.org> References: <20200102220546.960200039@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Chiu [ Upstream commit 0eeb91ade90ce06d2fa1e2fcb55e3316b64c203c ] The RTL8723BU has problems connecting to AP after each warm reboot. Sometimes it returns no scan result, and in most cases, it fails the authentication for unknown reason. However, it works totally fine after cold reboot. Compare the value of register SYS_CR and SYS_CLK_MAC_CLK_ENABLE for cold reboot and warm reboot, the registers imply that the MAC is already powered and thus some procedures are skipped during driver initialization. Double checked the vendor driver, it reads the SYS_CR and SYS_CLK_MAC_CLK_ENABLE also but doesn't skip any during initialization based on them. This commit only tells the RTL8723BU to do full initialization without checking MAC status. Signed-off-by: Chris Chiu Signed-off-by: Jes Sorensen Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 + drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 1 + drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h index 08d587a342d3..9143b173935d 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h @@ -1348,6 +1348,7 @@ struct rtl8xxxu_fileops { u8 has_s0s1:1; u8 has_tx_report:1; u8 gen2_thermal_meter:1; + u8 needs_full_init:1; u32 adda_1t_init; u32 adda_1t_path_on; u32 adda_2t_path_on_a; diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c index 02b8ddd98a95..f51ee88d692b 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c @@ -1673,6 +1673,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops = { .has_s0s1 = 1, .has_tx_report = 1, .gen2_thermal_meter = 1, + .needs_full_init = 1, .adda_1t_init = 0x01c00014, .adda_1t_path_on = 0x01c00014, .adda_2t_path_on_a = 0x01c00014, diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index e78545d4add3..6d34d442294a 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -3905,6 +3905,9 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw) else macpower = true; + if (fops->needs_full_init) + macpower = false; + ret = fops->power_on(priv); if (ret < 0) { dev_warn(dev, "%s: Failed power on\n", __func__); -- 2.20.1