Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2493029lqt; Mon, 22 Apr 2024 12:14:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWYaTiGjNyKtrNdWaNyDQNf499UU34FnKL4VPlZjyQEBBBgvHk+CxJXxTH5j8KyFW9TQov+qHpkMz8wPpLmKGTrD62WsIS/3pkauGe1TA== X-Google-Smtp-Source: AGHT+IHzJhA6UCGTaECbxEIegTL+8rL/jtSSxWIj9q635lgHqCprV6VR0AvER0R4MouRP3v6wO3K X-Received: by 2002:a17:90a:5517:b0:2a5:d0cf:3ef with SMTP id b23-20020a17090a551700b002a5d0cf03efmr2633572pji.37.1713813290201; Mon, 22 Apr 2024 12:14:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713813290; cv=pass; d=google.com; s=arc-20160816; b=zI0JGS4t95gpCHSq9YwUsKWGNJI0vRShbCcmq+avWvjhO5iUcnanSzqkr+NfNtdZZZ kt/Si19zt8j4MbCoCyfcTByeqZB73tgvioMqXNWjMbbhCxs4G45O7J+fTYSJfvBndDcv z9Y4ZoFYyJ9omBW8Oz3WhFLPNdaxznzuClAylclTc3nZPXqYzfrvCtcYiSbdJWL7qz0C yMgESdQV2ejRZ+zvwo0TRf0M605sI6UtBpAIkIOxfo2ygB2UJ58xMnsqieXttQNssxSd 82ndMID0QRgOFnfx6i+R8zXchOosSZ8lKibpbwahnrzhNtVHIVowsWREPpy6BJ7tFoI8 D57Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=2rtFnq+oapczRimi/OtClEIsqfnW1e7l6v2L94IlXag=; fh=pSTk5vqm54ZcSwARprQXPOQedk2c32wGceNSFLDN6cA=; b=DDze2Lq3DiDypkKkB0X0MSDfvhg058cZ17jPMPJJVnQW2drJ+3X4L05KqKamXkWV0Q 5qlkqq6e1aZ384YqKJ2SHWBQ2hFxE0k4agWulePPifPB0Yv+ar/onLepzqO7FRAcH2+D NCro7b3UoI9WsA7xiXFecL5umFQLzYGTQoE51gcrgE4G/wCTK5f9yBP661AgcIwci0AO gV3xUrXGSL08KAtr4mSkwIybxJn4Jsj0b71pLGcI0Lt/kycKyBm2YyJ+jR8aIBUenJW7 vMhVcq+wU1peOf8Ymn0klL4sPI6d4X5qC+za8NR2poaEx/fAgmJGaMz18/NuIwhQiCen NhEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uDXCxd3s; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-153895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153895-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s18-20020a639e12000000b005f40318db6dsi8074831pgd.756.2024.04.22.12.14.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 12:14:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uDXCxd3s; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-153895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153895-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 532A3B21991 for ; Mon, 22 Apr 2024 19:06:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B5E3155323; Mon, 22 Apr 2024 19:05:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uDXCxd3s" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 639071552F2; Mon, 22 Apr 2024 19:05:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713812757; cv=none; b=gQfLiKHGyLThQkCLQqcyZX8rwdCgTP+NYlTNafLcejP+mjKxH2WqwZo3dmTuAQulUzqDdd/XJrnJx1HTMPi2qxl3j1cYraTWjVU6htvg5ByZATK0xgnPUvsgu39RApRlC94qVK0OW6p6YdSRhLEu1b2CwVMePqGtY51Hm8bf5hY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713812757; c=relaxed/simple; bh=olqbjtMO2lYQFKdnW9FhBNUoQLhAMSlCx3EdoK7BvxQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=BnPOPqmX1bBviROfsGh/Lrf9hNfkwooEZRorfMbOQ30E9qH5nhJkq8qTlVZILnPp9HWruHKwEcXphafGN9FKSdmy7de9cBqfj6P19Sxpd2K0bfMbn+R510e5oTnOuR1IJyZAgWYuMtw1ZW0JkxhKsXwIXrYpZ9jgY64swWJ/BfY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uDXCxd3s; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2C49C4AF0C; Mon, 22 Apr 2024 19:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713812757; bh=olqbjtMO2lYQFKdnW9FhBNUoQLhAMSlCx3EdoK7BvxQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=uDXCxd3sZnTu0YXjlb27OMBo2Ww2PBVIwA+q8lUNvApEq/PWHI1QUkVnqx5Ydl+j3 1FjK1hRE44LaOBxQDRMXqtuoal3S/5FElxlVHf9ogy7p/ZycNb/RIsXvkUXdQwMsgH bXarTEys6i+IEP2d/uWh3ep3Ka9wJjL3OT95V4VfT2+IHY2cGsvcMsAjiZ91945MkB lZlu0/ba4iregoy927lvLlmniSLuG0+IYbHNX1JXlUwm7besyDoAHgOi1UI/tQo7iL 7p1RJcHEg/MuH0jb5LtTG964ydw10G2NUg1ov9MYBCCVDmuIJEgbNOkuCvwi4ymjQe 1Q0y51v50ZUaw== Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-5aca32d3f78so935099eaf.1; Mon, 22 Apr 2024 12:05:56 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXsRhF5ErfgVVyaHznnvTO2DC9VuN0BiemfKZWysoVkGxfAlJays5ddFvWFNuKFNxDYLuyDhyfbekjcdx6ydgVboeCWHFCjjc9Qa2oVllkXDgKal1GI1TcNj5JLTSXOUid6ST2vSB6wFgGME8YFi3tfe/xqLi4qMNdxDK3VzvYv7Wnj467n04yx9WmjCT9GuTWIZne7CB0OLso+RTs0Qg== X-Gm-Message-State: AOJu0Yx3H2P72KE05BNTXqLnHjdss0hthhYpCaMI7ugUFNfDq8DRyn0K WWAa0iMulpaZgLYxLtm9jrqLa79npQxNq30qEc/99z4t8sFMLp+jcwPQ337w/nrOL4VXa4Jl425 HdbD7WSZEyT9675+YP3f5TvihxiM= X-Received: by 2002:a4a:5581:0:b0:5aa:3e4f:f01e with SMTP id e123-20020a4a5581000000b005aa3e4ff01emr12662466oob.1.1713812756200; Mon, 22 Apr 2024 12:05:56 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-8-Jonathan.Cameron@huawei.com> In-Reply-To: <20240418135412.14730-8-Jonathan.Cameron@huawei.com> From: "Rafael J. Wysocki" Date: Mon, 22 Apr 2024 21:05:44 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 07/16] ACPI: scan: switch to flags for acpi_scan_check_and_detach() To: Jonathan Cameron Cc: Thomas Gleixner , Peter Zijlstra , linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon , Ingo Molnar , Borislav Petkov , Dave Hansen , linuxarm@huawei.com, justin.he@arm.com, jianyong.wu@arm.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 18, 2024 at 3:57=E2=80=AFPM Jonathan Cameron wrote: > > 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 I have no specific heartburn related to this, so Acked-by: Rafael J. Wysocki > --- > 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_dev= ice *device) > return 0; > } > > -static int acpi_scan_check_and_detach(struct acpi_device *adev, void *ch= eck) > +#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 =3D adev->handler; > + uintptr_t flags =3D (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_dev= ice *adev, void *check) > > static void acpi_scan_check_subtree(struct acpi_device *adev) > { > - acpi_scan_check_and_detach(adev, (void *)true); > + uintptr_t flags =3D 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 =3D 0; > + > + acpi_scan_check_and_detach(adev, (void *)flags); > } > EXPORT_SYMBOL_GPL(acpi_bus_trim); > > --