From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754529AbYEaK3V (ORCPT ); Sat, 31 May 2008 06:29:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751885AbYEaK3M (ORCPT ); Sat, 31 May 2008 06:29:12 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:36771 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751707AbYEaK3K (ORCPT ); Sat, 31 May 2008 06:29:10 -0400 Message-ID: <48412835.2010801@web.de> Date: Sat, 31 May 2008 12:28:05 +0200 From: =?UTF-8?B?UGFzY2FsIEJyw7xja25lcg==?= User-Agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080420) MIME-Version: 1.0 To: linux-kernel@vger.kernel.org CC: Matthew Garrett Subject: Re: [PATCH] libata: Handle bay devices in dock stations Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX18y32o0eWRB259wGm9Lg26p9Di2uEt+rkltqLQ/ 6X5xGCZfiUU/qArl5wWAaVduHDwoV/inKdanfljTH5oatXU9HN Gt85/+9yc= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm using a ThinkPad X31 with the Ultrabase X3, containing an Ultrabay, which sends events on removal or undocking thanks to the "dock" and "bay" modules. Unfortunately, hibernate/suspend to disk doesn't work with any patch to libata seen here (i'm using the ata_piix module), if the cd drive in my Ultrabay was removed before suspending. Ejecting and reinserting during the running system works great, when the bay module is loaded before ata_piix (via initrd) or with "libata.noacpi=1" boot parameter. For these tasks i'm using the example scripts listed on thinkwiki [1] and udev. For example, removing looks like the following in syslog (on 2.6.24): ACPI: \_SB_.PCI0.IDE0.SCND.MSTR: Bay event ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 ata2.00: waking up from sleep ata2: soft resetting link ata2.00: configured for UDMA/33 ata2: EH complete ata2.00: disabled ACPI: \_SB_.PCI0.IDE0.SCND.MSTR: Ejecting device After this, undocking works by pressing the "undock" button on my Ultrabase: ACPI: \_SB_.GDCK - undocking Reinserting the ThinkPad into the docking station just sends a dock event: ACPI: \_SB_.GDCK - docking So i need to trigger the cd device recognition via udev (and the switch on the Ultrabay): ACPI: \_SB_.PCI0.IDE0.SCND.MSTR: Bay event ata2: soft resetting link ata2.00: ATAPI: MATSHITADVD-ROM SR-8177, NB21, max UDMA/33 ata2.00: configured for UDMA/33 ata2: EH complete scsi 1:0:0:0: CD-ROM MATSHITA DVD-ROM SR-8177 NB21 PQ: 0 ANSI: 5 sr0: scsi3-mmc drive: 24x/24x cd/rw xa/form2 cdda tray sr 1:0:0:0: Attached scsi CD-ROM sr0 sr 1:0:0:0: Attached scsi generic sg1 type 5 So ejecting and reinserting of the bay devices and docking/undocking works, as long as - to come to my problem - i don't try to hibernate. Hibernating (tried plain echo disk > /sys/power/state, too) just freezes the entire system without leaving a message anywhere. When using tuxonice/suspend2, it hangs at "Doing atomic copy". I discovered a new strange behaviour with recent 2.6.26 kernel and your attached patch, too: If i remove the Ultrabay device via script, leaving the device plugged in, it is discovered and spinning up again automatically on hibernation (which works in this case, because the device is present). Seems like the device isn't completely removed in the driver (/dev/* block device not present and hald not running) and on hibernation something tries to access the nonexistent device and locks up the system. I tried stable 2.6.24, 2.6.25 and plain 2.6.26, 2.6.26 from zen-sources git, 2.6.26 patched with the patches in this thread and in [2]. Hope this helps, Pascal [1] http://www.thinkwiki.org/wiki/How_to_hotswap_UltraBay_devices [2] http://lkml.org/lkml/2008/2/14/123