Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1948150imm; Thu, 24 May 2018 03:26:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq8FHoab5ZWcbcswFeneEOO1pn+WHH/TafWPKoR4ZnzWS1NapsRJsmTSPbicCycI8QKh6Gz X-Received: by 2002:a17:902:8218:: with SMTP id x24-v6mr6773565pln.57.1527157580851; Thu, 24 May 2018 03:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527157580; cv=none; d=google.com; s=arc-20160816; b=zDKki1Hj/8GbXUOai49NiemQAp1+toJFUvR+xCGQdrbmeGmKGuvbr4bEXT5EM3tsj5 621Ea4ZfR0McOk/+vWKoV/zRRG6c/aGp6gD1hDMUf7V8JavoStX7y7eZV/OYrxbuB3KI Am5TZaGhInhl98QI5IO0ts8uGzkzuWwnnmKYcuB0nHGwjo5sjiJhgAzLl4Mfaj0MDG2Q Hf4MZEuHcdEdj70zJXIsH8x3WEc4U7wj6pAaNlZ6RrStt3hwtSdw8KHgNYjE7C75Halm D/OwvT6oMDYjBTMDb9ixmdmBYybx1DvHqB8BQsJqLsvTr8abtNrNHiLX9jraBBH8D8Zr 1W9A== 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=7TeQD9d/pUGRNy3NwTG6SsdG/w6N1SFOTZlNfo5xqo8=; b=m2pREZi7d+3x15HIUe4JwM0zTD6lq95TYVf+bIlWEzp9sffb52BE6QaoEWUUBERpxW 3/AvvIwtRIeV4xLqZffvn6tL8YWsioxPV4V5cZiLBmNuW6CTdCOcmuQRiMfK/KwWmDyu SbsqjqW7mhe8OAfhAYH5a1IyOgSL+W01w5BchJ7WvuHTuePRIiieta099YqitJ9vlcPM K/IFPYxQgyocRy6inNBFSnEit3c0DoP8syhM8beQz0OrxjpUXXQuWeCToprqm7k+YNeD +X4VoF10rH0C82IYAOFFC+zsJqnq4q4hVV1CE9CjxtqRvBD1hs81uqsGgqBBV88EPxXZ ExAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lQkETFa/; 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 g2-v6si20110542plt.421.2018.05.24.03.26.06; Thu, 24 May 2018 03:26:20 -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=lQkETFa/; 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 S1032013AbeEXKZc (ORCPT + 99 others); Thu, 24 May 2018 06:25:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:48360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031049AbeEXKCF (ORCPT ); Thu, 24 May 2018 06:02:05 -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 307BE2088E; Thu, 24 May 2018 10:02:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527156124; bh=lSoJW6qXsfWPMtiPRKTkxLtBc2fIFxpW2w82kMRQ4Cg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lQkETFa/7mav9UJ88YNUvZrjaZcWLxOwydUGckohnvHZf6zzEpKoX0XVFXh7lGQdy GiKnL+iZvLGmp4/T5fkGODpk3uBzQPoH+VNpUcilVc+QCqrR0gGc7Vun2zFgDKy8Zm RDAhuili/CPrVpUSyifzD8MN+wqa6sKMkCpVddp8= 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.16 073/161] usb: dwc2: hcd: Fix host channel halt flow Date: Thu, 24 May 2018 11:38:18 +0200 Message-Id: <20180524093027.283433163@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093018.331893860@linuxfoundation.org> References: <20180524093018.331893860@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.16-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 @@ -989,6 +989,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);