3 Jul 19:27
Re: [PATCH] [V2] powerpc: Xilinx: PS2: Added new XPS PS2 driver
From: Dmitry Torokhov <dmitry.torokhov <at> gmail.com>
Subject: Re: [PATCH] [V2] powerpc: Xilinx: PS2: Added new XPS PS2 driver
Newsgroups: gmane.linux.kernel.input, gmane.linux.ports.ppc64.devel
Date: 2008-07-03 17:27:00 GMT
Subject: Re: [PATCH] [V2] powerpc: Xilinx: PS2: Added new XPS PS2 driver
Newsgroups: gmane.linux.kernel.input, gmane.linux.ports.ppc64.devel
Date: 2008-07-03 17:27:00 GMT
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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
RSS Feed