diff options
author | Nate Williams <nate@FreeBSD.org> | 1997-10-23 02:30:39 +0000 |
---|---|---|
committer | Nate Williams <nate@FreeBSD.org> | 1997-10-23 02:30:39 +0000 |
commit | 2e6bafc0a24ce6e91ca12bffc251e7063f0d10c1 (patch) | |
tree | 54471ed51f2ae1b982501782a02ebbdf1bbc310b /sys/pccard/pccard.c | |
parent | 63ea538413c26f44537a2286ae7e34462f09a095 (diff) | |
download | src-2e6bafc0a24ce6e91ca12bffc251e7063f0d10c1.tar.gz src-2e6bafc0a24ce6e91ca12bffc251e7063f0d10c1.zip |
- When doing suspend/resume, only try to suspend those drivers on active
slots. Otherwise, we try to suspend drivers who have been disabled
already.
[
The only reason the drivers are still on the list is because of race
conditions where the card is removed while the driver is in use. We
leave the drivers on the slot list (leaving all of their structures in
place in case a process is using it) but set it's state to empty so that
further uses by the pccard code know not to expect active cards.
]
Notes
Notes:
svn path=/head/; revision=30660
Diffstat (limited to 'sys/pccard/pccard.c')
-rw-r--r-- | sys/pccard/pccard.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c index cfda8715590c..8f7d15b754ec 100644 --- a/sys/pccard/pccard.c +++ b/sys/pccard/pccard.c @@ -355,8 +355,10 @@ slot_suspend(void *arg) struct slot *sp = arg; struct pccard_dev *dp; - for (dp = sp->devices; dp; dp = dp->next) - (void)dp->drv->suspend(dp); + if (slot->state == filled) { + for (dp = sp->devices; dp; dp = dp->next) + (void)dp->drv->suspend(dp); + } sp->ctrl->disable(sp); return (0); } @@ -387,8 +389,10 @@ slot_resume(void *arg) sp->ctrl->power(sp); if (sp->irq) sp->ctrl->mapirq(sp, sp->irq); - for (dp = sp->devices; dp; dp = dp->next) - (void)dp->drv->init(dp, 0); + if (slot->state == filled) { + for (dp = sp->devices; dp; dp = dp->next) + (void)dp->drv->init(dp, 0); + } } return (0); } |