From patchwork Fri Oct 17 17:16:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38932 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CA5D3202DB for ; Fri, 17 Oct 2014 17:18:05 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id w7sf715298lbi.6 for ; Fri, 17 Oct 2014 10:18:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=ukjHHNT3PNQJCK7wG1hB4OD3AqS+GEhl00GOV9+M+Ok=; b=JAJCsdWCsnWqUDMB78vjdPZX2FBo7tWkRrr7aJ2zlLMVRkpBosSIdDxzhihSBXGIb6 LJT0AQXhf6Z6unYTQ6Qm+kcorAOyDlJk/O9LDXkI7ff9IZTMzuL2MMILJZSA8WXVoVzI FVvSG7u+FPNvk2nkVvfP8jZazmmG2gBeag8MsiGaP/vvSxHFyz2UU/cGwhT0ce9fdmT1 fXiNJngPDQPjWMrnA7JCcdmDoAWBtHpx6c5Q7C2RuXItj+KaUbiM6VdlHaCfbMClpXZO 9aq7A8a4cT0PCkI7ivoemL9a5qNb7ye7SV8jykxNpF8+7NB0Jr6vZ8ty5U5S0pVmlKWV HdZw== X-Gm-Message-State: ALoCoQlkO3DpoRpxCTDjrpMTMgrNq4W2YLZa2R01oLLgZPDRVsHwTNbnZmiU0Cjem9gMhSdjcs0+ X-Received: by 10.180.72.141 with SMTP id d13mr56223wiv.6.1413566284655; Fri, 17 Oct 2014 10:18:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.4 with SMTP id t4ls286570laz.33.gmail; Fri, 17 Oct 2014 10:18:04 -0700 (PDT) X-Received: by 10.152.206.11 with SMTP id lk11mr10493406lac.42.1413566284372; Fri, 17 Oct 2014 10:18:04 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id qy3si3052277lbb.3.2014.10.17.10.18.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 10:18:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id l4so1046258lbv.10 for ; Fri, 17 Oct 2014 10:18:04 -0700 (PDT) X-Received: by 10.152.5.38 with SMTP id p6mr5621303lap.44.1413566284077; Fri, 17 Oct 2014 10:18:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp268045lbz; Fri, 17 Oct 2014 10:18:03 -0700 (PDT) X-Received: by 10.66.157.101 with SMTP id wl5mr9697355pab.37.1413566282128; Fri, 17 Oct 2014 10:18:02 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si1686618pdm.75.2014.10.17.10.18.01 for ; Fri, 17 Oct 2014 10:18:02 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753510AbaJQRR6 (ORCPT + 3 others); Fri, 17 Oct 2014 13:17:58 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:55976 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753356AbaJQRR5 (ORCPT ); Fri, 17 Oct 2014 13:17:57 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9HHHnnS029255; Fri, 17 Oct 2014 12:17:49 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHHncj000772; Fri, 17 Oct 2014 12:17:49 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 17 Oct 2014 12:17:49 -0500 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 s9HHHmvq030932; Fri, 17 Oct 2014 12:17:49 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Greg KH , , Paul Zimmerman , , , , , , , Felipe Balbi Subject: [PATCH 22/67] usb: dwc3: gadget: set state to NOT_ATTACHED on disconnect_irq Date: Fri, 17 Oct 2014 12:16:29 -0500 Message-ID: <1413566234-13537-23-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1413566234-13537-1-git-send-email-balbi@ti.com> References: <1413566234-13537-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , whenever we get a Disconnect Interrupt, we should make sure to update out udc state to NOT_ATTACHED, otherwise sysfs will show wrong values. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 89cfdbf..d08666d 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2141,6 +2141,7 @@ static void dwc3_gadget_disconnect_interrupt(struct dwc3 *dwc) dwc->gadget.speed = USB_SPEED_UNKNOWN; dwc->setup_packet_pending = false; + usb_gadget_set_state(&dwc->gadget, USB_STATE_NOTATTACHED); } static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)