From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755528AbbBLKYf (ORCPT ); Thu, 12 Feb 2015 05:24:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46703 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755509AbbBLKYc (ORCPT ); Thu, 12 Feb 2015 05:24:32 -0500 From: Vitaly Kuznetsov To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , "K. Y. Srinivasan" , Haiyang Zhang , Andrew Morton , Yasuaki Ishimatsu , Tang Chen , Vlastimil Babka , David Rientjes , Fabian Frederick , Zhang Zhen , Vladimir Davydov , Wang Nan , "Rafael J. Wysocki" , devel@linuxdriverproject.org, linux-mm@kvack.org Subject: [PATCH RESEND 1/3] driver core: export lock_device_hotplug/unlock_device_hotplug Date: Thu, 12 Feb 2015 11:23:52 +0100 Message-Id: <1423736634-338-2-git-send-email-vkuznets@redhat.com> In-Reply-To: <1423736634-338-1-git-send-email-vkuznets@redhat.com> References: <1423736634-338-1-git-send-email-vkuznets@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org add_memory() is supposed to be run with device_hotplug_lock grabbed, otherwise it can race with e.g. device_online(). Allow external modules (hv_balloon for now) to lock device hotplug. Signed-off-by: Vitaly Kuznetsov --- drivers/base/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/core.c b/drivers/base/core.c index 97e2baf..b3073af 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -55,11 +55,13 @@ void lock_device_hotplug(void) { mutex_lock(&device_hotplug_lock); } +EXPORT_SYMBOL_GPL(lock_device_hotplug); void unlock_device_hotplug(void) { mutex_unlock(&device_hotplug_lock); } +EXPORT_SYMBOL_GPL(unlock_device_hotplug); int lock_device_hotplug_sysfs(void) { -- 1.9.3