Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3690845imu; Mon, 14 Jan 2019 07:26:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN4DyG8Xg0TEHZbZz9q/kR+TQFHIAFjiUthptevLkzaCKqCBNn57wUuGI1i8yCcSBUrI7lv5 X-Received: by 2002:a17:902:42e4:: with SMTP id h91mr26393457pld.18.1547479582483; Mon, 14 Jan 2019 07:26:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547479582; cv=none; d=google.com; s=arc-20160816; b=T0S/9LFOlHwThyx7ukQpF0EvlLFGK1TLFAljBhtZ3ViUpZn5sHv4NPi6V96n3d/Rj0 SXuo2y3Y6aloWYOBRJX4/IR9JsJwXLJ5o7rWYU7lqkdY4VsM1HFeUWCYXMBbcowzaL0F ctUG9fzzRtRmQpY3KrlmWxUCgptz7YUprsvGJESE6jMZ/5mSrpGiM9uyGRicG4gq7pc5 jKgJf/p/a7dYKuCWIHV2M7V9H1+x3xew2pg86undhvfGWQpiOYVEc+ijQKF+3e77Df+J j+H5Dl7i5MScbli/h2m7C345ha2DUiyQQy2kGyMiJRwtr/bSmUOXh0xDxu0etYDH49uW AYlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=MMphkTJ/37LzXuHqsi4mS4XhMcF5WhH4Th7s/s8LjMI=; b=TZsD1/QIT++AWotS5NKR+AQQ8zshVQDElr30/hWcqj8hrbXxJ47m35+zEdSSJ8AI3a 4PNUDG+TsDuq9C4rQJZXuS+BxSUWdK3VH3BJOriQ/l5K6Fdo+cnl4hKBK7rze1i0PJ5p 4T3mCifPxW4ZEV270R38pkY6zhkn83gvLVNw5nL/GAA3De6YDN0GGieeWO48La2qgsmk J1IhY4Eq1XVU1manuQoiE3m9FjYwLAs7BapIY5P4bbP+OKufaQ+bs8BxR1pND3RoUpqR OZ5mEFyFqxG5CdhLljGDvc3zUAw69L3pe/x7WTFcASUmryVAdN8Qvxaoe7KeDmU8alZ1 IFLQ== 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 f90si480914plb.362.2019.01.14.07.26.06; Mon, 14 Jan 2019 07:26:22 -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 S1726673AbfANPYp (ORCPT + 99 others); Mon, 14 Jan 2019 10:24:45 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:40976 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726629AbfANPYp (ORCPT ); Mon, 14 Jan 2019 10:24:45 -0500 Received: (qmail 1674 invoked by uid 2102); 14 Jan 2019 10:24:44 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 14 Jan 2019 10:24:44 -0500 Date: Mon, 14 Jan 2019 10:24:44 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Paul Elder cc: laurent.pinchart@ideasonboard.com, , , , , , , Subject: Re: [PATCH v5 4/6] usb: gadget: add mechanism to specify an explicit status stage In-Reply-To: <20190114051113.GD32268@localhost.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 14 Jan 2019, Paul Elder wrote: > > > > Can you check your uvc > > > > changes using dummy_hcd with the patch below? > > > > > > I'm not sure what to make of the test results. I get the same results > > > with or without the patch. Which I guess makes sense... in dummy_queue, > > > this is getting hit when the uvc function driver tries to complete the > > > delayed status: > > > > > > req = usb_request_to_dummy_request(_req); > > > if (!_req || !list_empty(&req->queue) || !_req->complete) > > > return -EINVAL; > > > > > > So the delayed/explicit status stage is never completed, afaict. > > > > I presume you are hitting the !list_empty(&req->queue) test, yes? The > > other two tests are trivial. > > Yes, that is what's happening. > > > Triggering the !list_empty() test means the request has already been > > submitted and not yet completed. This probably indicates there is a > > bug in the uvc function driver code. > > The uvc function driver works with musb, though :/ > > I compared the sequence of calls to the uvc setup, completion handler, > and status stage sending, and for some reason dummy_hcd, after an OUT > setup-completion-status sequence, calls a completion-status-completion > sequence, and then goes on the the next request. musb simply goes on to > the next request after the setup-completion-status sequence. I don't quite understand. There's a control-OUT transfer, the setup, data, and status transactions all complete normally, and then what happens? What do you mean by "a completion-status-completion sequence"? A more detailed description would help. > I commented out the paranoia block in dummy_timer, and dummy_hcd still > does the extra completion, but it doesn't error out anymore. I doubt > that's the/a solution though, especially since I get: > > [ 22.616577] uvcvideo: Failed to query (129) UVC probe control : -75 (exp. 26). > [ 22.624481] uvcvideo: Failed to initialize the device (-5). > > Not sure if that's a result of dummy_hcd not supporting isochronous > transfers or not. > > I'm not sure where to continue investigating :/ Perhaps removing the "#if 0" protecting the dev_dbg line in dummy_queue() would provide some helpful output. Another thing to check would be if the "implement an emulated single-request FIFO" in dummy_queue() is causing trouble. There's no harm in replacing the long "if" condition with "if (0)". Alan Stern