diff options
Diffstat (limited to 'drivers/scsi/ibmvscsi/ibmvfc.c')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 732f6d35b4a8..c2eea711a5ce 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c | |||
@@ -28,7 +28,9 @@ | |||
28 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
29 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
30 | #include <linux/kthread.h> | 30 | #include <linux/kthread.h> |
31 | #include <linux/slab.h> | ||
31 | #include <linux/of.h> | 32 | #include <linux/of.h> |
33 | #include <linux/pm.h> | ||
32 | #include <linux/stringify.h> | 34 | #include <linux/stringify.h> |
33 | #include <asm/firmware.h> | 35 | #include <asm/firmware.h> |
34 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
@@ -4736,6 +4738,27 @@ static int ibmvfc_remove(struct vio_dev *vdev) | |||
4736 | } | 4738 | } |
4737 | 4739 | ||
4738 | /** | 4740 | /** |
4741 | * ibmvfc_resume - Resume from suspend | ||
4742 | * @dev: device struct | ||
4743 | * | ||
4744 | * We may have lost an interrupt across suspend/resume, so kick the | ||
4745 | * interrupt handler | ||
4746 | * | ||
4747 | */ | ||
4748 | static int ibmvfc_resume(struct device *dev) | ||
4749 | { | ||
4750 | unsigned long flags; | ||
4751 | struct ibmvfc_host *vhost = dev_get_drvdata(dev); | ||
4752 | struct vio_dev *vdev = to_vio_dev(dev); | ||
4753 | |||
4754 | spin_lock_irqsave(vhost->host->host_lock, flags); | ||
4755 | vio_disable_interrupts(vdev); | ||
4756 | tasklet_schedule(&vhost->tasklet); | ||
4757 | spin_unlock_irqrestore(vhost->host->host_lock, flags); | ||
4758 | return 0; | ||
4759 | } | ||
4760 | |||
4761 | /** | ||
4739 | * ibmvfc_get_desired_dma - Calculate DMA resources needed by the driver | 4762 | * ibmvfc_get_desired_dma - Calculate DMA resources needed by the driver |
4740 | * @vdev: vio device struct | 4763 | * @vdev: vio device struct |
4741 | * | 4764 | * |
@@ -4755,6 +4778,10 @@ static struct vio_device_id ibmvfc_device_table[] __devinitdata = { | |||
4755 | }; | 4778 | }; |
4756 | MODULE_DEVICE_TABLE(vio, ibmvfc_device_table); | 4779 | MODULE_DEVICE_TABLE(vio, ibmvfc_device_table); |
4757 | 4780 | ||
4781 | static struct dev_pm_ops ibmvfc_pm_ops = { | ||
4782 | .resume = ibmvfc_resume | ||
4783 | }; | ||
4784 | |||
4758 | static struct vio_driver ibmvfc_driver = { | 4785 | static struct vio_driver ibmvfc_driver = { |
4759 | .id_table = ibmvfc_device_table, | 4786 | .id_table = ibmvfc_device_table, |
4760 | .probe = ibmvfc_probe, | 4787 | .probe = ibmvfc_probe, |
@@ -4763,6 +4790,7 @@ static struct vio_driver ibmvfc_driver = { | |||
4763 | .driver = { | 4790 | .driver = { |
4764 | .name = IBMVFC_NAME, | 4791 | .name = IBMVFC_NAME, |
4765 | .owner = THIS_MODULE, | 4792 | .owner = THIS_MODULE, |
4793 | .pm = &ibmvfc_pm_ops, | ||
4766 | } | 4794 | } |
4767 | }; | 4795 | }; |
4768 | 4796 | ||