From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757202AbcHYVEB (ORCPT ); Thu, 25 Aug 2016 17:04:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58218 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754022AbcHYVD4 (ORCPT ); Thu, 25 Aug 2016 17:03:56 -0400 Date: Thu, 25 Aug 2016 16:55:21 -0400 From: Greg KH To: =?iso-8859-1?Q?Bj=F8rn?= Mork Cc: =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , Richard Purdie , Jacek Anaszewski , Felipe Balbi , Peter Chen , "linux-usb@vger.kernel.org" , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , 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 Message-ID: <20160825205521.GA32076@kroah.com> References: <20160823220404.9887-1-zajec5@gmail.com> <20160824092225.GB23180@kroah.com> <20160824210457.GC4305@kroah.com> <20160825125305.GB15567@kroah.com> <8737lsy9pf.fsf@miraculix.mork.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8737lsy9pf.fsf@miraculix.mork.no> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 25, 2016 at 08:39:24PM +0200, Bjørn Mork wrote: > 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? Hah, nice try :) I guess when I think "USB activity" I think about the lower layers of frames and acks and naks on the bus. But maybe because I have just recently been doing a lot of work down at the EHCI frame timing layer for some strange hardware... But you are right, if all you care about is the data that the host sees, then yes, you could do something like usbmon to "tickle" a led if you want to. Odds are, someone's already done this for a raspberry pi :) thanks, greg k-h