Date: Thu, 10 Oct 2002 16:23:59 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: iwasaki@jp.FreeBSD.org Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/pccbb pccbb.c pccbbvar.h Message-ID: <20021010.162359.88676799.imp@bsdimp.com> In-Reply-To: <20021011.041710.54180152.iwasaki@jp.FreeBSD.org> References: <200210072311.g97NBT05005394@freefall.freebsd.org> <20021011.041710.54180152.iwasaki@jp.FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20021011.041710.54180152.iwasaki@jp.FreeBSD.org> Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org> writes: : Hi, Warner. : : From: Warner Losh <imp@FreeBSD.org> : Subject: cvs commit: src/sys/dev/pccbb pccbb.c pccbbvar.h : Date: Mon, 7 Oct 2002 16:11:29 -0700 (PDT) : Message-ID: <200210072311.g97NBT05005394@freefall.freebsd.org> : : > imp 2002/10/07 16:11:29 PDT : > : > Modified files: : > sys/dev/pccbb pccbb.c pccbbvar.h : > Log: : > MFp4: : > o Better resume code. Move the comments around. Force the socket state to : > be querried. Ack the interrupts properly. : > o Intercept the interrupt requests and keep a list of interrupts to service : > ourselves. When the card attaches, set its OK bit. When we get a card : > status change interrupt for that card, clear the OK bit. Don't call the : > ISR if the OK bit is cleared. Iwasaki-san and yamamoto-san have both : > sent me patches that fix the same problem this fixes, but at the pccard : > level. : > o Try to get the signalling of the thread to actually die. This might not be : > 100% right, but it is less wrong than before. : > o Add a SIC next to a TI type that looks like it could be wrong, but isn't. : > : > Revision Changes Path : > 1.57 +71 -43 src/sys/dev/pccbb/pccbb.c : > 1.15 +5 -3 src/sys/dev/pccbb/pccbbvar.h : > : : ATA CF card seems to be broken by this commit. : I think that ata_attach() expect for interrupts to get parameters, : however cbb_insert() doesn't allow calling any interrupt handlers : until CARD_ATTACH_CARD() is completed successfully. So ata_attach() : ends up with timeout... That's correct. I oopsed. : Here's my quick fix, but I'm not sure whether this is correct for : other device drivers as well. Could you review this? This patch looks OK, but there is one problem. If I don't have a pccard (or cardbus) device, then CARD_OK will be set, even though there's no driver. Here's what I just committed to my p4 tree for testing. I'll commit it to current when I do the next merge of my p4 tree into current. Warner --- //depot/user/imp/newcard/dev/pccbb/pccbb.c 2002/10/07 20:57:58 +++ //depot/user/imp/newcard/dev/pccbb/pccbb.c 2002/10/10 15:05:04 @@ -957,11 +957,12 @@ if (sockstate & CBB_SOCKET_STAT_16BIT) { if (sc->pccarddev != NULL) { sc->flags |= CBB_16BIT_CARD; - if (CARD_ATTACH_CARD(sc->pccarddev) != 0) + sc->flags |= CBB_CARD_OK; + if (CARD_ATTACH_CARD(sc->pccarddev) != 0) { device_printf(sc->dev, "PC Card card activation failed\n"); - else - sc->flags |= CBB_CARD_OK; + sc->flags &= ~CBB_CARD_OK; + } } else { device_printf(sc->dev, "PC Card inserted, but no pccard bus.\n"); @@ -969,14 +970,15 @@ } else if (sockstate & CBB_SOCKET_STAT_CB) { if (sc->cbdev != NULL) { sc->flags &= ~CBB_16BIT_CARD; - if (CARD_ATTACH_CARD(sc->cbdev) != 0) + sc->flags |= CBB_CARD_OK; + if (CARD_ATTACH_CARD(sc->cbdev) != 0) { device_printf(sc->dev, "CardBus card activation failed\n"); - else - sc->flags |= CBB_CARD_OK; + sc->flags &= ~CBB_CARD_OK; + } } else { device_printf(sc->dev, - "CardBUS card inserted, but no cardbus bus.\n"); + "CardBus card inserted, but no cardbus bus.\n"); } } else { /* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021010.162359.88676799.imp>