diff options
Diffstat (limited to 'drivers/misc/mei/interrupt.c')
-rw-r--r-- | drivers/misc/mei/interrupt.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index b584749bcc4a..406e9e2b2fff 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
@@ -35,14 +35,14 @@ | |||
35 | * for the completed callbacks | 35 | * for the completed callbacks |
36 | * | 36 | * |
37 | * @dev: mei device | 37 | * @dev: mei device |
38 | * @compl_list: list of completed cbs | 38 | * @cmpl_list: list of completed cbs |
39 | */ | 39 | */ |
40 | void mei_irq_compl_handler(struct mei_device *dev, struct mei_cl_cb *compl_list) | 40 | void mei_irq_compl_handler(struct mei_device *dev, struct list_head *cmpl_list) |
41 | { | 41 | { |
42 | struct mei_cl_cb *cb, *next; | 42 | struct mei_cl_cb *cb, *next; |
43 | struct mei_cl *cl; | 43 | struct mei_cl *cl; |
44 | 44 | ||
45 | list_for_each_entry_safe(cb, next, &compl_list->list, list) { | 45 | list_for_each_entry_safe(cb, next, cmpl_list, list) { |
46 | cl = cb->cl; | 46 | cl = cb->cl; |
47 | list_del_init(&cb->list); | 47 | list_del_init(&cb->list); |
48 | 48 | ||
@@ -92,13 +92,13 @@ void mei_irq_discard_msg(struct mei_device *dev, struct mei_msg_hdr *hdr) | |||
92 | * | 92 | * |
93 | * @cl: reading client | 93 | * @cl: reading client |
94 | * @mei_hdr: header of mei client message | 94 | * @mei_hdr: header of mei client message |
95 | * @complete_list: completion list | 95 | * @cmpl_list: completion list |
96 | * | 96 | * |
97 | * Return: always 0 | 97 | * Return: always 0 |
98 | */ | 98 | */ |
99 | int mei_cl_irq_read_msg(struct mei_cl *cl, | 99 | int mei_cl_irq_read_msg(struct mei_cl *cl, |
100 | struct mei_msg_hdr *mei_hdr, | 100 | struct mei_msg_hdr *mei_hdr, |
101 | struct mei_cl_cb *complete_list) | 101 | struct list_head *cmpl_list) |
102 | { | 102 | { |
103 | struct mei_device *dev = cl->dev; | 103 | struct mei_device *dev = cl->dev; |
104 | struct mei_cl_cb *cb; | 104 | struct mei_cl_cb *cb; |
@@ -144,7 +144,7 @@ int mei_cl_irq_read_msg(struct mei_cl *cl, | |||
144 | 144 | ||
145 | if (mei_hdr->msg_complete) { | 145 | if (mei_hdr->msg_complete) { |
146 | cl_dbg(dev, cl, "completed read length = %zu\n", cb->buf_idx); | 146 | cl_dbg(dev, cl, "completed read length = %zu\n", cb->buf_idx); |
147 | list_move_tail(&cb->list, &complete_list->list); | 147 | list_move_tail(&cb->list, cmpl_list); |
148 | } else { | 148 | } else { |
149 | pm_runtime_mark_last_busy(dev->dev); | 149 | pm_runtime_mark_last_busy(dev->dev); |
150 | pm_request_autosuspend(dev->dev); | 150 | pm_request_autosuspend(dev->dev); |
@@ -154,7 +154,7 @@ int mei_cl_irq_read_msg(struct mei_cl *cl, | |||
154 | 154 | ||
155 | discard: | 155 | discard: |
156 | if (cb) | 156 | if (cb) |
157 | list_move_tail(&cb->list, &complete_list->list); | 157 | list_move_tail(&cb->list, cmpl_list); |
158 | mei_irq_discard_msg(dev, mei_hdr); | 158 | mei_irq_discard_msg(dev, mei_hdr); |
159 | return 0; | 159 | return 0; |
160 | } | 160 | } |
@@ -169,7 +169,7 @@ discard: | |||
169 | * Return: 0, OK; otherwise, error. | 169 | * Return: 0, OK; otherwise, error. |
170 | */ | 170 | */ |
171 | static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb, | 171 | static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb, |
172 | struct mei_cl_cb *cmpl_list) | 172 | struct list_head *cmpl_list) |
173 | { | 173 | { |
174 | struct mei_device *dev = cl->dev; | 174 | struct mei_device *dev = cl->dev; |
175 | u32 msg_slots; | 175 | u32 msg_slots; |
@@ -183,7 +183,7 @@ static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb, | |||
183 | return -EMSGSIZE; | 183 | return -EMSGSIZE; |
184 | 184 | ||
185 | ret = mei_hbm_cl_disconnect_rsp(dev, cl); | 185 | ret = mei_hbm_cl_disconnect_rsp(dev, cl); |
186 | list_move_tail(&cb->list, &cmpl_list->list); | 186 | list_move_tail(&cb->list, cmpl_list); |
187 | 187 | ||
188 | return ret; | 188 | return ret; |
189 | } | 189 | } |
@@ -199,7 +199,7 @@ static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb, | |||
199 | * Return: 0, OK; otherwise, error. | 199 | * Return: 0, OK; otherwise, error. |
200 | */ | 200 | */ |
201 | static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb, | 201 | static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb, |
202 | struct mei_cl_cb *cmpl_list) | 202 | struct list_head *cmpl_list) |
203 | { | 203 | { |
204 | struct mei_device *dev = cl->dev; | 204 | struct mei_device *dev = cl->dev; |
205 | u32 msg_slots; | 205 | u32 msg_slots; |
@@ -219,7 +219,7 @@ static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb, | |||
219 | if (ret) { | 219 | if (ret) { |
220 | cl->status = ret; | 220 | cl->status = ret; |
221 | cb->buf_idx = 0; | 221 | cb->buf_idx = 0; |
222 | list_move_tail(&cb->list, &cmpl_list->list); | 222 | list_move_tail(&cb->list, cmpl_list); |
223 | return ret; | 223 | return ret; |
224 | } | 224 | } |
225 | 225 | ||
@@ -249,7 +249,7 @@ static inline bool hdr_is_fixed(struct mei_msg_hdr *mei_hdr) | |||
249 | * Return: 0 on success, <0 on failure. | 249 | * Return: 0 on success, <0 on failure. |
250 | */ | 250 | */ |
251 | int mei_irq_read_handler(struct mei_device *dev, | 251 | int mei_irq_read_handler(struct mei_device *dev, |
252 | struct mei_cl_cb *cmpl_list, s32 *slots) | 252 | struct list_head *cmpl_list, s32 *slots) |
253 | { | 253 | { |
254 | struct mei_msg_hdr *mei_hdr; | 254 | struct mei_msg_hdr *mei_hdr; |
255 | struct mei_cl *cl; | 255 | struct mei_cl *cl; |
@@ -347,12 +347,11 @@ EXPORT_SYMBOL_GPL(mei_irq_read_handler); | |||
347 | * | 347 | * |
348 | * Return: 0 on success, <0 on failure. | 348 | * Return: 0 on success, <0 on failure. |
349 | */ | 349 | */ |
350 | int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list) | 350 | int mei_irq_write_handler(struct mei_device *dev, struct list_head *cmpl_list) |
351 | { | 351 | { |
352 | 352 | ||
353 | struct mei_cl *cl; | 353 | struct mei_cl *cl; |
354 | struct mei_cl_cb *cb, *next; | 354 | struct mei_cl_cb *cb, *next; |
355 | struct mei_cl_cb *list; | ||
356 | s32 slots; | 355 | s32 slots; |
357 | int ret; | 356 | int ret; |
358 | 357 | ||
@@ -367,19 +366,18 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list) | |||
367 | /* complete all waiting for write CB */ | 366 | /* complete all waiting for write CB */ |
368 | dev_dbg(dev->dev, "complete all waiting for write cb.\n"); | 367 | dev_dbg(dev->dev, "complete all waiting for write cb.\n"); |
369 | 368 | ||
370 | list = &dev->write_waiting_list; | 369 | list_for_each_entry_safe(cb, next, &dev->write_waiting_list, list) { |
371 | list_for_each_entry_safe(cb, next, &list->list, list) { | ||
372 | cl = cb->cl; | 370 | cl = cb->cl; |
373 | 371 | ||
374 | cl->status = 0; | 372 | cl->status = 0; |
375 | cl_dbg(dev, cl, "MEI WRITE COMPLETE\n"); | 373 | cl_dbg(dev, cl, "MEI WRITE COMPLETE\n"); |
376 | cl->writing_state = MEI_WRITE_COMPLETE; | 374 | cl->writing_state = MEI_WRITE_COMPLETE; |
377 | list_move_tail(&cb->list, &cmpl_list->list); | 375 | list_move_tail(&cb->list, cmpl_list); |
378 | } | 376 | } |
379 | 377 | ||
380 | /* complete control write list CB */ | 378 | /* complete control write list CB */ |
381 | dev_dbg(dev->dev, "complete control write list cb.\n"); | 379 | dev_dbg(dev->dev, "complete control write list cb.\n"); |
382 | list_for_each_entry_safe(cb, next, &dev->ctrl_wr_list.list, list) { | 380 | list_for_each_entry_safe(cb, next, &dev->ctrl_wr_list, list) { |
383 | cl = cb->cl; | 381 | cl = cb->cl; |
384 | switch (cb->fop_type) { | 382 | switch (cb->fop_type) { |
385 | case MEI_FOP_DISCONNECT: | 383 | case MEI_FOP_DISCONNECT: |
@@ -423,7 +421,7 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list) | |||
423 | } | 421 | } |
424 | /* complete write list CB */ | 422 | /* complete write list CB */ |
425 | dev_dbg(dev->dev, "complete write list cb.\n"); | 423 | dev_dbg(dev->dev, "complete write list cb.\n"); |
426 | list_for_each_entry_safe(cb, next, &dev->write_list.list, list) { | 424 | list_for_each_entry_safe(cb, next, &dev->write_list, list) { |
427 | cl = cb->cl; | 425 | cl = cb->cl; |
428 | if (cl == &dev->iamthif_cl) | 426 | if (cl == &dev->iamthif_cl) |
429 | ret = mei_amthif_irq_write(cl, cb, cmpl_list); | 427 | ret = mei_amthif_irq_write(cl, cb, cmpl_list); |