Re: [net PATCH 1/5] octeontx2: Detect the mbox up or down message via register

From: Paolo Abeni
Date: Tue Mar 12 2024 - 07:22:52 EST


On Tue, 2024-03-12 at 00:46 +0530, Subbaraya Sundeep wrote:
> +bool otx2_mbox_wait_for_zero(struct otx2_mbox *mbox, int devid)
> +{
> + u64 data;
> +
> + data = readq((void __iomem *)mbox->reg_base +
> + (mbox->trigger | (devid << mbox->tr_shift)));
> +
> + /* If data is non-zero wait for ~1ms and return to caller
> + * whether data has changed to zero or not after the wait.
> + */
> +
> + if (data)
> + usleep_range(950, 1000);
> + else
> + return true;

Since you have to repost,

if (!data)
return true;

usleep_range(950, 1000);


will be more readable


Side note: this quite huge for a 'net' patch: it would be nice (but not
mandatory) if you could break it in smaller pieces or consider a 'net-
next' target. In the latter case, please note that 'net-next' is
currently closed for the merge window.

Cheers,

Paolo