Re: Staging: RAR support - bring ready to move from staging

Previous thread: PATCH: Fix up memrar to the new RAR API by Alan Cox on Tuesday, May 4, 2010 - 2:52 am. (2 messages)

Next thread: [PATCH 1/7] oprofile: update file list in MAINTAINERS file by Robert Richter on Tuesday, May 4, 2010 - 3:44 am. (1 message)
From: Alan Cox
Date: Tuesday, May 4, 2010 - 2:50 am

rar: perform a clean up pass

- Move to a registration model where each RAR is claimed/unclaimed
- Use that to fix the client stuff (one client per RAR so no need to queue stuff)
- Support unregister so drivers can rmmod themselves safely
- Fix locking hang on calling rar lock from rar callback
- Clean up
- Kerneldoc

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/staging/rar_register/rar_register.c |  611 +++++++++++++++------------
 drivers/staging/rar_register/rar_register.h |   62 ---
 2 files changed, 347 insertions(+), 326 deletions(-)


diff --git a/drivers/staging/rar_register/rar_register.c b/drivers/staging/rar_register/rar_register.c
index bfc0e31..7c2011c 100644
--- a/drivers/staging/rar_register/rar_register.c
+++ b/drivers/staging/rar_register/rar_register.c
@@ -51,98 +51,160 @@
 #include <linux/kernel.h>
 
 /* === Lincroft Message Bus Interface === */
-/* Message Control Register */
-#define LNC_MCR_OFFSET 0xD0
-
-/* Maximum number of clients (other drivers using this driver) */
-#define MAX_RAR_CLIENTS 10
-
-/* Message Data Register */
-#define LNC_MDR_OFFSET 0xD4
+#define LNC_MCR_OFFSET		0xD0	/* Message Control Register */
+#define LNC_MDR_OFFSET		0xD4	/* Message Data Register */
 
 /* Message Opcodes */
-#define LNC_MESSAGE_READ_OPCODE 0xD0
+#define LNC_MESSAGE_READ_OPCODE	0xD0
 #define LNC_MESSAGE_WRITE_OPCODE 0xE0
 
 /* Message Write Byte Enables */
-#define LNC_MESSAGE_BYTE_WRITE_ENABLES 0xF
+#define LNC_MESSAGE_BYTE_WRITE_ENABLES	0xF
 
 /* B-unit Port */
-#define LNC_BUNIT_PORT 0x3
+#define LNC_BUNIT_PORT	0x3
 
 /* === Lincroft B-Unit Registers - Programmed by IA32 firmware === */
-#define LNC_BRAR0L 0x10
-#define LNC_BRAR0H 0x11
-#define LNC_BRAR1L 0x12
-#define LNC_BRAR1H 0x13
-
+#define LNC_BRAR0L	0x10
+#define LNC_BRAR0H	0x11
+#define LNC_BRAR1L	0x12
+#define LNC_BRAR1H	0x13
 /* Reserved for SeP */
-#define LNC_BRAR2L 0x14
-#define LNC_BRAR2H 0x15
+#define LNC_BRAR2L	0x14
+#define LNC_BRAR2H	0x15
 
 /* ...
From: Greg KH
Date: Tuesday, May 4, 2010 - 8:51 am

I get the following build errors with this patch:
	  CC [M]  drivers/staging/memrar/memrar_handler.o
	drivers/staging/memrar/memrar_handler.c: In function ‘memrar_init’:
	drivers/staging/memrar/memrar_handler.c:910: warning: passing argument 1 of ‘register_rar’ makes integer from pointer without a cast
	drivers/staging/memrar/../rar_register/rar_register.h:37: note: expected ‘int’ but argument is of type ‘int (*)(void *)’
	drivers/staging/memrar/memrar_handler.c:910: error: too few arguments to function ‘register_rar’
	make[2]: *** [drivers/staging/memrar/memrar_handler.o] Error 1
	make[1]: *** [drivers/staging/memrar] Error 2
	make: *** [_module_drivers/staging] Error 2

Should I have applied your other patch first?

thanks,

greg k-h
--

From: Alan Cox
Date: Tuesday, May 4, 2010 - 9:27 am

On Tue, 4 May 2010 08:51:12 -0700

Expected - its a staging driver so I thought a patch that broke the API
of another staging driver was fine (the second patch will fix it up)
--

From: Greg KH
Date: Tuesday, May 4, 2010 - 10:20 am

Ah, those were two different drivers, that makes more sense.

It's not nice to break the build, I can't take a patch that is known to
do that, sorry.  Care to merge them together?

thanks,

greg k-h
--

From: Alan Cox
Date: Tuesday, May 4, 2010 - 10:30 am

Yeah I'll cat them together and resend them tomorrow 8)
--

Previous thread: PATCH: Fix up memrar to the new RAR API by Alan Cox on Tuesday, May 4, 2010 - 2:52 am. (2 messages)

Next thread: [PATCH 1/7] oprofile: update file list in MAINTAINERS file by Robert Richter on Tuesday, May 4, 2010 - 3:44 am. (1 message)