Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1880684rbb; Tue, 27 Feb 2024 04:25:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW7PAyNqUZjB+guLBVcw1HzqilFQMuR/+bk3hVcf/zLKENCZOjFHTFVc7tCpT+7wnFbL5Cfdn6X9eAMPBHEb633Ux/uoHJMHmhNHUhTdA== X-Google-Smtp-Source: AGHT+IGA1ObuIei435H0L+F1KRDdWO/v/vEUaCEtEsiIMHK36MBN0p2hcF0shR8rqqZjkxe0WX5Y X-Received: by 2002:a17:906:ca5b:b0:a3f:29c:c8fa with SMTP id jx27-20020a170906ca5b00b00a3f029cc8famr7016408ejb.66.1709036717730; Tue, 27 Feb 2024 04:25:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709036717; cv=pass; d=google.com; s=arc-20160816; b=nRpugBn5VRlamlebj34JO9LBUE+ybwMvsmfwr254dB7IyiQabb3mMw3KIdXITREFmM 0wUYWMZ4VfbPSEa+IfSJq/EqvrkL5VJ6r8LmLS+10XywUExcBztZZXoKbzOagP++QWzk RUbhnb4PXqUjBMzx3n2DGQXuJdN7S5kbt8Ayt+44ULQbn/QiwT3cIrWsCep6TWJh5A5Z MSqmmT9oskntsmAEYJ4iCoohJvKAyMBRZHQO9Vcu5zNzyDLE0/ynwow8ctrADkZfIAxA fl0NjFqzI62dcY4kgWLmu1HkPjd+OXFYWCD6kS3cb0TZVYURm4Y0lfrdJH7RjYPazj+D 7AUA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=E/wiSc2z1aN/zk1ViOrhWJAnNttJ2qgcDzL0//7StTs=; fh=W9u7LD1eSKmMk2q+qTuerfw0q38uetajqeZJcQPgeZI=; b=eLiKwsITC+lRJKgAuz5dbvRx8kO1/Xg3Z4MaKVsK5bjz80EgHOlYANlugVl67luLQN KrIgK2VLCLKHdBzeONyLfUBZ+m7qY63An0lL5HLhELnMV/SPkIIJIgK8GiKDJmK9Xk7x bIQU9hS/wxfuD/POVeE84wyNzaXw3sfSG5U9m7x3mKrfi2tOE8bvJCI31WKifBkutNkc yLIy0HscDpkn/fFSX4ZfekFcKeJZSMkgiJ78sIlss6eMAeKokBBuxiExPWGYlloOxxic G39me4ti9w23oJv1Lq0Z3nQ2oXDdhdAR8q4ke0V62eX3xYw5xma8KOJ33dTyHYEIz9fu HjlQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=c77viuDl; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-4083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z13-20020a170906270d00b00a3ec1f042d1si677616ejc.389.2024.02.27.04.25.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 04:25:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=c77viuDl; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-4083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CFDDA1F2637A for ; Tue, 27 Feb 2024 12:22:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 239891420C9; Tue, 27 Feb 2024 12:19:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c77viuDl" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 587F0145B3D for ; Tue, 27 Feb 2024 12:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709036362; cv=none; b=e3Mj6OmIYsRNgcpRZ2Hai+d1CTs9IOmFxAyEfpOi+oVeMv8l2+hr1TPG8xRu9Cf1D+1lo6hkIHi5bztXZlRijBNOw7Zg/4s20HUs9QB66EPiHXpf7q+Y7gnzfaoHEGX90XSi8RVqv/ZVshUnXH2+IIEF3MovFhIOaJbHKb2UJxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709036362; c=relaxed/simple; bh=BuQblpNofFIXtFSoVAR2IqO+QKBFrm+5UqSx6NOMM7I=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=jqRznN4l2FfDP7kk2aA91gV6XXEw2AACw2IKXezt+w7x8d3+rYxvoAtUE+uOJb5uM9/T/braPn/hqpkx70CvkRg2+o6FvblfmiQW1gWRzCEPDw8GmvXLJsFSbJwdov7MHG+t2FUcdv39EGqX3ye69xLKPrtjVTYmRc+5l+3iOyY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=c77viuDl; arc=none smtp.client-ip=209.85.167.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f43.google.com with SMTP id 2adb3069b0e04-513031ce058so1237590e87.1 for ; Tue, 27 Feb 2024 04:19:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709036358; x=1709641158; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=E/wiSc2z1aN/zk1ViOrhWJAnNttJ2qgcDzL0//7StTs=; b=c77viuDlynL2FWQc9R03/OMO81p+hZM5cBZNrU2PbjyMSNPeexAYrbDonX/1F/g1Cw 8ZBvIziNRpate/n/dJ714vlPyg/BbTcGldViE7Ynn1cWKBHvqCYKxKMgJgr9Ho7XCeNh 5v8hOOBs67g9fRWMB/VuBPnyF2JE+ajua0CAgbK7qtB0QBrC3dVtvxGGihkFcxrpKixm pRXwRqtGMZ1NRsoMwK9fUzGKA90sXhWX4WoY3pDcMxxLSkcn/qB7XFi3PhDhjYZ5xT+G ObcCqN5efF5cVG/sXDmFJkmo+qILX077cyCom6L+AvO0M0LicEw6gRpGG40reTLV5evi NFcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709036358; x=1709641158; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E/wiSc2z1aN/zk1ViOrhWJAnNttJ2qgcDzL0//7StTs=; b=rNkBBGWlVepJtj+TwxO7rRVp2NhMEBDyB0Vpmcy0/hVh/Uz9pcuIUmQ+CnsI+vTS2L kzGH247E4BuS8jNJCeXZYprpIIwBH7Sd9d3pSY8bHZWjVNt8AfkW8n9wpMfMRCznUe3Z nujtRHS0o9kqY1/AFrQmr8cA3Mhp97gCkN4+eATETsm9sughHopdA8VnKFb8xEAO95LJ k5sDfzg+CAplrN1qZUFeUxuWKjLwliwTswb2empBQ02Jcl6S7v8gtFzWklNxQXET+RQL FCmaC1DyQANRqKMGwTGc6BT7sMXW9PLotWd1Y+5Fd0zO3CnrJqbUjFIW17x5kc0MJlkG izuQ== X-Gm-Message-State: AOJu0Yx19AHI4/v8J8vtKf0V/bw0CtCfIxo02rqIEosxNZ+T/5hIZlXG zvNsseLYjhBM3OSPyJdzxGR260IDqUHPGxs9ccKD1yGW24Yb3WmF521sqP8C X-Received: by 2002:ac2:4204:0:b0:513:1169:af0a with SMTP id y4-20020ac24204000000b005131169af0amr609229lfh.11.1709036358262; Tue, 27 Feb 2024 04:19:18 -0800 (PST) Received: from [192.168.1.50] ([79.119.240.211]) by smtp.gmail.com with ESMTPSA id dj16-20020a05640231b000b00566317ad834sm681406edb.49.2024.02.27.04.19.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Feb 2024 04:19:17 -0800 (PST) Message-ID: <8770f25c-1dcb-48c6-9279-cd6de158dfec@gmail.com> Date: Tue, 27 Feb 2024 14:19:17 +0200 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Bitterblue Smith Subject: [PATCH 2/4] wifi: rtw88: 8821cu: Fix connection failure To: "linux-wireless@vger.kernel.org" Cc: Ping-Ke Shih , Sascha Hauer References: <909d9f75-44cd-4710-9d3f-56691fd58090@gmail.com> Content-Language: en-US In-Reply-To: <909d9f75-44cd-4710-9d3f-56691fd58090@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Clear bit 8 of REG_SYS_STATUS1 after MAC power on. Without this, some RTL8821CU and RTL8811CU cannot connect to any network: Feb 19 13:33:11 ideapad2 kernel: wlp3s0f3u2: send auth to 90:55:de:__:__:__ (try 1/3) Feb 19 13:33:13 ideapad2 kernel: wlp3s0f3u2: send auth to 90:55:de:__:__:__ (try 2/3) Feb 19 13:33:14 ideapad2 kernel: wlp3s0f3u2: send auth to 90:55:de:__:__:__ (try 3/3) Feb 19 13:33:15 ideapad2 kernel: wlp3s0f3u2: authentication with 90:55:de:__:__:__ timed out The RTL8822CU and RTL8822BU out-of-tree drivers do this as well, so do it for all three types of chips. Tested with RTL8811CU (Tenda U9 V2.0). Signed-off-by: Bitterblue Smith --- drivers/net/wireless/realtek/rtw88/mac.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c index 298663b03580..a3b2c57c5503 100644 --- a/drivers/net/wireless/realtek/rtw88/mac.c +++ b/drivers/net/wireless/realtek/rtw88/mac.c @@ -309,6 +309,14 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on) pwr_seq = pwr_on ? chip->pwr_on_seq : chip->pwr_off_seq; ret = rtw_pwr_seq_parser(rtwdev, pwr_seq); + if (pwr_seq == chip->pwr_on_seq && + rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB) { + if (chip->id == RTW_CHIP_TYPE_8822C || + chip->id == RTW_CHIP_TYPE_8822B || + chip->id == RTW_CHIP_TYPE_8821C) + rtw_write8_clr(rtwdev, REG_SYS_STATUS1 + 1, BIT(0)); + } + if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_SDIO) rtw_write32(rtwdev, REG_SDIO_HIMR, imr); -- 2.43.2