All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sevak Arakelyan <SEVAK.ARAKELYAN@synopsys.com>
To: Stefan Wahren <stefan.wahren@i2se.com>,
	John Youn <John.Youn@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>,
	Razmik Karapetyan <Razmik.Karapetyan@synopsys.com>,
	Vardan Mikayelyan <Vardan.Mikayelyan@synopsys.com>,
	Heiko Stuebner <heiko@sntech.de>,
	"Michael Niewoehner" <linux@mniewoehner.de>,
	Dinh Nguyen <dinguyen@opensource.altera.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFT] usb: dwc2: gadget: Fix fifo size configuration
Date: Tue, 20 Dec 2016 12:57:23 +0000	[thread overview]
Message-ID: <15C49E4896EAA041B5EC6E28053E94311CF8B321@am04wembxb.internal.synopsys.com> (raw)
In-Reply-To: 1482165496-6917-1-git-send-email-stefan.wahren@i2se.com

On 12/19/2016 8:39 PM, Stefan Wahren wrote:
> Currently the upper limit for the endpoint index during fifo size
> config was always 16 instead of the available endpoints. So fix this
> by using the determined amount of endpoints and avoid a warning about
> "insufficient fifo memory" on bcm2835 which has only 8 endpoints.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> Fixes: 0a176279db68 ("usb: dwc2: gadget: configure fifos from device tree")
> ---
>  drivers/usb/dwc2/gadget.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Since revert of ("usb: dwc2: gadget: fix TX FIFO size and address") which
> caused regressions on some platforms this is the second attempt to fix
> gadget support for bcm2835.
>
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index b95930f..b00184c 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -228,7 +228,7 @@ static void dwc2_hsotg_init_fifo(struct dwc2_hsotg *hsotg)
>  	 * them to endpoints dynamically according to maxpacket size value of
>  	 * given endpoint.
>  	 */
> -	for (ep = 1; ep < MAX_EPS_CHANNELS; ep++) {
> +	for (ep = 1; ep < hsotg->num_of_eps; ep++) {
>  		if (!txfsz[ep])
>  			continue;
>  		val = addr;

Hi Stefan,

    This patch is only temporary, not full solution for bcm2835 and in
the loop you need to use hsotg->num_of_eps in shared FIFO mode and the
number of device IN EPs which is in GHWCFG4 with mask
GHWCFG4_NUM_IN_EPS_MASK in dedicated FIFO mode.

    The upper limit is up to 15 but the actual number of FIFOa are being
configured according to the given legacy array
DWC2_G_P_LEGACY_TX_FIFO_SIZE {256, 256, 256, 256, 768, 768, 768, 768, 0,
0, 0, 0, 0, 0, 0}, in that case it is 8 FIFOs. The legacy values are the
main issue. We must do correct calculation according to FIFO operation
mode, device operation mode, take into consideration the EP Info Block
which must be at the end of total FIFO and after that configure correct
number of FIFOs with correct size of depth on every setup. We prepared a
patch series to fix that issue and it is under internal review and
testing process and will be submitted soon.
  
Thanks,
Sevak

  reply	other threads:[~2016-12-20 12:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 16:38 [PATCH RFT] usb: dwc2: gadget: Fix fifo size configuration Stefan Wahren
2016-12-20 12:57 ` Sevak Arakelyan [this message]
2016-12-20 14:19   ` Stefan Wahren
2016-12-20 15:49     ` Sevak Arakelyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15C49E4896EAA041B5EC6E28053E94311CF8B321@am04wembxb.internal.synopsys.com \
    --to=sevak.arakelyan@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=Razmik.Karapetyan@synopsys.com \
    --cc=Vardan.Mikayelyan@synopsys.com \
    --cc=dinguyen@opensource.altera.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@mniewoehner.de \
    --cc=stefan.wahren@i2se.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.