From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765274AbdAJO4D (ORCPT ); Tue, 10 Jan 2017 09:56:03 -0500 Received: from foss.arm.com ([217.140.101.70]:55966 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759900AbdAJO4A (ORCPT ); Tue, 10 Jan 2017 09:56:00 -0500 Date: Tue, 10 Jan 2017 14:57:41 +0000 From: Lorenzo Pieralisi To: Hanjun Guo Cc: Marc Zyngier , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, Thomas Gleixner , Greg KH , Tomasz Nowicki , Ma Jun , Kefeng Wang , Agustin Vega-Frias , Sinan Kaya , charles.garcia-tobin@arm.com, huxinwei@huawei.com, yimin@huawei.com, Jon Masters Subject: Re: [PATCH v6 05/14] ACPI: platform-msi: retrieve dev id from IORT Message-ID: <20170110145741.GA17967@red-moon> References: <1483363905-2806-1-git-send-email-hanjun.guo@linaro.org> <1483363905-2806-6-git-send-email-hanjun.guo@linaro.org> <20170104191805.GE8604@red-moon> <20170105151530.GA30852@red-moon> <237ca4dc-07ce-0104-27f2-5437b7c7718e@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <237ca4dc-07ce-0104-27f2-5437b7c7718e@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 10, 2017 at 09:39:39PM +0800, Hanjun Guo wrote: [...] > >What you can do is create a wrapper, say iort_node_map_platform_id() > >(whose signature is equivalent to iort_node_map_rid() minus rid_in) > >that carries out the two steps outlined above. > > > >To do that I suggest the following: > > > >(1) I send a patch to "fix" iort_node_get_id() (ie index issue you > > reported) > > I prepared two simple patches, one is for fix the indentation and > the other is adding the missing kernel-doc comment, how about > sending the out for 4.10-rcx? For me it is fine depending on how Rafael wants to handle them, ie if he can batch those with the eg iort_node_get_id() fix I have just sent: https://patchwork.kernel.org/patch/9507041/ > >(2) We remove type_mask handling from iort_node_get_id() > > iort_node_get_id() for now only supports id single mappings, > Do we need to extend it for multi id mappings? seems Sinan's > platform have such cases. I am not really sure I understand what you mean here. > >(3) We create iort_node_map_platform_id() that (pseudo-code, I can > > write the patch if it is clearer): > > > >struct acpi_iort_node *iort_node_map_platform_id(u8 type_mask, int index, > > ...) > >{ > > u32 id, id_out; > > struct acpi_iort_node *parent = iort_node_get_id(&id, index); > > > > if (!parent) > > return NULL; > > > > /* we should probably rename iort_node_map_rid() too */ > > if (!(IORT_TYPE_MASK(parent->type) & type_mask) > > parent = iort_node_map_rid(parent, id, &id_out, type_mask); > > > > return parent; > >} > > > >(4) we update current iort_node_get_id() users and move them over > > to iort_node_map_platform_id() > > I think we need to prepare one patch for the above steps, or it > have functional changes for iort_node_get_id(), for example we > removed the type_mask handling from iort_node_get_id() and it > will break the case for SMMU if we only have requester id entries. If the question is "should we apply this change as a single logical patch" the answer is yes, it looks a simple one to me (basically it implies writing the function above and update the iort_node_get_id() existing callers with it). Does this answer your question ? Thanks ! Lorenzo