Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1918271imm; Thu, 24 May 2018 02:55:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZobDUyNz3ceI08dMAmDjSqIMhny1Au6ar75dyZHiF+Wrn4ej6eSBNaiMqE9/k2jFfHfZApw X-Received: by 2002:a17:902:4483:: with SMTP id l3-v6mr6717451pld.282.1527155746627; Thu, 24 May 2018 02:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527155746; cv=none; d=google.com; s=arc-20160816; b=dcYtZRezsj5nNOKm5QVFpsjmisNiz2K5lNivKduJ8vbOtrpkZw5snbcLF6uq0590Jh JUMKfoyGIa6gg54jbLsB+6o/XwGpoh4u6hKLLdtAUeXGrkE7KjqLLdSv/J0ZkLvR3hl/ HeJQ5Pw7f7S05TQyE/LjhXBZqp7qt9eHjRPGnTItC3sxk7BUypTKGy7x8TZGbBOggrg8 fd+uHxbPb4EvJDaxZsWu7eHnd5amCcyPdhbmgZ2eL2rUINdp5uIQYXxnxDQ9cIveHzMi RCQJbDWS6CQmaFwabsnddI5pZ+fe39vmmtuBIQo4uDHWF1Nvbaa4PUYqvqtsDM68HYla nIGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=TE0Ykb2IogWqoNG9WyWWcuOK6iXO3oft1CEvfkHhpjs=; b=sMLBajDO4/sRlvCZMTJFA8546R4YjRbIn1rgaFiKsdBEe69nci2MAhGmY99GM+WfYr SOcfxo2IP0Yax2ZVsKKLWLvl3BE0aRrvSxSdpNbG6A7sHShtRdGhluXO4XojOJZ7Pyic XdctxXUALWaEDpFrtEaNnN2+U+FBDKSn8rkmBqOgsEDE1FpQSoxu6/Aw5bOwv7a+I9eG MOL1c5GcB3cycKllKnuTKQN0Fn5Ad+DN3WJWUSzTEblzqOPgPtoiis39L+Pis5zhxxg3 MU57RXv7Sb3CpaQSs7WOBAqxNnL+Wv7IYSGWRSDM7bKli1tk9gIlpN3nX+sLY59z/7NE cEUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XaN5jjpO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k127-v6si16207842pgk.256.2018.05.24.02.55.32; Thu, 24 May 2018 02:55:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XaN5jjpO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968215AbeEXJyk (ORCPT + 99 others); Thu, 24 May 2018 05:54:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:34696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967900AbeEXJyf (ORCPT ); Thu, 24 May 2018 05:54:35 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1EC412089F; Thu, 24 May 2018 09:54:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155674; bh=rvQDwwfiEd5O/3SordetEErSB+HGRmMIuLs7/viA09s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XaN5jjpO8VDDukJp5TYge0yoZh+j+kwxSxorV4icOdev2yohgMV2p39xI6b4HB+Ka V0UQafHqUaPpQ38eFwrfHA6KwacC7zx+nVjWGuAIxLX/llhNZOfNrS1OH2KzhrUf2/ aCJtvW/uUlOlYvanmgibrjbtiNnU/fWxFUCypHvE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Youn , Minas Harutyunyan , Grigor Tovmasyan , Felipe Balbi , Sasha Levin Subject: [PATCH 4.14 074/165] usb: dwc2: hcd: Fix host channel halt flow Date: Thu, 24 May 2018 11:38:00 +0200 Message-Id: <20180524093625.012265731@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Minas Harutyunyan [ Upstream commit a82c7abdf8fc3b09c4a0ed2eee6d43ecef2ccdb0 ] According databook in Buffer and External DMA mode non-split periodic channels can't be halted. Acked-by: John Youn Signed-off-by: Minas Harutyunyan Signed-off-by: Grigor Tovmasyan Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc2/hcd.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -979,6 +979,24 @@ void dwc2_hc_halt(struct dwc2_hsotg *hso 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->params.g_dma && !hsotg->params.g_dma_desc) || + 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);