Skip to contentSkip to conversation

mspec driver

PATCH In review Jes Sorensen 3 participants 5 messages Sep 20, 2006 – Sep 21, 2006 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mspec driver

Ohoy,

Another one to go on top of do_no_pfn() - no changes here either.

Cheers,
Jes

This patch implements the special memory driver (mspec) based on the do_no_pfn approach. The driver is currently used only on SN2 hardware with special fetchop support but could be beneficial on other architectures using the uncached mode.

----

 drivers/char/Kconfig  |    8 
 drivers/char/Makefile |    1 
 drivers/char/mspec.c  |  421 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 430 insertions(+)
drivers/char/Kconfig +8 -0
Index: linux-2.6/drivers/char/Kconfig
===================================================================
@@ -439,6 +439,14 @@ config SGI_MBCS
          If you have an SGI Altix with an attached SABrick
          say Y or M here, otherwise say N.
 
+config MSPEC
+	tristate "Memory special operations driver"
+	depends on IA64
+	help
+	  If you have an ia64 and you want to enable memory special
+	  operations support (formerly known as fetchop), say Y here,
+	  otherwise say N.
+
 source "drivers/serial/Kconfig"
 
 config UNIX98_PTYS
drivers/char/Makefile +1 -0
Index: linux-2.6/drivers/char/Makefile
===================================================================
@@ -51,6 +51,7 @@ obj-$(CONFIG_VIOCONS)		+= viocons.o
 obj-$(CONFIG_VIOTAPE)		+= viotape.o
 obj-$(CONFIG_HVCS)		+= hvcs.o
 obj-$(CONFIG_SGI_MBCS)		+= mbcs.o
+obj-$(CONFIG_MSPEC)		+= mspec.o
 
 obj-$(CONFIG_PRINTER)		+= lp.o
 obj-$(CONFIG_TIPAR)		+= tipar.o
drivers/char/mspec.c new file +421 -0

421 lines not on this page · raw message

#1 lore raw

On 20 Sep 2006 03:26:53 -0400 Jes Sorensen wrote:

Ahoy.

Quoted 10 lines
 drivers/char/Kconfig  |    8 
 drivers/char/Makefile |    1 
 drivers/char/mspec.c  |  421 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 430 insertions(+)

Index: linux-2.6/drivers/char/Kconfig
===================================================================

drivers/char/Kconfig config SGI_MBCS · line 448

Quoted 10 lines
drivers/char/Kconfig +7 -0
@@ -439,6 +439,14 @@ config SGI_MBCS
          If you have an SGI Altix with an attached SABrick
          say Y or M here, otherwise say N.
 
+config MSPEC
+	tristate "Memory special operations driver"
+	depends on IA64
+	help
+	  If you have an ia64 and you want to enable memory special
+	  operations support (formerly known as fetchop), say Y here,
+	  otherwise say N.

If the answers are {Y, N}, then it should be bool instead of tristate. If tristate, M can be an answer....

drivers/char/mspec.c line 1

Quoted 10 lines
drivers/char/Kconfig +0 -0
 source "drivers/serial/Kconfig"
 
 config UNIX98_PTYS

Index: linux-2.6/drivers/char/mspec.c
===================================================================

drivers/char/mspec.c new file +1 -0
@@ -0,0 +1,421 @@
+#include <linux/config.h>

Don't need to include config.h (it's done by build system). (well, actually autoconf.h is)

drivers/char/mspec.c line 226

Quoted 5 lines
drivers/char/mspec.c new file +5 -0
+static struct vm_operations_struct mspec_vm_ops = {
+	.open = mspec_open,
+	.close = mspec_close,
+	.nopfn = mspec_nopfn
+};

These interfaces create a userspace interface, eh? So those 3 functions could stand to have kernel-doc function comments and have documentation in Documentation/ABI/ (see its README file for more details). Maybe check all of Documentation/SubmitChecklist for other items...

drivers/char/mspec.c line 330

Quoted 7 lines
drivers/char/mspec.c new file +7 -0
+/*
+ * mspec_init
+ *
+ * Called at boot time to initialize the mspec facility.
+ */
+static int __init
+mspec_init(void)

ugh, matey. All on one line.

drivers/char/mspec.c line 400

Quoted 5 lines
drivers/char/mspec.c new file +5 -0
+{
+}
+
+static void __exit
+mspec_exit(void)

Ditto.

drivers/char/mspec.c line 20

Quoted 2 lines
drivers/char/mspec.c new file +2 -0
+{
+}

---
~Randy

#2 lore raw
Quoted 5 lines · Randy.Dunlap
Quoted 4 lines · On 20 Sep 2006 03:26:53 -0400 Jes Sorensen wrote:
drivers/char/Kconfig +0 -0
@@ -439,6 +439,14 @@ config SGI_MBCS
          If you have an SGI Altix with an attached SABrick
          say Y or M here, otherwise say N.
 
Quoted 10 lines

drivers/char/Kconfig config SGI_MBCS · line 448

Quoted 7 lines
drivers/char/Kconfig +7 -0
+config MSPEC
+	tristate "Memory special operations driver"
+	depends on IA64
+	help
+	  If you have an ia64 and you want to enable memory special
+	  operations support (formerly known as fetchop), say Y here,
+	  otherwise say N.

If the answers are {Y, N}, then it should be bool instead of tristate. If tristate, M can be an answer....

True, will look into that.

Quoted 4 lines

drivers/char/mspec.c line 33

Quoted 1 line
drivers/char/mspec.c new file +1 -0
+#include <linux/config.h>

Don't need to include config.h (it's done by build system). (well, actually autoconf.h is)

True, I remember that changing - what happens when the code sits around for too long. Personally I prefer it is included explicitly, but I'll change it anyway.

Quoted 11 lines

drivers/char/mspec.c line 226

Quoted 5 lines
drivers/char/mspec.c new file +5 -0
+static struct vm_operations_struct mspec_vm_ops = {
+	.open = mspec_open,
+	.close = mspec_close,
+	.nopfn = mspec_nopfn
+};

These interfaces create a userspace interface, eh? So those 3 functions could stand to have kernel-doc function comments and have documentation in Documentation/ABI/ (see its README file for more details). Maybe check all of Documentation/SubmitChecklist for other items...

Mmmmmmm, I'd need someone else to write that up, might take a little longer to get done. Robin know any volunteers?

Quoted 9 lines

drivers/char/mspec.c line 330

Quoted 7 lines
drivers/char/mspec.c new file +7 -0
+/*
+ * mspec_init
+ *
+ * Called at boot time to initialize the mspec facility.
+ */
+static int __init
+mspec_init(void)

ugh, matey. All on one line.

Sorry, but I think that one falls under personal preference. It's short than 80, which is what really matters.

Cheers,
Jes

#3 lore raw
Quoted 8 lines
Quoted 5 lines

These interfaces create a userspace interface, eh? So those 3 functions could stand to have kernel-doc function comments and have documentation in Documentation/ABI/ (see its README file for more details). Maybe check all of Documentation/SubmitChecklist for other items...

Mmmmmmm, I'd need someone else to write that up, might take a little longer to get done. Robin know any volunteers?

Am I reading this right? Jes, are you looking for a volunteer or a "volunteer" :)

Sure, I can grab this and see about the documentation. I assume you want me to give you the blurb and your will add it to your patch? If that assumption is wrong, please let me know.

Thanks,
Robin

#4 lore raw
Quoted 6 lines · Robin Holt

Am I reading this right? Jes, are you looking for a volunteer or a "volunteer" :)

Sure, I can grab this and see about the documentation. I assume you want me to give you the blurb and your will add it to your patch? If that assumption is wrong, please let me know.

Hi Robin,

Well if you are volunteering, that would be great :) Problem is I still don't understand quite what is going on, so it's a bit harder for me to write it and having it actually be correct.

If you have the time to write it up, then I'll be happy to add it to my patch and push it all upstream.

Cheers,
Jes