Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 May 2019 18:17:43 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r347000 - stable/12/sys/dev/acpica
Message-ID:  <201905011817.x41IHhgF060675@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed May  1 18:17:42 2019
New Revision: 347000
URL: https://svnweb.freebsd.org/changeset/base/347000

Log:
  MFC 346066: Refine r330113 to honor the ProducerConsumer flag most of the time.
  
  While it is true that the ACPI spec says that the flag is only valid
  on Extended Address Space Descriptors, examples of other descriptors
  in the spec use the ProducerConsumer flag explicitly, and real
  hardware uses it as well.  In fact, even in the ASL of the Thunder X2
  for which r330113 was a workaround, some devices use this flag on
  non-Extended Address Space Descriptors correctly.  Instead, only
  ignore the flag for resources associated with the UART devices on the
  Thunder X2 using the "ARMH0011" HID to identify these devices.
  
  This should fix regressions from ignoring this flag in other contexts
  such as Hyper-V.
  
  PR:		235876

Modified:
  stable/12/sys/dev/acpica/acpi_resource.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/acpica/acpi_resource.c
==============================================================================
--- stable/12/sys/dev/acpica/acpi_resource.c	Wed May  1 17:30:14 2019	(r346999)
+++ stable/12/sys/dev/acpica/acpi_resource.c	Wed May  1 18:17:42 2019	(r347000)
@@ -159,6 +159,7 @@ struct acpi_resource_context {
     struct acpi_parse_resource_set *set;
     device_t	dev;
     void	*context;
+    bool	ignore_producer_flag;
 };
 
 #ifdef ACPI_DEBUG_OUTPUT
@@ -342,7 +343,7 @@ acpi_parse_resource(ACPI_RESOURCE *res, void *context)
 	}
 	if (length <= 0)
 	    break;
-	if (res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 &&
+	if (!arc->ignore_producer_flag &&
 	    res->Data.Address.ProducerConsumer != ACPI_CONSUMER) {
 	    ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
 		"ignored %s %s producer\n", name,
@@ -431,6 +432,12 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
     set->set_init(dev, arg, &arc.context);
     arc.set = set;
     arc.dev = dev;
+    arc.ignore_producer_flag = false;
+
+    /* UARTs on ThunderX2 set ResourceProducer on memory resources. */
+    if (acpi_MatchHid(handle, "ARMH0011"))
+	    arc.ignore_producer_flag = true;
+
     status = AcpiWalkResources(handle, "_CRS", acpi_parse_resource, &arc);
     if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
 	printf("can't fetch resources for %s - %s\n",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905011817.x41IHhgF060675>