2002-09-09 18:55:23

by James Blackwell

[permalink] [raw]
Subject: [PATCH] IRQ patch for Toshiba Char Driver in 2.5.34

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.




--
GnuPG fingerprint AAE4 8C76 58DA 5902 761D 247A 8A55 DA73 0635 7400
James Blackwell -- Director http://www.linuxguru.net


2002-09-09 19:11:26

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: [PATCH] IRQ patch for Toshiba Char Driver in 2.5.34

On Mon, 9 Sep 2002, James Blackwell wrote:

> 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.

Show us the goods first ;)

Zwane
--
function.linuxpower.ca

2002-09-11 10:24:52

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] IRQ patch for Toshiba Char Driver in 2.5.34

You've just made the driver horribly racy on SMP or preempt systems..

Instead of a blind search and replace you have to find out the protected
data and add a spinlock around it, also in the top-half of the kernel.

2002-09-15 17:57:42

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] IRQ patch for Toshiba Char Driver in 2.5.34

Hi!

> You've just made the driver horribly racy on SMP or preempt
> systems..

Well, as long as toshiba does not make SMP notebooks, we are safe ;-).

Pavel

--
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?

2002-09-15 19:25:35

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: [PATCH] IRQ patch for Toshiba Char Driver in 2.5.34

On Sun, Sep 15, 2002 at 05:42:48PM +0200, Pavel Machek wrote:
> Hi!
>
> > You've just made the driver horribly racy on SMP or preempt
> > systems..
>
> Well, as long as toshiba does not make SMP notebooks, we are safe ;-).

... or preempt. Which doesn't really depend on Toshiba.

--
Vojtech Pavlik
SuSE Labs

2002-09-15 19:48:44

by James Blackwell

[permalink] [raw]
Subject: Re: [PATCH] IRQ patch for Toshiba Char Driver in 2.5.34

On Sun, Sep 15, 2002 at 09:30:09PM +0200, Vojtech Pavlik wrote:
> On Sun, Sep 15, 2002 at 05:42:48PM +0200, Pavel Machek wrote:
> > Hi!
> >
> > > You've just made the driver horribly racy on SMP or preempt
> > > systems..
> >
> > Well, as long as toshiba does not make SMP notebooks, we are safe ;-).
>
> ... or preempt. Which doesn't really depend on Toshiba.
>

Does that mean my very first kernel patch, insignificant as it is, is
probably acceptable?

Should I resubmit it? I haven't tried 2.5.34 yet, and 2.5.33 had keyboard
problems that prevented me from using it.


--
GnuPG fingerprint AAE4 8C76 58DA 5902 761D 247A 8A55 DA73 0635 7400
James Blackwell -- Director http://www.linuxguru.net

2002-09-15 19:57:04

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] IRQ patch for Toshiba Char Driver in 2.5.34

Hi!

> > > > You've just made the driver horribly racy on SMP or preempt
> > > > systems..
> > >
> > > Well, as long as toshiba does not make SMP notebooks, we are safe ;-).
> >
> > ... or preempt. Which doesn't really depend on Toshiba.
> >
>
> Does that mean my very first kernel patch, insignificant as it is, is
> probably acceptable?
>
> Should I resubmit it? I haven't tried 2.5.34 yet, and 2.5.33 had keyboard
> problems that prevented me from using it.

Perhaps adding #ifdef CONFIG_SMP #error Not SMP safe, #ifdef
CONFIG_PREEMPT #error Not preempt safe and resubmitting is not such a
bad idea.

It would be nice to make it preempt/smp safe, through. [SMP notebooks
are not so unreasonable; think p4 hyperthreading].
Pavel
--
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.

2002-09-15 22:22:12

by Dave Jones

[permalink] [raw]
Subject: Re: [PATCH] IRQ patch for Toshiba Char Driver in 2.5.34

On Sun, Sep 15, 2002 at 10:02:02PM +0200, Pavel Machek wrote:

> It would be nice to make it preempt/smp safe, through. [SMP notebooks
> are not so unreasonable; think p4 hyperthreading].

Current P4 notebooks aren't using xeon's to the best
of my knowledge, though as such technology becomes more
commonplace, it's not unviable for the future maybe.

Dave

--
| Dave Jones. http://www.codemonkey.org.uk
| SuSE Labs

2002-09-16 00:33:47

by Jonathan Buzzard

[permalink] [raw]
Subject: Re: [PATCH] IRQ patch for Toshiba Char Driver in 2.5.34



[email protected] said:
> It would be nice to make it preempt/smp safe, through. [SMP notebooks
> are not so unreasonable; think p4 hyperthreading].

They are here. The code that is protected by cli() and friends does not
run on any anything more fancy than a Pentium. As I recall nothing but
mobile P90 in a Portage 610CT and a mobile P120 in a Tecra 700CDT/CDS.

JAB.

--
Jonathan A. Buzzard Email: [email protected]
Northumberland, United Kingdom. Tel: +44(0)1661-832195


2002-09-16 11:54:15

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH] IRQ patch for Toshiba Char Driver in 2.5.34

Hi!

> > It would be nice to make it preempt/smp safe, through. [SMP notebooks
> > are not so unreasonable; think p4 hyperthreading].
>
> They are here. The code that is protected by cli() and friends does not
> run on any anything more fancy than a Pentium. As I recall nothing but
> mobile P90 in a Portage 610CT and a mobile P120 in a Tecra 700CDT/CDS.

Its still not safe due to preempt.

Anyway #ifdef PREEMPT bug, and comment that this is never ever used on
SMP might be enough.
Pavel
--
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.