Date: Fri, 10 May 2019 16:43:54 +0000 (UTC) From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347440 - head/sys/dev/ahci Message-ID: <201905101643.x4AGhsYx087970@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: manu Date: Fri May 10 16:43:53 2019 New Revision: 347440 URL: https://svnweb.freebsd.org/changeset/base/347440 Log: ahci: Check if bus is cache-coherent We do this for FDT systems but not for ACPI ones. Check the presence of the _CCA attribute. Sponsored by: Ampere Computing, LLC Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D20144 Modified: head/sys/dev/ahci/ahci_generic.c Modified: head/sys/dev/ahci/ahci_generic.c ============================================================================== --- head/sys/dev/ahci/ahci_generic.c Fri May 10 16:43:47 2019 (r347439) +++ head/sys/dev/ahci/ahci_generic.c Fri May 10 16:43:53 2019 (r347440) @@ -89,6 +89,7 @@ ahci_fdt_probe(device_t dev) static int ahci_acpi_probe(device_t dev) { + struct ahci_controller *ctlr = device_get_softc(dev); ACPI_HANDLE h; if ((h = acpi_get_handle(dev)) == NULL) @@ -98,6 +99,12 @@ ahci_acpi_probe(device_t dev) pci_get_subclass(dev) == PCIS_STORAGE_SATA && pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0) { device_set_desc_copy(dev, "AHCI SATA controller"); + if (ACPI_FAILURE(acpi_GetInteger(h, "_CCA", + &ctlr->dma_coherent))) + ctlr->dma_coherent = 0; + if (bootverbose) + device_printf(dev, "Bus is%s cache-coherent\n", + ctlr->dma_coherent ? "" : " not"); return (BUS_PROBE_DEFAULT); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905101643.x4AGhsYx087970>