Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp146773imm; Mon, 2 Jul 2018 09:05:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJS7eo0QzodM5HMGBWzed/PQc2lpqFqtXWZmbPdwpf+G+6kcNr9xAUwJLrB3q61418bJbno X-Received: by 2002:a63:107:: with SMTP id 7-v6mr21867042pgb.289.1530547525197; Mon, 02 Jul 2018 09:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530547525; cv=none; d=google.com; s=arc-20160816; b=wObmxJuQK4YtSgySg9qOH3z/e17GnoPlLOl8ajXpqHD6N3VDmNlcpdEadU5B7tZ238 XXmbVdRamXHspQpDOC3/vMtpflE4rudhIkOCcsmaJvvgXSFErUeIw27Ia74U/YAmxDSS DBWPEpxjrOiqwv/gro2+hnkho3cOQhV6qB9QMxxjXLHFtI5OfbVxI7frQYI3kIJPS1oB I2JN5JK35w9BvAAiNJR+UyQhx1ARz8RnMhDItkW+SAPnjuCazMAgKtsZTCrg9HUn5dBj kxsL6W6+vN9V0rsO+5N1pbbAuwnG4WP562CiPql0J58Gmf2+EZTwccC7DknfnhadOIaH AeCw== 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 :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=rx6D6Pfu7EZo5nMg9xpXPDB0AqpXJA1zpIxfa3dYvxY=; b=n/ECs5ePn10UNOGWJA61VRzVtXVpM87NhrG7WI1hNyGSUa4I+u2MQezqgJOoEWj0ZL sIeNI7SlHRy99GCmD2GGtI+03yX+mxoTGhkykbFSJuwXv5ZmCTKRAqUCb/0hn7epq+5F eQvzVpMLISgr/2xZfu4wV+iRB68yrhcYw+usrB09gqEUl+DqMpUVYr8ZSVaQW193ftrR 2pws5rySWtGH0m+GaTIpl6jE4xuVvu3SbVN8iVvIa76LZErfLxDv6Z+bZoF0M8clHWax 4/YKBUzJGv4Ijo/DZhZGdph8ss8cfLS+tZE2SHGBe7pgroQkF/FCpuavvVvlCwX8hKMT Z9jg== 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 u13-v6si16628115plm.99.2018.07.02.09.05.10; Mon, 02 Jul 2018 09:05:25 -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 S1752533AbeGBQD7 (ORCPT + 99 others); Mon, 2 Jul 2018 12:03:59 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:39006 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752137AbeGBQD5 (ORCPT ); Mon, 2 Jul 2018 12:03:57 -0400 Received: (qmail 3435 invoked by uid 2102); 2 Jul 2018 12:03:56 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 2 Jul 2018 12:03:56 -0400 Date: Mon, 2 Jul 2018 12:03:56 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Paul Menzel cc: Greg Kroah-Hartman , , Subject: Re: [PATCH] usb/host/pci-quirks: Only reset USB bus on NVIDIA devices In-Reply-To: <3301ef51-e35f-1273-6efc-8c11f31a945c@molgen.mpg.de> Message-ID: 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 On Mon, 2 Jul 2018, Paul Menzel wrote: > [Taking stable@ out of CC. I just started to use `git send-email`.] > > > Dear Alan, > > > Am 02.07.2018 um 17:45 schrieb Alan Stern: > > On Sun, 1 Jul 2018, Paul Menzel wrote: > > > >> Currently, on the AMD board Asus F2A85-M Pro there is a 100 ms delay as > >> the USB bus of each of the two OHCI PCI devices is reset. As a 50 ms > >> delay is done per the USB specification. > >> > >> Commit c6187597 (OHCI: final fix for NVIDIA problems (I hope)) > >> unconditionally does the bus reset for > >> all chipsets, while it was only doen for NVIDIA chipsets before. > > > > I don't follow this at all. Prior to that commit, the bus reset (i.e., > > > > writel(control & OHCI_CTRL_MASK, base + OHCI_CONTROL); > > > > ) was performed unconditionally for _all_ controllers. (However, the > > 50-ms delay was used only for NVIDIA hardware.) Following that commit, > > the reset is performed for all controllers, but only if the HCFS > > bitfield is nonzero. > > > >> As it should not be needed for non-NVIDIA chipsets, only do the reset > >> for Nvidia devices. > > > > Therefore this reasoning is wrong. > > True. Thank you for checking that. > > >> Tested on Asus F2A85-M PRO and ASRock E350M1. The USB keyboard works and > >> the LUKS passphrase can be entered. > > > > Unfortunately, there is a wide variety of OHCI controller hardware > > available. Something that works on one or two controllers might not > > work on another. > > The problem is, that currently 100 ms sleep is over 10 % of the overall > execution time of the Linux kernel here. So I really like to not sleep > if it’s not needed. It would be nice to execute the probes in parallel; that would reduce the total delay to 50 ms. However, that is the subject of a separate discussion. > > Besides, doesn't it seem like a bad idea to reset the controller while > > leaving devices on the USB bus in whatever state they happened to be? > > Yes, it’s probably not optimal. > > I wonder if the reset is needed, if the firmware has already initialized > the device. The devices on the bus need to be reset, because the OS has no idea of what they are and what the firmware has them doing. For example, the firmware may have assigned bus address 2 to a keyboard. But the OS can initialize the devices in a different order, and it might want to assign bus address 2 to a USB drive. Then you'd have two devices trying to use the same address at the same time, which would not be a good thing. Alan Stern