Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2505132imm; Mon, 24 Sep 2018 05:36:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV60p58aiIdMjlae5NHwGNBCP9LU259b/pyy+YzAq78kMefhQZbGK3TMLOJ3HUw5KRaXGfbmX X-Received: by 2002:a63:4716:: with SMTP id u22-v6mr7851343pga.95.1537792569407; Mon, 24 Sep 2018 05:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792569; cv=none; d=google.com; s=arc-20160816; b=O54czc+M3BHJQ4Z54rN56cxVs8qyaFZd8jN6eEQ0UvSAvW23An7aM8vgBnGv5w3yuM aYPvRgNa/Z/8QrA86CQOsXEmkSQSRWpcj/AtWKwpNmfKWRtV+3ljZMCduGo2B2h4yqvi 77mqcxfkj0LNw9Md29ral3ryL7TZX5hy7ZIfKCqWwcO+zldbVpJtVUhZqqw/7UXpxUHV qa6Ax+WGekgPIFyw/z0Kn/kzg+GIl6ufUvkZ900t7HZ9b5239peNsSikgF+23FR+UkfA yFmKhvadIs0lcv3xFiRDi/DUIEoLVNw9dsI9s6MmN4MKpUxhgMhheebxtdmKbRqbWDzf vfoQ== 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; bh=C7/zuJDf8zy2aU7ENiu7CfSkxv2KAQdR3/aCPpC342A=; b=cQXyyJyGKgdxm0H3hwln/TDNTc4skpn7T7yJ4DadnIS11GH/Wyln/G3K/yi3Rxudpv ww0ThkKcDZpVdFNU7f0okSTrMEbeODTUhd3ppZxOhCmxUzr5deTp7IHTAKCUXhIUP1ky hNoqKmrQr2gBhSh5fU8rgUWfQalgimKrfdy6iTD1O4b5FhWPli5XuIbMDUgrN9v9FxU4 uVwmbe40l/yDa8iJJ5XK9ts6T0OyXKrxNGFwyvBNpMaqrrJBLfpht99c/BjeTSswcy9a VMoDlPG9cK5WYnyWtjAb/RNcknXKBRzyPJxlJ/uySCh97NV+9hPdHC1vKpPC85SCa/eb mjVA== ARC-Authentication-Results: i=1; mx.google.com; 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 t11-v6si736605pgm.572.2018.09.24.05.35.54; Mon, 24 Sep 2018 05:36:09 -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; 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 S2388383AbeIXSgx (ORCPT + 99 others); Mon, 24 Sep 2018 14:36:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58480 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387602AbeIXSgw (ORCPT ); Mon, 24 Sep 2018 14:36:52 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E4D6B1018; Mon, 24 Sep 2018 12:34:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunfeng Yun Subject: [PATCH 4.18 116/235] usb: mtu3: fix error of xhci port id when enable U3 dual role Date: Mon, 24 Sep 2018 13:51:42 +0200 Message-Id: <20180924113117.616351333@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chunfeng Yun commit 78af87b8bbbbcaa613f1a7d8f14472fe9a7dc622 upstream. If dual role mode is enabled, when switch u3port0 to device mode, it will affect port id calculation of host(xHCI), specially when host supports multi U2 ports or U3 ports, so need enable its dual role mode, and fix it here. Signed-off-by: Chunfeng Yun Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/mtu3/mtu3_core.c | 6 +++++- drivers/usb/mtu3/mtu3_hw_regs.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -107,8 +107,12 @@ static int mtu3_device_enable(struct mtu (SSUSB_U2_PORT_DIS | SSUSB_U2_PORT_PDN | SSUSB_U2_PORT_HOST_SEL)); - if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG) + if (mtu->ssusb->dr_mode == USB_DR_MODE_OTG) { mtu3_setbits(ibase, SSUSB_U2_CTRL(0), SSUSB_U2_PORT_OTG_SEL); + if (mtu->is_u3_ip) + mtu3_setbits(ibase, SSUSB_U3_CTRL(0), + SSUSB_U3_PORT_DUAL_MODE); + } return ssusb_check_clocks(mtu->ssusb, check_clk); } --- a/drivers/usb/mtu3/mtu3_hw_regs.h +++ b/drivers/usb/mtu3/mtu3_hw_regs.h @@ -459,6 +459,7 @@ /* U3D_SSUSB_U3_CTRL_0P */ #define SSUSB_U3_PORT_SSP_SPEED BIT(9) +#define SSUSB_U3_PORT_DUAL_MODE BIT(7) #define SSUSB_U3_PORT_HOST_SEL BIT(2) #define SSUSB_U3_PORT_PDN BIT(1) #define SSUSB_U3_PORT_DIS BIT(0)