Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4121186ybx; Mon, 4 Nov 2019 08:10:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxNieZK/xuQL5Hv5RKbNptamZY03kmWeaB6CvmMYpWWmCc0vm1jv0rrqiovuT7cSzXtIUha X-Received: by 2002:a17:906:5494:: with SMTP id r20mr24287911ejo.293.1572883836284; Mon, 04 Nov 2019 08:10:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572883836; cv=none; d=google.com; s=arc-20160816; b=I/ZrLXAVb7ch7V8tqigthTlA/W7GGjFFd4Yj4KPbI2eC7eBEdbxvb+s8yHMU99wsd5 PTKctO/AMIIASt8GmSPGI/Ej8nTun7XM3nFQNK68OczI12ehw0fzB6ip/lMRoq65XOAy 11zwCjkG7zvRZm92P3dCDi8z3A2xK1FdwSAt5aQMJ0r9M2Mc8Ro4Z5FTmYgBbUdrMaOZ NnI5QkeOuokqeE4qZ//zt10yR/IA0u2048jri2diuesSWfqwRfGN07F2ibD6AG/qCSzx pjs2oDpNca9+yr7WAEZoPZwtu6thnbBXUM3Gl/y3pn0kuFYZeT03oMLRE3a8TN0RMj7p jBkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject; bh=wk0JENP9egF5hhWdjxvsLHvPsWINZijZUpZcEiqgFBo=; b=S9ab6O2Q0lab2hykW6MK4RoFVNKKAIBsi5FnwY2VNm/ho5eajPlhbauuNxC51A/BYN KKKRM3z+Cx4I8Wfi1Y0sOMqyIt0eV9ZVKS2g01y9rM55PCflZJbd9BJLjU4lfwSHrCGX 7inWMUTf/Si6tfnQKWEbrw1q+DY6UIV1hnaXFQLHM6vOQ2HMRyS8A7mL//hk0oSkLyPl AOgoYxJnT34ExrGnDbmVvTaK6Lu/khMhaBMi/BaedsDx9CbbtT0D/0oO+xMTNAu7STL7 BFmla3rYUNOAvjxurraTzfvcLNnpLPUK6H6fArSXHj+z8upOC+EI3aFZs1HpkkMTBf1I TXkQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23si7675063edc.185.2019.11.04.08.09.53; Mon, 04 Nov 2019 08:10:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728321AbfKDQHT convert rfc822-to-8bit (ORCPT + 99 others); Mon, 4 Nov 2019 11:07:19 -0500 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:36542 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727838AbfKDQHT (ORCPT ); Mon, 4 Nov 2019 11:07:19 -0500 Received: from [141.24.212.108] (thunderstorm.prakinf.tu-ilmenau.de [141.24.212.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id 36538580068; Mon, 4 Nov 2019 17:07:16 +0100 (CET) Subject: Re: [PATCH] mt76: mt76x02: fix num slots in beacon config init To: Lorenzo Bianconi Cc: nbd@nbd.name, sgruszka@redhat.com, linux-wireless@vger.kernel.org References: <20191104150341.13896-1-markus.theil@tu-ilmenau.de> <20191104154537.GE3935@localhost.localdomain> From: Markus Theil Openpgp: preference=signencryp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7Ug8UyNT5/0gZVkOileTQl0KtgwO9VBXAdrmMPHFldRn3dGNiGlCbxnsaNQDfQwTFmDu0 1TjzwC4byWLQT+C7yCTk8h9q0NwmCJ5yG7Fe7VUUpA+ZVLyMSt+tSpH8v3n+3I2AKoMAEQEA AcLBZQQYAQoADwUCVyikBgIbDAUJB4YfgAAKCRBt3CLaT/oEE7lZEACgrOxRaCQ7D5Rc4BOA N4VDIQqVch8X3pBE/k/v3UopkgmYnP4RlhegWr4wp2E6Vuyt8nwnZs3WhxQENfMjd5rV3WhG k5ib+pmLvtAht5j8jfP5+UKUTvX1a6oMi98PT8PuQ70oKM7T/KN+RpXIHoz/2Dgde1RQpwKC XWtkU9tBF87fE8FfwuqS6myOfd8zc6fOVV/fxmTXVC8qA7tB+0tOSDHB80GRYwnlumChOtOB Np8ABFWryE2e6mZZnp9Tpd1A74B45z6l445f5BixGLExAOoTJNA2k0JWx79/2Yi+pwTnQMzW QBLa48MnL3DUlVlahz1FZfGbA2U5NARS8iRdUhCaHL0Lph8HxWJwYA5w2afyCCwRD7xFo44V jsCNbqtZ6TrFARJdrbeWQl3RZ4Y+uuvN9mgvttVenAbx5d68IariYtXashucQeIMoqIloHTN sJDaupNm6+A9T3Re5yXmZsrWSxEEEGv1Bh+5DH6vauP0Ng0ebZ4c6jXfgLpPnAUWlV0rnmrJ q9141nbyLRYAhUXxiqajb+Zocp2Am4BF19rBUa1C78ooye9XShhuQvDTB6tZuiYWc24tiyqb IjR1hmG/zg8APhURAv/zUubaf4IA7v5YHVQqAbpUfb6ePlPVJBtVw2CwXFrGwnqDFh82La8D sGZPq8zmOtvOyZtafA== Organization: TU Ilmenau Message-ID: Date: Mon, 4 Nov 2019 17:07:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191104154537.GE3935@localhost.localdomain> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8BIT Content-Language: en-US Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 04.11.19 16:45, Lorenzo Bianconi wrote: >> mt76x02 mmio and usb devices use a different number of beacon slots (8 >> vs. 5). Consider this in mt76x02_init_beacon_config. >> >> Signed-off-by: Markus Theil >> --- >> drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c >> index 4209209ac940..b7412953ff26 100644 >> --- a/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c >> +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_beacon.c >> @@ -249,7 +249,7 @@ void mt76x02_init_beacon_config(struct mt76x02_dev *dev) >> mt76_set(dev, MT_BEACON_TIME_CFG, MT_BEACON_TIME_CFG_SYNC_MODE); >> mt76_wr(dev, MT_BCN_BYPASS_MASK, 0xffff); >> >> - for (i = 0; i < 8; i++) >> + for (i = 0; i < dev->beacon_ops->nslots; i++) >> mt76x02_mac_set_beacon(dev, i, NULL); >> >> mt76x02_set_beacon_offsets(dev); > Hi Markus, > > mt76x02_init_beacon_config is run just at bootstrap and it is used to clean all > beacon RAM memory. It can't see any issue with the current code. > > Regards, > Lorenzo > >> -- >> 2.17.1 >> Hi Lorenzo, I just thought this function should overwrite all 8192 byte beacon RAM memory. If the loop count is set to 8 it would overwrite 8 x 1024 = 8192 byte in the mmio case and 8 x 1638 = 13104 byte in the USB case. 1638 is 8192 / N_BCN_SLOTS. N_BCN_SLOTS is currently 5 for USB. mt76x02_beacon.c has no further checks for beacon_ops->nslots in the case of setting a beacon. Markus