lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 24 Jun 2021 21:01:30 +0200
From:   Loic Poulain <loic.poulain@...aro.org>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
        Hemant Kumar <hemantk@...eaurora.org>,
        Bhaumik Bhatt <bbhatt@...eaurora.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH 4/8] bus: mhi: Add inbound buffers allocation flag

On Thu, 24 Jun 2021 at 18:48, Greg KH <gregkh@...uxfoundation.org> wrote:
>
> On Thu, Jun 24, 2021 at 05:39:58PM +0200, Loic Poulain wrote:
> > Hi Greg,
> >
> > On Thu, 24 Jun 2021 at 15:51, Greg KH <gregkh@...uxfoundation.org> wrote:
> > >
> > > On Mon, Jun 21, 2021 at 09:46:12PM +0530, Manivannan Sadhasivam wrote:
> > > > From: Loic Poulain <loic.poulain@...aro.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.
> > > >
> > > > Keep auto_queue flag for now, but should be removed at some point.
> > > >
> > > > Signed-off-by: Loic Poulain <loic.poulain@...aro.org>
> > > > Tested-by: Bhaumik Bhatt <bbhatt@...eaurora.org>
> > > > Reviewed-by: Bhaumik Bhatt <bbhatt@...eaurora.org>
> > > > Reviewed-by: Hemant Kumar <hemantk@...eaurora.org>
> > > > Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> > > > Acked-by: Jakub Kicinski <kuba@...nel.org>
> > > > Link: https://lore.kernel.org/r/1621603519-16773-1-git-send-email-loic.poulain@linaro.org
> > > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> > [...]
> > > > +/**
> > > > + * enum mhi_chan_flags - MHI channel flags
> > > > + * @MHI_CH_INBOUND_ALLOC_BUFS: Automatically allocate and queue inbound buffers
> > > > + */
> > > > +enum mhi_chan_flags {
> > > > +     MHI_CH_INBOUND_ALLOC_BUFS = BIT(0),
> > >
> > > Why is an enumerated type a bitfield?
> > >
> > > Please just use integers for enumerated types.
> >
> > This 'trick' for listing flags is used in other places like drm,
> > mac80211, etc...: grep -r "BIT(0)," ./include/
>
> An enum is a list of values that are unique.  Not values you can mush
> together into a single variable and look at the bit masks of.
>
> > I don't understand why it would not be right? should we simply use
> > a list of defines for this?
>
> What are you using this for?  If you are going to combine them, then
> yes, use #defines.

Yes, it's for combining, thanks for the clarification.
Loic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ