From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752148AbaIKHSk (ORCPT ); Thu, 11 Sep 2014 03:18:40 -0400 Received: from mga02.intel.com ([134.134.136.20]:6292 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751066AbaIKHSj (ORCPT ); Thu, 11 Sep 2014 03:18:39 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,504,1406617200"; d="scan'208";a="601305817" Message-ID: <54114CA4.9030503@linux.intel.com> Date: Thu, 11 Sep 2014 15:17:56 +0800 From: Jiang Liu Organization: Intel User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Thomas Gleixner CC: Benjamin Herrenschmidt , Ingo Molnar , "H. Peter Anvin" , "Rafael J. Wysocki" , Bjorn Helgaas , Randy Dunlap , Yinghai Lu , Borislav Petkov , Grant Likely , x86@kernel.org, Len Brown , Pavel Machek , Prarit Bhargava , Konrad Rzeszutek Wilk , Andrew Morton , Tony Luck , Joerg Roedel , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, Ingo Molnar , linux-pm@vger.kernel.org Subject: Re: [Patch v4 14/16] x86, irq: Introduce helper to check whether an IOAPIC has been registered References: <1409192561-19744-1-git-send-email-jiang.liu@linux.intel.com> <1409192561-19744-15-git-send-email-jiang.liu@linux.intel.com> <540FBB93.4020509@linux.intel.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2014/9/11 4:08, Thomas Gleixner wrote: > On Wed, 10 Sep 2014, Jiang Liu wrote: >> On 2014/9/9 20:37, Thomas Gleixner wrote: >>>> + ret = mp_ioapic_registered(gsi_base); >>>> + up_write(&acpi_ioapic_rwsem); >>>> + >>>> + return ret; >>>> +} >>> >>> So I assume that this is for a particular caller in the apci ioapic >>> hotplug code and that call site has its own serialization. Otherwise >>> the return value is not protected at all. >>> >>> Please add a Docbook comment to that function, and document the >>> locking rules as thats pretty non obvious. >> How about this comments about locking rules? >> /* >> * Locks related to IOAPIC hotplug >> * Hotplug side: >> * ->lock_device_hotplug() //device_hotplug_lock >> * ->acpi_ioapic_rwsem >> * ->ioapic_lock >> * Interrupt mapping side: >> * ->acpi_ioapic_rwsem >> * ->ioapic_mutex >> * ->ioapic_lock >> */ > > That looks asymetric. Why is the hotplug side not taking ioapic_mutex? Hi Thomas, We decide to protect system from IOAPIC hotplug in the ACPI layer. For ACPI enumerated IOAPICs, ioapic_mutex is redundant and it's used to protect MPPARSE, SFI, OF enumerated IOAPICs. Regards! Gerry > > Thanks, > > tglx >