lkml.org 
[lkml]   [2002]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 2.5.24: generic ATA PCI auto-dma tuning (3/5)

- add int 'map' parameter to ch->udma_setup() functions

--
Bartlomiej Zolnierkiewicz
diff -ur linux-ata-hosts-8/include/linux/ide.h linux/include/linux/ide.h
--- linux-ata-hosts-8/include/linux/ide.h Mon Jun 24 22:35:10 2002
+++ linux/include/linux/ide.h Mon Jun 24 22:40:40 2002
@@ -456,7 +456,7 @@
void (*atapi_read)(struct ata_device *, void *, unsigned int);
void (*atapi_write)(struct ata_device *, void *, unsigned int);

- int (*udma_setup)(struct ata_device *);
+ int (*udma_setup)(struct ata_device *, int);

void (*udma_enable)(struct ata_device *, int, int);
void (*udma_start) (struct ata_device *, struct request *);
@@ -799,9 +799,9 @@
extern int udma_pci_irq_status(struct ata_device *drive);
extern void udma_pci_timeout(struct ata_device *drive);
extern void udma_pci_irq_lost(struct ata_device *);
-extern int udma_pci_setup(struct ata_device *);
+extern int udma_pci_setup(struct ata_device *, int);

-extern int udma_generic_setup(struct ata_device *);
+extern int udma_generic_setup(struct ata_device *, int);

extern int udma_new_table(struct ata_device *, struct request *);
extern void udma_destroy_table(struct ata_channel *);
diff -ur linux-ata-hosts-8/drivers/ide/alim15x3.c linux/drivers/ide/alim15x3.c
--- linux-ata-hosts-8/drivers/ide/alim15x3.c Mon Jun 24 22:24:30 2002
+++ linux/drivers/ide/alim15x3.c Mon Jun 24 22:40:40 2002
@@ -177,7 +177,7 @@
return !ali15x3_tune_chipset(drive, mode);
}

-static int ali15x3_udma_setup(struct ata_device *drive)
+static int ali15x3_udma_setup(struct ata_device *drive, int map)
{
struct hd_driveid *id = drive->id;
struct ata_channel *hwif = drive->channel;
diff -ur linux-ata-hosts-8/drivers/ide/cs5530.c linux/drivers/ide/cs5530.c
--- linux-ata-hosts-8/drivers/ide/cs5530.c Mon Jun 24 22:15:08 2002
+++ linux/drivers/ide/cs5530.c Mon Jun 24 22:40:40 2002
@@ -191,7 +191,7 @@
return 0;
}

-static int cs5530_udma_setup(struct ata_device *drive)
+static int cs5530_udma_setup(struct ata_device *drive, int map)
{
return cs5530_config_dma(drive);
}
diff -ur linux-ata-hosts-8/drivers/ide/cy82c693.c linux/drivers/ide/cy82c693.c
--- linux-ata-hosts-8/drivers/ide/cy82c693.c Mon Jun 24 22:15:18 2002
+++ linux/drivers/ide/cy82c693.c Mon Jun 24 22:40:40 2002
@@ -237,7 +237,7 @@
/*
* used to set DMA mode for CY82C693 (single and multi modes)
*/
-static int cy82c693_udma_setup(struct ata_device *drive)
+static int cy82c693_udma_setup(struct ata_device *drive, int map)
{
/*
* Set dma mode for drive everything else is done by the defaul func.
diff -ur linux-ata-hosts-8/drivers/ide/hpt34x.c linux/drivers/ide/hpt34x.c
--- linux-ata-hosts-8/drivers/ide/hpt34x.c Mon Jun 24 22:35:10 2002
+++ linux/drivers/ide/hpt34x.c Mon Jun 24 22:40:40 2002
@@ -72,11 +72,10 @@
}

#ifdef CONFIG_BLK_DEV_IDEDMA
-
-static int hpt34x_udma_setup(struct ata_device *drive)
+static int hpt34x_udma_setup(struct ata_device *drive, int map)
{
#ifdef CONFIG_HPT34X_AUTODMA
- udma_generic_setup(drive);
+ udma_generic_setup(drive, map);
#endif

return 0;
diff -ur linux-ata-hosts-8/drivers/ide/hpt366.c linux/drivers/ide/hpt366.c
--- linux-ata-hosts-8/drivers/ide/hpt366.c Mon Jun 24 22:24:30 2002
+++ linux/drivers/ide/hpt366.c Mon Jun 24 22:40:40 2002
@@ -743,7 +743,7 @@
}
}

-static int hpt3xx_udma_setup(struct ata_device *drive)
+static int hpt3xx_udma_setup(struct ata_device *drive, int map)
{
struct hd_driveid *id = drive->id;
int on = 1;
diff -ur linux-ata-hosts-8/drivers/ide/icside.c linux/drivers/ide/icside.c
--- linux-ata-hosts-8/drivers/ide/icside.c Mon Jun 24 22:21:01 2002
+++ linux/drivers/ide/icside.c Mon Jun 24 22:40:40 2002
@@ -405,7 +405,7 @@
#endif
}

-static int icside_dma_check(struct ata_device *drive)
+static int icside_dma_check(struct ata_device *drive, int map)
{
struct hd_driveid *id = drive->id;
struct ata_channel *ch = drive->channel;
diff -ur linux-ata-hosts-8/drivers/ide/ide-pmac.c linux/drivers/ide/ide-pmac.c
--- linux-ata-hosts-8/drivers/ide/ide-pmac.c Mon Jun 24 22:21:01 2002
+++ linux/drivers/ide/ide-pmac.c Mon Jun 24 22:40:40 2002
@@ -260,7 +260,7 @@
static int pmac_udma_stop(struct ata_device *drive);
static int pmac_udma_init(struct ata_device *drive, struct request *rq);
static int pmac_udma_irq_status(struct ata_device *drive);
-static int pmac_udma_setup(struct ata_device *drive);
+static int pmac_udma_setup(struct ata_device *drive, int map);
static int pmac_ide_build_dmatable(struct ata_device *drive, struct request *rq, int ix, int wr);
static int pmac_ide_tune_chipset(struct ata_device *drive, byte speed);
static void pmac_ide_tuneproc(struct ata_device *drive, byte pio);
@@ -1498,7 +1498,7 @@
return 0;
}

-static int pmac_udma_setup(struct ata_device *drive)
+static int pmac_udma_setup(struct ata_device *drive, int map)
{
/* Change this to better match ide-dma.c */
pmac_ide_check_dma(drive);
diff -ur linux-ata-hosts-8/drivers/ide/main.c linux/drivers/ide/main.c
--- linux-ata-hosts-8/drivers/ide/main.c Mon Jun 24 22:15:08 2002
+++ linux/drivers/ide/main.c Mon Jun 24 22:40:40 2002
@@ -1074,7 +1074,8 @@
spin_unlock_irqrestore(&ide_lock, flags);
/* Default autotune or requested autotune */
if (drive->autotune != 2) {
- if (drive->channel->udma_setup) {
+ struct ata_channel *ch = drive->channel;
+ if (ch->udma_setup) {

/*
* Force DMAing for the beginning of the check. Some
@@ -1085,7 +1086,7 @@
*/

udma_enable(drive, 0, 0);
- drive->channel->udma_setup(drive);
+ ch->udma_setup(drive, ch->modes_map);
#ifdef CONFIG_BLK_DEV_IDE_TCQ_DEFAULT
udma_tcq_enable(drive, 1);
#endif
diff -ur linux-ata-hosts-8/drivers/ide/ns87415.c linux/drivers/ide/ns87415.c
--- linux-ata-hosts-8/drivers/ide/ns87415.c Mon Jun 24 22:21:01 2002
+++ linux/drivers/ide/ns87415.c Mon Jun 24 22:40:40 2002
@@ -112,14 +112,14 @@
return ide_stopped;
}

-static int ns87415_udma_setup(struct ata_device *drive)
+static int ns87415_udma_setup(struct ata_device *drive, int map)
{
if (drive->type != ATA_DISK) {
udma_enable(drive, 0, 0);

return 0;
}
- return udma_pci_setup(drive);
+ return udma_pci_setup(drive, map);
}
#endif

diff -ur linux-ata-hosts-8/drivers/ide/pcidma.c linux/drivers/ide/pcidma.c
--- linux-ata-hosts-8/drivers/ide/pcidma.c Mon Jun 24 22:35:10 2002
+++ linux/drivers/ide/pcidma.c Mon Jun 24 22:40:40 2002
@@ -174,11 +174,10 @@
}

/* generic udma_setup() function for drivers having ->speedproc/tuneproc */
-int udma_generic_setup(struct ata_device *drive)
+int udma_generic_setup(struct ata_device *drive, int map)
{
struct hd_driveid *id = drive->id;
struct ata_channel *ch = drive->channel;
- int map = ch->modes_map; /* map of host capabilities */
int on = 0;
u8 mode;

@@ -240,7 +239,7 @@
/*
* Configure a device for DMA operation.
*/
-int udma_pci_setup(struct ata_device *drive)
+int udma_pci_setup(struct ata_device *drive, int map)
{
int config_allows_dma = 1;
struct hd_driveid *id = drive->id;
diff -ur linux-ata-hosts-8/drivers/ide/pdc202xx.c linux/drivers/ide/pdc202xx.c
--- linux-ata-hosts-8/drivers/ide/pdc202xx.c Mon Jun 24 22:24:30 2002
+++ linux/drivers/ide/pdc202xx.c Mon Jun 24 22:40:40 2002
@@ -496,7 +496,7 @@
return !hwif->speedproc(drive, mode);
}

-static int pdc202xx_udma_setup(struct ata_device *drive)
+static int pdc202xx_udma_setup(struct ata_device *drive, int map)
{
struct hd_driveid *id = drive->id;
struct ata_channel *hwif = drive->channel;
diff -ur linux-ata-hosts-8/drivers/ide/sl82c105.c linux/drivers/ide/sl82c105.c
--- linux-ata-hosts-8/drivers/ide/sl82c105.c Mon Jun 24 22:15:08 2002
+++ linux/drivers/ide/sl82c105.c Mon Jun 24 22:40:40 2002
@@ -130,7 +130,7 @@
* Check to see if the drive and
* chipset is capable of DMA mode
*/
-static int sl82c105_dma_setup(struct ata_device *drive)
+static int sl82c105_dma_setup(struct ata_device *drive, int map)
{
int on = 0;

diff -ur linux-ata-hosts-8/drivers/ide/trm290.c linux/drivers/ide/trm290.c
--- linux-ata-hosts-8/drivers/ide/trm290.c Mon Jun 24 22:21:01 2002
+++ linux/drivers/ide/trm290.c Mon Jun 24 22:40:40 2002
@@ -239,9 +239,9 @@
return (inw(drive->channel->dma_base + 2) == 0x00ff);
}

-static int trm290_udma_setup(struct ata_device *drive)
+static int trm290_udma_setup(struct ata_device *drive, int map)
{
- return udma_pci_setup(drive);
+ return udma_pci_setup(drive, map);
}
#endif
\
 
 \ /
  Last update: 2005-03-22 13:27    [W:0.047 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site