From patchwork Tue Aug 21 10:44:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10571363 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C8F6E1803 for ; Tue, 21 Aug 2018 10:44:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD3D829DA1 for ; Tue, 21 Aug 2018 10:44:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B106929DA3; Tue, 21 Aug 2018 10:44:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9EFE29DA7 for ; Tue, 21 Aug 2018 10:44:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 98EB36B1E4C; Tue, 21 Aug 2018 06:44:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 968BB6B1E4D; Tue, 21 Aug 2018 06:44:50 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 808716B1E4E; Tue, 21 Aug 2018 06:44:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f199.google.com (mail-qt0-f199.google.com [209.85.216.199]) by kanga.kvack.org (Postfix) with ESMTP id 507DB6B1E4C for ; Tue, 21 Aug 2018 06:44:50 -0400 (EDT) Received: by mail-qt0-f199.google.com with SMTP id e14-v6so15847245qtp.17 for ; Tue, 21 Aug 2018 03:44:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=YOn2XEJJjUAF950/2+ACrSpbLnm+unK2V2ttVzDG1Lg=; b=PYOr+wYqPubqTUVKudoz2C67FBWaVs/YiGbR86TDZDorUJq3d9XiYgOYleAltSCo5L 6oQzcD2Sn/IsN7n/3Hf47XEny5ABWaqYyJA6FQ4sd1Pvqvp17V/L1BOsNve4gKdX3pjY 1tnt/eQaDdE0XwiTmZChnQ42znyfVKCYnR+hS8vptzfdGIfiQTgYy/BfjzaLbyhMSc0X 1wWc549VgUxxBtZyjbUkiSpuU9d5HwBfMY6d2oFi0YzEk4nrWQtCUKaNPvfEjkgceFN/ hFlVOOzCNdDqjfBO4aj7vZ6cmZInG2KdNg/2prFeQypie8dMZhUFP0P1ccFNCOa7omTN daNQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AOUpUlH5gsVre5UVBnyqoPsPACBTg1OrmqEwTpt7JBqyNPjgWE6PQTMK 0UIm4VX1a/5pyolJaLRJsKhjObr48TV4hTd490c/80OsoG49RTrBi2kHCMGM+xRvy2D1GU+WnzC oeF6iH/H1SfoxKY9qIddfrD3x2ooW8aqA5tIxXDzEG8lbJ4B7Y84S1yzYNO/hRpGISw== X-Received: by 2002:ac8:29f6:: with SMTP id 51-v6mr48359441qtt.200.1534848290132; Tue, 21 Aug 2018 03:44:50 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxZWxDteR3W9gMrf29yMpxL+D4QDMd0PTVSksSJSknkTniDzY09Q9RKfA585FtAlc8iIy/m X-Received: by 2002:ac8:29f6:: with SMTP id 51-v6mr48359416qtt.200.1534848289698; Tue, 21 Aug 2018 03:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534848289; cv=none; d=google.com; s=arc-20160816; b=aB9R7kh+YN9UlW1tkvGmLDNDhLLzr4xiqOxgo8lp3cdQW5qxnvPICidCBbhLzaXPRQ qS0dPt1QMUuVrPrUltnGURlgIpDUa3sqnM1NHg2sFCSq1zX/dD2++UdF55HFOxCc6xj/ 00/eJKj4Rc4zxgLsOgnfj5vQXnUXRhg0Nk9aTOxg94KQP7ap2q8jI/26RVxBmrOuSFDt eZlwaHIC5zXY9pqAOqhyXwooNbJ9Z5JPCuihvSK2O5Uq4x/IkprBwLO3UoxVlzqVjbEd upv92TIodz3Cd+T0HbpsKTDEaZOeH7FInmf6PoxXLqPJ7NUh0DqFRqzBzOPlMF0MbZSd uY4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YOn2XEJJjUAF950/2+ACrSpbLnm+unK2V2ttVzDG1Lg=; b=hWOowVkkmUQkoPI3B4SukpsbB/pbEsK0XgBJfkZUXg+OZZk0pJfI6Tx3XcDLa9pTu0 1A+Sd10mWoXm/EoYrARweDJsCtUxPsS270nXev8LtsdKo0GbSkSP+RXychFh+/mDK7tO S6UkS5DgW0kr6AeaIfbPSVRnqB/Nmb6WWcHkwLDuh7Ilf0gClvSY6cSyie3S1/wCO94F BVqU7YRgcYByF4hwoAOoQM933vP54fpV6ksyYwwTTV6zZ5TNJPyEuqAGQh9st8VivRaR s3K1RGNPPsbDtg3gaqLcrKQFxd00u9xkA88CykGK3hPutzojGBT6e+JfsUKlQ6MHv+ie zN2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id q11-v6si11179048qkl.387.2018.08.21.03.44.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 03:44:49 -0700 (PDT) Received-SPF: pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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:'' X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Pavel Tatashin --- 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(); } /*