Received: by 2002:a05:7208:b08c:b0:82:bbfa:f723 with SMTP id c12csp377933rbb; Fri, 26 Apr 2024 06:57:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUTaW0uwgQeLgXHwqTObs5u0V3tzjPeaPOrj+0ELA3BkNhTR7gKzuErTayirqLF7az16BemOFK3PyMnLVR/7lvAj3MJ4CRI9dmxzqAKpg== X-Google-Smtp-Source: AGHT+IHtNX88Rhk3nDWx4f3kHqPzRX9YU0BMmMY4QuciUzCwsPR1SHSMYqbrCvrNyh3wxSDarRct X-Received: by 2002:a50:c01e:0:b0:572:5832:b4db with SMTP id r30-20020a50c01e000000b005725832b4dbmr1543844edb.14.1714139837914; Fri, 26 Apr 2024 06:57:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714139837; cv=pass; d=google.com; s=arc-20160816; b=Lt/pHQYAoM3kwPitF26d2a8hK5SmksqQc/DwRX9qEUqlf5QIus8rdIHFecPgEKicq8 GuvoGuGXGcXLELmCyUSxFh9ZHHuDQG+tYqq3J4iBKU09KCIG8ou7dmsEsQxqjr6RBBzp EtJtoLtE0XCclGxTIUuBhFAfRu31pZ1ccPS7VORAfPqothXnKja+RyUNBIg//TtIkp9Q igitRgI1gwbD9EQoZJK+OcnmMvcy5QWyzB3r4umlf+bB64pI3zlx3wJ7vXQuE2hulrIo NaOrx2dQfIiIM1dniosi1Ic53mTECJKO0yF5Nm8SPUB9Bsj0ASXxzOPvcmEq5b1xHpAe 5m5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=YMc7WNOF5vjRchXGNAcL7G2ExgU8iKjWiS9y08fbbu0=; fh=QfGN+Nlycv3VEqD8X65neWxvyXXboUCZUO7iSMK6eUk=; b=WhmVaW8isKUapgkqDIX3gd6830seFbnKBFXx0u3OsMzgW8h+SziucOaJoJXSH5OdIe 1fMlmVywIi4tQ9QIsIWl5e1UktRIzV1akOVj6hLrHiVx4dMZ1bKNe5PGiYoFikdHFklR gq0tGzHRinzL2tAmvWAO4lm9vtR4dEZvVEQNNAIZLRXQ40G+SoSlE/hHAGqfXoL6OhVr AoEVoQkrQJj8mGqyZyNzKHAYPXTHKrM2DgY2TGM3733+Z0+likhaVqiry4wyI4fScaJn 2gitwvQM6XotDoecisQhAtEWeSUDhw6zcFupl48+nl//RIxLN1g3bqJubHUvsGa8+2EF xsWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-160106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z6-20020a056402274600b0057203ecc9b5si7072126edd.624.2024.04.26.06.57.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 06:57:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-160106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A917C1F22285 for ; Fri, 26 Apr 2024 13:57:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9B40148FF5; Fri, 26 Apr 2024 13:55:06 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D804A1482EF; Fri, 26 Apr 2024 13:55:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714139706; cv=none; b=osSJlDX2roYhG5K/tZXnSwj2RyrqKfnAeMkQYnF4f8FhT75TwMQPTlXCkSkqPMkxtCV54Bqv4UpyvF6CLB0tWjNQoqq3g6f3NZZpCLR9jvpAs17BLCjrYsBPc++qN/rgiQm9WDt2cQjWnGDc+AkFMnPftDigrWrvY8tDR7AgFqE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714139706; c=relaxed/simple; bh=Qd27B0CcTyL73Pi9Pcj+U7bKKa7uHGvRH9GI7EG3dGU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Esh829Fy9qkI3tb//2RsjzMNpWsSlDzxVp7NpqoxxRbBt0x6BxlUiP+JxXpVDAw6HKUxJ6qNOemXptSgevyJyMg5JWCkiFgCE2zN4anKsB0XaYHhDzLxbvS7H6fAc//fX9J0v4FxrjSUYKnE6gOZhLg3P9IUhQzp2uA1NRpO5cE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VQvNq0Fblz6DBLn; Fri, 26 Apr 2024 21:54:51 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id AC288140A87; Fri, 26 Apr 2024 21:55:02 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 26 Apr 2024 14:55:01 +0100 From: Jonathan Cameron To: Thomas Gleixner , Peter Zijlstra , , , , , , , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon , Marc Zyngier , Hanjun Guo CC: Ingo Molnar , Borislav Petkov , Dave Hansen , , , , Lorenzo Pieralisi , Sudeep Holla Subject: [PATCH v8 07/16] ACPI: scan: switch to flags for acpi_scan_check_and_detach() Date: Fri, 26 Apr 2024 14:51:17 +0100 Message-ID: <20240426135126.12802-8-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240426135126.12802-1-Jonathan.Cameron@huawei.com> References: <20240426135126.12802-1-Jonathan.Cameron@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: lhrpeml500002.china.huawei.com (7.191.160.78) To lhrpeml500005.china.huawei.com (7.191.163.240) Precursor patch adds the ability to pass a uintptr_t of flags into acpi_scan_check_and detach() so that additional flags can be added to indicate whether to defer portions of the eject flow. The new flag follows in the next patch. Acked-by: Rafael J. Wysocki Reviewed-by: Hanjun Guo Reviewed-by: Gavin Shan Tested-by: Miguel Luis Signed-off-by: Jonathan Cameron --- v8: No change (tags picked up) --- drivers/acpi/scan.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 7c157bf92695..fb5427caf0f4 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -244,13 +244,16 @@ static int acpi_scan_try_to_offline(struct acpi_device *device) return 0; } -static int acpi_scan_check_and_detach(struct acpi_device *adev, void *check) +#define ACPI_SCAN_CHECK_FLAG_STATUS BIT(0) + +static int acpi_scan_check_and_detach(struct acpi_device *adev, void *p) { struct acpi_scan_handler *handler = adev->handler; + uintptr_t flags = (uintptr_t)p; - acpi_dev_for_each_child_reverse(adev, acpi_scan_check_and_detach, check); + acpi_dev_for_each_child_reverse(adev, acpi_scan_check_and_detach, p); - if (check) { + if (flags & ACPI_SCAN_CHECK_FLAG_STATUS) { acpi_bus_get_status(adev); /* * Skip devices that are still there and take the enabled @@ -288,7 +291,9 @@ static int acpi_scan_check_and_detach(struct acpi_device *adev, void *check) static void acpi_scan_check_subtree(struct acpi_device *adev) { - acpi_scan_check_and_detach(adev, (void *)true); + uintptr_t flags = ACPI_SCAN_CHECK_FLAG_STATUS; + + acpi_scan_check_and_detach(adev, (void *)flags); } static int acpi_scan_hot_remove(struct acpi_device *device) @@ -2600,7 +2605,9 @@ EXPORT_SYMBOL(acpi_bus_scan); */ void acpi_bus_trim(struct acpi_device *adev) { - acpi_scan_check_and_detach(adev, NULL); + uintptr_t flags = 0; + + acpi_scan_check_and_detach(adev, (void *)flags); } EXPORT_SYMBOL_GPL(acpi_bus_trim); -- 2.39.2