2000-12-11 01:12:55

by Frank Davis

[permalink] [raw]
Subject: INIT_LIST_HEAD marco audit

Hello all,
It looks like we need to perform an audit of test12-pre8 and find all the changes where INIT_LIST_HEAD should now be used. Does anyone have a complete list of all the problem drivers, as well as a list of the ones that have already been fixed? If so, please post it to l-k . I don't mind maintaining a list of those patches..Just send them to [email protected] .
Regards,
-Frank



2000-12-11 01:17:06

by Mohammad A. Haque

[permalink] [raw]
Subject: Re: INIT_LIST_HEAD marco audit

Generating an updated batch patch right now....

Frank Davis wrote:
>
> Hello all,
> It looks like we need to perform an audit of test12-pre8 and find all the changes where INIT_LIST_HEAD should now be used. Does anyone have a complete list of all the problem drivers, as well as a list of the ones that have already been fixed? If so, please post it to l-k . I don't mind maintaining a list of those patches..Just send them to [email protected] .

--

=====================================================================
Mohammad A. Haque http://www.haque.net/
[email protected]

"Alcohol and calculus don't mix. Project Lead
Don't drink and derive." --Unknown http://wm.themes.org/
[email protected]
=====================================================================

2000-12-11 03:25:46

by Mohammad A. Haque

[permalink] [raw]
Subject: Re: INIT_LIST_HEAD marco audit

The follwing files probably need to be patched to use the
DECLARE_TASK_QUEUE() macro and new tq_struct, but I don't have time
right now to go through them.

(grep for "static struct tq_struct.*=")

drivers/net/wan/sdlamain.c
drivers/block/paride/pseudo.h
drivers/scsi/atari_NCR5380.c
drivers/scsi/mac_NCR5380.c
drivers/scsi/oktagon_esp.c
drivers/scsi/sun3_NCR5380.c
drivers/isdn/hisax/foreign.c
drivers/isdn/hisax/foreign.c
drivers/isdn/hisax/foreign.c
drivers/acorn/block/mfmhd.c
drivers/pcmcia/i82365.c
drivers/pcmcia/tcic.c
drivers/s390/block/dasd.c

Frank Davis wrote:
>
> Hello all,
> It looks like we need to perform an audit of test12-pre8 and find all the changes where INIT_LIST_HEAD should now be used. Does anyone have a complete list of all the problem drivers, as well as a list of the ones that have already been fixed? If so, please post it to l-k . I don't mind maintaining a list of those patches..Just send them to [email protected] .

--

=====================================================================
Mohammad A. Haque http://www.haque.net/
[email protected]

"Alcohol and calculus don't mix. Project Lead
Don't drink and derive." --Unknown http://wm.themes.org/
[email protected]
=====================================================================

2000-12-11 03:52:43

by Mohammad A. Haque

[permalink] [raw]
Subject: Re: INIT_LIST_HEAD marco audit

Add drivers/i2o/i2o_lan.c to the list. My patch does patch this file but
I did a copy paste and didn't replace run_task_queue with
i2o_lan_receive_post.

"Mohammad A. Haque" wrote:
>
> The follwing files probably need to be patched to use the
> DECLARE_TASK_QUEUE() macro and new tq_struct, but I don't have time
> right now to go through them.
>
> (grep for "static struct tq_struct.*=")
>
> drivers/net/wan/sdlamain.c
> drivers/block/paride/pseudo.h
> drivers/scsi/atari_NCR5380.c
> drivers/scsi/mac_NCR5380.c
> drivers/scsi/oktagon_esp.c
> drivers/scsi/sun3_NCR5380.c
> drivers/isdn/hisax/foreign.c
> drivers/isdn/hisax/foreign.c
> drivers/isdn/hisax/foreign.c
> drivers/acorn/block/mfmhd.c
> drivers/pcmcia/i82365.c
> drivers/pcmcia/tcic.c
> drivers/s390/block/dasd.c

--

=====================================================================
Mohammad A. Haque http://www.haque.net/
[email protected]

"Alcohol and calculus don't mix. Project Lead
Don't drink and derive." --Unknown http://wm.themes.org/
[email protected]
=====================================================================

2000-12-11 04:22:55

by Miles Lane

[permalink] [raw]
Subject: Re: INIT_LIST_HEAD marco audit

"Mohammad A. Haque" wrote:
>
> The follwing files probably need to be patched to use the
> DECLARE_TASK_QUEUE() macro and new tq_struct, but I don't have time
> right now to go through them.

Would someone who knows what to do send out a patch for
these two drivers?

drivers/pcmcia/i82365.c
drivers/pcmcia/tcic.c

Thanks!

Miles

2000-12-11 04:45:45

by Mohammad A. Haque

[permalink] [raw]
Subject: Re: INIT_LIST_HEAD marco audit

Does this look right to people?

--- linux-2.4.0-test12.old/drivers/pcmcia/tcic.c Sun Nov 19 21:56:30
2000
+++ linux-2.4.0-test12/drivers/pcmcia/tcic.c Sun Dec 10 23:00:07 2000
@@ -548,8 +548,9 @@
}
}

-static struct tq_struct tcic_task = {
- routine: tcic_bh
+DECLARE_TASK_QUEUE(tcic_task);
+struct tq_struct run_tcic_task = {
+ routine: (void (*)(void *)) tcic_bh
};

static void tcic_interrupt(int irq, void *dev, struct pt_regs *regs)
--- linux-2.4.0-test12.old/drivers/pcmcia/i82365.c Sun Nov 19 21:56:30
2000
+++ linux-2.4.0-test12/drivers/pcmcia/i82365.c Sun Dec 10 23:06:01 2000
@@ -877,8 +877,9 @@
}
}

-static struct tq_struct pcic_task = {
- routine: pcic_bh
+DECLARE_TASK_QUEUE(pcic_task);
+struct tq_struct run_pcic_task = {
+ routine: (void (*)(void *)) pcic_bh
};

static void pcic_interrupt(int irq, void *dev,

Miles Lane wrote:
> Would someone who knows what to do send out a patch for
> these two drivers?
>
> drivers/pcmcia/i82365.c
> drivers/pcmcia/tcic.c

--

=====================================================================
Mohammad A. Haque http://www.haque.net/
[email protected]

"Alcohol and calculus don't mix. Project Lead
Don't drink and derive." --Unknown http://wm.themes.org/
[email protected]
=====================================================================

2000-12-11 13:21:18

by Alan

[permalink] [raw]
Subject: Re: INIT_LIST_HEAD marco audit

> -static struct tq_struct tcic_task = {
> - routine: tcic_bh
> +DECLARE_TASK_QUEUE(tcic_task);
> +struct tq_struct run_tcic_task = {
> + routine: (void (*)(void *)) tcic_bh
> };

Why remove the 'static' ?

2000-12-11 13:50:10

by Mohammad A. Haque

[permalink] [raw]
Subject: Re: INIT_LIST_HEAD marco audit

Thinko.

Question is... Adam Richter posted a patch for i2o_lan.c that does
this...

static struct tq_struct i2o_post_buckets_task = {
list: LIST_HEAD_INIT(i2o_post_buckets_task.list),
sync: 0,
routine: (void (*)(void *))i2o_lan_receive_post,
data: (void *) 0
};

If that's correct then is the only fix for structures similar to
tcic_task to type cast the routine?

Alan Cox wrote:
>
> > -static struct tq_struct tcic_task = {
> > - routine: tcic_bh
> > +DECLARE_TASK_QUEUE(tcic_task);
> > +struct tq_struct run_tcic_task = {
> > + routine: (void (*)(void *)) tcic_bh
> > };
>
> Why remove the 'static' ?

--

=====================================================================
Mohammad A. Haque http://www.haque.net/
[email protected]

"Alcohol and calculus don't mix. Project Lead
Don't drink and derive." --Unknown http://wm.themes.org/
[email protected]
=====================================================================

2000-12-11 23:44:37

by Andrew Morton

[permalink] [raw]
Subject: Re: INIT_LIST_HEAD marco audit

"Mohammad A. Haque" wrote:
>
> Thinko.
>
> Question is... Adam Richter posted a patch for i2o_lan.c that does
> this...
>
> static struct tq_struct i2o_post_buckets_task = {
> list: LIST_HEAD_INIT(i2o_post_buckets_task.list),
> sync: 0,
> routine: (void (*)(void *))i2o_lan_receive_post,
> data: (void *) 0
> };
>

Will someone pleeeeze compile, test, use and submit this?

--- linux-2.4.0-test12-pre7/include/linux/tqueue.h Mon Dec 11 13:21:04 2000
+++ linux/include/linux/tqueue.h Tue Dec 12 10:03:51 2000
@@ -47,6 +47,16 @@
#define DECLARE_TASK_QUEUE(q) LIST_HEAD(q)
#define TQ_ACTIVE(q) (!list_empty(&q))

+#define INIT_TQ_STRUCT(routine, data) \
+ { list: LIST_HEAD_INIT(*(struct list_head *)0), \
+ sync: 0, \
+ routine: (routine), \
+ data: (data), \
+ }
+
+#define DECLARE_TQ_STRUCT(name, routine, data) \
+ struct tq_struct name = INIT_TQ_STRUCT(routine, data)
+
extern task_queue tq_timer, tq_immediate, tq_disk;

/*