* [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers
@ 2004-06-21 14:14 Andi Kleen
2004-06-21 13:44 ` Sergey Vlasov
2004-06-21 15:30 ` Luben Tuikov
0 siblings, 2 replies; 10+ messages in thread
From: Andi Kleen @ 2004-06-21 14:14 UTC (permalink / raw)
To: linux-scsi
[I didn't find an aic7xxx maintainer in MAINTAINERS, so just sending
to the list]
This is needed for 2.6 hotplug where the driver is autoloaded. When you have
multiple conflicting entries the hotplug module loader usually loads
the first one listed, which may be correct or may be not.
With these changes the drivers announce the correct PCI IDs.
The patches are quite big (i had to move the ID tables into an include),
but mostly mechanical.
I only tested it on a single 78xx, so it's possible that i made
a typo somewhere. Some testing would be appreciated, especially
on 79xx
There is still an conflicting entry for aic7xxx_old unfortunately. This
is hard to handle in hotplug. I think the right solution would be to somehow
tag drivers as obsolete so that they aren't loaded by default. This will
need an extension in the module pci table mechanism. I'm thinking about
a a new MODULE_OBSOLETE macro for this and a obsolete_modules table generated
at modules_install time. But that's for another patch. Better would be
maybe to just drop the aic7xxx_old driver. Is it really still needed?
-Andi
diff -u linux/drivers/scsi/aic7xxx/aic79xx_pci.c-o linux/drivers/scsi/aic7xxx/aic79xx_pci.c
--- linux/drivers/scsi/aic7xxx/aic79xx_pci.c-o 2004-03-21 21:11:51.000000000 +0100
+++ linux/drivers/scsi/aic7xxx/aic79xx_pci.c 2004-06-21 15:15:28.000000000 +0200
@@ -51,46 +51,7 @@
#include <dev/aic7xxx/aic79xx_inline.h>
#endif
-static __inline uint64_t
-ahd_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor)
-{
- uint64_t id;
-
- id = subvendor
- | (subdevice << 16)
- | ((uint64_t)vendor << 32)
- | ((uint64_t)device << 48);
-
- return (id);
-}
-
-#define ID_ALL_MASK 0xFFFFFFFFFFFFFFFFull
-#define ID_ALL_IROC_MASK 0xFFFFFF7FFFFFFFFFull
-#define ID_DEV_VENDOR_MASK 0xFFFFFFFF00000000ull
-#define ID_9005_GENERIC_MASK 0xFFF0FFFF00000000ull
-#define ID_9005_GENERIC_IROC_MASK 0xFFF0FF7F00000000ull
-
-#define ID_AIC7901 0x800F9005FFFF9005ull
-#define ID_AHA_29320A 0x8000900500609005ull
-#define ID_AHA_29320ALP 0x8017900500449005ull
-
-#define ID_AIC7901A 0x801E9005FFFF9005ull
-#define ID_AHA_29320 0x8012900500429005ull
-#define ID_AHA_29320B 0x8013900500439005ull
-#define ID_AHA_29320LP 0x8014900500449005ull
-
-#define ID_AIC7902 0x801F9005FFFF9005ull
-#define ID_AIC7902_B 0x801D9005FFFF9005ull
-#define ID_AHA_39320 0x8010900500409005ull
-#define ID_AHA_39320_B 0x8015900500409005ull
-#define ID_AHA_39320A 0x8016900500409005ull
-#define ID_AHA_39320D 0x8011900500419005ull
-#define ID_AHA_39320D_B 0x801C900500419005ull
-#define ID_AHA_39320D_HP 0x8011900500AC0E11ull
-#define ID_AHA_39320D_B_HP 0x801C900500AC0E11ull
-#define ID_AIC7902_PCI_REV_A4 0x3
-#define ID_AIC7902_PCI_REV_B0 0x10
-#define SUBID_HP 0x0E11
+#include "aic79xx_pci.h"
#define DEVID_9005_TYPE(id) ((id) & 0xF)
#define DEVID_9005_TYPE_HBA 0x0 /* Standard Card */
diff -u linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c-o linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
--- linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c-o 2004-03-21 21:11:51.000000000 +0100
+++ linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2004-06-21 15:39:28.000000000 +0200
@@ -41,6 +41,7 @@
#include "aic79xx_osm.h"
#include "aic79xx_inline.h"
+#include "aic79xx_pci.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
struct pci_device_id
@@ -58,12 +59,30 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
static void ahd_linux_pci_dev_remove(struct pci_dev *pdev);
-/* We do our own ID filtering. So, grab all SCSI storage class devices. */
static struct pci_device_id ahd_linux_pci_id_table[] = {
- {
- 0x9005, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- PCI_CLASS_STORAGE_SCSI << 8, 0xFFFF00, 0
- },
+#define LINUXID(x,s) (unsigned)((((x) >> s) & 0xffff) ?: PCI_ANY_ID)
+#define ID(x) \
+ { \
+ LINUXID(x,32), LINUXID(x,48), LINUXID(x,0), LINUXID(x,16), \
+ PCI_CLASS_STORAGE_SCSI << 8, 0xFFFF00, 0 \
+ }
+ ID(ID_AHA_29320A),
+ ID(ID_AHA_29320ALP),
+ ID(ID_AHA_29320),
+ ID(ID_AHA_29320B),
+ ID(ID_AHA_29320LP),
+ ID(ID_AHA_39320),
+ ID(ID_AHA_39320_B),
+ ID(ID_AHA_39320A),
+ ID(ID_AHA_39320D),
+ ID(ID_AHA_39320D_HP),
+ ID(ID_AHA_39320D_B),
+ ID(ID_AHA_39320D_B_HP),
+ ID(ID_AHA_29320),
+ ID(ID_AHA_29320B),
+ ID(ID_AIC7901 & ID_DEV_VENDOR_MASK),
+ ID(ID_AIC7901A & ID_DEV_VENDOR_MASK),
+ ID(ID_AIC7902 & ID_9005_GENERIC_MASK),
{ 0 }
};
diff -u /dev/null linux/drivers/scsi/aic7xxx/aic79xx_pci.h
--- /dev/null 2004-02-18 23:32:57.000000000 +0100
+++ linux/drivers/scsi/aic7xxx/aic79xx_pci.h 2004-06-21 15:04:07.000000000 +0200
@@ -0,0 +1,41 @@
+
+static __inline uint64_t
+ahd_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor)
+{
+ uint64_t id;
+
+ id = subvendor
+ | (subdevice << 16)
+ | ((uint64_t)vendor << 32)
+ | ((uint64_t)device << 48);
+
+ return (id);
+}
+
+#define ID_ALL_MASK 0xFFFFFFFFFFFFFFFFull
+#define ID_ALL_IROC_MASK 0xFFFFFF7FFFFFFFFFull
+#define ID_DEV_VENDOR_MASK 0xFFFFFFFF00000000ull
+#define ID_9005_GENERIC_MASK 0xFFF0FFFF00000000ull
+#define ID_9005_GENERIC_IROC_MASK 0xFFF0FF7F00000000ull
+
+#define ID_AIC7901 0x800F9005FFFF9005ull
+#define ID_AHA_29320A 0x8000900500609005ull
+#define ID_AHA_29320ALP 0x8017900500449005ull
+
+#define ID_AIC7901A 0x801E9005FFFF9005ull
+#define ID_AHA_29320 0x8012900500429005ull
+#define ID_AHA_29320B 0x8013900500439005ull
+#define ID_AHA_29320LP 0x8014900500449005ull
+
+#define ID_AIC7902 0x801F9005FFFF9005ull
+#define ID_AIC7902_B 0x801D9005FFFF9005ull
+#define ID_AHA_39320 0x8010900500409005ull
+#define ID_AHA_39320_B 0x8015900500409005ull
+#define ID_AHA_39320A 0x8016900500409005ull
+#define ID_AHA_39320D 0x8011900500419005ull
+#define ID_AHA_39320D_B 0x801C900500419005ull
+#define ID_AHA_39320D_HP 0x8011900500AC0E11ull
+#define ID_AHA_39320D_B_HP 0x801C900500AC0E11ull
+#define ID_AIC7902_PCI_REV_A4 0x3
+#define ID_AIC7902_PCI_REV_B0 0x10
+#define SUBID_HP 0x0E11
diff -u /dev/null linux/drivers/scsi/aic7xxx/aic7xxx_pci.h
--- /dev/null 2004-02-18 23:32:57.000000000 +0100
+++ linux/drivers/scsi/aic7xxx/aic7xxx_pci.h 2004-06-21 15:05:13.000000000 +0200
@@ -0,0 +1,92 @@
+
+static __inline uint64_t
+ahc_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor)
+{
+ uint64_t id;
+
+ id = subvendor
+ | (subdevice << 16)
+ | ((uint64_t)vendor << 32)
+ | ((uint64_t)device << 48);
+
+ return (id);
+}
+
+#define ID_ALL_MASK 0xFFFFFFFFFFFFFFFFull
+#define ID_DEV_VENDOR_MASK 0xFFFFFFFF00000000ull
+#define ID_9005_GENERIC_MASK 0xFFF0FFFF00000000ull
+#define ID_9005_SISL_MASK 0x000FFFFF00000000ull
+#define ID_9005_SISL_ID 0x0005900500000000ull
+#define ID_AIC7850 0x5078900400000000ull
+#define ID_AHA_2902_04_10_15_20C_30C 0x5078900478509004ull
+#define ID_AIC7855 0x5578900400000000ull
+#define ID_AIC7859 0x3860900400000000ull
+#define ID_AHA_2930CU 0x3860900438699004ull
+#define ID_AIC7860 0x6078900400000000ull
+#define ID_AIC7860C 0x6078900478609004ull
+#define ID_AHA_1480A 0x6075900400000000ull
+#define ID_AHA_2940AU_0 0x6178900400000000ull
+#define ID_AHA_2940AU_1 0x6178900478619004ull
+#define ID_AHA_2940AU_CN 0x2178900478219004ull
+#define ID_AHA_2930C_VAR 0x6038900438689004ull
+
+#define ID_AIC7870 0x7078900400000000ull
+#define ID_AHA_2940 0x7178900400000000ull
+#define ID_AHA_3940 0x7278900400000000ull
+#define ID_AHA_398X 0x7378900400000000ull
+#define ID_AHA_2944 0x7478900400000000ull
+#define ID_AHA_3944 0x7578900400000000ull
+#define ID_AHA_4944 0x7678900400000000ull
+
+#define ID_AIC7880 0x8078900400000000ull
+#define ID_AIC7880_B 0x8078900478809004ull
+#define ID_AHA_2940U 0x8178900400000000ull
+#define ID_AHA_3940U 0x8278900400000000ull
+#define ID_AHA_2944U 0x8478900400000000ull
+#define ID_AHA_3944U 0x8578900400000000ull
+#define ID_AHA_398XU 0x8378900400000000ull
+#define ID_AHA_4944U 0x8678900400000000ull
+#define ID_AHA_2940UB 0x8178900478819004ull
+#define ID_AHA_2930U 0x8878900478889004ull
+#define ID_AHA_2940U_PRO 0x8778900478879004ull
+#define ID_AHA_2940U_CN 0x0078900478009004ull
+
+#define ID_AIC7895 0x7895900478959004ull
+#define ID_AIC7895_ARO 0x7890900478939004ull
+#define ID_AIC7895_ARO_MASK 0xFFF0FFFFFFFFFFFFull
+#define ID_AHA_2940U_DUAL 0x7895900478919004ull
+#define ID_AHA_3940AU 0x7895900478929004ull
+#define ID_AHA_3944AU 0x7895900478949004ull
+
+#define ID_AIC7890 0x001F9005000F9005ull
+#define ID_AIC7890_ARO 0x00139005000F9005ull
+#define ID_AAA_131U2 0x0013900500039005ull
+#define ID_AHA_2930U2 0x0011900501819005ull
+#define ID_AHA_2940U2B 0x00109005A1009005ull
+#define ID_AHA_2940U2_OEM 0x0010900521809005ull
+#define ID_AHA_2940U2 0x00109005A1809005ull
+#define ID_AHA_2950U2B 0x00109005E1009005ull
+
+#define ID_AIC7892 0x008F9005FFFF9005ull
+#define ID_AIC7892_ARO 0x00839005FFFF9005ull
+#define ID_AHA_29160 0x00809005E2A09005ull
+#define ID_AHA_29160_CPQ 0x00809005E2A00E11ull
+#define ID_AHA_29160N 0x0080900562A09005ull
+#define ID_AHA_29160C 0x0080900562209005ull
+#define ID_AHA_29160B 0x00809005E2209005ull
+#define ID_AHA_19160B 0x0081900562A19005ull
+
+#define ID_AIC7896 0x005F9005FFFF9005ull
+#define ID_AIC7896_ARO 0x00539005FFFF9005ull
+#define ID_AHA_3950U2B_0 0x00509005FFFF9005ull
+#define ID_AHA_3950U2B_1 0x00509005F5009005ull
+#define ID_AHA_3950U2D_0 0x00519005FFFF9005ull
+#define ID_AHA_3950U2D_1 0x00519005B5009005ull
+
+#define ID_AIC7899 0x00CF9005FFFF9005ull
+#define ID_AIC7899_ARO 0x00C39005FFFF9005ull
+#define ID_AHA_3960D 0x00C09005F6209005ull
+#define ID_AHA_3960D_CPQ 0x00C09005F6200E11ull
+
+#define ID_AIC7810 0x1078900400000000ull
+#define ID_AIC7815 0x7815900400000000ull
diff -u linux/drivers/scsi/aic7xxx/aic7xxx_pci.c-o linux/drivers/scsi/aic7xxx/aic7xxx_pci.c
--- linux/drivers/scsi/aic7xxx/aic7xxx_pci.c-o 2004-03-21 21:11:51.000000000 +0100
+++ linux/drivers/scsi/aic7xxx/aic7xxx_pci.c 2004-06-21 15:15:24.000000000 +0200
@@ -54,101 +54,11 @@
#include <dev/aic7xxx/aic7xxx_93cx6.h>
#endif
+#include "aic7xxx_pci.h"
+
#define AHC_PCI_IOADDR PCIR_MAPS /* I/O Address */
#define AHC_PCI_MEMADDR (PCIR_MAPS + 4) /* Mem I/O Address */
-static __inline uint64_t
-ahc_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor)
-{
- uint64_t id;
-
- id = subvendor
- | (subdevice << 16)
- | ((uint64_t)vendor << 32)
- | ((uint64_t)device << 48);
-
- return (id);
-}
-
-#define ID_ALL_MASK 0xFFFFFFFFFFFFFFFFull
-#define ID_DEV_VENDOR_MASK 0xFFFFFFFF00000000ull
-#define ID_9005_GENERIC_MASK 0xFFF0FFFF00000000ull
-#define ID_9005_SISL_MASK 0x000FFFFF00000000ull
-#define ID_9005_SISL_ID 0x0005900500000000ull
-#define ID_AIC7850 0x5078900400000000ull
-#define ID_AHA_2902_04_10_15_20C_30C 0x5078900478509004ull
-#define ID_AIC7855 0x5578900400000000ull
-#define ID_AIC7859 0x3860900400000000ull
-#define ID_AHA_2930CU 0x3860900438699004ull
-#define ID_AIC7860 0x6078900400000000ull
-#define ID_AIC7860C 0x6078900478609004ull
-#define ID_AHA_1480A 0x6075900400000000ull
-#define ID_AHA_2940AU_0 0x6178900400000000ull
-#define ID_AHA_2940AU_1 0x6178900478619004ull
-#define ID_AHA_2940AU_CN 0x2178900478219004ull
-#define ID_AHA_2930C_VAR 0x6038900438689004ull
-
-#define ID_AIC7870 0x7078900400000000ull
-#define ID_AHA_2940 0x7178900400000000ull
-#define ID_AHA_3940 0x7278900400000000ull
-#define ID_AHA_398X 0x7378900400000000ull
-#define ID_AHA_2944 0x7478900400000000ull
-#define ID_AHA_3944 0x7578900400000000ull
-#define ID_AHA_4944 0x7678900400000000ull
-
-#define ID_AIC7880 0x8078900400000000ull
-#define ID_AIC7880_B 0x8078900478809004ull
-#define ID_AHA_2940U 0x8178900400000000ull
-#define ID_AHA_3940U 0x8278900400000000ull
-#define ID_AHA_2944U 0x8478900400000000ull
-#define ID_AHA_3944U 0x8578900400000000ull
-#define ID_AHA_398XU 0x8378900400000000ull
-#define ID_AHA_4944U 0x8678900400000000ull
-#define ID_AHA_2940UB 0x8178900478819004ull
-#define ID_AHA_2930U 0x8878900478889004ull
-#define ID_AHA_2940U_PRO 0x8778900478879004ull
-#define ID_AHA_2940U_CN 0x0078900478009004ull
-
-#define ID_AIC7895 0x7895900478959004ull
-#define ID_AIC7895_ARO 0x7890900478939004ull
-#define ID_AIC7895_ARO_MASK 0xFFF0FFFFFFFFFFFFull
-#define ID_AHA_2940U_DUAL 0x7895900478919004ull
-#define ID_AHA_3940AU 0x7895900478929004ull
-#define ID_AHA_3944AU 0x7895900478949004ull
-
-#define ID_AIC7890 0x001F9005000F9005ull
-#define ID_AIC7890_ARO 0x00139005000F9005ull
-#define ID_AAA_131U2 0x0013900500039005ull
-#define ID_AHA_2930U2 0x0011900501819005ull
-#define ID_AHA_2940U2B 0x00109005A1009005ull
-#define ID_AHA_2940U2_OEM 0x0010900521809005ull
-#define ID_AHA_2940U2 0x00109005A1809005ull
-#define ID_AHA_2950U2B 0x00109005E1009005ull
-
-#define ID_AIC7892 0x008F9005FFFF9005ull
-#define ID_AIC7892_ARO 0x00839005FFFF9005ull
-#define ID_AHA_29160 0x00809005E2A09005ull
-#define ID_AHA_29160_CPQ 0x00809005E2A00E11ull
-#define ID_AHA_29160N 0x0080900562A09005ull
-#define ID_AHA_29160C 0x0080900562209005ull
-#define ID_AHA_29160B 0x00809005E2209005ull
-#define ID_AHA_19160B 0x0081900562A19005ull
-
-#define ID_AIC7896 0x005F9005FFFF9005ull
-#define ID_AIC7896_ARO 0x00539005FFFF9005ull
-#define ID_AHA_3950U2B_0 0x00509005FFFF9005ull
-#define ID_AHA_3950U2B_1 0x00509005F5009005ull
-#define ID_AHA_3950U2D_0 0x00519005FFFF9005ull
-#define ID_AHA_3950U2D_1 0x00519005B5009005ull
-
-#define ID_AIC7899 0x00CF9005FFFF9005ull
-#define ID_AIC7899_ARO 0x00C39005FFFF9005ull
-#define ID_AHA_3960D 0x00C09005F6209005ull
-#define ID_AHA_3960D_CPQ 0x00C09005F6200E11ull
-
-#define ID_AIC7810 0x1078900400000000ull
-#define ID_AIC7815 0x7815900400000000ull
-
#define DEVID_9005_TYPE(id) ((id) & 0xF)
#define DEVID_9005_TYPE_HBA 0x0 /* Standard Card */
#define DEVID_9005_TYPE_AAA 0x3 /* RAID Card */
diff -u linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c-o linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
--- linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c-o 2004-03-21 21:11:51.000000000 +0100
+++ linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c 2004-06-21 15:39:42.000000000 +0200
@@ -40,6 +40,7 @@
*/
#include "aic7xxx_osm.h"
+#include "aic7xxx_pci.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
struct pci_device_id
@@ -57,16 +58,73 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
static void ahc_linux_pci_dev_remove(struct pci_dev *pdev);
-/* We do our own ID filtering. So, grab all SCSI storage class devices. */
static struct pci_device_id ahc_linux_pci_id_table[] = {
- {
- 0x9004, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- PCI_CLASS_STORAGE_SCSI << 8, 0xFFFF00, 0
- },
- {
- 0x9005, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- PCI_CLASS_STORAGE_SCSI << 8, 0xFFFF00, 0
- },
+#define LINUXID(x,s) (unsigned)((((x) >> s) & 0xffff) ?: PCI_ANY_ID)
+#define ID(x) \
+ { \
+ LINUXID(x,32), LINUXID(x,48), LINUXID(x,0), LINUXID(x,16), \
+ PCI_CLASS_STORAGE_SCSI << 8, 0xFFFF00, 0 \
+ }
+ ID(ID_AHA_2902_04_10_15_20C_30C),
+ ID(ID_AHA_2930CU),
+ ID(ID_AHA_1480A & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_2940AU_0 & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_2940AU_CN & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_2930C_VAR & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_2940),
+ ID(ID_AHA_3940),
+ ID(ID_AHA_398X),
+ ID(ID_AHA_2944),
+ ID(ID_AHA_3944),
+ ID(ID_AHA_4944),
+ ID(ID_AHA_2940U & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_3940U & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_2944U & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_3944U & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_398XU & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_4944U & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_2930U & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_2940U_PRO & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_2940U_CN & ID_DEV_VENDOR_MASK),
+ ID(ID_AHA_2930U2),
+ ID(ID_AHA_2940U2B),
+ ID(ID_AHA_2940U2_OEM),
+ ID(ID_AHA_2940U2),
+ ID(ID_AHA_2950U2B),
+ ID(ID_AIC7890_ARO),
+ ID(ID_AAA_131U2),
+ ID(ID_AHA_29160),
+ ID(ID_AHA_29160_CPQ),
+ ID(ID_AHA_29160N),
+ ID(ID_AHA_29160C),
+ ID(ID_AHA_29160B),
+ ID(ID_AHA_19160B),
+ ID(ID_AIC7892_ARO),
+ ID(ID_AHA_2940U_DUAL),
+ ID(ID_AHA_3940AU),
+ ID(ID_AHA_3944AU),
+ ID(ID_AIC7895_ARO),
+ ID(ID_AHA_3950U2B_0),
+ ID(ID_AHA_3950U2B_1),
+ ID(ID_AHA_3950U2D_0),
+ ID(ID_AHA_3950U2D_1),
+ ID(ID_AIC7896_ARO),
+ ID(ID_AHA_3960D),
+ ID(ID_AHA_3960D_CPQ),
+ ID(ID_AIC7899_ARO),
+ ID(ID_AIC7850 & ID_DEV_VENDOR_MASK),
+ ID(ID_AIC7855 & ID_DEV_VENDOR_MASK),
+ ID(ID_AIC7859 & ID_DEV_VENDOR_MASK),
+ ID(ID_AIC7860 & ID_DEV_VENDOR_MASK),
+ ID(ID_AIC7870 & ID_DEV_VENDOR_MASK),
+ ID(ID_AIC7880 & ID_DEV_VENDOR_MASK),
+ ID(ID_AIC7890 & ID_9005_GENERIC_MASK),
+ ID(ID_AIC7892 & ID_9005_GENERIC_MASK),
+ ID(ID_AIC7895 & ID_DEV_VENDOR_MASK),
+ ID(ID_AIC7896 & ID_9005_GENERIC_MASK),
+ ID(ID_AIC7899 & ID_9005_GENERIC_MASK),
+ ID(ID_AIC7810 & ID_DEV_VENDOR_MASK),
+ ID(ID_AIC7815 & ID_DEV_VENDOR_MASK),
{ 0 }
};
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers 2004-06-21 14:14 [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers Andi Kleen @ 2004-06-21 13:44 ` Sergey Vlasov 2004-06-21 16:24 ` Andi Kleen 2004-06-21 15:30 ` Luben Tuikov 1 sibling, 1 reply; 10+ messages in thread From: Sergey Vlasov @ 2004-06-21 13:44 UTC (permalink / raw) To: Andi Kleen; +Cc: linux-scsi [-- Attachment #1: Type: text/plain, Size: 637 bytes --] On Mon, 21 Jun 2004 16:14:41 +0200 Andi Kleen wrote: > This is needed for 2.6 hotplug where the driver is autoloaded. When you have > multiple conflicting entries the hotplug module loader usually loads > the first one listed, which may be correct or may be not. > > With these changes the drivers announce the correct PCI IDs. Unfortunately, the patch does not seem to be correct :( struct pci_device_id does not have the mask field, therefore the ID_9005_GENERIC_MASK restriction cannot be specified other than by listing all 16 possible IDs as separate entries. Your patch adds only one entry, thus losing 15 other possible IDs. [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers 2004-06-21 13:44 ` Sergey Vlasov @ 2004-06-21 16:24 ` Andi Kleen 2004-06-21 16:10 ` Sergey Vlasov 0 siblings, 1 reply; 10+ messages in thread From: Andi Kleen @ 2004-06-21 16:24 UTC (permalink / raw) To: Sergey Vlasov; +Cc: linux-scsi On Mon, 21 Jun 2004 17:44:08 +0400 Sergey Vlasov <vsu@altlinux.ru> wrote: > On Mon, 21 Jun 2004 16:14:41 +0200 Andi Kleen wrote: > > > This is needed for 2.6 hotplug where the driver is autoloaded. When you have > > multiple conflicting entries the hotplug module loader usually loads > > the first one listed, which may be correct or may be not. > > > > With these changes the drivers announce the correct PCI IDs. > > Unfortunately, the patch does not seem to be correct :( > > struct pci_device_id does not have the mask field, therefore the > ID_9005_GENERIC_MASK restriction cannot be specified other than by > listing all 16 possible IDs as separate entries. Your patch adds only > one entry, thus losing 15 other possible IDs. Hmm, good point. Thanks for catching this. Here is a new patch. Does this one look better? -Andi diff -u linux/drivers/scsi/aic7xxx/aic79xx_pci.c-o linux/drivers/scsi/aic7xxx/aic79xx_pci.c --- linux/drivers/scsi/aic7xxx/aic79xx_pci.c-o 2004-03-21 21:11:51.000000000 +0100 +++ linux/drivers/scsi/aic7xxx/aic79xx_pci.c 2004-06-21 15:15:28.000000000 +0200 @@ -51,46 +51,7 @@ #include <dev/aic7xxx/aic79xx_inline.h> #endif -static __inline uint64_t -ahd_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor) -{ - uint64_t id; - - id = subvendor - | (subdevice << 16) - | ((uint64_t)vendor << 32) - | ((uint64_t)device << 48); - - return (id); -} - -#define ID_ALL_MASK 0xFFFFFFFFFFFFFFFFull -#define ID_ALL_IROC_MASK 0xFFFFFF7FFFFFFFFFull -#define ID_DEV_VENDOR_MASK 0xFFFFFFFF00000000ull -#define ID_9005_GENERIC_MASK 0xFFF0FFFF00000000ull -#define ID_9005_GENERIC_IROC_MASK 0xFFF0FF7F00000000ull - -#define ID_AIC7901 0x800F9005FFFF9005ull -#define ID_AHA_29320A 0x8000900500609005ull -#define ID_AHA_29320ALP 0x8017900500449005ull - -#define ID_AIC7901A 0x801E9005FFFF9005ull -#define ID_AHA_29320 0x8012900500429005ull -#define ID_AHA_29320B 0x8013900500439005ull -#define ID_AHA_29320LP 0x8014900500449005ull - -#define ID_AIC7902 0x801F9005FFFF9005ull -#define ID_AIC7902_B 0x801D9005FFFF9005ull -#define ID_AHA_39320 0x8010900500409005ull -#define ID_AHA_39320_B 0x8015900500409005ull -#define ID_AHA_39320A 0x8016900500409005ull -#define ID_AHA_39320D 0x8011900500419005ull -#define ID_AHA_39320D_B 0x801C900500419005ull -#define ID_AHA_39320D_HP 0x8011900500AC0E11ull -#define ID_AHA_39320D_B_HP 0x801C900500AC0E11ull -#define ID_AIC7902_PCI_REV_A4 0x3 -#define ID_AIC7902_PCI_REV_B0 0x10 -#define SUBID_HP 0x0E11 +#include "aic79xx_pci.h" #define DEVID_9005_TYPE(id) ((id) & 0xF) #define DEVID_9005_TYPE_HBA 0x0 /* Standard Card */ diff -u linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c-o linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c --- linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c-o 2004-03-21 21:11:51.000000000 +0100 +++ linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c 2004-06-21 18:23:15.000000000 +0200 @@ -41,6 +41,7 @@ #include "aic79xx_osm.h" #include "aic79xx_inline.h" +#include "aic79xx_pci.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) struct pci_device_id @@ -58,12 +59,34 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) static void ahd_linux_pci_dev_remove(struct pci_dev *pdev); -/* We do our own ID filtering. So, grab all SCSI storage class devices. */ static struct pci_device_id ahd_linux_pci_id_table[] = { - { - 0x9005, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, - PCI_CLASS_STORAGE_SCSI << 8, 0xFFFF00, 0 - }, +#define LINUXID(x,s) (unsigned)((((x) >> s) & 0xffff) ?: PCI_ANY_ID) +#define ID(x) \ + { \ + LINUXID(x,32), LINUXID(x,48), LINUXID(x,0), LINUXID(x,16), \ + PCI_CLASS_STORAGE_SCSI << 8, 0xFFFF00, 0 \ + } +#define ID4(x,y) \ + ID(x | ((y+0)<<48)), ID(x | ((y+1)<<48)), ID(x | ((y+2)<<48)), \ + ID(x | ((y+3)<<48)) +#define ID16(x) ID4(x,0ULL), ID4(x,4ULL), ID4(x,8ULL), ID4(x,12ULL) + ID(ID_AHA_29320A), + ID(ID_AHA_29320ALP), + ID(ID_AHA_29320), + ID(ID_AHA_29320B), + ID(ID_AHA_29320LP), + ID(ID_AHA_39320), + ID(ID_AHA_39320_B), + ID(ID_AHA_39320A), + ID(ID_AHA_39320D), + ID(ID_AHA_39320D_HP), + ID(ID_AHA_39320D_B), + ID(ID_AHA_39320D_B_HP), + ID(ID_AHA_29320), + ID(ID_AHA_29320B), + ID(ID_AIC7901 & ID_DEV_VENDOR_MASK), + ID(ID_AIC7901A & ID_DEV_VENDOR_MASK), + ID16(ID_AIC7902), { 0 } }; diff -u /dev/null linux/drivers/scsi/aic7xxx/aic79xx_pci.h --- /dev/null 2004-02-18 23:32:57.000000000 +0100 +++ linux/drivers/scsi/aic7xxx/aic79xx_pci.h 2004-06-21 15:04:07.000000000 +0200 @@ -0,0 +1,41 @@ + +static __inline uint64_t +ahd_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor) +{ + uint64_t id; + + id = subvendor + | (subdevice << 16) + | ((uint64_t)vendor << 32) + | ((uint64_t)device << 48); + + return (id); +} + +#define ID_ALL_MASK 0xFFFFFFFFFFFFFFFFull +#define ID_ALL_IROC_MASK 0xFFFFFF7FFFFFFFFFull +#define ID_DEV_VENDOR_MASK 0xFFFFFFFF00000000ull +#define ID_9005_GENERIC_MASK 0xFFF0FFFF00000000ull +#define ID_9005_GENERIC_IROC_MASK 0xFFF0FF7F00000000ull + +#define ID_AIC7901 0x800F9005FFFF9005ull +#define ID_AHA_29320A 0x8000900500609005ull +#define ID_AHA_29320ALP 0x8017900500449005ull + +#define ID_AIC7901A 0x801E9005FFFF9005ull +#define ID_AHA_29320 0x8012900500429005ull +#define ID_AHA_29320B 0x8013900500439005ull +#define ID_AHA_29320LP 0x8014900500449005ull + +#define ID_AIC7902 0x801F9005FFFF9005ull +#define ID_AIC7902_B 0x801D9005FFFF9005ull +#define ID_AHA_39320 0x8010900500409005ull +#define ID_AHA_39320_B 0x8015900500409005ull +#define ID_AHA_39320A 0x8016900500409005ull +#define ID_AHA_39320D 0x8011900500419005ull +#define ID_AHA_39320D_B 0x801C900500419005ull +#define ID_AHA_39320D_HP 0x8011900500AC0E11ull +#define ID_AHA_39320D_B_HP 0x801C900500AC0E11ull +#define ID_AIC7902_PCI_REV_A4 0x3 +#define ID_AIC7902_PCI_REV_B0 0x10 +#define SUBID_HP 0x0E11 diff -u /dev/null linux/drivers/scsi/aic7xxx/aic7xxx_pci.h --- /dev/null 2004-02-18 23:32:57.000000000 +0100 +++ linux/drivers/scsi/aic7xxx/aic7xxx_pci.h 2004-06-21 15:05:13.000000000 +0200 @@ -0,0 +1,92 @@ + +static __inline uint64_t +ahc_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor) +{ + uint64_t id; + + id = subvendor + | (subdevice << 16) + | ((uint64_t)vendor << 32) + | ((uint64_t)device << 48); + + return (id); +} + +#define ID_ALL_MASK 0xFFFFFFFFFFFFFFFFull +#define ID_DEV_VENDOR_MASK 0xFFFFFFFF00000000ull +#define ID_9005_GENERIC_MASK 0xFFF0FFFF00000000ull +#define ID_9005_SISL_MASK 0x000FFFFF00000000ull +#define ID_9005_SISL_ID 0x0005900500000000ull +#define ID_AIC7850 0x5078900400000000ull +#define ID_AHA_2902_04_10_15_20C_30C 0x5078900478509004ull +#define ID_AIC7855 0x5578900400000000ull +#define ID_AIC7859 0x3860900400000000ull +#define ID_AHA_2930CU 0x3860900438699004ull +#define ID_AIC7860 0x6078900400000000ull +#define ID_AIC7860C 0x6078900478609004ull +#define ID_AHA_1480A 0x6075900400000000ull +#define ID_AHA_2940AU_0 0x6178900400000000ull +#define ID_AHA_2940AU_1 0x6178900478619004ull +#define ID_AHA_2940AU_CN 0x2178900478219004ull +#define ID_AHA_2930C_VAR 0x6038900438689004ull + +#define ID_AIC7870 0x7078900400000000ull +#define ID_AHA_2940 0x7178900400000000ull +#define ID_AHA_3940 0x7278900400000000ull +#define ID_AHA_398X 0x7378900400000000ull +#define ID_AHA_2944 0x7478900400000000ull +#define ID_AHA_3944 0x7578900400000000ull +#define ID_AHA_4944 0x7678900400000000ull + +#define ID_AIC7880 0x8078900400000000ull +#define ID_AIC7880_B 0x8078900478809004ull +#define ID_AHA_2940U 0x8178900400000000ull +#define ID_AHA_3940U 0x8278900400000000ull +#define ID_AHA_2944U 0x8478900400000000ull +#define ID_AHA_3944U 0x8578900400000000ull +#define ID_AHA_398XU 0x8378900400000000ull +#define ID_AHA_4944U 0x8678900400000000ull +#define ID_AHA_2940UB 0x8178900478819004ull +#define ID_AHA_2930U 0x8878900478889004ull +#define ID_AHA_2940U_PRO 0x8778900478879004ull +#define ID_AHA_2940U_CN 0x0078900478009004ull + +#define ID_AIC7895 0x7895900478959004ull +#define ID_AIC7895_ARO 0x7890900478939004ull +#define ID_AIC7895_ARO_MASK 0xFFF0FFFFFFFFFFFFull +#define ID_AHA_2940U_DUAL 0x7895900478919004ull +#define ID_AHA_3940AU 0x7895900478929004ull +#define ID_AHA_3944AU 0x7895900478949004ull + +#define ID_AIC7890 0x001F9005000F9005ull +#define ID_AIC7890_ARO 0x00139005000F9005ull +#define ID_AAA_131U2 0x0013900500039005ull +#define ID_AHA_2930U2 0x0011900501819005ull +#define ID_AHA_2940U2B 0x00109005A1009005ull +#define ID_AHA_2940U2_OEM 0x0010900521809005ull +#define ID_AHA_2940U2 0x00109005A1809005ull +#define ID_AHA_2950U2B 0x00109005E1009005ull + +#define ID_AIC7892 0x008F9005FFFF9005ull +#define ID_AIC7892_ARO 0x00839005FFFF9005ull +#define ID_AHA_29160 0x00809005E2A09005ull +#define ID_AHA_29160_CPQ 0x00809005E2A00E11ull +#define ID_AHA_29160N 0x0080900562A09005ull +#define ID_AHA_29160C 0x0080900562209005ull +#define ID_AHA_29160B 0x00809005E2209005ull +#define ID_AHA_19160B 0x0081900562A19005ull + +#define ID_AIC7896 0x005F9005FFFF9005ull +#define ID_AIC7896_ARO 0x00539005FFFF9005ull +#define ID_AHA_3950U2B_0 0x00509005FFFF9005ull +#define ID_AHA_3950U2B_1 0x00509005F5009005ull +#define ID_AHA_3950U2D_0 0x00519005FFFF9005ull +#define ID_AHA_3950U2D_1 0x00519005B5009005ull + +#define ID_AIC7899 0x00CF9005FFFF9005ull +#define ID_AIC7899_ARO 0x00C39005FFFF9005ull +#define ID_AHA_3960D 0x00C09005F6209005ull +#define ID_AHA_3960D_CPQ 0x00C09005F6200E11ull + +#define ID_AIC7810 0x1078900400000000ull +#define ID_AIC7815 0x7815900400000000ull diff -u linux/drivers/scsi/aic7xxx/aic7xxx_pci.c-o linux/drivers/scsi/aic7xxx/aic7xxx_pci.c --- linux/drivers/scsi/aic7xxx/aic7xxx_pci.c-o 2004-03-21 21:11:51.000000000 +0100 +++ linux/drivers/scsi/aic7xxx/aic7xxx_pci.c 2004-06-21 15:15:24.000000000 +0200 @@ -54,101 +54,11 @@ #include <dev/aic7xxx/aic7xxx_93cx6.h> #endif +#include "aic7xxx_pci.h" + #define AHC_PCI_IOADDR PCIR_MAPS /* I/O Address */ #define AHC_PCI_MEMADDR (PCIR_MAPS + 4) /* Mem I/O Address */ -static __inline uint64_t -ahc_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor) -{ - uint64_t id; - - id = subvendor - | (subdevice << 16) - | ((uint64_t)vendor << 32) - | ((uint64_t)device << 48); - - return (id); -} - -#define ID_ALL_MASK 0xFFFFFFFFFFFFFFFFull -#define ID_DEV_VENDOR_MASK 0xFFFFFFFF00000000ull -#define ID_9005_GENERIC_MASK 0xFFF0FFFF00000000ull -#define ID_9005_SISL_MASK 0x000FFFFF00000000ull -#define ID_9005_SISL_ID 0x0005900500000000ull -#define ID_AIC7850 0x5078900400000000ull -#define ID_AHA_2902_04_10_15_20C_30C 0x5078900478509004ull -#define ID_AIC7855 0x5578900400000000ull -#define ID_AIC7859 0x3860900400000000ull -#define ID_AHA_2930CU 0x3860900438699004ull -#define ID_AIC7860 0x6078900400000000ull -#define ID_AIC7860C 0x6078900478609004ull -#define ID_AHA_1480A 0x6075900400000000ull -#define ID_AHA_2940AU_0 0x6178900400000000ull -#define ID_AHA_2940AU_1 0x6178900478619004ull -#define ID_AHA_2940AU_CN 0x2178900478219004ull -#define ID_AHA_2930C_VAR 0x6038900438689004ull - -#define ID_AIC7870 0x7078900400000000ull -#define ID_AHA_2940 0x7178900400000000ull -#define ID_AHA_3940 0x7278900400000000ull -#define ID_AHA_398X 0x7378900400000000ull -#define ID_AHA_2944 0x7478900400000000ull -#define ID_AHA_3944 0x7578900400000000ull -#define ID_AHA_4944 0x7678900400000000ull - -#define ID_AIC7880 0x8078900400000000ull -#define ID_AIC7880_B 0x8078900478809004ull -#define ID_AHA_2940U 0x8178900400000000ull -#define ID_AHA_3940U 0x8278900400000000ull -#define ID_AHA_2944U 0x8478900400000000ull -#define ID_AHA_3944U 0x8578900400000000ull -#define ID_AHA_398XU 0x8378900400000000ull -#define ID_AHA_4944U 0x8678900400000000ull -#define ID_AHA_2940UB 0x8178900478819004ull -#define ID_AHA_2930U 0x8878900478889004ull -#define ID_AHA_2940U_PRO 0x8778900478879004ull -#define ID_AHA_2940U_CN 0x0078900478009004ull - -#define ID_AIC7895 0x7895900478959004ull -#define ID_AIC7895_ARO 0x7890900478939004ull -#define ID_AIC7895_ARO_MASK 0xFFF0FFFFFFFFFFFFull -#define ID_AHA_2940U_DUAL 0x7895900478919004ull -#define ID_AHA_3940AU 0x7895900478929004ull -#define ID_AHA_3944AU 0x7895900478949004ull - -#define ID_AIC7890 0x001F9005000F9005ull -#define ID_AIC7890_ARO 0x00139005000F9005ull -#define ID_AAA_131U2 0x0013900500039005ull -#define ID_AHA_2930U2 0x0011900501819005ull -#define ID_AHA_2940U2B 0x00109005A1009005ull -#define ID_AHA_2940U2_OEM 0x0010900521809005ull -#define ID_AHA_2940U2 0x00109005A1809005ull -#define ID_AHA_2950U2B 0x00109005E1009005ull - -#define ID_AIC7892 0x008F9005FFFF9005ull -#define ID_AIC7892_ARO 0x00839005FFFF9005ull -#define ID_AHA_29160 0x00809005E2A09005ull -#define ID_AHA_29160_CPQ 0x00809005E2A00E11ull -#define ID_AHA_29160N 0x0080900562A09005ull -#define ID_AHA_29160C 0x0080900562209005ull -#define ID_AHA_29160B 0x00809005E2209005ull -#define ID_AHA_19160B 0x0081900562A19005ull - -#define ID_AIC7896 0x005F9005FFFF9005ull -#define ID_AIC7896_ARO 0x00539005FFFF9005ull -#define ID_AHA_3950U2B_0 0x00509005FFFF9005ull -#define ID_AHA_3950U2B_1 0x00509005F5009005ull -#define ID_AHA_3950U2D_0 0x00519005FFFF9005ull -#define ID_AHA_3950U2D_1 0x00519005B5009005ull - -#define ID_AIC7899 0x00CF9005FFFF9005ull -#define ID_AIC7899_ARO 0x00C39005FFFF9005ull -#define ID_AHA_3960D 0x00C09005F6209005ull -#define ID_AHA_3960D_CPQ 0x00C09005F6200E11ull - -#define ID_AIC7810 0x1078900400000000ull -#define ID_AIC7815 0x7815900400000000ull - #define DEVID_9005_TYPE(id) ((id) & 0xF) #define DEVID_9005_TYPE_HBA 0x0 /* Standard Card */ #define DEVID_9005_TYPE_AAA 0x3 /* RAID Card */ diff -u linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c-o linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c --- linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c-o 2004-03-21 21:11:51.000000000 +0100 +++ linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c 2004-06-21 18:23:44.000000000 +0200 @@ -40,6 +40,7 @@ */ #include "aic7xxx_osm.h" +#include "aic7xxx_pci.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) struct pci_device_id @@ -57,16 +58,77 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) static void ahc_linux_pci_dev_remove(struct pci_dev *pdev); -/* We do our own ID filtering. So, grab all SCSI storage class devices. */ static struct pci_device_id ahc_linux_pci_id_table[] = { - { - 0x9004, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, - PCI_CLASS_STORAGE_SCSI << 8, 0xFFFF00, 0 - }, - { - 0x9005, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, - PCI_CLASS_STORAGE_SCSI << 8, 0xFFFF00, 0 - }, +#define LINUXID(x,s) (unsigned)((((x) >> s) & 0xffff) ?: PCI_ANY_ID) +#define ID(x) \ + { \ + LINUXID(x,32), LINUXID(x,48), LINUXID(x,0), LINUXID(x,16), \ + PCI_CLASS_STORAGE_SCSI << 8, 0xFFFF00, 0 \ + } +#define ID4(x,y) \ + ID(x | ((y+0)<<48)), ID(x | ((y+1)<<48)), ID(x | ((y+2)<<48)), \ + ID(x | ((y+3)<<48)) +#define ID16(x) ID4(x,0ULL), ID4(x,4ULL), ID4(x,8ULL), ID4(x,12ULL) + ID(ID_AHA_2902_04_10_15_20C_30C), + ID(ID_AHA_2930CU), + ID(ID_AHA_1480A & ID_DEV_VENDOR_MASK), + ID(ID_AHA_2940AU_0 & ID_DEV_VENDOR_MASK), + ID(ID_AHA_2940AU_CN & ID_DEV_VENDOR_MASK), + ID(ID_AHA_2930C_VAR & ID_DEV_VENDOR_MASK), + ID(ID_AHA_2940), + ID(ID_AHA_3940), + ID(ID_AHA_398X), + ID(ID_AHA_2944), + ID(ID_AHA_3944), + ID(ID_AHA_4944), + ID(ID_AHA_2940U & ID_DEV_VENDOR_MASK), + ID(ID_AHA_3940U & ID_DEV_VENDOR_MASK), + ID(ID_AHA_2944U & ID_DEV_VENDOR_MASK), + ID(ID_AHA_3944U & ID_DEV_VENDOR_MASK), + ID(ID_AHA_398XU & ID_DEV_VENDOR_MASK), + ID(ID_AHA_4944U & ID_DEV_VENDOR_MASK), + ID(ID_AHA_2930U & ID_DEV_VENDOR_MASK), + ID(ID_AHA_2940U_PRO & ID_DEV_VENDOR_MASK), + ID(ID_AHA_2940U_CN & ID_DEV_VENDOR_MASK), + ID(ID_AHA_2930U2), + ID(ID_AHA_2940U2B), + ID(ID_AHA_2940U2_OEM), + ID(ID_AHA_2940U2), + ID(ID_AHA_2950U2B), + ID(ID_AIC7890_ARO), + ID(ID_AAA_131U2), + ID(ID_AHA_29160), + ID(ID_AHA_29160_CPQ), + ID(ID_AHA_29160N), + ID(ID_AHA_29160C), + ID(ID_AHA_29160B), + ID(ID_AHA_19160B), + ID(ID_AIC7892_ARO), + ID(ID_AHA_2940U_DUAL), + ID(ID_AHA_3940AU), + ID(ID_AHA_3944AU), + ID(ID_AIC7895_ARO), + ID(ID_AHA_3950U2B_0), + ID(ID_AHA_3950U2B_1), + ID(ID_AHA_3950U2D_0), + ID(ID_AHA_3950U2D_1), + ID(ID_AIC7896_ARO), + ID(ID_AHA_3960D), + ID(ID_AHA_3960D_CPQ), + ID(ID_AIC7899_ARO), + ID(ID_AIC7850 & ID_DEV_VENDOR_MASK), + ID(ID_AIC7855 & ID_DEV_VENDOR_MASK), + ID(ID_AIC7859 & ID_DEV_VENDOR_MASK), + ID(ID_AIC7860 & ID_DEV_VENDOR_MASK), + ID(ID_AIC7870 & ID_DEV_VENDOR_MASK), + ID(ID_AIC7880 & ID_DEV_VENDOR_MASK), + ID16(ID_AIC7890), + ID16(ID_AIC7892), + ID(ID_AIC7895 & ID_DEV_VENDOR_MASK), + ID(ID_AIC7896), + ID(ID_AIC7899), + ID(ID_AIC7810 & ID_DEV_VENDOR_MASK), + ID(ID_AIC7815 & ID_DEV_VENDOR_MASK), { 0 } }; ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers 2004-06-21 16:24 ` Andi Kleen @ 2004-06-21 16:10 ` Sergey Vlasov 0 siblings, 0 replies; 10+ messages in thread From: Sergey Vlasov @ 2004-06-21 16:10 UTC (permalink / raw) To: Andi Kleen; +Cc: linux-scsi [-- Attachment #1: Type: text/plain, Size: 1454 bytes --] On Mon, Jun 21, 2004 at 06:24:40PM +0200, Andi Kleen wrote: > On Mon, 21 Jun 2004 17:44:08 +0400 > Sergey Vlasov <vsu@altlinux.ru> wrote: > > > On Mon, 21 Jun 2004 16:14:41 +0200 Andi Kleen wrote: > > > > > This is needed for 2.6 hotplug where the driver is autoloaded. When you have > > > multiple conflicting entries the hotplug module loader usually loads > > > the first one listed, which may be correct or may be not. > > > > > > With these changes the drivers announce the correct PCI IDs. > > > > Unfortunately, the patch does not seem to be correct :( > > > > struct pci_device_id does not have the mask field, therefore the > > ID_9005_GENERIC_MASK restriction cannot be specified other than by > > listing all 16 possible IDs as separate entries. Your patch adds only > > one entry, thus losing 15 other possible IDs. > > Hmm, good point. Thanks for catching this. > > Here is a new patch. Does this one look better? It fixes the above problem, but it's hard to say that the patch is correct without carefully checking all the tables. I'm trying to hack up something to autogenerate the pci_device_id table from the aic7xxx internal table. BTW, ID_AIC7810 and ID_AIC7815 probably should not be in the PCI ID table at all - ahc_raid_setup() just prints "RAID functionality unsupported" for them. And some more IDs generated by ID16 are really rejected by the driver due to the (ID_9005_SISL_ID, ID_9005_SISL_MASK) exclusion entry. [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers 2004-06-21 14:14 [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers Andi Kleen 2004-06-21 13:44 ` Sergey Vlasov @ 2004-06-21 15:30 ` Luben Tuikov 2004-06-21 15:37 ` Arjan van de Ven 2004-06-21 18:03 ` [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers Andi Kleen 1 sibling, 2 replies; 10+ messages in thread From: Luben Tuikov @ 2004-06-21 15:30 UTC (permalink / raw) To: Andi Kleen; +Cc: linux-scsi Thank you Andi for the patches. aic7xxx drivers are due for update to use the new timeout infrastructure. I'll incorporate them in, and do some testing. Thanks, -- Luben Andi Kleen wrote: > > [I didn't find an aic7xxx maintainer in MAINTAINERS, so just sending > to the list] > > This is needed for 2.6 hotplug where the driver is autoloaded. When you > have > multiple conflicting entries the hotplug module loader usually loads > the first one listed, which may be correct or may be not. > > With these changes the drivers announce the correct PCI IDs. > > The patches are quite big (i had to move the ID tables into an include), > but mostly mechanical. > > I only tested it on a single 78xx, so it's possible that i made > a typo somewhere. Some testing would be appreciated, especially > on 79xx > > There is still an conflicting entry for aic7xxx_old unfortunately. This > is hard to handle in hotplug. I think the right solution would be to > somehow > tag drivers as obsolete so that they aren't loaded by default. This will > need an extension in the module pci table mechanism. I'm thinking about > a a new MODULE_OBSOLETE macro for this and a obsolete_modules table > generated > at modules_install time. But that's for another patch. Better would be > maybe to just drop the aic7xxx_old driver. Is it really still needed? > > -Andi ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers 2004-06-21 15:30 ` Luben Tuikov @ 2004-06-21 15:37 ` Arjan van de Ven 2004-06-21 16:09 ` [PATCH] Add proper module ID tables to Adaptec aic7[9x]xxdrivers Luben Tuikov 2004-06-21 18:03 ` [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers Andi Kleen 1 sibling, 1 reply; 10+ messages in thread From: Arjan van de Ven @ 2004-06-21 15:37 UTC (permalink / raw) To: Luben Tuikov; +Cc: Andi Kleen, linux-scsi [-- Attachment #1: Type: text/plain, Size: 554 bytes --] On Mon, 2004-06-21 at 17:30, Luben Tuikov wrote: > Thank you Andi for the patches. aic7xxx drivers are due for update > to use the new timeout infrastructure. I'll incorporate them in, > and do some testing. cool. Would you please consider the update to be done in small incremental changes/steps ? Eg each separate change/bugfix a separate patch ? Would make life a lot easier for me (distro kernel guy) and for James to be able to diagnose regressions a lot better by binary searching changesets etc etc. Greetings, Arjan van de Ven [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xxdrivers 2004-06-21 15:37 ` Arjan van de Ven @ 2004-06-21 16:09 ` Luben Tuikov 2004-06-21 16:12 ` Arjan van de Ven 0 siblings, 1 reply; 10+ messages in thread From: Luben Tuikov @ 2004-06-21 16:09 UTC (permalink / raw) To: arjanv; +Cc: Andi Kleen, linux-scsi Arjan van de Ven wrote: > On Mon, 2004-06-21 at 17:30, Luben Tuikov wrote: > >>Thank you Andi for the patches. aic7xxx drivers are due for update >>to use the new timeout infrastructure. I'll incorporate them in, >>and do some testing. > > > cool. > Would you please consider the update to be done in small incremental > changes/steps ? Eg each separate change/bugfix a separate patch ? > Would make life a lot easier for me (distro kernel guy) and for James to > be able to diagnose regressions a lot better by binary searching > changesets etc etc. Yep, no problem. Current kernel version of, say, aic79xxx is 1.3.11, and I have 2.0.12, they are 226 patches away. Each patch is a submission into perforce. I can extract each and every one of those 226 and can post them somewhere on a website (hosting anyone? ;-) ), so that anyone can review them. I can also provide a single patch from 1.3.11 to 2.0.11 so that a "to<-->from" picture can be seen as some patches in between may "cancel" each other out. And I'll also provide a bk-send and a tar.gz of the whole thing as it looks in my tree. Let me know if anything else is needed. Thanks, -- Luben ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xxdrivers 2004-06-21 16:09 ` [PATCH] Add proper module ID tables to Adaptec aic7[9x]xxdrivers Luben Tuikov @ 2004-06-21 16:12 ` Arjan van de Ven 0 siblings, 0 replies; 10+ messages in thread From: Arjan van de Ven @ 2004-06-21 16:12 UTC (permalink / raw) To: Luben Tuikov; +Cc: Andi Kleen, linux-scsi [-- Attachment #1: Type: text/plain, Size: 1310 bytes --] On Mon, Jun 21, 2004 at 12:09:27PM -0400, Luben Tuikov wrote: > Arjan van de Ven wrote: > >On Mon, 2004-06-21 at 17:30, Luben Tuikov wrote: > > > >>Thank you Andi for the patches. aic7xxx drivers are due for update > >>to use the new timeout infrastructure. I'll incorporate them in, > >>and do some testing. > > > > > >cool. > >Would you please consider the update to be done in small incremental > >changes/steps ? Eg each separate change/bugfix a separate patch ? > >Would make life a lot easier for me (distro kernel guy) and for James to > >be able to diagnose regressions a lot better by binary searching > >changesets etc etc. > > Yep, no problem. > > Current kernel version of, say, aic79xxx is 1.3.11, and I have > 2.0.12, they are 226 patches away. Each patch is a submission I was actually hoping you would have started from the kernel.org driver not the adaptec weird fork justin has been maintaining ;( > into perforce. I can extract each and every one of those 226 > and can post them somewhere on a website (hosting anyone? ;-) ), > so that anyone can review them. it's not just about review, it's also about merging it in parts so that you don't need to binary chop through 226 patches if something fails, but only through like 30 or so. And then a week later the next 30 go in etc etc [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers 2004-06-21 15:30 ` Luben Tuikov 2004-06-21 15:37 ` Arjan van de Ven @ 2004-06-21 18:03 ` Andi Kleen 2004-06-21 16:10 ` Luben Tuikov 1 sibling, 1 reply; 10+ messages in thread From: Andi Kleen @ 2004-06-21 18:03 UTC (permalink / raw) To: Luben Tuikov; +Cc: linux-scsi On Mon, 21 Jun 2004 11:30:04 -0400 Luben Tuikov <luben_tuikov@adaptec.com> wrote: > Thank you Andi for the patches. aic7xxx drivers are due for update > to use the new timeout infrastructure. I'll incorporate them in, > and do some testing. Thanks. Please use the second patch i posted, not the first. -Andi ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers 2004-06-21 18:03 ` [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers Andi Kleen @ 2004-06-21 16:10 ` Luben Tuikov 0 siblings, 0 replies; 10+ messages in thread From: Luben Tuikov @ 2004-06-21 16:10 UTC (permalink / raw) To: Andi Kleen; +Cc: linux-scsi Andi Kleen wrote: > On Mon, 21 Jun 2004 11:30:04 -0400 > Luben Tuikov <luben_tuikov@adaptec.com> wrote: > > > Thank you Andi for the patches. aic7xxx drivers are due for update > > to use the new timeout infrastructure. I'll incorporate them in, > > and do some testing. > > Thanks. Please use the second patch i posted, not the first. No problem. -- Luben ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2004-06-21 16:12 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2004-06-21 14:14 [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers Andi Kleen 2004-06-21 13:44 ` Sergey Vlasov 2004-06-21 16:24 ` Andi Kleen 2004-06-21 16:10 ` Sergey Vlasov 2004-06-21 15:30 ` Luben Tuikov 2004-06-21 15:37 ` Arjan van de Ven 2004-06-21 16:09 ` [PATCH] Add proper module ID tables to Adaptec aic7[9x]xxdrivers Luben Tuikov 2004-06-21 16:12 ` Arjan van de Ven 2004-06-21 18:03 ` [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers Andi Kleen 2004-06-21 16:10 ` Luben Tuikov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).