linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mt7601u: check the status of device in calibration
@ 2020-12-17 16:16 Zhi Han
  2020-12-17 16:55 ` Jakub Kicinski
  2021-01-14 17:30 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Zhi Han @ 2020-12-17 16:16 UTC (permalink / raw)
  To: linux-wireless; +Cc: kuba

When the usb device being plugged out, before ieee80211 gets to know the
hw being removed, it gets to know that the association status changed,
and thus ask for the device to do the calibration. This causes error as
the hw is absent.

This can be avoid by checking the status of the device before sending
the calibration request to the device.

Signed-off-by: Zhi Han <z.han@gmx.net>
---
 drivers/net/wireless/mediatek/mt7601u/phy.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt7601u/phy.c b/drivers/net/wireless/mediatek/mt7601u/phy.c
index 28db24a2b5e5..8a00f6a75ca9 100644
--- a/drivers/net/wireless/mediatek/mt7601u/phy.c
+++ b/drivers/net/wireless/mediatek/mt7601u/phy.c
@@ -586,6 +586,9 @@ static void mt7601u_rxdc_cal(struct mt7601u_dev *dev)

 void mt7601u_phy_recalibrate_after_assoc(struct mt7601u_dev *dev)
 {
+	if (test_bit(MT7601U_STATE_REMOVED, &dev->state))
+		return;
+
 	mt7601u_mcu_calibrate(dev, MCU_CAL_DPD, dev->curr_temp);

 	mt7601u_rxdc_cal(dev);

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

* Re: [PATCH] mt7601u: check the status of device in calibration
  2020-12-17 16:16 [PATCH] mt7601u: check the status of device in calibration Zhi Han
@ 2020-12-17 16:55 ` Jakub Kicinski
  2021-01-14 17:30 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-12-17 16:55 UTC (permalink / raw)
  To: Zhi Han; +Cc: linux-wireless

On Thu, 17 Dec 2020 17:16:57 +0100 Zhi Han wrote:
> When the usb device being plugged out, before ieee80211 gets to know the
> hw being removed, it gets to know that the association status changed,
> and thus ask for the device to do the calibration. This causes error as
> the hw is absent.
> 
> This can be avoid by checking the status of the device before sending
> the calibration request to the device.
> 
> Signed-off-by: Zhi Han <z.han@gmx.net>

Acked-by: Jakub Kicinski <kuba@kernel.org>

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

* Re: [PATCH] mt7601u: check the status of device in calibration
  2020-12-17 16:16 [PATCH] mt7601u: check the status of device in calibration Zhi Han
  2020-12-17 16:55 ` Jakub Kicinski
@ 2021-01-14 17:30 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-01-14 17:30 UTC (permalink / raw)
  To: Zhi Han; +Cc: linux-wireless, kuba

Zhi Han <z.han@gmx.net> wrote:

> When the usb device being plugged out, before ieee80211 gets to know the
> hw being removed, it gets to know that the association status changed,
> and thus ask for the device to do the calibration. This causes error as
> the hw is absent.
> 
> This can be avoid by checking the status of the device before sending
> the calibration request to the device.
> 
> Signed-off-by: Zhi Han <z.han@gmx.net>
> Acked-by: Jakub Kicinski <kuba@kernel.org>

Patch applied to wireless-drivers-next.git, thanks.

1dac51269d05 mt7601u: check the status of device in calibration

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20201217161657.GB12562@E480/

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


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

end of thread, other threads:[~2021-01-14 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 16:16 [PATCH] mt7601u: check the status of device in calibration Zhi Han
2020-12-17 16:55 ` Jakub Kicinski
2021-01-14 17:30 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).