From patchwork Sun Dec 9 19:01:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10720167 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C019015A6 for ; Sun, 9 Dec 2018 19:01:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACD9D2A0FA for ; Sun, 9 Dec 2018 19:01:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D3B62A0FE; Sun, 9 Dec 2018 19:01:57 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 1D6522A0FA for ; Sun, 9 Dec 2018 19:01:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726281AbeLITBu (ORCPT ); Sun, 9 Dec 2018 14:01:50 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52712 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbeLITBt (ORCPT ); Sun, 9 Dec 2018 14:01:49 -0500 Received: by mail-wm1-f65.google.com with SMTP id r11-v6so8791640wmb.2; Sun, 09 Dec 2018 11:01:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OKSka/+/cVpRHh/4vbzTPbz+qQ+/vVf1kkbTmUZ6zvo=; b=CHw6CpTPHF19FzbrESn/kQOq6RBZjBX2S9LWGTvd4Jy5/8hOTLvK5HaSUSsTjyX1xs LGrSGfuk+YX1siefrZpEO2MfetpTNMBJPehrBu1bYDwZk6z7xwYUAwJpXYhqIFYXycZ2 mfp5AmwylQj3T79OqV0CnFOGUrte4hj3bZCwmJ4TUren8ZJEeIWaD3JVr0UFENi74RtA 28bdnI92HVtRQCuAoYYWN2r9D9dbuxJHM5Ca4uwhxwiGRhjT+RsBdIXFBn3GW/fXz8eQ Si9R+aUBbSZdgu+jIvtCMfGJ53rIeSF7CzDuNBxg0I5a1IE4pWpHFPSC3MsEi8gfLWHe Ak+g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=OKSka/+/cVpRHh/4vbzTPbz+qQ+/vVf1kkbTmUZ6zvo=; b=B0PXIeYjemZwSGl4mMmVZTpC4mcCyEdOFWQM1GiAYB+361xR3WzsP1JoRvQQkL5+Ug TcotRwxVItoHcs7yGs2FCc2YGN/yRVM0XUpKx+80/JjBHGVDmDLpc4vF8FWj0U7Wbtr+ DufCuFqijCSz9BuExHboXahgABQHperMZsXR9oxn6jLL2O9Wp+02r5ji/Z0+ZsJnjwa1 bjuI+nph6X2nwsSA+uG/K5bZ0kEnGyJJW5mguytucxmq+jJ0TQNkfacdsUEP6X05O6+S uouk/6xYnqujnWqeRSW/RQnbLxrWRCc2BQzfzUuJy/26AC2yfupfWXLLtqoCbNTm7g8h 9Okg== X-Gm-Message-State: AA+aEWZGOX959fPea8lh7arz6YywgdhrumBVak4MZM8axvEqdOn8bfVs wqYo5LRay+BHQ33MXfQUwP1M0fk/ X-Google-Smtp-Source: AFSGD/X8xBh/cgoJxf6cXn7CZH//Zs45FpKW5F/aGAR9KTjB9/fJPP0PAoWaL249Vj1v8NrGS3Z1TQ== X-Received: by 2002:a1c:c64e:: with SMTP id w75mr8724696wmf.46.1544382106224; Sun, 09 Dec 2018 11:01:46 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD73FBA00428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:dc:d73f:ba00:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id l197sm30560215wma.44.2018.12.09.11.01.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Dec 2018 11:01:45 -0800 (PST) From: Martin Blumenstingl To: linux-usb@vger.kernel.org, hminas@synopsys.com, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, Arthur.Petrosyan@synopsys.com, christianshewitt@gmail.com, Martin Blumenstingl , stable@vger.kernel.org Subject: [PATCH 1/1] usb: dwc2: disable power_down on Amlogic devices Date: Sun, 9 Dec 2018 20:01:29 +0100 Message-Id: <20181209190129.11870-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181209190129.11870-1-martin.blumenstingl@googlemail.com> References: <20181209190129.11870-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 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 Disable power_down by setting the parameter to DWC2_POWER_DOWN_PARAM_NONE. This fixes a problem on various Amlogic Meson SoCs where USB devices are only recognized when plugged in before booting Linux. A hot-plugged USB device was not detected even though the device got power (my USB thumb drive for example has an LED which lit up). A similar fix was implemented for Rockchip SoCs in commit c216765d3a1def ("usb: dwc2: disable power_down on rockchip devices"). That commit suggests that a change in the dwc2 driver is the cause because the default value for the "hibernate" parameter (which then got renamed to "power_down" to support other modes) was changed in the v4.17 merge window with: commit 6d23ee9caa6790 ("Merge tag 'usb-for-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-testing"). Cc: # 4.19 Suggested-by: Christian Hewitt Signed-off-by: Martin Blumenstingl Acked-by: Minas Harutyunyan Tested-by: Brad Harper --- 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 7c1b6938f212..38c813b1d203 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -111,6 +111,7 @@ static void dwc2_set_amlogic_params(struct dwc2_hsotg *hsotg) p->phy_type = DWC2_PHY_TYPE_PARAM_UTMI; p->ahbcfg = GAHBCFG_HBSTLEN_INCR8 << GAHBCFG_HBSTLEN_SHIFT; + p->power_down = DWC2_POWER_DOWN_PARAM_NONE; } static void dwc2_set_amcc_params(struct dwc2_hsotg *hsotg)