Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp5137849imm; Fri, 18 May 2018 17:49:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrIJ0sqKqMp6KbyR67fN6Rww3e8evsfA3lnKRc9bphpHAh/+vn9l9AnBbwWiecPDw4ysaq9 X-Received: by 2002:a17:902:9349:: with SMTP id g9-v6mr11266727plp.375.1526690990091; Fri, 18 May 2018 17:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526690990; cv=none; d=google.com; s=arc-20160816; b=gzDxfSvC/vtkNfbkX7Cfl8ygVEHispYCcBuwFHoyjdGVitN5c2U5P0Hn5UzJXywn1T XoFL2vV7stWcjpixo12CtRWg8Qk4JW6lOQM4fng9oZaevczaUcPPa99DSsZtHPl/6CDc yAkgMZ5YsoYBG4goiJlLUi7aBedLjEIPRgJ/KPRH/HcfKnOHmiIPxXv9/XwZ6/NV4Q8W Ui1yctHk8G0K7eciyevncAhp3FBbuTvPLty94UJBNG2iIRQhvdWzmVBXDT6GutzJzJJo Kfe8kNHWVUMaJjcetfAj1LuueZW5oEeUI2GcCF97pC6zbBeh54LOiW5G2eaW5aDGIvzs yphw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=K57CyW8qMRB21buxOn3TodfIN5c6Wib5Z8BD6RWGTws=; b=DTDiawzDwQBcAZO/kcDOz8vbnnjmPqDj+h6J8W9BuZCh1n46Aq421ayy2U8uX+P0k/ alQvCTj/maiTExRr09ZBcOSQepdyN0BnGqV/Xxq2T40yU7YF2wqiAnLtVABmURqrvh/u sGb4qHddNa9sl/TokEUn2pV6KRdwUTGR3xGLhBZwshwj9RKnB4y8rk9ymrnYKtD/47tO tXvFNNMZgmxLmbQ8saMDfh962Jbk8vB9zwjqZ5Xd2fAXGES1ENvZzD4DfNPcVAIcxWLI BuvpinaFNoRfkUUzMFhVUZQZ1sgFLAmlwb2RCoackjkPkl/4xvu8oKOOdeF58SFrdOW2 ABBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kmadjF4F; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6-v6si8489951plq.382.2018.05.18.17.49.35; Fri, 18 May 2018 17:49:50 -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=@linaro.org header.s=google header.b=kmadjF4F; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752193AbeESAtR (ORCPT + 99 others); Fri, 18 May 2018 20:49:17 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:41714 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751909AbeESAtM (ORCPT ); Fri, 18 May 2018 20:49:12 -0400 Received: by mail-pl0-f67.google.com with SMTP id az12-v6so5495223plb.8 for ; Fri, 18 May 2018 17:49:12 -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=sG4Ths4l9BGhJU+mJ9Wt0ACzwlbSgIXyrAndSuR1KvioKMaRK5YZgXhMOzzkAJz9ig VHZWDHrbhKQgYLKmK8nS+Rb3oNlu8qJkDbygV9xx9HBPyhy8UMk/Q/NUlUKwQLPkBpUF GP32smEXTd1jOw3JPW3VH4sq4B/JOg1WpvqZ54a0gbd9wpH/2Wf/cfuGcXJx3ZCLi1eD MLjFMgg7hk/Z5QQsba+oQYpqRv3mbNJoviFmHvhQWGYjX5w49oYGBXuST7mXrzvYFnGq yL6hj5uKcShucRnWgibmtYvHznVx3a63b7nFDz3QqSjHsTkilYMhavdcQVpmLXmPxbc5 3PKw== X-Gm-Message-State: ALKqPwdq75GR66NsQTHk9ogL0cJVCUX2eqaPwYI0SS/ulqT/xUrjVoBk 4iXQcM9KhIK4nt9/PB/T5B7I5iz9wtw= 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) 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) -- 2.7.4