[PATCH] 2.2.10-pre4 IDE config problems

Andrzej Krzysztofowicz (ankry@green.mif.pg.gda.pl)
Tue, 6 Jul 1999 13:07:27 +0200 (EEST)


Hi,
I noticed that current (2.3.10-pre4) drivers/block/Config.in handling
of some IDE-related options does not properly handle old .config values
(i.e. uses old options when they should be ignored).
The simple example is (for i386 arch.): to disable CONFIG_PCI with following
options in old .config enabled:

==============================
CONFIG_EXPERIMENTAL=y
...
CONFIG_PCI=y
...
CONFIG_BLK_DEV_IDE=y
...
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_IDEDMA_PCI_AUTO=y
...
IDEDMA_PCI_EXPERIMENTAL=y
...
CONFIG_BLK_DEV_ALI15X3=y
...
CONFIG_BLK_DEV_IDEDMA=y
CONFIG_IDEDMA_AUTO=y
...
CONFIG_BLK_DEV_IDE_MODES=y
==============================

You get:

==============================
# CONFIG_PCI is not set
...
CONFIG_BLK_DEV_IDE=y
...
CONFIG_BLK_DEV_IDEDMA=y # it bases on old values of CONFIG_BLK_DEV_IDEDMA_PCI
CONFIG_IDEDMA_AUTO=y # and CONFIG_IDEDMA_PCI_AUTO which are never
... # undefined
CONFIG_BLK_DEV_IDE_MODES=y # as CONFIG_BLK_DEV_ALI15X3 is not undefined
# also ...
==============================

The similar problem appears always when somebody uses in a config condition
a variable:
- which may be not defined (for a specyfic configuration) and
- the condition for the same configuration is analysed during config
process.
It is a bug.
Of course, the problem disappears whan you call make config/menuconfig twice;
but this is not proper solution (IMHO) ...

The following patch (long) fixes this problem by defining
CONFIG_BLK_DEV_IDEDMA, CONFIG_IDEDMA_AUTO and CONFIG_BLK_DEV_IDE_MODES
(separate define_bool()s) *only* when they should be defined (and with
default to "n"). It also removes duplicated condition in line 32 of
drivers/block/Config.in (same condition is examined in lines 17,19).

Regards
Andrzej
********************* PATCH *********************************
--- linux/drivers/block/Config.in.orig Tue Jul 6 11:41:07 1999
+++ linux/drivers/block/Config.in Tue Jul 6 12:01:14 1999
@@ -17,6 +17,7 @@
if [ "$CONFIG_BLK_DEV_IDE" = "n" ]; then
bool 'Old hard disk (MFM/RLL/IDE) driver' CONFIG_BLK_DEV_HD_ONLY
else
+ define_bool CONFIG_BLK_DEV_IDE_MODES n
bool ' Use old disk-only driver on primary interface' CONFIG_BLK_DEV_HD_IDE
dep_tristate ' Include IDE/ATA-2 DISK support' CONFIG_BLK_DEV_IDEDISK $CONFIG_BLK_DEV_IDE
if [ "$CONFIG_BLK_DEV_IDEDISK" != "n" ]; then
@@ -29,125 +30,144 @@
dep_tristate ' Include IDE/ATAPI TAPE support' CONFIG_BLK_DEV_IDETAPE $CONFIG_BLK_DEV_IDE
dep_tristate ' Include IDE/ATAPI FLOPPY support' CONFIG_BLK_DEV_IDEFLOPPY $CONFIG_BLK_DEV_IDE
dep_tristate ' SCSI emulation support' CONFIG_BLK_DEV_IDESCSI $CONFIG_BLK_DEV_IDE
- if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
- bool ' CMD640 chipset bugfix/support' CONFIG_BLK_DEV_CMD640
- if [ "$CONFIG_BLK_DEV_CMD640" = "y" ]; then
- bool ' CMD640 enhanced support' CONFIG_BLK_DEV_CMD640_ENHANCED
- fi
- if [ "$CONFIG_PCI" = "y" ]; then
- bool ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000
- bool ' Generic PCI IDE chipset support' CONFIG_BLK_DEV_IDEPCI
- if [ "$CONFIG_BLK_DEV_IDEPCI" = "y" ]; then
- bool ' Generic PCI bus-master DMA support' CONFIG_BLK_DEV_IDEDMA_PCI
- if [ "$CONFIG_BLK_DEV_IDEDMA_PCI" = "y" ]; then
- bool ' Use PCI DMA by default when available' CONFIG_IDEDMA_PCI_AUTO
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- bool ' Good-Bad DMA Model-Firmware (EXPERIMENTAL)' IDEDMA_NEW_DRIVE_LISTINGS
- bool ' Generic ATA-66 support (DANGEROUS)' CONFIG_IDEDMA_ULTRA_66
- define_bool IDEDMA_PCI_EXPERIMENTAL y
- else
- define_bool IDEDMA_PCI_EXPERIMENTAL n
- fi
+ bool ' CMD640 chipset bugfix/support' CONFIG_BLK_DEV_CMD640
+ if [ "$CONFIG_BLK_DEV_CMD640" = "y" ]; then
+ define_bool CONFIG_BLK_DEV_IDE_MODES y
+ bool ' CMD640 enhanced support' CONFIG_BLK_DEV_CMD640_ENHANCED
+ fi
+ define_bool CONFIG_BLK_DEV_IDEDMA n
+ define_bool CONFIG_IDEDMA_AUTO n
+ if [ "$CONFIG_PCI" = "y" ]; then
+ bool ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000
+ bool ' Generic PCI IDE chipset support' CONFIG_BLK_DEV_IDEPCI
+ if [ "$CONFIG_BLK_DEV_IDEPCI" = "y" ]; then
+ bool ' Generic PCI bus-master DMA support' CONFIG_BLK_DEV_IDEDMA_PCI
+ if [ "$CONFIG_BLK_DEV_IDEDMA_PCI" = "y" ]; then
+ define_bool CONFIG_BLK_DEV_IDEDMA y
+ bool ' Use PCI DMA by default when available' CONFIG_IDEDMA_PCI_AUTO
+ if [ "$CONFIG_IDEDMA_PCI_AUTO" = "y" ]; then
+ define_bool CONFIG_IDEDMA_AUTO y
fi
- bool ' Boot off-board chipsets first support' CONFIG_BLK_DEV_OFFBOARD
- bool ' AEC6210 chipset support' CONFIG_BLK_DEV_AEC6210
- if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then
- bool ' ALI M15x3 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_ALI15X3
- bool ' CMD646 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_CMD646
- bool ' CY82C693 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_CY82C693
- fi
- bool ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X
- if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" -a \
- "$CONFIG_BLK_DEV_HPT34X" = "y" ]; then
- bool ' HPT34X DMA support (DANGEROUS)' CONFIG_BLK_DEV_HPT34X_DMA
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool ' Good-Bad DMA Model-Firmware (EXPERIMENTAL)' IDEDMA_NEW_DRIVE_LISTINGS
+ bool ' Generic ATA-66 support (DANGEROUS)' CONFIG_IDEDMA_ULTRA_66
+ define_bool IDEDMA_PCI_EXPERIMENTAL y
+ else
+ define_bool IDEDMA_PCI_EXPERIMENTAL n
fi
- bool ' Intel PIIXn chipsets support' CONFIG_BLK_DEV_PIIX
- if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" -a \
- "$CONFIG_BLK_DEV_PIIX" = "y" ]; then
- bool ' PIIXn Tuning support (EXPERIMENTAL)' CONFIG_BLK_DEV_PIIX_TUNING
+ fi
+ bool ' Boot off-board chipsets first support' CONFIG_BLK_DEV_OFFBOARD
+ bool ' AEC6210 chipset support' CONFIG_BLK_DEV_AEC6210
+ if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then
+ bool ' ALI M15x3 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_ALI15X3
+ bool ' CMD646 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_CMD646
+ bool ' CY82C693 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_CY82C693
+ if [ "$CONFIG_BLK_DEV_ALI15X3" = "y" -o \
+ "$CONFIG_BLK_DEV_CY82C693" = "y" ]; then
+ define_bool CONFIG_BLK_DEV_IDE_MODES y
fi
+ fi
+ bool ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X
+ if [ "$CONFIG_BLK_DEV_HPT34X" = "y" ]; then
+ define_bool CONFIG_BLK_DEV_IDE_MODES y
if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then
- bool ' NS87415 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_NS87415
+ bool ' HPT34X DMA support (DANGEROUS)' CONFIG_BLK_DEV_HPT34X_DMA
fi
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- bool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621
+ fi
+ bool ' Intel PIIXn chipsets support' CONFIG_BLK_DEV_PIIX
+ if [ "$CONFIG_BLK_DEV_PIIX" = "y" ]; then
+ define_bool CONFIG_BLK_DEV_IDE_MODES y
+ if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then
+ bool ' PIIXn Tuning support (EXPERIMENTAL)' CONFIG_BLK_DEV_PIIX_TUNING
fi
- if [ "$CONFIG_BLK_DEV_IDEDMA_PCI" = "y" ]; then
- bool ' PROMISE PDC20246/PDC20262 support' CONFIG_BLK_DEV_PDC202XX
- if [ "$CONFIG_EXPERIMENTAL" = "y" -a \
- "$CONFIG_BLK_DEV_PDC202XX" = "y" ]; then
- bool ' Special UDMA Feature (EXPERIMENTAL)' PDC202XX_FORCE_BURST_BIT
- bool ' Special Mode Feature (DANGEROUS)' PDC202XX_FORCE_MASTER_MODE
- fi
+ fi
+ if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then
+ bool ' NS87415 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_NS87415
+ fi
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621
+ if [ "$CONFIG_BLK_DEV_OPTI621" = "y" ]; then
+ define_bool CONFIG_BLK_DEV_IDE_MODES y
fi
- if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then
- bool ' Tekram TRM290 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_TRM290
- bool ' VIA82C586 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_VIA82C586
+ fi
+ if [ "$CONFIG_BLK_DEV_IDEDMA_PCI" = "y" ]; then
+ bool ' PROMISE PDC20246/PDC20262 support' CONFIG_BLK_DEV_PDC202XX
+ if [ "$CONFIG_EXPERIMENTAL" = "y" -a \
+ "$CONFIG_BLK_DEV_PDC202XX" = "y" ]; then
+ bool ' Special UDMA Feature (EXPERIMENTAL)' PDC202XX_FORCE_BURST_BIT
+ bool ' Special Mode Feature (DANGEROUS)' PDC202XX_FORCE_MASTER_MODE
fi
fi
- if [ "$CONFIG_PPC" = "y" -o "$CONFIG_ARM" = "y" ]; then
- bool ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105
+ if [ "$IDEDMA_PCI_EXPERIMENTAL" = "y" ]; then
+ bool ' Tekram TRM290 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_TRM290
+ bool ' VIA82C586 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_VIA82C586
fi
fi
- if [ "$CONFIG_PMAC" = "y" -o "$CONFIG_ALL_PPC" = "y" ]; then
- bool ' Builtin PowerMac IDE support' CONFIG_BLK_DEV_IDE_PMAC
- if [ "$CONFIG_BLK_DEV_IDE_PMAC" != "n" ]; then
- bool ' PowerMac IDE DMA support' CONFIG_BLK_DEV_IDEDMA_PMAC
- if [ "$CONFIG_BLK_DEV_IDEDMA_PMAC" = "y" ]; then
- bool ' Use DMA by default' CONFIG_IDEDMA_PMAC_AUTO
- fi
- fi
- fi
- if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
- bool ' ICS IDE interface support' CONFIG_BLK_DEV_IDE_ICSIDE
- if [ "$CONFIG_BLK_DEV_IDE_ICSIDE" = "y" ]; then
- bool ' ICS DMA support' CONFIG_BLK_DEV_IDEDMA_ICS
- if [ "$CONFIG_BLK_DEV_IDEDMA_ICS" = "y" ]; then
- bool ' Use ICS DMA by default' CONFIG_IDEDMA_ICS_AUTO
- fi
- fi
- bool ' RapIDE interface support' CONFIG_BLK_DEV_IDE_RAPIDE
- fi
- if [ "$CONFIG_BLK_DEV_IDEDMA_PCI" = "y" -o \
- "$CONFIG_BLK_DEV_IDEDMA_PMAC" = "y" -o \
- "$CONFIG_BLK_DEV_IDEDMA_ICS" = "y" ]; then
- define_bool CONFIG_BLK_DEV_IDEDMA y
- if [ "$CONFIG_IDEDMA_PCI_AUTO" = "y" -o \
- "$CONFIG_IDEDMA_PMAC_AUTO" = "y" -o \
- "$CONFIG_IDEDMA_ICS_AUTO" = "y" ]; then
- define_bool CONFIG_IDEDMA_AUTO y
- fi
- fi
- bool ' Other IDE chipset support' CONFIG_IDE_CHIPSETS
- if [ "$CONFIG_IDE_CHIPSETS" = "y" ]; then
- comment 'Note: most of these also require special kernel boot parameters'
- bool ' Generic 4 drives/port support' CONFIG_BLK_DEV_4DRIVES
- bool ' ALI M14xx support' CONFIG_BLK_DEV_ALI14XX
- bool ' DTC-2278 support' CONFIG_BLK_DEV_DTC2278
- bool ' Holtek HT6560B support' CONFIG_BLK_DEV_HT6560B
- if [ "$CONFIG_BLK_DEV_IDEDISK" = "y" -a \
- "$CONFIG_EXPERIMENTAL" = "y" ]; then
- bool ' PROMISE DC4030 support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC4030
+ if [ "$CONFIG_PPC" = "y" -o "$CONFIG_ARM" = "y" ]; then
+ bool ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105
+ if [ "$CONFIG_BLK_DEV_SL82C105" = "y" ]; then
+ define_bool CONFIG_BLK_DEV_IDE_MODES y
fi
- bool ' QDI QD6580 support' CONFIG_BLK_DEV_QD6580
- bool ' UMC-8672 support' CONFIG_BLK_DEV_UMC8672
fi
- if [ "$CONFIG_AMIGA" = "y" ]; then
- bool ' Amiga Gayle IDE interface support' CONFIG_BLK_DEV_GAYLE
- if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- bool ' Amiga IDE Doubler support' CONFIG_BLK_DEV_IDEDOUBLER $CONFIG_BLK_DEV_GAYLE
+ fi
+ if [ "$CONFIG_PMAC" = "y" -o "$CONFIG_ALL_PPC" = "y" ]; then
+ bool ' Builtin PowerMac IDE support' CONFIG_BLK_DEV_IDE_PMAC
+ if [ "$CONFIG_BLK_DEV_IDE_PMAC" != "n" ]; then
+ define_bool CONFIG_BLK_DEV_IDE_MODES y
+ bool ' PowerMac IDE DMA support' CONFIG_BLK_DEV_IDEDMA_PMAC
+ if [ "$CONFIG_BLK_DEV_IDEDMA_PMAC" = "y" ]; then
+ define_bool CONFIG_BLK_DEV_IDEDMA y
+ bool ' Use DMA by default' CONFIG_IDEDMA_PMAC_AUTO
+ if [ "$CONFIG_IDEDMA_PMAC_AUTO" = "y" ]; then
+ define_bool CONFIG_IDEDMA_AUTO y
+ fi
fi
fi
- if [ "$CONFIG_ZORRO" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then
- bool ' Buddha/Catweasel IDE interface support' CONFIG_BLK_DEV_BUDDHA
+ fi
+ if [ "$CONFIG_ARCH_ACORN" = "y" ]; then
+ bool ' ICS IDE interface support' CONFIG_BLK_DEV_IDE_ICSIDE
+ if [ "$CONFIG_BLK_DEV_IDE_ICSIDE" = "y" ]; then
+ bool ' ICS DMA support' CONFIG_BLK_DEV_IDEDMA_ICS
+ if [ "$CONFIG_BLK_DEV_IDEDMA_ICS" = "y" ]; then
+ define_bool CONFIG_BLK_DEV_IDEDMA y
+ bool ' Use ICS DMA by default' CONFIG_IDEDMA_ICS_AUTO
+ if [ "$CONFIG_IDEDMA_ICS_AUTO" = "y" ]; then
+ define_bool CONFIG_IDEDMA_AUTO y
+ fi
+ fi
fi
- if [ "$CONFIG_ATARI" = "y" ]; then
- bool ' Falcon IDE interface support' CONFIG_BLK_DEV_FALCON_IDE
+ bool ' RapIDE interface support' CONFIG_BLK_DEV_IDE_RAPIDE
+ fi
+ bool ' Other IDE chipset support' CONFIG_IDE_CHIPSETS
+ if [ "$CONFIG_IDE_CHIPSETS" = "y" ]; then
+ define_bool CONFIG_BLK_DEV_IDE_MODES y
+ comment 'Note: most of these also require special kernel boot parameters'
+ bool ' Generic 4 drives/port support' CONFIG_BLK_DEV_4DRIVES
+ bool ' ALI M14xx support' CONFIG_BLK_DEV_ALI14XX
+ bool ' DTC-2278 support' CONFIG_BLK_DEV_DTC2278
+ bool ' Holtek HT6560B support' CONFIG_BLK_DEV_HT6560B
+ if [ "$CONFIG_BLK_DEV_IDEDISK" = "y" -a \
+ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool ' PROMISE DC4030 support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC4030
fi
- if [ "$CONFIG_MAC" = "y" ]; then
- bool ' Macintosh Quadra/Powerbook IDE interface support' CONFIG_BLK_DEV_MAC_IDE
+ bool ' QDI QD6580 support' CONFIG_BLK_DEV_QD6580
+ bool ' UMC-8672 support' CONFIG_BLK_DEV_UMC8672
+ fi
+ if [ "$CONFIG_AMIGA" = "y" ]; then
+ bool ' Amiga Gayle IDE interface support' CONFIG_BLK_DEV_GAYLE
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool ' Amiga IDE Doubler support' CONFIG_BLK_DEV_IDEDOUBLER $CONFIG_BLK_DEV_GAYLE
fi
fi
+ if [ "$CONFIG_ZORRO" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool ' Buddha/Catweasel IDE interface support' CONFIG_BLK_DEV_BUDDHA
+ fi
+ if [ "$CONFIG_ATARI" = "y" ]; then
+ bool ' Falcon IDE interface support' CONFIG_BLK_DEV_FALCON_IDE
+ fi
+ if [ "$CONFIG_MAC" = "y" ]; then
+ bool ' Macintosh Quadra/Powerbook IDE interface support' CONFIG_BLK_DEV_MAC_IDE
+ fi
fi
if [ "$CONFIG_MCA" = "y" ]; then
tristate 'PS/2 ESDI hard disk support' CONFIG_BLK_DEV_PS2
@@ -199,20 +219,6 @@
dep_tristate 'Parallel port IDE device support' CONFIG_PARIDE $CONFIG_PARIDE_PARPORT
if [ "$CONFIG_PARIDE" = "y" -o "$CONFIG_PARIDE" = "m" ]; then
source drivers/block/paride/Config.in
-fi
-
-if [ "$CONFIG_IDE_CHIPSETS" = "y" -o \
- "$CONFIG_BLK_DEV_ALI15X3" = "y" -o \
- "$CONFIG_BLK_DEV_CMD640" = "y" -o \
- "$CONFIG_BLK_DEV_CY82C693" = "y" -o \
- "$CONFIG_BLK_DEV_HPT34X" = "y" -o \
- "$CONFIG_BLK_DEV_IDE_PMAC" = "y" -o \
- "$CONFIG_BLK_DEV_OPTI621" = "y" -o \
- "$CONFIG_BLK_DEV_PIIX" = "y" -o \
- "$CONFIG_BLK_DEV_SL82C105" = "y" ]; then
- define_bool CONFIG_BLK_DEV_IDE_MODES y
-else
- define_bool CONFIG_BLK_DEV_IDE_MODES n
fi

if [ "$CONFIG_BLK_DEV_HD_IDE" = "y" -o "$CONFIG_BLK_DEV_HD_ONLY" = "y" ]; then
*************************************************************

-- 
=======================================================================
  Andrzej M. Krzysztofowicz               ankry@mif.pg.gda.pl
  phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math.,   Technical University of Gdansk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/