@@ -280,14 +280,14 @@ static int write_ipc_from_queue(struct ishtp_device *dev)
280
280
* if tx send list is empty - return 0;
281
281
* may happen, as RX_COMPLETE handler doesn't check list emptiness.
282
282
*/
283
- if (list_empty (& dev -> wr_processing_list_head . link )) {
283
+ if (list_empty (& dev -> wr_processing_list )) {
284
284
spin_unlock_irqrestore (& dev -> wr_processing_spinlock , flags );
285
285
out_ipc_locked = 0 ;
286
286
return 0 ;
287
287
}
288
288
289
- ipc_link = list_entry ( dev -> wr_processing_list_head . link . next ,
290
- struct wr_msg_ctl_info , link );
289
+ ipc_link = list_first_entry ( & dev -> wr_processing_list ,
290
+ struct wr_msg_ctl_info , link );
291
291
/* first 4 bytes of the data is the doorbell value (IPC header) */
292
292
length = ipc_link -> length - sizeof (uint32_t );
293
293
doorbell_val = * (uint32_t * )ipc_link -> inline_data ;
@@ -338,7 +338,7 @@ static int write_ipc_from_queue(struct ishtp_device *dev)
338
338
ipc_send_compl = ipc_link -> ipc_send_compl ;
339
339
ipc_send_compl_prm = ipc_link -> ipc_send_compl_prm ;
340
340
list_del_init (& ipc_link -> link );
341
- list_add_tail (& ipc_link -> link , & dev -> wr_free_list_head . link );
341
+ list_add (& ipc_link -> link , & dev -> wr_free_list );
342
342
spin_unlock_irqrestore (& dev -> wr_processing_spinlock , flags );
343
343
344
344
/*
@@ -372,26 +372,26 @@ static int write_ipc_to_queue(struct ishtp_device *dev,
372
372
unsigned char * msg , int length )
373
373
{
374
374
struct wr_msg_ctl_info * ipc_link ;
375
- unsigned long flags ;
375
+ unsigned long flags ;
376
376
377
377
if (length > IPC_FULL_MSG_SIZE )
378
378
return - EMSGSIZE ;
379
379
380
380
spin_lock_irqsave (& dev -> wr_processing_spinlock , flags );
381
- if (list_empty (& dev -> wr_free_list_head . link )) {
381
+ if (list_empty (& dev -> wr_free_list )) {
382
382
spin_unlock_irqrestore (& dev -> wr_processing_spinlock , flags );
383
383
return - ENOMEM ;
384
384
}
385
- ipc_link = list_entry ( dev -> wr_free_list_head . link . next ,
386
- struct wr_msg_ctl_info , link );
385
+ ipc_link = list_first_entry ( & dev -> wr_free_list ,
386
+ struct wr_msg_ctl_info , link );
387
387
list_del_init (& ipc_link -> link );
388
388
389
389
ipc_link -> ipc_send_compl = ipc_send_compl ;
390
390
ipc_link -> ipc_send_compl_prm = ipc_send_compl_prm ;
391
391
ipc_link -> length = length ;
392
392
memcpy (ipc_link -> inline_data , msg , length );
393
393
394
- list_add_tail (& ipc_link -> link , & dev -> wr_processing_list_head . link );
394
+ list_add_tail (& ipc_link -> link , & dev -> wr_processing_list );
395
395
spin_unlock_irqrestore (& dev -> wr_processing_spinlock , flags );
396
396
397
397
write_ipc_from_queue (dev );
@@ -487,17 +487,13 @@ static int ish_fw_reset_handler(struct ishtp_device *dev)
487
487
{
488
488
uint32_t reset_id ;
489
489
unsigned long flags ;
490
- struct wr_msg_ctl_info * processing , * next ;
491
490
492
491
/* Read reset ID */
493
492
reset_id = ish_reg_read (dev , IPC_REG_ISH2HOST_MSG ) & 0xFFFF ;
494
493
495
494
/* Clear IPC output queue */
496
495
spin_lock_irqsave (& dev -> wr_processing_spinlock , flags );
497
- list_for_each_entry_safe (processing , next ,
498
- & dev -> wr_processing_list_head .link , link ) {
499
- list_move_tail (& processing -> link , & dev -> wr_free_list_head .link );
500
- }
496
+ list_splice_init (& dev -> wr_processing_list , & dev -> wr_free_list );
501
497
spin_unlock_irqrestore (& dev -> wr_processing_spinlock , flags );
502
498
503
499
/* ISHTP notification in IPC_RESET */
@@ -921,9 +917,9 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev)
921
917
spin_lock_init (& dev -> out_ipc_spinlock );
922
918
923
919
/* Init IPC processing and free lists */
924
- INIT_LIST_HEAD (& dev -> wr_processing_list_head . link );
925
- INIT_LIST_HEAD (& dev -> wr_free_list_head . link );
926
- for (i = 0 ; i < IPC_TX_FIFO_SIZE ; ++ i ) {
920
+ INIT_LIST_HEAD (& dev -> wr_processing_list );
921
+ INIT_LIST_HEAD (& dev -> wr_free_list );
922
+ for (i = 0 ; i < IPC_TX_FIFO_SIZE ; i ++ ) {
927
923
struct wr_msg_ctl_info * tx_buf ;
928
924
929
925
tx_buf = devm_kzalloc (& pdev -> dev ,
@@ -939,7 +935,7 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev)
939
935
i );
940
936
break ;
941
937
}
942
- list_add_tail (& tx_buf -> link , & dev -> wr_free_list_head . link );
938
+ list_add_tail (& tx_buf -> link , & dev -> wr_free_list );
943
939
}
944
940
945
941
dev -> ops = & ish_hw_ops ;
0 commit comments