From owner-freebsd-bugs@FreeBSD.ORG Wed Sep 29 22:40:04 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A87F1065693 for ; Wed, 29 Sep 2010 22:40: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 3DA118FC1D for ; Wed, 29 Sep 2010 22:40:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8TMe4DS001176 for ; Wed, 29 Sep 2010 22:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o8TMe4Ui001174; Wed, 29 Sep 2010 22:40:04 GMT (envelope-from gnats) Resent-Date: Wed, 29 Sep 2010 22:40:04 GMT Resent-Message-Id: <201009292240.o8TMe4Ui001174@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, Bernd Heller Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91B871065674 for ; Wed, 29 Sep 2010 22:39:30 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 80D188FC14 for ; Wed, 29 Sep 2010 22:39:30 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o8TMdUkH078628 for ; Wed, 29 Sep 2010 22:39:30 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o8TMdUKk078616; Wed, 29 Sep 2010 22:39:30 GMT (envelope-from nobody) Message-Id: <201009292239.o8TMdUKk078616@www.freebsd.org> Date: Wed, 29 Sep 2010 22:39:30 GMT From: Bernd Heller To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/151091: JMicron JMB363 unusable after S3 suspend/resume 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: Wed, 29 Sep 2010 22:40:04 -0000 >Number: 151091 >Category: kern >Synopsis: JMicron JMB363 unusable after S3 suspend/resume >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Sep 29 22:40:03 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Bernd Heller >Release: 8.1 >Organization: >Environment: FreeBSD helios.home.lan 8.1-RELEASE FreeBSD 8.1-RELEASE #21: Thu Sep 30 00:18:01 CEST 2010 root@helios.home.lan:/usr/obj/usr/src/sys/HELIOS amd64 >Description: I have experienced this using the normal ata drivers, and the new ATA/AHCI/CAM integration. I have done all tests only with AHCI/CAM from now on. I have been trying to get my JMB363 SATA controller to be usable after putting the machine into S3 with acpiconf. The result in the logs after resume looks like this: kernel: ahci0: AHCI controller reset failure Comparing the PCI registers before and after shows that not the entire state is restored. So fixing the problem seemed easy enough: save and restore the registers in the driver *_suspend/*_restore functions. The main problem however is, that those are called AFTER the AHCI driver has executed the reset. The call chain seems to go like this: pci_resume() ahci_resume() ahci_ctrl_reset() ata_jmicron_resume() I only got a first rudimentary hack to work by modifying ahci_resume() such, that it first calls bus_generic_resume() and then does the reset(). I have absolutely no idea if that has any other side effects. Someone who knows these systems in depth should have a look though. >How-To-Repeat: Use a system with a JMB363 controller. Put the system to sleep with "acpiconf -s 3". On resume try to access the disks: no go. >Fix: I have a hack that seems to lead in the right direction, but no patch quality code yet. >Release-Note: >Audit-Trail: >Unformatted: