Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1325253 > unrolled thread

[PATCH v2 1/5] usb: dwc2: gadget: use ep->fifo_index in context of FIFO registers

Started byRobert Baldyga <r.baldyga@samsung.com>
First post2016-02-03 12:40 +0100
Last post2016-02-04 13:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 1/5] usb: dwc2: gadget: use ep->fifo_index in context of  FIFO registers Robert Baldyga <r.baldyga@samsung.com> - 2016-02-03 12:40 +0100
    Re: [PATCH v2 1/5] usb: dwc2: gadget: use ep->fifo_index in context  of FIFO registers Vahram Aharonyan <Vahram.Aharonyan@synopsys.com> - 2016-02-04 13:30 +0100

#1325253 — [PATCH v2 1/5] usb: dwc2: gadget: use ep->fifo_index in context of FIFO registers

FromRobert Baldyga <r.baldyga@samsung.com>
Date2016-02-03 12:40 +0100
Subject[PATCH v2 1/5] usb: dwc2: gadget: use ep->fifo_index in context of FIFO registers
Message-ID<qY3WX-1lI-55@gated-at.bofh.it>
In context of FIFO registers we use ep->fifo_index instead of ep->index.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---
 drivers/usb/dwc2/gadget.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 422ab7d..0d0f6fe 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -369,7 +369,8 @@ static int dwc2_hsotg_write_fifo(struct dwc2_hsotg *hsotg,
 			return -ENOSPC;
 		}
 	} else if (hsotg->dedicated_fifos && hs_ep->index != 0) {
-		can_write = dwc2_readl(hsotg->regs + DTXFSTS(hs_ep->index));
+		can_write = dwc2_readl(hsotg->regs +
+				DTXFSTS(hs_ep->fifo_index));
 
 		can_write &= 0xffff;
 		can_write *= 4;
@@ -2172,7 +2173,7 @@ static void kill_all_requests(struct dwc2_hsotg *hsotg,
 
 	if (!hsotg->dedicated_fifos)
 		return;
-	size = (dwc2_readl(hsotg->regs + DTXFSTS(ep->index)) & 0xffff) * 4;
+	size = (dwc2_readl(hsotg->regs + DTXFSTS(ep->fifo_index)) & 0xffff) * 4;
 	if (size < ep->fifo_size)
 		dwc2_hsotg_txfifo_flush(hsotg, ep->fifo_index);
 }
-- 
1.9.1

[toc] | [next] | [standalone]


#1326727 — Re: [PATCH v2 1/5] usb: dwc2: gadget: use ep->fifo_index in context of FIFO registers

FromVahram Aharonyan <Vahram.Aharonyan@synopsys.com>
Date2016-02-04 13:30 +0100
SubjectRe: [PATCH v2 1/5] usb: dwc2: gadget: use ep->fifo_index in context of FIFO registers
Message-ID<qYrcS-7Z-23@gated-at.bofh.it>
In reply to#1325253
On 2/3/2016 3:40 PM, Robert Baldyga wrote:
> In context of FIFO registers we use ep->fifo_index instead of ep->index.
> 
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> ---
>  drivers/usb/dwc2/gadget.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 422ab7d..0d0f6fe 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -369,7 +369,8 @@ static int dwc2_hsotg_write_fifo(struct dwc2_hsotg *hsotg,
>  			return -ENOSPC;
>  		}
>  	} else if (hsotg->dedicated_fifos && hs_ep->index != 0) {
> -		can_write = dwc2_readl(hsotg->regs + DTXFSTS(hs_ep->index));
> +		can_write = dwc2_readl(hsotg->regs +
> +				DTXFSTS(hs_ep->fifo_index));
>  
>  		can_write &= 0xffff;
>  		can_write *= 4;
> @@ -2172,7 +2173,7 @@ static void kill_all_requests(struct dwc2_hsotg *hsotg,
>  
>  	if (!hsotg->dedicated_fifos)
>  		return;
> -	size = (dwc2_readl(hsotg->regs + DTXFSTS(ep->index)) & 0xffff) * 4;
> +	size = (dwc2_readl(hsotg->regs + DTXFSTS(ep->fifo_index)) & 0xffff) * 4;
>  	if (size < ep->fifo_size)
>  		dwc2_hsotg_txfifo_flush(hsotg, ep->fifo_index);
>  }
> 

Hi Robert,

DTXFSTS register is linked with endpoint, not FIFO - it contains information about how much space is used in the FIFO assigned to the endpoint. Changing ep->index to ep->fifo_index will work, if FIFO number assigned to that endpoint coincides with ep->index. For example, TX FIFO #1 has been assigned to EP 1 In. If TX FIFO #2 was assigned to EP #1, then with this change DTXFSTS[2] will be used instead of DTXFSTS[1] for EP #1.

Thanks,
Vahram.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web