Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6238942iob; Tue, 10 May 2022 13:40:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzODdQKtSmX9bgfHlq0vovOm6sOt6crWqU9k/RT31hWVX+TpJ/j21SXp+tJuBXf4r1B853Z X-Received: by 2002:a50:ee85:0:b0:428:2648:bc1f with SMTP id f5-20020a50ee85000000b004282648bc1fmr25014104edr.183.1652215220920; Tue, 10 May 2022 13:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652215220; cv=none; d=google.com; s=arc-20160816; b=RXpisLNrvK8rropLT9DmYepmi6F9FhkEegQGxng8O28uWE+mjGRtcJXuFVBp/YwqkR dvEbl1MkmzaijyOIYFTtVp6uf7MjSyKXRWMVsN3RHdIbDe/R/MGYDTK60y3qM+QDdPor LNOIuNiickahu5KVm2Z2Vxinpo8akSdSZK8uKgEy6hIkY6STiNRBF7BN4ym3hZ3aHohv i5G+TGWuHcXNVUc2Ld7xCjo1eOp3OUZ1ZeO12G+bBg5ESWcI46ZPxIPb/ubI46/iTm/i eSYtUlwI0MiyQwGaRNezzO9lAj0bCFtFRukB34YEZtUEeTMV0lhDR9P8gEztqHM8ZpgW g2mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id :dkim-signature; bh=K3OSba5esavcG+b77SPhzMiMQ7qM3cVFxkSq6HFhFF0=; b=uZBGkYh559N9Ix7QeIoKXm0/IuQKL0ZtwiQ4G3oJIvpFaxVABDjYnGugCxuCdKuX9Q tU0YaugV4ei+NmLM5OmHA8LKVkdheYDbvdu7FgPeZNSJg1FJV27pkt1jt2E1zsk8Ui14 WfXFp0FYMhIqwXn6S3C/wPttnfyb3rWVbWgUzbJY/yVjrscr7RQVDJcQ0ctyAcSOSnsW Xot+khIC7WvxgwhpMY09gyhVNehVXbkyziuG1wUtsjRlLEbv2Rt0mUA9nvetcQtStcGY M3wtLzlhcj3sRK3+eTkVVNz0lCtfBZ1D+KHg7qm6J0kzn4P9J8UKB64kk5k0vw8sHuDq DhQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=mfoKsOAo; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v13-20020a056402348d00b00425ffd41889si348518edc.20.2022.05.10.13.39.57; Tue, 10 May 2022 13:40:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=mfoKsOAo; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242300AbiEJPHg (ORCPT + 69 others); Tue, 10 May 2022 11:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345593AbiEJPGA (ORCPT ); Tue, 10 May 2022 11:06:00 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6802432CBBF for ; Tue, 10 May 2022 07:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Content-Type:References:In-Reply-To:Date:To:From:Subject:Message-ID:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=K3OSba5esavcG+b77SPhzMiMQ7qM3cVFxkSq6HFhFF0=; t=1652193077; x=1653402677; b=mfoKsOAoj+cw4/fC8MCr8pHxsS4m6QW6tOhRTQu0GDEFjm5 Wy+0SViczCQbR/QzLcHewSN5lipQQLdse2fQt06f6bHcFa2piATM3U2yt9iMYTm6h2340l0QVi1Gq LX/ARbX4Bzl3k6ojU/d1j1O3of71ZlSC+FiEcBYctsQRz9gSSNjYlU8n7XAUidp6+qmmjut7KuYRf QTqZSplNAKuLHQBM++mwkVX1GRBAB49rNTY7ojIfF6Pso/G8CvYpjMgRe87SToPbbUjIJe+qZocu2 RTNVovFBp4zh0U1LbgTM8mpB72/vNvH+mEr0EfUVIdYoTSGAM13bWL48yKD+qjhw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1noQtL-007pep-0e; Tue, 10 May 2022 16:31:11 +0200 Message-ID: <4281590ec280540e52202e052a23cbba3a33a474.camel@sipsolutions.net> Subject: Re: AP + STA on DFS channel breaks DFS detection. From: Johannes Berg To: Ben Greear , "linux-wireless@vger.kernel.org" Date: Tue, 10 May 2022 16:31:09 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, 2022-04-27 at 14:32 -0700, Ben Greear wrote: > I am using 5.17.4+ kernel, MT7915 radios. One radio (wiphy0) is acting as AP on > channel 132. It starts, does CAC and starts working fine. > > Then, I bring up a station on wiphy1 (on same machine). The STA connects to the AP > on wiphy0 and starts running traffic for a short time (usually < 1 minute). And then > the AP gets stopped. I don't think this is specific to connecting AP to STA on same machine, > probably if STA connected to another AP on channel 132 it would have same issue. > > I think I have tracked this down by adding prints and WARN_ON to find > the interesting state changes. It looks like when the STA changes its > regdom (probably because it is admin-up and/or associated to the AP), then the state of the > channel's dfs_state is reset. Channel objects are per band, not per wiphy. Actually, they are per wiphy, unless the driver sets up something else? I couldn't really figure out the code there, but it looked dynamically allocated, so not sure... > And then a bit later, a timer kicks off and decides that CAC has not completed > (because it already completed earlier on the AP, but chan->dfs_state was lost, > and STA will not do CAC anyway.) > > So, question is, how in the world to fix this properly! > Good question! But I'm not sure your description of this is quite right - the point isn't that the channels are shared, the point is that you're getting to update_all_wiphy_regulatory() which does update _all_ of the devices, since you've just switched the regulatory domain. I guess if the rules are identical on a given channel before/after the regdomain switch, we might get away with not resetting the dfs_state? johannes