From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: John Linn <john.linn@xilinx.com>
Cc: Sadanand <sadanan@xilinx.com>,
linuxppc-dev@ozlabs.org, linux-input@vger.kernel.org
Subject: Re: [PATCH] [V2] powerpc: Xilinx: PS2: Added new XPS PS2 driver
Date: Thu, 3 Jul 2008 13:27:00 -0400 [thread overview]
Message-ID: <20080703132305.ZZRA012@mailhub.coreip.homeip.net> (raw)
In-Reply-To: <20080703164235.37739A006B@mail196-wa4.bigfish.com>
Hi John,
On Thu, Jul 03, 2008 at 09:42:31AM -0700, John Linn wrote:
> +
> + /* Initialize the PS/2 interface */
> + mutex_lock(&drvdata->cfg_mutex);
> + if (xps2_initialize(drvdata)) {
> + mutex_unlock(&drvdata->cfg_mutex);
> + dev_err(dev, "Could not initialize device\n");
> + retval = -ENODEV;
> + goto failed3;
> + }
> + mutex_unlock(&drvdata->cfg_mutex);
The drvdata is allocated per-port and so both (there are 2 PS/2 ports,
right?) ports get their own copy of cfg_mutex. Since you are trying to
serialze access to resource shared by both ports it will not work.
The original driver-global mutex was appropriate (the only thing I
objected there was use of a counting semaphore instead of a mutex).
--
Dmitry
next prev parent reply other threads:[~2008-07-03 17:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-03 16:42 [PATCH] [V2] powerpc: Xilinx: PS2: Added new XPS PS2 driver John Linn
2008-07-03 17:27 ` Dmitry Torokhov [this message]
2008-07-03 17:42 ` Grant Likely
2008-07-03 17:59 ` John Linn
2008-07-03 17:37 ` Grant Likely
2008-07-03 19:31 ` John Linn
-- strict thread matches above, loose matches on Subject: below --
2008-06-30 15:38 John Linn
2008-06-30 17:55 ` Peter Korsgaard
2008-06-30 17:59 ` John Linn
2008-06-30 18:21 ` Dmitry Torokhov
2008-06-30 21:28 ` John Linn
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=20080703132305.ZZRA012@mailhub.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=john.linn@xilinx.com \
--cc=linux-input@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=sadanan@xilinx.com \
/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;
as well as URLs for NNTP newsgroup(s).