Received: by 10.223.164.221 with SMTP id h29csp997011wrb; Wed, 1 Nov 2017 08:47:00 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QkZOwIKRLndxbKFGLGEbqvjjJMskVCDGADV1HYiCaz+lbsVdxAVxACx45s0OvEoCd7Wo+A X-Received: by 10.99.111.197 with SMTP id k188mr341605pgc.344.1509551219941; Wed, 01 Nov 2017 08:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509551219; cv=none; d=google.com; s=arc-20160816; b=pseFNg10SKL6sqFgNNaPLw2huL9wl9BV6xgpNgWfVvb+Rejl+mPdPA+OMeq0vcJsnb 66bU/WB3Ft55CXRPzZKfo4b0eZhGG57SiMtZd+7NnPCvQAzJVuzhZW3U4VX9cexSHUGd 6sn1NzuQbCrH3PDnqp2ShgjfkdBXkAsvc1uU0i2d6osaLSUOII6OUvQdh9OHmHOf0EAT bvHfMowFBuFSoxe6MRht06V8Fx31ISiJYWDYkmAVnBN0VaS5XE/DuvqxLol0HwywpbtV FG/OQgXBtDiwCjqisOGGitCgXUQgfjV+Xyi8umF4udBnvuamwFN94ErRp353zja/sRmu InlQ== 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:arc-authentication-results; bh=2ZcfRoyz4Uyv4MELs6/+q/JrvZR9uonXpbdWPOaxjKw=; b=SR8q0w5aIH6b9jZNiC7TMojpcYU5ZU6VSqDUhKryfdjOD3UjTr+yDQEbNk9aMHC2Lt 3Qa5GWyqR6hTp3hXTJpRvvwCd8zrzHlmvVyIJq2BoE13seVc2eindomUwgPp4cJ2+7/o GqgztamopyvlVJ/P5vqMp7CqB45WnfVlE0cTtljWVMsjp+hsUMOnCtxkH7a4Q73BoN2q YrcIHZI+pFL5qjgLMTmJCwZ2VBJtQpqtl153jbzrhzTF4OK3JdsykfsnDToISfqutBRb USgL6TEsYajKLMMFs5q4Oh2uu14aERCulZt6DQ4zdkuDGz/TOoJRz+SafUkb3jpJV6KH uzOw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a87si1308009pfl.192.2017.11.01.08.46.45; Wed, 01 Nov 2017 08:46:59 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754829AbdKAPp6 (ORCPT + 99 others); Wed, 1 Nov 2017 11:45:58 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:46784 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754782AbdKAPpy (ORCPT ); Wed, 1 Nov 2017 11:45:54 -0400 Received: (qmail 2389 invoked by uid 2102); 1 Nov 2017 11:45:53 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 1 Nov 2017 11:45:53 -0400 Date: Wed, 1 Nov 2017 11:45:53 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Roger Quadros cc: balbi@kernel.org, , , , "# v4 . 13+" Subject: Re: [PATCH v2][RESEND] usb: gadget: core: Fix ->udc_set_speed() speed handling In-Reply-To: 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 Wed, 1 Nov 2017, Roger Quadros wrote: > > Roger, would you like to send in a follow-up patch that removes the now > > unnecessary code from dummy_udc_set_speed() in dummy_hcd.c? > > > > Sure. I have a question though. > > In dummy_udc_set_speed() we should just set gadget.speed to whatever is passed in speed. > This will be the maximum supported speed by the gadget function driver. Following your patch, it will be the maximum speed supported by the gadget function driver or the maximum speed supported by the UDC driver, whichever is lower. That's the whole point of your patch, right? > However, is it possible that the gadget will be connected at a lower speed than that? Yes, it is possible to connect at a speed lower than the function driver's maximum speed. The connection speed for dummy-hcd is controlled by a pair of module parameters: is_super_speed and is_high_speed. > I see gadget.speed being updated in dummy_hub_control() GetPortStatus: case, but not > in case of USB_SPEED_HIGH and USB_SPEED_LOW. Here's what the code does, in outline form: switch (dum_hcd->dum->gadget.speed) { case USB_SPEED_HIGH: ... break; case USB_SPEED_LOW: ... break; default: dum_hcd->dum->gadget.speed = USB_SPEED_FULL; break; } In other words, if gadget.speed isn't USB_SPEED_HIGH or USB_SPEED_LOW, set it to USB_SPEED_FULL. And this is all under the case where the connection is USB-2, not USB-3 or higher. How is this related to the requested change to dummy_udc_set_speed()? Alan Stern From 1582877081455430512@xxx Wed Nov 01 15:13:38 +0000 2017 X-GM-THRID: 1582781792863818730 X-Gmail-Labels: Inbox,Category Forums