Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp640290lqb; Wed, 29 May 2024 06:40:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcudjlBf5+y/WtsAXs+tLjMw2YEouy8Vcc/g/Z4d2J5Wgy2vi8pYBG9KUsrgGWsGw95YPrZ+AnE2XYAm3J81osgXEodLzH6qOPAwBkng== X-Google-Smtp-Source: AGHT+IGIXWOwncX3leOe3wWQrH4ou1MV5x6u0gdKFtpHWMRL/IEVMD7M7EICVrFb+GycOztrCkDs X-Received: by 2002:a17:903:1249:b0:1f3:16ac:8b06 with SMTP id d9443c01a7336-1f4498f0c20mr225844595ad.59.1716990001809; Wed, 29 May 2024 06:40:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716990001; cv=pass; d=google.com; s=arc-20160816; b=DMPL7unuuI8SpndWv0jt7w2GHAVys0NR+/yGXImeNcB9RGegs2fQ7EdT0jSk/Qqopx A9bIhFM/9qWVi6OLPwCG4zVR5TSojF58UH1Q7AdOQ4HvUlwJO9IeuzID30RGyW1fsVy7 L6nacvxo0bU0FkGr2k3OZzMwImrZCCJCgitGoEjhQ8Pzy5epUPEkSE5TcjFCbVF+hXfW DCwWA7Y3Fo50IGAcqfQu9XwHps7LvCVPlZeWOFnRncgw6RgP2VbN4A+0WClIAx0lZ0w1 v8tQfv5fyDA+wfiHNMt6fLtI4LRRhDtJ/t1MgZ3ik6OoW6YQW0Ddn5SfSvbaxP1oyJ2T otbQ== 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=aht+HmwSgVEG7FRuiiIZKdBkYOyKtWHYp90j0o0X65U=; fh=NxmCHexitX7P6x/7ARv3vZBmyAUGQGWkF2RSnxwWsIo=; b=HlOcXDZlta9GUKM3+YDsDQ0vwLkM2TbwuzOFOahFDgj3JHdC5H4+U99uB8sOGWXpad iSgueiNWKDN5ytLY9sub5gt7NIldFJwt3aW4KvC9U5JP/RsMspqoisCznwslGPPYoFP3 1d9wTOCSMpaG4SDu8zcad2Rq8NoEiomwRyh7PdvZRM3W2lnMv6cruCD7tyudir7tHqTt y9a9BsrdZ3WkVCX6NrRF6rHqMoiiISUQt7KtvI1Olg/G01xq9+JEPrlVTbVgTK78KzLZ pwAxWkPXk3ntjGL5CI80O9ERbu6iyxYsbDum8OwIjqeRTo80rSmy23Nw4q92mBk3gwk5 BW/Q==; 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-194177-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194177-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f48bbd6723si64249635ad.248.2024.05.29.06.40.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 06:40:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194177-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-194177-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194177-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6FEAF2879F7 for ; Wed, 29 May 2024 13:40:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C363D1C2AF; Wed, 29 May 2024 13:39:29 +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 AC9811BC43; Wed, 29 May 2024 13:39:27 +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=1716989969; cv=none; b=q/qZyhcUpWtaHRFUuiD+r6vy/LLFLDBhgWIbRTX9erdFqzzR7ymQzapDPP9mFrHlQ8ttHFmZMqQoWHsASS6dqARCfAa0rRKfWsnxOhZz7Ds0UZLBoYpsylxmxiA/hV9Fy+/w2wx2MsXH32d9f2csmPAs//BVBRnga4A47u+3lns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989969; c=relaxed/simple; bh=3q61VG1Ik4rX8YqbN6++r4IfLmipSRRTHufrzeAz2Uc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Sh4tU4wADScDdl/lrP/k8Xylpesx8PAv+0teUlZH4UX+U/09f4QPdUYVI3otedV5kXCvq6gWdQTM9CAZAZRqlsmpd8Ww57/gHvk2dmZLQ4SHLrFKBcq6nzx0kdVx3F7ahb0hor3kCwr2enLuVP1hREvI5vKjHh4AIDT5uwWeSTE= 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 4Vq9Nv6hqCz6J6nh; Wed, 29 May 2024 21:35:11 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id B4BCE140B55; Wed, 29 May 2024 21:39:25 +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.39; Wed, 29 May 2024 14:39:25 +0100 From: Jonathan Cameron To: Marc Zyngier , Will Deacon , Catalin Marinas , , , , , CC: Mark Rutland , Thomas Gleixner , Peter Zijlstra , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Hanjun Guo , Gavin Shan , Ingo Molnar , Borislav Petkov , Dave Hansen , , , Subject: [PATCH v10 09/19] ACPI: scan: switch to flags for acpi_scan_check_and_detach() Date: Wed, 29 May 2024 14:34:36 +0100 Message-ID: <20240529133446.28446-10-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240529133446.28446-1-Jonathan.Cameron@huawei.com> References: <20240529133446.28446-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: lhrpeml100001.china.huawei.com (7.191.160.183) 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 --- 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 503773707e01..4d649ce5876f 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -243,13 +243,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 @@ -287,7 +290,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) @@ -2596,7 +2601,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