From owner-p4-projects@FreeBSD.ORG Sat Oct 11 20:04:04 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 452C389B; Sat, 11 Oct 2014 20:04:04 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05D58898 for ; Sat, 11 Oct 2014 20:04:04 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6714177 for ; Sat, 11 Oct 2014 20:04:03 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id s9BK43UL040131 for ; Sat, 11 Oct 2014 20:04:03 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id s9BK43U0040128 for perforce@freebsd.org; Sat, 11 Oct 2014 20:04:03 GMT (envelope-from jhb@freebsd.org) Date: Sat, 11 Oct 2014 20:04:03 GMT Message-Id: <201410112004.s9BK43U0040128@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 1201502 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Oct 2014 20:04:04 -0000 http://p4web.freebsd.org/@@1201502?ac=10 Change 1201502 by jhb@jhb_ralph on 2014/10/11 20:03:15 Add a PREBUS pass for drivers that need to attach before busses are probed. In particular, the ACPI embedded controller needs to be attached very early (e.g. on my Thinkpad). This means that nexus and acpi/legacy on x86 are now attached at the PREBUS pass. The system resource drivers are attached next followed by the EC. Affected files ... .. //depot/projects/multipass/sys/amd64/acpica/acpi_machdep.c#9 edit .. //depot/projects/multipass/sys/dev/acpica/acpi.c#15 edit .. //depot/projects/multipass/sys/dev/acpica/acpi_ec.c#9 edit .. //depot/projects/multipass/sys/dev/acpica/acpi_resource.c#7 edit .. //depot/projects/multipass/sys/i386/acpica/acpi_machdep.c#9 edit .. //depot/projects/multipass/sys/sys/bus.h#13 edit .. //depot/projects/multipass/sys/x86/x86/legacy.c#3 edit .. //depot/projects/multipass/sys/x86/x86/nexus.c#6 edit Differences ... ==== //depot/projects/multipass/sys/amd64/acpica/acpi_machdep.c#9 (text+ko) ==== @@ -382,4 +382,4 @@ static devclass_t nexus_devclass; EARLY_DRIVER_MODULE(nexus_acpi, root, nexus_acpi_driver, nexus_devclass, 0, 0, - BUS_PASS_BUS); + BUS_PASS_PREBUS); ==== //depot/projects/multipass/sys/dev/acpica/acpi.c#15 (text+ko) ==== @@ -230,7 +230,7 @@ static devclass_t acpi_devclass; EARLY_DRIVER_MODULE(acpi, nexus, acpi_driver, acpi_devclass, acpi_modevent, 0, - BUS_PASS_BUS); + BUS_PASS_PREBUS); MODULE_VERSION(acpi, 1); ACPI_SERIAL_DECL(acpi, "ACPI root bus"); ==== //depot/projects/multipass/sys/dev/acpica/acpi_ec.c#9 (text+ko) ==== @@ -261,7 +261,7 @@ static devclass_t acpi_ec_devclass; EARLY_DRIVER_MODULE(acpi_ec, acpi, acpi_ec_driver, acpi_ec_devclass, 0, 0, - BUS_PASS_SCHEDULER); + BUS_PASS_PREBUS + BUS_PASS_ORDER_MIDDLE); MODULE_DEPEND(acpi_ec, acpi, 1, 1, 1); /* @@ -292,7 +292,7 @@ } /* Create the child device with the given unit number. */ - child = BUS_ADD_CHILD(parent, 3, "acpi_ec", ecdt->Uid); + child = BUS_ADD_CHILD(parent, 0, "acpi_ec", ecdt->Uid); if (child == NULL) { printf("%s: can't add child\n", __func__); return; @@ -326,10 +326,6 @@ params->uid = ecdt->Uid; acpi_GetInteger(h, "_GLK", ¶ms->glk); acpi_set_private(child, params); - - /* Finish the attach process. */ - if (device_probe_and_attach(child) != 0) - device_delete_child(parent, child); } static int ==== //depot/projects/multipass/sys/dev/acpica/acpi_resource.c#7 (text+ko) ==== @@ -647,7 +647,7 @@ static devclass_t acpi_sysres_devclass; EARLY_DRIVER_MODULE(acpi_sysresource, acpi, acpi_sysres_driver, - acpi_sysres_devclass, 0, 0, BUS_PASS_RESOURCE - 1); + acpi_sysres_devclass, 0, 0, BUS_PASS_PREBUS); MODULE_DEPEND(acpi_sysresource, acpi, 1, 1, 1); static int ==== //depot/projects/multipass/sys/i386/acpica/acpi_machdep.c#9 (text+ko) ==== @@ -392,4 +392,4 @@ static devclass_t nexus_devclass; EARLY_DRIVER_MODULE(nexus_acpi, root, nexus_acpi_driver, nexus_devclass, 0, 0, - BUS_PASS_BUS); + BUS_PASS_PREBUS); ==== //depot/projects/multipass/sys/sys/bus.h#13 (text+ko) ==== @@ -564,12 +564,13 @@ * probed in earlier passes. */ #define BUS_PASS_ROOT 0 /* Used to attach root0. */ -#define BUS_PASS_BUS 10 /* Busses and bridges. */ -#define BUS_PASS_CPU 20 /* CPU devices. */ -#define BUS_PASS_RESOURCE 30 /* Resource discovery. */ -#define BUS_PASS_INTERRUPT 40 /* Interrupt controllers. */ -#define BUS_PASS_TIMER 50 /* Timers and clocks. */ -#define BUS_PASS_SCHEDULER 60 /* Start scheduler. */ +#define BUS_PASS_PREBUS 10 /* Prequisites for busses. */ +#define BUS_PASS_BUS 20 /* Busses and bridges. */ +#define BUS_PASS_CPU 30 /* CPU devices. */ +#define BUS_PASS_RESOURCE 40 /* Resource discovery. */ +#define BUS_PASS_INTERRUPT 50 /* Interrupt controllers. */ +#define BUS_PASS_TIMER 60 /* Timers and clocks. */ +#define BUS_PASS_SCHEDULER 70 /* Start scheduler. */ #define BUS_PASS_DEFAULT __INT_MAX /* Everything else. */ #define BUS_PASS_ORDER_FIRST 0 ==== //depot/projects/multipass/sys/x86/x86/legacy.c#3 (text+ko) ==== @@ -109,7 +109,7 @@ static devclass_t legacy_devclass; EARLY_DRIVER_MODULE(legacy, nexus, legacy_driver, legacy_devclass, 0, 0, - BUS_PASS_BUS); + BUS_PASS_PREBUS); static int legacy_probe(device_t dev) ==== //depot/projects/multipass/sys/x86/x86/nexus.c#6 (text+ko) ==== @@ -178,7 +178,7 @@ static devclass_t nexus_devclass; EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, - BUS_PASS_BUS); + BUS_PASS_PREBUS); static int nexus_probe(device_t dev)