From 2e6bafc0a24ce6e91ca12bffc251e7063f0d10c1 Mon Sep 17 00:00:00 2001 From: Nate Williams Date: Thu, 23 Oct 1997 02:30:39 +0000 Subject: [PATCH] - 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. ] --- sys/pccard/pccard.c | 12 ++++++++---- 1 file 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); }