public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Pascal Brückner" <pascal.brueckner@inf.tu-dresden.de>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] libata: Handle bay devices in dock stations
Date: Sat, 31 May 2008 02:01:08 +0200	[thread overview]
Message-ID: <48409544.7080807@inf.tu-dresden.de> (raw)

tom@dbservic ... wrote:
> Will this patch or the other bay/dock related patches you send in the
> past days allow me to undock my laptop and still be able to
> suspend/resume without locking the laptop up? And without having to 
> run any userspace scripts?

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


             reply	other threads:[~2008-05-31  0:37 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-31  0:01 Pascal Brückner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-05-31 10:28 [PATCH] libata: Handle bay devices in dock stations Pascal Brückner
2008-05-28 14:38 Holger Macht
2008-05-28 14:39 ` Tejun Heo
2008-05-29  3:02 ` Andrew Morton
2008-05-29  3:08   ` Tejun Heo
2008-05-29 13:22 ` Matthew Garrett
2008-05-29 13:33   ` Holger Macht
2008-05-29 13:32     ` Matthew Garrett
2008-05-29 13:39       ` Holger Macht
2008-05-29 13:40         ` Matthew Garrett
2008-05-29 13:44   ` Tejun Heo
2008-05-29 14:02     ` Matthew Garrett
2008-05-29 14:14       ` Holger Macht
2008-05-29 14:35         ` Matthew Garrett
2008-05-29 14:37           ` Tejun Heo
2008-05-29 14:49             ` Matthew Garrett
2008-05-29 16:32               ` Holger Macht
2008-05-29 16:40                 ` Tejun Heo
2008-06-01 16:05                   ` Holger Macht
2008-05-29 16:46                 ` Holger Macht
2008-05-29 17:51                 ` Henrique de Moraes Holschuh
2008-05-30 11:07 ` tom
2008-06-01 16:06   ` Holger Macht
2008-06-03 18:07 ` Jeff Garzik
2008-06-03 18:13   ` Matthew Garrett
2008-06-03 18:23     ` Holger Macht
2008-06-09  1:44     ` Tejun Heo
2008-06-09  1:48       ` Matthew Garrett
2008-06-09  4:56         ` Tejun Heo
2008-06-03 18:27   ` Holger Macht
2008-06-03 18:29     ` Matthew Garrett
2008-06-03 18:54       ` Jeff Garzik
2008-06-04 10:29     ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48409544.7080807@inf.tu-dresden.de \
    --to=pascal.brueckner@inf.tu-dresden.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox