Re: [PATCH 05/10] net: emac: mal: replace busy-wait in mal_poll_disable with wait_event
From: Paolo Abeni
Date: Thu Jul 02 2026 - 07:00:43 EST
On 6/30/26 6:16 AM, Rosen Penev wrote:
> @@ -371,8 +373,8 @@ static irqreturn_t mal_int(int irq, void *dev_instance)
> void mal_poll_disable(struct mal_instance *mal, struct mal_commac *commac)
> {
> /* Spinlock-type semantics: only one caller disable poll at a time */
> - while (test_and_set_bit(MAL_COMMAC_POLL_DISABLED, &commac->flags))
> - msleep(1);
> + wait_event(commac->poll_wait,
> + !test_and_set_bit(MAL_COMMAC_POLL_DISABLED, &commac->flags));
The above looks dangerous to me. IDK which is the expected latency here,
but unconditionally spinning without any obvious upper bound and no
reschedule does not look good.
/P