Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp349016rwb; Thu, 1 Dec 2022 03:03:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf6WYulRvr6j00EsH2lW/KE+VFLebnblvP0TvFO5uRyIkHVFyp4w280uXbv/jkCU0RxDaVqA X-Received: by 2002:a05:6402:360b:b0:468:f365:dca with SMTP id el11-20020a056402360b00b00468f3650dcamr22988439edb.41.1669892638317; Thu, 01 Dec 2022 03:03:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669892638; cv=none; d=google.com; s=arc-20160816; b=c+EqAssC1kQFKmAUF/xhk3e3pMSqSoepVChUX6o5kaLWis/XrrIUofTowto/zMJVCU fYTqjkzEFPlafD2QL2gck5fxL0CMEAoPeeYQCiKq0O9+455rwmtkmCGmQRZO/FJbiK4k lscP0IFBdJVR19lQCkkoJRldMkVZn6ZVIsJexRPYMm9IhQ5i+oEEZZRzFTVuLkd3Bwrp VQcLhBqw41keUXbDDT5lElJdNTiKh+kdxUYGJi0szRPj8Wg5Iu9SQzGDOxsFUTKolXjs NinwcV2iHCm07zRaKzrzvYNCV9nr18QpVEqBzxmiSkx0huQ83HRcFt40DnuDBAVwR8aD 7bjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=YFaa7YKXSvWLRDXhrY62aVrDz3UmYOdr/qkiXBZuk9w=; b=zTOx8QgsCQ6AHXeLYfI7LOk0co6kp6SLNLk8HKNVMXZmYe4J+31PRg7UvfK1n1Q1Sv WowWM7Kwr+MCi/uTPH6R+31+ob5XtwCgXL6cLSpavIFTQ9N5qPqHoNS5RSZBO7+476s1 9Txs7E4nqXRBhDPM7dsA2YbW7wdU5ZagE9VbWwFt7Fz3+pL508brGIg9nfRujBQuINy9 hXKSJDC1cGPvgCTZrXVwkiuPx7XsvrPHFxTRYTT6gXzQPUNS8VHzfK18gg2KEIi0BwRR Splh7M7nsLWkfB6TbRpXPzO3oe33MjTvgyFJg+aTAkxCMXH+z+H4RRlAjDwGNxOKOHf+ sd5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Su6ZdHYo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs16-20020a170906dc9000b007ae814af686si3926320ejc.974.2022.12.01.03.03.38; Thu, 01 Dec 2022 03:03:58 -0800 (PST) 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=fail header.i=@nbd.name header.s=20160729 header.b=Su6ZdHYo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbiLAKx5 (ORCPT + 68 others); Thu, 1 Dec 2022 05:53:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229701AbiLAKxB (ORCPT ); Thu, 1 Dec 2022 05:53:01 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75374D9A for ; Thu, 1 Dec 2022 02:51:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YFaa7YKXSvWLRDXhrY62aVrDz3UmYOdr/qkiXBZuk9w=; b=Su6ZdHYotF5kFvfCFuoAraVUAy 8dq8a6reTuVno3MUjGSlFDICWKRBOBfAcoSkhaH8pEjqCDtCt7xNcjbFdwg1SLUIaAD6MUefzzzdn PMxjZubvCwQRjYQYEkK7Me2A1ULevYexXWqhFfU5tvc03M2VD0n35FsAtVrZjsddpz/w=; Received: from p200300daa7225c08186973351f2f7021.dip0.t-ipconnect.de ([2003:da:a722:5c08:1869:7335:1f2f:7021] helo=nf.local) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1p0hAW-005deM-BD; Thu, 01 Dec 2022 11:51:52 +0100 Message-ID: <973c3afc-2ea6-ff05-2c61-d047bf69867f@nbd.name> Date: Thu, 1 Dec 2022 11:51:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH 5/9] wifi: mt76: mt7996: add MAC support Content-Language: en-US To: Kalle Valo , Shayne Chen Cc: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , Bo Jiao , linux-mediatek References: <20221122084554.9494-1-shayne.chen@mediatek.com> <20221122084554.9494-6-shayne.chen@mediatek.com> <87zgc7mmr8.fsf@kernel.org> From: Felix Fietkau In-Reply-To: <87zgc7mmr8.fsf@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE 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 01.12.22 11:39, Kalle Valo wrote: > Shayne Chen writes: > >> (Split the big patch into smaller intermediate patches by functionality >> for easier review. Refer to the cover letter for more info.) >> >> Signed-off-by: Shayne Chen > > [...] > >> +static void mt7996_mac_sta_poll(struct mt7996_dev *dev) >> +{ >> + static const u8 ac_to_tid[] = { >> + [IEEE80211_AC_BE] = 0, >> + [IEEE80211_AC_BK] = 1, >> + [IEEE80211_AC_VI] = 4, >> + [IEEE80211_AC_VO] = 6 >> + }; >> + struct ieee80211_sta *sta; >> + struct mt7996_sta *msta; >> + struct rate_info *rate; >> + u32 tx_time[IEEE80211_NUM_ACS], rx_time[IEEE80211_NUM_ACS]; >> + LIST_HEAD(sta_poll_list); >> + int i; >> + >> + spin_lock_bh(&dev->sta_poll_lock); >> + list_splice_init(&dev->sta_poll_list, &sta_poll_list); >> + spin_unlock_bh(&dev->sta_poll_lock); >> + >> + rcu_read_lock(); >> + >> + while (true) { > > In upstream we have a preference that there's some kind of limit for > loops, to avoid neverending loops. This loop pulls entries from the on-stack sta_poll_list and bails out when the list is empty, so it's impossible for it to be neverending. - Felix