[PATCH 6/8] ALSA: pcm: conditionally avoid mmap of control data

Takashi Iwai tiwai at suse.de
Sun Jun 13 09:28:22 CEST 2021


On Thu, 10 Jun 2021 22:53:24 +0200,
Pierre-Louis Bossart wrote:
> 
> In case of mmap, by default alsa-lib mmaps both control and status data.
> 
> If driver subscribes for application pointer update, driver needs to get
> notification whenever appl ptr changes. With the above case driver won't
> get appl ptr notifications.
> 
> This patch check on a hw info flag and returns error when user land asks
> for mmaping control & status data, thus forcing user to issue
> IOCTL_SYNC_PTR.
> 
> This patch was originally submitted in 2017, c.f.
> https://lore.kernel.org/alsa-devel/1494896518-23399-4-git-send-email-subhransu.s.prusty@intel.com/
> 
> Suggested-by: Takashi Iwai <tiwai at suse.de>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
> Reviewed-by: Kai Vehmanen <kai.vehmanen at linux.intel.com>
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>

This kind of flag itself was what I also introduced for another
purpose, too.  There is a WIP patch that allows the use of
non-coherent non-contiguous buffer pages, and this flag would fit for
that.  FWIW, the patch is found at
  https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/log/?h=topic/memalloc


Takashi


More information about the Alsa-devel mailing list