From 65c9cd23cab821c165a70ddd0447eb6362ebbb0c Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 16 Oct 2007 22:29:54 +0200 Subject: ide: remove ide_use_fast_pio() Remove ide_use_fast_pio() and just re-tune PIO unconditionally if DMA tuning has failed in ->ide_dma_check. All host drivers using ide_use_fast_pio() set drive->autotune so PIO is always tuned anyway and in some cases we _really_ need to re-tune PIO because PIO and DMA timings are shared. Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/ide.h b/include/linux/ide.h index 30a1931466a..86c5907db2a 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1380,7 +1380,6 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data) extern char *ide_xfer_verbose(u8 xfer_rate); extern void ide_toggle_bounce(ide_drive_t *drive, int on); extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); -int ide_use_fast_pio(ide_drive_t *); static inline int ide_dev_has_iordy(struct hd_driveid *id) { -- cgit v1.2.3 From 0ae2e178652753ae1797d407755a3505f7c1d2a7 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 16 Oct 2007 22:29:55 +0200 Subject: ide: remove ->ide_dma_check (take 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 Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/ide.h b/include/linux/ide.h index 86c5907db2a..c144c7f2605 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -736,7 +736,6 @@ typedef struct hwif_s { void (*dma_exec_cmd)(ide_drive_t *, u8); void (*dma_start)(ide_drive_t *); int (*ide_dma_end)(ide_drive_t *drive); - int (*ide_dma_check)(ide_drive_t *drive); int (*ide_dma_on)(ide_drive_t *drive); void (*dma_off_quietly)(ide_drive_t *drive); int (*ide_dma_test_irq)(ide_drive_t *drive); @@ -1256,6 +1255,10 @@ enum { IDE_HFLAG_POST_SET_MODE = (1 << 8), /* don't program host/device for the transfer mode ("smart" hosts) */ IDE_HFLAG_NO_SET_MODE = (1 << 9), + /* trust BIOS for programming chipset/device for DMA */ + IDE_HFLAG_TRUST_BIOS_FOR_DMA = (1 << 10), + /* host uses VDMA */ + IDE_HFLAG_VDMA = (1 << 11), }; typedef struct ide_pci_device_s { @@ -1303,7 +1306,6 @@ static inline u8 ide_max_dma_mode(ide_drive_t *drive) return ide_find_dma_mode(drive, XFER_UDMA_6); } -int ide_tune_dma(ide_drive_t *); void ide_dma_off(ide_drive_t *); void ide_dma_verbose(ide_drive_t *); int ide_set_dma(ide_drive_t *); @@ -1330,7 +1332,6 @@ extern void ide_dma_timeout(ide_drive_t *); #else static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } -static inline int ide_tune_dma(ide_drive_t *drive) { return 0; } static inline void ide_dma_off(ide_drive_t *drive) { ; } static inline void ide_dma_verbose(ide_drive_t *drive) { ; } static inline int ide_set_dma(ide_drive_t *drive) { return 1; } -- cgit v1.2.3 From 9ff6f72f432364991d68e99cae72cb141c166e70 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 16 Oct 2007 22:29:58 +0200 Subject: ide: remove hwif->autodma and drive->autodma * hpt34x.c: disable DMA masks for HPT345 (hwif->autodma is zero so DMA won't be enabled anyway). * trm290.c: disable IDE_HFLAG_TRUST_BIOS_FOR_DMA flag (hwif->autodma is zero so DMA won't be enabled anyway). * Check noautodma global variable instead of drive->autodma in ide_tune_dma(). This fixes handling of "ide=nodma" kernel parameter for icside, ide-cris, au1xxx-ide, pmac, it821x, jmicron, sgiioc4 and siimage host drivers. * Remove hwif->autodma (it was not checked by IDE core code anyway) and drive->autodma (was set by all host drivers - except HPT345/TRM290 special cases - unless "ide=nodma" was used). While at it: - remove needless printk() from icside.c - remove stale FIXME/comment from ide-probe.c - don't force DMA off if PCI bus-mastering had to be enabled in setup-pci.c (this setting was always later over-ridden by host drivers anyway) Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/ide.h b/include/linux/ide.h index c144c7f2605..79652c5c0ea 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -576,7 +576,6 @@ typedef struct ide_drive_s { select_t select; /* basic drive/head select reg value */ u8 keep_settings; /* restore settings after drive reset */ - u8 autodma; /* device can safely use dma on host */ u8 using_dma; /* disk is using dma for read/write */ u8 retry_pio; /* retrying dma capable host in pio */ u8 state; /* retry state */ @@ -797,7 +796,6 @@ typedef struct hwif_s { unsigned serialized : 1; /* serialized all channel operation */ unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ unsigned reset : 1; /* reset after probe */ - unsigned autodma : 1; /* auto-attempt using DMA at boot */ unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ unsigned auto_poll : 1; /* supports nop auto-poll */ -- cgit v1.2.3 From c223701cf6c706f42840631c1ca919a18e6e2800 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 16 Oct 2007 22:29:58 +0200 Subject: ide: add "hdx=nodma" kernel parameter * Add "hdx=nodma" option allowing user to disallow DMA for a given device. * Obsolete "ide=nodma" option. Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/ide.h b/include/linux/ide.h index 79652c5c0ea..e39ee2fa260 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -599,6 +599,7 @@ typedef struct ide_drive_s { unsigned nice0 : 1; /* give obvious excess bandwidth */ unsigned nice2 : 1; /* give a share in our own bandwidth */ unsigned doorlocking : 1; /* for removable only: door lock/unlock works */ + unsigned nodma : 1; /* disallow DMA */ unsigned autotune : 2; /* 0=default, 1=autotune, 2=noautotune */ unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ -- cgit v1.2.3