Commit 867f9d46 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Rafael J. Wysocki

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 b355cee8
  Author: Zhang Rui <rui.zhang@intel.com>
  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.

Fixes: b355cee8 (ACPI / resources: ignore invalid ACPI device resources)
Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
Acked-by: default avatarZhang Rui <rui.zhang@intel.com>
Cc: 3.14+ <stable@vger.kernel.org> # 3.14+
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent cd3de83f
...@@ -77,7 +77,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) ...@@ -77,7 +77,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res)
switch (ares->type) { switch (ares->type) {
case ACPI_RESOURCE_TYPE_MEMORY24: case ACPI_RESOURCE_TYPE_MEMORY24:
memory24 = &ares->data.memory24; memory24 = &ares->data.memory24;
if (!memory24->address_length) if (!memory24->minimum && !memory24->address_length)
return false; return false;
acpi_dev_get_memresource(res, memory24->minimum, acpi_dev_get_memresource(res, memory24->minimum,
memory24->address_length, memory24->address_length,
...@@ -85,7 +85,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) ...@@ -85,7 +85,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res)
break; break;
case ACPI_RESOURCE_TYPE_MEMORY32: case ACPI_RESOURCE_TYPE_MEMORY32:
memory32 = &ares->data.memory32; memory32 = &ares->data.memory32;
if (!memory32->address_length) if (!memory32->minimum && !memory32->address_length)
return false; return false;
acpi_dev_get_memresource(res, memory32->minimum, acpi_dev_get_memresource(res, memory32->minimum,
memory32->address_length, memory32->address_length,
...@@ -93,7 +93,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res) ...@@ -93,7 +93,7 @@ bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res)
break; break;
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
fixed_memory32 = &ares->data.fixed_memory32; fixed_memory32 = &ares->data.fixed_memory32;
if (!fixed_memory32->address_length) if (!fixed_memory32->address && !fixed_memory32->address_length)
return false; return false;
acpi_dev_get_memresource(res, fixed_memory32->address, acpi_dev_get_memresource(res, fixed_memory32->address,
fixed_memory32->address_length, fixed_memory32->address_length,
...@@ -150,7 +150,7 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res) ...@@ -150,7 +150,7 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res)
switch (ares->type) { switch (ares->type) {
case ACPI_RESOURCE_TYPE_IO: case ACPI_RESOURCE_TYPE_IO:
io = &ares->data.io; io = &ares->data.io;
if (!io->address_length) if (!io->minimum && !io->address_length)
return false; return false;
acpi_dev_get_ioresource(res, io->minimum, acpi_dev_get_ioresource(res, io->minimum,
io->address_length, io->address_length,
...@@ -158,7 +158,7 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res) ...@@ -158,7 +158,7 @@ bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res)
break; break;
case ACPI_RESOURCE_TYPE_FIXED_IO: case ACPI_RESOURCE_TYPE_FIXED_IO:
fixed_io = &ares->data.fixed_io; fixed_io = &ares->data.fixed_io;
if (!fixed_io->address_length) if (!fixed_io->address && !fixed_io->address_length)
return false; return false;
acpi_dev_get_ioresource(res, fixed_io->address, acpi_dev_get_ioresource(res, fixed_io->address,
fixed_io->address_length, fixed_io->address_length,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment