aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2011-09-30 09:48:43 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-11-11 05:50:54 -0500
commit151bd30bdf88551d68a743b7f7504ca0f3ff2796 (patch)
tree8d987704d0061e77f59c668ebde4169f235163b8 /drivers/net/wireless
parent1555f7339db57987487e2bd849bca9a104109c18 (diff)
ath6kl: Replace spin_lock_irqsave with spin_lock_bh
It is not necessary to use spinlock primitive to protect data which is accessed in hard irq context as nothing is running in hard irq with this driver. The spinlock primitive meant to protect data in softirq context is more appropriate. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath6kl/main.c17
-rw-r--r--drivers/net/wireless/ath/ath6kl/sdio.c51
2 files changed, 27 insertions, 41 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index 30b5a53db9ed..adb16354cc4d 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -1025,8 +1025,6 @@ void ath6kl_connect_event(struct ath6kl *ar, u16 channel, u8 *bssid,
1025 u8 assoc_req_len, u8 assoc_resp_len, 1025 u8 assoc_req_len, u8 assoc_resp_len,
1026 u8 *assoc_info) 1026 u8 *assoc_info)
1027{ 1027{
1028 unsigned long flags;
1029
1030 ath6kl_cfg80211_connect_event(ar, channel, bssid, 1028 ath6kl_cfg80211_connect_event(ar, channel, bssid,
1031 listen_int, beacon_int, 1029 listen_int, beacon_int,
1032 net_type, beacon_ie_len, 1030 net_type, beacon_ie_len,
@@ -1043,11 +1041,11 @@ void ath6kl_connect_event(struct ath6kl *ar, u16 channel, u8 *bssid,
1043 netif_wake_queue(ar->net_dev); 1041 netif_wake_queue(ar->net_dev);
1044 1042
1045 /* Update connect & link status atomically */ 1043 /* Update connect & link status atomically */
1046 spin_lock_irqsave(&ar->lock, flags); 1044 spin_lock_bh(&ar->lock);
1047 set_bit(CONNECTED, &ar->flag); 1045 set_bit(CONNECTED, &ar->flag);
1048 clear_bit(CONNECT_PEND, &ar->flag); 1046 clear_bit(CONNECT_PEND, &ar->flag);
1049 netif_carrier_on(ar->net_dev); 1047 netif_carrier_on(ar->net_dev);
1050 spin_unlock_irqrestore(&ar->lock, flags); 1048 spin_unlock_bh(&ar->lock);
1051 1049
1052 aggr_reset_state(ar->aggr_cntxt); 1050 aggr_reset_state(ar->aggr_cntxt);
1053 ar->reconnect_flag = 0; 1051 ar->reconnect_flag = 0;
@@ -1330,8 +1328,6 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid,
1330 u8 assoc_resp_len, u8 *assoc_info, 1328 u8 assoc_resp_len, u8 *assoc_info,
1331 u16 prot_reason_status) 1329 u16 prot_reason_status)
1332{ 1330{
1333 unsigned long flags;
1334
1335 if (ar->nw_type == AP_NETWORK) { 1331 if (ar->nw_type == AP_NETWORK) {
1336 if (!ath6kl_remove_sta(ar, bssid, prot_reason_status)) 1332 if (!ath6kl_remove_sta(ar, bssid, prot_reason_status))
1337 return; 1333 return;
@@ -1390,10 +1386,10 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid,
1390 } 1386 }
1391 1387
1392 /* update connect & link status atomically */ 1388 /* update connect & link status atomically */
1393 spin_lock_irqsave(&ar->lock, flags); 1389 spin_lock_bh(&ar->lock);
1394 clear_bit(CONNECTED, &ar->flag); 1390 clear_bit(CONNECTED, &ar->flag);
1395 netif_carrier_off(ar->net_dev); 1391 netif_carrier_off(ar->net_dev);
1396 spin_unlock_irqrestore(&ar->lock, flags); 1392 spin_unlock_bh(&ar->lock);
1397 1393
1398 if ((reason != CSERV_DISCONNECT) || (ar->reconnect_flag != 1)) 1394 if ((reason != CSERV_DISCONNECT) || (ar->reconnect_flag != 1))
1399 ar->reconnect_flag = 0; 1395 ar->reconnect_flag = 0;
@@ -1411,9 +1407,8 @@ void ath6kl_disconnect_event(struct ath6kl *ar, u8 reason, u8 *bssid,
1411static int ath6kl_open(struct net_device *dev) 1407static int ath6kl_open(struct net_device *dev)
1412{ 1408{
1413 struct ath6kl *ar = ath6kl_priv(dev); 1409 struct ath6kl *ar = ath6kl_priv(dev);
1414 unsigned long flags;
1415 1410
1416 spin_lock_irqsave(&ar->lock, flags); 1411 spin_lock_bh(&ar->lock);
1417 1412
1418 set_bit(WLAN_ENABLED, &ar->flag); 1413 set_bit(WLAN_ENABLED, &ar->flag);
1419 1414
@@ -1423,7 +1418,7 @@ static int ath6kl_open(struct net_device *dev)
1423 } else 1418 } else
1424 netif_carrier_off(dev); 1419 netif_carrier_off(dev);
1425 1420
1426 spin_unlock_irqrestore(&ar->lock, flags); 1421 spin_unlock_bh(&ar->lock);
1427 1422
1428 return 0; 1423 return 0;
1429} 1424}
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index f1dc311ee0c7..2dd7a881f223 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -166,12 +166,11 @@ static int ath6kl_sdio_io(struct sdio_func *func, u32 request, u32 addr,
166static struct bus_request *ath6kl_sdio_alloc_busreq(struct ath6kl_sdio *ar_sdio) 166static struct bus_request *ath6kl_sdio_alloc_busreq(struct ath6kl_sdio *ar_sdio)
167{ 167{
168 struct bus_request *bus_req; 168 struct bus_request *bus_req;
169 unsigned long flag;
170 169
171 spin_lock_irqsave(&ar_sdio->lock, flag); 170 spin_lock_bh(&ar_sdio->lock);
172 171
173 if (list_empty(&ar_sdio->bus_req_freeq)) { 172 if (list_empty(&ar_sdio->bus_req_freeq)) {
174 spin_unlock_irqrestore(&ar_sdio->lock, flag); 173 spin_unlock_bh(&ar_sdio->lock);
175 return NULL; 174 return NULL;
176 } 175 }
177 176
@@ -179,7 +178,7 @@ static struct bus_request *ath6kl_sdio_alloc_busreq(struct ath6kl_sdio *ar_sdio)
179 struct bus_request, list); 178 struct bus_request, list);
180 list_del(&bus_req->list); 179 list_del(&bus_req->list);
181 180
182 spin_unlock_irqrestore(&ar_sdio->lock, flag); 181 spin_unlock_bh(&ar_sdio->lock);
183 ath6kl_dbg(ATH6KL_DBG_SCATTER, "%s: bus request 0x%p\n", 182 ath6kl_dbg(ATH6KL_DBG_SCATTER, "%s: bus request 0x%p\n",
184 __func__, bus_req); 183 __func__, bus_req);
185 184
@@ -189,14 +188,12 @@ static struct bus_request *ath6kl_sdio_alloc_busreq(struct ath6kl_sdio *ar_sdio)
189static void ath6kl_sdio_free_bus_req(struct ath6kl_sdio *ar_sdio, 188static void ath6kl_sdio_free_bus_req(struct ath6kl_sdio *ar_sdio,
190 struct bus_request *bus_req) 189 struct bus_request *bus_req)
191{ 190{
192 unsigned long flag;
193
194 ath6kl_dbg(ATH6KL_DBG_SCATTER, "%s: bus request 0x%p\n", 191 ath6kl_dbg(ATH6KL_DBG_SCATTER, "%s: bus request 0x%p\n",
195 __func__, bus_req); 192 __func__, bus_req);
196 193
197 spin_lock_irqsave(&ar_sdio->lock, flag); 194 spin_lock_bh(&ar_sdio->lock);
198 list_add_tail(&bus_req->list, &ar_sdio->bus_req_freeq); 195 list_add_tail(&bus_req->list, &ar_sdio->bus_req_freeq);
199 spin_unlock_irqrestore(&ar_sdio->lock, flag); 196 spin_unlock_bh(&ar_sdio->lock);
200} 197}
201 198
202static void ath6kl_sdio_setup_scat_data(struct hif_scatter_req *scat_req, 199static void ath6kl_sdio_setup_scat_data(struct hif_scatter_req *scat_req,
@@ -424,20 +421,19 @@ static void __ath6kl_sdio_write_async(struct ath6kl_sdio *ar_sdio,
424static void ath6kl_sdio_write_async_work(struct work_struct *work) 421static void ath6kl_sdio_write_async_work(struct work_struct *work)
425{ 422{
426 struct ath6kl_sdio *ar_sdio; 423 struct ath6kl_sdio *ar_sdio;
427 unsigned long flags;
428 struct bus_request *req, *tmp_req; 424 struct bus_request *req, *tmp_req;
429 425
430 ar_sdio = container_of(work, struct ath6kl_sdio, wr_async_work); 426 ar_sdio = container_of(work, struct ath6kl_sdio, wr_async_work);
431 sdio_claim_host(ar_sdio->func); 427 sdio_claim_host(ar_sdio->func);
432 428
433 spin_lock_irqsave(&ar_sdio->wr_async_lock, flags); 429 spin_lock_bh(&ar_sdio->wr_async_lock);
434 list_for_each_entry_safe(req, tmp_req, &ar_sdio->wr_asyncq, list) { 430 list_for_each_entry_safe(req, tmp_req, &ar_sdio->wr_asyncq, list) {
435 list_del(&req->list); 431 list_del(&req->list);
436 spin_unlock_irqrestore(&ar_sdio->wr_async_lock, flags); 432 spin_unlock_bh(&ar_sdio->wr_async_lock);
437 __ath6kl_sdio_write_async(ar_sdio, req); 433 __ath6kl_sdio_write_async(ar_sdio, req);
438 spin_lock_irqsave(&ar_sdio->wr_async_lock, flags); 434 spin_lock_bh(&ar_sdio->wr_async_lock);
439 } 435 }
440 spin_unlock_irqrestore(&ar_sdio->wr_async_lock, flags); 436 spin_unlock_bh(&ar_sdio->wr_async_lock);
441 437
442 sdio_release_host(ar_sdio->func); 438 sdio_release_host(ar_sdio->func);
443} 439}
@@ -520,7 +516,6 @@ static int ath6kl_sdio_write_async(struct ath6kl *ar, u32 address, u8 *buffer,
520{ 516{
521 struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); 517 struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
522 struct bus_request *bus_req; 518 struct bus_request *bus_req;
523 unsigned long flags;
524 519
525 bus_req = ath6kl_sdio_alloc_busreq(ar_sdio); 520 bus_req = ath6kl_sdio_alloc_busreq(ar_sdio);
526 521
@@ -533,9 +528,9 @@ static int ath6kl_sdio_write_async(struct ath6kl *ar, u32 address, u8 *buffer,
533 bus_req->request = request; 528 bus_req->request = request;
534 bus_req->packet = packet; 529 bus_req->packet = packet;
535 530
536 spin_lock_irqsave(&ar_sdio->wr_async_lock, flags); 531 spin_lock_bh(&ar_sdio->wr_async_lock);
537 list_add_tail(&bus_req->list, &ar_sdio->wr_asyncq); 532 list_add_tail(&bus_req->list, &ar_sdio->wr_asyncq);
538 spin_unlock_irqrestore(&ar_sdio->wr_async_lock, flags); 533 spin_unlock_bh(&ar_sdio->wr_async_lock);
539 queue_work(ar->ath6kl_wq, &ar_sdio->wr_async_work); 534 queue_work(ar->ath6kl_wq, &ar_sdio->wr_async_work);
540 535
541 return 0; 536 return 0;
@@ -581,9 +576,8 @@ static struct hif_scatter_req *ath6kl_sdio_scatter_req_get(struct ath6kl *ar)
581{ 576{
582 struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); 577 struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
583 struct hif_scatter_req *node = NULL; 578 struct hif_scatter_req *node = NULL;
584 unsigned long flag;
585 579
586 spin_lock_irqsave(&ar_sdio->scat_lock, flag); 580 spin_lock_bh(&ar_sdio->scat_lock);
587 581
588 if (!list_empty(&ar_sdio->scat_req)) { 582 if (!list_empty(&ar_sdio->scat_req)) {
589 node = list_first_entry(&ar_sdio->scat_req, 583 node = list_first_entry(&ar_sdio->scat_req,
@@ -591,7 +585,7 @@ static struct hif_scatter_req *ath6kl_sdio_scatter_req_get(struct ath6kl *ar)
591 list_del(&node->list); 585 list_del(&node->list);
592 } 586 }
593 587
594 spin_unlock_irqrestore(&ar_sdio->scat_lock, flag); 588 spin_unlock_bh(&ar_sdio->scat_lock);
595 589
596 return node; 590 return node;
597} 591}
@@ -600,13 +594,12 @@ static void ath6kl_sdio_scatter_req_add(struct ath6kl *ar,
600 struct hif_scatter_req *s_req) 594 struct hif_scatter_req *s_req)
601{ 595{
602 struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); 596 struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
603 unsigned long flag;
604 597
605 spin_lock_irqsave(&ar_sdio->scat_lock, flag); 598 spin_lock_bh(&ar_sdio->scat_lock);
606 599
607 list_add_tail(&s_req->list, &ar_sdio->scat_req); 600 list_add_tail(&s_req->list, &ar_sdio->scat_req);
608 601
609 spin_unlock_irqrestore(&ar_sdio->scat_lock, flag); 602 spin_unlock_bh(&ar_sdio->scat_lock);
610 603
611} 604}
612 605
@@ -617,7 +610,6 @@ static int ath6kl_sdio_async_rw_scatter(struct ath6kl *ar,
617 struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); 610 struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
618 u32 request = scat_req->req; 611 u32 request = scat_req->req;
619 int status = 0; 612 int status = 0;
620 unsigned long flags;
621 613
622 if (!scat_req->len) 614 if (!scat_req->len)
623 return -EINVAL; 615 return -EINVAL;
@@ -631,9 +623,9 @@ static int ath6kl_sdio_async_rw_scatter(struct ath6kl *ar,
631 status = ath6kl_sdio_scat_rw(ar_sdio, scat_req->busrequest); 623 status = ath6kl_sdio_scat_rw(ar_sdio, scat_req->busrequest);
632 sdio_release_host(ar_sdio->func); 624 sdio_release_host(ar_sdio->func);
633 } else { 625 } else {
634 spin_lock_irqsave(&ar_sdio->wr_async_lock, flags); 626 spin_lock_bh(&ar_sdio->wr_async_lock);
635 list_add_tail(&scat_req->busrequest->list, &ar_sdio->wr_asyncq); 627 list_add_tail(&scat_req->busrequest->list, &ar_sdio->wr_asyncq);
636 spin_unlock_irqrestore(&ar_sdio->wr_async_lock, flags); 628 spin_unlock_bh(&ar_sdio->wr_async_lock);
637 queue_work(ar->ath6kl_wq, &ar_sdio->wr_async_work); 629 queue_work(ar->ath6kl_wq, &ar_sdio->wr_async_work);
638 } 630 }
639 631
@@ -645,13 +637,12 @@ static void ath6kl_sdio_cleanup_scatter(struct ath6kl *ar)
645{ 637{
646 struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar); 638 struct ath6kl_sdio *ar_sdio = ath6kl_sdio_priv(ar);
647 struct hif_scatter_req *s_req, *tmp_req; 639 struct hif_scatter_req *s_req, *tmp_req;
648 unsigned long flag;
649 640
650 /* empty the free list */ 641 /* empty the free list */
651 spin_lock_irqsave(&ar_sdio->scat_lock, flag); 642 spin_lock_bh(&ar_sdio->scat_lock);
652 list_for_each_entry_safe(s_req, tmp_req, &ar_sdio->scat_req, list) { 643 list_for_each_entry_safe(s_req, tmp_req, &ar_sdio->scat_req, list) {
653 list_del(&s_req->list); 644 list_del(&s_req->list);
654 spin_unlock_irqrestore(&ar_sdio->scat_lock, flag); 645 spin_unlock_bh(&ar_sdio->scat_lock);
655 646
656 if (s_req->busrequest) 647 if (s_req->busrequest)
657 ath6kl_sdio_free_bus_req(ar_sdio, s_req->busrequest); 648 ath6kl_sdio_free_bus_req(ar_sdio, s_req->busrequest);
@@ -659,9 +650,9 @@ static void ath6kl_sdio_cleanup_scatter(struct ath6kl *ar)
659 kfree(s_req->sgentries); 650 kfree(s_req->sgentries);
660 kfree(s_req); 651 kfree(s_req);
661 652
662 spin_lock_irqsave(&ar_sdio->scat_lock, flag); 653 spin_lock_bh(&ar_sdio->scat_lock);
663 } 654 }
664 spin_unlock_irqrestore(&ar_sdio->scat_lock, flag); 655 spin_unlock_bh(&ar_sdio->scat_lock);
665} 656}
666 657
667/* setup of HIF scatter resources */ 658/* setup of HIF scatter resources */