Re: [PATCH 14/30] usb: dwc2: gadget: Start DDMA IN status phase in StsPhseRcvd handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/8/2016 1:27 AM, Felipe Balbi wrote:
> 
> Hi,
> 
> John Youn <johnyoun@xxxxxxxxxxxx> writes:
>> From: Vahram Aharonyan <vahrama@xxxxxxxxxxxx>
>>
>> In DDMA mode of operation IN status phase of control write transfer
>> should start after getting StsPhseRcvd interrupt. This interrupt is
>> issued by HW once host starts to send IN tokens after data stage.
>>
>> Signed-off-by: Vahram Aharonyan <vahrama@xxxxxxxxxxxx>
>> Signed-off-by: John Youn <johnyoun@xxxxxxxxxxxx>
>> ---
>>  drivers/usb/dwc2/gadget.c | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
>> index e866edc..4e84862 100644
>> --- a/drivers/usb/dwc2/gadget.c
>> +++ b/drivers/usb/dwc2/gadget.c
>> @@ -1993,7 +1993,9 @@ static void dwc2_hsotg_handle_outdone(struct dwc2_hsotg *hsotg, int epnum)
>>  		 */
>>  	}
>>  
>> -	if (epnum == 0 && hsotg->ep0_state == DWC2_EP0_DATA_OUT) {
>> +	/* DDMA IN status phase will start from StsPhseRcvd interrupt */
>> +	if (!using_desc_dma(hsotg) && epnum == 0 &&
>> +	    hsotg->ep0_state == DWC2_EP0_DATA_OUT) {
>>  		/* Move to STATUS IN */
>>  		dwc2_hsotg_ep0_zlp(hsotg, true);
>>  		return;
>> @@ -2616,9 +2618,14 @@ static void dwc2_hsotg_epint(struct dwc2_hsotg *hsotg, unsigned int idx,
>>  		}
>>  	}
>>  
>> -	if (ints & DXEPINT_STSPHSERCVD)
>> +	if (ints & DXEPINT_STSPHSERCVD) {
>>  		dev_dbg(hsotg->dev, "%s: StsPhseRcvd\n", __func__);
>>  
>> +		/* Move to STATUS IN for DDMA */
>> +		if (using_desc_dma(hsotg))
>> +			dwc2_hsotg_ep0_zlp(hsotg, true);
> 
> oh, so *now* the interrupt is needed. Why was it enabled so far back?
> Why couldn't enabling this interrupt be deferred all the way here?

I'll see if I can clean up the ordering a bit.

> 
> Also, someone needs to get rid of dev_dbg() and switch to tracepoints in
> this driver :-)
> 

Trust me, it's on our list :)

We just have to clear out a bunch of pending stuff first.

Regards,
John
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux