public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: ALSA Development Mailing List <alsa-devel@alsa-project.org>,
	Takashi Iwai <tiwai@suse.com>,
	Baolin Wang <baolin.wang7@gmail.com>,
	y2038 Mailman List <y2038@lists.linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH v6 0/8] Fix year 2038 issue for sound subsystem
Date: Wed, 13 Nov 2019 19:13:15 +0100	[thread overview]
Message-ID: <s5h1rub7ih0.wl-tiwai@suse.de> (raw)
In-Reply-To: <CAK8P3a2+DgOBXS9MmPfvyyCUmqMB-pOx-qLjTV-VjDgStP6tww@mail.gmail.com>

On Wed, 13 Nov 2019 18:19:56 +0100,
Arnd Bergmann wrote:
> 
> On Wed, Nov 13, 2019 at 6:04 PM Takashi Iwai <tiwai@suse.de> wrote:
> >
> > On Wed, 13 Nov 2019 17:51:57 +0100,
> > Arnd Bergmann wrote:
> > >
> > > On Wed, Nov 13, 2019 at 5:40 PM Takashi Iwai <tiwai@suse.de> wrote:
> > > > On Wed, 13 Nov 2019 15:32:44 +0100, Arnd Bergmann wrote:
> > >
> > > > > We had discussed alternatives for this one last time, and decided
> > > > > to go with the solution I posted here. The main alternative would
> > > > > be to change the 'timespec' in snd_timer_tread to a fixed-length
> > > > > structure based on two 'long' members. This would avoid the
> > > > > need to match the command with the time_t type, but the cost would
> > > > > be requiring CLOCK_MONOTONIC timestamps to avoid the
> > > > > overflow, and changing all application source code that requires
> > > > > the type to be compatible with 'timespec'.
> > > >
> > > > Fair enough.
> > > >
> > > > One thing I forgot to mention: when we add/modify the ioctl or ABI, we
> > > > need to increment the protocol version, e.g. SNDRV_PCM_VERSION to
> > > > indicate user-space the supported ABI.  Please change these in your
> > > > next patches, too.
> > >
> > > Just to confirm: this should be a simple one-line patch at the end of the
> > > series like
> > >
> > > diff --git a/tools/include/uapi/sound/asound.h
> > > b/tools/include/uapi/sound/asound.h
> > > index df1153cea0b7..72e8380c6dcd 100644
> > > --- a/include/uapi/sound/asound.h
> > > +++ b/include/uapi/sound/asound.h
> > > @@ -154,7 +154,7 @@ struct snd_hwdep_dsp_image {
> > >   *                                                                           *
> > >   *****************************************************************************/
> > >
> > > -#define SNDRV_PCM_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 14)
> > > +#define SNDRV_PCM_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 15)
> > >
> > >  typedef unsigned long snd_pcm_uframes_t;
> > >  typedef signed long snd_pcm_sframes_t;
> > >
> > > right? Most other kernel interfaces have no version numbering, so
> > > I don't know what policy you have here.
> >
> > I don't mind much about that, so it's up to you -- we can fold this
> > change into the patch that actually adds or modifies the ioctl, too.
> 
> I've added the patch below to the end of the series now, will repost
> the series  after no more comments come in for this version.
> Having a single patch to update the version seems better than updating
> it multiple times with each patch touching the ABI in this series.
> 
>       Arnd
> 
> commit b83a3eaece9b445f897a6f5ac2a903f2566a0e9d
> Author: Arnd Bergmann <arnd@arndb.de>
> Date:   Wed Nov 13 17:49:14 2019 +0100
> 
>     ALSA: bump uapi version number
> 
>     Change SNDRV_PCM_VERSION to indicate the addition of the time64
>     version of the mmap interface and these ioctl commands:
> 
>     SNDRV_PCM_IOCTL_SYNC
>     SNDRV_RAWMIDI_IOCTL_STATUS
>     SNDRV_PCM_IOCTL_STATUS
>     SNDRV_PCM_IOCTL_STATUS_EXT
>     SNDRV_TIMER_IOCTL_TREAD
>     SNDRV_TIMER_IOCTL_STATUS
> 
>     32-bit applications built with 64-bit time_t require both the headers
>     and the running kernel to support at least API version 2.0.15. When
>     built with earlier kernel headers, some of these may not work
>     correctly, so applications are encouraged to fail compilation like
> 
>      #if SNDRV_PCM_VERSION < SNDRV_PROTOCOL_VERSION(2, 0, 15)
>      extern int __fail_build_for_time_64[sizeof(long) - sizeof(time_t)];
>      #endif
> 
>     or provide their own updated copy of the header file.
> 
>     Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
> index 25dbf71fa667..5cddfe62c97a 100644
> --- a/include/uapi/sound/asound.h
> +++ b/include/uapi/sound/asound.h
> @@ -156,7 +156,7 @@ struct snd_hwdep_dsp_image {
>   *                                                                           *
>   *****************************************************************************/
> 
> -#define SNDRV_PCM_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 14)
> +#define SNDRV_PCM_VERSION              SNDRV_PROTOCOL_VERSION(2, 0, 15)
> 
>  typedef unsigned long snd_pcm_uframes_t;
>  typedef signed long snd_pcm_sframes_t;

I wasn't clear enough.  Each ALSA device API has a protocol version,
not only PCM, so we need updating SNDRV_RAWMIDI_VERSION and
SNDRV_TIMER_VERSION as well.


thanks,

Takashi

  reply	other threads:[~2019-11-13 18:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 15:16 [PATCH v6 0/8] Fix year 2038 issue for sound subsystem Arnd Bergmann
2019-11-12 15:16 ` [PATCH v6 1/8] ALSA: Replace timespec with timespec64 Arnd Bergmann
2019-11-12 15:16 ` [PATCH v6 2/8] ALSA: Avoid using timespec for struct snd_timer_status Arnd Bergmann
2019-11-12 15:42   ` Takashi Iwai
2019-11-12 20:08     ` Arnd Bergmann
2019-11-12 20:28       ` Takashi Iwai
2019-11-13 15:09         ` Arnd Bergmann
2019-11-12 15:16 ` [PATCH v6 3/8] ALSA: Avoid using timespec for struct snd_ctl_elem_value Arnd Bergmann
2019-11-12 15:16 ` [PATCH v6 4/8] ALSA: Avoid using timespec for struct snd_pcm_status Arnd Bergmann
2019-11-12 15:16 ` [PATCH v6 5/8] ALSA: Avoid using timespec for struct snd_rawmidi_status Arnd Bergmann
2019-11-12 16:38   ` [alsa-devel] " Takashi Iwai
2019-11-12 20:04     ` Arnd Bergmann
2019-11-12 20:26       ` Takashi Iwai
2019-11-13 15:16         ` Arnd Bergmann
2019-11-12 15:16 ` [PATCH v6 6/8] ALSA: Avoid using timespec for struct snd_timer_tread Arnd Bergmann
2019-11-12 15:16 ` [PATCH v6 7/8] ALSA: move snd_pcm_ioctl_sync_ptr_compat into pcm_native.c Arnd Bergmann
2019-11-12 15:16 ` [PATCH v6 8/8] ALSA: add new 32-bit layout for snd_pcm_mmap_status/control Arnd Bergmann
2019-11-15 15:24   ` Arnd Bergmann
2019-11-12 20:37 ` [PATCH v6 0/8] Fix year 2038 issue for sound subsystem Takashi Iwai
2019-11-13 14:32   ` Arnd Bergmann
2019-11-13 16:40     ` Takashi Iwai
2019-11-13 16:51       ` Arnd Bergmann
2019-11-13 17:04         ` Takashi Iwai
2019-11-13 17:19           ` Arnd Bergmann
2019-11-13 18:13             ` Takashi Iwai [this message]
2019-11-13 20:48               ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h1rub7ih0.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnd@arndb.de \
    --cc=baolin.wang7@gmail.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=y2038@lists.linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox