Skip to contentSkip to conversation

*** SUBJECT HERE ***

PATCH In review [email protected] 4 participants 13 messages May 3, 2011 Staging

lore
Share & tools
lore
#0 lore raw

cover *** SUBJECT HERE ***

From: Sukesh Srikakula <[email protected]>

*** BLURB HERE ***

Sukesh Srikakula (2):
brcm80211: FIX for TKIP GTK bug
brcm80211: Fix for suspend/resume bug

 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    4 ----
 drivers/staging/brcm80211/brcmfmac/dhd.h          |    3 +++
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |    6 ++++--
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c  |   12 ++++++++++++
 4 files changed, 19 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.3.2
#1 lore raw

PATCH 1/2 brcm80211: FIX for TKIP GTK bug

From: Sukesh Srikakula <[email protected]>

The last 16 bytes of the key sent by cfg80211 needs to be swapped before installing it to FW for TKIP encryption. This is not done for the group key in current code, which is corrected with this fix.

---
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +4 -0
index b44daf9..c60fc7c 100644
@@ -1616,6 +1616,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 	s32 val;
 	s32 wsec;
 	s32 err = 0;
+	u8 keybuf[8];
 
 	WL_DBG("key index (%d)\n", key_idx);
 	CHECK_SYS_UP();
@@ -1644,6 +1645,9 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
 		WL_DBG("WLAN_CIPHER_SUITE_WEP104\n");
 		break;
 	case WLAN_CIPHER_SUITE_TKIP:
+		memcpy(keybuf, &key.data[24], sizeof(keybuf));
+		memcpy(&key.data[24], &key.data[16], sizeof(keybuf));
+		memcpy(&key.data[16], keybuf, sizeof(keybuf));
 		key.algo = CRYPTO_ALGO_TKIP;
 		WL_DBG("WLAN_CIPHER_SUITE_TKIP\n");
 		break;
Signature · 1 line
1.7.3.2
#2 lore raw

PATCH 2/2 brcm80211: Fix for suspend/resume bug

In reply to [email protected]

From: Sukesh Srikakula <[email protected]>

Currently, there are 2 callbacks registered with OS for getting notifications when system goes to suspend/resume.
Racing between these 2 callbacks leads to failure in the suspend/resume path.
With this fix, we avoid registering dhd callback for suspend/resume notification when cfg80211 is used. Relevant functionality in dhd suspend/resume callback function is moved to cfg80211 suspend/resume functions.

---
 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c |    4 ----
 drivers/staging/brcm80211/brcmfmac/dhd.h          |    3 +++
 drivers/staging/brcm80211/brcmfmac/dhd_linux.c    |    6 ++++--
 drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c  |    8 ++++++++
 4 files changed, 15 insertions(+), 6 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -4
index 05f50d3..54ba30d 100644
@@ -30,10 +30,6 @@
 #include <dngl_stats.h>
 #include <dhd.h>
 
-#if defined(CONFIG_PM_SLEEP)
-#include <linux/suspend.h>
-extern volatile bool dhd_mmc_suspend;
-#endif
 #include "bcmsdh_sdmmc.h"
 
 extern int sdio_function_init(void);
drivers/staging/brcm80211/brcmfmac/dhd.h +3 -0
index 99c38dd..41c55a6 100644
@@ -31,6 +31,7 @@
 #include <linux/random.h>
 #include <linux/spinlock.h>
 #include <linux/ethtool.h>
+#include <linux/suspend.h>
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
 /* The kernel threading is sdio-specific */
@@ -123,6 +124,8 @@ typedef struct dhd_pub {
 
 #if defined(CONFIG_PM_SLEEP)
 
+extern volatile bool dhd_mmc_suspend;
+
 #define DHD_PM_RESUME_WAIT_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
 #define _DHD_PM_RESUME_WAIT(a, b) do {\
 			int retry = 0; \
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +4 -2
index b34c4ea..37b2c0c 100644
@@ -2015,7 +2015,8 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
 	g_bus = bus;
 #endif
 #if defined(CONFIG_PM_SLEEP)
-	register_pm_notifier(&dhd_sleep_pm_notifier);
+	if (!IS_CFG80211_FAVORITE())
+		register_pm_notifier(&dhd_sleep_pm_notifier);
 #endif	/* defined(CONFIG_PM_SLEEP) */
 	/* && defined(DHD_GPL) */
 	/* Init lock suspend to prevent kernel going to suspend */
@@ -2325,7 +2326,8 @@ void dhd_detach(dhd_pub_t *dhdp)
 				wl_cfg80211_detach();
 
 #if defined(CONFIG_PM_SLEEP)
-			unregister_pm_notifier(&dhd_sleep_pm_notifier);
+			if (!IS_CFG80211_FAVORITE())
+				unregister_pm_notifier(&dhd_sleep_pm_notifier);
 #endif	/* defined(CONFIG_PM_SLEEP) */
 			/* && defined(DHD_GPL) */
 			free_netdev(ifp->net);
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +8 -0
index c60fc7c..db77e60 100644
@@ -1971,6 +1971,10 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
 {
 	s32 err = 0;
 
+#if defined(CONFIG_PM_SLEEP)
+	dhd_mmc_suspend = false;
+#endif /*  defined(CONFIG_PM_SLEEP) */
+
 	CHECK_SYS_UP();
 	wl_invoke_iscan(wiphy_to_wl(wiphy));
 
@@ -1996,6 +2000,10 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy)
 
 	sdioh_sdio_set_host_pm_flags(MMC_PM_KEEP_POWER);
 
+#if defined(CONFIG_PM_SLEEP)
+	dhd_mmc_suspend = true;
+#endif /*  defined(CONFIG_PM_SLEEP) */
+
 	return err;
 }
 
Signature · 1 line
1.7.3.2
#3 lore raw

Re: [PATCH 2/2] brcm80211: Fix for suspend/resume bug

Quoted 14 lines · On 05/03/2011 09:00 AM, [email protected] wrote:

From: Sukesh Srikakula<[email protected]>

Currently, there are 2 callbacks registered with OS for getting notifications when system goes to suspend/resume.
Racing between these 2 callbacks leads to failure in the suspend/resume path.
With this fix, we avoid registering dhd callback for suspend/resume notification when cfg80211 is used. Relevant functionality in dhd suspend/resume callback function is moved to cfg80211 suspend/resume functions.

---

drivers/staging/brcm80211/brcmfmac/dhd.h +0 -0
index 99c38dd..41c55a6 100644

drivers/staging/brcm80211/brcmfmac/dhd.h typedef struct dhd_pub { · line 128

Quoted 5 lines
drivers/staging/brcm80211/brcmfmac/dhd.h +2 -0
@@ -123,6 +124,8 @@ typedef struct dhd_pub {
 
  #if defined(CONFIG_PM_SLEEP)
 
+extern volatile bool dhd_mmc_suspend;
+

You probably should run checkpatch.pl on this patch. The volatile keyword triggers a warning here. I grepped the fullmac code and this variable is only set so what is its purpose (debugging?)? See Documentation/volatile-considered-harmful.txt on this topic.

Gr. AvS

#4 lore raw

Re: [PATCH 2/2] brcm80211: Fix for suspend/resume bug

In reply to [email protected]
Quoted 3 lines · On Tue, May 03, 2011 at 12:00:57AM -0700, [email protected] wrote:

#if defined(CONFIG_PM_SLEEP)

+extern volatile bool dhd_mmc_suspend;

This does not do what you think it does.

#5 lore raw

Re: [PATCH 2/2] brcm80211: Fix for suspend/resume bug

Quoted 5 lines · Greg KH
Quoted 3 lines · On Tue, May 03, 2011 at 12:00:57AM -0700, [email protected] wrote:
  #if defined(CONFIG_PM_SLEEP)

+extern volatile bool dhd_mmc_suspend;

This does not do what you think it does.

Hi Greg,

I posted the 'catchup' patch set and I rebased it on '[PATCH 1/2] brcm80211: FIX for TKIP GTK bug' from Sukesh. The only other two patches I saw on the linuxdriver list are:

staging: brcm80211: brcmfmac: Add and use dhd_dbg [[email protected]] => he rejected it himself.
STAGING: brcm80211 SDIO/MMC cleanups [[email protected]] => does not apply.

So I discarded those two as well.

Gr. AvS

#6 lore raw

Re: [PATCH 2/2] brcm80211: Fix for suspend/resume bug

Quoted 4 lines · Arend van Spriel
Quoted 3 lines · Greg KH
Quoted 2 lines · On Tue, May 03, 2011 at 12:00:57AM -0700, [email protected] wrote:

#if defined(CONFIG_PM_SLEEP)

Quoted 8 lines
Quoted 2 lines
Quoted 1 line

+extern volatile bool dhd_mmc_suspend;

This does not do what you think it does.

Hi Greg,

I posted the 'catchup' patch set and I rebased it on '[PATCH 1/2]
brcm80211: FIX for TKIP GTK bug' from Sukesh. The only other two patches I saw on the linuxdriver list are:

You rebased on a 1/2 patch in a series with an invalid 0/2 email?

{sigh}

I dropped that patch as the whole series needed to be resent, do you want me to apply that one patch before yours?

thanks,

greg k-h

#7 lore raw

Re: [PATCH 2/2] brcm80211: Fix for suspend/resume bug

Quoted 7 lines · Greg KH
Quoted 6 lines · Arend van Spriel
Quoted 5 lines · Greg KH
Quoted 3 lines · On Tue, May 03, 2011 at 12:00:57AM -0700, [email protected] wrote:
  #if defined(CONFIG_PM_SLEEP)

+extern volatile bool dhd_mmc_suspend;

This does not do what you think it does.

Quoted 8 lines
Quoted 5 lines

Hi Greg,

I posted the 'catchup' patch set and I rebased it on '[PATCH 1/2]
brcm80211: FIX for TKIP GTK bug' from Sukesh. The only other two patches I saw on the linuxdriver list are:

You rebased on a 1/2 patch in a series with an invalid 0/2 email?

{sigh}

Sorry.

Quoted 2 lines

I dropped that patch as the whole series needed to be resent, do you want me to apply that one patch before yours?

I can resend my series if that is more convenient for you.

Gr. AvS

#8 lore raw

Re: [PATCH 2/2] brcm80211: Fix for suspend/resume bug

Quoted 13 lines · Arend van Spriel
Quoted 12 lines · Greg KH
Quoted 11 lines · Arend van Spriel
Quoted 5 lines · Greg KH
Quoted 3 lines · On Tue, May 03, 2011 at 12:00:57AM -0700, [email protected] wrote:

#if defined(CONFIG_PM_SLEEP)

+extern volatile bool dhd_mmc_suspend;

This does not do what you think it does.

Hi Greg,

I posted the 'catchup' patch set and I rebased it on '[PATCH 1/2]
brcm80211: FIX for TKIP GTK bug' from Sukesh. The only other two patches I saw on the linuxdriver list are:

Quoted 7 lines
Quoted 3 lines

You rebased on a 1/2 patch in a series with an invalid 0/2 email?

{sigh}

Sorry.

Quoted 2 lines

I dropped that patch as the whole series needed to be resent, do you want me to apply that one patch before yours?

I can resend my series if that is more convenient for you.

Please, but just send it to me, I doubt everyone wants to see 60+ patches again on the list.

thanks,

greg k-h

#9 lore raw

Re: [PATCH 2/2] brcm80211: Fix for suspend/resume bug

Quoted 16 lines · Greg KH
Quoted 15 lines · Arend van Spriel
Quoted 14 lines · Greg KH
Quoted 11 lines · Arend van Spriel
Quoted 5 lines · Greg KH
Quoted 3 lines · On Tue, May 03, 2011 at 12:00:57AM -0700, [email protected] wrote:
  #if defined(CONFIG_PM_SLEEP)

+extern volatile bool dhd_mmc_suspend;

This does not do what you think it does.

Hi Greg,

I posted the 'catchup' patch set and I rebased it on '[PATCH 1/2]
brcm80211: FIX for TKIP GTK bug' from Sukesh. The only other two patches I saw on the linuxdriver list are:

You rebased on a 1/2 patch in a series with an invalid 0/2 email?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

{sigh}

Sorry.

Quoted 2 lines

I dropped that patch as the whole series needed to be resent, do you want me to apply that one patch before yours?

I can resend my series if that is more convenient for you.

Please, but just send it to me, I doubt everyone wants to see 60+ patches again on the list.

Ok. Just for this time I will agree to break the rules ;-)

Gr. AvS

#10 lore raw

Re: [PATCH 2/2] brcm80211: Fix for suspend/resume bug

Quoted 17 lines · Arend van Spriel
Quoted 16 lines · Greg KH
Quoted 15 lines · Arend van Spriel
Quoted 14 lines · Greg KH
Quoted 11 lines · Arend van Spriel
Quoted 5 lines · Greg KH
Quoted 3 lines · On Tue, May 03, 2011 at 12:00:57AM -0700, [email protected] wrote:
   #if defined(CONFIG_PM_SLEEP)

+extern volatile bool dhd_mmc_suspend;

This does not do what you think it does.

Hi Greg,

I posted the 'catchup' patch set and I rebased it on '[PATCH 1/2]
brcm80211: FIX for TKIP GTK bug' from Sukesh. The only other two patches I saw on the linuxdriver list are:

You rebased on a 1/2 patch in a series with an invalid 0/2 email?

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

{sigh}

Sorry.

Quoted 2 lines

I dropped that patch as the whole series needed to be resent, do you want me to apply that one patch before yours?

I can resend my series if that is more convenient for you.

Please, but just send it to me, I doubt everyone wants to see 60+ patches again on the list.

Ok. Just for this time I will agree to break the rules ;-)

Hi Greg,

I rebase and regenerated the patch files. Did a diff before resending them with the previous set and there are no relevant differences so the patches I sent this morning are ok.

Gr. AvS

#11 lore raw

Re: [PATCH 2/2] brcm80211: Fix for suspend/resume bug

Quoted 25 lines · Arend van Spriel
Quoted 24 lines · Arend van Spriel
Quoted 23 lines · Greg KH
Quoted 13 lines · Arend van Spriel
Quoted 12 lines · Greg KH
Quoted 11 lines · Arend van Spriel
Quoted 5 lines · Greg KH
Quoted 3 lines · On Tue, May 03, 2011 at 12:00:57AM -0700, [email protected] wrote:
  #if defined(CONFIG_PM_SLEEP)

+extern volatile bool dhd_mmc_suspend;

This does not do what you think it does.

Hi Greg,

I posted the 'catchup' patch set and I rebased it on '[PATCH 1/2]
brcm80211: FIX for TKIP GTK bug' from Sukesh. The only other two patches I saw on the linuxdriver list are:

Quoted 7 lines
Quoted 3 lines

You rebased on a 1/2 patch in a series with an invalid 0/2 email?

{sigh}

Sorry.

Quoted 2 lines

I dropped that patch as the whole series needed to be resent, do you want me to apply that one patch before yours?

I can resend my series if that is more convenient for you.

Please, but just send it to me, I doubt everyone wants to see 60+ patches again on the list.

Quoted 7 lines
Quoted 1 line

Ok. Just for this time I will agree to break the rules ;-)

Hi Greg,

I rebase and regenerated the patch files. Did a diff before resending them with the previous set and there are no relevant differences so the patches I sent this morning are ok.

Great, I've applied them all now.

greg k-h