Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2527214imu; Thu, 29 Nov 2018 06:26:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/XBcThbFtAb6alePD1dq/YRnNwOcAZP6CtlVb/S/9aPkFiH6wfAVMLIyh/ZyJt9SNZy5MAz X-Received: by 2002:a62:19d5:: with SMTP id 204mr1586446pfz.33.1543501568105; Thu, 29 Nov 2018 06:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501568; cv=none; d=google.com; s=arc-20160816; b=1JoB/MnMhW6yNpD5VhdcdrGNceSx1ipS/kWKPC1lv0r0nK7uvWm/jWJQlhRevZwiEr eSgV39HtY12fxAJScVr4D6d6AmllbZl2dv8tKgU24SnUAw+YEWM8ku2xbJA17JSAOrm7 AiYWwjOa6b6yWsMjLqjfXLXxcTPWlS0cX++FjqQF/oI84aOwI2NWAlrCHnXRF/CR9wr6 5gox6tTqF0YED4X4wcmNBh/3q7Fpf/Qmakuk4zCXsymqQy3zM5fupT94FRq944Rn1nxz kJiOqDSL06a5Gpxt8eD8kU1vk9/uMuLt2spvqgXtn4SeaPAJbo5dz2UYN5FF2JrdImXk kXwg== 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=AhnuMFt/i5DtLtUcLVadvqZ1JK6diAcA0t3cTkuCfJI=; b=qcceRJRZyuGeCqgk1LAhGC3zdPTs8FmR4RLlU4vTts9SWvUIJYRAH1AhniUBNdxCRb g6sP3a/JA48miUo9YE/FwDoTCRwE54AFV+x3NXz4NM07GC+Ht9Cc/AMiH6oGsL7pBXc8 G4uqMobGM7boRL49E6SiWuyzDKRSNmxXXuNYIEZ/Vt+hif32qxc3VbTYgZmF4OazWwMf G9uJoAZ0kr+N7bZFCyOxPWyVu0yvUNjzqTnFRq73HIEuC3ekP2b8nvM0jIH3zdEr4hbp Qg9C28jhc6j1Dj7uKOMYI006xe22NijIbfvgu+ksTUMyiF3HZbKAMmHaElLIudvjM/x7 7mxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=udHnXzWF; 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 v6si2039972pgv.277.2018.11.29.06.25.35; Thu, 29 Nov 2018 06:26:08 -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=udHnXzWF; 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 S1732711AbeK3BaJ (ORCPT + 99 others); Thu, 29 Nov 2018 20:30:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:57034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731500AbeK3BaJ (ORCPT ); Thu, 29 Nov 2018 20:30:09 -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 EE9AB21104; Thu, 29 Nov 2018 14:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501477; bh=n9DJN1Oty99bkT1IuSc7bNCie40ugdXeimF7j/GmC84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=udHnXzWF0wm3n9nj4oTgwkS7HR493FssMrioy7EZXJQMp9DL+X3O07bpXlZGOX47q FHRVdT2GIAXpwgPtbK50LCSgyOXTUROPzjvdOysS8+ng5yP7x8N+LwrDqo2tt8XnoG M9l3qLQNelY0BAdxTBsdcu5zun7BlAOG6i/oQy2o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dennis Wassenberg , Mathias Nyman Subject: [PATCH 4.14 006/100] usb: core: Fix hub port connection events lost Date: Thu, 29 Nov 2018 15:11:36 +0100 Message-Id: <20181129140059.440780027@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dennis Wassenberg commit 22454b79e6de05fa61a2a72d00d2eed798abbb75 upstream. This will clear the USB_PORT_FEAT_C_CONNECTION bit in case of a hub port reset only if a device is was attached to the hub port before resetting the hub port. Using a Lenovo T480s attached to the ultra dock it was not possible to detect some usb-c devices at the dock usb-c ports because the hub_port_reset code will clear the USB_PORT_FEAT_C_CONNECTION bit after the actual hub port reset. Using this device combo the USB_PORT_FEAT_C_CONNECTION bit was set between the actual hub port reset and the clear of the USB_PORT_FEAT_C_CONNECTION bit. This ends up with clearing the USB_PORT_FEAT_C_CONNECTION bit after the new device was attached such that it was not detected. This patch will not clear the USB_PORT_FEAT_C_CONNECTION bit if there is currently no device attached to the port before the hub port reset. This will avoid clearing the connection bit for new attached devices. Signed-off-by: Dennis Wassenberg Acked-by: Mathias Nyman Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/hub.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -2815,7 +2815,9 @@ static int hub_port_reset(struct usb_hub USB_PORT_FEAT_C_BH_PORT_RESET); usb_clear_port_feature(hub->hdev, port1, USB_PORT_FEAT_C_PORT_LINK_STATE); - usb_clear_port_feature(hub->hdev, port1, + + if (udev) + usb_clear_port_feature(hub->hdev, port1, USB_PORT_FEAT_C_CONNECTION); /*