From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 18:57:04 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 5F39C1065675; Fri, 1 Apr 2011 18:57:04 +0000 (UTC) (envelope-from bhanuprakashbodireddy@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id E83518FC22; Fri, 1 Apr 2011 18:57:03 +0000 (UTC) Received: by pzk27 with SMTP id 27so910984pzk.13 for ; Fri, 01 Apr 2011 11:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YbMZhVwMz4KsFi1fpEBUVS71V9hu/zr0W54vWcXpEic=; b=IvcNHyFzZXChbc8gX5GCbX4A6Lxv1mJwaBeU03lCjkb4Dp3uRQYQOGL/HBu10QqrbZ 53aPr7OPm7GtMmgXFMlDjbx0fj3uwW1/I5jkrfYW1rzfQkXHyracgS5JRp8JAA3bEUve qczBlCIjEge5wOBI4jAV5jISm6DOnlagKJkEY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=kNJ4lRFzzGjrM6aVflUqKj9MZu2yqskEOqAoVGB/Kx42mG75xRPWyc2IxgorwO1e0d VnbmiRRluN2/+/U9SsK7AH3gf5xU5Cdox5KTjUA75u7+AY7xeFqIqeti9qWwgamoySrs QkahynR9xEGEtsgws/iuMB9QBBozIWbqAPDlQ= MIME-Version: 1.0 Received: by 10.142.142.4 with SMTP id p4mr3572397wfd.43.1301684223601; Fri, 01 Apr 2011 11:57:03 -0700 (PDT) Received: by 10.142.222.3 with HTTP; Fri, 1 Apr 2011 11:57:03 -0700 (PDT) In-Reply-To: References: Date: Fri, 1 Apr 2011 11:57:03 -0700 Message-ID: From: bhanuprakash bodireddy To: Andrew Duane Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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:57:04 -0000 Hi Andrew, That was definitely a good catch. Thanks for pointing that, Also if you have any other issues with USB code in contrib/octeon-sdk/*, please do let us know. Thanks, Bhanu Prakash. On Fri, Apr 1, 2011 at 11:45 AM, Juli Mallett wrote: > 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: > > > > 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. > > 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. >