Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3282928pxb; Tue, 19 Jan 2021 19:57:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhzzHiW64uunZ3n1mfXd6jkNpzWN7T8gdEYCgeq9K5FJhJRDntZQQk8WMLOKEu4eCjbk9w X-Received: by 2002:a50:8387:: with SMTP id 7mr5486336edi.131.1611115030717; Tue, 19 Jan 2021 19:57:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611115030; cv=none; d=google.com; s=arc-20160816; b=cqzFshU0OJ0I8MfIinrjy0yIC85ZqPp7S/PB/WAq/JIO/3DhSu0s6dz4lYcbZDsTvB MZxFA3UX+zhUOggz919F+2QAvOnuIKhUPTHYkblZPwdqDLzr6i3O1UG4tFoN009X2BT2 MJTO/xBqSvrvywx4EhVNCVFgRC5R5qL1NMtZ0eRyG7LJ9DY+EYOuKNetgDgY3f+QvLC9 qoy1x8plytSAiw726Mu+tZL7coF8ab1EPJN8Zpbzyqk3sNnthLEyXwhtRgwVcoY+A+T3 wQOmmFI2cFj2FwvCGmako5SWcpTO6GE3NoyHvreRGy4GJjxGk2xosYygpvGmq1q5jo4j 8brQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=rmNVsadvUvfUSqyjvLgSW52JXvqmaHb2Wy0DJaMu3Dg=; b=SIk0lAoPutYoSJUiNlEAG1j9T5FaOvk2+pE1Fh5Dyxy4L5sDhhuNwWb+d7OlRA0dVt qmt8wd0sHVhDp4hoLU50BLXJDY6xfXxc738zaAW5U2HcyrdE+TJ7rggO2tJusldd9x7m bP0/jjG1bVYu+xVLj+Xn9qvzwtNuKsViAuykHl4rHncvOOB2FobL+eqsyrIGuZn7zobu MAst7VeGcz1WvqZklQn0bYqVaQevQp39yQaKVRNMjMWArA2gwTrcqYp0NWmFKWLHPPGx kS//jA7Ldsoax6bpzU/LQoNOi0Y+vGf251bGDOIhrJF+wS9PkGBciv5/qPclhU0oaDjU Fupw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Jazlue4o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zo20si271109ejb.302.2021.01.19.19.56.39; Tue, 19 Jan 2021 19:57:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Jazlue4o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729315AbhATDy5 (ORCPT + 99 others); Tue, 19 Jan 2021 22:54:57 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:50791 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731507AbhATDwI (ORCPT ); Tue, 19 Jan 2021 22:52:08 -0500 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20210120035125epoutp029c28150a8836f85515c14a01e80f798b~b1EVLSuUi2313623136epoutp02G for ; Wed, 20 Jan 2021 03:51:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20210120035125epoutp029c28150a8836f85515c14a01e80f798b~b1EVLSuUi2313623136epoutp02G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1611114685; bh=rmNVsadvUvfUSqyjvLgSW52JXvqmaHb2Wy0DJaMu3Dg=; h=From:To:Cc:Subject:Date:References:From; b=Jazlue4oPk80MGKWtq5jer+gs20fKpSjCGr1pJE/DrdSbMNr1lJYqFkKyc7ahwJIy UwJWQH88ZMMJY9oSa442Eh6ibJYxqsi3tiV1wZ7oUestD41JGUV0pk79U6gxIdVuaN YtaXyW0nf9DROcgHREB+WlSAQQ85C4o2viH1/Jsc= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20210120035124epcas2p19d47d33491f049d669e65b496a47d681~b1EUZf7cE0409004090epcas2p1n; Wed, 20 Jan 2021 03:51:24 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.187]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4DLBQg68wvz4x9Q2; Wed, 20 Jan 2021 03:51:23 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id AB.2A.05262.BB8A7006; Wed, 20 Jan 2021 12:51:23 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20210120035123epcas2p2048f6d9896bd21f19d939a56fe0b6610~b1ESmBk-Q0078900789epcas2p2A; Wed, 20 Jan 2021 03:51:23 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210120035123epsmtrp11506a9812d8877c7dc11adc1a9faa50c~b1ESlZgnC1321313213epsmtrp1k; Wed, 20 Jan 2021 03:51:23 +0000 (GMT) X-AuditID: b6c32a47-b81ff7000000148e-33-6007a8bb19c1 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 8E.AE.13470.AB8A7006; Wed, 20 Jan 2021 12:51:22 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [12.36.155.120]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210120035122epsmtip1d4e05b15d6286804b575393b25e403d7~b1ESaKF8o0536305363epsmtip1b; Wed, 20 Jan 2021 03:51:22 +0000 (GMT) From: Daehwan Jung To: Felipe Balbi Cc: Daehwan Jung , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: usb: dwc3: gadget: skip pullup and set_speed after suspend Date: Wed, 20 Jan 2021 12:39:28 +0900 Message-Id: <1611113968-102424-1-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAKsWRmVeSWpSXmKPExsWy7bCmue7uFewJBqcmCVkca3vCbnFnwTQm i+bF69ksLu+aw2axaFkrswOrx6ZVnWwe++euYffo27KK0ePzJrkAlqgcm4zUxJTUIoXUvOT8 lMy8dFsl7+B453hTMwNDXUNLC3MlhbzE3FRbJRefAF23zBygvUoKZYk5pUChgMTiYiV9O5ui /NKSVIWM/OISW6XUgpScAkPDAr3ixNzi0rx0veT8XCtDAwMjU6DKhJyM3T9OMhV846jYd7SD vYFxBXsXIyeHhICJxILJr9m6GLk4hAR2MErc/NLLCuF8YpToeP4JKvONUWLPm99wLX//vWOC SOxllFj57RILhPODUaLh13ugfg4ONgEtie8LGUEaRASUJab8aANrYBaYxijxcO0WJpCEsICz xP/lR5lBbBYBVYlLm06CbeAVcJPo+bOeDWKbnMTNc53MIM0SAtPZJebPOcMIkXCRuHv6PpQt LPHq+Bao86QkXva3sYMcISFQLrFovh1EbwejxJpPZ6HqjSVmPWtnBKlhFtCUWL9LH6JcWeLI LRaQCmYBPomOw3+hpvBKdLQJQTQqS0y/PIEVwpaUOPj6HDNEiYfEyXVaIGEhgViJpWvuMU1g lJ2FMH4BI+MqRrHUguLc9NRiowJj5DjaxAhOS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jaRufiaSytz7TvTgu0CB4+JT/weJXfFuH/CCouC f29sLhgKxy542X04YMr5ac87P7Z25DkWsAgxlDPd15rhNG+ClUf2lWMfq2L/FG+/fEfjmYdF mYtkevRrHS7eh14PD5js2i2rZfSkOy+0a9/m1UnOP5Q5elevXhSWkdMcNtN908P5CsqLYv18 ll3c6RZtcXGfZ2+P42WdoK065Z7nVJONi04Efvm72G/h98B/3yv+ntLf8OmWWfTLoJA21X/W rTkiB/74f5G7X7eA03kC5/WqxNx1HHfP//kd38xgHK3EUpyRaKjFXFScCABgoX4igwIAAA== X-CMS-MailID: 20210120035123epcas2p2048f6d9896bd21f19d939a56fe0b6610 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210120035123epcas2p2048f6d9896bd21f19d939a56fe0b6610 References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sometimes dwc3_gadget_pullup and dwc3_gadget_set_speed are called after entering suspend. That's why it needs to check whether suspend 1. dwc3 sends disconnect uevent and turn off. (suspend) 2. Platform side causes pullup or set_speed(e.g., adbd closes ffs node) 3. It causes unexpected behavior like ITMON error. Signed-off-by: Daehwan Jung --- drivers/usb/dwc3/gadget.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index ee44321..d7d4202 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2093,6 +2093,9 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) unsigned long flags; int ret; + if (pm_runtime_suspended(dwc->dev)) + return 0; + is_on = !!is_on; /* @@ -2403,6 +2406,9 @@ static void dwc3_gadget_set_speed(struct usb_gadget *g, unsigned long flags; u32 reg; + if (pm_runtime_suspended(dwc->dev)) + return; + spin_lock_irqsave(&dwc->lock, flags); reg = dwc3_readl(dwc->regs, DWC3_DCFG); reg &= ~(DWC3_DCFG_SPEED_MASK); -- 2.7.4