Received: by 2002:ab2:68d2:0:b0:1f5:ff5f:8f32 with SMTP id e18csp114889lqp; Thu, 18 Apr 2024 06:58:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1DEKsmgBSWEZ8gmf+BG/KoZax/YIzh6v5doLy5qK6J82BO7grf3A6bx/XQMC2m4N5PUuvYB2V1MhBHZjLvv0YbfHSr54ecUqVfvvZuQ== X-Google-Smtp-Source: AGHT+IFpl6kPdcnbZa3HTCI+hB6wATtXorSi+lUQfSDPoQtVX4COTPJj1PDipKtfR5w1jcNtvyYS X-Received: by 2002:a05:6a20:2446:b0:1aa:33a5:c5e9 with SMTP id t6-20020a056a20244600b001aa33a5c5e9mr4201192pzc.34.1713448706166; Thu, 18 Apr 2024 06:58:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713448706; cv=pass; d=google.com; s=arc-20160816; b=iD41wEV58eqLsY4zdOMHaQGXVZC2O2RPK7YSjA2HSxNOPyvRyfxOED3x2i4N8+biIy mvBnscVeEphxPPSJUwhm/r80Ve7aIdcfgXm8He+Sm92GCcpsF+Xg7xfs0X9vtcgieOVc hDgAp/zbX9/7bSr1QE7CEfRBLnPOweDfO+08mUxaaKKzhRcMhoYXc7ftiyB+SsupeGB6 rt4f2UV2PbwMp9O+vWIpq3YrQD3E+hfjNed6jnwiTXto2ZOxpxPCWiVYrif+NwEjUOWs 3RrMArHyhui1+mnAR3YCeb3VG0b8mXubUl2Rzb81ORrwQgRRXvPEVbFjUL5Y02yehQ5J CtYg== 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=UMg40rsUB3vPXxFWX1yn4nja7w1R6UHOFoGTSCslElw=; fh=wmH6eZgtoFCyes/zVTYi+VaxxdPmNW9hqdNd8ZTZ4XU=; b=acSm6wEk+i98XNdD1XTLXq/uAh/VIF9AmF46J/YP6YAv1FXj8Acv6Kpaprh/3J+6uZ 6gdpCnjaO7rOoniC3Oi8p65/xeyygG0xI3hLHc2JMiRNaMR351n/gDUKe8G7x4Vj70Q4 A59dGsZv17RT+Gg9agMmb0jDlM038osTf7w4dFwA51iazIRoRko4oBLnU6i0ypjw4Faa ieY8l/ymJA1DFSyKFcBkC0ovGEh7SjnxNOtC8Khz2BWdrqgvl/63X9iPJKLDKFSXC4rB J0EjBtUmzWFsr5zd92r73EBcBBRkHQC8DsMisAmf/maH8F+tluMrrAvBPY64TtrGBVd4 nWzA==; 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-150220-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150220-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. [139.178.88.99]) by mx.google.com with ESMTPS id ge2-20020a056a00838200b006ea83747d2bsi1481417pfb.244.2024.04.18.06.58.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 06:58:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150220-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-150220-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150220-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 03AB2282806 for ; Thu, 18 Apr 2024 13:58:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08A021649DE; Thu, 18 Apr 2024 13:57:53 +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 03DCE160796; Thu, 18 Apr 2024 13:57:51 +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=1713448672; cv=none; b=rsfTsC5FUcskQhOiqUPdXt1YraFxyfm7i/vqCsAyIjzpVIRSjsDJ10ZW+JRQfieK83HPtFiLZ+39m3sbw8G49k0k5IV3Zb5C+11J1PfQPb5z4ZBDqSUtT7hZ9xelQIUNosktqNDK96qsbpWoaip1tOKOgR+UYK2wo5A23vJegvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713448672; c=relaxed/simple; bh=Fg1Uw/EE5fB2oyPrQhHIjgnrktVY0yIzZa7BULUrzRw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WZL9nhYHlswaIJUVI5zMqZ3vbCnkL4pG5Hp9Yr0DuCitZ16eR/MzTHfAfzemKYK7ZiHHiDqFMt5CeT6EqztMAjci2ApVuQ/aXaD9Tv2gZHimmf2PzTX9cS79VoQx54HCcHTCv/ryZJ2oT/X9KeAADH+OEmFH2c8U6UNUHIkyWfw= 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 4VKznZ1rkyz6D955; Thu, 18 Apr 2024 21:55:46 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 147261406AC; Thu, 18 Apr 2024 21:57:49 +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; Thu, 18 Apr 2024 14:57:48 +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 CC: Ingo Molnar , Borislav Petkov , Dave Hansen , , , Subject: [PATCH v7 07/16] ACPI: scan: switch to flags for acpi_scan_check_and_detach() Date: Thu, 18 Apr 2024 14:54:03 +0100 Message-ID: <20240418135412.14730-8-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> References: <20240418135412.14730-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: lhrpeml100002.china.huawei.com (7.191.160.241) 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. Signed-off-by: Jonathan Cameron --- v7: No change v6: Based on internal feedback switch to less invasive change to using flags rather than a struct. --- 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 d1464324de95..1ec9677e6c2d 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) @@ -2601,7 +2606,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