Re: [PATCH] mhi_bus: core: Return EBUSY if MHI ring is full

From: Loic Poulain
Date: Wed Feb 17 2021 - 11:07:47 EST


On Wed, 17 Feb 2021 at 16:06, Jeffrey Hugo <jhugo@xxxxxxxxxxxxxx> wrote:
>
> On 2/17/2021 8:02 AM, Loic Poulain wrote:
> > On Tue, 16 Feb 2021 at 19:50, Jeffrey Hugo <jhugo@xxxxxxxxxxxxxx> wrote:
> >>
> >> From: Fan Wu <wufan@xxxxxxxxxxxxxx>
> >>
> >> Currently ENOMEM is returned when MHI ring is full. This error code is
> >> very misleading. Change to EBUSY instead.
> >
> > Well, there is no space left in the ring, so it's no so misleading.
>
> ENOMEM is typically a memory allocation failure which is not what a
> client is going to think of regarding the ring, and it's not a unique
> failure code in this case. gen_tre can also return ENOMEM, which makes
> it difficult for the client to know if there is some significant
> failure, or they might just need to wait (assuming that is something the
> client can do).

Yes, fair enough, I overlooked the other thread, -EAGAIN would indeed
make sense.

Regards,
Loic