2000-11-13 23:15:01

by Adam J. Richter

[permalink] [raw]
Subject: Patch(?): linux-2.4.0-test11-pre4/drivers/sound/yss225.c compile failure




linux-2.4.0-test11-pre4/drivers/sound/yss225.c uses __initdata
but does not include <linux/init.h>, so it could not compile. I have
attached below.

Note that I am a bit uncertain about the correctness of
the __initdata prefix here in the first place. Is yss225 a PCI
device? If so, a kernel that supports PCI hot plugging should
be prepared to support the possibility of a hot pluggable yss225
card being inserted after the module has already been initialized.
Even if no CardBus or CompactPCI version of yss225 hardware exists
yet, it will require less maintenance for PCI drivers to be prepared
for this possibility from the outset (besides, is it possible to have a
hot pluggable PCI bridge card that bridges to a regular PCI bus?).

So, if yss225 is a PCI device, the declaration should use
__devinitdata. On the other hand, if it is ISA only, then __initdata
should be correct.

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
[email protected] \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."

--- linux-2.4.0-test11-pre4/drivers/sound/yss225.c Mon Nov 13 13:36:50 2000
+++ linux/drivers/sound/yss225.c Mon Nov 13 09:11:02 2000
@@ -1,3 +1,4 @@
+#include <linux/init.h>
unsigned char page_zero[] __initdata = {
0x01, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x00,
0x11, 0x00, 0x20, 0x00, 0x32, 0x00, 0x40, 0x00, 0x13, 0x00, 0x00,


Subject: Re: Patch(?): linux-2.4.0-test11-pre4/drivers/sound/yss225.c compile failure

On Mon, 13 Nov 2000, Adam J. Richter wrote:

> linux-2.4.0-test11-pre4/drivers/sound/yss225.c uses __initdata
> but does not include <linux/init.h>, so it could not compile. I have
> attached below.
>
> Note that I am a bit uncertain about the correctness of
> the __initdata prefix here in the first place. Is yss225 a PCI
> device? If so, a kernel that supports PCI hot plugging should
> be prepared to support the possibility of a hot pluggable yss225
> card being inserted after the module has already been initialized.
> Even if no CardBus or CompactPCI version of yss225 hardware exists
> yet, it will require less maintenance for PCI drivers to be prepared
> for this possibility from the outset (besides, is it possible to have a
> hot pluggable PCI bridge card that bridges to a regular PCI bus?).

Good question....

>
> So, if yss225 is a PCI device, the declaration should use
> __devinitdata. On the other hand, if it is ISA only, then __initdata
> should be correct.

Currently not a problem because yss225.c is used only by wavfront.c which
is a driver for Turtle Beach WaveFront Series (ISA)...

>
> Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
> [email protected] \ / San Jose, California 95129-1034
> +1 408 261-6630 | g g d r a s i l United States of America
> fax +1 408 261-6631 "Free Software For The Rest Of Us."
>
> --- linux-2.4.0-test11-pre4/drivers/sound/yss225.c Mon Nov 13 13:36:50 2000
> +++ linux/drivers/sound/yss225.c Mon Nov 13 09:11:02 2000
> @@ -1,3 +1,4 @@
> +#include <linux/init.h>
> unsigned char page_zero[] __initdata = {
> 0x01, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x00,
> 0x11, 0x00, 0x20, 0x00, 0x32, 0x00, 0x40, 0x00, 0x13, 0x00, 0x00,
>

Rasmus Andersen have already posted three patches
which fix my temporary braindamage (linux/init.h)...

Right know I don't care too much about hotplugging because most
of drivers are broken anyway (or not?)... I _will_ try to fix
hotplugging later (I'm talking not only about sound)... as it needs
some further investigation...

Regards
--
Bartlomiej Zolnierkiewicz
<[email protected]>

2000-11-14 23:33:35

by Jeff Garzik

[permalink] [raw]
Subject: Re: Patch(?): linux-2.4.0-test11-pre4/drivers/sound/yss225.c compilefailure

Bartlomiej Zolnierkiewicz wrote:
>
> On Mon, 13 Nov 2000, Adam J. Richter wrote:
>
> > linux-2.4.0-test11-pre4/drivers/sound/yss225.c uses __initdata
> > but does not include <linux/init.h>, so it could not compile. I have
> > attached below.
> >
> > Note that I am a bit uncertain about the correctness of
> > the __initdata prefix here in the first place. Is yss225 a PCI
> > device? If so, a kernel that supports PCI hot plugging should
> > be prepared to support the possibility of a hot pluggable yss225
> > card being inserted after the module has already been initialized.
> > Even if no CardBus or CompactPCI version of yss225 hardware exists
> > yet, it will require less maintenance for PCI drivers to be prepared
> > for this possibility from the outset (besides, is it possible to have a
> > hot pluggable PCI bridge card that bridges to a regular PCI bus?).
>
> Good question....

Please err on the conservative side -- IMHO you shouldn't mark a driver
as hotpluggable (by using the '__dev' prefix) unless you know it is
necessary.

Otherwise, you rob CONFIG_HOTPLUG people of some memory that could
otherwise be freed at boot. And the number of CONFIG_HOTPLUG people is
not small, it includes not only the CardBus users but USB users too...

Jeff


--
Jeff Garzik |
Building 1024 | The chief enemy of creativity is "good" sense
MandrakeSoft | -- Picasso

Subject: Re: Patch(?): linux-2.4.0-test11-pre4/drivers/sound/yss225.c compilefailure

On Tue, 14 Nov 2000, Jeff Garzik wrote:

> Bartlomiej Zolnierkiewicz wrote:
> >
> > On Mon, 13 Nov 2000, Adam J. Richter wrote:
> >
> > > linux-2.4.0-test11-pre4/drivers/sound/yss225.c uses __initdata
> > > but does not include <linux/init.h>, so it could not compile. I have
> > > attached below.
> > >
> > > Note that I am a bit uncertain about the correctness of
> > > the __initdata prefix here in the first place. Is yss225 a PCI
> > > device? If so, a kernel that supports PCI hot plugging should
> > > be prepared to support the possibility of a hot pluggable yss225
> > > card being inserted after the module has already been initialized.
> > > Even if no CardBus or CompactPCI version of yss225 hardware exists
> > > yet, it will require less maintenance for PCI drivers to be prepared
> > > for this possibility from the outset (besides, is it possible to have a
> > > hot pluggable PCI bridge card that bridges to a regular PCI bus?).
> >
> > Good question....
>

I mean question about h-p PCI bridge card that bridges regular PCI bus...

> Please err on the conservative side -- IMHO you shouldn't mark a driver
> as hotpluggable (by using the '__dev' prefix) unless you know it is
> necessary.
>
> Otherwise, you rob CONFIG_HOTPLUG people of some memory that could
> otherwise be freed at boot. And the number of CONFIG_HOTPLUG people is
> not small, it includes not only the CardBus users but USB users too...
>
> Jeff

I fully agree. That's why "hotplugging" drivers requires some more
effort then just adding __devfoo instead of __foo.
Jeff, have you read last coment in my mail?

--
Bartlomiej Zolnierkiewicz
<[email protected]>