From owner-freebsd-current Mon Sep 9 6:59:18 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ACE0237B400 for ; Mon, 9 Sep 2002 06:59:14 -0700 (PDT) Received: from smtp0.adl1.internode.on.net (smtp0.adl1.internode.on.net [203.16.214.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D61743E6A for ; Mon, 9 Sep 2002 06:59:13 -0700 (PDT) (envelope-from smckay@internode.on.net) Received: from dungeon.home (ppp1469.qld.padsl.internode.on.net [150.101.178.188]) by smtp0.adl1.internode.on.net (8.12.4/8.12.4) with ESMTP id g89Dx9eM030069; Mon, 9 Sep 2002 23:29:09 +0930 (CST) Received: from dungeon.home (localhost [127.0.0.1]) by dungeon.home (8.11.6/8.11.6) with ESMTP id g89Dx8t12523; Mon, 9 Sep 2002 23:59:09 +1000 (EST) (envelope-from mckay) Message-Id: <200209091359.g89Dx8t12523@dungeon.home> To: Martin Blapp Cc: current@freebsd.org, Stephen McKay Subject: Re: Uncommitted dc0 fixes ... References: <20020904165819.R31964-100000@levais.imp.ch> In-Reply-To: <20020904165819.R31964-100000@levais.imp.ch> from Martin Blapp at "Wed, 04 Sep 2002 15:07:48 +0000" Date: Mon, 09 Sep 2002 23:59:08 +1000 From: Stephen McKay Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wednesday, 4th September 2002, Martin Blapp wrote: >And this patch here together with patch III made the annoying messages (dc0: >failed to force tx and rx to idle mode) go away. And I can use now my card >without to replug the cable over again) I've been meaning to remove the annoying message for ages. Sorry about that. >+ if (DC_IS_INTEL(sc)) { >+ for (i = 0; i < DC_TIMEOUT; i++) { >+ isr = CSR_READ_4(sc, DC_ISR); >+ if (isr & DC_ISR_TX_IDLE && >+ (isr & DC_ISR_RX_STATE) >+ == DC_RXSTATE_STOPPED) >+ break; >+ DELAY(10); >+ } >+ } Conditionalising on DC_IS_INTEL() means most cards no longer wait until the TX and RX are idle. I don't have enough different if_dc cards to know if this is safe. On the other hand, every test I've done on my Intel and Macronix cards shows zero calls to DELAY() in this loop. The loop may as well not be there for those card types. Indeed, it isn't there at all in if_de and in a Linux driver I looked at. From this I'm guessing that no 21143 (real or clone) needs this check, though I've got no real proof. Out of all this fuzzy evidence, I guess the most sensible option is the patch you've proposed. If nobody else is interested, I'll commit this part of your patch cluster on the weekend. I suppose I could do the ADMtek auto tx underrun recover patch too, as it seems harmless to other cards. The other stuff I can't test at all. This driver represents a counterintuitive state of affairs. I was impressed when Bill Paul managed to support so many clone cards with one driver. But now nobody has enough hardware on hand to test any change properly. There's some sort of lesson to be learnt here. Stephen. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message