2016-09-09 18:01:27

by Jes Sorensen

[permalink] [raw]
Subject: [PATCH 0/2] Fix spelling and reset device on module unload

From: Jes Sorensen <[email protected]>

Hi,

Two fixes for the rtl8xxxu driver.

I am working on a much larger set which adds 8188eu support, and while
it's close to there, I am still chasing one issue where it doesn't
come back if reloading the driver module.

In the interim, these two should be good to apply.

Cheers,
Jes


Colin Ian King (1):
rtl8xxxu: fix spelling mistake "firmare" -> "firmware"

Jes Sorensen (1):
rtl8xxxu: Reset device on module unload if still attached

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

--
2.7.4


2016-09-09 18:01:27

by Jes Sorensen

[permalink] [raw]
Subject: [PATCH 2/2] rtl8xxxu: fix spelling mistake "firmare" -> "firmware"

From: Colin Ian King <[email protected]>

Trivial fix to spelling mistakes in dev_dbg message.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Jes Sorensen <[email protected]>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index d2611a4..ca92022 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -3921,11 +3921,11 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
rtl8xxxu_write16(priv, REG_TRXFF_BNDY + 2, priv->fops->trxff_boundary);

ret = rtl8xxxu_download_firmware(priv);
- dev_dbg(dev, "%s: download_fiwmare %i\n", __func__, ret);
+ dev_dbg(dev, "%s: download_firmware %i\n", __func__, ret);
if (ret)
goto exit;
ret = rtl8xxxu_start_firmware(priv);
- dev_dbg(dev, "%s: start_fiwmare %i\n", __func__, ret);
+ dev_dbg(dev, "%s: start_firmware %i\n", __func__, ret);
if (ret)
goto exit;

--
2.7.4

2016-09-14 17:01:27

by Kalle Valo

[permalink] [raw]
Subject: Re: [1/2] rtl8xxxu: Reset device on module unload if still attached

Jes Sorensen <[email protected]> wrote:
> From: Jes Sorensen <[email protected]>
>
> If the USB dongle is still attached, reset it on module unload to
> avoid scans failing when reloading the driver.
>
> Signed-off-by: Jes Sorensen <[email protected]>

Thanks, 2 patches applied to wireless-drivers-next.git:

54cdf5c727cb rtl8xxxu: Reset device on module unload if still attached
0cd7f70399f7 rtl8xxxu: fix spelling mistake "firmare" -> "firmware"

--
Sent by pwcli
https://patchwork.kernel.org/patch/9324069/

2016-09-09 18:01:27

by Jes Sorensen

[permalink] [raw]
Subject: [PATCH 1/2] rtl8xxxu: Reset device on module unload if still attached

From: Jes Sorensen <[email protected]>

If the USB dongle is still attached, reset it on module unload to
avoid scans failing when reloading the driver.

Signed-off-by: Jes Sorensen <[email protected]>
---
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index c362083..d2611a4 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -6129,6 +6129,11 @@ static void rtl8xxxu_disconnect(struct usb_interface *interface)
mutex_destroy(&priv->usb_buf_mutex);
mutex_destroy(&priv->h2c_mutex);

+ if (priv->udev->state != USB_STATE_NOTATTACHED) {
+ dev_info(&priv->udev->dev,
+ "Device still attached, trying to reset\n");
+ usb_reset_device(priv->udev);
+ }
usb_put_dev(priv->udev);
ieee80211_free_hw(hw);
}
--
2.7.4