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-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"This became slightly larger as I've been off in the last weeks.

The majority of changes here is about ASoC, fixes for dmaengine
and for addressing issues reported by CI, as well as other
device-specific small fixes.

Also, fixes for FireWire core stack and the usual HD-audio quirks
are included"

* tag 'sound-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits)
ASoC: SOF: Fix NULL pointer exception in sof_pci_probe callback
ASoC: ops: Validate input values in snd_soc_put_volsw_range()
ASoC: dmaengine: Restore NULL prepare_slave_config() callback
ASoC: atmel: mchp-pdmc: set prepare_slave_config
ASoC: max98090: Generate notifications on changes for custom control
ASoC: max98090: Reject invalid values in custom control put()
ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes
ALSA: hda/realtek: Add quirk for Yoga Duet 7 13ITL6 speakers
firewire: core: extend card->lock in fw_core_handle_bus_reset
firewire: remove check of list iterator against head past the loop body
firewire: fix potential uaf in outbound_phy_packet_callback()
ASoC: rt9120: Correct the reg 0x09 size to one byte
ALSA: hda/realtek: Enable mute/micmute LEDs support for HP Laptops
ALSA: hda/realtek: Fix mute led issue on thinkpad with cs35l41 s-codec
ASoC: meson: axg-card: Fix nonatomic links
ASoC: meson: axg-tdm-interface: Fix formatters in trigger"
ASoC: soc-ops: fix error handling
ASoC: meson: Fix event generation for G12A tohdmi mux
ASoC: meson: Fix event generation for AUI CODEC mux
ASoC: meson: Fix event generation for AUI ACODEC mux
...

+96 -74
+3
drivers/firewire/core-card.c
··· 668 668 void fw_core_remove_card(struct fw_card *card) 669 669 { 670 670 struct fw_card_driver dummy_driver = dummy_driver_template; 671 + unsigned long flags; 671 672 672 673 card->driver->update_phy_reg(card, 4, 673 674 PHY_LINK_ACTIVE | PHY_CONTENDER, 0); ··· 683 682 dummy_driver.stop_iso = card->driver->stop_iso; 684 683 card->driver = &dummy_driver; 685 684 685 + spin_lock_irqsave(&card->lock, flags); 686 686 fw_destroy_nodes(card); 687 + spin_unlock_irqrestore(&card->lock, flags); 687 688 688 689 /* Wait for all users, especially device workqueue jobs, to finish. */ 689 690 fw_card_put(card);
+3 -1
drivers/firewire/core-cdev.c
··· 1500 1500 { 1501 1501 struct outbound_phy_packet_event *e = 1502 1502 container_of(packet, struct outbound_phy_packet_event, p); 1503 + struct client *e_client; 1503 1504 1504 1505 switch (status) { 1505 1506 /* expected: */ ··· 1517 1516 } 1518 1517 e->phy_packet.data[0] = packet->timestamp; 1519 1518 1519 + e_client = e->client; 1520 1520 queue_event(e->client, &e->event, &e->phy_packet, 1521 1521 sizeof(e->phy_packet) + e->phy_packet.length, NULL, 0); 1522 - client_put(e->client); 1522 + client_put(e_client); 1523 1523 } 1524 1524 1525 1525 static int ioctl_send_phy_packet(struct client *client, union ioctl_arg *arg)
+3 -6
drivers/firewire/core-topology.c
··· 375 375 card->bm_retries = 0; 376 376 } 377 377 378 + /* Must be called with card->lock held */ 378 379 void fw_destroy_nodes(struct fw_card *card) 379 380 { 380 - unsigned long flags; 381 - 382 - spin_lock_irqsave(&card->lock, flags); 383 381 card->color++; 384 382 if (card->local_node != NULL) 385 383 for_each_fw_node(card, card->local_node, report_lost_node); 386 384 card->local_node = NULL; 387 - spin_unlock_irqrestore(&card->lock, flags); 388 385 } 389 386 390 387 static void move_tree(struct fw_node *node0, struct fw_node *node1, int port) ··· 507 510 struct fw_node *local_node; 508 511 unsigned long flags; 509 512 513 + spin_lock_irqsave(&card->lock, flags); 514 + 510 515 /* 511 516 * If the selfID buffer is not the immediate successor of the 512 517 * previously processed one, we cannot reliably compare the ··· 519 520 fw_destroy_nodes(card); 520 521 card->bm_retries = 0; 521 522 } 522 - 523 - spin_lock_irqsave(&card->lock, flags); 524 523 525 524 card->broadcast_channel_allocated = card->broadcast_channel_auto_allocated; 526 525 card->node_id = node_id;
+16 -14
drivers/firewire/core-transaction.c
··· 73 73 static int close_transaction(struct fw_transaction *transaction, 74 74 struct fw_card *card, int rcode) 75 75 { 76 - struct fw_transaction *t; 76 + struct fw_transaction *t = NULL, *iter; 77 77 unsigned long flags; 78 78 79 79 spin_lock_irqsave(&card->lock, flags); 80 - list_for_each_entry(t, &card->transaction_list, link) { 81 - if (t == transaction) { 82 - if (!try_cancel_split_timeout(t)) { 80 + list_for_each_entry(iter, &card->transaction_list, link) { 81 + if (iter == transaction) { 82 + if (!try_cancel_split_timeout(iter)) { 83 83 spin_unlock_irqrestore(&card->lock, flags); 84 84 goto timed_out; 85 85 } 86 - list_del_init(&t->link); 87 - card->tlabel_mask &= ~(1ULL << t->tlabel); 86 + list_del_init(&iter->link); 87 + card->tlabel_mask &= ~(1ULL << iter->tlabel); 88 + t = iter; 88 89 break; 89 90 } 90 91 } 91 92 spin_unlock_irqrestore(&card->lock, flags); 92 93 93 - if (&t->link != &card->transaction_list) { 94 + if (t) { 94 95 t->callback(card, rcode, NULL, 0, t->callback_data); 95 96 return 0; 96 97 } ··· 936 935 937 936 void fw_core_handle_response(struct fw_card *card, struct fw_packet *p) 938 937 { 939 - struct fw_transaction *t; 938 + struct fw_transaction *t = NULL, *iter; 940 939 unsigned long flags; 941 940 u32 *data; 942 941 size_t data_length; ··· 948 947 rcode = HEADER_GET_RCODE(p->header[1]); 949 948 950 949 spin_lock_irqsave(&card->lock, flags); 951 - list_for_each_entry(t, &card->transaction_list, link) { 952 - if (t->node_id == source && t->tlabel == tlabel) { 953 - if (!try_cancel_split_timeout(t)) { 950 + list_for_each_entry(iter, &card->transaction_list, link) { 951 + if (iter->node_id == source && iter->tlabel == tlabel) { 952 + if (!try_cancel_split_timeout(iter)) { 954 953 spin_unlock_irqrestore(&card->lock, flags); 955 954 goto timed_out; 956 955 } 957 - list_del_init(&t->link); 958 - card->tlabel_mask &= ~(1ULL << t->tlabel); 956 + list_del_init(&iter->link); 957 + card->tlabel_mask &= ~(1ULL << iter->tlabel); 958 + t = iter; 959 959 break; 960 960 } 961 961 } 962 962 spin_unlock_irqrestore(&card->lock, flags); 963 963 964 - if (&t->link == &card->transaction_list) { 964 + if (!t) { 965 965 timed_out: 966 966 fw_notice(card, "unsolicited response (source %x, tlabel %x)\n", 967 967 source, tlabel);
+7 -6
drivers/firewire/sbp2.c
··· 408 408 void *payload, size_t length, void *callback_data) 409 409 { 410 410 struct sbp2_logical_unit *lu = callback_data; 411 - struct sbp2_orb *orb; 411 + struct sbp2_orb *orb = NULL, *iter; 412 412 struct sbp2_status status; 413 413 unsigned long flags; 414 414 ··· 433 433 434 434 /* Lookup the orb corresponding to this status write. */ 435 435 spin_lock_irqsave(&lu->tgt->lock, flags); 436 - list_for_each_entry(orb, &lu->orb_list, link) { 436 + list_for_each_entry(iter, &lu->orb_list, link) { 437 437 if (STATUS_GET_ORB_HIGH(status) == 0 && 438 - STATUS_GET_ORB_LOW(status) == orb->request_bus) { 439 - orb->rcode = RCODE_COMPLETE; 440 - list_del(&orb->link); 438 + STATUS_GET_ORB_LOW(status) == iter->request_bus) { 439 + iter->rcode = RCODE_COMPLETE; 440 + list_del(&iter->link); 441 + orb = iter; 441 442 break; 442 443 } 443 444 } 444 445 spin_unlock_irqrestore(&lu->tgt->lock, flags); 445 446 446 - if (&orb->link != &lu->orb_list) { 447 + if (orb) { 447 448 orb->callback(orb, &status); 448 449 kref_put(&orb->kref, free_orb); /* orb callback reference */ 449 450 } else {
+1
sound/firewire/fireworks/fireworks_hwdep.c
··· 34 34 type = SNDRV_FIREWIRE_EVENT_EFW_RESPONSE; 35 35 if (copy_to_user(buf, &type, sizeof(type))) 36 36 return -EFAULT; 37 + count += sizeof(type); 37 38 remained -= sizeof(type); 38 39 buf += sizeof(type); 39 40
+9 -6
sound/pci/hda/patch_realtek.c
··· 8769 8769 [ALC287_FIXUP_CS35L41_I2C_2] = { 8770 8770 .type = HDA_FIXUP_FUNC, 8771 8771 .v.func = cs35l41_fixup_i2c_two, 8772 + .chained = true, 8773 + .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 8772 8774 }, 8773 8775 [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = { 8774 8776 .type = HDA_FIXUP_FUNC, ··· 9025 9023 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), 9026 9024 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 9027 9025 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), 9028 - SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2), 9029 - SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2), 9030 - SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2), 9031 - SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2), 9032 - SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2), 9033 - SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2), 9026 + SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9027 + SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9028 + SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9029 + SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9030 + SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9031 + SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9034 9032 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4), 9035 9033 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2), 9036 9034 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2), ··· 9247 9245 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), 9248 9246 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME), 9249 9247 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS), 9248 + SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 9250 9249 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), 9251 9250 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), 9252 9251 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
+1
sound/soc/atmel/mchp-pdmc.c
··· 966 966 967 967 static struct snd_dmaengine_pcm_config mchp_pdmc_config = { 968 968 .process = mchp_pdmc_process, 969 + .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, 969 970 }; 970 971 971 972 static int mchp_pdmc_probe(struct platform_device *pdev)
+10 -4
sound/soc/codecs/da7219.c
··· 446 446 struct soc_mixer_control *mixer_ctrl = 447 447 (struct soc_mixer_control *) kcontrol->private_value; 448 448 unsigned int reg = mixer_ctrl->reg; 449 - __le16 val; 449 + __le16 val_new, val_old; 450 450 int ret; 451 451 452 452 /* ··· 454 454 * Therefore we need to convert to little endian here to align with 455 455 * HW registers. 456 456 */ 457 - val = cpu_to_le16(ucontrol->value.integer.value[0]); 457 + val_new = cpu_to_le16(ucontrol->value.integer.value[0]); 458 458 459 459 mutex_lock(&da7219->ctrl_lock); 460 - ret = regmap_raw_write(da7219->regmap, reg, &val, sizeof(val)); 460 + ret = regmap_raw_read(da7219->regmap, reg, &val_old, sizeof(val_old)); 461 + if (ret == 0 && (val_old != val_new)) 462 + ret = regmap_raw_write(da7219->regmap, reg, 463 + &val_new, sizeof(val_new)); 461 464 mutex_unlock(&da7219->ctrl_lock); 462 465 463 - return ret; 466 + if (ret < 0) 467 + return ret; 468 + 469 + return val_old != val_new; 464 470 } 465 471 466 472
+4 -1
sound/soc/codecs/max98090.c
··· 413 413 414 414 val = (val >> mc->shift) & mask; 415 415 416 + if (sel < 0 || sel > mc->max) 417 + return -EINVAL; 418 + 416 419 *select = sel; 417 420 418 421 /* Setting a volume is only valid if it is already On */ ··· 430 427 mask << mc->shift, 431 428 sel << mc->shift); 432 429 433 - return 0; 430 + return *select != val; 434 431 } 435 432 436 433 static const char *max98090_perf_pwr_text[] =
-1
sound/soc/codecs/rt9120.c
··· 341 341 { 342 342 switch (reg) { 343 343 case 0x00: 344 - case 0x09: 345 344 case 0x20 ... 0x27: 346 345 return 2; 347 346 case 0x30 ... 0x3D:
+4 -4
sound/soc/codecs/wm8958-dsp2.c
··· 530 530 531 531 wm8958_dsp_apply(component, mbc, wm8994->mbc_ena[mbc]); 532 532 533 - return 0; 533 + return 1; 534 534 } 535 535 536 536 #define WM8958_MBC_SWITCH(xname, xval) {\ ··· 656 656 657 657 wm8958_dsp_apply(component, vss, wm8994->vss_ena[vss]); 658 658 659 - return 0; 659 + return 1; 660 660 } 661 661 662 662 ··· 730 730 731 731 wm8958_dsp_apply(component, hpf % 3, ucontrol->value.integer.value[0]); 732 732 733 - return 0; 733 + return 1; 734 734 } 735 735 736 736 #define WM8958_HPF_SWITCH(xname, xval) {\ ··· 824 824 825 825 wm8958_dsp_apply(component, eq, ucontrol->value.integer.value[0]); 826 826 827 - return 0; 827 + return 1; 828 828 } 829 829 830 830 #define WM8958_ENH_EQ_SWITCH(xname, xval) {\
+1 -1
sound/soc/generic/simple-card-utils.c
··· 322 322 323 323 if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(cpu_dai)) 324 324 snd_soc_dai_set_sysclk(cpu_dai, 325 - 0, 0, SND_SOC_CLOCK_IN); 325 + 0, 0, SND_SOC_CLOCK_OUT); 326 326 327 327 asoc_simple_clk_disable(dai); 328 328 }
+1 -1
sound/soc/meson/aiu-acodec-ctrl.c
··· 58 58 59 59 snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); 60 60 61 - return 0; 61 + return 1; 62 62 } 63 63 64 64 static SOC_ENUM_SINGLE_DECL(aiu_acodec_ctrl_mux_enum, AIU_ACODEC_CTRL,
+1 -1
sound/soc/meson/aiu-codec-ctrl.c
··· 57 57 58 58 snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); 59 59 60 - return 0; 60 + return 1; 61 61 } 62 62 63 63 static SOC_ENUM_SINGLE_DECL(aiu_hdmi_ctrl_mux_enum, AIU_HDMI_CLK_DATA_CTRL,
-1
sound/soc/meson/axg-card.c
··· 320 320 321 321 dai_link->cpus = cpu; 322 322 dai_link->num_cpus = 1; 323 - dai_link->nonatomic = true; 324 323 325 324 ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node, 326 325 &dai_link->cpus->dai_name);
+5 -21
sound/soc/meson/axg-tdm-interface.c
··· 351 351 return 0; 352 352 } 353 353 354 - static int axg_tdm_iface_trigger(struct snd_pcm_substream *substream, 355 - int cmd, 354 + static int axg_tdm_iface_prepare(struct snd_pcm_substream *substream, 356 355 struct snd_soc_dai *dai) 357 356 { 358 - struct axg_tdm_stream *ts = 359 - snd_soc_dai_get_dma_data(dai, substream); 357 + struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream); 360 358 361 - switch (cmd) { 362 - case SNDRV_PCM_TRIGGER_START: 363 - case SNDRV_PCM_TRIGGER_RESUME: 364 - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 365 - axg_tdm_stream_start(ts); 366 - break; 367 - case SNDRV_PCM_TRIGGER_SUSPEND: 368 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 369 - case SNDRV_PCM_TRIGGER_STOP: 370 - axg_tdm_stream_stop(ts); 371 - break; 372 - default: 373 - return -EINVAL; 374 - } 375 - 376 - return 0; 359 + /* Force all attached formatters to update */ 360 + return axg_tdm_stream_reset(ts); 377 361 } 378 362 379 363 static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai) ··· 397 413 .set_fmt = axg_tdm_iface_set_fmt, 398 414 .startup = axg_tdm_iface_startup, 399 415 .hw_params = axg_tdm_iface_hw_params, 416 + .prepare = axg_tdm_iface_prepare, 400 417 .hw_free = axg_tdm_iface_hw_free, 401 - .trigger = axg_tdm_iface_trigger, 402 418 }; 403 419 404 420 /* TDM Backend DAIs */
+1 -1
sound/soc/meson/g12a-tohdmitx.c
··· 67 67 68 68 snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); 69 69 70 - return 0; 70 + return 1; 71 71 } 72 72 73 73 static SOC_ENUM_SINGLE_DECL(g12a_tohdmitx_i2s_mux_enum, TOHDMITX_CTRL0,
+3 -3
sound/soc/soc-generic-dmaengine-pcm.c
··· 86 86 87 87 memset(&slave_config, 0, sizeof(slave_config)); 88 88 89 - if (pcm->config && pcm->config->prepare_slave_config) 90 - prepare_slave_config = pcm->config->prepare_slave_config; 91 - else 89 + if (!pcm->config) 92 90 prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; 91 + else 92 + prepare_slave_config = pcm->config->prepare_slave_config; 93 93 94 94 if (prepare_slave_config) { 95 95 int ret = prepare_slave_config(substream, params, &slave_config);
+18 -2
sound/soc/soc-ops.c
··· 461 461 ret = err; 462 462 } 463 463 } 464 - return err; 464 + return ret; 465 465 } 466 466 EXPORT_SYMBOL_GPL(snd_soc_put_volsw_sx); 467 467 ··· 519 519 unsigned int mask = (1 << fls(max)) - 1; 520 520 unsigned int invert = mc->invert; 521 521 unsigned int val, val_mask; 522 - int err, ret; 522 + int err, ret, tmp; 523 + 524 + tmp = ucontrol->value.integer.value[0]; 525 + if (tmp < 0) 526 + return -EINVAL; 527 + if (mc->platform_max && tmp > mc->platform_max) 528 + return -EINVAL; 529 + if (tmp > mc->max - mc->min + 1) 530 + return -EINVAL; 523 531 524 532 if (invert) 525 533 val = (max - ucontrol->value.integer.value[0]) & mask; ··· 542 534 ret = err; 543 535 544 536 if (snd_soc_volsw_is_stereo(mc)) { 537 + tmp = ucontrol->value.integer.value[1]; 538 + if (tmp < 0) 539 + return -EINVAL; 540 + if (mc->platform_max && tmp > mc->platform_max) 541 + return -EINVAL; 542 + if (tmp > mc->max - mc->min + 1) 543 + return -EINVAL; 544 + 545 545 if (invert) 546 546 val = (max - ucontrol->value.integer.value[1]) & mask; 547 547 else
+5
sound/soc/sof/sof-pci-dev.c
··· 153 153 154 154 dev_dbg(&pci->dev, "PCI DSP detected"); 155 155 156 + if (!desc) { 157 + dev_err(dev, "error: no matching PCI descriptor\n"); 158 + return -ENODEV; 159 + } 160 + 156 161 if (!desc->ops) { 157 162 dev_err(dev, "error: no matching PCI descriptor ops\n"); 158 163 return -ENODEV;