From patchwork Fri Jul 30 02:17:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 115366 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6U2HhWb006510 for ; Fri, 30 Jul 2010 02:17:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758374Ab0G3CRp (ORCPT ); Thu, 29 Jul 2010 22:17:45 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:53717 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758370Ab0G3CRo (ORCPT ); Thu, 29 Jul 2010 22:17:44 -0400 Received: by mail-bw0-f46.google.com with SMTP id 1so202286bwz.19 for ; Thu, 29 Jul 2010 19:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=n+mJW38H8O6IGIrOZUmae1YGfbWbeU5vxz6+cmPz1L8=; b=egEhqFDXyJrzAOLjXJ3Jkafi7v3Y128F8yEcQsmmCsk17AW/D+HssaPDZkes3LRUvH 4WkXGlMt/txK/MWIPEbzP+APnqXACUbv08Vi1RvWJbLDr5wxruWju7LzBM1H2d4p/jHa UCL4KELOmiUkOSJNT4DVgiRus8p5eFhkx5K54= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=TRwGD0tkXgh4BfXSnIUf4sjGXlXy/jXe25pCl1sY/AGk8AD375Fxi1o6SPGvmufmb/ kOyKUFnNjpraO0MofFIcBdXYI/9Q9hUy+Z60VVcEysC0uT9duCNYuO1+QlyWq/H6hVeN S7mgsprzM3256bwMaHR5Jq8LQF2Zp1Gf5yrj0= Received: by 10.204.59.9 with SMTP id j9mr669906bkh.150.1280456263120; Thu, 29 Jul 2010 19:17:43 -0700 (PDT) Received: from localhost.localdomain (IGLD-84-228-148-137.inter.net.il [84.228.148.137]) by mx.google.com with ESMTPS id f10sm1110122bkl.17.2010.07.29.19.17.39 (version=SSLv3 cipher=RC4-MD5); Thu, 29 Jul 2010 19:17:41 -0700 (PDT) From: Maxim Levitsky To: lirc-list@lists.sourceforge.net Cc: Jarod Wilson , linux-input@vger.kernel.org, linux-media@vger.kernel.org, Mauro Carvalho Chehab , Christoph Bartelmus , Maxim Levitsky Subject: [PATCH 04/13] IR: fix locking in ir_raw_event_work Date: Fri, 30 Jul 2010 05:17:06 +0300 Message-Id: <1280456235-2024-5-git-send-email-maximlevitsky@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1280456235-2024-1-git-send-email-maximlevitsky@gmail.com> References: <1280456235-2024-1-git-send-email-maximlevitsky@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 30 Jul 2010 02:17:46 +0000 (UTC) diff --git a/drivers/media/IR/ir-raw-event.c b/drivers/media/IR/ir-raw-event.c index 9d5c029..4098748 100644 --- a/drivers/media/IR/ir-raw-event.c +++ b/drivers/media/IR/ir-raw-event.c @@ -40,13 +40,16 @@ static void ir_raw_event_work(struct work_struct *work) struct ir_raw_event_ctrl *raw = container_of(work, struct ir_raw_event_ctrl, rx_work); + mutex_lock(&ir_raw_handler_lock); + while (kfifo_out(&raw->kfifo, &ev, sizeof(ev)) == sizeof(ev)) { - mutex_lock(&ir_raw_handler_lock); list_for_each_entry(handler, &ir_raw_handler_list, list) handler->decode(raw->input_dev, ev); - mutex_unlock(&ir_raw_handler_lock); raw->prev_ev = ev; } + + mutex_unlock(&ir_raw_handler_lock); + } /**