Bugzilla – Attachment 113274 Details for
Bug 231088
Resume after suspend to disk fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
PM debug patch #3
pm-debug.patch (text/x-patch), 8.28 KB, created by
Tejun Heo
on 2007-01-17 06:27:19 UTC
(
hide
)
Description:
PM debug patch #3
Filename:
MIME Type:
Creator:
Tejun Heo
Created:
2007-01-17 06:27:19 UTC
Size:
8.28 KB
patch
obsolete
>diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c >index 7daa60b..e0f1e61 100644 >--- a/drivers/ata/ahci.c >+++ b/drivers/ata/ahci.c >@@ -1330,7 +1330,7 @@ static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg) > > rc = ahci_deinit_port(port_mmio, hpriv->cap, &emsg); > if (rc == 0) >- ahci_power_down(port_mmio, hpriv->cap); >+ /*ahci_power_down(port_mmio, hpriv->cap)*/; > else { > ata_port_printk(ap, KERN_ERR, "%s (%d)\n", emsg, rc); > ahci_init_port(port_mmio, hpriv->cap, >diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c >index 37a979c..3737484 100644 >--- a/drivers/ata/libata-core.c >+++ b/drivers/ata/libata-core.c >@@ -5206,6 +5206,9 @@ static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg, > unsigned long flags; > int i, rc; > >+ printk("ata_host_request_pm: PM requested, mesg=%d action=0x%x ehi_f=0x%x wait=%d\n", >+ mesg.event, action, ehi_flags, wait); >+ > for (i = 0; i < host->n_ports; i++) { > struct ata_port *ap = host->ports[i]; > >@@ -5215,6 +5218,8 @@ static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg, > if (ap->pflags & ATA_PFLAG_PM_PENDING) { > ata_port_wait_eh(ap); > WARN_ON(ap->pflags & ATA_PFLAG_PM_PENDING); >+ ata_port_printk(ap, KERN_INFO, "ahrp: waiting for " >+ "the previous resume to complete\n"); > } > > /* request PM ops to EH */ >@@ -5230,6 +5235,7 @@ static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg, > ap->eh_info.action |= action; > ap->eh_info.flags |= ehi_flags; > >+ ata_port_printk(ap, KERN_INFO, "ahrp: EH requested\n"); > ata_port_schedule_eh(ap); > > spin_unlock_irqrestore(ap->lock, flags); >@@ -5241,6 +5247,7 @@ static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg, > if (rc) > return rc; > } >+ ata_port_printk(ap, KERN_INFO, "ahrp: done\n"); > } > > return 0; >@@ -5265,7 +5272,7 @@ int ata_host_suspend(struct ata_host *host, pm_message_t mesg) > { > int i, j, rc; > >- rc = ata_host_request_pm(host, mesg, 0, ATA_EHI_QUIET, 1); >+ rc = ata_host_request_pm(host, mesg, 0, 0/*ATA_EHI_QUIET*/, 1); > if (rc) > goto fail; > >@@ -5311,7 +5318,7 @@ int ata_host_suspend(struct ata_host *host, pm_message_t mesg) > void ata_host_resume(struct ata_host *host) > { > ata_host_request_pm(host, PMSG_ON, ATA_EH_SOFTRESET, >- ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, 0); >+ ATA_EHI_NO_AUTOPSY/* | ATA_EHI_QUIET*/, 0); > host->dev->power.power_state = PMSG_ON; > } > >diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c >index f603ddd..5d97e4a 100644 >--- a/drivers/ata/libata-eh.c >+++ b/drivers/ata/libata-eh.c >@@ -1757,15 +1757,18 @@ static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev) > > WARN_ON(dev->flags & ATA_DFLAG_SUSPENDED); > >+ ata_dev_printk(dev, KERN_INFO, "EH: performing ATA_EH_SUSPEND\n"); > ata_eh_about_to_do(ap, dev, ATA_EH_SUSPEND); > > if (dev->class == ATA_DEV_ATA && !(action & ATA_EH_PM_FREEZE)) { > /* flush cache */ >+ ata_dev_printk(dev, KERN_INFO, "EH: flushing cache\n"); > rc = ata_flush_cache(dev); > if (rc) > break; > > /* spin down */ >+ ata_dev_printk(dev, KERN_INFO, "EH: spinning down\n"); > err_mask = ata_do_simple_cmd(dev, ATA_CMD_STANDBYNOW1); > if (err_mask) { > ata_dev_printk(dev, KERN_ERR, "failed to " >@@ -1781,6 +1784,7 @@ static int ata_eh_suspend(struct ata_port *ap, struct ata_device **r_failed_dev) > spin_unlock_irqrestore(ap->lock, flags); > > ata_eh_done(ap, dev, ATA_EH_SUSPEND); >+ ata_dev_printk(dev, KERN_INFO, "EH: suspended\n"); > } > > if (rc) >@@ -1818,6 +1822,7 @@ static void ata_eh_prep_resume(struct ata_port *ap) > if (!ata_dev_enabled(dev) || !(action & ATA_EH_RESUME)) > continue; > >+ ata_dev_printk(dev, KERN_INFO, "EH: resume scheduled\n"); > spin_lock_irqsave(ap->lock, flags); > dev->flags &= ~ATA_DFLAG_SUSPENDED; > spin_unlock_irqrestore(ap->lock, flags); >@@ -1857,8 +1862,10 @@ static int ata_eh_resume(struct ata_port *ap, struct ata_device **r_failed_dev) > continue; > > ata_eh_about_to_do(ap, dev, ATA_EH_RESUME); >+ ata_dev_printk(dev, KERN_INFO, "EH: resuming\n"); > > if (dev->class == ATA_DEV_ATA && !(action & ATA_EH_PM_FREEZE)) { >+ ata_dev_printk(dev, KERN_INFO, "EH: spinning up\n"); > err_mask = ata_do_simple_cmd(dev, > ATA_CMD_IDLEIMMEDIATE); > if (err_mask) { >@@ -1870,6 +1877,7 @@ static int ata_eh_resume(struct ata_port *ap, struct ata_device **r_failed_dev) > } > } > >+ ata_dev_printk(dev, KERN_INFO, "EH: resumed\n"); > ata_eh_done(ap, dev, ATA_EH_RESUME); > } > >@@ -2212,6 +2220,8 @@ static void ata_eh_handle_port_suspend(struct ata_port *ap) > > WARN_ON(ap->pflags & ATA_PFLAG_SUSPENDED); > >+ ata_port_printk(ap, KERN_INFO, "EH: suspending port\n"); >+ > /* suspend */ > ata_eh_freeze_port(ap); > >@@ -2273,6 +2283,8 @@ static void ata_eh_handle_port_resume(struct ata_port *ap) > if (!(ap->pflags & ATA_PFLAG_SUSPENDED)) > goto done; > >+ ata_port_printk(ap, KERN_INFO, "EH: resuming port\n"); >+ > #ifdef CONFIG_ATA_ACPI > if (!(ap->flags & ATA_FLAG_SATA)) { > /* Call _STM for PATA ports */ >diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c >index bf5b1b3..130155d 100644 >--- a/drivers/ata/libata-scsi.c >+++ b/drivers/ata/libata-scsi.c >@@ -454,10 +454,12 @@ int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t mesg) > if (!dev) > goto out; > >+ ata_dev_printk(dev, KERN_INFO, "dev_sus: requested, mesg=%d\n", mesg.event); > spin_lock_irqsave(ap->lock, flags); > > /* wait for the previous resume to complete */ > while (dev->flags & ATA_DFLAG_SUSPENDED) { >+ ata_dev_printk(dev, KERN_INFO, "dev_sus: waiting for the preivous suspend to finish\n"); > spin_unlock_irqrestore(ap->lock, flags); > ata_port_wait_eh(ap); > spin_lock_irqsave(ap->lock, flags); >@@ -465,15 +467,18 @@ int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t mesg) > > /* if @sdev is already detached, nothing to do */ > if (sdev->sdev_state == SDEV_OFFLINE || >- sdev->sdev_state == SDEV_CANCEL || sdev->sdev_state == SDEV_DEL) >+ sdev->sdev_state == SDEV_CANCEL || sdev->sdev_state == SDEV_DEL) { >+ ata_dev_printk(dev, KERN_INFO, "dev_sus: device dead, nothing to do\n"); > goto out_unlock; >+ } > > /* request suspend */ > action = ATA_EH_SUSPEND; > if (mesg.event != PM_EVENT_SUSPEND) > action |= ATA_EH_PM_FREEZE; > ap->eh_info.dev_action[dev->devno] |= action; >- ap->eh_info.flags |= ATA_EHI_QUIET; >+ /*ap->eh_info.flags |= ATA_EHI_QUIET;*/ >+ ata_dev_printk(dev, KERN_INFO, "dev_sus: requesting EH action=0x%x\n", action); > ata_port_schedule_eh(ap); > > spin_unlock_irqrestore(ap->lock, flags); >@@ -490,6 +495,7 @@ int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t mesg) > sdev->sdev_state != SDEV_CANCEL && sdev->sdev_state != SDEV_DEL && > !(dev->flags & ATA_DFLAG_SUSPENDED)) > rc = -EIO; >+ ata_dev_printk(dev, KERN_INFO, "dev_sus: returned, rc=%d\n", rc); > > out_unlock: > spin_unlock_irqrestore(ap->lock, flags); >@@ -524,12 +530,15 @@ int ata_scsi_device_resume(struct scsi_device *sdev) > if (!dev) > goto out; > >+ ata_dev_printk(dev, KERN_INFO, "dev_res: device_resume requested\n"); > spin_lock_irqsave(ap->lock, flags); > > /* if @sdev is already detached, nothing to do */ > if (sdev->sdev_state == SDEV_OFFLINE || >- sdev->sdev_state == SDEV_CANCEL || sdev->sdev_state == SDEV_DEL) >+ sdev->sdev_state == SDEV_CANCEL || sdev->sdev_state == SDEV_DEL) { >+ ata_dev_printk(dev, KERN_INFO, "dev_res: device dead, nothing to do\n"); > goto out_unlock; >+ } > > /* request resume */ > action = ATA_EH_RESUME; >@@ -543,8 +552,9 @@ int ata_scsi_device_resume(struct scsi_device *sdev) > * those if we're the only device on this link. > */ > if (ata_port_max_devices(ap) == 1) >- ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET; >+ ehi->flags |= ATA_EHI_NO_AUTOPSY/* | ATA_EHI_QUIET*/; > >+ ata_dev_printk(dev, KERN_INFO, "dev_res: requesting EH action=0x%x\n", action); > ata_port_schedule_eh(ap); > > out_unlock: >diff --git a/kernel/power/disk.c b/kernel/power/disk.c >index e13e740..6fad333 100644 >--- a/kernel/power/disk.c >+++ b/kernel/power/disk.c >@@ -129,7 +129,11 @@ int pm_suspend_disk(void) > if (in_suspend) { > device_resume(); > pr_debug("PM: writing image.\n"); >- error = swsusp_write(); >+ /*error = swsusp_write();*/ >+ printk("PM: XXX: failing write image after sleeping 30 secs\n"); >+ ssleep(30); >+ printk("PM: XXX: failing w/ -EINVAL\n"); >+ error = -EINVAL; > if (!error) > power_down(pm_disk_mode); > else {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 231088
:
111197
|
111198
|
113021
|
113022
|
113081
|
113103
|
113123
| 113274 |
113341
|
113426