Commit 6f00d165 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'for-linus' into for-next



A back-merge of 5.15 branch into 5.16-devel branch for further
development of USB and ALSA core stuff that depends on 5.15 fixes.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parents 53451b6d aef454b4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -17891,7 +17891,8 @@ M: Olivier Moysan <olivier.moysan@foss.st.com>
M:	Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
S:	Maintained
F:	Documentation/devicetree/bindings/iio/adc/st,stm32-*.yaml
F:	Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml
F:	Documentation/devicetree/bindings/sound/st,stm32-*.yaml
F:	sound/soc/stm/
STM32 TIMER/LPTIMER DRIVERS
+1 −0
Original line number Diff line number Diff line
@@ -224,6 +224,7 @@ struct hda_codec {
#endif

	/* misc flags */
	unsigned int configured:1; /* codec was configured */
	unsigned int in_freeing:1; /* being released */
	unsigned int registered:1; /* codec was registered */
	unsigned int display_power_control:1; /* needs display power */
+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ struct snd_rawmidi_file {
	struct snd_rawmidi *rmidi;
	struct snd_rawmidi_substream *input;
	struct snd_rawmidi_substream *output;
	unsigned int user_pversion;	/* supported protocol version */
};

struct snd_rawmidi_str {
+1 −0
Original line number Diff line number Diff line
@@ -784,6 +784,7 @@ struct snd_rawmidi_status {

#define SNDRV_RAWMIDI_IOCTL_PVERSION	_IOR('W', 0x00, int)
#define SNDRV_RAWMIDI_IOCTL_INFO	_IOR('W', 0x01, struct snd_rawmidi_info)
#define SNDRV_RAWMIDI_IOCTL_USER_PVERSION _IOW('W', 0x02, int)
#define SNDRV_RAWMIDI_IOCTL_PARAMS	_IOWR('W', 0x10, struct snd_rawmidi_params)
#define SNDRV_RAWMIDI_IOCTL_STATUS	_IOWR('W', 0x20, struct snd_rawmidi_status)
#define SNDRV_RAWMIDI_IOCTL_DROP	_IOW('W', 0x30, int)
+71 −1
Original line number Diff line number Diff line
@@ -468,6 +468,76 @@ static int snd_pcm_ioctl_sync_ptr_x32(struct snd_pcm_substream *substream,
}
#endif /* CONFIG_X86_X32 */

#ifdef __BIG_ENDIAN
typedef char __pad_before_u32[4];
typedef char __pad_after_u32[0];
#else
typedef char __pad_before_u32[0];
typedef char __pad_after_u32[4];
#endif

/* PCM 2.0.15 API definition had a bug in mmap control; it puts the avail_min
 * at the wrong offset due to a typo in padding type.
 * The bug hits only 32bit.
 * A workaround for incorrect read/write is needed only in 32bit compat mode.
 */
struct __snd_pcm_mmap_control64_buggy {
	__pad_before_u32 __pad1;
	__u32 appl_ptr;
	__pad_before_u32 __pad2;	/* SiC! here is the bug */
	__pad_before_u32 __pad3;
	__u32 avail_min;
	__pad_after_uframe __pad4;
};

static int snd_pcm_ioctl_sync_ptr_buggy(struct snd_pcm_substream *substream,
					struct snd_pcm_sync_ptr __user *_sync_ptr)
{
	struct snd_pcm_runtime *runtime = substream->runtime;
	struct snd_pcm_sync_ptr sync_ptr;
	struct __snd_pcm_mmap_control64_buggy *sync_cp;
	volatile struct snd_pcm_mmap_status *status;
	volatile struct snd_pcm_mmap_control *control;
	int err;

	memset(&sync_ptr, 0, sizeof(sync_ptr));
	sync_cp = (struct __snd_pcm_mmap_control64_buggy *)&sync_ptr.c.control;
	if (get_user(sync_ptr.flags, (unsigned __user *)&(_sync_ptr->flags)))
		return -EFAULT;
	if (copy_from_user(sync_cp, &(_sync_ptr->c.control), sizeof(*sync_cp)))
		return -EFAULT;
	status = runtime->status;
	control = runtime->control;
	if (sync_ptr.flags & SNDRV_PCM_SYNC_PTR_HWSYNC) {
		err = snd_pcm_hwsync(substream);
		if (err < 0)
			return err;
	}
	snd_pcm_stream_lock_irq(substream);
	if (!(sync_ptr.flags & SNDRV_PCM_SYNC_PTR_APPL)) {
		err = pcm_lib_apply_appl_ptr(substream, sync_cp->appl_ptr);
		if (err < 0) {
			snd_pcm_stream_unlock_irq(substream);
			return err;
		}
	} else {
		sync_cp->appl_ptr = control->appl_ptr;
	}
	if (!(sync_ptr.flags & SNDRV_PCM_SYNC_PTR_AVAIL_MIN))
		control->avail_min = sync_cp->avail_min;
	else
		sync_cp->avail_min = control->avail_min;
	sync_ptr.s.status.state = status->state;
	sync_ptr.s.status.hw_ptr = status->hw_ptr;
	sync_ptr.s.status.tstamp = status->tstamp;
	sync_ptr.s.status.suspended_state = status->suspended_state;
	sync_ptr.s.status.audio_tstamp = status->audio_tstamp;
	snd_pcm_stream_unlock_irq(substream);
	if (copy_to_user(_sync_ptr, &sync_ptr, sizeof(sync_ptr)))
		return -EFAULT;
	return 0;
}

/*
 */
enum {
@@ -537,7 +607,7 @@ static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned l
		if (in_x32_syscall())
			return snd_pcm_ioctl_sync_ptr_x32(substream, argp);
#endif /* CONFIG_X86_X32 */
		return snd_pcm_common_ioctl(file, substream, cmd, argp);
		return snd_pcm_ioctl_sync_ptr_buggy(substream, argp);
	case SNDRV_PCM_IOCTL_HW_REFINE32:
		return snd_pcm_ioctl_hw_params_compat(substream, 1, argp);
	case SNDRV_PCM_IOCTL_HW_PARAMS32:
Loading