Skip to contentSkip to conversation

Adaptec driver suspend bug ahc_dv_0

DISCUSSION Steven Newbury 2 participants 3 messages Dec 17, 2004 – Dec 18, 2004

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

(Using current bk linus kernel 20041216)
When attempting to use ACPI sleep states on this system, one of the Adaptec driver kernel threads fails to stop:

Dec 17 00:32:47 comet kernel:  stopping tasks failed (1 tasks remaining)
Dec 17 00:32:47 comet kernel: Restarting tasks...<6> Strange, ahc_dv_0 not stop

The ahc_dv_0 thread then spins using 100% CPU in System until the computer is rebooted.

lspci output:

00:00.0 Host bridge: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] (rev 44)
00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP]
00:07.0 ISA bridge: VIA Technologies, Inc. VT82C596 ISA [Mobile South] (rev 12) 00:07.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) 00:07.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 08)
00:07.3 Host bridge: VIA Technologies, Inc. VT82C596 Power Management (rev 20) 00:08.0 SCSI storage controller: Adaptec AIC-7892A U160/m (rev 02) 00:09.0 Ethernet controller: Accton Technology Corporation EN-1216 Ethernet Adapter (rev 11)
00:0b.0 Multimedia audio controller: ESS Technology ES1969 Solo-1 Audiodrive (rev 01)
01:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G400 AGP (rev 04)

=====
Steve

___________________________________________________________
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

#1 lore raw

The driver has never supported suspend, unfortunately, but I have a messy-but-mostly-correct patch for this that I can send you later.

Quoted 46 lines · Steven Newbury

(Using current bk linus kernel 20041216)
When attempting to use ACPI sleep states on this system, one of the Adaptec driver kernel threads fails to stop:

Dec 17 00:32:47 comet kernel:  stopping tasks failed (1 tasks remaining)
Dec 17 00:32:47 comet kernel: Restarting tasks...<6> Strange, ahc_dv_0 not stop

The ahc_dv_0 thread then spins using 100% CPU in System until the computer is rebooted.

lspci output:

00:00.0 Host bridge: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] (rev 44)
00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP]
00:07.0 ISA bridge: VIA Technologies, Inc. VT82C596 ISA [Mobile South] (rev 12) 00:07.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) 00:07.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 08)
00:07.3 Host bridge: VIA Technologies, Inc. VT82C596 Power Management (rev 20) 00:08.0 SCSI storage controller: Adaptec AIC-7892A U160/m (rev 02) 00:09.0 Ethernet controller: Accton Technology Corporation EN-1216 Ethernet Adapter (rev 11)
00:0b.0 Multimedia audio controller: ESS Technology ES1969 Solo-1 Audiodrive (rev 01)
01:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G400 AGP (rev 04)

=====
Steve

___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
In reply to Steven Newbury
Quoted 5 lines · Steven Newbury

(Using current bk linus kernel 20041216)
When attempting to use ACPI sleep states on this system, one of the Adaptec driver kernel threads fails to stop:

You can try the attached patch; it is all of the current power management fixes that are in my local tree. (Most is my own work, one is Shaohua's.) If you are using the -mm tree, you will want to remove the 3c59x patch before applying this, because that is already in -mm.

These patches are believed to be OK for everything except SCSI removable disks that use the sd driver, which need better spinup and media change handling.

Nathan

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/12/17 18:33:47-05:00 [email protected]
# Merge
#

# drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
#   2004/12/17 18:33:45-05:00 [email protected] +0 -0
#   SCCS merged
# 
# drivers/scsi/aic7xxx/aic7xxx_osm.h
#   2004/12/17 18:33:45-05:00 [email protected] +0 -0
#   SCCS merged
# 
# ChangeSet
#   2004/12/17 18:28:55-05:00 [email protected] 
#   update for new pci_save_state api
# 
# drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
#   2004/12/17 18:28:45-05:00 [email protected] +2 -2
#   update for new pci_save_state api
# 
# drivers/scsi/aic7xxx/aic7xxx.h
#   2004/12/17 18:28:45-05:00 [email protected] +0 -2
#   update for new pci_save_state api
# 
# ChangeSet
#   2004/12/02 21:47:43-05:00 [email protected] 
#   sync up
# 
# drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
#   2004/12/02 21:47:33-05:00 [email protected] +1 -1
#   hand merge
# 
# drivers/net/3c59x.c
#   2004/12/02 21:47:33-05:00 [email protected] +1 -1
#   hand merge
# 
# drivers/scsi/aic7xxx/aic7xxx_pci.c
#   2004/12/01 21:52:26-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/scsi/aic7xxx/aic7xxx_osm.h
#   2004/12/01 21:52:26-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/scsi/aic7xxx/aic7xxx_osm.c
#   2004/12/01 21:52:26-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/scsi/sd.c
#   2004/12/01 21:52:25-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/scsi/scsi_sysfs.c
#   2004/12/01 21:52:25-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/scsi/scsi_priv.h
#   2004/12/01 21:52:25-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/scsi/scsi.c
#   2004/12/01 21:52:25-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/scsi/aic7xxx/aic7xxx_core.c
#   2004/12/01 21:52:25-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/scsi/aic7xxx/aic7xxx.h
#   2004/12/01 21:52:25-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/scsi/aic7xxx/aic79xx_osm.c
#   2004/12/01 21:52:25-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/acpi/sleep/main.c
#   2004/12/01 21:52:24-05:00 [email protected] +0 -0
#   Auto merged
# 
# drivers/acpi/bus.c
#   2004/12/01 21:52:24-05:00 [email protected] +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/20 17:08:12-05:00 [email protected] 
#   aic7xxx_acpi.patch7
# 
# drivers/scsi/aic7xxx/aic7xxx_pci.c
#   2004/07/22 20:45:33-04:00 [email protected] +181 -173
#   Import patch aic7xxx_acpi.patch7
# 
# drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
#   2004/07/24 10:28:24-04:00 [email protected] +58 -1
#   Import patch aic7xxx_acpi.patch7
# 
# drivers/scsi/aic7xxx/aic7xxx_osm.h
#   2004/07/24 10:01:00-04:00 [email protected] +1 -0
#   Import patch aic7xxx_acpi.patch7
# 
# drivers/scsi/aic7xxx/aic7xxx_osm.c
#   2004/07/24 09:59:01-04:00 [email protected] +1 -2
#   Import patch aic7xxx_acpi.patch7
# 
# drivers/scsi/aic7xxx/aic7xxx_core.c
#   2004/07/24 09:39:45-04:00 [email protected] +1 -0
#   Import patch aic7xxx_acpi.patch7
# 
# drivers/scsi/aic7xxx/aic7xxx.h
#   2004/07/21 22:42:46-04:00 [email protected] +3 -1
#   Import patch aic7xxx_acpi.patch7
# 
# drivers/scsi/aic7xxx/aic79xx_osm.c
#   2004/07/21 18:30:06-04:00 [email protected] +1 -1
#   Import patch aic7xxx_acpi.patch7
# 
# ChangeSet
#   2004/11/20 17:07:48-05:00 [email protected] 
#   scsi-powermanage-2.6.9.patch
# 
# include/scsi/scsi_driver.h
#   2004/11/20 16:49:28-05:00 [email protected] +4 -0
#   Import patch scsi-powermanage-2.6.9.patch
# 
# drivers/scsi/sd.c
#   2004/11/20 16:49:28-05:00 [email protected] +23 -1
#   Import patch scsi-powermanage-2.6.9.patch
# 
# drivers/scsi/scsi_sysfs.c
#   2004/11/20 16:49:28-05:00 [email protected] +6 -2
#   Import patch scsi-powermanage-2.6.9.patch
# 
# drivers/scsi/scsi_priv.h
#   2004/11/20 16:49:28-05:00 [email protected] +4 -0
#   Import patch scsi-powermanage-2.6.9.patch
# 
# drivers/scsi/scsi.c
#   2004/11/20 16:49:28-05:00 [email protected] +35 -0
#   Import patch scsi-powermanage-2.6.9.patch
# 
# ChangeSet
#   2004/11/20 17:05:53-05:00 [email protected] 
#   maskevent.patch3
# 
# drivers/acpi/sleep/main.c
#   2004/08/12 20:49:37-04:00 [email protected] +3 -1
#   Import patch maskevent.patch3
# 
# drivers/acpi/event.c
#   2004/08/12 20:49:37-04:00 [email protected] +2 -1
#   Import patch maskevent.patch3
# 
# drivers/acpi/bus.c
#   2004/08/12 20:49:37-04:00 [email protected] +2 -1
#   Import patch maskevent.patch3
# 
# ChangeSet
#   2004/11/20 16:35:11-05:00 [email protected] 
#   3c59x-powermanage.patch
# 
# drivers/net/3c59x.c
#   2004/08/11 22:32:58-04:00 [email protected] +14 -11
#   Import patch 3c59x-powermanage.patch
# 
diff -Nru a/drivers/acpi/bus.c b/drivers/acpi/bus.c
--- a/drivers/acpi/bus.c	2004-12-17 19:00:30 -05:00
+++ b/drivers/acpi/bus.c	2004-12-17 19:00:30 -05:00
@@ -291,6 +291,7 @@
 DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);

extern int event_is_open;
+extern int acpi_event_is_masked;

int
acpi_bus_generate_event (
@@ -307,7 +308,7 @@
return_VALUE(-EINVAL);

/* drop event on the floor if no one's listening */
- if (!event_is_open)
+ if (!event_is_open || acpi_event_is_masked)
return_VALUE(0);

event = kmalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC);

drivers/acpi/event.c +2 -1
diff -Nru a/drivers/acpi/event.c b/drivers/acpi/event.c
@@ -17,7 +17,8 @@
 
 /* Global vars for handling event proc entry */
 static spinlock_t		acpi_system_event_lock = SPIN_LOCK_UNLOCKED;
-int				event_is_open = 0;
+int				event_is_open;
+int				acpi_event_is_masked;
 extern struct list_head		acpi_bus_event_list;
 extern wait_queue_head_t	acpi_bus_event_queue;
 
drivers/acpi/sleep/main.c +3 -1
diff -Nru a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
@@ -76,7 +76,7 @@
  *	arch-specific assembly, which in turn call acpi_enter_sleep_state().
  *	It's unfortunate, but it works. Please fix if you're feeling frisky.
  */
-
+extern int acpi_event_is_masked;
 static int acpi_pm_enter(suspend_state_t pm_state)
 {
 	acpi_status status = AE_OK;
@@ -95,6 +95,7 @@
 
 	local_irq_save(flags);
 	acpi_enable_wakeup_device(acpi_state);
+	acpi_event_is_masked = 1;
 	switch (pm_state)
 	{
 	case PM_SUSPEND_STANDBY:
@@ -145,6 +146,7 @@
 
 	acpi_leave_sleep_state(acpi_state);
 	acpi_disable_wakeup_device(acpi_state);
+	acpi_event_is_masked = 0;
 
 	/* reset firmware waking vector */
 	acpi_set_firmware_waking_vector((acpi_physical_address) 0);
drivers/net/3c59x.c +14 -11
diff -Nru a/drivers/net/3c59x.c b/drivers/net/3c59x.c
@@ -1491,7 +1491,7 @@
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	dev->poll_controller = poll_vortex; 
 #endif
-	if (pdev && vp->enable_wol) {
+	if (pdev) {
 		vp->pm_state_valid = 1;
  		pci_save_state(VORTEX_PCI(vp));
  		acpi_set_WOL(dev);
@@ -1548,9 +1548,10 @@
 	unsigned int config;
 	int i;
 
-	if (VORTEX_PCI(vp) && vp->enable_wol) {
+	if (VORTEX_PCI(vp)) {
 		pci_set_power_state(VORTEX_PCI(vp), 0);	/* Go active */
 		pci_restore_state(VORTEX_PCI(vp));
+		pci_enable_device(VORTEX_PCI(vp));
 	}
 
 	/* Before initializing select the active media port. */
@@ -2706,7 +2707,7 @@
 	if (vp->full_bus_master_tx)
 		outl(0, ioaddr + DownListPtr);
 
-	if (final_down && VORTEX_PCI(vp) && vp->enable_wol) {
+	if (final_down && VORTEX_PCI(vp)) {
 		pci_save_state(VORTEX_PCI(vp));
 		acpi_set_WOL(dev);
 	}
@@ -3131,15 +3132,17 @@
 	struct vortex_private *vp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 
-	/* Power up on: 1==Downloaded Filter, 2==Magic Packets, 4==Link Status. */
-	EL3WINDOW(7);
-	outw(2, ioaddr + 0x0c);
-	/* The RxFilter must accept the WOL frames. */
-	outw(SetRxFilter|RxStation|RxMulticast|RxBroadcast, ioaddr + EL3_CMD);
-	outw(RxEnable, ioaddr + EL3_CMD);
+	if (vp->enable_wol) {
+		/* Power up on: 1==Downloaded Filter, 2==Magic Packets, 4==Link Status. */
+		EL3WINDOW(7);
+		outw(2, ioaddr + 0x0c);
+		/* The RxFilter must accept the WOL frames. */
+		outw(SetRxFilter|RxStation|RxMulticast|RxBroadcast, ioaddr + EL3_CMD);
+		outw(RxEnable, ioaddr + EL3_CMD);
 
+		pci_enable_wake(VORTEX_PCI(vp), 0, 1);
+	}
 	/* Change the power state to D3; RxEnable doesn't take effect. */
-	pci_enable_wake(VORTEX_PCI(vp), 0, 1);
 	pci_set_power_state(VORTEX_PCI(vp), 3);
 }
 
@@ -3162,7 +3165,7 @@
 	 */
 	unregister_netdev(dev);
 
-	if (VORTEX_PCI(vp) && vp->enable_wol) {
+	if (VORTEX_PCI(vp)) {
 		pci_set_power_state(VORTEX_PCI(vp), 0);	/* Go active */
 		if (vp->pm_state_valid)
 			pci_restore_state(VORTEX_PCI(vp));
drivers/scsi/aic7xxx/aic79xx_osm.c +1 -1
diff -Nru a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -2526,7 +2526,7 @@
 	sprintf(current->comm, "ahd_dv_%d", ahd->unit);
 #else
 	daemonize("ahd_dv_%d", ahd->unit);
-	current->flags |= PF_FREEZE;
+	current->flags |= PF_NOFREEZE;
 #endif
 	unlock_kernel();
 
drivers/scsi/aic7xxx/aic7xxx.h +1 -1
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h
@@ -1169,7 +1169,7 @@
 /***************************** PCI Front End *********************************/
 struct ahc_pci_identity	*ahc_find_pci_device(ahc_dev_softc_t);
 int			 ahc_pci_config(struct ahc_softc *,
-					struct ahc_pci_identity *);
+					struct ahc_pci_identity *, int resume);
 int			 ahc_pci_test_register_access(struct ahc_softc *);
 
 /*************************** EISA/VL Front End ********************************/
drivers/scsi/aic7xxx/aic7xxx_core.c +1 -0
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -4045,6 +4045,7 @@
 
 	ahc = (struct ahc_softc *)arg;
 
+	ahc_intr_enable(ahc, FALSE);
 	/* This will reset most registers to 0, but not all */
 	ahc_reset(ahc, /*reinit*/FALSE);
 	ahc_outb(ahc, SCSISEQ, 0);
drivers/scsi/aic7xxx/aic7xxx_osm.c +1 -2
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -479,7 +479,6 @@
 static void ahc_linux_release_simq(u_long arg);
 static void ahc_linux_dev_timed_unfreeze(u_long arg);
 static int  ahc_linux_queue_recovery_cmd(Scsi_Cmnd *cmd, scb_flag flag);
-static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc);
 static void ahc_linux_size_nseg(void);
 static void ahc_linux_thread_run_complete_queue(struct ahc_softc *ahc);
 static void ahc_linux_start_dv(struct ahc_softc *ahc);
@@ -2224,7 +2223,7 @@
 	sprintf(current->comm, "ahc_dv_%d", ahc->unit);
 #else
 	daemonize("ahc_dv_%d", ahc->unit);
-	current->flags |= PF_FREEZE;
+	current->flags |= PF_NOFREEZE;
 #endif
 	unlock_kernel();
 
drivers/scsi/aic7xxx/aic7xxx_osm.h +1 -0
diff -Nru a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -638,6 +638,7 @@
 					Scsi_Host_Template *);
 
 uint64_t	ahc_linux_get_memsize(void);
+void		ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc);
 
 /*************************** Pretty Printing **********************************/
 struct info_str {
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +58 -1

83 lines not on this page · raw message

drivers/scsi/aic7xxx/aic7xxx_pci.c +181 -173

418 lines not on this page · raw message

drivers/scsi/scsi.c +35 -0
diff -Nru a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
@@ -60,6 +60,7 @@
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_dbg.h>
 #include <scsi/scsi_device.h>
+#include <scsi/scsi_driver.h>
 #include <scsi/scsi_eh.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_tcq.h>
@@ -1209,6 +1210,40 @@
 #define register_scsi_cpu()
 #define unregister_scsi_cpu()
 #endif /* CONFIG_HOTPLUG_CPU */
+
+#ifdef CONFIG_PM
+int generic_scsi_suspend(struct device *dev, u32 state)
+{
+	int err;
+	struct scsi_device *sdev = to_scsi_device(dev);
+	struct scsi_driver *drv = to_scsi_driver(dev->driver);
+
+	err = scsi_device_quiesce(sdev);
+	if (err)
+		return err;
+
+	if (drv->suspend)
+		return drv->suspend(dev, state);
+
+	return 0;
+}
+
+int generic_scsi_resume(struct device *dev)
+{
+	int err;
+	struct scsi_device *sdev = to_scsi_device(dev);
+	struct scsi_driver *drv = to_scsi_driver(dev->driver);
+
+	if (drv->resume) {
+		err = drv->resume(dev);
+		if (err)
+			return err;
+	}
+
+	scsi_device_resume(sdev);
+	return 0;
+}
+#endif /*CONFIG_PM*/
 
 MODULE_DESCRIPTION("SCSI core");
 MODULE_LICENSE("GPL");
drivers/scsi/scsi_priv.h +4 -0
diff -Nru a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
@@ -82,6 +82,10 @@
 static inline void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
 	{ };
 #endif
+#ifdef CONFIG_PM
+extern int generic_scsi_suspend(struct device *dev, u32 state);
+extern int generic_scsi_resume(struct device *dev);
+#endif
 
 /* scsi_devinfo.c */
 extern int scsi_get_device_flags(struct scsi_device *sdev,
drivers/scsi/scsi_sysfs.c +6 -2
diff -Nru a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
@@ -201,8 +201,12 @@
 }
 
 struct bus_type scsi_bus_type = {
-        .name		= "scsi",
-        .match		= scsi_bus_match,
+	.name		= "scsi",
+	.match		= scsi_bus_match,
+#ifdef CONFIG_PM
+	.suspend	= generic_scsi_suspend,
+	.resume		= generic_scsi_resume,
+#endif
 };
 
 int scsi_sysfs_register(void)
drivers/scsi/sd.c +23 -1
diff -Nru a/drivers/scsi/sd.c b/drivers/scsi/sd.c
@@ -117,6 +117,10 @@
 
 static int sd_probe(struct device *);
 static int sd_remove(struct device *);
+#ifdef CONFIG_PM
+static int sd_suspend(struct device *, u32);
+static int sd_resume(struct device *);
+#endif
 static void sd_shutdown(struct device *dev);
 static void sd_rescan(struct device *);
 static int sd_init_command(struct scsi_cmnd *);
@@ -135,6 +139,10 @@
 	.rescan			= sd_rescan,
 	.init_command		= sd_init_command,
 	.issue_flush		= sd_issue_flush,
+#ifdef CONFIG_PM
+	.suspend		= sd_suspend,
+	.resume			= sd_resume,
+#endif
 };
 
 /*
@@ -1572,7 +1580,21 @@
 	printk(KERN_NOTICE "Synchronizing SCSI cache for disk %s: \n",
 			sdkp->disk->disk_name);
 	sd_sync_cache(sdp);
-}	
+}
+
+#ifdef CONFIG_PM
+static int sd_suspend(struct device *dev, u32 state)
+{
+	sd_shutdown(dev);
+	return 0;
+}
+
+static int sd_resume(struct device *dev)
+{
+	sd_rescan(dev);
+	return 0;
+}
+#endif /*CONFIG_PM*/
 
 /**
  *	init_sd - entry point for this driver (both when built in or when
include/scsi/scsi_driver.h +4 -0
diff -Nru a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
@@ -14,6 +14,10 @@
 	int (*init_command)(struct scsi_cmnd *);
 	void (*rescan)(struct device *);
 	int (*issue_flush)(struct device *, sector_t *);
+#ifdef CONFIG_PM
+	int (*suspend)(struct device *dev, u32 state);
+	int (*resume)(struct device *dev);
+#endif
 };
 #define to_scsi_driver(drv) \
 	container_of((drv), struct scsi_driver, gendrv)