From owner-freebsd-stable@freebsd.org Wed Jul 22 17:00:09 2015 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE65E9A7B3D for ; Wed, 22 Jul 2015 17:00:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA02B14AB for ; Wed, 22 Jul 2015 17:00:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (75-48-78-19.lightspeed.cncrca.sbcglobal.net [75.48.78.19]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D3498B9BA; Wed, 22 Jul 2015 13:00:08 -0400 (EDT) From: John Baldwin To: Kevin Oberman Cc: Joseph Mingrone , "Brandon J. Wandersee" , Adrian Chadd , FreeBSD-STABLE Mailing List Subject: Re: suspend/resume regression Date: Tue, 21 Jul 2015 15:56:48 -0700 Message-ID: <12509399.h3RdpFfE1l@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.1-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <86oak289hv.fsf@gly.ftfl.ca> <86oaj9dnbo.fsf@gly.ftfl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 22 Jul 2015 13:00:08 -0400 (EDT) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 17:00:10 -0000 On Saturday, July 18, 2015 10:22:33 PM Kevin Oberman wrote: > I just confirmed that my system resumes on HEAD of July 16 but fails on > 10.2-BETA2. So the problem limited to 10. I'm guessing that some other > change made to pci that has not been MFCed is the cause, but it is only > causing a problem on some hardware. I have seen no reports about systems > other than Lenovo systems. So my x220 does fail with a USB disk on 10, but I also get a weird behavior where it seems to wake up (disk lights up) and then goes back to sleep and never resumes again. I'm not sure if this is due to using a USB disk or not. I get the same result when I disable power management during suspend which was reported to fix other laptops IIRC. Please try this: Index: sys/dev/acpica/acpi.c =================================================================== --- sys/dev/acpica/acpi.c (revision 285761) +++ sys/dev/acpica/acpi.c (working copy) @@ -691,7 +691,7 @@ static void acpi_set_power_children(device_t dev, int state) { - device_t child, parent; + device_t child; device_t *devlist; struct pci_devinfo *dinfo; int dstate, i, numdevs; @@ -703,13 +703,12 @@ * Retrieve and set D-state for the sleep state if _SxD is present. * Skip children who aren't attached since they are handled separately. */ - parent = device_get_parent(dev); for (i = 0; i < numdevs; i++) { child = devlist[i]; dinfo = device_get_ivars(child); dstate = state; if (device_is_attached(child) && - acpi_device_pwr_for_sleep(parent, dev, &dstate) == 0) + acpi_device_pwr_for_sleep(dev, child, &dstate) == 0) acpi_set_powerstate(child, dstate); } free(devlist, M_TEMP); Index: sys/dev/pci/pci.c =================================================================== --- sys/dev/pci/pci.c (revision 285761) +++ sys/dev/pci/pci.c (working copy) @@ -3671,7 +3671,7 @@ child = devlist[i]; dstate = state; if (device_is_attached(child) && - PCIB_POWER_FOR_SLEEP(pcib, dev, &dstate) == 0) + PCIB_POWER_FOR_SLEEP(pcib, child, &dstate) == 0) pci_set_powerstate(child, dstate); } } Index: . =================================================================== --- . (revision 285761) +++ . (working copy) Property changes on: . ___________________________________________________________________ Modified: svn:mergeinfo Merged /head:r274386,274397 -- John Baldwin