diff mbox

[v3,4/7] sound/radeon: Add quirk for broken 64-bit MSI

Message ID 1412656696.30859.122.camel@pasglop (mailing list archive)
State Superseded
Delegated to: Benjamin Herrenschmidt
Headers show

Commit Message

Benjamin Herrenschmidt Oct. 7, 2014, 4:38 a.m. UTC
From: Signed-off-by: Alex Deucher <alexdeucher@gmail.com>

A number of radeon cards have a HW limitation causing them to be
unable to generate the full 64-bit of address bits for MSIs. This
breaks MSIs on some platforms such as POWER machines.

We used to have a powerpc specific quirk to address that on a
single card, but this doesn't scale very well, this is better
put under control of the drivers who know precisely what a given
HW revision can do.

This moves the setting of the quirk flag to the audio driver.

While recent ASICs have that problem fixed, they don't seem to
be listed in the PCI IDs of the current driver, so let's quirk all
the ATI HDMI for now. The consequences are nil on x86 anyway.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: <stable@vger.kernel.org>
---
 sound/pci/hda/hda_intel.c | 96 +++++++++++++++++++++++++++++++++--------------
 sound/pci/hda/hda_priv.h  |  1 +
 2 files changed, 69 insertions(+), 28 deletions(-)

Comments

Alex Deucher Oct. 7, 2014, 11:47 p.m. UTC | #1
On Tue, Oct 7, 2014 at 12:38 AM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> From: Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
>
> A number of radeon cards have a HW limitation causing them to be
> unable to generate the full 64-bit of address bits for MSIs. This
> breaks MSIs on some platforms such as POWER machines.
>
> We used to have a powerpc specific quirk to address that on a
> single card, but this doesn't scale very well, this is better
> put under control of the drivers who know precisely what a given
> HW revision can do.
>
> This moves the setting of the quirk flag to the audio driver.
>
> While recent ASICs have that problem fixed, they don't seem to
> be listed in the PCI IDs of the current driver, so let's quirk all
> the ATI HDMI for now. The consequences are nil on x86 anyway.
>
> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: <stable@vger.kernel.org>

Further discussion with the hw teams have revealed that this is still
an issue on newer asics so I think your original patch is correct
after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.

Alex

> ---
>  sound/pci/hda/hda_intel.c | 96 +++++++++++++++++++++++++++++++++--------------
>  sound/pci/hda/hda_priv.h  |  1 +
>  2 files changed, 69 insertions(+), 28 deletions(-)
>
> diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> index 99b367b..af38ed9 100644
> --- a/sound/pci/hda/hda_intel.c
> +++ b/sound/pci/hda/hda_intel.c
> @@ -1506,9 +1506,14 @@ static int azx_first_init(struct azx *chip)
>                 return -ENXIO;
>         }
>
> -       if (chip->msi)
> +       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 (azx_acquire_irq(chip, 0) < 0)
>                 return -EBUSY;
> @@ -2070,58 +2075,93 @@ static const struct pci_device_id azx_ids[] = {
>         { PCI_DEVICE(0x1022, 0x780d),
>           .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB },
>         /* ATI HDMI */
> -       { PCI_DEVICE(0x1002, 0x793b),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +       { PCI_DEVICE(0x1002, 0x1314),
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0x7919),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
> +       { PCI_DEVICE(0x1002, 0x7969),
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
> +       { PCI_DEVICE(0x1002, 0x793b),
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0x960f),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
> +       { PCI_DEVICE(0x1002, 0x9646),
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0x970f),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa00),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa08),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa10),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa18),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa20),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa28),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa30),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa38),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa40),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa48),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa50),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa58),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa60),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa68),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa80),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa88),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa90),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaa98),
> -         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0x9902),
> -         .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaaa0),
> -         .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaaa8),
> -         .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         { PCI_DEVICE(0x1002, 0xaab0),
> -         .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI },
> +         .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI |
> +         AZX_DCAPS_NO_MSI64 },
>         /* VIA VT8251/VT8237A */
>         { PCI_DEVICE(0x1106, 0x3288),
>           .driver_data = AZX_DRIVER_VIA | AZX_DCAPS_POSFIX_VIA },
> diff --git a/sound/pci/hda/hda_priv.h b/sound/pci/hda/hda_priv.h
> index 949cd43..5016014 100644
> --- a/sound/pci/hda/hda_priv.h
> +++ b/sound/pci/hda/hda_priv.h
> @@ -171,6 +171,7 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
>  #define AZX_DCAPS_PM_RUNTIME   (1 << 26)       /* runtime PM support */
>  #define AZX_DCAPS_I915_POWERWELL (1 << 27)     /* HSW i915 powerwell support */
>  #define AZX_DCAPS_CORBRP_SELF_CLEAR (1 << 28)  /* CORBRP clears itself after reset */
> +#define AZX_DCAPS_NO_MSI64      (1 << 29)      /* Stick to 32-bit MSIs */
>
>  /* HD Audio class code */
>  #define PCI_CLASS_MULTIMEDIA_HD_AUDIO  0x0403
>
>
Benjamin Herrenschmidt Oct. 7, 2014, 11:49 p.m. UTC | #2
On Tue, 2014-10-07 at 19:47 -0400, Alex Deucher wrote:
> > While recent ASICs have that problem fixed, they don't seem to
> > be listed in the PCI IDs of the current driver, so let's quirk all
> > the ATI HDMI for now. The consequences are nil on x86 anyway.
> >
> > Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > CC: <stable@vger.kernel.org>
> 
> Further discussion with the hw teams have revealed that this is still
> an issue on newer asics so I think your original patch is correct
> after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.

Ok. You confirm that this is however good on newer video side right ?

Also, is there a known issue that if MSI were once enabled, the chip
still shoots them even if we disable them in config space ?

When testing my new patch set, I was trying to test the error path
when the arch does *not* honor the limitation. The error went back
up to the driver as far as I can tell (ie, pci_enable_msi() failed),
but the system still got into error state as if the card had tried
to shoot an MSI to the wrong address.

(I suspect the graphics side)

Cheers,
Ben.
Alex Deucher Oct. 8, 2014, 12:18 a.m. UTC | #3
On Tue, Oct 7, 2014 at 7:49 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Tue, 2014-10-07 at 19:47 -0400, Alex Deucher wrote:
>> > While recent ASICs have that problem fixed, they don't seem to
>> > be listed in the PCI IDs of the current driver, so let's quirk all
>> > the ATI HDMI for now. The consequences are nil on x86 anyway.
>> >
>> > Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
>> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> > CC: <stable@vger.kernel.org>
>>
>> Further discussion with the hw teams have revealed that this is still
>> an issue on newer asics so I think your original patch is correct
>> after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.
>
> Ok. You confirm that this is however good on newer video side right ?
>

Yes, this was definitely fixed on the GPU side.

> Also, is there a known issue that if MSI were once enabled, the chip
> still shoots them even if we disable them in config space ?
>
> When testing my new patch set, I was trying to test the error path
> when the arch does *not* honor the limitation. The error went back
> up to the driver as far as I can tell (ie, pci_enable_msi() failed),
> but the system still got into error state as if the card had tried
> to shoot an MSI to the wrong address.
>
> (I suspect the graphics side)

I'm not aware of any such issue, but I can ask the hw guys if there is
anything special required to disable MSIs beyond the pci config space
settings.

Alex

>
> Cheers,
> Ben.
>
>
Benjamin Herrenschmidt Oct. 8, 2014, 5:28 a.m. UTC | #4
On Tue, 2014-10-07 at 19:47 -0400, Alex Deucher wrote:
> > This moves the setting of the quirk flag to the audio driver.
> >
> > While recent ASICs have that problem fixed, they don't seem to
> > be listed in the PCI IDs of the current driver, so let's quirk all
> > the ATI HDMI for now. The consequences are nil on x86 anyway.
> >
> > Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > CC: <stable@vger.kernel.org>
> 
> Further discussion with the hw teams have revealed that this is still
> an issue on newer asics so I think your original patch is correct
> after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.

Allright, I won't resend the whole series, I can just pickup my previous
patch. Takashi, Bjorn, Dave, this series covers your 3 areas of
maintainership, how do you want to proceed ? I'm happy to merge the
whole lot via powerpc ASAP (since it's all CC'ed stable) if you guys
send me the appropriate acks, otherwise, let me know.

Cheers,
Ben.
Alex Deucher Oct. 8, 2014, 6:23 a.m. UTC | #5
On Wed, Oct 8, 2014 at 1:28 AM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Tue, 2014-10-07 at 19:47 -0400, Alex Deucher wrote:
>> > This moves the setting of the quirk flag to the audio driver.
>> >
>> > While recent ASICs have that problem fixed, they don't seem to
>> > be listed in the PCI IDs of the current driver, so let's quirk all
>> > the ATI HDMI for now. The consequences are nil on x86 anyway.
>> >
>> > Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
>> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> > CC: <stable@vger.kernel.org>
>>
>> Further discussion with the hw teams have revealed that this is still
>> an issue on newer asics so I think your original patch is correct
>> after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.
>
> Allright, I won't resend the whole series, I can just pickup my previous
> patch. Takashi, Bjorn, Dave, this series covers your 3 areas of
> maintainership, how do you want to proceed ? I'm happy to merge the
> whole lot via powerpc ASAP (since it's all CC'ed stable) if you guys
> send me the appropriate acks, otherwise, let me know.
>

I don't remember if I gave my formal review of your original patch, so if not,
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

Alex
Takashi Iwai Oct. 8, 2014, 6:59 a.m. UTC | #6
At Wed, 08 Oct 2014 16:28:16 +1100,
Benjamin Herrenschmidt wrote:
> 
> On Tue, 2014-10-07 at 19:47 -0400, Alex Deucher wrote:
> > > This moves the setting of the quirk flag to the audio driver.
> > >
> > > While recent ASICs have that problem fixed, they don't seem to
> > > be listed in the PCI IDs of the current driver, so let's quirk all
> > > the ATI HDMI for now. The consequences are nil on x86 anyway.
> > >
> > > Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
> > > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > CC: <stable@vger.kernel.org>
> > 
> > Further discussion with the hw teams have revealed that this is still
> > an issue on newer asics so I think your original patch is correct
> > after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.
> 
> Allright, I won't resend the whole series, I can just pickup my previous
> patch. Takashi, Bjorn, Dave, this series covers your 3 areas of
> maintainership, how do you want to proceed ? I'm happy to merge the
> whole lot via powerpc ASAP (since it's all CC'ed stable) if you guys
> send me the appropriate acks, otherwise, let me know.

Feel free to merge through your tree.
  Reviewed-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi
Benjamin Herrenschmidt Oct. 13, 2014, 8:11 p.m. UTC | #7
On Wed, 2014-10-08 at 16:28 +1100, Benjamin Herrenschmidt wrote:

> > Further discussion with the hw teams have revealed that this is still
> > an issue on newer asics so I think your original patch is correct
> > after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.
> 
> Allright, I won't resend the whole series, I can just pickup my previous
> patch. Takashi, Bjorn, Dave, this series covers your 3 areas of
> maintainership, how do you want to proceed ? I'm happy to merge the
> whole lot via powerpc ASAP (since it's all CC'ed stable) if you guys
> send me the appropriate acks, otherwise, let me know.

So I got an Ack from Takashi but so far silence from Bjorn and Dave :-)

Ping ?

Cheers,
Ben.
Alex Deucher Oct. 13, 2014, 8:39 p.m. UTC | #8
On Mon, Oct 13, 2014 at 4:11 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Wed, 2014-10-08 at 16:28 +1100, Benjamin Herrenschmidt wrote:
>
>> > Further discussion with the hw teams have revealed that this is still
>> > an issue on newer asics so I think your original patch is correct
>> > after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.
>>
>> Allright, I won't resend the whole series, I can just pickup my previous
>> patch. Takashi, Bjorn, Dave, this series covers your 3 areas of
>> maintainership, how do you want to proceed ? I'm happy to merge the
>> whole lot via powerpc ASAP (since it's all CC'ed stable) if you guys
>> send me the appropriate acks, otherwise, let me know.
>
> So I got an Ack from Takashi but so far silence from Bjorn and Dave :-)
>
> Ping ?

I'm fine with the radeon patches going through your tree rather than
through my tree.

Alex
Bjorn Helgaas Oct. 13, 2014, 8:46 p.m. UTC | #9
On Mon, Oct 13, 2014 at 2:11 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Wed, 2014-10-08 at 16:28 +1100, Benjamin Herrenschmidt wrote:
>
>> > Further discussion with the hw teams have revealed that this is still
>> > an issue on newer asics so I think your original patch is correct
>> > after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.
>>
>> Allright, I won't resend the whole series, I can just pickup my previous
>> patch. Takashi, Bjorn, Dave, this series covers your 3 areas of
>> maintainership, how do you want to proceed ? I'm happy to merge the
>> whole lot via powerpc ASAP (since it's all CC'ed stable) if you guys
>> send me the appropriate acks, otherwise, let me know.
>
> So I got an Ack from Takashi but so far silence from Bjorn and Dave :-)
>
> Ping ?

Sorry, I've been taking a breather after the v3.17 release.  I'll try
to look at these soon, but I will be on vacation Thu-Fri this week).

Bjorn
Bjorn Helgaas Oct. 15, 2014, 10:19 p.m. UTC | #10
On Wed, Oct 08, 2014 at 04:28:16PM +1100, Benjamin Herrenschmidt wrote:
> On Tue, 2014-10-07 at 19:47 -0400, Alex Deucher wrote:
> > > This moves the setting of the quirk flag to the audio driver.
> > >
> > > While recent ASICs have that problem fixed, they don't seem to
> > > be listed in the PCI IDs of the current driver, so let's quirk all
> > > the ATI HDMI for now. The consequences are nil on x86 anyway.
> > >
> > > Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
> > > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > CC: <stable@vger.kernel.org>
> > 
> > Further discussion with the hw teams have revealed that this is still
> > an issue on newer asics so I think your original patch is correct
> > after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.
> 
> Allright, I won't resend the whole series, I can just pickup my previous
> patch. Takashi, Bjorn, Dave, this series covers your 3 areas of
> maintainership, how do you want to proceed ? I'm happy to merge the
> whole lot via powerpc ASAP (since it's all CC'ed stable) if you guys
> send me the appropriate acks, otherwise, let me know.

It all looks beautiful to me.

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

If I were merging it, I would change this:

  pci/msi: Add device flag indicating that 64-bit MSIs don't work

to this:

  PCI/MSI: Add device flag indicating that 64-bit MSIs don't work

I'd be happy to merge it, but given what I know now, I would wait and merge
it during the v3.19 merge window.  It sounds like it's more urgent than
that and should be merged earlier, but from the changelogs, it looks like
we're just replacing the powerpc-specific quirk with a more generic one.

So I assume you'll merge it via powerpc unless I hear otherwise.

Bjorn
Benjamin Herrenschmidt Oct. 15, 2014, 10:55 p.m. UTC | #11
On Wed, 2014-10-15 at 16:19 -0600, Bjorn Helgaas wrote:
>   PCI/MSI: Add device flag indicating that 64-bit MSIs don't work
> 
> I'd be happy to merge it, but given what I know now, I would wait and merge
> it during the v3.19 merge window.  It sounds like it's more urgent than
> that and should be merged earlier, but from the changelogs, it looks like
> we're just replacing the powerpc-specific quirk with a more generic one.
> 
> So I assume you'll merge it via powerpc unless I hear otherwise.

Either way works but it's easy to keep it all in one series in one tree.

The urgency is that the current powerpc quirk works only with one specific
card (ie, one device ID for gfx and one for audio) and misses the DMA limitation
of the sound driver (which is a somewhat orthogonal issue but the patch for it is
in the series).

Any other radeon card causes the machine to crash at boot (the driver doesn't
recover well from the EEH error triggered by the bad MSI address and the world
falls over from there).

So I want this to go back into distros.

Cheers,
Ben.
Bjorn Helgaas Nov. 11, 2014, 9:12 p.m. UTC | #12
On Thu, Oct 16, 2014 at 09:55:32AM +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2014-10-15 at 16:19 -0600, Bjorn Helgaas wrote:
> >   PCI/MSI: Add device flag indicating that 64-bit MSIs don't work
> > 
> > I'd be happy to merge it, but given what I know now, I would wait and merge
> > it during the v3.19 merge window.  It sounds like it's more urgent than
> > that and should be merged earlier, but from the changelogs, it looks like
> > we're just replacing the powerpc-specific quirk with a more generic one.
> > 
> > So I assume you'll merge it via powerpc unless I hear otherwise.
> 
> Either way works but it's easy to keep it all in one series in one tree.
> 
> The urgency is that the current powerpc quirk works only with one specific
> card (ie, one device ID for gfx and one for audio) and misses the DMA limitation
> of the sound driver (which is a somewhat orthogonal issue but the patch for it is
> in the series).
> 
> Any other radeon card causes the machine to crash at boot (the driver doesn't
> recover well from the EEH error triggered by the bad MSI address and the world
> falls over from there).
> 
> So I want this to go back into distros.

I'm still assuming you're going to merge this series, but I don't see it in
your tree (https://git.kernel.org/cgit/linux/kernel/git/benh/powerpc.git/)
yet.  Do you want me to do anything with it?

Bjorn
Michael Ellerman Nov. 12, 2014, 2:23 a.m. UTC | #13
On Tue, 2014-11-11 at 14:12 -0700, Bjorn Helgaas wrote:
> On Thu, Oct 16, 2014 at 09:55:32AM +1100, Benjamin Herrenschmidt wrote:
> > On Wed, 2014-10-15 at 16:19 -0600, Bjorn Helgaas wrote:
> > >   PCI/MSI: Add device flag indicating that 64-bit MSIs don't work
> 
> I'm still assuming you're going to merge this series, but I don't see it in
> your tree (https://git.kernel.org/cgit/linux/kernel/git/benh/powerpc.git/)
> yet.  Do you want me to do anything with it?

I'm doing the powerpc tree this cycle, so it'd be in my tree, but it's not:

  https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/

Ben if you want me to take it let me know.

cheers
Benjamin Herrenschmidt Nov. 12, 2014, 4:06 a.m. UTC | #14
On Wed, 2014-11-12 at 13:23 +1100, Michael Ellerman wrote:
> On Tue, 2014-11-11 at 14:12 -0700, Bjorn Helgaas wrote:
> > On Thu, Oct 16, 2014 at 09:55:32AM +1100, Benjamin Herrenschmidt wrote:
> > > On Wed, 2014-10-15 at 16:19 -0600, Bjorn Helgaas wrote:
> > > >   PCI/MSI: Add device flag indicating that 64-bit MSIs don't work
> > 
> > I'm still assuming you're going to merge this series, but I don't see it in
> > your tree (https://git.kernel.org/cgit/linux/kernel/git/benh/powerpc.git/)
> > yet.  Do you want me to do anything with it?
> 
> I'm doing the powerpc tree this cycle, so it'd be in my tree, but it's not:
> 
>   https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/
> 
> Ben if you want me to take it let me know.

Hrm, I might have dropped the ball accidentally here. Bjorn did you
actually Ack the core changes ? In that case we should probably pick it
up.

Cheers,
Ben.
Bjorn Helgaas Nov. 12, 2014, 4:09 a.m. UTC | #15
On Tue, Nov 11, 2014 at 9:06 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Wed, 2014-11-12 at 13:23 +1100, Michael Ellerman wrote:
>> On Tue, 2014-11-11 at 14:12 -0700, Bjorn Helgaas wrote:
>> > On Thu, Oct 16, 2014 at 09:55:32AM +1100, Benjamin Herrenschmidt wrote:
>> > > On Wed, 2014-10-15 at 16:19 -0600, Bjorn Helgaas wrote:
>> > > >   PCI/MSI: Add device flag indicating that 64-bit MSIs don't work
>> >
>> > I'm still assuming you're going to merge this series, but I don't see it in
>> > your tree (https://git.kernel.org/cgit/linux/kernel/git/benh/powerpc.git/)
>> > yet.  Do you want me to do anything with it?
>>
>> I'm doing the powerpc tree this cycle, so it'd be in my tree, but it's not:
>>
>>   https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/
>>
>> Ben if you want me to take it let me know.
>
> Hrm, I might have dropped the ball accidentally here. Bjorn did you
> actually Ack the core changes ? In that case we should probably pick it
> up.

Yep, I acked it earlier in this thread (Oct 15).

Bjorn
Michael Ellerman Nov. 13, 2014, 5:19 a.m. UTC | #16
On Wed, 2014-11-12 at 15:06 +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2014-11-12 at 13:23 +1100, Michael Ellerman wrote:
> > On Tue, 2014-11-11 at 14:12 -0700, Bjorn Helgaas wrote:
> > > On Thu, Oct 16, 2014 at 09:55:32AM +1100, Benjamin Herrenschmidt wrote:
> > > > On Wed, 2014-10-15 at 16:19 -0600, Bjorn Helgaas wrote:
> > > > >   PCI/MSI: Add device flag indicating that 64-bit MSIs don't work
> > > 
> > > I'm still assuming you're going to merge this series, but I don't see it in
> > > your tree (https://git.kernel.org/cgit/linux/kernel/git/benh/powerpc.git/)
> > > yet.  Do you want me to do anything with it?
> > 
> > I'm doing the powerpc tree this cycle, so it'd be in my tree, but it's not:
> > 
> >   https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/
> > 
> > Ben if you want me to take it let me know.
> 
> Hrm, I might have dropped the ball accidentally here. Bjorn did you
> actually Ack the core changes ? In that case we should probably pick it
> up.

I tried piecing together this series with v2 of patch 3 as you described, I
think, but it didn't apply cleanly, and I'm not confident I won't screw it up.

So please resend the series the way you want it to go in.

You got an ack from Bjorn:

  Acked-by: Bjorn Helgaas <bhelgaas@google.com>

And he asked you change the subject on patch 2 to:

  PCI/MSI: Add device flag indicating that 64-bit MSIs don't work


cheers
diff mbox

Patch

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 99b367b..af38ed9 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1506,9 +1506,14 @@  static int azx_first_init(struct azx *chip)
 		return -ENXIO;
 	}
 
-	if (chip->msi)
+	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 (azx_acquire_irq(chip, 0) < 0)
 		return -EBUSY;
@@ -2070,58 +2075,93 @@  static const struct pci_device_id azx_ids[] = {
 	{ PCI_DEVICE(0x1022, 0x780d),
 	  .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB },
 	/* ATI HDMI */
-	{ PCI_DEVICE(0x1002, 0x793b),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	{ PCI_DEVICE(0x1002, 0x1314),
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0x7919),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
+	{ PCI_DEVICE(0x1002, 0x7969),
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
+	{ PCI_DEVICE(0x1002, 0x793b),
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0x960f),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
+	{ PCI_DEVICE(0x1002, 0x9646),
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0x970f),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa00),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa08),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa10),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa18),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa20),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa28),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa30),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa38),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa40),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa48),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa50),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa58),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa60),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa68),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa80),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa88),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa90),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaa98),
-	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0x9902),
-	  .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaaa0),
-	  .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaaa8),
-	  .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	{ PCI_DEVICE(0x1002, 0xaab0),
-	  .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI },
+	  .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI |
+	  AZX_DCAPS_NO_MSI64 },
 	/* VIA VT8251/VT8237A */
 	{ PCI_DEVICE(0x1106, 0x3288),
 	  .driver_data = AZX_DRIVER_VIA | AZX_DCAPS_POSFIX_VIA },
diff --git a/sound/pci/hda/hda_priv.h b/sound/pci/hda/hda_priv.h
index 949cd43..5016014 100644
--- a/sound/pci/hda/hda_priv.h
+++ b/sound/pci/hda/hda_priv.h
@@ -171,6 +171,7 @@  enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
 #define AZX_DCAPS_PM_RUNTIME	(1 << 26)	/* runtime PM support */
 #define AZX_DCAPS_I915_POWERWELL (1 << 27)	/* HSW i915 powerwell support */
 #define AZX_DCAPS_CORBRP_SELF_CLEAR (1 << 28)	/* CORBRP clears itself after reset */
+#define AZX_DCAPS_NO_MSI64      (1 << 29)	/* Stick to 32-bit MSIs */
 
 /* HD Audio class code */
 #define PCI_CLASS_MULTIMEDIA_HD_AUDIO	0x0403