Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2099061imu; Wed, 28 Nov 2018 22:27:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/X526j8KeTdMZAlEh92yw+h4Gg89aiKlAzxO1ar1OHu4SXyQxDlENs1STOP/AyqcJmfGigp X-Received: by 2002:a62:6e07:: with SMTP id j7mr237263pfc.135.1543472857584; Wed, 28 Nov 2018 22:27:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543472857; cv=none; d=google.com; s=arc-20160816; b=KGzRk5RFhri53m3uODw5iuqgO/1ihiAoZzF4CY4UVyUeOcjOyQZHJfn1r2yOE+gtzA IUiiuNimKmZKZjNn2h57kAGDBwKFhd0kah7b9PBLawPD0yH1hJsVlKt78eDS5ub1Aa/n PZjPkZYHFSYBDQ125Ov6Fblddb7ERlOxAbTDZ/QQ9qW4Owg+iMMLtHTmfIP3MkQC28Fy mk4UyzEHZX6JnFEc31013JpCrqEiYgDicz/blAf+iIrm5v6QqTvD6RxLZlZZVjP2p6zj GYPQlC9h3WKh6w8r+O/FW1d7XxxjcDEUytv6pmWcJSoFFqAUiutsvlD7LTQKwRed1Cqq k/XA== 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=WJLFtFSE+3Ay2D+GvHXFWlksVPBEmsCLHHdlo86sWbQ=; b=mYgyCCTp4oXopXvykxqtCxhmnsd0Y2f9ezvciT+c7dACy45IUqcidnBGuNgLYcnuGa z/LILs8LIq0D/q91AS410M5Bm7woFldelJOA7ffEb5TD8IPyr3/FiiBQNFyi5X+PftCA P6OvxqMzwBUVDBLBeWO1stdaGdTmrSvVZMHmUt7NgZCReTelFc3C792zyXOhQc6JwOSo FkSQgcxnUtuhnmSC+Uj01A/J1kGi/4Rt82Wx4enwW0pWwyY1YmlxyLJz3LwR6imtlZ3O KW7MwGp6CWhD+dkQi/9QClk0UrcwNtFjqoMMlH4G5aTCYmZ3d7ouCYNzcn4pDZxmI/LQ mujA== 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 w6si1145632pfb.191.2018.11.28.22.27.22; Wed, 28 Nov 2018 22:27:37 -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 S1727774AbeK2Ram (ORCPT + 99 others); Thu, 29 Nov 2018 12:30:42 -0500 Received: from Mailgw01.mediatek.com ([1.203.163.78]:42067 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727643AbeK2Ram (ORCPT ); Thu, 29 Nov 2018 12:30:42 -0500 X-UUID: a910dc311edc44da9374e8aa4e1753cc-20181129 X-UUID: a910dc311edc44da9374e8aa4e1753cc-20181129 Received: from mtkcas34.mediatek.inc [(172.27.4.250)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 64181748; Thu, 29 Nov 2018 14:26:16 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS32N2.mediatek.inc (172.27.4.72) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 29 Nov 2018 14:26:15 +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; Thu, 29 Nov 2018 14:26:15 +0800 Message-ID: <1543472774.32173.114.camel@mhfsdcap03> Subject: Re: [PATCH v4] usb/mtu3: power down device ip at setup From: Chunfeng Yun To: "Hsin-Yi, Wang" CC: , Greg Kroah-Hartman , , , Date: Thu, 29 Nov 2018 14:26:14 +0800 In-Reply-To: <20181129031627.45006-1-hsinyi@chromium.org> References: <20181128095358.42498-1-hsinyi@chromium.org> <20181129031627.45006-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 Thu, 2018-11-29 at 11:16 +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 > --- > ChangeLog: > V3->V4: > *update comment > --- > drivers/usb/mtu3/mtu3_plat.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c > index 46551f6d16fd..e086630e41a9 100644 > --- a/drivers/usb/mtu3/mtu3_plat.c > +++ b/drivers/usb/mtu3/mtu3_plat.c > @@ -200,6 +200,14 @@ static void ssusb_ip_sw_reset(struct ssusb_mtk *ssusb) > mtu3_setbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL0, SSUSB_IP_SW_RST); > udelay(1); > mtu3_clrbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL0, SSUSB_IP_SW_RST); > + > + /* > + * device ip may be powered on in firmware/BROM stage before entering > + * kernel stage; > + * power down device ip, otherwise ip-sleep will fail when working as > + * host only mode > + */ > + mtu3_setbits(ssusb->ippc_base, U3D_SSUSB_IP_PW_CTRL2, SSUSB_IP_DEV_PDN); > } > > /* ignore the error if the clock does not exist */ Acked-by: Chunfeng Yun Thanks a lot