1
0
Fork 0
alistair23-linux/drivers
Bartlomiej Zolnierkiewicz 93de00fd1c ide: remove broken/dangerous HDIO_[UNREGISTER,SCAN]_HWIF ioctls (take 3)
hdparm explicitely marks HDIO_[UNREGISTER,SCAN]_HWIF ioctls as DANGEROUS
and given the number of bugs we can assume that there are no real users:

* DMA has no chance of working because DMA resources are released by
  ide_unregister() and they are never allocated again.

* Since ide_init_hwif_ports() is used for ->io_ports[] setup the ioctls
  don't work for almost all hosts with "non-standard" (== non ISA-like)
  layout of IDE taskfile registers (there is a lot of such host drivers).

* ide_port_init_devices() is not called when probing IDE devices so:
  - drive->autotune is never set and IDE host/devices are not programmed
    for the correct PIO/DMA transfer modes (=> possible data corruption)
  - host specific I/O 32-bit and IRQ unmasking settings are not applied
    (=> possible data corruption)
  - host specific ->port_init_devs method is not called (=> no luck with
    ht6560b, qd65xx and opti621 host drivers)

* ->rw_disk method is not preserved (=> no HPT3xxN chipsets support).

* ->serialized flag is not preserved (=> possible data corruption when
   using icside, aec62xx (ATP850UF chipset), cmd640, cs5530, hpt366
   (HPT3xxN chipsets), rz1000, sc1200, dtc2278 and ht6560b host drivers).

* ->ack_intr method is not preserved (=> needed by ide-cris, buddha,
  gayle and macide host drivers).

* ->sata_scr[] and sata_misc[] is cleared by ide_unregister() and it
  isn't initialized again (SiI3112 support needs them).

* To issue an ioctl() there need to be at least one IDE device present
  in the system.

* ->cable_detect method is not preserved + it is not called when probing
  IDE devices so cable detection is broken (however since DMA support is
  also broken it doesn't really matter ;-).

* Some objects which may have already been freed in ide_unregister()
  are restored by ide_hwif_restore() (i.e. ->hwgroup).

* ide_register_hw() may unregister unrelated IDE ports if free ide_hwifs[]
  slot cannot be found.

* When IDE host drivers are modular unregistered port may be re-used by
  different host driver that owned it first causing subtle bugs.

Since we now have a proper warm-plug support remove these ioctls,
then remove no longer needed:
- ide_register_hw() and ide_hwif_restore() functions
- 'init_default' and 'restore' arguments of ide_unregister()
- zeroeing of hwif->{dma,extra}_* fields in ide_unregister()

As an added bonus IDE core code size shrinks by ~3kB (x86-32).

v2:
* fix ide_unregister() arguments in cleanup_module() (Andrew Morton).

v3:
* fix ide_unregister() arguments in palm_bk3710.c.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:24 +02:00
..
acorn/char Fix default compose table initialization 2008-03-03 14:53:16 -08:00
acpi acpi: bus: check once more for an empty list after locking it 2008-04-15 19:35:41 -07:00
amba
ata [libata] make ali_atapi_dma static 2008-04-12 00:16:49 -04:00
atm [ATM] drivers/atm/iphase.c: compilation warning fix 2008-04-02 00:03:00 -07:00
auxdisplay
base driver core: fix small mem leak in driver_add_kobj() 2008-03-28 14:45:23 -07:00
block cciss: error: implicit declaration of function 'sg_init_table' 2008-04-11 08:06:44 -07:00
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-03-12 13:08:09 -07:00
cdrom make cdrom.c:check_for_audio_disc() static 2008-03-04 11:28:41 +01:00
char fix IS_I9XX macro in i915 DRM driver 2008-04-06 16:10:40 -07:00
clocksource
connector connector: convert to single-threaded workqueue 2008-03-23 21:51:12 -07:00
cpufreq [CPUFREQ] fix section mismatch warnings 2008-03-05 14:45:31 -05:00
cpuidle cpuidle: fix 100% C0 statistics regression 2008-03-26 00:58:19 -04:00
crypto drivers/crypto/hifn_795x.c trivial endianness annotations 2008-03-30 14:20:24 -07:00
dca DCA: convert struct class_device to struct device. 2008-02-08 15:33:33 -08:00
dio dio: ARRAY_SIZE() cleanup 2008-02-05 09:44:23 -08:00
dma [POWERPC] fsldma: Use compatiable binding as spec 2008-03-31 11:45:41 -05:00
edac drivers/edac/i3000: document type promotion 2008-02-07 08:42:23 -08:00
eisa
firewire firewire: fw-ohci: plug dma memory leak in AR handler 2008-03-27 21:01:14 +01:00
firmware ipmi: change device node ordering to reflect probe order 2008-04-04 14:46:26 -07:00
gpio gpio/pca953x bugfix: mark as can_sleep 2008-03-10 18:01:19 -07:00
hid HID: update key codes for Apple aluminium 2008-03-18 11:20:33 +01:00
hwmon hwmon: (w83781d) Fix I/O resource conflict with PNP 2008-03-27 08:40:41 -04:00
i2c i2c-tiny-usb: New VID/PID pair 2008-04-11 12:07:05 +02:00
ide ide: remove broken/dangerous HDIO_[UNREGISTER,SCAN]_HWIF ioctls (take 3) 2008-04-18 00:46:24 +02:00
ieee1394 ieee1394: sbp2: fix for SYM13FW500 bridge (Datafab disk) 2008-03-14 00:56:59 +01:00
infiniband trivial endianness annotations: infiniband core 2008-03-30 14:20:24 -07:00
input Input: appletouch - add product IDs for the 4th generation MacBooks 2008-04-02 10:14:29 -04:00
isdn [ISDN]: Do not validate ISDN net device address prior to interface-up 2008-04-13 22:44:20 -07:00
leds leds: fix platform driver hotplug/coldplug 2008-04-15 19:35:40 -07:00
lguest misc __user misannotations (pointless casts to long) 2008-03-30 14:20:23 -07:00
macintosh ide: rework PowerMac media-bay support (take 2) 2008-04-18 00:46:23 +02:00
mca
md md: close a livelock window in handle_parity_checks5 2008-04-11 08:06:44 -07:00
media pvrusb2: fix broken build due to patch order dependency 2008-04-07 19:14:34 -07:00
memstick memstick: suppress uninitialized-var warning 2008-03-28 14:45:23 -07:00
message [SCSI] mpt fusion: Power Management fixes for MPT SAS PCI-E controllers 2008-03-18 15:13:40 -05:00
mfd mfd/asic3: ioread/iowrite take pointer, not unsigned long 2008-03-30 14:20:24 -07:00
misc misc: fix platform driver hotplug/coldplug 2008-04-15 19:35:40 -07:00
mmc mmc: fix platform driver hotplug/coldplug 2008-04-15 19:35:40 -07:00
mtd mtd/chips: add missing set_current_state() to cfi_{amdstd,staa}_sync() 2008-04-08 18:25:53 -07:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-16 07:44:27 -07:00
nubus nubus: kill drivers/nubus/nubus_syms.c 2008-02-05 09:44:23 -08:00
of [POWERPC] Create and hook up of_platform_device_shutdown 2008-02-06 16:29:59 +11:00
oprofile d_path: Make get_dcookie() use a struct path argument 2008-02-14 21:17:08 -08:00
parisc [PARISC] make ptr_to_pide() static 2008-03-15 19:17:12 -07:00
parport parport_pc: make sure to release IO ports after probing for IT87XX 2008-04-04 14:30:31 -07:00
pci pci: revert SMBus unhide on HP Compaq nx6110 2008-03-28 14:45:22 -07:00
pcmcia pcmcia: fix platform driver hotplug/coldplug 2008-04-15 19:35:40 -07:00
pnp pnpacpi: reduce printk severity for "pnpacpi: exceeded the max number of ..." 2008-03-26 14:22:20 -04:00
power Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2008-02-07 09:45:58 -08:00
ps3 [POWERPC] PS3: Update sys-manager button events 2008-02-14 22:11:01 +11:00
rapidio docbook: fix rapidio source files 2008-03-03 10:47:13 -08:00
rtc rtc: fix the error in the function of cmos_set_alarm 2008-04-15 19:35:40 -07:00
s390 [S390] zcrypt: fix ap_device_list handling 2008-03-05 12:37:19 +01:00
sbus
scsi scsi: fix sense_slab/bio swapping livelock 2008-04-06 16:10:08 -07:00
serial serial: fix platform driver hotplug/coldplug 2008-04-15 19:35:40 -07:00
sh maple: fix device detection 2008-02-26 14:12:09 +09:00
sn ioc3.c: replace remaining __FUNCTION__ occurrences 2008-03-17 08:11:48 -04:00
spi spi: spi_s3c24xx must initialize num_chipselect 2008-04-15 19:35:41 -07:00
ssb ssb: Fix usage of struct device used for DMAing 2008-04-15 15:04:35 -04:00
tc
telephony
thermal acpi thermal trip points increased to 12 2008-04-15 19:35:41 -07:00
uio UIO: add pgprot_noncached() to UIO mmap code 2008-03-24 22:33:49 -07:00
usb USB: remove broken usb-serial num_endpoints check 2008-04-15 22:30:53 -07:00
video fbdev: fix /proc/fb oops after module removal 2008-04-15 19:35:40 -07:00
virtio virtio: remove overzealous BUG_ON. 2008-04-07 13:14:22 -07:00
w1 ds1wm: report bus reset error 2008-03-04 16:35:12 -08:00
watchdog watchdog: fix platform driver hotplug/coldplug 2008-04-11 08:06:44 -07:00
xen xen: fix grant table bug 2008-04-04 18:36:46 +02:00
zorro
Kconfig memstick: initial commit for Sony MemoryStick support 2008-02-09 11:08:34 -08:00
Makefile memstick: initial commit for Sony MemoryStick support 2008-02-09 11:08:34 -08:00