2001-10-15 17:59:36

by christophe barbé

[permalink] [raw]
Subject: [PATCH] export pci_table in aic7xxx for Hotplug

Attached to this mail is a patch (against 2.4.12) that export the PCI table
for the hotplug code (via modules.pcimaps).

I use it succesfully with my Adaptec APA1480A cardbus and the hotplug code.

Christophe Barb?


--
Christophe Barb? <[email protected]>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E


Attachments:
aic7xxx-k2412-bis.patch (478.00 B)

2001-10-15 19:01:54

by Justin T. Gibbs

[permalink] [raw]
Subject: Re: [PATCH] export pci_table in aic7xxx for Hotplug

>Attached to this mail is a patch (against 2.4.12) that export the PCI table
>for the hotplug code (via modules.pcimaps).
>
>I use it succesfully with my Adaptec APA1480A cardbus and the hotplug code.

Does the code in v6.2.4 of the aic7xxx driver work for you? Other than
the "__NO_VERSION__" stuff (which I'll have to look into), it seems
identical to what is in that version of the driver.

--
Justin

2001-10-15 20:23:06

by christophe barbé

[permalink] [raw]
Subject: Re: [PATCH] export pci_table in aic7xxx for Hotplug

I have defined __NO_VERSION__ before including module.h because in my
understanding this is required when you include it in a multi-files module.
Only one file must include module.h without defining the __NO_VERSION__.

I remember to read something about a repository for your new driver. Please
could you point it to me and I will try it ASAP.

Thanks,
Christophe

Le 2001.10.15 21:02:02 +0200, Justin T. Gibbs a ?crit :
> >Attached to this mail is a patch (against 2.4.12) that export the PCI
> table
> >for the hotplug code (via modules.pcimaps).
> >
> >I use it succesfully with my Adaptec APA1480A cardbus and the hotplug
> code.
>
> Does the code in v6.2.4 of the aic7xxx driver work for you? Other than
> the "__NO_VERSION__" stuff (which I'll have to look into), it seems
> identical to what is in that version of the driver.
>
> --
> Justin
>
--
Christophe Barb? <[email protected]>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E

2001-10-15 20:32:08

by Justin T. Gibbs

[permalink] [raw]
Subject: Re: [PATCH] export pci_table in aic7xxx for Hotplug

>I have defined __NO_VERSION__ before including module.h because in my
>understanding this is required when you include it in a multi-files module.
>Only one file must include module.h without defining the __NO_VERSION__.

I can find no reference to "__NO_VERSION__" in module.h or the files
it includes. Perhaps this is a requirement for old kernels?

>I remember to read something about a repository for your new driver. Please
>could you point it to me and I will try it ASAP.

http://people.FreeBSD.org/~gibbs/linux/

--
Justin

2001-10-15 20:45:39

by christophe barbé

[permalink] [raw]
Subject: Re: [PATCH] export pci_table in aic7xxx for Hotplug


Le 2001.10.15 22:31:47 +0200, Justin T. Gibbs a ?crit :
> >I have defined __NO_VERSION__ before including module.h because in my
> >understanding this is required when you include it in a multi-files
> module.
> >Only one file must include module.h without defining the __NO_VERSION__.
>
> I can find no reference to "__NO_VERSION__" in module.h or the files
> it includes. Perhaps this is a requirement for old kernels?

Perhaps I take it from the 2nd edition of Linux Device Drivers (normally
uptodate) but I should said that I've not checked in the .h file.
I guess it's at least harmless but if it works without it's better without.

> >I remember to read something about a repository for your new driver.
> Please
> >could you point it to me and I will try it ASAP.
>
> http://people.FreeBSD.org/~gibbs/linux/

Thank, I will check it.

>
> --
> Justin
>
--
Christophe Barb? <[email protected]>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E

2001-10-16 04:41:27

by Keith Owens

[permalink] [raw]
Subject: Re: [PATCH] export pci_table in aic7xxx for Hotplug

On Mon, 15 Oct 2001 14:31:47 -0600,
"Justin T. Gibbs" <[email protected]> wrote:
>>I have defined __NO_VERSION__ before including module.h because in my
>>understanding this is required when you include it in a multi-files module.
>>Only one file must include module.h without defining the __NO_VERSION__.
>
>I can find no reference to "__NO_VERSION__" in module.h or the files
>it includes. Perhaps this is a requirement for old kernels?

__NO_VERSION__ used to be required in multi part modules but too many
people got it wrong so I removed it in 2.3 kernels, fixing the problem
in a diffrent way. Removing all defines of __NO_VERSION__ is on my
clean up list for 2.5.

2001-10-16 16:18:01

by christophe barbé

[permalink] [raw]
Subject: Re: [PATCH] export pci_table in aic7xxx for Hotplug

I've patch my kernel with aic7xxx v6.2.4. The pci_table is correctly
exported.
I've a little problem (Oops) when I hot-remove the card and try to mount a
device no more available. But I believe it's a hotplug issue so I will mail
details to the hotplug ml.

Thank,
Christophe

Le 2001.10.15 22:31:47 +0200, Justin T. Gibbs a ?crit :
> >I have defined __NO_VERSION__ before including module.h because in my
> >understanding this is required when you include it in a multi-files
> module.
> >Only one file must include module.h without defining the __NO_VERSION__.
>
> I can find no reference to "__NO_VERSION__" in module.h or the files
> it includes. Perhaps this is a requirement for old kernels?
>
> >I remember to read something about a repository for your new driver.
> Please
> >could you point it to me and I will try it ASAP.
>
> http://people.FreeBSD.org/~gibbs/linux/
>
> --
> Justin
>
--
Christophe Barb? <[email protected]>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E

2001-10-16 20:16:39

by christophe barbé

[permalink] [raw]
Subject: Re: [PATCH] export pci_table in aic7xxx for Hotplug

About the Oops, I think it's a hotplug problem but I could be wrong.

I get a Oops when I do the following :

. Insert my card (card detected and driver loaded)
. mount /dev/sdc0 /cdrw
. use /cdrw
. umount /cdrw
. Remove the card (remove event detected but driver not unloaded)
. mount /dev/sdc0 /cdrw (oops and mount segfault)

lspci show the adaptec card after insertion and no more after removing.

Actually the hotplug stuff doesn't unload the driver. This is not simple
because another card can use the driver. This is a new problem compared
to pcmcia stuff where you use a specific module.

My understanding is that the hotplug code should notify to the driver
that a device managed by it has been removed. And the driver should
rescan for available devices.

I can send you the oops but I'm convinced that the Oops is caused by the
aic7xxx driver accessing a no more there device.

Is there a common way to ask to a driver to rescan it's devices (an
IOCTL). I'm afraid that not but it looks like a generic hotplug problem.

Christophe

On Tue, Oct 16, 2001 at 06:17:26PM +0200, christophe barbe wrote:
> I've patch my kernel with aic7xxx v6.2.4. The pci_table is correctly
> exported.
> I've a little problem (Oops) when I hot-remove the card and try to mount a
> device no more available. But I believe it's a hotplug issue so I will mail
> details to the hotplug ml.
>
> Thank,
> Christophe
>
> Le 2001.10.15 22:31:47 +0200, Justin T. Gibbs a ?crit :
> > >I have defined __NO_VERSION__ before including module.h because in my
> > >understanding this is required when you include it in a multi-files
> > module.
> > >Only one file must include module.h without defining the __NO_VERSION__.
> >
> > I can find no reference to "__NO_VERSION__" in module.h or the files
> > it includes. Perhaps this is a requirement for old kernels?
> >
> > >I remember to read something about a repository for your new driver.
> > Please
> > >could you point it to me and I will try it ASAP.
> >
> > http://people.FreeBSD.org/~gibbs/linux/
> >
> > --
> > Justin
> >
> --
> Christophe Barb? <[email protected]>
> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--
Christophe Barb? <[email protected]>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E

2001-10-16 20:50:34

by christophe barbé

[permalink] [raw]
Subject: Re: [PATCH] export pci_table in aic7xxx for Hotplug

Ok I switch ON the light in my brain and things are better now.

The PCI layer notify the driver that one of its devices has been
removed.
This is done with the remove function in the pci_driver struct.

In the case of the aic7xxx this is the function
ahc_linux_pci_dev_remove().

I should, at this point, precise that I use the driver v6.2.4.

I look in the code but it looks like this part of the code is broken.
Please Justin let me 1 month before starting looking at it. Otherwise I
have no chance to find a bug by myself.

Christophe


--
Christophe Barb? <[email protected]>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E

2001-10-16 20:59:16

by christophe barbé

[permalink] [raw]
Subject: Re: [PATCH] export pci_table in aic7xxx for Hotplug

Just in case I attach the oops and the associated ksymoops output.

Christophe


Le 2001.10.16 22:50:49 +0200, christophe barb? a ?crit :
> Ok I switch ON the light in my brain and things are better now.
>
> The PCI layer notify the driver that one of its devices has been
> removed.
> This is done with the remove function in the pci_driver struct.
>
> In the case of the aic7xxx this is the function
> ahc_linux_pci_dev_remove().
>
> I should, at this point, precise that I use the driver v6.2.4.
>
> I look in the code but it looks like this part of the code is broken.
> Please Justin let me 1 month before starting looking at it. Otherwise I
> have no chance to find a bug by myself.
>
> Christophe
>
>
> --
> Christophe Barb? <[email protected]>
> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Christophe Barb? <[email protected]>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E


Attachments:
oops.mount (1.69 kB)
ksymoops.mount (3.76 kB)
Download all attachments

2001-10-16 21:19:02

by Justin T. Gibbs

[permalink] [raw]
Subject: Re: [PATCH] export pci_table in aic7xxx for Hotplug

>Ok I switch ON the light in my brain and things are better now.
>
>The PCI layer notify the driver that one of its devices has been
>removed.
>This is done with the remove function in the pci_driver struct.
>
>In the case of the aic7xxx this is the function
>ahc_linux_pci_dev_remove().
>
>I should, at this point, precise that I use the driver v6.2.4.
>
>I look in the code but it looks like this part of the code is broken.

How so? Because of the panic or something evident in the code?
I'm always interested in bug reports. 8-)

>Please Justin let me 1 month before starting looking at it. Otherwise I
>have no chance to find a bug by myself.

Well, it will be a few days before I get a laptop setup to test this
on, but from what I can tell, we properly unregister our bus from the
SCSI subsystem, but the actual devices hanging off the bus are never
removed. I would expect the mid-layer to take care of this.

--
Justin