* [PATCH] ALSA: hda: intel: Switch to pci_alloc_irq_vectors API
@ 2024-10-31 19:41 Heiner Kallweit
2024-11-01 8:44 ` Takashi Iwai
2024-11-04 13:23 ` Takashi Iwai
0 siblings, 2 replies; 4+ messages in thread
From: Heiner Kallweit @ 2024-10-31 19:41 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai
Cc: linux-sound, Philipp Stanner, Bjorn Helgaas,
linux-pci@vger.kernel.org
Switch from legacy pci_msi_enable()/pci_intx() API to the
pci_alloc_irq_vectors API.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
sound/pci/hda/hda_intel.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 9fc5e6c5d..fc329b6a7 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -773,6 +773,14 @@ static void azx_clear_irq_pending(struct azx *chip)
static int azx_acquire_irq(struct azx *chip, int do_disconnect)
{
struct hdac_bus *bus = azx_bus(chip);
+ int ret;
+
+ if (!chip->msi || pci_alloc_irq_vectors(chip->pci, 1, 1, PCI_IRQ_MSI) < 0) {
+ ret = pci_alloc_irq_vectors(chip->pci, 1, 1, PCI_IRQ_INTX);
+ if (ret < 0)
+ return ret;
+ chip->msi = 0;
+ }
if (request_irq(chip->pci->irq, azx_interrupt,
chip->msi ? 0 : IRQF_SHARED,
@@ -786,7 +794,6 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect)
}
bus->irq = chip->pci->irq;
chip->card->sync_irq = bus->irq;
- pci_intx(chip->pci, !chip->msi);
return 0;
}
@@ -1879,13 +1886,9 @@ static int azx_first_init(struct azx *chip)
chip->gts_present = true;
#endif
- if (chip->msi) {
- if (chip->driver_caps & AZX_DCAPS_NO_MSI64) {
- dev_dbg(card->dev, "Disabling 64bit MSI\n");
- pci->no_64bit_msi = true;
- }
- if (pci_enable_msi(pci) < 0)
- chip->msi = 0;
+ if (chip->msi && chip->driver_caps & AZX_DCAPS_NO_MSI64) {
+ dev_dbg(card->dev, "Disabling 64bit MSI\n");
+ pci->no_64bit_msi = true;
}
pci_set_master(pci);
@@ -2037,7 +2040,7 @@ static int disable_msi_reset_irq(struct azx *chip)
free_irq(bus->irq, chip);
bus->irq = -1;
chip->card->sync_irq = -1;
- pci_disable_msi(chip->pci);
+ pci_free_irq_vectors(chip->pci);
chip->msi = 0;
err = azx_acquire_irq(chip, 1);
if (err < 0)
--
2.47.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ALSA: hda: intel: Switch to pci_alloc_irq_vectors API
2024-10-31 19:41 [PATCH] ALSA: hda: intel: Switch to pci_alloc_irq_vectors API Heiner Kallweit
@ 2024-11-01 8:44 ` Takashi Iwai
2024-11-04 9:30 ` Philipp Stanner
2024-11-04 13:23 ` Takashi Iwai
1 sibling, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2024-11-01 8:44 UTC (permalink / raw)
To: Heiner Kallweit
Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, Philipp Stanner,
Bjorn Helgaas, linux-pci@vger.kernel.org
On Thu, 31 Oct 2024 20:41:12 +0100,
Heiner Kallweit wrote:
>
> Switch from legacy pci_msi_enable()/pci_intx() API to the
> pci_alloc_irq_vectors API.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
So, this change looks conflicting with the pcim_intx() cleanup patch
set from Philipp. I think we can take this one and drop the
corresponding one from Philipp's patch set.
Bjorn, Philipp, does it sound OK?
thanks,
Takashi
> ---
> sound/pci/hda/hda_intel.c | 21 ++++++++++++---------
> 1 file changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 9fc5e6c5d..fc329b6a7 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -773,6 +773,14 @@ static void azx_clear_irq_pending(struct azx *chip)
> static int azx_acquire_irq(struct azx *chip, int do_disconnect)
> {
> struct hdac_bus *bus = azx_bus(chip);
> + int ret;
> +
> + if (!chip->msi || pci_alloc_irq_vectors(chip->pci, 1, 1, PCI_IRQ_MSI) < 0) {
> + ret = pci_alloc_irq_vectors(chip->pci, 1, 1, PCI_IRQ_INTX);
> + if (ret < 0)
> + return ret;
> + chip->msi = 0;
> + }
>
> if (request_irq(chip->pci->irq, azx_interrupt,
> chip->msi ? 0 : IRQF_SHARED,
> @@ -786,7 +794,6 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect)
> }
> bus->irq = chip->pci->irq;
> chip->card->sync_irq = bus->irq;
> - pci_intx(chip->pci, !chip->msi);
> return 0;
> }
>
> @@ -1879,13 +1886,9 @@ static int azx_first_init(struct azx *chip)
> chip->gts_present = true;
> #endif
>
> - if (chip->msi) {
> - if (chip->driver_caps & AZX_DCAPS_NO_MSI64) {
> - dev_dbg(card->dev, "Disabling 64bit MSI\n");
> - pci->no_64bit_msi = true;
> - }
> - if (pci_enable_msi(pci) < 0)
> - chip->msi = 0;
> + if (chip->msi && chip->driver_caps & AZX_DCAPS_NO_MSI64) {
> + dev_dbg(card->dev, "Disabling 64bit MSI\n");
> + pci->no_64bit_msi = true;
> }
>
> pci_set_master(pci);
> @@ -2037,7 +2040,7 @@ static int disable_msi_reset_irq(struct azx *chip)
> free_irq(bus->irq, chip);
> bus->irq = -1;
> chip->card->sync_irq = -1;
> - pci_disable_msi(chip->pci);
> + pci_free_irq_vectors(chip->pci);
> chip->msi = 0;
> err = azx_acquire_irq(chip, 1);
> if (err < 0)
> --
> 2.47.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ALSA: hda: intel: Switch to pci_alloc_irq_vectors API
2024-11-01 8:44 ` Takashi Iwai
@ 2024-11-04 9:30 ` Philipp Stanner
0 siblings, 0 replies; 4+ messages in thread
From: Philipp Stanner @ 2024-11-04 9:30 UTC (permalink / raw)
To: Takashi Iwai, Heiner Kallweit
Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, Bjorn Helgaas,
linux-pci@vger.kernel.org
On Fri, 2024-11-01 at 09:44 +0100, Takashi Iwai wrote:
> On Thu, 31 Oct 2024 20:41:12 +0100,
> Heiner Kallweit wrote:
> >
> > Switch from legacy pci_msi_enable()/pci_intx() API to the
> > pci_alloc_irq_vectors API.
> >
> > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>
> So, this change looks conflicting with the pcim_intx() cleanup patch
> set from Philipp. I think we can take this one and drop the
> corresponding one from Philipp's patch set.
>
> Bjorn, Philipp, does it sound OK?
Yes, that will be trivial to do. I'll just drop my hda_intel patch and
that's it.
Thanks,
P.
>
>
> thanks,
>
> Takashi
>
> > ---
> > sound/pci/hda/hda_intel.c | 21 ++++++++++++---------
> > 1 file changed, 12 insertions(+), 9 deletions(-)
> >
> > diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> > index 9fc5e6c5d..fc329b6a7 100644
> > --- a/sound/pci/hda/hda_intel.c
> > +++ b/sound/pci/hda/hda_intel.c
> > @@ -773,6 +773,14 @@ static void azx_clear_irq_pending(struct azx
> > *chip)
> > static int azx_acquire_irq(struct azx *chip, int do_disconnect)
> > {
> > struct hdac_bus *bus = azx_bus(chip);
> > + int ret;
> > +
> > + if (!chip->msi || pci_alloc_irq_vectors(chip->pci, 1, 1,
> > PCI_IRQ_MSI) < 0) {
> > + ret = pci_alloc_irq_vectors(chip->pci, 1, 1,
> > PCI_IRQ_INTX);
> > + if (ret < 0)
> > + return ret;
> > + chip->msi = 0;
> > + }
> >
> > if (request_irq(chip->pci->irq, azx_interrupt,
> > chip->msi ? 0 : IRQF_SHARED,
> > @@ -786,7 +794,6 @@ static int azx_acquire_irq(struct azx *chip,
> > int do_disconnect)
> > }
> > bus->irq = chip->pci->irq;
> > chip->card->sync_irq = bus->irq;
> > - pci_intx(chip->pci, !chip->msi);
> > return 0;
> > }
> >
> > @@ -1879,13 +1886,9 @@ static int azx_first_init(struct azx *chip)
> > chip->gts_present = true;
> > #endif
> >
> > - if (chip->msi) {
> > - if (chip->driver_caps & AZX_DCAPS_NO_MSI64) {
> > - dev_dbg(card->dev, "Disabling 64bit
> > MSI\n");
> > - pci->no_64bit_msi = true;
> > - }
> > - if (pci_enable_msi(pci) < 0)
> > - chip->msi = 0;
> > + if (chip->msi && chip->driver_caps & AZX_DCAPS_NO_MSI64) {
> > + dev_dbg(card->dev, "Disabling 64bit MSI\n");
> > + pci->no_64bit_msi = true;
> > }
> >
> > pci_set_master(pci);
> > @@ -2037,7 +2040,7 @@ static int disable_msi_reset_irq(struct azx
> > *chip)
> > free_irq(bus->irq, chip);
> > bus->irq = -1;
> > chip->card->sync_irq = -1;
> > - pci_disable_msi(chip->pci);
> > + pci_free_irq_vectors(chip->pci);
> > chip->msi = 0;
> > err = azx_acquire_irq(chip, 1);
> > if (err < 0)
> > --
> > 2.47.0
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ALSA: hda: intel: Switch to pci_alloc_irq_vectors API
2024-10-31 19:41 [PATCH] ALSA: hda: intel: Switch to pci_alloc_irq_vectors API Heiner Kallweit
2024-11-01 8:44 ` Takashi Iwai
@ 2024-11-04 13:23 ` Takashi Iwai
1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2024-11-04 13:23 UTC (permalink / raw)
To: Heiner Kallweit
Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, Philipp Stanner,
Bjorn Helgaas, linux-pci@vger.kernel.org
On Thu, 31 Oct 2024 20:41:12 +0100,
Heiner Kallweit wrote:
>
> Switch from legacy pci_msi_enable()/pci_intx() API to the
> pci_alloc_irq_vectors API.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Applied to for-next branch now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-04 13:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-31 19:41 [PATCH] ALSA: hda: intel: Switch to pci_alloc_irq_vectors API Heiner Kallweit
2024-11-01 8:44 ` Takashi Iwai
2024-11-04 9:30 ` Philipp Stanner
2024-11-04 13:23 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox