Skip to contentSkip to conversation

new SGI TIOCX driver in *-mm driver model locking broken

DISCUSSION Paul Jackson 3 participants 6 messages Apr 2, 2005

lore
Share & tools
lore
#0 lore raw

Looks like the new SGI TIOCX driver that Bruce Losure added to *-mm via the patch "bk-ia64.patch" includes an instance of the old style driver locking, that Patrick Mochel was changed to a new locking model.

If I try to compile 2.6.12-rc1-mm4 for SN2 with the config option

CONFIG_SGI_TIOCX=y

the build fails with a bunch of errors on line 527 of tiocx.c, starting with:

arch/ia64/sn/kernel/tiocx.c: In function `tiocx_exit':
arch/ia64/sn/kernel/tiocx.c:527: error: structure has no member named `bus_list'

The code in question includes the lines:

Quoted 8 lines

static void __exit tiocx_exit(void)

{
        struct device *dev;
        struct device *tdev;

        ...
        list_for_each_entry_safe(dev, tdev, &tiocx_bus_type.devices.list,
                                 bus_list) {

Someone, perhaps Patrick, needs to work the new locking model magic on this piece of code.

Signature · 3 lines
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <[email protected]> 1.650.933.1373, 1.925.600.0401
#1 lore raw
Quoted 7 lines · Paul Jackson

If I try to compile 2.6.12-rc1-mm4 for SN2 with the config option

CONFIG_SGI_TIOCX=y

the build fails with a bunch of errors on line 527 of tiocx.c, starting with:

Pat did a patch, but nobody's tested it yet.

arch/ia64/sn/kernel/tiocx.c renamed from arch/ia64/sn/kernel/tiocx.c~bk-driver-core-sn2-build-fix +9 -12
diff -puN arch/ia64/sn/kernel/tiocx.c~bk-driver-core-sn2-build-fix arch/ia64/sn/kernel/tiocx.c
@@ -514,25 +514,22 @@ static int __init tiocx_init(void)
 	return 0;
 }
 
-static void __exit tiocx_exit(void)
+static int cx_remove_device(struct device * dev, void * data)
 {
-	struct device *dev;
-	struct device *tdev;
+	struct cx_dev *cx_dev = to_cx_dev(dev);
+	device_remove_file(dev, &dev_attr_cxdev_control);
+	cx_device_unregister(cx_dev);
+	return 0;
+}
 
+static void __exit tiocx_exit(void)
+{
 	DBG("tiocx_exit\n");
 
 	/*
 	 * Unregister devices.
 	 */
-	list_for_each_entry_safe(dev, tdev, &tiocx_bus_type.devices.list,
-				 bus_list) {
-		if (dev) {
-			struct cx_dev *cx_dev = to_cx_dev(dev);
-			device_remove_file(dev, &dev_attr_cxdev_control);
-			cx_device_unregister(cx_dev);
-		}
-	}
-
+	bus_for_each_dev(&tiocx_bus_type, NULL, NULL, cx_remove_device);
 	bus_unregister(&tiocx_bus_type);
 }
 

_

#2 lore raw
Quoted 1 line · Andrew

Pat did a patch, but nobody's tested it yet.

It compiles. I have idea how to test it any further.

Signature · 3 lines
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <[email protected]> 1.650.933.1373, 1.925.600.0401
#3 lore raw

I booted a kernel with the patch on my system and it works as expected. Thanks!

-Bruce

Quoted 6 lines · Paul Jackson
Quoted 1 line · Andrew

Pat did a patch, but nobody's tested it yet.

It compiles. I have idea how to test it any further.

Signature · 4 lines
Bruce Losure                            internet: [email protected]
SGI                                     phone:    +1 651 683-7263
2750 Blue Water Rd			vnet:	  233-7263
Eagan, MN, USA 55121
#4 lore raw
In reply to Paul Jackson

Bruce - a related issue that fell out of the previous problem. I disabled SGI_TIOCX, with

# CONFIG_SGI_TIOCX is not set

and now 2.6.12-rc1-mm4 doesn't build SN2 because SGI_MBCS is still enabled in my .config, even after doing 'make oldconfig':

CONFIG_SGI_MBCS=m

The error messages from the build begin with:

drivers/built-in.o(.text+0xa0f62): In function `mbcs_sram_read':
drivers/char/mbcs.c:137: undefined reference to tiocx_dma_addr' drivers/built-in.o(.text+0xa1582): In function mbcs_sram_write':
drivers/char/mbcs.c:90: undefined reference to tiocx_dma_addr' drivers/built-in.o(.text+0xa1d62): In function mbcs_intr_alloc':
drivers/char/mbcs.c:589: undefined reference to tiocx_irq_alloc' drivers/built-in.o(.text+0xa1e12):drivers/char/mbcs.c:602: undefined reference to tiocx_irq_alloc' drivers/built-in.o(.text+0xa1ec2):drivers/char/mbcs.c:620: undefined reference to tiocx_irq_alloc' drivers/built-in.o(.text+0xa1f92):drivers/char/mbcs.c:573: undefined reference to tiocx_irq_free' drivers/built-in.o(.text+0xa1fc2):drivers/char/mbcs.c:573: undefined reference to `tiocx_irq_free'

and indeed there are many tiocx references in drivers/char/mbcs.c.

I'm not a CONFIG wizard, but I would suspect that there should be some sort of dependency in Kconfig, of SGI_MBCS on SGI_TIOCX, so that I couldn't ask for this bogus config (MBCS on, TIOCX off).

Signature · 3 lines
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <[email protected]> 1.650.933.1373, 1.925.600.0401
#5 lore raw
Quoted 10 lines · Paul Jackson

Bruce - a related issue that fell out of the previous problem. I disabled SGI_TIOCX, with

# CONFIG_SGI_TIOCX is not set

and now 2.6.12-rc1-mm4 doesn't build SN2 because SGI_MBCS is still enabled in my .config, even after doing 'make oldconfig':

CONFIG_SGI_MBCS=m

	...
Quoted 6 lines

and indeed there are many tiocx references in drivers/char/mbcs.c.

I'm not a CONFIG wizard, but I would suspect that there should be some sort of dependency in Kconfig, of SGI_MBCS on SGI_TIOCX, so that I couldn't ask for this bogus config (MBCS on, TIOCX off).

I'll try to figure out how to make that dependency and submit a patch.

-Bruce

Signature · 4 lines
Bruce Losure                            internet: [email protected]
SGI                                     phone:    +1 651 683-7263
2750 Blue Water Rd			vnet:	  233-7263
Eagan, MN, USA 55121