Date: Tue, 29 Oct 2002 12:29:34 +0900 (JST) From: Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org> To: imp@bsdimp.com Cc: iedowse@maths.tcd.ie, freebsd-mobile@FreeBSD.ORG Subject: Re: Patch to fix/shorten "wi" freezes Message-ID: <20021029.122934.67876690.iwasaki@jp.FreeBSD.org> In-Reply-To: <200210271800.aa11251@salmon.maths.tcd.ie> References: <200210271800.aa11251@salmon.maths.tcd.ie>
next in thread | previous in thread | raw e-mail | index | archive | help
> wi0: timeout in wi_cmd 0x0002; event status 0x8080 Here are 2 patches against similar problems related wi. Please review them. TIA. 1. The suspend methods problem with NEWARD cardbus and pccard. cardbus_suspend() forced cbb into power off via cbb_power(CARD_VCC_0V) before pccard_suspend() detach wi properly. ---- Index: cardbus.c =================================================================== RCS file: /home/ncvs/src/sys/dev/cardbus/cardbus.c,v retrieving revision 1.24 diff -u -r1.24 cardbus.c --- cardbus.c 7 Oct 2002 23:00:51 -0000 1.24 +++ cardbus.c 11 Oct 2002 02:22:28 -0000 @@ -148,6 +148,8 @@ static int cardbus_write_ivar(device_t cbdev, device_t child, int which, uintptr_t value); +#define DETACH_NOWARN 0x800 + /************************************************************************/ /* Probe/Attach */ /************************************************************************/ @@ -175,7 +177,7 @@ static int cardbus_suspend(device_t self) { - cardbus_detach_card(self, DETACH_FORCE); + cardbus_detach_card(self, DETACH_NOWARN); /* detach existing cards */ return (0); } @@ -208,8 +210,6 @@ PCIB_WRITE_CONFIG(brdev, b, s, f, PCIR_MAXLAT, 0x14, 1); cfg->maxlat = PCIB_READ_CONFIG(brdev, b, s, f, PCIR_MAXLAT, 1); } - -#define DETACH_NOWARN 0x800 static int cardbus_attach_card(device_t cbdev) ---- 2. Even after device had removed and wi_stop() called untimeout(wi_inquire), sometimes wi_inquire() is still called and we got kernel panic. I think there are some bugs in timeout/untimeout system under heavy stresses. Here's a workaround for sanity checking. ---- Index: if_wi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/wi/if_wi.c,v retrieving revision 1.117 diff -u -r1.117 if_wi.c --- if_wi.c 14 Oct 2002 01:59:57 -0000 1.117 +++ if_wi.c 15 Oct 2002 19:24:13 -0000 @@ -853,6 +853,17 @@ int s; sc = xsc; + + if (sc == NULL) { + printf("%s: wrong argument\n", __func__); + return; + } + + if (sc->wi_gone) { + printf("%s: already detached\n", __func__); + return; + } + ifp = &sc->arpcom.ac_if; sc->wi_stat_ch = timeout(wi_inquire, sc, hz * 60); ---- 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?20021029.122934.67876690.iwasaki>