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.

ALSA: riptide: Replace tasklet with threaded irq

The tasklet is an old API that should be deprecated, usually can be
converted to another decent API. In Riptide driver, a tasklet is
still used for offloading the PCM IRQ handling. It can be achieved
gracefully with a threaded IRQ, too.

This patch replaces the tasklet usage in riptide driver with a
threaded IRQ.

Link: https://lore.kernel.org/r/20200903104131.21097-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+11 -9
+11 -9
sound/pci/riptide/riptide.c
··· 445 445 union firmware_version firmware; 446 446 447 447 spinlock_t lock; 448 - struct tasklet_struct riptide_tq; 449 448 struct snd_info_entry *proc_entry; 450 449 451 450 unsigned long received_irqs; ··· 1069 1070 return 0; 1070 1071 } 1071 1072 1072 - static void riptide_handleirq(struct tasklet_struct *t) 1073 + static irqreturn_t riptide_handleirq(int irq, void *dev_id) 1073 1074 { 1074 - struct snd_riptide *chip = from_tasklet(chip, t, riptide_tq); 1075 + struct snd_riptide *chip = dev_id; 1075 1076 struct cmdif *cif = chip->cif; 1076 1077 struct snd_pcm_substream *substream[PLAYBACK_SUBSTREAMS + 1]; 1077 1078 struct snd_pcm_runtime *runtime; ··· 1082 1083 unsigned int flag; 1083 1084 1084 1085 if (!cif) 1085 - return; 1086 + return IRQ_HANDLED; 1086 1087 1087 1088 for (i = 0; i < PLAYBACK_SUBSTREAMS; i++) 1088 1089 substream[i] = chip->playback_substream[i]; ··· 1133 1134 } 1134 1135 } 1135 1136 } 1137 + 1138 + return IRQ_HANDLED; 1136 1139 } 1137 1140 1138 1141 #ifdef CONFIG_PM_SLEEP ··· 1700 1699 { 1701 1700 struct snd_riptide *chip = dev_id; 1702 1701 struct cmdif *cif = chip->cif; 1702 + irqreturn_t ret = IRQ_HANDLED; 1703 1703 1704 1704 if (cif) { 1705 1705 chip->received_irqs++; 1706 1706 if (IS_EOBIRQ(cif->hwport) || IS_EOSIRQ(cif->hwport) || 1707 1707 IS_EOCIRQ(cif->hwport)) { 1708 1708 chip->handled_irqs++; 1709 - tasklet_schedule(&chip->riptide_tq); 1709 + ret = IRQ_WAKE_THREAD; 1710 1710 } 1711 1711 if (chip->rmidi && IS_MPUIRQ(cif->hwport)) { 1712 1712 chip->handled_irqs++; ··· 1716 1714 } 1717 1715 SET_AIACK(cif->hwport); 1718 1716 } 1719 - return IRQ_HANDLED; 1717 + return ret; 1720 1718 } 1721 1719 1722 1720 static void ··· 1845 1843 chip->received_irqs = 0; 1846 1844 chip->handled_irqs = 0; 1847 1845 chip->cif = NULL; 1848 - tasklet_setup(&chip->riptide_tq, riptide_handleirq); 1849 1846 1850 1847 if ((chip->res_port = 1851 1848 request_region(chip->port, 64, "RIPTIDE")) == NULL) { ··· 1857 1856 hwport = (struct riptideport *)chip->port; 1858 1857 UNSET_AIE(hwport); 1859 1858 1860 - if (request_irq(pci->irq, snd_riptide_interrupt, IRQF_SHARED, 1861 - KBUILD_MODNAME, chip)) { 1859 + if (request_threaded_irq(pci->irq, snd_riptide_interrupt, 1860 + riptide_handleirq, IRQF_SHARED, 1861 + KBUILD_MODNAME, chip)) { 1862 1862 snd_printk(KERN_ERR "Riptide: unable to grab IRQ %d\n", 1863 1863 pci->irq); 1864 1864 snd_riptide_free(chip);