Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47349
b: refs/heads/master
c: 553c4aa
h: refs/heads/master
i:
  47347: 15ec53e
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Feb 9, 2007
1 parent d794bf7 commit f7755ff
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8bfa79fcb81d2bdb043f60ab4171704467808b55
refs/heads/master: 553c4aa630af7bc885e056d0436e4eb7f238579b
4 changes: 3 additions & 1 deletion trunk/drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,9 @@ static int ahci_pci_device_resume(struct pci_dev *pdev)
void __iomem *mmio = host->mmio_base;
int rc;

ata_pci_device_do_resume(pdev);
rc = ata_pci_device_do_resume(pdev);
if (rc)
return rc;

if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
rc = ahci_reset_controller(mmio, pdev);
Expand Down
22 changes: 17 additions & 5 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -6196,12 +6196,22 @@ void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg)
}
}

void ata_pci_device_do_resume(struct pci_dev *pdev)
int ata_pci_device_do_resume(struct pci_dev *pdev)
{
int rc;

pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
pci_enable_device(pdev);

rc = pci_enable_device(pdev);
if (rc) {
dev_printk(KERN_ERR, &pdev->dev,
"failed to enable device after resume (%d)\n", rc);
return rc;
}

pci_set_master(pdev);
return 0;
}

int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
Expand All @@ -6221,10 +6231,12 @@ int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
int ata_pci_device_resume(struct pci_dev *pdev)
{
struct ata_host *host = dev_get_drvdata(&pdev->dev);
int rc;

ata_pci_device_do_resume(pdev);
ata_host_resume(host);
return 0;
rc = ata_pci_device_do_resume(pdev);
if (rc == 0)
ata_host_resume(host);
return rc;
}
#endif /* CONFIG_PCI */

Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/ata/sata_sil.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,12 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
static int sil_pci_device_resume(struct pci_dev *pdev)
{
struct ata_host *host = dev_get_drvdata(&pdev->dev);
int rc;

rc = ata_pci_device_do_resume(pdev);
if (rc)
return rc;

ata_pci_device_do_resume(pdev);
sil_init_controller(pdev, host->n_ports, host->ports[0]->flags,
host->mmio_base);
ata_host_resume(host);
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/ata/sata_sil24.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,11 @@ static int sil24_pci_device_resume(struct pci_dev *pdev)
{
struct ata_host *host = dev_get_drvdata(&pdev->dev);
struct sil24_host_priv *hpriv = host->private_data;
int rc;

ata_pci_device_do_resume(pdev);
rc = ata_pci_device_do_resume(pdev);
if (rc)
return rc;

if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND)
writel(HOST_CTRL_GLOBAL_RST, hpriv->host_base + HOST_CTRL);
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i
unsigned int n_ports);
extern void ata_pci_remove_one (struct pci_dev *pdev);
extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg);
extern void ata_pci_device_do_resume(struct pci_dev *pdev);
extern int __must_check ata_pci_device_do_resume(struct pci_dev *pdev);
extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
extern int ata_pci_device_resume(struct pci_dev *pdev);
extern int ata_pci_clear_simplex(struct pci_dev *pdev);
Expand Down

0 comments on commit f7755ff

Please sign in to comment.