Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762699AbZLKWYz (ORCPT ); Fri, 11 Dec 2009 17:24:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761569AbZLKWYx (ORCPT ); Fri, 11 Dec 2009 17:24:53 -0500 Received: from kroah.org ([198.145.64.141]:60986 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761563AbZLKWYw (ORCPT ); Fri, 11 Dec 2009 17:24:52 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: David Altobelli , Andrew Morton , Greg Kroah-Hartman Subject: [PATCH 01/27] hpilo: add locking comment Date: Fri, 11 Dec 2009 14:24:23 -0800 Message-Id: <1260570289-6997-1-git-send-email-gregkh@suse.de> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <20091211212642.GA6624@kroah.com> References: <20091211212642.GA6624@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1429 Lines: 45 From: David Altobelli Add explanation about lock nesting and purpose of each lock in hpilo. Signed-off-by: David Altobelli Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/misc/hpilo.h | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/drivers/misc/hpilo.h b/drivers/misc/hpilo.h index 3857605..247eb38 100644 --- a/drivers/misc/hpilo.h +++ b/drivers/misc/hpilo.h @@ -44,9 +44,20 @@ struct ilo_hwinfo { struct pci_dev *ilo_dev; + /* + * open_lock serializes ccb_cnt during open and close + * [ irq disabled ] + * -> alloc_lock used when adding/removing/searching ccb_alloc, + * which represents all ccbs open on the device + * --> fifo_lock controls access to fifo queues shared with hw + * + * Locks must be taken in this order, but open_lock and alloc_lock + * are optional, they do not need to be held in order to take a + * lower level lock. + */ + spinlock_t open_lock; spinlock_t alloc_lock; spinlock_t fifo_lock; - spinlock_t open_lock; struct cdev cdev; }; -- 1.6.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/