lkml.org 
[lkml]   [2021]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] bus: mhi: Add inbound buffers allocation flag
On Sat, Oct 16, 2021 at 09:39:53AM +0200, Greg KH wrote:
> On Sat, Oct 16, 2021 at 12:27:33PM +0530, Manivannan Sadhasivam wrote:
> > From: Loic Poulain <loic.poulain@linaro.org>
> >
> > Currently, the MHI controller driver defines which channels should
> > have their inbound buffers allocated and queued. But ideally, this is
> > something that should be decided by the MHI device driver instead,
> > which actually deals with that buffers.
> >
> > Add a flag parameter to mhi_prepare_for_transfer allowing to specify
> > if buffers have to be allocated and queued by the MHI stack.
>
> This is a horrible api. Now one has to go and look up why "0" was added
> to a function as a parameter.
>
> If you don't want to allocate the buffer, then make a function of that
> name and call that. As you only have one "flag", don't try to make
> something generic here that is obviously not generic at all.
>

This is the only API that can be used by the client drivers to pass the
configurations to the MHI stack. So we wanted to have a flags parameter that
could be extended in the future also.

Regarding "0", the default behaviour is to not pre allocate the buffer at all.
So it made less sense to add a separate flag or an API for that.

Thanks,
Mani

> You all can do better than this.
>
> thanks,
>
> greg k-h

\
 
 \ /
  Last update: 2021-10-16 18:32    [W:0.052 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site