From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, alan@lxorguk.ukuu.org.uk, axboe@suse.de,
albertcc@tw.ibm.com, forrest.zhao@intel.com, efalk@google.com,
linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 01/10] libata-pm: add PM related constants, fields, ops and update helpers
Date: Fri, 12 May 2006 01:43:42 +0900 [thread overview]
Message-ID: <11473658221807-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11473658222012-git-send-email-htejun@gmail.com>
Add PM related constants, fields and ops. Also, update
ata_class_enabled/disabled() such that PM classes are considered.
---
include/linux/libata.h | 30 ++++++++++++++++++++++++++----
1 files changed, 26 insertions(+), 4 deletions(-)
0b01a8f6e5988eac0df74062857194288714042a
diff --git a/include/linux/libata.h b/include/linux/libata.h
index bbfd176..c25d8d2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -139,7 +139,9 @@ enum {
ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */
ATA_DEV_ATAPI = 3, /* ATAPI device */
ATA_DEV_ATAPI_UNSUP = 4, /* ATAPI device (unsupported) */
- ATA_DEV_NONE = 5, /* no device */
+ ATA_DEV_PM = 5, /* SATA port multiplier */
+ ATA_DEV_PM_UNSUP = 6, /* SATA port multiplier (unsupported) */
+ ATA_DEV_NONE = 7, /* no device */
ATA_DEV_ERING_SIZE = 32, /* record 32 recent errors */
@@ -161,6 +163,8 @@ enum {
ATA_FLAG_PIO_POLLING = (1 << 10), /* use polling PIO if LLD
* doesn't handle PIO interrupts */
ATA_FLAG_NCQ = (1 << 11), /* host supports NCQ */
+ ATA_FLAG_PM = (1 << 12), /* host supports port multiplier */
+ ATA_FLAG_SDB_NOTIFY = (1 << 13), /* host support SDB notify */
ATA_FLAG_DEBUGMSG = (1 << 14),
ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* flush port task */
@@ -263,6 +267,9 @@ enum {
ATA_PROBE_MAX_TRIES = 3,
ATA_EH_RESET_TRIES = 3,
ATA_EH_DEV_TRIES = 3,
+ ATA_EH_PM_TRIES = 5,
+ ATA_EH_PM_RESET_TRIES = 2,
+ ATA_EH_PM_LINK_TRIES = 2,
/* timing constants in millisecs */
ATA_DEBOUNCE_QUICK_INTERVAL = 5,
@@ -272,6 +279,8 @@ enum {
ATA_DEBOUNCE_INTERVAL = 10,
ATA_DEBOUNCE_DURATION = 500,
ATA_DEBOUNCE_TIMEOUT = 10000,
+
+ ATA_PM_SCR_TIMEOUT = 500,
};
enum hsm_task_states {
@@ -433,7 +442,12 @@ struct ata_device {
/* fields above n_sectors are not cleared across device init */
u64 n_sectors; /* size of device, if ATA */
unsigned int class; /* ATA_DEV_xxx */
- u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
+
+ union {
+ u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
+ u32 gscr[ATA_PM_GSCR_DWORDS]; /* PM GSCR block */
+ };
+
u8 pio_mode;
u8 dma_mode;
u8 xfer_mode;
@@ -580,6 +594,12 @@ struct ata_port_operations {
void (*qc_prep) (struct ata_queued_cmd *qc);
unsigned int (*qc_issue) (struct ata_queued_cmd *qc);
+ /* port multiplier */
+ void (*pm_attach) (struct ata_port *ap);
+ void (*pm_detach) (struct ata_port *ap);
+ int (*pm_read) (struct ata_device *dev, int pmp, int reg, u32 *r_val);
+ int (*pm_write) (struct ata_device *dev, int pmp, int reg, u32 val);
+
/* Error handlers. ->error_handler overrides ->eng_timeout and
* indicates that new-style EH is in place.
*/
@@ -894,12 +914,14 @@ static inline unsigned int ata_tag_inter
*/
static inline unsigned int ata_class_enabled(unsigned int class)
{
- return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI;
+ return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI ||
+ class == ATA_DEV_PM;
}
static inline unsigned int ata_class_disabled(unsigned int class)
{
- return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP;
+ return class == ATA_DEV_ATA_UNSUP || class == ATA_DEV_ATAPI_UNSUP ||
+ class == ATA_DEV_PM_UNSUP;
}
static inline unsigned int ata_class_absent(unsigned int class)
--
1.2.4
next prev parent reply other threads:[~2006-05-11 16:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-11 16:43 [PATCHSET 11/11] implement PM support Tejun Heo
2006-05-11 16:43 ` [PATCH 05/10] sata_sil24: rename PORT_CS_RESUME to PORT_CS_PM_RESUME Tejun Heo
2006-05-11 16:43 ` [PATCH 03/10] libata-pm: implement Port Multiplier support Tejun Heo
2006-05-11 16:43 ` [PATCH 04/10] libata-pm: hook PM support and enable it Tejun Heo
2006-05-11 16:43 ` [PATCH 07/10] sata_sil24: separate out sil24_exec_polled_cmd() Tejun Heo
2006-05-11 16:43 ` [PATCH 06/10] sata_sil24: add PM related constants Tejun Heo
2006-05-11 16:43 ` [PATCH 02/10] libata-pm: update ata_eh_reset() for PM Tejun Heo
2006-05-11 16:43 ` Tejun Heo [this message]
2006-05-11 16:43 ` [PATCH 09/10] sata_sil24: implement PM support Tejun Heo
2006-05-11 16:43 ` [PATCH 08/10] sata_sil24: separate out sil24_do_softreset() Tejun Heo
2006-05-11 16:43 ` [PATCH 10/10] sata_sil24: implement PORT_RST Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11473658221807-git-send-email-htejun@gmail.com \
--to=htejun@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=albertcc@tw.ibm.com \
--cc=axboe@suse.de \
--cc=efalk@google.com \
--cc=forrest.zhao@intel.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).