Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4942448imm; Tue, 21 Aug 2018 03:47:29 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwpA7iFq4HKCbqwX14jOgqww6Uc14sxGBSUWT2KOBoro3xc5FFF+TbBrZOIyx+DvT0mPzVH X-Received: by 2002:a63:2fc6:: with SMTP id v189-v6mr46799085pgv.61.1534848449670; Tue, 21 Aug 2018 03:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534848449; cv=none; d=google.com; s=arc-20160816; b=YW0jBgB7SDg2Vc5BU8AL7yVVYsJVCgLdYLEcIr+Teao5EEi/4MxLp5lXqF1aXGd9Ue xj5qI3oaKodl2D1HDyCe2ZnpPDlfhWLFRdJuf1f+itkyEpZ/XBAM4HSUFeUjHpxgCHAJ 27DI+/KFd6N2uKbuEHmD/O9RJSbqLSiYITH5RUnikvD/cc9FcoGl0Qr3gTtjpokD5ZLn 6JEk427Tcg0mBScAEwubeIztFbFdfawIOwD4kJ1LtjqAEsySvguBuN9C7H/i/x669NK2 eYfq9WNY6pewHYvTiYwckPcE6pWesOOHEOxtmwEpag5O/t5wqeIkpPio6J0RTlx5KXQr T9ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=YOn2XEJJjUAF950/2+ACrSpbLnm+unK2V2ttVzDG1Lg=; b=PBZ+Dz1KkCNNtIWsnJx+MmSl4evPA5R20PuW8lrZFG5Hdu66dJbGNaGZJbT340bWa9 JGc02G8c/4T1nkyxLAoNEN+CHbNpBjwFClY/hpF03f0DXdiOojegC5oxUkEvr4evjU8A T7KlDQr6qIEvr5k8JPRSWuSVUaq2jueJJ98LJvBQaD8gyJALWDHLTPmv5yCBSZjsClSp SAddaygxozij28yG9v8Uu6NTBKYWBoXQGYiys8eGUVY0uyeh35oHD22yEA1ETmJmqSBo se293HbUFlUsIvM+2vbwMoHyT5j3JIoxiQ59n+STRjRaJ2AdJtRaKZ3DbDyNSkHb5ER9 5nig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 142-v6si2145939pfy.182.2018.08.21.03.47.14; Tue, 21 Aug 2018 03:47:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727377AbeHUOEa (ORCPT + 99 others); Tue, 21 Aug 2018 10:04:30 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36162 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726859AbeHUOE2 (ORCPT ); Tue, 21 Aug 2018 10:04:28 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4E298402178A; Tue, 21 Aug 2018 10:44:49 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-96.ams2.redhat.com [10.36.117.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id 280F37D4C9; Tue, 21 Aug 2018 10:44:47 +0000 (UTC) From: David Hildenbrand To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-acpi@vger.kernel.org, xen-devel@lists.xenproject.org, devel@linuxdriverproject.org, David Hildenbrand , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Rashmica Gupta , Balbir Singh , Michael Neuling Subject: [PATCH RFCv2 4/6] powerpc/powernv: hold device_hotplug_lock when calling device_online() Date: Tue, 21 Aug 2018 12:44:16 +0200 Message-Id: <20180821104418.12710-5-david@redhat.com> In-Reply-To: <20180821104418.12710-1-david@redhat.com> References: <20180821104418.12710-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 21 Aug 2018 10:44:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 21 Aug 2018 10:44:49 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org device_online() should be called with device_hotplug_lock() held. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Rashmica Gupta Cc: Balbir Singh Cc: Michael Neuling Signed-off-by: David Hildenbrand --- arch/powerpc/platforms/powernv/memtrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c index 8f1cd4f3bfd5..ef7181d4fe68 100644 --- a/arch/powerpc/platforms/powernv/memtrace.c +++ b/arch/powerpc/platforms/powernv/memtrace.c @@ -229,9 +229,11 @@ static int memtrace_online(void) * we need to online the memory ourselves. */ if (!memhp_auto_online) { + lock_device_hotplug(); walk_memory_range(PFN_DOWN(ent->start), PFN_UP(ent->start + ent->size - 1), NULL, online_mem_block); + unlock_device_hotplug(); } /* -- 2.17.1