diff options
author | Tejun Heo <tj@kernel.org> | 2012-08-22 19:22:16 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-09-24 18:17:23 -0400 |
commit | 474fee3db16c63bc440bfb93b57f72ecfc4246f0 (patch) | |
tree | f5fed7f3b40408f21fa3b9edc67d5ac0b869149f /net | |
parent | 5db327f96daa2401b9afec6cd80cebe6c6475bb1 (diff) |
NFC: Use system_nrt_wq instead of custom ones
NFC is using a number of custom ordered workqueues w/ WQ_MEM_RECLAIM.
WQ_MEM_RECLAIM is unnecessary unless NFC is gonna be used as transport
for storage device, and all use cases match one work item to one
ordered workqueue - IOW, there's no actual ordering going on at all
and using system_nrt_wq gives the same behavior.
There's nothing to be gained by using custom workqueues. Use
system_nrt_wq instead and drop all the custom ones.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/nfc/core.c | 13 | ||||
-rw-r--r-- | net/nfc/hci/core.c | 42 | ||||
-rw-r--r-- | net/nfc/hci/hcp.c | 2 | ||||
-rw-r--r-- | net/nfc/hci/shdlc.c | 27 | ||||
-rw-r--r-- | net/nfc/llcp/llcp.c | 57 | ||||
-rw-r--r-- | net/nfc/llcp/llcp.h | 3 |
6 files changed, 26 insertions, 118 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c index ff749794bc5b..c9eacc1f145f 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c | |||
@@ -679,7 +679,7 @@ static void nfc_release(struct device *d) | |||
679 | 679 | ||
680 | if (dev->ops->check_presence) { | 680 | if (dev->ops->check_presence) { |
681 | del_timer_sync(&dev->check_pres_timer); | 681 | del_timer_sync(&dev->check_pres_timer); |
682 | destroy_workqueue(dev->check_pres_wq); | 682 | cancel_work_sync(&dev->check_pres_work); |
683 | } | 683 | } |
684 | 684 | ||
685 | nfc_genl_data_exit(&dev->genl_data); | 685 | nfc_genl_data_exit(&dev->genl_data); |
@@ -715,7 +715,7 @@ static void nfc_check_pres_timeout(unsigned long data) | |||
715 | { | 715 | { |
716 | struct nfc_dev *dev = (struct nfc_dev *)data; | 716 | struct nfc_dev *dev = (struct nfc_dev *)data; |
717 | 717 | ||
718 | queue_work(dev->check_pres_wq, &dev->check_pres_work); | 718 | queue_work(system_nrt_wq, &dev->check_pres_work); |
719 | } | 719 | } |
720 | 720 | ||
721 | struct class nfc_class = { | 721 | struct class nfc_class = { |
@@ -784,20 +784,11 @@ struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, | |||
784 | dev->targets_generation = 1; | 784 | dev->targets_generation = 1; |
785 | 785 | ||
786 | if (ops->check_presence) { | 786 | if (ops->check_presence) { |
787 | char name[32]; | ||
788 | init_timer(&dev->check_pres_timer); | 787 | init_timer(&dev->check_pres_timer); |
789 | dev->check_pres_timer.data = (unsigned long)dev; | 788 | dev->check_pres_timer.data = (unsigned long)dev; |
790 | dev->check_pres_timer.function = nfc_check_pres_timeout; | 789 | dev->check_pres_timer.function = nfc_check_pres_timeout; |
791 | 790 | ||
792 | INIT_WORK(&dev->check_pres_work, nfc_check_pres_work); | 791 | INIT_WORK(&dev->check_pres_work, nfc_check_pres_work); |
793 | snprintf(name, sizeof(name), "nfc%d_check_pres_wq", dev->idx); | ||
794 | dev->check_pres_wq = alloc_workqueue(name, WQ_NON_REENTRANT | | ||
795 | WQ_UNBOUND | | ||
796 | WQ_MEM_RECLAIM, 1); | ||
797 | if (dev->check_pres_wq == NULL) { | ||
798 | kfree(dev); | ||
799 | return NULL; | ||
800 | } | ||
801 | } | 792 | } |
802 | 793 | ||
803 | return dev; | 794 | return dev; |
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index 1ac7b3fac6c9..03646beb3a73 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c | |||
@@ -141,7 +141,7 @@ static void __nfc_hci_cmd_completion(struct nfc_hci_dev *hdev, int err, | |||
141 | kfree(hdev->cmd_pending_msg); | 141 | kfree(hdev->cmd_pending_msg); |
142 | hdev->cmd_pending_msg = NULL; | 142 | hdev->cmd_pending_msg = NULL; |
143 | 143 | ||
144 | queue_work(hdev->msg_tx_wq, &hdev->msg_tx_work); | 144 | queue_work(system_nrt_wq, &hdev->msg_tx_work); |
145 | } | 145 | } |
146 | 146 | ||
147 | void nfc_hci_resp_received(struct nfc_hci_dev *hdev, u8 result, | 147 | void nfc_hci_resp_received(struct nfc_hci_dev *hdev, u8 result, |
@@ -326,7 +326,7 @@ static void nfc_hci_cmd_timeout(unsigned long data) | |||
326 | { | 326 | { |
327 | struct nfc_hci_dev *hdev = (struct nfc_hci_dev *)data; | 327 | struct nfc_hci_dev *hdev = (struct nfc_hci_dev *)data; |
328 | 328 | ||
329 | queue_work(hdev->msg_tx_wq, &hdev->msg_tx_work); | 329 | queue_work(system_nrt_wq, &hdev->msg_tx_work); |
330 | } | 330 | } |
331 | 331 | ||
332 | static int hci_dev_connect_gates(struct nfc_hci_dev *hdev, u8 gate_count, | 332 | static int hci_dev_connect_gates(struct nfc_hci_dev *hdev, u8 gate_count, |
@@ -659,23 +659,11 @@ EXPORT_SYMBOL(nfc_hci_free_device); | |||
659 | 659 | ||
660 | int nfc_hci_register_device(struct nfc_hci_dev *hdev) | 660 | int nfc_hci_register_device(struct nfc_hci_dev *hdev) |
661 | { | 661 | { |
662 | struct device *dev = &hdev->ndev->dev; | ||
663 | const char *devname = dev_name(dev); | ||
664 | char name[32]; | ||
665 | int r = 0; | ||
666 | |||
667 | mutex_init(&hdev->msg_tx_mutex); | 662 | mutex_init(&hdev->msg_tx_mutex); |
668 | 663 | ||
669 | INIT_LIST_HEAD(&hdev->msg_tx_queue); | 664 | INIT_LIST_HEAD(&hdev->msg_tx_queue); |
670 | 665 | ||
671 | INIT_WORK(&hdev->msg_tx_work, nfc_hci_msg_tx_work); | 666 | INIT_WORK(&hdev->msg_tx_work, nfc_hci_msg_tx_work); |
672 | snprintf(name, sizeof(name), "%s_hci_msg_tx_wq", devname); | ||
673 | hdev->msg_tx_wq = alloc_workqueue(name, WQ_NON_REENTRANT | WQ_UNBOUND | | ||
674 | WQ_MEM_RECLAIM, 1); | ||
675 | if (hdev->msg_tx_wq == NULL) { | ||
676 | r = -ENOMEM; | ||
677 | goto exit; | ||
678 | } | ||
679 | 667 | ||
680 | init_timer(&hdev->cmd_timer); | 668 | init_timer(&hdev->cmd_timer); |
681 | hdev->cmd_timer.data = (unsigned long)hdev; | 669 | hdev->cmd_timer.data = (unsigned long)hdev; |
@@ -684,27 +672,10 @@ int nfc_hci_register_device(struct nfc_hci_dev *hdev) | |||
684 | skb_queue_head_init(&hdev->rx_hcp_frags); | 672 | skb_queue_head_init(&hdev->rx_hcp_frags); |
685 | 673 | ||
686 | INIT_WORK(&hdev->msg_rx_work, nfc_hci_msg_rx_work); | 674 | INIT_WORK(&hdev->msg_rx_work, nfc_hci_msg_rx_work); |
687 | snprintf(name, sizeof(name), "%s_hci_msg_rx_wq", devname); | ||
688 | hdev->msg_rx_wq = alloc_workqueue(name, WQ_NON_REENTRANT | WQ_UNBOUND | | ||
689 | WQ_MEM_RECLAIM, 1); | ||
690 | if (hdev->msg_rx_wq == NULL) { | ||
691 | r = -ENOMEM; | ||
692 | goto exit; | ||
693 | } | ||
694 | 675 | ||
695 | skb_queue_head_init(&hdev->msg_rx_queue); | 676 | skb_queue_head_init(&hdev->msg_rx_queue); |
696 | 677 | ||
697 | r = nfc_register_device(hdev->ndev); | 678 | return nfc_register_device(hdev->ndev); |
698 | |||
699 | exit: | ||
700 | if (r < 0) { | ||
701 | if (hdev->msg_tx_wq) | ||
702 | destroy_workqueue(hdev->msg_tx_wq); | ||
703 | if (hdev->msg_rx_wq) | ||
704 | destroy_workqueue(hdev->msg_rx_wq); | ||
705 | } | ||
706 | |||
707 | return r; | ||
708 | } | 679 | } |
709 | EXPORT_SYMBOL(nfc_hci_register_device); | 680 | EXPORT_SYMBOL(nfc_hci_register_device); |
710 | 681 | ||
@@ -725,9 +696,8 @@ void nfc_hci_unregister_device(struct nfc_hci_dev *hdev) | |||
725 | 696 | ||
726 | nfc_unregister_device(hdev->ndev); | 697 | nfc_unregister_device(hdev->ndev); |
727 | 698 | ||
728 | destroy_workqueue(hdev->msg_tx_wq); | 699 | cancel_work_sync(&hdev->msg_tx_work); |
729 | 700 | cancel_work_sync(&hdev->msg_rx_work); | |
730 | destroy_workqueue(hdev->msg_rx_wq); | ||
731 | } | 701 | } |
732 | EXPORT_SYMBOL(nfc_hci_unregister_device); | 702 | EXPORT_SYMBOL(nfc_hci_unregister_device); |
733 | 703 | ||
@@ -827,7 +797,7 @@ void nfc_hci_recv_frame(struct nfc_hci_dev *hdev, struct sk_buff *skb) | |||
827 | nfc_hci_hcp_message_rx(hdev, pipe, type, instruction, hcp_skb); | 797 | nfc_hci_hcp_message_rx(hdev, pipe, type, instruction, hcp_skb); |
828 | } else { | 798 | } else { |
829 | skb_queue_tail(&hdev->msg_rx_queue, hcp_skb); | 799 | skb_queue_tail(&hdev->msg_rx_queue, hcp_skb); |
830 | queue_work(hdev->msg_rx_wq, &hdev->msg_rx_work); | 800 | queue_work(system_nrt_wq, &hdev->msg_rx_work); |
831 | } | 801 | } |
832 | } | 802 | } |
833 | EXPORT_SYMBOL(nfc_hci_recv_frame); | 803 | EXPORT_SYMBOL(nfc_hci_recv_frame); |
diff --git a/net/nfc/hci/hcp.c b/net/nfc/hci/hcp.c index f4dad1a89740..2372b558abe9 100644 --- a/net/nfc/hci/hcp.c +++ b/net/nfc/hci/hcp.c | |||
@@ -108,7 +108,7 @@ int nfc_hci_hcp_message_tx(struct nfc_hci_dev *hdev, u8 pipe, | |||
108 | list_add_tail(&cmd->msg_l, &hdev->msg_tx_queue); | 108 | list_add_tail(&cmd->msg_l, &hdev->msg_tx_queue); |
109 | mutex_unlock(&hdev->msg_tx_mutex); | 109 | mutex_unlock(&hdev->msg_tx_mutex); |
110 | 110 | ||
111 | queue_work(hdev->msg_tx_wq, &hdev->msg_tx_work); | 111 | queue_work(system_nrt_wq, &hdev->msg_tx_work); |
112 | 112 | ||
113 | return 0; | 113 | return 0; |
114 | 114 | ||
diff --git a/net/nfc/hci/shdlc.c b/net/nfc/hci/shdlc.c index 6f840c18c892..39b51eacc391 100644 --- a/net/nfc/hci/shdlc.c +++ b/net/nfc/hci/shdlc.c | |||
@@ -540,7 +540,7 @@ static void nfc_shdlc_connect_timeout(unsigned long data) | |||
540 | 540 | ||
541 | pr_debug("\n"); | 541 | pr_debug("\n"); |
542 | 542 | ||
543 | queue_work(shdlc->sm_wq, &shdlc->sm_work); | 543 | queue_work(system_nrt_wq, &shdlc->sm_work); |
544 | } | 544 | } |
545 | 545 | ||
546 | static void nfc_shdlc_t1_timeout(unsigned long data) | 546 | static void nfc_shdlc_t1_timeout(unsigned long data) |
@@ -549,7 +549,7 @@ static void nfc_shdlc_t1_timeout(unsigned long data) | |||
549 | 549 | ||
550 | pr_debug("SoftIRQ: need to send ack\n"); | 550 | pr_debug("SoftIRQ: need to send ack\n"); |
551 | 551 | ||
552 | queue_work(shdlc->sm_wq, &shdlc->sm_work); | 552 | queue_work(system_nrt_wq, &shdlc->sm_work); |
553 | } | 553 | } |
554 | 554 | ||
555 | static void nfc_shdlc_t2_timeout(unsigned long data) | 555 | static void nfc_shdlc_t2_timeout(unsigned long data) |
@@ -558,7 +558,7 @@ static void nfc_shdlc_t2_timeout(unsigned long data) | |||
558 | 558 | ||
559 | pr_debug("SoftIRQ: need to retransmit\n"); | 559 | pr_debug("SoftIRQ: need to retransmit\n"); |
560 | 560 | ||
561 | queue_work(shdlc->sm_wq, &shdlc->sm_work); | 561 | queue_work(system_nrt_wq, &shdlc->sm_work); |
562 | } | 562 | } |
563 | 563 | ||
564 | static void nfc_shdlc_sm_work(struct work_struct *work) | 564 | static void nfc_shdlc_sm_work(struct work_struct *work) |
@@ -598,7 +598,7 @@ static void nfc_shdlc_sm_work(struct work_struct *work) | |||
598 | case SHDLC_NEGOCIATING: | 598 | case SHDLC_NEGOCIATING: |
599 | if (timer_pending(&shdlc->connect_timer) == 0) { | 599 | if (timer_pending(&shdlc->connect_timer) == 0) { |
600 | shdlc->state = SHDLC_CONNECTING; | 600 | shdlc->state = SHDLC_CONNECTING; |
601 | queue_work(shdlc->sm_wq, &shdlc->sm_work); | 601 | queue_work(system_nrt_wq, &shdlc->sm_work); |
602 | } | 602 | } |
603 | 603 | ||
604 | nfc_shdlc_handle_rcv_queue(shdlc); | 604 | nfc_shdlc_handle_rcv_queue(shdlc); |
@@ -662,7 +662,7 @@ static int nfc_shdlc_connect(struct nfc_shdlc *shdlc) | |||
662 | 662 | ||
663 | mutex_unlock(&shdlc->state_mutex); | 663 | mutex_unlock(&shdlc->state_mutex); |
664 | 664 | ||
665 | queue_work(shdlc->sm_wq, &shdlc->sm_work); | 665 | queue_work(system_nrt_wq, &shdlc->sm_work); |
666 | 666 | ||
667 | wait_event(connect_wq, shdlc->connect_result != 1); | 667 | wait_event(connect_wq, shdlc->connect_result != 1); |
668 | 668 | ||
@@ -679,7 +679,7 @@ static void nfc_shdlc_disconnect(struct nfc_shdlc *shdlc) | |||
679 | 679 | ||
680 | mutex_unlock(&shdlc->state_mutex); | 680 | mutex_unlock(&shdlc->state_mutex); |
681 | 681 | ||
682 | queue_work(shdlc->sm_wq, &shdlc->sm_work); | 682 | queue_work(system_nrt_wq, &shdlc->sm_work); |
683 | } | 683 | } |
684 | 684 | ||
685 | /* | 685 | /* |
@@ -697,7 +697,7 @@ void nfc_shdlc_recv_frame(struct nfc_shdlc *shdlc, struct sk_buff *skb) | |||
697 | skb_queue_tail(&shdlc->rcv_q, skb); | 697 | skb_queue_tail(&shdlc->rcv_q, skb); |
698 | } | 698 | } |
699 | 699 | ||
700 | queue_work(shdlc->sm_wq, &shdlc->sm_work); | 700 | queue_work(system_nrt_wq, &shdlc->sm_work); |
701 | } | 701 | } |
702 | EXPORT_SYMBOL(nfc_shdlc_recv_frame); | 702 | EXPORT_SYMBOL(nfc_shdlc_recv_frame); |
703 | 703 | ||
@@ -754,7 +754,7 @@ static int nfc_shdlc_xmit(struct nfc_hci_dev *hdev, struct sk_buff *skb) | |||
754 | 754 | ||
755 | skb_queue_tail(&shdlc->send_q, skb); | 755 | skb_queue_tail(&shdlc->send_q, skb); |
756 | 756 | ||
757 | queue_work(shdlc->sm_wq, &shdlc->sm_work); | 757 | queue_work(system_nrt_wq, &shdlc->sm_work); |
758 | 758 | ||
759 | return 0; | 759 | return 0; |
760 | } | 760 | } |
@@ -843,7 +843,6 @@ struct nfc_shdlc *nfc_shdlc_allocate(struct nfc_shdlc_ops *ops, | |||
843 | { | 843 | { |
844 | struct nfc_shdlc *shdlc; | 844 | struct nfc_shdlc *shdlc; |
845 | int r; | 845 | int r; |
846 | char name[32]; | ||
847 | 846 | ||
848 | if (ops->xmit == NULL) | 847 | if (ops->xmit == NULL) |
849 | return NULL; | 848 | return NULL; |
@@ -876,11 +875,6 @@ struct nfc_shdlc *nfc_shdlc_allocate(struct nfc_shdlc_ops *ops, | |||
876 | skb_queue_head_init(&shdlc->ack_pending_q); | 875 | skb_queue_head_init(&shdlc->ack_pending_q); |
877 | 876 | ||
878 | INIT_WORK(&shdlc->sm_work, nfc_shdlc_sm_work); | 877 | INIT_WORK(&shdlc->sm_work, nfc_shdlc_sm_work); |
879 | snprintf(name, sizeof(name), "%s_shdlc_sm_wq", devname); | ||
880 | shdlc->sm_wq = alloc_workqueue(name, WQ_NON_REENTRANT | WQ_UNBOUND | | ||
881 | WQ_MEM_RECLAIM, 1); | ||
882 | if (shdlc->sm_wq == NULL) | ||
883 | goto err_allocwq; | ||
884 | 878 | ||
885 | shdlc->client_headroom = tx_headroom; | 879 | shdlc->client_headroom = tx_headroom; |
886 | shdlc->client_tailroom = tx_tailroom; | 880 | shdlc->client_tailroom = tx_tailroom; |
@@ -904,9 +898,6 @@ err_regdev: | |||
904 | nfc_hci_free_device(shdlc->hdev); | 898 | nfc_hci_free_device(shdlc->hdev); |
905 | 899 | ||
906 | err_allocdev: | 900 | err_allocdev: |
907 | destroy_workqueue(shdlc->sm_wq); | ||
908 | |||
909 | err_allocwq: | ||
910 | kfree(shdlc); | 901 | kfree(shdlc); |
911 | 902 | ||
912 | return NULL; | 903 | return NULL; |
@@ -920,7 +911,7 @@ void nfc_shdlc_free(struct nfc_shdlc *shdlc) | |||
920 | nfc_hci_unregister_device(shdlc->hdev); | 911 | nfc_hci_unregister_device(shdlc->hdev); |
921 | nfc_hci_free_device(shdlc->hdev); | 912 | nfc_hci_free_device(shdlc->hdev); |
922 | 913 | ||
923 | destroy_workqueue(shdlc->sm_wq); | 914 | cancel_work_sync(&shdlc->sm_work); |
924 | 915 | ||
925 | skb_queue_purge(&shdlc->rcv_q); | 916 | skb_queue_purge(&shdlc->rcv_q); |
926 | skb_queue_purge(&shdlc->send_q); | 917 | skb_queue_purge(&shdlc->send_q); |
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c index 82f0f7588b46..6f368412ffd2 100644 --- a/net/nfc/llcp/llcp.c +++ b/net/nfc/llcp/llcp.c | |||
@@ -114,9 +114,9 @@ static void local_release(struct kref *ref) | |||
114 | nfc_llcp_socket_release(local, false); | 114 | nfc_llcp_socket_release(local, false); |
115 | del_timer_sync(&local->link_timer); | 115 | del_timer_sync(&local->link_timer); |
116 | skb_queue_purge(&local->tx_queue); | 116 | skb_queue_purge(&local->tx_queue); |
117 | destroy_workqueue(local->tx_wq); | 117 | cancel_work_sync(&local->tx_work); |
118 | destroy_workqueue(local->rx_wq); | 118 | cancel_work_sync(&local->rx_work); |
119 | destroy_workqueue(local->timeout_wq); | 119 | cancel_work_sync(&local->timeout_work); |
120 | kfree_skb(local->rx_pending); | 120 | kfree_skb(local->rx_pending); |
121 | kfree(local); | 121 | kfree(local); |
122 | } | 122 | } |
@@ -181,7 +181,7 @@ static void nfc_llcp_symm_timer(unsigned long data) | |||
181 | 181 | ||
182 | pr_err("SYMM timeout\n"); | 182 | pr_err("SYMM timeout\n"); |
183 | 183 | ||
184 | queue_work(local->timeout_wq, &local->timeout_work); | 184 | queue_work(system_nrt_wq, &local->timeout_work); |
185 | } | 185 | } |
186 | 186 | ||
187 | struct nfc_llcp_local *nfc_llcp_find_local(struct nfc_dev *dev) | 187 | struct nfc_llcp_local *nfc_llcp_find_local(struct nfc_dev *dev) |
@@ -1052,7 +1052,7 @@ static void nfc_llcp_rx_work(struct work_struct *work) | |||
1052 | 1052 | ||
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | queue_work(local->tx_wq, &local->tx_work); | 1055 | queue_work(system_nrt_wq, &local->tx_work); |
1056 | kfree_skb(local->rx_pending); | 1056 | kfree_skb(local->rx_pending); |
1057 | local->rx_pending = NULL; | 1057 | local->rx_pending = NULL; |
1058 | 1058 | ||
@@ -1071,7 +1071,7 @@ void nfc_llcp_recv(void *data, struct sk_buff *skb, int err) | |||
1071 | 1071 | ||
1072 | local->rx_pending = skb_get(skb); | 1072 | local->rx_pending = skb_get(skb); |
1073 | del_timer(&local->link_timer); | 1073 | del_timer(&local->link_timer); |
1074 | queue_work(local->rx_wq, &local->rx_work); | 1074 | queue_work(system_nrt_wq, &local->rx_work); |
1075 | 1075 | ||
1076 | return; | 1076 | return; |
1077 | } | 1077 | } |
@@ -1086,7 +1086,7 @@ int nfc_llcp_data_received(struct nfc_dev *dev, struct sk_buff *skb) | |||
1086 | 1086 | ||
1087 | local->rx_pending = skb_get(skb); | 1087 | local->rx_pending = skb_get(skb); |
1088 | del_timer(&local->link_timer); | 1088 | del_timer(&local->link_timer); |
1089 | queue_work(local->rx_wq, &local->rx_work); | 1089 | queue_work(system_nrt_wq, &local->rx_work); |
1090 | 1090 | ||
1091 | return 0; | 1091 | return 0; |
1092 | } | 1092 | } |
@@ -1121,7 +1121,7 @@ void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx, | |||
1121 | if (rf_mode == NFC_RF_INITIATOR) { | 1121 | if (rf_mode == NFC_RF_INITIATOR) { |
1122 | pr_debug("Queueing Tx work\n"); | 1122 | pr_debug("Queueing Tx work\n"); |
1123 | 1123 | ||
1124 | queue_work(local->tx_wq, &local->tx_work); | 1124 | queue_work(system_nrt_wq, &local->tx_work); |
1125 | } else { | 1125 | } else { |
1126 | mod_timer(&local->link_timer, | 1126 | mod_timer(&local->link_timer, |
1127 | jiffies + msecs_to_jiffies(local->remote_lto)); | 1127 | jiffies + msecs_to_jiffies(local->remote_lto)); |
@@ -1130,10 +1130,7 @@ void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx, | |||
1130 | 1130 | ||
1131 | int nfc_llcp_register_device(struct nfc_dev *ndev) | 1131 | int nfc_llcp_register_device(struct nfc_dev *ndev) |
1132 | { | 1132 | { |
1133 | struct device *dev = &ndev->dev; | ||
1134 | struct nfc_llcp_local *local; | 1133 | struct nfc_llcp_local *local; |
1135 | char name[32]; | ||
1136 | int err; | ||
1137 | 1134 | ||
1138 | local = kzalloc(sizeof(struct nfc_llcp_local), GFP_KERNEL); | 1135 | local = kzalloc(sizeof(struct nfc_llcp_local), GFP_KERNEL); |
1139 | if (local == NULL) | 1136 | if (local == NULL) |
@@ -1149,38 +1146,11 @@ int nfc_llcp_register_device(struct nfc_dev *ndev) | |||
1149 | 1146 | ||
1150 | skb_queue_head_init(&local->tx_queue); | 1147 | skb_queue_head_init(&local->tx_queue); |
1151 | INIT_WORK(&local->tx_work, nfc_llcp_tx_work); | 1148 | INIT_WORK(&local->tx_work, nfc_llcp_tx_work); |
1152 | snprintf(name, sizeof(name), "%s_llcp_tx_wq", dev_name(dev)); | ||
1153 | local->tx_wq = | ||
1154 | alloc_workqueue(name, | ||
1155 | WQ_NON_REENTRANT | WQ_UNBOUND | WQ_MEM_RECLAIM, | ||
1156 | 1); | ||
1157 | if (local->tx_wq == NULL) { | ||
1158 | err = -ENOMEM; | ||
1159 | goto err_local; | ||
1160 | } | ||
1161 | 1149 | ||
1162 | local->rx_pending = NULL; | 1150 | local->rx_pending = NULL; |
1163 | INIT_WORK(&local->rx_work, nfc_llcp_rx_work); | 1151 | INIT_WORK(&local->rx_work, nfc_llcp_rx_work); |
1164 | snprintf(name, sizeof(name), "%s_llcp_rx_wq", dev_name(dev)); | ||
1165 | local->rx_wq = | ||
1166 | alloc_workqueue(name, | ||
1167 | WQ_NON_REENTRANT | WQ_UNBOUND | WQ_MEM_RECLAIM, | ||
1168 | 1); | ||
1169 | if (local->rx_wq == NULL) { | ||
1170 | err = -ENOMEM; | ||
1171 | goto err_tx_wq; | ||
1172 | } | ||
1173 | 1152 | ||
1174 | INIT_WORK(&local->timeout_work, nfc_llcp_timeout_work); | 1153 | INIT_WORK(&local->timeout_work, nfc_llcp_timeout_work); |
1175 | snprintf(name, sizeof(name), "%s_llcp_timeout_wq", dev_name(dev)); | ||
1176 | local->timeout_wq = | ||
1177 | alloc_workqueue(name, | ||
1178 | WQ_NON_REENTRANT | WQ_UNBOUND | WQ_MEM_RECLAIM, | ||
1179 | 1); | ||
1180 | if (local->timeout_wq == NULL) { | ||
1181 | err = -ENOMEM; | ||
1182 | goto err_rx_wq; | ||
1183 | } | ||
1184 | 1154 | ||
1185 | local->sockets.lock = __RW_LOCK_UNLOCKED(local->sockets.lock); | 1155 | local->sockets.lock = __RW_LOCK_UNLOCKED(local->sockets.lock); |
1186 | local->connecting_sockets.lock = __RW_LOCK_UNLOCKED(local->connecting_sockets.lock); | 1156 | local->connecting_sockets.lock = __RW_LOCK_UNLOCKED(local->connecting_sockets.lock); |
@@ -1193,17 +1163,6 @@ int nfc_llcp_register_device(struct nfc_dev *ndev) | |||
1193 | list_add(&llcp_devices, &local->list); | 1163 | list_add(&llcp_devices, &local->list); |
1194 | 1164 | ||
1195 | return 0; | 1165 | return 0; |
1196 | |||
1197 | err_rx_wq: | ||
1198 | destroy_workqueue(local->rx_wq); | ||
1199 | |||
1200 | err_tx_wq: | ||
1201 | destroy_workqueue(local->tx_wq); | ||
1202 | |||
1203 | err_local: | ||
1204 | kfree(local); | ||
1205 | |||
1206 | return 0; | ||
1207 | } | 1166 | } |
1208 | 1167 | ||
1209 | void nfc_llcp_unregister_device(struct nfc_dev *dev) | 1168 | void nfc_llcp_unregister_device(struct nfc_dev *dev) |
diff --git a/net/nfc/llcp/llcp.h b/net/nfc/llcp/llcp.h index 83b8bba5a280..af395c9ceb03 100644 --- a/net/nfc/llcp/llcp.h +++ b/net/nfc/llcp/llcp.h | |||
@@ -56,12 +56,9 @@ struct nfc_llcp_local { | |||
56 | 56 | ||
57 | struct timer_list link_timer; | 57 | struct timer_list link_timer; |
58 | struct sk_buff_head tx_queue; | 58 | struct sk_buff_head tx_queue; |
59 | struct workqueue_struct *tx_wq; | ||
60 | struct work_struct tx_work; | 59 | struct work_struct tx_work; |
61 | struct workqueue_struct *rx_wq; | ||
62 | struct work_struct rx_work; | 60 | struct work_struct rx_work; |
63 | struct sk_buff *rx_pending; | 61 | struct sk_buff *rx_pending; |
64 | struct workqueue_struct *timeout_wq; | ||
65 | struct work_struct timeout_work; | 62 | struct work_struct timeout_work; |
66 | 63 | ||
67 | u32 target_idx; | 64 | u32 target_idx; |