lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 17 Apr 2017 15:36:24 -0700
From:   John Stultz <john.stultz@...aro.org>
To:     John Youn <johnyoun@...opsys.com>
Cc:     lkml <linux-kernel@...r.kernel.org>,
        Sevak Arakelyan <sevaka@...opsys.com>,
        Felipe Balbi <felipe.balbi@...ux.intel.com>
Subject: Re: bug? dwc2: insufficient fifo memory

On Fri, Feb 24, 2017 at 2:46 PM, John Stultz <john.stultz@...aro.org> wrote:
> Hey John,
>   So after the USB tree landed in 4.11-rc, I've been seeing the
> following warning at bootup.
>
> It seems the fifo_mem/total_fifo_size value on hikey is 1920, but I'm
> seeing the addresses zip upward quickly as the txfsz values are all
> 2048.  Not exactly sure whats wrong here.  Things still seem to work
> properly.
>
> thanks
> -john
>
>
> [    8.944987] dwc2 f72c0000.usb: bound driver configfs-gadget
> [    8.956651] insufficient fifo memory
> [    8.956703] ------------[ cut here ]------------
> [    8.964906] WARNING: CPU: 7 PID: 1 at drivers/usb/dwc2/gadget.c:330
> dwc2_hsotg_init_fifo+0x1a8/0x1c8


Hey John,
   So I finally got a bit of time to look deeper into this, and it
seems like this issue was introduced by commit 3c6aea7344c3 ("usb:
dwc2: gadget: Add checking for g-tx-fifo-size parameter"), as that
change added the following snippit:

               if (hsotg->params.g_tx_fifo_size[fifo] < min ||
                   hsotg->params.g_tx_fifo_size[fifo] >  dptxfszn) {
                       dev_warn(hsotg->dev, "%s: Invalid parameter
g_tx_fifo_size[%d]=%d\n",
                                __func__, fifo,
                                hsotg->params.g_tx_fifo_size[fifo]);
                       hsotg->params.g_tx_fifo_size[fifo] = dptxfszn;
               }

On HiKey, we have g-tx-fifo-size = <128 128 128 128 128 128> in the
dtsi, and the fifo_mem value ends up initialized at 1920.

Unfortunately, in the above, it sees other entries in the
g_tx_fifo_size[] array are initialized to zero, which then causes them
to be set to the "default" value of dptxfszn which is 2048.  So then
later in dwc2_hsotg_init_fifo() the addr value (which adds the
fifo_size array value each step) quickly grows beyond the fifo_mem
value, causing the warning.

Not sure what the right fix is here? Should the min value be used
instead of the "default" dptxfszn value?  Again, I'm not sure I see
any side-effects from this warning, but wanted to try to figure out
how to fix it properly.

thanks
-john

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ