summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-lib.c
Commit message (Collapse)AuthorAgeFilesLines
* ide: remove ide_dma_enable()Bartlomiej Zolnierkiewicz2007-05-161-12/+0Star
| | | | | | | | * check ->speedproc return value in ide_tune_dma() * use ide_tune_dma() in cmd64x/cs5530/sc1200/siimage/sl82c105/scc_pata drivers * remove no longer needed ide_dma_enable() Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: cable detection fixes (take 2)Bartlomiej Zolnierkiewicz2007-05-101-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ide: rework the code for selecting the best DMA transfer mode (v3)Bartlomiej Zolnierkiewicz2007-05-101-107/+18Star
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ide: ide_get_best_pio_mode() returns incorrect IORDY setting (take 2)Sergei Shtylyov2007-03-031-12/+6Star
| | | | | | | | | | | | | | | The function ide_get_best_pio_mode() fails to return the correct IORDY setting for the explicitly specified modes -- fix this along with the heading comment, and also remove the long commented out code. Also, while at it, correct the misliading comment about the PIO cycle time in <linux/ide.h> -- it actually consists of only the active and recovery periods, with only some chips also including the address setup time into equation... [ bart: sl82c105 seems to be currently the only driver affected by this fix ] Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ide_use_fast_pio() helper (v3)Bartlomiej Zolnierkiewicz2007-02-171-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add ide_use_fast_pio() helper for use by host drivers * add DMA capability and hwif->autodma checks to ide_use_dma() - au1xxx-ide/it8213/it821x drivers didn't check for (id->capability & 1) [ for the IT8211/2 in SMART mode this check shouldn't be made but since in it821x_fixups() we set DMA bit explicitly: if(strstr(id->model, "Integrated Technology Express")) { /* In raid mode the ident block is slightly buggy We need to set the bits so that the IDE layer knows LBA28. LBA48 and DMA ar valid */ id->capability |= 3; /* LBA28, DMA */ we are better off using generic helper if we can ] - ide-cris driver didn't set ->autodma [ before the patch hwif->autodma was only checked in the chipset specific hwif->ide_dma_check implementations, for ide-cris it is cris_dma_check() function so there no behavior change here ] v2: * updated patch description (thanks to Alan Cox for the feedback) v3: * updated for scc_pata driver Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: unexport ide_set_xfer_rate() (v2)Bartlomiej Zolnierkiewicz2007-02-171-2/+0Star
| | | | | | | | | | | | | | | In cmd64x, siimage and scc_pata drivers: * don't set drive->init_speed as it should be already set by successful execution of ide_set_xfer_rate() * use hwif->speedproc functions directly Above changes allows removal of EXPORT_SYMBOL_GPL(ide_set_xfer_rate). v2: * updated for scc_pata driver Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove write-only ide_pio_data_t.blacklistedBartlomiej Zolnierkiewicz2007-02-171-3/+0Star
| | | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* [PATCH] ide_dma_speed() fixesSergei Shtylyov2006-10-031-52/+73
| | | | | | | | | | | | | | ide_dma_speed() fails to actually honor the IDE drivers' mode support masks) because of the bogus checks -- thus, selecting the DMA transfer mode that the driver explicitly refuses to support is possible. Additionally, there is no check for validity of the UltraDMA mode data in the drive ID, and the function is misdocumented. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] Split struct request ->flags into two partsJens Axboe2006-09-301-2/+3
| | | | | | | | | | Right now ->flags is a bit of a mess: some are request types, and others are just modifiers. Clean this up by splitting it into ->cmd_type and ->cmd_flags. This allows introduction of generic Linux block message types, useful for sending generic Linux commands to block devices. Signed-off-by: Jens Axboe <axboe@suse.de>
* Remove obsolete #include <linux/config.h>Jörn Engel2006-06-301-1/+0Star
| | | | | Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
* [PATCH] fix IDE deadlock in error reporting codeIngo Molnar2006-06-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Michal Piotrowski reported the following validator assert: hdd: set_drive_speed_status: status=0x51 { DriveReady SeekComplete Error } hdd: set_drive_speed_status: error=0xb4 { AbortedCommand LastFailedSense=0x0b } ============================ [ BUG: illegal lock usage! ] ---------------------------- illegal {in-hardirq-W} -> {hardirq-on-W} usage. hdparm/1821 [HC0[0]:SC0[0]:HE1:SE1] takes: (ide_lock){++..}, at: [<c0268388>] ide_dump_opcode+0x13/0x9b [...] stack backtrace: [<c0104513>] show_trace+0x1b/0x20 [<c01045f1>] dump_stack+0x1f/0x24 [<c013976c>] print_usage_bug+0x1a5/0x1b1 [<c0139e90>] mark_lock+0x2ca/0x4f7 [<c013aa96>] __lockdep_acquire+0x47e/0xaa4 [<c013b536>] lockdep_acquire+0x67/0x7f [<c030552d>] _spin_lock+0x24/0x32 [<c0268388>] ide_dump_opcode+0x13/0x9b [<c02688b6>] ide_dump_status+0x4a6/0x4cc [<c0267ae6>] ide_config_drive_speed+0x32a/0x33a [<c0262dc5>] piix_tune_chipset+0x2ed/0x2f8 [<c0262e31>] piix_config_drive_xfer_rate+0x61/0xb5 [<c0263a82>] set_using_dma+0x2f/0x60 [<c0263bee>] ide_write_setting+0x4a/0xc3 [<c02647ca>] generic_ide_ioctl+0x8a/0x47f [<f886003a>] idecd_ioctl+0xfd/0x133 [ide_cd] [<c01f1fff>] blkdev_driver_ioctl+0x4b/0x5f [<c01f2783>] blkdev_ioctl+0x770/0x7bd [<c017dc0d>] block_ioctl+0x1f/0x21 [<c0189353>] do_ioctl+0x27/0x6e [<c0189604>] vfs_ioctl+0x26a/0x280 [<c0189667>] sys_ioctl+0x4d/0x7e [<c0305ed2>] sysenter_past_esp+0x63/0xa1 in ide_dump_opcode() takes the ide_lock in an irq-unsafe manner, i.e. this function expects to be called with irqs disabled. But ide_dump_ata[pi]_status() doesnt do that - it enables interrupts specifically. That is a no-no - what guarantees that another IDE port couldnt generate an IDE interrupt while we are dumping this error? The fix is to turn the irq-enabling in these functions into irq-disabling. Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> Cc: 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>
* [PATCH] More BUG_ON conversionEric Sesterhenn2006-06-231-2/+1Star
| | | | | | | | | | | 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>
* [PATCH] ide: fix ide_toggle_bounce() to not try to bounce if we have an IOMMUJames Bottomley2005-11-181-4/+4
| | | | | | | | | | The following patch fixes a crash caused by attempting to bounce buffer when an IDE CD-ROM is used on a machine with an IO-MMU. [At least, this patch fixes things so I can use my IDE CD-ROM behind an ns87415 on a HP PA-RISC workstation.] Signed-off-by: James Bottomley <jejb@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* [PATCH] ide: fix line break in ide messagesDenis Vlasenko2005-07-031-8/+5Star
| | | | | | | | From: Denis Vlasenko <vda@ilport.com.ua> * printk("\n") is misplaced, resulting in stray empty line in kernel log * cleanups nerby: some back-to-back printks are combined, etc Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
* Linux-2.6.12-rc2Linus Torvalds2005-04-171-0/+622
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!