Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1016408lqj; Mon, 3 Jun 2024 07:53:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWBg1cIgfh+uZATnzv0DHsG3GYZv1uSaXSiKEdFzPmEhRLfQuBnFWe6v1y5XJWOX8ED2y3ctuj7SxcdBW1fooL1sC7HKnWNNMjJFTj+6A== X-Google-Smtp-Source: AGHT+IFNXnYj9mpz9SgtK/FmKrSMOqG0UugkFSn4czgarSBtH7UkzQ1AHdGVdAJK1YB1/PLh0HeR X-Received: by 2002:a19:7519:0:b0:520:f419:272b with SMTP id 2adb3069b0e04-52b895608cemr6051701e87.5.1717426405018; Mon, 03 Jun 2024 07:53:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717426404; cv=pass; d=google.com; s=arc-20160816; b=O5CtzXx1vAtEiOWNwTYBS9tveJR6sTTFdg2tPR3eUtznLHm47WaBunuxTuoZKgIzV2 y97MW6pMxXVCwsuqNTGYfvGHGluitWoVX9kqzJKyf5BPY7FwaOM5b21WYTPdtdQ+JMGU zI8KQkQq5+qTXhMqWHbw+XzCAxsc1hua+Rxsobhi4vStWv2QiN7dGVwwtIAfJzRXxNGX ARkmFmcMtfOnMgvPUYyzIG+O2j4M3HwR4pbWSOotd6RNos6y7htVBybzpPGZH0717xGR 3vtMGCZfT9fO673Wi3arHSs1BBcl6vpiIULjixfrXicDXUsXMQ8V4XreuneVje1Dot8R jaLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=L50mzYHAl+broDDdUVPJTzCnMe6cWLR2pEk07R4/mA4=; fh=9xRchJIhDQof/djdUeuX2gjUxKB5bQdO3oixD03IJfM=; b=ARznJWufrBk+LBEURVy5JOK9dv1JPBOPbHCswxjZfsYfNGOlQMWNB1ub05HPxFRXK1 8s854sLxVFiuBAuqP+CM3ch1ny6MPcW1tJ6j16kS8UjUDg+sfgz3kr0yyoLfcFz8Ljm9 9Sjikw6qvlR1R3rtf9dZ1aZNyo2ybE36Kr9fa/J9YOt9yKw+CyUR53xLZcD2EIKKLbHb kwcnc9Naxz5n3Hjik9x7q3SMP1gPVtaZieDtqqRFqR0u6ukO3cxBvZNiNebjKgTQi703 +ekmMr9kPE7UrVcC6uszBk5dimqGXkJvWLZ47sx9RL6iC6HQTi+mkQgU5DbItpJ5vUcz VMvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EjJZr+Vj; 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-8429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8429-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 4fb4d7f45d1cf-57a31b802dasi4100403a12.52.2024.06.03.07.53.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 07:53:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8429-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=EjJZr+Vj; 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-8429-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8429-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 B21B41F22AF5 for ; Mon, 3 Jun 2024 14:53:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F370A12D1F1; Mon, 3 Jun 2024 14:52:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EjJZr+Vj" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 7AE1C12F5A5 for ; Mon, 3 Jun 2024 14:52:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717426367; cv=none; b=ssL0dtLcBhP9ivLQ9AEBdky+OTwjrPKIFQNB5cv2YdGb1PxiTzlVPO90ibAFrDtrftDLUXCuS2Yd+zK8s44BG+8CIRMB//JjAPlJMUp4hfCupWXYmy5Jk1OySpXjzA0sJTlAqR40WJDYwATRrkdNb9kXdl5Tc/usUsnrrolpF34= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717426367; c=relaxed/simple; bh=L50mzYHAl+broDDdUVPJTzCnMe6cWLR2pEk07R4/mA4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tj+Z5rFt/hVpq4rkSFdrywFWHzGUD3pxMiM2FO6BcVvdFPtLWt5u23MWENuemf8dYZuaj7kGbKsFCiF591bfq8uBU+27FDNSpelEqAD+abRT+miJTGM0eAh5G0W2+RO4gDdbZOjtIxC9xRmEbsjSQmKrc17bbPAtZ5hL1T+lI6s= 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=EjJZr+Vj; arc=none smtp.client-ip=209.85.210.179 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-pf1-f179.google.com with SMTP id d2e1a72fcca58-70109d34a16so4037711b3a.2 for ; Mon, 03 Jun 2024 07:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717426366; x=1718031166; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=L50mzYHAl+broDDdUVPJTzCnMe6cWLR2pEk07R4/mA4=; b=EjJZr+Vj9yUTaoeNSqElsB0yCfdohdsa1zmnMmBJ41DcD3abzhS71iLpMeDB4Gk9WO 2otcqFkUZAR6VbcI3qbb177bH+a3xkqNfi0naHVcmyjWhDkToEGaXe78c+rpKzOYRP7q V4Yw8yKmTn8MnYF9XOBuV7t+NiuGdju+3+xGef/214JyGsig+teqCcUL+P0L683nlEeY VDxl7e5BdBvUkwwnWwcQxC4rfh5EMNwQBXEbHmXz4KxrZRexHF0YIDE47FvsxkXZ1tgf Masryez8UA6NbvNtUTs0tU2LrY8kRjoBTgAh7WXXPv3oFDJC27tmAZq4rMgmg+/b3fig 42RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717426366; x=1718031166; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L50mzYHAl+broDDdUVPJTzCnMe6cWLR2pEk07R4/mA4=; b=iZpC8HDUwku2j6oVS/FGYsm1mArMsTmSbd0kRf9xPfjIMyyqJHB2uMLHski5vrRLRl 4lhyQvaDJYQ3a3FvYHzBrWOH4EGwaZeTkD2VsuSRVpLXB8CJ3eiAlZcuMJXO6TG3gfeZ Oiv1Jle5gqyWuFAQ7FZqe+qv+m12hc5KQ1jYduo5I10X3C9p1SL/FEGMlXGTkwAENuNW F/PaFvgUSJKbzs5F2i1Iz9POac+MLQK6lZs1JQnLJWDM84KSGzDSMr/3+Jo+Zu2kahqm 5iG+aNhyUV4YrvyrfxGHk/IqSyDJOX/XgK2B2TWo5KLA7YZokYa0ABRvEUZdmtzfszwq wBew== X-Gm-Message-State: AOJu0Yxoq08XDUdYe7VwjUhL1gX+TEM1EOGLsraO16z4ZTBDQbOW0bvl FhvAVnxrRmpQPOTvTshj4txmD6CvWWLugX/jTyJOhkScwNNFX/qU7lpELh9jbwxd1hHLzgYzxPJ IMqiO9xbKDZtO6pPkJgYZrDlxoRk= X-Received: by 2002:aa7:8890:0:b0:702:2d79:f4e5 with SMTP id d2e1a72fcca58-702477be3bbmr11434555b3a.5.1717426365554; Mon, 03 Jun 2024 07:52:45 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240527173454.459264-1-marcin.slusarz@gmail.com> <9bfc8f01e99b43e485b2afc6ae4fd661@realtek.com> <3cc9cc75468d487c988dbacd8dfc5f57@realtek.com> In-Reply-To: From: =?UTF-8?Q?Marcin_=C5=9Alusarz?= Date: Mon, 3 Jun 2024 16:52:39 +0200 Message-ID: Subject: Re: wifi: rtw88: 8821CU hangs after some number of power-off/on cycles To: Ping-Ke Shih Cc: "linux-wireless@vger.kernel.org" , =?UTF-8?Q?Marcin_=C5=9Alusarz?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable czw., 30 maj 2024 o 05:13 Ping-Ke Shih napisa=C5=82(a)= : > > Marcin =C5=9Alusarz wrote: > > =C5=9Br., 29 maj 2024 o 03:52 Ping-Ke Shih napisa= =C5=82(a): > > > > > > Marcin =C5=9Alusarz wrote: > > > > wt., 28 maj 2024 o 05:52 Ping-Ke Shih napisa= =C5=82(a): > > > > > > > > > > Marcin =C5=9Alusarz wrote: > > > > > > > > > > > > I found out that the reason for those hangs is a power-off+on s= equence that's > > > > > > triggered by the above steps. > > > > > > > > > > To avoid power-off/on sequence once device becomes idle, I would = like to add > > > > > a ips_disabled helper. Please revert your changes and apply my at= tached patch. > > > > > > > > My first attempt was very similar, and it fixed some cases but not = all of them. > > > > > > > > This is due to the existence of a second source of power-offs - rtw= _ops_stop, > > > > which is called, e.g., on downing the interface (ifconfig wlan0 dow= n). > > > > > > Please try attached v2 patch. I would like to have an explicit helper > > > (i.e. always_power_on in v2) to have this fix, so days later people c= an be easy > > > to understand how it works. Not prefer adjusting existing flags to im= plicitly > > > have behavior you want. > > > > So, do you think this is a chip issue, not just some driver misconfigur= ation? > > I asked internal USB WiFi people who say vendor drivers of USB/SDIO can't > power-on/-off frequently but not very sure if hardware issue or driver is= sue. > > > > > I'm asking because if we are going in this direction, there's something > > more to fix... With your v2, very frequently, I hit WARN_ON(!local->sta= rted) in > > ieee80211_rx_napi (in wireless-next, the code was moved to ieee80211_rx= _list). > > > > With my patch, I checked and hit that WARN_ON, too, but very occasional= ly. > > > > I think the difference is in what happens in rtw_ips_enter - I disabled= only > > the power_off, but you also disabled everything else, including the can= celation > > of work_structs. > > > > The warning itself sounds harmless, but I think users should never see = such > > warnings, so this needs to be fixed somehow. Probably some additional > > work_struct(s) need to be canceled? > > > > I forgot to say my patch is compiled test only, and I didn't consider flo= w > too much, just to close the behavior of your patches. You can improve my = patch > to be more reliable to avoid WARN_ON(). Two variants of the patch that fix this issue will follow. They are built on top of yours v2 and my "wifi: rtw88: schedule rx work after everything is set up" from the other thread. Please choose the one you like more :).