2005-04-02 11:44:58

by Paul Jackson

[permalink] [raw]
Subject: new SGI TIOCX driver in *-mm driver model locking broken

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:

> 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.

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373, 1.925.600.0401


2005-04-02 11:51:58

by Andrew Morton

[permalink] [raw]
Subject: Re: new SGI TIOCX driver in *-mm driver model locking broken

Paul Jackson <[email protected]> wrote:
>
> 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.

diff -puN arch/ia64/sn/kernel/tiocx.c~bk-driver-core-sn2-build-fix arch/ia64/sn/kernel/tiocx.c
--- 25/arch/ia64/sn/kernel/tiocx.c~bk-driver-core-sn2-build-fix 2005-04-01 21:41:07.000000000 -0800
+++ 25-akpm/arch/ia64/sn/kernel/tiocx.c 2005-04-01 21:41:07.000000000 -0800
@@ -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);
}

_

2005-04-02 12:11:23

by Paul Jackson

[permalink] [raw]
Subject: Re: new SGI TIOCX driver in *-mm driver model locking broken

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).

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373, 1.925.600.0401

2005-04-02 12:16:21

by Paul Jackson

[permalink] [raw]
Subject: Re: new SGI TIOCX driver in *-mm driver model locking broken

Andrew wrote:
> Pat did a patch, but nobody's tested it yet.

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

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373, 1.925.600.0401

2005-04-02 14:15:43

by Bruce Losure

[permalink] [raw]
Subject: Re: new SGI TIOCX driver in *-mm driver model locking broken

On Sat, 2 Apr 2005, Paul Jackson wrote:

> 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
>
...
> 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

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

2005-04-02 15:19:00

by Bruce Losure

[permalink] [raw]
Subject: Re: new SGI TIOCX driver in *-mm driver model locking broken



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

-Bruce

On Sat, 2 Apr 2005, Paul Jackson wrote:

> Andrew wrote:
> > Pat did a patch, but nobody's tested it yet.
>
> It compiles. I have idea how to test it any further.
>
>

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