Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2139256imc; Tue, 12 Mar 2019 07:48:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKP+EeDMmPSVxUbi7Eu9KSpSxE/uEqjHmSvduwxRjdD4ZR+LEx6kV8vDDDDTmTRZTYXgbO X-Received: by 2002:a17:902:4181:: with SMTP id f1mr40673400pld.280.1552402134907; Tue, 12 Mar 2019 07:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552402134; cv=none; d=google.com; s=arc-20160816; b=ZTkLOe7QsiyxeIN/FMFifyCridj7vd7i8VElWVR2e8ZWW3GRu3SI5RZYfmRhYGWJM4 QK4LOngMkGv9Z/G0aXZ03b/jN5FaGzH/mrgIoT/xUIY9LJ4ihpHZGQScECLbSzsxCNOF dOXVNAbF6vP4WX8I/WaXtKsJ0A4zB36sNGOXz1O27CS6h0zn9x7zD8SVDAL2wS8ky5Wt AFPxkb3i7/jouarjVl4ykQMkihwWaqoSv6FkyjiHq+iFyW/PD5HgbqBeJCmSDHs6xLsn vEVx0YqLjkAt9I3+dRrBfY3+mdy+RexfubrC57BFStyyWebRqxfx/9peYBd0ck0mk2Ol UQrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-disposition :content-transfer-encoding:mime-version:cc:user-agent:date:subject :to:from; bh=wSeCJZbVBrumcAQEXhPhIPTiQXthaMdHuzuvhj2oHsE=; b=o317uruiJ0/4dPUKdFAHwbPhlOrbf/lwPt9xLzjpYLAn8mO+O9IIam9MBhAUsH5fXO Y9ARUjaGjPeTN3WFCKLoeA/ya/BJmIHLPQbH3OjVF1mTAxep/3BMcWaSH1uDIBOh3egr fldybwFy0OHec0DlSf3mOI8OCa8yfjvpsWldS+s32I3DolsX0cbomG9GpxI2fpCvXgEF M5lLSjZx+Z4yFuAxXWGxVoomPB/4uHIUxcCtSV6vPRHhGoysvg4ucCrqDS1kaY+TUl5X psZ2zIO+4MU/pzutDn9MG9lMt8BjT7JecIGHsN0MpjY5vUHBRXlDBjiMeEFV2EgIXJba mZ3w== 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 a1si7883148pfn.245.2019.03.12.07.48.38; Tue, 12 Mar 2019 07:48:54 -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 S1726733AbfCLOq7 (ORCPT + 99 others); Tue, 12 Mar 2019 10:46:59 -0400 Received: from ns.gsystem.sk ([62.176.172.50]:42592 "EHLO gsystem.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfCLOq7 (ORCPT ); Tue, 12 Mar 2019 10:46:59 -0400 X-Greylist: delayed 1606 seconds by postgrey-1.27 at vger.kernel.org; Tue, 12 Mar 2019 10:46:58 EDT Received: from [192.168.1.3] by gsystem.sk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1h3iGJ-00025t-5P; Tue, 12 Mar 2019 15:20:11 +0100 From: Ondrej Zary To: linux-usb@vger.kernel.org Subject: Resetting dead USB controllers automatically? Date: Tue, 12 Mar 2019 15:20:08 +0100 User-Agent: KMail/1.9.10 Cc: linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201903121520.08430.linux@zary.sk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, my USB controller sometimes dies when plugging a device (maybe because of static): [11197.529334] ehci-pci 0000:00:09.2: HC died; cleaning up [11197.529883] uhci_hcd 0000:00:09.0: host system error, PCI problems? [11197.529893] uhci_hcd 0000:00:09.0: host controller process error, something bad happened! [11197.530568] usb 1-1: USB disconnect, device number 7 [11197.531224] uhci_hcd 0000:00:09.0: host system error, PCI problems? [11197.531278] uhci_hcd 0000:00:09.0: host controller process error, something bad happened! [11197.532155] uhci_hcd 0000:00:09.0: host system error, PCI problems? [11197.532203] uhci_hcd 0000:00:09.0: host controller process error, something bad happened! [11197.539798] uhci_hcd 0000:00:09.0: host system error, PCI problems? [11197.539865] uhci_hcd 0000:00:09.0: host controller process error, something bad happened! [11197.540092] uhci_hcd 0000:00:09.0: host system error, PCI problems? [11197.540109] uhci_hcd 0000:00:09.0: host controller process error, something bad happened! [11197.541210] uhci_hcd 0000:00:09.0: host system error, PCI problems? [11197.541285] uhci_hcd 0000:00:09.0: host controller process error, something bad happened! [11197.553179] usb 1-2: USB disconnect, device number 3 [11197.554087] usb 1-4: USB disconnect, device number 4 [11197.580154] uhci_hcd 0000:00:09.0: FGR not stopped yet! [11197.943554] uhci_hcd 0000:00:09.0: host system error, PCI problems? [11197.943717] uhci_hcd 0000:00:09.0: host controller process error, something bad happened! [11197.943735] uhci_hcd 0000:00:09.0: host controller halted, very bad! [11197.943794] uhci_hcd 0000:00:09.0: HCRESET not completed yet! [11197.943809] uhci_hcd 0000:00:09.0: HC died; cleaning up rmmod & modprobe isn't enough to fix it. Reboot is needed to make it work again. Or something like this: #!/bin/sh rmmod ehci-pci rmmod uhci-hcd echo 1 >"/sys/bus/pci/devices/0000:00:09.0/remove" echo 1 >"/sys/bus/pci/devices/0000:00:09.1/remove" echo 1 >"/sys/bus/pci/devices/0000:00:09.2/remove" echo 1 >/sys/bus/pci/rescan modprobe uhci-hcd I'm not the only one affected by this problem: http://www.google.com/search?q=%22HC+died%3B+cleaning+up%22 Maybe the uhci/ehci drivers (or the USB core?) could reset the controller automatically to improve reliability. Looks like someone thought about this before but it was never implemented. There's a comment in ehci_handle_controller_death() function in drivers/usb/host/ehci-timer.c: /* Not in process context, so don't try to reset the controller */ The controller is: 00:09.0 USB controller [0c03]: VIA Technologies, Inc. VT82xx/62xx UHCI USB 1.1 Controller [1106:3038] (rev 62) 00:09.1 USB controller [0c03]: VIA Technologies, Inc. VT82xx/62xx UHCI USB 1.1 Controller [1106:3038] (rev 62) 00:09.2 USB controller [0c03]: VIA Technologies, Inc. USB 2.0 [1106:3104] (rev 65) -- Ondrej Zary