It is about MSI. After disabling MSI interrupts are delivered, albeit the performance seems to be a bit poor (reading at a constant 8 MB/s on a WD Red disk).

Here's the dmesg with patched kernel - notice the intx instead msi:
ahci0 at pci1 dev 0 function 0 "JMicron JMB58x AHCI" rev 0x00: intx, AHCI 1.3.1

Should I commit this quirk? Or might this break something on other platforms?


Christopher


Index: ahci_pci.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/ahci_pci.c,v
retrieving revision 1.15
diff -u -p -r1.15 ahci_pci.c
--- ahci_pci.c  3 Aug 2018 22:18:13 -0000       1.15
+++ ahci_pci.c  19 Nov 2021 20:28:16 -0000
@@ -78,6 +78,8 @@ int                   ahci_intel_attach(struct ahci_soft
                            struct pci_attach_args *);
 int                    ahci_samsung_attach(struct ahci_softc *,
                            struct pci_attach_args *);
+int                    ahci_jmicron_attach(struct ahci_softc *,
+                           struct pci_attach_args *);
static const struct ahci_device ahci_devices[] = {
        { PCI_VENDOR_AMD,       PCI_PRODUCT_AMD_HUDSON2_SATA_1,
@@ -154,6 +156,9 @@ static const struct ahci_device ahci_dev
        { PCI_VENDOR_SAMSUNG2,  PCI_PRODUCT_SAMSUNG2_SM951_AHCI,
            NULL,               ahci_samsung_attach },
+ { PCI_VENDOR_JMICRON, PCI_PRODUCT_JMICRON_JMB58x,
+           NULL,               ahci_jmicron_attach },
+
        { PCI_VENDOR_VIATECH,   PCI_PRODUCT_VIATECH_VT8251_SATA,
          ahci_no_match,        ahci_vt8251_attach }
 };
@@ -286,6 +291,18 @@ ahci_samsung_attach(struct ahci_softc *s
         * as the XP941 SSD controller.
         * https://bugzilla.kernel.org/show_bug.cgi?id=60731
         * https://bugzilla.kernel.org/show_bug.cgi?id=89171
+        */
+       sc->sc_flags |= AHCI_F_NO_MSI;
+
+       return (0);
+}
+
+int
+ahci_jmicron_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
+{
+       /*
+        * Disable MSI on JMicron controller as it times out on at least
+        * rkpcie(4)
         */
        sc->sc_flags |= AHCI_F_NO_MSI;
Index: pcidevs
===================================================================
RCS file: /cvs/src/sys/dev/pci/pcidevs,v
retrieving revision 1.1981
diff -u -p -r1.1981 pcidevs
--- pcidevs     31 Oct 2021 14:41:00 -0000      1.1981
+++ pcidevs     19 Nov 2021 20:28:19 -0000
@@ -6560,6 +6560,7 @@ product JMICRON JMB363            0x2363  JMB363 ID
 product JMICRON JMB365         0x2365  JMB365 IDE/SATA
 product JMICRON JMB366         0x2366  JMB366 IDE/SATA
 product JMICRON JMB368         0x2368  JMB368 IDE
+product JMICRON JMB58x         0x0585  JMB58x AHCI
 product JMICRON FIREWIRE       0x2380  FireWire
 product JMICRON SD             0x2381  SD Host Controller
 product JMICRON SDMMC          0x2382  SD/MMC
Index: pcidevs.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/pcidevs.h,v
retrieving revision 1.1975
diff -u -p -r1.1975 pcidevs.h
--- pcidevs.h   31 Oct 2021 14:41:53 -0000      1.1975
+++ pcidevs.h   19 Nov 2021 20:28:22 -0000
@@ -6565,6 +6565,7 @@
 #define        PCI_PRODUCT_JMICRON_JMB365      0x2365          /* JMB365 
IDE/SATA */
 #define        PCI_PRODUCT_JMICRON_JMB366      0x2366          /* JMB366 
IDE/SATA */
 #define        PCI_PRODUCT_JMICRON_JMB368      0x2368          /* JMB368 IDE */
+#define        PCI_PRODUCT_JMICRON_JMB58x      0x0585          /* JMB58x AHCI 
*/
 #define        PCI_PRODUCT_JMICRON_FIREWIRE    0x2380          /* FireWire */
 #define        PCI_PRODUCT_JMICRON_SD  0x2381          /* SD Host Controller */
 #define        PCI_PRODUCT_JMICRON_SDMMC       0x2382          /* SD/MMC */
Index: pcidevs_data.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/pcidevs_data.h,v
retrieving revision 1.1970
diff -u -p -r1.1970 pcidevs_data.h
--- pcidevs_data.h      31 Oct 2021 14:41:53 -0000      1.1970
+++ pcidevs_data.h      19 Nov 2021 20:28:25 -0000
@@ -23584,6 +23584,10 @@ static const struct pci_known_product pc
            "JMB368 IDE",
        },
        {
+           PCI_VENDOR_JMICRON, PCI_PRODUCT_JMICRON_JMB58x,
+           "JMB58x AHCI",
+       },
+       {
            PCI_VENDOR_JMICRON, PCI_PRODUCT_JMICRON_FIREWIRE,
            "FireWire",
        },

Reply via email to