Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/ethernet/eth_stm32_hal_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ int eth_stm32_hal_init(const struct device *dev)
/* Initialize semaphores */
k_mutex_init(&dev_data->tx_mutex);
k_sem_init(&dev_data->rx_int_sem, 0, K_SEM_MAX_LIMIT);
k_sem_init(&dev_data->tx_int_sem, 0, K_SEM_MAX_LIMIT);
k_sem_init(&dev_data->tx_int_sem, 0, 1);
Comment on lines 514 to +608
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch and I think this error is widely spread in drivers.
Btw, are we sure rx_int_sem shouldn't also be used as a semaphore ? From the way it is used, I'd say yes.
If not maybe this is worth a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whilst working on this PR, I hadn't paid attention to rx_int_sem. Having briefly examined its logic today, I'm not entirely certain whether counting is necessary, as it contains a loop. Testing will be required to ascertain this.


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