Received: by 10.223.185.116 with SMTP id b49csp4198303wrg; Mon, 26 Feb 2018 13:02:03 -0800 (PST) X-Google-Smtp-Source: AH8x224+w2ttNWhEnO59+C2jc1HrYwlFM8TLuFeuiZ8ZIzdpgTvhaow3ieo05jocTI7TRjfQqBRn X-Received: by 2002:a17:902:7509:: with SMTP id i9-v6mr12170071pll.220.1519678923474; Mon, 26 Feb 2018 13:02:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519678923; cv=none; d=google.com; s=arc-20160816; b=PamCJFec+lYNhVb1WSyFqOxtswG+1lYMGsyvzKrpGPdvROmOC9fybONhrmfrlCCgKk yNck1mgIo2TjCK7Y/GorqHnmy7L9OiARRg5a7UwllrAR6iRMcYyOIjMUOwrF008myuYq I0S9jfIcwOoHpp8U5/OPSBoZTWJe9UcLtMRYK42dMzK0jPiMzaMYxW6Mwk2KVDpK8uvb iCZWtlDHRaMo5FVR8hZ2Za3jrb+p7HBmu651+EA1gkbunJSHr23BL1+3fY7wC+xZumIB vSxe7acOSPUR6ErZ7DCX2/x9M/HhLCN80uV/Ru+KSNFTmchtQ6dyzya2eJ/69NAu4Ac+ xFTQ== 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 :arc-authentication-results; bh=ZnrriezaO+2wscSQxvYhGmGv5EdaeUh5of7vP4Rlss0=; b=uFBQCp6DGg9Tg63YTEJJinpLaLYdf/T1Vm2GuBvL+NNY4mJtYYThabsaJUWDGN59v3 UBBVnribTmizHSeDnxByDH2HGlovvuQ16DXjcbzuLZ/U4+49949nK2p1H/nb73/FBCYf jllBciL3fzftIywgSr4pgXVg11xvdCHoeA6Gg9Z2vDd1fKLrfzwjxEac4/HaydP1GH2O wzhkx1+0+ibDLN6CNd7N827/rawy6aUdlyS+4J3AQuBqSdWpXxrzeRDSrgU4tHTDTkcE LWceRAMnVQorQmEpiH1sD+JOl0+sQct88U5CntprbGwIS+tcNlIAunTBOFou3O+z/sBm 8sxw== ARC-Authentication-Results: i=1; mx.google.com; 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 h14si3625271pfd.404.2018.02.26.13.01.46; Mon, 26 Feb 2018 13:02:03 -0800 (PST) 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; 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 S1752096AbeBZUWM (ORCPT + 99 others); Mon, 26 Feb 2018 15:22:12 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:33936 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751591AbeBZUWI (ORCPT ); Mon, 26 Feb 2018 15:22:08 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6ABC6BAE; Mon, 26 Feb 2018 20:21:51 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , Felipe Balbi Subject: [PATCH 4.9 22/39] usb: renesas_usbhs: missed the "running" flag in usb_dmac with rx path Date: Mon, 26 Feb 2018 21:20:43 +0100 Message-Id: <20180226201644.648054891@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226201643.660109883@linuxfoundation.org> References: <20180226201643.660109883@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yoshihiro Shimoda commit 17aa31f13cad25daa19d3f923323f552e87bc874 upstream. This fixes an issue that a gadget driver (usb_f_fs) is possible to stop rx transactions after the usb-dmac is used because the following functions missed to set/check the "running" flag. - usbhsf_dma_prepare_pop_with_usb_dmac() - usbhsf_dma_pop_done_with_usb_dmac() So, if next transaction uses pio, the usbhsf_prepare_pop() can not start the transaction because the "running" flag is 0. Fixes: 8355b2b3082d ("usb: renesas_usbhs: fix the behavior of some usbhs_pkt_handle") Cc: # v3.19+ Signed-off-by: Yoshihiro Shimoda Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/renesas_usbhs/fifo.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c @@ -1001,6 +1001,10 @@ static int usbhsf_dma_prepare_pop_with_u if ((uintptr_t)pkt->buf & (USBHS_USB_DMAC_XFER_SIZE - 1)) goto usbhsf_pio_prepare_pop; + /* return at this time if the pipe is running */ + if (usbhs_pipe_is_running(pipe)) + return 0; + usbhs_pipe_config_change_bfre(pipe, 1); ret = usbhsf_fifo_select(pipe, fifo, 0); @@ -1191,6 +1195,7 @@ static int usbhsf_dma_pop_done_with_usb_ usbhsf_fifo_clear(pipe, fifo); pkt->actual = usbhs_dma_calc_received_size(pkt, chan, rcv_len); + usbhs_pipe_running(pipe, 0); usbhsf_dma_stop(pipe, fifo); usbhsf_dma_unmap(pkt); usbhsf_fifo_unselect(pipe, pipe->fifo);