Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1787482imm; Thu, 27 Sep 2018 02:29:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV618uuOs1mQbNNtXLld6UtMmhmFAlM3dRjCIsHgzTOUqCRBxV/Wk+Fpd5sRz/D1Cmscf+pgZ X-Received: by 2002:a17:902:7e45:: with SMTP id a5-v6mr10066054pln.151.1538040541947; Thu, 27 Sep 2018 02:29:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538040541; cv=none; d=google.com; s=arc-20160816; b=nIy2Fe8bU7nxblj+3MkS5gZoZjukMvB4UBuRy6MruqJvkk0kAfAM3aXdkr86a2goq1 6CoI9yoLx8ffNV9qJMMGM1xNYX7eh8ol2JjnuUiEvYD0WdPzhzjhvX7iV90GwgCPD3bg ydx5Rzq1VkOpQkJZc0lPGvPx8MFw4Jnd9k8gL8hWYOCp7cSQf34wOG7OemBhMUAZMVZT Vub0sHMfkvim46/6E+aslSPGgKZoV6sfMjT2rPigkFN2nhac+8xzmVnTpApZ5ZV1v1wy EkxkWvRibmkxtX4/CHRJDhPnSM9Fv7lWL6rmzahigUGmtYsKPmrFn43Tbi0cdkPh+DYZ /ELw== 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; bh=nz0n2L3JxULsBS/pUHRQ1cL3pjanD6P0YON1fc9C7I4=; b=kYRrPnY8rKV8Oe600MdF897VEn+97XRL81V2Zdg/M1WVosRQB+uMbL7JbRppv+6QM7 2A+P+/8eA62vji8oFjwI+t/RPDwedV/ia3uYJ9dxBxg/KpWx7ly8d4yVcjgQyFoPk077 SHJjgsBqfUnh2cWBylgy7miRjr0BluBaL0X/B7rS3YKUy0ujwHwjLUea3rNDAHhcOWEk /ciijv0h6H6HDDjm0QJ3QOkTNxoTQKlopBwCZrw2q9o2Pb9Rrk01eA+lLRbpR6OYVjPc NfXwn9xvSZgUaZl+CgGTKWZTfFyXJiO//e0qglN1tfB4+Y0Ndh0rh+rYy9Fm72j7GH4I iuUw== 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 t19-v6si1777158pfm.152.2018.09.27.02.28.46; Thu, 27 Sep 2018 02:29:01 -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 S1729117AbeI0Pn6 (ORCPT + 99 others); Thu, 27 Sep 2018 11:43:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35340 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727625AbeI0Pn5 (ORCPT ); Thu, 27 Sep 2018 11:43:57 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 48C0CA6DFD; Thu, 27 Sep 2018 09:26:37 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-205.ams2.redhat.com [10.36.116.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7ACF920154E7; Thu, 27 Sep 2018 09:26:32 +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 v3 4/6] powerpc/powernv: hold device_hotplug_lock when calling device_online() Date: Thu, 27 Sep 2018 11:25:52 +0200 Message-Id: <20180927092554.13567-5-david@redhat.com> In-Reply-To: <20180927092554.13567-1-david@redhat.com> References: <20180927092554.13567-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 27 Sep 2018 09:26:37 +0000 (UTC) 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 Reviewed-by: Pavel Tatashin Reviewed-by: Rashmica Gupta 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 773623f6bfb1..fdd48f1a39f7 100644 --- a/arch/powerpc/platforms/powernv/memtrace.c +++ b/arch/powerpc/platforms/powernv/memtrace.c @@ -242,9 +242,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