From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bo Shen Date: Tue, 14 May 2013 09:23:00 +0800 Subject: [U-Boot] Question: issues for usb keyboard work with OHCI HCD In-Reply-To: <201305131712.18073.marex@denx.de> References: <51832F55.4030409@atmel.com> <51871D17.8070201@atmel.com> <5190A9C9.1070908@atmel.com> <201305131712.18073.marex@denx.de> Message-ID: <519191F4.1050803@atmel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, On 5/13/2013 23:12, Marek Vasut wrote: > Dear Bo Shen, > >> Hi All, >> >> On 5/6/2013 11:01, Bo Shen wrote: >>> Hi Marek, >>> >>> On 5/3/2013 21:40, Marek Vasut wrote: >>>> Dear Bo Shen, >>>> >>>>> Hi All, >>>>> >>>>> Now, I test usb host support with Atmel boards, for example, >>>>> >>>>> at91sam9x5ek board. >>>>> >>>>> When test OHCI USB host with usb keyboard. I meet the following >>>>> >>>>> issue. >>>>> --->8--- >>>>> U-Boot 2013.04-dirty (May 03 2013 - 11:00:34) >>>>> >>>>> CPU: AT91SAM9G35 >>>>> Crystal frequency: 12 MHz >>>>> CPU clock : 400 MHz >>>>> Master clock : 133.333 MHz >>>>> DRAM: 128 MiB >>>>> WARNING: Caches not enabled >>>>> NAND: 256 MiB >>>>> MMC: mci: 0 >>>>> In: serial >>>>> Out: serial >>>>> Err: serial >>>>> Net: macb0 >>>>> Hit any key to stop autoboot: 0 >>>>> U-Boot> usb start >>>>> (Re)start USB... >>>>> USB0: scanning bus 0 for devices... 2 USB Device(s) found >>>>> >>>>> scanning usb for storage devices... 0 Storage Device(s) found >>>>> >>>>> U-Boot> setenv stdin usbkbd >>>>> U-Boot> ERROR: sohci_submit_job: ENOMEM >>>>> ERROR: sohci_submit_job failed >>>>> ... ... >>>>> (repeat to print these two error line) >>>> >>>> So the USB subsystem is leaking memory? Or do you only have too small >>>> MALLOC >>>> area? >>> >>> I am not sure whether USB subsystem is leaking memory. I am digging it. >>> >>> This issue is not relative with MALLOC area. >>> This issue come out when all ptd[i].usb_dev (the maximum value of i is >>> 64) is not NULL. Each time to call td_alloc, it will check whether >>> ptd[i].usb_dev is NULL (i from 0 to 63), if not find one of >>> ptd[i].usb_dev is NULL, then report ENOMEM. >> >> All clue for this issue? > > I assume you mean the TDs are all used up then? Are they not free'd ? Yes, that's true, all TDs are used. Nowhere free them, so I use urb_free_priv() to free urb in sohci_return_job() instead of td_submit_job(), then it works well. > Best regards, > Marek Vasut Best Regards, Bo Shen