From owner-svn-src-head@freebsd.org Wed Sep 30 17:10:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0675942C466; Wed, 30 Sep 2020 17:10:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1jSn6Ng7z4Wlr; Wed, 30 Sep 2020 17:10:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFDF322AF8; Wed, 30 Sep 2020 17:10:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08UHAnCM051168; Wed, 30 Sep 2020 17:10:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08UHAnat051167; Wed, 30 Sep 2020 17:10:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202009301710.08UHAnat051167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 30 Sep 2020 17:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366295 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 366295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 17:10:50 -0000 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 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); }