Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp156836imd; Wed, 31 Oct 2018 16:27:47 -0700 (PDT) X-Google-Smtp-Source: AJdET5eD2+XKEZ+gZ10PYWQC3zirVUyWRQlzO7wPN+NxmINfkI8/0EYSNxlYFBxEvQkDXrmgveSK X-Received: by 2002:a63:40c2:: with SMTP id n185-v6mr5046280pga.116.1541028467746; Wed, 31 Oct 2018 16:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541028467; cv=none; d=google.com; s=arc-20160816; b=dQeBPoHAUffwWJ5pfoKQCjxeQnUb+9cRM+gXoeWJgUbL8TXzjuCGUu7qmgHLT0ff9c G13W+gJNfqHogab0X2Nr8kns2kXa0vvx3F+1fB9+DEku6qD75uVc5onINgbdXNSbZeP6 TnXZtNK2+eWCS8dtbDtO8wXPYRrBLpO9LzRTocqmKaP2cWK3IHmgxPTeGBn57KG9ZB/J ywUZDieFWQXsMrPXNlyddOwwcfQQEbtuLsEideL9oE/j5X8uC8y8O6vXi/SzwWbS7gl0 3lZtY0+SohUQwJecNrQvCaqSEtzE39pjDHNke5a3CPFRcYXZlcCtfWaNZDf7QBfGZ4gk CxfQ== 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:message-id:subject:to :from:date:dkim-signature; bh=NIcr0LOzmSTs7Qestl7p50b3ttRyaIc+FF6JckdwSag=; b=WKhCc7brs9hi2lCve9utzhxLt7KWQkoJlBUTAjuVpz/mFVDQHk7RSF59/VjroEJ3Jy 2z9C+hWJd/jpizbupZo2qdUbapSaAEEGXc1oqh5DE+soExWC65/+L9wFuFitBI0wXkb6 7hGB4s5JyxUnJGygsTffM+ibENDl0eZ79UPcYo1rt+ATJ0qiBqbRrULnqa/8VsAYT5SB eiyKCWEhFZq4E11zUEhPNmZ7VzpuisYR64o922AxKv2ZcaIJMb+OBIyy2475eDyMcELv PsKhZH3wJFJq26b/rAJo+RkGrG69LTGWknxbxczEu0tqdIrkJhlEpEgSwQalOFKg06Z1 NbjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=XKi3AvcF; 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 v14-v6si3125724pgt.78.2018.10.31.16.27.33; Wed, 31 Oct 2018 16:27:47 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=XKi3AvcF; 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 S1731354AbeKAI0s (ORCPT + 99 others); Thu, 1 Nov 2018 04:26:48 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:34726 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727546AbeKAI0r (ORCPT ); Thu, 1 Nov 2018 04:26:47 -0400 Received: from emerald.amanokami.net (unknown [96.44.9.81]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0AAE811F2; Thu, 1 Nov 2018 00:26:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1541028388; bh=EZGOw/j7tr+oKO3jtwt4JL3i+Fs1aU4VF5qrCN8OpPU=; h=Date:From:To:Subject:References:In-Reply-To:From; b=XKi3AvcFYXle9xrJtQ8ynOLS7JbKvTzhrxHsFw4DeajesOU8FGHiFnva4x9Cv1ZoS CTG7rSxd0V8Mijiaxm4AY8LwC7gmNDaiC7kwEKOGaU/Yh/8lUvIz3PHx07gqMk6VrI ReYrFsRdAuI1xuz7pQLIS5C+2Zh4wrwf2y4zSu5o= Date: Wed, 31 Oct 2018 19:26:20 -0400 From: Paul Elder To: Bin Liu , laurent.pinchart@ideasonboard.com, kieran.bingham@ideasonboard.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, balbi@kernel.org, stern@rowland.harvard.edu, rogerq@ti.com Subject: Re: [PATCH 5/6] usb: musb: gadget: implement send_response Message-ID: <20181031232620.GA13896@emerald.amanokami.net> References: <20181010024903.1633-1-paul.elder@ideasonboard.com> <20181010024903.1633-6-paul.elder@ideasonboard.com> <20181011160746.GA8763@uda0271908> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181011160746.GA8763@uda0271908> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bin, On Thu, Oct 11, 2018 at 11:07:46AM -0500, Bin Liu wrote: > Hi, > > On Tue, Oct 09, 2018 at 10:49:02PM -0400, Paul Elder wrote: > > This patch implements a mechanism to signal the MUSB driver to reply to > > a control OUT request with STALL or ACK. > > > > Signed-off-by: Paul Elder > > Reviewed-by: Laurent Pinchart > > The patch looks good to me, here is my Acked-by: > > Acked-by: Bin Liu > > but I am unable to test this patch set - the current Greg's usb-next > tree gives deadlock error between composite_disconnect() and > usb_function_deactivate() when loading g_webcam.ko on BeagleboneBlack. > The error happens before applying this patch set. We don't use g_webcam anymore, because it doesn't offer the flexibility that configfs does (for example, only one function can be configured with g_webcam). There are no features that g_webcam offers that configfs doesn't. I was unable to reproduce the deadlock that you mention on Greg's usb-next tree. Which commit were you on? I did, however, get the deadlock that you mention upon *killing* the userspace application providing the stream, not when loading g_webcam.ko. Here is a sample script for setting up a UVC gadget through configfs (I haven't tested this exact script; I extracted the functional components): CONFIGFS="/sys/kernel/config" GADGET="$CONFIGFS/usb_gadget" VID="0x0525" PID="0xa4a2" SERIAL="0123456789" MANUF=$(hostname) PRODUCT="UVC Gadget" UDC=`ls /sys/class/udc` cd $GADGET/g1 echo $VID > idVendor echo $PID > idProduct mkdir -p strings/0x409 echo $SERIAL > strings/0x409/serialnumber echo $MANUF > strings/0x409/manufacturer echo $PRODUCT > strings/0x409/product mkdir configs/c.1 mkdir configs/c.1/strings/0x409 # create uvc CONFIG="configs/c.1" FUNCTION="uvc.0" mkdir functions/$FUNCTION # create frame 640x360 uncompressed WIDTH=640 HEIGHT=360 wdir=functions/$FUNCTION/streaming/uncompressed/u/${HEIGHT}p mkdir $wdir echo $WIDTH > $wdir/wWidth echo $HEIGHT > $wdir/wHeight echo $(( $WIDTH * $HEIGHT * 2 )) > $wdir/dwMaxVideoFrameBufferSize cat < $wdir/dwFrameInterval 666666 100000 5000000 EOF # end create frame mkdir functions/$FUNCTION/streaming/header/h cd functions/$FUNCTION/streaming/header/h ln -s ../../uncompressed/u cd ../../class/fs ln -s ../../header/h cd ../../class/hs ln -s ../../header/h cd ../../../control mkdir header/h ln -s header/h class/fs ln -s header/h class/ss cd ../../../ # Set the packet size: uvc gadget max size is 3k... echo 3072 > functions/$FUNCTION/streaming_maxpacket echo 2048 > functions/$FUNCTION/streaming_maxpacket echo 1024 > functions/$FUNCTION/streaming_maxpacket ln -s functions/$FUNCTION configs/c.1 # end create uvc echo $UDC > UDC Thanks, Paul