File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1504,6 +1504,10 @@ static int m_can_start(struct net_device *dev)
1504
1504
1505
1505
m_can_enable_all_interrupts (cdev );
1506
1506
1507
+ if (cdev -> version > 30 )
1508
+ cdev -> tx_fifo_putidx = FIELD_GET (TXFQS_TFQPI_MASK ,
1509
+ m_can_read (cdev , M_CAN_TXFQS ));
1510
+
1507
1511
return 0 ;
1508
1512
}
1509
1513
@@ -1793,7 +1797,7 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev)
1793
1797
}
1794
1798
1795
1799
/* get put index for frame */
1796
- putidx = FIELD_GET ( TXFQS_TFQPI_MASK , txfqs ) ;
1800
+ putidx = cdev -> tx_fifo_putidx ;
1797
1801
1798
1802
/* Construct DLC Field, with CAN-FD configuration.
1799
1803
* Use the put index of the fifo as the message marker,
@@ -1827,6 +1831,8 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev)
1827
1831
1828
1832
/* Enable TX FIFO element to start transfer */
1829
1833
m_can_write (cdev , M_CAN_TXBAR , (1 << putidx ));
1834
+ cdev -> tx_fifo_putidx = (++ cdev -> tx_fifo_putidx >= cdev -> can .echo_skb_max ?
1835
+ 0 : cdev -> tx_fifo_putidx );
1830
1836
1831
1837
/* stop network queue if fifo full */
1832
1838
if (m_can_tx_fifo_full (cdev ) ||
Original file line number Diff line number Diff line change @@ -101,6 +101,9 @@ struct m_can_classdev {
101
101
u32 tx_max_coalesced_frames_irq ;
102
102
u32 tx_coalesce_usecs_irq ;
103
103
104
+ // Store this internally to avoid fetch delays on peripheral chips
105
+ int tx_fifo_putidx ;
106
+
104
107
struct mram_cfg mcfg [MRAM_CFG_NUM ];
105
108
106
109
struct hrtimer hrtimer ;
You can’t perform that action at this time.
0 commit comments