From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v4 04/17] xen/arm: ITS: Add helper functions to manage its_devices Date: Wed, 15 Jul 2015 16:28:02 +0200 Message-ID: <55A66DF2.7050803@citrix.com> References: <1436514172-3263-1-git-send-email-vijay.kilari@gmail.com> <1436514172-3263-5-git-send-email-vijay.kilari@gmail.com> <55A637CC.10003@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" 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: Ian Campbell , Stefano Stabellini , Prasun Kapoor , Vijaya Kumar K , Tim Deegan , "xen-devel@lists.xen.org" , Stefano Stabellini , manish.jaggi@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org On 15/07/2015 16:21, Vijay Kilari wrote: >> A general question, how do you ensure any concurrent insert to the RB-tree? >> Is it taken care by the ITS lock and the caller? >> >> I would be ok to defer the locking for when the PCI passthrough is supported >> as all the ITS device are added when Xen is booted. >> >> A TODO would be worth to add. With the TODO and the answer to my questions: > > I have added new lock "rb_its_dev_lock" in patch #8 where caller is managing. It's rather strange to introduce the lock later given that anyone can call these functions (they are exported). You need to ensure that the caller does take the lock by adding an ASSERT(spin_is_locked(...)) in each function. Regards, -- Julien Grall