diff options
author | Tejun Heo <htejun@gmail.com> | 2007-09-23 00:14:13 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-12 14:55:42 -0400 |
commit | 7d77b247088fb360aa74bfdd9e19bce1e1987668 (patch) | |
tree | add1b03309dd6fa82eb0f47e1a88766695f38f28 /drivers/ata/libata-core.c | |
parent | e31e8531d668c9c4dc7883054788f89805188003 (diff) |
libata-pmp-prep: implement sata_async_notification()
AN serves multiple purposes. For ATAPI, it's used for media change
notification. For PMP, for downstream PHY status change notification.
Implement sata_async_notification() which demultiplexes AN.
To avoid unnecessary port events, ATAPI AN is not enabled if PMP is
attached but SNTF is not available.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Kriten Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 376dbd80cc93..8b08e7bdd24d 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -2016,6 +2016,7 @@ int ata_dev_configure(struct ata_device *dev) | |||
2016 | else if (dev->class == ATA_DEV_ATAPI) { | 2016 | else if (dev->class == ATA_DEV_ATAPI) { |
2017 | const char *cdb_intr_string = ""; | 2017 | const char *cdb_intr_string = ""; |
2018 | const char *atapi_an_string = ""; | 2018 | const char *atapi_an_string = ""; |
2019 | u32 sntf; | ||
2019 | 2020 | ||
2020 | rc = atapi_cdb_len(id); | 2021 | rc = atapi_cdb_len(id); |
2021 | if ((rc < 12) || (rc > ATAPI_CDB_LEN)) { | 2022 | if ((rc < 12) || (rc > ATAPI_CDB_LEN)) { |
@@ -2027,11 +2028,14 @@ int ata_dev_configure(struct ata_device *dev) | |||
2027 | } | 2028 | } |
2028 | dev->cdb_len = (unsigned int) rc; | 2029 | dev->cdb_len = (unsigned int) rc; |
2029 | 2030 | ||
2030 | /* | 2031 | /* Enable ATAPI AN if both the host and device have |
2031 | * check to see if this ATAPI device supports | 2032 | * the support. If PMP is attached, SNTF is required |
2032 | * Asynchronous Notification | 2033 | * to enable ATAPI AN to discern between PHY status |
2034 | * changed notifications and ATAPI ANs. | ||
2033 | */ | 2035 | */ |
2034 | if ((ap->flags & ATA_FLAG_AN) && ata_id_has_atapi_AN(id)) { | 2036 | if ((ap->flags & ATA_FLAG_AN) && ata_id_has_atapi_AN(id) && |
2037 | (!ap->nr_pmp_links || | ||
2038 | sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf) == 0)) { | ||
2035 | unsigned int err_mask; | 2039 | unsigned int err_mask; |
2036 | 2040 | ||
2037 | /* issue SET feature command to turn this on */ | 2041 | /* issue SET feature command to turn this on */ |
@@ -7248,6 +7252,7 @@ EXPORT_SYMBOL_GPL(ata_port_schedule_eh); | |||
7248 | EXPORT_SYMBOL_GPL(ata_link_abort); | 7252 | EXPORT_SYMBOL_GPL(ata_link_abort); |
7249 | EXPORT_SYMBOL_GPL(ata_port_abort); | 7253 | EXPORT_SYMBOL_GPL(ata_port_abort); |
7250 | EXPORT_SYMBOL_GPL(ata_port_freeze); | 7254 | EXPORT_SYMBOL_GPL(ata_port_freeze); |
7255 | EXPORT_SYMBOL_GPL(sata_async_notification); | ||
7251 | EXPORT_SYMBOL_GPL(ata_eh_freeze_port); | 7256 | EXPORT_SYMBOL_GPL(ata_eh_freeze_port); |
7252 | EXPORT_SYMBOL_GPL(ata_eh_thaw_port); | 7257 | EXPORT_SYMBOL_GPL(ata_eh_thaw_port); |
7253 | EXPORT_SYMBOL_GPL(ata_eh_qc_complete); | 7258 | EXPORT_SYMBOL_GPL(ata_eh_qc_complete); |