Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3523908pxj; Mon, 7 Jun 2021 12:58:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzMz6Enm7UznO0O3eFAkck0b98kTuWsuLmXltvpEUMZWYVRtMlFsTwRJKBqXWY2W/LRkw7 X-Received: by 2002:a17:907:628d:: with SMTP id nd13mr19139897ejc.299.1623095883371; Mon, 07 Jun 2021 12:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623095883; cv=none; d=google.com; s=arc-20160816; b=OG8ZSfsnDuVG+oGkGS+27UT01xOFZXMqYsa/UWTBD9bPqC48a7H42LKInk5TBJJTxJ Wr3vyFFdhF5GajHSYS+PTcR78erwAepRERRVmuJZ1PGvfWXXfBY80adoidrn7MRXSqf6 i6aSP6UM6M1VZ+dqp/m58Gx7OLVP5NNYovPiZOi6E9FaeTAhEQ5FGgcTahrqKDuWgtWa BIwzUQc1KJC5R3xxAKm6Zq0UaxcjmSmzuB6awatDzyrnCE1qQmR8glSa/ImlHiGiu9TR fXUL9DSVHrImnX57sYtXyM8zcPFO9tJo6oonjgfH2cPoAPuzUThMIrqIkDz/S5p5shpz lHOw== 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=Vq0FXkjEaqVQtYMlODRy+q5RbBxL52gZGzEQgseX1Ic=; b=yXjTOUb4tBqDW23G3migfS3ahL2KPEW1O9FXp0OlKnRwKzx92fL2/nUU+nHm6Gq0Lp 3oYWJm5V9EHfvqgz3FArVHSu7g+QyQWZmr39eQ5eX+RQ/x1/zo6cwxoqH+tqN4oY0IyY /etZiy5EqFFbwe6APHeTpJ3w9DYz9GK3cFtYnm0XkBQolMIn7GUjYNS4tWe4ilYzshOv 2XLP/BtuB/k22D/4E8/TVmLVCg7oIu69vCvmVLcqV7EgDV8x6sIGSJ3fB2w7BSw+6rYI ztir9RY10m6s4VXxgpM200TW9Eeht4/DGobYJbr0kLN4qWM2FmJ26cxE1BqOJCv3kCYq JtzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g29Aa0K5; 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 s7si4708710ejs.405.2021.06.07.12.57.39; Mon, 07 Jun 2021 12:58:03 -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=g29Aa0K5; 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 S231634AbhFGT5n (ORCPT + 99 others); Mon, 7 Jun 2021 15:57:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40238 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231630AbhFGT5l (ORCPT ); Mon, 7 Jun 2021 15:57:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623095749; 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=Vq0FXkjEaqVQtYMlODRy+q5RbBxL52gZGzEQgseX1Ic=; b=g29Aa0K5YwXJEbqLKy54R8gO3OVPlHRPd68irellAtBhh0XaF3SN0C7ky1g/pwtOD5w6o0 IQASBmVvAXuXo4oo3L4saT7Y9hNqOzzSYmsfLhOC7hrfCmrx+rgAgQCzxtTTxUKsLm93bV p6Vd8QGR4iQFXI3I/Gc+XNT9ABW90C0= 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-294-lBmuo3skPOeiocgp4fAR5Q-1; Mon, 07 Jun 2021 15:55:48 -0400 X-MC-Unique: lBmuo3skPOeiocgp4fAR5Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 38D4C1005D6C; Mon, 7 Jun 2021 19:55:46 +0000 (UTC) Received: from t480s.redhat.com (ovpn-112-9.ams2.redhat.com [10.36.112.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2B8810013C1; Mon, 7 Jun 2021 19:55:35 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: David Hildenbrand , Andrew Morton , Vitaly Kuznetsov , "Michael S. Tsirkin" , Jason Wang , Marek Kedzierski , Hui Zhu , 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 , virtualization@lists.linux-foundation.org, linux-mm@kvack.org, linux-acpi@vger.kernel.org Subject: [PATCH v1 08/12] ACPI: memhotplug: memory resources cannot be enabled yet Date: Mon, 7 Jun 2021 21:54:26 +0200 Message-Id: <20210607195430.48228-9-david@redhat.com> In-Reply-To: <20210607195430.48228-1-david@redhat.com> References: <20210607195430.48228-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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. 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