Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1391404rbb; Mon, 26 Feb 2024 07:54:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX71GVet0oDwkDvwEQgkU3z2Ih+qv+qUw2YZ6BN/FidgzD+ZzrejA4Zgjl9+BQiJBhFEsTLtfcEFnATdmjqPHCAa9uyYapMR88BhVD78w== X-Google-Smtp-Source: AGHT+IHYMxeYAE3t22MSVP11agNIL8cBonzK37C2DVK7siuoZPZqgfqTpwnWKpz6jEgbVccRFS2G X-Received: by 2002:a17:906:b847:b0:a42:e2ef:2414 with SMTP id ga7-20020a170906b84700b00a42e2ef2414mr4756381ejb.35.1708962898251; Mon, 26 Feb 2024 07:54:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708962898; cv=pass; d=google.com; s=arc-20160816; b=Rv2hDmpvSPqYOgNCIem94FqzTJstzvYdGAk7ZTABWHS0NCHg5U+KCW//LmMW8fSCty NVA7BKJgRhAArJ4e5ysO47RvJBnd7k2c+8m2CEmZ9kyHo27FeDNsrr3FaKez2kXG9EGM 7/luXduFi+BlLdQlk2S2o5BW8k4I2MGQEKeeXtD8ePbIeZAH5YKM+Lomv5LFSLyhkcrm rG1sAiMAt4qtN8sBdGzyseWiASsCnlaHv6QYJ/5K7sBZ505r+MDZSr/Bdvzx6JN7CKWy NepsNodBp8Cy8VDWXIsgMkyv6KHY9d2Rs9SfOwbQWVbueH5Eg/6L4WK33B/3u4vMCxx0 LlKQ== 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; bh=8hG+R8NZ6weR+cw6Mtpt9mJbOI6Ku9oH9aEPOnZNcL4=; fh=fEclwDKK0yrYGWIRFvsIQgPJDllfaYbF3v3V6+SwbuQ=; b=tQ8XC5sLGZ/PO8ZJiQa5S2Ni0P/WUG6dwCpORjtoVNAEDcbEYAkibLG+S2ifcdFq8j XfUFxHjK1kD1Oyogg2Kcdfhmw4rfS436R4SmQ3Q/om2XAFvr1pDC5ZIsLJ/qQon0bnvz AC5tvSEf6Cg6tOIn7vE4lWeyf56Gow3DseY7BsrNiMq0Ky7yIm2jQxEUM3JmnnvKJNLV biNdRzZoMWGXTLeHGZ596G7x8qcWONt4Tgldw+ySfgPkSe1x1Alj5Sn8MJvbztWUG/bn bPqHalHuW7YSrs6xi2egdIShM4Kv8Z5PZ35i+NPsPM+c4gp1KjpANE+lOzy/7GMjuJoa dAEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-81849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81849-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g16-20020a170906395000b00a3e58786ab0si2128802eje.495.2024.02.26.07.54.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 07:54:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-81849-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81849-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D44621F2C257 for ; Mon, 26 Feb 2024 15:54:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B69EA12A14A; Mon, 26 Feb 2024 15:54:41 +0000 (UTC) Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C27721292ED; Mon, 26 Feb 2024 15:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708962881; cv=none; b=RITeDFitdbeRbz3ZHYVMMp0UBCd6SwQHB/QsO/4rmzq8fKxMxe0lOT4+EJq8W5/5nouRa8YISeullplT1Z5kGj9G+DtpUF9yk7nu8Go3j8v4GRliRc76hts5OZaLhLBvOeJoQqMXlttccnjc0wk3PWgMKqFr5e7bRQFpmZ6Sk0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708962881; c=relaxed/simple; bh=GIXw4CMiWjn027axPINZjhYRbMIP/5BA//VYtZABjv8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=s+dSD1fz6csBBOEUnJErrCs5cDBjh9WMO2BFyGgIC+jBPGEuQDrTynbsqcUPTwZFiUwLKHItxkom90gJIGpuHEVzRBmTj/peYbSSZ7PbZ1cGxVa+1QRIkn7pxpmd8Mk1lQ/1IcFjX4t8REhzVhGt51/7K4jrOwDrGCegkl49PEM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.160.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-21fbe64ef0cso172921fac.1; Mon, 26 Feb 2024 07:54:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708962879; x=1709567679; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8hG+R8NZ6weR+cw6Mtpt9mJbOI6Ku9oH9aEPOnZNcL4=; b=GDi9peFSdfaxXypWsHXYi1JlyTy7fJ0vafzaF9xRBRj/iJcp3wd0cn7OV0fnwzr61q QHxIGPSP3ZTIyrkbAcjoE39O9Icwd6yEaGc/bkdggkYyHp4ONt4wefMFBsvV4y6k7v39 F59OaAIZQlmcMq4umg3OGJ9t8hnmXSTwYZKhr/qOBuLQzKrNDt5etOpibg/QpicQbSD1 Quw2N81b+1dg7HjHAOoEHcSE/ku8b5UzwkSOWefx7uTA/Xz746SfqsSYguo8KcN1NNkV hevzsSuEOZadPQNmPYbXlqUDFb/t36VQG3MQzO9dYrp9kFvZvYugAQ6QjOzz5GJYi5/p 6uCw== X-Forwarded-Encrypted: i=1; AJvYcCWhrzbqCVBcPx8l0UZsRhzEWbgQ4QP0y10P1vD6er63mWbkshf2rHSF+IaR1Lm58ibj97AVGsUQHBb1C2syJ7L4kA67MDZF+geuwjufgAyYFdNRsWJWxOfz1HGrTIrtmkniCozvyqOvVQ== X-Gm-Message-State: AOJu0Yz2SKHPsiqDsCABVgfwIzhsfcr2va2F6NkjmCzpCbLg9Yzfrfnv r5Yld6tycuANGy8+dbrE7ZOq6eznagDQELemWM5qrii4yAOrbDnqcdlHwSTnKAeNpH5G/YY49PN qI9Dq6AX76Eod/WiaqAMj3yX9dyAJDDUZHwk= X-Received: by 2002:a05:6820:2c8e:b0:5a0:4d78:975d with SMTP id dx14-20020a0568202c8e00b005a04d78975dmr6637712oob.1.1708962878870; Mon, 26 Feb 2024 07:54:38 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <4562925.LvFx2qVVIh@kreacher> <2939512.e9J7NaK4W3@kreacher> <20240222182834.00000b02@Huawei.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Mon, 26 Feb 2024 16:54:27 +0100 Message-ID: Subject: Re: [PATCH v1 3/4] ACPI: scan: Rework Device Check and Bus Check notification handling To: Jonathan Cameron Cc: "Rafael J. Wysocki" , Linux ACPI , LKML , Mika Westerberg , "Russell King (Oracle)" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 26, 2024 at 4:37=E2=80=AFPM Rafael J. Wysocki wrote: > > On Thu, Feb 22, 2024 at 7:28=E2=80=AFPM Jonathan Cameron > wrote: > > > > On Wed, 21 Feb 2024 21:02:33 +0100 > > "Rafael J. Wysocki" wrote: [...] > > > +bool acpi_device_is_enabled(const struct acpi_device *adev) > > > +{ > > > + return acpi_device_is_present(adev) && adev->status.enabled; > > > > This resolves as (present or functional) && enabled. > > > > By my reading you are not allowed functional && enabled, but not presen= t. > > Line one of the description says. > > > > "If bit [0] is cleared, then bit 1 must also be cleared (in other words= , a device that is not present cannot be enabled)." > > > > I don't much care about that though (I think we discussed this > > in Russel's earlier series) > > Functional and enabled, but not present would go against the spec. I > guess the kernel could protect itself against this, but then whatever > it chooses to do has not been defined anyway. > > The spec doesn't actually say what the OSPM is supposed to do when it > sees that combination of bits. I'm inclined to clarify it to say "if > bit [0] is cleared, bit [1] has no defined meaning and it should be > ignored by the OSPM". To be consistent with this interpretation, > acpi_device_is_enabled() should return "(present and enabled) or > functional". > > I'll change it along these lines. Actually, I don't think that the "functional" bit has any bearing on this. It only means that the OSPM should continue the enumeration below the device regardless of the present bit value. In the acpi_processor_add() case it is clearly irrelevant. acpi_scan_bus_check() needs to walk the entire subtree below the target device anyway. As for acpi_scan_device_check(), IMO it's better to make it walk the subtree below the device if it is present, but not enabled, for backwards compatibility.