From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 18:46:02 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2800A1065674 for ; Fri, 1 Apr 2011 18:46:02 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id DFA658FC25 for ; Fri, 1 Apr 2011 18:46:01 +0000 (UTC) Received: by yxl31 with SMTP id 31so1775394yxl.13 for ; Fri, 01 Apr 2011 11:46:01 -0700 (PDT) Received: by 10.150.63.19 with SMTP id l19mr4765941yba.71.1301683561128; Fri, 01 Apr 2011 11:46:01 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.151.13.12 with HTTP; Fri, 1 Apr 2011 11:45:41 -0700 (PDT) In-Reply-To: References: From: Juli Mallett Date: Fri, 1 Apr 2011 11:45:41 -0700 X-Google-Sender-Auth: iONzqFjxGxnWXpZ4N0LvE2wRdws Message-ID: To: Andrew Duane Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "mips@freebsd.org" Subject: Re: Blatant simple bug in Cavium SDK USB code? X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Apr 2011 18:46:02 -0000 Hey Andrew, On Fri, Apr 1, 2011 at 11:08, Andrew Duane wrote: > > In the routine cvmx_usb_initialize in sys/contrib/octeon-sdk/cvmx-usb.c, = I'm pretty sure there's a silly little bug that really BADLY breaks the USB= driver for some of us. > > Near the top, after it finds board type and sets the clock type, as part = of the structure initialization, there is: > > =A0 =A0memset(usb, 0, sizeof(usb)); > > Tell me that is not supposed to be: > > =A0 =A0memset(usb, 0, sizeof(*usb)); > > The existing code only zeros 4/8 bytes, instead of the 23KB of the struct= ure. Ouch, nice catch. Is that the only thing keeping the USB driver from working for you? I thought it had rotted some behind other controller changes and also had some problems with stalls, but perhaps the culprit was initialization all along. I'll check in that fix soon, but would like to hear from you as to whether you have any additional fixes for USB (or even bugs to report.) I've BCC'd some Cavium people who will no doubt appreciate the bug report! Thanks, Juli.