Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b887d2e6 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman
Browse files

PM: PCI and IDE handle PM_EVENT_PRETHAW



Convert some framework code to handle the new PRETHAW message.

  - IDE just treats it like a FREEZE.

  - The pci_choose_state() thingie still doesn't use PCI_D0 when it gets a
    FREEZE (and now PRETHAW) event, which seems rather buglike but wasn't
    something to change with this patch.

Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 82bb67f2
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1207,7 +1207,7 @@ int system_bus_clock (void)


EXPORT_SYMBOL(system_bus_clock);
EXPORT_SYMBOL(system_bus_clock);


static int generic_ide_suspend(struct device *dev, pm_message_t state)
static int generic_ide_suspend(struct device *dev, pm_message_t mesg)
{
{
	ide_drive_t *drive = dev->driver_data;
	ide_drive_t *drive = dev->driver_data;
	struct request rq;
	struct request rq;
@@ -1221,7 +1221,9 @@ static int generic_ide_suspend(struct device *dev, pm_message_t state)
	rq.special = &args;
	rq.special = &args;
	rq.end_io_data = &rqpm;
	rq.end_io_data = &rqpm;
	rqpm.pm_step = ide_pm_state_start_suspend;
	rqpm.pm_step = ide_pm_state_start_suspend;
	rqpm.pm_state = state.event;
	if (mesg.event == PM_EVENT_PRETHAW)
		mesg.event = PM_EVENT_FREEZE;
	rqpm.pm_state = mesg.event;


	return ide_do_drive_cmd(drive, &rq, ide_wait);
	return ide_do_drive_cmd(drive, &rq, ide_wait);
}
}
+3 −1
Original line number Original line Diff line number Diff line
@@ -432,10 +432,12 @@ pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state)
	case PM_EVENT_ON:
	case PM_EVENT_ON:
		return PCI_D0;
		return PCI_D0;
	case PM_EVENT_FREEZE:
	case PM_EVENT_FREEZE:
	case PM_EVENT_PRETHAW:
		/* REVISIT both freeze and pre-thaw "should" use D0 */
	case PM_EVENT_SUSPEND:
	case PM_EVENT_SUSPEND:
		return PCI_D3hot;
		return PCI_D3hot;
	default:
	default:
		printk("They asked me for state %d\n", state.event);
		printk("Unrecognized suspend event %d\n", state.event);
		BUG();
		BUG();
	}
	}
	return PCI_D0;
	return PCI_D0;