Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5385079imu; Tue, 13 Nov 2018 05:52:33 -0800 (PST) X-Google-Smtp-Source: AJdET5ds0NBZb1cm/tOQwgKqvnfcTmISoag1HXygExdY7r5pbo5PC4Z2E7RPLrNS8FjNQBa9BqhT X-Received: by 2002:a62:32c4:: with SMTP id y187-v6mr5275078pfy.4.1542117153457; Tue, 13 Nov 2018 05:52:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542117153; cv=none; d=google.com; s=arc-20160816; b=0Xj6yxXn/gvyQrSP0v5l1uzkOBSmkG/LwvqyR+Fbse4MUm49E2Wb7WrI77tBDEMrei tRzq/YE5GibzI98q4ukLTVqT971mjozeAriphXrdo4j47mnmGAaDbz8WWq+z7pswAQH2 k3dW0tQPujnaIkcBnyXZP3nbJkXyuOjIpKmvQAf3HwDqFQzJyruTft2dNXpfCjUiXHDB DLKVgo6aH5dh37KWh5DrMaHCvjKqWm+oF2D93CwtrI57Z9DxaE1EyeHQY186PoJRDISm i+UvONGaTccISueMsH5LiBqbpyj20vJ0m0vZ5jyF5iE/NxzLLii7RfIyw2Fqe6PWAlzK Q9qw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8IV4U8aADj4IzLPQi8D7nS7GudZpfMstJcoH9tdAyQo=; b=sGM+zRJPyNLEsP2zlusKRRufhzS0tchXoKvPdkj4Q9giWb+AbzXhWefI3ff+i3iyRI T+4AaJVo1BxC6i42e3Q/T25+Mx/bt+BYA9lK6wE/cDdfGqSRUaOP7FAIZIEh3cdM2IdZ HtAHRJxaAeKWGg37W9Rfx6bWjBgg6A0PR4w7AER9kWso9wmok98MYinbHViYShhgebVF dyteOxSAXuov+xEqnCYn32RAbd0Bf73t0yDaznzOQACAwi9CMNul8bOGTj5B0b8rNnin dccX6pJLy+ESVjLLnoL3QfjGsAT/cAUOD0KAFOPGHJY7XjoXvJMaGV0hh9W+6QOsYWB1 nCcQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b40-v6si23499789pla.285.2018.11.13.05.52.17; Tue, 13 Nov 2018 05:52:33 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387583AbeKMXuJ (ORCPT + 99 others); Tue, 13 Nov 2018 18:50:09 -0500 Received: from mga18.intel.com ([134.134.136.126]:46233 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732959AbeKMXuJ (ORCPT ); Tue, 13 Nov 2018 18:50:09 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2018 05:51:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,499,1534834800"; d="scan'208";a="249340710" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.164]) ([10.237.72.164]) by orsmga004.jf.intel.com with ESMTP; 13 Nov 2018 05:51:51 -0800 Subject: Re: [PATCH] usb: core: Fix hub port connection events lost To: Dennis Wassenberg , Alan Stern , Mathias Nyman , Greg Kroah-Hartman Cc: Ravi Chandra Sadineni , Kuppuswamy Sathyanarayanan , Bin Liu , Maxim Moseychuk , Mike Looijmans , Dominik Bozek , USB list , Kernel development list References: <4140fee5-8935-daed-8438-d04d7f1198b2@secunet.com> <0427ea9d-a04c-61bf-9f64-5f2a42ab0072@linux.intel.com> <414018c4-60ed-279f-f77e-b31f4813a540@secunet.com> From: Mathias Nyman Message-ID: <1573e062-d095-a8d0-5b1b-e2364ad0729b@linux.intel.com> Date: Tue, 13 Nov 2018 15:55:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <414018c4-60ed-279f-f77e-b31f4813a540@secunet.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13.11.2018 15:40, Dennis Wassenberg wrote: > 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 > --- > drivers/usb/core/hub.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index c6077d582d29..2731fad6f659 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -2849,7 +2849,9 @@ static int hub_port_reset(struct usb_hub *hub, int port1, > 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); > > /* > Acked-by: Mathias Nyman