linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64()
@ 2018-06-18 15:41 Arnd Bergmann
  2018-06-18 15:41 ` [PATCH 2/2] ALSA: line6: stop using get_seconds() Arnd Bergmann
  2018-06-18 15:45 ` [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64() Takashi Iwai
  0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-06-18 15:41 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: y2038, Arnd Bergmann, Takashi Sakamoto, Maciej S. Szmigiero,
	alsa-devel, linux-kernel

The API got renamed for consistency and the old name will
be removed once the last users are gone.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/sound/pcm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 5d5daa190b08..f566611f0fef 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -1187,7 +1187,7 @@ static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime,
 		ktime_get_ts64(tv);
 		break;
 	case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW:
-		getrawmonotonic64(tv);
+		ktime_get_raw_ts64(tv);
 		break;
 	default:
 #ifdef CONFIG_SND_TSTAMP_REALTIME
-- 
2.9.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ALSA: line6: stop using get_seconds()
  2018-06-18 15:41 [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64() Arnd Bergmann
@ 2018-06-18 15:41 ` Arnd Bergmann
  2018-06-18 15:45 ` [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64() Takashi Iwai
  1 sibling, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-06-18 15:41 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Arnd Bergmann
  Cc: y2038, Kees Cook, alsa-devel, linux-kernel

The get_seconds() function is deprecated because it truncates the
timestamp to 32 bits, so all users should change to ktime_get_seconds()
or ktime_get_real_seconds().

The firmware interface for passing the timestamp is also limited to
32 bits, so this patch only has the cosmetic effect of avoiding the
old interface.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/usb/line6/toneport.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c
index 750467fb95db..f47ba94e6f4a 100644
--- a/sound/usb/line6/toneport.c
+++ b/sound/usb/line6/toneport.c
@@ -367,12 +367,13 @@ static bool toneport_has_source_select(struct usb_line6_toneport *toneport)
 */
 static void toneport_setup(struct usb_line6_toneport *toneport)
 {
-	int ticks;
+	u32 ticks;
 	struct usb_line6 *line6 = &toneport->line6;
 	struct usb_device *usbdev = line6->usbdev;
 
 	/* sync time on device with host: */
-	ticks = (int)get_seconds();
+	/* note: 32-bit timestamps overflow in year 2106 */
+	ticks = (u32)ktime_get_real_seconds();
 	line6_write_data(line6, 0x80c6, &ticks, 4);
 
 	/* enable device: */
-- 
2.9.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64()
  2018-06-18 15:41 [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64() Arnd Bergmann
  2018-06-18 15:41 ` [PATCH 2/2] ALSA: line6: stop using get_seconds() Arnd Bergmann
@ 2018-06-18 15:45 ` Takashi Iwai
  2018-06-18 15:52   ` Arnd Bergmann
  1 sibling, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2018-06-18 15:45 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jaroslav Kysela, alsa-devel, y2038, Maciej S. Szmigiero,
	Takashi Sakamoto, linux-kernel

On Mon, 18 Jun 2018 17:41:00 +0200,
Arnd Bergmann wrote:
> 
> The API got renamed for consistency and the old name will
> be removed once the last users are gone.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

These two fixes can be postponed for 4.19, or urgently needed for
4.18?  I suppose the former, but just to be sure.


thanks,

Takashi

> ---
>  include/sound/pcm.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/sound/pcm.h b/include/sound/pcm.h
> index 5d5daa190b08..f566611f0fef 100644
> --- a/include/sound/pcm.h
> +++ b/include/sound/pcm.h
> @@ -1187,7 +1187,7 @@ static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime,
>  		ktime_get_ts64(tv);
>  		break;
>  	case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW:
> -		getrawmonotonic64(tv);
> +		ktime_get_raw_ts64(tv);
>  		break;
>  	default:
>  #ifdef CONFIG_SND_TSTAMP_REALTIME
> -- 
> 2.9.0
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64()
  2018-06-18 15:45 ` [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64() Takashi Iwai
@ 2018-06-18 15:52   ` Arnd Bergmann
  2018-06-18 15:56     ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2018-06-18 15:52 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, alsa-devel, y2038 Mailman List,
	Maciej S. Szmigiero, Takashi Sakamoto, Linux Kernel Mailing List

On Mon, Jun 18, 2018 at 5:45 PM, Takashi Iwai <tiwai@suse.de> wrote:
> On Mon, 18 Jun 2018 17:41:00 +0200,
> Arnd Bergmann wrote:
>>
>> The API got renamed for consistency and the old name will
>> be removed once the last users are gone.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> These two fixes can be postponed for 4.19, or urgently needed for
> 4.18?  I suppose the former, but just to be sure.

Not urgent at all. I also noticed (slightly too late) that the first one doesn't
even apply,
I had written it on top of my tree that contained the previously discussed
API conversion, which Baolin and I still need to follow up on. I'll fold
the first patch into that series, please apply just the seconds patch
for 4.19 for now.

        Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64()
  2018-06-18 15:52   ` Arnd Bergmann
@ 2018-06-18 15:56     ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2018-06-18 15:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jaroslav Kysela, alsa-devel, y2038 Mailman List,
	Maciej S. Szmigiero, Takashi Sakamoto, Linux Kernel Mailing List

On Mon, 18 Jun 2018 17:52:43 +0200,
Arnd Bergmann wrote:
> 
> On Mon, Jun 18, 2018 at 5:45 PM, Takashi Iwai <tiwai@suse.de> wrote:
> > On Mon, 18 Jun 2018 17:41:00 +0200,
> > Arnd Bergmann wrote:
> >>
> >> The API got renamed for consistency and the old name will
> >> be removed once the last users are gone.
> >>
> >> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >
> > These two fixes can be postponed for 4.19, or urgently needed for
> > 4.18?  I suppose the former, but just to be sure.
> 
> Not urgent at all. I also noticed (slightly too late) that the first one doesn't
> even apply,
> I had written it on top of my tree that contained the previously discussed
> API conversion, which Baolin and I still need to follow up on. I'll fold
> the first patch into that series, please apply just the seconds patch
> for 4.19 for now.

Alright, thanks.


Takashi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-18 15:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 15:41 [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64() Arnd Bergmann
2018-06-18 15:41 ` [PATCH 2/2] ALSA: line6: stop using get_seconds() Arnd Bergmann
2018-06-18 15:45 ` [PATCH 1/2] ALSA: use ktime_get_raw_ts64() instead of getrawmonotonic64() Takashi Iwai
2018-06-18 15:52   ` Arnd Bergmann
2018-06-18 15:56     ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).