diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2010-02-21 11:37:57 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-03-03 08:02:41 -0500 |
commit | 64355b929dec0cb6271e4ac7834c9cf262961e40 (patch) | |
tree | aa1768917c57fdb95f7320a499f27bf76af55d08 /drivers/scsi/ibmvscsi/ibmvscsi.c | |
parent | c03af1ae1cce97a5530b907ea03625ce6e00214e (diff) |
[SCSI] ibmvscsi: Add suspend/resume support
Adds support for resuming from suspend for IBM VSCSI devices. We may have
lost an interrupt over the suspend, so we just kick the interrupt handler
to process anything that is outstanding. We expect to find a transport event
indicating we need to reestablish our CRQ.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/ibmvscsi/ibmvscsi.c')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index e3a18e0ef276..dc1bcbe3b176 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -71,6 +71,7 @@ | |||
71 | #include <linux/dma-mapping.h> | 71 | #include <linux/dma-mapping.h> |
72 | #include <linux/delay.h> | 72 | #include <linux/delay.h> |
73 | #include <linux/of.h> | 73 | #include <linux/of.h> |
74 | #include <linux/pm.h> | ||
74 | #include <asm/firmware.h> | 75 | #include <asm/firmware.h> |
75 | #include <asm/vio.h> | 76 | #include <asm/vio.h> |
76 | #include <scsi/scsi.h> | 77 | #include <scsi/scsi.h> |
@@ -1991,6 +1992,19 @@ static int ibmvscsi_remove(struct vio_dev *vdev) | |||
1991 | } | 1992 | } |
1992 | 1993 | ||
1993 | /** | 1994 | /** |
1995 | * ibmvscsi_resume: Resume from suspend | ||
1996 | * @dev: device struct | ||
1997 | * | ||
1998 | * We may have lost an interrupt across suspend/resume, so kick the | ||
1999 | * interrupt handler | ||
2000 | */ | ||
2001 | static int ibmvscsi_resume(struct device *dev) | ||
2002 | { | ||
2003 | struct ibmvscsi_host_data *hostdata = dev_get_drvdata(dev); | ||
2004 | return ibmvscsi_ops->resume(hostdata); | ||
2005 | } | ||
2006 | |||
2007 | /** | ||
1994 | * ibmvscsi_device_table: Used by vio.c to match devices in the device tree we | 2008 | * ibmvscsi_device_table: Used by vio.c to match devices in the device tree we |
1995 | * support. | 2009 | * support. |
1996 | */ | 2010 | */ |
@@ -2000,6 +2014,10 @@ static struct vio_device_id ibmvscsi_device_table[] __devinitdata = { | |||
2000 | }; | 2014 | }; |
2001 | MODULE_DEVICE_TABLE(vio, ibmvscsi_device_table); | 2015 | MODULE_DEVICE_TABLE(vio, ibmvscsi_device_table); |
2002 | 2016 | ||
2017 | static struct dev_pm_ops ibmvscsi_pm_ops = { | ||
2018 | .resume = ibmvscsi_resume | ||
2019 | }; | ||
2020 | |||
2003 | static struct vio_driver ibmvscsi_driver = { | 2021 | static struct vio_driver ibmvscsi_driver = { |
2004 | .id_table = ibmvscsi_device_table, | 2022 | .id_table = ibmvscsi_device_table, |
2005 | .probe = ibmvscsi_probe, | 2023 | .probe = ibmvscsi_probe, |
@@ -2008,6 +2026,7 @@ static struct vio_driver ibmvscsi_driver = { | |||
2008 | .driver = { | 2026 | .driver = { |
2009 | .name = "ibmvscsi", | 2027 | .name = "ibmvscsi", |
2010 | .owner = THIS_MODULE, | 2028 | .owner = THIS_MODULE, |
2029 | .pm = &ibmvscsi_pm_ops, | ||
2011 | } | 2030 | } |
2012 | }; | 2031 | }; |
2013 | 2032 | ||