From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932342AbcHYSwQ (ORCPT ); Thu, 25 Aug 2016 14:52:16 -0400 Received: from canardo.mork.no ([148.122.252.1]:36919 "EHLO canardo.mork.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752629AbcHYSwO (ORCPT ); Thu, 25 Aug 2016 14:52:14 -0400 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Greg KH Cc: =?utf-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , Richard Purdie , Jacek Anaszewski , Felipe Balbi , Peter Chen , "linux-usb\@vger.kernel.org" , =?utf-8?Q?Raf?= =?utf-8?Q?a=C5=82_Mi=C5=82ecki?= , Jonathan Corbet , Ezequiel Garcia , Matthias Brugger , Boris Brezillon , Geert Uytterhoeven , Stephan Linz , "open list\:DOCUMENTATION" , open list , "open list\:LED SUBSYSTEM" Subject: Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Organization: m References: <20160823220404.9887-1-zajec5@gmail.com> <20160824092225.GB23180@kroah.com> <20160824210457.GC4305@kroah.com> <20160825125305.GB15567@kroah.com> Date: Thu, 25 Aug 2016 20:39:24 +0200 In-Reply-To: <20160825125305.GB15567@kroah.com> (Greg KH's message of "Thu, 25 Aug 2016 08:53:05 -0400") Message-ID: <8737lsy9pf.fsf@miraculix.mork.no> User-Agent: Gnus/5.130015 (Ma Gnus v0.15) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id u7PIqKcb006348 Greg KH writes: > On Thu, Aug 25, 2016 at 07:14:52AM +0200, Rafał Miłecki wrote: >> >> Good question. I would like to extend this USB port trigger in the >> future by reacting to USB activity. This involves playing with URBs >> and I believe that at that point it'd be getting too much USB specific >> to /rule them all/. > > Oh that's never going to work, sorry. USB "activity" happens deep in > USB host controller hardware, not up at the kernel level at all. It's > just too fast, and would take up too much CPU to do it otherwise. Heck, > even old UHCI 1.1 USB controllers did this. > > USB "activity" happens all the time, look at a USB bus analyzer if you > want to see what goes on. Teasing out what is "real data" and what is > just "normal bus activity" is impossible at the kernel level, OK, I am going to play stupid again: Does this mean that usbmon is impossible? > and really > makes no sense at all (your led would just be "on" all the time.) I don't see how this is any different from e.g. the network activity triggers. FWIW, on my system "cat /sys/kernel/debug/usb/usbmon/0u" can be silent for long periods, and show a rush of lines whenever there is USB activity. I imagine that a LED triggered by a hook in a similar place would be useful on systems with LEDs for that sort of stuff. Bjørn