public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] set dock_station->flags to zero during dock_add
@ 2010-02-01 16:30 Chris Mason
  2010-02-01 17:35 ` Alex Chiang
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Mason @ 2010-02-01 16:30 UTC (permalink / raw)
  To: linux-acpi, linux-kernel, Alex Chiang

Before fe06fba292af5ed5c1c6ad9af3a9ef68da7a5088 the dock_station struct
was allocated and zero filled by kzalloc.  Now it is allocated by
platform_device_register_data(), apparently via a kmemdup of a variable
on the stack?

Now we no longer init dock_station->flags to zero, and my x60 laptop was
lucky enough to always have DOCK_DOCKING set.  So, I always saw -EBUSY
when I tried to undock.

With the patch below, I can dock and undock properly again.  I double
checked that dock_station->flags was the only field that we were not
setting up.

This was just brute force guessing, I have no idea what this code does.

Signed-off-by: Chris Mason <chris.mason@oracle.com>

diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index bbc2c13..0a449ad 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -944,6 +945,7 @@ static int dock_add(acpi_handle handle)
 	dock_station->handle = handle;
 	dock_station->dock_device = dd;
 	dock_station->last_dock_time = jiffies - HZ;
+	dock_station->flags = 0;
 
 	mutex_init(&dock_station->hp_lock);
 	spin_lock_init(&dock_station->dd_lock);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-02-13  9:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-01 16:30 [PATCH] set dock_station->flags to zero during dock_add Chris Mason
2010-02-01 17:35 ` Alex Chiang
2010-02-01 17:45   ` Chris Mason
2010-02-01 17:57     ` Alex Chiang
2010-02-12 20:45   ` Chris Mason
2010-02-13  9:34   ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox