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: 136382 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1888333lji; Fri, 18 May 2018 17:49:12 -0700 (PDT) X-Received: by 2002:a17:902:8f97:: with SMTP id z23-v6mr11778298plo.329.1526690951931; Fri, 18 May 2018 17:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526690951; cv=none; d=google.com; s=arc-20160816; b=UvKUFdJ2UGzFnHMu+U4bYrQ4iL86/ViDAcKS1HGNIFsFSZH9MATxSn0XFm/E2j5ZlM Jt7omBQ4hlQGmhIx42J0QInLBsLG/+9rf+jT0Kfmb3buCDbILpHSm7QSZrYgdYfIdsBz gX3v8vLtmnksNUADGgE1KMI5SRbAFP0LC7feGCERrd9blbUK/voE5ifjU3+H97465bhk ZDuRJamZ8P9s92PMCktkoo9fqsvXLWR4ELOirSRjFv1zciPvSD5qobexSI5MOEunjmzf 4bPVxkCEOaFbLiEofN7baMC9DAMsfO9/octdrlbZjt4OwYv9R2hoOJkvJnbOXDiKNub+ 3i/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=K57CyW8qMRB21buxOn3TodfIN5c6Wib5Z8BD6RWGTws=; b=IX4IGyYpcq4iRivZPKodhoolh0J/84GoX7h4ocEOnVljolHX3/mBbPeKQprTjz6/ep vuqfx13J7WxZh9ZtFP2ZYqGEjO6rzTyCpDUqY6dgke2p1hyc2qmhZXF0BiayOPxXGVUU yiNNO/oTRNOC20Whi8WsG36xp7knVwdnH04LaimFew7U0UTPwDmjizvs3sCRE+2ybEw9 HYTFiMOxox84F7Y5fVqMQRKvIxBeJB01P0bkQDw7yLOURAPOzn2h2anbGRjlgayAtodw HHdKNMhAUFR3qDrMi0uQUMOosHDJDoTMoKWdW8T9sNu5EUUnM6dNg7Gi+jFPSblk+tIw m3Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kmadjF4F; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id f94-v6sor4520555plb.14.2018.05.18.17.49.11 for (Google Transport Security); Fri, 18 May 2018 17:49:11 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kmadjF4F; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=rBGNsgJfUXwl/ifnyvZ2vcPrgTYzNJxDAunbwp5sTmgnYR6ZyTG/ZL1vOGbGRaHPNP HQ0rZxbSiXo6INnidKvrYRXYQaLKbcYv5os44z465OiroGflJQDo52r1M9pvnmi8DA2p dZDoaLf3XvXcTJtH+2SAs0mdg0wztdVr4J2nXLUZm9ZzlkPsW/tXmwYIz/ck2884KMog qovs/Zn1PYBSDtnipTLTfLllrA232wRWtZAN/D0LukmqfAnUT5ucQniJK8i8j+l9l3Xj T1HIDOb9+2JYNIO2OhaeePpH+eIvtf0/+xGGjjhfAdGd7XYNOe72cMrsXn0jOjGfzXxV Ay4w== X-Gm-Message-State: ALKqPwenNlOOJ4u3wHxlnVSuhgfV6n64V/BKk7yKRVTeqFloXNTWQaMY q+QGsuXGz5Gi3mrUVvKRuyk2fTt4 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) Return-Path: 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 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 --- drivers/usb/dwc2/params.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 Tested-by: John Stultz #On HiKey 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)