From 2fcbdcb4c802fe40d6827dbc365dac90cfe8c0a3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 21 Jun 2012 23:41:46 -0700 Subject: [SCSI] libata: export ata_port suspend/resume infrastructure for sas Reuse ata_port_{suspend|resume}_common for sas. This path is chosen over adding coordination between ata-tranport and sas-transport because libsas wants to revalidate the domain at resume-time at the host level. It can not validate links have resumed properly until libata has had a chance to perform its revalidation, and any sane placing of an ata_port in the sas-transport model would delay it's resumption until after the host. Export the common portion of port suspend/resume (bypass pm_runtime), and allow sas to perform these operations asynchronously (similar to the libsas async-ata probe implmentation). Async operation is determined by having an external, rather than stack based, location for storing the result of the operation. Signed-off-by: Dan Williams Reviewed-by: Jacek Danecki Acked-by: Jeff Garzik Signed-off-by: James Bottomley --- include/linux/libata.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/linux/libata.h') diff --git a/include/linux/libata.h b/include/linux/libata.h index 31a2853e9530..cc834e1136b2 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1013,6 +1013,17 @@ extern bool ata_link_offline(struct ata_link *link); #ifdef CONFIG_PM extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); extern void ata_host_resume(struct ata_host *host); +extern int ata_sas_port_async_suspend(struct ata_port *ap, int *async); +extern int ata_sas_port_async_resume(struct ata_port *ap, int *async); +#else +static inline int ata_sas_port_async_suspend(struct ata_port *ap, int *async) +{ + return 0; +} +static inline int ata_sas_port_async_resume(struct ata_port *ap, int *async) +{ + return 0; +} #endif extern int ata_ratelimit(void); extern void ata_msleep(struct ata_port *ap, unsigned int msecs); -- cgit v1.2.2