mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-23 16:01:42 +00:00
Grap the ATA lock on all channels before suspend, this makes certain
that we have no outstanding ops in transit, which would cause problems on resume.
This commit is contained in:
parent
7ed6898c2f
commit
9c51ecf436
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114656
@ -240,6 +240,19 @@ ata_detach(device_t dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ata_suspend(device_t dev)
|
||||
{
|
||||
struct ata_channel *ch;
|
||||
|
||||
if (!dev || !(ch = device_get_softc(dev)))
|
||||
return ENXIO;
|
||||
|
||||
ch->locking(ch, ATA_LF_LOCK);
|
||||
ATA_SLEEPLOCK_CH(ch, ATA_CONTROL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ata_resume(device_t dev)
|
||||
{
|
||||
|
@ -282,6 +282,7 @@ extern struct intr_config_hook *ata_delayed_attach;
|
||||
int ata_probe(device_t);
|
||||
int ata_attach(device_t);
|
||||
int ata_detach(device_t);
|
||||
int ata_suspend(device_t);
|
||||
int ata_resume(device_t);
|
||||
void ata_start(struct ata_channel *);
|
||||
void ata_reset(struct ata_channel *);
|
||||
|
@ -522,6 +522,7 @@ static device_method_t ata_pcisub_methods[] = {
|
||||
DEVMETHOD(device_probe, ata_pcisub_probe),
|
||||
DEVMETHOD(device_attach, ata_attach),
|
||||
DEVMETHOD(device_detach, ata_detach),
|
||||
DEVMETHOD(device_suspend, ata_suspend),
|
||||
DEVMETHOD(device_resume, ata_resume),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user