Skip to content

Commit

Permalink
Revert "ALSA: pcm: conditionally avoid mmap of control data"
Browse files Browse the repository at this point in the history
This reverts commit 9ae202e.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
  • Loading branch information
plbossart committed Aug 16, 2021
1 parent 342e370 commit a49c531
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion include/uapi/sound/asound.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ typedef int __bitwise snd_pcm_subformat_t;
#define SNDRV_PCM_INFO_HAS_LINK_ABSOLUTE_ATIME 0x02000000 /* report absolute hardware link audio time, not reset on startup */
#define SNDRV_PCM_INFO_HAS_LINK_ESTIMATED_ATIME 0x04000000 /* report estimated link audio time */
#define SNDRV_PCM_INFO_HAS_LINK_SYNCHRONIZED_ATIME 0x08000000 /* report synchronized audio/system time */
#define SNDRV_PCM_INFO_NO_STATUS_MMAP 0x10000000 /* status and control mmap not supported */

#define SNDRV_PCM_INFO_DRAIN_TRIGGER 0x40000000 /* internal kernel flag - trigger in drain */
#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
Expand Down
17 changes: 0 additions & 17 deletions sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -3798,13 +3798,11 @@ static int snd_pcm_mmap(struct file *file, struct vm_area_struct *area)
struct snd_pcm_file * pcm_file;
struct snd_pcm_substream *substream;
unsigned long offset;
unsigned int info;

pcm_file = file->private_data;
substream = pcm_file->substream;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
info = substream->runtime->hw.info;

offset = area->vm_pgoff << PAGE_SHIFT;
switch (offset) {
Expand All @@ -3815,13 +3813,6 @@ static int snd_pcm_mmap(struct file *file, struct vm_area_struct *area)
case SNDRV_PCM_MMAP_OFFSET_STATUS_NEW:
if (!pcm_status_mmap_allowed(pcm_file))
return -ENXIO;
/*
* force fallback to ioctl if driver doesn't support status
* and control mmap.
*/
if (info & SNDRV_PCM_INFO_NO_STATUS_MMAP)
return -ENXIO;

return snd_pcm_mmap_status(substream, file, area);
case SNDRV_PCM_MMAP_OFFSET_CONTROL_OLD:
if (pcm_file->no_compat_mmap || !IS_ENABLED(CONFIG_64BIT))
Expand All @@ -3830,14 +3821,6 @@ static int snd_pcm_mmap(struct file *file, struct vm_area_struct *area)
case SNDRV_PCM_MMAP_OFFSET_CONTROL_NEW:
if (!pcm_control_mmap_allowed(pcm_file))
return -ENXIO;

/*
* force fallback to ioctl if driver doesn't support status
* and control mmap.
*/
if (info & SNDRV_PCM_INFO_NO_STATUS_MMAP)
return -ENXIO;

return snd_pcm_mmap_control(substream, file, area);
default:
return snd_pcm_mmap_data(substream, file, area);
Expand Down

0 comments on commit a49c531

Please sign in to comment.