Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2722158imj; Mon, 11 Feb 2019 07:30:53 -0800 (PST) X-Google-Smtp-Source: AHgI3IYBS1b2zLOTjSAuPG+HRqUf2pwq9IV823KmtIenCJj2DeBvIFEwzSfs6cXRDDAr0H3Hp09z X-Received: by 2002:a63:d347:: with SMTP id u7mr17950533pgi.383.1549899053796; Mon, 11 Feb 2019 07:30:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549899053; cv=none; d=google.com; s=arc-20160816; b=n2CGNbFex3REetdMkUkB6wmtdY2SnV2bAsfTXI9Xh4hQcEop4izcRVmf/u++fmuy+i SDY/HbO5pl2tU8/W48y3wK+qFN6h0iYKazmse5OEN5TyaM9OqLbqZYxzUbVQ1eqBa44B klgMhlt1ZSIqAMxB2AXZrFhy+ljsLf/RwmmCzdwc8l6vEFn5pbi570g8mZyoAD8g56+p KktDn/VCVHjX/Vz406KT/GtZlGEFSqc4hLz+CuzWDga+wuKoqeqv6misJoISoT3nrtLZ Z8uYrGNveWbus9yQml0FtXzi/InPTdqrqOcaA1cooow7yGwHYZd5XAHpa4MVfeWiiieN slUw== 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=ODTnYT0YJmz14b9SvyFwo9UBUNHJgBfAbmZETsAaJVA=; b=C2m9pTb6dQ06hQnB+2g8ez3miS7pTESaCSxen6zmFoeIY2uv1l799UvPoDc7lnVEXo oIfbhMdSHmWPUPqo9FgAd52bT8munkeFjAEz+71yeMQvwXQRlPf32R9PjofJRh+bVTdc xnTeXvTy6jWVotvcdWEcrcHWr9dB6jCXvAUjhEGVJvQR9jWbzJPpJeQu+XUcxbr/Lydr tjJTwzpw6xnZ5/72wqKjRVox0z8lhfVCth9z84noLjSwjzl7XhCDHPvvvVUBk5QxTGKJ Rvaxw9D4vmw7hCFVj/uqPi8g4p9neb++T28+02IKm6w2SPsmGw1dNs0Qjt6JCXqcm1Ne rKvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wq97ylr+; 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 t19si9731919pgl.102.2019.02.11.07.30.37; Mon, 11 Feb 2019 07:30:53 -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=wq97ylr+; 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 S2389287AbfBKO5H (ORCPT + 99 others); Mon, 11 Feb 2019 09:57:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:44358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388263AbfBKO5A (ORCPT ); Mon, 11 Feb 2019 09:57:00 -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 C978F222AB; Mon, 11 Feb 2019 14:56:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897020; bh=gha/FcjtfZvUQyuruUvGqXAg6kA7gfOi94bbqM+FO0g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wq97ylr+DMTIMbEBTs2w8Lj4JHS07dwzAw4A/EdP6zHxram9iXIRWihqZJMyW0I8m 2vUGUsGlrgHlV73ANwTzx/MmZsOpkIndXdIsGLCuJeKoYzQWgKlkpyYsvk0ZU9lrLl dH4Sg2x9BvQdqY/xVKE6HzV48iKmkFFIeWdelw8c= 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.14 065/205] usb: mtu3: fix the issue about SetFeature(U1/U2_Enable) Date: Mon, 11 Feb 2019 15:17:43 +0100 Message-Id: <20190211141833.033703648@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 947579842ad7..95978e3b363e 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -564,8 +564,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 958d74dd2b78..7997cf5f06fc 100644 --- a/drivers/usb/mtu3/mtu3_gadget_ep0.c +++ b/drivers/usb/mtu3/mtu3_gadget_ep0.c @@ -335,9 +335,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; @@ -350,9 +350,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