public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@ucw.cz>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: linux-kernel@vger.kernel.org, Vojtech Pavlik <vojtech@suse.cz>
Subject: Re: [PATCH 2.6] 1/3 Serio: claim serio early
Date: Mon, 25 Aug 2003 12:27:20 +0200	[thread overview]
Message-ID: <20030825102720.GA4369@ucw.cz> (raw)
In-Reply-To: <200308230131.50388.dtor_core@ameritech.net>

On Sat, Aug 23, 2003 at 01:31:50AM -0500, Dmitry Torokhov wrote:
> Hi, 
> 
> I think that serio_dev in serio_open should claim serio before calling 
> "open" function as it has already been decided that (in case of success)
> this serio belongs to that serio_dev. Otherwise it might try to find an
> owner on its own, like i8042 module that calls serio_interrupt which in 
> turn will do serio_rescan. From that point on 2 instances may start 
> fighting over the same serio.
> 
> What you think about the patch below?

Agreed.

> 
> Dmitry
> 
> diff -urN --exclude-from=/usr/src/exclude 2.6.0-test4/drivers/input/serio/serio.c linux-2.6.0-test4/drivers/input/serio/serio.c
> --- 2.6.0-test4/drivers/input/serio/serio.c	2003-08-22 21:53:29.000000000 -0500
> +++ linux-2.6.0-test4/drivers/input/serio/serio.c	2003-08-22 22:58:37.000000000 -0500
> @@ -204,9 +204,11 @@
>  /* called from serio_dev->connect/disconnect methods under serio_sem */
>  int serio_open(struct serio *serio, struct serio_dev *dev)
>  {
> -	if (serio->open(serio))
> -		return -1;
>  	serio->dev = dev;
> +	if (serio->open(serio)) {
> +		serio->dev = NULL;
> +		return -1;
> +	}
>  	return 0;
>  }
>  
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

      reply	other threads:[~2003-08-25 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-23  6:31 [PATCH 2.6] 1/3 Serio: claim serio early Dmitry Torokhov
2003-08-25 10:27 ` Vojtech Pavlik [this message]

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=20030825102720.GA4369@ucw.cz \
    --to=vojtech@ucw.cz \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /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