From: Scott Wood <scottwood@freescale.com>
To: Zhao Qiang-B45475 <qiang.zhao@freescale.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"lauraa@codeaurora.org" <lauraa@codeaurora.org>,
Xie Xiaobo-R63061 <X.Xie@freescale.com>,
"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
Li Yang-Leo-R58472 <LeoLi@freescale.com>,
"paulus@samba.org" <paulus@samba.org>
Subject: Re: [PATCH v12 3/6] CPM/QE: use genalloc to manage CPM/QE muram
Date: Fri, 23 Oct 2015 15:59:07 -0500 [thread overview]
Message-ID: <1445633947.701.231.camel@freescale.com> (raw)
In-Reply-To: <SN1PR0301MB1550906A0C2A2F6BA4EF807D9B260@SN1PR0301MB1550.namprd03.prod.outlook.com>
Don't send HTML e-mail.
On Fri, 2015-10-23 at 02:06 -0500, Zhao Qiang-B45475 wrote:
> On Fri, 2015-10-23 at 11:00 AM, Wood Scott-B07421 <scottwood@freescale.com>
> wrote:
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Friday, October 23, 2015 11:00 AM
> > To: Zhao Qiang-B45475 <qiang.zhao@freescale.com>
> > Cc: linux-kernel@vger.kernel.org; linuxppc-dev@lists.ozlabs.org;
> > lauraa@codeaurora.org; Xie Xiaobo-R63061 <X.Xie@freescale.com>;
> > benh@kernel.crashing.org; Li Yang-Leo-R58472 <LeoLi@freescale.com>;
> > paulus@samba.org
> > Subject: Re: [PATCH v12 3/6] CPM/QE: use genalloc to manage CPM/QE muram
> >
> > On Wed, 2015-10-14 at 15:16 +0800, Zhao Qiang wrote:
> > > -/**
> > > +/*
> > > * cpm_muram_alloc - allocate the requested size worth of multi-user
> ram
> > > * @size: number of bytes to allocate
> > > * @align: requested alignment, in bytes @@ -141,59 +151,102 @@ out:
> > > */
> > > unsigned long cpm_muram_alloc(unsigned long size, unsigned long
> > > align) {
> > > - unsigned long start;
> > > unsigned long flags;
> > > -
> > > + unsigned long start;
> > > + static struct genpool_data_align muram_pool_data;
> > > spin_lock_irqsave(&cpm_muram_lock, flags);
> > > - cpm_muram_info.alignment = align;
> > > - start = rh_alloc(&cpm_muram_info, size, "commproc");
> > > - memset(cpm_muram_addr(start), 0, size);
> > > + muram_pool_data.align = align;
> > > + gen_pool_set_algo(muram_pool, gen_pool_first_fit_align,
> > > + &muram_pool_data);
> > > + start = cpm_muram_alloc_common(size, &muram_pool_data);
> > > spin_unlock_irqrestore(&cpm_muram_lock, flags);
> > > -
> > > return start;
> > > }
> > > EXPORT_SYMBOL(cpm_muram_alloc);
> >
> > Why is muram_pool_data static? Why is it being passed to
> > gen_pool_set_algo()?
> Cpm_muram use both align algo and fixed algo, so we need to set
> corresponding algo and
> Algo data.
The data gets passed in via gen_pool_alloc_data(). The point was to allow it
to be on the caller's stack, not a long-lived data structure shared by all
callers and needing synchronization.
> >The whole reason we're adding gen_pool_alloc_data()
> > is to avoid that. Do we need gen_pool_alloc_algo() too?
>
> We add gen_pool_alloc_data() to pass data to algo, because align algo and
> fixed algo,
> Because align and fixed algos need specific data.
And my point is that because of that, it seems like we need a version that
accepts an algorithm as well.
-Scott
next prev parent reply other threads:[~2015-10-23 20:59 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 7:16 [PATCH v12 1/6] genalloc:support memory-allocation with bytes-alignment to genalloc Zhao Qiang
2015-10-14 7:16 ` [PATCH v12 2/6] genalloc:support allocating specific region Zhao Qiang
2015-10-14 7:16 ` [PATCH v12 3/6] CPM/QE: use genalloc to manage CPM/QE muram Zhao Qiang
2015-10-23 2:59 ` Scott Wood
2015-10-23 7:06 ` Zhao Qiang
2015-10-23 20:59 ` Scott Wood [this message]
2015-10-26 3:15 ` Zhao Qiang
2015-10-26 3:15 ` Zhao Qiang
2015-10-27 4:50 ` Scott Wood
2015-10-14 7:16 ` [PATCH v12 4/6] QE/CPM: move muram management functions to qe_common Zhao Qiang
2015-10-23 3:09 ` Scott Wood
2015-10-23 7:45 ` Zhao Qiang
2015-10-23 7:45 ` Zhao Qiang
2015-10-23 20:56 ` Scott Wood
2015-10-26 2:42 ` Zhao Qiang
2015-10-26 2:42 ` Zhao Qiang
2015-10-27 4:48 ` Scott Wood
2015-10-27 6:24 ` Zhao Qiang
2015-10-27 6:24 ` Zhao Qiang
2015-10-27 6:50 ` Scott Wood
2015-10-27 7:34 ` Zhao Qiang
2015-10-27 7:34 ` Zhao Qiang
2015-10-27 7:36 ` Scott Wood
2015-10-14 7:16 ` [PATCH v12 5/6] QE: use subsys_initcall to init qe Zhao Qiang
2015-10-23 3:11 ` Scott Wood
2015-10-14 7:16 ` [PATCH v12 6/6] QE: Move QE from arch/powerpc to drivers/soc Zhao Qiang
2015-10-23 3:19 ` Scott Wood
2015-10-23 7:49 ` Zhao Qiang
2015-10-23 7:49 ` Zhao Qiang
2015-10-23 20:55 ` Scott Wood
2015-10-26 2:33 ` Zhao Qiang
2015-10-26 2:33 ` Zhao Qiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1445633947.701.231.camel@freescale.com \
--to=scottwood@freescale.com \
--cc=LeoLi@freescale.com \
--cc=X.Xie@freescale.com \
--cc=benh@kernel.crashing.org \
--cc=lauraa@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=qiang.zhao@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.