From: James Blackwell <jblack@linuxguru.net>
To: linux-kernel@vger.kernel.org
Cc: jonathan@buzzard.org.uk
Subject: [Patch] 2.5.34 IRQ Patch
Date: Mon, 9 Sep 2002 08:04:52 -0400 [thread overview]
Message-ID: <20020909120451.GA23868@comet> (raw)
Somewhere around 2.5.31 the method for setting and clearing interrupts
changed:
From- To-
save_flags(flags); local_irq_save(flags);
cli();
restore_flags(flags); local_irq_restore(flags);
Though bordering on trivial, including toshiba support with stock 2.5.34
fails to compile, which this patch seems to fix. This patch fixes this
issue and has worked reliably for me under 2.5.31, though it is untested on
2.5.32 and 2.5.33 because I didn't manage to get those to work.
A note to those that are a bit rough on kernel patch newbies.... submitting
a kernel patch for the very first time is a rather intimidating experience
so please don't chew my head off unless its absolutely necessary.
See my point? I was so worried that Cristoph Hellwig is going to come to
my house and eat me I forgot to include the patch itself. :)
diff -ur linux-2.5.34/drivers/char/toshiba.c linux-2.5.34.new/drivers/char/toshiba.c
--- linux-2.5.34/drivers/char/toshiba.c 2002-09-09 13:35:16.000000000 -0400
+++ linux-2.5.34.new/drivers/char/toshiba.c 2002-09-09 07:46:23.000000000 -0400
@@ -114,11 +114,10 @@
if (tosh_fn!=0) {
scan = inb(tosh_fn);
} else {
- save_flags(flags);
- cli();
+ local_irq_save(flags);
outb(0x8e, 0xe4);
scan = inb(0xe5);
- restore_flags(flags);
+ local_irq_restore(flags);
}
return (int) scan;
@@ -141,35 +140,32 @@
if (tosh_id==0xfccb) {
if (eax==0xfe00) {
/* fan status */
- save_flags(flags);
- cli();
+ local_irq_save(flags);
outb(0xbe, 0xe4);
al = inb(0xe5);
- restore_flags(flags);
+ local_irq_restore(flags);
regs->eax = 0x00;
regs->ecx = (unsigned int) (al & 0x01);
}
if ((eax==0xff00) && (ecx==0x0000)) {
/* fan off */
- save_flags(flags);
- cli();
+ local_irq_save(flags);
outb(0xbe, 0xe4);
al = inb(0xe5);
outb(0xbe, 0xe4);
outb (al | 0x01, 0xe5);
- restore_flags(flags);
+ local_irq_restore(flags);
regs->eax = 0x00;
regs->ecx = 0x00;
}
if ((eax==0xff00) && (ecx==0x0001)) {
/* fan on */
- save_flags(flags);
- cli();
+ local_irq_save(flags);
outb(0xbe, 0xe4);
al = inb(0xe5);
outb(0xbe, 0xe4);
outb(al & 0xfe, 0xe5);
- restore_flags(flags);
+ local_irq_restore(flags);
regs->eax = 0x00;
regs->ecx = 0x01;
}
@@ -180,33 +176,30 @@
if (tosh_id==0xfccc) {
if (eax==0xfe00) {
/* fan status */
- save_flags(flags);
- cli();
+ local_irq_save(flags);
outb(0xe0, 0xe4);
al = inb(0xe5);
- restore_flags(flags);
+ local_irq_restore(flags);
regs->eax = 0x00;
regs->ecx = al & 0x01;
}
if ((eax==0xff00) && (ecx==0x0000)) {
/* fan off */
- save_flags(flags);
- cli();
+ local_irq_save(flags);
outb(0xe0, 0xe4);
al = inb(0xe5);
outw(0xe0 | ((al & 0xfe) << 8), 0xe4);
- restore_flags(flags);
+ local_irq_restore(flags);
regs->eax = 0x00;
regs->ecx = 0x00;
}
if ((eax==0xff00) && (ecx==0x0001)) {
/* fan on */
- save_flags(flags);
- cli();
+ local_irq_save(flags);
outb(0xe0, 0xe4);
al = inb(0xe5);
outw(0xe0 | ((al | 0x01) << 8), 0xe4);
- restore_flags(flags);
+ local_irq_restore(flags);
regs->eax = 0x00;
regs->ecx = 0x01;
}
--
GnuPG fingerprint AAE4 8C76 58DA 5902 761D 247A 8A55 DA73 0635 7400
James Blackwell -- Director http://www.linuxguru.net
next reply other threads:[~2002-09-09 19:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-09 12:04 James Blackwell [this message]
2002-09-09 19:16 ` [Patch] 2.5.34 IRQ Patch John Levon
2002-09-09 13:49 ` James Blackwell
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=20020909120451.GA23868@comet \
--to=jblack@linuxguru.net \
--cc=jonathan@buzzard.org.uk \
--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.