Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966475AbdDSQkN (ORCPT ); Wed, 19 Apr 2017 12:40:13 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:38667 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966428AbdDSQkK (ORCPT ); Wed, 19 Apr 2017 12:40:10 -0400 Date: Thu, 20 Apr 2017 00:39:59 +0800 From: joeyli To: "Rafael J. Wysocki" Cc: Linux ACPI , LKML , Mika Westerberg , Andy Shevchenko Subject: Re: [PATCH 2/2] ACPI / scan: Avoid enumerating devices more than once Message-ID: <20170419163959.GB3576@linux-l9pv.suse> References: <20731969.imAyuWkf7P@aspire.rjw.lan> <2231844.zRx0dlJUx2@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2231844.zRx0dlJUx2@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: 1367 Lines: 40 On Mon, Apr 17, 2017 at 01:20:48AM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > acpi_bus_attach() does not check the visited flag for devices that > have been enumerated already and some of them may be enumerated > for multiple times as a result, because some callers of > acpi_bus_scan() don't check the visited flag either. > > For this reason, modify acpi_bus_attach() to check the visited flag > and avoid enumerating devices that have already been enumerated. > > Signed-off-by: Rafael J. Wysocki Reviewed-by: Joey Lee Thanka a lot! Joey Lee > --- > drivers/acpi/scan.c | 2 ++ > 1 file changed, 2 insertions(+) > > Index: linux-pm/drivers/acpi/scan.c > =================================================================== > --- linux-pm.orig/drivers/acpi/scan.c > +++ linux-pm/drivers/acpi/scan.c > @@ -1850,6 +1850,8 @@ static void acpi_bus_attach(struct acpi_ > device->flags.power_manageable = 0; > > device->flags.initialized = true; > + } else if (device->flags.visited) { > + goto ok; > } > > ret = acpi_scan_attach_handler(device); > > -- > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html