Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2896913lqt; Tue, 23 Apr 2024 05:14:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgTDKdzp2xWqagtFvH/GdxQJTSX6dvnwLcc+IO6bzdPzdlC6iVrgjkbSF9Ug1fNzskEVMkJ5Hi50zhvq2g3/styHbpQMnRjnbsT8Gsyg== X-Google-Smtp-Source: AGHT+IEu10Me0W6s0XJA5+BwziinvhRze+3jtd40sM1fF+eBuM9H1ISUvoN50fPU3QzuLLrGxSFo X-Received: by 2002:a17:902:dac9:b0:1e9:519:7dc6 with SMTP id q9-20020a170902dac900b001e905197dc6mr13173788plx.55.1713874468286; Tue, 23 Apr 2024 05:14:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713874468; cv=pass; d=google.com; s=arc-20160816; b=m2tLl9XouurHDO4RTfX0PEK2VYsnn22F6BmBmFM1kI+tQMMivbMZgGjcmm1tN/yCKM YTRHqyB0r9zRZV4jpRvy375SPKbdUbSnLJjtksyRDI9QmVTJow0FbSzQHarJc73ZieYD /HF7BshbmKCYE5Wir1rxZWFq9rHMJcliRRCJj+m7h5DCDtcIxjvd1BtIAL8JyQdMvZve 8zPp6l3FphKek9GBwXq730p7DltEgYiBle4PZ8wX4JiPJyrf739KmczTwN1+xgvT0BbG kYLNqr8OWMp/Tmx3OQwCkXpquoR9gTMKhMOYdvWPfhVt6Tu4p2QVs+2QHRl02CrQkkVI XHqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:from:references:cc:to:subject; bh=1qKpRlIvlVcaA2p40hXqbQ3hiyvTHp5jH5xAlk3lLoc=; fh=S7HzysLzJEf2t9xHfpKwrx1jR0+E6OoCAaKUKAWYRPs=; b=ie0NEgN4xxlI7h+5HGfRtO//dARmrajqwqftUqXb24SUpObxhdZo1vC/mMuyYla+3z ntfC8Gt6JmK0Gt/QaoEZKnCnTrRxxx/mk3/Ul+G1+4naju6SD8EOMaDJTo2qPmc5qthU UtIudUjGLuxxEMFe2XB0+2XfDSuUQmtv6si6BzfBv4qm+mfDHBH5bunlo9R/hlQLeM/t 2r+bo/pHNHXbVcglA5l+9fCY20NV3Y1dJGK2oVIofDiBoy/G6ff25uEt7x9K0XdxCyle XRZd+W/hS9ey9yWY0XdUgHQtWwHhwaPGgX11TeDZqrmNFBrUoG66w4nvmyAORg1XziSU FLEA==; 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-155120-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155120-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 ix18-20020a170902f81200b001e3ff4b7ce7si9338852plb.438.2024.04.23.05.14.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 05:14:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155120-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-155120-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155120-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 C0FA928973C for ; Tue, 23 Apr 2024 12:07:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C049134CFE; Tue, 23 Apr 2024 12:02:21 +0000 (UTC) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (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 71B788564A; Tue, 23 Apr 2024 12:02:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713873741; cv=none; b=Nv//M0VXEsoJgVgC2ER0PAa9TbVqB8VANlpEbLkumDddNxEmvCrKiLTnh2Dh+xGPDqBPvj8CEd2FWuliWwJvvAlymnioprw16uP8dAainmSsMIINJeUflb16FEMWvUBRcNqoH3BMTUHZ+p9ceV82oqJcgBcRCM9HetQxlS3hCQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713873741; c=relaxed/simple; bh=hfKlsY4ZX33lVwyiKtYcBze9pmY4qL8hQv67+y8Zpf4=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=syN+jajb8+TG5ig4end0QvVVVd46Hd0SLI6i58aF07hCWEPfBn2RsHelSC7cBC92QmiKfZmXMk83uAiXYl3UTwilbaW36mOktA3VFcZwTZRQg73m+qqVrT4Pw0wShbVB6yXOja6e1FyVjzW2nDpz6puLgO91e54sKf+GWAcD2yI= 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=45.249.212.189 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.19.163.174]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4VP0zN61SJzNngf; Tue, 23 Apr 2024 19:59:44 +0800 (CST) Received: from dggpemm500002.china.huawei.com (unknown [7.185.36.229]) by mail.maildlp.com (Postfix) with ESMTPS id 38ED71403D4; Tue, 23 Apr 2024 20:02:15 +0800 (CST) Received: from [10.174.178.247] (10.174.178.247) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 23 Apr 2024 20:02:14 +0800 Subject: Re: [PATCH v7 07/16] ACPI: scan: switch to flags for acpi_scan_check_and_detach() To: Jonathan Cameron , 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 , , , References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-8-Jonathan.Cameron@huawei.com> From: Hanjun Guo Message-ID: Date: Tue, 23 Apr 2024 20:02:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240418135412.14730-8-Jonathan.Cameron@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500002.china.huawei.com (7.185.36.229) On 2024/4/18 21:54, 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 > > --- > 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); Reviewed-by: Hanjun Guo