* Device Driver for SMP
@ 2004-02-23 16:36 Jinu M.
2004-02-23 16:43 ` Arjan van de Ven
2004-02-23 16:57 ` Richard B. Johnson
0 siblings, 2 replies; 3+ messages in thread
From: Jinu M. @ 2004-02-23 16:36 UTC (permalink / raw)
To: linux-kernel
Hi All,
We have developed a PCI device driver which works well on both MAC (yellow dog) and x86 (RedHat) architectures.
Now we need to provide the support for SMP machine. What generic changes will have to be made to the driver to get it working on a SMP machine.
My first doubt is who takes care of the SMP support? Is it the kernel's job or the driver's job?
As you can see I am not a guru at Linux device drivers, so I would be happy if you could provide me pointers or some good explanation on it.
Thanks a lot!
-Jinu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Device Driver for SMP
2004-02-23 16:36 Device Driver for SMP Jinu M.
@ 2004-02-23 16:43 ` Arjan van de Ven
2004-02-23 16:57 ` Richard B. Johnson
1 sibling, 0 replies; 3+ messages in thread
From: Arjan van de Ven @ 2004-02-23 16:43 UTC (permalink / raw)
To: Jinu M.; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
On Mon, 2004-02-23 at 17:36, Jinu M. wrote:
> Hi All,
>
> We have developed a PCI device driver which works well on both MAC (yellow dog) and x86 (RedHat) architectures.
> Now we need to provide the support for SMP machine. What generic changes will have to be made to the driver to get it working on a SMP machine.
if you coded it well, none.
But you failed to provide an URL to the source of the driver so it's
hard to say.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Device Driver for SMP
2004-02-23 16:36 Device Driver for SMP Jinu M.
2004-02-23 16:43 ` Arjan van de Ven
@ 2004-02-23 16:57 ` Richard B. Johnson
1 sibling, 0 replies; 3+ messages in thread
From: Richard B. Johnson @ 2004-02-23 16:57 UTC (permalink / raw)
To: Jinu M.; +Cc: linux-kernel
On Mon, 23 Feb 2004, Jinu M. wrote:
> Hi All,
>
> We have developed a PCI device driver which works well on both MAC
> (yellow dog) and x86 (RedHat) architectures.
> Now we need to provide the support for SMP machine. What generic
> changes will have to be made to the driver to get it working
> on a SMP machine.
>
> My first doubt is who takes care of the SMP support? Is it the kernel's
> job or the driver's job?
> As you can see I am not a guru at Linux device drivers, so I would
> be happy if you could provide me pointers or some good explanation
> on it.
>
> Thanks a lot!
> -Jinu
>
If the driver was properly written, there is nothing you need
to do to "convert" it to SMP. However, if the driver was written
using 'cli/sti' pairs to protect critical sections, you need
to rewrite those sections to use spin-locks.
OTOH, if the driver was written like a lot of so-called "perfectly
working..." drivers I've seen, you may need to start from scratch!
It all depends upon the techniques the writer used.
When you have two or more CPUs, you absolutely-positively need
to identify and protect critical sections of code. These are
the sections that would corrupt data, muck up hardware, or
otherwise screw up if two or more CPUs were executing the
code or messing with variables at nearly the same time.
For instance, let's say it took two instructions to hardware
to turn on an external light-bulb and no intermediate hardware
instructions were allowed between these two instructions. You
definately need to keep another CPU from touching the hardware
until these two instructions have completed. With only one
CPU, you can often write sloppy code because you know that
nothing else is going to touch your hardware until you are
done. Not so, with SMP machines.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-02-23 16:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-23 16:36 Device Driver for SMP Jinu M.
2004-02-23 16:43 ` Arjan van de Ven
2004-02-23 16:57 ` Richard B. Johnson
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®