From: "Rafael J. Wysocki" Subject: Re: [PATCH v7 1/2] ACPI / bus: Introduce a list of ids for "always present" devices Date: Fri, 21 Apr 2017 12:40:35 +0200 Message-ID: <2704999.lztfqqMbc1@aspire.rjw.lan> References: <20170419120408.25037-1-hdegoede@redhat.com> <1789483.xWIoVTSXvK@aspire.rjw.lan> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: Sender: linux-acpi-owner@vger.kernel.org To: Hans de Goede Cc: "Rafael J. Wysocki" , Hans de Goede , Jani Nikula , Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= , Len Brown , intel-gfx , Andy Shevchenko , Lukas Wunner , Robert Moore , ACPI Devel Maling List List-Id: intel-gfx@lists.freedesktop.org On Friday, April 21, 2017 12:42:31 PM Hans de Goede wrote: > HI, > [cut] > >>> And in that path, which I seem to have overlooked before, the > >>> acpi_set_device_status() call is too early for invoking > >>> acpi_device_always_present(adev), so the latter should be called > >>> directly from acpi_add_single_object() like > >>> > >>> acpi_init_device_object(device, handle, type, sta); > >>> if (acpi_device_always_present(adev)) > >>> acpi_set_device_status(adev, ACPI_STA_DEFAULT); > >> > >> That is not necessary, the place(s) where we care about status being > >> fixed-up for always-present devices, so that they get scanned / their > >> platform device initiated, is in acpi_bus_attach() which > >> already calls acpi_bus_get_status() and thus gets the > >> acpi_device_always_present() check applied before checking. > >> > >> For hotplugged devices there are acpi_scan_bus_check and > >> acpi_scan_device_check but those both also already call > >> acpi_bus_get_status() before checking adev->status. > > > > OK > > > > Which probably means that we don't need to initialize adev->status > > in acpi_init_device_object() to anything meaningful, do we? > > Right, I don't think that is necessary. But maybe it is necessary > for some special cases (e.g. power resources) ? For power resources _STA is defined differently at all and we don't even call acpi_add_single_object() for them. :-) Are there any other special cases in which that may matter? Thanks, Rafael