linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, lkml@rtr.ca, axboe@suse.de,
	forrest.zhao@intel.com, alan@lxorguk.ukuu.org.uk,
	linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 02/10] libata: kill per-device PM
Date: Tue, 13 Jun 2006 00:50:28 +0900	[thread overview]
Message-ID: <11501274281240-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11501274284082-git-send-email-htejun@gmail.com>

As new PM implementation will expand the existing controller-wide PM
to trigger ATA bus wide PM operations, it collides with per-device PM.
Kill per-device PM in preparation for new PM framework.

Signed-off-by: Tejun Heo <htejun@gmail.com>

---

 drivers/scsi/ata_piix.c    |    2 -
 drivers/scsi/libata-core.c |   83 --------------------------------------------
 drivers/scsi/libata-scsi.c |   16 --------
 include/linux/libata.h     |    4 --
 4 files changed, 0 insertions(+), 105 deletions(-)

aa2de6bd3de34adcf6a736a70e88f90aba652c3b
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 521b718..75aa47f 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -220,8 +220,6 @@ static struct scsi_host_template piix_sh
 	.slave_configure	= ata_scsi_slave_config,
 	.slave_destroy		= ata_scsi_slave_destroy,
 	.bios_param		= ata_std_bios_param,
-	.resume			= ata_scsi_device_resume,
-	.suspend		= ata_scsi_device_suspend,
 };
 
 static const struct ata_port_operations piix_pata_ops = {
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 51d3b4b..d9fdbbd 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4947,84 +4947,6 @@ static int ata_do_simple_cmd(struct ata_
 	return err;
 }
 
-static int ata_flush_cache(struct ata_device *dev)
-{
-	u8 cmd;
-
-	if (!ata_try_flush_cache(dev))
-		return 0;
-
-	if (ata_id_has_flush_ext(dev->id))
-		cmd = ATA_CMD_FLUSH_EXT;
-	else
-		cmd = ATA_CMD_FLUSH;
-
-	return ata_do_simple_cmd(dev, cmd);
-}
-
-static int ata_standby_drive(struct ata_device *dev)
-{
-	return ata_do_simple_cmd(dev, ATA_CMD_STANDBYNOW1);
-}
-
-static int ata_start_drive(struct ata_device *dev)
-{
-	return ata_do_simple_cmd(dev, ATA_CMD_IDLEIMMEDIATE);
-}
-
-/**
- *	ata_device_resume - wakeup a previously suspended devices
- *	@dev: the device to resume
- *
- *	Kick the drive back into action, by sending it an idle immediate
- *	command and making sure its transfer mode matches between drive
- *	and host.
- *
- */
-int ata_device_resume(struct ata_device *dev)
-{
-	struct ata_port *ap = dev->ap;
-
-	if (ap->flags & ATA_FLAG_SUSPENDED) {
-		struct ata_device *failed_dev;
-
-		ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000);
-
-		ap->flags &= ~ATA_FLAG_SUSPENDED;
-		while (ata_set_mode(ap, &failed_dev))
-			ata_dev_disable(failed_dev);
-	}
-	if (!ata_dev_enabled(dev))
-		return 0;
-	if (dev->class == ATA_DEV_ATA)
-		ata_start_drive(dev);
-
-	return 0;
-}
-
-/**
- *	ata_device_suspend - prepare a device for suspend
- *	@dev: the device to suspend
- *	@state: target power management state
- *
- *	Flush the cache on the drive, if appropriate, then issue a
- *	standbynow command.
- */
-int ata_device_suspend(struct ata_device *dev, pm_message_t state)
-{
-	struct ata_port *ap = dev->ap;
-
-	if (!ata_dev_enabled(dev))
-		return 0;
-	if (dev->class == ATA_DEV_ATA)
-		ata_flush_cache(dev);
-
-	if (state.event != PM_EVENT_FREEZE)
-		ata_standby_drive(dev);
-	ap->flags |= ATA_FLAG_SUSPENDED;
-	return 0;
-}
-
 /**
  *	ata_port_start - Set port up for dma.
  *	@ap: Port to initialize
@@ -5872,11 +5794,6 @@ EXPORT_SYMBOL_GPL(ata_pci_default_filter
 EXPORT_SYMBOL_GPL(ata_pci_clear_simplex);
 #endif /* CONFIG_PCI */
 
-EXPORT_SYMBOL_GPL(ata_device_suspend);
-EXPORT_SYMBOL_GPL(ata_device_resume);
-EXPORT_SYMBOL_GPL(ata_scsi_device_suspend);
-EXPORT_SYMBOL_GPL(ata_scsi_device_resume);
-
 EXPORT_SYMBOL_GPL(ata_eng_timeout);
 EXPORT_SYMBOL_GPL(ata_port_schedule_eh);
 EXPORT_SYMBOL_GPL(ata_port_abort);
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 45a49be..0c30e6c 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -399,22 +399,6 @@ void ata_dump_status(unsigned id, struct
 	}
 }
 
-int ata_scsi_device_resume(struct scsi_device *sdev)
-{
-	struct ata_port *ap = ata_shost_to_port(sdev->host);
-	struct ata_device *dev = __ata_scsi_find_dev(ap, sdev);
-
-	return ata_device_resume(dev);
-}
-
-int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t state)
-{
-	struct ata_port *ap = ata_shost_to_port(sdev->host);
-	struct ata_device *dev = __ata_scsi_find_dev(ap, sdev);
-
-	return ata_device_suspend(dev, state);
-}
-
 /**
  *	ata_to_sense_error - convert ATA error to SCSI error
  *	@id: ATA device number
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 369f821..17c8ced 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -657,10 +657,6 @@ extern int sata_scr_write(struct ata_por
 extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val);
 extern int ata_port_online(struct ata_port *ap);
 extern int ata_port_offline(struct ata_port *ap);
-extern int ata_scsi_device_resume(struct scsi_device *);
-extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
-extern int ata_device_resume(struct ata_device *);
-extern int ata_device_suspend(struct ata_device *, pm_message_t state);
 extern int ata_ratelimit(void);
 extern unsigned int ata_busy_sleep(struct ata_port *ap,
 				   unsigned long timeout_pat,
-- 
1.3.2



  parent reply	other threads:[~2006-06-12 15:50 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-12 15:50 [PATCHSET] new Power Management for libata Tejun Heo
2006-06-12 15:50 ` [PATCH 01/10] libata: power down controller only on PMSG_SUSPEND Tejun Heo
2006-06-12 16:32   ` Jeff Garzik
2006-06-13  2:20     ` Tejun Heo
2006-06-12 15:50 ` [PATCH 03/10] libata: move ata_do_simple_cmd() right below ata_exec_internal() Tejun Heo
2006-06-12 15:50 ` Tejun Heo [this message]
2006-06-12 15:50 ` [PATCH 04/10] libata: update ata_do_simple_cmd() Tejun Heo
2006-06-12 15:50 ` [PATCH 09/10] sata_sil24: separate out sil24_init_controller() Tejun Heo
2006-06-12 15:50 ` [PATCH 10/10] sata_sil24: add suspend/sleep support Tejun Heo
2006-06-12 15:50 ` [PATCH 08/10] sata_sil: " Tejun Heo
2006-06-12 15:50 ` [PATCH 07/10] sata_sil: separate out sil_init_controller() Tejun Heo
2006-06-12 15:50 ` [PATCH 05/10] libata: implement new EH action ATA_EH_SPINUP Tejun Heo
2006-06-14  1:18   ` Jeff Garzik
2006-06-14 15:02     ` Tejun Heo
2006-06-14 15:25       ` Alan Cox
2006-06-12 15:50 ` [PATCH 06/10] libata: implement new Power Management framework Tejun Heo
2006-06-12 16:34   ` Alan Cox
2006-06-13  2:08     ` Tejun Heo
2006-06-13  6:25   ` zhao, forrest
2006-06-13  8:56     ` Tejun Heo
2006-06-13 11:59       ` Jeff Garzik
2006-06-13  8:17   ` zhao, forrest
2006-06-13  9:00     ` Tejun Heo
2006-06-13  8:54       ` zhao, forrest
2006-06-13  9:15         ` Tejun Heo
2006-06-13  8:37   ` zhao, forrest
2006-06-14  7:56   ` zhao, forrest
2006-06-14 13:29     ` Tejun Heo
2006-06-15  1:33       ` zhao, forrest
2006-06-15  3:41         ` Tejun Heo
2006-06-12 15:57 ` [PATCHSET] new Power Management for libata Tejun Heo
2006-06-13  6:28 ` zhao, forrest
2006-06-13  9:09 ` rolled up patch for " Tejun Heo
2006-06-13 10:38   ` Jens Axboe
2006-06-19  5:46     ` Jens Axboe
2006-06-14  1:25 ` [PATCHSET] " Jeff Garzik
2006-06-14 13:46   ` Tejun Heo
2006-06-19  5:18     ` zhao, forrest
2006-06-19  8:46       ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11501274281240-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=axboe@suse.de \
    --cc=forrest.zhao@intel.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=lkml@rtr.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).