Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c7066ae authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Takashi Iwai
Browse files

ALSA: core: fix 64-bit SNDRV_PCM_IOCTL_STATUS ABI breakage



Commit 4eeaaeae (ALSA: core: add hooks for audio timestamps) added the
new audio_tstamp field to struct snd_pcm_status.  However, struct
timespec requires 64-bit alignment, so the 64-bit compiler would insert
32 bits of padding before this field, which broke SNDRV_PCM_IOCTL_STATUS
with error messages like this:

  kernel: unknown ioctl = 0x80984120

To solve this, insert the padding explicitly so that it can be taken
into account when calculating the ABI structure size.

Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 7dd7a2fd
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -407,8 +407,9 @@ struct snd_pcm_status {
	snd_pcm_uframes_t avail_max;	/* max frames available on hw since last status */
	snd_pcm_uframes_t avail_max;	/* max frames available on hw since last status */
	snd_pcm_uframes_t overrange;	/* count of ADC (capture) overrange detections from last status */
	snd_pcm_uframes_t overrange;	/* count of ADC (capture) overrange detections from last status */
	snd_pcm_state_t suspended_state; /* suspended stream state */
	snd_pcm_state_t suspended_state; /* suspended stream state */
	__u32 reserved_alignment;	/* must be filled with zero */
	struct timespec audio_tstamp;	/* from sample counter or wall clock */
	struct timespec audio_tstamp;	/* from sample counter or wall clock */
	unsigned char reserved[60-sizeof(struct timespec)]; /* must be filled with zero */
	unsigned char reserved[56-sizeof(struct timespec)]; /* must be filled with zero */
};
};


struct snd_pcm_mmap_status {
struct snd_pcm_mmap_status {
+2 −1
Original line number Original line Diff line number Diff line
@@ -190,8 +190,9 @@ struct snd_pcm_status32 {
	u32 avail_max;
	u32 avail_max;
	u32 overrange;
	u32 overrange;
	s32 suspended_state;
	s32 suspended_state;
	u32 reserved_alignment;
	struct compat_timespec audio_tstamp;
	struct compat_timespec audio_tstamp;
	unsigned char reserved[60-sizeof(struct compat_timespec)];
	unsigned char reserved[56-sizeof(struct compat_timespec)];
} __attribute__((packed));
} __attribute__((packed));