From patchwork Tue Sep 18 11:48:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10604223 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 E20A315A6 for ; Tue, 18 Sep 2018 11:49:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D10132A6F6 for ; Tue, 18 Sep 2018 11:49:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4DD02A704; Tue, 18 Sep 2018 11:49:02 +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 315AB2A6FA for ; Tue, 18 Sep 2018 11:49:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC9AC8E0007; Tue, 18 Sep 2018 07:49:00 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B78C28E0001; Tue, 18 Sep 2018 07:49:00 -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 A67938E0007; Tue, 18 Sep 2018 07:49:00 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id 784418E0001 for ; Tue, 18 Sep 2018 07:49:00 -0400 (EDT) Received: by mail-qk1-f198.google.com with SMTP id 123-v6so1098118qkl.3 for ; Tue, 18 Sep 2018 04:49:00 -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=mNZd+qrx4q0iFsukH9TqaDOD8bGhgHDuAq2e66sltyg=; b=HLy8k6o7EANr0t7CV4ygWjGqERIswuUdM1p12vBwQ5PzAtTAiYsmb8oPr2xJEnwv3v naQ38F41CW7hkLEPZQgzoAcSZzfx7kzyvnT/4re8ZjMSss0fvpQH5Tr4SlEtYqD5k42U IV8DTMHvMr1NhHrP3jD7zcrfamFpGQWc/2Y0HrRKOrNlerF1vU6sZMfnu/tLzkVF40kD 7wjtygJ6lAFM/D3GrucRVywGqg1/NwNVehnXuHw1D4AeElcBitm0nEYd2YHJ2TyY4yN/ QrRL8OgOp0n2HYVpUosJzHjc+Nan3sd5hW5xFuFKwFM1TcObHqpaPMWL7jyiTNRb4kDU IAwQ== 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: APzg51Bi0ULS9WrPOgU88TjEqS4qpV+R2T9eicFalD61g1wI+G5gZBk4 YfRFxw99dEKl68NxZqeJ0TsBIX1VMFLrW83Ca/+R5TUTLYNNHvlH611CLAShJa6dLkhQM2wBay5 Ff16aEkNJkiyljpugeWYzC5sgUd+xg6mhtlAjqP1TYBt8jwT4xNrAHcmbNM7ldcJLyQ== X-Received: by 2002:a0c:f70d:: with SMTP id w13-v6mr20390732qvn.66.1537271340286; Tue, 18 Sep 2018 04:49:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZkEPc98Ct6dZHC9L0odE2u5egouqOFkztmqzV0WFHMBOOeDylBlYO2Gkn0RsDrv4KPqsix X-Received: by 2002:a0c:f70d:: with SMTP id w13-v6mr20390713qvn.66.1537271339601; Tue, 18 Sep 2018 04:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537271339; cv=none; d=google.com; s=arc-20160816; b=X9e8H9MueSXboO6BkJlfUYvtptPOJ5Pu7Ym1FZgdh/rPZXKHDMepL+5yuZt4rQFJTR RTWhiEmr43CuQ3VL7cZRLUdoyZV3cauyS+Ar36p0m2yo0EjYB9JkF1kDMDUqGM+cjiIk rgj+WtH8ZKlcL+ROzLq3GgS+m8N8Wa1tmAKFAUBeupuidPWdp2lbfvSEGdLzeMtiAv6z qUFsD8LJ6wfNfxFN5f8ODPebnZJJOpODJ6Zis2P/dQyRikwFnKq5um7knmI870kz/A1l 0rJ7A71UZDWKXnCDH1kjxj51fOxaB22oPqs1vzjD3Kst8f/78XwLceC18jxSFv1UAAO8 uryw== 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=mNZd+qrx4q0iFsukH9TqaDOD8bGhgHDuAq2e66sltyg=; b=aU07op3d/ceGN4SEMLrL3lhpSNWbyBEMM9KFtJ7WdaD+BFqWhtPINMiTGcQ8O/ogLP E/a5TcLpusaikTbbuDOo8+/UXgt1UHuVgCUfjLwvdYe/jeHy7XGZza1zHiXfJT1hyGQX vYuWidl5o6V1zGwAyCb8IqV8e/QPFCxA4pyZ/gV6JEzVOtwQnoi+/ecAlgHJFqJZ0g9B kOyR2bvl1myB20aXkhtissezND75QVhD8MOGq7Tmueuu9czA5LOpEMaUDR5sH7rN+LYS NhSc0NivGRCAZx4XKXrMxENxTbx8Ok1HBN2wBf1tPt1M+wB5pzIvnfQZBgBpJtO5SSrt UVcQ== 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 c16-v6si3576574qvi.75.2018.09.18.04.48.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Sep 2018 04:48:59 -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-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2498356E5; Tue, 18 Sep 2018 11:48:58 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-248.ams2.redhat.com [10.36.116.248]) by smtp.corp.redhat.com (Postfix) with ESMTP id C688217101; Tue, 18 Sep 2018 11:48:55 +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 v1 4/6] powerpc/powernv: hold device_hotplug_lock when calling device_online() Date: Tue, 18 Sep 2018 13:48:20 +0200 Message-Id: <20180918114822.21926-5-david@redhat.com> In-Reply-To: <20180918114822.21926-1-david@redhat.com> References: <20180918114822.21926-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 18 Sep 2018 11:48:58 +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 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(); } /*