Skip to contentSkip to conversation

module programming smp-safety howto?

DISCUSSION Emmanuel Michon 4 participants 5 messages Apr 10, 2002 – Apr 14, 2002

lore
Share & tools
lore
#0 lore raw

Hi,

I'm responsible for the development of a kernel module for Sigma Designs EM84xx PCI chips (MPEG2 and MPEG4 hardware decoder boards). It's working properly now, irq sharing and multiple board support is ok.

I would like to make it smp-safe.

For instance, I use at a place cli()/restore to implement something that looks like a critical section (first code path is in a ioctl, second in a irq top half). I guess this approach is wrong with smp.

Is there some documentation or howto about what changes compared to non-smp computers?

Maybe a specific kernel module can be considered as a good model?

Sincerely yours,

Signature · 4 lines
Emmanuel Michon
Chef de projet
REALmagic France SAS
Mobile: 0614372733 GPGkeyID: D2997E42  
#1 lore raw
Quoted 5 lines · Emmanuel Michon

I'm responsible for the development of a kernel module for Sigma Designs EM84xx PCI chips (MPEG2 and MPEG4 hardware decoder boards). It's working properly now, irq sharing and multiple board support is ok.

Quoted 8 lines

I would like to make it smp-safe.

For instance, I use at a place cli()/restore to implement something that looks like a critical section (first code path is in a ioctl, second in a irq top half). I guess this approach is wrong with smp.

Is there some documentation or howto about what changes compared to non-smp computers?

Run "make psdocs" in your kernel tree, and you'll find Rusty's kernel-locking guide in Documentation/DocBook/ . If you don't have the proper tools, you can also download it from
http://www.kernelnewbies.org/documents/ .

Quoted 1 line

Maybe a specific kernel module can be considered as a good model?

I found the 8139too driver a nice source for good programming practice (thanks, Jeff!).

Erik

Signature · 5 lines
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands  Phone: +31-15-2783635
Fax: +31-15-2781843  Email: [email protected]
WWW: http://www-ict.its.tudelft.nl/~erik/
#2 lore raw
In reply to Emmanuel Michon

Look at Linux Kernel Internals available at:

http://www.moses.uklinux.net/patches/lki.html

Also, are we going to see the driver published under GPL (I sure hope so!) or is it going to be binary only as per usual Sigma Designs policy?

Anton

Quoted 13 lines · Emmanuel Michon

Hi,

I'm responsible for the development of a kernel module for Sigma Designs EM84xx PCI chips (MPEG2 and MPEG4 hardware decoder boards). It's working properly now, irq sharing and multiple board support is ok.

I would like to make it smp-safe.

For instance, I use at a place cli()/restore to implement something that looks like a critical section (first code path is in a ioctl, second in a irq top half). I guess this approach is wrong with smp.

Quoted 18 lines

Is there some documentation or howto about what changes compared to non-smp computers?

Maybe a specific kernel module can be considered as a good model?

Sincerely yours,

Signature · 9 lines
Emmanuel Michon
Chef de projet
REALmagic France SAS
Mobile: 0614372733 GPGkeyID: D2997E42  
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Best regards,

Anton

Signature · 4 lines
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS maintainer / WWW: http://linux-ntfs.sf.net/
IRC: #ntfs on irc.openprojects.net / ICQ: 8561279
WWW: http://www-stu.christs.cam.ac.uk/~aia21/
#3 lore raw
Quoted 1 line · Anton Altaparmakov

http://www.moses.uklinux.net/patches/lki.html

thanks!

Quoted 2 lines

Also, are we going to see the driver published under GPL (I sure hope so!) or is it going to be binary only as per usual Sigma Designs policy?

The core library (supporting the PCI chip and all devices attached thru its i2c) is binary only.

The connection between the usual linux module api and this library comes as source code for but is not GPL (NVIDIA driver like).

Unfortunately I personnally do not decide of this: many engineers work at Sigma, with various backgrounds.

[This mail is a bit off topic, sorry. Any following discussion will be completely for sure]

Sincerely yours,

Signature · 4 lines
Emmanuel Michon
Chef de projet
REALmagic France SAS
Mobile: 0614372733 GPGkeyID: D2997E42  
#4 lore raw
Quoted 8 lines · Emmanuel Michon
Quoted 2 lines · Anton Altaparmakov

Also, are we going to see the driver published under GPL (I sure hope so!) or is it going to be binary only as per usual Sigma Designs policy?

The core library (supporting the PCI chip and all devices attached thru its i2c) is binary only.

If it's anything like the code that Sigma has for its 8400/8401, I would keep it private out of sheer embarrassment, myself.

It sounds like you're doing from-the-ground-up new development, instead of trying to port the user-space library for the 8400, which is a good thing, as the 8400 code we licensed under NDA at my last position was a steaming pile of dung. It also sounds like you're making a real driver, instead of a shim driver that mmaps all the hardware for a user-space library - another good design decision.

Peter Desnoyers