Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2640967pxa; Mon, 17 Aug 2020 15:13:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5F9g0SS03fJxOrZj+Iya8df1E+nlQtNSIW/3EZj0yPn9+pVo/tzbN6GtewmClwg6+/f2C X-Received: by 2002:a17:906:9512:: with SMTP id u18mr16825935ejx.207.1597702406112; Mon, 17 Aug 2020 15:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597702406; cv=none; d=google.com; s=arc-20160816; b=ASinVhr1YEiIFGkfgRg4rSc1i1+gNJuZdAjEBvjLtR7gszNbUNsZLoGRXrC6bJNyKY Ah1nT5aVmJ+9Oe8k1rYZAnz29pf4Of2g2acfIkr+X4Kotber4193b+ow4+kVr16sG7Sm /JYEzk4sa3Fi9CCwE6O8+YlWXETvHs0HnFe0AI2jce9COJJ/AdLXIq74rl8UD3YmK5Oc apT/SC5ZM/BRltcMtJ63H1wsu6AnEr0/icwVK1a9mNGLr5i8Ddyign9LyWfBK+rePuq4 13tVbQVtSMV7bVVrwnTkS5aCXs7I3v4OQBw7e8rG4OETlvopoCrG77Xd7y0fgZK5hndy q5IQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dSmL6nJ4YolA+eCzYItUxgwrgB2o72baAf5Vts7VkWw=; b=ZOalXJ5aOPEB52mfRfnAyOMW7cl6PO4CUwQJjX071eRLtYtgoKqBs8CwZsI3QYqxmk fA4Q/pC5A6ndJE4+4T3gpafj5JX6rGodmcCHklJCdmOehoiRVgcMOdIIziDXIoQhDUvC TYE1eKGnmnZZdz+vCcpTsw82S+O69SSKgGyDlmfTAWiGO8ITsL0OuqZNUqmlT2+DIK81 Ibdp1d47PKyAUNEPwT/2LWq3TVLtlOLPv7YtErij+WEtLN38CE72nCjyiGfh1RwOO+o3 L3r/klHrhYK/nKJ/pCV8UQtMrmmBnaR6IJ5gQVcXdxrNwrCEyVoTLqPpiqk0Mp4ghdNG x5BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Quk2gRUF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx25si11834951edb.149.2020.08.17.15.13.02; Mon, 17 Aug 2020 15:13:26 -0700 (PDT) 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=@kernel.org header.s=default header.b=Quk2gRUF; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389107AbgHQQx6 (ORCPT + 99 others); Mon, 17 Aug 2020 12:53:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:51148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388244AbgHQQDa (ORCPT ); Mon, 17 Aug 2020 12:03:30 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F3CFF207FB; Mon, 17 Aug 2020 16:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680210; bh=x9GG5gygsBiraECBSOqumUJcpCscr6B3l3sBiltVbKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Quk2gRUFD2hsCsli0icR4sJ1H8mBg8mxoF71lJhrhZ6SkU6CG26pieY3PEsU9tE+P PM4HpL1iw0ilLD3yC0IwJGN95e/WL15QC66kg/CN0JBIXsAeaJf/zNhFLxG+agY1Aj xzQF3xxjKF4J2VRInpoZIKaqHeXEoExNNwERTEJo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunfeng Yun , Sasha Levin Subject: [PATCH 5.4 065/270] usb: mtu3: clear dual mode of u3port when disable device Date: Mon, 17 Aug 2020 17:14:26 +0200 Message-Id: <20200817143758.986608510@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunfeng Yun [ Upstream commit f1e51e99ed498d4aa9ae5df28e43d558ea627781 ] If not clear u3port's dual mode when disable device, the IP will fail to enter sleep mode when suspend. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1595834101-13094-10-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/mtu3/mtu3_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index 9dd02160cca97..e3780d4d65149 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -131,8 +131,12 @@ static void mtu3_device_disable(struct mtu3 *mtu) mtu3_setbits(ibase, SSUSB_U2_CTRL(0), SSUSB_U2_PORT_DIS | SSUSB_U2_PORT_PDN); - if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG) + if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG) { mtu3_clrbits(ibase, SSUSB_U2_CTRL(0), SSUSB_U2_PORT_OTG_SEL); + if (mtu->is_u3_ip) + mtu3_clrbits(ibase, SSUSB_U3_CTRL(0), + SSUSB_U3_PORT_DUAL_MODE); + } mtu3_setbits(ibase, U3D_SSUSB_IP_PW_CTRL2, SSUSB_IP_DEV_PDN); } -- 2.25.1