export pci_table in aic7xxx for Hotplug
Subsystems (2)
PATCH 1/1 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é
Signature · 2 lines
Christophe Barbé <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E
drivers/scsi/aic7xxx/aic7xxx_linux_pci.c +5 -0
@@ -33,6 +33,9 @@#include "aic7xxx_osm.h" +#define __NO_VERSION__ +#include <linux/module.h> +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,4 ,0 )struct pci_device_id {
@@ -56,6 +59,8 @@ }, { 0 } }; + +MODULE_DEVICE_TABLE (pci, ahc_linux_pci_id_table);struct pci_driver aic7xxx_pci_driver = { name:"aic7xxx" ,
Quoted 4 lines
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
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
Quoted 14 lines · Justin T. Gibbs
Quoted 1 line
Attached to this mail is a patch (against 2.4.12) that export the PCI
table
Quoted 3 lines
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
Signature · 2 lines
Christophe Barbé <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E
Quoted 3 lines
I have defined
__NO_VERSION__before includingmodule.hbecause in my understanding this is required when you include it in a multi-files module. Only one file must includemodule.hwithout 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?
Quoted 2 lines
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
Quoted 6 lines · Justin T. Gibbs
Quoted 3 lines
I have defined
__NO_VERSION__before includingmodule.hbecause in my understanding this is required when you include it in a multi-files module. Only one file must includemodule.hwithout defining the__NO_VERSION__.I can find no reference to "
__NO_VERSION__" inmodule.hor 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.
Quoted 7 lines · Justin T. Gibbs
Quoted 2 lines
I have defined
__NO_VERSION__before includingmodule.hbecause in my understanding this is required when you include it in a multi-filesmodule.
Quoted 1 line
Only one file must include
module.hwithout defining the__NO_VERSION__.I can find no reference to "
__NO_VERSION__" inmodule.hor 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.
Quoted 5 lines
Quoted 1 line
I remember to read something about a repository for your new driver.
Please
Quoted 1 line
could you point it to me and I will try it ASAP.
Thank, I will check it.
Quoted 4 lines
--
Justin
Signature · 2 lines
Christophe Barbé <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E
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
Quoted 17 lines · Justin T. Gibbs
Quoted 2 lines
I have defined
__NO_VERSION__before includingmodule.hbecause in my understanding this is required when you include it in a multi-filesmodule.
Quoted 1 line
Only one file must include
module.hwithout defining the__NO_VERSION__.I can find no reference to "
__NO_VERSION__" inmodule.hor the files
it includes. Perhaps this is a requirement for old kernels?Quoted 1 line
I remember to read something about a repository for your new driver.
Please
Quoted 1 line
could you point it to me and I will try it ASAP.
http://people.FreeBSD.org/~gibbs/linux/
--
Justin
Signature · 2 lines
Christophe Barbé <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E
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
Quoted 35 lines · christophe barbe
I've patch my kernel with aic7xxx v6.2.4. The
pci_tableis 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,
ChristopheQuoted 17 lines · Justin T. Gibbs
Quoted 2 lines
I have defined
__NO_VERSION__before includingmodule.hbecause in my understanding this is required when you include it in a multi-filesmodule.
Quoted 1 line
Only one file must include
module.hwithout defining the__NO_VERSION__.I can find no reference to "
__NO_VERSION__" inmodule.hor the files
it includes. Perhaps this is a requirement for old kernels?Quoted 1 line
I remember to read something about a repository for your new driver.
Please
Quoted 1 line
could you point it to me and I will try it ASAP.
http://people.FreeBSD.org/~gibbs/linux/
--
JustinSignature · 7 lines
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/
Signature · 2 lines
Christophe Barbé <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E
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 functionahc_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
Signature · 2 lines
Christophe Barbé <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E
Quoted 6 lines
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 thepci_driverstruct.
Quoted 6 lines
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-)
Quoted 2 lines
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
Just in case I attach the oops and the associated ksymoops output.
Christophe
Quoted 28 lines · christophe barbé
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 thepci_driverstruct.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
Signature · 8 lines
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/
Signature · 2 lines
Christophe Barbé <[email protected]> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8 F67A 8F45 2F1E D72C B41E