aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/nfc/hci.h2
-rw-r--r--include/net/nfc/nfc.h1
-rw-r--r--include/net/nfc/shdlc.h1
-rw-r--r--net/nfc/core.c13
-rw-r--r--net/nfc/hci/core.c42
-rw-r--r--net/nfc/hci/hcp.c2
-rw-r--r--net/nfc/hci/shdlc.c27
-rw-r--r--net/nfc/llcp/llcp.c57
-rw-r--r--net/nfc/llcp/llcp.h3
9 files changed, 26 insertions, 122 deletions
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index f5169b04f082..6f065d563ec1 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -74,7 +74,6 @@ struct nfc_hci_dev {
74 74
75 struct list_head msg_tx_queue; 75 struct list_head msg_tx_queue;
76 76
77 struct workqueue_struct *msg_tx_wq;
78 struct work_struct msg_tx_work; 77 struct work_struct msg_tx_work;
79 78
80 struct timer_list cmd_timer; 79 struct timer_list cmd_timer;
@@ -82,7 +81,6 @@ struct nfc_hci_dev {
82 81
83 struct sk_buff_head rx_hcp_frags; 82 struct sk_buff_head rx_hcp_frags;
84 83
85 struct workqueue_struct *msg_rx_wq;
86 struct work_struct msg_rx_work; 84 struct work_struct msg_rx_work;
87 85
88 struct sk_buff_head msg_rx_queue; 86 struct sk_buff_head msg_rx_queue;
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 7b9f71fa0ea7..bfbac732d8c6 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -113,7 +113,6 @@ struct nfc_dev {
113 int tx_tailroom; 113 int tx_tailroom;
114 114
115 struct timer_list check_pres_timer; 115 struct timer_list check_pres_timer;
116 struct workqueue_struct *check_pres_wq;
117 struct work_struct check_pres_work; 116 struct work_struct check_pres_work;
118 117
119 struct nfc_ops *ops; 118 struct nfc_ops *ops;
diff --git a/include/net/nfc/shdlc.h b/include/net/nfc/shdlc.h
index 35e930d2f638..342427362989 100644
--- a/include/net/nfc/shdlc.h
+++ b/include/net/nfc/shdlc.h
@@ -79,7 +79,6 @@ struct nfc_shdlc {
79 79
80 struct sk_buff_head ack_pending_q; 80 struct sk_buff_head ack_pending_q;
81 81
82 struct workqueue_struct *sm_wq;
83 struct work_struct sm_work; 82 struct work_struct sm_work;
84 83
85 struct nfc_shdlc_ops *ops; 84 struct nfc_shdlc_ops *ops;
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
721struct class nfc_class = { 721struct 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
147void nfc_hci_resp_received(struct nfc_hci_dev *hdev, u8 result, 147void 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
332static int hci_dev_connect_gates(struct nfc_hci_dev *hdev, u8 gate_count, 332static 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
660int nfc_hci_register_device(struct nfc_hci_dev *hdev) 660int 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
699exit:
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}
709EXPORT_SYMBOL(nfc_hci_register_device); 680EXPORT_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</