aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 18:23:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 18:23:35 -0700
commit51562cba98939da0a1d10fe7c25359b77a069033 (patch)
tree9c18b8ac63eab57a87cb19421734ce9843be30e6 /include
parent7fe0b14b725d6d09a1d9e1409bd465cb88b587f9 (diff)
parent13b74085d92feda78bad1045516d332a1e9a3407 (diff)
Merge tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
Pull libata changes from Jeff Garzik: "Minor libata updates, nothing notable. 1) Apply -- and then revert -- the FUA feature. Caused disk corruption in linux-next, proving it cannot be turned on by default. Net effect to upstream tree: zero 2) New AHCI platform driver sata_highbank 3) Improve SCSI MODE SENSE handling; support MODE SELECT 4) AHCI: support aggressive device sleep (power mgmt) 5) sata_fsl: minor fix 6) pata_arasan: clk support" * tag 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: sata_mv: Fix warnings when no PCI [libata] Makefile: Fix build error in sata_highbank [libata] export ata_dev_set_feature() libata-core: use ATA_LBA in ata_build_rw_tf() ata/ahci_platform: Add clock framework support pata_arasan: add Device Tree probing capability pata_arasan: Add clk_{un}prepare() support ata: add platform driver for Calxeda AHCI controller sata_fsl: add workaround for data length mismatch on freescale V2 controller ahci: implement aggressive SATA device sleep support ata: define enum constants for IDENTIFY DEVICE Revert "libata: enable SATA disk fua detection on default" [libata] scsi: implement MODE SELECT command [libata] scsi: support MODE SENSE request for changeable and default parameters [libata] scsi: Remove unlikely() from FUA check libata: enable SATA disk fua detection on default
Diffstat (limited to 'include')
-rw-r--r--include/linux/ata.h30
-rw-r--r--include/linux/libata.h4
2 files changed, 26 insertions, 8 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 5713d3ac381a..408da9502177 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -77,6 +77,9 @@ enum {
ATA_ID_EIDE_PIO_IORDY = 68,
ATA_ID_ADDITIONAL_SUPP = 69,
ATA_ID_QUEUE_DEPTH = 75,
+ ATA_ID_SATA_CAPABILITY = 76,
+ ATA_ID_SATA_CAPABILITY_2 = 77,
+ ATA_ID_FEATURE_SUPP = 78,
ATA_ID_MAJOR_VER = 80,
ATA_ID_COMMAND_SET_1 = 82,
ATA_ID_COMMAND_SET_2 = 83,
@@ -292,6 +295,13 @@ enum {
/* READ_LOG_EXT pages */
ATA_LOG_SATA_NCQ = 0x10,
+ ATA_LOG_SATA_ID_DEV_DATA = 0x30,
+ ATA_LOG_SATA_SETTINGS = 0x08,
+ ATA_LOG_DEVSLP_MDAT = 0x30,
+ ATA_LOG_DEVSLP_MDAT_MASK = 0x1F,
+ ATA_LOG_DEVSLP_DETO = 0x31,
+ ATA_LOG_DEVSLP_VALID = 0x37,
+ ATA_LOG_DEVSLP_VALID_MASK = 0x80,
/* READ/WRITE LONG (obsolete) */
ATA_CMD_READ_LONG = 0x22,
@@ -345,6 +355,7 @@ enum {
SATA_FPDMA_IN_ORDER = 0x04, /* FPDMA in-order data delivery */
SATA_AN = 0x05, /* Asynchronous Notification */
SATA_SSP = 0x06, /* Software Settings Preservation */
+ SATA_DEVSLP = 0x09, /* Device Sleep */
/* feature values for SET_MAX */
ATA_SET_MAX_ADDR = 0x00,
@@ -558,15 +569,17 @@ static inline int ata_is_data(u8 prot)
#define ata_id_is_ata(id) (((id)[ATA_ID_CONFIG] & (1 << 15)) == 0)
#define ata_id_has_lba(id) ((id)[ATA_ID_CAPABILITY] & (1 << 9))
#define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8))
-#define ata_id_has_ncq(id) ((id)[76] & (1 << 8))
+#define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8))
#define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1)
#define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7))
#define ata_id_has_atapi_AN(id) \
- ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
- ((id)[78] & (1 << 5)) )
+ ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \
+ ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
+ ((id)[ATA_ID_FEATURE_SUPP] & (1 << 5)))
#define ata_id_has_fpdma_aa(id) \
- ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
- ((id)[78] & (1 << 2)) )
+ ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \
+ ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
+ ((id)[ATA_ID_FEATURE_SUPP] & (1 << 2)))
#define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10))
#define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11))
#define ata_id_u32(id,n) \
@@ -578,11 +591,12 @@ static inline int ata_is_data(u8 prot)
((u64) (id)[(n) + 0]) )
#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)
-#define ata_id_has_da(id) ((id)[77] & (1 << 4))
+#define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4))
+#define ata_id_has_devslp(id) ((id)[ATA_ID_FEATURE_SUPP] & (1 << 8))
static inline bool ata_id_has_hipm(const u16 *id)
{
- u16 val = id[76];
+ u16 val = id[ATA_ID_SATA_CAPABILITY];
if (val == 0 || val == 0xffff)
return false;
@@ -592,7 +606,7 @@ static inline bool ata_id_has_hipm(const u16 *id)
static inline bool ata_id_has_dipm(const u16 *id)
{
- u16 val = id[78];
+ u16 val = id[ATA_ID_FEATURE_SUPP];
if (val == 0 || val == 0xffff)
return false;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 64f90e17e51d..464e67c2e77a 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -162,6 +162,7 @@ enum {
ATA_DFLAG_DETACHED = (1 << 25),
ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
+ ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */
ATA_DEV_UNKNOWN = 0, /* unknown device */
ATA_DEV_ATA = 1, /* ATA device */
@@ -649,6 +650,9 @@ struct ata_device {
u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */
};
+ /* Identify Device Data Log (30h), SATA Settings (page 08h) */
+ u8 sata_settings[ATA_SECT_SIZE];
+
/* error history */
int spdn_cnt;
/* ering is CLEAR_END, read comment above CLEAR_END */