All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages
@ 2022-06-23  0:35 sean.wang
  2022-06-23  0:35 ` [PATCH 2/2] mt76: mt7921: reduce the mutex lock scope during reset sean.wang
  2022-06-23  8:48 ` [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages AngeloGioacchino Del Regno
  0 siblings, 2 replies; 5+ messages in thread
From: sean.wang @ 2022-06-23  0:35 UTC (permalink / raw)
  To: nbd, lorenzo.bianconi
  Cc: sean.wang, Soul.Huang, YN.Chen, Leon.Yen, Eric-SY.Chang,
	Deren.Wu, km.lin, jenhao.yang, robin.chiu, Eddie.Chen, ch.yeh,
	posh.sun, ted.huang, Stella.Chang, Tom.Chou, steve.lee, jsiuda,
	frankgor, kuabhs, druth, abhishekpandit, shawnku, linux-wireless,
	linux-mediatek

From: Sean Wang <sean.wang@mediatek.com>

Use dev_info instead for the informative messages.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index eb1bfb682e02..2ce3a833176e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -740,7 +740,7 @@ void mt7921_mac_reset_work(struct work_struct *work)
 	struct mt76_connac_pm *pm = &dev->pm;
 	int i;
 
-	dev_err(dev->mt76.dev, "chip reset\n");
+	dev_info(dev->mt76.dev, "chip reset\n");
 	dev->hw_full_reset = true;
 	ieee80211_stop_queues(hw);
 
-- 
2.25.1


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

* [PATCH 2/2] mt76: mt7921: reduce the mutex lock scope during reset
  2022-06-23  0:35 [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages sean.wang
@ 2022-06-23  0:35 ` sean.wang
  2022-06-23  8:56   ` AngeloGioacchino Del Regno
  2022-06-23  8:48 ` [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages AngeloGioacchino Del Regno
  1 sibling, 1 reply; 5+ messages in thread
From: sean.wang @ 2022-06-23  0:35 UTC (permalink / raw)
  To: nbd, lorenzo.bianconi
  Cc: sean.wang, Soul.Huang, YN.Chen, Leon.Yen, Eric-SY.Chang,
	Deren.Wu, km.lin, jenhao.yang, robin.chiu, Eddie.Chen, ch.yeh,
	posh.sun, ted.huang, Stella.Chang, Tom.Chou, steve.lee, jsiuda,
	frankgor, kuabhs, druth, abhishekpandit, shawnku, linux-wireless,
	linux-mediatek

From: Sean Wang <sean.wang@mediatek.com>

Reduce the mutex lock scope for reset to get rid of possible task hung
e.g wpa_supplicant and to allow the user-space process to keep running
during we need more retries to complete the reset.

Suggested-by: YN Chen <YN.Chen@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index 2ce3a833176e..c7bca83e7686 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -738,7 +738,7 @@ void mt7921_mac_reset_work(struct work_struct *work)
 					      reset_work);
 	struct ieee80211_hw *hw = mt76_hw(dev);
 	struct mt76_connac_pm *pm = &dev->pm;
-	int i;
+	int i, ret;
 
 	dev_info(dev->mt76.dev, "chip reset\n");
 	dev->hw_full_reset = true;
@@ -748,11 +748,14 @@ void mt7921_mac_reset_work(struct work_struct *work)
 	cancel_delayed_work_sync(&pm->ps_work);
 	cancel_work_sync(&pm->wake_work);
 
-	mutex_lock(&dev->mt76.mutex);
-	for (i = 0; i < 10; i++)
-		if (!mt7921_dev_reset(dev))
+	for (i = 0; i < 10; i++) {
+		mutex_lock(&dev->mt76.mutex);
+		ret = mt7921_dev_reset(dev);
+		mutex_unlock(&dev->mt76.mutex);
+
+		if (!ret)
 			break;
-	mutex_unlock(&dev->mt76.mutex);
+	}
 
 	if (i == 10)
 		dev_err(dev->mt76.dev, "chip reset failed\n");
-- 
2.25.1


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

* Re: [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages
  2022-06-23  0:35 [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages sean.wang
  2022-06-23  0:35 ` [PATCH 2/2] mt76: mt7921: reduce the mutex lock scope during reset sean.wang
@ 2022-06-23  8:48 ` AngeloGioacchino Del Regno
  2022-06-29 17:26   ` Kalle Valo
  1 sibling, 1 reply; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23  8:48 UTC (permalink / raw)
  To: sean.wang, nbd, lorenzo.bianconi
  Cc: Soul.Huang, YN.Chen, Leon.Yen, Eric-SY.Chang, Deren.Wu, km.lin,
	jenhao.yang, robin.chiu, Eddie.Chen, ch.yeh, posh.sun, ted.huang,
	Stella.Chang, Tom.Chou, steve.lee, jsiuda, frankgor, kuabhs,
	druth, abhishekpandit, shawnku, linux-wireless, linux-mediatek

Il 23/06/22 02:35, sean.wang@mediatek.com ha scritto:
> From: Sean Wang <sean.wang@mediatek.com>
> 
> Use dev_info instead for the informative messages.
> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>   drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> index eb1bfb682e02..2ce3a833176e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> @@ -740,7 +740,7 @@ void mt7921_mac_reset_work(struct work_struct *work)
>   	struct mt76_connac_pm *pm = &dev->pm;
>   	int i;
>   
> -	dev_err(dev->mt76.dev, "chip reset\n");
> +	dev_info(dev->mt76.dev, "chip reset\n");

Since this function is normally expected to be called and this message is
describing the wanted flow and/or this worker function starting, I'd say
that this is not a really important information anyway...

What about changing that one to a dev_dbg() instead?

Regards,
Angelo

>   	dev->hw_full_reset = true;
>   	ieee80211_stop_queues(hw);
>   


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

* Re: [PATCH 2/2] mt76: mt7921: reduce the mutex lock scope during reset
  2022-06-23  0:35 ` [PATCH 2/2] mt76: mt7921: reduce the mutex lock scope during reset sean.wang
@ 2022-06-23  8:56   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 5+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-23  8:56 UTC (permalink / raw)
  To: sean.wang, nbd, lorenzo.bianconi
  Cc: Soul.Huang, YN.Chen, Leon.Yen, Eric-SY.Chang, Deren.Wu, km.lin,
	jenhao.yang, robin.chiu, Eddie.Chen, ch.yeh, posh.sun, ted.huang,
	Stella.Chang, Tom.Chou, steve.lee, jsiuda, frankgor, kuabhs,
	druth, abhishekpandit, shawnku, linux-wireless, linux-mediatek

Il 23/06/22 02:35, sean.wang@mediatek.com ha scritto:
> From: Sean Wang <sean.wang@mediatek.com>
> 
> Reduce the mutex lock scope for reset to get rid of possible task hung
> e.g wpa_supplicant and to allow the user-space process to keep running
> during we need more retries to complete the reset.
> 

To actually, effectively, reduce the chance to get a hung task, and also
to improve the general responsiveness, I think that the best way would be
to manage the locking inside of the reset callback(s) for each dev/bus.

This is especially because some of these reset functions (like the SDIO one)
may end up waiting for more than *two seconds*.

However, I get that this proposal requires way more effort, and this commit
will anyway improve the situation as it is... so, you get my:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

> Suggested-by: YN Chen <YN.Chen@mediatek.com>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>

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

* Re: [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages
  2022-06-23  8:48 ` [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages AngeloGioacchino Del Regno
@ 2022-06-29 17:26   ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2022-06-29 17:26 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: sean.wang, nbd, lorenzo.bianconi, Soul.Huang, YN.Chen, Leon.Yen,
	Eric-SY.Chang, Deren.Wu, km.lin, jenhao.yang, robin.chiu,
	Eddie.Chen, ch.yeh, posh.sun, ted.huang, Stella.Chang, Tom.Chou,
	steve.lee, jsiuda, frankgor, kuabhs, druth, abhishekpandit,
	shawnku, linux-wireless, linux-mediatek

AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
writes:

> Il 23/06/22 02:35, sean.wang@mediatek.com ha scritto:
>> From: Sean Wang <sean.wang@mediatek.com>
>>
>> Use dev_info instead for the informative messages.
>>
>> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
>> ---
>>   drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>> index eb1bfb682e02..2ce3a833176e 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>> @@ -740,7 +740,7 @@ void mt7921_mac_reset_work(struct work_struct *work)
>>   	struct mt76_connac_pm *pm = &dev->pm;
>>   	int i;
>>   -	dev_err(dev->mt76.dev, "chip reset\n");
>> +	dev_info(dev->mt76.dev, "chip reset\n");
>
> Since this function is normally expected to be called and this message is
> describing the wanted flow and/or this worker function starting, I'd say
> that this is not a really important information anyway...
>
> What about changing that one to a dev_dbg() instead?

Yeah, that would be better.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

end of thread, other threads:[~2022-06-29 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23  0:35 [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages sean.wang
2022-06-23  0:35 ` [PATCH 2/2] mt76: mt7921: reduce the mutex lock scope during reset sean.wang
2022-06-23  8:56   ` AngeloGioacchino Del Regno
2022-06-23  8:48 ` [PATCH 1/2] mt76: mt7921: reduce log severity levels for informative messages AngeloGioacchino Del Regno
2022-06-29 17:26   ` Kalle Valo

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.