Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1493145imu; Wed, 16 Jan 2019 21:20:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN4mn5JTJL2ceTlD44zqGsgd8tTY1T8BCuJe0/CjTTl5iTE2VayWx0xJczlho2ZWIxWdGq7K X-Received: by 2002:a17:902:6a8c:: with SMTP id n12mr13663713plk.85.1547702423686; Wed, 16 Jan 2019 21:20:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547702423; cv=none; d=google.com; s=arc-20160816; b=SFozSgDIgH3Y9l0H09sJSvPKDpHuGwShPWz5csvfXTtZ7Ox3e6wUOOVnz1tgzbbu21 7m9MU4X28xwrkPn9tnM4ZyaVHOsXHqbZHkoeC50eCCQFl+/uqOfY/4FRVL3CWBIQrvaJ QD6BTIINBbI2mnP2dskUXiCZRBhod+jo3sMK07BGt5Kc9dfH4Ifst6KzNA3kuNjw7Jjd LFU5Jh9LIxtb51fsi1hctfGR6nmOTXgZsp5zhBiDxhcmUsJMkipqCRV4j+1miMpfq7vj I+gG3IRWsvDmy/cWHTkixIK0QOZoiIQWHkg0bwCL/DrVeKxGSWaP5XC771CE1nYO967n Dnkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=XvZMs47sXQ2CtbRs+eIegwgslk8eTyoumulywHZ45KU=; b=idZh5KlHW8BwgPwF66Uwaj9g9aD2CRPAuoK02xaxCyOTqWsoNgVC5jtIVNXRC4aKyT vQYnYJ+rPdr786EzBhJF0shcWM6eUrpvA4aQXGd3Kdy9Y8hYb3EacvA4d4Nl/BjmKy0k 37ZxqxuXQ2Ta0fh5tivJYmUYRA8FnJ54BqiuJfdM2RW67KNuZFcHve1/fIhcdIrFblJ5 gK4KGcsy4JPCTGqTuit8fObJMVnEvdYH8BZQk6RgNEcp0dz4uuSOARItCNgLvYGJbOnl Z5mySl4WI35/OZEIS+66Z0E7NSQ3Tpy016491tqic5bXt0Q7XZ3rqNXKfAgdoaY7Zsgf 9/5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=il73TofM; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si557981pgh.469.2019.01.16.21.20.07; Wed, 16 Jan 2019 21:20:23 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=il73TofM; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404926AbfAPPd3 (ORCPT + 99 others); Wed, 16 Jan 2019 10:33:29 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:58148 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387579AbfAPPd2 (ORCPT ); Wed, 16 Jan 2019 10:33:28 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x0GFXM0E126353; Wed, 16 Jan 2019 09:33:22 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1547652802; bh=XvZMs47sXQ2CtbRs+eIegwgslk8eTyoumulywHZ45KU=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=il73TofMq3RYero5x3YFK3Ckl2kau5tLbg2/kvnytRDQuIURTwdnfBdpO6C19pM1X Z++YzakwJ1l69Kq5bs47GPcbyIwYJhEabyS74PPCZFClf+is6rHcnWQCJd5/H6+1Ci ojshfa6ab8xXL6oQnS9+t5zeEAhNNJ4oj4hJOUoM= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x0GFXMoF060396 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 16 Jan 2019 09:33:22 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Wed, 16 Jan 2019 09:33:22 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Wed, 16 Jan 2019 09:33:22 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id x0GFXMSH029704; Wed, 16 Jan 2019 09:33:22 -0600 Date: Wed, 16 Jan 2019 09:33:22 -0600 From: Bin Liu To: Paul Elder CC: , , , , , , Subject: Re: [PATCH v3] usb: gadget: musb: fix short isoc packets with inventra dma Message-ID: <20190116153322.GG18026@uda0271908> Mail-Followup-To: Bin Liu , Paul Elder , laurent.pinchart@ideasonboard.com, kieran.bingham@ideasonboard.com, drinkcat@chromium.org, balbi@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190116000145.5816-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190116000145.5816-1-paul.elder@ideasonboard.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 15, 2019 at 07:01:45PM -0500, Paul Elder wrote: > Handling short packets (length < max packet size) in the Inventra DMA > engine in the MUSB driver causes the MUSB DMA controller to hang. An > example of a problem that is caused by this problem is when streaming > video out of a UVC gadget, only the first video frame is transferred. > > For short packets (mode-0 or mode-1 DMA), MUSB_TXCSR_TXPKTRDY must be > set manually by the driver. This was previously done in musb_g_tx > (musb_gadget.c), but incorrectly (all csr flags were cleared, and only > MUSB_TXCSR_MODE and MUSB_TXCSR_TXPKTRDY were set). Fixing that problem > allows some requests to be transferred correctly, but multiple requests > were often put together in one USB packet, and caused problems if the > packet size was not a multiple of 4. Instead, set MUSB_TXCSR_TXPKTRDY > in dma_controller_irq (musbhsdma.c), just like host mode transfers. > > This topic was originally tackled by Nicolas Boichat [0] [1] and is > discussed further at [2] as part of his GSoC project [3]. > > [0] https://groups.google.com/forum/?hl=en#!topic/beagleboard-gsoc/k8Azwfp75CU > [1] https://gitorious.org/beagleboard-usbsniffer/beagleboard-usbsniffer-kernel/commit/b0be3b6cc195ba732189b04f1d43ec843c3e54c9?p=beagleboard-usbsniffer:beagleboard-usbsniffer-kernel.git;a=patch;h=b0be3b6cc195ba732189b04f1d43ec843c3e54c9 > [2] http://beagleboard-usbsniffer.blogspot.com/2010/07/musb-isochronous-transfers-fixed.html > [3] http://elinux.org/BeagleBoard/GSoC/USBSniffer > > Signed-off-by: Paul Elder > --- > Changes in v3: > > - remove unnecessary chunk for sending short packet > > Changes in v2: > > - no more flushing FIFO > - greatly simplified short packet if guard in musb_g_tx, and removed > unnecessary variables > - minor indentation and wording changes > drivers/usb/musb/musb_gadget.c | 13 +------------ > drivers/usb/musb/musbhsdma.c | 21 +++++++++++---------- > 2 files changed, 12 insertions(+), 22 deletions(-) Applied. Thanks. Regards, -Bin.