Skip to content

Commit

Permalink
ACPI/libata: Restore libata.noacpi support
Browse files Browse the repository at this point in the history
This patch restores libata.noacpi support to libata-acpi.c.
There are broken optional control methods for ATA controller devices in the
real world.  The libata.noacpi has been used for a long time as a
workaround to deal with issues caused by the broken ASL codes.
1. The "noacpi" option is introduced by the following commit:
   commit 11ef697
   Date: Thu, 28 Sep 2006 11:29:01 -0700
   Subject: libata: ACPI and _GTF support
2. The "noacpi" option is renamed to "libata_noacpi" by the following
   commit:
   commit d7d0dad
   Date: Wed, 28 Mar 2007 01:57:37 -0400
   Subject: [libata] Disable ACPI by default; fix namespace problems
3. Some of its logics are changed over time - becomes relying on the
   "acpi_handle" bound to the ATA devices since this commit:
   commit fafbae8
   Date: Tue, 15 May 2007 03:28:16 +0900
   Subject: libata-acpi: implement ata_acpi_associate()
4. The option is deleted by the following commit:
   commit 30dcf76
   Date: Mon, 25 Jun 2012 16:13:04 +0800
   Subject: libata: migrate ACPI code over to new bindings
But the libata.noacpi setup is still left in the kernel without codes to
implement it.  So the deletion introduces a regression to the Linux.
This patch disables ATA_ACPI support at runtime by stopping acpi binding
on the ATA devices to fix this regression.
This patch is tested by booting a SATA x86-64 kernel or a PATA x86 kernel
with or without "libata.noacpi=1" kernel command line argument.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Lv Zheng authored and Jeff Garzik committed Apr 30, 2013
1 parent d66af4d commit 19ccee7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ata/libata-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ acpi_handle ata_dev_acpi_handle(struct ata_device *dev)
acpi_integer adr;
struct ata_port *ap = dev->link->ap;

if (dev->flags & ATA_DFLAG_ACPI_DISABLED)
if (libata_noacpi || dev->flags & ATA_DFLAG_ACPI_DISABLED)
return NULL;

if (ap->flags & ATA_FLAG_ACPI_SATA) {
Expand Down Expand Up @@ -1047,7 +1047,7 @@ static int compat_pci_ata(struct ata_port *ap)

static int ata_acpi_bind_host(struct ata_port *ap, acpi_handle *handle)
{
if (ap->flags & ATA_FLAG_ACPI_SATA)
if (libata_noacpi || ap->flags & ATA_FLAG_ACPI_SATA)
return -ENODEV;

*handle = acpi_get_child(DEVICE_ACPI_HANDLE(ap->tdev.parent),
Expand Down

0 comments on commit 19ccee7

Please sign in to comment.