Skip to content

Commit

Permalink
laird: ath6kl: Fix scheduling while atomic bug during firmware recovery
Browse files Browse the repository at this point in the history
During firmware recovery, which is done in an interrupt context, some
atheros driver events are sent via netlink which use GFP_KERNEL.
Memory allocations using GFP_KERNEL allow for sleeping which is not
allowed in an interrupt.  Replacing those with GFP_ATOMIC which is safe.

Bug: 6950
  • Loading branch information
dankephart committed Apr 16, 2015
1 parent de08e2d commit 547204c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/wireless/ath/ath6kl/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4522,7 +4522,7 @@ static void ath6kl_wmi_event_multicast(enum wmi_cmd_id cmd_id, u8 *datap, int le
void *hdr;

//allocate the memory
msg = genlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
msg = genlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!msg)
return;

Expand All @@ -4547,7 +4547,7 @@ static void ath6kl_wmi_event_multicast(enum wmi_cmd_id cmd_id, u8 *datap, int le
genlmsg_end(msg, hdr);

//send the message */
genlmsg_multicast(msg, 0, atheros_events_mcgrp.id, GFP_KERNEL);
genlmsg_multicast(msg, 0, atheros_events_mcgrp.id, GFP_ATOMIC);

return;

Expand All @@ -4561,15 +4561,15 @@ void ath6kl_drv_event_multicast(enum atheros_cmd_id cmd_id, unsigned int reason)
struct sk_buff *msg;
void *hdr;

msg = genlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
msg = genlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (msg)
hdr = genlmsg_put(msg, 0, 0, &atheros_fam, 0, cmd_id);
if (!hdr)
nlmsg_free(msg);
else {
nla_put_u32(msg, ATHEROS_ATTR_MSG, reason);
genlmsg_end(msg, hdr);
genlmsg_multicast(msg, 0, atheros_events_mcgrp.id, GFP_KERNEL);
genlmsg_multicast(msg, 0, atheros_events_mcgrp.id, GFP_ATOMIC);
}

return;
Expand Down

0 comments on commit 547204c

Please sign in to comment.