linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] PCI: Add func1 DMA quirk for Marvell 88SE9125 SATA controller
@ 2021-11-16 14:32 Yifeng Li
  2021-11-16 15:49 ` Krzysztof Wilczyński
  2021-11-17 10:12 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Yifeng Li @ 2021-11-16 14:32 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, linux-kernel

Like other SATA controller chips in the Marvell 88SE91xx series, the
Marvell 88SE9125 has the same DMA requester ID hardware bug that prevents
it from working under IOMMU. This patch adds its device ID 0x9125 to the
Function 1 DMA alias quirk list.

This patch should not be confused with an earlier patch, commit 059983790a4c
("PCI: Add function 1 DMA alias quirk for Marvell 9215 SATA controller"),
which applies to a different chip with a similar model number, 88SE9215.

Without this patch, device initialization fails with DMA errors.

    ata8: softreset failed (1st FIS failed)
    DMAR: DRHD: handling fault status reg 2
    DMAR: [DMA Write NO_PASID] Request device [03:00.1] fault addr 0xfffc0000 [fault reason 0x02] Present bit in context entry is clear
    DMAR: DRHD: handling fault status reg 2
    DMAR: [DMA Read NO_PASID] Request device [03:00.1] fault addr 0xfffc0000 [fault reason 0x02] Present bit in context entry is clear

After applying the patch, the controller can be successfully initialized.

    ata8: SATA link up 1.5 Gbps (SStatus 113 SControl 330)
    ata8.00: ATAPI: PIONEER BD-RW   BDR-207M, 1.21, max UDMA/100
    ata8.00: configured for UDMA/100
    scsi 7:0:0:0: CD-ROM            PIONEER  BD-RW   BDR-207M 1.21 PQ: 0 ANSI: 5

Cc: stable@vger.kernel.org
Reported-by: sbingner <sam@bingner.com>
Tested-by: sbingner <sam@bingner.com>
Tested-by: Yifeng Li <tomli@tomli.me>
Signed-off-by: Yifeng Li <tomli@tomli.me>
---

Notes:
    I accidentally sent an earlier version of the commit without CCing
    stable@vger.kernel.org. The mail itself was also rejected by
    many servers due to a DKIM issue. Thus [PATCH v2], sorry for the
    noise.

 drivers/pci/quirks.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 003950c73..20a932690 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4103,6 +4103,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9120,
 			 quirk_dma_func1_alias);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9123,
 			 quirk_dma_func1_alias);
+/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c136 */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9125,
+			 quirk_dma_func1_alias);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9128,
 			 quirk_dma_func1_alias);
 /* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c14 */
-- 
2.31.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] PCI: Add func1 DMA quirk for Marvell 88SE9125 SATA controller
  2021-11-16 14:32 [PATCH v2] PCI: Add func1 DMA quirk for Marvell 88SE9125 SATA controller Yifeng Li
@ 2021-11-16 15:49 ` Krzysztof Wilczyński
  2021-11-16 16:12   ` Tom Li
  2021-11-17 10:12 ` Christoph Hellwig
  1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Wilczyński @ 2021-11-16 15:49 UTC (permalink / raw)
  To: Yifeng Li; +Cc: Bjorn Helgaas, linux-pci, linux-kernel

Hi,

Thank you for sending the patch over to fix this!

> Like other SATA controller chips in the Marvell 88SE91xx series, the
> Marvell 88SE9125 has the same DMA requester ID hardware bug that prevents
> it from working under IOMMU. This patch adds its device ID 0x9125 to the
> Function 1 DMA alias quirk list.

[...]
> Reported-by: sbingner <sam@bingner.com>
> Tested-by: sbingner <sam@bingner.com>

Both of these tags would require a proper full name, if possible, rather
than a name that is abbreviated and/or a username.

Reviewed-by: Krzysztof Wilczyński <kw@liunx.com>

	Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] PCI: Add func1 DMA quirk for Marvell 88SE9125 SATA controller
  2021-11-16 15:49 ` Krzysztof Wilczyński
@ 2021-11-16 16:12   ` Tom Li
  2021-11-16 16:39     ` Krzysztof Wilczyński
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Li @ 2021-11-16 16:12 UTC (permalink / raw)
  To: Krzysztof Wilczyński; +Cc: Bjorn Helgaas, linux-pci, linux-kernel

On Tue, Nov 16, 2021 at 04:49:54PM +0100, Krzysztof Wilczyński wrote:
> > Reported-by: sbingner <sam@bingner.com>
> > Tested-by: sbingner <sam@bingner.com>
> 
> Both of these tags would require a proper full name, if possible, rather
> than a name that is abbreviated and/or a username.
> 
> Reviewed-by: Krzysztof Wilczyński <kw@liunx.com>
> 
> 	Krzysztof

No problem, I'll send a revision to correct the tags immediately.

Cheers,
Yifeng Li

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] PCI: Add func1 DMA quirk for Marvell 88SE9125 SATA controller
  2021-11-16 16:12   ` Tom Li
@ 2021-11-16 16:39     ` Krzysztof Wilczyński
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Wilczyński @ 2021-11-16 16:39 UTC (permalink / raw)
  To: Tom Li; +Cc: Bjorn Helgaas, linux-pci, linux-kernel

Hi,

> On Tue, Nov 16, 2021 at 04:49:54PM +0100, Krzysztof Wilczyński wrote:
> > > Reported-by: sbingner <sam@bingner.com>
> > > Tested-by: sbingner <sam@bingner.com>
> > 
> > Both of these tags would require a proper full name, if possible, rather
> > than a name that is abbreviated and/or a username.
> > 
> > Reviewed-by: Krzysztof Wilczyński <kw@liunx.com>
> > 
> > 	Krzysztof
> 
> No problem, I'll send a revision to correct the tags immediately.

No worries!  Thank you!

	Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] PCI: Add func1 DMA quirk for Marvell 88SE9125 SATA controller
  2021-11-16 14:32 [PATCH v2] PCI: Add func1 DMA quirk for Marvell 88SE9125 SATA controller Yifeng Li
  2021-11-16 15:49 ` Krzysztof Wilczyński
@ 2021-11-17 10:12 ` Christoph Hellwig
  2021-11-17 14:15   ` Alex Williamson
  1 sibling, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2021-11-17 10:12 UTC (permalink / raw)
  To: Yifeng Li; +Cc: Bjorn Helgaas, linux-pci, linux-kernel, kvm

On Tue, Nov 16, 2021 at 02:32:26PM +0000, Yifeng Li wrote:
> Like other SATA controller chips in the Marvell 88SE91xx series, the
> Marvell 88SE9125 has the same DMA requester ID hardware bug that prevents
> it from working under IOMMU. This patch adds its device ID 0x9125 to the
> Function 1 DMA alias quirk list.

Btw, do we need to prevent vfio assignment for all devices with this
quirk?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] PCI: Add func1 DMA quirk for Marvell 88SE9125 SATA controller
  2021-11-17 10:12 ` Christoph Hellwig
@ 2021-11-17 14:15   ` Alex Williamson
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Williamson @ 2021-11-17 14:15 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Yifeng Li, Bjorn Helgaas, linux-pci, linux-kernel, kvm

On Wed, 17 Nov 2021 02:12:04 -0800
Christoph Hellwig <hch@infradead.org> wrote:

> On Tue, Nov 16, 2021 at 02:32:26PM +0000, Yifeng Li wrote:
> > Like other SATA controller chips in the Marvell 88SE91xx series, the
> > Marvell 88SE9125 has the same DMA requester ID hardware bug that prevents
> > it from working under IOMMU. This patch adds its device ID 0x9125 to the
> > Function 1 DMA alias quirk list.  
> 
> Btw, do we need to prevent vfio assignment for all devices with this
> quirk?

No, the alias is taken into account with grouping and IOMMU
programming, it should work with vfio.  Thanks,

Alex


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-17 14:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 14:32 [PATCH v2] PCI: Add func1 DMA quirk for Marvell 88SE9125 SATA controller Yifeng Li
2021-11-16 15:49 ` Krzysztof Wilczyński
2021-11-16 16:12   ` Tom Li
2021-11-16 16:39     ` Krzysztof Wilczyński
2021-11-17 10:12 ` Christoph Hellwig
2021-11-17 14:15   ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).