All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alex Chiang <achiang@hp.com>
Subject: [PATCH] set dock_station->flags to zero during dock_add
Date: Mon, 1 Feb 2010 11:30:44 -0500	[thread overview]
Message-ID: <20100201163043.GA3240@think> (raw)

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);

             reply	other threads:[~2010-02-01 16:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01 16:30 Chris Mason [this message]
2010-02-01 17:35 ` [PATCH] set dock_station->flags to zero during dock_add 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

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=20100201163043.GA3240@think \
    --to=chris.mason@oracle.com \
    --cc=achiang@hp.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.