From owner-freebsd-bugs@FreeBSD.ORG Wed Feb 13 17:20:03 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07EFD16A419 for ; Wed, 13 Feb 2008 17:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F3FB513C459 for ; Wed, 13 Feb 2008 17:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1DHK21v081011 for ; Wed, 13 Feb 2008 17:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1DHK2gj081010; Wed, 13 Feb 2008 17:20:02 GMT (envelope-from gnats) Date: Wed, 13 Feb 2008 17:20:02 GMT Message-Id: <200802131720.m1DHK2gj081010@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Mark Willson Cc: Subject: Re: kern/112179: [sis] [patch] sis driver for natsemi DP83815D autonegotiate failure X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Mark Willson List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2008 17:20:03 -0000 The following reply was made to PR kern/112179; it has been noted by GNATS. From: Mark Willson To: bug-followup@FreeBSD.org, mark@hydrus.org.uk, volker@vwsoft.com Cc: Subject: Re: kern/112179: [sis] [patch] sis driver for natsemi DP83815D autonegotiate failure Date: Wed, 13 Feb 2008 16:46:18 GMT > Date: Tue, 12 Feb 2008 22:42:30 +0100 > From: Volker > Subject: Re: kern/112179: [sis] [patch] sis driver for natsemi DP83815D autonegotiate > failure > > Mark, > > is this problem still valid for you? Can you please check with > 6.3-RELEASE? > > This problem _might_ be the same as PR kern/64556 > http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/64556 > > Nevertheless, without knowing anything about the chipset in question, > the patch is awful, as it double checks the condition: > > if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr <= NS_SRR_15D) { > // we're getting here only, if sis_srr is less or equal NS_SRR_15D > > CSR_WRITE_4(sc, NS_PHY_PAGE, 0x0001); > CSR_WRITE_4(sc, NS_PHY_CR, 0x189C); > - if (sc->sis_srr == NS_SRR_15C) { > + if (sc->sis_srr <= NS_SRR_15D) { > // and here we're checking for the same value? > // the piece of code is not reached if sis_srr is > NS_SRR_15D, so > it's a wasted 'if' construction > Volker, Thanks for your mail. I'm travelling at the moment and don't have access to the machine to try this out until the weekend. I will provide feedback then. I agree that 112179 might be the same as 64556, but I'm not really sure. And I also agree the patch is lousy; I made the smallest textual change compatible with fixing the problem. Dropping the extra test would be much better. I'm afraid I know nothing about the chip set either, the fix was cribbed from the Linux driver. -mark