mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Ryan Arnold <rsa@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, linuxppc64-dev@lists.linuxppc.org,
	paulus@samba.org, benh@kernel.crashing.org
Subject: Re: [PATCH] interrupt driven hvc_console as vio device
Date: Tue, 24 Aug 2004 21:49:50 -0700	[thread overview]
Message-ID: <20040824214950.5d9043a3.akpm@osdl.org> (raw)
In-Reply-To: <1093394937.3402.83.camel@localhost>

Ryan Arnold <rsa@us.ibm.com> wrote:
>
>  static int hvc_write_room(struct tty_struct *tty)
>   {
>   	struct hvc_struct *hp = tty->driver_data;
>  +	unsigned long flags;
>  +	int retval;
>   
>  -	return N_OUTBUF - hp->n_outbuf;
>  +	spin_lock_irqsave(&hp->lock, flags);
>  +	retval = N_OUTBUF - hp->n_outbuf;
>  +	spin_unlock_irqrestore(&hp->lock, flags);
>  +	return retval;
>   }
>   
>   static int hvc_chars_in_buffer(struct tty_struct *tty)
>   {
>   	struct hvc_struct *hp = tty->driver_data;
>  +	unsigned long flags;
>  +	int retval;
>   
>  -	return hp->n_outbuf;
>  +	spin_lock_irqsave(&hp->lock, flags);
>  +	retval = hp->n_outbuf;
>  +	spin_unlock_irqrestore(&hp->lock, flags);
>  +	return retval;
>   }

The new locking in these functions doesn't really do anything, apart from
adding memory barriers.  If that's what you really want, I suggest you
simply add (commented) memory barriers.


  parent reply	other threads:[~2004-08-25  4:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-25  0:48 Ryan Arnold
2004-08-25  4:46 ` Andrew Morton
2004-08-25  5:09   ` Ryan Arnold
2004-08-25  4:49 ` Andrew Morton [this message]
2004-08-25  5:12   ` Ryan Arnold
2004-08-25  4:59 ` Paul Mackerras

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=20040824214950.5d9043a3.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@lists.linuxppc.org \
    --cc=paulus@samba.org \
    --cc=rsa@us.ibm.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

all inboxes | Powered by JetHome®