Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Sep 1998 11:51:40 -0600
From:      Nate Williams <nate@mt.sri.com>
To:        Brian Somers <brian@Awfulhak.org>
Cc:        Robert Watson <robert@fledge.watson.org>, freebsd-bugs@FreeBSD.ORG, freebsd-mobile@FreeBSD.ORG
Subject:   Re: after wakeup from apm sleep: pccardd[46]: No free configuration for card 3... 
Message-ID:  <199809241751.LAA06047@mt.sri.com>
In-Reply-To: <199809240928.KAA04905@woof.lan.awfulhak.org>
References:  <Pine.BSF.3.96.980923133349.479A-100000@sleipnir.pr3.watson.org> <199809240928.KAA04905@woof.lan.awfulhak.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> Short fix (sometimes works): kill & restart pccardd.
> 
> My machine's doing this too...
> 
> It looks like there's a problem with the slot power off code.  It 
> waits a second (via timeout()) after the card has been removed before 
> removing power.

But, if you note 'power_off_slot' just does a control disable, which
happens anyway in suspend, so it's doesn't make any difference.

power_off_slot(void *arg)
{
        struct slot *slt = (struct slot *)arg;
         
        /* Power off the slot. */
        slt->pwr_off_pending = 0;
        slt->ctrl->disable(slt);
}

And, suspend:
slot_suspend(void *arg)
{       
        struct slot *slt = arg; 
 
        /* This code stolen from pccard_event:card_removed */
        if (slt->state == filled) {
                int s = splhigh();
                disable_slot(slt); 
                slt->state = suspend;
                splx(s);
                printf("Card disabled, slot %d\n", slt->slotnum);
        }
        slt->ctrl->disable(slt);
        return (0);
}

Note that even though the slot disable is set into a timeout, we also
'disable' the slot anyway (which is all the power_off_slot does anyway).

So, the slot is still powered off (but we do have a timeout still
pending to disable the slot that may not have been fired.)

> This is a problem if the removal event is the result 
> of a suspend as the timeout() doesn't wake up 'till *after* resuming. 

Agreed.

> If the card is still there, sometimes the attach happens before the 
> remove, resulting in the remove being untimeout()'d and pccardd 
> thinking the driver entry is already in use.
> 
> The fix (which I plan to add in the next couple of days):

Sounds way too codiff -u -r1.27.2.7 pccard.c
--- pccard.c    1998/04/18 23:24:47     1.27.2.7
+++ pccard.c    1998/09/24 17:50:48
@@ -378,6 +378,11 @@
                splx(s);
                printf("Card disabled, slot %d\n", slt->slotnum);
        }
+       /*
+         * Disable any pending timeouts for this slot since we're
+         * powering it down/disabling now.
+        */
+        untimeout(power_off_slot, (caddr_t)slt); 
        slt->ctrl->disable(slt);
        return (0);
 }

> Any objections ?

Too complex.  Also, I don't see how this 'bug' could cause the problems
we're seeing, but agree that this is a bug.



Nate

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809241751.LAA06047>