Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2074032lqa; Tue, 30 Apr 2024 07:33:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUSKrOatEbLvW80Up/ZUykYjai/78dsFJr3z8UIr1y4Fkbut/U2x0xzNr/IW0xoDE7aWiZ4I8fuxtzsui/nrGGY7bzECjnYvrFzPFaxfw== X-Google-Smtp-Source: AGHT+IHGm1hCendoLxwOAYiVb7SVfGSjEZxD6B/RzLI1Nti4G/2gc8AnBUqTIw7z7JS/vw5S+BgA X-Received: by 2002:a17:906:4711:b0:a58:c0c7:d7cb with SMTP id y17-20020a170906471100b00a58c0c7d7cbmr1954740ejq.45.1714487618125; Tue, 30 Apr 2024 07:33:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714487618; cv=pass; d=google.com; s=arc-20160816; b=qfFCDLPO8H3R/Qdf9cP01v32svyAnPwskkixl4ps+bB0ru1VFrjsou6gkEw1jU44tz yw0fW0gGyseVdjUU8AALmo+vcZ/SHVOReSF+4hDeWtL4TULWC2gDuhjENvwgayq6jAmt ytB7+7OZn59lYvXq+MswWrAbYEpxrJyoLUm611EIps2Mv20adm2MVVkm1EMOQ9ayySOm KxH/eKgVZu/nKfY5oB8BxgOlVJ2ly40ewJuK7gb/lkkwcAOZ/uHkPG5bFZj7/8MfrAKK TibbdCASBrgCPuVLvrBDo+BFQd/ClIrnbgNcSkwuDD6s1OyNK3BO9o7WMbSjYVDB4exA v2iA== 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=V36Fn8ylERq5SYs5muy8Cy1QcOzV01UkLZasNN6He14=; fh=25IklNjpQtm3+ZI4w1ifckV22BkO2b6a/wyTwiBBJrk=; b=GrgIjVhrrHKN1gIuiUPncuSff+KfaaqOane0CLjc2GRgIbkHMvFW/M0Smlm3Lbcqma PFT5KRiGN7PdKDmm+eWN7If3GZB2bFm59xu7p9FAkXDGETr5SW6zA3OyudT7PxkOeiF5 7mQEPjehaaI9/qQX53HRsof35ZSCKtm3UP44UpLsmys1uoJqfCNYJmvXcPj+woYSVITw iRMRunw1zahNOLmhV0lAPjU/6CFvrwC3MCfG0uwkA1JVRmpRCd/0CekLZrmGsePasWch OiKNgq/Vl461D6PBLqFkBXlfInGmchr6iyAFuTSnieSfSAi+C1MjiU9SoZ+8rB+1tmBB dNug==; 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-164143-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164143-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. [147.75.80.249]) by mx.google.com with ESMTPS id hg8-20020a170906f34800b00a5940721d9bsi66877ejb.920.2024.04.30.07.33.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 07:33:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164143-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-164143-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164143-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 D266F1F22DEB for ; Tue, 30 Apr 2024 14:33:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D38B77115; Tue, 30 Apr 2024 14:29:18 +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 1E116770E1; Tue, 30 Apr 2024 14:29:15 +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=1714487357; cv=none; b=VgU6eQM5WgNEEQtqEhDvA5p1HN02i0R4zaadzP+2gZAacxlyZp/Ogz3Kat3Kp7X9PvHeDxGEsjUTDwHa8cHMi5dVuflF/ypf8F4E5oW4C7e649VXY+5g/NMWdkzYgi42jKtCZCxx2dNbXwGaAtH1Azmr1sZ8DUAzRf893+HCjP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714487357; c=relaxed/simple; bh=PGmqSdaMi8/XMHxNyn4fbHRCcojpyBV0VsMIysem5cw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cQ2P+5qulOZ0c9TwfHZ/GA2e1XA5NOdmRwYQ/mLY+zaKNENVyBN9zXAYPqU8L5aHNI/YXjUi3nBkB5U4SIC112vD0PHUXbT9wiAW8tmeoUkSqH/Q7CQpbOnADEfJ/y/PBfo7ssEuiWjuD6CGdzkjBczJeLFSAZRWLKlMqJ+UU1g= 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.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4VTMvb5qh5z6GD3R; Tue, 30 Apr 2024 22:26:35 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 0DB46140B54; Tue, 30 Apr 2024 22:29:13 +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; Tue, 30 Apr 2024 15:29:12 +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 , Gavin Shan CC: Ingo Molnar , Borislav Petkov , Dave Hansen , , , Subject: [PATCH v9 09/19] ACPI: scan: switch to flags for acpi_scan_check_and_detach() Date: Tue, 30 Apr 2024 15:24:24 +0100 Message-ID: <20240430142434.10471-10-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240430142434.10471-1-Jonathan.Cameron@huawei.com> References: <20240430142434.10471-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: lhrpeml100003.china.huawei.com (7.191.160.210) 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 --- v9: No change --- 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