public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Platte <jplatte@naasa.net>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [2.6.30] Kernel bug with dock driver
Date: Mon, 15 Jun 2009 09:36:39 +0200	[thread overview]
Message-ID: <200906150936.41983.jplatte@naasa.net> (raw)
In-Reply-To: <20090615020226.GA30720@khazad-dum.debian.net>

Am Monday, 15. June 2009 schrieb Henrique de Moraes Holschuh:
> Do it in single user mode with udev helpers *killed*, but just release

Today I tried to reproduce the bug in runlevel 2 (Debian based system) without 
success, even after a suspend to disk. In the past this was one method to 
trigger bugs with the bay.

> the lever, _don't_ pull the drive off the bay, unless you do verify that
> the bay LED went off.
>
> ***NEVER*** remove an Ultrabay device with the Ultrabay LED still lit,
> especially if it is a PATA device.

I did this accidentally some times before and the bay is still working. But 
I'll try to not to do it again :)

> If the bug cannot be reproduced in that condition, it is happening
> because userspace is trapping the lever release event (as it should),
> and doing something the kernel doesn't like with it (which is a bug
> in the kernel in any case).  That might help you track down a better
> way to reproduce the issue.

Userspace scripts are written by me (based on some information from 
thinkwiki). 
The udev rule looks like this:
ATTR{type}=="ata_bay", ATTR{docked}=="1", KERNEL=="dock.*", ACTION=="change", 
SUBSYSTEM=="platform", RUN+="/usr/local/sbin/ultrabay_open"

and ultrabay_open contains the following lines of shell code:
#!/bin/bash
ULTRABAY_SYSDIR='/sys/class/scsi_device/1:0:0:0/device'
shopt -s nullglob

if [ -d $ULTRABAY_SYSDIR ]; then
        sync
        echo 1 > $ULTRABAY_SYSDIR/delete
        logger "removed $ULTRABAY_SYSDIR"
fi
sync
# Turn off power to the UltraBay:
if [ -f /sys/devices/platform/dock.2/undock ]; then
        echo 1 > /sys/devices/platform/dock.2/undock
        logger "/sys/devices/platform/dock.2/undock"
else
        echo eject > /proc/acpi/ibm/bay
fi
# Tell the user we're OK
logger "/proc/acpi/ibm/beep"
echo 12 > /proc/acpi/ibm/beep

What I discovered today after modifying ultrabay_open was that in some cases 
the script is called again directly after inserting a drive to the bay. But 
only, if the execution of this script takes some more time (I added a sleep 2 
after the second sync to be able to see which command might trigger the bug).

So maybe yesterday this script was called twice and the kernel does not like 
to undock a device while it is in the process of being undocked? How should I 
modify the udev rule to prevent another execution each time a drive is 
inserted into the bay?

regards,
Jörg

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-06-15  7:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-14 19:00 [2.6.30] Kernel bug with dock driver Joerg Platte
2009-06-15  2:02 ` Henrique de Moraes Holschuh
2009-06-15  7:36   ` Joerg Platte [this message]
2009-06-15 20:29     ` Henrique de Moraes Holschuh
2009-06-16  9:24       ` Joerg Platte
2009-06-17 12:34         ` Henrique de Moraes Holschuh
2009-06-18 21:22           ` Joerg Platte
2009-06-18 22:10             ` Henrique de Moraes Holschuh
2009-06-17  7:13 ` Zhang Rui
2009-06-18 21:26   ` Joerg Platte
2009-06-18 22:12     ` Henrique de Moraes Holschuh

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=200906150936.41983.jplatte@naasa.net \
    --to=jplatte@naasa.net \
    --cc=hmh@hmh.eng.br \
    --cc=linux-acpi@vger.kernel.org \
    --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