From owner-freebsd-bugs@FreeBSD.ORG Fri Aug 24 01:20:04 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E13D106566B for ; Fri, 24 Aug 2012 01:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4F14D8FC18 for ; Fri, 24 Aug 2012 01:20:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7O1K4dU005077 for ; Fri, 24 Aug 2012 01:20:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7O1K4JV005075; Fri, 24 Aug 2012 01:20:04 GMT (envelope-from gnats) Resent-Date: Fri, 24 Aug 2012 01:20:04 GMT Resent-Message-Id: <201208240120.q7O1K4JV005075@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Brandon Gooch Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 959C1106566C for ; Fri, 24 Aug 2012 01:10:30 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 6834C8FC17 for ; Fri, 24 Aug 2012 01:10:30 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q7O1AUZn080160 for ; Fri, 24 Aug 2012 01:10:30 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q7O1AUHJ080159; Fri, 24 Aug 2012 01:10:30 GMT (envelope-from nobody) Message-Id: <201208240110.q7O1AUHJ080159@red.freebsd.org> Date: Fri, 24 Aug 2012 01:10:30 GMT From: Brandon Gooch To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/170949: [patch] Use DRIVER_MODULE_ORDERED and SI_ORDER_ANY in vga_isa.c to ensure driver ordering X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2012 01:20:04 -0000 >Number: 170949 >Category: kern >Synopsis: [patch] Use DRIVER_MODULE_ORDERED and SI_ORDER_ANY in vga_isa.c to ensure driver ordering >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Aug 24 01:20:03 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Brandon Gooch >Release: 10-CURRENT >Organization: >Environment: FreeBSD m6500.local 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r239550M: Wed Aug 22 00:35:46 CDT 2012 root@m6500.local:/usr/obj/usr/src/sys/DELL_M6500 amd64 >Description: The vgapm device driver must register after the NVIDIA device driver to allow for a functional ACPI suspend and resume cycle. This patch makes use of the DRIVER_MODULE_ORDERED macro and SI_ORDER_ANY constants to ensure the ordering of device driver registration. I have used this patch on a variety of systems with success. >How-To-Repeat: Use the NVIDIA driver (from ports or from vendor-supplied tarball) with power management enabled. Attempt an ACPI suspend and resume cycle. The video card is not reinitialized properly due to the device driver ordering of vgapm0 and nvidia0: pcib0 pnpinfo _HID=PNP0A03 _UID=0 at handle=\_SB_.PCI0 pci0 hostb0 pnpinfo vendor=0x8086 device=0xd132 subvendor=0x1028 subdevice=0x02ef class=0x060000 at slot=0 function=0 pcib1 pnpinfo vendor=0x8086 device=0xd138 subvendor=0x1028 subdevice=0x02ef class=0x060400 at slot=3 function=0 handle=\_SB_.PCI0.AGP1 pci1 vgapci0 pnpinfo vendor=0x10de device=0x061f subvendor=0x1028 subdevice=0x02ef class=0x030000 at slot=0 function=0 handle=\_SB_.PCI0.AGP1.VID_ vgapm0 nvidia0 >Fix: After applying the attached patch, rebuild the kernel (install, and reboot). After boot, notice the vgapm0 device driver is registered after the nvidia0 device driver: pcib0 pnpinfo _HID=PNP0A03 _UID=0 at handle=\_SB_.PCI0 pci0 hostb0 pnpinfo vendor=0x8086 device=0xd132 subvendor=0x1028 subdevice=0x02ef class=0x060000 at slot=0 function=0 pcib1 pnpinfo vendor=0x8086 device=0xd138 subvendor=0x1028 subdevice=0x02ef class=0x060400 at slot=3 function=0 handle=\_SB_.PCI0.AGP1 pci1 vgapci0 pnpinfo vendor=0x10de device=0x061f subvendor=0x1028 subdevice=0x02ef class=0x030000 at slot=0 function=0 handle=\_SB_.PCI0.AGP1.VID_ nvidia0 vgapm0 You should be able to perform and suspend/resume cycle successfully. Patch attached with submission follows: Index: sys/isa/vga_isa.c =================================================================== --- sys/isa/vga_isa.c (revision 239550) +++ sys/isa/vga_isa.c (working copy) @@ -379,4 +379,4 @@ 0 }; -DRIVER_MODULE(vgapm, vgapci, vgapm_driver, vgapm_devclass, 0, 0); +DRIVER_MODULE_ORDERED(vgapm, vgapci, vgapm_driver, vgapm_devclass, NULL, NULL, SI_ORDER_ANY); >Release-Note: >Audit-Trail: >Unformatted: