linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw
@ 2012-03-28 13:51 Vivek Natarajan
  2012-03-28 13:51 ` [PATCH 2/2] ath6kl: Fix scan related issue on suspend-resume Vivek Natarajan
  2012-04-03 18:27 ` [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Vivek Natarajan @ 2012-03-28 13:51 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl-devel, linux-wireless, PingYang Zhang

Sometimes it has been observed that allocating a contiguous memory
of more than 100K fails with kmalloc. This has been modified to
use vmalloc instead.

Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com>
Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/core.c |    3 ++-
 drivers/net/wireless/ath/ath6kl/init.c |    4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
index 5c20a04..fdb3b1d 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -20,6 +20,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/export.h>
+#include <linux/vmalloc.h>
 
 #include "debug.h"
 #include "hif-ops.h"
@@ -305,7 +306,7 @@ void ath6kl_core_cleanup(struct ath6kl *ar)
 
 	kfree(ar->fw_board);
 	kfree(ar->fw_otp);
-	kfree(ar->fw);
+	vfree(ar->fw);
 	kfree(ar->fw_patch);
 	kfree(ar->fw_testscript);
 
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 092e4cd..5949ab5 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -21,6 +21,7 @@
 #include <linux/export.h>
 #include <linux/of.h>
 #include <linux/mmc/sdio_func.h>
+#include <linux/vmalloc.h>
 
 #include "core.h"
 #include "cfg80211.h"
@@ -928,13 +929,14 @@ static int ath6kl_fetch_fw_apin(struct ath6kl *ar, const char *name)
 			if (ar->fw != NULL)
 				break;
 
-			ar->fw = kmemdup(data, ie_len, GFP_KERNEL);
+			ar->fw = vmalloc(ie_len);
 
 			if (ar->fw == NULL) {
 				ret = -ENOMEM;
 				goto out;
 			}
 
+			memcpy(ar->fw, data, ie_len);
 			ar->fw_len = ie_len;
 			break;
 		case ATH6KL_FW_IE_PATCH_IMAGE:
-- 
1.7.4.1


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

* [PATCH 2/2] ath6kl: Fix scan related issue on suspend-resume
  2012-03-28 13:51 [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw Vivek Natarajan
@ 2012-03-28 13:51 ` Vivek Natarajan
  2012-04-03 18:27 ` [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Vivek Natarajan @ 2012-03-28 13:51 UTC (permalink / raw)
  To: kvalo; +Cc: ath6kl-devel, linux-wireless, PingYang Zhang

When a scan request is pending while going to suspend, any new
scan request after resume will fail. So, cancel all scan requests
in all the vifs before moving to suspend state.

Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com>
Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index df95e0d..952a858 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2205,6 +2205,7 @@ int ath6kl_cfg80211_suspend(struct ath6kl *ar,
 			    enum ath6kl_cfg_suspend_mode mode,
 			    struct cfg80211_wowlan *wow)
 {
+	struct ath6kl_vif *vif;
 	enum ath6kl_state prev_state;
 	int ret;
 
@@ -2274,6 +2275,9 @@ int ath6kl_cfg80211_suspend(struct ath6kl *ar,
 		break;
 	}
 
+	list_for_each_entry(vif, &ar->vif_list, list)
+		ath6kl_cfg80211_scan_complete_event(vif, true);
+
 	return 0;
 }
 EXPORT_SYMBOL(ath6kl_cfg80211_suspend);
-- 
1.7.4.1


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

* Re: [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw
  2012-03-28 13:51 [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw Vivek Natarajan
  2012-03-28 13:51 ` [PATCH 2/2] ath6kl: Fix scan related issue on suspend-resume Vivek Natarajan
@ 2012-04-03 18:27 ` Kalle Valo
  2012-04-03 18:41   ` Joe Perches
  1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2012-04-03 18:27 UTC (permalink / raw)
  To: Vivek Natarajan; +Cc: ath6kl-devel, linux-wireless, PingYang Zhang

On 03/28/2012 04:51 PM, Vivek Natarajan wrote:
> Sometimes it has been observed that allocating a contiguous memory
> of more than 100K fails with kmalloc. This has been modified to
> use vmalloc instead.
> 
> Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com>
> Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>

Thanks, both patches applied.

Kalle

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

* Re: [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw
  2012-04-03 18:27 ` [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw Kalle Valo
@ 2012-04-03 18:41   ` Joe Perches
  2012-04-03 18:47     ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2012-04-03 18:41 UTC (permalink / raw)
  To: Kalle Valo, Andrew Morton
  Cc: Vivek Natarajan, ath6kl-devel, linux-wireless, PingYang Zhang

On Tue, 2012-04-03 at 21:27 +0300, Kalle Valo wrote:
> On 03/28/2012 04:51 PM, Vivek Natarajan wrote:
> > Sometimes it has been observed that allocating a contiguous memory
> > of more than 100K fails with kmalloc. This has been modified to
> > use vmalloc instead.
> > 
> > Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com>
> > Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
> 
> Thanks, both patches applied.

Because the vmalloc space is limited, this should try
kmalloc first and only on failure try vmalloc.

Andrew, more reasons for a real helper/API.
Care to rap any knuckles?


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

* Re: [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw
  2012-04-03 18:41   ` Joe Perches
@ 2012-04-03 18:47     ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2012-04-03 18:47 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andrew Morton, Vivek Natarajan, ath6kl-devel, linux-wireless,
	PingYang Zhang

On 04/03/2012 09:41 PM, Joe Perches wrote:
> On Tue, 2012-04-03 at 21:27 +0300, Kalle Valo wrote:
>> On 03/28/2012 04:51 PM, Vivek Natarajan wrote:
>>> Sometimes it has been observed that allocating a contiguous memory
>>> of more than 100K fails with kmalloc. This has been modified to
>>> use vmalloc instead.
>>>
>>> Signed-off-by: PingYang Zhang <pingzhan@qca.qualcomm.com>
>>> Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
>>
>> Thanks, both patches applied.
> 
> Because the vmalloc space is limited, this should try
> kmalloc first and only on failure try vmalloc.

Thanks, I didn't know that.

Vivek, I would gladly take a followup patch which does what Joe suggests.

Kalle

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

end of thread, other threads:[~2012-04-03 18:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-28 13:51 [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw Vivek Natarajan
2012-03-28 13:51 ` [PATCH 2/2] ath6kl: Fix scan related issue on suspend-resume Vivek Natarajan
2012-04-03 18:27 ` [PATCH 1/2] ath6kl: Use vmalloc instead of kmalloc for fw Kalle Valo
2012-04-03 18:41   ` Joe Perches
2012-04-03 18:47     ` 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).