From patchwork Thu Jun 19 10:41:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Whitcroft X-Patchwork-Id: 4382281 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B6123BEEAA for ; Thu, 19 Jun 2014 10:41:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB1DC201F7 for ; Thu, 19 Jun 2014 10:41:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB5BB20268 for ; Thu, 19 Jun 2014 10:41:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757228AbaFSKle (ORCPT ); Thu, 19 Jun 2014 06:41:34 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:63087 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756093AbaFSKle (ORCPT ); Thu, 19 Jun 2014 06:41:34 -0400 Received: by mail-wi0-f179.google.com with SMTP id cc10so2598246wib.12 for ; Thu, 19 Jun 2014 03:41:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=V3xuXj16zTThCDj7mPcfbqQVdB0r2uU9zpv3orHA6aA=; b=VarbgpTNZDdwA6WTIMd+4n2m1PwptkGK77r+mlLaw6TEIUklqMPZJsGa02FV9x6+8Z 4P4kjfc3ZKxzasPSz9NxmCeFO71ceZ7Jib8rJvZs2xI/STpNSmxb6mt8weOChDtLesho 5wp4rR/h98/h2SAEXuk5VXOVSs5YCELcXrNunxal8O6K47fmcRY9ICbkBSbwruqn/MrI iUjrgJjxx79M+nRkji6fyFFCrKyov+t+nyQJjHrMyo2esNixtYrCj+y34ZsXzi8DdL5o DxiIYPzg/siwrQrcN/t1hIL4s9iU36d1IE8PJPj6E/WrBwBQ5zZQL+zw2Szi9QkyCnJd 5/jw== X-Gm-Message-State: ALoCoQmzmia4po0UcmaUJg82JJXx9kyxFHFJmOsgXUie95CmmWVTF6N2OW9V4pzkrhbNrmhjQcit X-Received: by 10.180.38.107 with SMTP id f11mr5199225wik.59.1403174492681; Thu, 19 Jun 2014 03:41:32 -0700 (PDT) Received: from localhost ([2001:470:6973:2:ad6c:8f10:293e:56ec]) by mx.google.com with ESMTPSA id dt7sm9729618wic.6.2014.06.19.03.41.31 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Jun 2014 03:41:32 -0700 (PDT) Date: Thu, 19 Jun 2014 11:41:30 +0100 From: Andy Whitcroft To: Zhang Rui , Len Brown , "Rafael J. Wysocki" Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: ACPI resource change triggers loss of serial ports Message-ID: <20140619104130.GA11561@dm> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The recently merged change (in v3.14-rc6) to ACPI resource detection (below) causes all zero length ACPI resources to be elided from the table: commit b355cee88e3b1a193f0e9a81db810f6f83ad728b Author: Zhang Rui Date: Thu Feb 27 11:37:15 2014 +0800 ACPI / resources: ignore invalid ACPI device resources This change has caused a regression in (at least) serial port detection for a number of machines (see LP#1313981 [1]). These seem to represent their IO regions (presumably incorrectly) as a zero length region. Reverting the above commit restores these serial devices. For Zhang's case I wonder if this check could be tightened up to cover only the zero base, something like the (untested) patch below. -apw [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1313981 From e5211c68278387ef65e483bcfedd5581a79ec783 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Thu, 19 Jun 2014 11:19:16 +0100 Subject: [PATCH] ACPI / Resources: only reject zero length resources based at address zero The recently merged change (in v3.14-rc6) to ACPI resource detection (below) causes all zero length ACPI resources to be elided from the table: commit b355cee88e3b1a193f0e9a81db810f6f83ad728b Author: Zhang Rui Date: Thu Feb 27 11:37:15 2014 +0800 ACPI / resources: ignore invalid ACPI device resources This change has caused a regression in (at least) serial port detection for a number of machines (see LP#1313981 [1]). These seem to represent their IO regions (presumably incorrectly) as a zero length region. Reverting the above commit restores these serial devices. Only elide zero length resources which lie at address 0. Signed-off-by: Andy Whitcroft Acked-by: Zhang Rui --- drivers/acpi/resource.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 0bdacc5..2ba8f02 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -77,7 +77,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) switch (ares->type) { case ACPI_RESOURCE_TYPE_MEMORY24: memory24 = &ares->data.memory24; - if (!memory24->address_length) + if (!memory24->minimum && !memory24->address_length) return false; acpi_dev_get_memresource(res, memory24->minimum, memory24->address_length, @@ -85,7 +85,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) break; case ACPI_RESOURCE_TYPE_MEMORY32: memory32 = &ares->data.memory32; - if (!memory32->address_length) + if (!memory32->minimum && !memory32->address_length) return false; acpi_dev_get_memresource(res, memory32->minimum, memory32->address_length, @@ -93,7 +93,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) break; case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: fixed_memory32 = &ares->data.fixed_memory32; - if (!fixed_memory32->address_length) + if (!fixed_memory32->address && !fixed_memory32->address_length) return false; acpi_dev_get_memresource(res, fixed_memory32->address, fixed_memory32->address_length, @@ -150,7 +150,7 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res) switch (ares->type) { case ACPI_RESOURCE_TYPE_IO: io = &ares->data.io; - if (!io->address_length) + if (!io->minimum && !io->address_length) return false; acpi_dev_get_ioresource(res, io->minimum, io->address_length, @@ -158,7 +158,7 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res) break; case ACPI_RESOURCE_TYPE_FIXED_IO: fixed_io = &ares->data.fixed_io; - if (!fixed_io->address_length) + if (!fixed_io->address && !fixed_io->address_length) return false; acpi_dev_get_ioresource(res, fixed_io->address, fixed_io->address_length,