Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2939606pxv; Mon, 12 Jul 2021 05:44:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjilFAmetE9KRwXCKjm11D7LrfxkJzpvllDyz3Xi4nutdUKriZhKIoe1/NvVLkr7i2bJ+y X-Received: by 2002:a6b:4412:: with SMTP id r18mr15579272ioa.120.1626093861653; Mon, 12 Jul 2021 05:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626093861; cv=none; d=google.com; s=arc-20160816; b=GUWLLFrOUFQRipfGs/fO+GAFSkxN6E00srVreYRubEQW2F7CR+WkYaIFHFpu4Jnlhr Yh5hXOjNnve1G9eRem6AMatu5MOIsm7a95+5NhjFqO97BvBn1V1nYqVddyd9wuMdm3zO szPUKGsskkDOpkRc8z6kziZFFTmxhvVzrxt0Yc8K4i7WLWvr29aCcWeA5cj78p42kUO0 RLaBhf0q2PFmciOBTePfDg4wv8DCn07x9oTF76/y3h9keqM0IxbnssVBJ2yasR81DclH HSKu6xQqkkZi/rb6+7laVPmaBc4LSIXv+f2DJpD6jYCDjn1BxyUCYMyoDyFRklL+9hiT VTcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pXhL//ogQJi+M8+nVdHcrU68d/XzKP3Ysz4l2H7Enzo=; b=acLr9iYtfgTBjOumLoXgtAc8JCg4Zj3OUm6uS7eL89LL6mpTvLsvh8JMZfzlYmiQSd B7uK9FxekW+EI4VXBJU+XxSSdY21x43aeHEleCPs5SDLnYsyHllKgr3lyPb0Cmyf50QQ ykI1Heqsi62P7rc6BS/FqPTHqRtoTREZoZ0CmQyjXHdgujsZ28yRpMiF+AXfk7CtI28F /+UeskV1ROpR0PD98NMeLa9iVft3PnJHX1tyWAaO5b6dlFhz822FvfaSr/S6isemjTiQ KzIN/F/O+VbBHgV4ZYLv2cz/hbd6HzW9IwF75Sdm4Mur/9Ojcrw/7O1FbmNzL48EtGhy 8T0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EsnOiJlI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si18300177jav.64.2021.07.12.05.44.09; Mon, 12 Jul 2021 05:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EsnOiJlI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230361AbhGLMph (ORCPT + 99 others); Mon, 12 Jul 2021 08:45:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30646 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233685AbhGLMpg (ORCPT ); Mon, 12 Jul 2021 08:45:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626093768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pXhL//ogQJi+M8+nVdHcrU68d/XzKP3Ysz4l2H7Enzo=; b=EsnOiJlIlzUNM7Kf6oJ9GKG3KesDTiQ7Gwv2d5eTmw6tJWl69TJYxlVvOdPW+0dMPPlK4a 98zEEevcEX0YBglNFkZ8Z9/82+esZByojVfsfDlH2IzormKmnogj268LeaiQ2BmzlW+yos +a8Td0us9nn/EFESAhmQHBYmQatSK7o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-479-fIG3VmWRMnu31B8obKN8uw-1; Mon, 12 Jul 2021 08:42:46 -0400 X-MC-Unique: fIG3VmWRMnu31B8obKN8uw-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4983C804309; Mon, 12 Jul 2021 12:42:41 +0000 (UTC) Received: from t480s.redhat.com (ovpn-113-111.rdu2.redhat.com [10.10.113.111]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEFCA5C232; Mon, 12 Jul 2021 12:42:21 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Vitaly Kuznetsov , "Michael S. Tsirkin" , Jason Wang , Pankaj Gupta , Wei Yang , Oscar Salvador , Michal Hocko , Dan Williams , Anshuman Khandual , Dave Hansen , Vlastimil Babka , Mike Rapoport , "Rafael J. Wysocki" , Len Brown , Pavel Tatashin , Heiko Carstens , Michael Ellerman , Catalin Marinas , virtualization@lists.linux-foundation.org, linux-acpi@vger.kernel.org, Andy Lutomirski , "Aneesh Kumar K.V" , Anton Blanchard , Ard Biesheuvel , Baoquan He , Benjamin Herrenschmidt , Borislav Petkov , Christian Borntraeger , Christophe Leroy , Dave Jiang , "H. Peter Anvin" , Ingo Molnar , Jia He , Joe Perches , Kefeng Wang , Laurent Dufour , Michel Lespinasse , Nathan Lynch , Nicholas Piggin , Paul Mackerras , Peter Zijlstra , Pierre Morel , "Rafael J. Wysocki" , Rich Felker , Scott Cheloha , Sergei Trofimovich , Thiago Jung Bauermann , Thomas Gleixner , Vasily Gorbik , Vishal Verma , Will Deacon , Yoshinori Sato Subject: [PATCH v1 4/4] ACPI: memhotplug: memory resources cannot be enabled yet Date: Mon, 12 Jul 2021 14:40:52 +0200 Message-Id: <20210712124052.26491-5-david@redhat.com> In-Reply-To: <20210712124052.26491-1-david@redhat.com> References: <20210712124052.26491-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We allocate + initialize everything from scratch. In case enabling the device fails, we free all memory resourcs. Acked-by: Rafael J. Wysocki Cc: Len Brown Cc: linux-acpi@vger.kernel.org Signed-off-by: David Hildenbrand --- drivers/acpi/acpi_memhotplug.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 1d01d9414c40..eb4faf7c5cad 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -182,10 +182,6 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) * (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. -- 2.31.1