[PATCH] IDE clean 12 3rd attempt

[PATCH] IDE clean 12 3rd attempt

Post by Andries.Brou.. » Mon, 25 Feb 2002 23:00:15



Quote:> Since this apparently didn't get through to the mailing list
> I'm sending it again. This time compressed.

Pity - noncompressed is better, now only people with too much time
will look at it.

There is something else one might do.
In ide-geometry.c there is the routine probe_cmos_for_drives().
Long ago I already wrote "Eventually the entire routine below
should be removed". I think this is the proper time to do this.

This probe is done only for the i386 architecture, and only
for the first two IDE disks, and only influences their geometry.
It has been a pain - for example, it gives the first two disks
a different geometry from the others, which is inconvenient
when one want a RAID of identical disks.

So, it is good to rip this out and push the inconvenience to
people with ancient hardware. (People with MFM disks may need
boot parameters now.)
When this is gone, much more can go, both in the IDE code and
in setup.S.

Andries

diff -u ../linux-2.5.5/linux/drivers/ide/ide-geometry.c linux/drivers/ide/ide-geometry.c
--- ../linux-2.5.5/linux/drivers/ide/ide-geometry.c     Sun Feb  3 12:35:52 2002

 #include <linux/mc146818rtc.h>
 #include <asm/io.h>

-#ifdef CONFIG_BLK_DEV_IDE
-
-/*
- * We query CMOS about hard disks : it could be that we have a SCSI/ESDI/etc
- * controller that is BIOS compatible with ST-506, and thus showing up in our
- * BIOS table, but not register compatible, and therefore not present in CMOS.
- *
- * Furthermore, we will assume that our ST-506 drives <if any> are the primary
- * drives in the system -- the ones reflected as drive 1 or 2.  The first
- * drive is stored in the high nibble of CMOS byte 0x12, the second in the low
- * nibble.  This will be either a 4 bit drive type or 0xf indicating use byte
- * 0x19 for an 8 bit type, drive 1, 0x1a for drive 2 in CMOS.  A non-zero value
- * means we have an AT controller hard disk for that drive.
- *
- * Of course, there is no guarantee that either drive is actually on the
- * "primary" IDE interface, but we don't bother trying to sort that out here.
- * If a drive is not actually on the primary interface, then these parameters
- * will be ignored.  This results in the user having to supply the logical
- * drive geometry as a boot parameter for each drive not on the primary i/f.
- */
-/*
- * The only "perfect" way to handle this would be to modify the setup.[cS] code
- * to do BIOS calls Int13h/Fn08h and Int13h/Fn48h to get all of the drive info
- * for us during initialization.  I have the necessary docs -- any takers?  -ml
- */
-/*
- * I did this, but it doesnt work - there is no reasonable way to find the
- * correspondence between the BIOS numbering of the disks and the Linux
- * numbering. -aeb
- *
- * The code below is bad. One of the problems is that drives 1 and 2
- * may be SCSI disks (even when IDE disks are present), so that
- * the geometry we read here from BIOS is attributed to the wrong disks.
- * Consequently, also the former "drive->present = 1" below was a mistake.
- *
- * Eventually the entire routine below should be removed.
- *

- * chip.
- */
-
-void probe_cmos_for_drives (ide_hwif_t *hwif)
-{
-#ifdef __i386__
-       extern struct drive_info_struct drive_info;
-       byte cmos_disks, *BIOS = (byte *) &drive_info;
-       int unit;
-       unsigned long flags;
-
-#ifdef CONFIG_BLK_DEV_PDC4030
-       if (hwif->chipset == ide_pdc4030 && hwif->channel != 0)
-               return;
-#endif /* CONFIG_BLK_DEV_PDC4030 */
-       spin_lock_irqsave(&rtc_lock, flags);
-       cmos_disks = CMOS_READ(0x12);
-       spin_unlock_irqrestore(&rtc_lock, flags);
-       /* Extract drive geometry from CMOS+BIOS if not already setup */
-       for (unit = 0; unit < MAX_DRIVES; ++unit) {
-               ide_drive_t *drive = &hwif->drives[unit];
-
-               if ((cmos_disks & (0xf0 >> (unit*4)))
-                  && !drive->present && !drive->nobios) {
-                       unsigned short cyl = *(unsigned short *)BIOS;
-                       unsigned char head = *(BIOS+2);
-                       unsigned char sect = *(BIOS+14);
-                       if (cyl > 0 && head > 0 && sect > 0 && sect < 64) {
-                               drive->cyl   = drive->bios_cyl  = cyl;
-                               drive->head  = drive->bios_head = head;
-                               drive->sect  = drive->bios_sect = sect;
-                               drive->ctl   = *(BIOS+8);
-                       } else {
-                               printk("hd%c: C/H/S=%d/%d/%d from BIOS ignored\n",
-                                      unit+'a', cyl, head, sect);
-                       }
-               }
-
-               BIOS += 16;
-       }
-#endif
-}
-#endif /* CONFIG_BLK_DEV_IDE */
-
-
 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)

 extern ide_drive_t * get_info_ptr(kdev_t);
diff -u ../linux-2.5.5/linux/drivers/ide/ide-probe.c linux/drivers/ide/ide-probe.c
--- ../linux-2.5.5/linux/drivers/ide/ide-probe.c        Thu Feb 21 23:50:02 2002

        if (hwif->noprobe)
                return;
-#ifdef CONFIG_BLK_DEV_IDE
-       if (hwif->io_ports[IDE_DATA_OFFSET] == HD_DATA) {
-               extern void probe_cmos_for_drives(ide_hwif_t *);
-
-               probe_cmos_for_drives (hwif);
-       }
-#endif

        if ((hwif->chipset != ide_4drives || !hwif->mate->present) &&
 #if CONFIG_BLK_DEV_PDC4030
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

[PATCH] IDE clean 12 3rd attempt

Post by Martin Daleck » Tue, 26 Feb 2002 05:00:09



>>Since this apparently didn't get through to the mailing list
>>I'm sending it again. This time compressed.

> Pity - noncompressed is better, now only people with too much time
> will look at it.

> There is something else one might do.
> In ide-geometry.c there is the routine probe_cmos_for_drives().
> Long ago I already wrote "Eventually the entire routine below
> should be removed". I think this is the proper time to do this.

> This probe is done only for the i386 architecture, and only
> for the first two IDE disks, and only influences their geometry.
> It has been a pain - for example, it gives the first two disks
> a different geometry from the others, which is inconvenient
> when one want a RAID of identical disks.

Basically I lend toward your arguments. I think too that a bios based
detection is already right and then we have now the ide-skip kernel
parameter which is allowing to exclude a drive from handling by the
linux ide driver anyway. And I think that 2.4.x and above don't run on
i386's anymore anyway.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

[PATCH] IDE clean 12 3rd attempt

Post by ar.. » Tue, 26 Feb 2002 05:00:18



> linux ide driver anyway. And I think that 2.4.x and above don't run on
> i386's anymore anyway.

it was about the i386 architecture, not just 80386 cpus. And yes 2.4 still
runs on those; you'be surprised how many
embedded systems run 80386 equivalents...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

[PATCH] IDE clean 12 3rd attempt

Post by Eric Krou » Tue, 26 Feb 2002 05:10:09



> And I think that 2.4.x and above don't run on
> i386's anymore anyway.

I don't mean to intrude or offend, but please backup your claims with
hard facts as opposed to mere suppositions.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

[PATCH] IDE clean 12 3rd attempt

Post by Martin Daleck » Tue, 26 Feb 2002 05:10:11




>>linux ide driver anyway. And I think that 2.4.x and above don't run on
>>i386's anymore anyway.

> it was about the i386 architecture, not just 80386 cpus. And yes 2.4 still
> runs on those; you'be surprised how many
> embedded systems run 80386 equivalents...

Interresting. But do they still incorporate ST509 and other
archaic controllers? Or do they have broken BIOS-es which don't
setup the geometry information properly? I don't think so.

Well now I'm quite convinced. We can point those people to the legacy
single host driver anyway... And then the tradeoff goes just in favour
of supporting more and more common new hardware - it will just make
more people happy than it will make people loose :-).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

[PATCH] IDE clean 12 3rd attempt

Post by Martin Daleck » Tue, 26 Feb 2002 05:10:08


Hello!

This is finally moving the ide-pci.c file into a shape where
the host chip detection lists can finally be moved to where they
belong - into the particular chipset specific files.

This is accomplished, by a rather obivous removal of macro magic,
which was just making entries to the global device type
list nonfunctional, instead of making them conditional on the
corresponding CONFIG_BLHA options.

The second thing was to add a flag field to the device recognition
list, which made it possible to compress many of the
multi || chip id conditionals go away.

The only other file affected is ide.h - here is the change in the size
of the name field, which apparently slipped through ide-clean-12...

[ ide-clean-13.diff 39K ]
diff -ur linux-2.5.5/drivers/ide/ide-pci.c linux/drivers/ide/ide-pci.c
--- linux-2.5.5/drivers/ide/ide-pci.c   Sun Feb 24 16:32:54 2002
+++ linux/drivers/ide/ide-pci.c Sun Feb 24 19:50:32 2002
@@ -44,11 +44,6 @@
 extern unsigned int ata66_aec62xx(ide_hwif_t *);
 extern void ide_init_aec62xx(ide_hwif_t *);
 extern void ide_dmacapable_aec62xx(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_aec62xx      NULL
-# define ata66_aec62xx         NULL
-# define ide_init_aec62xx      IDE_NO_DRIVER
-# define ide_dmacapable_aec62xx        NULL
 #endif

 #ifdef CONFIG_BLK_DEV_ALI15X3
@@ -56,11 +51,6 @@
 extern unsigned int ata66_ali15x3(ide_hwif_t *);
 extern void ide_init_ali15x3(ide_hwif_t *);
 extern void ide_dmacapable_ali15x3(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_ali15x3      NULL
-# define ata66_ali15x3         NULL
-# define ide_init_ali15x3      IDE_NO_DRIVER
-# define ide_dmacapable_ali15x3        NULL
 #endif

 #ifdef CONFIG_BLK_DEV_AMD74XX
@@ -68,11 +58,6 @@
 extern unsigned int ata66_amd74xx(ide_hwif_t *);
 extern void ide_init_amd74xx(ide_hwif_t *);
 extern void ide_dmacapable_amd74xx(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_amd74xx      NULL
-# define ata66_amd74xx         NULL
-# define ide_init_amd74xx      IDE_NO_DRIVER
-# define ide_dmacapable_amd74xx        NULL
 #endif

 #ifdef CONFIG_BLK_DEV_CMD64X
@@ -80,38 +65,21 @@
 extern unsigned int ata66_cmd64x(ide_hwif_t *);
 extern void ide_init_cmd64x(ide_hwif_t *);
 extern void ide_dmacapable_cmd64x(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_cmd64x    NULL
-# define ata66_cmd64x      NULL
-# ifdef __sparc_v9__
-#  define ide_init_cmd64x   IDE_IGNORE
-# else
-#  define ide_init_cmd64x   IDE_NO_DRIVER
-# endif
 #endif

 #ifdef CONFIG_BLK_DEV_CY82C693
 extern unsigned int pci_init_cy82c693(struct pci_dev *);
 extern void ide_init_cy82c693(ide_hwif_t *);
-#else
-# define pci_init_cy82c693  NULL
-# define ide_init_cy82c693  IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_CS5530
 extern unsigned int pci_init_cs5530(struct pci_dev *);
 extern void ide_init_cs5530(ide_hwif_t *);
-#else
-# define pci_init_cs5530    NULL
-# define ide_init_cs5530    IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_HPT34X
 extern unsigned int pci_init_hpt34x(struct pci_dev *);
 extern void ide_init_hpt34x(ide_hwif_t *);
-#else
-# define pci_init_hpt34x    NULL
-# define ide_init_hpt34x    IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_HPT366
@@ -123,25 +91,17 @@
 extern void ide_init_hpt366(ide_hwif_t *);
 extern void ide_dmacapable_hpt366(ide_hwif_t *, unsigned long);
 #else
+/* FIXME: those have to be killed */
 static byte hpt363_shared_irq;
 static byte hpt363_shared_pin;
-
-# define pci_init_hpt366       NULL
-# define ata66_hpt366          NULL
-# define ide_init_hpt366       IDE_NO_DRIVER
-# define ide_dmacapable_hpt366 NULL
 #endif

 #ifdef CONFIG_BLK_DEV_NS87415
 extern void ide_init_ns87415(ide_hwif_t *);
-#else
-# define ide_init_ns87415   IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_OPTI621
 extern void ide_init_opti621(ide_hwif_t *);
-#else
-# define ide_init_opti621   IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_PDC_ADMA
@@ -149,97 +109,55 @@
 extern unsigned int ata66_pdcadma(ide_hwif_t *);
 extern void ide_init_pdcadma(ide_hwif_t *);
 extern void ide_dmacapable_pdcadma(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_pdcadma      NULL
-# define ata66_pdcadma         NULL
-# define ide_init_pdcadma      IDE_IGNORE
-# define ide_dmacapable_pdcadma        NULL
 #endif

 #ifdef CONFIG_BLK_DEV_PDC202XX
 extern unsigned int pci_init_pdc202xx(struct pci_dev *);
 extern unsigned int ata66_pdc202xx(ide_hwif_t *);
 extern void ide_init_pdc202xx(ide_hwif_t *);
-#else
-# define pci_init_pdc202xx  NULL
-# define ata66_pdc202xx            NULL
-# define ide_init_pdc202xx  IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_PIIX
 extern unsigned int pci_init_piix(struct pci_dev *);
 extern unsigned int ata66_piix(ide_hwif_t *);
 extern void ide_init_piix(ide_hwif_t *);
-#else
-# define pci_init_piix NULL
-# define ata66_piix    NULL
-# define ide_init_piix IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_IT8172
 extern unsigned int pci_init_it8172(struct pci_dev *);
-
-/* We assume that this function has not been added to the global setup lists
- * due to a patch merge error.
- */
-extern unsigned int ata66_it8172(ide_hwif_t *);
 extern void ide_init_it8172(ide_hwif_t *);
-#else
-# define pci_init_it8172    NULL
-# define ata66_it8172      NULL
-# define ide_init_it8172    IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_RZ1000
 extern void ide_init_rz1000(ide_hwif_t *);
-#else
-# define ide_init_rz1000    IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_SVWKS
 extern unsigned int pci_init_svwks(struct pci_dev *);
 extern unsigned int ata66_svwks(ide_hwif_t *);
 extern void ide_init_svwks(ide_hwif_t *);
-#else
-# define pci_init_svwks        NULL
-# define ata66_svwks   NULL
-# define ide_init_svwks        IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_SIS5513
 extern unsigned int pci_init_sis5513(struct pci_dev *);
 extern unsigned int ata66_sis5513(ide_hwif_t *);
 extern void ide_init_sis5513(ide_hwif_t *);
-#else
-# define pci_init_sis5513   NULL
-# define ata66_sis5513     NULL
-# define ide_init_sis5513   IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_SLC90E66
 extern unsigned int pci_init_slc90e66(struct pci_dev *);
 extern unsigned int ata66_slc90e66(ide_hwif_t *);
 extern void ide_init_slc90e66(ide_hwif_t *);
-#else
-# define pci_init_slc90e66  NULL
-# define ata66_slc90e66            NULL
-# define ide_init_slc90e66  IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_SL82C105
 extern unsigned int pci_init_sl82c105(struct pci_dev *);
 extern void dma_init_sl82c105(ide_hwif_t *, unsigned long);
 extern void ide_init_sl82c105(ide_hwif_t *);
-#else
-# define pci_init_sl82c105  NULL
-# define dma_init_sl82c105  NULL
-# define ide_init_sl82c105  IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_TRM290
 extern void ide_init_trm290(ide_hwif_t *);
-#else
-# define ide_init_trm290    IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_VIA82CXXX
@@ -247,11 +165,6 @@
 extern unsigned int ata66_via82cxxx(ide_hwif_t *);
 extern void ide_init_via82cxxx(ide_hwif_t *);
 extern void ide_dmacapable_via82cxxx(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_via82cxxx        NULL
-# define ata66_via82cxxx           NULL
-# define ide_init_via82cxxx        IDE_NO_DRIVER
-# define ide_dmacapable_via82cxxx   NULL
 #endif

 typedef struct ide_pci_enablebit_s {
@@ -260,6 +173,17 @@
        byte    val;    /* value of masked reg when "enabled" */
 } ide_pci_enablebit_t;

+/* Flags used to untangle quirk handling.
+ */
+#define ATA_F_DMA      0x01
+#define ATA_F_NODMA    0x02    /* no DMA mode supported at all */
+#define ATA_F_NOADMA   0x04    /* DMA has to be enabled explicitely */
+#define ATA_F_FIXIRQ   0x08    /* fixed irq wiring */
+#define ATA_F_SER      0x10    /* serialize on first and second channel interrupts */
+#define ATA_F_IRQ      0x20    /* trust IRQ information from config */
+#define ATA_F_PHACK    0x40    /* apply PROMISE hacks */
+#define ATA_F_HPTHACK  0x80    /* apply HPT366 hacks */
+
 typedef struct ide_pci_device_s {
        unsigned short          vendor;
        unsigned short          device;
@@ -268,114 +192,139 @@
        void                    (*init_hwif)(ide_hwif_t *hwif);
        void                    (*dma_init)(ide_hwif_t *hwif, unsigned long dmabase);
        ide_pci_enablebit_t     enablebits[2];
-       byte                    bootable;
+       unsigned int            bootable;
        unsigned int            extra;
+       unsigned int            flags;
 } ide_pci_device_t;

 static ide_pci_device_t pci_chipsets[] __initdata = {
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82371FB_0,      NULL,               NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82371FB_1,      NULL,               NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82371MX,        NULL,               NULL,               ide_init_piix,      NULL,                       {{0x6D,0x80,0x80}, {0x6F,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82371SB_1,      pci_init_piix,      NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82371AB,        pci_init_piix,      NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801AB_1,      pci_init_piix,      NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82443MX_1,      pci_init_piix,      NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801AA_1,      pci_init_piix,      ata66_piix,         ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82372FB_1,      pci_init_piix,      ata66_piix,         ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82451NX,        pci_init_piix,      NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801BA_9,      pci_init_piix,      ata66_piix,         ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801BA_8,      pci_init_piix,      ata66_piix,         ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801CA_10,     pci_init_piix,      ata66_piix,         ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_VIA,     PCI_DEVICE_ID_VIA_82C561,           NULL,               NULL,               NULL,               NULL,                       {{0x00,0x00,0x00}, {0x00,0x00,0x00}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_VIA,     PCI_DEVICE_ID_VIA_82C576_1,         pci_init_via82cxxx, ata66_via82cxxx,    ide_init_via82cxxx, ide_dmacapable_via82cxxx,   {{0x40,0x02,0x02}, {0x40,0x01,0x01}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_VIA,     PCI_DEVICE_ID_VIA_82C586_1,         pci_init_via82cxxx,
...

read more »

 
 
 

[PATCH] IDE clean 12 3rd attempt

Post by Alan Co » Tue, 26 Feb 2002 05:30:10



> > And I think that 2.4.x and above don't run on
> > i386's anymore anyway.

> I don't mean to intrude or offend, but please backup your claims with
> hard facts as opposed to mere suppositions.

2.4 runs on an i386
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

[PATCH] IDE clean 12 3rd attempt

Post by Arjan van de Ve » Tue, 26 Feb 2002 05:50:08



> > it was about the i386 architecture, not just 80386 cpus. And yes 2.4 still
> > runs on those; you'be surprised how many
> > embedded systems run 80386 equivalents...

> Interresting. But do they still incorporate ST509 and other
> archaic controllers? Or do they have broken BIOS-es which don't
> setup the geometry information properly? I don't think so.

You bet that embedded systems use controllers that emulate archaic ones.
Oh and bios.... well......

Quote:> Well now I'm quite convinced. We can point those people to the legacy
> single host driver anyway... And then the tradeoff goes just in favour
> of supporting more and more common new hardware - it will just make
> more people happy than it will make people loose :-).

If you drop hardware support for no good reason.... you scare me. you
really do. Now dropping hardware support (or moving support
elsewhere) isn't always avoidable, but I'd think you need a pretty
good reason to do so.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

[PATCH] IDE clean 12 3rd attempt

Post by Vojtech Pavli » Tue, 26 Feb 2002 06:10:10





> >>linux ide driver anyway. And I think that 2.4.x and above don't run on
> >>i386's anymore anyway.

> > it was about the i386 architecture, not just 80386 cpus. And yes 2.4 still
> > runs on those; you'be surprised how many
> > embedded systems run 80386 equivalents...

> Interresting. But do they still incorporate ST509 and other
> archaic controllers? Or do they have broken BIOS-es which don't
> setup the geometry information properly? I don't think so.

Actually you cannot connect an IDE drive to a ST509 harddrive
controller. So that isn't handled by the IDE driver anyway and the
change won't affect people using ST509 controllers.

Quote:> Well now I'm quite convinced. We can point those people to the legacy
> single host driver anyway...

They have to use it anyway.

Quote:> And then the tradeoff goes just in favour of supporting more and more
> common new hardware - it will just make more people happy than it will
> make people loose :-).

--
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

[PATCH] IDE clean 12 3rd attempt

Post by Martin Daleck » Tue, 26 Feb 2002 06:10:11




>>>it was about the i386 architecture, not just 80386 cpus. And yes 2.4 still
>>>runs on those; you'be surprised how many
>>>embedded systems run 80386 equivalents...

>>Interresting. But do they still incorporate ST509 and other
>>archaic controllers? Or do they have broken BIOS-es which don't
>>setup the geometry information properly? I don't think so.

> You bet that embedded systems use controllers that emulate archaic ones.
> Oh and bios.... well......

>>Well now I'm quite convinced. We can point those people to the legacy
>>single host driver anyway... And then the tradeoff goes just in favour
>>of supporting more and more common new hardware - it will just make
>>more people happy than it will make people loose :-).

> If you drop hardware support for no good reason.... you scare me. you
> really do. Now dropping hardware support (or moving support
> elsewhere) isn't always avoidable, but I'd think you need a pretty
> good reason to do so.

Yes right. But first please really really think again what ST509 and MFM
controllers are ;-). And after all I have already heard some time
before some real complains from real users around me about the
particular behaviour currently present, which tried to use software raid
on ATA disks. And after all please have a look at the note from Andires
inside the patch, which has been there for a long time now.

Hmm I will perhaps have just to check what distro-backed-kernels do
here... Becouse if my memmory is right, they are removing this
particular function too already...

If you have any objections please *point me* at a particular system
where this would really break things.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

[PATCH] IDE clean 12 3rd attempt

Post by Martin Daleck » Tue, 26 Feb 2002 06:30:10


Silly me I have been testing the new flag field by an bitwise
or instead of the proper & :-). Can't imagine how this did slip in...
Corrected patch attached.

[ ide-clean-13a.diff 39K ]
diff -ur linux-2.5.5/drivers/ide/ide-pci.c linux/drivers/ide/ide-pci.c
--- linux-2.5.5/drivers/ide/ide-pci.c   Sun Feb 24 16:32:54 2002
+++ linux/drivers/ide/ide-pci.c Sun Feb 24 19:50:32 2002
@@ -44,11 +44,6 @@
 extern unsigned int ata66_aec62xx(ide_hwif_t *);
 extern void ide_init_aec62xx(ide_hwif_t *);
 extern void ide_dmacapable_aec62xx(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_aec62xx      NULL
-# define ata66_aec62xx         NULL
-# define ide_init_aec62xx      IDE_NO_DRIVER
-# define ide_dmacapable_aec62xx        NULL
 #endif

 #ifdef CONFIG_BLK_DEV_ALI15X3
@@ -56,11 +51,6 @@
 extern unsigned int ata66_ali15x3(ide_hwif_t *);
 extern void ide_init_ali15x3(ide_hwif_t *);
 extern void ide_dmacapable_ali15x3(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_ali15x3      NULL
-# define ata66_ali15x3         NULL
-# define ide_init_ali15x3      IDE_NO_DRIVER
-# define ide_dmacapable_ali15x3        NULL
 #endif

 #ifdef CONFIG_BLK_DEV_AMD74XX
@@ -68,11 +58,6 @@
 extern unsigned int ata66_amd74xx(ide_hwif_t *);
 extern void ide_init_amd74xx(ide_hwif_t *);
 extern void ide_dmacapable_amd74xx(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_amd74xx      NULL
-# define ata66_amd74xx         NULL
-# define ide_init_amd74xx      IDE_NO_DRIVER
-# define ide_dmacapable_amd74xx        NULL
 #endif

 #ifdef CONFIG_BLK_DEV_CMD64X
@@ -80,38 +65,21 @@
 extern unsigned int ata66_cmd64x(ide_hwif_t *);
 extern void ide_init_cmd64x(ide_hwif_t *);
 extern void ide_dmacapable_cmd64x(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_cmd64x    NULL
-# define ata66_cmd64x      NULL
-# ifdef __sparc_v9__
-#  define ide_init_cmd64x   IDE_IGNORE
-# else
-#  define ide_init_cmd64x   IDE_NO_DRIVER
-# endif
 #endif

 #ifdef CONFIG_BLK_DEV_CY82C693
 extern unsigned int pci_init_cy82c693(struct pci_dev *);
 extern void ide_init_cy82c693(ide_hwif_t *);
-#else
-# define pci_init_cy82c693  NULL
-# define ide_init_cy82c693  IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_CS5530
 extern unsigned int pci_init_cs5530(struct pci_dev *);
 extern void ide_init_cs5530(ide_hwif_t *);
-#else
-# define pci_init_cs5530    NULL
-# define ide_init_cs5530    IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_HPT34X
 extern unsigned int pci_init_hpt34x(struct pci_dev *);
 extern void ide_init_hpt34x(ide_hwif_t *);
-#else
-# define pci_init_hpt34x    NULL
-# define ide_init_hpt34x    IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_HPT366
@@ -123,25 +91,17 @@
 extern void ide_init_hpt366(ide_hwif_t *);
 extern void ide_dmacapable_hpt366(ide_hwif_t *, unsigned long);
 #else
+/* FIXME: those have to be killed */
 static byte hpt363_shared_irq;
 static byte hpt363_shared_pin;
-
-# define pci_init_hpt366       NULL
-# define ata66_hpt366          NULL
-# define ide_init_hpt366       IDE_NO_DRIVER
-# define ide_dmacapable_hpt366 NULL
 #endif

 #ifdef CONFIG_BLK_DEV_NS87415
 extern void ide_init_ns87415(ide_hwif_t *);
-#else
-# define ide_init_ns87415   IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_OPTI621
 extern void ide_init_opti621(ide_hwif_t *);
-#else
-# define ide_init_opti621   IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_PDC_ADMA
@@ -149,97 +109,55 @@
 extern unsigned int ata66_pdcadma(ide_hwif_t *);
 extern void ide_init_pdcadma(ide_hwif_t *);
 extern void ide_dmacapable_pdcadma(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_pdcadma      NULL
-# define ata66_pdcadma         NULL
-# define ide_init_pdcadma      IDE_IGNORE
-# define ide_dmacapable_pdcadma        NULL
 #endif

 #ifdef CONFIG_BLK_DEV_PDC202XX
 extern unsigned int pci_init_pdc202xx(struct pci_dev *);
 extern unsigned int ata66_pdc202xx(ide_hwif_t *);
 extern void ide_init_pdc202xx(ide_hwif_t *);
-#else
-# define pci_init_pdc202xx  NULL
-# define ata66_pdc202xx            NULL
-# define ide_init_pdc202xx  IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_PIIX
 extern unsigned int pci_init_piix(struct pci_dev *);
 extern unsigned int ata66_piix(ide_hwif_t *);
 extern void ide_init_piix(ide_hwif_t *);
-#else
-# define pci_init_piix NULL
-# define ata66_piix    NULL
-# define ide_init_piix IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_IT8172
 extern unsigned int pci_init_it8172(struct pci_dev *);
-
-/* We assume that this function has not been added to the global setup lists
- * due to a patch merge error.
- */
-extern unsigned int ata66_it8172(ide_hwif_t *);
 extern void ide_init_it8172(ide_hwif_t *);
-#else
-# define pci_init_it8172    NULL
-# define ata66_it8172      NULL
-# define ide_init_it8172    IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_RZ1000
 extern void ide_init_rz1000(ide_hwif_t *);
-#else
-# define ide_init_rz1000    IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_SVWKS
 extern unsigned int pci_init_svwks(struct pci_dev *);
 extern unsigned int ata66_svwks(ide_hwif_t *);
 extern void ide_init_svwks(ide_hwif_t *);
-#else
-# define pci_init_svwks        NULL
-# define ata66_svwks   NULL
-# define ide_init_svwks        IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_SIS5513
 extern unsigned int pci_init_sis5513(struct pci_dev *);
 extern unsigned int ata66_sis5513(ide_hwif_t *);
 extern void ide_init_sis5513(ide_hwif_t *);
-#else
-# define pci_init_sis5513   NULL
-# define ata66_sis5513     NULL
-# define ide_init_sis5513   IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_SLC90E66
 extern unsigned int pci_init_slc90e66(struct pci_dev *);
 extern unsigned int ata66_slc90e66(ide_hwif_t *);
 extern void ide_init_slc90e66(ide_hwif_t *);
-#else
-# define pci_init_slc90e66  NULL
-# define ata66_slc90e66            NULL
-# define ide_init_slc90e66  IDE_NO_DRIVER
 #endif

 #ifdef CONFIG_BLK_DEV_SL82C105
 extern unsigned int pci_init_sl82c105(struct pci_dev *);
 extern void dma_init_sl82c105(ide_hwif_t *, unsigned long);
 extern void ide_init_sl82c105(ide_hwif_t *);
-#else
-# define pci_init_sl82c105  NULL
-# define dma_init_sl82c105  NULL
-# define ide_init_sl82c105  IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_TRM290
 extern void ide_init_trm290(ide_hwif_t *);
-#else
-# define ide_init_trm290    IDE_IGNORE
 #endif

 #ifdef CONFIG_BLK_DEV_VIA82CXXX
@@ -247,11 +165,6 @@
 extern unsigned int ata66_via82cxxx(ide_hwif_t *);
 extern void ide_init_via82cxxx(ide_hwif_t *);
 extern void ide_dmacapable_via82cxxx(ide_hwif_t *, unsigned long);
-#else
-# define pci_init_via82cxxx        NULL
-# define ata66_via82cxxx           NULL
-# define ide_init_via82cxxx        IDE_NO_DRIVER
-# define ide_dmacapable_via82cxxx   NULL
 #endif

 typedef struct ide_pci_enablebit_s {
@@ -260,6 +173,17 @@
        byte    val;    /* value of masked reg when "enabled" */
 } ide_pci_enablebit_t;

+/* Flags used to untangle quirk handling.
+ */
+#define ATA_F_DMA      0x01
+#define ATA_F_NODMA    0x02    /* no DMA mode supported at all */
+#define ATA_F_NOADMA   0x04    /* DMA has to be enabled explicitely */
+#define ATA_F_FIXIRQ   0x08    /* fixed irq wiring */
+#define ATA_F_SER      0x10    /* serialize on first and second channel interrupts */
+#define ATA_F_IRQ      0x20    /* trust IRQ information from config */
+#define ATA_F_PHACK    0x40    /* apply PROMISE hacks */
+#define ATA_F_HPTHACK  0x80    /* apply HPT366 hacks */
+
 typedef struct ide_pci_device_s {
        unsigned short          vendor;
        unsigned short          device;
@@ -268,114 +192,139 @@
        void                    (*init_hwif)(ide_hwif_t *hwif);
        void                    (*dma_init)(ide_hwif_t *hwif, unsigned long dmabase);
        ide_pci_enablebit_t     enablebits[2];
-       byte                    bootable;
+       unsigned int            bootable;
        unsigned int            extra;
+       unsigned int            flags;
 } ide_pci_device_t;

 static ide_pci_device_t pci_chipsets[] __initdata = {
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82371FB_0,      NULL,               NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82371FB_1,      NULL,               NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82371MX,        NULL,               NULL,               ide_init_piix,      NULL,                       {{0x6D,0x80,0x80}, {0x6F,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82371SB_1,      pci_init_piix,      NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82371AB,        pci_init_piix,      NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801AB_1,      pci_init_piix,      NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82443MX_1,      pci_init_piix,      NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801AA_1,      pci_init_piix,      ata66_piix,         ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82372FB_1,      pci_init_piix,      ata66_piix,         ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82451NX,        pci_init_piix,      NULL,               ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801BA_9,      pci_init_piix,      ata66_piix,         ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801BA_8,      pci_init_piix,      ata66_piix,         ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_82801CA_10,     pci_init_piix,      ata66_piix,         ide_init_piix,      NULL,                       {{0x41,0x80,0x80}, {0x43,0x80,0x80}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_VIA,     PCI_DEVICE_ID_VIA_82C561,           NULL,               NULL,               NULL,               NULL,                       {{0x00,0x00,0x00}, {0x00,0x00,0x00}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_VIA,     PCI_DEVICE_ID_VIA_82C576_1,         pci_init_via82cxxx, ata66_via82cxxx,    ide_init_via82cxxx, ide_dmacapable_via82cxxx,   {{0x40,0x02,0x02}, {0x40,0x01,0x01}},   ON_BOARD,   0 },
-       {PCI_VENDOR_ID_VIA,     PCI_DEVICE_ID_VIA_82C586_1,         pci_init_via82cxxx,
...

read more »

 
 
 

1. IDE clean 12 3rd attempt

This portion of the patch should be split out and submitted separately,
to the author of the document, as it doesn't really have anything to do
with the rest of the ide changes.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. how does one resize a reiserfs partition?

3. IDE errors during boot with some ¨ide.2.2.12.*.patch.gz¨

4. Linux on old Tektronix?

5. Connection attempt to TCP 192.168.0.13:3128 from 192.168.0.12:2050

6. Mosaic connect problems

7. PATCH: clean up the IDE iops, add ones for a dead iface

8. share and netgroups

9. PATCH: clean up ht6560 legacy ide driver

10. Two-channel ide controllers + 3rd ide drive?

11. Does the 1.3.57 Developmental Kernel support IDE Devices on the 3rd IDE Port

12. added a 3rd FAST IDE HDD, and I cannot access my IDE ATAPI CDROM

13. 2nd ALSA update [12/12] - 2002/10/01