Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp39217imm; Mon, 21 May 2018 01:46:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrod9dpflP3/5t8fG6pSR3rCEYH2TLzNumxY2mdGArWE9e7NSJimZiu4s0BaIAbtSdCjJJA X-Received: by 2002:a62:c485:: with SMTP id h5-v6mr19539877pfk.86.1526892396921; Mon, 21 May 2018 01:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526892396; cv=none; d=google.com; s=arc-20160816; b=xfggRnhmgSGAKpgnjSvyxmM4XGbOKokvFi1rrZPtyu0omzCEzxyw+X8ML8Usw0F6q7 8ViStNL2TIOuTKn8M50/1TPbh4miLJp3Son+edHTWimJQ51viblWSK1B6KXTWUc15jSp 3Jonl6u1wEl7HR8hMLNIDbjnC5xdWXAGBqT4vx7756QfmfxJasGg03hEbHvtKhiJ69KN RAYts4d0kQlzZOgxO68U6k/fAtSmdHSsuXTJ6FSGbr+RNOSRPDFodvLVPS+T7SklAYTR ob32dhxyHcpxafkysLSK3M/3MO+E0pkcK6HYDbMLjwusTko7gQCmT5TroHC0Qj0ew2zy 1tNw== 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 :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=MVZOe2JVvekZmJKgx7IYqBDE6CSKVQey4x43g8lHlHM=; b=T7QCte9B+bE8sYHnnaJyYooL6xaONCu7cBzmzetuy2LFBTlB3blvCTCg75S/ZF8XBf 8QmXb6lnz42CFORkhOZxF7/p9VFEpaCJlx4YQr5MeGBolQLA5ylqqx6Eiy4F8gAMUNlW LSeol3eUPkgtCokrX61yXuWINaYYgzKyTDz+oyQT16cfL3j57huPAzOvNWvZuLrDGScv 0UamhUexmatjlX7dcL9pV/zXgEENl8p7nSR9XwB9qD1Q1OwWEq2P2hMvHKcfEtmpJlXp q/rS4wPbj05+QT+JWIQ5zg50L0jGVLbsbHr51+ApUIUFSnV61qEsGVnvouFzJI2/t7KL lIBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=PDvuEsnf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si9224898pgc.588.2018.05.21.01.46.20; Mon, 21 May 2018 01:46:36 -0700 (PDT) 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; dkim=pass header.i=@synopsys.com header.s=mail header.b=PDvuEsnf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751109AbeEUIpn (ORCPT + 99 others); Mon, 21 May 2018 04:45:43 -0400 Received: from smtprelay6.synopsys.com ([198.182.37.59]:43415 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750945AbeEUIpk (ORCPT ); Mon, 21 May 2018 04:45:40 -0400 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 55ABA1E05E0; Mon, 21 May 2018 10:45:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1526892339; bh=LWjgTk06sJWzK1WpAxfJIHqilI+2cHU7LOr0v3nWqNY=; h=From:To:CC:Subject:Date:References:From; b=PDvuEsnf1jC4+ujD36KTfsr12+AfIVvjyo5RZPuQmMAEh7wbDPAtvyVmleqBRZee7 uk9M7m3bF1yxKQfLNa0pSm4MdUmbMQsNAxbRq1q/capzYMSXUvQ8cY0d8nrvFN3EXB bBQEDZCPGtxoMaO8Y5G86KjhCY7i+nPudvggQ9yaKHHwch8Ev9S20BaM9qaVHrocfw q+Wree/C75cIcY2DplbF0lk1mCcH8l+xQ3OQWSBCyVFTwpoMWU1n+BAKW8vOCIM/IU fZC52F6y5vhuidjA/I4KVk0K7uYnBhmRqMpc3BoOcxi5fqgFHodfpzQ1PjsZZ0Bqde BOBa2NEoeap0w== Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) by mailhost.synopsys.com (Postfix) with ESMTP id 8DCEF3A81; Mon, 21 May 2018 01:45:38 -0700 (PDT) Received: from AM04WEHTCB.internal.synopsys.com (10.116.16.192) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 21 May 2018 01:45:38 -0700 Received: from AM04WEMBXA.internal.synopsys.com ([fe80::79c3:55f2:1f20:5bf4]) by am04wehtcb.internal.synopsys.com ([::1]) with mapi id 14.03.0361.001; Mon, 21 May 2018 12:45:35 +0400 From: Minas Harutyunyan To: John Stultz , lkml CC: John Youn , Vardan Mikayelyan , Artur Petrosyan , Grigor Tovmasyan , Felipe Balbi , "linux-usb@vger.kernel.org" Subject: Re: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature Thread-Topic: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature Thread-Index: AQHT7ws4+xyvQUj0rEqQiAqvmDphzw== Date: Mon, 21 May 2018 08:45:35 +0000 Message-ID: <410670D7E743164D87FA6160E7907A5601313531E1@am04wembxa.internal.synopsys.com> References: <1526690943-8211-1-git-send-email-john.stultz@linaro.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.116.70.67] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi John,=0A= =0A= On 5/19/2018 4:49 AM, John Stultz wrote:=0A= > In 4.17-rc, commit 03ea6d6e9e1f ("usb: dwc2: Enable power down")=0A= > caused the HiKey board to not correctly handle switching between=0A= > usb-gadget and usb-host mode.=0A= > =0A= > Unplugging the OTG port would result in:=0A= > [ 42.240973] dwc2 f72c0000.usb: dwc2_restore_host_registers: no host re= gisters to restore=0A= > [ 42.249066] dwc2 f72c0000.usb: dwc2_host_exit_hibernation: failed to r= estore host registers=0A= > =0A= > And the USB-host ports would not function.=0A= > =0A= > And plugging in the OTG port, we would see:=0A= > [ 46.046557] WARNING: CPU: 3 PID: 6 at drivers/usb/dwc2/gadget.c:260 dw= c2_hsotg_init_fifo+0x194/0x1a0=0A= > [ 46.055761] CPU: 3 PID: 6 Comm: kworker/u16:0 Not tainted 4.17.0-rc5-0= 0030-ge67da8c #231=0A= > [ 46.055767] Hardware name: HiKey Development Board (DT)=0A= > [ 46.055784] Workqueue: dwc2 dwc2_conn_id_status_change=0A= > ...=0A= > =0A= Could you please send full log to debug.=0A= =0A= =0A= > Thus, this patch sets the hisi params to disable the power_down=0A= > flag by default, and gets thing working again.=0A= > =0A= > Cc: John Youn =0A= > Cc: Vardan Mikayelyan =0A= > Cc: Artur Petrosyan =0A= > Cc: Grigor Tovmasyan =0A= > Cc: Felipe Balbi =0A= > Cc: linux-usb@vger.kernel.org=0A= > Signed-off-by: John Stultz =0A= > ---=0A= > drivers/usb/dwc2/params.c | 1 +=0A= > 1 file changed, 1 insertion(+)=0A= > =0A= > diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c=0A= > index f03e418..96b1b25 100644=0A= > --- a/drivers/usb/dwc2/params.c=0A= > +++ b/drivers/usb/dwc2/params.c=0A= > @@ -70,6 +70,7 @@ static void dwc2_set_his_params(struct dwc2_hsotg *hsot= g)=0A= > GAHBCFG_HBSTLEN_SHIFT;=0A= > p->uframe_sched =3D false;=0A= > p->change_speed_quirk =3D true;=0A= > + p->power_down =3D false;=0A= =0A= power_down declared as int, suggested to update as follow:=0A= p->power_down =3D DWC2_POWER_DOWN_PARAM_NONE;=0A= =0A= This can be accepted as temporary solution until we will fully debug =0A= hibernation feature for HiKey platform.=0A= =0A= > }=0A= > =0A= > static void dwc2_set_rk_params(struct dwc2_hsotg *hsotg)=0A= > =0A= =0A=