Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6016166ybc; Wed, 27 Nov 2019 13:27:21 -0800 (PST) X-Google-Smtp-Source: APXvYqyomNK6SRAm1exj/hq9njmQuK5Jb/uLbSV2AGMFuKcckGLNbeTQSoDQnt+Yk6P/xBujGT8R X-Received: by 2002:a17:906:2e41:: with SMTP id r1mr27937437eji.127.1574890041404; Wed, 27 Nov 2019 13:27:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890041; cv=none; d=google.com; s=arc-20160816; b=fUzPlBRPQlybcs3sei78JT+W43YLOoW6z3n7XHHig/Sm6MBiRirAtsWQbDyTS7a7ti c7m7Me7obXZpuQ0LRBafZpopulhuI1BxXaxsF36b2TyiL4erO5K3xp33J8Y8FIuPvVHu S3J0ZJJMWMKN3lymhez2s3cT8lE4s2ZRNNQiR7pgxYs1FsmHRmw40ZMSymzNMkVQDcF0 +QCJXKarnzxNPeSUO2WeWkGzrsoiZseAoFaOR8x40HKR0SlzEesepKc+3lM//2qb4ev7 R97vqB9jShBOwRSbIlBVYon7w6LHnTmDtD1d8cndE+fDhwyJp1Mhc1G9mcIZxFHa7zNV igZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kFE6OrVx9SNeGulhd/vlNOuwF1ShY721brKuAuq1SsA=; b=zA/D7Tp8jctJhh0oPVBkt1E2i5FjzoaTd2IgJSOCXhmMl4s8hklS8qmSldXrYdDoCp nPJXTZTEaN3qE+lSdG6PRfj01eRlP6HMGsbq5MNes8s+1JS3ydBz8KSNUOQqZw5aPQtZ j4D5C1xjNGLCr6TBl8Vy6/R6BObbmsDqF5rGjEbnMWF1lNLzHiM652ZC+9Q7Y9o+a08R 4dGXxv4LITrktpuKAPWwwcCGaKwPiXkvYTTpgOtTdkovKPODQF/voO74jCOMEgMv/MeE ZdwUIzQUECa3nPMBaRxCRAsoIFKi8vJFQ2gWIBXScD7RB4CerN0ZDuRoGV6nbvY3fBhe 4hFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1hwzKdW7; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15si11268723edw.361.2019.11.27.13.26.58; Wed, 27 Nov 2019 13:27:21 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=1hwzKdW7; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731948AbfK0VCt (ORCPT + 99 others); Wed, 27 Nov 2019 16:02:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:55682 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727370AbfK0VCr (ORCPT ); Wed, 27 Nov 2019 16:02:47 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 680C22166E; Wed, 27 Nov 2019 21:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888566; bh=BGVEmFHLvjGZOll6shoHOgq10KG5rn1aBv9tgolO9tc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1hwzKdW774X/5P3EpH8sH3EFpme8u7+IZuP+4CwVbxPEEC+eUB24aovDsiOufz5zy G+rzHy32zx6XoLiDNJly7RWHhvjrcwmG+qQMPC0MeCGbTybS0yaeb/YQuN9ilBVq3o ou5w/nDbNPR0aX30Zs6v7XQMOLilb99LAOyYrrAg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Hildenbrand , Pavel Tatashin , Rashmica Gupta , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Balbir Singh , Michael Neuling , Boris Ostrovsky , Dan Williams , Haiyang Zhang , Heiko Carstens , John Allen , Jonathan Corbet , Joonsoo Kim , Juergen Gross , Kate Stewart , "K. Y. Srinivasan" , Len Brown , Martin Schwidefsky , Mathieu Malaterre , Michal Hocko , Nathan Fontenot , Oscar Salvador , Philippe Ombredanne , "Rafael J. Wysocki" , "Rafael J. Wysocki" , Stephen Hemminger , Thomas Gleixner , Vlastimil Babka , YASUAKI ISHIMATSU , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.19 182/306] powerpc/powernv: hold device_hotplug_lock when calling device_online() Date: Wed, 27 Nov 2019 21:30:32 +0100 Message-Id: <20191127203128.604227621@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Hildenbrand [ Upstream commit cec1680591d6d5b10ecc10f370210089416e98af ] device_online() should be called with device_hotplug_lock() held. Link: http://lkml.kernel.org/r/20180925091457.28651-5-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Pavel Tatashin Reviewed-by: Rashmica Gupta Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Rashmica Gupta Cc: Balbir Singh Cc: Michael Neuling Cc: Boris Ostrovsky Cc: Dan Williams Cc: Greg Kroah-Hartman Cc: Haiyang Zhang Cc: Heiko Carstens Cc: John Allen Cc: Jonathan Corbet Cc: Joonsoo Kim Cc: Juergen Gross Cc: Kate Stewart Cc: "K. Y. Srinivasan" Cc: Len Brown Cc: Martin Schwidefsky Cc: Mathieu Malaterre Cc: Michal Hocko Cc: Nathan Fontenot Cc: Oscar Salvador Cc: Philippe Ombredanne Cc: Rafael J. Wysocki Cc: "Rafael J. Wysocki" Cc: Stephen Hemminger Cc: Thomas Gleixner Cc: Vlastimil Babka Cc: YASUAKI ISHIMATSU Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- 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 232bf5987f91d..dd3cc4632b9ae 100644 --- a/arch/powerpc/platforms/powernv/memtrace.c +++ b/arch/powerpc/platforms/powernv/memtrace.c @@ -244,9 +244,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.20.1