From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Brownell Subject: Re: Threaded interrupts for synaptic touchscreen in HTC dream Date: Wed, 22 Jul 2009 09:51:53 -0700 Message-ID: <200907220951.54419.david-b@pacbell.net> References: <5d5443650907151033w36008b71pe4b32bcea9489b75@mail.gmail.com> <20090722121800.GD21171@rakim.wolfsonmicro.main> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org To: Thomas Gleixner Cc: Mark Brown , Dmitry Torokhov , Trilok Soni , Pavel Machek , Arve Hj?nnev?g , kernel list , Brian Swetland , linux-input@vger.kernel.org, Andrew Morton , linux-i2c@vger.kernel.org, Joonyoung Shim , m.szyprowski@samsung.com, t.fujak@samsung.com, kyungmin.park@samsung.com, Peter Zijlstra , Daniel Ribeiro List-Id: linux-input@vger.kernel.org On Wednesday 22 July 2009, Thomas Gleixner wrote: > main interrupt > =A0 =A0 =A0hardirq handler wakes main thread handler >=20 > main thread handler > =A0 =A0 bus magic > =A0 =A0=A0=A0=A0=A0=A0subdevice1 "hardirq" handler wakes subdevice1 i= rq thread > =A0 =A0=A0=A0=A0=A0=A0subdevice2 "hardirq" handler wakes subdevice2 i= rq thread Why force this wasteful/undesired "all subdevices must have their own IRQ handling thread" policy? As previously noted, a single thread typically suffices. There's no need to waste a dozen (or so) pages of memory for such purposes ... these events are (as noted most recently by Mark) infrequent/rare and performance isn't a functionality gatekeeper. Plus ... > =A0 =A0 main thread handler waits for subdevice1/2 handlers to comple= te =2E.. sharing that thread can eliminate that synchronization problem, and simplify the whole process. > subdevice1 thread handler > =A0 =A0 bus magic > =A0 =A0 .... > =A0 =A0 thread_fn returns > =A0 =A0 signal main thread handler via completion >=20 > subdevice2 thread handler > =A0 =A0 bus magic > =A0 =A0 .... > =A0 =A0 thread_fn returns > =A0 =A0 signal main thread handler via completion >=20 > main thread handler resumes > =A0 =A0 bus magic > =A0 =A0 main thread handler returns from thread_fn > =A0 =A0 unmask main interrupt