Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: compress_offload: Add 64-bit safe timestamp infrastructure

The copied_total field in struct snd_compr_tstamp is a 32-bit
value that can overflow on long-running high-bitrate streams,
leading to incorrect calculations for buffer availablility.

This patch adds a 64-bit safe timestamping mechanism.
A new UAPI struct, snd_compr_tstamp64, is added which uses 64-bit
types for byte counters. The relevant ops structures across the
ASoC and core compress code are updated to use this new struct.
ASoC drivers are updated to use u64 counters.

Internal timestamps being u64 now, a compatibility function is added
to convert the 64-bit timestamp back to the 32-bit format for legacy
ioctl callers.

Reviewed-by: Miller Liang <millerliang@google.com>
Tested-by: Joris Verhaegen <verhaegen@google.com>
Signed-off-by: Joris Verhaegen <verhaegen@google.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250905091301.2711705-2-verhaegen@google.com

authored by

Joris Verhaegen and committed by
Takashi Iwai
2c92e2fb cbd67687

+125 -72
+1 -1
include/sound/compress_driver.h
··· 161 161 struct snd_compr_metadata *metadata); 162 162 int (*trigger)(struct snd_compr_stream *stream, int cmd); 163 163 int (*pointer)(struct snd_compr_stream *stream, 164 - struct snd_compr_tstamp *tstamp); 164 + struct snd_compr_tstamp64 *tstamp); 165 165 int (*copy)(struct snd_compr_stream *stream, char __user *buf, 166 166 size_t count); 167 167 int (*mmap)(struct snd_compr_stream *stream,
+2 -2
include/sound/soc-component.h
··· 47 47 struct snd_compr_stream *stream, int cmd); 48 48 int (*pointer)(struct snd_soc_component *component, 49 49 struct snd_compr_stream *stream, 50 - struct snd_compr_tstamp *tstamp); 50 + struct snd_compr_tstamp64 *tstamp); 51 51 int (*copy)(struct snd_soc_component *component, 52 52 struct snd_compr_stream *stream, char __user *buf, 53 53 size_t count); ··· 498 498 struct snd_compr_codec_caps *codec); 499 499 int snd_soc_component_compr_ack(struct snd_compr_stream *cstream, size_t bytes); 500 500 int snd_soc_component_compr_pointer(struct snd_compr_stream *cstream, 501 - struct snd_compr_tstamp *tstamp); 501 + struct snd_compr_tstamp64 *tstamp); 502 502 int snd_soc_component_compr_copy(struct snd_compr_stream *cstream, 503 503 char __user *buf, size_t count); 504 504 int snd_soc_component_compr_set_metadata(struct snd_compr_stream *cstream,
+4 -3
include/sound/soc-dai.h
··· 256 256 size_t bytes); 257 257 int snd_soc_dai_compr_pointer(struct snd_soc_dai *dai, 258 258 struct snd_compr_stream *cstream, 259 - struct snd_compr_tstamp *tstamp); 259 + struct snd_compr_tstamp64 *tstamp); 260 260 int snd_soc_dai_compr_set_metadata(struct snd_soc_dai *dai, 261 261 struct snd_compr_stream *cstream, 262 262 struct snd_compr_metadata *metadata); ··· 383 383 struct snd_compr_metadata *, struct snd_soc_dai *); 384 384 int (*trigger)(struct snd_compr_stream *, int, 385 385 struct snd_soc_dai *); 386 - int (*pointer)(struct snd_compr_stream *, 387 - struct snd_compr_tstamp *, struct snd_soc_dai *); 386 + int (*pointer)(struct snd_compr_stream *stream, 387 + struct snd_compr_tstamp64 *tstamp, 388 + struct snd_soc_dai *dai); 388 389 int (*ack)(struct snd_compr_stream *, size_t, 389 390 struct snd_soc_dai *); 390 391 };
+19
include/uapi/sound/compress_offload.h
··· 57 57 } __attribute__((packed, aligned(4))); 58 58 59 59 /** 60 + * struct snd_compr_tstamp64 - timestamp descriptor with fields in 64 bit 61 + * @byte_offset: Byte offset in ring buffer to DSP 62 + * @copied_total: Total number of bytes copied from/to ring buffer to/by DSP 63 + * @pcm_frames: Frames decoded or encoded by DSP. This field will evolve by 64 + * large steps and should only be used to monitor encoding/decoding 65 + * progress. It shall not be used for timing estimates. 66 + * @pcm_io_frames: Frames rendered or received by DSP into a mixer or an audio 67 + * output/input. This field should be used for A/V sync or time estimates. 68 + * @sampling_rate: sampling rate of audio 69 + */ 70 + struct snd_compr_tstamp64 { 71 + __u32 byte_offset; 72 + __u64 copied_total; 73 + __u64 pcm_frames; 74 + __u64 pcm_io_frames; 75 + __u32 sampling_rate; 76 + } __attribute__((packed, aligned(4))); 77 + 78 + /** 60 79 * struct snd_compr_avail - avail descriptor 61 80 * @avail: Number of bytes available in ring buffer for writing/reading 62 81 * @tstamp: timestamp information
+35 -17
sound/core/compress_offload.c
··· 176 176 return 0; 177 177 } 178 178 179 + static void 180 + snd_compr_tstamp32_from_64(struct snd_compr_tstamp *tstamp32, 181 + const struct snd_compr_tstamp64 *tstamp64) 182 + { 183 + tstamp32->byte_offset = tstamp64->byte_offset; 184 + tstamp32->copied_total = (u32)tstamp64->copied_total; 185 + tstamp32->pcm_frames = (u32)tstamp64->pcm_frames; 186 + tstamp32->pcm_io_frames = (u32)tstamp64->pcm_io_frames; 187 + tstamp32->sampling_rate = tstamp64->sampling_rate; 188 + } 189 + 179 190 static int snd_compr_update_tstamp(struct snd_compr_stream *stream, 180 - struct snd_compr_tstamp *tstamp) 191 + struct snd_compr_tstamp64 *tstamp) 181 192 { 182 193 if (!stream->ops->pointer) 183 194 return -ENOTSUPP; 184 195 stream->ops->pointer(stream, tstamp); 185 - pr_debug("dsp consumed till %d total %d bytes\n", 186 - tstamp->byte_offset, tstamp->copied_total); 196 + pr_debug("dsp consumed till %u total %llu bytes\n", tstamp->byte_offset, 197 + tstamp->copied_total); 187 198 if (stream->direction == SND_COMPRESS_PLAYBACK) 188 199 stream->runtime->total_bytes_transferred = tstamp->copied_total; 189 200 else ··· 205 194 static size_t snd_compr_calc_avail(struct snd_compr_stream *stream, 206 195 struct snd_compr_avail *avail) 207 196 { 197 + struct snd_compr_tstamp64 tstamp64 = { 0 }; 198 + 208 199 memset(avail, 0, sizeof(*avail)); 209 - snd_compr_update_tstamp(stream, &avail->tstamp); 200 + snd_compr_update_tstamp(stream, &tstamp64); 201 + snd_compr_tstamp32_from_64(&avail->tstamp, &tstamp64); 210 202 /* Still need to return avail even if tstamp can't be filled in */ 211 203 212 204 if (stream->runtime->total_bytes_available == 0 && ··· 218 204 pr_debug("detected init and someone forgot to do a write\n"); 219 205 return stream->runtime->buffer_size; 220 206 } 221 - pr_debug("app wrote %lld, DSP consumed %lld\n", 222 - stream->runtime->total_bytes_available, 223 - stream->runtime->total_bytes_transferred); 207 + pr_debug("app wrote %llu, DSP consumed %llu\n", 208 + stream->runtime->total_bytes_available, 209 + stream->runtime->total_bytes_transferred); 224 210 if (stream->runtime->total_bytes_available == 225 211 stream->runtime->total_bytes_transferred) { 226 212 if (stream->direction == SND_COMPRESS_PLAYBACK) { ··· 237 223 if (stream->direction == SND_COMPRESS_PLAYBACK) 238 224 avail->avail = stream->runtime->buffer_size - avail->avail; 239 225 240 - pr_debug("ret avail as %lld\n", avail->avail); 226 + pr_debug("ret avail as %llu\n", avail->avail); 241 227 return avail->avail; 242 228 } 243 229 ··· 288 274 (app_pointer * runtime->buffer_size); 289 275 290 276 dstn = runtime->buffer + app_pointer; 291 - pr_debug("copying %ld at %lld\n", 292 - (unsigned long)count, app_pointer); 277 + pr_debug("copying %lu at %llu\n", (unsigned long)count, app_pointer); 293 278 if (count < runtime->buffer_size - app_pointer) { 294 279 if (copy_from_user(dstn, buf, count)) 295 280 return -EFAULT; ··· 331 318 } 332 319 333 320 avail = snd_compr_get_avail(stream); 334 - pr_debug("avail returned %ld\n", (unsigned long)avail); 321 + pr_debug("avail returned %lu\n", (unsigned long)avail); 335 322 /* calculate how much we can write to buffer */ 336 323 if (avail > count) 337 324 avail = count; ··· 387 374 } 388 375 389 376 avail = snd_compr_get_avail(stream); 390 - pr_debug("avail returned %ld\n", (unsigned long)avail); 377 + pr_debug("avail returned %lu\n", (unsigned long)avail); 391 378 /* calculate how much we can read from buffer */ 392 379 if (avail > count) 393 380 avail = count; ··· 456 443 #endif 457 444 458 445 avail = snd_compr_get_avail(stream); 459 - pr_debug("avail is %ld\n", (unsigned long)avail); 446 + pr_debug("avail is %lu\n", (unsigned long)avail); 460 447 /* check if we have at least one fragment to fill */ 461 448 switch (runtime->state) { 462 449 case SNDRV_PCM_STATE_DRAINING: ··· 739 726 static inline int 740 727 snd_compr_tstamp(struct snd_compr_stream *stream, unsigned long arg) 741 728 { 742 - struct snd_compr_tstamp tstamp = {0}; 729 + struct snd_compr_tstamp64 tstamp64 = { 0 }; 730 + struct snd_compr_tstamp tstamp32 = { 0 }; 743 731 int ret; 744 732 745 - ret = snd_compr_update_tstamp(stream, &tstamp); 746 - if (ret == 0) 733 + ret = snd_compr_update_tstamp(stream, &tstamp64); 734 + if (ret == 0) { 735 + snd_compr_tstamp32_from_64(&tstamp32, &tstamp64); 747 736 ret = copy_to_user((struct snd_compr_tstamp __user *)arg, 748 - &tstamp, sizeof(tstamp)) ? -EFAULT : 0; 737 + &tstamp32, sizeof(tstamp32)) ? 738 + -EFAULT : 739 + 0; 740 + } 749 741 return ret; 750 742 } 751 743
+2 -2
sound/soc/codecs/wm_adsp.c
··· 173 173 struct snd_compressed_buffer size; 174 174 175 175 u32 *raw_buf; 176 - unsigned int copied_total; 176 + u64 copied_total; 177 177 178 178 unsigned int sample_rate; 179 179 ··· 1860 1860 1861 1861 int wm_adsp_compr_pointer(struct snd_soc_component *component, 1862 1862 struct snd_compr_stream *stream, 1863 - struct snd_compr_tstamp *tstamp) 1863 + struct snd_compr_tstamp64 *tstamp) 1864 1864 { 1865 1865 struct wm_adsp_compr *compr = stream->runtime->private_data; 1866 1866 struct wm_adsp *dsp = compr->dsp;
+1 -1
sound/soc/codecs/wm_adsp.h
··· 131 131 int wm_adsp_compr_handle_irq(struct wm_adsp *dsp); 132 132 int wm_adsp_compr_pointer(struct snd_soc_component *component, 133 133 struct snd_compr_stream *stream, 134 - struct snd_compr_tstamp *tstamp); 134 + struct snd_compr_tstamp64 *tstamp); 135 135 int wm_adsp_compr_copy(struct snd_soc_component *component, 136 136 struct snd_compr_stream *stream, 137 137 char __user *buf, size_t count);
+7 -5
sound/soc/intel/atom/sst-mfld-platform-compress.c
··· 18 18 #include <sound/pcm_params.h> 19 19 #include <sound/soc.h> 20 20 #include <sound/compress_driver.h> 21 + #include <asm/div64.h> 21 22 #include "sst-mfld-platform.h" 22 23 23 24 /* compress stream operations */ ··· 203 202 204 203 static int sst_platform_compr_pointer(struct snd_soc_component *component, 205 204 struct snd_compr_stream *cstream, 206 - struct snd_compr_tstamp *tstamp) 205 + struct snd_compr_tstamp64 *tstamp) 207 206 { 208 207 struct sst_runtime_stream *stream; 208 + u64 temp_copied_total = tstamp->copied_total; 209 209 210 - stream = cstream->runtime->private_data; 210 + stream = cstream->runtime->private_data; 211 211 stream->compr_ops->tstamp(sst->dev, stream->id, tstamp); 212 - tstamp->byte_offset = tstamp->copied_total % 213 - (u32)cstream->runtime->buffer_size; 214 - pr_debug("calc bytes offset/copied bytes as %d\n", tstamp->byte_offset); 212 + tstamp->byte_offset = 213 + do_div(temp_copied_total, cstream->runtime->buffer_size); 214 + pr_debug("calc bytes offset/copied bytes as %u\n", tstamp->byte_offset); 215 215 return 0; 216 216 } 217 217
+1 -1
sound/soc/intel/atom/sst-mfld-platform.h
··· 105 105 int (*stream_pause_release)(struct device *dev, unsigned int str_id); 106 106 107 107 int (*tstamp)(struct device *dev, unsigned int str_id, 108 - struct snd_compr_tstamp *tstamp); 108 + struct snd_compr_tstamp64 *tstamp); 109 109 int (*ack)(struct device *dev, unsigned int str_id, 110 110 unsigned long bytes); 111 111 int (*close)(struct device *dev, unsigned int str_id);
+5 -4
sound/soc/intel/atom/sst/sst_drv_interface.c
··· 326 326 } 327 327 328 328 static int sst_cdev_tstamp(struct device *dev, unsigned int str_id, 329 - struct snd_compr_tstamp *tstamp) 329 + struct snd_compr_tstamp64 *tstamp) 330 330 { 331 331 struct snd_sst_tstamp fw_tstamp = {0,}; 332 332 struct stream_info *stream; ··· 349 349 (u64)stream->num_ch * SST_GET_BYTES_PER_SAMPLE(24)); 350 350 tstamp->sampling_rate = fw_tstamp.sampling_frequency; 351 351 352 - dev_dbg(dev, "PCM = %u\n", tstamp->pcm_io_frames); 353 - dev_dbg(dev, "Ptr Query on strid = %d copied_total %d, decodec %d\n", 352 + dev_dbg(dev, "PCM = %llu\n", tstamp->pcm_io_frames); 353 + dev_dbg(dev, 354 + "Ptr Query on strid = %d copied_total %llu, decodec %llu\n", 354 355 str_id, tstamp->copied_total, tstamp->pcm_frames); 355 - dev_dbg(dev, "rendered %d\n", tstamp->pcm_io_frames); 356 + dev_dbg(dev, "rendered %llu\n", tstamp->pcm_io_frames); 356 357 357 358 return 0; 358 359 }
+1 -1
sound/soc/intel/avs/probes.c
··· 213 213 } 214 214 215 215 static int avs_probe_compr_pointer(struct snd_compr_stream *cstream, 216 - struct snd_compr_tstamp *tstamp, struct snd_soc_dai *dai) 216 + struct snd_compr_tstamp64 *tstamp, struct snd_soc_dai *dai) 217 217 { 218 218 struct hdac_ext_stream *host_stream = avs_compr_get_host_stream(cstream); 219 219 struct snd_soc_pcm_stream *pstream;
+16 -10
sound/soc/qcom/qdsp6/q6apm-dai.c
··· 11 11 #include <sound/soc-dapm.h> 12 12 #include <linux/spinlock.h> 13 13 #include <sound/pcm.h> 14 + #include <asm/div64.h> 14 15 #include <asm/dma.h> 15 16 #include <linux/dma-mapping.h> 16 17 #include <sound/pcm_params.h> ··· 66 65 unsigned int pcm_size; 67 66 unsigned int pcm_count; 68 67 unsigned int periods; 69 - unsigned int bytes_sent; 70 - unsigned int bytes_received; 71 - unsigned int copied_total; 68 + uint64_t bytes_sent; 69 + uint64_t bytes_received; 70 + uint64_t copied_total; 72 71 uint16_t bits_per_sample; 73 72 snd_pcm_uframes_t queue_ptr; 74 73 bool next_track; ··· 576 575 577 576 static int q6apm_dai_compr_pointer(struct snd_soc_component *component, 578 577 struct snd_compr_stream *stream, 579 - struct snd_compr_tstamp *tstamp) 578 + struct snd_compr_tstamp64 *tstamp) 580 579 { 581 580 struct snd_compr_runtime *runtime = stream->runtime; 582 581 struct q6apm_dai_rtd *prtd = runtime->private_data; 583 582 unsigned long flags; 583 + uint64_t temp_copied_total; 584 584 585 585 spin_lock_irqsave(&prtd->lock, flags); 586 586 tstamp->copied_total = prtd->copied_total; 587 - tstamp->byte_offset = prtd->copied_total % prtd->pcm_size; 587 + temp_copied_total = tstamp->copied_total; 588 + tstamp->byte_offset = do_div(temp_copied_total, prtd->pcm_size); 588 589 spin_unlock_irqrestore(&prtd->lock, flags); 589 590 590 591 return 0; ··· 763 760 size_t copy; 764 761 u32 wflags = 0; 765 762 u32 app_pointer; 766 - u32 bytes_received; 763 + uint64_t bytes_received; 764 + uint64_t temp_bytes_received; 767 765 uint32_t bytes_to_write; 768 - int avail, bytes_in_flight = 0; 766 + uint64_t avail, bytes_in_flight = 0; 769 767 770 768 bytes_received = prtd->bytes_received; 769 + temp_bytes_received = bytes_received; 771 770 772 771 /** 773 772 * Make sure that next track data pointer is aligned at 32 bit boundary 774 773 * This is a Mandatory requirement from DSP data buffers alignment 775 774 */ 776 - if (prtd->next_track) 775 + if (prtd->next_track) { 777 776 bytes_received = ALIGN(prtd->bytes_received, prtd->pcm_count); 777 + temp_bytes_received = bytes_received; 778 + } 778 779 779 - app_pointer = bytes_received/prtd->pcm_size; 780 - app_pointer = bytes_received - (app_pointer * prtd->pcm_size); 780 + app_pointer = do_div(temp_bytes_received, prtd->pcm_size); 781 781 dstn = prtd->dma_buffer.area + app_pointer; 782 782 783 783 if (count < prtd->pcm_size - app_pointer) {
+16 -10
sound/soc/qcom/qdsp6/q6asm-dai.c
··· 14 14 #include <sound/pcm.h> 15 15 #include <linux/spinlock.h> 16 16 #include <sound/compress_driver.h> 17 + #include <asm/div64.h> 17 18 #include <asm/dma.h> 18 19 #include <linux/dma-mapping.h> 19 20 #include <sound/pcm_params.h> ··· 60 59 unsigned int pcm_count; 61 60 unsigned int pcm_irq_pos; /* IRQ position */ 62 61 unsigned int periods; 63 - unsigned int bytes_sent; 64 - unsigned int bytes_received; 65 - unsigned int copied_total; 62 + uint64_t bytes_sent; 63 + uint64_t bytes_received; 64 + uint64_t copied_total; 66 65 uint16_t bits_per_sample; 67 66 uint16_t source; /* Encoding source bit mask */ 68 67 struct audio_client *audio_client; ··· 1027 1026 1028 1027 static int q6asm_dai_compr_pointer(struct snd_soc_component *component, 1029 1028 struct snd_compr_stream *stream, 1030 - struct snd_compr_tstamp *tstamp) 1029 + struct snd_compr_tstamp64 *tstamp) 1031 1030 { 1032 1031 struct snd_compr_runtime *runtime = stream->runtime; 1033 1032 struct q6asm_dai_rtd *prtd = runtime->private_data; 1034 1033 unsigned long flags; 1034 + uint64_t temp_copied_total; 1035 1035 1036 1036 spin_lock_irqsave(&prtd->lock, flags); 1037 1037 1038 1038 tstamp->copied_total = prtd->copied_total; 1039 - tstamp->byte_offset = prtd->copied_total % prtd->pcm_size; 1039 + temp_copied_total = tstamp->copied_total; 1040 + tstamp->byte_offset = do_div(temp_copied_total, prtd->pcm_size); 1040 1041 1041 1042 spin_unlock_irqrestore(&prtd->lock, flags); 1042 1043 ··· 1053 1050 struct q6asm_dai_rtd *prtd = runtime->private_data; 1054 1051 unsigned long flags; 1055 1052 u32 wflags = 0; 1056 - int avail, bytes_in_flight = 0; 1053 + uint64_t avail, bytes_in_flight = 0; 1057 1054 void *dstn; 1058 1055 size_t copy; 1059 1056 u32 app_pointer; 1060 - u32 bytes_received; 1057 + uint64_t bytes_received; 1058 + uint64_t temp_bytes_received; 1061 1059 1062 1060 bytes_received = prtd->bytes_received; 1061 + temp_bytes_received = bytes_received; 1063 1062 1064 1063 /** 1065 1064 * Make sure that next track data pointer is aligned at 32 bit boundary 1066 1065 * This is a Mandatory requirement from DSP data buffers alignment 1067 1066 */ 1068 - if (prtd->next_track) 1067 + if (prtd->next_track) { 1069 1068 bytes_received = ALIGN(prtd->bytes_received, prtd->pcm_count); 1069 + temp_bytes_received = bytes_received; 1070 + } 1070 1071 1071 - app_pointer = bytes_received/prtd->pcm_size; 1072 - app_pointer = bytes_received - (app_pointer * prtd->pcm_size); 1072 + app_pointer = do_div(temp_bytes_received, prtd->pcm_size); 1073 1073 dstn = prtd->dma_buffer.area + app_pointer; 1074 1074 1075 1075 if (count < prtd->pcm_size - app_pointer) {
+1 -1
sound/soc/soc-component.c
··· 637 637 EXPORT_SYMBOL_GPL(snd_soc_component_compr_ack); 638 638 639 639 int snd_soc_component_compr_pointer(struct snd_compr_stream *cstream, 640 - struct snd_compr_tstamp *tstamp) 640 + struct snd_compr_tstamp64 *tstamp) 641 641 { 642 642 struct snd_soc_pcm_runtime *rtd = cstream->private_data; 643 643 struct snd_soc_component *component;
+1 -1
sound/soc/soc-compress.c
··· 457 457 } 458 458 459 459 static int soc_compr_pointer(struct snd_compr_stream *cstream, 460 - struct snd_compr_tstamp *tstamp) 460 + struct snd_compr_tstamp64 *tstamp) 461 461 { 462 462 struct snd_soc_pcm_runtime *rtd = cstream->private_data; 463 463 int ret;
+1 -1
sound/soc/soc-dai.c
··· 774 774 775 775 int snd_soc_dai_compr_pointer(struct snd_soc_dai *dai, 776 776 struct snd_compr_stream *cstream, 777 - struct snd_compr_tstamp *tstamp) 777 + struct snd_compr_tstamp64 *tstamp) 778 778 { 779 779 int ret = 0; 780 780
+1 -1
sound/soc/sof/amd/acp-probes.c
··· 108 108 109 109 static int acp_probes_compr_pointer(struct sof_client_dev *cdev, 110 110 struct snd_compr_stream *cstream, 111 - struct snd_compr_tstamp *tstamp, 111 + struct snd_compr_tstamp64 *tstamp, 112 112 struct snd_soc_dai *dai) 113 113 { 114 114 struct acp_dsp_stream *stream = cstream->runtime->private_data;
+1 -1
sound/soc/sof/compress.c
··· 361 361 362 362 static int sof_compr_pointer(struct snd_soc_component *component, 363 363 struct snd_compr_stream *cstream, 364 - struct snd_compr_tstamp *tstamp) 364 + struct snd_compr_tstamp64 *tstamp) 365 365 { 366 366 struct snd_sof_pcm *spcm; 367 367 struct snd_soc_pcm_runtime *rtd = cstream->private_data;
+1 -1
sound/soc/sof/intel/hda-probes.c
··· 112 112 113 113 static int hda_probes_compr_pointer(struct sof_client_dev *cdev, 114 114 struct snd_compr_stream *cstream, 115 - struct snd_compr_tstamp *tstamp, 115 + struct snd_compr_tstamp64 *tstamp, 116 116 struct snd_soc_dai *dai) 117 117 { 118 118 struct hdac_ext_stream *hext_stream = hda_compr_get_stream(cstream);
+1 -1
sound/soc/sof/sof-client-probes.c
··· 137 137 } 138 138 139 139 static int sof_probes_compr_pointer(struct snd_compr_stream *cstream, 140 - struct snd_compr_tstamp *tstamp, 140 + struct snd_compr_tstamp64 *tstamp, 141 141 struct snd_soc_dai *dai) 142 142 { 143 143 struct snd_soc_card *card = snd_soc_component_get_drvdata(dai->component);
+2 -2
sound/soc/sof/sof-client-probes.h
··· 4 4 #define __SOF_CLIENT_PROBES_H 5 5 6 6 struct snd_compr_stream; 7 - struct snd_compr_tstamp; 7 + struct snd_compr_tstamp64; 8 8 struct snd_compr_params; 9 9 struct sof_client_dev; 10 10 struct snd_soc_dai; ··· 24 24 int (*trigger)(struct sof_client_dev *cdev, struct snd_compr_stream *cstream, 25 25 int cmd, struct snd_soc_dai *dai); 26 26 int (*pointer)(struct sof_client_dev *cdev, struct snd_compr_stream *cstream, 27 - struct snd_compr_tstamp *tstamp, 27 + struct snd_compr_tstamp64 *tstamp, 28 28 struct snd_soc_dai *dai); 29 29 }; 30 30
+3 -3
sound/soc/sprd/sprd-pcm-compress.c
··· 85 85 int info_size; 86 86 87 87 /* Data size copied to IRAM buffer */ 88 - int copied_total; 88 + u64 copied_total; 89 89 /* Total received data size from userspace */ 90 - int received_total; 90 + u64 received_total; 91 91 /* Stage 0 IRAM buffer received data size */ 92 92 int received_stage0; 93 93 /* Stage 1 DDR buffer received data size */ ··· 513 513 514 514 static int sprd_platform_compr_pointer(struct snd_soc_component *component, 515 515 struct snd_compr_stream *cstream, 516 - struct snd_compr_tstamp *tstamp) 516 + struct snd_compr_tstamp64 *tstamp) 517 517 { 518 518 struct snd_compr_runtime *runtime = cstream->runtime; 519 519 struct sprd_compr_stream *stream = runtime->private_data;
+2 -2
sound/soc/sprd/sprd-pcm-dma.h
··· 19 19 int total_time; 20 20 int current_time; 21 21 int total_data_length; 22 - int current_data_offset; 22 + u64 current_data_offset; 23 23 }; 24 24 25 25 struct sprd_compr_params { ··· 46 46 int (*stop)(int str_id); 47 47 int (*pause)(int str_id); 48 48 int (*pause_release)(int str_id); 49 - int (*drain)(int received_total); 49 + int (*drain)(u64 received_total); 50 50 int (*set_params)(int str_id, struct sprd_compr_params *params); 51 51 }; 52 52
+1 -1
sound/soc/uniphier/aio-compress.c
··· 249 249 250 250 static int uniphier_aio_compr_pointer(struct snd_soc_component *component, 251 251 struct snd_compr_stream *cstream, 252 - struct snd_compr_tstamp *tstamp) 252 + struct snd_compr_tstamp64 *tstamp) 253 253 { 254 254 struct snd_soc_pcm_runtime *rtd = cstream->private_data; 255 255 struct snd_compr_runtime *runtime = cstream->runtime;