Received: by 10.192.165.148 with SMTP id m20csp1032335imm; Fri, 27 Apr 2018 11:26:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqOEKFIy2KmeZDfk0wRjQ6wUcQdi2hAQbph15S+la3Jjcving2UVt+4TK/KHE21YkNw5JSn X-Received: by 2002:a17:902:a9c2:: with SMTP id b2-v6mr1932483plr.181.1524853586395; Fri, 27 Apr 2018 11:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524853586; cv=none; d=google.com; s=arc-20160816; b=ZyalDiPjcOYz1f09Wgb58Hwkd6tl1IvUaHhoWn7AYENRCo/isyc4gDXKXIH9252pDk ZPPF7URA/PILaxBIxwD1tSRFzwM/ZZOhmlfQuuZrhx1aJiIrZwywFH9AegCpb11avi/L hlJ79NdbSV9PYJ9S/J/PPe73AbO86hujMtzkrAO5cuMJ55/7za7kQNIz+bYzPMzS325p tn6DNrsYrhrZB6vcCnD/UWA+riHput7vhDkLDVEsUoPi2Oz4LkjKrXErvyu5gUBrQMTK nZXrKxTiW9saubLbjq5K+gqAhf5LjpRWhwhVnVn+ULUdoJapKfZLLBOGXZiaR6tLCANN 2pyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=srwQnMvf/Hoe9saN/VgrZyeH7RAdScd6oJ1EVnlIgNc=; b=xXC5/0RGSWYyAJJG1Oy+5iTePVIV5m5JB9/o1yKATjRfC+9T5Gfovb6cgSNxILgebT H6CORFQv6/Cahol3XR20G3kltPFcbV/ytZhl9wQ5o9dKQQSf1UXl0rfn6I78lb5W9fES WVEG8V2fD7CZOBH2Y9XkIL1SpMZrOyyp3K/C8l0S5dW/M2lHnBlXoi7xc1rHzJejD1Fs 8FShTQKgXg7D6zyTImXzy2BcCIUIZMIF252GJFnegXJQZmFj+m+EKQt3BUoJFZ/Eaain lxSi6JFdRP4KIfbE/Ba8btnak5fCufaJuPCKjr/2x1ihb9rr+r400i1OPOc/yTBCb6IG 1aQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j186-v6si1605255pgc.621.2018.04.27.11.26.12; Fri, 27 Apr 2018 11:26:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758159AbeD0SYu (ORCPT + 99 others); Fri, 27 Apr 2018 14:24:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41358 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758043AbeD0SYp (ORCPT ); Fri, 27 Apr 2018 14:24:45 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B8A240267A3; Fri, 27 Apr 2018 18:24:45 +0000 (UTC) Received: from ovpn-120-169.rdu2.redhat.com (ovpn-120-169.rdu2.redhat.com [10.10.120.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DF4F215CDCB; Fri, 27 Apr 2018 18:24:44 +0000 (UTC) Message-ID: <1524853484.5602.32.camel@redhat.com> Subject: Re: [PATCH] ACPI / scan: Fix regression related to X-Gene UARTs From: Mark Salter To: "Rafael J. Wysocki" Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Danis , "Rafael J . Wysocki" , ACPI Devel Maling List , Linux Kernel Mailing List Date: Fri, 27 Apr 2018 14:24:44 -0400 In-Reply-To: References: <20180420032947.23023-1-msalter@redhat.com> Organization: Red Hat, Inc Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 27 Apr 2018 18:24:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 27 Apr 2018 18:24:45 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'msalter@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2018-04-22 at 11:34 +0200, Rafael J. Wysocki wrote: > On Fri, Apr 20, 2018 at 5:29 AM, Mark Salter wrote: > > Commit e361d1f85855 ("ACPI / scan: Fix enumeration for special UART > > devices") caused a regression with some X-Gene based platforms (Mustang > > and M400) with invalid DSDT. > > I'm not convinced that making changes to the core ACPI device > enumeration code in order to cover up for firmware bugs is the right > approach. It is unfortunate but the firmware bug predates the change which uncovered it, so previously working systems no longer work. > > > The DSDT makes it appear that the UART > > device is also a slave device attached to itself. With the above commit > > the UART won't be enumerated by ACPI scan (slave serial devices shouldn't > > be). So check for X-Gene UART device and skip slace device check on it. > > > > Signed-off-by: Mark Salter > > --- > > drivers/acpi/scan.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c > > index cc234e6a6297..1dcdd0122862 100644 > > --- a/drivers/acpi/scan.c > > +++ b/drivers/acpi/scan.c > > @@ -1551,6 +1551,14 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device) > > fwnode_property_present(&device->fwnode, "baud"))) > > return true; > > > > + /* > > + * Firmware on some arm64 X-Gene platforms will make the UART > > + * device appear as both a UART and a slave of that UART. Just > > + * bail out here for X-Gene UARTs. > > + */ > > + if (!strcmp(acpi_device_hid(device), "APMC0D08")) > > + return false; > > Is the device ID never to be used outside of the broken configurations? > > Even if that's the plan, how are you going to guarantee that anyway? The device ID will always be used for X-Gene UARTs. Whether the DSDT is broken or not wouldn't matter because the end result would be the same (the UART being treated as master rather than a serial bus slave). The broken firmware looks like this: Device (URT0) { Name (_HID, "APMC0D08") // _HID: Hardware ID ... Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { Memory32Fixed (ReadWrite, 0x1C020000, // Address Base 0x00000100, // Address Length ) UartSerialBusV2 (0x0001C200, DataBitsEight, StopBitsOne, 0x00, LittleEndian, ParityTypeNone, FlowControlNone, 0x0010, 0x0010, "URT0", 0x00, ResourceConsumer, , Exclusive, ) Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, ,, ) { 0x0000006D, } }) ... } So "URT0" has a UartSerialBusV2 resource which references itself as the bus master. > > > + > > INIT_LIST_HEAD(&resource_list); > > acpi_dev_get_resources(device, &resource_list, > > acpi_check_serial_bus_slave, > > --