Go to file
dyoung fa956bd2bd Fix a bug in Cardbus power activation.
Most Cardbus bridges supported by pccbb(4) fire a power-cycle
interrupt when the power state of a cardslot changes from 'off' to
'on'.  TI bridges fire a power-cycle interrupt on both on->off and
off->on changes.

When pccbb_power() powered-down a cardslot, it did not wait around
for the power-cycle interrupt.  When pccbb_power() powered-up a
cardslot, it did wait for the interrupt.  If a pccbb_power(UP)
followed a pccbb_power(DOWN) very closely, pccbb_power() used to
interpret the power-cycle interrupt for the up->down transition as
"power-up complete," read the power-state bit and, finding that
power had NOT been activated, complain, "cbb0:  power on failed?"
Then pccbb_power() exited before power-activation was complete,
falsely indicating that the power-activation *was* complete.  After
that, a driver attach/enable routine would blithely configure a
card that was not fully powered-up.  An operator who ran a command
such as 'ifconfig rtw0 down up' or 'ifconfig ath0 down up' would
read 'cbb0: power on failed?' in the system log, and their NIC
would misbehave.

This excerpt from a comment in the source should suffice to explain
how I fixed the bug,

        /*
         * Wait as long as 200ms for a power-cycle interrupt.  If
         * interrupts are enabled, but the socket has already
         * changed to the desired status, keep waiting for the
         * interrupt.  "Consuming" the interrupt in this way keeps
         * the interrupt from prematurely waking some subsequent
         * pccbb_power call.

And this explains why this patch will work for Ricoh bridges that
do not fire an interrupt on the on->off transition:

         * XXX Not every bridge interrupts on the ->OFF transition.
         * XXX That's ok, we will time-out after 200ms.
         *
         * XXX The power cycle event will never happen when attaching
         * XXX a 16-bit card.  That's ok, we will time-out after
         * XXX 200ms.
         */

M. Warner Losh and Charles M. Hannum provided valuable input on
this patch.
2007-02-04 21:04:37 +00:00
bin Applied patch by Arto Huusko from PR bin/24753 to append a slash to "." 2007-01-28 22:30:12 +00:00
common Fix typo. 2007-02-02 19:35:59 +00:00
crypto Fixed a check of NAT-T support in libipsec 2007-02-02 13:42:28 +00:00
dist include <types.h> 2007-01-30 18:12:48 +00:00
distrib Bump libutil minor. 2007-02-04 15:10:59 +00:00
doc Add entry for iwi(4) changes from ticket #387. 2007-02-01 21:56:12 +00:00
etc Use mkdir -p to create ${per_user_tmp_dir}, otherwise if /private (this is 2007-02-04 18:28:26 +00:00
games - Don't call basename $0 at many places. Use variable $PROGNAME 2007-01-24 13:17:42 +00:00
gnu Don't mark 0 length arrays as being too small for stack protection. 2007-01-27 01:27:29 +00:00
include Add macros for overflow detection 2007-02-03 23:48:21 +00:00
lib Add support for per-user /tmp. 2007-02-04 08:19:26 +00:00
libexec PR/35449: Shigeya Suzuki: ftpd does not register socket address into PAM +FIX 2007-01-20 17:26:32 +00:00
regress make this compile with -DSTATISTICS 2007-02-03 23:46:40 +00:00
rescue add libprop to LIBS, as veriexecctl now needs it. 2006-11-29 08:41:49 +00:00
sbin warns=4 2007-02-04 20:54:02 +00:00
share Add support for per-user /tmp. 2007-02-04 08:19:26 +00:00
sys Fix a bug in Cardbus power activation. 2007-02-04 21:04:37 +00:00
tools paxctl got moved to usr.sbin, it seems. 2007-01-30 23:47:37 +00:00
usr.bin Add code to ensure that .if/.endif are correctly nested with .for/.endfor 2007-02-04 19:23:49 +00:00
usr.sbin The hashing routines (MD5File() and co.) can do dynamic allocation, so 2007-02-04 08:03:18 +00:00
x11 build XFree86 on shark 2006-12-21 01:45:32 +00:00
build.sh Remove duplicate evbarm-e[bl] cases. Add evbppc64 and macppc64. 2007-01-29 00:08:13 +00:00
BUILDING Try to clarify the description of build.sh -m mach. 2007-01-27 11:47:36 +00:00
Makefile don't filter out .WAIT when converting from _SUBDIR to SUBDIR 2006-09-07 03:51:44 +00:00
Makefile.inc
UPDATING Note also that the distrib/ install images need cleaning to excise 2006-12-15 14:18:38 +00:00