From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-gw0-f46.google.com ([74.125.83.46]:45788 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757411Ab0KJX2t (ORCPT ); Wed, 10 Nov 2010 18:28:49 -0500 Date: Wed, 10 Nov 2010 15:28:41 -0800 From: Dmitry Torokhov Subject: Re: [RFC v1 PATCH 3/6] led: pmic8058: Add PMIC8058 leds driver Message-ID: <20101110232840.GA2121@core.coreip.homeip.net> References: <1289393281-4459-1-git-send-email-tsoni@codeaurora.org> <1289393281-4459-4-git-send-email-tsoni@codeaurora.org> <4CDB0451.3090303@metafoo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CDB0451.3090303@metafoo.de> Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: Lars-Peter Clausen Cc: Trilok Soni , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, rtc-linux@googlegroups.com, linux-arm-msm@vger.kernel.org, Richard Purdie On Wed, Nov 10, 2010 at 09:45:05PM +0100, Lars-Peter Clausen wrote: > Trilok Soni wrote: > > + > > +static void led_kp_set(struct pmic8058_led_data *led, enum led_brightness value) > > +{ > > + int rc; > > + u8 level; > > + unsigned long flags; > > + > > + spin_lock_irqsave(&led->value_lock, flags); > This function is only ever called from within the workqueue so there is no need for > locking. > That is a common misconception, unfortunately. The same work may be executing on several CPUs at the same time if it was scheduled on multi-threaded work queue. ... > > + schedule_work(&led->work); And sure enough, keventd is such workqueue. Now, whether having the same work run simultaneously is OK or not is a different question altogether... -- Dmitry