public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: acme@conectiva.com.br (Arnaldo Carvalho de Melo)
Cc: linux@advansys.com, alan@lxorguk.ukuu.org.uk (Alan Cox),
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] advansys.c: include missing restore_flags, etc
Date: Tue, 9 Jan 2001 10:02:14 +0000 (GMT)	[thread overview]
Message-ID: <200101091002.f09A2El13844@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20010109001443.A20786@conectiva.com.br> from "Arnaldo Carvalho de Melo" at Jan 09, 2001 12:14:43 AM

Arnaldo Carvalho de Melo writes:
> 	Please consider applying, comments in the patch.

Can't the following be fixed properly?

> -STATIC int
> +STATIC unsigned long
>  DvcEnterCritical(void)
>  {
> -    int    flags;
> +    unsigned long flags;
>  
>      save_flags(flags);
>      cli();

Guess what happens here?

    return flags;

> @@ -9965,7 +9972,7 @@
>  }
>  
>  STATIC void
> -DvcLeaveCritical(int flags)
> +DvcLeaveCritical(unsigned long flags)
>  {
>      restore_flags(flags);
>  }

The above doesn't work on some architectures.  Its better to use a macro
if you want to separate this out.  ie, something like (davem will have to
okay it tho):

#define DvcEnterCritical()				\
 ({ unsigned long __flags; save_flags(__flags); cli(); __flags; })

#define DvcLeaveCritical(flags)				\
 do { restore_flags(flags); } while (0)

This should then ensure that you don't end up with problems associated
with register windows on the sparc or whatever.  Even better would be
to use a spinlock instead of Dvc?????Critical.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |         Russell King        rmk@arm.linux.org.uk      --- ---
  | | | | http://www.arm.linux.org.uk/personal/aboutme.html   /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2001-01-09 10:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-08 22:11 [PATCH] de620.c: nitpicking Arnaldo Carvalho de Melo
2001-01-08 22:25 ` Arnaldo Carvalho de Melo
2001-01-08 22:30   ` [PATCH] tidy 53c7,8xx.c was " Arnaldo Carvalho de Melo
2001-01-09  2:14     ` [PATCH] advansys.c: include missing restore_flags, etc Arnaldo Carvalho de Melo
2001-01-09  7:30       ` Pauline Middelink
2001-01-09 10:06         ` Arnaldo Carvalho de Melo
2001-01-09 10:23         ` Alan Cox
2001-01-09 23:12           ` Pauline Middelink
2001-01-10  7:48         ` Ralf Baechle
2001-01-09 10:02       ` Russell King [this message]
2001-01-09 11:18       ` [PATCH] ad1848.c: include missing restore_flags Arnaldo Carvalho de Melo
2001-01-09 12:00         ` [PATCH] sscape.c: " Arnaldo Carvalho de Melo
2001-01-09 12:24           ` [PATCH] via-macii.c: restore_flags on failure Arnaldo Carvalho de Melo
2001-01-09 13:38             ` [PATCH] dn_keyb.c: " Arnaldo Carvalho de Melo
2001-01-09 16:17               ` Alan Cox
2001-01-09 15:30                 ` Arnaldo Carvalho de Melo

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=200101091002.f09A2El13844@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=acme@conectiva.com.br \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@advansys.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