From: Ian Campbell Subject: Re: [PATCH v2 06/15] xen/arm: move gic lock out of gic data structure Date: Thu, 10 Apr 2014 11:31:57 +0100 Message-ID: <1397125917.9862.108.camel@kazak.uk.xensource.com> References: <1396612593-443-1-git-send-email-vijay.kilari@gmail.com> <1396612593-443-7-git-send-email-vijay.kilari@gmail.com> <1397119921.9862.35.camel@kazak.uk.xensource.com> <1397124152.9862.91.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vijay Kilari Cc: Stefano Stabellini , Prasun Kapoor , Vijaya Kumar K , Julien Grall , xen-devel@lists.xen.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 2014-04-10 at 15:42 +0530, Vijay Kilari wrote: > On Thu, Apr 10, 2014 at 3:32 PM, Ian Campbell wrote: > > On Thu, 2014-04-10 at 14:54 +0530, Vijay Kilari wrote: > >> On Thu, Apr 10, 2014 at 2:22 PM, Ian Campbell wrote: > >> > On Fri, 2014-04-04 at 17:26 +0530, vijay.kilari@gmail.com wrote: > >> >> From: Vijaya Kumar K > >> >> > >> >> spinlock is used across generic and GIC low level > >> >> functions. Move this lock out of gic data. > >> >> This helps to separate generic and low level functions > >> >> later. > >> > > >> > Is there a subsequent patch which exposes this lock to gic-{v2,v3}.c? I > >> > grepped but couldn't find it. AFAIK the pattern is always: > >> > common: take lock > >> > common: call per gic callback > >> > per gic callback: do stuff assuming lock held > >> > common: release lock > >> > > >> > IOW the lock is only used from the common code? > >> > > >> Yes, lock is only used in common code and your pattern is correct. > > > > Why is gic.lock not alright? > > > gic.lock also protects some common code as well in the existing v2 driver. > So it is retained in common code and locking mechanism is not changed. Ah. I was missing that the struct gic was going to become v2 specific and move to gic-v2.c, but this field needs to stay behind in the common code. Can you make that explicit in your commit log please. Ian,