From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 11:05:46 2014 Return-Path: Delivered-To: svn-src-head@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 6651D763; Wed, 19 Nov 2014 11:05:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a: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 53166627; Wed, 19 Nov 2014 11:05:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJB5kOS060273; Wed, 19 Nov 2014 11:05:46 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJB5kDw060272; Wed, 19 Nov 2014 11:05:46 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411191105.sAJB5kDw060272@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Wed, 19 Nov 2014 11:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274707 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 11:05:46 -0000 Author: dchagin Date: Wed Nov 19 11:05:45 2014 New Revision: 274707 URL: https://svnweb.freebsd.org/changeset/base/274707 Log: Revert r274635 as it's completely wrong. The parent of a pci dev device is a pciX device which do not implement the PCIB_POWER_FOR_SLEEP method from pcib_if.m. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Nov 19 10:25:08 2014 (r274706) +++ head/sys/dev/pci/pci.c Wed Nov 19 11:05:45 2014 (r274707) @@ -3637,6 +3637,7 @@ static void pci_set_power_child(device_t dev, device_t child, int state) { struct pci_devinfo *dinfo; + device_t pcib; int dstate; /* @@ -3646,10 +3647,11 @@ pci_set_power_child(device_t dev, device * device power. Skip children who aren't attached since they * are handled separately. */ + pcib = device_get_parent(dev); dinfo = device_get_ivars(child); dstate = state; if (device_is_attached(child) && - PCIB_POWER_FOR_SLEEP(dev, child, &dstate) == 0) + PCIB_POWER_FOR_SLEEP(pcib, child, &dstate) == 0) pci_set_powerstate(child, dstate); }