Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2651483imj; Mon, 11 Feb 2019 06:29:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IasReSEiQZQgbPV2fM/l43KpWOQKQ5lvbAlsjERPtjccJN8FWfzBYqgPkjZ4AQrUvH9nI7k X-Received: by 2002:a63:d49:: with SMTP id 9mr5922340pgn.27.1549895385551; Mon, 11 Feb 2019 06:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895385; cv=none; d=google.com; s=arc-20160816; b=ABWS9HAxfI9dA5oY9Q1tWWQ9Y08LM3PkRyv26WD0lvd0FJJDYAvx14+e1bv20xNy51 stjFk1Krh74ZiQcis+wMSvHf9myptxKSRV3wuvNo4POM0qS4fIQM5SALA1yf3uf0LSPY WNbtxqkQyGoAP5+N3voao0uPPoF3q+ZwibzDk9dYosZJycxPEVKE118YMRpkguClGndP 2yskKGzZLt0/F0G2NtRQyxLEPjdMzljTNS/A4cIiA0ZkdY3aVTsUfCXvjD4yQxJWGOPH 2tcwVh0J2ljs5NOU1eSg6Ip3pKV4fim0gZBopeXsIu87bRNzDoZe1ioYqU3epZ1PK/PX m9xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zMHJfFDIesdJPq7TEzhkNTHnsTal9mDrB8Fx+fCUjDY=; b=rH5WMGIwuyItQwbi8JDKpevRGHz9fpDhJ3JR1aeLgZCbq1fiGuzUoeb6RirWZ07OuO w9LaXYW/V2VDVySySFgafsG3HTewkfG6MTYs8uY+/kIbxrNMQVrU8mpSsBeZegl54dNp hC9zNH1O8zf+sOwQUeuQA+FnuA3ms5OmGu7quFRP+xBKv+3NDMOLgLxjOCqhfDpLz2G6 +G98fQcj6z1n3wGr5e8leNrd/T8kZixOnc9d4OGFyPj7PbD1S5K/rTUC8w84ppGcwgh6 q1iUvv3Te/nFMVZHON0a8UbwMsjL+/HmMvnWPw4oHX0woNKXs32bQWWrMiGGQSylrfUM e9fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mv1CFARD; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m21si5670782pls.324.2019.02.11.06.29.30; Mon, 11 Feb 2019 06:29:45 -0800 (PST) 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=@kernel.org header.s=default header.b=mv1CFARD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728692AbfBKO1j (ORCPT + 99 others); Mon, 11 Feb 2019 09:27:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:33462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729743AbfBKO1h (ORCPT ); Mon, 11 Feb 2019 09:27:37 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 474E921855; Mon, 11 Feb 2019 14:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895256; bh=+NRQya5fWAYBHwrZMGSKb6r941a1uDjni8mFFtAq3mg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mv1CFARDjBC56B3my9+5MetUS48YaWB7nGIjntNwXiyOz9rqN79TsmGBHjKMSHKgM Y0fpQLFwSzjkZ0vi+TvMzyr5c14+eG0dCy2K0Wf8YfF+jWpDwRQKavfKmGIaUXLzAP c4rsgZ9qXWsM/B4QA/RZ5DDveOsos7XWkm5m6V7k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunfeng Yun , Felipe Balbi , Sasha Levin Subject: [PATCH 4.20 115/352] usb: mtu3: fix the issue about SetFeature(U1/U2_Enable) Date: Mon, 11 Feb 2019 15:15:42 +0100 Message-Id: <20190211141853.172799857@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a0678e2eed41e81004308693ac84ea95614b0920 ] Fix the issue: device doesn't accept LGO_U1/U2: 1. set SW_U1/U2_ACCEPT_ENABLE to eanble controller to accept LGO_U1/U2 by default; 2. enable/disable controller to initiate requests for transition into U1/U2 by SW_U1/U2_REQUEST_ENABLE instead of SW_U1/U2_ACCEPT_ENABLE; Signed-off-by: Chunfeng Yun Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/mtu3/mtu3_core.c | 4 +++- drivers/usb/mtu3/mtu3_gadget_ep0.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index ae70b9bfd797..860693520132 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -578,8 +578,10 @@ static void mtu3_regs_init(struct mtu3 *mtu) if (mtu->is_u3_ip) { /* disable LGO_U1/U2 by default */ mtu3_clrbits(mbase, U3D_LINK_POWER_CONTROL, - SW_U1_ACCEPT_ENABLE | SW_U2_ACCEPT_ENABLE | SW_U1_REQUEST_ENABLE | SW_U2_REQUEST_ENABLE); + /* enable accept LGO_U1/U2 link command from host */ + mtu3_setbits(mbase, U3D_LINK_POWER_CONTROL, + SW_U1_ACCEPT_ENABLE | SW_U2_ACCEPT_ENABLE); /* device responses to u3_exit from host automatically */ mtu3_clrbits(mbase, U3D_LTSSM_CTRL, SOFT_U3_EXIT_EN); /* automatically build U2 link when U3 detect fail */ diff --git a/drivers/usb/mtu3/mtu3_gadget_ep0.c b/drivers/usb/mtu3/mtu3_gadget_ep0.c index 25216e79cd6e..3c464d8ae023 100644 --- a/drivers/usb/mtu3/mtu3_gadget_ep0.c +++ b/drivers/usb/mtu3/mtu3_gadget_ep0.c @@ -336,9 +336,9 @@ static int ep0_handle_feature_dev(struct mtu3 *mtu, lpc = mtu3_readl(mbase, U3D_LINK_POWER_CONTROL); if (set) - lpc |= SW_U1_ACCEPT_ENABLE; + lpc |= SW_U1_REQUEST_ENABLE; else - lpc &= ~SW_U1_ACCEPT_ENABLE; + lpc &= ~SW_U1_REQUEST_ENABLE; mtu3_writel(mbase, U3D_LINK_POWER_CONTROL, lpc); mtu->u1_enable = !!set; @@ -351,9 +351,9 @@ static int ep0_handle_feature_dev(struct mtu3 *mtu, lpc = mtu3_readl(mbase, U3D_LINK_POWER_CONTROL); if (set) - lpc |= SW_U2_ACCEPT_ENABLE; + lpc |= SW_U2_REQUEST_ENABLE; else - lpc &= ~SW_U2_ACCEPT_ENABLE; + lpc &= ~SW_U2_REQUEST_ENABLE; mtu3_writel(mbase, U3D_LINK_POWER_CONTROL, lpc); mtu->u2_enable = !!set; -- 2.19.1