From owner-cvs-all Thu Oct 10 12:17:21 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AADB37B401; Thu, 10 Oct 2002 12:17:19 -0700 (PDT) Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 737E943EAC; Thu, 10 Oct 2002 12:17:17 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwa@tasogare.imasy.or.jp [202.227.24.5]) by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare) with ESMTP/inet id g9AJHFY17311; Fri, 11 Oct 2002 04:17:15 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) Date: Fri, 11 Oct 2002 04:17:10 +0900 (JST) Message-Id: <20021011.041710.54180152.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 From: Mitsuru IWASAKI In-Reply-To: <200210072311.g97NBT05005394@freefall.freebsd.org> References: <200210072311.g97NBT05005394@freefall.freebsd.org> X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, Warner. From: Warner Losh 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