Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932342AbdLGRPA (ORCPT ); Thu, 7 Dec 2017 12:15:00 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:64445 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756380AbdLGRO4 (ORCPT ); Thu, 7 Dec 2017 12:14:56 -0500 Subject: Re: [PATCH] usb: dwc2: hcd: Fix host channel halt flow To: Minas Harutyunyan References: <728f1476-6b48-f1f7-58ad-b3aaf091bd40@i2se.com> In-Reply-To: <728f1476-6b48-f1f7-58ad-b3aaf091bd40@i2se.com> Cc: John Youn , Felipe Balbi , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" From: Stefan Wahren Message-ID: <8e14e212-c995-de21-676e-b6f8bc1c613f@i2se.com> Date: Thu, 7 Dec 2017 18:14:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: de-DE X-Provags-ID: V03:K0:YfMV7FuBpAYmT29lilTpQbA55zTtriJVHpLV+IifH3cCoPVE7Oi AUhKZCzK3e8E92ZMz6h0YVeOErgA6kEl2baj4uWWEnpEDZypD4bEY6yV31SK+vWgsog8tX5 iwFul3l3r7+W99fd3E6Fm01OeclF11eGn1HkiZrmKPxWao//VGyFI/jrelOLi3I9o9OsSy/ ib6x0qYi2pByfAhbgSaOQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:fIK2yivkfPw=:AH9kNfYFGzMS4v3vsJc0Mz F/klfkyA/NwJJOiZNImLLGF42aZDOThV1XNOscsTtoktmA32kd83qhJEU3FF7qInGe+fmNbEq 0QdhjyxZ09x3bBJcaSSNSbwXlFvLM9dfUW/8ACpH7qE+hkQ1Ogv5xGgz2204wUHtI8BLam7j8 ntl9N+t9JPQgiBrYe5Mqx0uphbBmBnqTfMmhruuLzTii8D4fH/W1dYaiBsxsZRtfMqL7h1A56 hEc/XWesHDMhLDegsLI2vs3ZPc7BClwXGhKnI0kGu2Yw5fXnZLdbic2r6nCT/9I2PS3LmA+NI z2MFRiZnNQwDvnOzK8EUQrb1cG3JYCuQnrpSJLj30U18NfoE1o5qrleG2h8NxAmWasV9K1pXY oYPF2p0/uLSM3muGChtWfAc2XPT9/heRSyNKbrkMdIHizPJisqPl04PCdeYJ0bNXCgNxDxI9B 3yeQav2WSwr5nw15OKA7QDEh08l1QDC8eZ1SiTGqzoZ1ld27Ous803u8oIJsnme5IVMILgCXl ZG8x9kiOVm+fYLHidw8YJXwx2Hf8G0nhcyTnInj3xX8MldDs7ptm8E2KWBfENmvtR/dtyDjW0 pBn0UGPilQKSHZhx0hL0cofJtIFZ/kVDAJHAeVU/0MoAKRARU/9eM8J6o3VDvBa30FIjUlZLZ Sj6XUKwOZ2VhpaiPvGdCy8EYogCg13W0Cm49LNWxzoRLMIJlqbjx3y7cq3uDtPumOKLOH/8Tn BmwbSq8ls0sEGEMXqAI0g45hFg4Ivw/wVj4CiK9BIhQrexyMoFAlI6PedA4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1553 Lines: 51 Hi Minas, Am 07.12.2017 um 18:08 schrieb Stefan Wahren: > According databook in Buffer and External DMA mode > non-split periodic channels can't be halted. do you know of any consequences not having this patch applied? > > Signed-off-by: Minas Harutyunyan Please add a fixes tag. Thanks Stefan > --- > drivers/usb/dwc2/hcd.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c > index 614bb9603def..987122497408 100644 > --- a/drivers/usb/dwc2/hcd.c > +++ b/drivers/usb/dwc2/hcd.c > @@ -985,6 +985,25 @@ void dwc2_hc_halt(struct dwc2_hsotg *hsotg, struct dwc2_host_chan *chan, > > if (dbg_hc(chan)) > dev_vdbg(hsotg->dev, "%s()\n", __func__); > + > + /* > + * In buffer DMA or external DMA mode channel can't be halted > + * for non-split periodic channels. At the end of the next > + * uframe/frame (in the worst case), the core generates a channel > + * halted and disables the channel automatically. > + */ > + if ((hsotg->core_params->dma_enable > 0 && > + hsotg->core_params->dma_desc_enable <= 0) || > + hsotg->hw_params.arch == GHWCFG2_EXT_DMA_ARCH) { > + if (!chan->do_split && > + (chan->ep_type == USB_ENDPOINT_XFER_ISOC || > + chan->ep_type == USB_ENDPOINT_XFER_INT)) { > + dev_err(hsotg->dev, "%s() Channel can't be halted\n", > + __func__); > + return; > + } > + } > + > if (halt_status == DWC2_HC_XFER_NO_HALT_STATUS) > dev_err(hsotg->dev, "!!! halt_status = %d !!!\n", halt_status); >