Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp265902rdf; Thu, 2 Nov 2023 22:56:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkTaOhEt+zf2cOJQEvVnqmOOTnZMf9LcinitYDf6pmwyaz7K3Af1JKhs6JynY3lUOMuqYv X-Received: by 2002:ac2:4982:0:b0:509:d86:fb2c with SMTP id f2-20020ac24982000000b005090d86fb2cmr12013456lfl.58.1698990972047; Thu, 02 Nov 2023 22:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698990972; cv=none; d=google.com; s=arc-20160816; b=QVl9lV7GBIwVWYOiVwyIvsHmGaL9ZyZgivT73Bo8a/2xGWRp34usv7nNTTfFN/1Q60 HuDGvTA6yhh273qIzaMG60sFWhtHY7arszgR7XK1D1WhySt1qn1l8v5+iKN6Roy7liGz ihTEjmdVPxKiu9UwtgEmgSZ91AzyIA5PQ7IiJFVNmNA/igchP54jqM7sUXrRbETZANdx iuwg5IloPpFDW5otyiez6VbI2tg7db749KZbvEaq+KdPe1+dUXC2uYCOIzCCjTUkaISh tbNpV5xqpB/DHJ4LFe/xqktg0ygAhcBC9w/c2z8YLQR0IvJcR+3/5Ih2U4FcV1NpfFGv cHLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SS+0CxFlTXhHHVezauyHh5OCKnB6A8gc2DZwzA4C8+A=; fh=Xf8ANyYjy6CW8NxjZZw8fN3pHjD6zKB0E6RaxkEGLI8=; b=FN/GWWOnpY/Cdi8g9Pf267n9TcQuJz1VxPVh5BHnTeMwScqmjjuljyt17U8Hysyn64 U9UGyct7gb9bDeFnso8qmbdoOURpzZMJomFRtnAFo8Ebp4rWYvz0RLgyPmDvuJzJl8gS VMiHit3f0l2RByzTMi/tOJH+YdElIMAZ1t9y8pSmUnblR8JOBVWoZfFJ8gwGHrkMy86p bHOo3MrXtPhtIMF6Pptdfl7cBjelyThFUwsAW7sb7KHh+p2oXYnyDdP56N+uUndip8L3 idmUFoUNVVWbCNV/NL58nQ56tToUflW+Pc2XBoAoqVWK96oHuhelDlbhuuE7r2s1Q+R9 ++AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=saV4Pz94; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id j25-20020a508a99000000b00543c69aa7dbsi556543edj.205.2023.11.02.22.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 22:56:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=saV4Pz94; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 70333819705B; Thu, 2 Nov 2023 22:55:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229807AbjKCFz7 (ORCPT + 52 others); Fri, 3 Nov 2023 01:55:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbjKCFz6 (ORCPT ); Fri, 3 Nov 2023 01:55:58 -0400 Received: from mx4.wp.pl (mx1.wp.pl [212.77.101.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 699C7CA for ; Thu, 2 Nov 2023 22:55:51 -0700 (PDT) Received: (wp-smtpd smtp.wp.pl 11091 invoked from network); 3 Nov 2023 06:55:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1698990948; bh=SS+0CxFlTXhHHVezauyHh5OCKnB6A8gc2DZwzA4C8+A=; h=From:To:Cc:Subject; b=saV4Pz94WRTVNFxhWlf+ZiqQ3ZomKX4+JJrcDSXVkuHRg9i4Zgh0Xfsjb6V3dFXtA 7bNHLm4nwpHzBlSObLQS+K8Sh4Tukiy/Xl4/JXgh5dBvE86KMsMZK4/7H8FLY8kAnE kGs4GQLBRjwcFmvu5SAxX+RWu1nWlAlKctPoczOA= Received: from 89-64-13-175.dynamic.chello.pl (HELO localhost) (stf_xl@wp.pl@[89.64.13.175]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 3 Nov 2023 06:55:47 +0100 Date: Fri, 3 Nov 2023 06:55:47 +0100 From: Stanislaw Gruszka To: Shiji Yang Cc: kvalo@kernel.org, linux-wireless@vger.kernel.org Subject: Re: [PATCH 3/3] wifi: rt2x00: restart beacon queue when hardware reset Message-ID: <20231103055547.GA27419@wp.pl> References: <20231101090710.GB552433@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-WP-MailID: f9b46c954e2705caab55806a4ac53dad X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000000 [ESMU] X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 02 Nov 2023 22:55:58 -0700 (PDT) On Thu, Nov 02, 2023 at 08:36:04PM +0800, Shiji Yang wrote: > On Wed, 1 Nov 2023 10:07:10 +0100, Stanislaw Gruszka wrote: > > >On Sat, Oct 28, 2023 at 08:15:32PM +0800, Shiji Yang wrote: > >> When a hardware reset is triggered, all registers are reset, so all > >> queues are forced to stop in hardware interface. However, mac80211 > >> will not automatically stop the queue. If we don't manually stop the > >> beacon queue, the queue will be deadlocked and unable to start again. > >> This patch fixes the issue where Apple devices cannot connect to the > >> AP after calling ieee80211_restart_hw(). > > > >Should not this be solved in mac80211 then? ieee80211_restart_work > >does a lot o diffrent things, why beconing is not also > >stoped/started there ? > > > >Regards > >Stanislaw > > > > Hi! Thanks for your review. > > I think this issue is a bug of the rt2x00. When restart is called, Yes, I think you have right, this is rt2x00 issue. > mac80211 didn't call rt2x00mac_bss_info_changed() to update the > flag (This may be expected? I'm not sure. But all other Tx/Rx queues > are also manually disabled). And after resetting, > 'bss_conf->enable_beacon' and 'intf->enable_beacon' are still true. > Though mac80211 will call this function and try to enable the beacon > queue again. However, both 'if' and 'else if' blocks will never be > entered anymore because all conditions are false. This patch just > fixes this dead lock. Ok, I see. I don't remember how this supposed to work. I see we do for (i = 0; i < queue->limit; i++) { entry = &queue->entries[i]; clear_bit(ENTRY_BCN_ASSIGNED, &entry->flags); } in rt2800_pre_reset_hw() But I think what should be done there is clear intf->enable_beacon for each interface. Now I don't remember how I tested this, probably only in STA mode. > Maybe Kalle Valo knows if it's a mac80211 bug. This issue has been > here for several years. > > Looking forward to your reply. :-) > By the way, it seems that 'intf_beaconing' variable is useless. Does > it really can be increased to '2'? Maybe in multi ssid mode? Yes. When you can have multiple vif interfaces this variable can be bigger than 1. We advertise support for that for AP and mesh interfaces in rt2x00lib_set_if_combinations(). > } else if (bss_conf->enable_beacon && !intf->enable_beacon) { > rt2x00dev->intf_beaconing++; > intf->enable_beacon = true; > /* > * Upload beacon to the H/W. This is only required on > * USB devices. PCI devices fetch beacons periodically. > */ > if (rt2x00_is_usb(rt2x00dev)) > rt2x00queue_update_beacon(rt2x00dev, vif); Hmm, maybe I also tested on AP USB, but don't remember. Thanks for explanations! Patch is ok for me. Regards Stanislaw