* [PATCH] wl12xx: free firmware after booting the chip
@ 2011-01-17 17:17 Eliad Peller
2011-01-17 17:58 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Eliad Peller @ 2011-01-17 17:17 UTC (permalink / raw)
To: Luciano Coelho; +Cc: linux-wireless
There is no need to save the fw in memory after it has been
uploaded to the chip.
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
drivers/net/wireless/wl12xx/main.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 8a35491..e1944b1 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -691,7 +691,6 @@ static int wl1271_fetch_firmware(struct wl1271 *wl)
goto out;
}
- vfree(wl->fw);
wl->fw_len = fw->size;
wl->fw = vmalloc(wl->fw_len);
@@ -891,7 +890,7 @@ int wl1271_plt_start(struct wl1271 *wl)
wl->state = WL1271_STATE_PLT;
wl1271_notice("firmware booted in PLT mode (%s)",
wl->chip.fw_ver);
- goto out;
+ goto out_free_fw;
irq_disable:
wl1271_disable_interrupts(wl);
@@ -911,6 +910,9 @@ power_off:
wl1271_error("firmware boot in PLT mode failed despite %d retries",
WL1271_BOOT_RETRIES);
+out_free_fw:
+ vfree(wl->fw);
+ wl->fw = NULL;
out:
mutex_unlock(&wl->mutex);
@@ -1126,7 +1128,7 @@ power_off:
if (!booted) {
wl1271_error("firmware boot failed despite %d retries",
WL1271_BOOT_RETRIES);
- goto out;
+ goto out_free_fw;
}
wl->vif = vif;
@@ -1148,6 +1150,9 @@ power_off:
wl1271_debug(DEBUG_MAC80211, "11a is %ssupported",
wl->enable_11a ? "" : "not ");
+out_free_fw:
+ vfree(wl->fw);
+ wl->fw = NULL;
out:
mutex_unlock(&wl->mutex);
@@ -3300,8 +3305,6 @@ int wl1271_free_hw(struct wl1271 *wl)
wl1271_debugfs_exit(wl);
- vfree(wl->fw);
- wl->fw = NULL;
kfree(wl->nvs);
wl->nvs = NULL;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] wl12xx: free firmware after booting the chip
2011-01-17 17:17 [PATCH] wl12xx: free firmware after booting the chip Eliad Peller
@ 2011-01-17 17:58 ` Johannes Berg
2011-01-17 18:11 ` Eliad Peller
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2011-01-17 17:58 UTC (permalink / raw)
To: Eliad Peller; +Cc: Luciano Coelho, linux-wireless
On Mon, 2011-01-17 at 19:17 +0200, Eliad Peller wrote:
> There is no need to save the fw in memory after it has been
> uploaded to the chip.
Are you sure it's not needed for resume? At which point userspace isn't
up so you can't load it.
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wl12xx: free firmware after booting the chip
2011-01-17 17:58 ` Johannes Berg
@ 2011-01-17 18:11 ` Eliad Peller
2011-01-17 18:13 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Eliad Peller @ 2011-01-17 18:11 UTC (permalink / raw)
To: Johannes Berg; +Cc: Luciano Coelho, linux-wireless
good point!
does loading it on suspend makes sense, or i should abandon this patch?
On Mon, Jan 17, 2011 at 7:58 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2011-01-17 at 19:17 +0200, Eliad Peller wrote:
>> There is no need to save the fw in memory after it has been
>> uploaded to the chip.
>
> Are you sure it's not needed for resume? At which point userspace isn't
> up so you can't load it.
>
> johannes
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wl12xx: free firmware after booting the chip
2011-01-17 18:11 ` Eliad Peller
@ 2011-01-17 18:13 ` Johannes Berg
2011-01-17 19:32 ` Eliad Peller
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2011-01-17 18:13 UTC (permalink / raw)
To: Eliad Peller; +Cc: Luciano Coelho, linux-wireless
On Mon, 2011-01-17 at 20:11 +0200, Eliad Peller wrote:
> good point!
> does loading it on suspend makes sense, or i should abandon this patch?
I wouldn't, you then run into failure modes where it can't be loaded
during suspend either, etc. It's not huge anyway, is it?
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wl12xx: free firmware after booting the chip
2011-01-17 18:13 ` Johannes Berg
@ 2011-01-17 19:32 ` Eliad Peller
0 siblings, 0 replies; 5+ messages in thread
From: Eliad Peller @ 2011-01-17 19:32 UTC (permalink / raw)
To: Johannes Berg; +Cc: Luciano Coelho, linux-wireless
it's about 270K...
i guess i'll leave it for now.
thanks!
On Mon, Jan 17, 2011 at 8:13 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2011-01-17 at 20:11 +0200, Eliad Peller wrote:
>> good point!
>> does loading it on suspend makes sense, or i should abandon this patch?
>
> I wouldn't, you then run into failure modes where it can't be loaded
> during suspend either, etc. It's not huge anyway, is it?
>
> johannes
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-01-17 19:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-17 17:17 [PATCH] wl12xx: free firmware after booting the chip Eliad Peller
2011-01-17 17:58 ` Johannes Berg
2011-01-17 18:11 ` Eliad Peller
2011-01-17 18:13 ` Johannes Berg
2011-01-17 19:32 ` Eliad Peller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox