Received: by 10.223.185.116 with SMTP id b49csp4188420wrg; Mon, 26 Feb 2018 12:50:44 -0800 (PST) X-Google-Smtp-Source: AG47ELtxagu2ZHSoYEKklZzUX2NszvBmfWUvZLqAyc9cIpc1DiwRkOl4edVGiLnxFaduZLNbOAjz X-Received: by 10.99.146.26 with SMTP id o26mr2142086pgd.309.1519678244483; Mon, 26 Feb 2018 12:50:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519678244; cv=none; d=google.com; s=arc-20160816; b=Nb9qhmepiKg0g1ts6kKXIo4urXYnYHD0xgfEQBk+v9qYFBvFde2+WBbMiMAYAWCxUL FyOIU7mR8j97jUT5CNWkGLFiD7qrqUq2B5XCmIyBB9Fobft30bROAP2XdkvZhNajiL4x N7Uk39r+q2ivqZd8Ev/MpowQv3sEZu8tJMejAsXtTdOq+xBiuS1y31B4jJpmOYTf2yBl J+iOyxEtwjmLdyGko2Q8NdhyMMZGPIrMezapJsj9IHPwF4ZOw72qnPwxfktzy6aAlZC+ Tjp5NdvMDDkLAK0c/jEjvwUHwxuUTXsWt36oEmi3gI6iH0nOqg44peCVvfxj0d99+DtH yOuw== 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=l/iz5oJlNV+D2Je1p6cCLUoGFR06YOay+TXEzOoh+AY=; b=jZ+27t+08T7CnX7ROl4HUY28dnPjp3/OibaL3vL0Y8tuLqABgf8obZLYJYMmjwY4t9 neuf/4fUzh3m9FTk/jOBwJAMtVd6KOxXm01UutyqKzv9gBapPemA0wmnb15QjiEnOfxG DEdn0sMewvAOcXDezp3vTk8gWZn5Jgdn3qyLkJ4LiRlxWSFLCBepcPWjj3tizBKmtnjo BUG7F6jLclwWwvbVr927tT2nFKEG8LXpmhG4NtLyUIrpmvRpBAbTef8D/hAiDU/9KAsH NSnor0bcfi/eFixWHeTN9ctqV8o9H7UTY3vKD2NdDL25IwnMxcnzop6Cum/m21iQu0wm WZMg== 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 k66si7285591pfa.415.2018.02.26.12.50.27; Mon, 26 Feb 2018 12:50:44 -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 S1753103AbeBZUZH (ORCPT + 99 others); Mon, 26 Feb 2018 15:25:07 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35342 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753084AbeBZUZE (ORCPT ); Mon, 26 Feb 2018 15:25:04 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AF90FFAD; Mon, 26 Feb 2018 20:25:03 +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.14 45/54] usb: renesas_usbhs: missed the "running" flag in usb_dmac with rx path Date: Mon, 26 Feb 2018 21:22:22 +0100 Message-Id: <20180226202146.653301014@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202144.375869933@linuxfoundation.org> References: <20180226202144.375869933@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: 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 @@ -998,6 +998,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); @@ -1188,6 +1192,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);