Date: Fri, 11 Oct 2002 04:17:10 +0900 (JST) From: Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org> To: imp@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: <20021011.041710.54180152.iwasaki@jp.FreeBSD.org> In-Reply-To: <200210072311.g97NBT05005394@freefall.freebsd.org> References: <200210072311.g97NBT05005394@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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...
Here's my quick fix, but I'm not sure whether this is correct for
other device drivers as well. Could you review this?
Thanks
Index: pccbb.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/pccbb/pccbb.c,v
retrieving revision 1.57
diff -u -r1.57 pccbb.c
--- pccbb.c 7 Oct 2002 23:11:29 -0000 1.57
+++ pccbb.c 10 Oct 2002 19:03:19 -0000
@@ -957,14 +957,15 @@
DEVPRINTF((sc->dev, "card inserted: event=0x%08x, state=%08x\n",
sockevent, sockstate));
+ sc->flags |= CBB_CARD_OK;
if (sockstate & CBB_SOCKET_STAT_16BIT) {
if (sc->pccarddev != NULL) {
sc->flags |= CBB_16BIT_CARD;
- if (CARD_ATTACH_CARD(sc->pccarddev) != 0)
+ 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");
@@ -972,11 +973,11 @@
} else if (sockstate & CBB_SOCKET_STAT_CB) {
if (sc->cbdev != NULL) {
sc->flags &= ~CBB_16BIT_CARD;
- if (CARD_ATTACH_CARD(sc->cbdev) != 0)
+ 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");
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?20021011.041710.54180152.iwasaki>
