From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755520AbcIFK1Z (ORCPT ); Tue, 6 Sep 2016 06:27:25 -0400 Received: from mail-yw0-f174.google.com ([209.85.161.174]:34812 "EHLO mail-yw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755360AbcIFK1V (ORCPT ); Tue, 6 Sep 2016 06:27:21 -0400 Subject: Re: [PATCH V10 2/8] ACPI: Add new IORT functions to support MSI domain handling To: Thomas Gleixner References: <1473152938-17388-1-git-send-email-tn@semihalf.com> <1473152938-17388-3-git-send-email-tn@semihalf.com> Cc: marc.zyngier@arm.com, jason@lakedaemon.net, rjw@rjwysocki.net, helgaas@kernel.org, rafael@kernel.org, Lorenzo.Pieralisi@arm.com, will.deacon@arm.com, catalin.marinas@arm.com, hanjun.guo@linaro.org, shijie.huang@arm.com, robert.richter@caviumnetworks.com, mw@semihalf.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-acpi@lists.linaro.org, andrea.gallo@linaro.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, al.stone@linaro.org, graeme.gregory@linaro.org, ddaney.cavm@gmail.com, okaya@codeaurora.org From: Tomasz Nowicki Message-ID: Date: Tue, 6 Sep 2016 12:27:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06.09.2016 12:20, Thomas Gleixner wrote: > On Tue, 6 Sep 2016, Tomasz Nowicki wrote: >> +/** >> + * iort_get_device_domain() - Find MSI domain related to a device >> + * @dev: The device. >> + * @req_id: Requester ID for the device. >> + * >> + * Returns: the MSI domain for this device, NULL otherwise >> + */ >> +struct irq_domain *iort_get_device_domain(struct device *dev, u32 req_id) >> +{ >> + static struct fwnode_handle *handle; > > static ?????? > >> + int its_id; >> + >> + if (iort_dev_find_its_id(dev, req_id, 0, &its_id)) >> + return NULL; >> + >> + handle = iort_find_domain_token(its_id); > > You reevaluate that on every call. > Obviously it is the bug. Thanks for spotting this. Tomasz