From patchwork Sat May 19 00:49:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10412441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1C0186037D for ; Sat, 19 May 2018 00:49:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E7A128AF4 for ; Sat, 19 May 2018 00:49:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02E8428B10; Sat, 19 May 2018 00:49:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6496D28AF4 for ; Sat, 19 May 2018 00:49:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752044AbeESAtN (ORCPT ); Fri, 18 May 2018 20:49:13 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:43213 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbeESAtL (ORCPT ); Fri, 18 May 2018 20:49:11 -0400 Received: by mail-pl0-f68.google.com with SMTP id c41-v6so5484759plj.10 for ; Fri, 18 May 2018 17:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=K57CyW8qMRB21buxOn3TodfIN5c6Wib5Z8BD6RWGTws=; b=kmadjF4Fn63Gqf72vjqEbiCYrpFrpujOYNwNH56SmJcHmVcWJzymPaD/+qafu77NEF 2O2rJOplPUZb61/xVvnfjni3jL+z0tGhUpUeq9oyIDjHBhJBQqUyMXVxJ3kg8MyRy0G9 j4pxXHlIIxzsA5+hFFeFon0AnVmfx6zqZrckc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=K57CyW8qMRB21buxOn3TodfIN5c6Wib5Z8BD6RWGTws=; b=qLjT+1wUK4So2EvbbLsfbQiR+R+1CmkVwRi77OZ6jYNSA13LGBHsTCPHJ/BCFpCW0c iim4jNdvFRia3YROrNxJNVRiB3HdFWle6T1wIhlRv5YLiMfu405MCczDi3jZXEocTEqw 8CRfs1x0XnyOKAb0izph8QbseFJPn1qXTDUk3q7S3V9+LfS8uchoqooKnlY0gJqGWyvh kt2BRKiMH6RsbUUXc7NNt4swPOTSqUKra44LpM0Qro8jkLOmQM1Oda34AwvYftzmvtX6 v1PR8V1XUKeRxNKohOCcjdj2wMGRC5SEG4kjr/JicwdcIQDFnly7JXQADbA6tTi7NRaT SBhg== X-Gm-Message-State: ALKqPwcvaqQ/Y0w5CK9/A9TdaFr7lLfi+2Lk2T+2brUDHEY0fP4jvla2 Fa15RSXeoVHNbHfMjbZ19VURsQ== X-Google-Smtp-Source: AB8JxZop1TunDGZhRB0j6eS2o9XcwmAXVjuX+56AOyZzo7QC716u1c4mRFylP7lMrfafP1lTT2l7uA== X-Received: by 2002:a17:902:ba87:: with SMTP id k7-v6mr11649857pls.193.1526690951314; Fri, 18 May 2018 17:49:11 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id a10-v6sm12735764pfo.55.2018.05.18.17.49.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 17:49:10 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , John Youn , Vardan Mikayelyan , Artur Petrosyan , Grigor Tovmasyan , Felipe Balbi , linux-usb@vger.kernel.org Subject: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature Date: Fri, 18 May 2018 17:49:03 -0700 Message-Id: <1526690943-8211-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In 4.17-rc, commit 03ea6d6e9e1f ("usb: dwc2: Enable power down") caused the HiKey board to not correctly handle switching between usb-gadget and usb-host mode. Unplugging the OTG port would result in: [ 42.240973] dwc2 f72c0000.usb: dwc2_restore_host_registers: no host registers to restore [ 42.249066] dwc2 f72c0000.usb: dwc2_host_exit_hibernation: failed to restore host registers And the USB-host ports would not function. And plugging in the OTG port, we would see: [ 46.046557] WARNING: CPU: 3 PID: 6 at drivers/usb/dwc2/gadget.c:260 dwc2_hsotg_init_fifo+0x194/0x1a0 [ 46.055761] CPU: 3 PID: 6 Comm: kworker/u16:0 Not tainted 4.17.0-rc5-00030-ge67da8c #231 [ 46.055767] Hardware name: HiKey Development Board (DT) [ 46.055784] Workqueue: dwc2 dwc2_conn_id_status_change ... Thus, this patch sets the hisi params to disable the power_down flag by default, and gets thing working again. Cc: John Youn Cc: Vardan Mikayelyan Cc: Artur Petrosyan Cc: Grigor Tovmasyan Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Signed-off-by: John Stultz Tested-by: John Stultz #On HiKey --- drivers/usb/dwc2/params.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index f03e418..96b1b25 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -70,6 +70,7 @@ static void dwc2_set_his_params(struct dwc2_hsotg *hsotg) GAHBCFG_HBSTLEN_SHIFT; p->uframe_sched = false; p->change_speed_quirk = true; + p->power_down = false; } static void dwc2_set_rk_params(struct dwc2_hsotg *hsotg)