All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] rtl8xxxu: Fix driver reload issues with 8723bu and 8192eu
@ 2016-09-30 23:35 Jes.Sorensen
  2016-09-30 23:35 ` [PATCH 1/2] rtl8xxxu: Fix rtl8723bu driver reload issue Jes.Sorensen
  2016-09-30 23:35 ` [PATCH 2/2] rtl8xxxu: Fix rtl8192eu " Jes.Sorensen
  0 siblings, 2 replies; 8+ messages in thread
From: Jes.Sorensen @ 2016-09-30 23:35 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, Larry.Finger, stable, Jes Sorensen

From: Jes Sorensen <Jes.Sorensen@redhat.com>

Hi,

These two patches fix issues where rtl8723bu and rtl8192eu dongles
would stop receving data if one reloaded the driver module, requiring
it to be physically removed and reinserted.

Both issues are applicable to 4.9. The first patch for 8723bu is
applicable to stable 4.7 and 4.8. The second patch will only be
applicable to stable 4.8, once patches currently in flight are merged
by the network maintainers.

Cheers,
Jes


Jes Sorensen (2):
  rtl8xxxu: Fix rtl8723bu driver reload issue
  rtl8xxxu: Fix rtl8192eu driver reload issue

 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 8 +++++++-
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 4 ++++
 2 files changed, 11 insertions(+), 1 deletion(-)

-- 
2.7.4

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

* [PATCH 1/2] rtl8xxxu: Fix rtl8723bu driver reload issue
  2016-09-30 23:35 [PATCH 0/2] rtl8xxxu: Fix driver reload issues with 8723bu and 8192eu Jes.Sorensen
@ 2016-09-30 23:35 ` Jes.Sorensen
  2016-10-01 11:56   ` Greg KH
  2016-10-07 11:24   ` [1/2] " Kalle Valo
  2016-09-30 23:35 ` [PATCH 2/2] rtl8xxxu: Fix rtl8192eu " Jes.Sorensen
  1 sibling, 2 replies; 8+ messages in thread
From: Jes.Sorensen @ 2016-09-30 23:35 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, Larry.Finger, stable, Jes Sorensen

From: Jes Sorensen <Jes.Sorensen@redhat.com>

The generic disable_rf() function clears bits 22 and 23 in
REG_RX_WAIT_CCA, however we did not re-enable them again in
rtl8723b_enable_rf()

This resolves the problem for me with 8723bu devices not working again
after reloading the driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
index 6c086b5..02b8ddd 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
@@ -1498,6 +1498,10 @@ static void rtl8723b_enable_rf(struct rtl8xxxu_priv *priv)
 	u32 val32;
 	u8 val8;
 
+	val32 = rtl8xxxu_read32(priv, REG_RX_WAIT_CCA);
+	val32 |= (BIT(22) | BIT(23));
+	rtl8xxxu_write32(priv, REG_RX_WAIT_CCA, val32);
+
 	/*
 	 * No indication anywhere as to what 0x0790 does. The 2 antenna
 	 * vendor code preserves bits 6-7 here.
-- 
2.7.4

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

* [PATCH 2/2] rtl8xxxu: Fix rtl8192eu driver reload issue
  2016-09-30 23:35 [PATCH 0/2] rtl8xxxu: Fix driver reload issues with 8723bu and 8192eu Jes.Sorensen
  2016-09-30 23:35 ` [PATCH 1/2] rtl8xxxu: Fix rtl8723bu driver reload issue Jes.Sorensen
@ 2016-09-30 23:35 ` Jes.Sorensen
  2016-10-03  7:30   ` Kalle Valo
  1 sibling, 1 reply; 8+ messages in thread
From: Jes.Sorensen @ 2016-09-30 23:35 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, Larry.Finger, stable, Jes Sorensen

From: Jes Sorensen <Jes.Sorensen@redhat.com>

The 8192eu suffered from two issues when reloading the driver.

The same problems as with the 8723bu where REG_RX_WAIT_CCA bits 22 and
23 didn't get set in rtl8192e_enable_rf().

In addition it also seems prone to issues when setting REG_RF_CTRL to
0 intead of just disabling the RF_ENABLE bit. Similar to what was
causing issues with the 8188eu.

With this patch I can successfully reload the driver and reassociate
to an APi with an 8192eu dongle.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
index df54d27..a793fed 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
@@ -1461,7 +1461,9 @@ static int rtl8192eu_active_to_emu(struct rtl8xxxu_priv *priv)
 	int count, ret = 0;
 
 	/* Turn off RF */
-	rtl8xxxu_write8(priv, REG_RF_CTRL, 0);
+	val8 = rtl8xxxu_read8(priv, REG_RF_CTRL);
+	val8 &= ~RF_ENABLE;
+	rtl8xxxu_write8(priv, REG_RF_CTRL, val8);
 
 	/* Switch DPDT_SEL_P output from register 0x65[2] */
 	val8 = rtl8xxxu_read8(priv, REG_LEDCFG2);
@@ -1593,6 +1595,10 @@ static void rtl8192e_enable_rf(struct rtl8xxxu_priv *priv)
 	u32 val32;
 	u8 val8;
 
+	val32 = rtl8xxxu_read32(priv, REG_RX_WAIT_CCA);
+	val32 |= (BIT(22) | BIT(23));
+	rtl8xxxu_write32(priv, REG_RX_WAIT_CCA, val32);
+
 	val8 = rtl8xxxu_read8(priv, REG_GPIO_MUXCFG);
 	val8 |= BIT(5);
 	rtl8xxxu_write8(priv, REG_GPIO_MUXCFG, val8);
-- 
2.7.4

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

* Re: [PATCH 1/2] rtl8xxxu: Fix rtl8723bu driver reload issue
  2016-09-30 23:35 ` [PATCH 1/2] rtl8xxxu: Fix rtl8723bu driver reload issue Jes.Sorensen
@ 2016-10-01 11:56   ` Greg KH
  2016-10-01 12:29     ` Jes Sorensen
  2016-10-07 11:24   ` [1/2] " Kalle Valo
  1 sibling, 1 reply; 8+ messages in thread
From: Greg KH @ 2016-10-01 11:56 UTC (permalink / raw)
  To: Jes.Sorensen; +Cc: linux-wireless, kvalo, Larry.Finger, stable

On Fri, Sep 30, 2016 at 07:35:17PM -0400, Jes.Sorensen@redhat.com wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
> 
> The generic disable_rf() function clears bits 22 and 23 in
> REG_RX_WAIT_CCA, however we did not re-enable them again in
> rtl8723b_enable_rf()
> 
> This resolves the problem for me with 8723bu devices not working again
> after reloading the driver.
> 
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 4 ++++
>  1 file changed, 4 insertions(+)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>

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

* Re: [PATCH 1/2] rtl8xxxu: Fix rtl8723bu driver reload issue
  2016-10-01 11:56   ` Greg KH
@ 2016-10-01 12:29     ` Jes Sorensen
  2016-10-03  7:29       ` Kalle Valo
  0 siblings, 1 reply; 8+ messages in thread
From: Jes Sorensen @ 2016-10-01 12:29 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-wireless, kvalo, Larry.Finger, stable

Greg KH <greg@kroah.com> writes:
> On Fri, Sep 30, 2016 at 07:35:17PM -0400, Jes.Sorensen@redhat.com wrote:
>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>> 
>> The generic disable_rf() function clears bits 22 and 23 in
>> REG_RX_WAIT_CCA, however we did not re-enable them again in
>> rtl8723b_enable_rf()
>> 
>> This resolves the problem for me with 8723bu devices not working again
>> after reloading the driver.
>> 
>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>> ---
>>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>
> <formletter>
>
> This is not the correct way to submit patches for inclusion in the
> stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
> for how to do this properly.
>
> </formletter>

DOH Kalle told me to CC stable I took it for granted that you meant CC
in the email sense. Guess I get to blame my self for looking like a
fool in public.

I'll send you an email directly with the SHA once it hits Linus' tree
instead.

Jes

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

* Re: [PATCH 1/2] rtl8xxxu: Fix rtl8723bu driver reload issue
  2016-10-01 12:29     ` Jes Sorensen
@ 2016-10-03  7:29       ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2016-10-03  7:29 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: Greg KH, linux-wireless, Larry.Finger, stable

Jes Sorensen <Jes.Sorensen@redhat.com> writes:

> Greg KH <greg@kroah.com> writes:
>> On Fri, Sep 30, 2016 at 07:35:17PM -0400, Jes.Sorensen@redhat.com wrote:
>>> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>>> 
>>> The generic disable_rf() function clears bits 22 and 23 in
>>> REG_RX_WAIT_CCA, however we did not re-enable them again in
>>> rtl8723b_enable_rf()
>>> 
>>> This resolves the problem for me with 8723bu devices not working again
>>> after reloading the driver.
>>> 
>>> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
>>> ---
>>>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>
>> <formletter>
>>
>> This is not the correct way to submit patches for inclusion in the
>> stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
>> for how to do this properly.
>>
>> </formletter>
>
> DOH Kalle told me to CC stable I took it for granted that you meant CC
> in the email sense. Guess I get to blame my self for looking like a
> fool in public.

Yes, I meant adding it to the commit log. This part of the stable
process is a bit confusing, I should have been more clear how this
works.

> I'll send you an email directly with the SHA once it hits Linus' tree
> instead.

No need, I'll add this to the commit log and the stable team will get
the commit automatically once the commit is in Linus' tree:

Cc: stable@vger.kernel.org # 4.7+

-- 
Kalle Valo

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

* Re: [PATCH 2/2] rtl8xxxu: Fix rtl8192eu driver reload issue
  2016-09-30 23:35 ` [PATCH 2/2] rtl8xxxu: Fix rtl8192eu " Jes.Sorensen
@ 2016-10-03  7:30   ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2016-10-03  7:30 UTC (permalink / raw)
  To: Jes.Sorensen; +Cc: linux-wireless, Larry.Finger, stable

Jes.Sorensen@redhat.com writes:

> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> The 8192eu suffered from two issues when reloading the driver.
>
> The same problems as with the 8723bu where REG_RX_WAIT_CCA bits 22 and
> 23 didn't get set in rtl8192e_enable_rf().
>
> In addition it also seems prone to issues when setting REG_RF_CTRL to
> 0 intead of just disabling the RF_ENABLE bit. Similar to what was
> causing issues with the 8188eu.
>
> With this patch I can successfully reload the driver and reassociate
> to an APi with an 8192eu dongle.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>

I'll add:

Cc: stable@vger.kernel.org # 4.8+

-- 
Kalle Valo

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

* Re: [1/2] rtl8xxxu: Fix rtl8723bu driver reload issue
  2016-09-30 23:35 ` [PATCH 1/2] rtl8xxxu: Fix rtl8723bu driver reload issue Jes.Sorensen
  2016-10-01 11:56   ` Greg KH
@ 2016-10-07 11:24   ` Kalle Valo
  1 sibling, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2016-10-07 11:24 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: linux-wireless, Larry.Finger, stable, Jes Sorensen

Jes Sorensen <Jes.Sorensen@redhat.com> wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
> 
> The generic disable_rf() function clears bits 22 and 23 in
> REG_RX_WAIT_CCA, however we did not re-enable them again in
> rtl8723b_enable_rf()
> 
> This resolves the problem for me with 8723bu devices not working again
> after reloading the driver.
> 
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> Cc: stable@vger.kernel.org # 4.7+

2 patches applied to wireless-drivers.git, thanks.

ab05e5ec81c7 rtl8xxxu: Fix rtl8723bu driver reload issue
29d5e6fbd65b rtl8xxxu: Fix rtl8192eu driver reload issue

-- 
https://patchwork.kernel.org/patch/9359015/

Documentation about submitting wireless patches and checking status
from patchwork:

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

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

end of thread, other threads:[~2016-10-07 11:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-30 23:35 [PATCH 0/2] rtl8xxxu: Fix driver reload issues with 8723bu and 8192eu Jes.Sorensen
2016-09-30 23:35 ` [PATCH 1/2] rtl8xxxu: Fix rtl8723bu driver reload issue Jes.Sorensen
2016-10-01 11:56   ` Greg KH
2016-10-01 12:29     ` Jes Sorensen
2016-10-03  7:29       ` Kalle Valo
2016-10-07 11:24   ` [1/2] " Kalle Valo
2016-09-30 23:35 ` [PATCH 2/2] rtl8xxxu: Fix rtl8192eu " Jes.Sorensen
2016-10-03  7:30   ` 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.