Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3828811ybi; Sun, 14 Jul 2019 23:07:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxN4IRFKkMozjOulXW5i970ZERERxpi7XeO9JkcT3GjAX/tAgVYb5SVhGd5nNyi7Uv7M378 X-Received: by 2002:a63:eb56:: with SMTP id b22mr25356342pgk.355.1563170846926; Sun, 14 Jul 2019 23:07:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563170846; cv=none; d=google.com; s=arc-20160816; b=EtzisuwsbpmZGs2gjBmjuhgBpAfDePy8pO1DUo8pexyqNqRceTEUGHfGsyWqJPffNq VTYa5ZQJoWOEshNkFLxOgR1R3xTTWkEwR1UGSCHD29slHBZh2HqdH/HGFfi14SBYSgGv mrRSziiuxS0gDZNuNOaN5oyGXuGh/F9jtiBQJY8AHliUHqeGzh4PRDREGJ6y6Dz3php4 nWQCL17jNUvmx8IPfMBQwDYT4JC4rghB7zK96117ViPdcAtH4atw+WrULbYTCnGimh6u wLxcIHDtC+mPokwh8gQYyEnN26JWLGSHUPbw7gwChglmsnvmmJ6Ly6IYxxTLbYamQAx7 79nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:subject:from:date :dkim-signature; bh=z1MaOt0jW59xYgvE7c4XkSzT9zY9zvt+sXJ111t6oK4=; b=quqXA/eYEIydREkKd8TPLdB1YcEsmoeRPnDB3NGtdiRTmMyludYl13ONqcWWDmg1gi I2m210ne1L6kVv5wImzUAQs14s6IbRN87ChW6UkRiNN30gBA6uJ+qqtu6jFQz6ovRkBd +aRYYcbSepCWadmPux67L24XVYDHUeYgKHcuEiD7bvkYdxgnKKkZTqfA6F7SOWIqIGaY 3W12rfcqaHcgKXpMURgckMriKMHqEavbD4gYlHx24i6ZDqbiIUnYFMxI2y4J9MPorFOK YJOcpntgvGqnR1CV+Yex9bkl5mvBVHl8EgiTBsd4GprOynAPHKm8vtq2ucBctUWpbL1g z3RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=wjhDRBgy; 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=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 6si15602224pgb.201.2019.07.14.23.06.39; Sun, 14 Jul 2019 23:07:26 -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=fail header.i=@crapouillou.net header.s=mail header.b=wjhDRBgy; 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=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728967AbfGOGFy (ORCPT + 99 others); Mon, 15 Jul 2019 02:05:54 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:56402 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726425AbfGOGFy (ORCPT ); Mon, 15 Jul 2019 02:05:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1563170752; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z1MaOt0jW59xYgvE7c4XkSzT9zY9zvt+sXJ111t6oK4=; b=wjhDRBgyh9wpm9oRX0H1916idSKCg0Ie8HZwIh6+VLKjzbLkSFTPT0Es6B81OLvJ3lxWu8 JNddxONRUczkKGDRXrB6wRxXkzafNLmBpM1ORhkdE8I1EAm0eWCWun3FDkkTPsR3tJ245f y8cvtm2KBkAf1Qf5MLBYd6WSAvJduKY= Date: Mon, 15 Jul 2019 02:05:40 -0400 From: Paul Cercueil Subject: Re: [PATCH] usb: musb: Disable pullup in gadget setup To: Bin Liu Cc: od@zcrc.me, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: <1563170740.1702.0@crapouillou.net> In-Reply-To: <20190430150506.GF20993@uda0271908> References: <20190404093743.6470-1-paul@crapouillou.net> <20190404161046.GA30182@uda0271908> <20190430150506.GF20993@uda0271908> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bin, Le mar. 30 avril 2019 =E0 11:05, Bin Liu a =E9crit : > Hi Paul, >=20 > On Thu, Apr 04, 2019 at 11:10:46AM -0500, Bin Liu wrote: >> On Thu, Apr 04, 2019 at 11:37:43AM +0200, Paul Cercueil wrote: >> > The pullup may be already enabled before the driver is=20 >> initialized. >> > It has to be disabled at init time, as we cannot guarantee that a=20 >> gadget >> > driver will be bound to the UDC. >> > >> > Signed-off-by: Paul Cercueil >> > --- >> > drivers/usb/musb/musb_gadget.c | 1 + >> > 1 file changed, 1 insertion(+) >> > >> > diff --git a/drivers/usb/musb/musb_gadget.c=20 >> b/drivers/usb/musb/musb_gadget.c >> > index ffe462a657b1..094dc59c834c 100644 >> > --- a/drivers/usb/musb/musb_gadget.c >> > +++ b/drivers/usb/musb/musb_gadget.c >> > @@ -1794,6 +1794,7 @@ int musb_gadget_setup(struct musb *musb) >> > >> > musb->is_active =3D 0; >> > musb_platform_try_idle(musb, 0); >> > + musb_pullup(musb, 0); >> > >> > status =3D usb_add_gadget_udc(musb->controller, &musb->g); >> > if (status) >>=20 >> Applied. >=20 > Sorry, I have dropped this patch from my tree. I realized the gadget > core already defines callbacks to control the pullup. I think the > proper fix should be calling usb_udc_vbus_handler() in musb gadget or > glue layers. >=20 > -Bin. usb_udc_vbus_handler() requires a usb_gadget *, I don't see where I can get that from the struct musb. Besides, the point is to have the pullup disabled before a gadget is=20 bound, so I don't understand why you suggest that? -Paul =