Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3628255imu; Mon, 28 Jan 2019 08:05:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN4TIg8NvhRL3LD/tIyI7EN1jLqsImOL6yPTKZGkRRYmnceNHYxoMSDDd5Z/mZN14IPICGRa X-Received: by 2002:a63:304:: with SMTP id 4mr18589613pgd.99.1548691546386; Mon, 28 Jan 2019 08:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691546; cv=none; d=google.com; s=arc-20160816; b=XlTvffEuBds23kpiS7Yeu5dXOw6fy1VfFijSjmvzpp8dSBoJ1m5Sf41k94YSKikIB+ Yhf78TfJzmxtOm4E2Ni2Bum1lf7GkAleuTUwMu1kWQYTHCKBCaCvzEXrEtjI0ygn76Kx /ijjQfQVLyTcYFkD90rT+O8UxG2uePmJDeAo/jRL5xMBh/bsVmvKpH3V7/vbQfM5L9JV IJJ7yNwtXOkFIPT9fTwXhKdtSOg6iUu5lTM0tQ3NBRv/pJhYYnGqQZjw2taQkNke2U1+ NgkHra84/nKbLEnpLuCpX+cQfDBVatxhqw273VLjt+wdxtXHqca9SSfUJ/YBHeCCLwQ5 5Riw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iX48Td/CsCZEK99g16OGPk+FwX5v9Z7Sz50/d/t0LqM=; b=WpHIP01wGunPZEqL48dLMlMyJZPOBrtEU5qgWwhJDXB6ynRYnwob69WOenmGVWtwDS N85C9Epm9xZbrhSZwIavXgpNQE3IqsKUEbOJ563Vl8tLhJdWE+uNjiu5EW6mTeFMe9xm v/cZ93WQf90e/fgdFwu69Mj0LIJnKcrjLQnnnVnR0FF6Rx57rgleQ9aHymdAhjyI+kZe 8qCxlvxwJ6Fh7X8pwhe6/KOItLVtV5g08AUS7sNkyWNjFxBYYxR9pt5Qebpx9aajX6kt RefTb/kKvM0C2zFO3EbTJBxqLEgvIVMSgDcdBIyfTlwrUDAXnCpkj/kmQG+g0LZCaRyB nUIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qCCRbTcJ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si6531531plb.35.2019.01.28.08.05.30; Mon, 28 Jan 2019 08:05:46 -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=qCCRbTcJ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731636AbfA1QEj (ORCPT + 99 others); Mon, 28 Jan 2019 11:04:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:50252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730106AbfA1QEg (ORCPT ); Mon, 28 Jan 2019 11:04:36 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9A0F820989; Mon, 28 Jan 2019 16:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691475; bh=YHCOsfZhKbPFqTNavMEaNg9uS/DGsVxvozCv3lS0Ce0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qCCRbTcJddWZYA/P4kXBgqmMOvYeYw1bbOhgf/X4kKoXWu8AK2v+/5TfgdYZiVr5V NhOUNxyrR594mZ3Y/Sp4bU5p8cIou8nKdFbK7S9WLqTohOBmLtj82EzqgZVuL+2Ih0 I1brhFLfhdLouVHvFTwacKt1SAluD+EAQj6YZVLI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chunfeng Yun , Felipe Balbi , Sasha Levin Subject: [PATCH AUTOSEL 4.19 106/258] usb: mtu3: fix the issue about SetFeature(U1/U2_Enable) Date: Mon, 28 Jan 2019 10:56:52 -0500 Message-Id: <20190128155924.51521-106-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunfeng Yun [ 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 d045d8458f81..48d10a61e271 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