All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
       [not found] <cover.1557591530.git.lorenzo@kernel.org>
@ 2019-05-11 16:38 ` Lorenzo Bianconi
  2019-05-13  4:26   ` Kalle Valo
  0 siblings, 1 reply; 16+ messages in thread
From: Lorenzo Bianconi @ 2019-05-11 16:38 UTC (permalink / raw)
  To: nbd; +Cc: lorenzo.bianconi, linux-wireless

Introduce a knob in mt7603 debugfs in order to enable/disable
edcca processing

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 .../wireless/mediatek/mt76/mt7603/debugfs.c   | 30 +++++++++++++++++++
 .../net/wireless/mediatek/mt76/mt7603/init.c  |  4 ++-
 .../net/wireless/mediatek/mt76/mt7603/main.c  |  3 +-
 .../wireless/mediatek/mt76/mt7603/mt7603.h    |  6 +++-
 4 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c
index f8b3b6ab6297..efc1cf5ae870 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c
@@ -40,6 +40,35 @@ mt7603_radio_read(struct seq_file *s, void *data)
 	return 0;
 }
 
+static int
+mt7603_edcca_set(void *data, u64 val)
+{
+	struct mt7603_dev *dev = data;
+
+	mutex_lock(&dev->mt76.mutex);
+
+	dev->ed_monitor_enabled = !!val;
+	dev->ed_monitor = dev->ed_monitor_enabled &&
+			  dev->region == NL80211_DFS_ETSI;
+	mt7603_init_edcca(dev);
+
+	mutex_unlock(&dev->mt76.mutex);
+
+	return 0;
+}
+
+static int
+mt7603_edcca_get(void *data, u64 *val)
+{
+	struct mt7603_dev *dev = data;
+
+	*val = dev->ed_monitor_enabled;
+	return 0;
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(fops_edcca, mt7603_edcca_get,
+			 mt7603_edcca_set, "%lld\n");
+
 void mt7603_init_debugfs(struct mt7603_dev *dev)
 {
 	struct dentry *dir;
@@ -48,6 +77,7 @@ void mt7603_init_debugfs(struct mt7603_dev *dev)
 	if (!dir)
 		return;
 
+	debugfs_create_file("edcca", 0400, dir, dev, &fops_edcca);
 	debugfs_create_u32("reset_test", 0600, dir, &dev->reset_test);
 	debugfs_create_devm_seqfile(dev->mt76.dev, "reset", dir,
 				    mt7603_reset_read);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/init.c b/drivers/net/wireless/mediatek/mt76/mt7603/init.c
index 78cdbb70e178..4e269044f8a4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/init.c
@@ -437,7 +437,9 @@ mt7603_regd_notifier(struct wiphy *wiphy,
 	struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
 	struct mt7603_dev *dev = hw->priv;
 
-	dev->ed_monitor = request->dfs_region == NL80211_DFS_ETSI;
+	dev->region = request->dfs_region;
+	dev->ed_monitor = dev->ed_monitor_enabled &&
+			  dev->region == NL80211_DFS_ETSI;
 }
 
 static int
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/main.c b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
index 0a0334dc40d5..e931af92af43 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/main.c
@@ -103,8 +103,7 @@ mt7603_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 	mutex_unlock(&dev->mt76.mutex);
 }
 
-static void
-mt7603_init_edcca(struct mt7603_dev *dev)
+void mt7603_init_edcca(struct mt7603_dev *dev)
 {
 	/* Set lower signal level to -65dBm */
 	mt76_rmw_field(dev, MT_RXTD(8), MT_RXTD_8_LOWER_SIGNAL, 0x23);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h
index fa64bbaab0d2..944dc9a11a15 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h
@@ -117,8 +117,11 @@ struct mt7603_dev {
 	u8 mac_work_count;
 
 	u8 mcu_running;
-	u8 ed_monitor;
 
+	enum nl80211_dfs_regions region;
+
+	u8 ed_monitor_enabled;
+	u8 ed_monitor;
 	s8 ed_trigger;
 	u8 ed_strict_mode;
 	u8 ed_strong_signal;
@@ -241,4 +244,5 @@ void mt7603_update_channel(struct mt76_dev *mdev);
 void mt7603_edcca_set_strict(struct mt7603_dev *dev, bool val);
 void mt7603_cca_stats_reset(struct mt7603_dev *dev);
 
+void mt7603_init_edcca(struct mt7603_dev *dev);
 #endif
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-11 16:38 ` [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca Lorenzo Bianconi
@ 2019-05-13  4:26   ` Kalle Valo
  2019-05-13  8:41     ` Lorenzo Bianconi
  0 siblings, 1 reply; 16+ messages in thread
From: Kalle Valo @ 2019-05-13  4:26 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: nbd, lorenzo.bianconi, linux-wireless

Lorenzo Bianconi <lorenzo@kernel.org> writes:

> Introduce a knob in mt7603 debugfs in order to enable/disable
> edcca processing
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

It's good to explain what edcca does and how the file is used supposed
to be used. In other words, have a small introduction for the user.

> @@ -48,6 +77,7 @@ void mt7603_init_debugfs(struct mt7603_dev *dev)
>  	if (!dir)
>  		return;
>  
> +	debugfs_create_file("edcca", 0400, dir, dev, &fops_edcca);

Why 0400 and not 0600?

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-13  4:26   ` Kalle Valo
@ 2019-05-13  8:41     ` Lorenzo Bianconi
  2019-05-13  9:48       ` Stanislaw Gruszka
  2019-05-13 12:37       ` Kalle Valo
  0 siblings, 2 replies; 16+ messages in thread
From: Lorenzo Bianconi @ 2019-05-13  8:41 UTC (permalink / raw)
  To: Kalle Valo; +Cc: nbd, lorenzo.bianconi, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

> Lorenzo Bianconi <lorenzo@kernel.org> writes:
> 
> > Introduce a knob in mt7603 debugfs in order to enable/disable
> > edcca processing
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> 
> It's good to explain what edcca does and how the file is used supposed
> to be used. In other words, have a small introduction for the user.

Hi Kalle,

edcca is used for adjusting energy detect based on CCA thresholds.
The code was already there so I just reported the acronym.

> 
> > @@ -48,6 +77,7 @@ void mt7603_init_debugfs(struct mt7603_dev *dev)
> >  	if (!dir)
> >  		return;
> >  
> > +	debugfs_create_file("edcca", 0400, dir, dev, &fops_edcca);
> 
> Why 0400 and not 0600?

yes, right. There is the same issue in mt76x02 code, I will fix both of them.
Thx.

Regards,
Lorenzo

> 
> -- 
> Kalle Valo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-13  8:41     ` Lorenzo Bianconi
@ 2019-05-13  9:48       ` Stanislaw Gruszka
  2019-05-15  9:33         ` Stanislaw Gruszka
  2019-05-13 12:37       ` Kalle Valo
  1 sibling, 1 reply; 16+ messages in thread
From: Stanislaw Gruszka @ 2019-05-13  9:48 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

On Mon, May 13, 2019 at 10:41:28AM +0200, Lorenzo Bianconi wrote:
> > Lorenzo Bianconi <lorenzo@kernel.org> writes:
> > 
> > > Introduce a knob in mt7603 debugfs in order to enable/disable
> > > edcca processing
> > >
> > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > 
> > It's good to explain what edcca does and how the file is used supposed
> > to be used. In other words, have a small introduction for the user.
> 
> Hi Kalle,
> 
> edcca is used for adjusting energy detect based on CCA thresholds.
> The code was already there so I just reported the acronym.

What for it is needed ?

Stanislaw

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-13  8:41     ` Lorenzo Bianconi
  2019-05-13  9:48       ` Stanislaw Gruszka
@ 2019-05-13 12:37       ` Kalle Valo
  2019-05-13 15:41         ` Lorenzo Bianconi
  1 sibling, 1 reply; 16+ messages in thread
From: Kalle Valo @ 2019-05-13 12:37 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: nbd, lorenzo.bianconi, linux-wireless

Lorenzo Bianconi <lorenzo@kernel.org> writes:

>> Lorenzo Bianconi <lorenzo@kernel.org> writes:
>> 
>> > Introduce a knob in mt7603 debugfs in order to enable/disable
>> > edcca processing
>> >
>> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>> 
>> It's good to explain what edcca does and how the file is used supposed
>> to be used. In other words, have a small introduction for the user.
>
> Hi Kalle,
>
> edcca is used for adjusting energy detect based on CCA thresholds.
> The code was already there so I just reported the acronym.

A lot of people read commit logs but not everyone (myself included) are
familiar with mt76 internals so please try to explain the acronyms and
the background of the patch. Also you should explain in the commit log
_why_ you are adding the debugfs file, how it helps the user and how to
use it.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-13 12:37       ` Kalle Valo
@ 2019-05-13 15:41         ` Lorenzo Bianconi
  0 siblings, 0 replies; 16+ messages in thread
From: Lorenzo Bianconi @ 2019-05-13 15:41 UTC (permalink / raw)
  To: Kalle Valo; +Cc: nbd, lorenzo.bianconi, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1460 bytes --]

> Lorenzo Bianconi <lorenzo@kernel.org> writes:
> 
> >> Lorenzo Bianconi <lorenzo@kernel.org> writes:
> >> 
> >> > Introduce a knob in mt7603 debugfs in order to enable/disable
> >> > edcca processing
> >> >
> >> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> >> 
> >> It's good to explain what edcca does and how the file is used supposed
> >> to be used. In other words, have a small introduction for the user.
> >
> > Hi Kalle,
> >
> > edcca is used for adjusting energy detect based on CCA thresholds.
> > The code was already there so I just reported the acronym.
> 
> A lot of people read commit logs but not everyone (myself included) are
> familiar with mt76 internals so please try to explain the acronyms and
> the background of the patch. Also you should explain in the commit log
> _why_ you are adding the debugfs file, how it helps the user and how to
> use it.

sorry for not been so clear.
ED/CCA is used to control tx power according to the CCA MIB counters (e.g do not
transmit if the channel busy time is higher than 90% for given amount of time
in a row).
As already done in commit 643749d4a82b ("mt76: mt76x02: disable ED/CCA by default"),
this patch adds the possibility to enable/disable the processing according to an
entry in the debugfs. The reason behind this patch is ED/CCA caused
instability in the past so it could be useful to disable it.

Regards,
Lorenzo

> 
> -- 
> Kalle Valo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-13  9:48       ` Stanislaw Gruszka
@ 2019-05-15  9:33         ` Stanislaw Gruszka
  2019-05-15  9:43           ` Lorenzo Bianconi
  0 siblings, 1 reply; 16+ messages in thread
From: Stanislaw Gruszka @ 2019-05-15  9:33 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

On Mon, May 13, 2019 at 11:48:37AM +0200, Stanislaw Gruszka wrote:
> On Mon, May 13, 2019 at 10:41:28AM +0200, Lorenzo Bianconi wrote:
> > > Lorenzo Bianconi <lorenzo@kernel.org> writes:
> > > 
> > > > Introduce a knob in mt7603 debugfs in order to enable/disable
> > > > edcca processing
> > > >
> > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > 
> > > It's good to explain what edcca does and how the file is used supposed
> > > to be used. In other words, have a small introduction for the user.
> > 
> > Hi Kalle,
> > 
> > edcca is used for adjusting energy detect based on CCA thresholds.
> > The code was already there so I just reported the acronym.
> 
> What for it is needed ?

Care to comment why EDCCA is needed at all ?

Taking that debugfs file that enable it is read-only, it looks like
feature that nobody needs nor tests.

Stanislaw 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-15  9:33         ` Stanislaw Gruszka
@ 2019-05-15  9:43           ` Lorenzo Bianconi
  2019-05-15  9:54             ` Stanislaw Gruszka
  0 siblings, 1 reply; 16+ messages in thread
From: Lorenzo Bianconi @ 2019-05-15  9:43 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

> On Mon, May 13, 2019 at 11:48:37AM +0200, Stanislaw Gruszka wrote:
> > On Mon, May 13, 2019 at 10:41:28AM +0200, Lorenzo Bianconi wrote:
> > > > Lorenzo Bianconi <lorenzo@kernel.org> writes:
> > > > 
> > > > > Introduce a knob in mt7603 debugfs in order to enable/disable
> > > > > edcca processing
> > > > >
> > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > 
> > > > It's good to explain what edcca does and how the file is used supposed
> > > > to be used. In other words, have a small introduction for the user.
> > > 
> > > Hi Kalle,
> > > 
> > > edcca is used for adjusting energy detect based on CCA thresholds.
> > > The code was already there so I just reported the acronym.
> > 
> > What for it is needed ?
> 
> Care to comment why EDCCA is needed at all ?
> 
> Taking that debugfs file that enable it is read-only, it looks like
> feature that nobody needs nor tests.

already fixed in v2
https://patchwork.kernel.org/patch/10940645/

Lorenzo

> 
> Stanislaw 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-15  9:43           ` Lorenzo Bianconi
@ 2019-05-15  9:54             ` Stanislaw Gruszka
  2019-05-15 10:03               ` Lorenzo Bianconi
  0 siblings, 1 reply; 16+ messages in thread
From: Stanislaw Gruszka @ 2019-05-15  9:54 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

On Wed, May 15, 2019 at 11:43:55AM +0200, Lorenzo Bianconi wrote:
> > On Mon, May 13, 2019 at 11:48:37AM +0200, Stanislaw Gruszka wrote:
> > > On Mon, May 13, 2019 at 10:41:28AM +0200, Lorenzo Bianconi wrote:
> > > > > Lorenzo Bianconi <lorenzo@kernel.org> writes:
> > > > > 
> > > > > > Introduce a knob in mt7603 debugfs in order to enable/disable
> > > > > > edcca processing
> > > > > >
> > > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > > 
> > > > > It's good to explain what edcca does and how the file is used supposed
> > > > > to be used. In other words, have a small introduction for the user.
> > > > 
> > > > Hi Kalle,
> > > > 
> > > > edcca is used for adjusting energy detect based on CCA thresholds.
> > > > The code was already there so I just reported the acronym.
> > > 
> > > What for it is needed ?
> > 
> > Care to comment why EDCCA is needed at all ?
> > 
> > Taking that debugfs file that enable it is read-only, it looks like
> > feature that nobody needs nor tests.
> 
> already fixed in v2
> https://patchwork.kernel.org/patch/10940645/

I'm aware of this patch and other one for mt76x02. But so far in the
sources EDCCA is disabled for mt76x02 without possibility to enable it
(and this permission file issue was pointed by Kalle during review, not
by someone who want to test EDCCA). So again, what for EDCCA is needed ?

Stanislaw

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-15  9:54             ` Stanislaw Gruszka
@ 2019-05-15 10:03               ` Lorenzo Bianconi
  2019-05-15 10:33                 ` Stanislaw Gruszka
  0 siblings, 1 reply; 16+ messages in thread
From: Lorenzo Bianconi @ 2019-05-15 10:03 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]

> On Wed, May 15, 2019 at 11:43:55AM +0200, Lorenzo Bianconi wrote:
> > > On Mon, May 13, 2019 at 11:48:37AM +0200, Stanislaw Gruszka wrote:
> > > > On Mon, May 13, 2019 at 10:41:28AM +0200, Lorenzo Bianconi wrote:
> > > > > > Lorenzo Bianconi <lorenzo@kernel.org> writes:
> > > > > > 
> > > > > > > Introduce a knob in mt7603 debugfs in order to enable/disable
> > > > > > > edcca processing
> > > > > > >
> > > > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > > > 
> > > > > > It's good to explain what edcca does and how the file is used supposed
> > > > > > to be used. In other words, have a small introduction for the user.
> > > > > 
> > > > > Hi Kalle,
> > > > > 
> > > > > edcca is used for adjusting energy detect based on CCA thresholds.
> > > > > The code was already there so I just reported the acronym.
> > > > 
> > > > What for it is needed ?
> > > 
> > > Care to comment why EDCCA is needed at all ?
> > > 
> > > Taking that debugfs file that enable it is read-only, it looks like
> > > feature that nobody needs nor tests.
> > 
> > already fixed in v2
> > https://patchwork.kernel.org/patch/10940645/
> 
> I'm aware of this patch and other one for mt76x02. But so far in the
> sources EDCCA is disabled for mt76x02 without possibility to enable it
> (and this permission file issue was pointed by Kalle during review, not
> by someone who want to test EDCCA). So again, what for EDCCA is needed ?

As I have already written in a previous email, ED/CCA is used to control tx power
according to the CCA MIB counters (e.g do not transmit if the channel busy time
is higher than 90% for given amount of time in a row). I guess it is required
by ETSI regulatory.
Regarding file permission for mt76x02 debugfs edcca node is a typo.

Lorenzo

> 
> Stanislaw

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-15 10:03               ` Lorenzo Bianconi
@ 2019-05-15 10:33                 ` Stanislaw Gruszka
  2019-05-15 11:13                   ` Lorenzo Bianconi
  0 siblings, 1 reply; 16+ messages in thread
From: Stanislaw Gruszka @ 2019-05-15 10:33 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

On Wed, May 15, 2019 at 12:03:44PM +0200, Lorenzo Bianconi wrote:
> > On Wed, May 15, 2019 at 11:43:55AM +0200, Lorenzo Bianconi wrote:
> > > > On Mon, May 13, 2019 at 11:48:37AM +0200, Stanislaw Gruszka wrote:
> > > > > On Mon, May 13, 2019 at 10:41:28AM +0200, Lorenzo Bianconi wrote:
> > > > > > > Lorenzo Bianconi <lorenzo@kernel.org> writes:
> > > > > > > 
> > > > > > > > Introduce a knob in mt7603 debugfs in order to enable/disable
> > > > > > > > edcca processing
> > > > > > > >
> > > > > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > > > > 
> > > > > > > It's good to explain what edcca does and how the file is used supposed
> > > > > > > to be used. In other words, have a small introduction for the user.
> > > > > > 
> > > > > > Hi Kalle,
> > > > > > 
> > > > > > edcca is used for adjusting energy detect based on CCA thresholds.
> > > > > > The code was already there so I just reported the acronym.
> > > > > 
> > > > > What for it is needed ?
> > > > 
> > > > Care to comment why EDCCA is needed at all ?
> > > > 
> > > > Taking that debugfs file that enable it is read-only, it looks like
> > > > feature that nobody needs nor tests.
> > > 
> > > already fixed in v2
> > > https://patchwork.kernel.org/patch/10940645/
> > 
> > I'm aware of this patch and other one for mt76x02. But so far in the
> > sources EDCCA is disabled for mt76x02 without possibility to enable it
> > (and this permission file issue was pointed by Kalle during review, not
> > by someone who want to test EDCCA). So again, what for EDCCA is needed ?
> 
> As I have already written in a previous email, ED/CCA is used to control tx power
> according to the CCA MIB counters (e.g do not transmit if the channel busy time
> is higher than 90% for given amount of time in a row). I guess it is required
> by ETSI regulatory.
But what is user case for that, i.e. who need this (it wasn't implemented in
mt76x2 since you added it on Dec 2018). What will happen if it will be removed?

> Regarding file permission for mt76x02 debugfs edcca node is a typo.
Typo or not, effectively disable the feature and show nobody is
testing it.

The reason I'm asking is that seems EDCCA is the main reason to
implement watchod for mt76x2, it wasn't necessary to have a watchdog
as seems devices did not hung before EDCCA was added.

Stanislaw

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-15 10:33                 ` Stanislaw Gruszka
@ 2019-05-15 11:13                   ` Lorenzo Bianconi
  2019-05-15 11:46                     ` Stanislaw Gruszka
  0 siblings, 1 reply; 16+ messages in thread
From: Lorenzo Bianconi @ 2019-05-15 11:13 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 2673 bytes --]

> On Wed, May 15, 2019 at 12:03:44PM +0200, Lorenzo Bianconi wrote:
> > > On Wed, May 15, 2019 at 11:43:55AM +0200, Lorenzo Bianconi wrote:
> > > > > On Mon, May 13, 2019 at 11:48:37AM +0200, Stanislaw Gruszka wrote:
> > > > > > On Mon, May 13, 2019 at 10:41:28AM +0200, Lorenzo Bianconi wrote:
> > > > > > > > Lorenzo Bianconi <lorenzo@kernel.org> writes:
> > > > > > > > 
> > > > > > > > > Introduce a knob in mt7603 debugfs in order to enable/disable
> > > > > > > > > edcca processing
> > > > > > > > >
> > > > > > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > > > > > 
> > > > > > > > It's good to explain what edcca does and how the file is used supposed
> > > > > > > > to be used. In other words, have a small introduction for the user.
> > > > > > > 
> > > > > > > Hi Kalle,
> > > > > > > 
> > > > > > > edcca is used for adjusting energy detect based on CCA thresholds.
> > > > > > > The code was already there so I just reported the acronym.
> > > > > > 
> > > > > > What for it is needed ?
> > > > > 
> > > > > Care to comment why EDCCA is needed at all ?
> > > > > 
> > > > > Taking that debugfs file that enable it is read-only, it looks like
> > > > > feature that nobody needs nor tests.
> > > > 
> > > > already fixed in v2
> > > > https://patchwork.kernel.org/patch/10940645/
> > > 
> > > I'm aware of this patch and other one for mt76x02. But so far in the
> > > sources EDCCA is disabled for mt76x02 without possibility to enable it
> > > (and this permission file issue was pointed by Kalle during review, not
> > > by someone who want to test EDCCA). So again, what for EDCCA is needed ?
> > 
> > As I have already written in a previous email, ED/CCA is used to control tx power
> > according to the CCA MIB counters (e.g do not transmit if the channel busy time
> > is higher than 90% for given amount of time in a row). I guess it is required
> > by ETSI regulatory.
> But what is user case for that, i.e. who need this (it wasn't implemented in
> mt76x2 since you added it on Dec 2018). What will happen if it will be removed?
> 
> > Regarding file permission for mt76x02 debugfs edcca node is a typo.
> Typo or not, effectively disable the feature and show nobody is
> testing it.
> 
> The reason I'm asking is that seems EDCCA is the main reason to
> implement watchod for mt76x2, it wasn't necessary to have a watchdog
> as seems devices did not hung before EDCCA was added.

IIRC I added the first watchdog implementation to fix tx hangs that occur
under heavy load even using FCC regulatory (so when EDCCA processing is
disabled)

Regards,
Lorenzo

> 
> Stanislaw

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-15 11:13                   ` Lorenzo Bianconi
@ 2019-05-15 11:46                     ` Stanislaw Gruszka
  2019-05-15 12:07                       ` Lorenzo Bianconi
  0 siblings, 1 reply; 16+ messages in thread
From: Stanislaw Gruszka @ 2019-05-15 11:46 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

On Wed, May 15, 2019 at 01:13:49PM +0200, Lorenzo Bianconi wrote:
> > On Wed, May 15, 2019 at 12:03:44PM +0200, Lorenzo Bianconi wrote:
> > > > On Wed, May 15, 2019 at 11:43:55AM +0200, Lorenzo Bianconi wrote:
> > > > > > On Mon, May 13, 2019 at 11:48:37AM +0200, Stanislaw Gruszka wrote:
> > > > > > > On Mon, May 13, 2019 at 10:41:28AM +0200, Lorenzo Bianconi wrote:
> > > > > > > > > Lorenzo Bianconi <lorenzo@kernel.org> writes:
> > > > > > > > > 
> > > > > > > > > > Introduce a knob in mt7603 debugfs in order to enable/disable
> > > > > > > > > > edcca processing
> > > > > > > > > >
> > > > > > > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > > > > > > 
> > > > > > > > > It's good to explain what edcca does and how the file is used supposed
> > > > > > > > > to be used. In other words, have a small introduction for the user.
> > > > > > > > 
> > > > > > > > Hi Kalle,
> > > > > > > > 
> > > > > > > > edcca is used for adjusting energy detect based on CCA thresholds.
> > > > > > > > The code was already there so I just reported the acronym.
> > > > > > > 
> > > > > > > What for it is needed ?
> > > > > > 
> > > > > > Care to comment why EDCCA is needed at all ?
> > > > > > 
> > > > > > Taking that debugfs file that enable it is read-only, it looks like
> > > > > > feature that nobody needs nor tests.
> > > > > 
> > > > > already fixed in v2
> > > > > https://patchwork.kernel.org/patch/10940645/
> > > > 
> > > > I'm aware of this patch and other one for mt76x02. But so far in the
> > > > sources EDCCA is disabled for mt76x02 without possibility to enable it
> > > > (and this permission file issue was pointed by Kalle during review, not
> > > > by someone who want to test EDCCA). So again, what for EDCCA is needed ?
> > > 
> > > As I have already written in a previous email, ED/CCA is used to control tx power
> > > according to the CCA MIB counters (e.g do not transmit if the channel busy time
> > > is higher than 90% for given amount of time in a row). I guess it is required
> > > by ETSI regulatory.
> > But what is user case for that, i.e. who need this (it wasn't implemented in
> > mt76x2 since you added it on Dec 2018). What will happen if it will be removed?
> > 
> > > Regarding file permission for mt76x02 debugfs edcca node is a typo.
> > Typo or not, effectively disable the feature and show nobody is
> > testing it.
> > 
> > The reason I'm asking is that seems EDCCA is the main reason to
> > implement watchod for mt76x2, it wasn't necessary to have a watchdog
> > as seems devices did not hung before EDCCA was added.
> 
> IIRC I added the first watchdog implementation to fix tx hangs that occur
> under heavy load even using FCC regulatory (so when EDCCA processing is
> disabled)

There was changes in various registers programming introduced by EDCCA
support, even with EDCCA disabled. It's rally not convenient that
watchdog and EDCCA are not related, since you added tx hung watchdog
2 weeks after adding EDCCA.

You can look at this report:
https://github.com/openwrt/mt76/issues/246
Before mt76x2e worked without hungs & watchodg. Now, even with EDCCA
disabled watchdog and HW restarts are required to fix hungs on runtime.

Stanislaw

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-15 11:46                     ` Stanislaw Gruszka
@ 2019-05-15 12:07                       ` Lorenzo Bianconi
  2019-05-15 13:48                         ` Stanislaw Gruszka
  0 siblings, 1 reply; 16+ messages in thread
From: Lorenzo Bianconi @ 2019-05-15 12:07 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 3644 bytes --]

> On Wed, May 15, 2019 at 01:13:49PM +0200, Lorenzo Bianconi wrote:
> > > On Wed, May 15, 2019 at 12:03:44PM +0200, Lorenzo Bianconi wrote:
> > > > > On Wed, May 15, 2019 at 11:43:55AM +0200, Lorenzo Bianconi wrote:
> > > > > > > On Mon, May 13, 2019 at 11:48:37AM +0200, Stanislaw Gruszka wrote:
> > > > > > > > On Mon, May 13, 2019 at 10:41:28AM +0200, Lorenzo Bianconi wrote:
> > > > > > > > > > Lorenzo Bianconi <lorenzo@kernel.org> writes:
> > > > > > > > > > 
> > > > > > > > > > > Introduce a knob in mt7603 debugfs in order to enable/disable
> > > > > > > > > > > edcca processing
> > > > > > > > > > >
> > > > > > > > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > > > > > > > 
> > > > > > > > > > It's good to explain what edcca does and how the file is used supposed
> > > > > > > > > > to be used. In other words, have a small introduction for the user.
> > > > > > > > > 
> > > > > > > > > Hi Kalle,
> > > > > > > > > 
> > > > > > > > > edcca is used for adjusting energy detect based on CCA thresholds.
> > > > > > > > > The code was already there so I just reported the acronym.
> > > > > > > > 
> > > > > > > > What for it is needed ?
> > > > > > > 
> > > > > > > Care to comment why EDCCA is needed at all ?
> > > > > > > 
> > > > > > > Taking that debugfs file that enable it is read-only, it looks like
> > > > > > > feature that nobody needs nor tests.
> > > > > > 
> > > > > > already fixed in v2
> > > > > > https://patchwork.kernel.org/patch/10940645/
> > > > > 
> > > > > I'm aware of this patch and other one for mt76x02. But so far in the
> > > > > sources EDCCA is disabled for mt76x02 without possibility to enable it
> > > > > (and this permission file issue was pointed by Kalle during review, not
> > > > > by someone who want to test EDCCA). So again, what for EDCCA is needed ?
> > > > 
> > > > As I have already written in a previous email, ED/CCA is used to control tx power
> > > > according to the CCA MIB counters (e.g do not transmit if the channel busy time
> > > > is higher than 90% for given amount of time in a row). I guess it is required
> > > > by ETSI regulatory.
> > > But what is user case for that, i.e. who need this (it wasn't implemented in
> > > mt76x2 since you added it on Dec 2018). What will happen if it will be removed?
> > > 
> > > > Regarding file permission for mt76x02 debugfs edcca node is a typo.
> > > Typo or not, effectively disable the feature and show nobody is
> > > testing it.
> > > 
> > > The reason I'm asking is that seems EDCCA is the main reason to
> > > implement watchod for mt76x2, it wasn't necessary to have a watchdog
> > > as seems devices did not hung before EDCCA was added.
> > 
> > IIRC I added the first watchdog implementation to fix tx hangs that occur
> > under heavy load even using FCC regulatory (so when EDCCA processing is
> > disabled)
> 
> There was changes in various registers programming introduced by EDCCA
> support, even with EDCCA disabled. It's rally not convenient that
> watchdog and EDCCA are not related, since you added tx hung watchdog
> 2 weeks after adding EDCCA.
> 
> You can look at this report:
> https://github.com/openwrt/mt76/issues/246
> Before mt76x2e worked without hungs & watchodg. Now, even with EDCCA
> disabled watchdog and HW restarts are required to fix hungs on runtime.

Tx hangs occur in very particular conditions (e.g 200Mbps bidirectional
traffic) and moreover they do not always occur so I am not convinced they
are always EDCCA related and so I am not confident to remove the watchdog

Lorenzo

> 
> Stanislaw

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-15 12:07                       ` Lorenzo Bianconi
@ 2019-05-15 13:48                         ` Stanislaw Gruszka
  2019-05-15 13:59                           ` Stanislaw Gruszka
  0 siblings, 1 reply; 16+ messages in thread
From: Stanislaw Gruszka @ 2019-05-15 13:48 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

On Wed, May 15, 2019 at 02:07:42PM +0200, Lorenzo Bianconi wrote:
> > On Wed, May 15, 2019 at 01:13:49PM +0200, Lorenzo Bianconi wrote:
> > > > On Wed, May 15, 2019 at 12:03:44PM +0200, Lorenzo Bianconi wrote:
> > > > > > On Wed, May 15, 2019 at 11:43:55AM +0200, Lorenzo Bianconi wrote:
> > > > > > > > On Mon, May 13, 2019 at 11:48:37AM +0200, Stanislaw Gruszka wrote:
> > > > > > > > > On Mon, May 13, 2019 at 10:41:28AM +0200, Lorenzo Bianconi wrote:
> > > > > > > > > > > Lorenzo Bianconi <lorenzo@kernel.org> writes:
> > > > > > > > > > > 
> > > > > > > > > > > > Introduce a knob in mt7603 debugfs in order to enable/disable
> > > > > > > > > > > > edcca processing
> > > > > > > > > > > >
> > > > > > > > > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > > > > > > > > > > 
> > > > > > > > > > > It's good to explain what edcca does and how the file is used supposed
> > > > > > > > > > > to be used. In other words, have a small introduction for the user.
> > > > > > > > > > 
> > > > > > > > > > Hi Kalle,
> > > > > > > > > > 
> > > > > > > > > > edcca is used for adjusting energy detect based on CCA thresholds.
> > > > > > > > > > The code was already there so I just reported the acronym.
> > > > > > > > > 
> > > > > > > > > What for it is needed ?
> > > > > > > > 
> > > > > > > > Care to comment why EDCCA is needed at all ?
> > > > > > > > 
> > > > > > > > Taking that debugfs file that enable it is read-only, it looks like
> > > > > > > > feature that nobody needs nor tests.
> > > > > > > 
> > > > > > > already fixed in v2
> > > > > > > https://patchwork.kernel.org/patch/10940645/
> > > > > > 
> > > > > > I'm aware of this patch and other one for mt76x02. But so far in the
> > > > > > sources EDCCA is disabled for mt76x02 without possibility to enable it
> > > > > > (and this permission file issue was pointed by Kalle during review, not
> > > > > > by someone who want to test EDCCA). So again, what for EDCCA is needed ?
> > > > > 
> > > > > As I have already written in a previous email, ED/CCA is used to control tx power
> > > > > according to the CCA MIB counters (e.g do not transmit if the channel busy time
> > > > > is higher than 90% for given amount of time in a row). I guess it is required
> > > > > by ETSI regulatory.
> > > > But what is user case for that, i.e. who need this (it wasn't implemented in
> > > > mt76x2 since you added it on Dec 2018). What will happen if it will be removed?
> > > > 
> > > > > Regarding file permission for mt76x02 debugfs edcca node is a typo.
> > > > Typo or not, effectively disable the feature and show nobody is
> > > > testing it.
> > > > 
> > > > The reason I'm asking is that seems EDCCA is the main reason to
> > > > implement watchod for mt76x2, it wasn't necessary to have a watchdog
> > > > as seems devices did not hung before EDCCA was added.
> > > 
> > > IIRC I added the first watchdog implementation to fix tx hangs that occur
> > > under heavy load even using FCC regulatory (so when EDCCA processing is
> > > disabled)
> > 
> > There was changes in various registers programming introduced by EDCCA
> > support, even with EDCCA disabled. It's rally not convenient that
> > watchdog and EDCCA are not related, since you added tx hung watchdog
> > 2 weeks after adding EDCCA.
> > 
> > You can look at this report:
> > https://github.com/openwrt/mt76/issues/246
> > Before mt76x2e worked without hungs & watchodg. Now, even with EDCCA
> > disabled watchdog and HW restarts are required to fix hungs on runtime.
> 
> Tx hangs occur in very particular conditions (e.g 200Mbps bidirectional
> traffic) and moreover they do not always occur so I am not convinced they
> are always EDCCA related and so I am not confident to remove the watchdog

I'm not opting for watchdog removal, but for full EDCCA removal.
Apparently nobody cares, if it can be enabled or not.

Stanislaw

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca
  2019-05-15 13:48                         ` Stanislaw Gruszka
@ 2019-05-15 13:59                           ` Stanislaw Gruszka
  0 siblings, 0 replies; 16+ messages in thread
From: Stanislaw Gruszka @ 2019-05-15 13:59 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: Kalle Valo, nbd, lorenzo.bianconi, linux-wireless

On Wed, May 15, 2019 at 03:48:29PM +0200, Stanislaw Gruszka wrote:
> > Tx hangs occur in very particular conditions (e.g 200Mbps bidirectional
> > traffic) and moreover they do not always occur so I am not convinced they
> > are always EDCCA related and so I am not confident to remove the watchdog
> 
> I'm not opting for watchdog removal, but for full EDCCA removal.
On mt76x02, on other chips/firmwares it can work just fine.

Stanislaw

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-05-15 13:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1557591530.git.lorenzo@kernel.org>
2019-05-11 16:38 ` [PATCH] mt76: mt7603: add debugfs knob to enable/disable edcca Lorenzo Bianconi
2019-05-13  4:26   ` Kalle Valo
2019-05-13  8:41     ` Lorenzo Bianconi
2019-05-13  9:48       ` Stanislaw Gruszka
2019-05-15  9:33         ` Stanislaw Gruszka
2019-05-15  9:43           ` Lorenzo Bianconi
2019-05-15  9:54             ` Stanislaw Gruszka
2019-05-15 10:03               ` Lorenzo Bianconi
2019-05-15 10:33                 ` Stanislaw Gruszka
2019-05-15 11:13                   ` Lorenzo Bianconi
2019-05-15 11:46                     ` Stanislaw Gruszka
2019-05-15 12:07                       ` Lorenzo Bianconi
2019-05-15 13:48                         ` Stanislaw Gruszka
2019-05-15 13:59                           ` Stanislaw Gruszka
2019-05-13 12:37       ` Kalle Valo
2019-05-13 15:41         ` Lorenzo Bianconi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.