* 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; 19+ 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] 19+ messages in thread
* [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; 19+ 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] 19+ 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; 19+ 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] 19+ 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; 19+ 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] 19+ 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; 19+ 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] 19+ 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; 19+ 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] 19+ 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; 19+ 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] 19+ 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; 19+ 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] 19+ 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; 19+ 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] 19+ 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; 19+ 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] 19+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers
[not found] <linux.scsi.20040621161047.GD16453@master.mivlgu.local>
@ 2004-10-06 19:47 ` Michael Tokarev
2004-10-06 20:25 ` Andi Kleen
0 siblings, 1 reply; 19+ messages in thread
From: Michael Tokarev @ 2004-10-06 19:47 UTC (permalink / raw)
To: Sergey Vlasov; +Cc: Andi Kleen, linux-scsi, Luben Tuikov
[Answering to an old post -- rehashing the topic.
I didn't trim the email. See my comments below.]
On Mon, 21 Jun 2004 20:10:47 +0400, Sergey Vlasov wrote:
> 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.
I found several "OEM" (on-board) aic79xx controllers (mostly on
HP boxes) that breaks after the above-mentioned change, which
found it's way into 2.6.8 kernel. For example, HP ProLiant ML
machines and others. The end-result is that the driver, which
worked just fine before, does not "detect" the card anymore.
On one of such machines, AIC7902 U320 (rev 03) card is shown
as device=9005:801f (identified by the driver), but subsystem
id is 103c:103c, wich gets interpreted by pci.ids as
"Hewlett-Packard Company: Unknown device 103c". It does
not look like a right thing to do, but HP knows better it
seems.
Also, I tried to guess what all those new PCI ID macros does
in the driver, but that's quite a challenge: deeply-nested
macros with non-obvious bit manipulation... ;) So I can't
produce a patch right now for this problem. Either way,
the resulting PCI table does not look right:
$ fgrep aic79xx /lib/modules/`uname -r`/modules.pcimap | wc -l
32
$ fgrep aic79xx /lib/modules/`uname -r`/modules.pcimap | sort -u | wc -l
15
Devices 9005:800f and 9005:801e are listed with *:* subsystem,
while the rest (incl. 9005:801f -- the one shown above) specifies
several non-wildcard subsystem entries, nothing to match 103c
(HP).
Maybe just list all subsystems as wildcards?
Thanks.
/mjt
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers
2004-10-06 19:47 ` Michael Tokarev
@ 2004-10-06 20:25 ` Andi Kleen
2004-10-06 21:36 ` Michael Tokarev
2004-10-07 18:08 ` Luben Tuikov
0 siblings, 2 replies; 19+ messages in thread
From: Andi Kleen @ 2004-10-06 20:25 UTC (permalink / raw)
To: Michael Tokarev; +Cc: Sergey Vlasov, Andi Kleen, linux-scsi, Luben Tuikov
On Wed, Oct 06, 2004 at 11:47:33PM +0400, Michael Tokarev wrote:
> [Answering to an old post -- rehashing the topic.
> I didn't trim the email. See my comments below.]
>
> On Mon, 21 Jun 2004 20:10:47 +0400, Sergey Vlasov wrote:
> >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.
>
> I found several "OEM" (on-board) aic79xx controllers (mostly on
> HP boxes) that breaks after the above-mentioned change, which
> found it's way into 2.6.8 kernel. For example, HP ProLiant ML
I don't think it's merged in mainline, no. Or at least 2.6.9rc3
doesn't have it.
> machines and others. The end-result is that the driver, which
> worked just fine before, does not "detect" the card anymore.
>
> On one of such machines, AIC7902 U320 (rev 03) card is shown
> as device=9005:801f (identified by the driver), but subsystem
> id is 103c:103c, wich gets interpreted by pci.ids as
> "Hewlett-Packard Company: Unknown device 103c". It does
> not look like a right thing to do, but HP knows better it
> seems.
>
> Also, I tried to guess what all those new PCI ID macros does
> in the driver, but that's quite a challenge: deeply-nested
> macros with non-obvious bit manipulation... ;) So I can't
They just try to match large groups without too much typing....
> produce a patch right now for this problem. Either way,
> the resulting PCI table does not look right:
>
> $ fgrep aic79xx /lib/modules/`uname -r`/modules.pcimap | wc -l
> 32
> $ fgrep aic79xx /lib/modules/`uname -r`/modules.pcimap | sort -u | wc -l
> 15
>
> Devices 9005:800f and 9005:801e are listed with *:* subsystem,
> while the rest (incl. 9005:801f -- the one shown above) specifies
> several non-wildcard subsystem entries, nothing to match 103c
> (HP).
If I remember the patch correctly it only matches the Adaptec vendor id.
For HP there will need to be an special entry (probably needs some
reverse engineering from the original code)
> Maybe just list all subsystems as wildcards?
No, i don't think that's a good idea.
At least the vendors should be listed explicitely.
Otherwise hotplug autoloading is unhappy because bogus modules
get loaded all the time.
I can go over it again at some point, but currently I don't
have too much time, so it would be good if someone else would
tackle it.
Luben, can you just do a proper pci_id table please? You probably
know the requirements best.
-Andi
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers
2004-10-06 20:25 ` Andi Kleen
@ 2004-10-06 21:36 ` Michael Tokarev
2004-10-07 18:08 ` Luben Tuikov
1 sibling, 0 replies; 19+ messages in thread
From: Michael Tokarev @ 2004-10-06 21:36 UTC (permalink / raw)
To: Andi Kleen; +Cc: Sergey Vlasov, linux-scsi, Luben Tuikov
Andi Kleen wrote:
> On Wed, Oct 06, 2004 at 11:47:33PM +0400, Michael Tokarev wrote:
[]
>>I found several "OEM" (on-board) aic79xx controllers (mostly on
>>HP boxes) that breaks after the above-mentioned change, which
>>found it's way into 2.6.8 kernel. For example, HP ProLiant ML
>
> I don't think it's merged in mainline, no. Or at least 2.6.9rc3
> doesn't have it.
Interesting. Well... looks like it's debian stuff. I'm sorry
about this - should have looked better. So, that's even better:
the change like this should generate quite some breakage, and
it's good it isn't applied.
And now as I see the problem is debian-specific, the more
"interesting" debian patch looks, here's the description:
## DP: Description: Export proper PCI ID table to hotplug in aic7xxx/aic79xx
## DP: Patch author: Andi Kleen <ak@suse.de>
## DP: Upstream status: submitted (long ago, aic7xx maintaince is horrible)
oh well... :(
(original message (with patch) can be found at
http://groups.google.com/groups?selm=linux.scsi.20040621182440.0743036f.ak%40suse.de
)
[]
>>Also, I tried to guess what all those new PCI ID macros does
>>in the driver, but that's quite a challenge: deeply-nested
>>macros with non-obvious bit manipulation... ;) So I can't
>
> They just try to match large groups without too much typing....
Figured that much ;)
>
> If I remember the patch correctly it only matches the Adaptec vendor id.
Well not really. Or, rather, it indeed only matches by 0x9005
as vendor, but there's also _subsytem_ vendor and _subsystem_ device
which does not match now. Device reports:
device=9005:801f, subsystem=103c:103c (Hewlett-Packard)
device=9005:801f, subsystem=1025:002a (Acer Labs)
etc. The pci_table correctly matches the device part,
but only accepts subsystem=9005:ffff (which seems to
be wrong).
> For HP there will need to be an special entry (probably needs some
> reverse engineering from the original code)
Note again it isn't main vendor_id, it's subsystem vendor_id.
Main vendor_id is still 0x9005.
>>Maybe just list all subsystems as wildcards?
>
> No, i don't think that's a good idea.
Now I've 4 different variations of 9005:801f - the same
card, but with different subsystem ids. Several of other
AIC97xx cards actually uses wildcarded *sub*system_{vendor,id},
eg 9005:800f. And there are actually 16 different devices
which where mentioned by Luden in that thread (0x80xx) -- the
driver code basically just ignores subsystem identifiers for
almost all of them.
> At least the vendors should be listed explicitely.
> Otherwise hotplug autoloading is unhappy because bogus modules
> get loaded all the time.
Yes -- vendor_id, but not subvendor_id.
/mjt
> I can go over it again at some point, but currently I don't
> have too much time, so it would be good if someone else would
> tackle it.
>
> Luben, can you just do a proper pci_id table please? You probably
> know the requirements best.
>
> -Andi
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers
2004-10-06 20:25 ` Andi Kleen
2004-10-06 21:36 ` Michael Tokarev
@ 2004-10-07 18:08 ` Luben Tuikov
2004-10-07 19:12 ` Michael Tokarev
1 sibling, 1 reply; 19+ messages in thread
From: Luben Tuikov @ 2004-10-07 18:08 UTC (permalink / raw)
To: Andi Kleen; +Cc: Michael Tokarev, Sergey Vlasov, linux-scsi
Andi Kleen wrote:
> On Wed, Oct 06, 2004 at 11:47:33PM +0400, Michael Tokarev wrote:
>
>>[Answering to an old post -- rehashing the topic.
>> I didn't trim the email. See my comments below.]
>>
>>On Mon, 21 Jun 2004 20:10:47 +0400, Sergey Vlasov wrote:
>>
>>>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.
>>
>>I found several "OEM" (on-board) aic79xx controllers (mostly on
>>HP boxes) that breaks after the above-mentioned change, which
>>found it's way into 2.6.8 kernel. For example, HP ProLiant ML
>
>
> I don't think it's merged in mainline, no. Or at least 2.6.9rc3
> doesn't have it.
>
>
>
>>machines and others. The end-result is that the driver, which
>>worked just fine before, does not "detect" the card anymore.
>>
>>On one of such machines, AIC7902 U320 (rev 03) card is shown
>>as device=9005:801f (identified by the driver), but subsystem
>>id is 103c:103c, wich gets interpreted by pci.ids as
>>"Hewlett-Packard Company: Unknown device 103c". It does
>>not look like a right thing to do, but HP knows better it
>>seems.
>>
>>Also, I tried to guess what all those new PCI ID macros does
>>in the driver, but that's quite a challenge: deeply-nested
>>macros with non-obvious bit manipulation... ;) So I can't
>
>
> They just try to match large groups without too much typing....
>
>
>>produce a patch right now for this problem. Either way,
>>the resulting PCI table does not look right:
>>
>>$ fgrep aic79xx /lib/modules/`uname -r`/modules.pcimap | wc -l
>>32
>>$ fgrep aic79xx /lib/modules/`uname -r`/modules.pcimap | sort -u | wc -l
>>15
>>
>>Devices 9005:800f and 9005:801e are listed with *:* subsystem,
>>while the rest (incl. 9005:801f -- the one shown above) specifies
>>several non-wildcard subsystem entries, nothing to match 103c
>>(HP).
>
>
> If I remember the patch correctly it only matches the Adaptec vendor id.
>
> For HP there will need to be an special entry (probably needs some
> reverse engineering from the original code)
>
>
>>Maybe just list all subsystems as wildcards?
>
>
> No, i don't think that's a good idea.
>
> At least the vendors should be listed explicitely.
> Otherwise hotplug autoloading is unhappy because bogus modules
> get loaded all the time.
>
> I can go over it again at some point, but currently I don't
> have too much time, so it would be good if someone else would
> tackle it.
>
> Luben, can you just do a proper pci_id table please? You probably
> know the requirements best.
Yes, no problem. (It'd be tricky but I'll try to augment it properly.)
Luben
> -Andi
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers
2004-10-07 18:08 ` Luben Tuikov
@ 2004-10-07 19:12 ` Michael Tokarev
2004-10-07 19:46 ` Luben Tuikov
0 siblings, 1 reply; 19+ messages in thread
From: Michael Tokarev @ 2004-10-07 19:12 UTC (permalink / raw)
To: Luben Tuikov; +Cc: linux-scsi
Luben Tuikov wrote:
> Andi Kleen wrote:
>
[]
>> Luben, can you just do a proper pci_id table please? You probably
>> know the requirements best.
>
> Yes, no problem. (It'd be tricky but I'll try to augment it properly.)
Christoph Hellwig already did that, it seems --
see his post to linux-scsi dated Sep-12,
http://marc.theaimsgroup.com/?m=109500574722283
/mjt
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers
2004-10-07 19:12 ` Michael Tokarev
@ 2004-10-07 19:46 ` Luben Tuikov
2004-10-07 20:36 ` Christoph Hellwig
0 siblings, 1 reply; 19+ messages in thread
From: Luben Tuikov @ 2004-10-07 19:46 UTC (permalink / raw)
To: Michael Tokarev; +Cc: linux-scsi
Michael Tokarev wrote:
> Luben Tuikov wrote:
>
>> Andi Kleen wrote:
>>
> []
>
>>> Luben, can you just do a proper pci_id table please? You probably
>>> know the requirements best.
>>
>>
>> Yes, no problem. (It'd be tricky but I'll try to augment it properly.)
>
>
> Christoph Hellwig already did that, it seems --
> see his post to linux-scsi dated Sep-12,
> http://marc.theaimsgroup.com/?m=109500574722283
Yes, I forgot about this one -- this is pretty much what I
had intended to do.
Thanks for pointing it out,
Luben
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers
2004-10-07 19:46 ` Luben Tuikov
@ 2004-10-07 20:36 ` Christoph Hellwig
2004-10-07 20:42 ` Luben Tuikov
0 siblings, 1 reply; 19+ messages in thread
From: Christoph Hellwig @ 2004-10-07 20:36 UTC (permalink / raw)
To: Luben Tuikov; +Cc: Michael Tokarev, linux-scsi
On Thu, Oct 07, 2004 at 03:46:56PM -0400, Luben Tuikov wrote:
> Michael Tokarev wrote:
> > Luben Tuikov wrote:
> >
> >> Andi Kleen wrote:
> >>
> > []
> >
> >>> Luben, can you just do a proper pci_id table please? You probably
> >>> know the requirements best.
> >>
> >>
> >> Yes, no problem. (It'd be tricky but I'll try to augment it properly.)
> >
> >
> > Christoph Hellwig already did that, it seems --
> > see his post to linux-scsi dated Sep-12,
> > http://marc.theaimsgroup.com/?m=109500574722283
>
> Yes, I forgot about this one -- this is pretty much what I
> had intended to do.
The version had a few bugs unfortunately. For various HP boards
I mixed up vendor and subvendor id, and the raid boards are completely
missing. I tried to fix that up but got totally lost in the various ids.
If there's a completely list of AIC79XX board variants I could try again.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers
2004-10-07 20:36 ` Christoph Hellwig
@ 2004-10-07 20:42 ` Luben Tuikov
2004-10-07 20:47 ` Christoph Hellwig
0 siblings, 1 reply; 19+ messages in thread
From: Luben Tuikov @ 2004-10-07 20:42 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Michael Tokarev, linux-scsi
Christoph Hellwig wrote:
> On Thu, Oct 07, 2004 at 03:46:56PM -0400, Luben Tuikov wrote:
>
>>Michael Tokarev wrote:
>>
>>>Luben Tuikov wrote:
>>>
>>>
>>>>Andi Kleen wrote:
>>>>
>>>
>>>[]
>>>
>>>
>>>>>Luben, can you just do a proper pci_id table please? You probably
>>>>>know the requirements best.
>>>>
>>>>
>>>>Yes, no problem. (It'd be tricky but I'll try to augment it properly.)
>>>
>>>
>>>Christoph Hellwig already did that, it seems --
>>>see his post to linux-scsi dated Sep-12,
>>>http://marc.theaimsgroup.com/?m=109500574722283
>>
>>Yes, I forgot about this one -- this is pretty much what I
>>had intended to do.
>
>
> The version had a few bugs unfortunately. For various HP boards
> I mixed up vendor and subvendor id, and the raid boards are completely
> missing. I tried to fix that up but got totally lost in the various ids.
>
> If there's a completely list of AIC79XX board variants I could try again.
Ah, ok -- I was wondering.
Well, it's not as easy as dumping the list into a table.
Let me try to come up with something here.
Luben
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] Add proper module ID tables to Adaptec aic7[9x]xx drivers
2004-10-07 20:42 ` Luben Tuikov
@ 2004-10-07 20:47 ` Christoph Hellwig
0 siblings, 0 replies; 19+ messages in thread
From: Christoph Hellwig @ 2004-10-07 20:47 UTC (permalink / raw)
To: Luben Tuikov; +Cc: Michael Tokarev, linux-scsi
On Thu, Oct 07, 2004 at 04:42:02PM -0400, Luben Tuikov wrote:
> Ah, ok -- I was wondering.
>
> Well, it's not as easy as dumping the list into a table.
> Let me try to come up with something here.
I think best would be to kill all subvendor/subdevice id matching
so we can just live with the generic ids. This would simplify things
a lot if Adaptec doesn't plan to introduce random incompatiblities
for devices only differing in subvendor/subdevice id.
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2004-10-07 20:47 UTC | newest]
Thread overview: 19+ 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
[not found] <linux.scsi.20040621161047.GD16453@master.mivlgu.local>
2004-10-06 19:47 ` Michael Tokarev
2004-10-06 20:25 ` Andi Kleen
2004-10-06 21:36 ` Michael Tokarev
2004-10-07 18:08 ` Luben Tuikov
2004-10-07 19:12 ` Michael Tokarev
2004-10-07 19:46 ` Luben Tuikov
2004-10-07 20:36 ` Christoph Hellwig
2004-10-07 20:42 ` Luben Tuikov
2004-10-07 20:47 ` Christoph Hellwig
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).