Commit 11ef697b authored by Kristen Carlson Accardi's avatar Kristen Carlson Accardi Committed by Jeff Garzik

[PATCH] libata: ACPI and _GTF support

_GTF is an acpi method that is used to reinitialize the drive.  It returns
a task file containing ata commands that are sent back to the drive to restore
it to boot up defaults.
Signed-off-by: default avatarKristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
(cherry picked from 9c69cab24b51a89664f4c0dfaf8a436d32117624 commit)
parent 8a03d9a4
......@@ -48,6 +48,7 @@ parameter is applicable:
ISAPNP ISA PnP code is enabled.
ISDN Appropriate ISDN support is enabled.
JOY Appropriate joystick support is enabled.
LIBATA Libata driver is enabled
LP Printer support is enabled.
LOOP Loopback device support is enabled.
M68k M68k architecture is enabled.
......@@ -1038,6 +1039,10 @@ and is between 256 and 4096 characters. It is defined in the file
emulation library even if a 387 maths coprocessor
is present.
noacpi [LIBATA] Disables use of ACPI in libata suspend/resume
when set.
Format: <int>
noaliencache [MM, NUMA] Disables the allcoation of alien caches in
the slab allocator. Saves per-node memory, but will
impact performance on real NUMA hardware.
......
......@@ -161,6 +161,19 @@ config SATA_INTEL_COMBINED
depends on IDE=y && !BLK_DEV_IDE_SATA && (SATA_AHCI || ATA_PIIX)
default y
config SATA_ACPI
bool
depends on ACPI && PCI
default y
help
This option adds support for SATA-related ACPI objects.
These ACPI objects add the ability to retrieve taskfiles
from the ACPI BIOS and write them to the disk controller.
These objects may be related to performance, security,
power management, or other areas.
You can disable this at kernel boot time by using the
option libata.noacpi=1
config PATA_ALI
tristate "ALi PATA support (Experimental)"
depends on PCI && EXPERIMENTAL
......
......@@ -66,4 +66,4 @@ obj-$(CONFIG_ATA_GENERIC) += ata_generic.o
obj-$(CONFIG_PATA_LEGACY) += pata_legacy.o
libata-objs := libata-core.o libata-scsi.o libata-sff.o libata-eh.o
libata-$(CONFIG_SATA_ACPI) += libata-acpi.o
This diff is collapsed.
......@@ -93,6 +93,10 @@ static int ata_probe_timeout = ATA_TMOUT_INTERNAL / HZ;
module_param(ata_probe_timeout, int, 0444);
MODULE_PARM_DESC(ata_probe_timeout, "Set ATA probing timeout (seconds)");
int noacpi;
module_param(noacpi, int, 0444);
MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set");
MODULE_AUTHOR("Jeff Garzik");
MODULE_DESCRIPTION("Library module for ATA devices");
MODULE_LICENSE("GPL");
......@@ -1778,6 +1782,9 @@ int ata_bus_probe(struct ata_port *ap)
/* reset and determine device classes */
ap->ops->phy_reset(ap);
/* retrieve and execute the ATA task file of _GTF */
ata_acpi_exec_tfs(ap);
for (i = 0; i < ATA_MAX_DEVICES; i++) {
dev = &ap->device[i];
......
......@@ -47,6 +47,7 @@ extern struct workqueue_struct *ata_aux_wq;
extern int atapi_enabled;
extern int atapi_dmadir;
extern int libata_fua;
extern int noacpi;
extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev);
extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
u64 block, u32 n_block, unsigned int tf_flags,
......@@ -87,6 +88,15 @@ extern void ata_port_init(struct ata_port *ap, struct ata_host *host,
extern struct ata_probe_ent *ata_probe_ent_alloc(struct device *dev,
const struct ata_port_info *port);
/* libata-acpi.c */
#ifdef CONFIG_SATA_ACPI
extern int ata_acpi_exec_tfs(struct ata_port *ap);
#else
static inline int ata_acpi_exec_tfs(struct ata_port *ap)
{
return 0;
}
#endif
/* libata-scsi.c */
extern struct scsi_transport_template ata_scsi_transport_template;
......
......@@ -35,6 +35,7 @@
#include <linux/ata.h>
#include <linux/workqueue.h>
#include <scsi/scsi_host.h>
#include <linux/acpi.h>
/*
* Define if arch has non-standard setup. This is a _PCI_ standard
......@@ -495,6 +496,10 @@ struct ata_device {
/* error history */
struct ata_ering ering;
unsigned int horkage; /* List of broken features */
#ifdef CONFIG_SATA_ACPI
/* ACPI objects info */
acpi_handle obj_handle;
#endif
};
/* Offset into struct ata_device. Fields above it are maintained
......
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