aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-12-11ALSA: Avoid using timespec for struct snd_rawmidi_statusBaolin Wang3-94/+128
The struct snd_rawmidi_status will use 'timespec' type variables to record timestamp, which is not year 2038 safe on 32bits system. Thus we introduced 'struct snd_rawmidi_status32' and 'struct snd_rawmidi_status64' to handle 32bit time_t and 64bit time_t in native mode, which replace timespec with s64 type. In compat mode, we renamed or introduced new structures to handle 32bit/64bit time_t in compatible mode. The 'struct snd_rawmidi_status32' and snd_rawmidi_ioctl_status32() are used to handle 32bit time_t in compat mode. 'struct compat_snd_rawmidi_status64' is used to handle 64bit time_t. When glibc changes time_t to 64-bit, any recompiled program will issue ioctl commands that the kernel does not understand without this patch. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-12-11ALSA: Avoid using timespec for struct snd_pcm_statusBaolin Wang5-126/+198
The struct snd_pcm_status will use 'timespec' type variables to record timestamp, which is not year 2038 safe on 32bits system. Userspace will use SNDRV_PCM_IOCTL_STATUS and SNDRV_PCM_IOCTL_STATUS_EXT as commands to issue ioctl() to fill the 'snd_pcm_status' structure in userspace. The command number is always defined through _IOR/_IOW/IORW, so when userspace changes the definition of 'struct timespec' to use 64-bit types, the command number also changes. Thus in the kernel, we now need to define two versions of each such ioctl and corresponding ioctl commands to handle 32bit time_t and 64bit time_t in native mode: struct snd_pcm_status32 { ...... s32 trigger_tstamp_sec; s32 trigger_tstamp_nsec; ...... s32 audio_tstamp_sec; s32 audio_tstamp_nsec; ...... }; struct snd_pcm_status64 { ...... s32 trigger_tstamp_sec; s32 trigger_tstamp_nsec; ...... s32 audio_tstamp_sec; s32 audio_tstamp_nsec; ...... }; Moreover in compat file, we renamed or introduced new structures to handle 32bit/64bit time_t in compatible mode. The 'struct snd_pcm_status32' and snd_pcm_status_user32() are used to handle 32bit time_t in compat mode. 'struct compat_snd_pcm_status64' and snd_pcm_status_user_compat64() are used to handle 64bit time_t. The implicit padding before timespec is made explicit to avoid incompatible structure layout between 32-bit and 64-bit x86 due to the different alignment requirements, and the snd_pcm_status structure is now hidden from the kernel to avoid relying on the timespec definitio definitionn Finally we can replace SNDRV_PCM_IOCTL_STATUS and SNDRV_PCM_IOCTL_STATUS_EXT with new commands and introduce new functions to fill new 'struct snd_pcm_status64' instead of using unsafe 'struct snd_pcm_status'. Then in future, the new commands can be matched when userspace changes 'timespec' to 64bit type to make a size change of 'struct snd_pcm_status'. When glibc changes time_t to 64-bit, any recompiled program will issue ioctl commands that the kernel does not understand without this patch. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-12-11ALSA: Avoid using timespec for struct snd_ctl_elem_valueBaolin Wang1-2/+1
The struct snd_ctl_elem_value will use 'timespec' type variables to record timestamp, which is not year 2038 safe on 32bits system. Since there are no drivers will implemented the tstamp member of the struct snd_ctl_elem_value, and also the stucture size will not be changed if we change timespec to s64 for tstamp member of struct snd_ctl_elem_value. From Takashi's comments, "In the library, applications are not expected to access to this structure directly. The applications get opaque pointer to the structure and must use any control APIs to operate it. Actually the library produce no API to handle 'struct snd_ctl_elem_value.tstamp'. This means that we can drop this member from alsa-lib without decline of functionality." Thus we can simply remove the tstamp member to avoid using the type which is not year 2038 safe on 32bits system. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-12-11ALSA: Avoid using timespec for struct snd_timer_statusBaolin Wang3-57/+64
struct snd_timer_status uses 'timespec' type variables to record timestamp, which will be changed to an incompatible layout with updated user space using 64-bit time_t. To handle both the old and the new layout on 32-bit architectures, this patch introduces 'struct snd_timer_status32' and 'struct snd_timer_status64' to handle 32bit time_t and 64bit time_t in native mode and compat mode, which replaces timespec with s64 type. When glibc changes time_t to 64-bit, any recompiled program will issue ioctl commands that the kernel does not understand without this patch. In the public uapi header, snd_timer_status is now guarded by an #ifndef __KERNEL__ to avoid referencing 'struct timespec'. The timespec definition will be removed from the kernel to prevent new y2038 bugs and to avoid the conflict with an incompatible libc type of the same name. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-12-11ALSA: Replace timespec with timespec64Baolin Wang9-53/+65
Since timespec is not year 2038 safe on 32bit system, and we need to convert all timespec variables to timespec64 type for sound subsystem. This patch is used to do preparation for following patches, that will convert all structures defined in uapi/sound/asound.h to use 64-bit time_t. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-12-11ALSA: usb-audio: Support PCM sync_stopTakashi Iwai1-12/+25
USB-audio driver had some implementation of its own sync-stop mechanism. This patch moved a part of it to the common PCM sync_stop ops. Link: https://lore.kernel.org/r/20191210063454.31603-56-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: vxpocket: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the threaded interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-55-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: pdaudiocf: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the threaded interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-54-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: vx222: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the threaded interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-53-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: pcxhr: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the threaded interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-52-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: mixart: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the threaded interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-51-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: lx6464es: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the threaded interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-50-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: wss: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-49-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: wavefront: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-48-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: sb: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-47-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: opti9xx: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-46-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: opl3sa2: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-45-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: msnd: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-44-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: gus: Support PCM sync_stopTakashi Iwai3-1/+4
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-43-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: es18xx: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-42-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: es1688: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-41-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: ad1816a: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-40-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: ymfpci: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-39-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: via82xx: Support PCM sync_stopTakashi Iwai2-4/+2
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-38-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: trident: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-37-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: sonicvibes: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-36-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: sis7019: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-35-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: rme9652: Support PCM sync_stopTakashi Iwai3-0/+3
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-34-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: rme96: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-33-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: rme32: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-32-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: riptide: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-31-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: oxygen: Support PCM sync_stopTakashi Iwai1-1/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-30-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: nm256: Support PCM sync_stopTakashi Iwai1-0/+2
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. It's cleared and reset dynamically at IRQ re-acquiring for the PM resume, too. Link: https://lore.kernel.org/r/20191210063454.31603-29-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: maestro3: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-28-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: lola: Support PCM sync_stopTakashi Iwai1-1/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-27-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: korg1212: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-26-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: intel8x0: Support PCM sync_stopTakashi Iwai2-1/+6
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. It's cleared and reset dynamically at IRQ re-acquiring for the PM resume, too. Link: https://lore.kernel.org/r/20191210063454.31603-25-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: ice1724: Support PCM sync_stopTakashi Iwai1-1/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-24-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: ice1712: Support PCM sync_stopTakashi Iwai1-1/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-23-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: hda: Support PCM sync_stopTakashi Iwai2-4/+4
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. It's cleared and reset dynamically at IRQ re-acquiring for the PM resume, too. Link: https://lore.kernel.org/r/20191210063454.31603-22-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: fm801: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-21-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: es1968: Support PCM sync_stopTakashi Iwai1-2/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-20-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: es1938: Support PCM sync_stopTakashi Iwai1-0/+3
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. It's cleared and reset dynamically at IRQ re-acquiring for the PM resume, too. Link: https://lore.kernel.org/r/20191210063454.31603-19-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: ens137x: Support PCM sync_stopTakashi Iwai1-3/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-18-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: emu10k1: Support PCM sync_stopTakashi Iwai2-0/+2
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-17-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: echoaudio: Support PCM sync_stopTakashi Iwai1-0/+3
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. It's cleared and reset dynamically at IRQ re-acquiring for the PM resume, too. Link: https://lore.kernel.org/r/20191210063454.31603-16-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: ctxfi: Support PCM sync_stopTakashi Iwai2-3/+2
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-15-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: cs5535audio: Support PCM sync_stopTakashi Iwai1-1/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-14-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: cs46xx: Support PCM sync_stopTakashi Iwai1-0/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation. Link: https://lore.kernel.org/r/20191210063454.31603-13-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-11ALSA: cs4281: Support PCM sync_stopTakashi Iwai1-4/+1
The driver invokes snd_pcm_period_elapsed() simply from the interrupt handler. Set card->sync_irq for enabling the missing sync_stop PCM operation, as well as removing the superfluous synchronize_irq() call. Link: https://lore.kernel.org/r/20191210063454.31603-12-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>