From patchwork Wed Jul 10 22:45:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 2825935 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8905B9F756 for ; Wed, 10 Jul 2013 22:35:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 774552011D for ; Wed, 10 Jul 2013 22:35:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 778C820136 for ; Wed, 10 Jul 2013 22:35:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754528Ab3GJWfu (ORCPT ); Wed, 10 Jul 2013 18:35:50 -0400 Received: from hydra.sisk.pl ([212.160.235.94]:37389 "EHLO hydra.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754415Ab3GJWft (ORCPT ); Wed, 10 Jul 2013 18:35:49 -0400 Received: from vostro.rjw.lan (afeo110.neoplus.adsl.tpnet.pl [95.49.118.110]) by hydra.sisk.pl (Postfix) with ESMTPSA id 1227AE3DC5; Thu, 11 Jul 2013 00:31:38 +0200 (CEST) From: "Rafael J. Wysocki" To: Toshi Kani Cc: ACPI Devel Maling List , LKML , Bjorn Helgaas , Yinghai Lu Subject: Re: [PATCH] ACPI / scan: Always call acpi_bus_scan() for bus check notifications Date: Thu, 11 Jul 2013 00:45:36 +0200 Message-ID: <6189099.QeK4PsCIFb@vostro.rjw.lan> User-Agent: KMail/4.9.5 (Linux/3.10.0+; KDE/4.9.5; x86_64; ; ) In-Reply-To: <19368029.jaCH7i2zvY@vostro.rjw.lan> References: <2230821.QbNohsyO0O@vostro.rjw.lan> <1373398362.24916.4.camel@misato.fc.hp.com> <19368029.jaCH7i2zvY@vostro.rjw.lan> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wednesday, July 10, 2013 02:11:05 AM Rafael J. Wysocki wrote: > On Tuesday, July 09, 2013 01:32:42 PM Toshi Kani wrote: > > On Mon, 2013-07-08 at 02:10 +0200, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki > > > > > > An ACPI_NOTIFY_BUS_CHECK notification means that we should scan the > > > entire namespace starting from the given handle even if the device > > > represented by that handle is present (other devices below it may > > > just have been added). > > > > > > For this reason, modify acpi_scan_bus_device_check() to always run > > > acpi_bus_scan() if the notification being handled is of type > > > ACPI_NOTIFY_BUS_CHECK. > > > > > > Signed-off-by: Rafael J. Wysocki > > > Cc: 3.10+ > > > > Acked-by: Toshi Kani > > > > But, I think we need the additional patch below. > > Yes, I think you're right. That said I'd prefer to put the check into acpi_bus_device_attach() like in the appended patch. Thanks, Rafael Acked-by: Toshi Kani --- From: Rafael J. Wysocki Subject: ACPI / scan: Do not try to attach scan handlers to devices having them In acpi_bus_device_attach(), if there is an ACPI device object for the given handle and that device object has a scan handler attached to it already, there's nothing more to do for that handle and the function should just return success immediately. Make that happen. Reported-by: Toshi Kani Signed-off-by: Rafael J. Wysocki --- drivers/acpi/scan.c | 3 +++ 1 file changed, 3 insertions(+) -- 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 Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -1984,6 +1984,9 @@ static acpi_status acpi_bus_device_attac if (acpi_bus_get_device(handle, &device)) return AE_CTRL_DEPTH; + if (device->handler) + return AE_OK; + ret = acpi_scan_attach_handler(device); if (ret) return ret > 0 ? AE_OK : AE_CTRL_DEPTH;