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

From: Subbaraya Sundeep Bhatta
Date: Tue Mar 12 2024 - 07:49:47 EST


Hi,

>-----Original Message-----
>From: Paolo Abeni <pabeni@xxxxxxxxxx>
>Sent: Tuesday, March 12, 2024 4:52 PM
>To: Subbaraya Sundeep Bhatta <sbhatta@xxxxxxxxxxx>;
>netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
>Cc: davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx; Sunil
>Kovvuri Goutham <sgoutham@xxxxxxxxxxx>; Linu Cherian
><lcherian@xxxxxxxxxxx>; Geethasowjanya Akula <gakula@xxxxxxxxxxx>;
>Hariprasad Kelam <hkelam@xxxxxxxxxxx>; Naveen Mamindlapalli
><naveenm@xxxxxxxxxxx>; horms@xxxxxxxxxx
>Subject: [EXTERNAL] Re: [net PATCH 1/5] octeontx2: Detect the mbox up or
>down message via register
>
>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
>
>
Sure will change as per your suggestion.

>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.
>
Actually I thought of breaking into smaller pieces before but all this changes are needed for basic
mbox functionality hence used a single patch. I am fixing mbox communication errors with a design change so assumed
it as net material. Please let me know if you still want to be a net-next patch.

Thanks,
Sundeep

>Cheers,
>
>Paolo