From patchwork Tue Sep 25 09:14:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10613767 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 C0352913 for ; Tue, 25 Sep 2018 09:15:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B42F9299D5 for ; Tue, 25 Sep 2018 09:15:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A87CA29B3C; Tue, 25 Sep 2018 09:15:45 +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 3E270299D5 for ; Tue, 25 Sep 2018 09:15:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 60EBA8E0086; Tue, 25 Sep 2018 05:15:43 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 596538E0072; Tue, 25 Sep 2018 05:15:43 -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 45F6C8E0086; Tue, 25 Sep 2018 05:15:43 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by kanga.kvack.org (Postfix) with ESMTP id 173848E0072 for ; Tue, 25 Sep 2018 05:15:43 -0400 (EDT) Received: by mail-qk1-f200.google.com with SMTP id y130-v6so25485542qka.1 for ; Tue, 25 Sep 2018 02:15:43 -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=nz0n2L3JxULsBS/pUHRQ1cL3pjanD6P0YON1fc9C7I4=; b=bv/edRi5saUHfodP6LxYH52uUNVW2AgCOnhsC+sNeFaBg7orB0zFhF2oUxWtUdvuIe Mwjeuu1bmR83DijqWl8drftLm+QB3pdRdvER5ruScU4ax7ZkfzqTgGmjQAtS7c6fJ5qG YykgCli5bOHMpYsJpDn+bOHfAf9+KGGYoNt8hwVLI5udYu8vyw13NIn6+ktR6bizaeCa abA+rRNEmpVkUPK/J5jhduATUr1mlh799BHT9DMytZwpycRuEmaLPraZ9cy1Exajhpho p9PZRHKFwsdlTs8PknkPxxVEq8rxbFWzg3eeKbgVY9i48s7ugc/h0CtiGh6h0tBH+v65 Q9qg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: ABuFfojsiEcIw+/e9f9MCtqMhzx0cckgd+q+hx60vujftasRuaJvQau3 EXpIcmghd2NjI+39//mOkDdZJzcN5T1gb70JI+meIWwG2nZWTQD9+twWiGrcUr5QTCVsTjrYEwH Gfj2JVvOMBnhj/DFjWwLfwB7W+FyWZ06oOAf7QiLEjqj3rQiQK/0p82NxXD/4J583Kg== X-Received: by 2002:a37:4a46:: with SMTP id x67-v6mr79394qka.60.1537866942868; Tue, 25 Sep 2018 02:15:42 -0700 (PDT) X-Google-Smtp-Source: ACcGV615lj4HrHSj/OxyMKGYqlxQKxuYB1cK7YKYVi6R+JJDMIdRRnPPKGxT1d3HUN+qWS9Sk6op X-Received: by 2002:a37:4a46:: with SMTP id x67-v6mr79381qka.60.1537866942426; Tue, 25 Sep 2018 02:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537866942; cv=none; d=google.com; s=arc-20160816; b=GYeE4ciSpT8FwnAmKdrmMAJLOubIGE/3JpyQF9rdnHZmXWmjtuTDcWUaX2VzUKDIIb DsvuLqd0KzBMinmkLv1wgLv1Pk6cuiwonaAFoStf5+M0XGVMO5VXD4R0wvUxptGyWWjL x6oT4GjgmuFJmE0SpqaBEzqjTcqXfhl8NFXUy06EW3Fxu0FGpcEhds6g8iHFMQKjdK3l HiXIidi+9br8Ln1TFHkQjgkYzyIfi8winLLiYUvmpqjvcB5LuU9/cJ5s+mqsAcmykYic tG6AIX+LnWXT9p5jtH5byZK3PqeJqlLxBVX2fCABbjEyVrhDJyS3/8GAQUKorvJeu+yT VNJg== 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; bh=nz0n2L3JxULsBS/pUHRQ1cL3pjanD6P0YON1fc9C7I4=; b=FQEFe7Cm6TYF/H4CXsbxJgmMr0044YmBqFd0aDRnKFvJePt0P/JUIy7YDzAVzivcsy kVAswxadJ0c1C8M0wHTkHdKbfSAtqTGBLii9YvG01R1xkmAUDAAC5/AztDRuL9icwKY7 GvSKXmLz6ctOKkMi0v4eKJcmdkxslqqqhp0uQNIXFzEUN7+Et107FykFJbFNVfEGvP4Z iUSc23VrGYym4vC0ekRK1/lSPNJFKM1+Hd5bPVlw4eWzYectZwJfBG3t4Ob1Yue7XYaY BBrYREF9YcTdS24LxOZ9BWqEa+OnwI25ahxinGuEiEy/2AcpjazsJ6OCHgSzOSOoKArj I5UQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 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 (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id k58-v6si1751755qtf.286.2018.09.25.02.15.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Sep 2018 02:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of david@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of david@redhat.com designates 209.132.183.28 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-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7D9595D68D; Tue, 25 Sep 2018 09:15:41 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-161.ams2.redhat.com [10.36.117.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89AB4308BE75; Tue, 25 Sep 2018 09:15:38 +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 v2 4/6] powerpc/powernv: hold device_hotplug_lock when calling device_online() Date: Tue, 25 Sep 2018 11:14:55 +0200 Message-Id: <20180925091457.28651-5-david@redhat.com> In-Reply-To: <20180925091457.28651-1-david@redhat.com> References: <20180925091457.28651-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 25 Sep 2018 09:15:41 +0000 (UTC) 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 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(); } /*