Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966409AbdDSQjQ (ORCPT ); Wed, 19 Apr 2017 12:39:16 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:56877 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966388AbdDSQjN (ORCPT ); Wed, 19 Apr 2017 12:39:13 -0400 Date: Thu, 20 Apr 2017 00:38:51 +0800 From: joeyli To: "Rafael J. Wysocki" Cc: Linux ACPI , LKML , Mika Westerberg , Andy Shevchenko Subject: Re: [PATCH 1/2] ACPI / scan: Apply default enumeration to devices with ACPI drivers Message-ID: <20170419163851.GA3576@linux-l9pv.suse> References: <20731969.imAyuWkf7P@aspire.rjw.lan> <7942620.ijDeSLx5PQ@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7942620.ijDeSLx5PQ@aspire.rjw.lan> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1654 Lines: 48 On Mon, Apr 17, 2017 at 01:19:50AM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > The current code in acpi_bus_attach() is inconsistent with respect > to device objects with ACPI drivers bound to them, as it allows > ACPI drivers to bind to device objects with existing "physical" > device companions, but it doesn't allow "physical" device objects > to be created for ACPI device objects with ACPI drivers bound to > them. Thus, in some cases, the outcome depends on the ordering > of events which is confusing at best. > > For this reason, modify acpi_bus_attach() to call > acpi_default_enumeration() for device objects with the > pnp.type.platform_id flag set regardless of whether or not > any ACPI drivers are bound to them. > > Signed-off-by: Rafael J. Wysocki I did my best to review the context of codes in this patchset. Reviewed-by: Joey Lee Thanka a lot! Joey Lee > --- > drivers/acpi/scan.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > Index: linux-pm/drivers/acpi/scan.c > =================================================================== > --- linux-pm.orig/drivers/acpi/scan.c > +++ linux-pm/drivers/acpi/scan.c > @@ -1866,10 +1866,10 @@ static void acpi_bus_attach(struct acpi_ > if (ret < 0) > return; > > - if (ret > 0 || !device->pnp.type.platform_id) > - acpi_device_set_enumerated(device); > - else > + if (device->pnp.type.platform_id) > acpi_default_enumeration(device); > + else > + acpi_device_set_enumerated(device); > > ok: > list_for_each_entry(child, &device->children, node) >