From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 1/8] shdma: fdt: allow moving of the shdma_slave_used fields
Date: Wed, 04 Jun 2014 17:29:02 +0000 [thread overview]
Message-ID: <538F575E.3020802@cogentembedded.com> (raw)
In-Reply-To: <1401898455-31064-2-git-send-email-ben.dooks@codethink.co.uk>
Hello.
On 06/04/2014 08:14 PM, Ben Dooks wrote:
> The shdma_slave_used is used to track the DMA hardware channels that are
> claimed by clients. This works when the system has a global number space
> as used by the platform clients, however when we are using fdt possible
> space is much bigger (if we used phandle+hwid).
> It is much easier for the OF case to change to using the hwid of the
> channel and make the allocation bitmap part of the mux device that holds
> all the dma controllers that can access the set of hwids that need
> protecting. So change the code to make it that each sdev points to an
> bitmap that can be allocated via the shdma-of.c when needed.
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> drivers/dma/sh/shdma-base.c | 17 +++++++++--------
> include/linux/shdma-base.h | 1 +
> 2 files changed, 10 insertions(+), 8 deletions(-)
> diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
> index b35007e..5b18c88 100644
> --- a/drivers/dma/sh/shdma-base.c
> +++ b/drivers/dma/sh/shdma-base.c
[...]
> @@ -997,9 +998,9 @@ EXPORT_SYMBOL(shdma_cleanup);
>
> static int __init shdma_enter(void)
> {
> - shdma_slave_used = kzalloc(DIV_ROUND_UP(slave_num, BITS_PER_LONG) *
> + shdma_global_slave_used = kzalloc(DIV_ROUND_UP(slave_num, BITS_PER_LONG) *
> sizeof(long), GFP_KERNEL);
kcalloc() seems more fitting here.
> - if (!shdma_slave_used)
> + if (!shdma_global_slave_used)
> return -ENOMEM;
> return 0;
> }
WBR, Sergei
prev parent reply other threads:[~2014-06-04 17:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 16:14 [PATCH 1/8] shdma: fdt: allow moving of the shdma_slave_used fields Ben Dooks
2014-06-04 17:29 ` Sergei Shtylyov [this message]
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=538F575E.3020802@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=linux-sh@vger.kernel.org \
/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.