IDE (a.k.a. "zombie") updates #2
Subsystems (6)
* Disk shock protection support. (Elias Oltmanns)
* IDE ACPI fix for slave device-only configurations.
* Conversion of ide-{cd,floppy} to new IDE debugging macros. (Borislav Petkov)
* Next part of generic ATAPI support saga. (the usual suspects)
* sgiioc4 host driver fixes. (Sergei Shtylylov)
* "Short cable" quirk for EC-900 mini-notebook.
(Herton Ronaldo Krzesinski)
* Misc fixups (Adrian Bunk, Alexander Beregalov, Elias Oltmanns).
* A ton of cleanups.
Linus, please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/
to receive the following updates:
Documentation/laptops/disk-shock-protection.txt | 149 +++++ arch/mips/include/asm/mach-generic/ide.h | 29 - arch/xtensa/kernel/setup.c | 5 - drivers/ide/Kconfig | 38 +-- drivers/ide/Makefile | 19 +- drivers/ide/arm/icside.c | 23 +- drivers/ide/h8300/ide-h8300.c | 2 +- drivers/ide/ide-acpi.c | 12 +- drivers/ide/ide-atapi.c | 183 +++++-- drivers/ide/ide-cd.c | 261 +++++++--- drivers/ide/ide-cd.h | 1 - drivers/ide/ide-disk.c | 357 ++++--------- drivers/ide/ide-disk.h | 32 ++ drivers/ide/ide-disk_ioctl.c | 29 + drivers/ide/ide-disk_proc.c | 129 +++++ drivers/ide/ide-dma-sff.c | 356 ++++++++++++ drivers/ide/ide-dma.c | 481 ++--------------- drivers/ide/ide-floppy.c | 392 ++++---------- drivers/ide/ide-floppy.h | 19 +- drivers/ide/ide-floppy_ioctl.c | 56 ++- drivers/ide/ide-floppy_proc.c | 33 ++ drivers/ide/ide-generic.c | 51 +-- drivers/ide/ide-io.c | 237 ++++----- drivers/ide/ide-ioctls.c | 21 +- drivers/ide/ide-iops.c | 95 +++-- drivers/ide/ide-lib.c | 2 +- drivers/ide/ide-park.c | 121 +++++ drivers/ide/ide-probe.c | 215 ++++---- drivers/ide/ide-proc.c | 6 +- drivers/ide/ide-tape.c | 155 ++---- drivers/ide/ide-taskfile.c | 128 ++--- drivers/ide/ide.c | 135 +++-- drivers/ide/legacy/ali14xx.c | 2 +- drivers/ide/legacy/ht6560b.c | 9 +- drivers/ide/legacy/ide-4drives.c | 2 +- drivers/ide/legacy/qd65xx.c | 2 +- drivers/ide/mips/au1xxx-ide.c | 34 +- drivers/ide/pci/aec62xx.c | 8 +- drivers/ide/pci/alim15x3.c | 15 +- drivers/ide/pci/amd74xx.c | 8 +- drivers/ide/pci/atiixp.c | 6 +- drivers/ide/pci/cmd640.c | 18 +- drivers/ide/pci/cmd64x.c | 10 +- drivers/ide/pci/cs5520.c | 4 +- drivers/ide/pci/cs5530.c | 6 +- drivers/ide/pci/cs5535.c | 8 +- drivers/ide/pci/cy82c693.c | 124 +---- drivers/ide/pci/delkin_cb.c | 6 +- drivers/ide/pci/generic.c | 6 +- drivers/ide/pci/hpt34x.c | 6 +- drivers/ide/pci/hpt366.c | 15 +- drivers/ide/pci/it8213.c | 6 +- drivers/ide/pci/it821x.c | 46 +- drivers/ide/pci/jmicron.c | 6 +- drivers/ide/pci/ns87415.c | 21 +- drivers/ide/pci/opti621.c | 8 +- drivers/ide/pci/pdc202xx_new.c | 6 +- drivers/ide/pci/pdc202xx_old.c | 14 +- drivers/ide/pci/piix.c | 46 +- drivers/ide/pci/rz1000.c | 6 +- drivers/ide/pci/sc1200.c | 12 +- drivers/ide/pci/scc_pata.c | 29 +- drivers/ide/pci/serverworks.c | 8 +- drivers/ide/pci/sgiioc4.c | 59 +-- drivers/ide/pci/siimage.c | 17 +- drivers/ide/pci/sis5513.c | 6 +- drivers/ide/pci/sl82c105.c | 8 +- drivers/ide/pci/slc90e66.c | 6 +- drivers/ide/pci/tc86c001.c | 8 +- drivers/ide/pci/triflex.c | 15 +- drivers/ide/pci/trm290.c | 10 +- drivers/ide/pci/via82cxxx.c | 6 +- drivers/ide/ppc/pmac.c | 71 +-- drivers/scsi/ide-scsi.c | 102 ++--- include/linux/ide.h | 653 +++++++++++++---------- 75 files changed, 2656 insertions(+), 2574 deletions(-) create mode 100644 Documentation/laptops/disk-shock-protection.txt create mode 100644 drivers/ide/ide-disk.h create mode 100644 drivers/ide/ide-disk_ioctl.c create mode 100644 drivers/ide/ide-disk_proc.c create mode 100644 drivers/ide/ide-dma-sff.c create mode 100644 drivers/ide/ide-floppy_proc.c create mode 100644 drivers/ide/ide-park.c
Adrian Bunk (1):
xtensa: remove dead CONFIG_BLK_DEV_IDE code
Alexander Beregalov (1):
ide-cd: fix printk format warning
Bartlomiej Zolnierkiewicz (48):
ide: drop dsc_handle argument from ide_pc_intr()
ide: add pointer to the current packet command to ide_drive_t
ide: drop 'timeout' and 'expiry' arguments from ide_pc_intr()
ide: add request_sense_{pc,rq} to ide_drive_t
ide: add ide_retry_pc() helper
ide: add ->pc_{update,io}_buffers methods
ide: make ide_pc_intr() static
ide: make ide_transfer_pc() static
ide: remove CONFIG_BLK_DEV_IDE config option (take 2)
ide: remove unnecessary MAX_HWIFS checks from ide-probe.c
ide: fix IDE ACPI for slave device-only configurations
ide-disk: set_addressing() fixes
ide-disk: add ide_do_setfeature() helper
ide: add device flags
ide: DMA_PIO_RETRY -> IDE_DFLAG_DMA_PIO_RETRY
ide: remove superfluous ->media field from ide_driver_t
ide: remove superfluous ->dma field from ide_hwif_t
ide: remove superfluous ->waiting_for_dma checks
ide: fix HDIO_DRIVE_TASK[FILE] ioctls for CHS commands on LBA devices
ide: sanitize ide*_pm_* enums
cy82c693: remove dead CY82C693_SETDMA_CLOCK code
cy82c693: remove no longer needed CY82C693_DEBUG_LOGS code
ide: use 'drive->dn & 1' instead of drive->select.b.unit
ide: remove [ata_]select_t
ide: convert 'pio_mode' device setting to use DS_SYNC flag
ide: factor out reset error reporting from reset_pollfunc()
ide: merge all TASKFILE_NO_DATA data phase handlers into taskfile_no_intr()
ide: use unique names for struct pci_driver instances
ide: ->ide_dma_clear_irq() -> ->clear_irq()
ide-generic: no need to probe all ports at once
ide-generic: remove no longer needed ide_probe_legacy()
ide: remove ide_host_alloc_all()
ide: set IDE_AFLAG_DRQ_INTERRUPT in do_identify()
ide-cd: no need to zero drive->special.all
ide-floppy: move all ioctl handling to ide-floppy_ioctl.c (take 2)
ide-floppy: move /proc handling to ide-floppy_proc.c (take 2)
ide-disk: move all ioctl handling to ide-disk_ioctl.c
ide-disk: move /proc handling to ide-disk_proc.c (take 3)
pmac: remove superfluous pmif == NULL checks
pmac: remove needless pmac_ide_destroy_dmatable() wrapper
ide: __ide_dma_end() -> ide_dma_end()
ide: make ide_dma_lost_irq() available also for CONFIG_BLK_DEV_IDEDMA_SFF=n
ide: make ide_dma_timeout() available also for CONFIG_BLK_DEV_IDEDMA_SFF=n
ide: switch to DMA-mapping API part #2
ide: remove needless includes from ide-dma.c
ide: cleanup ide_build_dmatable()
ide: cleanup ide-dma.c
ide: move SFF DMA code to ide-dma-sff.c
Borislav Petkov (10):
ide: unify conversion macros
ide: add drive->debug_mask switch
ide: add a driver-wide debugging macro
ide-floppy: convert driver to the new debugging macro
ide-floppy: add a debug_mask module parameter
ide-cd: convert driver to new ide debugging macro (v3)
ide-cd: add a debug_mask module parameter
ide: add ide_drive_t.dma flag
ide-cd: move cdrom_info.dma to ide_drive_t.dma
ide-atapi: assign taskfile flags per device type
Elias Oltmanns (3):
ide: Two fixes regarding memory allocation
ide: Implement disk shock protection support (v4)
ata: Add documentation for hard disk shock protection interface (v3)
Herton Ronaldo Krzesinski (1):
piix: add Hercules EC-900 mini-notebook to ich_laptop short cable list
Sergei Shtylylov (2):
sgiioc4: sgiioc4_read_status drive busy check fix
sgiioc4: fix messages
Documentation/laptops/disk-shock-protection.txt new file +149 -0
@@ -0,0 +1,149 @@ +Hard disk shock protection +========================== + +Author: Elias Oltmanns <[email protected]> +Last modified: 2008-10-03 + + +0. Contents +----------- + +1. Intro +2. The interface +3. References +4. CREDITS + + +1. Intro +-------- + +ATA/ATAPI-7 specifies the IDLE IMMEDIATE command with unload feature. +Issuing this command should cause the drive to switch to idle mode and +unload disk heads. This feature is being used in modern laptops in +conjunction with accelerometers and appropriate software to implement +a shock protection facility. The idea is to stop all I/O operations on +the internal hard drive and park its heads on the ramp when critical +situations are anticipated. The desire to have such a feature +available on GNU/Linux systems has been the original motivation to +implement a generic disk head parking interface in the Linux kernel. +Please note, however, that other components have to be set up on your +system in order to get disk shock protection working (see +section 3. References below for pointers to more information about +that). + + +2. The interface +---------------- + +For each ATA device, the kernel exports the file +block/*/device/unload_heads in sysfs (here assumed to be mounted under +/sys). Access to /sys/block/*/device/unload_heads is denied with +-EOPNOTSUPP if the device does not support the unload feature. +Otherwise, writing an integer value to this file will take the heads +of the respective drive off the platter and block all I/O operations +for the specified number of milliseconds. When the timeout expires and +no further disk head park request has been issued in the meantime, +normal operation will be resumed. The maximal value accepted for a +timeout is 30000 milliseconds. Exceeding this limit will return +-EOVERFLOW, but heads will be parked anyway and the timeout will be +set to 30 seconds. However, you can always change a timeout to any +value between 0 and 30000 by issuing a subsequent head park request +before the timeout of the previous one has expired. In particular, the +total timeout can exceed 30 seconds and, more importantly, you can +cancel a previously set timeout and resume normal operation +immediately by specifying a timeout of 0. Values below -2 are rejected +with -EINVAL (see below for the special meaning of -1 and -2). If the +timeout specified for a recent head park request has not yet expired, +reading from /sys/block/*/device/unload_heads will report the number +of milliseconds remaining until normal operation will be resumed; +otherwise, reading the unload_heads attribute will return 0. + +For example, do the following in order to park the heads of drive +/dev/sda and stop all I/O operations for five seconds: + +# echo 5000 > /sys/block/sda/device/unload_heads + +A simple + +# cat /sys/block/sda/device/unload_heads + +will show you how many milliseconds are left before normal operation +will be resumed. + +A word of caution: The fact that the interface operates on a basis of +milliseconds may raise expectations that cannot be satisfied in +reality. In fact, the ATA specs clearly state that the time for an +unload operation to complete is vendor specific. The hint in ATA-7 +that this will typically be within 500 milliseconds apparently has +been dropped in ATA-8. + +There is a technical detail of this implementation that may cause some +confusion and should be discussed here. When a head park request has +been issued to a device successfully, all I/O operations on the +controller port this device is attached to will be deferred. That is +to say, any other device that may be connected to the same port will +be affected too. The only exception is that a subsequent head unload +request to that other device will be executed immediately. Further +operations on that port will be deferred until the timeout specified +for either device on the port has expired. As far as PATA (old style +IDE) configurations are concerned, there can only be two devices +attached to any single port. In SATA world we have port multipliers +which means that a user-issued head parking request to one device may +actually result in stopping I/O to a whole bunch of devices. However, +since this feature is supposed to be used on laptops and does not seem +to be very useful in any other environment, there will be mostly one +device per port. Even if the CD/DVD writer happens to be connected to +the same port as the hard drive, it generally *should* recover just +fine from the occasional buffer under-run incurred by a head park +request to the HD. Actually, when you are using an ide driver rather +than its libata counterpart (i.e. your disk is called /dev/hda +instead of /dev/sda), then parking the heads of one drive (drive X) +will generally not affect the mode of operation of another drive +(drive Y) on the same port as described above. It is only when a port +reset is required to recover from an exception on drive Y that further +I/O operations on that drive (and the reset itself) will be delayed +until drive X is no longer in the parked state. + +Finally, there are some hard drives that only comply with an earlier +version of the ATA standard than ATA-7, but do support the unload +feature nonetheless. Unfortunately, there is no safe way Linux can +detect these devices, so you won't be able to write to the +unload_heads attribute. If you know that your device really does +support the unload feature (for instance, because the vendor of your +laptop or the hard drive itself told you so), then you can tell the +kernel to enable the usage of this feature for that drive by writing +the special value -1 to the unload_heads attribute: + +# echo -1 > /sys/block/sda/device/unload_heads + +will enable the feature for /dev/sda, and giving -2 instead of -1 will +disable it again. + + +3. References +------------- + +There are several laptops from different vendors featuring shock +protection capabilities. As manufacturers have refused to support open +source development of the required software components so far, Linux +support for shock protection varies considerably between different +hardware implementations. Ideally, this section should contain a list +of pointers at different projects aiming at an implementation of shock +protection on different systems. Unfortunately, I only know of a +single project which, although still considered experimental, is fit +for use. Please feel free to add projects that have been the victims +of my ignorance. + +- http://www.thinkwiki.org/wiki/HDAPS + See this page for information about Linux support of the hard disk + active protection system as implemented in IBM/Lenovo Thinkpads. + + +4. CREDITS +---------- + +This implementation of disk head parking has been inspired by a patch +originally published by Jon Escombe <[email protected]>. My efforts +to develop an implementation of this feature that is fit to be merged +into mainline have been aided by various kernel developers, in +particular by Tejun Heo and Bartlomiej Zolnierkiewicz.
arch/mips/include/asm/mach-generic/ide.h +0 -29
@@ -19,35 +19,6 @@#include <linux/stddef.h> #include <asm/processor.h> -static __inline__int ide_probe_legacy (void ) -{ -#ifdef CONFIG_PCI -struct pci_dev *dev; -/* -* This can be called on the ide_setup() path, super-early in -* boot. But the down_read() will enable local interrupts, -* which can cause some machines to crash. So here we detect -* and flag that situation and bail out early. -*/ -if (no_pci_devices ()) -return 0 ; - dev =pci_get_class (PCI_CLASS_BRIDGE_EISA <<8 ,NULL ); -if (dev) - goto found; - dev =pci_get_class (PCI_CLASS_BRIDGE_ISA <<8 ,NULL ); -if (dev) - goto found; -return 0 ; -found: -pci_dev_put (dev); -return 1 ; -#elif defined(CONFIG_EISA ) || defined(CONFIG_ISA ) -return 1 ; -#else -return 0 ; -#endif -} -/* MIPS port and memory-mapped I/O string operations. */ static inline void __ide_flush_prologue (void ) {
arch/xtensa/kernel/setup.c +0 -5
@@ -53,11 +53,6 @@ extern struct fd_ops no_fd_ops;struct fd_ops *fd_ops;#endif -#if defined(CONFIG_BLK_DEV_IDE ) || defined(CONFIG_BLK_DEV_IDE_MODULE ) -extern struct ide_ops no_ide_ops; -struct ide_ops *ide_ops; -#endif -extern struct rtc_ops no_rtc_ops;struct rtc_ops *rtc_ops;
drivers/ide/Kconfig +2 -36
@@ -54,38 +54,6 @@ menuconfig IDE if IDE -config BLK_DEV_IDE - tristate "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support" - ---help--- - If you say Y here, you will use the full-featured IDE driver to - control up to ten ATA/IDE interfaces, each being able to serve a - "master" and a "slave" device, for a total of up to twenty ATA/IDE - disk/cdrom/tape/floppy drives. - - Useful information about large (>540 MB) IDE disks, multiple - interfaces, what to do if ATA/IDE devices are not automatically - detected, sound card ATA/IDE ports, module support, and other - topics, is contained in <file:Documentation/ide/ide.txt>. For detailed - information about hard drives, consult the Disk-HOWTO and the - Multi-Disk-HOWTO, available from - <http://www.tldp.org/docs.html#howto>. - - To fine-tune ATA/IDE drive/interface parameters for improved - performance, look for the hdparm package at - <ftp://ibiblio.org/pub/Linux/system/hardware/>. - - To compile this driver as a module, choose M here and read - <file:Documentation/ide/ide.txt>. The module will be called ide-mod. - Do not compile this driver as a module if your root file system (the - one containing the directory /) is located on an IDE device. - - If you have one or more IDE drives, say Y or M here. If your system - has no IDE drives, or if memory requirements are really tight, you - could say N here, and select the "Old hard disk driver" below - instead to save about 13 KB of memory in the kernel. - -if BLK_DEV_IDE - comment "Please see Documentation/ide/ide.txt for help/info on IDE drives" config IDE_TIMINGS
@@ -348,7 +316,7 @@ config BLK_DEV_IDEPCI config IDEPCI_PCIBUS_ORDER bool "Probe IDE PCI devices in the PCI bus order (DEPRECATED)" - depends on BLK_DEV_IDE=y && BLK_DEV_IDEPCI + depends on IDE=y && BLK_DEV_IDEPCI default y help Probe IDE PCI devices in the order in which they appear on the
@@ -729,7 +697,7 @@ endif config BLK_DEV_IDE_PMAC tristate "PowerMac on-board IDE support" - depends on PPC_PMAC && IDE=y && BLK_DEV_IDE=y + depends on PPC_PMAC && IDE=y select IDE_TIMINGS help This driver provides support for the on-board IDE controller on
@@ -963,6 +931,4 @@ config BLK_DEV_IDEDMA def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \ BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA -endif - endif # IDE
drivers/ide/Makefile +13 -6
@@ -5,24 +5,25 @@ EXTRA_CFLAGS += -Idrivers/ide ide-core-y += ide.o ide-ioctls.o ide-io.o ide-iops.o ide-lib.o ide-probe.o \ - ide-taskfile.o ide-pio-blacklist.o + ide-taskfile.o ide-park.o ide-pio-blacklist.o # core IDE code ide-core-$(CONFIG_IDE_TIMINGS) += ide-timings.o ide-core-$(CONFIG_IDE_ATAPI) += ide-atapi.o ide-core-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o ide-core-$(CONFIG_BLK_DEV_IDEDMA) += ide-dma.o +ide-core-$(CONFIG_BLK_DEV_IDEDMA_SFF) += ide-dma-sff.o ide-core-$(CONFIG_IDE_PROC_FS) += ide-proc.o ide-core-$(CONFIG_BLK_DEV_IDEACPI) += ide-acpi.o -obj-$(CONFIG_BLK_DEV_IDE) += ide-core.o +obj-$(CONFIG_IDE) += ide-core.o ifeq ($(CONFIG_IDE_ARM), y) ide-arm-core-y += arm/ide_arm.o obj-y += ide-arm-core.o endif -obj-$(CONFIG_BLK_DEV_IDE) += legacy/ pci/ +obj-$(CONFIG_IDE) += legacy/ pci/ obj-$(CONFIG_IDEPCI_PCIBUS_ORDER) += ide-scan-pci.o
@@ -31,15 +32,21 @@ ifeq ($(CONFIG_BLK_DEV_CMD640), y) obj-y += cmd640-core.o endif -obj-$(CONFIG_BLK_DEV_IDE) += ppc/ +obj-$(CONFIG_IDE) += ppc/ obj-$(CONFIG_IDE_H8300) += h8300/ obj-$(CONFIG_IDE_GENERIC) += ide-generic.o obj-$(CONFIG_BLK_DEV_IDEPNP) += ide-pnp.o +ide-disk_mod-y += ide-disk.o ide-disk_ioctl.o ide-cd_mod-y += ide-cd.o ide-cd_ioctl.o ide-cd_verbose.o ide-floppy_mod-y += ide-floppy.o ide-floppy_ioctl.o -obj-$(CONFIG_BLK_DEV_IDEDISK) += ide-disk.o +ifeq ($(CONFIG_IDE_PROC_FS), y) + ide-disk_mod-y += ide-disk_proc.o + ide-floppy_mod-y += ide-floppy_proc.o +endif + +obj-$(CONFIG_BLK_DEV_IDEDISK) += ide-disk_mod.o obj-$(CONFIG_BLK_DEV_IDECD) += ide-cd_mod.o obj-$(CONFIG_BLK_DEV_IDEFLOPPY) += ide-floppy_mod.o obj-$(CONFIG_BLK_DEV_IDETAPE) += ide-tape.o
@@ -54,4 +61,4 @@ ifeq ($(CONFIG_BLK_DEV_PLATFORM), y) obj-y += ide-platform-core.o endif -obj-$(CONFIG_BLK_DEV_IDE) += arm/ mips/ +obj-$(CONFIG_IDE) += arm/ mips/
drivers/ide/arm/icside.c +2 -21
@@ -372,25 +372,6 @@ static int icside_dma_test_irq(ide_drive_t *drive) ICS_ARCIN_V6_INTRSTAT_1)) & 1; } -static void icside_dma_timeout (ide_drive_t *drive) -{ -ide_hwif_t *hwif = drive->hwif; - -printk (KERN_ERR "%s: DMA timeout occurred: " , drive->name); - -if (icside_dma_test_irq (drive)) -return ; - -ide_dump_status (drive,"DMA timeout" , hwif->tp_ops->read_status (hwif)); - -icside_dma_end (drive); -} - -static void icside_dma_lost_irq (ide_drive_t *drive) -{ -printk (KERN_ERR "%s: IRQ lost\n" , drive->name); -} -static int icside_dma_init (ide_hwif_t *hwif,const struct ide_port_info *d) { hwif->dmatable_cpu =NULL ;
@@ -406,8 +387,8 @@ static const struct ide_dma_ops icside_v6_dma_ops = { .dma_start = icside_dma_start, .dma_end = icside_dma_end, .dma_test_irq = icside_dma_test_irq, - .dma_timeout = icside_dma_timeout, - .dma_lost_irq = icside_dma_lost_irq, + .dma_timeout = ide_dma_timeout, + .dma_lost_irq = ide_dma_lost_irq, };#else #define icside_v6_dma_ops NULL
drivers/ide/h8300/ide-h8300.c +1 -1
@@ -80,7 +80,7 @@ static void h8300_tf_load(ide_drive_t *drive, ide_task_t *task)outb (tf->lbah, io_ports->lbah_addr);if (task->tf_flags &IDE_TFLAG_OUT_DEVICE ) -outb ((tf->device &HIHI ) | drive->select.all, +outb ((tf->device &HIHI ) | drive->select, io_ports->device_addr); }
drivers/ide/ide-acpi.c +7 -5
@@ -290,7 +290,7 @@ static int do_drive_get_GTF(ide_drive_t *drive,DEBPRINT ("ENTER: %s at %s, port#: %d, hard_port#: %d\n" , hwif->name, dev->bus_id, port, hwif->channel); -if (!drive->present) { +if ((drive->dev_flags &IDE_DFLAG_PRESENT ) ==0 ) {DEBPRINT ("%s drive %d:%d not present\n" , hwif->name, hwif->channel, port); goto out;
@@ -420,8 +420,9 @@ static int do_drive_set_taskfiles(ide_drive_t *drive,DEBPRINT ("ENTER: %s, hard_port#: %d\n" , drive->name, drive->dn); -if (!drive->present) +if ((drive->dev_flags &IDE_DFLAG_PRESENT ) ==0 ) goto out; +if (!gtf_count)/* shouldn't be here */ goto out;
@@ -660,7 +661,8 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on)if (!drive->acpidata->obj_handle) drive->acpidata->obj_handle =ide_acpi_drive_get_handle (drive); -if (drive->acpidata->obj_handle && drive->present) { +if (drive->acpidata->obj_handle && + (drive->dev_flags &IDE_DFLAG_PRESENT )) {acpi_bus_set_power (drive->acpidata->obj_handle, on?ACPI_STATE_D0 :ACPI_STATE_D3 ); }
@@ -720,7 +722,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif)memset (drive->acpidata,0 ,sizeof (*drive->acpidata)); -if (!drive->present) +if ((drive->dev_flags &IDE_DFLAG_PRESENT ) ==0 )continue ; err =taskfile_lib_get_identify (drive, drive->acpidata->idbuff);
@@ -745,7 +747,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif)for (i =0 ; i <MAX_DRIVES ; i++) { drive = &hwif->drives[i]; -if (drive->present) +if (drive->dev_flags &IDE_DFLAG_PRESENT )/* Execute ACPI startup code */ ide_acpi_exec_tfs (drive); }
drivers/ide/ide-atapi.c +135 -48
316 lines not on this page · raw message
drivers/ide/ide-cd.c +184 -77
772 lines not on this page · raw message
drivers/ide/ide-cd.h +0 -1
@@ -88,7 +88,6 @@ struct cdrom_info {struct request_sense sense_data;struct request request_sense_request; -int dma;unsigned long last_block;unsigned long start_seek;
drivers/ide/ide-disk.c +113 -244
612 lines not on this page · raw message
drivers/ide/ide-disk.h new file +32 -0
@@ -0,0 +1,32 @@ +#ifndef __IDE_DISK_H +#define __IDE_DISK_H + +struct ide_disk_obj { +ide_drive_t *drive; +ide_driver_t *driver; +struct gendisk *disk; +struct kref kref; +unsigned int openers;/* protected by BKL for now */ +}; + +#define ide_disk_g (disk) \ + container_of((disk)->private_data, struct ide_disk_obj, driver) + +/* ide-disk.c */ +sector_t ide_disk_capacity (ide_drive_t *); +ide_decl_devset (address); +ide_decl_devset (multcount); +ide_decl_devset (nowerr); +ide_decl_devset (wcache); +ide_decl_devset (acoustic); + +/* ide-disk_ioctl.c */ +int ide_disk_ioctl (struct inode *,struct file *,unsigned int ,unsigned long ); + +#ifdef CONFIG_IDE_PROC_FS +/* ide-disk_proc.c */ +extern ide_proc_entry_t ide_disk_proc[]; +extern const struct ide_proc_devset ide_disk_settings[]; +#endif + +#endif /* __IDE_DISK_H */
drivers/ide/ide-disk_ioctl.c new file +29 -0
@@ -0,0 +1,29 @@ +#include <linux/kernel.h> +#include <linux/ide.h> +#include <linux/hdreg.h> + +#include "ide-disk.h" + +static const struct ide_ioctl_devset ide_disk_ioctl_settings[] = { +{HDIO_GET_ADDRESS ,HDIO_SET_ADDRESS , &ide_devset_address }, +{HDIO_GET_MULTCOUNT ,HDIO_SET_MULTCOUNT , &ide_devset_multcount }, +{HDIO_GET_NOWERR ,HDIO_SET_NOWERR , &ide_devset_nowerr }, +{HDIO_GET_WCACHE ,HDIO_SET_WCACHE , &ide_devset_wcache }, +{HDIO_GET_ACOUSTIC ,HDIO_SET_ACOUSTIC , &ide_devset_acoustic }, +{0 } +}; + +int ide_disk_ioctl (struct inode *inode,struct file *file, +unsigned int cmd,unsigned long arg) +{ +struct block_device *bdev = inode->i_bdev; +struct ide_disk_obj *idkp =ide_disk_g (bdev->bd_disk); +ide_drive_t *drive = idkp->drive; +int err; + + err =ide_setting_ioctl (drive, bdev, cmd, arg, ide_disk_ioctl_settings); +if (err != -EOPNOTSUPP ) +return err; + +return generic_ide_ioctl (drive, file, bdev, cmd, arg); +}
drivers/ide/ide-disk_proc.c new file +129 -0
129 lines not on this page · raw message
drivers/ide/ide-dma-sff.c new file +356 -0
356 lines not on this page · raw message
drivers/ide/ide-dma.c +45 -436
350 lines not on this page · raw message
drivers/ide/ide-floppy.c +114 -278
392 lines not on this page · raw message
drivers/ide/ide-floppy_ioctl.c +53 -3
56 lines not on this page · raw message
drivers/ide/ide-floppy_proc.c new file +33 -0
Lines of this file are not shown. View the raw message.
drivers/ide/ide-generic.c +12 -39
51 lines not on this page · raw message
drivers/ide/ide-io.c +95 -142
237 lines not on this page · raw message
drivers/ide/ide-iops.c +64 -31
95 lines not on this page · raw message
drivers/ide/ide-park.c new file +121 -0
121 lines not on this page · raw message
drivers/ide/ide-probe.c +111 -104
215 lines not on this page · raw message
drivers/ide/ide-tape.c +49 -106
155 lines not on this page · raw message
drivers/ide/ide-taskfile.c +41 -87
128 lines not on this page · raw message
drivers/ide/ide.c +85 -50
135 lines not on this page · raw message
drivers/ide/pci/cy82c693.c +6 -118
124 lines not on this page · raw message
drivers/ide/pci/it821x.c +21 -25
46 lines not on this page · raw message
drivers/ide/pci/piix.c +27 -19
46 lines not on this page · raw message
drivers/ide/pci/sgiioc4.c +26 -33
59 lines not on this page · raw message
drivers/ide/ppc/pmac.c +14 -57
71 lines not on this page · raw message
drivers/scsi/ide-scsi.c +33 -69
102 lines not on this page · raw message
include/linux/ide.h +361 -292
653 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.