Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2818d0d7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "Most of the commits are trivial cleanup patches, while one commit is a
  significant fix for the race at ALSA sequencer that was spotted by
  syzkaller"

* tag 'sound-fix-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: seq: Cancel pending autoload work at unbinding device
  ALSA: firewire: Use common error handling code in snd_motu_stream_start_duplex()
  ALSA: asihpi: Kill BUG_ON() usages
  ALSA: core: Use %pS printk format for direct addresses
  ALSA: ymfpci: Use common error handling code in snd_ymfpci_create()
  ALSA: ymfpci: Use common error handling code in snd_card_ymfpci_probe()
  ALSA: 6fire: Use common error handling code in usb6fire_chip_probe()
  ALSA: usx2y: Use common error handling code in submit_urbs()
  ALSA: us122l: Use common error handling code in us122l_create_card()
  ALSA: hdspm: Use common error handling code in snd_hdspm_probe()
  ALSA: rme9652: Use common code in hdsp_get_iobox_version()
  ALSA: maestro3: Use common error handling code in two functions
parents cc4238bd fc27fe7e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ void snd_device_disconnect(struct snd_card *card, void *device_data)
	if (dev)
		__snd_device_disconnect(dev);
	else
		dev_dbg(card->dev, "device disconnect %p (from %pF), not found\n",
		dev_dbg(card->dev, "device disconnect %p (from %pS), not found\n",
			device_data, __builtin_return_address(0));
}
EXPORT_SYMBOL_GPL(snd_device_disconnect);
@@ -152,7 +152,7 @@ void snd_device_free(struct snd_card *card, void *device_data)
	if (dev)
		__snd_device_free(dev);
	else
		dev_dbg(card->dev, "device free %p (from %pF), not found\n",
		dev_dbg(card->dev, "device free %p (from %pS), not found\n",
			device_data, __builtin_return_address(0));
}
EXPORT_SYMBOL(snd_device_free);
+3 −0
Original line number Diff line number Diff line
@@ -148,8 +148,10 @@ void snd_seq_device_load_drivers(void)
	flush_work(&autoload_work);
}
EXPORT_SYMBOL(snd_seq_device_load_drivers);
#define cancel_autoload_drivers()	cancel_work_sync(&autoload_work)
#else
#define queue_autoload_drivers() /* NOP */
#define cancel_autoload_drivers() /* NOP */
#endif

/*
@@ -159,6 +161,7 @@ static int snd_seq_device_dev_free(struct snd_device *device)
{
	struct snd_seq_device *dev = device->device_data;

	cancel_autoload_drivers();
	put_device(&dev->dev);
	return 0;
}
+8 −8
Original line number Diff line number Diff line
@@ -253,24 +253,21 @@ int snd_motu_stream_start_duplex(struct snd_motu *motu, unsigned int rate)
		if (err < 0) {
			dev_err(&motu->unit->device,
				"fail to start isochronous comm: %d\n", err);
			stop_both_streams(motu);
			return err;
			goto stop_streams;
		}

		err = start_isoc_ctx(motu, &motu->rx_stream);
		if (err < 0) {
			dev_err(&motu->unit->device,
				"fail to start IT context: %d\n", err);
			stop_both_streams(motu);
			return err;
			goto stop_streams;
		}

		err = protocol->switch_fetching_mode(motu, true);
		if (err < 0) {
			dev_err(&motu->unit->device,
				"fail to enable frame fetching: %d\n", err);
			stop_both_streams(motu);
			return err;
			goto stop_streams;
		}
	}

@@ -281,12 +278,15 @@ int snd_motu_stream_start_duplex(struct snd_motu *motu, unsigned int rate)
			dev_err(&motu->unit->device,
				"fail to start IR context: %d", err);
			amdtp_stream_stop(&motu->rx_stream);
			stop_both_streams(motu);
			return err;
			goto stop_streams;
		}
	}

	return 0;

stop_streams:
	stop_both_streams(motu);
	return err;
}

void snd_motu_stream_stop_duplex(struct snd_motu *motu)
+1 −5
Original line number Diff line number Diff line
@@ -558,12 +558,10 @@ static void snd_card_asihpi_pcm_int_start(struct snd_pcm_substream *substream)
	struct snd_card_asihpi_pcm *dpcm;
	struct snd_card_asihpi *card;

	BUG_ON(!substream);

	dpcm = (struct snd_card_asihpi_pcm *)substream->runtime->private_data;
	card = snd_pcm_substream_chip(substream);

	BUG_ON(in_interrupt());
	WARN_ON(in_interrupt());
	tasklet_disable(&card->t);
	card->llmode_streampriv = dpcm;
	tasklet_enable(&card->t);
@@ -578,8 +576,6 @@ static void snd_card_asihpi_pcm_int_stop(struct snd_pcm_substream *substream)
	struct snd_card_asihpi_pcm *dpcm;
	struct snd_card_asihpi *card;

	BUG_ON(!substream);

	dpcm = (struct snd_card_asihpi_pcm *)substream->runtime->private_data;
	card = snd_pcm_substream_chip(substream);

+28 −29
Original line number Diff line number Diff line
@@ -2622,22 +2622,18 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,

	err = request_firmware(&chip->assp_kernel_image,
			       "ess/maestro3_assp_kernel.fw", &pci->dev);
	if (err < 0) {
		snd_m3_free(chip);
		return err;
	}
	if (err < 0)
		goto free_chip;

	err = request_firmware(&chip->assp_minisrc_image,
			       "ess/maestro3_assp_minisrc.fw", &pci->dev);
	if (err < 0) {
		snd_m3_free(chip);
		return err;
	}
	if (err < 0)
		goto free_chip;

	err = pci_request_regions(pci, card->driver);
	if (err < 0)
		goto free_chip;

	if ((err = pci_request_regions(pci, card->driver)) < 0) {
		snd_m3_free(chip);
		return err;
	}
	chip->iobase = pci_resource_start(pci, 0);
	
	/* just to be sure */
@@ -2655,8 +2651,8 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
	if (request_irq(pci->irq, snd_m3_interrupt, IRQF_SHARED,
			KBUILD_MODNAME, chip)) {
		dev_err(card->dev, "unable to grab IRQ %d\n", pci->irq);
		snd_m3_free(chip);
		return -ENOMEM;
		err = -ENOMEM;
		goto free_chip;
	}
	chip->irq = pci->irq;

@@ -2666,10 +2662,9 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
		dev_warn(card->dev, "can't allocate apm buffer\n");
#endif

	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
		snd_m3_free(chip);
		return err;
	}
	err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
	if (err < 0)
		goto free_chip;

	if ((err = snd_m3_mixer(chip)) < 0)
		return err;
@@ -2699,6 +2694,10 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
	*chip_ret = chip;

	return 0; 

free_chip:
	snd_m3_free(chip);
	return err;
}

/*
@@ -2741,23 +2740,19 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
		break;
	}

	if ((err = snd_m3_create(card, pci,
				 external_amp[dev],
				 amp_gpio[dev],
				 &chip)) < 0) {
		snd_card_free(card);
		return err;
	}
	err = snd_m3_create(card, pci, external_amp[dev], amp_gpio[dev], &chip);
	if (err < 0)
		goto free_card;

	card->private_data = chip;

	sprintf(card->shortname, "ESS %s PCI", card->driver);
	sprintf(card->longname, "%s at 0x%lx, irq %d",
		card->shortname, chip->iobase, chip->irq);

	if ((err = snd_card_register(card)) < 0) {
		snd_card_free(card);
		return err;
	}
	err = snd_card_register(card);
	if (err < 0)
		goto free_card;

#if 0 /* TODO: not supported yet */
	/* TODO enable MIDI IRQ and I/O */
@@ -2772,6 +2767,10 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
	pci_set_drvdata(pci, card);
	dev++;
	return 0;

free_card:
	snd_card_free(card);
	return err;
}

static void snd_m3_remove(struct pci_dev *pci)
Loading