summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-disk.c
Commit message (Collapse)AuthorAgeFilesLines
...
* ide-disk: set_addressing() fixesBartlomiej Zolnierkiewicz2008-10-131-6/+5
| | | | | | | | | | * Return -EIO if arg > 0 and LBA48 is unsupported. * No need to reset ->addressing. * Make ->addressing a single bit flag. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: Remove ide_spin_wait_hwgroup() and use special requests insteadElias Oltmanns2008-10-101-34/+32
| | | | | | | | | | Use a special request for serialisation purposes and get rid of the awkward ide_spin_wait_hwgroup(). This also involves converting the ide_devset structure so it can be shared by the /proc and the ioctl code. Signed-off-by: Elias Oltmanns <eo@nebensachen.de> [bart: use rq->cmd[] directly] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ide_setting_ioctl() helperBartlomiej Zolnierkiewicz2008-10-101-41/+18
| | | | | | | | | | | | | | | | | | | | * Add struct ide_ioctl_devset representing ioctl device setting. * Add ide_setting_ioctl() helper for matching given ioctl and its parameters against table of ioctl device settings. * Convert ide_setting_ioctl() and idedisk_ioctl() to use ide_setting_ioctl(). * Un-export ide_setting_mtx. While at it: * {get,set}_lba_addressing() -> {get,set}_addressing() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: lba_capacity_is_ok() -> ata_id_is_lba_capacity_ok()Bartlomiej Zolnierkiewicz2008-10-101-51/+1
| | | | | | | | Rename lba_capacity_is_ok() to ata_id_is_lba_capacity_ok() and move it to <linux/ata.h> (remove needless parens while at it). Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled()Bartlomiej Zolnierkiewicz2008-10-101-3/+3
| | | | | | | | | | | | * Add ata_id_flush_ext_enabled() inline helper to <linux/ata.h>. * ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled() The latter one also checks if the command is marked as supported in word 83 and validity of words 83 & 86. Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: ide_id_has_flush_cache() -> ata_id_flush_enabled()Bartlomiej Zolnierkiewicz2008-10-101-3/+3
| | | | | | | | | | | | * Add ata_id_flush_enabled() inline helper to <linux/ata.h>. * ide_id_has_flush_cache() -> ata_id_flush_enabled() The latter one also checks if the command is marked as supported in word 83 and validity of words 83 & 86. Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: idedisk_supports_lba48() -> ata_id_lba48_enabled()Bartlomiej Zolnierkiewicz2008-10-101-15/+6
| | | | | | | | | | | * Add ata_id_lba48_enabled() inline helper to <linux/ata.h>. * idedisk_supports_lba48() -> ata_id_lba48_enabled() The latter one also checks validity of words 83 & 86. Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove ->supports_dsc_overlap field from ide_driver_tBartlomiej Zolnierkiewicz2008-10-101-1/+0
| | | | | | | | | | | * Use drive->media and drive->scsi to check if ->dsc_overlap can be set by HDIO_SET_NICE ioctl in generic_ide_ioctl(). * Remove unused ->supports_dsc_overlap field from ide_driver_t. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove SECTOR_WORDS defineBartlomiej Zolnierkiewicz2008-10-101-2/+3
| | | | | | Just use SECTOR_SIZE instead. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: /proc/ide/hd*/settings reworkBartlomiej Zolnierkiewicz2008-10-101-39/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add struct ide_devset, S_* flags, *DEVSET() & ide*_devset_*() macros. * Add 'const struct ide_devset **settings' to ide_driver_t. * Use 'const struct ide_devset **settings' in ide_drive_t instead of 'struct ide_settings_s *settings'. Then convert core code and device drivers to use struct ide_devset and co.: - device settings are no longer allocated dynamically for each device but instead there is an unique struct ide_devset instance per setting - device driver keeps the pointer to the table of pointers to its settings in ide_driver_t.settings - generic settings are kept in ide_generic_setting[] - ide_proc_[un]register_driver(), ide_find_setting_by_name(), ide_{read,write}_setting() and proc_ide_{read,write}_settings() are updated accordingly - ide*_add_settings() are removed * Remove no longer used __ide_add_setting(), ide_add_setting(), __ide_remove_setting() and auto_remove_settings(). * Remove no longer used TYPE_*, SETTING_*, ide_procset_t and ide_settings_t. * ->keep_settings, ->using_dma, ->unmask, ->noflush, ->dsc_overlap, ->nice1, ->addressing, ->wcache and ->nowerr ide_drive_t fields can now be bitfield flags. While at it: * Rename ide_find_setting_by_name() to ide_find_setting(). * Rename write_wcache() to set_wcache(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: preparations for /proc/ide/hd*/settings reworkBartlomiej Zolnierkiewicz2008-10-101-2/+1
| | | | | | | | | | | | | | | | | | | | After rework settings will be no longer created dynamically for each device so we need to make some fixups first. * Use set_[ksettings,unmaskirq]() as a set function for ["keepsettings","unmaskirq"] setting. * Allow writes to ["io_32bit","unmaskirq"] settings also when drive->no_[io_32bit,unmask] is set (this is checked later inside set_[io_32bit,unmaskirq]() anywyay and keeps consistency with the corresponding HDIO_SET_[32BIT,UNMASKINTR] ioctls). * Use max possible multi sectors value (16) as an allowed max for "multcount" setting. set_multcount() set function checks against device's max possbile value anyway and it makes the proc setting consistent with the corresponding HDIO_SET_MULTCOUNT ioctl. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: call ide_proc_register_driver() laterBartlomiej Zolnierkiewicz2008-10-101-2/+2
| | | | | | | | | | Call ide_proc_register_driver() in ide*_setup() (just before ide*_add_settings() call) instead of in ->probe method. Despite being basically a preparation for /proc/ide/hd*/settings rework this is a nice cleanup in itself. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: include <linux/hdreg.h> only when neededBartlomiej Zolnierkiewicz2008-10-101-0/+1
| | | | | | | | | | * Include <linux/ata.h> directly in <linux/ide.h> instead of through <linux/hdreg.h>. * Include <linux/hdreg.h> only when needed. Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove needless drive->present checks from device driversBartlomiej Zolnierkiewicz2008-10-101-2/+1
| | | | | | | Remove needless drive->present checks from ->probe methods (device model takes care of that). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove unused _IDE_C and _IDE_DISK definesBartlomiej Zolnierkiewicz2008-10-101-3/+0
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove no longer needed ide_drive_t fieldsBartlomiej Zolnierkiewicz2008-10-101-1/+1
| | | | | | Remove ->remap_0_to_1 and ->sect0 (they are always zero now). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: WIN_* -> ATA_CMD_*Bartlomiej Zolnierkiewicz2008-10-101-34/+34
| | | | | | | | | | | | | | | | | | | | | * Use ATA_CMD_* defines instead of WIN_* ones. While at it: * EXABYTE_ENABLE_NEXT -> ATA_EXABYTE_ENABLE_NEST * SETFEATURES_{EN,DIS}_WCACHE -> SETFEATURES_WC_{ON,OFF} * SETFEATURES_{EN,DIS}_AAM -> SETFEATURES_AAM_{ON,OFF} * SMART_* -> ATA_SMART_* * Remove stale comment from ide-proc.c. Partially based on earlier work by Chris Wedgwood. Acked-by: Chris Wedgwood <cw@f00f.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: use ata_id_hpa_enabled()Bartlomiej Zolnierkiewicz2008-10-101-13/+2
| | | | | | | | idedisk_supports_hpa() -> ata_id_hpa_enabled(). The latter one also checks validity of words 82 & 85. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: use ata_id_wcache_enabled()Bartlomiej Zolnierkiewicz2008-10-101-1/+1
| | | | | | | Replace open-coded check by ata_id_wcache_enabled() (which also checks validity of word 85). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove drive->driveidBartlomiej Zolnierkiewicz2008-10-101-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Factor out HDIO_[OBSOLETE,GET]_IDENTITY ioctls handling to ide_get_identity_ioctl(). * Use temporary buffer in ide_get_identity_ioctl() instead of accessing drive->id directly. * Add ide_id_to_hd_driveid() inline to convert raw id into struct hd_driveid format (needed on big-endian). * Use ide_id_to_hd_driveid() in ide_get_identity_ioctl(), cleanup ide_fix_driveid() and switch ide to use use raw id. * Remove no longer needed drive->driveid. This leaves us with 3 users of struct hd_driveid in tree: - arch/um/drivers/ubd_kern.c - drivers/block/xsysace.c - drivers/usb/storage/isd200.c While at it: * Use ata_id_u{32,64}() and ata_id_has_{dma,lba,iordy}() macros. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: make drive->id an union (take 2)Bartlomiej Zolnierkiewicz2008-10-101-30/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make drive->id an unnamed union so id can be accessed either by using 'u16 *id' or 'struct hd_driveid *driveid'. Then convert all existing drive->id users accordingly (using 'u16 *id' when possible). This is an intermediate step to make ide 'struct hd_driveid'-free. While at it: - Add missing KERN_CONTs in it821x.c. - Use ATA_ID_WORDS and ATA_ID_*_LEN defines. - Remove unnecessary checks for drive->id. - s/drive_table/table/ in ide_in_drive_list(). - Cleanup ide_config_drive_speed() a bit. - s/drive1/dev1/ & s/drive0/dev0/ in ide_undecoded_slave(). v2: Fix typo in drivers/ide/ppc/pmac.c. (From Stephen Rothwell) There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* block: allow disk to have extended device numberTejun Heo2008-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Now that disk and partition handlings are mostly unified, it's easy to allow disk to have extended device number. This patch makes add_disk() use extended device number if disk->minors is zero. Both sd and ide-disk are updated to use this. * sd_format_disk_name() is implemented which can generically determine the drive name. This removes disk number restriction stemming from limited device names. * If sd index goes over SD_MAX_DISKS (which can be increased now BTW), sd simply doesn't initialize minors letting block layer choose extended device number. * If CONFIG_DEBUG_EXT_DEVT is set, both sd and ide-disk always set minors to 0 and use extended device numbers. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* block: replace @ext_minors with GENHD_FL_EXT_DEVTTejun Heo2008-10-091-9/+5
| | | | | | | | | | | | | | | With previous changes, it's meaningless to limit the number of partitions. Replace @ext_minors with GENHD_FL_EXT_DEVT such that setting the flag allows the disk to have maximum number of allowed partitions (only limited by the number of entries in parsed_partitions as determined by MAX_PART constant). This kills not-too-pretty alloc_disk_ext[_node]() functions and makes @minors parameter to alloc_disk[_node]() unnecessary. The parameter is left alone to avoid disturbing the users. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* block: implement CONFIG_DEBUG_BLOCK_EXT_DEVTTejun Heo2008-10-091-0/+6
| | | | | | | | | | | | | | | | Extended devt introduces non-contiguos device numbers. This patch implements a debug option which forces most devt allocations to be from the extended area and spreads them out. This is enabled by default if DEBUG_KERNEL is set and achieves... 1. Detects code paths in kernel or userland which expect predetermined consecutive device numbers. 2. When something goes wrong, avoid corruption as adding to the minor of earlier partition won't lead to the wrong but valid device. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* sd/ide-disk: apply extended minors to sd and ideTejun Heo2008-10-091-3/+8
| | | | | | | | | | | | | | | | Update sd and ide-disk such that they can take advantage of extended minors. ide-disk already has 64 minors per device and currently doesn't use extended minors although after this patch it can be turned on by simply tweaking constants. sd only had 16 minors per device causing problems on certain peculiar configurations. This patch lifts the restriction and enables it to use upto 64 minors. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* ide-disk: remove stale init_idedisk_capacity() documentationBartlomiej Zolnierkiewicz2008-09-021-14/+0
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix regression caused by ide_device_{get,put}() addition (take 2)Bartlomiej Zolnierkiewicz2008-08-051-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Monday 28 July 2008, Benjamin Herrenschmidt wrote: [...] > Vector: 300 (Data Access) at [c58b7b80] > pc: c014f264: elv_may_queue+0x10/0x44 > lr: c0152750: get_request+0x2c/0x2c0 > sp: c58b7c30 > msr: 1032 > dar: c > dsisr: 40000000 > current = 0xc58aaae0 > pid = 854, comm = media-bay > enter ? for help > mon> t > [c58b7c40] c0152750 get_request+0x2c/0x2c0 > [c58b7c70] c0152a08 get_request_wait+0x24/0xec > [c58b7cc0] c0225674 ide_cd_queue_pc+0x58/0x1a0 > [c58b7d40] c022672c ide_cdrom_packet+0x9c/0xdc > [c58b7d70] c0261810 cdrom_get_disc_info+0x60/0xd0 > [c58b7dc0] c026208c cdrom_mrw_exit+0x1c/0x11c > [c58b7e30] c0260f7c unregister_cdrom+0x84/0xe8 > [c58b7e50] c022395c ide_cd_release+0x80/0x84 > [c58b7e70] c0163650 kref_put+0x54/0x6c > [c58b7e80] c0223884 ide_cd_put+0x40/0x5c > [c58b7ea0] c0211100 generic_ide_remove+0x28/0x3c > [c58b7eb0] c01e9d34 __device_release_driver+0x78/0xb4 > [c58b7ec0] c01e9e44 device_release_driver+0x28/0x44 > [c58b7ee0] c01e8f7c bus_remove_device+0xac/0xd8 > [c58b7f00] c01e7424 device_del+0x104/0x198 > [c58b7f20] c01e74d0 device_unregister+0x18/0x30 > [c58b7f40] c02121c4 __ide_port_unregister_devices+0x6c/0x88 > [c58b7f60] c0212398 ide_port_unregister_devices+0x38/0x80 > [c58b7f80] c0208ca4 media_bay_step+0x1cc/0x5c0 > [c58b7fb0] c0209124 media_bay_task+0x8c/0xcc > [c58b7fd0] c00485c0 kthread+0x48/0x84 > [c58b7ff0] c0011b20 kernel_thread+0x44/0x60 The guilty commit turned out to be 08da591e14cf87247ec09b17c350235157a92fc3 ("ide: add ide_device_{get,put}() helpers"). ide_device_put() is called before kref_put() in ide_cd_put() so IDE device is already gone by the time ide_cd_release() is reached. Fix it by calling ide_device_get() before kref_get() and ide_device_put() after kref_put() in all affected device drivers. v2: Brown paper bag time. In v1 cd->drive was referenced after dropping last reference on cd object (which could result in OOPS in ide_device_put() as reported/debugged by Mariusz Kozlowski). Fix it by caching cd->drive in the local variable (fix other device drivers too). Reported-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reported-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Borislav Petkov <petkovbb@gmail.com> Tested-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Tested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ide_device_{get,put}() helpersBartlomiej Zolnierkiewicz2008-07-241-3/+9
| | | | | | | | | | | | * Add 'struct ide_host *host' field to ide_hwif_t and set it in ide_host_alloc_all(). * Add ide_device_{get,put}() helpers loosely based on SCSI's scsi_device_{get,put}() ones. * Convert IDE device drivers to use ide_device_{get,put}(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove dead Virtual DMA supportBartlomiej Zolnierkiewicz2008-07-231-1/+1
| | | | | | | | | | | | | | | | | Lets remove dead Virtual DMA support for now so it doesn't clutter core IDE code (it can be bring back when there is a need for it): * Remove IDE_HFLAG_VDMA host flag. * Remove ide_drive_t.vdma flag. * cs5520.c: remove stale FIXMEs, cs5520_dma_host_set() and cs5520_dma_ops (also there is no longer a need to set IDE_HFLAG_NO_ATAPI_DMA). There should be no functional changes caused by this patch. Cc: TAKADA Yoshihito <takada@mbf.nifty.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* IDE: Remove unused codeElias Oltmanns2008-07-161-1/+0
| | | | | | | | | | | Remove some code which has been made obsolete and hasn't worked properly before anyway. Part of the infrastructure may be reintroduced in a follow up patch to implement a working command aborting facility. Signed-off-by: Elias Oltmanns <eo@nebensachen.de> Cc: "Alan Cox" <alan@lxorguk.ukuu.org.uk> Cc: "Randy Dunlap" <randy.dunlap@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove IDE_TFLAG_NO_SELECT_MASK taskfile flagBartlomiej Zolnierkiewicz2008-07-151-2/+1
| | | | | | | | | | | | | Always call SELECT_MASK(..., 0) in ide_tf_load() (needs to be done to match ide_set_irq(..., 1)) and then remove IDE_TFLAG_NO_SELECT_MASK taskfile flag. This change should only affect hpt366 and icside host drivers since ->maskproc(..., 0) for sgiioc4 is equivalent to ide_set_irq(..., 1). Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: convert ide_do_drive_cmd path to use blk_execute_rqFUJITA Tomonori2008-07-151-4/+6
| | | | | | | | | | This converts the ide_do_drive_cmd path using ide_wait to use blk_execute_rq. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Borislav Petkov <petkovbb@gmail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: fix issues found by checkpatch.plBartlomiej Zolnierkiewicz2008-04-261-50/+70
| | | | | | | | There are no changes to the resulting drivers/ide/ide-disk.o binary file (md5sum-s after and before the patch match). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: add proc_idedisk_read_smart() helperBartlomiej Zolnierkiewicz2008-04-261-22/+17
| | | | | | | | | | | | * Factor out common code from proc_idedisk_read_smart_{thresholds,values}() to proc_idedisk_read_smart() helper. * Rename proc_idedisk_read_smart_thresholds() to proc_idedisk_read_st() and proc_idedisk_read_smart_values() to proc_idedisk_read_sv(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: add missing printk() KERN_* levelsBartlomiej Zolnierkiewicz2008-02-261-2/+3
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide/libata: ST310211A has buggy HPA tooMikko Rapeli2008-02-191-0/+1
| | | | | | | Signed-off-by: Mikko Rapeli <mikko.rapeli@teleca.com> Tested-by: Bart Champagne <bart@as35701.net> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: fix flush requests (take 2)Bartlomiej Zolnierkiewicz2008-02-111-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 813a0eb233ee67d7166241a8b389b6a76f2247f9 Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Date: Fri Jan 25 22:17:10 2008 +0100 ide: switch idedisk_prepare_flush() to use REQ_TYPE_ATA_TASKFILE requests ... broke flush requests. Allocating IDE command structure on the stack for flush requests is not a very brilliant idea: - idedisk_prepare_flush() only prepares the request and it doesn't wait for it to be completed - there are can be multiple flush requests queued in the queue Fix the problem (per hints from James Bottomley) by: - dynamically allocating ide_task_t instance using kmalloc(..., GFP_ATOMIC) - adding new taskfile flag (IDE_TFLAG_DYN) - calling kfree() in ide_end_drive_command() if IDE_TFLAG_DYN is set (while at it rename 'args' to 'task' and fix whitespace damage) [ This will be fixed properly before 2.6.25 but this bug is rather critical and the proper solution requires some more work + testing. ] Thanks to Sebastian Siewior and Christoph Hellwig for reporting the problem and testing patches (extra thanks to Sebastian for bisecting it to the guilty commmit). Tested-by: Sebastian Siewior <ide-bug@ml.breakpoint.cc> Cc: Christoph Hellwig <hch@infradead.org> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Tejun Heo <htejun@gmail.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: update/add my CopyrightsBartlomiej Zolnierkiewicz2008-02-011-4/+5
| | | | | | The last years stuff and a trip down memory lane... Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: delete filenames/versions from commentsBartlomiej Zolnierkiewicz2008-02-011-2/+0
| | | | | | | | | | | | | | | Delete filenames/versions from comments. I'm leaving decisions about adding DRV_VERSION defines and MODULE_VERSION()-s to maintainers of the respective drivers. While at it: * Remove unused VERSION define from ide.c. * Remove unused/stale DRV_VERSION define from au1xxx-ide.c. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: convert "empty" REQ_TYPE_ATA_CMD requests to use REQ_TYPE_ATA_TASKFILEBartlomiej Zolnierkiewicz2008-01-261-1/+3
| | | | | | | | | Based on the previous work by Tejun Heo. There should be no functionality changes caused by this patch. Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: set IDE_TFLAG_IN_* flags before queuing/executing commandBartlomiej Zolnierkiewicz2008-01-261-12/+12
| | | | | | | | | | | | * Add IDE_TFLAG_{HOB,TF,DEVICE} defines. * Set IDE_TFLAG_IN_* flags in {do_rw,ide_no_data,ide_raw}_taskfile() users. * Remove no longer needed ->tf_flags setup from ide_end_drive_cmd(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove broken disk byte-swapping supportBartlomiej Zolnierkiewicz2008-01-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | Remove broken disk byte-swapping support: - it can cause a data corruption on SMP (or if using PREEMPT on UP) - all data coming from disk are byte-swapped by taskfile_*_data() which results in incorrect identify data being reported by /proc/ide/ and IOCTLs - "hdx=bswap/byteswap" kernel parameter has been broken on m68k host drivers (including Atari/Q40 ones) since 2.5.x days (because of 'hwif' zero-ing) - byte-swapping is limited to PIO transfers (for working with TiVo disks on x86 machines using user-space solutions or dm-byteswap should result in much better performance because DMA can be used) For previous discussions please see: http://www.ussg.iu.edu/hypermail/linux/kernel/0201.0/0768.html http://lkml.org/lkml/2004/2/28/111 [ I have dm-byteswap device mapper target if somebody is interested (patch is for 2.6.4 though but I'll dust it off if needed). ] Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: dump taskfile HOB registers in ide_tf_load() (if DEBUG is defined)Bartlomiej Zolnierkiewicz2008-01-261-6/+1
| | | | | | | | | * Dump taskfile HOB registers in ide_tf_load() (if DEBUG is defined). * Remove no longer needed DEBUG code from __ide_do_rw_disk(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: add idedisk_set_doorlock() helperBartlomiej Zolnierkiewicz2008-01-261-10/+13
| | | | | | | There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: use ide_get_lba_addr()Bartlomiej Zolnierkiewicz2008-01-251-22/+4
| | | | | | | | | | | | | | * Export ide_get_lba_addr(). * Convert idedisk_{read_native,set}_max_address() to use ide_get_lba_addr(). * Remove incorrect comment from idedisk_read_native_max_address() (noticed by Sergei). There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: use do_rw_taskfile() (take 2)Bartlomiej Zolnierkiewicz2008-01-251-19/+10
| | | | | | | | | | | | | | | | | | | | | | | * Add IDE_TFLAG_DMA_PIO_FALLBACK taskfile flag to indicate the need to skip loading taskfile registers in do_rw_taskfile(). * Export do_rw_taskfile(). * Convert __ide_do_rw_disk() to use do_rw_taskfile(). * Unexport ide_tf_load(). * Unexport {pre_task_out,task_in}_intr() and make it static. * Remove incorrect comment about do_rw_taskfile() from <linux/ide.h>. There should be no functionality changes caused by this patch. v2: * Add missing blk_fs_request() check to task_dma_ok() (for VDMA). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: add ide_tf_set_cmd() helperBartlomiej Zolnierkiewicz2008-01-251-30/+55
| | | | | | | | | | | | | | * Add ide_tf_set_cmd() helper for selecting/setting command and data phase (note: DMA data phases are there for completness, they are not required ATM). * Set IDE_TFLAG_WRITE taskfile flag for write requests in __ide_do_rw_disk(). * Convert __ide_do_rw_disk() to use the new ide_tf_set_cmd() helper. There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: extend timeout for PIO-in commandsBartlomiej Zolnierkiewicz2008-01-251-1/+2
| | | | | | | s/WAIT_CMD/WAIT_WORSTCASE/ to make the timeout the same as in do_rw_taskfile() Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: use ->data_phase to set ->handler in do_rw_taskfile()Bartlomiej Zolnierkiewicz2008-01-251-2/+0
| | | | | | | | | | | | * Use ->data_phase to set ->handler in do_rw_taskfile() instead of setting ->handler in callers of ide_raw_taskfile()/do_rw_taskfile(). * Unexport task_no_data_intr() and make it static. There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-disk: guarantee 400ns delay after writing command registerBartlomiej Zolnierkiewicz2008-01-251-0/+1
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
OpenPOWER on IntegriCloud