Blatant simple bug in Cavium SDK USB code?
bhanuprakash bodireddy
bhanuprakashbodireddy at gmail.com
Fri Apr 1 21:23:50 UTC 2011
Hi Andrew,
We are yet to add the USB support to mainline. I have sent USB support
patches to Juli and she had reviewed them earlier.
But some of the routines are yet to be rewritten(due to other issues) and
hence the support is still missing.
Thanks,
Bhanu Prakash.
On Fri, Apr 1, 2011 at 1:03 PM, Andrew Duane <aduane at juniper.net> wrote:
> This isn't even close to the only problem I'm having. I don't make it out
> of cvmx_usb_initialize at all. One of two things happens:
>
> 1) The code completes and device_probe returns ENXIO so the routine bails
> out and USB doesn't work.
> 2) Something goes insane and I either get a load fault halfway through the
> routine touching one of the USB registers (CVMX_USBCX_GAHBCFG I think), or I
> get an instruction exception in some worker routine buried in the middle.
>
> Ouch indeed....
>
> --
> Andrew Duane Juniper Networks
> 978-589-0551 10 Technology Park Dr
> aduane at juniper.net Westford, MA 01886-3418
>
> ________________________________________
> From: juli at clockworksquid.com [juli at clockworksquid.com] On Behalf Of Juli
> Mallett [jmallett at FreeBSD.org]
> Sent: Friday, April 01, 2011 2:45 PM
> To: Andrew Duane
> Cc: mips at freebsd.org
> Subject: Re: Blatant simple bug in Cavium SDK USB code?
>
> Hey Andrew,
>
> On Fri, Apr 1, 2011 at 11:08, Andrew Duane <aduane at juniper.net> 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.
> _______________________________________________
> freebsd-mips at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-mips
> To unsubscribe, send any mail to "freebsd-mips-unsubscribe at freebsd.org"
>
More information about the freebsd-mips
mailing list