Index: sys/dev/ahci/ahci.h =================================================================== --- sys/dev/ahci/ahci.h +++ sys/dev/ahci/ahci.h @@ -624,6 +624,7 @@ #define AHCI_Q_MRVL_SR_DEL 0x00200000 #define AHCI_Q_NOCCS 0x00400000 #define AHCI_Q_NOAUX 0x00800000 +#define AHCI_Q_IOMMU_BUSWIDE 0x01000000 #define AHCI_Q_BIT_STRING \ "\020" \ @@ -650,7 +651,8 @@ "\025NOMSIX" \ "\026MRVL_SR_DEL" \ "\027NOCCS" \ - "\030NOAUX" + "\030NOAUX" \ + "\031IOMMU_BUSWIDE" int ahci_attach(device_t dev); int ahci_detach(device_t dev); Index: sys/dev/ahci/ahci_pci.c =================================================================== --- sys/dev/ahci/ahci_pci.c +++ sys/dev/ahci/ahci_pci.c @@ -37,12 +37,16 @@ #include #include #include +#include +#include +#include #include #include #include #include #include #include +#include #include "ahci.h" static int force_ahci = 1; @@ -263,6 +267,7 @@ {0x91251b4b, 0x00, "Marvell 88SE9125", 0}, {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_ALTSIG}, {0x91301b4b, 0x00, "Marvell 88SE9130", AHCI_Q_ALTSIG}, + {0x91701b4b, 0x00, "Marvell 88SE9170", AHCI_Q_IOMMU_BUSWIDE}, {0x91721b4b, 0x00, "Marvell 88SE9172", 0}, {0x91821b4b, 0x00, "Marvell 88SE9182", 0}, {0x91831b4b, 0x00, "Marvell 88SS9183", 0}, @@ -482,6 +487,16 @@ ahci_ids[i].rev > revid)) i++; ctlr->quirks = ahci_ids[i].quirks; + + if (ctlr->quirks & AHCI_Q_IOMMU_BUSWIDE) { + /* + * The controller issues DMA requests from PCI function 1, + * but the device is not multifunction. + * Ref: https://bugzilla.kernel.org/show_bug.cgi?id=42679 + */ + bus_dma_iommu_set_buswide(dev); + } + /* Limit speed for my onboard JMicron external port. * It is not eSATA really, limit to SATA 1 */ if (pci_get_devid(dev) == 0x2363197b &&