Author: manu
Date: Wed Sep 30 17:10:49 2020
New Revision: 366295
URL: https://svnweb.freebsd.org/changeset/base/366295

Log:
  ahci_generic: add quirk for NXP0004 (NXP Layerscape LX2160A)
  
  This fixes this error :
  (aprobe3:ahcich3:0:15:0): NOP FLUSHQUEUE. ACB: 00 00 00 00 00 00 00 00 00 00 
00 00
  (aprobe3:ahcich3:0:15:0): CAM status: Command timeout
  (aprobe3:ahcich3:0:15:0): Error 5, Retries exhausted
  
  Submitted by: Greg V <greg@unrelenting.technology>
  Reviewed by:  imp, mav
  MFC after:    2 weeks
  Differential Revision:        https://reviews.freebsd.org/D25157

Modified:
  head/sys/dev/ahci/ahci_generic.c

Modified: head/sys/dev/ahci/ahci_generic.c
==============================================================================
--- head/sys/dev/ahci/ahci_generic.c    Wed Sep 30 17:09:17 2020        
(r366294)
+++ head/sys/dev/ahci/ahci_generic.c    Wed Sep 30 17:10:49 2020        
(r366295)
@@ -86,11 +86,22 @@ ahci_fdt_probe(device_t dev)
 #endif
 
 #ifdef DEV_ACPI
+
+static const struct ahci_acpi_quirk {
+       const char*     hid;
+       u_int           quirks;
+} ahci_acpi_quirks[] = {
+       { "NXP0004", AHCI_Q_NOPMP },
+       { NULL, 0 }
+};
+
+
 static int
 ahci_acpi_probe(device_t dev)
 {
        struct ahci_controller *ctlr = device_get_softc(dev);
        ACPI_HANDLE h;
+       int i;
 
        if ((h = acpi_get_handle(dev)) == NULL)
                return (ENXIO);
@@ -105,6 +116,12 @@ ahci_acpi_probe(device_t dev)
                if (bootverbose)
                        device_printf(dev, "Bus is%s cache-coherent\n",
                          ctlr->dma_coherent ? "" : " not");
+               for (i = 0; ahci_acpi_quirks[i].hid != NULL; i++) {
+                       if (acpi_MatchHid(h, ahci_acpi_quirks[i].hid) != 
ACPI_MATCHHID_NOMATCH) {
+                               ctlr->quirks = ahci_acpi_quirks[i].quirks;
+                               break;
+                       }
+               }
                return (BUS_PROBE_DEFAULT);
        }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to