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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-4.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"It's our tradition to get a high volume of fixes late at rc7: this
time, X32 ABI breakage was found and this resulted in a high number
LOCs. The necessary changes to ALSA core codes were fairly
straightforward, and more importantly, they are specific to X32, thus
should be safe to apply.

Other than that, rather a collection of small fixes:
- Removal of the code that blocks too long at closing the OSS
sequencer client (which was spotted by syzkaller, unsurprisingly)
- Fixes races at HD-audio HDMI i915 audio binding
- a few HDSP/HDPM zero-division fixes
- Quirks for HD-audio and USB-audio as usual"

* tag 'sound-4.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - hdmi defer to register acomp eld notifier
ALSA: hda - hdmi add wmb barrier for audio component
ALSA: hda - Fix mic issues on Acer Aspire E1-472
ALSA: seq: oss: Don't drain at closing a client
ALSA: usb-audio: Add a quirk for Plantronics DA45
ALSA: hdsp: Fix wrong boolean ctl value accesses
ALSA: hdspm: Fix zero-division
ALSA: hdspm: Fix wrong boolean ctl value accesses
ALSA: timer: Fix ioctls for X32 ABI
ALSA: timer: Fix broken compat timer user status ioctl
ALSA: rawmidi: Fix ioctls X32 ABI
ALSA: rawmidi: Use comapt_put_timespec()
ALSA: pcm: Fix ioctls for X32 ABI
ALSA: ctl: Fix ioctls for X32 ABI

+348 -53
+74 -16
sound/core/control_compat.c
··· 170 170 unsigned char reserved[128]; 171 171 }; 172 172 173 + #ifdef CONFIG_X86_X32 174 + /* x32 has a different alignment for 64bit values from ia32 */ 175 + struct snd_ctl_elem_value_x32 { 176 + struct snd_ctl_elem_id id; 177 + unsigned int indirect; /* bit-field causes misalignment */ 178 + union { 179 + s32 integer[128]; 180 + unsigned char data[512]; 181 + s64 integer64[64]; 182 + } value; 183 + unsigned char reserved[128]; 184 + }; 185 + #endif /* CONFIG_X86_X32 */ 173 186 174 187 /* get the value type and count of the control */ 175 188 static int get_ctl_type(struct snd_card *card, struct snd_ctl_elem_id *id, ··· 232 219 233 220 static int copy_ctl_value_from_user(struct snd_card *card, 234 221 struct snd_ctl_elem_value *data, 235 - struct snd_ctl_elem_value32 __user *data32, 222 + void __user *userdata, 223 + void __user *valuep, 236 224 int *typep, int *countp) 237 225 { 226 + struct snd_ctl_elem_value32 __user *data32 = userdata; 238 227 int i, type, size; 239 228 int uninitialized_var(count); 240 229 unsigned int indirect; ··· 254 239 if (type == SNDRV_CTL_ELEM_TYPE_BOOLEAN || 255 240 type == SNDRV_CTL_ELEM_TYPE_INTEGER) { 256 241 for (i = 0; i < count; i++) { 242 + s32 __user *intp = valuep; 257 243 int val; 258 - if (get_user(val, &data32->value.integer[i])) 244 + if (get_user(val, &intp[i])) 259 245 return -EFAULT; 260 246 data->value.integer.value[i] = val; 261 247 } ··· 266 250 dev_err(card->dev, "snd_ioctl32_ctl_elem_value: unknown type %d\n", type); 267 251 return -EINVAL; 268 252 } 269 - if (copy_from_user(data->value.bytes.data, 270 - data32->value.data, size)) 253 + if (copy_from_user(data->value.bytes.data, valuep, size)) 271 254 return -EFAULT; 272 255 } 273 256 ··· 276 261 } 277 262 278 263 /* restore the value to 32bit */ 279 - static int copy_ctl_value_to_user(struct snd_ctl_elem_value32 __user *data32, 264 + static int copy_ctl_value_to_user(void __user *userdata, 265 + void __user *valuep, 280 266 struct snd_ctl_elem_value *data, 281 267 int type, int count) 282 268 { ··· 286 270 if (type == SNDRV_CTL_ELEM_TYPE_BOOLEAN || 287 271 type == SNDRV_CTL_ELEM_TYPE_INTEGER) { 288 272 for (i = 0; i < count; i++) { 273 + s32 __user *intp = valuep; 289 274 int val; 290 275 val = data->value.integer.value[i]; 291 - if (put_user(val, &data32->value.integer[i])) 276 + if (put_user(val, &intp[i])) 292 277 return -EFAULT; 293 278 } 294 279 } else { 295 280 size = get_elem_size(type, count); 296 - if (copy_to_user(data32->value.data, 297 - data->value.bytes.data, size)) 281 + if (copy_to_user(valuep, data->value.bytes.data, size)) 298 282 return -EFAULT; 299 283 } 300 284 return 0; 301 285 } 302 286 303 - static int snd_ctl_elem_read_user_compat(struct snd_card *card, 304 - struct snd_ctl_elem_value32 __user *data32) 287 + static int ctl_elem_read_user(struct snd_card *card, 288 + void __user *userdata, void __user *valuep) 305 289 { 306 290 struct snd_ctl_elem_value *data; 307 291 int err, type, count; ··· 310 294 if (data == NULL) 311 295 return -ENOMEM; 312 296 313 - if ((err = copy_ctl_value_from_user(card, data, data32, &type, &count)) < 0) 297 + err = copy_ctl_value_from_user(card, data, userdata, valuep, 298 + &type, &count); 299 + if (err < 0) 314 300 goto error; 315 301 316 302 snd_power_lock(card); ··· 321 303 err = snd_ctl_elem_read(card, data); 322 304 snd_power_unlock(card); 323 305 if (err >= 0) 324 - err = copy_ctl_value_to_user(data32, data, type, count); 306 + err = copy_ctl_value_to_user(userdata, valuep, data, 307 + type, count); 325 308 error: 326 309 kfree(data); 327 310 return err; 328 311 } 329 312 330 - static int snd_ctl_elem_write_user_compat(struct snd_ctl_file *file, 331 - struct snd_ctl_elem_value32 __user *data32) 313 + static int ctl_elem_write_user(struct snd_ctl_file *file, 314 + void __user *userdata, void __user *valuep) 332 315 { 333 316 struct snd_ctl_elem_value *data; 334 317 struct snd_card *card = file->card; ··· 339 320 if (data == NULL) 340 321 return -ENOMEM; 341 322 342 - if ((err = copy_ctl_value_from_user(card, data, data32, &type, &count)) < 0) 323 + err = copy_ctl_value_from_user(card, data, userdata, valuep, 324 + &type, &count); 325 + if (err < 0) 343 326 goto error; 344 327 345 328 snd_power_lock(card); ··· 350 329 err = snd_ctl_elem_write(card, file, data); 351 330 snd_power_unlock(card); 352 331 if (err >= 0) 353 - err = copy_ctl_value_to_user(data32, data, type, count); 332 + err = copy_ctl_value_to_user(userdata, valuep, data, 333 + type, count); 354 334 error: 355 335 kfree(data); 356 336 return err; 357 337 } 338 + 339 + static int snd_ctl_elem_read_user_compat(struct snd_card *card, 340 + struct snd_ctl_elem_value32 __user *data32) 341 + { 342 + return ctl_elem_read_user(card, data32, &data32->value); 343 + } 344 + 345 + static int snd_ctl_elem_write_user_compat(struct snd_ctl_file *file, 346 + struct snd_ctl_elem_value32 __user *data32) 347 + { 348 + return ctl_elem_write_user(file, data32, &data32->value); 349 + } 350 + 351 + #ifdef CONFIG_X86_X32 352 + static int snd_ctl_elem_read_user_x32(struct snd_card *card, 353 + struct snd_ctl_elem_value_x32 __user *data32) 354 + { 355 + return ctl_elem_read_user(card, data32, &data32->value); 356 + } 357 + 358 + static int snd_ctl_elem_write_user_x32(struct snd_ctl_file *file, 359 + struct snd_ctl_elem_value_x32 __user *data32) 360 + { 361 + return ctl_elem_write_user(file, data32, &data32->value); 362 + } 363 + #endif /* CONFIG_X86_X32 */ 358 364 359 365 /* add or replace a user control */ 360 366 static int snd_ctl_elem_add_compat(struct snd_ctl_file *file, ··· 441 393 SNDRV_CTL_IOCTL_ELEM_WRITE32 = _IOWR('U', 0x13, struct snd_ctl_elem_value32), 442 394 SNDRV_CTL_IOCTL_ELEM_ADD32 = _IOWR('U', 0x17, struct snd_ctl_elem_info32), 443 395 SNDRV_CTL_IOCTL_ELEM_REPLACE32 = _IOWR('U', 0x18, struct snd_ctl_elem_info32), 396 + #ifdef CONFIG_X86_X32 397 + SNDRV_CTL_IOCTL_ELEM_READ_X32 = _IOWR('U', 0x12, struct snd_ctl_elem_value_x32), 398 + SNDRV_CTL_IOCTL_ELEM_WRITE_X32 = _IOWR('U', 0x13, struct snd_ctl_elem_value_x32), 399 + #endif /* CONFIG_X86_X32 */ 444 400 }; 445 401 446 402 static inline long snd_ctl_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg) ··· 483 431 return snd_ctl_elem_add_compat(ctl, argp, 0); 484 432 case SNDRV_CTL_IOCTL_ELEM_REPLACE32: 485 433 return snd_ctl_elem_add_compat(ctl, argp, 1); 434 + #ifdef CONFIG_X86_X32 435 + case SNDRV_CTL_IOCTL_ELEM_READ_X32: 436 + return snd_ctl_elem_read_user_x32(ctl->card, argp); 437 + case SNDRV_CTL_IOCTL_ELEM_WRITE_X32: 438 + return snd_ctl_elem_write_user_x32(ctl, argp); 439 + #endif /* CONFIG_X86_X32 */ 486 440 } 487 441 488 442 down_read(&snd_ioctl_rwsem);
+176 -1
sound/core/pcm_compat.c
··· 183 183 return err; 184 184 } 185 185 186 + #ifdef CONFIG_X86_X32 187 + /* X32 ABI has the same struct as x86-64 for snd_pcm_channel_info */ 188 + static int snd_pcm_channel_info_user(struct snd_pcm_substream *substream, 189 + struct snd_pcm_channel_info __user *src); 190 + #define snd_pcm_ioctl_channel_info_x32(s, p) \ 191 + snd_pcm_channel_info_user(s, p) 192 + #endif /* CONFIG_X86_X32 */ 193 + 186 194 struct snd_pcm_status32 { 187 195 s32 state; 188 196 struct compat_timespec trigger_tstamp; ··· 250 242 251 243 return err; 252 244 } 245 + 246 + #ifdef CONFIG_X86_X32 247 + /* X32 ABI has 64bit timespec and 64bit alignment */ 248 + struct snd_pcm_status_x32 { 249 + s32 state; 250 + u32 rsvd; /* alignment */ 251 + struct timespec trigger_tstamp; 252 + struct timespec tstamp; 253 + u32 appl_ptr; 254 + u32 hw_ptr; 255 + s32 delay; 256 + u32 avail; 257 + u32 avail_max; 258 + u32 overrange; 259 + s32 suspended_state; 260 + u32 audio_tstamp_data; 261 + struct timespec audio_tstamp; 262 + struct timespec driver_tstamp; 263 + u32 audio_tstamp_accuracy; 264 + unsigned char reserved[52-2*sizeof(struct timespec)]; 265 + } __packed; 266 + 267 + #define put_timespec(src, dst) copy_to_user(dst, src, sizeof(*dst)) 268 + 269 + static int snd_pcm_status_user_x32(struct snd_pcm_substream *substream, 270 + struct snd_pcm_status_x32 __user *src, 271 + bool ext) 272 + { 273 + struct snd_pcm_status status; 274 + int err; 275 + 276 + memset(&status, 0, sizeof(status)); 277 + /* 278 + * with extension, parameters are read/write, 279 + * get audio_tstamp_data from user, 280 + * ignore rest of status structure 281 + */ 282 + if (ext && get_user(status.audio_tstamp_data, 283 + (u32 __user *)(&src->audio_tstamp_data))) 284 + return -EFAULT; 285 + err = snd_pcm_status(substream, &status); 286 + if (err < 0) 287 + return err; 288 + 289 + if (clear_user(src, sizeof(*src))) 290 + return -EFAULT; 291 + if (put_user(status.state, &src->state) || 292 + put_timespec(&status.trigger_tstamp, &src->trigger_tstamp) || 293 + put_timespec(&status.tstamp, &src->tstamp) || 294 + put_user(status.appl_ptr, &src->appl_ptr) || 295 + put_user(status.hw_ptr, &src->hw_ptr) || 296 + put_user(status.delay, &src->delay) || 297 + put_user(status.avail, &src->avail) || 298 + put_user(status.avail_max, &src->avail_max) || 299 + put_user(status.overrange, &src->overrange) || 300 + put_user(status.suspended_state, &src->suspended_state) || 301 + put_user(status.audio_tstamp_data, &src->audio_tstamp_data) || 302 + put_timespec(&status.audio_tstamp, &src->audio_tstamp) || 303 + put_timespec(&status.driver_tstamp, &src->driver_tstamp) || 304 + put_user(status.audio_tstamp_accuracy, &src->audio_tstamp_accuracy)) 305 + return -EFAULT; 306 + 307 + return err; 308 + } 309 + #endif /* CONFIG_X86_X32 */ 253 310 254 311 /* both for HW_PARAMS and HW_REFINE */ 255 312 static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream, ··· 542 469 return 0; 543 470 } 544 471 472 + #ifdef CONFIG_X86_X32 473 + /* X32 ABI has 64bit timespec and 64bit alignment */ 474 + struct snd_pcm_mmap_status_x32 { 475 + s32 state; 476 + s32 pad1; 477 + u32 hw_ptr; 478 + u32 pad2; /* alignment */ 479 + struct timespec tstamp; 480 + s32 suspended_state; 481 + struct timespec audio_tstamp; 482 + } __packed; 483 + 484 + struct snd_pcm_mmap_control_x32 { 485 + u32 appl_ptr; 486 + u32 avail_min; 487 + }; 488 + 489 + struct snd_pcm_sync_ptr_x32 { 490 + u32 flags; 491 + u32 rsvd; /* alignment */ 492 + union { 493 + struct snd_pcm_mmap_status_x32 status; 494 + unsigned char reserved[64]; 495 + } s; 496 + union { 497 + struct snd_pcm_mmap_control_x32 control; 498 + unsigned char reserved[64]; 499 + } c; 500 + } __packed; 501 + 502 + static int snd_pcm_ioctl_sync_ptr_x32(struct snd_pcm_substream *substream, 503 + struct snd_pcm_sync_ptr_x32 __user *src) 504 + { 505 + struct snd_pcm_runtime *runtime = substream->runtime; 506 + volatile struct snd_pcm_mmap_status *status; 507 + volatile struct snd_pcm_mmap_control *control; 508 + u32 sflags; 509 + struct snd_pcm_mmap_control scontrol; 510 + struct snd_pcm_mmap_status sstatus; 511 + snd_pcm_uframes_t boundary; 512 + int err; 513 + 514 + if (snd_BUG_ON(!runtime)) 515 + return -EINVAL; 516 + 517 + if (get_user(sflags, &src->flags) || 518 + get_user(scontrol.appl_ptr, &src->c.control.appl_ptr) || 519 + get_user(scontrol.avail_min, &src->c.control.avail_min)) 520 + return -EFAULT; 521 + if (sflags & SNDRV_PCM_SYNC_PTR_HWSYNC) { 522 + err = snd_pcm_hwsync(substream); 523 + if (err < 0) 524 + return err; 525 + } 526 + status = runtime->status; 527 + control = runtime->control; 528 + boundary = recalculate_boundary(runtime); 529 + if (!boundary) 530 + boundary = 0x7fffffff; 531 + snd_pcm_stream_lock_irq(substream); 532 + /* FIXME: we should consider the boundary for the sync from app */ 533 + if (!(sflags & SNDRV_PCM_SYNC_PTR_APPL)) 534 + control->appl_ptr = scontrol.appl_ptr; 535 + else 536 + scontrol.appl_ptr = control->appl_ptr % boundary; 537 + if (!(sflags & SNDRV_PCM_SYNC_PTR_AVAIL_MIN)) 538 + control->avail_min = scontrol.avail_min; 539 + else 540 + scontrol.avail_min = control->avail_min; 541 + sstatus.state = status->state; 542 + sstatus.hw_ptr = status->hw_ptr % boundary; 543 + sstatus.tstamp = status->tstamp; 544 + sstatus.suspended_state = status->suspended_state; 545 + sstatus.audio_tstamp = status->audio_tstamp; 546 + snd_pcm_stream_unlock_irq(substream); 547 + if (put_user(sstatus.state, &src->s.status.state) || 548 + put_user(sstatus.hw_ptr, &src->s.status.hw_ptr) || 549 + put_timespec(&sstatus.tstamp, &src->s.status.tstamp) || 550 + put_user(sstatus.suspended_state, &src->s.status.suspended_state) || 551 + put_timespec(&sstatus.audio_tstamp, &src->s.status.audio_tstamp) || 552 + put_user(scontrol.appl_ptr, &src->c.control.appl_ptr) || 553 + put_user(scontrol.avail_min, &src->c.control.avail_min)) 554 + return -EFAULT; 555 + 556 + return 0; 557 + } 558 + #endif /* CONFIG_X86_X32 */ 545 559 546 560 /* 547 561 */ ··· 647 487 SNDRV_PCM_IOCTL_WRITEN_FRAMES32 = _IOW('A', 0x52, struct snd_xfern32), 648 488 SNDRV_PCM_IOCTL_READN_FRAMES32 = _IOR('A', 0x53, struct snd_xfern32), 649 489 SNDRV_PCM_IOCTL_SYNC_PTR32 = _IOWR('A', 0x23, struct snd_pcm_sync_ptr32), 650 - 490 + #ifdef CONFIG_X86_X32 491 + SNDRV_PCM_IOCTL_CHANNEL_INFO_X32 = _IOR('A', 0x32, struct snd_pcm_channel_info), 492 + SNDRV_PCM_IOCTL_STATUS_X32 = _IOR('A', 0x20, struct snd_pcm_status_x32), 493 + SNDRV_PCM_IOCTL_STATUS_EXT_X32 = _IOWR('A', 0x24, struct snd_pcm_status_x32), 494 + SNDRV_PCM_IOCTL_SYNC_PTR_X32 = _IOWR('A', 0x23, struct snd_pcm_sync_ptr_x32), 495 + #endif /* CONFIG_X86_X32 */ 651 496 }; 652 497 653 498 static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg) ··· 724 559 return snd_pcm_ioctl_rewind_compat(substream, argp); 725 560 case SNDRV_PCM_IOCTL_FORWARD32: 726 561 return snd_pcm_ioctl_forward_compat(substream, argp); 562 + #ifdef CONFIG_X86_X32 563 + case SNDRV_PCM_IOCTL_STATUS_X32: 564 + return snd_pcm_status_user_x32(substream, argp, false); 565 + case SNDRV_PCM_IOCTL_STATUS_EXT_X32: 566 + return snd_pcm_status_user_x32(substream, argp, true); 567 + case SNDRV_PCM_IOCTL_SYNC_PTR_X32: 568 + return snd_pcm_ioctl_sync_ptr_x32(substream, argp); 569 + case SNDRV_PCM_IOCTL_CHANNEL_INFO_X32: 570 + return snd_pcm_ioctl_channel_info_x32(substream, argp); 571 + #endif /* CONFIG_X86_X32 */ 727 572 } 728 573 729 574 return -ENOIOCTLCMD;
+54 -2
sound/core/rawmidi_compat.c
··· 85 85 if (err < 0) 86 86 return err; 87 87 88 - if (put_user(status.tstamp.tv_sec, &src->tstamp.tv_sec) || 89 - put_user(status.tstamp.tv_nsec, &src->tstamp.tv_nsec) || 88 + if (compat_put_timespec(&status.tstamp, &src->tstamp) || 90 89 put_user(status.avail, &src->avail) || 91 90 put_user(status.xruns, &src->xruns)) 92 91 return -EFAULT; ··· 93 94 return 0; 94 95 } 95 96 97 + #ifdef CONFIG_X86_X32 98 + /* X32 ABI has 64bit timespec and 64bit alignment */ 99 + struct snd_rawmidi_status_x32 { 100 + s32 stream; 101 + u32 rsvd; /* alignment */ 102 + struct timespec tstamp; 103 + u32 avail; 104 + u32 xruns; 105 + unsigned char reserved[16]; 106 + } __attribute__((packed)); 107 + 108 + #define put_timespec(src, dst) copy_to_user(dst, src, sizeof(*dst)) 109 + 110 + static int snd_rawmidi_ioctl_status_x32(struct snd_rawmidi_file *rfile, 111 + struct snd_rawmidi_status_x32 __user *src) 112 + { 113 + int err; 114 + struct snd_rawmidi_status status; 115 + 116 + if (rfile->output == NULL) 117 + return -EINVAL; 118 + if (get_user(status.stream, &src->stream)) 119 + return -EFAULT; 120 + 121 + switch (status.stream) { 122 + case SNDRV_RAWMIDI_STREAM_OUTPUT: 123 + err = snd_rawmidi_output_status(rfile->output, &status); 124 + break; 125 + case SNDRV_RAWMIDI_STREAM_INPUT: 126 + err = snd_rawmidi_input_status(rfile->input, &status); 127 + break; 128 + default: 129 + return -EINVAL; 130 + } 131 + if (err < 0) 132 + return err; 133 + 134 + if (put_timespec(&status.tstamp, &src->tstamp) || 135 + put_user(status.avail, &src->avail) || 136 + put_user(status.xruns, &src->xruns)) 137 + return -EFAULT; 138 + 139 + return 0; 140 + } 141 + #endif /* CONFIG_X86_X32 */ 142 + 96 143 enum { 97 144 SNDRV_RAWMIDI_IOCTL_PARAMS32 = _IOWR('W', 0x10, struct snd_rawmidi_params32), 98 145 SNDRV_RAWMIDI_IOCTL_STATUS32 = _IOWR('W', 0x20, struct snd_rawmidi_status32), 146 + #ifdef CONFIG_X86_X32 147 + SNDRV_RAWMIDI_IOCTL_STATUS_X32 = _IOWR('W', 0x20, struct snd_rawmidi_status_x32), 148 + #endif /* CONFIG_X86_X32 */ 99 149 }; 100 150 101 151 static long snd_rawmidi_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg) ··· 163 115 return snd_rawmidi_ioctl_params_compat(rfile, argp); 164 116 case SNDRV_RAWMIDI_IOCTL_STATUS32: 165 117 return snd_rawmidi_ioctl_status_compat(rfile, argp); 118 + #ifdef CONFIG_X86_X32 119 + case SNDRV_RAWMIDI_IOCTL_STATUS_X32: 120 + return snd_rawmidi_ioctl_status_x32(rfile, argp); 121 + #endif /* CONFIG_X86_X32 */ 166 122 } 167 123 return -ENOIOCTLCMD; 168 124 }
-2
sound/core/seq/oss/seq_oss.c
··· 149 149 if ((dp = file->private_data) == NULL) 150 150 return 0; 151 151 152 - snd_seq_oss_drain_write(dp); 153 - 154 152 mutex_lock(&register_mutex); 155 153 snd_seq_oss_release(dp); 156 154 mutex_unlock(&register_mutex);
-1
sound/core/seq/oss/seq_oss_device.h
··· 127 127 unsigned int snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wait); 128 128 129 129 void snd_seq_oss_reset(struct seq_oss_devinfo *dp); 130 - void snd_seq_oss_drain_write(struct seq_oss_devinfo *dp); 131 130 132 131 /* */ 133 132 void snd_seq_oss_process_queue(struct seq_oss_devinfo *dp, abstime_t time);
-16
sound/core/seq/oss/seq_oss_init.c
··· 436 436 437 437 438 438 /* 439 - * Wait until the queue is empty (if we don't have nonblock) 440 - */ 441 - void 442 - snd_seq_oss_drain_write(struct seq_oss_devinfo *dp) 443 - { 444 - if (! dp->timer->running) 445 - return; 446 - if (is_write_mode(dp->file_mode) && !is_nonblock_mode(dp->file_mode) && 447 - dp->writeq) { 448 - while (snd_seq_oss_writeq_sync(dp->writeq)) 449 - ; 450 - } 451 - } 452 - 453 - 454 - /* 455 439 * reset sequencer devices 456 440 */ 457 441 void
+16 -2
sound/core/timer_compat.c
··· 70 70 struct snd_timer_status32 __user *_status) 71 71 { 72 72 struct snd_timer_user *tu; 73 - struct snd_timer_status status; 73 + struct snd_timer_status32 status; 74 74 75 75 tu = file->private_data; 76 76 if (snd_BUG_ON(!tu->timeri)) 77 77 return -ENXIO; 78 78 memset(&status, 0, sizeof(status)); 79 - status.tstamp = tu->tstamp; 79 + status.tstamp.tv_sec = tu->tstamp.tv_sec; 80 + status.tstamp.tv_nsec = tu->tstamp.tv_nsec; 80 81 status.resolution = snd_timer_resolution(tu->timeri); 81 82 status.lost = tu->timeri->lost; 82 83 status.overrun = tu->overrun; ··· 89 88 return 0; 90 89 } 91 90 91 + #ifdef CONFIG_X86_X32 92 + /* X32 ABI has the same struct as x86-64 */ 93 + #define snd_timer_user_status_x32(file, s) \ 94 + snd_timer_user_status(file, s) 95 + #endif /* CONFIG_X86_X32 */ 96 + 92 97 /* 93 98 */ 94 99 95 100 enum { 96 101 SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct snd_timer_info32), 97 102 SNDRV_TIMER_IOCTL_STATUS32 = _IOW('T', 0x14, struct snd_timer_status32), 103 + #ifdef CONFIG_X86_X32 104 + SNDRV_TIMER_IOCTL_STATUS_X32 = _IOW('T', 0x14, struct snd_timer_status), 105 + #endif /* CONFIG_X86_X32 */ 98 106 }; 99 107 100 108 static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg) ··· 132 122 return snd_timer_user_info_compat(file, argp); 133 123 case SNDRV_TIMER_IOCTL_STATUS32: 134 124 return snd_timer_user_status_compat(file, argp); 125 + #ifdef CONFIG_X86_X32 126 + case SNDRV_TIMER_IOCTL_STATUS_X32: 127 + return snd_timer_user_status_x32(file, argp); 128 + #endif /* CONFIG_X86_X32 */ 135 129 } 136 130 return -ENOIOCTLCMD; 137 131 }
+12 -7
sound/pci/hda/patch_hdmi.c
··· 2477 2477 is_broxton(codec)) 2478 2478 codec->core.link_power_control = 1; 2479 2479 2480 - if (codec_has_acomp(codec)) { 2481 - codec->depop_delay = 0; 2482 - spec->i915_audio_ops.audio_ptr = codec; 2483 - spec->i915_audio_ops.pin_eld_notify = intel_pin_eld_notify; 2484 - snd_hdac_i915_register_notifier(&spec->i915_audio_ops); 2485 - } 2486 - 2487 2480 if (hdmi_parse_codec(codec) < 0) { 2488 2481 if (spec->i915_bound) 2489 2482 snd_hdac_i915_exit(&codec->bus->core); ··· 2497 2504 generic_hdmi_init_per_pins(codec); 2498 2505 2499 2506 init_channel_allocations(); 2507 + 2508 + if (codec_has_acomp(codec)) { 2509 + codec->depop_delay = 0; 2510 + spec->i915_audio_ops.audio_ptr = codec; 2511 + /* intel_audio_codec_enable() or intel_audio_codec_disable() 2512 + * will call pin_eld_notify with using audio_ptr pointer 2513 + * We need make sure audio_ptr is really setup 2514 + */ 2515 + wmb(); 2516 + spec->i915_audio_ops.pin_eld_notify = intel_pin_eld_notify; 2517 + snd_hdac_i915_register_notifier(&spec->i915_audio_ops); 2518 + } 2500 2519 2501 2520 return 0; 2502 2521 }
+1
sound/pci/hda/patch_realtek.c
··· 5412 5412 SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC), 5413 5413 SND_PCI_QUIRK(0x1025, 0x0740, "Acer AO725", ALC271_FIXUP_HP_GATE_MIC_JACK), 5414 5414 SND_PCI_QUIRK(0x1025, 0x0742, "Acer AO756", ALC271_FIXUP_HP_GATE_MIC_JACK), 5415 + SND_PCI_QUIRK(0x1025, 0x0762, "Acer Aspire E1-472", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), 5415 5416 SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572), 5416 5417 SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), 5417 5418 SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
+2 -2
sound/pci/rme9652/hdsp.c
··· 2879 2879 { 2880 2880 struct hdsp *hdsp = snd_kcontrol_chip(kcontrol); 2881 2881 2882 - ucontrol->value.enumerated.item[0] = hdsp_dds_offset(hdsp); 2882 + ucontrol->value.integer.value[0] = hdsp_dds_offset(hdsp); 2883 2883 return 0; 2884 2884 } 2885 2885 ··· 2891 2891 2892 2892 if (!snd_hdsp_use_is_exclusive(hdsp)) 2893 2893 return -EBUSY; 2894 - val = ucontrol->value.enumerated.item[0]; 2894 + val = ucontrol->value.integer.value[0]; 2895 2895 spin_lock_irq(&hdsp->lock); 2896 2896 if (val != hdsp_dds_offset(hdsp)) 2897 2897 change = (hdsp_set_dds_offset(hdsp, val) == 0) ? 1 : 0;
+12 -4
sound/pci/rme9652/hdspm.c
··· 1601 1601 { 1602 1602 u64 n; 1603 1603 1604 + if (snd_BUG_ON(rate <= 0)) 1605 + return; 1606 + 1604 1607 if (rate >= 112000) 1605 1608 rate /= 4; 1606 1609 else if (rate >= 56000) ··· 2218 2215 } else { 2219 2216 /* slave mode, return external sample rate */ 2220 2217 rate = hdspm_external_sample_rate(hdspm); 2218 + if (!rate) 2219 + rate = hdspm->system_sample_rate; 2221 2220 } 2222 2221 } 2223 2222 ··· 2265 2260 ucontrol) 2266 2261 { 2267 2262 struct hdspm *hdspm = snd_kcontrol_chip(kcontrol); 2263 + int rate = ucontrol->value.integer.value[0]; 2268 2264 2269 - hdspm_set_dds_value(hdspm, ucontrol->value.enumerated.item[0]); 2265 + if (rate < 27000 || rate > 207000) 2266 + return -EINVAL; 2267 + hdspm_set_dds_value(hdspm, ucontrol->value.integer.value[0]); 2270 2268 return 0; 2271 2269 } 2272 2270 ··· 4457 4449 { 4458 4450 struct hdspm *hdspm = snd_kcontrol_chip(kcontrol); 4459 4451 4460 - ucontrol->value.enumerated.item[0] = hdspm->tco->term; 4452 + ucontrol->value.integer.value[0] = hdspm->tco->term; 4461 4453 4462 4454 return 0; 4463 4455 } ··· 4468 4460 { 4469 4461 struct hdspm *hdspm = snd_kcontrol_chip(kcontrol); 4470 4462 4471 - if (hdspm->tco->term != ucontrol->value.enumerated.item[0]) { 4472 - hdspm->tco->term = ucontrol->value.enumerated.item[0]; 4463 + if (hdspm->tco->term != ucontrol->value.integer.value[0]) { 4464 + hdspm->tco->term = ucontrol->value.integer.value[0]; 4473 4465 4474 4466 hdspm_tco_write(hdspm); 4475 4467
+1
sound/usb/quirks.c
··· 1124 1124 case USB_ID(0x045E, 0x076F): /* MS Lifecam HD-6000 */ 1125 1125 case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */ 1126 1126 case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */ 1127 + case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */ 1127 1128 case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */ 1128 1129 case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ 1129 1130 case USB_ID(0x21B4, 0x0081): /* AudioQuest DragonFly */