Skip to content

Commit ab093c2

Browse files
Freey0cfriedt
authored andcommitted
drivers: ethernet: eth_stm32 tx_in_sem limit set to 1
tx_int_sem serves solely as a signal indicator and does not require signal counting. Within eth_stm32_tx, the semaphore is reset each time a packet is transmitted. Upon receiving the transmission completion signal, the function exits. Signal counting is unnecessary. Change to a binary semaphore. Signed-off-by: WenBin Zhang <[email protected]>
1 parent f8a76ef commit ab093c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ethernet/eth_stm32_hal_v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ int eth_stm32_hal_init(const struct device *dev)
512512
/* Initialize semaphores */
513513
k_mutex_init(&dev_data->tx_mutex);
514514
k_sem_init(&dev_data->rx_int_sem, 0, K_SEM_MAX_LIMIT);
515-
k_sem_init(&dev_data->tx_int_sem, 0, K_SEM_MAX_LIMIT);
515+
k_sem_init(&dev_data->tx_int_sem, 0, 1);
516516

517517
/* Tx config init: */
518518
memset(&tx_config, 0, sizeof(ETH_TxPacketConfig));

0 commit comments

Comments
 (0)