Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp777427imu; Tue, 27 Nov 2018 22:23:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/XyVn18lM7A382ne8GXtRSEbpTCSsy0x7E3n0DJ2hhrEIpwZDzm/aBDRcqPXk7nD3lk9MG7 X-Received: by 2002:a63:ef47:: with SMTP id c7mr32295055pgk.386.1543386216629; Tue, 27 Nov 2018 22:23:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543386216; cv=none; d=google.com; s=arc-20160816; b=O6UGN8fwUpBezx0cOHxPH2KVpVU4UHPR/c+f2kbGGIhZLJjjnZRVf9GSRHhTzxtWah z2S1ragfMCyxyw26y1AFQmleYzFgoJxL3FEyNWhS8365COcnPCxZx1eWWUz22NepDpnS xtiS2KtN2mu285MeMSIqQRd5/8/V3O0hZV0ezvWPea/sISS4ZFAAaU5mONLGaB8wcac+ Spcco0YuYVN8YGP/6ZPtg5c5R+JuwKlzertX6ZdKX6zYDtICRKBzlv2LOveC71nks/a/ kL2KZlI9MpO1R/SylJtpGPM9SZ+HL4MDZJL8/yC3Ro34ZQOUrNFakgDT13WXmvfPXpfR y6oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=Y/0bg9zY3nYi247mGWNSM19cZYnjBzbXprDF7xGOiC8=; b=cP70o6E2aNAkERRuoPaZuurMBsr2msySmJCKZ6svbR6davf4SYtYJNTkqBQ33fJgRS yifoOpl8z6UR5QVKEqbdgr6Q41o2+VmrVNRm6aDhqQWOoZfjXEzJ2PGOh6rQplJOLT19 V0uZ8dllpMup7kjy/ylMwypefOyV5IfSXVdMxPqC+daEwvqpYyoysuw3gE3nGiuUUH5d TCSaHxMonwytzz/qUE0TtqvEWcHvemwIB/RmyB7OCpBK18caN+ioLujD7wUThlZh4aPZ S+/kkVLkxsI+FXliCD3iC7ARvxDNO7PZZ7wxifp9DlZNI1Az2C952A32n8IvYfY9fFNU 2JSQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si1647717plv.413.2018.11.27.22.23.21; Tue, 27 Nov 2018 22:23:36 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727285AbeK1RXQ (ORCPT + 99 others); Wed, 28 Nov 2018 12:23:16 -0500 Received: from Mailgw01.mediatek.com ([1.203.163.78]:16051 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726972AbeK1RXQ (ORCPT ); Wed, 28 Nov 2018 12:23:16 -0500 X-UUID: 4fc6aa946fca45deb515d382ce0720d4-20181128 X-UUID: 4fc6aa946fca45deb515d382ce0720d4-20181128 Received: from mtkcas35.mediatek.inc [(172.27.4.250)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2016612770; Wed, 28 Nov 2018 14:22:31 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS32DR.mediatek.inc (172.27.6.104) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 28 Nov 2018 14:22:29 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 28 Nov 2018 14:22:29 +0800 Message-ID: <1543386149.32173.87.camel@mhfsdcap03> Subject: Re: [PATCH] usb/mtu3: power down device ip at setup From: Chunfeng Yun To: "Hsin-Yi, Wang" CC: , Greg Kroah-Hartman , , , Date: Wed, 28 Nov 2018 14:22:29 +0800 In-Reply-To: <20181128060412.630-1-hsinyi@chromium.org> References: <20181128060412.630-1-hsinyi@chromium.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hsin-Yi, On Wed, 2018-11-28 at 14:04 +0800, Hsin-Yi, Wang wrote: > Originally, when dr_mode is USB_DR_MODE_HOST, it didn't power down device ip, > so host ip sleep will fail at ssusb_host_disable. > > Power down device ip at ssusb_host_setup. > > Signed-off-by: Hsin-Yi, Wang > --- > drivers/usb/mtu3/mtu3_host.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c > index c871b94f3e6f..d17cf43305db 100644 > --- a/drivers/usb/mtu3/mtu3_host.c > +++ b/drivers/usb/mtu3/mtu3_host.c > @@ -192,9 +192,17 @@ int ssusb_host_disable(struct ssusb_mtk *ssusb, bool suspend) > static void ssusb_host_setup(struct ssusb_mtk *ssusb) > { > struct otg_switch_mtk *otg_sx = &ssusb->otg_switch; > + void __iomem *ibase = ssusb->ippc_base; > > host_ports_num_get(ssusb); > > + /* > + * device ip is default power-on in fact The device ip is power-off by default, no need power down it here. On which platform did you encounter the issue? > + * power down device ip, otherwise ip-sleep will fail > + */ > + if (ssusb->dr_mode == USB_DR_MODE_HOST) > + mtu3_setbits(ibase, U3D_SSUSB_IP_PW_CTRL2, SSUSB_IP_DEV_PDN); > + > /* > * power on host and power on/enable all ports > * if support OTG, gadget driver will switch port0 to device mode