All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	lgirdwood@gmail.com
Subject: Re: [PATCH] ASoC: core: Only kmemdup binary control buffer if	masking
Date: Wed, 2 Apr 2014 15:49:20 +0100	[thread overview]
Message-ID: <20140402144920.GN1665@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20140402144103.GF2269@sirena.org.uk>

On Wed, Apr 02, 2014 at 03:41:03PM +0100, Mark Brown wrote:
> On Wed, Apr 02, 2014 at 03:17:05PM +0100, Charles Keepax wrote:
> 
> > When writing a binary control we may apply a mask to the first register,
> > as this requires modifying the data the buffer is duplicated, currently
> > this is done for all binary control writes. As most binary controls
> > don't use the mask facility and thus can freely use the original buffer,
> > avoid the kmemdup for these cases.
> 
> No, that's not why we're duplicating...
> 
> > -	data = kmemdup(ucontrol->value.bytes.data, len, GFP_KERNEL | GFP_DMA);
> 
> ...note the GFP_DMA there, it's about ensuring that the buffer is
> DMAable since the underlying APIs end up wanting that (or will for
> larger coefficient blocks anyway).  What would be slightly more
> efficient in the success case would be to do a kmalloc() then
> copy_from_user() into that block allowing us to bypass the copy.

Ah... thanks sorry about the noise.

Thanks,
Charles

      reply	other threads:[~2014-04-02 14:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 14:17 [PATCH] ASoC: core: Only kmemdup binary control buffer if masking Charles Keepax
2014-04-02 14:41 ` Mark Brown
2014-04-02 14:49   ` Charles Keepax [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=20140402144920.GN1665@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.wolfsonmicro.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.