Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4131687ybx; Mon, 4 Nov 2019 08:18:54 -0800 (PST) X-Google-Smtp-Source: APXvYqx/6+0g96NS2CzgVj+gvmaRu7O6hjHlaLIFgwQSi5BApB2IwR2MB2A+DvB6hJVmv6uiCocf X-Received: by 2002:a50:ef0b:: with SMTP id m11mr2997817eds.74.1572884333880; Mon, 04 Nov 2019 08:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572884333; cv=none; d=google.com; s=arc-20160816; b=E/ZoNGnJ3iChTCrP3InJlt6sLpFg3rM1m+4Hv2E7OyF4/l7sX9ay0Dpq9W95ZBJ8mG qS3g5PAeIp3F/ZH4zV30fD+fvEhFga89ep7WgXfhvOH7et1F8ZXkUg/WNKS21rHDEfxZ XOtKfCLTOpPeQg/iwmeOke0yjdmA4deNVYSgFcJ9lhgEiL/RfnS5n4YuZdfulZBOAtfE ClgoeNBqWnpm0ZTnnRzw1SjKkSpCS3nqQ6NUVexZXheXM4hBr/iwBI5WnvNjcWDpNNQe jJnzJDW+eH1lOPCRw5X544WyVMhVNjfM8m/DYJrX1sruNak8nlLfeFfyNltG5QGZPUij Fp7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=IyQ+4JUWbfmaAcHb0YjJWmh9HnZSg4yUhaVLsd07I5Y=; b=qfPNoPTsoYo+OCLldWLom7X+OXxqUF+BTjS8rUjGpl8QSoISgTfyC5rr+JC3ty7A87 hZm1G3JmWksr7//Cb+Kx0f/Y/luuMuwNFkm5WWOSzdEuJv9m0H4vPz0IjPMkN5ytXmy7 8Icgo7XRYhoTNQvNxT9QGQDYP3HiFotzM+QlEdbbFmd4cOeFuoYwNmhLncNgClZlwirQ IQ2Z7EQrPFREi1q4Ty112Hd5q0dHyhc8jbGeUAjixc9k4keH1hr6QffUfPKe27PbTQkH nS1UtNMTzxeCCrn9wOc7JGtuSLfm92W6ah2qPkxVFQdOSBHZc9rkFmRD1+J36ZBXBkwr 47Vg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j52si8757988eda.438.2019.11.04.08.18.03; Mon, 04 Nov 2019 08:18:53 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728641AbfKDQRT (ORCPT + 99 others); Mon, 4 Nov 2019 11:17:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:18972 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727998AbfKDQRT (ORCPT ); Mon, 4 Nov 2019 11:17:19 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3DEB90C99 for ; Mon, 4 Nov 2019 16:17:18 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id u2so4527132wrm.7 for ; Mon, 04 Nov 2019 08:17:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=IyQ+4JUWbfmaAcHb0YjJWmh9HnZSg4yUhaVLsd07I5Y=; b=B2BUzuUTkBZMR+yHgrRC7tgd5rf04rpvGv/JBJ7KpZmPWsipQtWNe8BaOCCEYENkZd 69tMy/kC+bWGd1J4LfzCwqKS+Z0x1eHxaJGkBaiUTrLadaxhJxo1wqXBLtGdkcLDzL/Z wE46lg1i7Mjlg9CO69ooZypJvcBlxdFF3lk50I6FUDJMjv+rMWG2U/yT4VHdq7m5PF59 TTVPcz/db7nYJZwvM/FE35YGK76rkvRRo1HAzukc+sR2NbEjtv9syFnwof7Xv+XHPeBH b/XMU5YVQFTP/F8QrnYwjzZvxRFOgJfRrwbh2hsiUTJ5Q/aSI/ViakJWWaBMWyiTQF+k 6Ymw== X-Gm-Message-State: APjAAAVGyol3GgaqQRObAuKRzwlpFy5B3wkl/L26/tAcvRbvsiBQ2BNK IuE4JKb0fy+fI5ZOHTbdiqF3UbDOXW6p4fEvXjv02socbVQt6FUQO4zIq6cyBJ2ZJe7pZu9JElv teGlZ0qruBKeHV4OdwR5sap9VIm4= X-Received: by 2002:a7b:cb86:: with SMTP id m6mr16785231wmi.124.1572884237464; Mon, 04 Nov 2019 08:17:17 -0800 (PST) X-Received: by 2002:a7b:cb86:: with SMTP id m6mr16785212wmi.124.1572884237230; Mon, 04 Nov 2019 08:17:17 -0800 (PST) Received: from localhost.localdomain ([176.229.194.15]) by smtp.gmail.com with ESMTPSA id m3sm13192203wrw.20.2019.11.04.08.17.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 08:17:16 -0800 (PST) Date: Mon, 4 Nov 2019 18:17:12 +0200 From: Lorenzo Bianconi To: Markus Theil Cc: nbd@nbd.name, sgruszka@redhat.com, linux-wireless@vger.kernel.org Subject: Re: [PATCH] mt76: mt76x02: fix num slots in beacon config init Message-ID: <20191104161712.GF3935@localhost.localdomain> References: <20191104150341.13896-1-markus.theil@tu-ilmenau.de> <20191104154537.GE3935@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WlEyl6ow+jlIgNUh" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --WlEyl6ow+jlIgNUh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Nov 04, Markus Theil wrote: > 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/dri= vers/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); > >> =20 > >> - for (i =3D 0; i < 8; i++) > >> + for (i =3D 0; i < dev->beacon_ops->nslots; i++) > >> mt76x02_mac_set_beacon(dev, i, NULL); > >> =20 > >> mt76x02_set_beacon_offsets(dev); > > Hi Markus, > > > > mt76x02_init_beacon_config is run just at bootstrap and it is used to c= lean all > > beacon RAM memory. It can't see any issue with the current code. > > > > Regards, > > Lorenzo > > > >> --=20 > >> 2.17.1 > >> > Hi Lorenzo, >=20 > 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 =3D 8192 > byte in the mmio case and 8 x 1638 =3D 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. ops..I did not notice beacon_len in __mt76x02_mac_set_beacon Lorenzo >=20 > Markus >=20 >=20 --WlEyl6ow+jlIgNUh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCXcBPBgAKCRA6cBh0uS2t rFWzAQDrh+JC/h/hyOeszGLapiPlTJPeQMdKcr7GmBU1N4QdRgD+JvpXiXAqGK7F gl/To3Hol642UOR/HJ7lUXBOqp4CLws= =9/bX -----END PGP SIGNATURE----- --WlEyl6ow+jlIgNUh--