Skip to contentSkip to conversation

export pci_table in aic7xxx for Hotplug

PATCH In review christophe barbe 5 participants 11 messages Oct 15, 2001 – Oct 16, 2001

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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",
#1 lore raw
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

#2 lore raw
In reply to christophe barbe

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
#3 lore raw
Quoted 3 lines

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?

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

#4 lore raw
Quoted 6 lines · Justin T. Gibbs
Quoted 3 lines

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.

#5 lore raw
In reply to christophe barbe
Quoted 7 lines · Justin T. Gibbs
Quoted 2 lines

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.

Quoted 1 line

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.

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.

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

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
#6 lore raw
In reply to christophe barbe

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 including module.h because in my understanding this is required when you include it in a multi-files

module.

Quoted 1 line

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?

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
#7 lore raw
In reply to christophe barbe

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_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 including module.h because in my understanding this is required when you include it in a multi-files

module.

Quoted 1 line

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?

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 · 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
#8 lore raw
In reply to christophe barbe

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

Signature · 2 lines
Christophe Barbé <[email protected]>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8  F67A 8F45 2F1E D72C B41E
#9 lore raw
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 the pci_driver struct.

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

#10 lore raw
In reply to christophe barbe

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

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