diff options
Diffstat (limited to 'net/nfc/llcp/llcp.c')
-rw-r--r-- | net/nfc/llcp/llcp.c | 57 |
1 files changed, 8 insertions, 49 deletions
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) |