From patchwork Tue Jul 9 19:32:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toshi Kani X-Patchwork-Id: 2825430 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 61980C0AB2 for ; Tue, 9 Jul 2013 19:33:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6951C20143 for ; Tue, 9 Jul 2013 19:33:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6C1EB20151 for ; Tue, 9 Jul 2013 19:33:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752447Ab3GITdX (ORCPT ); Tue, 9 Jul 2013 15:33:23 -0400 Received: from g5t0009.atlanta.hp.com ([15.192.0.46]:28103 "EHLO g5t0009.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752396Ab3GITdW (ORCPT ); Tue, 9 Jul 2013 15:33:22 -0400 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g5t0009.atlanta.hp.com (Postfix) with ESMTP id 0D5EA30683; Tue, 9 Jul 2013 19:33:22 +0000 (UTC) Received: from [16.71.12.41] (misato.fc.hp.com [16.71.12.41]) by g5t0029.atlanta.hp.com (Postfix) with ESMTP id 941F720237; Tue, 9 Jul 2013 19:33:21 +0000 (UTC) Message-ID: <1373398362.24916.4.camel@misato.fc.hp.com> Subject: Re: [PATCH] ACPI / scan: Always call acpi_bus_scan() for bus check notifications From: Toshi Kani To: "Rafael J. Wysocki" Cc: ACPI Devel Maling List , LKML , Bjorn Helgaas , Yinghai Lu Date: Tue, 09 Jul 2013 13:32:42 -0600 In-Reply-To: <2230821.QbNohsyO0O@vostro.rjw.lan> References: <2230821.QbNohsyO0O@vostro.rjw.lan> X-Mailer: Evolution 3.6.4 (3.6.4-3.fc18) 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 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. Thanks, -Toshi struct acpi_scan_handler *handler; --- 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 ===== From: Toshi Kani Subject: [PATCH] ACPI: Do not call attach() if device is attached attach() of ACPI scan handlers does not expect to be called multiple times on a same device. Also, the attached handler may not be changed without calling its detach(). Change acpi_scan_attach_handler() not to call attach() when the given device is already attached. Signed-off-by: Toshi Kani --- drivers/acpi/scan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 20757e0..2b9e867 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1885,6 +1885,9 @@ static int acpi_scan_attach_handler(struct acpi_device *device) struct acpi_hardware_id *hwid; int ret = 0; + if (device->handler) + return 1; + list_for_each_entry(hwid, &device->pnp.ids, list) { const struct acpi_device_id *devid;