ASoC: SOF: Intel: hda: fix MSI handling
The addition of a kernel module parameter to optionally disable MSI
had the side effect of permanently disabling it.
The return value of pci_alloc_irq_vectors() is the number of allocated
vectors or a negative number on error, so testing with the ! operator
is not quite right. It was one optimization too far.
Restore previous behavior to use MSI by default, unless the user
selects not to do so or the allocation of irq_vectors fails.
Fixes: 672ff5e359
('ASoC: SOF: Intel: hda: add a parameter to disable MSI')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190806170603.10815-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
0922c7a51c
commit
bb67dd1878
|
@ -537,7 +537,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
|
||||||
* if it fails, use legacy interrupt mode
|
* if it fails, use legacy interrupt mode
|
||||||
* TODO: support msi multiple vectors
|
* TODO: support msi multiple vectors
|
||||||
*/
|
*/
|
||||||
if (hda_use_msi && !pci_alloc_irq_vectors(pci, 1, 1, PCI_IRQ_MSI)) {
|
if (hda_use_msi && pci_alloc_irq_vectors(pci, 1, 1, PCI_IRQ_MSI) > 0) {
|
||||||
dev_info(sdev->dev, "use msi interrupt mode\n");
|
dev_info(sdev->dev, "use msi interrupt mode\n");
|
||||||
hdev->irq = pci_irq_vector(pci, 0);
|
hdev->irq = pci_irq_vector(pci, 0);
|
||||||
/* ipc irq number is the same of hda irq */
|
/* ipc irq number is the same of hda irq */
|
||||||
|
|
Loading…
Reference in New Issue