All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jan Dittmer <j.dittmer@portrix.net>
Cc: Greg KH <greg@kroah.com>, linux-kernel@vger.kernel.org
Subject: Re: Three drivers/i2c/ patches
Date: Sun, 13 Jul 2003 10:24:07 +0100	[thread overview]
Message-ID: <20030713102407.A24901@infradead.org> (raw)
In-Reply-To: <3F107F0F.40701@portrix.net>; from j.dittmer@portrix.net on Sat, Jul 12, 2003 at 11:35:11PM +0200

> diff -urN -X exclude linux-bk/drivers/i2c/i2c-elektor.c 2.5.75-bk1/drivers/i2c/i2c-elektor.c
> --- linux-bk/drivers/i2c/i2c-elektor.c	Sun Jun 15 14:04:13 2003
> +++ 2.5.75-bk1/drivers/i2c/i2c-elektor.c	Sat Jul 12 11:51:34 2003
> @@ -59,6 +59,8 @@
>    need to be rewriten - but for now just remove this for simpler reading */
>  
>  static wait_queue_head_t pcf_wait;
> +
> +spinlock_t pcf_pending_lock = SPIN_LOCK_UNLOCKED;
>  static int pcf_pending;
>  
>  /* ----- global defines -----------------------------------------------	*/
> @@ -120,12 +122,12 @@
>  	int timeout = 2;
>  
>  	if (irq > 0) {
> -		cli();
> +		spin_lock_irq(&pcf_pending_lock);
>  		if (pcf_pending == 0) {
>  			interruptible_sleep_on_timeout(&pcf_wait, timeout*HZ );
>  		} else
>  			pcf_pending = 0;
> -		sti();
> +		spin_unlock_irq(&pcf_pending_lock);

Sleeping with interrupts disabled and a spinlock held still isn't exactly
a good idea.  As is sleep_on..


  reply	other threads:[~2003-07-13  9:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-12 21:35 Three drivers/i2c/ patches Jan Dittmer
2003-07-13  9:24 ` Christoph Hellwig [this message]
2003-07-13 10:32   ` Jan Dittmer
2003-07-13 19:00 ` Greg KH

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=20030713102407.A24901@infradead.org \
    --to=hch@infradead.org \
    --cc=greg@kroah.com \
    --cc=j.dittmer@portrix.net \
    --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.