From mboxrd@z Thu Jan 1 00:00:00 1970 From: Holger Macht Subject: Re: [PATCH] ACPI: Set flag DOCK_UNDOCKING when triggered via sysfs Date: Wed, 12 Mar 2008 11:40:35 +0100 Message-ID: <20080312104034.GA4371@homac> References: <20080312000727.GB4089@homac> <20080311223522.3326b6ee.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail.suse.de ([195.135.220.2]:40664 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750788AbYCLKjF (ORCPT ); Wed, 12 Mar 2008 06:39:05 -0400 Content-Disposition: inline In-Reply-To: <20080311223522.3326b6ee.akpm@linux-foundation.org> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Andrew Morton Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Kristen Carlson Accardi , Len Brown , stable@kernel.org On Di 11. M=E4r - 22:35:22, Andrew Morton wrote: > On Wed, 12 Mar 2008 01:07:27 +0100 Holger Macht wrot= e: >=20 > > begin_undock() is only called when triggered via a acpi notify hand= ler > > (pressing the undock button on the dock station), but complete_undo= ck() is > > always called after the eject. So if a undock is triggered through = a sysfs > > write, the flag DOCK_UNDOCKING has to be set for the dock station, > > too. Otherwise this will freeze the system hard. > >=20 >=20 > We prefer not to make systems freeze hard. >=20 > > --- > >=20 > > diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c > > index 307cef6..fa44fb9 100644 > > --- a/drivers/acpi/dock.c > > +++ b/drivers/acpi/dock.c > > @@ -710,6 +710,7 @@ static ssize_t write_undock(struct device *dev,= struct device_attribute *attr, > > if (!count) > > return -EINVAL; > > =20 > > + begin_undock(dock_station); > > ret =3D handle_eject_request(dock_station, ACPI_NOTIFY_EJECT_REQU= EST); > > return ret ? ret: count; > > } >=20 > I assume that this is needed in 2.6.24.x as well? I tested this, and no, I weren't able to reproduce on 2.6.24. Moreover, it seems that the freeze is related to some libata issue beca= use it only freezes when a drive is in the dock station. Nevertheless, I think the patch is correct. Maybe there's a race involv= ed somewhere I'm not aware of. I really like to wait for Kristen to commen= t before pushing it into more trees. Thanks, Holger -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html