From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 18:59:10 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 906CF106564A for ; Fri, 1 Apr 2011 18:59:10 +0000 (UTC) (envelope-from mahan@mahan.org) Received: from ns.mahan.org (ns.mahan.org [67.116.10.138]) by mx1.freebsd.org (Postfix) with ESMTP id 68D548FC12 for ; Fri, 1 Apr 2011 18:59:10 +0000 (UTC) Received: from Patrick-Mahans-MacBook-Pro.local (crowTrobot [67.116.10.140]) by ns.mahan.org (8.13.6/8.13.6) with ESMTP id p31IiuWD041374 for ; Fri, 1 Apr 2011 11:44:56 -0700 (PDT) (envelope-from mahan@mahan.org) Message-ID: <4D961CB0.6080802@mahan.org> Date: Fri, 01 Apr 2011 11:42:56 -0700 From: Patrick Mahan User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: freebsd-mips@freebsd.org References: In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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:59:10 -0000 On 4/1/11 11:08 AM, 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: > > memset(usb, 0, sizeof(usb)); > > Tell me that is not supposed to be: > > memset(usb, 0, sizeof(*usb)); > > The existing code only zeros 4/8 bytes, instead of the 23KB of the structure. > Ugh... Looks like this is an original bug from Cavium. No wonder I always had issues working with the USB in u-boot off of the SDK. I see this is my 1.9 Cavium SDK. Not sure if it is on a more recent version. Patrick