From patchwork Wed Sep 8 02:55:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12479871 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BD7CC433F5 for ; Wed, 8 Sep 2021 02:55:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3B9026112F for ; Wed, 8 Sep 2021 02:55:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3B9026112F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id DB268940011; Tue, 7 Sep 2021 22:55:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D3AFE940007; Tue, 7 Sep 2021 22:55:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C03B6940011; Tue, 7 Sep 2021 22:55:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0240.hostedemail.com [216.40.44.240]) by kanga.kvack.org (Postfix) with ESMTP id AF7B8940007 for ; Tue, 7 Sep 2021 22:55:17 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6E67B2BFAD for ; Wed, 8 Sep 2021 02:55:17 +0000 (UTC) X-FDA: 78562889874.16.83DFFFA Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf01.hostedemail.com (Postfix) with ESMTP id 25AB75055452 for ; Wed, 8 Sep 2021 02:55:17 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 97DEF61108; Wed, 8 Sep 2021 02:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1631069716; bh=WNGz+EtiL+kJAEIjuXINr2mmwKzBUsIDsSS3NALhNOs=; h=Date:From:To:Subject:In-Reply-To:From; b=P5tft03lAR6oJCk16f0RrZq16lmtV8WFp6Xgt9V+nYvOeCKZ0G98lGmxUY6ISiyP1 VbFva+BAozP/g/V2lnGEGCBWKfnHoHHuw4zV2BJB8HMehEeOKXUiS0QiDUc2LAmAH6 yqoc3/s02ZJxhIqqyzIeyXVG7KYI16nFd0YhRcbQ= Date: Tue, 07 Sep 2021 19:55:14 -0700 From: Andrew Morton To: akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, anshuman.khandual@arm.com, anton@ozlabs.org, ardb@kernel.org, bauerman@linux.ibm.com, benh@kernel.crashing.org, bhe@redhat.com, borntraeger@de.ibm.com, bp@alien8.de, catalin.marinas@arm.com, cheloha@linux.ibm.com, christophe.leroy@c-s.fr, dalias@libc.org, dan.j.williams@intel.com, dave.hansen@linux.intel.com, dave.jiang@intel.com, david@redhat.com, gor@linux.ibm.com, hca@linux.ibm.com, hpa@zytor.com, jasowang@redhat.com, joe@perches.com, justin.he@arm.com, ldufour@linux.ibm.com, lenb@kernel.org, linux-mm@kvack.org, luto@kernel.org, mhocko@kernel.org, michel@lespinasse.org, mingo@redhat.com, mm-commits@vger.kernel.org, mpe@ellerman.id.au, mst@redhat.com, nathanl@linux.ibm.com, npiggin@gmail.com, osalvador@suse.de, pankaj.gupta.linux@gmail.com, pankaj.gupta@ionos.com, pasha.tatashin@soleen.com, paulus@samba.org, peterz@infradead.org, pmorel@linux.ibm.com, rafael.j.wysocki@intel.com, richard.weiyang@linux.alibaba.com, rjw@rjwysocki.net, rppt@kernel.org, slyfox@gentoo.org, tglx@linutronix.de, torvalds@linux-foundation.org, vbabka@suse.cz, vishal.l.verma@intel.com, vkuznets@redhat.com, wangkefeng.wang@huawei.com, will@kernel.org, ysato@users.sourceforge.jp Subject: [patch 041/147] ACPI: memhotplug: memory resources cannot be enabled yet Message-ID: <20210908025514.zEZRUptEJ%akpm@linux-foundation.org> In-Reply-To: <20210907195226.14b1d22a07c085b22968b933@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=P5tft03l; spf=pass (imf01.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 25AB75055452 X-Stat-Signature: w9ayh8z77ryt9wezgmkuwwek6omaz3ny X-HE-Tag: 1631069717-370239 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: From: David Hildenbrand Subject: ACPI: memhotplug: memory resources cannot be enabled yet We allocate + initialize everything from scratch. In case enabling the device fails, we free all memory resourcs. Link: https://lkml.kernel.org/r/20210712124052.26491-5-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Rafael J. Wysocki Reviewed-by: Oscar Salvador Reviewed-by: Pankaj Gupta Cc: Andy Lutomirski Cc: "Aneesh Kumar K.V" Cc: Anshuman Khandual Cc: Anton Blanchard Cc: Ard Biesheuvel Cc: Baoquan He Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Catalin Marinas Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Dan Williams Cc: Dave Hansen Cc: Dave Jiang Cc: Heiko Carstens Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Jason Wang Cc: Jia He Cc: Joe Perches Cc: Kefeng Wang Cc: Laurent Dufour Cc: Len Brown Cc: Michael Ellerman Cc: "Michael S. Tsirkin" Cc: Michal Hocko Cc: Michel Lespinasse Cc: Mike Rapoport Cc: Nathan Lynch Cc: Nicholas Piggin Cc: Pankaj Gupta Cc: Paul Mackerras Cc: Pavel Tatashin Cc: Peter Zijlstra Cc: Pierre Morel Cc: "Rafael J. Wysocki" Cc: Rich Felker Cc: Scott Cheloha Cc: Sergei Trofimovich Cc: Thiago Jung Bauermann Cc: Thomas Gleixner Cc: Vasily Gorbik Cc: Vishal Verma Cc: Vitaly Kuznetsov Cc: Vlastimil Babka Cc: Wei Yang Cc: Will Deacon Cc: Yoshinori Sato Signed-off-by: Andrew Morton --- drivers/acpi/acpi_memhotplug.c | 4 ---- 1 file changed, 4 deletions(-) --- a/drivers/acpi/acpi_memhotplug.c~acpi-memhotplug-memory-resources-cannot-be-enabled-yet +++ a/drivers/acpi/acpi_memhotplug.c @@ -182,10 +182,6 @@ static int acpi_memory_enable_device(str * (i.e. memory-hot-remove function) */ list_for_each_entry(info, &mem_device->res_list, list) { - if (info->enabled) { /* just sanity check...*/ - num_enabled++; - continue; - } /* * If the memory block size is zero, please ignore it. * Don't try to do the following memory hotplug flowchart.