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

Pull sound fixes from Takashi Iwai:
"Most of changes in this pull request are about the fixes of crash of
FireWire drivers at hot-unplugging. In addition, there are a few
HD-audio fixes (removal of wrong static, a pin quirk for an ASUS mobo,
a regression fix for runtime PM on Panther Point) and a long-standing
(but fairly minor) bug of PCM core"

* tag 'sound-4.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Disable runtime PM for Panther Point again
ALSA: hda: controller code - do not export static functions
ALSA: pcm: Don't leave PREPARED state after draining
ALSA: fireworks/bebob/dice/oxfw: make it possible to shutdown safely
ALSA: fireworks/bebob/dice/oxfw: allow stream destructor after releasing runtime
ALSA: firewire-lib: remove reference counting
ALSA: fireworks/bebob/dice/oxfw: add reference-counting for FireWire unit
ALSA: hda - Add pin configs for ASUS mobo with IDT 92HD73XX codec
ALSA: firewire-lib: fix an unexpected byte sequence for micro sign

+106 -61
+2
sound/core/pcm_native.c
··· 1552 1552 if (! snd_pcm_playback_empty(substream)) { 1553 1553 snd_pcm_do_start(substream, SNDRV_PCM_STATE_DRAINING); 1554 1554 snd_pcm_post_start(substream, SNDRV_PCM_STATE_DRAINING); 1555 + } else { 1556 + runtime->status->state = SNDRV_PCM_STATE_SETUP; 1555 1557 } 1556 1558 break; 1557 1559 case SNDRV_PCM_STATE_RUNNING:
+2 -3
sound/firewire/amdtp.c
··· 33 33 */ 34 34 #define MAX_MIDI_RX_BLOCKS 8 35 35 36 - #define TRANSFER_DELAY_TICKS 0x2e00 /* 479.17 µs */ 36 + #define TRANSFER_DELAY_TICKS 0x2e00 /* 479.17 microseconds */ 37 37 38 38 /* isochronous header parameters */ 39 39 #define ISO_DATA_LENGTH_SHIFT 16 ··· 78 78 int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit, 79 79 enum amdtp_stream_direction dir, enum cip_flags flags) 80 80 { 81 - s->unit = fw_unit_get(unit); 81 + s->unit = unit; 82 82 s->direction = dir; 83 83 s->flags = flags; 84 84 s->context = ERR_PTR(-1); ··· 102 102 { 103 103 WARN_ON(amdtp_stream_running(s)); 104 104 mutex_destroy(&s->mutex); 105 - fw_unit_put(s->unit); 106 105 } 107 106 EXPORT_SYMBOL(amdtp_stream_destroy); 108 107
+16 -4
sound/firewire/bebob/bebob.c
··· 116 116 return err; 117 117 } 118 118 119 + /* 120 + * This module releases the FireWire unit data after all ALSA character devices 121 + * are released by applications. This is for releasing stream data or finishing 122 + * transactions safely. Thus at returning from .remove(), this module still keep 123 + * references for the unit. 124 + */ 119 125 static void 120 126 bebob_card_free(struct snd_card *card) 121 127 { 122 128 struct snd_bebob *bebob = card->private_data; 129 + 130 + snd_bebob_stream_destroy_duplex(bebob); 131 + fw_unit_put(bebob->unit); 132 + 133 + kfree(bebob->maudio_special_quirk); 123 134 124 135 if (bebob->card_index >= 0) { 125 136 mutex_lock(&devices_mutex); ··· 216 205 card->private_free = bebob_card_free; 217 206 218 207 bebob->card = card; 219 - bebob->unit = unit; 208 + bebob->unit = fw_unit_get(unit); 220 209 bebob->spec = spec; 221 210 mutex_init(&bebob->mutex); 222 211 spin_lock_init(&bebob->lock); ··· 317 306 if (bebob == NULL) 318 307 return; 319 308 320 - kfree(bebob->maudio_special_quirk); 309 + /* Awake bus-reset waiters. */ 310 + if (!completion_done(&bebob->bus_reset)) 311 + complete_all(&bebob->bus_reset); 321 312 322 - snd_bebob_stream_destroy_duplex(bebob); 323 - snd_card_disconnect(bebob->card); 313 + /* No need to wait for releasing card object in this context. */ 324 314 snd_card_free_when_closed(bebob->card); 325 315 } 326 316
+4 -12
sound/firewire/bebob/bebob_stream.c
··· 410 410 static void 411 411 destroy_both_connections(struct snd_bebob *bebob) 412 412 { 413 - break_both_connections(bebob); 414 - 415 413 cmp_connection_destroy(&bebob->in_conn); 416 414 cmp_connection_destroy(&bebob->out_conn); 417 415 } ··· 710 712 mutex_unlock(&bebob->mutex); 711 713 } 712 714 715 + /* 716 + * This function should be called before starting streams or after stopping 717 + * streams. 718 + */ 713 719 void snd_bebob_stream_destroy_duplex(struct snd_bebob *bebob) 714 720 { 715 - mutex_lock(&bebob->mutex); 716 - 717 - amdtp_stream_pcm_abort(&bebob->rx_stream); 718 - amdtp_stream_pcm_abort(&bebob->tx_stream); 719 - 720 - amdtp_stream_stop(&bebob->rx_stream); 721 - amdtp_stream_stop(&bebob->tx_stream); 722 - 723 721 amdtp_stream_destroy(&bebob->rx_stream); 724 722 amdtp_stream_destroy(&bebob->tx_stream); 725 723 726 724 destroy_both_connections(bebob); 727 - 728 - mutex_unlock(&bebob->mutex); 729 725 } 730 726 731 727 /*
+12 -6
sound/firewire/dice/dice-stream.c
··· 311 311 return err; 312 312 } 313 313 314 + /* 315 + * This function should be called before starting streams or after stopping 316 + * streams. 317 + */ 314 318 static void destroy_stream(struct snd_dice *dice, struct amdtp_stream *stream) 315 319 { 316 - amdtp_stream_destroy(stream); 320 + struct fw_iso_resources *resources; 317 321 318 322 if (stream == &dice->tx_stream) 319 - fw_iso_resources_destroy(&dice->tx_resources); 323 + resources = &dice->tx_resources; 320 324 else 321 - fw_iso_resources_destroy(&dice->rx_resources); 325 + resources = &dice->rx_resources; 326 + 327 + amdtp_stream_destroy(stream); 328 + fw_iso_resources_destroy(resources); 322 329 } 323 330 324 331 int snd_dice_stream_init_duplex(struct snd_dice *dice) ··· 339 332 goto end; 340 333 341 334 err = init_stream(dice, &dice->rx_stream); 335 + if (err < 0) 336 + destroy_stream(dice, &dice->tx_stream); 342 337 end: 343 338 return err; 344 339 } ··· 349 340 { 350 341 snd_dice_transaction_clear_enable(dice); 351 342 352 - stop_stream(dice, &dice->tx_stream); 353 343 destroy_stream(dice, &dice->tx_stream); 354 - 355 - stop_stream(dice, &dice->rx_stream); 356 344 destroy_stream(dice, &dice->rx_stream); 357 345 358 346 dice->substreams_counter = 0;
+11 -5
sound/firewire/dice/dice.c
··· 226 226 strcpy(card->mixername, "DICE"); 227 227 } 228 228 229 + /* 230 + * This module releases the FireWire unit data after all ALSA character devices 231 + * are released by applications. This is for releasing stream data or finishing 232 + * transactions safely. Thus at returning from .remove(), this module still keep 233 + * references for the unit. 234 + */ 229 235 static void dice_card_free(struct snd_card *card) 230 236 { 231 237 struct snd_dice *dice = card->private_data; 232 238 239 + snd_dice_stream_destroy_duplex(dice); 233 240 snd_dice_transaction_destroy(dice); 241 + fw_unit_put(dice->unit); 242 + 234 243 mutex_destroy(&dice->mutex); 235 244 } 236 245 ··· 260 251 261 252 dice = card->private_data; 262 253 dice->card = card; 263 - dice->unit = unit; 254 + dice->unit = fw_unit_get(unit); 264 255 card->private_free = dice_card_free; 265 256 266 257 spin_lock_init(&dice->lock); ··· 314 305 { 315 306 struct snd_dice *dice = dev_get_drvdata(&unit->device); 316 307 317 - snd_card_disconnect(dice->card); 318 - 319 - snd_dice_stream_destroy_duplex(dice); 320 - 308 + /* No need to wait for releasing card object in this context. */ 321 309 snd_card_free_when_closed(dice->card); 322 310 } 323 311
+14 -6
sound/firewire/fireworks/fireworks.c
··· 173 173 return err; 174 174 } 175 175 176 + /* 177 + * This module releases the FireWire unit data after all ALSA character devices 178 + * are released by applications. This is for releasing stream data or finishing 179 + * transactions safely. Thus at returning from .remove(), this module still keep 180 + * references for the unit. 181 + */ 176 182 static void 177 183 efw_card_free(struct snd_card *card) 178 184 { 179 185 struct snd_efw *efw = card->private_data; 186 + 187 + snd_efw_stream_destroy_duplex(efw); 188 + snd_efw_transaction_remove_instance(efw); 189 + fw_unit_put(efw->unit); 190 + 191 + kfree(efw->resp_buf); 180 192 181 193 if (efw->card_index >= 0) { 182 194 mutex_lock(&devices_mutex); ··· 197 185 } 198 186 199 187 mutex_destroy(&efw->mutex); 200 - kfree(efw->resp_buf); 201 188 } 202 189 203 190 static int ··· 229 218 card->private_free = efw_card_free; 230 219 231 220 efw->card = card; 232 - efw->unit = unit; 221 + efw->unit = fw_unit_get(unit); 233 222 mutex_init(&efw->mutex); 234 223 spin_lock_init(&efw->lock); 235 224 init_waitqueue_head(&efw->hwdep_wait); ··· 300 289 { 301 290 struct snd_efw *efw = dev_get_drvdata(&unit->device); 302 291 303 - snd_efw_stream_destroy_duplex(efw); 304 - snd_efw_transaction_remove_instance(efw); 305 - 306 - snd_card_disconnect(efw->card); 292 + /* No need to wait for releasing card object in this context. */ 307 293 snd_card_free_when_closed(efw->card); 308 294 } 309 295
+10 -9
sound/firewire/fireworks/fireworks_stream.c
··· 100 100 return err; 101 101 } 102 102 103 + /* 104 + * This function should be called before starting the stream or after stopping 105 + * the streams. 106 + */ 103 107 static void 104 108 destroy_stream(struct snd_efw *efw, struct amdtp_stream *stream) 105 109 { 106 - stop_stream(efw, stream); 107 - 108 - amdtp_stream_destroy(stream); 110 + struct cmp_connection *conn; 109 111 110 112 if (stream == &efw->tx_stream) 111 - cmp_connection_destroy(&efw->out_conn); 113 + conn = &efw->out_conn; 112 114 else 113 - cmp_connection_destroy(&efw->in_conn); 115 + conn = &efw->in_conn; 116 + 117 + amdtp_stream_destroy(stream); 118 + cmp_connection_destroy(&efw->out_conn); 114 119 } 115 120 116 121 static int ··· 324 319 325 320 void snd_efw_stream_destroy_duplex(struct snd_efw *efw) 326 321 { 327 - mutex_lock(&efw->mutex); 328 - 329 322 destroy_stream(efw, &efw->rx_stream); 330 323 destroy_stream(efw, &efw->tx_stream); 331 - 332 - mutex_unlock(&efw->mutex); 333 324 } 334 325 335 326 void snd_efw_stream_lock_changed(struct snd_efw *efw)
+4 -2
sound/firewire/oxfw/oxfw-stream.c
··· 337 337 stop_stream(oxfw, stream); 338 338 } 339 339 340 + /* 341 + * This function should be called before starting the stream or after stopping 342 + * the streams. 343 + */ 340 344 void snd_oxfw_stream_destroy_simplex(struct snd_oxfw *oxfw, 341 345 struct amdtp_stream *stream) 342 346 { ··· 350 346 conn = &oxfw->out_conn; 351 347 else 352 348 conn = &oxfw->in_conn; 353 - 354 - stop_stream(oxfw, stream); 355 349 356 350 amdtp_stream_destroy(stream); 357 351 cmp_connection_destroy(conn);
+14 -7
sound/firewire/oxfw/oxfw.c
··· 104 104 return err; 105 105 } 106 106 107 + /* 108 + * This module releases the FireWire unit data after all ALSA character devices 109 + * are released by applications. This is for releasing stream data or finishing 110 + * transactions safely. Thus at returning from .remove(), this module still keep 111 + * references for the unit. 112 + */ 107 113 static void oxfw_card_free(struct snd_card *card) 108 114 { 109 115 struct snd_oxfw *oxfw = card->private_data; 110 116 unsigned int i; 117 + 118 + snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->rx_stream); 119 + if (oxfw->has_output) 120 + snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream); 121 + 122 + fw_unit_put(oxfw->unit); 111 123 112 124 for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; i++) { 113 125 kfree(oxfw->tx_stream_formats[i]); ··· 148 136 oxfw = card->private_data; 149 137 oxfw->card = card; 150 138 mutex_init(&oxfw->mutex); 151 - oxfw->unit = unit; 139 + oxfw->unit = fw_unit_get(unit); 152 140 oxfw->device_info = (const struct device_info *)id->driver_data; 153 141 spin_lock_init(&oxfw->lock); 154 142 init_waitqueue_head(&oxfw->hwdep_wait); ··· 224 212 { 225 213 struct snd_oxfw *oxfw = dev_get_drvdata(&unit->device); 226 214 227 - snd_card_disconnect(oxfw->card); 228 - 229 - snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->rx_stream); 230 - if (oxfw->has_output) 231 - snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream); 232 - 215 + /* No need to wait for releasing card object in this context. */ 233 216 snd_card_free_when_closed(oxfw->card); 234 217 } 235 218
-5
sound/pci/hda/hda_controller.c
··· 961 961 dev_err(chip->card->dev, "cannot allocate CORB/RIRB\n"); 962 962 return err; 963 963 } 964 - EXPORT_SYMBOL_GPL(azx_alloc_cmd_io); 965 964 966 965 static void azx_init_cmd_io(struct azx *chip) 967 966 { ··· 1025 1026 azx_writeb(chip, RIRBCTL, AZX_RBCTL_DMA_EN | AZX_RBCTL_IRQ_EN); 1026 1027 spin_unlock_irq(&chip->reg_lock); 1027 1028 } 1028 - EXPORT_SYMBOL_GPL(azx_init_cmd_io); 1029 1029 1030 1030 static void azx_free_cmd_io(struct azx *chip) 1031 1031 { ··· 1034 1036 azx_writeb(chip, CORBCTL, 0); 1035 1037 spin_unlock_irq(&chip->reg_lock); 1036 1038 } 1037 - EXPORT_SYMBOL_GPL(azx_free_cmd_io); 1038 1039 1039 1040 static unsigned int azx_command_addr(u32 cmd) 1040 1041 { ··· 1313 1316 else 1314 1317 return azx_corb_send_cmd(bus, val); 1315 1318 } 1316 - EXPORT_SYMBOL_GPL(azx_send_cmd); 1317 1319 1318 1320 /* get a response */ 1319 1321 static unsigned int azx_get_response(struct hda_bus *bus, ··· 1326 1330 else 1327 1331 return azx_rirb_get_response(bus, addr); 1328 1332 } 1329 - EXPORT_SYMBOL_GPL(azx_get_response); 1330 1333 1331 1334 #ifdef CONFIG_SND_HDA_DSP_LOADER 1332 1335 /*
+1 -1
sound/pci/hda/hda_intel.c
··· 1966 1966 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM }, 1967 1967 /* Panther Point */ 1968 1968 { PCI_DEVICE(0x8086, 0x1e20), 1969 - .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH }, 1969 + .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH_NOPM }, 1970 1970 /* Lynx Point */ 1971 1971 { PCI_DEVICE(0x8086, 0x8c20), 1972 1972 .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_PCH },
+16 -1
sound/pci/hda/patch_sigmatel.c
··· 79 79 STAC_ALIENWARE_M17X, 80 80 STAC_92HD89XX_HP_FRONT_JACK, 81 81 STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK, 82 + STAC_92HD73XX_ASUS_MOBO, 82 83 STAC_92HD73XX_MODELS 83 84 }; 84 85 ··· 1912 1911 [STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK] = { 1913 1912 .type = HDA_FIXUP_PINS, 1914 1913 .v.pins = stac92hd89xx_hp_z1_g2_right_mic_jack_pin_configs, 1915 - } 1914 + }, 1915 + [STAC_92HD73XX_ASUS_MOBO] = { 1916 + .type = HDA_FIXUP_PINS, 1917 + .v.pins = (const struct hda_pintbl[]) { 1918 + /* enable 5.1 and SPDIF out */ 1919 + { 0x0c, 0x01014411 }, 1920 + { 0x0d, 0x01014410 }, 1921 + { 0x0e, 0x01014412 }, 1922 + { 0x22, 0x014b1180 }, 1923 + { } 1924 + } 1925 + }, 1916 1926 }; 1917 1927 1918 1928 static const struct hda_model_fixup stac92hd73xx_models[] = { ··· 1935 1923 { .id = STAC_DELL_M6_BOTH, .name = "dell-m6" }, 1936 1924 { .id = STAC_DELL_EQ, .name = "dell-eq" }, 1937 1925 { .id = STAC_ALIENWARE_M17X, .name = "alienware" }, 1926 + { .id = STAC_92HD73XX_ASUS_MOBO, .name = "asus-mobo" }, 1938 1927 {} 1939 1928 }; 1940 1929 ··· 1988 1975 "HP Z1 G2", STAC_92HD89XX_HP_Z1_G2_RIGHT_MIC_JACK), 1989 1976 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x2b17, 1990 1977 "unknown HP", STAC_92HD89XX_HP_FRONT_JACK), 1978 + SND_PCI_QUIRK(PCI_VENDOR_ID_ASUSTEK, 0x83f8, "ASUS AT4NM10", 1979 + STAC_92HD73XX_ASUS_MOBO), 1991 1980 {} /* terminator */ 1992 1981 }; 1993 1982