File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,10 @@ static dma_addr_t net_devmem_get_dma_addr(const struct net_iov *niov)
55
55
((dma_addr_t )net_iov_idx (niov ) << PAGE_SHIFT );
56
56
}
57
57
58
- void __net_devmem_dmabuf_binding_free (struct net_devmem_dmabuf_binding * binding )
58
+ void __net_devmem_dmabuf_binding_free (struct work_struct * wq )
59
59
{
60
+ struct net_devmem_dmabuf_binding * binding = container_of (wq , typeof (* binding ), unbind_w );
61
+
60
62
size_t size , avail ;
61
63
62
64
gen_pool_for_each_chunk (binding -> chunk_pool ,
Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ struct net_devmem_dmabuf_binding {
54
54
* net_iovs in the TX path.
55
55
*/
56
56
struct net_iov * * tx_vec ;
57
+
58
+ struct work_struct unbind_w ;
57
59
};
58
60
59
61
#if defined(CONFIG_NET_DEVMEM )
@@ -70,7 +72,7 @@ struct dmabuf_genpool_chunk_owner {
70
72
dma_addr_t base_dma_addr ;
71
73
};
72
74
73
- void __net_devmem_dmabuf_binding_free (struct net_devmem_dmabuf_binding * binding );
75
+ void __net_devmem_dmabuf_binding_free (struct work_struct * wq );
74
76
struct net_devmem_dmabuf_binding *
75
77
net_devmem_bind_dmabuf (struct net_device * dev ,
76
78
enum dma_data_direction direction ,
@@ -121,7 +123,8 @@ net_devmem_dmabuf_binding_put(struct net_devmem_dmabuf_binding *binding)
121
123
if (!refcount_dec_and_test (& binding -> ref ))
122
124
return ;
123
125
124
- __net_devmem_dmabuf_binding_free (binding );
126
+ INIT_WORK (& binding -> unbind_w , __net_devmem_dmabuf_binding_free );
127
+ schedule_work (& binding -> unbind_w );
125
128
}
126
129
127
130
void net_devmem_get_net_iov (struct net_iov * niov );
@@ -154,8 +157,7 @@ static inline void net_devmem_put_net_iov(struct net_iov *niov)
154
157
{
155
158
}
156
159
157
- static inline void
158
- __net_devmem_dmabuf_binding_free (struct net_devmem_dmabuf_binding * binding )
160
+ static inline void __net_devmem_dmabuf_binding_free (struct work_struct * wq )
159
161
{
160
162
}
161
163
You can’t perform that action at this time.
0 commit comments