aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-iops.c
AgeCommit message (Collapse)AuthorFilesLines
2021-06-16ide: remove the legacy ide driverChristoph Hellwig1-536/+0
The legay ide driver has been replace with libata starting in 2003 and has been scheduled for removal for a while. Finally kill it off so that we can start cleaning up various bits of cruft it forced on the block layer. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-01-20ide: remove unnecessary touch_softlockup_watchdogGuoqing Jiang1-1/+0
Call touch_softlockup_watchdog before touch_nmi_watchdog is not needed, since touch_softlockup_watchdog is called inside touch_nmi_watchdog. Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2019-05-21treewide: Add SPDX license identifier for missed filesThomas Gleixner1-0/+1
Add SPDX license identifiers to all files which: - Have no license information of any form - Have EXPORT_.*_SYMBOL_GPL inside which was used in the initial scan/conversion to ignore the file These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-05ide: don't enable/disable interrupts in force threaded-IRQ modeSebastian Andrzej Siewior1-4/+9
The interrupts are enabled/disabled so the interrupt handler can run with enabled interrupts while serving the interrupt and not lose other interrupts especially the timer tick. If the system runs with force-threaded interrupts then there is no need to enable the interrupts. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-12-24Replace <asm/uaccess.h> with <linux/uaccess.h> globallyLinus Torvalds1-1/+1
This was entirely automated, using the script by Al: PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>' sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \ $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h) to do the replacement at the end of the merge window. Requested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-01-19ide: add SATA cable detection supportBartlomiej Zolnierkiewicz1-1/+1
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-15ide: fixup for fujitsu diskWu Zhangjin1-0/+1
This patch will fix the following problem on Yeeloong netbook with fujitsu disk. irq 14: nobody cared (try booting with the "irqpoll" option) Call Trace: [<ffffffff8020d438>] dump_stack+0x8/0x40 [<ffffffff8027ec64>] __report_bad_irq+0x58/0xe4 [<ffffffff8027ee6c>] note_interrupt+0x17c/0x23c [<ffffffff8027f9b8>] handle_level_irq+0xcc/0x134 [<ffffffff802125b0>] mach_irq_dispatch+0xb8/0x1e0 [<ffffffff8020041c>] ret_from_irq+0x0/0x4 [<ffffffff8029e678>] free_hot_cold_page+0x224/0x2a0 [<ffffffff8026f794>] swsusp_free+0xb0/0x14c [<ffffffff8026ec08>] hibernate+0x198/0x218 [<ffffffff8026cfa8>] state_store+0x90/0x138 [<ffffffff8032b5a4>] sysfs_write_file+0x130/0x194 [<ffffffff802c94fc>] vfs_write+0xb8/0x180 [<ffffffff802c96b8>] SyS_write+0x50/0x98 [<ffffffff80203fd8>] handle_sys+0x158/0x174 handlers: [<ffffffff80429670>] (ide_intr+0x0/0x300) Disabling IRQ #14 References: 1. commit 1fde02e7146d4a1bab80fd1506f9018fe71e8521 of git://dev.lemote.com/linux_loongson.git 2. 8bc1e5aa06a2a9a425c4a6795fc564cba1521487 (ide: respect quirk_drives[] list on all controllers) Signed-off-by: Yan Hua <yanh@lemote.com> Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-07ide: fix races in handling of user-space SET XFER commandsBartlomiej Zolnierkiewicz1-10/+0
* Make cmd->tf_flags field 'u16' and add IDE_TFLAG_SET_XFER taskfile flag. * Update ide_finish_cmd() to set xfer / re-read id if the new flag is set. * Convert set_xfer_rate() (write handler for /proc/ide/hd?/current_speed) and ide_cmd_ioctl() (HDIO_DRIVE_CMD ioctl handler) to use the new flag. * Remove no longer needed disable_irq_nosync() + enable_irq() from ide_config_drive_speed(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-07ide: allow ide_dev_read_id() to be called from the IRQ contextBartlomiej Zolnierkiewicz1-3/+3
* Un-static __ide_wait_stat(). * Allow ide_dev_read_id() helper to be called from the IRQ context by adding irq_ctx flag and using mdelay()/__ide_wait_stat() when needed. * Switch ide_driveid_update() to set irq_ctx flag. This change is needed for the consecutive patch which fixes races in handling of user-space SET XFER commands but for improved bisectability and clarity it is better to do it in a separate patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-24ide: add QUANTUM FIREBALLct20 30 with firmware APL.090 to ivb_list[]Bartlomiej Zolnierkiewicz1-0/+1
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-24ide: relax DMA info validity checkingBartlomiej Zolnierkiewicz1-3/+0
There are some broken devices that report multiple DMA xfer modes enabled at once (ATA spec doesn't allow it) but otherwise work fine with DMA so just delete ide_id_dma_bug(). [ As discovered by detective work by Frans and Bart, due to how handling of the ID block was handled before commit c419993 ("ide-iops: only clear DMA words on setting DMA mode") this check was always seeing zeros in the fields or other similar garbage. Therefore this check wasn't actually checking anything. Now that the tests actually check the real bits, all we see are devices that trigger the check yet work perfectly fine, therefore killing this useless check is the best thing to do. -DaveM ] Reported-by: Frans Pop <elendil@planet.nl> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-07ide: add IDE_DFLAG_NIEN_QUIRK device flagBartlomiej Zolnierkiewicz1-4/+2
Add IDE_DFLAG_NIEN_QUIRK device flag and use it instead of drive->quirk_list. There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-06-07ide: respect quirk_drives[] list on all controllersBartlomiej Zolnierkiewicz1-0/+25
* Add ide_check_nien_quirk_list() helper to the core code and then use it in ide_port_tune_devices(). * Remove no longer needed ->quirkproc methods from hpt366.c and pdc202xx_{new,old}.c. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-06-07ide: remove superfluous SELECT_MASK() call from ide_driveid_update()Bartlomiej Zolnierkiewicz1-1/+0
We always call SELECT_MASK(drive, 0) after ide_dev_read_id() call so there is no need to do it again in the error path. Moreover with the combination of HPT36x controller and the drive on the quirk_drives[] list this can result in superfluous enable_irq() call which in turn will trigger WARN() in __enable_irq(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-05-22ide: fix 40-wire cable detection for TSST SH-S202* ATAPI devices (v2)Bartlomiej Zolnierkiewicz1-4/+17
Since 2.6.26 we support UDMA66 on ATAPI devices requiring IVB quirk: commit 8588a2b732928b343233af9b1855705b8286bed4 ("ide: add SH-S202J to ivb_list[]") We also later added support for more such devices in: commit e97564f362a93f8c248246c19828895950341252 ("ide: More TSST drives with broken cable detection") and in: commit 3ced5c49bd2d1f2c7f769e3a54385883de63a652 ("ide: add TSSTcorp CDDVDW SH-S202H to ivb_list[]") It turns out that such devices lack cable detection altogether (which in turn results in incorrect detection of 40-wire cables by our current cable detection strategy) so always handle them by trusting host-side cable detection only. v2: Model detection fixup from Martin. Reported-and-tested-by: Martin Lottermoser <Martin.Lottermoser@t-online.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-04-08ide: refactor tf_read() methodSergei Shtylyov1-6/+3
Simplify tf_read() method, making it deal only with 'struct ide_taskfile' and the validity flags that the upper layer passes, and factoring out the code that deals with the high order bytes into ide_tf_readback() to be called from the only two functions interested, ide_complete_cmd() and ide_dump_sector(). This should stop the needless code duplication in this method and so make it about twice smaller than it was; along with simplifying the setup for the method call, this should save both time and space... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-04-08ide: refactor tf_load() methodSergei Shtylyov1-6/+5
Simplify tf_load() method, making it deal only with 'struct ide_taskfile' and the validity flags that the upper layer passes, and moving the code that deals with the high order bytes into the only function interested, do_rw_taskfile(). This should stop the needless code duplication in this method and so make it about twice smaller than it was; along with simplifying the setup for the method call, this should save both time and space... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-04-08ide: replace IDE_TFLAG_* flags by IDE_VALID_*Sergei Shtylyov1-2/+2
Replace IDE_TFLAG_{IN|OUT}_* flags meaning to the taskfile register validity on input/output by the IDE_VALID_* flags and introduce 4 symmetric 8-bit register validity indicator subfields, 'valid.{input/output}.{tf|hob}', into the 'struct ide_cmd' instead of using the 'tf_flags' field for that purpose (this field can then be turned from 32-bit into 8-bit one). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-31ide: inline SELECT_DRIVE()Sergei Shtylyov1-6/+1
Since SELECT_DRIVE() has boiled down to a mere dev_select() method call, it now makes sense to just inline it... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-31ide: turn selectproc() method into dev_select() method (take 5)Sergei Shtylyov1-11/+1
Turn selectproc() method into dev_select() method by teaching it to write to the device register and moving it from 'struct ide_port_ops' to 'struct ide_tp_ops'. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: benh@kernel.crashing.org Cc: petkovbb@gmail.com [bart: add ->dev_select to at91_ide.c and tx4939.c (__BIG_ENDIAN case)] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-31ide: rename IDE_TFLAG_IN_[HOB_]FEATURESergei Shtylyov1-1/+1
The feature register has never been readable -- when its location is read, one gets the error register value; hence rename IDE_TFLAG_IN_[HOB_]FEATURE into IDE_TFLAG_IN_[HOB_]ERROR and introduce the 'hob_error' field into the 'struct ide_taskfile' (despite the error register not really depending on the HOB bit). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-31ide: turn set_irq() method into write_devctl() methodSergei Shtylyov1-2/+2
Turn set_irq() method with its software reset hack into write_devctl() method (for just writing a value into the device control register) at last... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-31ide: add support for CFA specified transfer modes (take 3)Sergei Shtylyov1-1/+11
Add support for the CompactFlash specific PIO modes 5/6 and MWDMA modes 3/4. Since there were no PIO5 capable hard drives produced and one would also need 66 MHz IDE clock to actually get the difference WRT the address setup timings programmed, I decided to simply replace the old non-standard PIO mode 5 timings with the CFA specified ones. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: stf_xl@wp.pl Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-31ide-iops: only clear DMA words on setting DMA modeSergei Shtylyov1-3/+5
The bytes indicating current DMA mode in the identify data words 62, 63, and 88 should only change on setting a DMA mode, so stop clearing them on setting PIO mode in ide_config_drive_speed(). While at it, correct SW/MW DMA mode masks... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-27ide: remove ide_execute_pkt_cmd() (v2)Bartlomiej Zolnierkiewicz1-17/+8
* Pass command structure to ide_execute_command() and skip __ide_set_handler() for ATAPI protocols on non-DRQ devices. * Convert ide_issue_pc() to always use ide_execute_command() and remove no longer needed ide_execute_pkt_cmd(). v2: * Fix for non-DRQ devices (based on report from Borislav). There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-27ide: add ->dma_timer_expiry method and remove ->dma_exec_cmd one (v2)Bartlomiej Zolnierkiewicz1-5/+1
* Rename dma_timer_expiry() to ide_dma_sff_timer_expiry() and export it. * Add ->dma_timer_expiry method and use it to set hwif->expiry for ATA_PROT_DMA protocol in do_rw_taskfile(). * Initialize ->dma_timer_expiry to ide_dma_sff_timer_expiry() for SFF hosts. * Move setting hwif->expiry from ide_execute_command() to its users and drop 'expiry' argument. * Use ide_execute_command() instead of ->dma_exec_cmd in do_rw_taskfile(). * Remove ->dma_exec_cmd method and its implementations. * Unexport ide_execute_command() and ide_dma_intr(). v2: * Fix CONFIG_BLK_DEV_IDEDMA=n build (noticed by Randy Dunlap). * Fix *dma_expiry naming (suggested by Sergei Shtylyov). There should be no functional changes caused by this patch. Cc: Randy Dunlap <randy.dunlap@oracle.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-27ide: set hwif->expiry prior to calling [__]ide_set_handler()Bartlomiej Zolnierkiewicz1-6/+7
* Set hwif->expiry prior to calling [__]ide_set_handler() and drop 'expiry' argument. * Set hwif->expiry to NULL in ide_{timer_expiry,intr}() and remove 'hwif->expiry = NULL' assignments. There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-27ide: remove ide_task_t typedefBartlomiej Zolnierkiewicz1-15/+15
While at it: - rename struct ide_task_s to struct ide_cmd - remove stale comments from idedisk_{read_native,set}_max_address() - drop unused 'cmd' argument from ide_{cmd,task}_ioctl() - drop unused 'task' argument from tx4939ide_tf_load_fixup() - rename ide_complete_task() to ide_complete_cmd() - use consistent naming for struct ide_cmd variables There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: use try_to_identify() in ide_driveid_update()Bartlomiej Zolnierkiewicz1-50/+4
* Pass pointer to buffer for IDENTIFY data to do_identify() and try_to_identify(). * Un-static try_to_identify() and use it in ide_driveid_update(). * Rename try_to_identify() to ide_dev_read_id(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: clear drive IRQ after re-enabling local IRQs in ide_driveid_update()Bartlomiej Zolnierkiewicz1-2/+2
Clear drive IRQ after re-enabling local IRQs in ide_driveid_update() to match try_to_identify(). Also remove superfluous local_irq_enable() call while at it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: sanitize SELECT_MASK() usage in ide_driveid_update()Bartlomiej Zolnierkiewicz1-1/+3
Call SELECT_MASK() after ide_fix_driveid(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: shorten timeout value in ide_driveid_update()Bartlomiej Zolnierkiewicz1-1/+1
Shorten timeout value in ide_driveid_update() (30s -> 15s) to match try_to_identify(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: propagate AltStatus workarounds to ide_driveid_update()Bartlomiej Zolnierkiewicz1-3/+18
Propagate AltStatus workarounds from try_to_identify() to ide_driveid_update(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: fix kmalloc() failure handling in ide_driveid_update()Bartlomiej Zolnierkiewicz1-13/+20
* Doing kmalloc() in the middle of command execution is not only ugly but leaves drive waiting to send data on kmalloc() failure. Fix it. While at it: * Unify error code paths. * Fixup error message to be more useful and add missing KERN_ERR level. * Rename 'stat' variable to 's'. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: move error handling code to ide-eh.c (v2)Bartlomiej Zolnierkiewicz1-297/+2
Do some CodingStyle fixups in <linux/ide.h> while at it. v2: Add missing <linux/delay.h> include (reported by Stephen Rothwell). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: checkpatch.pl fixes for ide-iops.cBartlomiej Zolnierkiewicz1-25/+23
Fix following checkpatch.pl warnings/errors: - WARNING: space prohibited between function name and open parenthesis '(' - WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable - WARNING: line over 80 characters - ERROR: trailing whitespace - ERROR: space required before the open parenthesis '(' Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: fix comments in ide_config_drive_speed()Bartlomiej Zolnierkiewicz1-6/+3
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: fix printk() levels in [atapi_]reset_pollfunc()Bartlomiej Zolnierkiewicz1-4/+5
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: move standard I/O code to ide-io-std.cBartlomiej Zolnierkiewicz1-313/+0
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: move ide_read_bcount_and_ireason() to ide-atapi.cBartlomiej Zolnierkiewicz1-15/+0
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: move drive_is_ready() to ide-io.cBartlomiej Zolnierkiewicz1-25/+0
Move drive_is_ready() to ide-io.c, then make it static. Also make some minor CodingStyle fixups while at it. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: remove stale comments from drive_is_ready()Bartlomiej Zolnierkiewicz1-9/+0
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-24ide: add ide_for_each_present_dev() iteratorBartlomiej Zolnierkiewicz1-3/+2
* Add ide_for_each_present_dev() iterator and convert IDE code to use it. * Do some drive-by CodingStyle fixups in ide-acpi.c while at it. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-05ide-iops: fix odd-length ATAPI PIO transfersSergei Shtylyov1-0/+2
Commit 9567b349f7e7dd7e2483db99ee8e4a6fe0caca38 (ide: merge ->atapi_*put_bytes and ->ata_*put_data methods) introduced a regression WRT the odd-length ATAPI PIO transfers -- the final word didn't get written (causing command timeouts). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-01-14ide: fix accidental LOCKDEP breakage caused by local_irq_set() removalBartlomiej Zolnierkiewicz1-1/+1
commit 54cc1428cfa619e16d75baae8cb041a2eff015f0 ("ide: remove local_irq_set() macro") accidentally replaced local_save_flags() by local_irq_set() in ide_probe_port() and __ide_wait_stat() which resulted in LOCKDEP breakage. Reported-by: Larry Finger <Larry.Finger@lwfinger.net> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-01-06ide: move read_sff_dma_status() method to 'struct ide_dma_ops'Sergei Shtylyov1-10/+0
Move apparently misplaced read_sff_dma_status() method from 'struct ide_tp_ops' to 'struct ide_dma_ops', renaming it to dma_sff_read_status() and making only required for SFF-8038i compatible IDE controller drivers (greatly cutting down the number of initializers) as its only user (outside ide-dma-sff.c and such drivers) appears to be ide_pci_check_simplex() which is only called for such controllers... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-01-06ide: add port and host iteratorsBartlomiej Zolnierkiewicz1-6/+5
Add ide_port_for_each_dev() / ide_host_for_each_port() iterators and update IDE code to use them. While at it: - s/unit/i/ variable in ide_port_wait_ready(), ide_probe_port(), ide_port_tune_devices(), ide_port_init_devices_data(), do_reset1(), ide_acpi_set_state() and scc_dma_end() - s/d/i/ variable in ide_proc_port_register_devices() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-01-06ide: dynamic allocation of device structuresBartlomiej Zolnierkiewicz1-2/+2
Allocate device structures dynamically instead of having them embedded in ide_hwif_t: * Remove needless zeroing of port structure from ide_init_port_data(). * Add ide_hwif_t.devices[MAX_DRIVES] (table of pointers to the devices). * Add ide_port_{alloc,free}_devices() helpers and use them respectively in ide_{host,free}_alloc(). * Convert all users of ->drives[] to use ->devices[] instead. While at it: * Use drive->dn for the slave device check in scc_pata.c. As a nice side-effect this patch cuts ~1kB (x86-32) from the resulting code size: text data bss dec hex filename 53963 1244 237 55444 d894 drivers/ide/ide-core.o.before 52981 1244 237 54462 d4be drivers/ide/ide-core.o.after Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-01-06ide: unexport ide_wait_not_busy()Bartlomiej Zolnierkiewicz1-3/+0
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-01-06ide: remove local_irq_set() macroBartlomiej Zolnierkiewicz1-1/+2
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-01-06ide: remove HWIF() macroBartlomiej Zolnierkiewicz1-2/+2
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-01-06ide: merge ide_hwgroup_t with ide_hwif_t (v2)Bartlomiej Zolnierkiewicz1-37/+32
* Merge ide_hwgroup_t with ide_hwif_t. * Cleanup init_irq() accordingly, then remove no longer needed ide_remove_port_from_hwgroup() and ide_ports[]. * Remove now unused HWGROUP() macro. While at it: * ide_dump_ata_error() fixups v2: * Fix ->quirk_list check in do_ide_request() (s/hwif->cur_dev/prev_port->cur_dev). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-12-29ide: replace the global ide_lock spinlock by per-hwgroup spinlocks (v2)Bartlomiej Zolnierkiewicz1-25/+23
Now that (almost) all host drivers have been fixed not to abuse ide_lock and core code usage of ide_lock has been sanitized we may safely replace ide_lock by per-hwgroup locks. This patch is partially based on earlier patch from Ravikiran G Thirumalai. While at it: - don't use deprecated HWIF() and HWGROUP() macros - update locking documentation in ide.h v2: Add missing spin_lock_init(&hwgroup->lock). (Noticed by Elias Oltmanns) Cc: Vaibhav V. Nivargi <vaibhav.nivargi@gmail.com> Cc: Alok N. Kataria <alokk@calsoftinc.com> Cc: Shai Fultheim <shai@scalex86.org> Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org> Cc: Elias Oltmanns <eo@nebensachen.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-12-02ide: remove dead code from drive_is_ready()Bartlomiej Zolnierkiewicz1-5/+0
We guarantee 400ns delay at the time of issuing the command. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-12-02ide: add SAMSUNG SP0822N with firmware WA100-10 to ivb_list[]Bartlomiej Zolnierkiewicz1-0/+1
Should fix kernel.org bug #10225: http://bugzilla.kernel.org/show_bug.cgi?id=10225 Reported-by: Matthias B. <haferfrost@web.de> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Acked-by: Sergei Shtyltov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-12-02amd74xx: workaround unreliable AltStatus register for nVidia controllersBartlomiej Zolnierkiewicz1-1/+2
It seems that on some nVidia controllers using AltStatus register can be unreliable so default to Status register if the PCI device is in Compatibility Mode. In order to achieve this: * Add ide_pci_is_in_compatibility_mode() inline helper to <linux/ide.h>. * Add IDE_HFLAG_BROKEN_ALTSTATUS host flag and set it in amd74xx host driver for nVidia controllers in Compatibility Mode. * Teach actual_try_to_identify() and drive_is_ready() about the new flag. This fixes the regression caused by removal of CONFIG_IDEPCI_SHARE_IRQ config option in 2.6.25 and using AltStatus register unconditionally when available (kernel.org bugs #11659 and #10216). [ Moreover for CONFIG_IDEPCI_SHARE_IRQ=y (which is what most people and distributions use) it never worked correctly. ] Thanks to Remy LABENE and Lars Winterfeld for help with debugging the problem. More info at: http://bugzilla.kernel.org/show_bug.cgi?id=11659 http://bugzilla.kernel.org/show_bug.cgi?id=10216 Reported-by: Remy LABENE <remy.labene@free.fr> Tested-by: Remy LABENE <remy.labene@free.fr> Tested-by: Lars Winterfeld <lars.winterfeld@tu-ilmenau.de> Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-11-02ide: Switch to a common addressAlan Cox1-1/+1
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-17ide: mask interrupt in ide_config_drive_speed()Sergei Shtylyov1-1/+1
Apparently, there is no sense in unmasking IRQ on the controller when you call disable_irq_nosync() before doing this, set the nIEN bit afterwards, and then unmask IRQ again after the command completion, hence 0 passed to SELECT_MASK() before issuing the command in ide_config_drive_speed() is probably just a typo. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: Implement disk shock protection support (v4)Elias Oltmanns1-1/+28
On user request (through sysfs), the IDLE IMMEDIATE command with UNLOAD FEATURE as specified in ATA-7 is issued to the device and processing of the request queue is stopped thereafter until the specified timeout expires or user space asks to resume normal operation. This is supposed to prevent the heads of a hard drive from accidentally crashing onto the platter when a heavy shock is anticipated (like a falling laptop expected to hit the floor). Port resets are deferred whenever a device on that port is in the parked state. v3: Elias Oltmanns <eo@nebensachen.de> wrote: [...] > >> 1. Make sure that no negative value is being passed to > >> jiffies_to_msecs() in ide_park_show(). > >> 2. Drop the superfluous variable hwif in ide_special_rq(). > >> 3. Skip initialisation of task and tf in ide_special_rq() if we are not > >> handling a (un)park request. > > > > Well, #3 should have been done differently because we donn't want to > > check for REQ_(UN)?PARK_HEADS more often than is necessary. > > While preparing the backport to 2.6.27, it has just occurred to me that > we need to clear the IDE_DFLAG_PARKED flag in ide_disk_pre_reset() > because this flag must not be set after *any* sort of access to the > device. v4: Fix a memory leak due to a missing blk_put_request() in issue_park_cmd(). Additionally, we should plug the queue when enqueueing the unpark request because there is no guarantee that the park timeout has not expired by then. Even though the chance for that to happen is very slim, the request might end up hanging in the queue until the next I/O operation is queued up. While at it, clean up the code a little: - make issue_park_cmd() a function of type void since nobody cares for the return value anyway; - use blk_start_queueing() instead of __blk_run_queue() since we don't have to worry about recursion; - remove a superfluous pointer deference in task_no_data_intr(). Signed-off-by: Elias Oltmanns <eo@nebensachen.de> Cc: Jeff Garzik <jeff@garzik.org>, Cc: Randy Dunlap <randy.dunlap@oracle.com> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: factor out reset error reporting from reset_pollfunc()Bartlomiej Zolnierkiewicz1-19/+21
Factor out reset error reporting from reset_pollfunc() to ide_reset_report_error() helper. While at it: - fix KERN_* printk() levels - remove 'switch ()' Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: remove [ata_]select_tBartlomiej Zolnierkiewicz1-1/+1
* Use 'drive->dn & 1' in ide_init_disk(). * remove [ata_]select_t. While at it: * Use ATA_DEVICE_OBS define in ide_port_init_devices_data(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-13ide: add device flagsBartlomiej Zolnierkiewicz1-10/+14
Add 'unsigned long dev_flags' to ide_drive_t and convert bitfields to IDE_DFLAG_* flags. While at it: - IDE_DFLAG_ADDRESSING -> IDE_DFLAG_LBA48 - fixup some comments - remove needless g->flags zeroing from ide*_probe() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-10ide: ide_dev_is_sata() -> ata_id_is_sata()Bartlomiej Zolnierkiewicz1-1/+1
* Use optimized ATA version check from Sergei in ata_id_is_sata(). * ide_dev_is_sata() -> ata_id_is_sata() Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-10ide: remove SECTOR_WORDS defineBartlomiej Zolnierkiewicz1-1/+1
Just use SECTOR_SIZE instead. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-10ide: include <linux/hdreg.h> only when neededBartlomiej Zolnierkiewicz1-1/+0
* 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>
2008-10-10ide: enhance ide_busy_sleep()Bartlomiej Zolnierkiewicz1-10/+5
* Make ide_busy_sleep() take timeout value as a parameter and also allow use of AltStatus Register if requested with altstatus parameter. Update existing users accordingly. * Convert ide_driveid_update() and actual_try_to_identify() to use ide_busy_sleep(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-10ide: re-code ide_fixstring() loop to be less evilLinus Torvalds1-3/+5
On Friday 25 July 2008, Linus Torvalds wrote: > > On Fri, 25 Jul 2008, Ben Dooks wrote: > > > > personally, i would much prefer to see the loop being less evil > > like: > > > > for (p = s; p < end; p += 2) > > be16_to_cpus((u16 *)p); > > Well, in this case, the code actually depends on 'p' being back at the > start of the buffer by the end of it all, so it would need some more > changes than that. > > But yes, I applied David's patch, but I _also_ suspect that we would be > better off without code that does horrid things like casts and assignments > inside the function arguments. > > So it would be nice to re-code that loop to be more readable. But due to > the reliance of 'p' being 's' after the loop, the minimal patch would be > something like the appended. > > Bartlomiej - take this or not, I'm not going to commit it - I haven't > tested it, nor do I even have any machines that would trigger it. So this > is more a "maybe something like this" than anything else. From: Linus Torvalds <torvalds@linux-foundation.org> CC: Ben Dooks <ben-linux@fluff.org> Cc: David Miller <davem@davemloft.net> Cc: harvey.harrison@gmail.com Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-10ide: use ATA_* defines instead of *_STAT and *_ERR onesBartlomiej Zolnierkiewicz1-11/+11
* ERR_STAT -> ATA_ERR * INDEX_STAT -> ATA_IDX * ECC_STAT -> ATA_CORR * DRQ_STAT -> ATA_DRQ * SEEK_STAT -> ATA_DSC * WRERR_STAT -> ATA_DF * READY_STAT -> ATA_DRDY * BUSY_STAT -> ATA_BUSY * MARK_ERR -> ATA_AMNF * TRK0_ERR -> ATA_TRK0NF * ABRT_ERR -> ATA_ABORTED * MCR_ERR -> ATA_MCR * ID_ERR -> ATA_IDNF * MC_ERR -> ATA_MC * ECC_ERR -> ATA_UNC * ICRC_ERR -> ATA_ICRC * BBD_ERR -> ATA_BBK Also: * ILI_ERR -> ATAPI_ILI * EOM_ERR -> ATAPI_EOM * LFS_ERR -> ATAPI_LFS * CD -> ATAPI_COD * IO -> ATAPI_IO Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-10ide: WIN_* -> ATA_CMD_*Bartlomiej Zolnierkiewicz1-5/+5
* 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>
2008-10-10ide: remove drive->driveidBartlomiej Zolnierkiewicz1-18/+2
* 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>
2008-10-10ide: make drive->id an union (take 2)Bartlomiej Zolnierkiewicz1-42/+38
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>
2008-10-10ide: cleanup ide_fix_driveid()Bartlomiej Zolnierkiewicz1-87/+20
Do all __le16_to_cpu() swapping in one loop. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-08-05ide: fix ide_fix_driveid()Bartlomiej Zolnierkiewicz1-3/+3
Fix byte-swapping for id->words161_175[], id->words206_254[] and id->words206_254[]. Luckily all words previously left in little-endian byte-order are marked as reserved so this fix shouldn't affect user-space applications. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-24ide: trivial sparse annotationsHarvey Harrison1-4/+2
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: add struct ide_tp_ops (take 2)Bartlomiej Zolnierkiewicz1-54/+68
* Add struct ide_tp_ops for transport methods. * Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info and ide_hwif_t. * Set the default hwif->tp_ops in ide_init_port_data(). * Set host driver specific hwif->tp_ops in ide_init_port(). * Export ide_exec_command(), ide_read_status(), ide_read_altstatus(), ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}() and ata_{in,out}put_data(). * Convert host drivers and core code to use struct ide_tp_ops. * Remove no longer needed default_hwif_transport(). * Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops. While at it: * Use struct ide_port_info in falconide.c and q40ide.c. * Rename ata_{in,out}put_data() to ide_{in,out}put_data(). v2: * Fix missing convertion in ns87415.c. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: remove dead Virtual DMA supportBartlomiej Zolnierkiewicz1-2/+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>
2008-07-23ide: remove ->INB, ->OUTB and ->OUTBSYNC methodsBartlomiej Zolnierkiewicz1-28/+0
* Remove no longer needed ->INB, ->OUTB and ->OUTBSYNC methods. Then: * Remove no longer used default_hwif_[mm]iops() and ide_[mm_]outbsync(). * Cleanup SuperIO handling in ns87415.c. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: add ide_read_bcount_and_ireason() helperBartlomiej Zolnierkiewicz1-0/+15
Add ide_read_bcount_and_ireason() helper and use it instead of ->INB in {cdrom_newpc,ide_pc}_intr(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: use ->tf_read in ide_read_error()Bartlomiej Zolnierkiewicz1-0/+15
* Add IDE_TFLAG_IN_FEATURE taskfile flag for reading Feature register and handle it in ->tf_read. * Convert ide_read_error() to use ->tf_read instead of ->INB, then uninline and export it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: use ->tf_load in SELECT_DRIVE()Bartlomiej Zolnierkiewicz1-1/+5
Convert SELECT_DRIVE() to use ->tf_load instead of ->OUTB. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: use ->tf_load in ide_config_drive_speed()Bartlomiej Zolnierkiewicz1-3/+10
Convert ide_config_drive_speed() to use ->tf_load instead of ->OUTB. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: change order of register access in ide_config_drive_speed()Bartlomiej Zolnierkiewicz1-1/+1
Write ATA Feature register before ATA Sector Count register as a preparation to use ->tf_load in ide_config_drive_speed(). This change shouldn't affect anything (just an usual paranoia). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: add ->set_irq methodBartlomiej Zolnierkiewicz1-10/+27
Add ->set_irq method for setting nIEN bit of ATA Device Control register and use it instead of ide_set_irq(). While at it: * Use ->set_irq in init_irq() and do_reset1(). * Don't use HWIF() macro in ide_check_pm_state(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: add ->read_altstatus methodBartlomiej Zolnierkiewicz1-2/+11
* Remove ide_read_altstatus() inline helper. * Add ->read_altstatus method for reading ATA Alternate Status register and use it instead of ->INB. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: add ->read_status methodBartlomiej Zolnierkiewicz1-11/+22
* Remove ide_read_status() inline helper. * Add ->read_status method for reading ATA Status register and use it instead of ->INB. While at it: * Don't use HWGROUP() macro. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: add ->exec_command methodBartlomiej Zolnierkiewicz1-5/+14
Add ->exec_command method for writing ATA Command register and use it instead of ->OUTBSYNC. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: remove ->dma_{status,command} fields from ide_hwif_tBartlomiej Zolnierkiewicz1-2/+2
* Use ->dma_base + offset instead of ->dma_{status,command} and remove no longer needed ->dma_{status,command}. While at it: * Use ATA_DMA_* defines. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-23ide: add ->read_sff_dma_status methodBartlomiej Zolnierkiewicz1-0/+10
Add ->read_sff_dma_status method for reading DMA Status register and use it instead of ->INB. While at it: * Use inb() directly in ns87415.c::ns87415_dma_end(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-16IDE: Report errors during drive reset back to user spaceElias Oltmanns1-7/+11
Make sure that each error condition during the execution of an HDIO_DRIVE_RESET ioctl is actually reported to the calling process. Also, unify the exit path of reset_pollfunc() when returning ide_stopped since the need of ->port_ops->reset_poll() to be treated specially has vanished (way back, it seems). 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>
2008-07-16IDE: Fix HDIO_DRIVE_RESET handlingElias Oltmanns1-5/+13
Currently, the code path executing an HDIO_DRIVE_RESET ioctl is broken in various ways. Most importantly, it is treated as an out of band request in an illegal way which may very likely lead to system lock ups. Use the drive's request queue to avoid this problem (and fix a locking issue for free along the way). 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>
2008-07-15ide: remove drive->ctlBartlomiej Zolnierkiewicz1-5/+5
Remove drive->ctl (it is always equal to 0x08 after init time). While at it: * Use ATA_DEVCTL_OBS define. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-15ide: pass 'hwif *' instead of 'drive *' to ->OUTBSYNC methodBartlomiej Zolnierkiewicz1-9/+9
There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-15ide: move IRQ unmasking out from ->tf_load methodBartlomiej Zolnierkiewicz1-4/+1
Move IRQ unmasking out from ->tf_load method to its users. There should be no functional changes caused by this patch (SELECT_MASK() is NOP except for hpt366, icside and sgiioc4). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-15ide: remove IDE_TFLAG_NO_SELECT_MASK taskfile flagBartlomiej Zolnierkiewicz1-3/+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>
2008-07-15ide: remove commented out code from ide_config_drive_speed()Bartlomiej Zolnierkiewicz1-3/+0
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-07-15ide: disable drive interrupts in ide_driveid_update()Mikhail Cherkashin1-1/+1
Since ide_driveid_update() uses polling to execute the IDENTIFY DEVICE command but clears nIEN bit in the control register and doesn't mask the IDE interrupt, the latter does happen and lead to the corresponding message to appear: ide0: unexpected interrupt, status=0x58, count=1 when e.g. running hdparm with option -X with a non-PCI IDE driver... Signed-off-by: Mikhail Cherkashin <mcherkashin@ru.mvista.com> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-05-14make ide-iops.c:SELECT_MASK() staticAdrian Bunk1-1/+1
SELECT_MASK() can now become static. [bart: remove space between function name and open parenthesis] Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28ide: add TSSTcorp CDDVDW SH-S202H to ivb_list[]Alexander Smal1-0/+2
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28ide: skip "VLB sync" if host uses MMIOBartlomiej Zolnierkiewicz1-10/+10
* Skip "VLB sync" in ata_{in,out}put_data() if host uses MMIO. * Use I/O ops directly in ata_vlb_sync() an drop no longer needed 'ide_drive_t *drive' argument. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28ide: remove ->INW and ->OUTW methodsBartlomiej Zolnierkiewicz1-24/+0
* Remove no longer used ->INW and ->OUTW methods. While at it: * scc_pata.c: scc_ide_{out,in}w() is called only in scc_tf_{load,read}() so inline it there. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28ide: use IDE I/O helpers directly in ide_tf_{load,read}()Bartlomiej Zolnierkiewicz1-27/+56
There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28ide: add ->tf_load and ->tf_read methodsBartlomiej Zolnierkiewicz1-2/+5
* Add ->tf_load and ->tf_read methods to ide_hwif_t and set the default methods in default_hwif_transport(). * Use ->tf_{load,read} instead o calling ide_tf_{load,read}() directly. * Make ide_tf_{load,read}() static. There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28ide: move ide_tf_{load,read} to ide-iops.cBartlomiej Zolnierkiewicz1-0/+88
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28ide: add ide_execute_pkt_cmd() helperBartlomiej Zolnierkiewicz1-1/+11
Add ide_execute_pkt_cmd() helper for executing PACKET command, then convert ATAPI device drivers to use it. As a nice side-effect this fixes ide-{floppy,tape,scsi} w.r.t. ide_lock taking (ide-cd was OK). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28ide: always use ->OUTBSYNC method for executing commandsBartlomiej Zolnierkiewicz1-1/+1
Always use ->OUTBSYNC method for executing commands so the posting is done if needed (this affects only pmac and scc_pata host drivers at the moment). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28ide: remove ->INS{W,L} and ->OUTS{W,L} methodsBartlomiej Zolnierkiewicz1-66/+48
* Use ins{w,l}()/outs{w,l}() and __ide_mm_ins{w,l}()/__ide_mm_outs{w,l}() directly in ata_{in,out}put_data() (by using IDE_HFLAG_MMIO host flag to decide which I/O ops are required). * Remove no longer needed ->INS{W,L} and ->OUTS{W,L} methods (ide-h8300, au1xxx-ide and scc_pata implement their own ->{in,out}put_data methods). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28ide: merge ->atapi_*put_bytes and ->ata_*put_data methodsBartlomiej Zolnierkiewicz1-43/+25
* Merge ->atapi_{in,out}put_bytes and ->ata_{in,out}put_data methods into new ->{in,out}put_data methods which take number of bytes to transfer as an argument and always do padding. While at it: * Use 'hwif' or 'drive->hwif' instead of 'HWIF(drive)'. There should be no functional changes caused by this patch (all users of ->ata_{in,out}put_data methods were using multiply-of-4 word counts). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-28falconide/q40ide: add ->atapi_*put_bytes and ->ata_*put_data methods (take 2)Bartlomiej Zolnierkiewicz1-19/+7
* Add ->atapi_{in,out}put_bytes and ->ata_{in,out}put_data methods to falconide and q40ide host drivers (->ata_* methods are implemented on top of ->atapi_* methods so they also do byte-swapping now). * Cleanup atapi_{in,out}put_bytes(). v2: * Add 'struct request *rq' argument to ->ata_{in,out}put_data methods and don't byte-swap disk fs requests (we shouldn't un-swap fs requests because fs itself is stored byte-swapped on the disk) - this is how things were done before the patch (ideally device mapper should be used instead but it would break existing setups and would have some performance impact). Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Michael Schmitz <schmitz@debian.org> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Richard Zidlicky <rz@linux-m68k.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-27ide: add struct ide_io_ports (take 3)Bartlomiej Zolnierkiewicz1-38/+34
* Add struct ide_io_ports and use it instead of `unsigned long io_ports[]` in ide_hwif_t. * Rename io_ports[] in hw_regs_t to io_ports_array[]. * Use un-named union for 'unsigned long io_ports_array[]' and 'struct ide_io_ports io_ports' in hw_regs_t. * Remove IDE_*_OFFSET defines. v2: * scc_pata.c build fix from Stephen Rothwell. v3: * Fix ctl_adrr typo in Sparc-specific part of ns87415.c. (Noticed by Andrew Morton) Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide: add struct ide_dma_ops (take 3)Bartlomiej Zolnierkiewicz1-5/+5
Add struct ide_dma_ops and convert core code + drivers to use it. While at it: * Drop "ide_" prefix from ->ide_dma_end and ->ide_dma_test_irq methods. * Drop "ide_" "infixes" from DMA methods. * au1xxx-ide.c: - use auide_dma_{test_irq,end}() directly in auide_dma_timeout() * pdc202xx_old.c: - drop "old_" "infixes" from DMA methods * siimage.c: - add siimage_dma_test_irq() helper - print SATA warning in siimage_init_one() * Remove no longer needed ->init_hwif implementations. v2: * Changes based on review from Sergei: - s/siimage_ide_dma_test_irq/siimage_dma_test_irq/ - s/drive->hwif/hwif/ in idefloppy_pc_intr(). - fix patch description w.r.t. au1xxx-ide changes - fix au1xxx-ide build - fix naming for cmd64*_dma_ops - drop "ide_" and "old_" infixes - s/hpt3xxx_dma_ops/hpt37x_dma_ops/ - s/hpt370x_dma_ops/hpt370_dma_ops/ - use correct DMA ops for HPT302/N, HPT371/N and HPT374 - s/it821x_smart_dma_ops/it821x_pass_through_dma_ops/ v3: * Two bugs slipped in v2 (noticed by Sergei): - use correct DMA ops for HPT374 (for real this time) - handle HPT370/HPT370A properly Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide: add struct ide_port_ops (take 2)Bartlomiej Zolnierkiewicz1-10/+18
* Move hooks for port/host specific methods from ide_hwif_t to 'struct ide_port_ops'. * Add 'const struct ide_port_ops *port_ops' to 'struct ide_port_info' and ide_hwif_t. * Update host drivers and core code accordingly. While at it: * Rename ata66_*() cable detect functions to *_cable_detect() to match the standard naming. (Suggested by Sergei Shtylyov) v2: * Fix build for bast-ide. (Noticed by Andrew Morton) Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18ide: remove IDE_*_REG macrosBartlomiej Zolnierkiewicz1-36/+50
* Add IDE_{ALTSTATUS,IREASON,BCOUNTL,BCOUNTH}_OFFSET defines. * Remove IDE_*_REG macros - this results in more readable and slightly smaller code. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02ide: use ->ata_input_data in ide_driveid_update()Bartlomiej Zolnierkiewicz1-1/+1
Use ->ata_input_data method instead of calling ata_input_data() directly. Currently it matters only for (broken) ide-cris host driver but it may change in the future. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-29Revert "ide: change master/slave IDENTIFY order"Bartlomiej Zolnierkiewicz1-0/+1
This reverts commit b140b99c413ce410197cfcd4014e757cd745226a. [ conflict in drivers/ide/ide-probe.c fixed manually ] It turned out that probing order change causes problems for some drives: http://bugzilla.kernel.org/show_bug.cgi?id=10239 Since root causes are still being investigated and are unlikely to be fixed before 2.6.25 lets revert this change for now. As a result cable detection becomes less reliable when compared with 2.6.24 but the affected drives are useable again. Reported-by: Richard Genoud <richard.genoud@gmail.com> Bisected-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11ide: insert BUG_ON() into __ide_set_handler() (take 2)Sergei Shtylyov1-8/+2
Replace the check for hwgroup->handler and printk(KERN_CRIT, ...) at the start of __ide_set_handler() with mere BUG_ON() while removing such from the caller, ide_execute_command(). Fix up the code formatting, while at it... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06ide: add ide_read_error() inline helperBartlomiej Zolnierkiewicz1-1/+3
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06ide: add ide_read_[alt]status() inline helpersBartlomiej Zolnierkiewicz1-14/+25
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06ide: remove redundant BUG_ON() from [atapi_]reset_pollfunc()Bartlomiej Zolnierkiewicz1-2/+0
Same BUG_ON() is present inside ide_set_handler(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02ide: move check_dma_crc() to ide-dma.cBartlomiej Zolnierkiewicz1-23/+1
* Move check_dma_crc() to ide-dma.c and add inline version for CONFIG_BLK_DEV_IDEDMA=n case. * Rename check_dma_crc() to ide_check_dma_crc(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02ide: remove ide_auto_reduce_xfer()Bartlomiej Zolnierkiewicz1-28/+13
While at it: * Remove needless '!drive->crc_count' check. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02ide: move drive->crc_count check out from check_dma_crc()Bartlomiej Zolnierkiewicz1-12/+12
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02ide: remove ide_ata66_check()Bartlomiej Zolnierkiewicz1-15/+0
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02ide: remove set_transfer()Bartlomiej Zolnierkiewicz1-18/+0
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02ide: unexport SELECT_DRIVE()Bartlomiej Zolnierkiewicz1-2/+0
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02ide: use __ide_set_handler() in ide_execute_command()Bartlomiej Zolnierkiewicz1-13/+8
* Use __ide_set_handler() in ide_execute_command(). While at it: * Fix whitespace damage in ide_execute_command(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide: make probe_hwif() return an error valueBartlomiej Zolnierkiewicz1-1/+1
Make probe_hwif() return an error value. While at it: * Remove comment about MAX_DRIVES == 2 limitation (it is not special to probe_hwif(), it is a general assumption taken by a lot of IDE code). * Rename probe_hwif() to ide_probe_port(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide: delete filenames/versions from commentsBartlomiej Zolnierkiewicz1-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>
2008-01-26ide: switch ide_cmd_ioctl() to use REQ_TYPE_ATA_TASKFILE requestsBartlomiej Zolnierkiewicz1-2/+2
Based on the earlier 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>
2008-01-26ide: add ide_set_irq() inline helperBartlomiej Zolnierkiewicz1-6/+4
There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26ide: merge ->dma_host_{on,off} methods into ->dma_host_set methodBartlomiej Zolnierkiewicz1-4/+4
Merge ->dma_host_{on,off} methods into ->dma_host_set method which takes 'int on' argument. 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>
2008-01-26ide: move drive->using_dma check to callers of ->dma_host_on methodBartlomiej Zolnierkiewicz1-1/+2
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26ide: remove ->ide_dma_on and ->dma_off_quietly methods from ide_hwif_tBartlomiej Zolnierkiewicz1-5/+5
* Make ide_dma_off_quietly() and __ide_dma_on() always available. * Drop "__" prefix from __ide_dma_on(). * Check for presence of ->dma_host_on instead of ->ide_dma_on. * Convert all users of ->ide_dma_on and ->dma_off_quietly methods to use ide_dma_on() and ide_dma_off_quietly() instead. * Remove no longer needed ->ide_dma_on and ->dma_off_quietly methods from ide_hwif_t. * Make ide_dma_on() void. 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>
2008-01-26ide: (hopefully) fix VDMA for CS5520Bartlomiej Zolnierkiewicz1-1/+1
* Set the correct hwif->dma_base for the second channel in ide_get_or_set_dma_base(). * Remove DMA enable code from cs5520_set_pio_mode(), this can be handled by the generic ->dma_host_on method now. * Add VDMA check to ide_config_drive_speed(). * drive->using_dma was never enabled since cs5520 host driver's ->ide_dma_on method overrided the generic ->ide_dma_on (so __ide_dma_on() was never called, drive->using_dma was never set and VDMA was never used since it depends on drive->using_dma). Fix it by using ->dma_host_on method instead of ->ide_dma_on (also add matching ->dma_host_off method). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25ide: add ide_tf_read() helperBartlomiej Zolnierkiewicz1-8/+0
* Factor out code reading taskfile registers from ide_end_drive_cmd() to the new ide_tf_read() helper. * Add IDE_TFLAG_IN_* taskfile flags to indicate the need to load particular IDE taskfile register in ide_tf_read(). * Update ide_end_drive_cmd() to set respective IDE_TFLAG_IN_* taksfile flags. * Add ide_get_lba_addr() for getting LBA sector address from taskfile struct. * Factor out code getting sector address from ide_dump_ata_status() to the new ide_dump_sector() function. * Convert ide_dump_sector() to use ide_tf_read() and ide_get_lba_addr(). * Remove no longer needed ide_read_24(). The only change in functionality caused by this patch is that ide_dump_ata_status() no longer prints "high"/"low" parts of LBA48 sector address (of course LBA48 sector address is still printed). Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25ide: fix registers loading order in ide_dump_ata_status()Bartlomiej Zolnierkiewicz1-2/+2
Fix registers loading order in ide_dump_ata_status()/ide_read_24(). Load registers in this order: * IDE_SECTOR_REG * IDE_LCYL_REG * IDE_HCYL_REG * IDE_SELECT_REG It shouldn't affect anything (just a usual paranoia to separate changes which change the way in which hardware is accessed from code cleanups). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25ide: remove SELECT_INTERRUPT()Bartlomiej Zolnierkiewicz1-8/+0
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25ide: remove QUIRK_LIST()Bartlomiej Zolnierkiewicz1-6/+0
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25ide: remove stale ide.h "configuration options"Bartlomiej Zolnierkiewicz1-7/+2
Remove stale ide.h "configuration options": * INITIAL_MULT_COUNT - always defined to 0 * SUPPORT_SLOW_DATA_PORTS - unused * OK_TO_RESET_CONTROLLER - always defined to 1 * DISABLE_IRQ_NOSYNC - always defined to 0 Leave SUPPORT_VLB_SYNC (defined to 0 for CRIS and FRV, otherwise to 1) for now but disallow overriding it by <asm/ide.h>. 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>
2008-01-25ide: remove CONFIG_IDEPCI_SHARE_IRQ config optionBartlomiej Zolnierkiewicz1-2/+0
We can safely remove CONFIG_IDEPCI_SHARE_IRQ and always support PCI IRQ sharing. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25ide: add struct ide_taskfile (take 2)Bartlomiej Zolnierkiewicz1-6/+6
* Don't set write-only ide_task_t.hobRegister[6] and ide_task_t.hobRegister[7] in idedisk_set_max_address_ext(). * Add struct ide_taskfile and use it in ide_task_t instead of tfRegister[] and hobRegister[]. * Remove no longer needed IDE_CONTROL_OFFSET_HOB define. * Add #ifndef/#endif __KERNEL__ around definitions of {task,hob}_struct_t. While at it: * Use ATA_LBA define for LBA bit (0x40) as suggested by Tejun Heo. v2: * Add missing newlines. (Noticed by Sergei) * Use ~ATA_LBA instead of 0xBF. (Noticed by Sergei) * Use unnamed unions for error/feature and status/command. (Suggested by Sergei). There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25ide: remove task_ioreg_t typedef (take 2)Bartlomiej Zolnierkiewicz1-2/+3
Remove task_ioreg_t typedef from the kernel code (but leave it in <linux/hdreg.h> for #ifndef/#endif __KERNEL__ case). While at it also move sata_ioreg_t typedef under #ifndef/#endif __KERNEL__. v2: Remove name of the second parameter from ide_execute_command() declaration. (Noticed by Sergei). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-10ide: fix cable detection for SATA bridgesGeorge Kibardin1-3/+3
Signed-off-by: George Kibardin <george-kibardin@yandex.ru> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-12-12ide: DMA reporting and validity checking fixes (take 3)Bartlomiej Zolnierkiewicz1-0/+3
* ide_xfer_verbose() fixups: - beautify returned mode names - fix PIO5 reporting - make it return 'const char *' * Change printk() level from KERN_DEBUG to KERN_INFO in ide_find_dma_mode(). * Add ide_id_dma_bug() helper based on ide_dma_verbose() to check for invalid DMA info in identify block. * Use ide_id_dma_bug() in ide_tune_dma() and ide_driveid_update(). As a result DMA won't be tuned or will be disabled after tuning if device reports inconsistent info about enabled DMA mode (ide_dma_verbose() does the same checks while the IDE device is probed by ide-{cd,disk} device driver). * Remove no longer needed ide_dma_verbose(). This patch should fix the following problem with out-of-sync IDE messages reported by Nick Warne: hdd: ATAPI 48X DVD-ROM DVD-R-RAM CD-R/RW drive, 2048kB Cache<7>hdd: skipping word 93 validity check , UDMA(66) and later debugged by Mark Lord to be caused by: ide_dma_verbose() printk( ... "2048kB Cache"); eighty_ninty_three() printk(KERN_DEBUG "%s: skipping word 93 validity check\n"); ide_dma_verbose() printk(", UDMA(66)" Please note that as a result ide-{cd,disk} device drivers won't report the DMA speed used but this is intended since now DMA mode being used is always reported by IDE core code. v2: * fixes suggested by Randy: - use KERN_CONT for printk()-s in ide-{cd,disk}.c - don't remove argument name from ide_xfer_verbose() declaration v3: * Remove incorrect check for (id->field_valid & 1) from ide_id_dma_bug() (spotted by Sergei). * "XFER SLOW" -> "PIO SLOW" in ide_xfer_verbose() (suggested by Sergei). * Fix ide_find_dma_mode() to report the correct mode ('mode' after being limited by 'req_mode'). Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Nick Warne <nick@ukfsn.org> Cc: Mark Lord <lkml@rtr.ca> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-27ide: More TSST drives with broken cable detectionPeter Missel1-0/+3
Add more TSST (Toshiba/Samsung) drives to the 'broken cable detection' blacklist. Signed-off-by: Peter Missel (peter.missel@onlinehome.de) Cc: Alan Cox <alan@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-27ide: remove bogus ide_fix_driveid() commentBartlomiej Zolnierkiewicz1-3/+0
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-27ide: don't set PIO mode on pre-EIDE drivesSergei Shtylyov1-1/+6
Fix handling of the PIO modes for the pre-EIDE drives that did not support the PIO Flow Control Transfer Mode value (00001 nnn) of the Set Transfer Mode feature by skipping the actual mode programming. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-05ide: move ide_fixstring() documentation to ide-iops.c from ide.hBartlomiej Zolnierkiewicz1-0/+7
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-05ide: unexport ide_fix_driveidAdrian Bunk1-3/+0
ide_fix_driveid can now be unexported. Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-26ide: add SH-S202J to ivb_list[]Bartlomiej Zolnierkiewicz1-0/+3
From the report by Nick Warne. Tested-by: Nick Warne <nick@ukfsn.org> Cc: Lennart Sorensen <lsorense@csclub.uwaterloo.ca> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20ide: remove dead code from ide_driveid_update()Bartlomiej Zolnierkiewicz1-23/+3
* Remove dead code from ide_driveid_update(). While at it: * Remove useless comment. * s/HWIF(drive)/drive->hwif/ Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16ide: remove ->ide_dma_check (take 2)Bartlomiej Zolnierkiewicz1-2/+2
* Add IDE_HFLAG_TRUST_BIOS_FOR_DMA host flag for host drivers that depend on BIOS for programming device/controller for DMA. Set it in cy82c693, generic, ns87415, opti621 and trm290 host drivers. * Add IDE_HFLAG_VDMA host flag for host drivers using VDMA. Set it in cs5520 host driver. * Teach ide_tune_dma() about IDE_HFLAG_TRUST_BIOS_FOR_DMA flag. * Add generic ide_dma_check() helper and remove all open coded ->ide_dma_check implementations. Fix all places checking for presence of ->ide_dma_check hook to check for ->ide_dma_on instead. * Remove no longer needed code from config_drive_for_dma(). * Make ide_tune_dma() static. v2: * Fix config_drive_for_dma() return values. * Fix ide-dma.c build for CONFIG_BLK_DEV_IDEDMA_PCI=n by adding dummy config_drive_for_dma() inline. * Fix IDE_HFLAG_TRUST_BIOS_FOR_DMA handling in ide_dma_check(). * Fix init_hwif_it8213() comment. There should be no functionality changes caused by this patch. Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide: remove CONFIG_IDEDMA_IVB config optionBartlomiej Zolnierkiewicz1-4/+0
Devices which don't set word 93 validation bit should be now handled by ide-iops.c::ivb_list[] and for debugging purposes cable detection can be completely overriden with "idex=ata66" parameter. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide: change master/slave IDENTIFY orderBartlomiej Zolnierkiewicz1-1/+0
Need to probe slave device first to make it release PDIAG- (this is required for correct device side cable detection). Based on libata commit f31f0cc2f0b7527072d94d02da332d9bb8d7d94c. Thanks to Craig for testing this patch. Cc: Craig Block <chblock3@yahoo.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide: move ide_config_drive_speed() calls to upper layers (take 2)Bartlomiej Zolnierkiewicz1-3/+0
* Convert {ide_hwif_t,ide_pci_device_t}->host_flag to be u16. * Add IDE_HFLAG_POST_SET_MODE host flag to indicate the need to program the host for the transfer mode after programming the device. Set it in au1xxx-ide, amd74xx, cs5530, cs5535, pdc202xx_new, sc1200, pmac and via82cxxx host drivers. * Add IDE_HFLAG_NO_SET_MODE host flag to indicate the need to completely skip programming of host/device for the transfer mode ("smart" hosts). Set it in it821x host driver and check it in ide_tune_dma(). * Add ide_set_pio_mode()/ide_set_dma_mode() helpers and convert all direct ->set_pio_mode/->speedproc users to use these helpers. * Move ide_config_drive_speed() calls from ->set_pio_mode/->speedproc methods to callers. * Rename ->speedproc method to ->set_dma_mode, make it void and update all implementations accordingly. * Update ide_set_xfer_rate() comments. * Unexport ide_config_drive_speed(). v2: * Fix issues noticed by Sergei: - export ide_set_dma_mode() instead of moving ->set_pio_mode abuse wrt to setting DMA modes from sc1200_set_pio_mode() to do_special() - check IDE_HFLAG_NO_SET_MODE in ide_tune_dma() - check for (hwif->set_pio_mode) == NULL in ide_set_pio_mode() - check for (hwif->set_dma_mode) == NULL in ide_set_dma_mode() - return -1 from ide_set_{pio,dma}_mode() if ->set_{pio,dma}_mode == NULL - don't set ->set_{pio,dma}_mode on it821x in "smart" mode - fix build problem in pmac.c - minor fixes in au1xxx-ide.c/cs5530.c/siimage.c - improve patch description Changes in behavior caused by this patch: - HDIO_SET_PIO_MODE ioctl would now return -ENOSYS for attempts to change PIO mode if it821x controller is in "smart" mode - removal of two debugging printk-s (from cs5530.c and sc1200.c) - transfer modes 0x00-0x07 passed from user space may be programmed twice on the device (not really an issue since 0x00 is not supported correctly by any host driver ATM, 0x01 is not supported at all and 0x02-0x07 are invalid) Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: remove pmac_ide_do_setfeature() (take 2)Bartlomiej Zolnierkiewicz1-1/+1
Use ide_config_drive_speed() instead of pmac_ide_do_setfeature() and remove the latter, also ide-iops.c::__ide_wait_stat() could be static again. Since for IDE PMAC host driver IDE_CONTROL_REG is always true, device's ->quirk_list is always zero and ->ide_dma_host_{on,off} are nops than the only changes in behavior are: * if PIO mode is set then ->dma_off_queitly is called to disable DMA * if setting transfer mode fails ide_dump_status() is called to dump status v2: * IDE PMAC controllers allow separate PIO and DMA timings and PPC userland depends on this fact, and calls "hdparm -p" without calling "hdparm -d". Therefore to compensate for DMA being disabled by ide_config_drive_speed() for PIO modes: - add IDE_HFLAG_SET_PIO_MODE_KEEP_DMA flag and set it in PMAC host driver - add handling of the new flag to ide-io.c::do_special() Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: use __ide_wait_stat()Bartlomiej Zolnierkiewicz1-30/+1
* Use __ide_wait_stat() instead of wait_for_ready() in pmac_ide_do_setfeature(). While at it do following changes to match __ide_wait_stat() call in ide_config_drive_speed(): * Wait WAIT_CMD time (20 sec) instead of 2 sec for device to clear BUSY_STAT. * Check DRQ_STAT bit (shouldn't be set for good device status). Also remove no longer needed wait_for_ready() from ide-iops.c. Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide: add __ide_wait_stat() helperBartlomiej Zolnierkiewicz1-52/+44
* Split off checking of the status register from ide_wait_stat() to __ide_wait_stat() helper. * Use the new helper in ide_config_drive_speed(). The only change in the functionality is that the function now fails if after 20 sec (WAIT_CMD) device is still busy (BUSY_STAT bit is set) while previously instead of failing the function continued with checking for the correct device status (which would give the device additional 10 usec to clear BUSY_STAT bit). * Remove stale comment for ide_config_drive_speed(). * Remove duplicate comment for ide_wait_stat() from <linux/ide.h>. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11ide: add ide_set{_max}_pio() (take 4)Bartlomiej Zolnierkiewicz1-6/+0
* Add IDE_HFLAG_ABUSE_{PREFETCH,FAST_DEVSEL,DMA_MODES} flags and set them in ht6560, cmd640, cmd64x and sc1200 host drivers. * Add set_pio_mode_abuse() for checking if host driver has a non-standard ->tuneproc() implementation and use it in do_special(). * Add ide_set_pio() for setting PIO mode (it uses hwif->pio_mask to find the maximum PIO mode supported by the host), also add ide_set_max_pio() wrapper for ide_set_pio() to use for auto-tuning. Convert users of ->tuneproc to use ide_set{_max}_pio() where possible. This leaves only do_special(), set_using_pio(), ide_hwif_restore() and ide_set_pio() as a direct users of ->tuneproc. * Remove no longer needed ide_get_best_pio_mode() calls and printk-s reporting PIO mode selected from ->tuneproc implementations. * Rename ->tuneproc hook to ->set_pio_mode and make 'pio' argument const. * Remove stale comment from ide_config_drive_speed(). v2: * Fix "ata_" prefix (Noticed by Jeff). v3: * Minor cleanups/fixups per Sergei's suggestions. v4: * Fix compile problem in drivers/ide/pci/cmd640.c (Noticed by Andrew Morton). * Improve some ->set_pio_mode comments. Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11ide: add ide_dev_is_sata() helper (take 2)Sergei Shtylyov1-2/+1
Make the SATA drive detection code from eighty_ninty_three() into inline ide_dev_is_sata() helper fixing it along the way to be more strict while checking word 80 for the reserved values... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20ide-disk: workaround for buggy HPA support on ST340823A (take 3)Bartlomiej Zolnierkiewicz1-0/+2
This disk reports total number of sectors instead of maximum sector address in response to READ_NATIVE_MAX_ADDRESS command and also happily accepts SET_MAX_ADDRESS command with the bogus value. This results in +1 sector capacity being used and errors on attempts to use the last sector. ... hdd: Host Protected Area detected.         current capacity is 78165360 sectors (40020 MB)         native  capacity is 78165361 sectors (40020 MB) hdd: Host Protected Area disabled. ... hdd: reading: block=78165360, sectors=1, buffer=0xc1e63000 hdd: dma_intr: status=0x51 { DriveReady SeekComplete Error } hdd: dma_intr: error=0x10 { SectorIdNotFound }, LBAsect=78165360, sector=78165360 ... Add hpa_list[] table and workaround the issue in idedisk_check_hpa(). v2: * Add missing export and improve patch description a bit. v3: * Add list termination. (From Mikko) Fixes kernel bugzilla bug #8816. Thanks to Mikko for investigating the issue and helping with this patch. Cc: Mikko Rapeli <mikko.rapeli@iki.fi> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20ide: ide_config_drive_speed() bugfixesBartlomiej Zolnierkiewicz1-2/+2
* Use ->OUTBSYNC instead of ->OUTB when writing command register (needed for scc_pata and pmac host drivers). * Don't check DRDY bit of the status register on ATAPI devices (ATAPI devices are free to ignore DRDY bit). Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Kou Ishizaki <kou.ishizaki@toshiba.co.jp> Cc: Akira Iguchi <akira2.iguchi@toshiba.co.jp> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20ide: add cable detection for early UDMA66 devices (take 3)Bartlomiej Zolnierkiewicz1-3/+36
* Move ide_in_drive_list() from ide-dma.c to ide-iops.c. * Add ivb_list[] table for listening early UDMA66 devices which don't conform to ATA4 standard wrt cable detection (bit14 is zero, only bit13 is valid) and use only device side cable detection for them since host side cable detection may be unreliable. * Add model "QUANTUM FIREBALLlct10 05" with firwmare "A03.0900" to the list (from Craig's bugreport). v2: * Improve kernel message basing on suggestion from Sergei. v3: * Don't print kernel message when no device side cable detection is done, plus some minor fixes. (Noticed by Sergei) Thanks to Craig for testing this patch. Cc: Craig Block <chblock3@yahoo.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-09ide: add short cables supportBartlomiej Zolnierkiewicz1-2/+6
This patch allows users to override both host and device side cable detection with "ideX=ata66" kernel parameter. Thanks to this it should be now possible to use UDMA > 2 modes on systems (laptops mainly) which use short 40-pin cable instead of 80-pin one. Next patches add automatic detection of some systems using short cables. Changes: * Rename hwif->udma_four to hwif->cbl and make it u8. * Convert all existing users accordingly (use ATA_CBL_* defines while at it). * Add ATA_CBL_PATA40_SHORT support to ide-iops.c:eighty_ninty_three(). * Use ATA_CBL_PATA40_SHORT for "ideX=ata66" kernel parameter. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
2007-05-10ide: cable detection fixes (take 2)Bartlomiej Zolnierkiewicz1-24/+29
Tejun's recent eighty_ninty_three() fix has inspired me to do more thorough review of the cable detection code... * print user-friendly warning about limiting the maximum transfer speed to UDMA33 (and the reason behind it) when 80-wire cable is not detected, also while at it cleanup eighty_ninty_three() a bit * use eighty_ninty_three() in ide_ata66_check(), this actually fixes 3 bugs: - bit 14 (word 93 validity check) == 1 && bit 13 (80-wire cable test) == 1 were used as 80-wire cable present test for CONFIG_IDEDMA_IVB=n case (please see FIXME comment in eighty_ninty_three() for more details) - CONFIG_IDEDMA_IVB=y/n cases were interchanged - check for SATA devices was missing * remove private cable warnings from pdc_202xx{old,new} drivers now that core code provides this functionality (plus, in pdc202xx_new case the test could give false warnings for ATAPI devices because pdc202xx_new driver doesn't even support ATAPI DMA) Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-05-10ide: rework the code for selecting the best DMA transfer mode (v3)Bartlomiej Zolnierkiewicz1-2/+0
Depends on the "ide: fix UDMA/MWDMA/SWDMA masks" patch. * add ide_hwif_t.udma_filter hook for filtering UDMA mask (use it in alim15x3, hpt366, siimage and serverworks drivers) * add ide_max_dma_mode() for finding best DMA mode for the device (loosely based on some older libata-core.c code) * convert ide_dma_speed() users to use ide_max_dma_mode() * make ide_rate_filter() take "ide_drive_t *drive" as an argument instead of "u8 mode" and teach it to how to use UDMA mask to do filtering * use ide_rate_filter() in hpt366 driver * remove no longer needed ide_dma_speed() and *_ratemask() * unexport eighty_ninty_three() v2: * rename ->filter_udma_mask to ->udma_filter [ Suggested by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ] v3: * updated for scc_pata driver (fixes XFER_UDMA_6 filtering for user-space originated transfer mode change requests when 100MHz clock is used) Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-04-10ide: correctly prevent IDE timer expiry function to run if request was ↵Suleiman Souhlal1-0/+2
already handled It is possible for the timer expiry function to run even though the request has already been handled: ide_timer_expiry() only checks that the handler is not NULL, but it is possible that we have handled a request (thus clearing the handler) and then started a new request (thus starting the timer again, and setting a handler). A simple way to exhibit this is to set the DMA timeout to 1 jiffy and run dd: The kernel will panic after a few minutes because ide_timer_expiry() tries to add a timer when it's already active. To fix this, we simply add a request generation count that gets incremented at every interrupt, and check in ide_timer_expiry() that we have not already handled a new interrupt before running the expiry function. Signed-off-by: Suleiman Souhlal <suleiman@google.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-03-26ide: use correct IDE error recoverySuleiman Souhlal1-0/+3
IDE error recovery is using IDLE IMMEDIATE if the drive is busy or has DRQ set. This violates the ATA spec (can only send IDLE IMMEDIATE when drive is not busy) and really hoses up some drives (modern drives will not be able to recover using this error handling). The correct thing to do is issue a SRST followed by a SET FEATURES command. This is what Western Digital recommends for error recovery and what Western Digital says Windows does.  It also does not violate the ATA spec as far as I can tell. Bart: * port the patch over the current tree * undo the recalibration code removal * send SET FEATURES command after checking for good drive status * don't check whether the current request is of REQ_TYPE_ATA_{CMD,TASK} type because we need to send SET FEATURES before handling any requests * some pre-ATA4 drives require INITIALIZE DEVICE PARAMETERS command before other commands (except IDENTIFY) so send SET FEATURES only if there are no pending drive->special requests * update comments and patch description * any bugs introduced by this patch are mine and not Suleiman's :-) Signed-off-by: Suleiman Souhlal <suleiman@google.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-03-26ide: revert "ide: fix drive side 80c cable check, take 2" for nowBartlomiej Zolnierkiewicz1-2/+6
"ide: fix drive side 80c cable check, take 2" patch from Tejun Heo (commit fab59375b9543f84d1714f7dd00f5d11e531bd3e) fixed 80c bit test (bit13 of word93) but we also need to fix master/slave IDENTIFY order (slave device should be probed first in order to make it release PDIAG- signal) and we should also check for pre-ATA3 slave devices (which may not release PDIAG- signal). [ Unfortunately the fact that IDE driver doesn't reset devices itself helps only a bit as it seems that some BIOS-es reset ATA devices after programming the chipset, some BIOS-es can be set to not probe/configure selected devices, there may be no BIOS in case of add-on cards etc. ] Since we are quite late in the release cycle and the required changes will affect a lot of systems just revert the fix for now. [ Please also see libata commit f31f0cc2f0b7527072d94d02da332d9bb8d7d94c. ] Thanks goes out to Fernando Mitio Yamada for reporting the problem and patiently testing patches. Acked-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-03-03ide: fix drive side 80c cable check, take 2Tejun Heo1-0/+2
eighty_ninty_three() had word 93 validitity check but not the 80c bit test itself (bit 13). This increases the chance of incorrect wire detection especially because host side cable detection is often unreliable and we sometimes soley depend on drive side cable detection. Fix it. [ bart: fix off-by-1 bit name in the patch description ] Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-02-17ide: make ide_hwif_t.ide_dma_host_on void (v2)Bartlomiej Zolnierkiewicz1-1/+1
* since ide_hwif_t.ide_dma_host_on is called either when drive->using_dma == 1 or when return value is discarded make it void, also drop "ide_" prefix * make __ide_dma_host_on() void and drop "__" prefix v2: * while at it rename atiixp_ide_dma_host_on() to atiixp_dma_host_on() and sgiioc4_ide_dma_host_on() to sgiioc4_dma_host_on(). [ Noticed by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-02-17ide: make ide_hwif_t.ide_dma_{host_off,off_quietly} void (v2)Bartlomiej Zolnierkiewicz1-4/+4
* since ide_hwif_t.ide_dma_{host_off,off_quietly} always return '0' make these functions void and while at it drop "ide_" prefix * fix comment for __ide_dma_off_quietly() * make __ide_dma_{host_off,off_quietly,off}() void and drop "__" prefix v2: * while at it rename atiixp_ide_dma_host_off() to atiixp_dma_host_off(), sgiioc4_ide_dma_{host_off,off_quietly}() to sgiioc4_dma_{host_off,off_quietly}() and sl82c105_ide_dma_off_quietly() to sl82c105_dma_off_quietly() [ Noticed by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-02-17ide: use PIO/MMIO operations directly where possible (v2)Bartlomiej Zolnierkiewicz1-24/+0
This results in smaller/faster/simpler code and allows future optimizations. Also remove no longer needed ide[_mm]_{inl,outl}() and ide_hwif_t.{INL,OUTL}. v2: * updated for scc_pata Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2006-10-03[PATCH] ide: Fix crash on repeated resetAlan Cox1-0/+4
Michal Miroslaw reported a problem (bugzilla #7023) where a user initiated reset while the IDE layer was already resetting the channel caused a crash, and provided a rough fix. This is a slightly cleaner version of the fix which tracks the reset state and blocks further reset requests while a reset is in progress. Note this is not a security issue - random end users can't access the ioctl in question anyway. Signed-off-by: Alan Cox <alan@redhat.com> Cc: Michal Miroslaw <mirq-linux@rere.qmqm.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-31[PATCH] IDE: Touch NMI watchdog during resume from STRMichal Schmidt1-0/+2
When resuming from suspend-to-RAM, the NMI watchdog detects a lockup in ide_wait_not_busy. Here's a screenshot of the trace taken by a digital camera: http://www.uamt.feec.vutbr.cz/rizeni/pom/DSC03510-2.JPG Let's touch the NMI watchdog in ide_wait_not_busy. The system then resumes correctly from STR. [akpm@osdl.org: modular build fix] Signed-off-by: Michal Schmidt <xschmi00@stud.feec.vutbr.cz> Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel1-1/+0
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-28[PATCH] Old IDE, fix SATA detection for cablingAlan Cox1-0/+4
This is based on the proposed patches flying around but also checks that the device in question is new enough to have word 93 rather thanb blindly assuming word 93 == 0 means SATA (see ATA-5, ATA-7) Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-23[PATCH] More BUG_ON conversionEric Sesterhenn1-8/+4
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: James Bottomley <James.Bottomley@steeleye.com> Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-03[PATCH] solve false-positive soft lockup messages during IDE initIngo Molnar1-0/+1
Signed-off-by: Ingo Molnar <mingo@elte.hu> Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Rogio Brito <rbrito@ime.usp.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09[PATCH] ide: possible cleanupsAdrian Bunk1-6/+0
This patch contains the following possible cleanups: - pci/cy82c693.c: make a needlessly global function static - remove the following unneeded EXPORT_SYMBOL's: - ide-taskfile.c: do_rw_taskfile - ide-iops.c: default_hwif_iops - ide-iops.c: default_hwif_transport - ide-iops.c: wait_for_ready Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-09-13[PATCH] ide: clean up the garbage in eighty_ninty_threeAlan Cox1-35/+6
Replace the foot long pile of festering garbage in eighty_ninty_three with some actual clean code. All the ifdefs are fixed and havent changed since 2.4 Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-27[PATCH] ide: IDE timing violation on resetAlan Cox1-1/+2
Pretty much theoretical for non MMIO thankfully. We _must_ use OUTBSYNC for commands or they may be posted and thus ruin the 400nS required delay. Signed-off-by: Alan Cox <alan@redhat.com> Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-16Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds1-0/+1285
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!