* [git patches] IDE update
@ 2007-05-09 22:46 Bartlomiej Zolnierkiewicz
2007-05-09 22:46 ` Jeff Garzik
2007-05-09 22:47 ` Jeff Garzik
0 siblings, 2 replies; 67+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-05-09 22:46 UTC (permalink / raw)
To: linux-ide, linux-kernel
[ I've sent it to Linus a moment ago, here is a copy for linux-{ide,kernel} ]
Highlights of this update:
* the code for selecting and programming the best DMA transfer mode
has been reworked to be cleaner, more generic and more libata-like,
(> 500 LOCs gone and this change allows the change described below)
* more cable detection fixes, also be more user-friendly [+ developer
friendly when it comes to debugging problems :) ] and inform user about
limiting DMA speed to UDMA/33 if the 40-wire cable was detected instead
of 80-wire one
* make /proc/ide interface optional (but enabled by default) as all
important functionality should be now available through sysfs (+ ioctls),
while at it do some cleanup/fixes of IDE procfs code
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/
to receive the following updates:
drivers/ide/Kconfig | 14 ++
drivers/ide/Makefile | 2 +-
drivers/ide/arm/bast-ide.c | 2 +-
drivers/ide/arm/icside.c | 9 +-
drivers/ide/arm/ide_arm.c | 2 +-
drivers/ide/arm/rapide.c | 2 +-
drivers/ide/cris/ide-cris.c | 4 +-
drivers/ide/h8300/ide-h8300.c | 2 +-
drivers/ide/ide-cd.c | 20 +-
drivers/ide/ide-disk.c | 101 +++++++--
drivers/ide/ide-dma.c | 94 ++++++++
drivers/ide/ide-floppy.c | 30 ++--
drivers/ide/ide-generic.c | 2 -
drivers/ide/ide-io.c | 17 +-
drivers/ide/ide-iops.c | 55 +++---
drivers/ide/ide-lib.c | 132 ++---------
drivers/ide/ide-pnp.c | 2 +-
drivers/ide/ide-probe.c | 3 +
drivers/ide/ide-proc.c | 344 +++++++++++++++++++++++++++--
drivers/ide/ide-tape.c | 49 ++--
drivers/ide/ide.c | 470 ++++++++--------------------------------
drivers/ide/legacy/ali14xx.c | 3 +-
drivers/ide/legacy/buddha.c | 2 +-
drivers/ide/legacy/dtc2278.c | 3 +-
drivers/ide/legacy/falconide.c | 2 +-
drivers/ide/legacy/gayle.c | 2 +-
drivers/ide/legacy/ht6560b.c | 3 +-
drivers/ide/legacy/ide-cs.c | 2 +-
drivers/ide/legacy/macide.c | 6 +-
drivers/ide/legacy/q40ide.c | 2 +-
drivers/ide/legacy/qd65xx.c | 7 +-
drivers/ide/legacy/umc8672.c | 3 +-
drivers/ide/mips/au1xxx-ide.c | 3 +
drivers/ide/mips/swarm.c | 3 +
drivers/ide/pci/aec62xx.c | 62 ++----
drivers/ide/pci/alim15x3.c | 97 +++------
drivers/ide/pci/amd74xx.c | 6 +-
drivers/ide/pci/atiixp.c | 40 +----
drivers/ide/pci/cmd64x.c | 90 +++------
drivers/ide/pci/cs5520.c | 20 ++-
drivers/ide/pci/cs5535.c | 33 +---
drivers/ide/pci/delkin_cb.c | 2 +-
drivers/ide/pci/hpt34x.c | 27 +--
drivers/ide/pci/hpt366.c | 85 +++-----
drivers/ide/pci/it8213.c | 39 +---
drivers/ide/pci/it821x.c | 20 +--
drivers/ide/pci/jmicron.c | 40 +----
drivers/ide/pci/pdc202xx_new.c | 40 +---
drivers/ide/pci/pdc202xx_old.c | 54 +----
drivers/ide/pci/piix.c | 163 +++-----------
drivers/ide/pci/scc_pata.c | 21 +--
drivers/ide/pci/serverworks.c | 31 ++-
drivers/ide/pci/sgiioc4.c | 2 +-
drivers/ide/pci/siimage.c | 45 ++--
drivers/ide/pci/sis5513.c | 44 +---
drivers/ide/pci/slc90e66.c | 24 +--
drivers/ide/pci/tc86c001.c | 20 +--
drivers/ide/pci/triflex.c | 15 +-
drivers/ide/ppc/pmac.c | 2 +
drivers/ide/setup-pci.c | 27 ++-
drivers/macintosh/mediabay.c | 2 +-
drivers/scsi/ide-scsi.c | 30 ++-
include/linux/ide.h | 93 +++++----
63 files changed, 1107 insertions(+), 1464 deletions(-)
Bartlomiej Zolnierkiewicz (11):
ide: fix UDMA/MWDMA/SWDMA masks (v3)
ide: rework the code for selecting the best DMA transfer mode (v3)
ide: add ide_tune_dma() helper
ide: make /proc/ide/ optional
ide: split off ioctl handling from IDE settings (v2)
ide: move IDE settings handling to ide-proc.c
ide: cable detection fixes (take 2)
ide: add "initializing" argument to ide_register_hw()
ide: add ide_proc_register_port()
ide: legacy PCI bus order probing fixes
ide: fix PIO setup on resume for ATAPI devices
[ sorry but the patch is too big to be included ]
^ permalink raw reply [flat|nested] 67+ messages in thread* Re: [git patches] IDE update 2007-05-09 22:46 [git patches] IDE update Bartlomiej Zolnierkiewicz @ 2007-05-09 22:46 ` Jeff Garzik 2007-05-09 23:20 ` David Miller 2007-05-09 23:23 ` Bartlomiej Zolnierkiewicz 2007-05-09 22:47 ` Jeff Garzik 1 sibling, 2 replies; 67+ messages in thread From: Jeff Garzik @ 2007-05-09 22:46 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel Bartlomiej Zolnierkiewicz wrote: > Bartlomiej Zolnierkiewicz (11): > ide: fix UDMA/MWDMA/SWDMA masks (v3) > ide: rework the code for selecting the best DMA transfer mode (v3) > ide: add ide_tune_dma() helper > ide: make /proc/ide/ optional > ide: split off ioctl handling from IDE settings (v2) > ide: move IDE settings handling to ide-proc.c > ide: cable detection fixes (take 2) > ide: add "initializing" argument to ide_register_hw() > ide: add ide_proc_register_port() > ide: legacy PCI bus order probing fixes > ide: fix PIO setup on resume for ATAPI devices > > > [ sorry but the patch is too big to be included ] The limit was raised to 400K IIRC. Jeff ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2007-05-09 22:46 ` Jeff Garzik @ 2007-05-09 23:20 ` David Miller 2007-05-09 23:23 ` Bartlomiej Zolnierkiewicz 1 sibling, 0 replies; 67+ messages in thread From: David Miller @ 2007-05-09 23:20 UTC (permalink / raw) To: jeff; +Cc: bzolnier, linux-ide, linux-kernel From: Jeff Garzik <jeff@garzik.org> Date: Wed, 09 May 2007 18:46:16 -0400 > Bartlomiej Zolnierkiewicz wrote: > > Bartlomiej Zolnierkiewicz (11): > > ide: fix UDMA/MWDMA/SWDMA masks (v3) > > ide: rework the code for selecting the best DMA transfer mode (v3) > > ide: add ide_tune_dma() helper > > ide: make /proc/ide/ optional > > ide: split off ioctl handling from IDE settings (v2) > > ide: move IDE settings handling to ide-proc.c > > ide: cable detection fixes (take 2) > > ide: add "initializing" argument to ide_register_hw() > > ide: add ide_proc_register_port() > > ide: legacy PCI bus order probing fixes > > ide: fix PIO setup on resume for ATAPI devices > > > > > > [ sorry but the patch is too big to be included ] > > > The limit was raised to 400K IIRC. On lkml but not linux-ide, I'll go and bump it up there too. There, done... ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2007-05-09 22:46 ` Jeff Garzik 2007-05-09 23:20 ` David Miller @ 2007-05-09 23:23 ` Bartlomiej Zolnierkiewicz 2007-05-09 23:18 ` Jeff Garzik 1 sibling, 1 reply; 67+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2007-05-09 23:23 UTC (permalink / raw) To: Jeff Garzik; +Cc: linux-ide, linux-kernel On Thursday 10 May 2007, Jeff Garzik wrote: > Bartlomiej Zolnierkiewicz wrote: > > Bartlomiej Zolnierkiewicz (11): > > ide: fix UDMA/MWDMA/SWDMA masks (v3) > > ide: rework the code for selecting the best DMA transfer mode (v3) > > ide: add ide_tune_dma() helper > > ide: make /proc/ide/ optional > > ide: split off ioctl handling from IDE settings (v2) > > ide: move IDE settings handling to ide-proc.c > > ide: cable detection fixes (take 2) > > ide: add "initializing" argument to ide_register_hw() > > ide: add ide_proc_register_port() > > ide: legacy PCI bus order probing fixes > > ide: fix PIO setup on resume for ATAPI devices > > > > > > [ sorry but the patch is too big to be included ] > > > The limit was raised to 400K IIRC. That's (good) news to me, here goes the actual 150K patch: diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 5bdf64b..1d06b41 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig @@ -291,6 +291,17 @@ config IDE_TASK_IOCTL If you are unsure, say N here. +config IDE_PROC_FS + bool "legacy /proc/ide/ support" + depends on IDE && PROC_FS + default y + help + This option enables support for the various files in + /proc/ide. In Linux 2.6 this has been superseded by + files in sysfs but many legacy applications rely on this. + + If unsure say Y. + comment "IDE chipset support/bugfixes" config IDE_GENERIC @@ -360,6 +371,9 @@ config IDEPCI_SHARE_IRQ It is safe to say Y to this question, in most cases. If unsure, say N. +config IDEPCI_PCIBUS_ORDER + def_bool PCI && BLK_DEV_IDE=y && BLK_DEV_IDEPCI + config BLK_DEV_OFFBOARD bool "Boot off-board chipsets first support" depends on PCI && BLK_DEV_IDEPCI diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile index d9f029e..75dc696 100644 --- a/drivers/ide/Makefile +++ b/drivers/ide/Makefile @@ -20,7 +20,7 @@ ide-core-$(CONFIG_BLK_DEV_CMD640) += pci/cmd640.o # Core IDE code - must come before legacy ide-core-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o ide-core-$(CONFIG_BLK_DEV_IDEDMA) += ide-dma.o -ide-core-$(CONFIG_PROC_FS) += ide-proc.o +ide-core-$(CONFIG_IDE_PROC_FS) += ide-proc.o ide-core-$(CONFIG_BLK_DEV_IDEPNP) += ide-pnp.o ide-core-$(CONFIG_BLK_DEV_IDEACPI) += ide-acpi.o diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c index 9d474e5..f7449d0 100644 --- a/drivers/ide/arm/bast-ide.c +++ b/drivers/ide/arm/bast-ide.c @@ -45,7 +45,7 @@ bastide_register(unsigned int base, unsigned int aux, int irq, hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20); hw.irq = irq; - ide_register_hw(&hw, hwif); + ide_register_hw(&hw, 0, hwif); return 0; } diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index e2953fc..1fe0457 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c @@ -342,7 +342,7 @@ static int icside_dma_check(ide_drive_t *drive) * Enable DMA on any drive that has multiword DMA */ if (id->field_valid & 2) { - xfer_mode = ide_dma_speed(drive, 0); + xfer_mode = ide_max_dma_mode(drive); goto out; } @@ -591,7 +591,8 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec) state->hwif[0] = hwif; probe_hwif_init(hwif); - create_proc_ide_interfaces(); + + ide_proc_register_port(hwif); return 0; } @@ -679,7 +680,9 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec) probe_hwif_init(hwif); probe_hwif_init(mate); - create_proc_ide_interfaces(); + + ide_proc_register_port(hwif); + ide_proc_register_port(mate); return 0; diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c index 23488c4..a3d6744 100644 --- a/drivers/ide/arm/ide_arm.c +++ b/drivers/ide/arm/ide_arm.c @@ -38,6 +38,6 @@ void __init ide_arm_init(void) memset(&hw, 0, sizeof(hw)); ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206); hw.irq = IDE_ARM_IRQ; - ide_register_hw(&hw, NULL); + ide_register_hw(&hw, 1, NULL); } } diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index 9c6c49f..890ea3f 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c @@ -76,7 +76,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) hwif->gendev.parent = &ec->dev; hwif->noprobe = 0; probe_hwif_init(hwif); - create_proc_ide_interfaces(); + ide_proc_register_port(hwif); ecard_set_drvdata(ec, hwif); goto out; } diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c index 5e8efc8..c04cb25 100644 --- a/drivers/ide/cris/ide-cris.c +++ b/drivers/ide/cris/ide-cris.c @@ -796,7 +796,7 @@ init_e100_ide (void) ide_offsets, 0, 0, cris_ide_ack_intr, ide_default_irq(0)); - ide_register_hw(&hw, &hwif); + ide_register_hw(&hw, 1, &hwif); hwif->mmio = 1; hwif->chipset = ide_etrax100; hwif->tuneproc = &tune_cris_ide; @@ -1004,7 +1004,7 @@ static int cris_ide_build_dmatable (ide_drive_t *drive) static int cris_config_drive_for_dma (ide_drive_t *drive) { - u8 speed = ide_dma_speed(drive, 1); + u8 speed = ide_max_dma_mode(drive); if (!speed) return 0; diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c index 88750a3..6d26ad7 100644 --- a/drivers/ide/h8300/ide-h8300.c +++ b/drivers/ide/h8300/ide-h8300.c @@ -101,7 +101,7 @@ void __init h8300_ide_init(void) hw_setup(&hw); /* register if */ - idx = ide_register_hw(&hw, &hwif); + idx = ide_register_hw(&hw, 1, &hwif); if (idx == -1) { printk(KERN_ERR "ide-h8300: IDE I/F register failed\n"); return; diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 638becd..252ab82 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -3059,10 +3059,14 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive) return nslots; } +#ifdef CONFIG_IDE_PROC_FS static void ide_cdrom_add_settings(ide_drive_t *drive) { - ide_add_setting(drive, "dsc_overlap", SETTING_RW, -1, -1, TYPE_BYTE, 0, 1, 1, 1, &drive->dsc_overlap, NULL); + ide_add_setting(drive, "dsc_overlap", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->dsc_overlap, NULL); } +#else +static inline void ide_cdrom_add_settings(ide_drive_t *drive) { ; } +#endif /* * standard prep_rq_fn that builds 10 byte cmds @@ -3274,7 +3278,7 @@ int ide_cdrom_setup (ide_drive_t *drive) return 0; } -#ifdef CONFIG_PROC_FS +#ifdef CONFIG_IDE_PROC_FS static sector_t ide_cdrom_capacity (ide_drive_t *drive) { @@ -3291,7 +3295,7 @@ static void ide_cd_remove(ide_drive_t *drive) { struct cdrom_info *info = drive->driver_data; - ide_unregister_subdriver(drive, info->driver); + ide_proc_unregister_driver(drive, info->driver); del_gendisk(info->disk); @@ -3321,7 +3325,7 @@ static void ide_cd_release(struct kref *kref) static int ide_cd_probe(ide_drive_t *); -#ifdef CONFIG_PROC_FS +#ifdef CONFIG_IDE_PROC_FS static int proc_idecd_read_capacity (char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -3336,8 +3340,6 @@ static ide_proc_entry_t idecd_proc[] = { { "capacity", S_IFREG|S_IRUGO, proc_idecd_read_capacity, NULL }, { NULL, 0, NULL, NULL } }; -#else -# define idecd_proc NULL #endif static ide_driver_t ide_cdrom_driver = { @@ -3355,7 +3357,9 @@ static ide_driver_t ide_cdrom_driver = { .end_request = ide_end_request, .error = __ide_error, .abort = __ide_abort, +#ifdef CONFIG_IDE_PROC_FS .proc = idecd_proc, +#endif }; static int idecd_open(struct inode * inode, struct file * file) @@ -3517,7 +3521,7 @@ static int ide_cd_probe(ide_drive_t *drive) ide_init_disk(g, drive); - ide_register_subdriver(drive, &ide_cdrom_driver); + ide_proc_register_driver(drive, &ide_cdrom_driver); kref_init(&info->kref); @@ -3534,7 +3538,7 @@ static int ide_cd_probe(ide_drive_t *drive) g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE; if (ide_cdrom_setup(drive)) { struct cdrom_device_info *devinfo = &info->devinfo; - ide_unregister_subdriver(drive, &ide_cdrom_driver); + ide_proc_unregister_driver(drive, &ide_cdrom_driver); kfree(info->buffer); kfree(info->toc); kfree(info->changer_info); diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 37aa6dd..7fff773 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -559,8 +559,7 @@ static sector_t idedisk_capacity (ide_drive_t *drive) return drive->capacity64 - drive->sect0; } -#ifdef CONFIG_PROC_FS - +#ifdef CONFIG_IDE_PROC_FS static int smart_enable(ide_drive_t *drive) { ide_task_t args; @@ -678,12 +677,7 @@ static ide_proc_entry_t idedisk_proc[] = { { "smart_thresholds", S_IFREG|S_IRUSR, proc_idedisk_read_smart_thresholds, NULL }, { NULL, 0, NULL, NULL } }; - -#else - -#define idedisk_proc NULL - -#endif /* CONFIG_PROC_FS */ +#endif /* CONFIG_IDE_PROC_FS */ static void idedisk_prepare_flush(request_queue_t *q, struct request *rq) { @@ -737,6 +731,9 @@ static int set_multcount(ide_drive_t *drive, int arg) { struct request rq; + if (arg < 0 || arg > drive->id->max_multsect) + return -EINVAL; + if (drive->special.b.set_multmode) return -EBUSY; ide_init_drive_cmd (&rq); @@ -749,6 +746,9 @@ static int set_multcount(ide_drive_t *drive, int arg) static int set_nowerr(ide_drive_t *drive, int arg) { + if (arg < 0 || arg > 1) + return -EINVAL; + if (ide_spin_wait_hwgroup(drive)) return -EBUSY; drive->nowerr = arg; @@ -800,6 +800,9 @@ static int write_cache(ide_drive_t *drive, int arg) ide_task_t args; int err = 1; + if (arg < 0 || arg > 1) + return -EINVAL; + if (ide_id_has_flush_cache(drive->id)) { memset(&args, 0, sizeof(ide_task_t)); args.tfRegister[IDE_FEATURE_OFFSET] = (arg) ? @@ -835,6 +838,9 @@ static int set_acoustic (ide_drive_t *drive, int arg) { ide_task_t args; + if (arg < 0 || arg > 254) + return -EINVAL; + memset(&args, 0, sizeof(ide_task_t)); args.tfRegister[IDE_FEATURE_OFFSET] = (arg) ? SETFEATURES_EN_AAM : SETFEATURES_DIS_AAM; @@ -855,6 +861,9 @@ static int set_acoustic (ide_drive_t *drive, int arg) */ static int set_lba_addressing(ide_drive_t *drive, int arg) { + if (arg < 0 || arg > 2) + return -EINVAL; + drive->addressing = 0; if (HWIF(drive)->no_lba48) @@ -866,23 +875,27 @@ static int set_lba_addressing(ide_drive_t *drive, int arg) return 0; } +#ifdef CONFIG_IDE_PROC_FS static void idedisk_add_settings(ide_drive_t *drive) { struct hd_driveid *id = drive->id; - ide_add_setting(drive, "bios_cyl", SETTING_RW, -1, -1, TYPE_INT, 0, 65535, 1, 1, &drive->bios_cyl, NULL); - ide_add_setting(drive, "bios_head", SETTING_RW, -1, -1, TYPE_BYTE, 0, 255, 1, 1, &drive->bios_head, NULL); - ide_add_setting(drive, "bios_sect", SETTING_RW, -1, -1, TYPE_BYTE, 0, 63, 1, 1, &drive->bios_sect, NULL); - ide_add_setting(drive, "address", SETTING_RW, HDIO_GET_ADDRESS, HDIO_SET_ADDRESS, TYPE_INTA, 0, 2, 1, 1, &drive->addressing, set_lba_addressing); - ide_add_setting(drive, "bswap", SETTING_READ, -1, -1, TYPE_BYTE, 0, 1, 1, 1, &drive->bswap, NULL); - ide_add_setting(drive, "multcount", id ? SETTING_RW : SETTING_READ, HDIO_GET_MULTCOUNT, HDIO_SET_MULTCOUNT, TYPE_BYTE, 0, id ? id->max_multsect : 0, 1, 1, &drive->mult_count, set_multcount); - ide_add_setting(drive, "nowerr", SETTING_RW, HDIO_GET_NOWERR, HDIO_SET_NOWERR, TYPE_BYTE, 0, 1, 1, 1, &drive->nowerr, set_nowerr); - ide_add_setting(drive, "lun", SETTING_RW, -1, -1, TYPE_INT, 0, 7, 1, 1, &drive->lun, NULL); - ide_add_setting(drive, "wcache", SETTING_RW, HDIO_GET_WCACHE, HDIO_SET_WCACHE, TYPE_BYTE, 0, 1, 1, 1, &drive->wcache, write_cache); - ide_add_setting(drive, "acoustic", SETTING_RW, HDIO_GET_ACOUSTIC, HDIO_SET_ACOUSTIC, TYPE_BYTE, 0, 254, 1, 1, &drive->acoustic, set_acoustic); - ide_add_setting(drive, "failures", SETTING_RW, -1, -1, TYPE_INT, 0, 65535, 1, 1, &drive->failures, NULL); - ide_add_setting(drive, "max_failures", SETTING_RW, -1, -1, TYPE_INT, 0, 65535, 1, 1, &drive->max_failures, NULL); + ide_add_setting(drive, "bios_cyl", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, &drive->bios_cyl, NULL); + ide_add_setting(drive, "bios_head", SETTING_RW, TYPE_BYTE, 0, 255, 1, 1, &drive->bios_head, NULL); + ide_add_setting(drive, "bios_sect", SETTING_RW, TYPE_BYTE, 0, 63, 1, 1, &drive->bios_sect, NULL); + ide_add_setting(drive, "address", SETTING_RW, TYPE_BYTE, 0, 2, 1, 1, &drive->addressing, set_lba_addressing); + ide_add_setting(drive, "bswap", SETTING_READ, TYPE_BYTE, 0, 1, 1, 1, &drive->bswap, NULL); + ide_add_setting(drive, "multcount", SETTING_RW, TYPE_BYTE, 0, id->max_multsect, 1, 1, &drive->mult_count, set_multcount); + ide_add_setting(drive, "nowerr", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->nowerr, set_nowerr); + ide_add_setting(drive, "lun", SETTING_RW, TYPE_INT, 0, 7, 1, 1, &drive->lun, NULL); + ide_add_setting(drive, "wcache", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->wcache, write_cache); + ide_add_setting(drive, "acoustic", SETTING_RW, TYPE_BYTE, 0, 254, 1, 1, &drive->acoustic, set_acoustic); + ide_add_setting(drive, "failures", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, &drive->failures, NULL); + ide_add_setting(drive, "max_failures", SETTING_RW, TYPE_INT, 0, 65535, 1, 1, &drive->max_failures, NULL); } +#else +static inline void idedisk_add_settings(ide_drive_t *drive) { ; } +#endif static void idedisk_setup (ide_drive_t *drive) { @@ -1001,7 +1014,7 @@ static void ide_disk_remove(ide_drive_t *drive) struct ide_disk_obj *idkp = drive->driver_data; struct gendisk *g = idkp->disk; - ide_unregister_subdriver(drive, idkp->driver); + ide_proc_unregister_driver(drive, idkp->driver); del_gendisk(g); @@ -1066,7 +1079,9 @@ static ide_driver_t idedisk_driver = { .end_request = ide_end_request, .error = __ide_error, .abort = __ide_abort, +#ifdef CONFIG_IDE_PROC_FS .proc = idedisk_proc, +#endif }; static int idedisk_open(struct inode *inode, struct file *filp) @@ -1140,9 +1155,49 @@ static int idedisk_getgeo(struct block_device *bdev, struct hd_geometry *geo) static int idedisk_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { + unsigned long flags; struct block_device *bdev = inode->i_bdev; struct ide_disk_obj *idkp = ide_disk_g(bdev->bd_disk); - return generic_ide_ioctl(idkp->drive, file, bdev, cmd, arg); + ide_drive_t *drive = idkp->drive; + int err, (*setfunc)(ide_drive_t *, int); + u8 *val; + + switch (cmd) { + case HDIO_GET_ADDRESS: val = &drive->addressing; goto read_val; + case HDIO_GET_MULTCOUNT: val = &drive->mult_count; goto read_val; + case HDIO_GET_NOWERR: val = &drive->nowerr; goto read_val; + case HDIO_GET_WCACHE: val = &drive->wcache; goto read_val; + case HDIO_GET_ACOUSTIC: val = &drive->acoustic; goto read_val; + case HDIO_SET_ADDRESS: setfunc = set_lba_addressing; goto set_val; + case HDIO_SET_MULTCOUNT: setfunc = set_multcount; goto set_val; + case HDIO_SET_NOWERR: setfunc = set_nowerr; goto set_val; + case HDIO_SET_WCACHE: setfunc = write_cache; goto set_val; + case HDIO_SET_ACOUSTIC: setfunc = set_acoustic; goto set_val; + } + + return generic_ide_ioctl(drive, file, bdev, cmd, arg); + +read_val: + down(&ide_setting_sem); + spin_lock_irqsave(&ide_lock, flags); + err = *val; + spin_unlock_irqrestore(&ide_lock, flags); + up(&ide_setting_sem); + return err >= 0 ? put_user(err, (long __user *)arg) : err; + +set_val: + if (bdev != bdev->bd_contains) + err = -EINVAL; + else { + if (!capable(CAP_SYS_ADMIN)) + err = -EACCES; + else { + down(&ide_setting_sem); + err = setfunc(drive, arg); + up(&ide_setting_sem); + } + } + return err; } static int idedisk_media_changed(struct gendisk *disk) @@ -1202,7 +1257,7 @@ static int ide_disk_probe(ide_drive_t *drive) ide_init_disk(g, drive); - ide_register_subdriver(drive, &idedisk_driver); + ide_proc_register_driver(drive, &idedisk_driver); kref_init(&idkp->kref); diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index fd21308..5fe8519 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -705,6 +705,100 @@ int ide_use_dma(ide_drive_t *drive) EXPORT_SYMBOL_GPL(ide_use_dma); +static const u8 xfer_mode_bases[] = { + XFER_UDMA_0, + XFER_MW_DMA_0, + XFER_SW_DMA_0, +}; + +static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base) +{ + struct hd_driveid *id = drive->id; + ide_hwif_t *hwif = drive->hwif; + unsigned int mask = 0; + + switch(base) { + case XFER_UDMA_0: + if ((id->field_valid & 4) == 0) + break; + + mask = id->dma_ultra & hwif->ultra_mask; + + if (hwif->udma_filter) + mask &= hwif->udma_filter(drive); + + if ((mask & 0x78) && (eighty_ninty_three(drive) == 0)) + mask &= 0x07; + break; + case XFER_MW_DMA_0: + mask = id->dma_mword & hwif->mwdma_mask; + break; + case XFER_SW_DMA_0: + mask = id->dma_1word & hwif->swdma_mask; + break; + default: + BUG(); + break; + } + + return mask; +} + +/** + * ide_max_dma_mode - compute DMA speed + * @drive: IDE device + * + * Checks the drive capabilities and returns the speed to use + * for the DMA transfer. Returns 0 if the drive is incapable + * of DMA transfers. + */ + +u8 ide_max_dma_mode(ide_drive_t *drive) +{ + ide_hwif_t *hwif = drive->hwif; + unsigned int mask; + int x, i; + u8 mode = 0; + + if (drive->media != ide_disk && hwif->atapi_dma == 0) + return 0; + + for (i = 0; i < ARRAY_SIZE(xfer_mode_bases); i++) { + mask = ide_get_mode_mask(drive, xfer_mode_bases[i]); + x = fls(mask) - 1; + if (x >= 0) { + mode = xfer_mode_bases[i] + x; + break; + } + } + + printk(KERN_DEBUG "%s: selected mode 0x%x\n", drive->name, mode); + + return mode; +} + +EXPORT_SYMBOL_GPL(ide_max_dma_mode); + +int ide_tune_dma(ide_drive_t *drive) +{ + u8 speed; + + /* TODO: use only ide_max_dma_mode() */ + if (!ide_use_dma(drive)) + return 0; + + speed = ide_max_dma_mode(drive); + + if (!speed) + return 0; + + drive->hwif->speedproc(drive, speed); + + return ide_dma_enable(drive); +} + +EXPORT_SYMBOL_GPL(ide_tune_dma); + void ide_dma_verbose(ide_drive_t *drive) { struct hd_driveid *id = drive->id; diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 57cd21c..f429be8 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -1811,18 +1811,22 @@ static int idefloppy_identify_device (ide_drive_t *drive,struct hd_driveid *id) return 0; } +#ifdef CONFIG_IDE_PROC_FS static void idefloppy_add_settings(ide_drive_t *drive) { idefloppy_floppy_t *floppy = drive->driver_data; /* - * drive setting name read/write ioctl ioctl data type min max mul_factor div_factor data pointer set function + * drive setting name read/write data type min max mul_factor div_factor data pointer set function */ - ide_add_setting(drive, "bios_cyl", SETTING_RW, -1, -1, TYPE_INT, 0, 1023, 1, 1, &drive->bios_cyl, NULL); - ide_add_setting(drive, "bios_head", SETTING_RW, -1, -1, TYPE_BYTE, 0, 255, 1, 1, &drive->bios_head, NULL); - ide_add_setting(drive, "bios_sect", SETTING_RW, -1, -1, TYPE_BYTE, 0, 63, 1, 1, &drive->bios_sect, NULL); - ide_add_setting(drive, "ticks", SETTING_RW, -1, -1, TYPE_BYTE, 0, 255, 1, 1, &floppy->ticks, NULL); + ide_add_setting(drive, "bios_cyl", SETTING_RW, TYPE_INT, 0, 1023, 1, 1, &drive->bios_cyl, NULL); + ide_add_setting(drive, "bios_head", SETTING_RW, TYPE_BYTE, 0, 255, 1, 1, &drive->bios_head, NULL); + ide_add_setting(drive, "bios_sect", SETTING_RW, TYPE_BYTE, 0, 63, 1, 1, &drive->bios_sect, NULL); + ide_add_setting(drive, "ticks", SETTING_RW, TYPE_BYTE, 0, 255, 1, 1, &floppy->ticks, NULL); } +#else +static inline void idefloppy_add_settings(ide_drive_t *drive) { ; } +#endif /* * Driver initialization. @@ -1873,7 +1877,7 @@ static void ide_floppy_remove(ide_drive_t *drive) idefloppy_floppy_t *floppy = drive->driver_data; struct gendisk *g = floppy->disk; - ide_unregister_subdriver(drive, floppy->driver); + ide_proc_unregister_driver(drive, floppy->driver); del_gendisk(g); @@ -1892,8 +1896,7 @@ static void ide_floppy_release(struct kref *kref) kfree(floppy); } -#ifdef CONFIG_PROC_FS - +#ifdef CONFIG_IDE_PROC_FS static int proc_idefloppy_read_capacity (char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -1909,12 +1912,7 @@ static ide_proc_entry_t idefloppy_proc[] = { { "geometry", S_IFREG|S_IRUGO, proc_ide_read_geometry, NULL }, { NULL, 0, NULL, NULL } }; - -#else - -#define idefloppy_proc NULL - -#endif /* CONFIG_PROC_FS */ +#endif /* CONFIG_IDE_PROC_FS */ static int ide_floppy_probe(ide_drive_t *); @@ -1933,7 +1931,9 @@ static ide_driver_t idefloppy_driver = { .end_request = idefloppy_do_end_request, .error = __ide_error, .abort = __ide_abort, +#ifdef CONFIG_IDE_PROC_FS .proc = idefloppy_proc, +#endif }; static int idefloppy_open(struct inode *inode, struct file *filp) @@ -2159,7 +2159,7 @@ static int ide_floppy_probe(ide_drive_t *drive) ide_init_disk(g, drive); - ide_register_subdriver(drive, &idefloppy_driver); + ide_proc_register_driver(drive, &idefloppy_driver); kref_init(&floppy->kref); diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 99fd561..0f72b98 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c @@ -22,8 +22,6 @@ static int __init ide_generic_init(void) if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) ide_release_lock(); /* for atari only */ - create_proc_ide_interfaces(); - return 0; } diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 8670112..8e56814 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -172,15 +172,6 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * memset(args, 0, sizeof(*args)); - if (drive->media != ide_disk) { - /* - * skip idedisk_pm_restore_pio and idedisk_pm_idle for ATAPI - * devices - */ - if (pm->pm_step == idedisk_pm_restore_pio) - pm->pm_step = ide_pm_restore_dma; - } - switch (pm->pm_step) { case ide_pm_flush_cache: /* Suspend step 1 (flush cache) */ if (drive->media != ide_disk) @@ -207,7 +198,13 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * case idedisk_pm_restore_pio: /* Resume step 1 (restore PIO) */ if (drive->hwif->tuneproc != NULL) drive->hwif->tuneproc(drive, 255); - ide_complete_power_step(drive, rq, 0, 0); + /* + * skip idedisk_pm_idle for ATAPI devices + */ + if (drive->media != ide_disk) + pm->pm_step = ide_pm_restore_dma; + else + ide_complete_power_step(drive, rq, 0, 0); return ide_stopped; case idedisk_pm_idle: /* Resume step 2 (idle) */ diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 3caa176..f0be5f6 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c @@ -571,51 +571,54 @@ EXPORT_SYMBOL(ide_wait_stat); */ u8 eighty_ninty_three (ide_drive_t *drive) { - if(HWIF(drive)->udma_four == 0) - return 0; + ide_hwif_t *hwif = drive->hwif; + struct hd_driveid *id = drive->id; + + if (hwif->udma_four == 0) + goto no_80w; /* Check for SATA but only if we are ATA5 or higher */ - if (drive->id->hw_config == 0 && (drive->id->major_rev_num & 0x7FE0)) + if (id->hw_config == 0 && (id->major_rev_num & 0x7FE0)) return 1; - if (!(drive->id->hw_config & 0x6000)) - return 0; -#ifndef CONFIG_IDEDMA_IVB - if(!(drive->id->hw_config & 0x4000)) - return 0; -#endif /* CONFIG_IDEDMA_IVB */ + /* * FIXME: * - change master/slave IDENTIFY order * - force bit13 (80c cable present) check * (unless the slave device is pre-ATA3) */ - return 1; -} +#ifndef CONFIG_IDEDMA_IVB + if (id->hw_config & 0x4000) +#else + if (id->hw_config & 0x6000) +#endif + return 1; + +no_80w: + if (drive->udma33_warned == 1) + return 0; -EXPORT_SYMBOL(eighty_ninty_three); + printk(KERN_WARNING "%s: %s side 80-wire cable detection failed, " + "limiting max speed to UDMA33\n", + drive->name, hwif->udma_four ? "drive" : "host"); + + drive->udma33_warned = 1; + + return 0; +} int ide_ata66_check (ide_drive_t *drive, ide_task_t *args) { if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) && (args->tfRegister[IDE_SECTOR_OFFSET] > XFER_UDMA_2) && (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER)) { -#ifndef CONFIG_IDEDMA_IVB - if ((drive->id->hw_config & 0x6000) == 0) { -#else /* !CONFIG_IDEDMA_IVB */ - if (((drive->id->hw_config & 0x2000) == 0) || - ((drive->id->hw_config & 0x4000) == 0)) { -#endif /* CONFIG_IDEDMA_IVB */ - printk("%s: Speed warnings UDMA 3/4/5 is not " - "functional.\n", drive->name); - return 1; - } - if (!HWIF(drive)->udma_four) { - printk("%s: Speed warnings UDMA 3/4/5 is not " - "functional.\n", - HWIF(drive)->name); + if (eighty_ninty_three(drive) == 0) { + printk(KERN_WARNING "%s: UDMA speeds >UDMA33 cannot " + "be set\n", drive->name); return 1; } } + return 0; } diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index 6871931..3be3c69 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c @@ -69,123 +69,41 @@ char *ide_xfer_verbose (u8 xfer_rate) EXPORT_SYMBOL(ide_xfer_verbose); /** - * ide_dma_speed - compute DMA speed - * @drive: drive - * @mode: modes available - * - * Checks the drive capabilities and returns the speed to use - * for the DMA transfer. Returns 0 if the drive is incapable - * of DMA transfers. - */ - -u8 ide_dma_speed(ide_drive_t *drive, u8 mode) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - u8 ultra_mask, mwdma_mask, swdma_mask; - u8 speed = 0; - - if (drive->media != ide_disk && hwif->atapi_dma == 0) - return 0; - - /* Capable of UltraDMA modes? */ - ultra_mask = id->dma_ultra & hwif->ultra_mask; - - if (!(id->field_valid & 4)) - mode = 0; /* fallback to MW/SW DMA if no UltraDMA */ - - switch (mode) { - case 4: - if (ultra_mask & 0x40) { - speed = XFER_UDMA_6; - break; - } - case 3: - if (ultra_mask & 0x20) { - speed = XFER_UDMA_5; - break; - } - case 2: - if (ultra_mask & 0x10) { - speed = XFER_UDMA_4; - break; - } - if (ultra_mask & 0x08) { - speed = XFER_UDMA_3; - break; - } - case 1: - if (ultra_mask & 0x04) { - speed = XFER_UDMA_2; - break; - } - if (ultra_mask & 0x02) { - speed = XFER_UDMA_1; - break; - } - if (ultra_mask & 0x01) { - speed = XFER_UDMA_0; - break; - } - case 0: - mwdma_mask = id->dma_mword & hwif->mwdma_mask; - - if (mwdma_mask & 0x04) { - speed = XFER_MW_DMA_2; - break; - } - if (mwdma_mask & 0x02) { - speed = XFER_MW_DMA_1; - break; - } - if (mwdma_mask & 0x01) { - speed = XFER_MW_DMA_0; - break; - } - - swdma_mask = id->dma_1word & hwif->swdma_mask; - - if (swdma_mask & 0x04) { - speed = XFER_SW_DMA_2; - break; - } - if (swdma_mask & 0x02) { - speed = XFER_SW_DMA_1; - break; - } - if (swdma_mask & 0x01) { - speed = XFER_SW_DMA_0; - break; - } - } - - return speed; -} -EXPORT_SYMBOL(ide_dma_speed); - - -/** - * ide_rate_filter - return best speed for mode - * @mode: modes available + * ide_rate_filter - filter transfer mode + * @drive: IDE device * @speed: desired speed * - * Given the available DMA/UDMA mode this function returns + * Given the available transfer modes this function returns * the best available speed at or below the speed requested. + * + * FIXME: filter also PIO/SWDMA/MWDMA modes */ -u8 ide_rate_filter (u8 mode, u8 speed) +u8 ide_rate_filter(ide_drive_t *drive, u8 speed) { #ifdef CONFIG_BLK_DEV_IDEDMA - static u8 speed_max[] = { - XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, - XFER_UDMA_5, XFER_UDMA_6 - }; + ide_hwif_t *hwif = drive->hwif; + u8 mask = hwif->ultra_mask, mode = XFER_MW_DMA_2; + + if (hwif->udma_filter) + mask = hwif->udma_filter(drive); + + /* + * TODO: speed > XFER_UDMA_2 extra check is needed to avoid false + * cable warning from eighty_ninty_three(), moving ide_rate_filter() + * calls from ->speedproc to core code will make this hack go away + */ + if (speed > XFER_UDMA_2) { + if ((mask & 0x78) && (eighty_ninty_three(drive) == 0)) + mask &= 0x07; + } + + if (mask) + mode = fls(mask) - 1 + XFER_UDMA_0; // printk("%s: mode 0x%02x, speed 0x%02x\n", __FUNCTION__, mode, speed); - /* So that we remember to update this if new modes appear */ - BUG_ON(mode > 4); - return min(speed, speed_max[mode]); + return min(speed, mode); #else /* !CONFIG_BLK_DEV_IDEDMA */ return min(speed, (u8)XFER_PIO_4); #endif /* CONFIG_BLK_DEV_IDEDMA */ diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c index 98410ca..2b8009c 100644 --- a/drivers/ide/ide-pnp.c +++ b/drivers/ide/ide-pnp.c @@ -42,7 +42,7 @@ static int idepnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id hw.irq = pnp_irq(dev, 0); hw.dma = NO_DMA; - index = ide_register_hw(&hw, &hwif); + index = ide_register_hw(&hw, 1, &hwif); if (index != -1) { printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index); diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 8f15c23..3cebed7 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -1427,6 +1427,9 @@ int ideprobe_init (void) } } } + for (index = 0; index < MAX_HWIFS; ++index) + if (probe[index]) + ide_proc_register_port(&ide_hwifs[index]); return 0; } diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index a9e0b30..d50bd99 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c @@ -3,6 +3,8 @@ * * Copyright (C) 1997-1998 Mark Lord * Copyright (C) 2003 Red Hat <alan@redhat.com> + * + * Some code was moved here from ide.c, see it for original copyrights. */ /* @@ -37,6 +39,8 @@ #include <asm/io.h> +static struct proc_dir_entry *proc_ide_root; + static int proc_ide_read_imodel (char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -121,6 +125,265 @@ static int proc_ide_read_identify PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } +/** + * __ide_add_setting - add an ide setting option + * @drive: drive to use + * @name: setting name + * @rw: true if the function is read write + * @data_type: type of data + * @min: range minimum + * @max: range maximum + * @mul_factor: multiplication scale + * @div_factor: divison scale + * @data: private data field + * @set: setting + * @auto_remove: setting auto removal flag + * + * Removes the setting named from the device if it is present. + * The function takes the settings_lock to protect against + * parallel changes. This function must not be called from IRQ + * context. Returns 0 on success or -1 on failure. + * + * BUGS: This code is seriously over-engineered. There is also + * magic about how the driver specific features are setup. If + * a driver is attached we assume the driver settings are auto + * remove. + */ + +static int __ide_add_setting(ide_drive_t *drive, const char *name, int rw, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set, int auto_remove) +{ + ide_settings_t **p = (ide_settings_t **) &drive->settings, *setting = NULL; + + down(&ide_setting_sem); + while ((*p) && strcmp((*p)->name, name) < 0) + p = &((*p)->next); + if ((setting = kzalloc(sizeof(*setting), GFP_KERNEL)) == NULL) + goto abort; + if ((setting->name = kmalloc(strlen(name) + 1, GFP_KERNEL)) == NULL) + goto abort; + strcpy(setting->name, name); + setting->rw = rw; + setting->data_type = data_type; + setting->min = min; + setting->max = max; + setting->mul_factor = mul_factor; + setting->div_factor = div_factor; + setting->data = data; + setting->set = set; + + setting->next = *p; + if (auto_remove) + setting->auto_remove = 1; + *p = setting; + up(&ide_setting_sem); + return 0; +abort: + up(&ide_setting_sem); + kfree(setting); + return -1; +} + +int ide_add_setting(ide_drive_t *drive, const char *name, int rw, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set) +{ + return __ide_add_setting(drive, name, rw, data_type, min, max, mul_factor, div_factor, data, set, 1); +} + +EXPORT_SYMBOL(ide_add_setting); + +/** + * __ide_remove_setting - remove an ide setting option + * @drive: drive to use + * @name: setting name + * + * Removes the setting named from the device if it is present. + * The caller must hold the setting semaphore. + */ + +static void __ide_remove_setting (ide_drive_t *drive, char *name) +{ + ide_settings_t **p, *setting; + + p = (ide_settings_t **) &drive->settings; + + while ((*p) && strcmp((*p)->name, name)) + p = &((*p)->next); + if ((setting = (*p)) == NULL) + return; + + (*p) = setting->next; + + kfree(setting->name); + kfree(setting); +} + +/** + * auto_remove_settings - remove driver specific settings + * @drive: drive + * + * Automatically remove all the driver specific settings for this + * drive. This function may not be called from IRQ context. The + * caller must hold ide_setting_sem. + */ + +static void auto_remove_settings (ide_drive_t *drive) +{ + ide_settings_t *setting; +repeat: + setting = drive->settings; + while (setting) { + if (setting->auto_remove) { + __ide_remove_setting(drive, setting->name); + goto repeat; + } + setting = setting->next; + } +} + +/** + * ide_find_setting_by_name - find a drive specific setting + * @drive: drive to scan + * @name: setting name + * + * Scan's the device setting table for a matching entry and returns + * this or NULL if no entry is found. The caller must hold the + * setting semaphore + */ + +static ide_settings_t *ide_find_setting_by_name(ide_drive_t *drive, char *name) +{ + ide_settings_t *setting = drive->settings; + + while (setting) { + if (strcmp(setting->name, name) == 0) + break; + setting = setting->next; + } + return setting; +} + +/** + * ide_read_setting - read an IDE setting + * @drive: drive to read from + * @setting: drive setting + * + * Read a drive setting and return the value. The caller + * must hold the ide_setting_sem when making this call. + * + * BUGS: the data return and error are the same return value + * so an error -EINVAL and true return of the same value cannot + * be told apart + */ + +static int ide_read_setting(ide_drive_t *drive, ide_settings_t *setting) +{ + int val = -EINVAL; + unsigned long flags; + + if ((setting->rw & SETTING_READ)) { + spin_lock_irqsave(&ide_lock, flags); + switch(setting->data_type) { + case TYPE_BYTE: + val = *((u8 *) setting->data); + break; + case TYPE_SHORT: + val = *((u16 *) setting->data); + break; + case TYPE_INT: + val = *((u32 *) setting->data); + break; + } + spin_unlock_irqrestore(&ide_lock, flags); + } + return val; +} + +/** + * ide_write_setting - read an IDE setting + * @drive: drive to read from + * @setting: drive setting + * @val: value + * + * Write a drive setting if it is possible. The caller + * must hold the ide_setting_sem when making this call. + * + * BUGS: the data return and error are the same return value + * so an error -EINVAL and true return of the same value cannot + * be told apart + * + * FIXME: This should be changed to enqueue a special request + * to the driver to change settings, and then wait on a sema for completion. + * The current scheme of polling is kludgy, though safe enough. + */ + +static int ide_write_setting(ide_drive_t *drive, ide_settings_t *setting, int val) +{ + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + if (setting->set) + return setting->set(drive, val); + if (!(setting->rw & SETTING_WRITE)) + return -EPERM; + if (val < setting->min || val > setting->max) + return -EINVAL; + if (ide_spin_wait_hwgroup(drive)) + return -EBUSY; + switch (setting->data_type) { + case TYPE_BYTE: + *((u8 *) setting->data) = val; + break; + case TYPE_SHORT: + *((u16 *) setting->data) = val; + break; + case TYPE_INT: + *((u32 *) setting->data) = val; + break; + } + spin_unlock_irq(&ide_lock); + return 0; +} + +static int set_xfer_rate (ide_drive_t *drive, int arg) +{ + int err; + + if (arg < 0 || arg > 70) + return -EINVAL; + + err = ide_wait_cmd(drive, + WIN_SETFEATURES, (u8) arg, + SETFEATURES_XFER, 0, NULL); + + if (!err && arg) { + ide_set_xfer_rate(drive, (u8) arg); + ide_driveid_update(drive); + } + return err; +} + +/** + * ide_add_generic_settings - generic ide settings + * @drive: drive being configured + * + * Add the generic parts of the system settings to the /proc files. + * The caller must not be holding the ide_setting_sem. + */ + +void ide_add_generic_settings (ide_drive_t *drive) +{ +/* + * drive setting name read/write access data type min max mul_factor div_factor data pointer set function + */ + __ide_add_setting(drive, "io_32bit", drive->no_io_32bit ? SETTING_READ : SETTING_RW, TYPE_BYTE, 0, 1 + (SUPPORT_VLB_SYNC << 1), 1, 1, &drive->io_32bit, set_io_32bit, 0); + __ide_add_setting(drive, "keepsettings", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->keep_settings, NULL, 0); + __ide_add_setting(drive, "nice1", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->nice1, NULL, 0); + __ide_add_setting(drive, "pio_mode", SETTING_WRITE, TYPE_BYTE, 0, 255, 1, 1, NULL, set_pio_mode, 0); + __ide_add_setting(drive, "unmaskirq", drive->no_unmask ? SETTING_READ : SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->unmask, NULL, 0); + __ide_add_setting(drive, "using_dma", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->using_dma, set_using_dma, 0); + __ide_add_setting(drive, "init_speed", SETTING_RW, TYPE_BYTE, 0, 70, 1, 1, &drive->init_speed, NULL, 0); + __ide_add_setting(drive, "current_speed", SETTING_RW, TYPE_BYTE, 0, 70, 1, 1, &drive->current_speed, set_xfer_rate, 0); + __ide_add_setting(drive, "number", SETTING_RW, TYPE_BYTE, 0, 3, 1, 1, &drive->dn, NULL, 0); +} + static void proc_ide_settings_warn(void) { static int warned = 0; @@ -399,7 +662,7 @@ static ide_proc_entry_t generic_drive_entries[] = { { NULL, 0, NULL, NULL } }; -void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void *data) +static void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void *data) { struct proc_dir_entry *ent; @@ -415,7 +678,7 @@ void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void } } -void ide_remove_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p) +static void ide_remove_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p) { if (!dir || !p) return; @@ -425,6 +688,51 @@ void ide_remove_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p) } } +void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) +{ + ide_add_proc_entries(drive->proc, driver->proc, drive); +} + +EXPORT_SYMBOL(ide_proc_register_driver); + +/** + * ide_proc_unregister_driver - remove driver specific data + * @drive: drive + * @driver: driver + * + * Clean up the driver specific /proc files and IDE settings + * for a given drive. + * + * Takes ide_setting_sem and ide_lock. + * Caller must hold none of the locks. + */ + +void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) +{ + unsigned long flags; + + ide_remove_proc_entries(drive->proc, driver->proc); + + down(&ide_setting_sem); + spin_lock_irqsave(&ide_lock, flags); + /* + * ide_setting_sem protects the settings list + * ide_lock protects the use of settings + * + * so we need to hold both, ide_settings_sem because we want to + * modify the settings list, and ide_lock because we cannot take + * a setting out that is being used. + * + * OTOH both ide_{read,write}_setting are only ever used under + * ide_setting_sem. + */ + auto_remove_settings(drive); + spin_unlock_irqrestore(&ide_lock, flags); + up(&ide_setting_sem); +} + +EXPORT_SYMBOL(ide_proc_unregister_driver); + static void create_proc_ide_drives(ide_hwif_t *hwif) { int d; @@ -477,26 +785,24 @@ static ide_proc_entry_t hwif_entries[] = { { NULL, 0, NULL, NULL } }; -void create_proc_ide_interfaces(void) +void ide_proc_register_port(ide_hwif_t *hwif) { - int h; + if (!hwif->present) + return; - for (h = 0; h < MAX_HWIFS; h++) { - ide_hwif_t *hwif = &ide_hwifs[h]; + if (!hwif->proc) { + hwif->proc = proc_mkdir(hwif->name, proc_ide_root); - if (!hwif->present) - continue; - if (!hwif->proc) { - hwif->proc = proc_mkdir(hwif->name, proc_ide_root); - if (!hwif->proc) - return; - ide_add_proc_entries(hwif->proc, hwif_entries, hwif); - } - create_proc_ide_drives(hwif); + if (!hwif->proc) + return; + + ide_add_proc_entries(hwif->proc, hwif_entries, hwif); } + + create_proc_ide_drives(hwif); } -EXPORT_SYMBOL(create_proc_ide_interfaces); +EXPORT_SYMBOL_GPL(ide_proc_register_port); #ifdef CONFIG_BLK_DEV_IDEPCI void ide_pci_create_host_proc(const char *name, get_info_t *get_info) @@ -507,7 +813,7 @@ void ide_pci_create_host_proc(const char *name, get_info_t *get_info) EXPORT_SYMBOL_GPL(ide_pci_create_host_proc); #endif -void destroy_proc_ide_interface(ide_hwif_t *hwif) +void ide_proc_unregister_port(ide_hwif_t *hwif) { if (hwif->proc) { destroy_proc_ide_drives(hwif); @@ -554,11 +860,11 @@ void proc_ide_create(void) { struct proc_dir_entry *entry; + proc_ide_root = proc_mkdir("ide", NULL); + if (!proc_ide_root) return; - create_proc_ide_interfaces(); - entry = create_proc_entry("drivers", 0, proc_ide_root); if (entry) entry->proc_fops = &ide_drivers_operations; diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 4e59239..e82bfa5 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@ -4561,28 +4561,33 @@ static void idetape_get_blocksize_from_block_descriptor(ide_drive_t *drive) printk(KERN_INFO "ide-tape: Adjusted block size - %d\n", tape->tape_block_size); #endif /* IDETAPE_DEBUG_INFO */ } + +#ifdef CONFIG_IDE_PROC_FS static void idetape_add_settings (ide_drive_t *drive) { idetape_tape_t *tape = drive->driver_data; /* - * drive setting name read/write ioctl ioctl data type min max mul_factor div_factor data pointer set function + * drive setting name read/write data type min max mul_factor div_factor data pointer set function */ - ide_add_setting(drive, "buffer", SETTING_READ, -1, -1, TYPE_SHORT, 0, 0xffff, 1, 2, &tape->capabilities.buffer_size, NULL); - ide_add_setting(drive, "pipeline_min", SETTING_RW, -1, -1, TYPE_INT, 1, 0xffff, tape->stage_size / 1024, 1, &tape->min_pipeline, NULL); - ide_add_setting(drive, "pipeline", SETTING_RW, -1, -1, TYPE_INT, 1, 0xffff, tape->stage_size / 1024, 1, &tape->max_stages, NULL); - ide_add_setting(drive, "pipeline_max", SETTING_RW, -1, -1, TYPE_INT, 1, 0xffff, tape->stage_size / 1024, 1, &tape->max_pipeline, NULL); - ide_add_setting(drive, "pipeline_used",SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, tape->stage_size / 1024, 1, &tape->nr_stages, NULL); - ide_add_setting(drive, "pipeline_pending",SETTING_READ,-1, -1, TYPE_INT, 0, 0xffff, tape->stage_size / 1024, 1, &tape->nr_pending_stages, NULL); - ide_add_setting(drive, "speed", SETTING_READ, -1, -1, TYPE_SHORT, 0, 0xffff, 1, 1, &tape->capabilities.speed, NULL); - ide_add_setting(drive, "stage", SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1024, &tape->stage_size, NULL); - ide_add_setting(drive, "tdsc", SETTING_RW, -1, -1, TYPE_INT, IDETAPE_DSC_RW_MIN, IDETAPE_DSC_RW_MAX, 1000, HZ, &tape->best_dsc_rw_frequency, NULL); - ide_add_setting(drive, "dsc_overlap", SETTING_RW, -1, -1, TYPE_BYTE, 0, 1, 1, 1, &drive->dsc_overlap, NULL); - ide_add_setting(drive, "pipeline_head_speed_c",SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->controlled_pipeline_head_speed, NULL); - ide_add_setting(drive, "pipeline_head_speed_u",SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->uncontrolled_pipeline_head_speed, NULL); - ide_add_setting(drive, "avg_speed", SETTING_READ, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->avg_speed, NULL); - ide_add_setting(drive, "debug_level",SETTING_RW, -1, -1, TYPE_INT, 0, 0xffff, 1, 1, &tape->debug_level, NULL); + ide_add_setting(drive, "buffer", SETTING_READ, TYPE_SHORT, 0, 0xffff, 1, 2, &tape->capabilities.buffer_size, NULL); + ide_add_setting(drive, "pipeline_min", SETTING_RW, TYPE_INT, 1, 0xffff, tape->stage_size / 1024, 1, &tape->min_pipeline, NULL); + ide_add_setting(drive, "pipeline", SETTING_RW, TYPE_INT, 1, 0xffff, tape->stage_size / 1024, 1, &tape->max_stages, NULL); + ide_add_setting(drive, "pipeline_max", SETTING_RW, TYPE_INT, 1, 0xffff, tape->stage_size / 1024, 1, &tape->max_pipeline, NULL); + ide_add_setting(drive, "pipeline_used", SETTING_READ, TYPE_INT, 0, 0xffff, tape->stage_size / 1024, 1, &tape->nr_stages, NULL); + ide_add_setting(drive, "pipeline_pending", SETTING_READ, TYPE_INT, 0, 0xffff, tape->stage_size / 1024, 1, &tape->nr_pending_stages, NULL); + ide_add_setting(drive, "speed", SETTING_READ, TYPE_SHORT, 0, 0xffff, 1, 1, &tape->capabilities.speed, NULL); + ide_add_setting(drive, "stage", SETTING_READ, TYPE_INT, 0, 0xffff, 1, 1024, &tape->stage_size, NULL); + ide_add_setting(drive, "tdsc", SETTING_RW, TYPE_INT, IDETAPE_DSC_RW_MIN, IDETAPE_DSC_RW_MAX, 1000, HZ, &tape->best_dsc_rw_frequency, NULL); + ide_add_setting(drive, "dsc_overlap", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->dsc_overlap, NULL); + ide_add_setting(drive, "pipeline_head_speed_c",SETTING_READ, TYPE_INT, 0, 0xffff, 1, 1, &tape->controlled_pipeline_head_speed, NULL); + ide_add_setting(drive, "pipeline_head_speed_u",SETTING_READ, TYPE_INT, 0, 0xffff, 1, 1, &tape->uncontrolled_pipeline_head_speed,NULL); + ide_add_setting(drive, "avg_speed", SETTING_READ, TYPE_INT, 0, 0xffff, 1, 1, &tape->avg_speed, NULL); + ide_add_setting(drive, "debug_level", SETTING_RW, TYPE_INT, 0, 0xffff, 1, 1, &tape->debug_level, NULL); } +#else +static inline void idetape_add_settings(ide_drive_t *drive) { ; } +#endif /* * ide_setup is called to: @@ -4703,7 +4708,7 @@ static void ide_tape_remove(ide_drive_t *drive) { idetape_tape_t *tape = drive->driver_data; - ide_unregister_subdriver(drive, tape->driver); + ide_proc_unregister_driver(drive, tape->driver); ide_unregister_region(tape->disk); @@ -4730,8 +4735,7 @@ static void ide_tape_release(struct kref *kref) kfree(tape); } -#ifdef CONFIG_PROC_FS - +#ifdef CONFIG_IDE_PROC_FS static int proc_idetape_read_name (char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -4749,11 +4753,6 @@ static ide_proc_entry_t idetape_proc[] = { { "name", S_IFREG|S_IRUGO, proc_idetape_read_name, NULL }, { NULL, 0, NULL, NULL } }; - -#else - -#define idetape_proc NULL - #endif static int ide_tape_probe(ide_drive_t *); @@ -4773,7 +4772,9 @@ static ide_driver_t idetape_driver = { .end_request = idetape_end_request, .error = __ide_error, .abort = __ide_abort, +#ifdef CONFIG_IDE_PROC_FS .proc = idetape_proc, +#endif }; /* @@ -4864,7 +4865,7 @@ static int ide_tape_probe(ide_drive_t *drive) ide_init_disk(g, drive); - ide_register_subdriver(drive, &idetape_driver); + ide_proc_register_driver(drive, &idetape_driver); kref_init(&tape->kref); diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index ae5bf2b..f2b547f 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -168,12 +168,11 @@ static const u8 ide_hwif_to_major[] = { IDE0_MAJOR, IDE1_MAJOR, static int idebus_parameter; /* holds the "idebus=" parameter */ static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */ -static int initializing; /* set while initializing built-in drivers */ DECLARE_MUTEX(ide_cfg_sem); __cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock); -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_IDEPCI_PCIBUS_ORDER static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ #endif @@ -216,9 +215,6 @@ static void init_hwif_data(ide_hwif_t *hwif, unsigned int index) hwif->bus_state = BUSSTATE_ON; hwif->atapi_dma = 0; /* disable all atapi dma */ - hwif->ultra_mask = 0x80; /* disable all ultra */ - hwif->mwdma_mask = 0x80; /* disable all mwdma */ - hwif->swdma_mask = 0x80; /* disable all swdma */ init_completion(&hwif->gendev_rel_comp); @@ -305,9 +301,7 @@ static void __init init_ide_data (void) #endif } #ifdef CONFIG_IDE_ARM - initializing = 1; ide_arm_init(); - initializing = 0; #endif } @@ -353,10 +347,6 @@ static int ide_system_bus_speed(void) return system_bus_speed; } -#ifdef CONFIG_PROC_FS -struct proc_dir_entry *proc_ide_root; -#endif - static struct resource* hwif_request_region(ide_hwif_t *hwif, unsigned long addr, int num) { @@ -480,6 +470,7 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif) hwif->tuneproc = tmp_hwif->tuneproc; hwif->speedproc = tmp_hwif->speedproc; + hwif->udma_filter = tmp_hwif->udma_filter; hwif->selectproc = tmp_hwif->selectproc; hwif->reset_poll = tmp_hwif->reset_poll; hwif->pre_reset = tmp_hwif->pre_reset; @@ -599,7 +590,7 @@ void ide_unregister(unsigned int index) spin_unlock_irq(&ide_lock); - destroy_proc_ide_interface(hwif); + ide_proc_unregister_port(hwif); hwgroup = hwif->hwgroup; /* @@ -751,6 +742,7 @@ void ide_setup_ports ( hw_regs_t *hw, /** * ide_register_hw_with_fixup - register IDE interface * @hw: hardware registers + * @initializing: set while initializing built-in drivers * @hwifp: pointer to returned hwif * @fixup: fixup function * @@ -760,7 +752,9 @@ void ide_setup_ports ( hw_regs_t *hw, * Returns -1 on error. */ -int ide_register_hw_with_fixup(hw_regs_t *hw, ide_hwif_t **hwifp, void(*fixup)(ide_hwif_t *hwif)) +int ide_register_hw_with_fixup(hw_regs_t *hw, int initializing, + ide_hwif_t **hwifp, + void(*fixup)(ide_hwif_t *hwif)) { int index, retry = 1; ide_hwif_t *hwif; @@ -801,7 +795,7 @@ found: if (!initializing) { probe_hwif_init_with_fixup(hwif, fixup); - create_proc_ide_interfaces(); + ide_proc_register_port(hwif); } if (hwifp) @@ -812,9 +806,9 @@ found: EXPORT_SYMBOL(ide_register_hw_with_fixup); -int ide_register_hw(hw_regs_t *hw, ide_hwif_t **hwifp) +int ide_register_hw(hw_regs_t *hw, int initializing, ide_hwif_t **hwifp) { - return ide_register_hw_with_fixup(hw, hwifp, NULL); + return ide_register_hw_with_fixup(hw, initializing, hwifp, NULL); } EXPORT_SYMBOL(ide_register_hw); @@ -825,205 +819,7 @@ EXPORT_SYMBOL(ide_register_hw); DECLARE_MUTEX(ide_setting_sem); -/** - * __ide_add_setting - add an ide setting option - * @drive: drive to use - * @name: setting name - * @rw: true if the function is read write - * @read_ioctl: function to call on read - * @write_ioctl: function to call on write - * @data_type: type of data - * @min: range minimum - * @max: range maximum - * @mul_factor: multiplication scale - * @div_factor: divison scale - * @data: private data field - * @set: setting - * @auto_remove: setting auto removal flag - * - * Removes the setting named from the device if it is present. - * The function takes the settings_lock to protect against - * parallel changes. This function must not be called from IRQ - * context. Returns 0 on success or -1 on failure. - * - * BUGS: This code is seriously over-engineered. There is also - * magic about how the driver specific features are setup. If - * a driver is attached we assume the driver settings are auto - * remove. - */ - -static int __ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set, int auto_remove) -{ - ide_settings_t **p = (ide_settings_t **) &drive->settings, *setting = NULL; - - down(&ide_setting_sem); - while ((*p) && strcmp((*p)->name, name) < 0) - p = &((*p)->next); - if ((setting = kzalloc(sizeof(*setting), GFP_KERNEL)) == NULL) - goto abort; - if ((setting->name = kmalloc(strlen(name) + 1, GFP_KERNEL)) == NULL) - goto abort; - strcpy(setting->name, name); - setting->rw = rw; - setting->read_ioctl = read_ioctl; - setting->write_ioctl = write_ioctl; - setting->data_type = data_type; - setting->min = min; - setting->max = max; - setting->mul_factor = mul_factor; - setting->div_factor = div_factor; - setting->data = data; - setting->set = set; - - setting->next = *p; - if (auto_remove) - setting->auto_remove = 1; - *p = setting; - up(&ide_setting_sem); - return 0; -abort: - up(&ide_setting_sem); - kfree(setting); - return -1; -} - -int ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set) -{ - return __ide_add_setting(drive, name, rw, read_ioctl, write_ioctl, data_type, min, max, mul_factor, div_factor, data, set, 1); -} - -EXPORT_SYMBOL(ide_add_setting); - -/** - * __ide_remove_setting - remove an ide setting option - * @drive: drive to use - * @name: setting name - * - * Removes the setting named from the device if it is present. - * The caller must hold the setting semaphore. - */ - -static void __ide_remove_setting (ide_drive_t *drive, char *name) -{ - ide_settings_t **p, *setting; - - p = (ide_settings_t **) &drive->settings; - - while ((*p) && strcmp((*p)->name, name)) - p = &((*p)->next); - if ((setting = (*p)) == NULL) - return; - - (*p) = setting->next; - - kfree(setting->name); - kfree(setting); -} - -/** - * ide_find_setting_by_ioctl - find a drive specific ioctl - * @drive: drive to scan - * @cmd: ioctl command to handle - * - * Scan's the device setting table for a matching entry and returns - * this or NULL if no entry is found. The caller must hold the - * setting semaphore - */ - -static ide_settings_t *ide_find_setting_by_ioctl (ide_drive_t *drive, int cmd) -{ - ide_settings_t *setting = drive->settings; - - while (setting) { - if (setting->read_ioctl == cmd || setting->write_ioctl == cmd) - break; - setting = setting->next; - } - - return setting; -} - -/** - * ide_find_setting_by_name - find a drive specific setting - * @drive: drive to scan - * @name: setting name - * - * Scan's the device setting table for a matching entry and returns - * this or NULL if no entry is found. The caller must hold the - * setting semaphore - */ - -ide_settings_t *ide_find_setting_by_name (ide_drive_t *drive, char *name) -{ - ide_settings_t *setting = drive->settings; - - while (setting) { - if (strcmp(setting->name, name) == 0) - break; - setting = setting->next; - } - return setting; -} - -/** - * auto_remove_settings - remove driver specific settings - * @drive: drive - * - * Automatically remove all the driver specific settings for this - * drive. This function may not be called from IRQ context. The - * caller must hold ide_setting_sem. - */ - -static void auto_remove_settings (ide_drive_t *drive) -{ - ide_settings_t *setting; -repeat: - setting = drive->settings; - while (setting) { - if (setting->auto_remove) { - __ide_remove_setting(drive, setting->name); - goto repeat; - } - setting = setting->next; - } -} - -/** - * ide_read_setting - read an IDE setting - * @drive: drive to read from - * @setting: drive setting - * - * Read a drive setting and return the value. The caller - * must hold the ide_setting_sem when making this call. - * - * BUGS: the data return and error are the same return value - * so an error -EINVAL and true return of the same value cannot - * be told apart - */ - -int ide_read_setting (ide_drive_t *drive, ide_settings_t *setting) -{ - int val = -EINVAL; - unsigned long flags; - - if ((setting->rw & SETTING_READ)) { - spin_lock_irqsave(&ide_lock, flags); - switch(setting->data_type) { - case TYPE_BYTE: - val = *((u8 *) setting->data); - break; - case TYPE_SHORT: - val = *((u16 *) setting->data); - break; - case TYPE_INT: - case TYPE_INTA: - val = *((u32 *) setting->data); - break; - } - spin_unlock_irqrestore(&ide_lock, flags); - } - return val; -} +EXPORT_SYMBOL_GPL(ide_setting_sem); /** * ide_spin_wait_hwgroup - wait for group @@ -1058,61 +854,14 @@ int ide_spin_wait_hwgroup (ide_drive_t *drive) EXPORT_SYMBOL(ide_spin_wait_hwgroup); -/** - * ide_write_setting - read an IDE setting - * @drive: drive to read from - * @setting: drive setting - * @val: value - * - * Write a drive setting if it is possible. The caller - * must hold the ide_setting_sem when making this call. - * - * BUGS: the data return and error are the same return value - * so an error -EINVAL and true return of the same value cannot - * be told apart - * - * FIXME: This should be changed to enqueue a special request - * to the driver to change settings, and then wait on a sema for completion. - * The current scheme of polling is kludgy, though safe enough. - */ - -int ide_write_setting (ide_drive_t *drive, ide_settings_t *setting, int val) +int set_io_32bit(ide_drive_t *drive, int arg) { - int i; - u32 *p; - - if (!capable(CAP_SYS_ADMIN)) - return -EACCES; - if (!(setting->rw & SETTING_WRITE)) + if (drive->no_io_32bit) return -EPERM; - if (val < setting->min || val > setting->max) + + if (arg < 0 || arg > 1 + (SUPPORT_VLB_SYNC << 1)) return -EINVAL; - if (setting->set) - return setting->set(drive, val); - if (ide_spin_wait_hwgroup(drive)) - return -EBUSY; - switch (setting->data_type) { - case TYPE_BYTE: - *((u8 *) setting->data) = val; - break; - case TYPE_SHORT: - *((u16 *) setting->data) = val; - break; - case TYPE_INT: - *((u32 *) setting->data) = val; - break; - case TYPE_INTA: - p = (u32 *) setting->data; - for (i = 0; i < 1 << PARTN_BITS; i++, p++) - *p = val; - break; - } - spin_unlock_irq(&ide_lock); - return 0; -} -static int set_io_32bit(ide_drive_t *drive, int arg) -{ drive->io_32bit = arg; #ifdef CONFIG_BLK_DEV_DTC2278 if (HWIF(drive)->chipset == ide_dtc2278) @@ -1121,12 +870,28 @@ static int set_io_32bit(ide_drive_t *drive, int arg) return 0; } -static int set_using_dma (ide_drive_t *drive, int arg) +static int set_ksettings(ide_drive_t *drive, int arg) +{ + if (arg < 0 || arg > 1) + return -EINVAL; + + if (ide_spin_wait_hwgroup(drive)) + return -EBUSY; + drive->keep_settings = arg; + spin_unlock_irq(&ide_lock); + + return 0; +} + +int set_using_dma(ide_drive_t *drive, int arg) { #ifdef CONFIG_BLK_DEV_IDEDMA ide_hwif_t *hwif = drive->hwif; int err = -EPERM; + if (arg < 0 || arg > 1) + return -EINVAL; + if (!drive->id || !(drive->id->capability & 1)) goto out; @@ -1159,14 +924,20 @@ static int set_using_dma (ide_drive_t *drive, int arg) out: return err; #else + if (arg < 0 || arg > 1) + return -EINVAL; + return -EPERM; #endif } -static int set_pio_mode (ide_drive_t *drive, int arg) +int set_pio_mode(ide_drive_t *drive, int arg) { struct request rq; + if (arg < 0 || arg > 255) + return -EINVAL; + if (!HWIF(drive)->tuneproc) return -ENOSYS; if (drive->special.b.set_tune) @@ -1178,42 +949,20 @@ static int set_pio_mode (ide_drive_t *drive, int arg) return 0; } -static int set_xfer_rate (ide_drive_t *drive, int arg) +static int set_unmaskirq(ide_drive_t *drive, int arg) { - int err = ide_wait_cmd(drive, - WIN_SETFEATURES, (u8) arg, - SETFEATURES_XFER, 0, NULL); + if (drive->no_unmask) + return -EPERM; - if (!err && arg) { - ide_set_xfer_rate(drive, (u8) arg); - ide_driveid_update(drive); - } - return err; -} + if (arg < 0 || arg > 1) + return -EINVAL; -/** - * ide_add_generic_settings - generic ide settings - * @drive: drive being configured - * - * Add the generic parts of the system settings to the /proc files and - * ioctls for this IDE device. The caller must not be holding the - * ide_setting_sem. - */ + if (ide_spin_wait_hwgroup(drive)) + return -EBUSY; + drive->unmask = arg; + spin_unlock_irq(&ide_lock); -void ide_add_generic_settings (ide_drive_t *drive) -{ -/* - * drive setting name read/write access read ioctl write ioctl data type min max mul_factor div_factor data pointer set function - */ - __ide_add_setting(drive, "io_32bit", drive->no_io_32bit ? SETTING_READ : SETTING_RW, HDIO_GET_32BIT, HDIO_SET_32BIT, TYPE_BYTE, 0, 1 + (SUPPORT_VLB_SYNC << 1), 1, 1, &drive->io_32bit, set_io_32bit, 0); - __ide_add_setting(drive, "keepsettings", SETTING_RW, HDIO_GET_KEEPSETTINGS, HDIO_SET_KEEPSETTINGS, TYPE_BYTE, 0, 1, 1, 1, &drive->keep_settings, NULL, 0); - __ide_add_setting(drive, "nice1", SETTING_RW, -1, -1, TYPE_BYTE, 0, 1, 1, 1, &drive->nice1, NULL, 0); - __ide_add_setting(drive, "pio_mode", SETTING_WRITE, -1, HDIO_SET_PIO_MODE, TYPE_BYTE, 0, 255, 1, 1, NULL, set_pio_mode, 0); - __ide_add_setting(drive, "unmaskirq", drive->no_unmask ? SETTING_READ : SETTING_RW, HDIO_GET_UNMASKINTR, HDIO_SET_UNMASKINTR, TYPE_BYTE, 0, 1, 1, 1, &drive->unmask, NULL, 0); - __ide_add_setting(drive, "using_dma", SETTING_RW, HDIO_GET_DMA, HDIO_SET_DMA, TYPE_BYTE, 0, 1, 1, 1, &drive->using_dma, set_using_dma, 0); - __ide_add_setting(drive, "init_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->init_speed, NULL, 0); - __ide_add_setting(drive, "current_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->current_speed, set_xfer_rate, 0); - __ide_add_setting(drive, "number", SETTING_RW, -1, -1, TYPE_BYTE, 0, 3, 1, 1, &drive->dn, NULL, 0); + return 0; } /** @@ -1285,27 +1034,23 @@ static int generic_ide_resume(struct device *dev) int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device *bdev, unsigned int cmd, unsigned long arg) { - ide_settings_t *setting; + unsigned long flags; ide_driver_t *drv; - int err = 0; void __user *p = (void __user *)arg; + int err = 0, (*setfunc)(ide_drive_t *, int); + u8 *val; - down(&ide_setting_sem); - if ((setting = ide_find_setting_by_ioctl(drive, cmd)) != NULL) { - if (cmd == setting->read_ioctl) { - err = ide_read_setting(drive, setting); - up(&ide_setting_sem); - return err >= 0 ? put_user(err, (long __user *)arg) : err; - } else { - if (bdev != bdev->bd_contains) - err = -EINVAL; - else - err = ide_write_setting(drive, setting, arg); - up(&ide_setting_sem); - return err; - } + switch (cmd) { + case HDIO_GET_32BIT: val = &drive->io_32bit; goto read_val; + case HDIO_GET_KEEPSETTINGS: val = &drive->keep_settings; goto read_val; + case HDIO_GET_UNMASKINTR: val = &drive->unmask; goto read_val; + case HDIO_GET_DMA: val = &drive->using_dma; goto read_val; + case HDIO_SET_32BIT: setfunc = set_io_32bit; goto set_val; + case HDIO_SET_KEEPSETTINGS: setfunc = set_ksettings; goto set_val; + case HDIO_SET_PIO_MODE: setfunc = set_pio_mode; goto set_val; + case HDIO_SET_UNMASKINTR: setfunc = set_unmaskirq; goto set_val; + case HDIO_SET_DMA: setfunc = set_using_dma; goto set_val; } - up(&ide_setting_sem); switch (cmd) { case HDIO_OBSOLETE_IDENTITY: @@ -1359,7 +1104,7 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device ide_init_hwif_ports(&hw, (unsigned long) args[0], (unsigned long) args[1], NULL); hw.irq = args[2]; - if (ide_register_hw(&hw, NULL) == -1) + if (ide_register_hw(&hw, 0, NULL) == -1) return -EIO; return 0; } @@ -1434,6 +1179,28 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device default: return -EINVAL; } + +read_val: + down(&ide_setting_sem); + spin_lock_irqsave(&ide_lock, flags); + err = *val; + spin_unlock_irqrestore(&ide_lock, flags); + up(&ide_setting_sem); + return err >= 0 ? put_user(err, (long __user *)arg) : err; + +set_val: + if (bdev != bdev->bd_contains) + err = -EINVAL; + else { + if (!capable(CAP_SYS_ADMIN)) + err = -EACCES; + else { + down(&ide_setting_sem); + err = setfunc(drive, arg); + up(&ide_setting_sem); + } + } + return err; } EXPORT_SYMBOL(generic_ide_ioctl); @@ -1566,13 +1333,13 @@ static int __init ide_setup(char *s) return 1; } -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_IDEPCI_PCIBUS_ORDER if (!strcmp(s, "ide=reverse")) { ide_scan_direction = 1; printk(" : Enabled support for IDE inverse scan order.\n"); return 1; } -#endif /* CONFIG_BLK_DEV_IDEPCI */ +#endif #ifdef CONFIG_BLK_DEV_IDEACPI if (!strcmp(s, "ide=noacpi")) { @@ -1832,9 +1599,9 @@ extern void __init h8300_ide_init(void); */ static void __init probe_for_hwifs (void) { -#ifdef CONFIG_BLK_DEV_IDEPCI +#ifdef CONFIG_IDEPCI_PCIBUS_ORDER ide_scan_pcibus(ide_scan_direction); -#endif /* CONFIG_BLK_DEV_IDEPCI */ +#endif #ifdef CONFIG_ETRAX_IDE { @@ -1892,54 +1659,6 @@ static void __init probe_for_hwifs (void) #endif } -void ide_register_subdriver(ide_drive_t *drive, ide_driver_t *driver) -{ -#ifdef CONFIG_PROC_FS - ide_add_proc_entries(drive->proc, driver->proc, drive); -#endif -} - -EXPORT_SYMBOL(ide_register_subdriver); - -/** - * ide_unregister_subdriver - disconnect drive from driver - * @drive: drive to unplug - * @driver: driver - * - * Disconnect a drive from the driver it was attached to and then - * clean up the various proc files and other objects attached to it. - * - * Takes ide_setting_sem and ide_lock. - * Caller must hold none of the locks. - */ - -void ide_unregister_subdriver(ide_drive_t *drive, ide_driver_t *driver) -{ - unsigned long flags; - -#ifdef CONFIG_PROC_FS - ide_remove_proc_entries(drive->proc, driver->proc); -#endif - down(&ide_setting_sem); - spin_lock_irqsave(&ide_lock, flags); - /* - * ide_setting_sem protects the settings list - * ide_lock protects the use of settings - * - * so we need to hold both, ide_settings_sem because we want to - * modify the settings list, and ide_lock because we cannot take - * a setting out that is being used. - * - * OTOH both ide_{read,write}_setting are only ever used under - * ide_setting_sem. - */ - auto_remove_settings(drive); - spin_unlock_irqrestore(&ide_lock, flags); - up(&ide_setting_sem); -} - -EXPORT_SYMBOL(ide_unregister_subdriver); - /* * Probe module */ @@ -2071,9 +1790,7 @@ static int __init ide_init(void) init_ide_data(); -#ifdef CONFIG_PROC_FS - proc_ide_root = proc_mkdir("ide", NULL); -#endif + proc_ide_create(); #ifdef CONFIG_BLK_DEV_ALI14XX if (probe_ali14xx) @@ -2096,14 +1813,9 @@ static int __init ide_init(void) (void)qd65xx_init(); #endif - initializing = 1; /* Probe for special PCI and other "known" interface chipsets. */ probe_for_hwifs(); - initializing = 0; -#ifdef CONFIG_PROC_FS - proc_ide_create(); -#endif return 0; } @@ -2143,9 +1855,7 @@ void __exit cleanup_module (void) pnpide_exit(); #endif -#ifdef CONFIG_PROC_FS proc_ide_destroy(); -#endif bus_unregister(&ide_bus_type); } diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c index 91961aa..df17ed6 100644 --- a/drivers/ide/legacy/ali14xx.c +++ b/drivers/ide/legacy/ali14xx.c @@ -223,7 +223,8 @@ static int __init ali14xx_probe(void) probe_hwif_init(hwif); probe_hwif_init(mate); - create_proc_ide_interfaces(); + ide_proc_register_port(hwif); + ide_proc_register_port(mate); return 0; } diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c index 1ed224a..101aee1 100644 --- a/drivers/ide/legacy/buddha.c +++ b/drivers/ide/legacy/buddha.c @@ -213,7 +213,7 @@ fail_base2: IRQ_AMIGA_PORTS); } - index = ide_register_hw(&hw, &hwif); + index = ide_register_hw(&hw, 1, &hwif); if (index != -1) { hwif->mmio = 1; printk("ide%d: ", index); diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c index 0219ffa..36a3f0a 100644 --- a/drivers/ide/legacy/dtc2278.c +++ b/drivers/ide/legacy/dtc2278.c @@ -138,7 +138,8 @@ static int __init dtc2278_probe(void) probe_hwif_init(hwif); probe_hwif_init(mate); - create_proc_ide_interfaces(); + ide_proc_register_port(hwif); + ide_proc_register_port(mate); return 0; } diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index a9f2cd5..e1e9d9d 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c @@ -70,7 +70,7 @@ void __init falconide_init(void) 0, 0, NULL, // falconide_iops, IRQ_MFP_IDE); - index = ide_register_hw(&hw, NULL); + index = ide_register_hw(&hw, 1, NULL); if (index != -1) printk("ide%d: Falcon IDE interface\n", index); diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c index dcfadbb..0830a02 100644 --- a/drivers/ide/legacy/gayle.c +++ b/drivers/ide/legacy/gayle.c @@ -165,7 +165,7 @@ found: // &gayle_iops, IRQ_AMIGA_PORTS); - index = ide_register_hw(&hw, &hwif); + index = ide_register_hw(&hw, 1, &hwif); if (index != -1) { hwif->mmio = 1; switch (i) { diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index a283264..c8f353b 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c @@ -357,7 +357,8 @@ int __init ht6560b_init(void) probe_hwif_init(hwif); probe_hwif_init(mate); - create_proc_ide_interfaces(); + ide_proc_register_port(hwif); + ide_proc_register_port(mate); return 0; diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index c6522a6..2f3977f 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c @@ -153,7 +153,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq hw.irq = irq; hw.chipset = ide_pci; hw.dev = &handle->dev; - return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); + return ide_register_hw_with_fixup(&hw, 0, NULL, ide_undecoded_slave); } /*====================================================================== diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c index 4c0079a..c211fc7 100644 --- a/drivers/ide/legacy/macide.c +++ b/drivers/ide/legacy/macide.c @@ -102,21 +102,21 @@ void macide_init(void) 0, 0, macide_ack_intr, // quadra_ide_iops, IRQ_NUBUS_F); - index = ide_register_hw(&hw, &hwif); + index = ide_register_hw(&hw, 1, &hwif); break; case MAC_IDE_PB: ide_setup_ports(&hw, IDE_BASE, macide_offsets, 0, 0, macide_ack_intr, // macide_pb_iops, IRQ_NUBUS_C); - index = ide_register_hw(&hw, &hwif); + index = ide_register_hw(&hw, 1, &hwif); break; case MAC_IDE_BABOON: ide_setup_ports(&hw, BABOON_BASE, macide_offsets, 0, 0, NULL, // macide_baboon_iops, IRQ_BABOON_1); - index = ide_register_hw(&hw, &hwif); + index = ide_register_hw(&hw, 1, &hwif); if (index == -1) break; if (macintosh_config->ident == MAC_MODEL_PB190) { diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c index 74f0812..e628a98 100644 --- a/drivers/ide/legacy/q40ide.c +++ b/drivers/ide/legacy/q40ide.c @@ -142,7 +142,7 @@ void q40ide_init(void) 0, NULL, // m68kide_iops, q40ide_default_irq(pcide_bases[i])); - index = ide_register_hw(&hw, &hwif); + index = ide_register_hw(&hw, 1, &hwif); // **FIXME** if (index != -1) hwif->mmio = 1; diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c index 2fb8f50..d1414a7 100644 --- a/drivers/ide/legacy/qd65xx.c +++ b/drivers/ide/legacy/qd65xx.c @@ -427,7 +427,7 @@ static int __init qd_probe(int base) qd_setup(hwif, base, config, QD6500_DEF_DATA, QD6500_DEF_DATA, &qd6500_tune_drive); - create_proc_ide_interfaces(); + ide_proc_register_port(hwif); return 1; } @@ -459,7 +459,7 @@ static int __init qd_probe(int base) &qd6580_tune_drive); qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); - create_proc_ide_interfaces(); + ide_proc_register_port(hwif); return 1; } else { @@ -479,7 +479,8 @@ static int __init qd_probe(int base) &qd6580_tune_drive); qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); - create_proc_ide_interfaces(); + ide_proc_register_port(hwif); + ide_proc_register_port(mate); return 0; /* no other qd65xx possible */ } diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c index ca79744..ddc403a 100644 --- a/drivers/ide/legacy/umc8672.c +++ b/drivers/ide/legacy/umc8672.c @@ -160,7 +160,8 @@ static int __init umc8672_probe(void) probe_hwif_init(hwif); probe_hwif_init(mate); - create_proc_ide_interfaces(); + ide_proc_register_port(hwif); + ide_proc_register_port(mate); return 0; } diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index d54d9fe..ca95e99 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c @@ -760,6 +760,9 @@ static int au_ide_probe(struct device *dev) #endif probe_hwif_init(hwif); + + ide_proc_register_port(hwif); + dev_set_drvdata(dev, hwif); printk(KERN_INFO "Au1xxx IDE(builtin) configured for %s\n", mode ); diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c index 81fa068..6e935d7 100644 --- a/drivers/ide/mips/swarm.c +++ b/drivers/ide/mips/swarm.c @@ -129,6 +129,9 @@ static int __devinit swarm_ide_probe(struct device *dev) hwif->irq = hwif->hw.irq; probe_hwif_init(hwif); + + ide_proc_register_port(hwif); + dev_set_drvdata(dev, hwif); return 0; diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c index 73bdf64..b173bc6 100644 --- a/drivers/ide/pci/aec62xx.c +++ b/drivers/ide/pci/aec62xx.c @@ -87,38 +87,12 @@ static u8 pci_bus_clock_list_ultra (u8 speed, struct chipset_bus_clock_list_entr return chipset_table->ultra_settings; } -static u8 aec62xx_ratemask (ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - u8 mode; - - switch(hwif->pci_dev->device) { - case PCI_DEVICE_ID_ARTOP_ATP865: - case PCI_DEVICE_ID_ARTOP_ATP865R: - mode = (inb(hwif->channel ? - hwif->mate->dma_status : - hwif->dma_status) & 0x10) ? 4 : 3; - break; - case PCI_DEVICE_ID_ARTOP_ATP860: - case PCI_DEVICE_ID_ARTOP_ATP860R: - mode = 2; - break; - case PCI_DEVICE_ID_ARTOP_ATP850UF: - default: - return 1; - } - - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); - return mode; -} - static int aec6210_tune_chipset (ide_drive_t *drive, u8 xferspeed) { ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; u16 d_conf = 0; - u8 speed = ide_rate_filter(aec62xx_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); u8 ultra = 0, ultra_conf = 0; u8 tmp0 = 0, tmp1 = 0, tmp2 = 0; unsigned long flags; @@ -145,7 +119,7 @@ static int aec6260_tune_chipset (ide_drive_t *drive, u8 xferspeed) { ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; - u8 speed = ide_rate_filter(aec62xx_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); u8 unit = (drive->select.b.unit & 0x01); u8 tmp1 = 0, tmp2 = 0; u8 ultra = 0, drive_conf = 0, ultra_conf = 0; @@ -181,17 +155,6 @@ static int aec62xx_tune_chipset (ide_drive_t *drive, u8 speed) } } -static int config_chipset_for_dma (ide_drive_t *drive) -{ - u8 speed = ide_dma_speed(drive, aec62xx_ratemask(drive)); - - if (!(speed)) - return 0; - - (void) aec62xx_tune_chipset(drive, speed); - return ide_dma_enable(drive); -} - static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio) { pio = ide_get_best_pio_mode(drive, pio, 4, NULL); @@ -200,7 +163,7 @@ static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio) static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive) { - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; if (ide_use_fast_pio(drive)) @@ -261,11 +224,13 @@ static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const ch static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif) { + struct pci_dev *dev = hwif->pci_dev; + hwif->autodma = 0; hwif->tuneproc = &aec62xx_tune_drive; hwif->speedproc = &aec62xx_tune_chipset; - if (hwif->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) + if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) hwif->serialized = hwif->channel; if (hwif->mate) @@ -277,7 +242,15 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif) return; } - hwif->ultra_mask = 0x7f; + hwif->ultra_mask = hwif->cds->udma_mask; + + /* atp865 and atp865r */ + if (hwif->ultra_mask == 0x3f) { + /* check bit 0x10 of DMA status register */ + if (inb(pci_resource_start(dev, 4) + 2) & 0x10) + hwif->ultra_mask = 0x7f; /* udma0-6 */ + } + hwif->mwdma_mask = 0x07; hwif->ide_dma_check = &aec62xx_config_drive_xfer_rate; @@ -344,6 +317,7 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = { .autodma = AUTODMA, .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, .bootable = OFF_BOARD, + .udma_mask = 0x07, /* udma0-2 */ },{ /* 1 */ .name = "AEC6260", .init_setup = init_setup_aec62xx, @@ -353,6 +327,7 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = { .channels = 2, .autodma = NOAUTODMA, .bootable = OFF_BOARD, + .udma_mask = 0x1f, /* udma0-4 */ },{ /* 2 */ .name = "AEC6260R", .init_setup = init_setup_aec62xx, @@ -363,6 +338,7 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = { .autodma = AUTODMA, .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, .bootable = NEVER_BOARD, + .udma_mask = 0x1f, /* udma0-4 */ },{ /* 3 */ .name = "AEC6X80", .init_setup = init_setup_aec6x80, @@ -372,6 +348,7 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = { .channels = 2, .autodma = AUTODMA, .bootable = OFF_BOARD, + .udma_mask = 0x3f, /* udma0-5 */ },{ /* 4 */ .name = "AEC6X80R", .init_setup = init_setup_aec6x80, @@ -382,6 +359,7 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = { .autodma = AUTODMA, .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, .bootable = OFF_BOARD, + .udma_mask = 0x3f, /* udma0-5 */ } }; diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 946a127..428efda 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c @@ -50,7 +50,7 @@ static u8 m5229_revision; static u8 chip_is_1543c_e; static struct pci_dev *isa_dev; -#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) +#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) #include <linux/stat.h> #include <linux/proc_fs.h> @@ -278,7 +278,7 @@ static int ali_get_info (char *buffer, char **addr, off_t offset, int count) return p-buffer; /* => must be less than 4k! */ } -#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ +#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) */ /** * ali15x3_tune_pio - set up chipset for PIO mode @@ -378,74 +378,31 @@ static void ali15x3_tune_drive (ide_drive_t *drive, u8 pio) } /** - * ali15x3_can_ultra - check for ultra DMA support - * @drive: drive to do the check + * ali_udma_filter - compute UDMA mask + * @drive: IDE device * - * Check the drive and controller revisions. Return 0 if UDMA is - * not available, or 1 if UDMA can be used. The actual rules for - * the ALi are + * Return available UDMA modes. + * + * The actual rules for the ALi are: * No UDMA on revisions <= 0x20 * Disk only for revisions < 0xC2 * Not WDC drives for revisions < 0xC2 * * FIXME: WDC ifdef needs to die */ - -static u8 ali15x3_can_ultra (ide_drive_t *drive) -{ -#ifndef CONFIG_WDC_ALI15X3 - struct hd_driveid *id = drive->id; -#endif /* CONFIG_WDC_ALI15X3 */ - if (m5229_revision <= 0x20) { - return 0; - } else if ((m5229_revision < 0xC2) && -#ifndef CONFIG_WDC_ALI15X3 - ((chip_is_1543c_e && strstr(id->model, "WDC ")) || - (drive->media!=ide_disk))) { -#else /* CONFIG_WDC_ALI15X3 */ - (drive->media!=ide_disk)) { -#endif /* CONFIG_WDC_ALI15X3 */ - return 0; - } else { - return 1; - } -} - -/** - * ali15x3_ratemask - generate DMA mode list - * @drive: drive to compute against - * - * Generate a list of the available DMA modes for the drive. - * FIXME: this function contains lots of bogus masking we can dump - * - * Return the highest available mode (UDMA33, UDMA66, UDMA100,..) - */ - -static u8 ali15x3_ratemask (ide_drive_t *drive) +static u8 ali_udma_filter(ide_drive_t *drive) { - u8 mode = 0, can_ultra = ali15x3_can_ultra(drive); - - if (m5229_revision > 0xC4 && can_ultra) { - mode = 4; - } else if (m5229_revision == 0xC4 && can_ultra) { - mode = 3; - } else if (m5229_revision >= 0xC2 && can_ultra) { - mode = 2; - } else if (can_ultra) { - return 1; - } else { - return 0; + if (m5229_revision > 0x20 && m5229_revision < 0xC2) { + if (drive->media != ide_disk) + return 0; +#ifndef CONFIG_WDC_ALI15X3 + if (chip_is_1543c_e && strstr(drive->id->model, "WDC ")) + return 0; +#endif } - /* - * If the drive sees no suitable cable then UDMA 33 - * is the highest permitted mode - */ - - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); - return mode; + return drive->hwif->ultra_mask; } /** @@ -461,7 +418,7 @@ static int ali15x3_tune_chipset (ide_drive_t *drive, u8 xferspeed) { ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; - u8 speed = ide_rate_filter(ali15x3_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); u8 speed1 = speed; u8 unit = (drive->select.b.unit & 0x01); u8 tmpbyte = 0x00; @@ -511,7 +468,7 @@ static int ali15x3_tune_chipset (ide_drive_t *drive, u8 xferspeed) static int config_chipset_for_dma (ide_drive_t *drive) { - u8 speed = ide_dma_speed(drive, ali15x3_ratemask(drive)); + u8 speed = ide_max_dma_mode(drive); if (!(speed)) return 0; @@ -609,13 +566,13 @@ static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const c isa_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); -#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) +#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) if (!ali_proc) { ali_proc = 1; bmide_dev = dev; ide_pci_create_host_proc("ali", ali_get_info); } -#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ +#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_IDE_PROC_FS) */ local_irq_save(flags); @@ -771,6 +728,7 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif) hwif->autodma = 0; hwif->tuneproc = &ali15x3_tune_drive; hwif->speedproc = &ali15x3_tune_chipset; + hwif->udma_filter = &ali_udma_filter; /* don't use LBA48 DMA on ALi devices before rev 0xC5 */ hwif->no_lba48_dma = (m5229_revision <= 0xC4) ? 1 : 0; @@ -783,8 +741,17 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif) hwif->atapi_dma = 1; - if (m5229_revision > 0x20) - hwif->ultra_mask = 0x7f; + if (m5229_revision <= 0x20) + hwif->ultra_mask = 0x00; /* no udma */ + else if (m5229_revision < 0xC2) + hwif->ultra_mask = 0x07; /* udma0-2 */ + else if (m5229_revision == 0xC2 || m5229_revision == 0xC3) + hwif->ultra_mask = 0x1f; /* udma0-4 */ + else if (m5229_revision == 0xC4) + hwif->ultra_mask = 0x3f; /* udma0-5 */ + else + hwif->ultra_mask = 0x7f; /* udma0-6 */ + hwif->mwdma_mask = 0x07; hwif->swdma_mask = 0x07; diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 7989bdd..becb1a5 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c @@ -92,7 +92,7 @@ static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3 * AMD /proc entry. */ -#ifdef CONFIG_PROC_FS +#ifdef CONFIG_IDE_PROC_FS #include <linux/stat.h> #include <linux/proc_fs.h> @@ -402,14 +402,14 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch * Register /proc/ide/amd74xx entry */ -#if defined(DISPLAY_AMD_TIMINGS) && defined(CONFIG_PROC_FS) +#if defined(DISPLAY_AMD_TIMINGS) && defined(CONFIG_IDE_PROC_FS) if (!amd74xx_proc) { amd_base = pci_resource_start(dev, 4); bmide_dev = dev; ide_pci_create_host_proc("amd74xx", amd74xx_get_info); amd74xx_proc = 1; } -#endif /* DISPLAY_AMD_TIMINGS && CONFIG_PROC_FS */ +#endif /* DISPLAY_AMD_TIMINGS && CONFIG_IDE_PROC_FS */ return dev->irq; } diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c index 2d48af3..0e52ad7 100644 --- a/drivers/ide/pci/atiixp.c +++ b/drivers/ide/pci/atiixp.c @@ -49,22 +49,6 @@ static int save_mdma_mode[4]; static DEFINE_SPINLOCK(atiixp_lock); /** - * atiixp_ratemask - compute rate mask for ATIIXP IDE - * @drive: IDE drive to compute for - * - * Returns the available modes for the ATIIXP IDE controller. - */ - -static u8 atiixp_ratemask(ide_drive_t *drive) -{ - u8 mode = 3; - - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); - return mode; -} - -/** * atiixp_dma_2_pio - return the PIO mode matching DMA * @xfer_rate: transfer speed * @@ -189,7 +173,7 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed) u16 tmp16; u8 speed, pio; - speed = ide_rate_filter(atiixp_ratemask(drive), xferspeed); + speed = ide_rate_filter(drive, xferspeed); spin_lock_irqsave(&atiixp_lock, flags); @@ -223,26 +207,6 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed) } /** - * atiixp_config_drive_for_dma - configure drive for DMA - * @drive: IDE drive to configure - * - * Set up a ATIIXP interface channel for the best available speed. - * We prefer UDMA if it is available and then MWDMA. If DMA is - * not available we switch to PIO and return 0. - */ - -static int atiixp_config_drive_for_dma(ide_drive_t *drive) -{ - u8 speed = ide_dma_speed(drive, atiixp_ratemask(drive)); - - if (!speed) - return 0; - - (void) atiixp_speedproc(drive, speed); - return ide_dma_enable(drive); -} - -/** * atiixp_dma_check - set up an IDE device * @drive: IDE drive to configure * @@ -256,7 +220,7 @@ static int atiixp_dma_check(ide_drive_t *drive) drive->init_speed = 0; - if (ide_use_dma(drive) && atiixp_config_drive_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; if (ide_use_fast_pio(drive)) { diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index 77f51ab..61ea96b 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c @@ -74,7 +74,7 @@ #define UDIDETCR1 0x7B #define DTPR1 0x7C -#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) +#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_IDE_PROC_FS) #include <linux/stat.h> #include <linux/proc_fs.h> @@ -165,7 +165,7 @@ static int cmd64x_get_info (char *buffer, char **addr, off_t offset, int count) return p-buffer; /* => must be less than 4k! */ } -#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */ +#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_IDE_PROC_FS) */ static u8 quantize_timing(int timing, int quant) { @@ -292,55 +292,6 @@ static void cmd64x_tune_drive (ide_drive_t *drive, u8 pio) (void) ide_config_drive_speed(drive, XFER_PIO_0 + pio); } -static u8 cmd64x_ratemask (ide_drive_t *drive) -{ - struct pci_dev *dev = HWIF(drive)->pci_dev; - u8 mode = 0; - - switch(dev->device) { - case PCI_DEVICE_ID_CMD_649: - mode = 3; - break; - case PCI_DEVICE_ID_CMD_648: - mode = 2; - break; - case PCI_DEVICE_ID_CMD_643: - return 0; - - case PCI_DEVICE_ID_CMD_646: - { - unsigned int class_rev = 0; - pci_read_config_dword(dev, - PCI_CLASS_REVISION, &class_rev); - class_rev &= 0xff; - /* - * UltraDMA only supported on PCI646U and PCI646U2, which - * correspond to revisions 0x03, 0x05 and 0x07 respectively. - * Actually, although the CMD tech support people won't - * tell me the details, the 0x03 revision cannot support - * UDMA correctly without hardware modifications, and even - * then it only works with Quantum disks due to some - * hold time assumptions in the 646U part which are fixed - * in the 646U2. - * - * So we only do UltraDMA on revision 0x05 and 0x07 chipsets. - */ - switch(class_rev) { - case 0x07: - case 0x05: - return 1; - case 0x03: - case 0x01: - default: - return 0; - } - } - } - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); - return mode; -} - static int cmd64x_tune_chipset (ide_drive_t *drive, u8 speed) { ide_hwif_t *hwif = HWIF(drive); @@ -348,7 +299,7 @@ static int cmd64x_tune_chipset (ide_drive_t *drive, u8 speed) u8 unit = drive->dn & 0x01; u8 regU = 0, pciU = hwif->channel ? UDIDETCR1 : UDIDETCR0; - speed = ide_rate_filter(cmd64x_ratemask(drive), speed); + speed = ide_rate_filter(drive, speed); if (speed >= XFER_SW_DMA_0) { (void) pci_read_config_byte(dev, pciU, ®U); @@ -403,7 +354,7 @@ static int cmd64x_tune_chipset (ide_drive_t *drive, u8 speed) static int config_chipset_for_dma (ide_drive_t *drive) { - u8 speed = ide_dma_speed(drive, cmd64x_ratemask(drive)); + u8 speed = ide_max_dma_mode(drive); if (!speed) return 0; @@ -597,7 +548,7 @@ static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev, const cha (void) pci_write_config_byte(dev, UDIDETCR0, 0xf0); #endif /* CONFIG_PPC */ -#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) +#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_IDE_PROC_FS) cmd_devs[n_cmd_devs++] = dev; @@ -605,7 +556,7 @@ static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev, const cha cmd64x_proc = 1; ide_pci_create_host_proc("cmd64x", cmd64x_get_info); } -#endif /* DISPLAY_CMD64X_TIMINGS && CONFIG_PROC_FS */ +#endif /* DISPLAY_CMD64X_TIMINGS && CONFIG_IDE_PROC_FS */ return 0; } @@ -644,15 +595,24 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif) hwif->atapi_dma = 1; - hwif->ultra_mask = 0x3f; - hwif->mwdma_mask = 0x07; + hwif->ultra_mask = hwif->cds->udma_mask; + + /* + * UltraDMA only supported on PCI646U and PCI646U2, which + * correspond to revisions 0x03, 0x05 and 0x07 respectively. + * Actually, although the CMD tech support people won't + * tell me the details, the 0x03 revision cannot support + * UDMA correctly without hardware modifications, and even + * then it only works with Quantum disks due to some + * hold time assumptions in the 646U part which are fixed + * in the 646U2. + * + * So we only do UltraDMA on revision 0x05 and 0x07 chipsets. + */ + if (dev->device == PCI_DEVICE_ID_CMD_646 && class_rev < 5) + hwif->ultra_mask = 0x00; - if (dev->device == PCI_DEVICE_ID_CMD_643) - hwif->ultra_mask = 0x80; - if (dev->device == PCI_DEVICE_ID_CMD_646) - hwif->ultra_mask = (class_rev > 0x04) ? 0x07 : 0x80; - if (dev->device == PCI_DEVICE_ID_CMD_648) - hwif->ultra_mask = 0x1f; + hwif->mwdma_mask = 0x07; hwif->ide_dma_check = &cmd64x_config_drive_for_dma; if (!(hwif->udma_four)) @@ -716,6 +676,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { .autodma = AUTODMA, .enablebits = {{0x00,0x00,0x00}, {0x51,0x08,0x08}}, .bootable = ON_BOARD, + .udma_mask = 0x00, /* no udma */ },{ /* 1 */ .name = "CMD646", .init_setup = init_setup_cmd646, @@ -725,6 +686,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { .autodma = AUTODMA, .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, .bootable = ON_BOARD, + .udma_mask = 0x07, /* udma0-2 */ },{ /* 2 */ .name = "CMD648", .init_setup = init_setup_cmd64x, @@ -734,6 +696,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { .autodma = AUTODMA, .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, .bootable = ON_BOARD, + .udma_mask = 0x1f, /* udma0-4 */ },{ /* 3 */ .name = "CMD649", .init_setup = init_setup_cmd64x, @@ -743,6 +706,7 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = { .autodma = AUTODMA, .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}}, .bootable = ON_BOARD, + .udma_mask = 0x3f, /* udma0-5 */ } }; diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index 400859a..3b88a3a 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c @@ -213,6 +213,7 @@ static ide_pci_device_t cyrix_chipsets[] __devinitdata = { static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) { + ide_hwif_t *hwif = NULL, *mate = NULL; ata_index_t index; ide_pci_device_t *d = &cyrix_chipsets[id->driver_data]; @@ -239,10 +240,21 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic ide_pci_setup_ports(dev, d, 14, &index); - if((index.b.low & 0xf0) != 0xf0) - probe_hwif_init(&ide_hwifs[index.b.low]); - if((index.b.high & 0xf0) != 0xf0) - probe_hwif_init(&ide_hwifs[index.b.high]); + if ((index.b.low & 0xf0) != 0xf0) + hwif = &ide_hwifs[index.b.low]; + if ((index.b.high & 0xf0) != 0xf0) + mate = &ide_hwifs[index.b.high]; + + if (hwif) + probe_hwif_init(hwif); + if (mate) + probe_hwif_init(mate); + + if (hwif) + ide_proc_register_port(hwif); + if (mate) + ide_proc_register_port(mate); + return 0; } diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c index 45f43ef..41925c4 100644 --- a/drivers/ide/pci/cs5535.c +++ b/drivers/ide/pci/cs5535.c @@ -127,20 +127,6 @@ static void cs5535_set_speed(ide_drive_t *drive, u8 speed) } } -static u8 cs5535_ratemask(ide_drive_t *drive) -{ - /* eighty93 will return 1 if it's 80core and capable of - exceeding udma2, 0 otherwise. we need ratemask to set - the max speed and if we can > udma2 then we return 2 - which selects speed_max as udma4 which is the 5535's max - speed, and 1 selects udma2 which is the max for 40c */ - if (!eighty_ninty_three(drive)) - return 1; - - return 2; -} - - /**** * cs5535_set_drive - Configure the drive to the new speed * @drive: Drive to set up @@ -151,7 +137,7 @@ static u8 cs5535_ratemask(ide_drive_t *drive) */ static int cs5535_set_drive(ide_drive_t *drive, u8 speed) { - speed = ide_rate_filter(cs5535_ratemask(drive), speed); + speed = ide_rate_filter(drive, speed); ide_config_drive_speed(drive, speed); cs5535_set_speed(drive, speed); @@ -178,28 +164,13 @@ static void cs5535_tuneproc(ide_drive_t *drive, u8 xferspeed) cs5535_set_speed(drive, xferspeed); } -static int cs5535_config_drive_for_dma(ide_drive_t *drive) -{ - u8 speed; - - speed = ide_dma_speed(drive, cs5535_ratemask(drive)); - - /* If no DMA speed was available then let dma_check hit pio */ - if (!speed) { - return 0; - } - - cs5535_set_drive(drive, speed); - return ide_dma_enable(drive); -} - static int cs5535_dma_check(ide_drive_t *drive) { u8 speed; drive->init_speed = 0; - if (ide_use_dma(drive) && cs5535_config_drive_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; if (ide_use_fast_pio(drive)) { diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c index dd7ec37..46f4a88 100644 --- a/drivers/ide/pci/delkin_cb.c +++ b/drivers/ide/pci/delkin_cb.c @@ -80,7 +80,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) hw.irq = dev->irq; hw.chipset = ide_pci; /* this enables IRQ sharing */ - rc = ide_register_hw_with_fixup(&hw, &hwif, ide_undecoded_slave); + rc = ide_register_hw_with_fixup(&hw, 0, &hwif, ide_undecoded_slave); if (rc < 0) { printk(KERN_ERR "delkin_cb: ide_register_hw failed (%d)\n", rc); pci_disable_device(dev); diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index 924eaa3..2c24c3d 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c @@ -43,15 +43,10 @@ #define HPT343_DEBUG_DRIVE_INFO 0 -static u8 hpt34x_ratemask (ide_drive_t *drive) -{ - return 1; -} - static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed) { struct pci_dev *dev = HWIF(drive)->pci_dev; - u8 speed = ide_rate_filter(hpt34x_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); u32 reg1= 0, tmp1 = 0, reg2 = 0, tmp2 = 0; u8 hi_speed, lo_speed; @@ -89,29 +84,11 @@ static void hpt34x_tune_drive (ide_drive_t *drive, u8 pio) (void) hpt34x_tune_chipset(drive, (XFER_PIO_0 + pio)); } -/* - * This allows the configuration of ide_pci chipset registers - * for cards that learn about the drive's UDMA, DMA, PIO capabilities - * after the drive is reported by the OS. Initially for designed for - * HPT343 UDMA chipset by HighPoint|Triones Technologies, Inc. - */ - -static int config_chipset_for_dma (ide_drive_t *drive) -{ - u8 speed = ide_dma_speed(drive, hpt34x_ratemask(drive)); - - if (!(speed)) - return 0; - - (void) hpt34x_tune_chipset(drive, speed); - return ide_dma_enable(drive); -} - static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive) { drive->init_speed = 0; - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) + if (ide_tune_dma(drive)) #ifndef CONFIG_HPT34X_AUTODMA return -1; #else diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index cf9d344..fcbc560 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c @@ -514,43 +514,31 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list) return 0; } -static u8 hpt3xx_ratemask(ide_drive_t *drive) -{ - struct hpt_info *info = pci_get_drvdata(HWIF(drive)->pci_dev); - u8 mode = info->max_mode; - - if (!eighty_ninty_three(drive) && mode) - mode = min(mode, (u8)1); - return mode; -} - /* * Note for the future; the SATA hpt37x we must set * either PIO or UDMA modes 0,4,5 */ - -static u8 hpt3xx_ratefilter(ide_drive_t *drive, u8 speed) + +static u8 hpt3xx_udma_filter(ide_drive_t *drive) { struct hpt_info *info = pci_get_drvdata(HWIF(drive)->pci_dev); u8 chip_type = info->chip_type; - u8 mode = hpt3xx_ratemask(drive); - - if (drive->media != ide_disk) - return min(speed, (u8)XFER_PIO_4); + u8 mode = info->max_mode; + u8 mask; switch (mode) { case 0x04: - speed = min_t(u8, speed, XFER_UDMA_6); + mask = 0x7f; break; case 0x03: - speed = min_t(u8, speed, XFER_UDMA_5); + mask = 0x3f; if (chip_type >= HPT374) break; if (!check_in_drive_list(drive, bad_ata100_5)) goto check_bad_ata33; /* fall thru */ case 0x02: - speed = min_t(u8, speed, XFER_UDMA_4); + mask = 0x1f; /* * CHECK ME, Does this need to be changed to HPT374 ?? @@ -561,13 +549,13 @@ static u8 hpt3xx_ratefilter(ide_drive_t *drive, u8 speed) !check_in_drive_list(drive, bad_ata66_4)) goto check_bad_ata33; - speed = min_t(u8, speed, XFER_UDMA_3); + mask = 0x0f; if (HPT366_ALLOW_ATA66_3 && !check_in_drive_list(drive, bad_ata66_3)) goto check_bad_ata33; /* fall thru */ case 0x01: - speed = min_t(u8, speed, XFER_UDMA_2); + mask = 0x07; check_bad_ata33: if (chip_type >= HPT370A) @@ -577,10 +565,10 @@ static u8 hpt3xx_ratefilter(ide_drive_t *drive, u8 speed) /* fall thru */ case 0x00: default: - speed = min_t(u8, speed, XFER_MW_DMA_2); + mask = 0x00; break; } - return speed; + return mask; } static u32 get_speed_setting(u8 speed, struct hpt_info *info) @@ -608,12 +596,19 @@ static int hpt36x_tune_chipset(ide_drive_t *drive, u8 xferspeed) ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; struct hpt_info *info = pci_get_drvdata(dev); - u8 speed = hpt3xx_ratefilter(drive, xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); u8 itr_addr = drive->dn ? 0x44 : 0x40; - u32 itr_mask = speed < XFER_MW_DMA_0 ? 0x30070000 : - (speed < XFER_UDMA_0 ? 0xc0070000 : 0xc03800ff); - u32 new_itr = get_speed_setting(speed, info); u32 old_itr = 0; + u32 itr_mask, new_itr; + + /* TODO: move this to ide_rate_filter() [ check ->atapi_dma ] */ + if (drive->media != ide_disk) + speed = min_t(u8, speed, XFER_PIO_4); + + itr_mask = speed < XFER_MW_DMA_0 ? 0x30070000 : + (speed < XFER_UDMA_0 ? 0xc0070000 : 0xc03800ff); + + new_itr = get_speed_setting(speed, info); /* * Disable on-chip PIO FIFO/buffer (and PIO MST mode as well) @@ -633,12 +628,19 @@ static int hpt37x_tune_chipset(ide_drive_t *drive, u8 xferspeed) ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; struct hpt_info *info = pci_get_drvdata(dev); - u8 speed = hpt3xx_ratefilter(drive, xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); u8 itr_addr = 0x40 + (drive->dn * 4); - u32 itr_mask = speed < XFER_MW_DMA_0 ? 0x303c0000 : - (speed < XFER_UDMA_0 ? 0xc03c0000 : 0xc1c001ff); - u32 new_itr = get_speed_setting(speed, info); u32 old_itr = 0; + u32 itr_mask, new_itr; + + /* TODO: move this to ide_rate_filter() [ check ->atapi_dma ] */ + if (drive->media != ide_disk) + speed = min_t(u8, speed, XFER_PIO_4); + + itr_mask = speed < XFER_MW_DMA_0 ? 0x303c0000 : + (speed < XFER_UDMA_0 ? 0xc03c0000 : 0xc1c001ff); + + new_itr = get_speed_setting(speed, info); pci_read_config_dword(dev, itr_addr, &old_itr); new_itr = (new_itr & ~itr_mask) | (old_itr & itr_mask); @@ -667,24 +669,6 @@ static void hpt3xx_tune_drive(ide_drive_t *drive, u8 pio) (void) hpt3xx_tune_chipset (drive, XFER_PIO_0 + pio); } -/* - * This allows the configuration of ide_pci chipset registers - * for cards that learn about the drive's UDMA, DMA, PIO capabilities - * after the drive is reported by the OS. Initially designed for - * HPT366 UDMA chipset by HighPoint|Triones Technologies, Inc. - * - */ -static int config_chipset_for_dma(ide_drive_t *drive) -{ - u8 speed = ide_dma_speed(drive, hpt3xx_ratemask(drive)); - - if (!speed) - return 0; - - (void) hpt3xx_tune_chipset(drive, speed); - return ide_dma_enable(drive); -} - static int hpt3xx_quirkproc(ide_drive_t *drive) { struct hd_driveid *id = drive->id; @@ -739,7 +723,7 @@ static int hpt366_config_drive_xfer_rate(ide_drive_t *drive) { drive->init_speed = 0; - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; if (ide_use_fast_pio(drive)) @@ -1271,6 +1255,7 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) hwif->intrproc = &hpt3xx_intrproc; hwif->maskproc = &hpt3xx_maskproc; hwif->busproc = &hpt3xx_busproc; + hwif->udma_filter = &hpt3xx_udma_filter; /* * HPT3xxN chips have some complications: diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c index 424f00b..c04a026 100644 --- a/drivers/ide/pci/it8213.c +++ b/drivers/ide/pci/it8213.c @@ -17,22 +17,6 @@ #include <asm/io.h> -/* - * it8213_ratemask - Compute available modes - * @drive: IDE drive - * - * Compute the available speeds for the devices on the interface. This - * is all modes to ATA133 clipped by drive cable setup. - */ - -static u8 it8213_ratemask (ide_drive_t *drive) -{ - u8 mode = 4; - if (!eighty_ninty_three(drive)) - mode = min_t(u8, mode, 1); - return mode; -} - /** * it8213_dma_2_pio - return the PIO mode matching DMA * @xfer_rate: transfer speed @@ -145,7 +129,7 @@ static int it8213_tune_chipset (ide_drive_t *drive, u8 xferspeed) ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; u8 maslave = 0x40; - u8 speed = ide_rate_filter(it8213_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); int a_speed = 3 << (drive->dn * 4); int u_flag = 1 << drive->dn; int v_flag = 0x01 << drive->dn; @@ -213,25 +197,6 @@ static int it8213_tune_chipset (ide_drive_t *drive, u8 xferspeed) return ide_config_drive_speed(drive, speed); } -/* - * config_chipset_for_dma - configure for DMA - * @drive: drive to configure - * - * Called by the IDE layer when it wants the timings set up. - */ - -static int config_chipset_for_dma (ide_drive_t *drive) -{ - u8 speed = ide_dma_speed(drive, it8213_ratemask(drive)); - - if (!speed) - return 0; - - it8213_tune_chipset(drive, speed); - - return ide_dma_enable(drive); -} - /** * it8213_configure_drive_for_dma - set up for DMA transfers * @drive: drive we are going to set up @@ -246,7 +211,7 @@ static int it8213_config_drive_for_dma (ide_drive_t *drive) { u8 pio; - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; pio = ide_get_best_pio_mode(drive, 255, 4, NULL); diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c index 4e12548..442f658 100644 --- a/drivers/ide/pci/it821x.c +++ b/drivers/ide/pci/it821x.c @@ -229,22 +229,6 @@ static void it821x_clock_strategy(ide_drive_t *drive) } /** - * it821x_ratemask - Compute available modes - * @drive: IDE drive - * - * Compute the available speeds for the devices on the interface. This - * is all modes to ATA133 clipped by drive cable setup. - */ - -static u8 it821x_ratemask (ide_drive_t *drive) -{ - u8 mode = 4; - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); - return mode; -} - -/** * it821x_tunepio - tune a drive * @drive: drive to tune * @pio: the desired PIO mode @@ -438,7 +422,7 @@ static int it821x_tune_chipset (ide_drive_t *drive, byte xferspeed) ide_hwif_t *hwif = drive->hwif; struct it821x_dev *itdev = ide_get_hwifdata(hwif); - u8 speed = ide_rate_filter(it821x_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); switch (speed) { case XFER_PIO_4: @@ -488,7 +472,7 @@ static int it821x_tune_chipset (ide_drive_t *drive, byte xferspeed) static int config_chipset_for_dma (ide_drive_t *drive) { - u8 speed = ide_dma_speed(drive, it821x_ratemask(drive)); + u8 speed = ide_max_dma_mode(drive); if (speed == 0) return 0; diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c index be4fc96..76ed251 100644 --- a/drivers/ide/pci/jmicron.c +++ b/drivers/ide/pci/jmicron.c @@ -22,22 +22,6 @@ typedef enum { } port_type; /** - * jmicron_ratemask - Compute available modes - * @drive: IDE drive - * - * Compute the available speeds for the devices on the interface. This - * is all modes to ATA133 clipped by drive cable setup. - */ - -static u8 jmicron_ratemask(ide_drive_t *drive) -{ - u8 mode = 4; - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); - return mode; -} - -/** * ata66_jmicron - Cable check * @hwif: IDE port * @@ -129,32 +113,12 @@ static void config_jmicron_chipset_for_pio (ide_drive_t *drive, byte set_speed) static int jmicron_tune_chipset (ide_drive_t *drive, byte xferspeed) { - - u8 speed = ide_rate_filter(jmicron_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); return ide_config_drive_speed(drive, speed); } /** - * config_chipset_for_dma - configure for DMA - * @drive: drive to configure - * - * As the JMicron snoops for timings all we actually need to do is - * make sure we don't set an invalid mode. - */ - -static int config_chipset_for_dma (ide_drive_t *drive) -{ - u8 speed = ide_dma_speed(drive, jmicron_ratemask(drive)); - - if (!speed) - return 0; - - jmicron_tune_chipset(drive, speed); - return ide_dma_enable(drive); -} - -/** * jmicron_configure_drive_for_dma - set up for DMA transfers * @drive: drive we are going to set up * @@ -164,7 +128,7 @@ static int config_chipset_for_dma (ide_drive_t *drive) static int jmicron_config_drive_for_dma (ide_drive_t *drive) { - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; config_jmicron_chipset_for_pio(drive, 1); diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 2cdd629..65b1e12 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c @@ -37,8 +37,6 @@ #include <asm/pci-bridge.h> #endif -#define PDC202_DEBUG_CABLE 0 - #undef DEBUG #ifdef DEBUG @@ -82,16 +80,6 @@ static u8 max_dma_rate(struct pci_dev *pdev) return mode; } -static u8 pdcnew_ratemask(ide_drive_t *drive) -{ - u8 mode = max_dma_rate(HWIF(drive)->pci_dev); - - if (!eighty_ninty_three(drive)) - mode = min_t(u8, mode, 1); - - return mode; -} - /** * get_indexed_reg - Get indexed register * @hwif: for the port address @@ -164,7 +152,7 @@ static int pdcnew_tune_chipset(ide_drive_t *drive, u8 speed) u8 adj = (drive->dn & 1) ? 0x08 : 0x00; int err; - speed = ide_rate_filter(pdcnew_ratemask(drive), speed); + speed = ide_rate_filter(drive, speed); /* * Issue SETFEATURES_XFER to the drive first. PDC202xx hardware will @@ -244,17 +232,8 @@ static int config_chipset_for_dma(ide_drive_t *drive) { struct hd_driveid *id = drive->id; ide_hwif_t *hwif = HWIF(drive); - u8 ultra_66 = (id->dma_ultra & 0x0078) ? 1 : 0; - u8 cable = pdcnew_cable_detect(hwif); u8 speed; - if (ultra_66 && cable) { - printk(KERN_WARNING "Warning: %s channel " - "requires an 80-pin cable for operation.\n", - hwif->channel ? "Secondary" : "Primary"); - printk(KERN_WARNING "%s reduced to Ultra33 mode.\n", drive->name); - } - if (id->capability & 4) { /* * Set IORDY_EN & PREFETCH_EN (this seems to have @@ -267,7 +246,7 @@ static int config_chipset_for_dma(ide_drive_t *drive) set_indexed_reg(hwif, 0x13 + adj, tmp | 0x03); } - speed = ide_dma_speed(drive, pdcnew_ratemask(drive)); + speed = ide_max_dma_mode(drive); if (!speed) return 0; @@ -543,7 +522,8 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif) hwif->drives[0].autotune = hwif->drives[1].autotune = 1; hwif->atapi_dma = 1; - hwif->ultra_mask = 0x7f; + + hwif->ultra_mask = hwif->cds->udma_mask; hwif->mwdma_mask = 0x07; hwif->err_stops_fifo = 1; @@ -556,11 +536,6 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif) if (!noautodma) hwif->autodma = 1; hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; - -#if PDC202_DEBUG_CABLE - printk(KERN_DEBUG "%s: %s-pin cable\n", - hwif->name, hwif->udma_four ? "80" : "40"); -#endif /* PDC202_DEBUG_CABLE */ } static int __devinit init_setup_pdcnew(struct pci_dev *dev, ide_pci_device_t *d) @@ -619,6 +594,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = { .channels = 2, .autodma = AUTODMA, .bootable = OFF_BOARD, + .udma_mask = 0x3f, /* udma0-5 */ },{ /* 1 */ .name = "PDC20269", .init_setup = init_setup_pdcnew, @@ -627,6 +603,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = { .channels = 2, .autodma = AUTODMA, .bootable = OFF_BOARD, + .udma_mask = 0x7f, /* udma0-6*/ },{ /* 2 */ .name = "PDC20270", .init_setup = init_setup_pdc20270, @@ -635,6 +612,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = { .channels = 2, .autodma = AUTODMA, .bootable = OFF_BOARD, + .udma_mask = 0x3f, /* udma0-5 */ },{ /* 3 */ .name = "PDC20271", .init_setup = init_setup_pdcnew, @@ -643,6 +621,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = { .channels = 2, .autodma = AUTODMA, .bootable = OFF_BOARD, + .udma_mask = 0x7f, /* udma0-6*/ },{ /* 4 */ .name = "PDC20275", .init_setup = init_setup_pdcnew, @@ -651,6 +630,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = { .channels = 2, .autodma = AUTODMA, .bootable = OFF_BOARD, + .udma_mask = 0x7f, /* udma0-6*/ },{ /* 5 */ .name = "PDC20276", .init_setup = init_setup_pdc20276, @@ -659,6 +639,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = { .channels = 2, .autodma = AUTODMA, .bootable = OFF_BOARD, + .udma_mask = 0x7f, /* udma0-6*/ },{ /* 6 */ .name = "PDC20277", .init_setup = init_setup_pdcnew, @@ -667,6 +648,7 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = { .channels = 2, .autodma = AUTODMA, .bootable = OFF_BOARD, + .udma_mask = 0x7f, /* udma0-6*/ } }; diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index a7a639f..7146fe3 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c @@ -46,7 +46,6 @@ #include <asm/io.h> #include <asm/irq.h> -#define PDC202_DEBUG_CABLE 0 #define PDC202XX_DEBUG_DRIVE_INFO 0 static const char *pdc_quirk_drives[] = { @@ -101,35 +100,12 @@ static const char *pdc_quirk_drives[] = { #define MC1 0x02 /* DMA"C" timing */ #define MC0 0x01 /* DMA"C" timing */ -static u8 pdc202xx_ratemask (ide_drive_t *drive) -{ - u8 mode; - - switch(HWIF(drive)->pci_dev->device) { - case PCI_DEVICE_ID_PROMISE_20267: - case PCI_DEVICE_ID_PROMISE_20265: - mode = 3; - break; - case PCI_DEVICE_ID_PROMISE_20263: - case PCI_DEVICE_ID_PROMISE_20262: - mode = 2; - break; - case PCI_DEVICE_ID_PROMISE_20246: - return 1; - default: - return 0; - } - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); - return mode; -} - static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed) { ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; u8 drive_pci = 0x60 + (drive->dn << 2); - u8 speed = ide_rate_filter(pdc202xx_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); u32 drive_conf; u8 AP, BP, CP, DP; @@ -261,20 +237,7 @@ static int config_chipset_for_dma (ide_drive_t *drive) u32 drive_conf = 0; u8 drive_pci = 0x60 + (drive->dn << 2); u8 test1 = 0, test2 = 0, speed = -1; - u8 AP = 0, cable = 0; - - u8 ultra_66 = ((id->dma_ultra & 0x0010) || - (id->dma_ultra & 0x0008)) ? 1 : 0; - - if (dev->device != PCI_DEVICE_ID_PROMISE_20246) - cable = pdc202xx_old_cable_detect(hwif); - else - ultra_66 = 0; - - if (ultra_66 && cable) { - printk(KERN_WARNING "Warning: %s channel requires an 80-pin cable for operation.\n", hwif->channel ? "Secondary":"Primary"); - printk(KERN_WARNING "%s reduced to Ultra33 mode.\n", drive->name); - } + u8 AP = 0; if (dev->device != PCI_DEVICE_ID_PROMISE_20246) pdc_old_disable_66MHz_clock(drive->hwif); @@ -308,7 +271,7 @@ chipset_is_set: if (drive->media == ide_disk) /* PREFETCH_EN */ pci_write_config_byte(dev, (drive_pci), AP|PREFETCH_EN); - speed = ide_dma_speed(drive, pdc202xx_ratemask(drive)); + speed = ide_max_dma_mode(drive); if (!(speed)) { /* restore original pci-config space */ @@ -478,7 +441,7 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) hwif->drives[0].autotune = hwif->drives[1].autotune = 1; - hwif->ultra_mask = 0x3f; + hwif->ultra_mask = hwif->cds->udma_mask; hwif->mwdma_mask = 0x07; hwif->swdma_mask = 0x07; hwif->atapi_dma = 1; @@ -500,10 +463,6 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) if (!noautodma) hwif->autodma = 1; hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; -#if PDC202_DEBUG_CABLE - printk(KERN_DEBUG "%s: %s-pin cable\n", - hwif->name, hwif->udma_four ? "80" : "40"); -#endif /* PDC202_DEBUG_CABLE */ } static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase) @@ -587,6 +546,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { .autodma = AUTODMA, .bootable = OFF_BOARD, .extra = 16, + .udma_mask = 0x07, /* udma0-2 */ },{ /* 1 */ .name = "PDC20262", .init_setup = init_setup_pdc202ata4, @@ -597,6 +557,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { .autodma = AUTODMA, .bootable = OFF_BOARD, .extra = 48, + .udma_mask = 0x1f, /* udma0-4 */ },{ /* 2 */ .name = "PDC20263", .init_setup = init_setup_pdc202ata4, @@ -607,6 +568,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { .autodma = AUTODMA, .bootable = OFF_BOARD, .extra = 48, + .udma_mask = 0x1f, /* udma0-4 */ },{ /* 3 */ .name = "PDC20265", .init_setup = init_setup_pdc20265, @@ -617,6 +579,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { .autodma = AUTODMA, .bootable = OFF_BOARD, .extra = 48, + .udma_mask = 0x3f, /* udma0-5 */ },{ /* 4 */ .name = "PDC20267", .init_setup = init_setup_pdc202xx, @@ -627,6 +590,7 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = { .autodma = AUTODMA, .bootable = OFF_BOARD, .extra = 48, + .udma_mask = 0x3f, /* udma0-5 */ } }; diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 061d300..8b219dd 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c @@ -106,68 +106,6 @@ static int no_piix_dma; /** - * piix_ratemask - compute rate mask for PIIX IDE - * @drive: IDE drive to compute for - * - * Returns the available modes for the PIIX IDE controller. - */ - -static u8 piix_ratemask (ide_drive_t *drive) -{ - struct pci_dev *dev = HWIF(drive)->pci_dev; - u8 mode; - - switch(dev->device) { - case PCI_DEVICE_ID_INTEL_82801EB_1: - mode = 3; - break; - /* UDMA 100 capable */ - case PCI_DEVICE_ID_INTEL_82801BA_8: - case PCI_DEVICE_ID_INTEL_82801BA_9: - case PCI_DEVICE_ID_INTEL_82801CA_10: - case PCI_DEVICE_ID_INTEL_82801CA_11: - case PCI_DEVICE_ID_INTEL_82801E_11: - case PCI_DEVICE_ID_INTEL_82801DB_1: - case PCI_DEVICE_ID_INTEL_82801DB_10: - case PCI_DEVICE_ID_INTEL_82801DB_11: - case PCI_DEVICE_ID_INTEL_82801EB_11: - case PCI_DEVICE_ID_INTEL_ESB_2: - case PCI_DEVICE_ID_INTEL_ICH6_19: - case PCI_DEVICE_ID_INTEL_ICH7_21: - case PCI_DEVICE_ID_INTEL_ESB2_18: - case PCI_DEVICE_ID_INTEL_ICH8_6: - mode = 3; - break; - /* UDMA 66 capable */ - case PCI_DEVICE_ID_INTEL_82801AA_1: - case PCI_DEVICE_ID_INTEL_82372FB_1: - mode = 2; - break; - /* UDMA 33 capable */ - case PCI_DEVICE_ID_INTEL_82371AB: - case PCI_DEVICE_ID_INTEL_82443MX_1: - case PCI_DEVICE_ID_INTEL_82451NX: - case PCI_DEVICE_ID_INTEL_82801AB_1: - return 1; - /* Non UDMA capable (MWDMA2) */ - case PCI_DEVICE_ID_INTEL_82371SB_1: - case PCI_DEVICE_ID_INTEL_82371FB_1: - case PCI_DEVICE_ID_INTEL_82371FB_0: - case PCI_DEVICE_ID_INTEL_82371MX: - default: - return 0; - } - - /* - * If we are UDMA66 capable fall back to UDMA33 - * if the drive cannot see an 80pin cable. - */ - if (!eighty_ninty_three(drive)) - mode = min_t(u8, mode, 1); - return mode; -} - -/** * piix_dma_2_pio - return the PIO mode matching DMA * @xfer_rate: transfer speed * @@ -301,7 +239,7 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed) ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; u8 maslave = hwif->channel ? 0x42 : 0x40; - u8 speed = ide_rate_filter(piix_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); int a_speed = 3 << (drive->dn * 4); int u_flag = 1 << drive->dn; int v_flag = 0x01 << drive->dn; @@ -366,30 +304,6 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed) } /** - * piix_config_drive_for_dma - configure drive for DMA - * @drive: IDE drive to configure - * - * Set up a PIIX interface channel for the best available speed. - * We prefer UDMA if it is available and then MWDMA. If DMA is - * not available we switch to PIO and return 0. - */ - -static int piix_config_drive_for_dma (ide_drive_t *drive) -{ - u8 speed = ide_dma_speed(drive, piix_ratemask(drive)); - - /* - * If no DMA speed was available or the chipset has DMA bugs - * then disable DMA and use PIO - */ - if (!speed) - return 0; - - (void) piix_tune_chipset(drive, speed); - return ide_dma_enable(drive); -} - -/** * piix_config_drive_xfer_rate - set up an IDE device * @drive: IDE drive to configure * @@ -401,7 +315,7 @@ static int piix_config_drive_xfer_rate (ide_drive_t *drive) { drive->init_speed = 0; - if (ide_use_dma(drive) && piix_config_drive_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; if (ide_use_fast_pio(drive)) @@ -524,26 +438,14 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif) hwif->ide_dma_clear_irq = &piix_dma_clear_irq; hwif->atapi_dma = 1; - hwif->ultra_mask = 0x3f; + + hwif->ultra_mask = hwif->cds->udma_mask; hwif->mwdma_mask = 0x06; hwif->swdma_mask = 0x04; - switch(hwif->pci_dev->device) { - case PCI_DEVICE_ID_INTEL_82371FB_0: - case PCI_DEVICE_ID_INTEL_82371FB_1: - case PCI_DEVICE_ID_INTEL_82371SB_1: - hwif->ultra_mask = 0x80; - break; - case PCI_DEVICE_ID_INTEL_82371AB: - case PCI_DEVICE_ID_INTEL_82443MX_1: - case PCI_DEVICE_ID_INTEL_82451NX: - case PCI_DEVICE_ID_INTEL_82801AB_1: - hwif->ultra_mask = 0x07; - break; - default: - if (!hwif->udma_four) - hwif->udma_four = piix_cable_detect(hwif); - break; + if (hwif->ultra_mask & 0x78) { + if (!hwif->udma_four) + hwif->udma_four = piix_cable_detect(hwif); } if (no_piix_dma) @@ -557,7 +459,7 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif) hwif->drives[0].autodma = hwif->autodma; } -#define DECLARE_PIIX_DEV(name_str) \ +#define DECLARE_PIIX_DEV(name_str, udma) \ { \ .name = name_str, \ .init_chipset = init_chipset_piix, \ @@ -566,11 +468,12 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif) .autodma = AUTODMA, \ .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ .bootable = ON_BOARD, \ + .udma_mask = udma, \ } static ide_pci_device_t piix_pci_info[] __devinitdata = { - /* 0 */ DECLARE_PIIX_DEV("PIIXa"), - /* 1 */ DECLARE_PIIX_DEV("PIIXb"), + /* 0 */ DECLARE_PIIX_DEV("PIIXa", 0x00), /* no udma */ + /* 1 */ DECLARE_PIIX_DEV("PIIXb", 0x00), /* no udma */ /* 2 */ { /* @@ -587,28 +490,28 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = { .flags = IDEPCI_FLAG_ISA_PORTS }, - /* 3 */ DECLARE_PIIX_DEV("PIIX3"), - /* 4 */ DECLARE_PIIX_DEV("PIIX4"), - /* 5 */ DECLARE_PIIX_DEV("ICH0"), - /* 6 */ DECLARE_PIIX_DEV("PIIX4"), - /* 7 */ DECLARE_PIIX_DEV("ICH"), - /* 8 */ DECLARE_PIIX_DEV("PIIX4"), - /* 9 */ DECLARE_PIIX_DEV("PIIX4"), - /* 10 */ DECLARE_PIIX_DEV("ICH2"), - /* 11 */ DECLARE_PIIX_DEV("ICH2M"), - /* 12 */ DECLARE_PIIX_DEV("ICH3M"), - /* 13 */ DECLARE_PIIX_DEV("ICH3"), - /* 14 */ DECLARE_PIIX_DEV("ICH4"), - /* 15 */ DECLARE_PIIX_DEV("ICH5"), - /* 16 */ DECLARE_PIIX_DEV("C-ICH"), - /* 17 */ DECLARE_PIIX_DEV("ICH4"), - /* 18 */ DECLARE_PIIX_DEV("ICH5-SATA"), - /* 19 */ DECLARE_PIIX_DEV("ICH5"), - /* 20 */ DECLARE_PIIX_DEV("ICH6"), - /* 21 */ DECLARE_PIIX_DEV("ICH7"), - /* 22 */ DECLARE_PIIX_DEV("ICH4"), - /* 23 */ DECLARE_PIIX_DEV("ESB2"), - /* 24 */ DECLARE_PIIX_DEV("ICH8M"), + /* 3 */ DECLARE_PIIX_DEV("PIIX3", 0x00), /* no udma */ + /* 4 */ DECLARE_PIIX_DEV("PIIX4", 0x07), /* udma0-2 */ + /* 5 */ DECLARE_PIIX_DEV("ICH0", 0x07), /* udma0-2 */ + /* 6 */ DECLARE_PIIX_DEV("PIIX4", 0x07), /* udma0-2 */ + /* 7 */ DECLARE_PIIX_DEV("ICH", 0x1f), /* udma0-4 */ + /* 8 */ DECLARE_PIIX_DEV("PIIX4", 0x1f), /* udma0-4 */ + /* 9 */ DECLARE_PIIX_DEV("PIIX4", 0x07), /* udma0-2 */ + /* 10 */ DECLARE_PIIX_DEV("ICH2", 0x3f), /* udma0-5 */ + /* 11 */ DECLARE_PIIX_DEV("ICH2M", 0x3f), /* udma0-5 */ + /* 12 */ DECLARE_PIIX_DEV("ICH3M", 0x3f), /* udma0-5 */ + /* 13 */ DECLARE_PIIX_DEV("ICH3", 0x3f), /* udma0-5 */ + /* 14 */ DECLARE_PIIX_DEV("ICH4", 0x3f), /* udma0-5 */ + /* 15 */ DECLARE_PIIX_DEV("ICH5", 0x3f), /* udma0-5 */ + /* 16 */ DECLARE_PIIX_DEV("C-ICH", 0x3f), /* udma0-5 */ + /* 17 */ DECLARE_PIIX_DEV("ICH4", 0x3f), /* udma0-5 */ + /* 18 */ DECLARE_PIIX_DEV("ICH5-SATA", 0x3f), /* udma0-5 */ + /* 19 */ DECLARE_PIIX_DEV("ICH5", 0x3f), /* udma0-5 */ + /* 20 */ DECLARE_PIIX_DEV("ICH6", 0x3f), /* udma0-5 */ + /* 21 */ DECLARE_PIIX_DEV("ICH7", 0x3f), /* udma0-5 */ + /* 22 */ DECLARE_PIIX_DEV("ICH4", 0x3f), /* udma0-5 */ + /* 23 */ DECLARE_PIIX_DEV("ESB2", 0x3f), /* udma0-5 */ + /* 24 */ DECLARE_PIIX_DEV("ICH8M", 0x3f), /* udma0-5 */ }; /** diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c index f84bf79..cbf9363 100644 --- a/drivers/ide/pci/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c @@ -190,23 +190,6 @@ scc_ide_outsl(unsigned long port, void *addr, u32 count) } /** - * scc_ratemask - Compute available modes - * @drive: IDE drive - * - * Compute the available speeds for the devices on the interface. - * Enforce UDMA33 as a limit if there is no 80pin cable present. - */ - -static u8 scc_ratemask(ide_drive_t *drive) -{ - u8 mode = 4; - - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); - return mode; -} - -/** * scc_tuneproc - tune a drive PIO mode * @drive: drive to tune * @mode_wanted: the target operating mode @@ -273,7 +256,7 @@ static void scc_tuneproc(ide_drive_t *drive, byte mode_wanted) static int scc_tune_chipset(ide_drive_t *drive, byte xferspeed) { ide_hwif_t *hwif = HWIF(drive); - u8 speed = ide_rate_filter(scc_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); struct scc_ports *ports = ide_get_hwifdata(hwif); unsigned long ctl_base = ports->ctl; unsigned long cckctrl_port = ctl_base + 0xff0; @@ -347,7 +330,7 @@ static int scc_tune_chipset(ide_drive_t *drive, byte xferspeed) static int scc_config_chipset_for_dma(ide_drive_t *drive) { - u8 speed = ide_dma_speed(drive, scc_ratemask(drive)); + u8 speed = ide_max_dma_mode(drive); if (!speed) return 0; diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index dbcd37a..2fa6d92 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c @@ -65,16 +65,16 @@ static int check_in_drive_lists (ide_drive_t *drive, const char **list) return 0; } -static u8 svwks_ratemask (ide_drive_t *drive) +static u8 svwks_udma_filter(ide_drive_t *drive) { struct pci_dev *dev = HWIF(drive)->pci_dev; - u8 mode = 0; + u8 mask = 0; if (!svwks_revision) pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision); if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) - return 2; + return 0x1f; if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { u32 reg = 0; if (isa_dev) @@ -86,25 +86,31 @@ static u8 svwks_ratemask (ide_drive_t *drive) if(drive->media == ide_disk) return 0; /* Check the OSB4 DMA33 enable bit */ - return ((reg & 0x00004000) == 0x00004000) ? 1 : 0; + return ((reg & 0x00004000) == 0x00004000) ? 0x07 : 0; } else if (svwks_revision < SVWKS_CSB5_REVISION_NEW) { - return 1; + return 0x07; } else if (svwks_revision >= SVWKS_CSB5_REVISION_NEW) { - u8 btr = 0; + u8 btr = 0, mode; pci_read_config_byte(dev, 0x5A, &btr); mode = btr & 0x3; - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); + /* If someone decides to do UDMA133 on CSB5 the same issue will bite so be inclusive */ if (mode > 2 && check_in_drive_lists(drive, svwks_bad_ata100)) mode = 2; + + switch(mode) { + case 2: mask = 0x1f; break; + case 1: mask = 0x07; break; + default: mask = 0x00; break; + } } if (((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) && (!(PCI_FUNC(dev->devfn) & 1))) - mode = 2; - return mode; + mask = 0x1f; + + return mask; } static u8 svwks_csb_check (struct pci_dev *dev) @@ -141,7 +147,7 @@ static int svwks_tune_chipset (ide_drive_t *drive, u8 xferspeed) if (xferspeed == 255) /* PIO auto-tuning */ speed = XFER_PIO_0 + pio; else - speed = ide_rate_filter(svwks_ratemask(drive), xferspeed); + speed = ide_rate_filter(drive, xferspeed); /* If we are about to put a disk into UDMA mode we screwed up. Our code assumes we never _ever_ do this on an OSB4 */ @@ -304,7 +310,7 @@ static void svwks_tune_drive (ide_drive_t *drive, u8 pio) static int config_chipset_for_dma (ide_drive_t *drive) { - u8 speed = ide_dma_speed(drive, svwks_ratemask(drive)); + u8 speed = ide_max_dma_mode(drive); if (!(speed)) speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); @@ -500,6 +506,7 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif) hwif->tuneproc = &svwks_tune_drive; hwif->speedproc = &svwks_tune_chipset; + hwif->udma_filter = &svwks_udma_filter; hwif->atapi_dma = 1; diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index fd09b29..d3185e2 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c @@ -692,7 +692,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d) return -EIO; /* Create /proc/ide entries */ - create_proc_ide_interfaces(); + ide_proc_register_port(hwif); return 0; } diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index c0188de..5314ec9 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c @@ -122,45 +122,41 @@ static inline unsigned long siimage_seldev(ide_drive_t *drive, int r) } /** - * siimage_ratemask - Compute available modes - * @drive: IDE drive + * sil_udma_filter - compute UDMA mask + * @drive: IDE device + * + * Compute the available UDMA speeds for the device on the interface. * - * Compute the available speeds for the devices on the interface. * For the CMD680 this depends on the clocking mode (scsc), for the - * SI3312 SATA controller life is a bit simpler. Enforce UDMA33 - * as a limit if there is no 80pin cable present. + * SI3112 SATA controller life is a bit simpler. */ - -static byte siimage_ratemask (ide_drive_t *drive) + +static u8 sil_udma_filter(ide_drive_t *drive) { - ide_hwif_t *hwif = HWIF(drive); - u8 mode = 0, scsc = 0; + ide_hwif_t *hwif = drive->hwif; unsigned long base = (unsigned long) hwif->hwif_data; + u8 mask = 0, scsc = 0; if (hwif->mmio) scsc = hwif->INB(base + 0x4A); else pci_read_config_byte(hwif->pci_dev, 0x8A, &scsc); - if(is_sata(hwif)) - { - if(strstr(drive->id->model, "Maxtor")) - return 3; - return 4; + if (is_sata(hwif)) { + mask = strstr(drive->id->model, "Maxtor") ? 0x3f : 0x7f; + goto out; } - + if ((scsc & 0x30) == 0x10) /* 133 */ - mode = 4; + mask = 0x7f; else if ((scsc & 0x30) == 0x20) /* 2xPCI */ - mode = 4; + mask = 0x7f; else if ((scsc & 0x30) == 0x00) /* 100 */ - mode = 3; + mask = 0x3f; else /* Disabled ? */ BUG(); - - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); - return mode; +out: + return mask; } /** @@ -306,7 +302,7 @@ static int siimage_tune_chipset (ide_drive_t *drive, byte xferspeed) ide_hwif_t *hwif = HWIF(drive); u16 ultra = 0, multi = 0; u8 mode = 0, unit = drive->select.b.unit; - u8 speed = ide_rate_filter(siimage_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); unsigned long base = (unsigned long)hwif->hwif_data; u8 scsc = 0, addr_mask = ((hwif->channel) ? ((hwif->mmio) ? 0xF4 : 0x84) : @@ -389,7 +385,7 @@ static int siimage_tune_chipset (ide_drive_t *drive, byte xferspeed) static int config_chipset_for_dma (ide_drive_t *drive) { - u8 speed = ide_dma_speed(drive, siimage_ratemask(drive)); + u8 speed = ide_max_dma_mode(drive); if (!speed) return 0; @@ -989,6 +985,7 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif) hwif->tuneproc = &siimage_tuneproc; hwif->reset_poll = &siimage_reset_poll; hwif->pre_reset = &siimage_pre_reset; + hwif->udma_filter = &sil_udma_filter; if(is_sata(hwif)) { static int first = 1; diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 2ba0669..2bde1b9 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c @@ -191,7 +191,7 @@ static char* chipset_capability[] = { "ATA 133 (1st gen)", "ATA 133 (2nd gen)" }; -#if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) +#if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_IDE_PROC_FS) #include <linux/stat.h> #include <linux/proc_fs.h> @@ -426,17 +426,7 @@ static int sis_get_info (char *buffer, char **addr, off_t offset, int count) return len > count ? count : len; } -#endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */ - -static u8 sis5513_ratemask (ide_drive_t *drive) -{ - u8 rates[] = { 0, 0, 1, 2, 3, 3, 4, 4 }; - u8 mode = rates[chipset_family]; - - if (!eighty_ninty_three(drive)) - mode = min(mode, (u8)1); - return mode; -} +#endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_IDE_PROC_FS) */ /* * Configuration functions @@ -563,7 +553,7 @@ static int sis5513_tune_chipset (ide_drive_t *drive, u8 xferspeed) u8 drive_pci, reg, speed; u32 regdw; - speed = ide_rate_filter(sis5513_ratemask(drive), xferspeed); + speed = ide_rate_filter(drive, xferspeed); /* See config_art_rwp_pio for drive pci config registers */ drive_pci = 0x40; @@ -648,32 +638,13 @@ static void sis5513_tune_drive (ide_drive_t *drive, u8 pio) (void) config_chipset_for_pio(drive, pio); } -/* - * ((id->hw_config & 0x4000|0x2000) && (HWIF(drive)->udma_four)) - */ -static int config_chipset_for_dma (ide_drive_t *drive) -{ - u8 speed = ide_dma_speed(drive, sis5513_ratemask(drive)); - -#ifdef DEBUG - printk("SIS5513: config_chipset_for_dma, drive %d, ultra %x\n", - drive->dn, drive->id->dma_ultra); -#endif - - if (!(speed)) - return 0; - - sis5513_tune_chipset(drive, speed); - return ide_dma_enable(drive); -} - static int sis5513_config_xfer_rate(ide_drive_t *drive) { config_art_rwp_pio(drive, 5); drive->init_speed = 0; - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; if (ide_use_fast_pio(drive)) @@ -826,7 +797,7 @@ static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const c break; } -#if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) +#if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_IDE_PROC_FS) if (!sis_proc) { sis_proc = 1; bmide_dev = dev; @@ -858,6 +829,8 @@ static unsigned int __devinit ata66_sis5513 (ide_hwif_t *hwif) static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif) { + u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f }; + hwif->autodma = 0; if (!hwif->irq) @@ -873,7 +846,8 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif) } hwif->atapi_dma = 1; - hwif->ultra_mask = 0x7f; + + hwif->ultra_mask = udma_rates[chipset_family]; hwif->mwdma_mask = 0x07; hwif->swdma_mask = 0x07; diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index 852ccb3..c40f291 100644 --- a/drivers/ide/pci/slc90e66.c +++ b/drivers/ide/pci/slc90e66.c @@ -21,15 +21,6 @@ #include <asm/io.h> -static u8 slc90e66_ratemask (ide_drive_t *drive) -{ - u8 mode = 2; - - if (!eighty_ninty_three(drive)) - mode = min_t(u8, mode, 1); - return mode; -} - static u8 slc90e66_dma_2_pio (u8 xfer_rate) { switch(xfer_rate) { case XFER_UDMA_4: @@ -122,7 +113,7 @@ static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) ide_hwif_t *hwif = HWIF(drive); struct pci_dev *dev = hwif->pci_dev; u8 maslave = hwif->channel ? 0x42 : 0x40; - u8 speed = ide_rate_filter(slc90e66_ratemask(drive), xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); int sitre = 0, a_speed = 7 << (drive->dn * 4); int u_speed = 0, u_flag = 1 << drive->dn; u16 reg4042, reg44, reg48, reg4a; @@ -169,22 +160,11 @@ static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) return ide_config_drive_speed(drive, speed); } -static int slc90e66_config_drive_for_dma (ide_drive_t *drive) -{ - u8 speed = ide_dma_speed(drive, slc90e66_ratemask(drive)); - - if (!speed) - return 0; - - (void) slc90e66_tune_chipset(drive, speed); - return ide_dma_enable(drive); -} - static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive) { drive->init_speed = 0; - if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; if (ide_use_fast_pio(drive)) diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c index 0b6d81d..cee619b 100644 --- a/drivers/ide/pci/tc86c001.c +++ b/drivers/ide/pci/tc86c001.c @@ -13,18 +13,13 @@ #include <linux/pci.h> #include <linux/ide.h> -static inline u8 tc86c001_ratemask(ide_drive_t *drive) -{ - return eighty_ninty_three(drive) ? 2 : 1; -} - static int tc86c001_tune_chipset(ide_drive_t *drive, u8 speed) { ide_hwif_t *hwif = HWIF(drive); unsigned long scr_port = hwif->config_data + (drive->dn ? 0x02 : 0x00); u16 mode, scr = hwif->INW(scr_port); - speed = ide_rate_filter(tc86c001_ratemask(drive), speed); + speed = ide_rate_filter(drive, speed); switch (speed) { case XFER_UDMA_4: mode = 0x00c0; break; @@ -172,20 +167,9 @@ static int tc86c001_busproc(ide_drive_t *drive, int state) return 0; } -static int config_chipset_for_dma(ide_drive_t *drive) -{ - u8 speed = ide_dma_speed(drive, tc86c001_ratemask(drive)); - - if (!speed) - return 0; - - (void) tc86c001_tune_chipset(drive, speed); - return ide_dma_enable(drive); -} - static int tc86c001_config_drive_xfer_rate(ide_drive_t *drive) { - if (ide_use_dma(drive) && config_chipset_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; if (ide_use_fast_pio(drive)) diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index 5e06179..35e8c61 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c @@ -48,7 +48,7 @@ static int triflex_tune_chipset(ide_drive_t *drive, u8 xferspeed) u16 timing = 0; u32 triflex_timings = 0; u8 unit = (drive->select.b.unit & 0x01); - u8 speed = ide_rate_filter(0, xferspeed); + u8 speed = ide_rate_filter(drive, xferspeed); pci_read_config_dword(dev, channel_offset, &triflex_timings); @@ -100,20 +100,9 @@ static void triflex_tune_drive(ide_drive_t *drive, u8 pio) (void) triflex_tune_chipset(drive, (XFER_PIO_0 + use_pio)); } -static int triflex_config_drive_for_dma(ide_drive_t *drive) -{ - int speed = ide_dma_speed(drive, 0); /* No ultra speeds */ - - if (!speed) - return 0; - - (void) triflex_tune_chipset(drive, speed); - return ide_dma_enable(drive); -} - static int triflex_config_drive_xfer_rate(ide_drive_t *drive) { - if (ide_use_dma(drive) && triflex_config_drive_for_dma(drive)) + if (ide_tune_dma(drive)) return 0; triflex_tune_drive(drive, 255); diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index a49ebe4..45fc36f 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -1276,6 +1276,8 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif) /* We probe the hwif now */ probe_hwif_init(hwif); + ide_proc_register_port(hwif); + return 0; } diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index 118fb32..67035ba 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -702,6 +702,7 @@ out: int ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d) { + ide_hwif_t *hwif = NULL, *mate = NULL; ata_index_t index_list; int ret; @@ -710,11 +711,19 @@ int ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t *d) goto out; if ((index_list.b.low & 0xf0) != 0xf0) - probe_hwif_init_with_fixup(&ide_hwifs[index_list.b.low], d->fixup); + hwif = &ide_hwifs[index_list.b.low]; if ((index_list.b.high & 0xf0) != 0xf0) - probe_hwif_init_with_fixup(&ide_hwifs[index_list.b.high], d->fixup); + mate = &ide_hwifs[index_list.b.high]; - create_proc_ide_interfaces(); + if (hwif) + probe_hwif_init_with_fixup(hwif, d->fixup); + if (mate) + probe_hwif_init_with_fixup(mate, d->fixup); + + if (hwif) + ide_proc_register_port(hwif); + if (mate) + ide_proc_register_port(mate); out: return ret; } @@ -748,13 +757,22 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2, } } - create_proc_ide_interfaces(); + for (i = 0; i < 2; i++) { + u8 idx[2] = { index_list[i].b.low, index_list[i].b.high }; + int j; + + for (j = 0; j < 2; j++) { + if ((idx[j] & 0xf0) != 0xf0) + ide_proc_register_port(ide_hwifs + idx[j]); + } + } out: return ret; } EXPORT_SYMBOL_GPL(ide_setup_pci_devices); +#ifdef CONFIG_IDEPCI_PCIBUS_ORDER /* * Module interfaces */ @@ -861,3 +879,4 @@ void __init ide_scan_pcibus (int scan_direction) __pci_register_driver(d, d->driver.owner, d->driver.mod_name); } } +#endif diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index 0acf2f7..c803d2b 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c @@ -563,7 +563,7 @@ static void media_bay_step(int i) ide_init_hwif_ports(&hw, (unsigned long) bay->cd_base, (unsigned long) 0, NULL); hw.irq = bay->cd_irq; hw.chipset = ide_pmac; - bay->cd_index = ide_register_hw(&hw, NULL); + bay->cd_index = ide_register_hw(&hw, 0, NULL); pmu_resume(); } if (bay->cd_index == -1) { diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 2b5b8a9..8263f75 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -721,19 +721,23 @@ static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *r return ide_stopped; } +#ifdef CONFIG_IDE_PROC_FS static void idescsi_add_settings(ide_drive_t *drive) { idescsi_scsi_t *scsi = drive_to_idescsi(drive); /* - * drive setting name read/write ioctl ioctl data type min max mul_factor div_factor data pointer set function + * drive setting name read/write data type min max mul_factor div_factor data pointer set function */ - ide_add_setting(drive, "bios_cyl", SETTING_RW, -1, -1, TYPE_INT, 0, 1023, 1, 1, &drive->bios_cyl, NULL); - ide_add_setting(drive, "bios_head", SETTING_RW, -1, -1, TYPE_BYTE, 0, 255, 1, 1, &drive->bios_head, NULL); - ide_add_setting(drive, "bios_sect", SETTING_RW, -1, -1, TYPE_BYTE, 0, 63, 1, 1, &drive->bios_sect, NULL); - ide_add_setting(drive, "transform", SETTING_RW, -1, -1, TYPE_INT, 0, 3, 1, 1, &scsi->transform, NULL); - ide_add_setting(drive, "log", SETTING_RW, -1, -1, TYPE_INT, 0, 1, 1, 1, &scsi->log, NULL); + ide_add_setting(drive, "bios_cyl", SETTING_RW, TYPE_INT, 0, 1023, 1, 1, &drive->bios_cyl, NULL); + ide_add_setting(drive, "bios_head", SETTING_RW, TYPE_BYTE, 0, 255, 1, 1, &drive->bios_head, NULL); + ide_add_setting(drive, "bios_sect", SETTING_RW, TYPE_BYTE, 0, 63, 1, 1, &drive->bios_sect, NULL); + ide_add_setting(drive, "transform", SETTING_RW, TYPE_INT, 0, 3, 1, 1, &scsi->transform, NULL); + ide_add_setting(drive, "log", SETTING_RW, TYPE_INT, 0, 1, 1, 1, &scsi->log, NULL); } +#else +static inline void idescsi_add_settings(ide_drive_t *drive) { ; } +#endif /* * Driver initialization. @@ -756,7 +760,7 @@ static void ide_scsi_remove(ide_drive_t *drive) struct ide_scsi_obj *scsi = scsihost_to_idescsi(scsihost); struct gendisk *g = scsi->disk; - ide_unregister_subdriver(drive, scsi->driver); + ide_proc_unregister_driver(drive, scsi->driver); ide_unregister_region(g); @@ -770,13 +774,11 @@ static void ide_scsi_remove(ide_drive_t *drive) static int ide_scsi_probe(ide_drive_t *); -#ifdef CONFIG_PROC_FS +#ifdef CONFIG_IDE_PROC_FS static ide_proc_entry_t idescsi_proc[] = { { "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL }, { NULL, 0, NULL, NULL } }; -#else -# define idescsi_proc NULL #endif static ide_driver_t idescsi_driver = { @@ -790,11 +792,13 @@ static ide_driver_t idescsi_driver = { .version = IDESCSI_VERSION, .media = ide_scsi, .supports_dsc_overlap = 0, - .proc = idescsi_proc, .do_request = idescsi_do_request, .end_request = idescsi_end_request, .error = idescsi_atapi_error, .abort = idescsi_atapi_abort, +#ifdef CONFIG_IDE_PROC_FS + .proc = idescsi_proc, +#endif }; static int idescsi_ide_open(struct inode *inode, struct file *filp) @@ -1153,7 +1157,7 @@ static int ide_scsi_probe(ide_drive_t *drive) idescsi->host = host; idescsi->disk = g; g->private_data = &idescsi->driver; - ide_register_subdriver(drive, &idescsi_driver); + ide_proc_register_driver(drive, &idescsi_driver); err = 0; idescsi_setup(drive, idescsi); g->fops = &idescsi_ops; @@ -1165,7 +1169,7 @@ static int ide_scsi_probe(ide_drive_t *drive) } /* fall through on error */ ide_unregister_region(g); - ide_unregister_subdriver(drive, &idescsi_driver); + ide_proc_unregister_driver(drive, &idescsi_driver); put_disk(g); out_host_put: diff --git a/include/linux/ide.h b/include/linux/ide.h index 418dfb5..df4e6a5 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -223,8 +223,9 @@ typedef struct hw_regs_s { /* * Register new hardware with ide */ -int ide_register_hw(hw_regs_t *hw, struct hwif_s **hwifp); -int ide_register_hw_with_fixup(hw_regs_t *, struct hwif_s **, void (*)(struct hwif_s *)); +int ide_register_hw(hw_regs_t *, int, struct hwif_s **); +int ide_register_hw_with_fixup(hw_regs_t *, int, struct hwif_s **, + void (*)(struct hwif_s *)); /* * Set up hw_regs_t structure before calling ide_register_hw (optional) @@ -559,9 +560,10 @@ typedef struct ide_drive_s { struct ide_drive_s *next; /* circular list of hwgroup drives */ void *driver_data; /* extra driver data */ struct hd_driveid *id; /* drive model identification info */ +#ifdef CONFIG_IDE_PROC_FS struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ struct ide_settings_s *settings;/* /proc/ide/ drive settings */ - +#endif struct hwif_s *hwif; /* actually (ide_hwif_t *) */ unsigned long sleep; /* sleep until this time */ @@ -601,16 +603,12 @@ typedef struct ide_drive_s { 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 */ unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */ - unsigned addressing; /* : 3; - * 0=28-bit - * 1=48-bit - * 2=48-bit doing 28-bit - * 3=64-bit - */ unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ unsigned post_reset : 1; + unsigned udma33_warned : 1; + u8 addressing; /* 0=28-bit, 1=48-bit, 2=48-bit doing 28-bit */ u8 quirk_list; /* considered quirky, set for a specific host */ u8 init_speed; /* transfer rate set at boot */ u8 current_speed; /* current transfer rate set */ @@ -717,11 +715,8 @@ typedef struct hwif_s { int (*quirkproc)(ide_drive_t *); /* driver soft-power interface */ int (*busproc)(ide_drive_t *, int); -// /* host rate limiter */ -// u8 (*ratemask)(ide_drive_t *); -// /* device rate limiter */ -// u8 (*ratefilter)(ide_drive_t *, u8); #endif + u8 (*udma_filter)(ide_drive_t *); void (*ata_input_data)(ide_drive_t *, void *, u32); void (*ata_output_data)(ide_drive_t *, void *, u32); @@ -866,16 +861,22 @@ typedef struct hwgroup_s { unsigned char cmd_buf[4]; } ide_hwgroup_t; -/* structure attached to the request for IDE_TASK_CMDS */ +typedef struct ide_driver_s ide_driver_t; + +extern struct semaphore ide_setting_sem; + +int set_io_32bit(ide_drive_t *, int); +int set_pio_mode(ide_drive_t *, int); +int set_using_dma(ide_drive_t *, int); +#ifdef CONFIG_IDE_PROC_FS /* * configurable drive settings */ #define TYPE_INT 0 -#define TYPE_INTA 1 -#define TYPE_BYTE 2 -#define TYPE_SHORT 3 +#define TYPE_BYTE 1 +#define TYPE_SHORT 2 #define SETTING_READ (1 << 0) #define SETTING_WRITE (1 << 1) @@ -885,8 +886,6 @@ typedef int (ide_procset_t)(ide_drive_t *, int); typedef struct ide_settings_s { char *name; int rw; - int read_ioctl; - int write_ioctl; int data_type; int min; int max; @@ -898,12 +897,7 @@ typedef struct ide_settings_s { struct ide_settings_s *next; } ide_settings_t; -extern struct semaphore ide_setting_sem; -extern int ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set); -extern ide_settings_t *ide_find_setting_by_name(ide_drive_t *drive, char *name); -extern int ide_read_setting(ide_drive_t *t, ide_settings_t *setting); -extern int ide_write_setting(ide_drive_t *drive, ide_settings_t *setting, int val); -extern void ide_add_generic_settings(ide_drive_t *drive); +int ide_add_setting(ide_drive_t *, const char *, int, int, int, int, int, int, void *, ide_procset_t *set); /* * /proc/ide interface @@ -915,15 +909,15 @@ typedef struct { write_proc_t *write_proc; } ide_proc_entry_t; -#ifdef CONFIG_PROC_FS -extern struct proc_dir_entry *proc_ide_root; +void proc_ide_create(void); +void proc_ide_destroy(void); +void ide_proc_register_port(ide_hwif_t *); +void ide_proc_unregister_port(ide_hwif_t *); +void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); +void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); + +void ide_add_generic_settings(ide_drive_t *); -extern void proc_ide_create(void); -extern void proc_ide_destroy(void); -extern void create_proc_ide_interfaces(void); -void destroy_proc_ide_interface(ide_hwif_t *); -extern void ide_add_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *, void *); -extern void ide_remove_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *); read_proc_t proc_ide_read_capacity; read_proc_t proc_ide_read_geometry; @@ -947,8 +941,13 @@ void ide_pci_create_host_proc(const char *, get_info_t *); return len; \ } #else -static inline void create_proc_ide_interfaces(void) { ; } -static inline void destroy_proc_ide_interface(ide_hwif_t *hwif) { ; } +static inline void proc_ide_create(void) { ; } +static inline void proc_ide_destroy(void) { ; } +static inline void ide_proc_register_port(ide_hwif_t *hwif) { ; } +static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } +static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } +static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } +static inline void ide_add_generic_settings(ide_drive_t *drive) { ; } #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; #endif @@ -991,7 +990,7 @@ enum { * The gendriver.owner field should be set to the module owner of this driver. * The gendriver.name field should be set to the name of this driver */ -typedef struct ide_driver_s { +struct ide_driver_s { const char *version; u8 media; unsigned supports_dsc_overlap : 1; @@ -999,12 +998,14 @@ typedef struct ide_driver_s { int (*end_request)(ide_drive_t *, int, int); ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); - ide_proc_entry_t *proc; struct device_driver gen_driver; int (*probe)(ide_drive_t *); void (*remove)(ide_drive_t *); void (*shutdown)(ide_drive_t *); -} ide_driver_t; +#ifdef CONFIG_IDE_PROC_FS + ide_proc_entry_t *proc; +#endif +}; #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) @@ -1204,9 +1205,14 @@ void ide_init_disk(struct gendisk *, ide_drive_t *); extern int ideprobe_init(void); +#ifdef CONFIG_IDEPCI_PCIBUS_ORDER extern void ide_scan_pcibus(int scan_direction) __init; extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name); #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME) +#else +#define ide_pci_register_driver(d) pci_register_driver(d) +#endif + void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); @@ -1214,9 +1220,6 @@ extern void default_hwif_iops(ide_hwif_t *); extern void default_hwif_mmiops(ide_hwif_t *); extern void default_hwif_transport(ide_hwif_t *); -void ide_register_subdriver(ide_drive_t *, ide_driver_t *); -void ide_unregister_subdriver(ide_drive_t *, ide_driver_t *); - #define ON_BOARD 1 #define NEVER_BOARD 0 @@ -1257,6 +1260,7 @@ typedef struct ide_pci_device_s { unsigned int extra; struct ide_pci_device_s *next; u8 flags; + u8 udma_mask; } ide_pci_device_t; extern int ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); @@ -1278,6 +1282,8 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); int __ide_dma_bad_drive(ide_drive_t *); int __ide_dma_good_drive(ide_drive_t *); int ide_use_dma(ide_drive_t *); +u8 ide_max_dma_mode(ide_drive_t *); +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 *); @@ -1304,6 +1310,8 @@ extern int __ide_dma_timeout(ide_drive_t *); #else static inline int ide_use_dma(ide_drive_t *drive) { 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; } @@ -1348,8 +1356,7 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data) } /* ide-lib.c */ -extern u8 ide_dma_speed(ide_drive_t *drive, u8 mode); -extern u8 ide_rate_filter(u8 mode, u8 speed); +u8 ide_rate_filter(ide_drive_t *, u8); extern int ide_dma_enable(ide_drive_t *drive); extern char *ide_xfer_verbose(u8 xfer_rate); extern void ide_toggle_bounce(ide_drive_t *drive, int on); ^ permalink raw reply related [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2007-05-09 23:23 ` Bartlomiej Zolnierkiewicz @ 2007-05-09 23:18 ` Jeff Garzik 0 siblings, 0 replies; 67+ messages in thread From: Jeff Garzik @ 2007-05-09 23:18 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel Bartlomiej Zolnierkiewicz wrote: > On Thursday 10 May 2007, Jeff Garzik wrote: >> The limit was raised to 400K IIRC. > That's (good) news to me, here goes the actual 150K patch: Thanks. I did in fact receive copies from vger, so it went through. Jeff ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2007-05-09 22:46 [git patches] IDE update Bartlomiej Zolnierkiewicz 2007-05-09 22:46 ` Jeff Garzik @ 2007-05-09 22:47 ` Jeff Garzik 2007-05-09 22:59 ` Andrew Morton 1 sibling, 1 reply; 67+ messages in thread From: Jeff Garzik @ 2007-05-09 22:47 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz Cc: linux-ide, linux-kernel, Andrew Morton, Linus Torvalds Bartlomiej Zolnierkiewicz wrote: > * the code for selecting and programming the best DMA transfer mode > has been reworked to be cleaner, more generic and more libata-like, > (> 500 LOCs gone and this change allows the change described below) > Bartlomiej Zolnierkiewicz (11): > ide: rework the code for selecting the best DMA transfer mode (v3) Has this seen testing/exposure in -mm tree? Jeff ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2007-05-09 22:47 ` Jeff Garzik @ 2007-05-09 22:59 ` Andrew Morton 2007-05-09 23:15 ` Jeff Garzik 0 siblings, 1 reply; 67+ messages in thread From: Andrew Morton @ 2007-05-09 22:59 UTC (permalink / raw) To: Jeff Garzik Cc: Bartlomiej Zolnierkiewicz, linux-ide, linux-kernel, Linus Torvalds On Wed, 09 May 2007 18:47:23 -0400 Jeff Garzik <jeff@garzik.org> wrote: > Bartlomiej Zolnierkiewicz wrote: > > * the code for selecting and programming the best DMA transfer mode > > has been reworked to be cleaner, more generic and more libata-like, > > (> 500 LOCs gone and this change allows the change described below) > > > Bartlomiej Zolnierkiewicz (11): > > ide: rework the code for selecting the best DMA transfer mode (v3) > > > Has this seen testing/exposure in -mm tree? > argh. If this was in a file called ide-rework-the-code-for-selecting-the-best-DMA-transfer-mode.patch then it would be so easy. <logs into hera> <greps> ah, it's hidden in ide-max-dma-mode-v3.patch. akpm:/usr/src/25> grep ide-max-dma-mode-v3 pc/*series pc/2.6.21-mm1-series:ide-ide-max-dma-mode-v3.patch pc/2.6.21-mm2-series:ide-ide-max-dma-mode-v3.patch pc/2.6.21-rc2-mm2-series:ide-ide-max-dma-mode-v3.patch pc/2.6.21-rc3-mm1-series:ide-ide-max-dma-mode-v3.patch pc/2.6.21-rc3-mm2-series:ide-ide-max-dma-mode-v3.patch pc/2.6.21-rc4-mm1-series:ide-ide-max-dma-mode-v3.patch pc/2.6.21-rc5-mm3-series:ide-ide-max-dma-mode-v3.patch pc/2.6.21-rc5-mm4-series:ide-ide-max-dma-mode-v3.patch pc/2.6.21-rc6-mm1-series:ide-ide-max-dma-mode-v3.patch pc/2.6.21-rc7-mm1-series:ide-ide-max-dma-mode-v3.patch pc/2.6.21-rc7-mm2-series:ide-ide-max-dma-mode-v3.patch No probs. ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2007-05-09 22:59 ` Andrew Morton @ 2007-05-09 23:15 ` Jeff Garzik 0 siblings, 0 replies; 67+ messages in thread From: Jeff Garzik @ 2007-05-09 23:15 UTC (permalink / raw) To: Andrew Morton Cc: Bartlomiej Zolnierkiewicz, linux-ide, linux-kernel, Linus Torvalds Andrew Morton wrote: > Jeff Garzik <jeff@garzik.org> wrote: >> Has this seen testing/exposure in -mm tree? >> > > argh. If this was in a file called > ide-rework-the-code-for-selecting-the-best-DMA-transfer-mode.patch then it > would be so easy. > > <logs into hera> > > <greps> > > ah, it's hidden in ide-max-dma-mode-v3.patch. > > akpm:/usr/src/25> grep ide-max-dma-mode-v3 pc/*series > pc/2.6.21-mm1-series:ide-ide-max-dma-mode-v3.patch > pc/2.6.21-mm2-series:ide-ide-max-dma-mode-v3.patch > pc/2.6.21-rc2-mm2-series:ide-ide-max-dma-mode-v3.patch > pc/2.6.21-rc3-mm1-series:ide-ide-max-dma-mode-v3.patch > pc/2.6.21-rc3-mm2-series:ide-ide-max-dma-mode-v3.patch > pc/2.6.21-rc4-mm1-series:ide-ide-max-dma-mode-v3.patch > pc/2.6.21-rc5-mm3-series:ide-ide-max-dma-mode-v3.patch > pc/2.6.21-rc5-mm4-series:ide-ide-max-dma-mode-v3.patch > pc/2.6.21-rc6-mm1-series:ide-ide-max-dma-mode-v3.patch > pc/2.6.21-rc7-mm1-series:ide-ide-max-dma-mode-v3.patch > pc/2.6.21-rc7-mm2-series:ide-ide-max-dma-mode-v3.patch > > No probs. Cool beans. I'm happy then. Jeff ^ permalink raw reply [flat|nested] 67+ messages in thread
* [git patches] IDE update
@ 2007-07-09 21:46 Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 67+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-07-09 21:46 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-ide, linux-kernel
First IDE update for 2.6.23 merge window:
* Fixups/cleanups all over the place (detailed changelog somewhere below).
Thanks to all contributors!
* Support for short 40-wire cables.
If your laptop's disk was limited to UDMA33 because of failed cable
detection there is good chance that this update fixes the issue.
If it still doesn't please report it.
Linus, please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/
to receive the following updates:
drivers/ide/arm/icside.c | 16 +--
drivers/ide/cris/ide-cris.c | 2 +-
drivers/ide/ide-cd.c | 6 +-
drivers/ide/ide-cd.h | 2 -
drivers/ide/ide-disk.c | 8 +-
drivers/ide/ide-dma.c | 110 ++++++++++--------
drivers/ide/ide-io.c | 4 +-
drivers/ide/ide-iops.c | 8 +-
drivers/ide/ide-probe.c | 10 +-
drivers/ide/ide-proc.c | 34 +++---
drivers/ide/ide-timing.h | 56 +---------
drivers/ide/ide.c | 33 +++---
drivers/ide/legacy/hd.c | 2 +-
drivers/ide/legacy/macide.c | 14 ---
drivers/ide/mips/au1xxx-ide.c | 24 ++---
drivers/ide/pci/aec62xx.c | 119 ++++++-------------
drivers/ide/pci/alim15x3.c | 78 +++++++++-----
drivers/ide/pci/amd74xx.c | 127 ++++++++++-----------
drivers/ide/pci/atiixp.c | 5 +-
drivers/ide/pci/cmd64x.c | 130 ++++++++--------------
drivers/ide/pci/cs5535.c | 6 +-
drivers/ide/pci/hpt366.c | 170 +++++++++++++++-------------
drivers/ide/pci/it8213.c | 8 +-
drivers/ide/pci/it821x.c | 9 +-
drivers/ide/pci/jmicron.c | 20 ++--
drivers/ide/pci/pdc202xx_new.c | 9 +-
drivers/ide/pci/pdc202xx_old.c | 35 ++++--
drivers/ide/pci/piix.c | 45 ++++++-
drivers/ide/pci/scc_pata.c | 2 +-
drivers/ide/pci/serverworks.c | 103 +++---------------
drivers/ide/pci/sgiioc4.c | 20 ++--
drivers/ide/pci/siimage.c | 18 ++--
drivers/ide/pci/sis5513.c | 34 +++++-
drivers/ide/pci/sl82c105.c | 20 +--
drivers/ide/pci/slc90e66.c | 5 +-
drivers/ide/pci/tc86c001.c | 4 +-
drivers/ide/pci/via82cxxx.c | 175 +++++++++++++++++------------
drivers/ide/ppc/pmac.c | 42 ++-----
include/asm-mips/mach-au1x00/au1xxx_ide.h | 28 +++---
include/linux/ide.h | 18 ++--
40 files changed, 733 insertions(+), 826 deletions(-)
Adrian Bunk (1):
drivers/ide/ide-dma.c: unexport ide_set_dma
Andi Drebes (1):
drivers/ide/legacy/hd.c: Array size calculation using sizeof replaced with ARRAY_SIZE
Bartlomiej Zolnierkiewicz (8):
serverworks: always tune CSB6
ide: fix pre-EIDE SWDMA support
ide: convert ide_find_best_mode() users to use ide_max_dma_mode()
ide: add short cables support
piix: backport short cables support from ata_piix.c
alim15x3: backport short cables support from pata_ali.c
sis5513: backport short cables support from pata_sis.c
via82cxxx: backport short cables support from pata_via.c
Junio C Hamano (3):
ide_in_drive_list(): accept NULL as the wildcard for firmware revision
mips au1xxx_ide.h: use NULL as firmware-revision wildcard
ide_in_drive_list(): "ALL" is not a wildcard anymore
Matthias Kaehlcke (2):
ide: use mutex instead of ide_cfg_sem semaphore in IDE driver
ide: use mutex instead of ide_setting_sem semaphore in IDE driver
Robert P. J. Day (3):
ide-cd: replace C code with call to ARRAY_SIZE() macro
ide: remove references to the non-existent CONFIG_SCSI_EATA_DMA
ide: remove content related to dead CONFIG_BLK_DEV_MAC_MEDIABAY config variable
Sergei Shtylyov (7):
ide: make void and rename ide_dma_lostirq() method
ide: make void and rename ide_dma_timeout() method
hpt366: simplify UltraDMA filtering (take 4)
cmd64x: init. code cleanup
aec62xx: rework init_setup_aec6x80()
aec62xx: remove init_dma() method (take 2)
aec62xx: kill speedproc() method wrapper (take 2)
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 66f8262..444a0b8 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -448,23 +448,21 @@ static int icside_dma_test_irq(ide_drive_t *drive)
ICS_ARCIN_V6_INTRSTAT_1)) & 1;
}
-static int icside_dma_timeout(ide_drive_t *drive)
+static void icside_dma_timeout(ide_drive_t *drive)
{
printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name);
if (icside_dma_test_irq(drive))
- return 0;
+ return;
- ide_dump_status(drive, "DMA timeout",
- HWIF(drive)->INB(IDE_STATUS_REG));
+ ide_dump_status(drive, "DMA timeout", HWIF(drive)->INB(IDE_STATUS_REG));
- return icside_dma_end(drive);
+ icside_dma_end(drive);
}
-static int icside_dma_lostirq(ide_drive_t *drive)
+static void icside_dma_lost_irq(ide_drive_t *drive)
{
printk(KERN_ERR "%s: IRQ lost\n", drive->name);
- return 1;
}
static void icside_dma_init(ide_hwif_t *hwif)
@@ -490,8 +488,8 @@ static void icside_dma_init(ide_hwif_t *hwif)
hwif->dma_start = icside_dma_start;
hwif->ide_dma_end = icside_dma_end;
hwif->ide_dma_test_irq = icside_dma_test_irq;
- hwif->ide_dma_timeout = icside_dma_timeout;
- hwif->ide_dma_lostirq = icside_dma_lostirq;
+ hwif->dma_timeout = icside_dma_timeout;
+ hwif->dma_lost_irq = icside_dma_lost_irq;
hwif->drives[0].autodma = hwif->autodma;
hwif->drives[1].autodma = hwif->autodma;
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index ca0341c..886091b 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -819,7 +819,7 @@ init_e100_ide (void)
hwif->dma_host_off = &cris_dma_off;
hwif->dma_host_on = &cris_dma_on;
hwif->dma_off_quietly = &cris_dma_off;
- hwif->udma_four = 0;
+ hwif->cbl = ATA_CBL_PATA40;
hwif->ultra_mask = cris_ultra_mask;
hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */
hwif->autodma = 1;
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 252ab82..1486eb2 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -481,7 +481,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
else
printk(" Unknown Error Type: ");
- if (sense->sense_key < ARY_LEN(sense_key_texts))
+ if (sense->sense_key < ARRAY_SIZE(sense_key_texts))
s = sense_key_texts[sense->sense_key];
printk("%s -- (Sense key=0x%02x)\n", s, sense->sense_key);
@@ -491,7 +491,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
sense->ascq);
s = buf;
} else {
- int lo = 0, mid, hi = ARY_LEN(sense_data_texts);
+ int lo = 0, mid, hi = ARRAY_SIZE(sense_data_texts);
unsigned long key = (sense->sense_key << 16);
key |= (sense->asc << 8);
if (!(sense->ascq >= 0x80 && sense->ascq <= 0xdd))
@@ -524,7 +524,7 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
if (failed_command != NULL) {
- int lo=0, mid, hi= ARY_LEN (packet_command_texts);
+ int lo=0, mid, hi= ARRAY_SIZE(packet_command_texts);
s = NULL;
while (hi > lo) {
diff --git a/drivers/ide/ide-cd.h b/drivers/ide/ide-cd.h
index ad1f2ed..228b29c 100644
--- a/drivers/ide/ide-cd.h
+++ b/drivers/ide/ide-cd.h
@@ -498,8 +498,6 @@ struct cdrom_info {
* Descriptions of ATAPI error codes.
*/
-#define ARY_LEN(a) ((sizeof(a) / sizeof(a[0])))
-
/* This stuff should be in cdrom.h, since it is now generic... */
/* ATAPI sense keys (from table 140 of ATAPI 2.6) */
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index dc2175c..b1304a7 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -1190,11 +1190,11 @@ static int idedisk_ioctl(struct inode *inode, struct file *file,
return generic_ide_ioctl(drive, file, bdev, cmd, arg);
read_val:
- down(&ide_setting_sem);
+ mutex_lock(&ide_setting_mtx);
spin_lock_irqsave(&ide_lock, flags);
err = *val;
spin_unlock_irqrestore(&ide_lock, flags);
- up(&ide_setting_sem);
+ mutex_unlock(&ide_setting_mtx);
return err >= 0 ? put_user(err, (long __user *)arg) : err;
set_val:
@@ -1204,9 +1204,9 @@ set_val:
if (!capable(CAP_SYS_ADMIN))
err = -EACCES;
else {
- down(&ide_setting_sem);
+ mutex_lock(&ide_setting_mtx);
err = setfunc(drive, arg);
- up(&ide_setting_sem);
+ mutex_unlock(&ide_setting_mtx);
}
}
return err;
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index ead141e..5fe1d72 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -91,45 +91,45 @@
static const struct drive_list_entry drive_whitelist [] = {
- { "Micropolis 2112A" , "ALL" },
- { "CONNER CTMA 4000" , "ALL" },
- { "CONNER CTT8000-A" , "ALL" },
- { "ST34342A" , "ALL" },
+ { "Micropolis 2112A" , NULL },
+ { "CONNER CTMA 4000" , NULL },
+ { "CONNER CTT8000-A" , NULL },
+ { "ST34342A" , NULL },
{ NULL , NULL }
};
static const struct drive_list_entry drive_blacklist [] = {
- { "WDC AC11000H" , "ALL" },
- { "WDC AC22100H" , "ALL" },
- { "WDC AC32500H" , "ALL" },
- { "WDC AC33100H" , "ALL" },
- { "WDC AC31600H" , "ALL" },
+ { "WDC AC11000H" , NULL },
+ { "WDC AC22100H" , NULL },
+ { "WDC AC32500H" , NULL },
+ { "WDC AC33100H" , NULL },
+ { "WDC AC31600H" , NULL },
{ "WDC AC32100H" , "24.09P07" },
{ "WDC AC23200L" , "21.10N21" },
- { "Compaq CRD-8241B" , "ALL" },
- { "CRD-8400B" , "ALL" },
- { "CRD-8480B", "ALL" },
- { "CRD-8482B", "ALL" },
- { "CRD-84" , "ALL" },
- { "SanDisk SDP3B" , "ALL" },
- { "SanDisk SDP3B-64" , "ALL" },
- { "SANYO CD-ROM CRD" , "ALL" },
- { "HITACHI CDR-8" , "ALL" },
- { "HITACHI CDR-8335" , "ALL" },
- { "HITACHI CDR-8435" , "ALL" },
- { "Toshiba CD-ROM XM-6202B" , "ALL" },
- { "TOSHIBA CD-ROM XM-1702BC", "ALL" },
- { "CD-532E-A" , "ALL" },
- { "E-IDE CD-ROM CR-840", "ALL" },
- { "CD-ROM Drive/F5A", "ALL" },
- { "WPI CDD-820", "ALL" },
- { "SAMSUNG CD-ROM SC-148C", "ALL" },
- { "SAMSUNG CD-ROM SC", "ALL" },
- { "ATAPI CD-ROM DRIVE 40X MAXIMUM", "ALL" },
- { "_NEC DV5800A", "ALL" },
+ { "Compaq CRD-8241B" , NULL },
+ { "CRD-8400B" , NULL },
+ { "CRD-8480B", NULL },
+ { "CRD-8482B", NULL },
+ { "CRD-84" , NULL },
+ { "SanDisk SDP3B" , NULL },
+ { "SanDisk SDP3B-64" , NULL },
+ { "SANYO CD-ROM CRD" , NULL },
+ { "HITACHI CDR-8" , NULL },
+ { "HITACHI CDR-8335" , NULL },
+ { "HITACHI CDR-8435" , NULL },
+ { "Toshiba CD-ROM XM-6202B" , NULL },
+ { "TOSHIBA CD-ROM XM-1702BC", NULL },
+ { "CD-532E-A" , NULL },
+ { "E-IDE CD-ROM CR-840", NULL },
+ { "CD-ROM Drive/F5A", NULL },
+ { "WPI CDD-820", NULL },
+ { "SAMSUNG CD-ROM SC-148C", NULL },
+ { "SAMSUNG CD-ROM SC", NULL },
+ { "ATAPI CD-ROM DRIVE 40X MAXIMUM", NULL },
+ { "_NEC DV5800A", NULL },
{ "SAMSUNG CD-ROM SN-124", "N001" },
- { "Seagate STT20000A", "ALL" },
+ { "Seagate STT20000A", NULL },
{ NULL , NULL }
};
@@ -147,8 +147,8 @@ int ide_in_drive_list(struct hd_driveid *id, const struct drive_list_entry *driv
{
for ( ; drive_table->id_model ; drive_table++)
if ((!strcmp(drive_table->id_model, id->model)) &&
- ((strstr(id->fw_rev, drive_table->id_firmware)) ||
- (!strcmp(drive_table->id_firmware, "ALL"))))
+ (!drive_table->id_firmware ||
+ strstr(id->fw_rev, drive_table->id_firmware)))
return 1;
return 0;
}
@@ -702,8 +702,22 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base)
mask = id->dma_mword & hwif->mwdma_mask;
break;
case XFER_SW_DMA_0:
- if (id->field_valid & 2)
+ if (id->field_valid & 2) {
mask = id->dma_1word & hwif->swdma_mask;
+ } else if (id->tDMA) {
+ /*
+ * ide_fix_driveid() doesn't convert ->tDMA to the
+ * CPU endianness so we need to do it here
+ */
+ u8 mode = le16_to_cpu(id->tDMA);
+
+ /*
+ * if the mode is valid convert it to the mask
+ * (the maximum allowed mode is XFER_SW_DMA_2)
+ */
+ if (mode <= 2)
+ mask = ((2 << mode) - 1) & hwif->swdma_mask;
+ }
break;
default:
BUG();
@@ -847,27 +861,27 @@ int ide_set_dma(ide_drive_t *drive)
return rc;
}
-EXPORT_SYMBOL_GPL(ide_set_dma);
-
#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
-int __ide_dma_lostirq (ide_drive_t *drive)
+void ide_dma_lost_irq (ide_drive_t *drive)
{
printk("%s: DMA interrupt recovery\n", drive->name);
- return 1;
}
-EXPORT_SYMBOL(__ide_dma_lostirq);
+EXPORT_SYMBOL(ide_dma_lost_irq);
-int __ide_dma_timeout (ide_drive_t *drive)
+void ide_dma_timeout (ide_drive_t *drive)
{
+ ide_hwif_t *hwif = HWIF(drive);
+
printk(KERN_ERR "%s: timeout waiting for DMA\n", drive->name);
- if (HWIF(drive)->ide_dma_test_irq(drive))
- return 0;
- return HWIF(drive)->ide_dma_end(drive);
+ if (hwif->ide_dma_test_irq(drive))
+ return;
+
+ hwif->ide_dma_end(drive);
}
-EXPORT_SYMBOL(__ide_dma_timeout);
+EXPORT_SYMBOL(ide_dma_timeout);
/*
* Needed for allowing full modular support of ide-driver
@@ -1018,10 +1032,10 @@ void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_p
hwif->ide_dma_end = &__ide_dma_end;
if (!hwif->ide_dma_test_irq)
hwif->ide_dma_test_irq = &__ide_dma_test_irq;
- if (!hwif->ide_dma_timeout)
- hwif->ide_dma_timeout = &__ide_dma_timeout;
- if (!hwif->ide_dma_lostirq)
- hwif->ide_dma_lostirq = &__ide_dma_lostirq;
+ if (!hwif->dma_timeout)
+ hwif->dma_timeout = &ide_dma_timeout;
+ if (!hwif->dma_lost_irq)
+ hwif->dma_lost_irq = &ide_dma_lost_irq;
if (hwif->chipset != ide_trm290) {
u8 dma_stat = hwif->INB(hwif->dma_status);
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index bfe8f1b..c5b5011 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1350,7 +1350,7 @@ static ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error)
hwif->INB(IDE_STATUS_REG));
} else {
printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name);
- (void) hwif->ide_dma_timeout(drive);
+ hwif->dma_timeout(drive);
}
/*
@@ -1466,7 +1466,7 @@ void ide_timer_expiry (unsigned long data)
startstop = handler(drive);
} else if (drive_is_ready(drive)) {
if (drive->waiting_for_dma)
- (void) hwgroup->hwif->ide_dma_lostirq(drive);
+ hwgroup->hwif->dma_lost_irq(drive);
(void)ide_ack_intr(hwif);
printk(KERN_WARNING "%s: lost interrupt\n", drive->name);
startstop = handler(drive);
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index f0be5f6..92578b6 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -574,7 +574,10 @@ u8 eighty_ninty_three (ide_drive_t *drive)
ide_hwif_t *hwif = drive->hwif;
struct hd_driveid *id = drive->id;
- if (hwif->udma_four == 0)
+ if (hwif->cbl == ATA_CBL_PATA40_SHORT)
+ return 1;
+
+ if (hwif->cbl != ATA_CBL_PATA80)
goto no_80w;
/* Check for SATA but only if we are ATA5 or higher */
@@ -600,7 +603,8 @@ no_80w:
printk(KERN_WARNING "%s: %s side 80-wire cable detection failed, "
"limiting max speed to UDMA33\n",
- drive->name, hwif->udma_four ? "drive" : "host");
+ drive->name,
+ hwif->cbl == ATA_CBL_PATA80 ? "drive" : "host");
drive->udma33_warned = 1;
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index f5ce22c..cc58013 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -144,7 +144,7 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
local_irq_enable();
ide_fix_driveid(id);
-#if defined (CONFIG_SCSI_EATA_DMA) || defined (CONFIG_SCSI_EATA_PIO) || defined (CONFIG_SCSI_EATA)
+#if defined (CONFIG_SCSI_EATA_PIO) || defined (CONFIG_SCSI_EATA)
/*
* EATA SCSI controllers do a hardware ATA emulation:
* Ignore them if there is a driver for them available.
@@ -154,7 +154,7 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
printk("%s: EATA SCSI HBA %.10s\n", drive->name, id->model);
goto err_misc;
}
-#endif /* CONFIG_SCSI_EATA_DMA || CONFIG_SCSI_EATA_PIO */
+#endif /* CONFIG_SCSI_EATA || CONFIG_SCSI_EATA_PIO */
/*
* WIN_IDENTIFY returns little-endian info,
@@ -1025,7 +1025,7 @@ static int init_irq (ide_hwif_t *hwif)
BUG_ON(irqs_disabled());
BUG_ON(hwif == NULL);
- down(&ide_cfg_sem);
+ mutex_lock(&ide_cfg_mtx);
hwif->hwgroup = NULL;
#if MAX_HWIFS > 1
/*
@@ -1154,7 +1154,7 @@ static int init_irq (ide_hwif_t *hwif)
printk(" (%sed with %s)",
hwif->sharing_irq ? "shar" : "serializ", match->name);
printk("\n");
- up(&ide_cfg_sem);
+ mutex_unlock(&ide_cfg_mtx);
return 0;
out_unlink:
spin_lock_irq(&ide_lock);
@@ -1177,7 +1177,7 @@ out_unlink:
}
spin_unlock_irq(&ide_lock);
out_up:
- up(&ide_cfg_sem);
+ mutex_unlock(&ide_cfg_mtx);
return 1;
}
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index ea94c9a..fc1d8ae 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -156,7 +156,7 @@ static int __ide_add_setting(ide_drive_t *drive, const char *name, int rw, int d
{
ide_settings_t **p = (ide_settings_t **) &drive->settings, *setting = NULL;
- down(&ide_setting_sem);
+ mutex_lock(&ide_setting_mtx);
while ((*p) && strcmp((*p)->name, name) < 0)
p = &((*p)->next);
if ((setting = kzalloc(sizeof(*setting), GFP_KERNEL)) == NULL)
@@ -177,10 +177,10 @@ static int __ide_add_setting(ide_drive_t *drive, const char *name, int rw, int d
if (auto_remove)
setting->auto_remove = 1;
*p = setting;
- up(&ide_setting_sem);
+ mutex_unlock(&ide_setting_mtx);
return 0;
abort:
- up(&ide_setting_sem);
+ mutex_unlock(&ide_setting_mtx);
kfree(setting);
return -1;
}
@@ -224,7 +224,7 @@ static void __ide_remove_setting (ide_drive_t *drive, char *name)
*
* Automatically remove all the driver specific settings for this
* drive. This function may not be called from IRQ context. The
- * caller must hold ide_setting_sem.
+ * caller must hold ide_setting_mtx.
*/
static void auto_remove_settings (ide_drive_t *drive)
@@ -269,7 +269,7 @@ static ide_settings_t *ide_find_setting_by_name(ide_drive_t *drive, char *name)
* @setting: drive setting
*
* Read a drive setting and return the value. The caller
- * must hold the ide_setting_sem when making this call.
+ * must hold the ide_setting_mtx when making this call.
*
* BUGS: the data return and error are the same return value
* so an error -EINVAL and true return of the same value cannot
@@ -306,7 +306,7 @@ static int ide_read_setting(ide_drive_t *drive, ide_settings_t *setting)
* @val: value
*
* Write a drive setting if it is possible. The caller
- * must hold the ide_setting_sem when making this call.
+ * must hold the ide_setting_mtx when making this call.
*
* BUGS: the data return and error are the same return value
* so an error -EINVAL and true return of the same value cannot
@@ -367,7 +367,7 @@ static int set_xfer_rate (ide_drive_t *drive, int arg)
* @drive: drive being configured
*
* Add the generic parts of the system settings to the /proc files.
- * The caller must not be holding the ide_setting_sem.
+ * The caller must not be holding the ide_setting_mtx.
*/
void ide_add_generic_settings (ide_drive_t *drive)
@@ -408,7 +408,7 @@ static int proc_ide_read_settings
proc_ide_settings_warn();
- down(&ide_setting_sem);
+ mutex_lock(&ide_setting_mtx);
out += sprintf(out, "name\t\t\tvalue\t\tmin\t\tmax\t\tmode\n");
out += sprintf(out, "----\t\t\t-----\t\t---\t\t---\t\t----\n");
while(setting) {
@@ -428,7 +428,7 @@ static int proc_ide_read_settings
setting = setting->next;
}
len = out - page;
- up(&ide_setting_sem);
+ mutex_unlock(&ide_setting_mtx);
PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
}
@@ -508,16 +508,16 @@ static int proc_ide_write_settings(struct file *file, const char __user *buffer,
++p;
}
- down(&ide_setting_sem);
+ mutex_lock(&ide_setting_mtx);
setting = ide_find_setting_by_name(drive, name);
if (!setting)
{
- up(&ide_setting_sem);
+ mutex_unlock(&ide_setting_mtx);
goto parse_error;
}
if (for_real)
ide_write_setting(drive, setting, val * setting->div_factor / setting->mul_factor);
- up(&ide_setting_sem);
+ mutex_unlock(&ide_setting_mtx);
}
} while (!for_real++);
free_page((unsigned long)buf);
@@ -705,7 +705,7 @@ EXPORT_SYMBOL(ide_proc_register_driver);
* Clean up the driver specific /proc files and IDE settings
* for a given drive.
*
- * Takes ide_setting_sem and ide_lock.
+ * Takes ide_setting_mtx and ide_lock.
* Caller must hold none of the locks.
*/
@@ -715,10 +715,10 @@ void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver)
ide_remove_proc_entries(drive->proc, driver->proc);
- down(&ide_setting_sem);
+ mutex_lock(&ide_setting_mtx);
spin_lock_irqsave(&ide_lock, flags);
/*
- * ide_setting_sem protects the settings list
+ * ide_setting_mtx protects the settings list
* ide_lock protects the use of settings
*
* so we need to hold both, ide_settings_sem because we want to
@@ -726,11 +726,11 @@ void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver)
* a setting out that is being used.
*
* OTOH both ide_{read,write}_setting are only ever used under
- * ide_setting_sem.
+ * ide_setting_mtx.
*/
auto_remove_settings(drive);
spin_unlock_irqrestore(&ide_lock, flags);
- up(&ide_setting_sem);
+ mutex_unlock(&ide_setting_mtx);
}
EXPORT_SYMBOL(ide_proc_unregister_driver);
diff --git a/drivers/ide/ide-timing.h b/drivers/ide/ide-timing.h
index c0864b1..e6cb859 100644
--- a/drivers/ide/ide-timing.h
+++ b/drivers/ide/ide-timing.h
@@ -102,66 +102,16 @@ static struct ide_timing ide_timing[] = {
#define EZ(v,unit) ((v)?ENOUGH(v,unit):0)
#define XFER_MODE 0xf0
-#define XFER_UDMA_133 0x48
-#define XFER_UDMA_100 0x44
-#define XFER_UDMA_66 0x42
-#define XFER_UDMA 0x40
#define XFER_MWDMA 0x20
-#define XFER_SWDMA 0x10
#define XFER_EPIO 0x01
#define XFER_PIO 0x00
-static short ide_find_best_mode(ide_drive_t *drive, int map)
+static short ide_find_best_pio_mode(ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
short best = 0;
- if (!id)
- return XFER_PIO_SLOW;
-
- if ((map & XFER_UDMA) && (id->field_valid & 4)) { /* Want UDMA and UDMA bitmap valid */
-
- if ((map & XFER_UDMA_133) == XFER_UDMA_133)
- if ((best = (id->dma_ultra & 0x0040) ? XFER_UDMA_6 : 0)) return best;
-
- if ((map & XFER_UDMA_100) == XFER_UDMA_100)
- if ((best = (id->dma_ultra & 0x0020) ? XFER_UDMA_5 : 0)) return best;
-
- if ((map & XFER_UDMA_66) == XFER_UDMA_66)
- if ((best = (id->dma_ultra & 0x0010) ? XFER_UDMA_4 :
- (id->dma_ultra & 0x0008) ? XFER_UDMA_3 : 0)) return best;
-
- if ((best = (id->dma_ultra & 0x0004) ? XFER_UDMA_2 :
- (id->dma_ultra & 0x0002) ? XFER_UDMA_1 :
- (id->dma_ultra & 0x0001) ? XFER_UDMA_0 : 0)) return best;
- }
-
- if ((map & XFER_MWDMA) && (id->field_valid & 2)) { /* Want MWDMA and drive has EIDE fields */
-
- if ((best = (id->dma_mword & 0x0004) ? XFER_MW_DMA_2 :
- (id->dma_mword & 0x0002) ? XFER_MW_DMA_1 :
- (id->dma_mword & 0x0001) ? XFER_MW_DMA_0 : 0)) return best;
- }
-
- if (map & XFER_SWDMA) { /* Want SWDMA */
-
- if (id->field_valid & 2) { /* EIDE SWDMA */
-
- if ((best = (id->dma_1word & 0x0004) ? XFER_SW_DMA_2 :
- (id->dma_1word & 0x0002) ? XFER_SW_DMA_1 :
- (id->dma_1word & 0x0001) ? XFER_SW_DMA_0 : 0)) return best;
- }
-
- if (id->capability & 1) { /* Pre-EIDE style SWDMA */
-
- if ((best = (id->tDMA == 2) ? XFER_SW_DMA_2 :
- (id->tDMA == 1) ? XFER_SW_DMA_1 :
- (id->tDMA == 0) ? XFER_SW_DMA_0 : 0)) return best;
- }
- }
-
-
- if ((map & XFER_EPIO) && (id->field_valid & 2)) { /* EIDE PIO modes */
+ if (id->field_valid & 2) { /* EIDE PIO modes */
if ((best = (drive->id->eide_pio_modes & 4) ? XFER_PIO_5 :
(drive->id->eide_pio_modes & 2) ? XFER_PIO_4 :
@@ -262,7 +212,7 @@ static int ide_timing_compute(ide_drive_t *drive, short speed, struct ide_timing
*/
if ((speed & XFER_MODE) != XFER_PIO) {
- ide_timing_compute(drive, ide_find_best_mode(drive, XFER_PIO | XFER_EPIO), &p, T, UT);
+ ide_timing_compute(drive, ide_find_best_pio_mode(drive), &p, T, UT);
ide_timing_merge(&p, t, t, IDE_TIMING_ALL);
}
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 0cd76bf..c948a5c 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -169,7 +169,7 @@ static const u8 ide_hwif_to_major[] = { IDE0_MAJOR, IDE1_MAJOR,
static int idebus_parameter; /* holds the "idebus=" parameter */
static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */
-DECLARE_MUTEX(ide_cfg_sem);
+DEFINE_MUTEX(ide_cfg_mtx);
__cacheline_aligned_in_smp DEFINE_SPINLOCK(ide_lock);
#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
@@ -460,6 +460,8 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
hwif->mwdma_mask = tmp_hwif->mwdma_mask;
hwif->swdma_mask = tmp_hwif->swdma_mask;
+ hwif->cbl = tmp_hwif->cbl;
+
hwif->chipset = tmp_hwif->chipset;
hwif->hold = tmp_hwif->hold;
@@ -496,8 +498,8 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
hwif->ide_dma_clear_irq = tmp_hwif->ide_dma_clear_irq;
hwif->dma_host_on = tmp_hwif->dma_host_on;
hwif->dma_host_off = tmp_hwif->dma_host_off;
- hwif->ide_dma_lostirq = tmp_hwif->ide_dma_lostirq;
- hwif->ide_dma_timeout = tmp_hwif->ide_dma_timeout;
+ hwif->dma_lost_irq = tmp_hwif->dma_lost_irq;
+ hwif->dma_timeout = tmp_hwif->dma_timeout;
hwif->OUTB = tmp_hwif->OUTB;
hwif->OUTBSYNC = tmp_hwif->OUTBSYNC;
@@ -533,7 +535,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
hwif->extra_base = tmp_hwif->extra_base;
hwif->extra_ports = tmp_hwif->extra_ports;
hwif->autodma = tmp_hwif->autodma;
- hwif->udma_four = tmp_hwif->udma_four;
hwif->hwif_data = tmp_hwif->hwif_data;
}
@@ -564,7 +565,7 @@ void ide_unregister(unsigned int index)
{
ide_drive_t *drive;
ide_hwif_t *hwif, *g;
- static ide_hwif_t tmp_hwif; /* protected by ide_cfg_sem */
+ static ide_hwif_t tmp_hwif; /* protected by ide_cfg_mtx */
ide_hwgroup_t *hwgroup;
int irq_count = 0, unit;
@@ -572,7 +573,7 @@ void ide_unregister(unsigned int index)
BUG_ON(in_interrupt());
BUG_ON(irqs_disabled());
- down(&ide_cfg_sem);
+ mutex_lock(&ide_cfg_mtx);
spin_lock_irq(&ide_lock);
hwif = &ide_hwifs[index];
if (!hwif->present)
@@ -679,7 +680,7 @@ void ide_unregister(unsigned int index)
abort:
spin_unlock_irq(&ide_lock);
- up(&ide_cfg_sem);
+ mutex_unlock(&ide_cfg_mtx);
}
EXPORT_SYMBOL(ide_unregister);
@@ -817,9 +818,9 @@ EXPORT_SYMBOL(ide_register_hw);
* Locks for IDE setting functionality
*/
-DECLARE_MUTEX(ide_setting_sem);
+DEFINE_MUTEX(ide_setting_mtx);
-EXPORT_SYMBOL_GPL(ide_setting_sem);
+EXPORT_SYMBOL_GPL(ide_setting_mtx);
/**
* ide_spin_wait_hwgroup - wait for group
@@ -1192,11 +1193,11 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device
}
read_val:
- down(&ide_setting_sem);
+ mutex_lock(&ide_setting_mtx);
spin_lock_irqsave(&ide_lock, flags);
err = *val;
spin_unlock_irqrestore(&ide_lock, flags);
- up(&ide_setting_sem);
+ mutex_unlock(&ide_setting_mtx);
return err >= 0 ? put_user(err, (long __user *)arg) : err;
set_val:
@@ -1206,9 +1207,9 @@ set_val:
if (!capable(CAP_SYS_ADMIN))
err = -EACCES;
else {
- down(&ide_setting_sem);
+ mutex_lock(&ide_setting_mtx);
err = setfunc(drive, arg);
- up(&ide_setting_sem);
+ mutex_unlock(&ide_setting_mtx);
}
}
return err;
@@ -1548,7 +1549,11 @@ static int __init ide_setup(char *s)
goto bad_option;
case -7: /* ata66 */
#ifdef CONFIG_BLK_DEV_IDEPCI
- hwif->udma_four = 1;
+ /*
+ * Use ATA_CBL_PATA40_SHORT so drive side
+ * cable detection is also overriden.
+ */
+ hwif->cbl = ATA_CBL_PATA40_SHORT;
goto obsolete_option;
#else
goto bad_hwif;
diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c
index 45ed035..661c12f 100644
--- a/drivers/ide/legacy/hd.c
+++ b/drivers/ide/legacy/hd.c
@@ -130,7 +130,7 @@ struct hd_i_struct {
#ifdef HD_TYPE
static struct hd_i_struct hd_info[] = { HD_TYPE };
-static int NR_HD = ((sizeof (hd_info))/(sizeof (struct hd_i_struct)));
+static int NR_HD = ARRAY_SIZE(hd_info);
#else
static struct hd_i_struct hd_info[MAX_HD];
static int NR_HD;
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index c211fc7..b557c45 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -77,15 +77,6 @@ int macide_ack_intr(ide_hwif_t* hwif)
return 0;
}
-#ifdef CONFIG_BLK_DEV_MAC_MEDIABAY
-static void macide_mediabay_interrupt(int irq, void *dev_id)
-{
- int state = baboon->mb_status & 0x04;
-
- printk(KERN_INFO "macide: media bay %s detected\n", state? "removal":"insertion");
-}
-#endif
-
/*
* Probe for a Macintosh IDE interface
*/
@@ -128,11 +119,6 @@ void macide_init(void)
ide_drive_t *drive = &ide_hwifs[index].drives[0];
drive->capacity64 = drive->cyl*drive->head*drive->sect;
-#ifdef CONFIG_BLK_DEV_MAC_MEDIABAY
- request_irq(IRQ_BABOON_2, macide_mediabay_interrupt,
- IRQ_FLG_FAST, "mediabay",
- macide_mediabay_interrupt);
-#endif
}
break;
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index ca95e99..2e7013a 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -381,9 +381,7 @@ static int auide_dma_setup(ide_drive_t *drive)
static int auide_dma_check(ide_drive_t *drive)
{
- u8 speed;
-
-#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
+ u8 speed = ide_max_dma_mode(drive);
if( dbdma_init_done == 0 ){
auide_hwif.white_list = ide_in_drive_list(drive->id,
@@ -394,7 +392,6 @@ static int auide_dma_check(ide_drive_t *drive)
auide_ddma_init(&auide_hwif);
dbdma_init_done = 1;
}
-#endif
/* Is the drive in our DMA black list? */
@@ -409,8 +406,6 @@ static int auide_dma_check(ide_drive_t *drive)
else
drive->using_dma = 1;
- speed = ide_find_best_mode(drive, XFER_PIO | XFER_MWDMA);
-
if (drive->autodma && (speed & XFER_MODE) != XFER_PIO)
return 0;
@@ -456,10 +451,9 @@ static void auide_dma_off_quietly(ide_drive_t *drive)
drive->using_dma = 0;
}
-static int auide_dma_lostirq(ide_drive_t *drive)
+static void auide_dma_lost_irq(ide_drive_t *drive)
{
printk(KERN_ERR "%s: IRQ lost\n", drive->name);
- return 0;
}
static void auide_ddma_tx_callback(int irq, void *param)
@@ -489,16 +483,16 @@ static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 de
#if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA)
-static int auide_dma_timeout(ide_drive_t *drive)
+static void auide_dma_timeout(ide_drive_t *drive)
{
-// printk("%s\n", __FUNCTION__);
+ ide_hwif_t *hwif = HWIF(drive);
printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name);
- if (HWIF(drive)->ide_dma_test_irq(drive))
- return 0;
+ if (hwif->ide_dma_test_irq(drive))
+ return;
- return HWIF(drive)->ide_dma_end(drive);
+ hwif->ide_dma_end(drive);
}
@@ -721,7 +715,7 @@ static int au_ide_probe(struct device *dev)
#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
hwif->dma_off_quietly = &auide_dma_off_quietly;
- hwif->ide_dma_timeout = &auide_dma_timeout;
+ hwif->dma_timeout = &auide_dma_timeout;
hwif->ide_dma_check = &auide_dma_check;
hwif->dma_exec_cmd = &auide_dma_exec_cmd;
@@ -731,7 +725,7 @@ static int au_ide_probe(struct device *dev)
hwif->ide_dma_test_irq = &auide_dma_test_irq;
hwif->dma_host_off = &auide_dma_host_off;
hwif->dma_host_on = &auide_dma_host_on;
- hwif->ide_dma_lostirq = &auide_dma_lostirq;
+ hwif->dma_lost_irq = &auide_dma_lost_irq;
hwif->ide_dma_on = &auide_dma_on;
hwif->autodma = 1;
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index b173bc6..e5d0936 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -1,5 +1,5 @@
/*
- * linux/drivers/ide/pci/aec62xx.c Version 0.21 Apr 21, 2007
+ * linux/drivers/ide/pci/aec62xx.c Version 0.24 May 24, 2007
*
* Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
* Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com>
@@ -140,25 +140,10 @@ static int aec6260_tune_chipset (ide_drive_t *drive, u8 xferspeed)
return(ide_config_drive_speed(drive, speed));
}
-static int aec62xx_tune_chipset (ide_drive_t *drive, u8 speed)
-{
- switch (HWIF(drive)->pci_dev->device) {
- case PCI_DEVICE_ID_ARTOP_ATP865:
- case PCI_DEVICE_ID_ARTOP_ATP865R:
- case PCI_DEVICE_ID_ARTOP_ATP860:
- case PCI_DEVICE_ID_ARTOP_ATP860R:
- return ((int) aec6260_tune_chipset(drive, speed));
- case PCI_DEVICE_ID_ARTOP_ATP850UF:
- return ((int) aec6210_tune_chipset(drive, speed));
- default:
- return -1;
- }
-}
-
static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio)
{
pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
- (void) aec62xx_tune_chipset(drive, pio + XFER_PIO_0);
+ (void) HWIF(drive)->speedproc(drive, pio + XFER_PIO_0);
}
static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
@@ -172,12 +157,9 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
return -1;
}
-static int aec62xx_irq_timeout (ide_drive_t *drive)
+static void aec62xx_dma_lost_irq (ide_drive_t *drive)
{
- ide_hwif_t *hwif = HWIF(drive);
- struct pci_dev *dev = hwif->pci_dev;
-
- switch(dev->device) {
+ switch (HWIF(drive)->pci_dev->device) {
case PCI_DEVICE_ID_ARTOP_ATP860:
case PCI_DEVICE_ID_ARTOP_ATP860R:
case PCI_DEVICE_ID_ARTOP_ATP865:
@@ -186,7 +168,6 @@ static int aec62xx_irq_timeout (ide_drive_t *drive)
default:
break;
}
- return 0;
}
static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name)
@@ -224,64 +205,46 @@ static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const ch
static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
{
- struct pci_dev *dev = hwif->pci_dev;
+ struct pci_dev *dev = hwif->pci_dev;
+ u8 reg54 = 0, mask = hwif->channel ? 0xf0 : 0x0f;
+ unsigned long flags;
- hwif->autodma = 0;
hwif->tuneproc = &aec62xx_tune_drive;
- hwif->speedproc = &aec62xx_tune_chipset;
- if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF)
- hwif->serialized = hwif->channel;
-
- if (hwif->mate)
- hwif->mate->serialized = hwif->serialized;
+ if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) {
+ if(hwif->mate)
+ hwif->mate->serialized = hwif->serialized = 1;
+ hwif->speedproc = &aec6210_tune_chipset;
+ } else
+ hwif->speedproc = &aec6260_tune_chipset;
if (!hwif->dma_base) {
- hwif->drives[0].autotune = 1;
- hwif->drives[1].autotune = 1;
+ hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
return;
}
hwif->ultra_mask = hwif->cds->udma_mask;
-
- /* atp865 and atp865r */
- if (hwif->ultra_mask == 0x3f) {
- /* check bit 0x10 of DMA status register */
- if (inb(pci_resource_start(dev, 4) + 2) & 0x10)
- hwif->ultra_mask = 0x7f; /* udma0-6 */
- }
-
hwif->mwdma_mask = 0x07;
hwif->ide_dma_check = &aec62xx_config_drive_xfer_rate;
- hwif->ide_dma_lostirq = &aec62xx_irq_timeout;
-
- if (!noautodma)
- hwif->autodma = 1;
- hwif->drives[0].autodma = hwif->autodma;
- hwif->drives[1].autodma = hwif->autodma;
-}
-
-static void __devinit init_dma_aec62xx(ide_hwif_t *hwif, unsigned long dmabase)
-{
- struct pci_dev *dev = hwif->pci_dev;
+ hwif->dma_lost_irq = &aec62xx_dma_lost_irq;
if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) {
- u8 reg54h = 0;
- unsigned long flags;
-
spin_lock_irqsave(&ide_lock, flags);
- pci_read_config_byte(dev, 0x54, ®54h);
- pci_write_config_byte(dev, 0x54, reg54h & ~(hwif->channel ? 0xF0 : 0x0F));
+ pci_read_config_byte (dev, 0x54, ®54);
+ pci_write_config_byte(dev, 0x54, (reg54 & ~mask));
spin_unlock_irqrestore(&ide_lock, flags);
- } else {
- u8 ata66 = 0;
+ } else if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
+ u8 ata66 = 0, mask = hwif->channel ? 0x02 : 0x01;
+
pci_read_config_byte(hwif->pci_dev, 0x49, &ata66);
- if (!(hwif->udma_four))
- hwif->udma_four = (ata66&(hwif->channel?0x02:0x01))?0:1;
+
+ hwif->cbl = (ata66 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
}
- ide_setup_dma(hwif, dmabase, 8);
+ if (!noautodma)
+ hwif->autodma = 1;
+ hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
}
static int __devinit init_setup_aec62xx(struct pci_dev *dev, ide_pci_device_t *d)
@@ -291,16 +254,12 @@ static int __devinit init_setup_aec62xx(struct pci_dev *dev, ide_pci_device_t *d
static int __devinit init_setup_aec6x80(struct pci_dev *dev, ide_pci_device_t *d)
{
- unsigned long bar4reg = pci_resource_start(dev, 4);
-
- if (inb(bar4reg+2) & 0x10) {
- strcpy(d->name, "AEC6880");
- if (dev->device == PCI_DEVICE_ID_ARTOP_ATP865R)
- strcpy(d->name, "AEC6880R");
- } else {
- strcpy(d->name, "AEC6280");
- if (dev->device == PCI_DEVICE_ID_ARTOP_ATP865R)
- strcpy(d->name, "AEC6280R");
+ unsigned long dma_base = pci_resource_start(dev, 4);
+
+ if (inb(dma_base + 2) & 0x10) {
+ d->name = (dev->device == PCI_DEVICE_ID_ARTOP_ATP865R) ?
+ "AEC6880R" : "AEC6880";
+ d->udma_mask = 0x7f; /* udma0-6 */
}
return ide_setup_pci_device(dev, d);
@@ -312,7 +271,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
.init_setup = init_setup_aec62xx,
.init_chipset = init_chipset_aec62xx,
.init_hwif = init_hwif_aec62xx,
- .init_dma = init_dma_aec62xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
@@ -323,7 +281,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
.init_setup = init_setup_aec62xx,
.init_chipset = init_chipset_aec62xx,
.init_hwif = init_hwif_aec62xx,
- .init_dma = init_dma_aec62xx,
.channels = 2,
.autodma = NOAUTODMA,
.bootable = OFF_BOARD,
@@ -333,28 +290,25 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
.init_setup = init_setup_aec62xx,
.init_chipset = init_chipset_aec62xx,
.init_hwif = init_hwif_aec62xx,
- .init_dma = init_dma_aec62xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
.bootable = NEVER_BOARD,
.udma_mask = 0x1f, /* udma0-4 */
},{ /* 3 */
- .name = "AEC6X80",
+ .name = "AEC6280",
.init_setup = init_setup_aec6x80,
.init_chipset = init_chipset_aec62xx,
.init_hwif = init_hwif_aec62xx,
- .init_dma = init_dma_aec62xx,
.channels = 2,
.autodma = AUTODMA,
.bootable = OFF_BOARD,
.udma_mask = 0x3f, /* udma0-5 */
},{ /* 4 */
- .name = "AEC6X80R",
+ .name = "AEC6280R",
.init_setup = init_setup_aec6x80,
.init_chipset = init_chipset_aec62xx,
.init_hwif = init_hwif_aec62xx,
- .init_dma = init_dma_aec62xx,
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
@@ -370,13 +324,16 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
*
* Called when the PCI registration layer (or the IDE initialization)
* finds a device matching our IDE device tables.
+ *
+ * NOTE: since we're going to modify the 'name' field for AEC-6[26]80[R]
+ * chips, pass a local copy of 'struct pci_device_id' down the call chain.
*/
static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
- ide_pci_device_t *d = &aec62xx_chipsets[id->driver_data];
+ ide_pci_device_t d = aec62xx_chipsets[id->driver_data];
- return d->init_setup(dev, d);
+ return d.init_setup(dev, &d);
}
static struct pci_device_id aec62xx_pci_tbl[] = {
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 27525ec..8a6b27b 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -1,5 +1,5 @@
/*
- * linux/drivers/ide/pci/alim15x3.c Version 0.21 2007/02/03
+ * linux/drivers/ide/pci/alim15x3.c Version 0.25 Jun 9 2007
*
* Copyright (C) 1998-2000 Michel Aubry, Maintainer
* Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer
@@ -10,6 +10,7 @@
* Copyright (C) 2002 Alan Cox <alan@redhat.com>
* ALi (now ULi M5228) support by Clear Zhang <Clear.Zhang@ali.com.tw>
* Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com>
+ * Copyright (C) 2007 Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
*
* (U)DMA capable version of ali 1533/1543(C), 1535(D)
*
@@ -36,6 +37,7 @@
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/init.h>
+#include <linux/dmi.h>
#include <asm/io.h>
@@ -583,6 +585,35 @@ out:
return 0;
}
+/*
+ * Cable special cases
+ */
+
+static struct dmi_system_id cable_dmi_table[] = {
+ {
+ .ident = "HP Pavilion N5430",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
+ DMI_MATCH(DMI_BOARD_NAME, "OmniBook N32N-736"),
+ },
+ },
+ { }
+};
+
+static int ali_cable_override(struct pci_dev *pdev)
+{
+ /* Fujitsu P2000 */
+ if (pdev->subsystem_vendor == 0x10CF &&
+ pdev->subsystem_device == 0x10AF)
+ return 1;
+
+ /* Systems by DMI */
+ if (dmi_check_system(cable_dmi_table))
+ return 1;
+
+ return 0;
+}
+
/**
* ata66_ali15x3 - check for UDMA 66 support
* @hwif: IDE interface
@@ -594,37 +625,31 @@ out:
* FIXME: frobs bits that are not defined on newer ALi devicea
*/
-static unsigned int __devinit ata66_ali15x3 (ide_hwif_t *hwif)
+static u8 __devinit ata66_ali15x3(ide_hwif_t *hwif)
{
struct pci_dev *dev = hwif->pci_dev;
- unsigned int ata66 = 0;
- u8 cable_80_pin[2] = { 0, 0 };
-
unsigned long flags;
- u8 tmpbyte;
+ u8 cbl = ATA_CBL_PATA40, tmpbyte;
local_irq_save(flags);
if (m5229_revision >= 0xC2) {
/*
- * Ultra66 cable detection (from Host View)
- * m5229, 0x4a, bit0: primary, bit1: secondary 80 pin
- */
- pci_read_config_byte(dev, 0x4a, &tmpbyte);
- /*
- * 0x4a, bit0 is 0 => primary channel
- * has 80-pin (from host view)
- */
- if (!(tmpbyte & 0x01)) cable_80_pin[0] = 1;
- /*
- * 0x4a, bit1 is 0 => secondary channel
- * has 80-pin (from host view)
- */
- if (!(tmpbyte & 0x02)) cable_80_pin[1] = 1;
- /*
- * Allow ata66 if cable of current channel has 80 pins
+ * m5229 80-pin cable detection (from Host View)
+ *
+ * 0x4a bit0 is 0 => primary channel has 80-pin
+ * 0x4a bit1 is 0 => secondary channel has 80-pin
+ *
+ * Certain laptops use short but suitable cables
+ * and don't implement the detect logic.
*/
- ata66 = (hwif->channel)?cable_80_pin[1]:cable_80_pin[0];
+ if (ali_cable_override(dev))
+ cbl = ATA_CBL_PATA40_SHORT;
+ else {
+ pci_read_config_byte(dev, 0x4a, &tmpbyte);
+ if ((tmpbyte & (1 << hwif->channel)) == 0)
+ cbl = ATA_CBL_PATA80;
+ }
} else {
/*
* check m1533, 0x5e, bit 1~4 == 1001 => & 00011110 = 00010010
@@ -657,7 +682,7 @@ static unsigned int __devinit ata66_ali15x3 (ide_hwif_t *hwif)
local_irq_restore(flags);
- return(ata66);
+ return cbl;
}
/**
@@ -708,8 +733,9 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
hwif->dma_setup = &ali15x3_dma_setup;
if (!noautodma)
hwif->autodma = 1;
- if (!(hwif->udma_four))
- hwif->udma_four = ata66_ali15x3(hwif);
+
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = ata66_ali15x3(hwif);
}
hwif->drives[0].autodma = hwif->autodma;
hwif->drives[1].autodma = hwif->autodma;
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index a2be65f..84ed30c 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -1,10 +1,11 @@
/*
- * Version 2.16
+ * Version 2.20
*
* AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04
* IDE driver for Linux.
*
* Copyright (c) 2000-2002 Vojtech Pavlik
+ * Copyright (c) 2007 Bartlomiej Zolnierkiewicz
*
* Based on the work of:
* Andre Hedrick
@@ -37,11 +38,6 @@
#define AMD_ADDRESS_SETUP (0x0c + amd_config->base)
#define AMD_UDMA_TIMING (0x10 + amd_config->base)
-#define AMD_UDMA 0x07
-#define AMD_UDMA_33 0x01
-#define AMD_UDMA_66 0x02
-#define AMD_UDMA_100 0x03
-#define AMD_UDMA_133 0x04
#define AMD_CHECK_SWDMA 0x08
#define AMD_BAD_SWDMA 0x10
#define AMD_BAD_FIFO 0x20
@@ -53,32 +49,33 @@
static struct amd_ide_chip {
unsigned short id;
- unsigned long base;
- unsigned char flags;
+ u8 base;
+ u8 udma_mask;
+ u8 flags;
} amd_ide_chips[] = {
- { PCI_DEVICE_ID_AMD_COBRA_7401, 0x40, AMD_UDMA_33 | AMD_BAD_SWDMA },
- { PCI_DEVICE_ID_AMD_VIPER_7409, 0x40, AMD_UDMA_66 | AMD_CHECK_SWDMA },
- { PCI_DEVICE_ID_AMD_VIPER_7411, 0x40, AMD_UDMA_100 | AMD_BAD_FIFO },
- { PCI_DEVICE_ID_AMD_OPUS_7441, 0x40, AMD_UDMA_100 },
- { PCI_DEVICE_ID_AMD_8111_IDE, 0x40, AMD_UDMA_133 | AMD_CHECK_SERENADE },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, 0x50, AMD_UDMA_100 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE, 0x50, AMD_UDMA_133 },
- { PCI_DEVICE_ID_AMD_CS5536_IDE, 0x40, AMD_UDMA_100 },
+ { PCI_DEVICE_ID_AMD_COBRA_7401, 0x40, ATA_UDMA2, AMD_BAD_SWDMA },
+ { PCI_DEVICE_ID_AMD_VIPER_7409, 0x40, ATA_UDMA4, AMD_CHECK_SWDMA },
+ { PCI_DEVICE_ID_AMD_VIPER_7411, 0x40, ATA_UDMA5, AMD_BAD_FIFO },
+ { PCI_DEVICE_ID_AMD_OPUS_7441, 0x40, ATA_UDMA5, },
+ { PCI_DEVICE_ID_AMD_8111_IDE, 0x40, ATA_UDMA6, AMD_CHECK_SERENADE },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, 0x50, ATA_UDMA5, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE, 0x50, ATA_UDMA6, },
+ { PCI_DEVICE_ID_AMD_CS5536_IDE, 0x40, ATA_UDMA5, },
{ 0 }
};
@@ -87,7 +84,7 @@ static ide_pci_device_t *amd_chipset;
static unsigned int amd_80w;
static unsigned int amd_clock;
-static char *amd_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" };
+static char *amd_dma[] = { "16", "25", "33", "44", "66", "100", "133" };
static unsigned char amd_cyc2udma[] = { 6, 6, 5, 4, 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 7 };
/*
@@ -128,7 +125,7 @@ static int amd74xx_get_info(char *buffer, char **addr, off_t offset, int count)
pci_read_config_byte(dev, PCI_REVISION_ID, &t);
amd_print("Revision: IDE %#x", t);
- amd_print("Highest DMA rate: %s", amd_dma[amd_config->flags & AMD_UDMA]);
+ amd_print("Highest DMA rate: UDMA%s", amd_dma[fls(amd_config->udma_mask) - 1]);
amd_print("BM-DMA base: %#lx", amd_base);
amd_print("PCI clock: %d.%dMHz", amd_clock / 1000, amd_clock / 100 % 10);
@@ -221,12 +218,12 @@ static void amd_set_speed(struct pci_dev *dev, unsigned char dn, struct ide_timi
pci_write_config_byte(dev, AMD_DRIVE_TIMING + (3 - dn),
((FIT(timing->active, 1, 16) - 1) << 4) | (FIT(timing->recover, 1, 16) - 1));
- switch (amd_config->flags & AMD_UDMA) {
- case AMD_UDMA_33: t = timing->udma ? (0xc0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break;
- case AMD_UDMA_66: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 2, 10)]) : 0x03; break;
- case AMD_UDMA_100: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 10)]) : 0x03; break;
- case AMD_UDMA_133: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 15)]) : 0x03; break;
- default: return;
+ switch (amd_config->udma_mask) {
+ case ATA_UDMA2: t = timing->udma ? (0xc0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break;
+ case ATA_UDMA4: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 2, 10)]) : 0x03; break;
+ case ATA_UDMA5: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 10)]) : 0x03; break;
+ case ATA_UDMA6: t = timing->udma ? (0xc0 | amd_cyc2udma[FIT(timing->udma, 1, 15)]) : 0x03; break;
+ default: return;
}
pci_write_config_byte(dev, AMD_UDMA_TIMING + (3 - dn), t);
@@ -248,7 +245,7 @@ static int amd_set_drive(ide_drive_t *drive, u8 speed)
ide_config_drive_speed(drive, speed);
T = 1000000000 / amd_clock;
- UT = T / min_t(int, max_t(int, amd_config->flags & AMD_UDMA, 1), 2);
+ UT = (amd_config->udma_mask == ATA_UDMA2) ? T : (T / 2);
ide_timing_compute(drive, speed, &t, T, UT);
@@ -277,29 +274,19 @@ static int amd_set_drive(ide_drive_t *drive, u8 speed)
static void amd74xx_tune_drive(ide_drive_t *drive, u8 pio)
{
if (pio == 255) {
- amd_set_drive(drive, ide_find_best_mode(drive, XFER_PIO | XFER_EPIO));
+ amd_set_drive(drive, ide_find_best_pio_mode(drive));
return;
}
amd_set_drive(drive, XFER_PIO_0 + min_t(byte, pio, 5));
}
-/*
- * amd74xx_dmaproc() is a callback from upper layers that can do
- * a lot, but we use it for DMA/PIO tuning only, delegating everything
- * else to the default ide_dmaproc().
- */
-
static int amd74xx_ide_dma_check(ide_drive_t *drive)
{
- int w80 = HWIF(drive)->udma_four;
+ u8 speed = ide_max_dma_mode(drive);
- u8 speed = ide_find_best_mode(drive,
- XFER_PIO | XFER_EPIO | XFER_MWDMA | XFER_UDMA |
- ((amd_config->flags & AMD_BAD_SWDMA) ? 0 : XFER_SWDMA) |
- (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_66 ? XFER_UDMA_66 : 0) |
- (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_100 ? XFER_UDMA_100 : 0) |
- (w80 && (amd_config->flags & AMD_UDMA) >= AMD_UDMA_133 ? XFER_UDMA_133 : 0));
+ if (speed == 0)
+ speed = ide_find_best_pio_mode(drive);
amd_set_drive(drive, speed);
@@ -334,10 +321,10 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch
* Check 80-wire cable presence.
*/
- switch (amd_config->flags & AMD_UDMA) {
+ switch (amd_config->udma_mask) {
- case AMD_UDMA_133:
- case AMD_UDMA_100:
+ case ATA_UDMA6:
+ case ATA_UDMA5:
pci_read_config_byte(dev, AMD_CABLE_DETECT, &t);
pci_read_config_dword(dev, AMD_UDMA_TIMING, &u);
amd_80w = ((t & 0x3) ? 1 : 0) | ((t & 0xc) ? 2 : 0);
@@ -349,7 +336,7 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch
}
break;
- case AMD_UDMA_66:
+ case ATA_UDMA4:
/* no host side cable detection */
amd_80w = 0x03;
break;
@@ -370,7 +357,7 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch
if ((amd_config->flags & AMD_CHECK_SERENADE) &&
dev->subsystem_vendor == PCI_VENDOR_ID_AMD &&
dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE)
- amd_config->flags = AMD_UDMA_100;
+ amd_config->udma_mask = ATA_UDMA5;
/*
* Determine the system bus clock.
@@ -395,8 +382,9 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch
*/
pci_read_config_byte(dev, PCI_REVISION_ID, &t);
- printk(KERN_INFO "%s: %s (rev %02x) %s controller\n",
- amd_chipset->name, pci_name(dev), t, amd_dma[amd_config->flags & AMD_UDMA]);
+ printk(KERN_INFO "%s: %s (rev %02x) UDMA%s controller\n",
+ amd_chipset->name, pci_name(dev), t,
+ amd_dma[fls(amd_config->udma_mask) - 1]);
/*
* Register /proc/ide/amd74xx entry
@@ -437,12 +425,19 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
return;
hwif->atapi_dma = 1;
- hwif->ultra_mask = 0x7f;
- hwif->mwdma_mask = 0x07;
- hwif->swdma_mask = 0x07;
- if (!hwif->udma_four)
- hwif->udma_four = (amd_80w >> hwif->channel) & 1;
+ hwif->ultra_mask = amd_config->udma_mask;
+ hwif->mwdma_mask = 0x07;
+ if ((amd_config->flags & AMD_BAD_SWDMA) == 0)
+ hwif->swdma_mask = 0x07;
+
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
+ if ((amd_80w >> hwif->channel) & 1)
+ hwif->cbl = ATA_CBL_PATA80;
+ else
+ hwif->cbl = ATA_CBL_PATA40;
+ }
+
hwif->ide_dma_check = &amd74xx_ide_dma_check;
if (!noautodma)
hwif->autodma = 1;
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 8ab33fa..2761510 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -264,10 +264,11 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
hwif->swdma_mask = 0x04;
pci_read_config_byte(pdev, ATIIXP_IDE_UDMA_MODE + ch, &udma_mode);
+
if ((udma_mode & 0x07) >= 0x04 || (udma_mode & 0x70) >= 0x40)
- hwif->udma_four = 1;
+ hwif->cbl = ATA_CBL_PATA80;
else
- hwif->udma_four = 0;
+ hwif->cbl = ATA_CBL_PATA40;
hwif->dma_host_on = &atiixp_dma_host_on;
hwif->dma_host_off = &atiixp_dma_host_off;
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 7c57dc6..8631b6c 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -1,5 +1,5 @@
/*
- * linux/drivers/ide/pci/cmd64x.c Version 1.47 Mar 19, 2007
+ * linux/drivers/ide/pci/cmd64x.c Version 1.50 May 10, 2007
*
* cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
* Due to massive hardware bugs, UltraDMA is only supported
@@ -52,9 +52,6 @@
#define ARTTIM23_DIS_RA2 0x04
#define ARTTIM23_DIS_RA3 0x08
#define ARTTIM23_INTR_CH1 0x10
-#define ARTTIM2 0x57
-#define ARTTIM3 0x57
-#define DRWTIM23 0x58
#define DRWTIM2 0x58
#define BRST 0x59
#define DRWTIM3 0x5b
@@ -469,71 +466,43 @@ static int cmd646_1_ide_dma_end (ide_drive_t *drive)
static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev, const char *name)
{
- u32 class_rev = 0;
u8 mrdmode = 0;
- pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
- class_rev &= 0xff;
+ if (dev->device == PCI_DEVICE_ID_CMD_646) {
+ u8 rev = 0;
- switch(dev->device) {
- case PCI_DEVICE_ID_CMD_643:
- break;
- case PCI_DEVICE_ID_CMD_646:
- printk(KERN_INFO "%s: chipset revision 0x%02X, ", name, class_rev);
- switch(class_rev) {
- case 0x07:
- case 0x05:
- printk("UltraDMA Capable");
- break;
- case 0x03:
- printk("MultiWord DMA Force Limited");
- break;
- case 0x01:
- default:
- printk("MultiWord DMA Limited, IRQ workaround enabled");
- break;
- }
- printk("\n");
- break;
- case PCI_DEVICE_ID_CMD_648:
- case PCI_DEVICE_ID_CMD_649:
+ pci_read_config_byte(dev, PCI_REVISION_ID, &rev);
+
+ switch (rev) {
+ case 0x07:
+ case 0x05:
+ printk("%s: UltraDMA capable", name);
break;
+ case 0x03:
default:
+ printk("%s: MultiWord DMA force limited", name);
+ break;
+ case 0x01:
+ printk("%s: MultiWord DMA limited, "
+ "IRQ workaround enabled\n", name);
break;
+ }
}
/* Set a good latency timer and cache line size value. */
(void) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64);
/* FIXME: pci_set_master() to ensure a good latency timer value */
- /* Setup interrupts. */
- (void) pci_read_config_byte(dev, MRDMODE, &mrdmode);
- mrdmode &= ~(0x30);
- (void) pci_write_config_byte(dev, MRDMODE, mrdmode);
-
- /* Use MEMORY READ LINE for reads.
- * NOTE: Although not mentioned in the PCI0646U specs,
- * these bits are write only and won't be read
- * back as set or not. The PCI0646U2 specs clarify
- * this point.
+ /*
+ * Enable interrupts, select MEMORY READ LINE for reads.
+ *
+ * NOTE: although not mentioned in the PCI0646U specs,
+ * bits 0-1 are write only and won't be read back as
+ * set or not -- PCI0646U2 specs clarify this point.
*/
- (void) pci_write_config_byte(dev, MRDMODE, mrdmode | 0x02);
-
- /* Set reasonable active/recovery/address-setup values. */
- (void) pci_write_config_byte(dev, ARTTIM0, 0x40);
- (void) pci_write_config_byte(dev, DRWTIM0, 0x3f);
- (void) pci_write_config_byte(dev, ARTTIM1, 0x40);
- (void) pci_write_config_byte(dev, DRWTIM1, 0x3f);
-#ifdef __i386__
- (void) pci_write_config_byte(dev, ARTTIM23, 0x1c);
-#else
- (void) pci_write_config_byte(dev, ARTTIM23, 0x5c);
-#endif
- (void) pci_write_config_byte(dev, DRWTIM23, 0x3f);
- (void) pci_write_config_byte(dev, DRWTIM3, 0x3f);
-#ifdef CONFIG_PPC
- (void) pci_write_config_byte(dev, UDIDETCR0, 0xf0);
-#endif /* CONFIG_PPC */
+ (void) pci_read_config_byte (dev, MRDMODE, &mrdmode);
+ mrdmode &= ~0x30;
+ (void) pci_write_config_byte(dev, MRDMODE, (mrdmode | 0x02));
#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_IDE_PROC_FS)
@@ -548,29 +517,27 @@ static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev, const cha
return 0;
}
-static unsigned int __devinit ata66_cmd64x(ide_hwif_t *hwif)
+static u8 __devinit ata66_cmd64x(ide_hwif_t *hwif)
{
- u8 ata66 = 0, mask = (hwif->channel) ? 0x02 : 0x01;
+ struct pci_dev *dev = hwif->pci_dev;
+ u8 bmidecsr = 0, mask = hwif->channel ? 0x02 : 0x01;
- switch(hwif->pci_dev->device) {
- case PCI_DEVICE_ID_CMD_643:
- case PCI_DEVICE_ID_CMD_646:
- return ata66;
- default:
- break;
+ switch (dev->device) {
+ case PCI_DEVICE_ID_CMD_648:
+ case PCI_DEVICE_ID_CMD_649:
+ pci_read_config_byte(dev, BMIDECSR, &bmidecsr);
+ return (bmidecsr & mask) ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
+ default:
+ return ATA_CBL_PATA40;
}
- pci_read_config_byte(hwif->pci_dev, BMIDECSR, &ata66);
- return (ata66 & mask) ? 1 : 0;
}
static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
{
struct pci_dev *dev = hwif->pci_dev;
- unsigned int class_rev;
+ u8 rev = 0;
- hwif->autodma = 0;
- pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
- class_rev &= 0xff;
+ pci_read_config_byte(dev, PCI_REVISION_ID, &rev);
hwif->tuneproc = &cmd64x_tune_drive;
hwif->speedproc = &cmd64x_tune_chipset;
@@ -580,8 +547,8 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
if (!hwif->dma_base)
return;
- hwif->atapi_dma = 1;
-
+ hwif->atapi_dma = 1;
+ hwif->mwdma_mask = 0x07;
hwif->ultra_mask = hwif->cds->udma_mask;
/*
@@ -596,16 +563,15 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
*
* So we only do UltraDMA on revision 0x05 and 0x07 chipsets.
*/
- if (dev->device == PCI_DEVICE_ID_CMD_646 && class_rev < 5)
+ if (dev->device == PCI_DEVICE_ID_CMD_646 && rev < 5)
hwif->ultra_mask = 0x00;
- hwif->mwdma_mask = 0x07;
-
hwif->ide_dma_check = &cmd64x_config_drive_for_dma;
- if (!(hwif->udma_four))
- hwif->udma_four = ata66_cmd64x(hwif);
- switch(dev->device) {
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = ata66_cmd64x(hwif);
+
+ switch (dev->device) {
case PCI_DEVICE_ID_CMD_648:
case PCI_DEVICE_ID_CMD_649:
alt_irq_bits:
@@ -614,10 +580,10 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
break;
case PCI_DEVICE_ID_CMD_646:
hwif->chipset = ide_cmd646;
- if (class_rev == 0x01) {
+ if (rev == 0x01) {
hwif->ide_dma_end = &cmd646_1_ide_dma_end;
break;
- } else if (class_rev >= 0x03)
+ } else if (rev >= 0x03)
goto alt_irq_bits;
/* fall thru */
default:
@@ -626,11 +592,9 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
break;
}
-
if (!noautodma)
hwif->autodma = 1;
- hwif->drives[0].autodma = hwif->autodma;
- hwif->drives[1].autodma = hwif->autodma;
+ hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
}
static int __devinit init_setup_cmd64x(struct pci_dev *dev, ide_pci_device_t *d)
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
index 41925c4..10f61f3 100644
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -187,7 +187,8 @@ static u8 __devinit cs5535_cable_detect(struct pci_dev *dev)
/* if a 80 wire cable was detected */
pci_read_config_byte(dev, CS5535_CABLE_DETECT, &bit);
- return (bit & 1);
+
+ return (bit & 1) ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
}
/****
@@ -212,8 +213,7 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
hwif->ultra_mask = 0x1F;
hwif->mwdma_mask = 0x07;
-
- hwif->udma_four = cs5535_cable_detect(hwif->pci_dev);
+ hwif->cbl = cs5535_cable_detect(hwif->pci_dev);
if (!noautodma)
hwif->autodma = 1;
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index c33d0b0..4b6bae8 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1,5 +1,5 @@
/*
- * linux/drivers/ide/pci/hpt366.c Version 1.06 Jun 27, 2007
+ * linux/drivers/ide/pci/hpt366.c Version 1.10 Jun 29, 2007
*
* Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
* Portions Copyright (C) 2001 Sun Microsystems, Inc.
@@ -77,7 +77,7 @@
* since they may tamper with its fields
* - prefix the driver startup messages with the real chip name
* - claim the extra 240 bytes of I/O space for all chips
- * - optimize the rate masking/filtering and the drive list lookup code
+ * - optimize the UltraDMA filtering and the drive list lookup code
* - use pci_get_slot() to get to the function 1 of HPT36x/374
* - cache offset of the channel's misc. control registers (MCRs) being used
* throughout the driver
@@ -99,9 +99,9 @@
* stop duplicating it for each channel by storing the pointer in the pci_dev
* structure: first, at the init_setup stage, point it to a static "template"
* with only the chip type and its specific base DPLL frequency, the highest
- * supported DMA mode, and the chip settings table pointer filled, then, at
- * the init_chipset stage, allocate per-chip instance and fill it with the
- * rest of the necessary information
+ * UltraDMA mode, and the chip settings table pointer filled, then, at the
+ * init_chipset stage, allocate per-chip instance and fill it with the rest
+ * of the necessary information
* - get rid of the constant thresholds in the HPT37x PCI clock detection code,
* switch to calculating PCI clock frequency based on the chip's base DPLL
* frequency
@@ -112,6 +112,7 @@
* also fixing the interchanged 25/40 MHz PCI clock cases for HPT36x chips;
* unify HPT36x/37x timing setup code and the speedproc handlers by joining
* the register setting lists into the table indexed by the clock selected
+ * - set the correct hwif->ultra_mask for each individual chip
* Sergei Shtylyov, <sshtylyov@ru.mvista.com> or <source@mvista.com>
*/
@@ -391,7 +392,7 @@ enum ata_clock {
struct hpt_info {
u8 chip_type; /* Chip type */
- u8 max_mode; /* Speeds allowed */
+ u8 max_ultra; /* Max. UltraDMA mode allowed */
u8 dpll_clk; /* DPLL clock in MHz */
u8 pci_clk; /* PCI clock in MHz */
u32 **settings; /* Chipset settings table */
@@ -430,77 +431,77 @@ static u32 *hpt37x_settings[NUM_ATA_CLOCKS] = {
static struct hpt_info hpt36x __devinitdata = {
.chip_type = HPT36x,
- .max_mode = (HPT366_ALLOW_ATA66_4 || HPT366_ALLOW_ATA66_3) ? 2 : 1,
+ .max_ultra = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ? 4 : 3) : 2,
.dpll_clk = 0, /* no DPLL */
.settings = hpt36x_settings
};
static struct hpt_info hpt370 __devinitdata = {
.chip_type = HPT370,
- .max_mode = HPT370_ALLOW_ATA100_5 ? 3 : 2,
+ .max_ultra = HPT370_ALLOW_ATA100_5 ? 5 : 4,
.dpll_clk = 48,
.settings = hpt37x_settings
};
static struct hpt_info hpt370a __devinitdata = {
.chip_type = HPT370A,
- .max_mode = HPT370_ALLOW_ATA100_5 ? 3 : 2,
+ .max_ultra = HPT370_ALLOW_ATA100_5 ? 5 : 4,
.dpll_clk = 48,
.settings = hpt37x_settings
};
static struct hpt_info hpt374 __devinitdata = {
.chip_type = HPT374,
- .max_mode = 3,
+ .max_ultra = 5,
.dpll_clk = 48,
.settings = hpt37x_settings
};
static struct hpt_info hpt372 __devinitdata = {
.chip_type = HPT372,
- .max_mode = HPT372_ALLOW_ATA133_6 ? 4 : 3,
+ .max_ultra = HPT372_ALLOW_ATA133_6 ? 6 : 5,
.dpll_clk = 55,
.settings = hpt37x_settings
};
static struct hpt_info hpt372a __devinitdata = {
.chip_type = HPT372A,
- .max_mode = HPT372_ALLOW_ATA133_6 ? 4 : 3,
+ .max_ultra = HPT372_ALLOW_ATA133_6 ? 6 : 5,
.dpll_clk = 66,
.settings = hpt37x_settings
};
static struct hpt_info hpt302 __devinitdata = {
.chip_type = HPT302,
- .max_mode = HPT302_ALLOW_ATA133_6 ? 4 : 3,
+ .max_ultra = HPT372_ALLOW_ATA133_6 ? 6 : 5,
.dpll_clk = 66,
.settings = hpt37x_settings
};
static struct hpt_info hpt371 __devinitdata = {
.chip_type = HPT371,
- .max_mode = HPT371_ALLOW_ATA133_6 ? 4 : 3,
+ .max_ultra = HPT371_ALLOW_ATA133_6 ? 6 : 5,
.dpll_clk = 66,
.settings = hpt37x_settings
};
static struct hpt_info hpt372n __devinitdata = {
.chip_type = HPT372N,
- .max_mode = HPT372_ALLOW_ATA133_6 ? 4 : 3,
+ .max_ultra = HPT372_ALLOW_ATA133_6 ? 6 : 5,
.dpll_clk = 77,
.settings = hpt37x_settings
};
static struct hpt_info hpt302n __devinitdata = {
.chip_type = HPT302N,
- .max_mode = HPT302_ALLOW_ATA133_6 ? 4 : 3,
+ .max_ultra = HPT302_ALLOW_ATA133_6 ? 6 : 5,
.dpll_clk = 77,
.settings = hpt37x_settings
};
static struct hpt_info hpt371n __devinitdata = {
.chip_type = HPT371N,
- .max_mode = HPT371_ALLOW_ATA133_6 ? 4 : 3,
+ .max_ultra = HPT371_ALLOW_ATA133_6 ? 6 : 5,
.dpll_clk = 77,
.settings = hpt37x_settings
};
@@ -523,53 +524,38 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list)
static u8 hpt3xx_udma_filter(ide_drive_t *drive)
{
struct hpt_info *info = pci_get_drvdata(HWIF(drive)->pci_dev);
- u8 chip_type = info->chip_type;
- u8 mode = info->max_mode;
u8 mask;
- switch (mode) {
- case 0x04:
- mask = 0x7f;
- break;
- case 0x03:
+ switch (info->chip_type) {
+ case HPT370A:
+ if (!HPT370_ALLOW_ATA100_5 ||
+ check_in_drive_list(drive, bad_ata100_5))
+ return 0x1f;
+ else
+ return 0x3f;
+ case HPT370:
+ if (!HPT370_ALLOW_ATA100_5 ||
+ check_in_drive_list(drive, bad_ata100_5))
+ mask = 0x1f;
+ else
mask = 0x3f;
- if (chip_type >= HPT374)
- break;
- if (!check_in_drive_list(drive, bad_ata100_5))
- goto check_bad_ata33;
- /* fall thru */
- case 0x02:
+ break;
+ case HPT36x:
+ if (!HPT366_ALLOW_ATA66_4 ||
+ check_in_drive_list(drive, bad_ata66_4))
+ mask = 0x0f;
+ else
mask = 0x1f;
- /*
- * CHECK ME, Does this need to be changed to HPT374 ??
- */
- if (chip_type >= HPT370)
- goto check_bad_ata33;
- if (HPT366_ALLOW_ATA66_4 &&
- !check_in_drive_list(drive, bad_ata66_4))
- goto check_bad_ata33;
-
- mask = 0x0f;
- if (HPT366_ALLOW_ATA66_3 &&
- !check_in_drive_list(drive, bad_ata66_3))
- goto check_bad_ata33;
- /* fall thru */
- case 0x01:
+ if (!HPT366_ALLOW_ATA66_3 ||
+ check_in_drive_list(drive, bad_ata66_3))
mask = 0x07;
-
- check_bad_ata33:
- if (chip_type >= HPT370A)
- break;
- if (!check_in_drive_list(drive, bad_ata33))
- break;
- /* fall thru */
- case 0x00:
- default:
- mask = 0x00;
- break;
+ break;
+ default:
+ return 0x7f;
}
- return mask;
+
+ return check_in_drive_list(drive, bad_ata33) ? 0x00 : mask;
}
static u32 get_speed_setting(u8 speed, struct hpt_info *info)
@@ -737,7 +723,7 @@ static int hpt366_config_drive_xfer_rate(ide_drive_t *drive)
* This is specific to the HPT366 UDMA chipset
* by HighPoint|Triones Technologies, Inc.
*/
-static int hpt366_ide_dma_lostirq(ide_drive_t *drive)
+static void hpt366_dma_lost_irq(ide_drive_t *drive)
{
struct pci_dev *dev = HWIF(drive)->pci_dev;
u8 mcr1 = 0, mcr3 = 0, scr1 = 0;
@@ -749,7 +735,7 @@ static int hpt366_ide_dma_lostirq(ide_drive_t *drive)
drive->name, __FUNCTION__, mcr1, mcr3, scr1);
if (scr1 & 0x10)
pci_write_config_byte(dev, 0x5a, scr1 & ~0x10);
- return __ide_dma_lostirq(drive);
+ ide_dma_lost_irq(drive);
}
static void hpt370_clear_engine(ide_drive_t *drive)
@@ -799,10 +785,10 @@ static int hpt370_ide_dma_end(ide_drive_t *drive)
return __ide_dma_end(drive);
}
-static int hpt370_ide_dma_timeout(ide_drive_t *drive)
+static void hpt370_dma_timeout(ide_drive_t *drive)
{
hpt370_irq_timeout(drive);
- return __ide_dma_timeout(drive);
+ ide_dma_timeout(drive);
}
/* returns 1 if DMA IRQ issued, 0 otherwise */
@@ -1150,7 +1136,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha
* Select 66 MHz DPLL clock only if UltraATA/133 mode is
* supported/enabled, use 50 MHz DPLL clock otherwise...
*/
- if (info->max_mode == 0x04) {
+ if (info->max_ultra == 6) {
dpll_clk = 66;
clock = ATA_CLOCK_66MHZ;
} else if (dpll_clk) { /* HPT36x chips don't have DPLL */
@@ -1243,7 +1229,7 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
struct pci_dev *dev = hwif->pci_dev;
struct hpt_info *info = pci_get_drvdata(dev);
int serialize = HPT_SERIALIZE_IO;
- u8 scr1 = 0, ata66 = (hwif->channel) ? 0x01 : 0x02;
+ u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02;
u8 chip_type = info->chip_type;
u8 new_mcr, old_mcr = 0;
@@ -1256,7 +1242,9 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
hwif->intrproc = &hpt3xx_intrproc;
hwif->maskproc = &hpt3xx_maskproc;
hwif->busproc = &hpt3xx_busproc;
- hwif->udma_filter = &hpt3xx_udma_filter;
+
+ if (chip_type <= HPT370A)
+ hwif->udma_filter = &hpt3xx_udma_filter;
/*
* HPT3xxN chips have some complications:
@@ -1305,7 +1293,7 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
return;
}
- hwif->ultra_mask = 0x7f;
+ hwif->ultra_mask = hwif->cds->udma_mask;
hwif->mwdma_mask = 0x07;
/*
@@ -1342,8 +1330,8 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
} else
pci_read_config_byte (dev, 0x5a, &scr1);
- if (!hwif->udma_four)
- hwif->udma_four = (scr1 & ata66) ? 0 : 1;
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = (scr1 & ata66) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
hwif->ide_dma_check = &hpt366_config_drive_xfer_rate;
@@ -1353,9 +1341,9 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
} else if (chip_type >= HPT370) {
hwif->dma_start = &hpt370_ide_dma_start;
hwif->ide_dma_end = &hpt370_ide_dma_end;
- hwif->ide_dma_timeout = &hpt370_ide_dma_timeout;
+ hwif->dma_timeout = &hpt370_dma_timeout;
} else
- hwif->ide_dma_lostirq = &hpt366_ide_dma_lostirq;
+ hwif->dma_lost_irq = &hpt366_dma_lost_irq;
if (!noautodma)
hwif->autodma = 1;
@@ -1503,9 +1491,35 @@ static int __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d)
pci_read_config_byte(dev, PCI_REVISION_ID, &rev);
- if (rev > 6)
+ switch (rev) {
+ case 0:
+ case 1:
+ case 2:
+ /*
+ * HPT36x chips have one channel per function and have
+ * both channel enable bits located differently and visible
+ * to both functions -- really stupid design decision... :-(
+ * Bit 4 is for the primary channel, bit 5 for the secondary.
+ */
+ d->channels = 1;
+ d->enablebits[0].mask = d->enablebits[0].val = 0x10;
+
+ d->udma_mask = HPT366_ALLOW_ATA66_3 ?
+ (HPT366_ALLOW_ATA66_4 ? 0x1f : 0x0f) : 0x07;
+ break;
+ case 3:
+ case 4:
+ d->udma_mask = HPT370_ALLOW_ATA100_5 ? 0x3f : 0x1f;
+ break;
+ default:
rev = 6;
-
+ /* fall thru */
+ case 5:
+ case 6:
+ d->udma_mask = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f;
+ break;
+ }
+
d->name = chipset_names[rev];
pci_set_drvdata(dev, info[rev]);
@@ -1513,15 +1527,6 @@ static int __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d)
if (rev > 2)
goto init_single;
- /*
- * HPT36x chips have one channel per function and have
- * both channel enable bits located differently and visible
- * to both functions -- really stupid design decision... :-(
- * Bit 4 is for the primary channel, bit 5 for the secondary.
- */
- d->channels = 1;
- d->enablebits[0].mask = d->enablebits[0].val = 0x10;
-
if ((dev2 = pci_get_slot(dev->bus, dev->devfn + 1)) != NULL) {
u8 mcr1 = 0, pin1 = 0, pin2 = 0;
int ret;
@@ -1573,6 +1578,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
+ .udma_mask = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f,
.bootable = OFF_BOARD,
.extra = 240
},{ /* 2 */
@@ -1584,6 +1590,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
+ .udma_mask = HPT302_ALLOW_ATA133_6 ? 0x7f : 0x3f,
.bootable = OFF_BOARD,
.extra = 240
},{ /* 3 */
@@ -1595,6 +1602,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
.channels = 2,
.autodma = AUTODMA,
.enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
+ .udma_mask = HPT371_ALLOW_ATA133_6 ? 0x7f : 0x3f,
.bootable = OFF_BOARD,
.extra = 240
},{ /* 4 */
@@ -1606,6 +1614,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
.channels = 2, /* 4 */
.autodma = AUTODMA,
.enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
+ .udma_mask = 0x3f,
.bootable = OFF_BOARD,
.extra = 240
},{ /* 5 */
@@ -1617,6 +1626,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
.channels = 2, /* 4 */
.autodma = AUTODMA,
.enablebits = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
+ .udma_mask = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f,
.bootable = OFF_BOARD,
.extra = 240
}
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index c04a026..ff48c23 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -231,7 +231,7 @@ static int it8213_config_drive_for_dma (ide_drive_t *drive)
static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
{
- u8 reg42h = 0, ata66 = 0;
+ u8 reg42h = 0;
hwif->speedproc = &it8213_tune_chipset;
hwif->tuneproc = &it8213_tuneproc;
@@ -250,11 +250,11 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
hwif->swdma_mask = 0x04;
pci_read_config_byte(hwif->pci_dev, 0x42, ®42h);
- ata66 = (reg42h & 0x02) ? 0 : 1;
hwif->ide_dma_check = &it8213_config_drive_for_dma;
- if (!(hwif->udma_four))
- hwif->udma_four = ata66;
+
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
/*
* The BIOS often doesn't set up DMA on this controller
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 3aeb7f1..8197b65 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -491,10 +491,10 @@ static int it821x_config_drive_for_dma (ide_drive_t *drive)
* the needed logic onboard.
*/
-static unsigned int __devinit ata66_it821x(ide_hwif_t *hwif)
+static u8 __devinit ata66_it821x(ide_hwif_t *hwif)
{
/* The reference driver also only does disk side */
- return 1;
+ return ATA_CBL_PATA80;
}
/**
@@ -662,8 +662,9 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
hwif->mwdma_mask = 0x07;
hwif->ide_dma_check = &it821x_config_drive_for_dma;
- if (!(hwif->udma_four))
- hwif->udma_four = ata66_it821x(hwif);
+
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = ata66_it821x(hwif);
/*
* The BIOS often doesn't set up DMA on this controller
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c
index 76ed251..a6008f6 100644
--- a/drivers/ide/pci/jmicron.c
+++ b/drivers/ide/pci/jmicron.c
@@ -25,10 +25,10 @@ typedef enum {
* ata66_jmicron - Cable check
* @hwif: IDE port
*
- * Return 1 if the cable is 80pin
+ * Returns the cable type.
*/
-static int __devinit ata66_jmicron(ide_hwif_t *hwif)
+static u8 __devinit ata66_jmicron(ide_hwif_t *hwif)
{
struct pci_dev *pdev = hwif->pci_dev;
@@ -70,16 +70,17 @@ static int __devinit ata66_jmicron(ide_hwif_t *hwif)
{
case PORT_PATA0:
if (control & (1 << 3)) /* 40/80 pin primary */
- return 0;
- return 1;
+ return ATA_CBL_PATA40;
+ return ATA_CBL_PATA80;
case PORT_PATA1:
if (control5 & (1 << 19)) /* 40/80 pin secondary */
- return 0;
- return 1;
+ return ATA_CBL_PATA40;
+ return ATA_CBL_PATA80;
case PORT_SATA:
break;
}
- return 1; /* Avoid bogus "control reaches end of non-void function" */
+ /* Avoid bogus "control reaches end of non-void function" */
+ return ATA_CBL_PATA80;
}
static void jmicron_tuneproc (ide_drive_t *drive, byte mode_wanted)
@@ -159,8 +160,9 @@ static void __devinit init_hwif_jmicron(ide_hwif_t *hwif)
hwif->mwdma_mask = 0x07;
hwif->ide_dma_check = &jmicron_config_drive_for_dma;
- if (!(hwif->udma_four))
- hwif->udma_four = ata66_jmicron(hwif);
+
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = ata66_jmicron(hwif);
hwif->autodma = 1;
hwif->drives[0].autodma = hwif->autodma;
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 0765dce..ee5020d 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -225,7 +225,10 @@ static void pdcnew_tune_drive(ide_drive_t *drive, u8 pio)
static u8 pdcnew_cable_detect(ide_hwif_t *hwif)
{
- return get_indexed_reg(hwif, 0x0b) & 0x04;
+ if (get_indexed_reg(hwif, 0x0b) & 0x04)
+ return ATA_CBL_PATA40;
+ else
+ return ATA_CBL_PATA80;
}
static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
@@ -509,8 +512,8 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate;
- if (!hwif->udma_four)
- hwif->udma_four = pdcnew_cable_detect(hwif) ? 0 : 1;
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = pdcnew_cable_detect(hwif);
if (!noautodma)
hwif->autodma = 1;
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 2384468..41ac4a9 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -152,8 +152,10 @@ static void pdc202xx_tune_drive(ide_drive_t *drive, u8 pio)
static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif)
{
u16 CIS = 0, mask = (hwif->channel) ? (1<<11) : (1<<10);
+
pci_read_config_word(hwif->pci_dev, 0x50, &CIS);
- return (CIS & mask) ? 1 : 0;
+
+ return (CIS & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
}
/*
@@ -267,18 +269,24 @@ somebody_else:
return (dma_stat & 4) == 4; /* return 1 if INTR asserted */
}
-static int pdc202xx_ide_dma_lostirq(ide_drive_t *drive)
+static void pdc202xx_dma_lost_irq(ide_drive_t *drive)
{
- if (HWIF(drive)->resetproc != NULL)
- HWIF(drive)->resetproc(drive);
- return __ide_dma_lostirq(drive);
+ ide_hwif_t *hwif = HWIF(drive);
+
+ if (hwif->resetproc != NULL)
+ hwif->resetproc(drive);
+
+ ide_dma_lost_irq(drive);
}
-static int pdc202xx_ide_dma_timeout(ide_drive_t *drive)
+static void pdc202xx_dma_timeout(ide_drive_t *drive)
{
- if (HWIF(drive)->resetproc != NULL)
- HWIF(drive)->resetproc(drive);
- return __ide_dma_timeout(drive);
+ ide_hwif_t *hwif = HWIF(drive);
+
+ if (hwif->resetproc != NULL)
+ hwif->resetproc(drive);
+
+ ide_dma_timeout(drive);
}
static void pdc202xx_reset_host (ide_hwif_t *hwif)
@@ -347,12 +355,13 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
hwif->err_stops_fifo = 1;
hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate;
- hwif->ide_dma_lostirq = &pdc202xx_ide_dma_lostirq;
- hwif->ide_dma_timeout = &pdc202xx_ide_dma_timeout;
+ hwif->dma_lost_irq = &pdc202xx_dma_lost_irq;
+ hwif->dma_timeout = &pdc202xx_dma_timeout;
if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) {
- if (!(hwif->udma_four))
- hwif->udma_four = (pdc202xx_old_cable_detect(hwif)) ? 0 : 1;
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = pdc202xx_old_cable_detect(hwif);
+
hwif->dma_start = &pdc202xx_old_ide_dma_start;
hwif->ide_dma_end = &pdc202xx_old_ide_dma_end;
}
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 8b219dd..2e0b29e 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -1,5 +1,5 @@
/*
- * linux/drivers/ide/pci/piix.c Version 0.47 February 8, 2007
+ * linux/drivers/ide/pci/piix.c Version 0.50 Jun 10, 2007
*
* Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer
* Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>
@@ -394,14 +394,45 @@ static void piix_dma_clear_irq(ide_drive_t *drive)
hwif->OUTB(dma_stat, hwif->dma_status);
}
-static int __devinit piix_cable_detect(ide_hwif_t *hwif)
+struct ich_laptop {
+ u16 device;
+ u16 subvendor;
+ u16 subdevice;
+};
+
+/*
+ * List of laptops that use short cables rather than 80 wire
+ */
+
+static const struct ich_laptop ich_laptop[] = {
+ /* devid, subvendor, subdev */
+ { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */
+ { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */
+ { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */
+ { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on Acer Aspire 2023WLMi */
+ /* end marker */
+ { 0, }
+};
+
+static u8 __devinit piix_cable_detect(ide_hwif_t *hwif)
{
- struct pci_dev *dev = hwif->pci_dev;
+ struct pci_dev *pdev = hwif->pci_dev;
+ const struct ich_laptop *lap = &ich_laptop[0];
u8 reg54h = 0, mask = hwif->channel ? 0xc0 : 0x30;
- pci_read_config_byte(dev, 0x54, ®54h);
+ /* check for specials */
+ while (lap->device) {
+ if (lap->device == pdev->device &&
+ lap->subvendor == pdev->subsystem_vendor &&
+ lap->subdevice == pdev->subsystem_device) {
+ return ATA_CBL_PATA40_SHORT;
+ }
+ lap++;
+ }
+
+ pci_read_config_byte(pdev, 0x54, ®54h);
- return (reg54h & mask) ? 1 : 0;
+ return (reg54h & mask) ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
}
/**
@@ -444,8 +475,8 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
hwif->swdma_mask = 0x04;
if (hwif->ultra_mask & 0x78) {
- if (!hwif->udma_four)
- hwif->udma_four = piix_cable_detect(hwif);
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = piix_cable_detect(hwif);
}
if (no_piix_dma)
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index 55bc0a3..7b87488 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -716,7 +716,7 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
hwif->atapi_dma = 1;
/* we support 80c cable only. */
- hwif->udma_four = 1;
+ hwif->cbl = ATA_CBL_PATA80;
hwif->autodma = 0;
if (!noautodma)
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index d9c4fd1..1371b5b 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -1,5 +1,5 @@
/*
- * linux/drivers/ide/pci/serverworks.c Version 0.11 Jun 2 2007
+ * linux/drivers/ide/pci/serverworks.c Version 0.20 Jun 3 2007
*
* Copyright (C) 1998-2000 Michel Aubry
* Copyright (C) 1998-2000 Andrzej Krzysztofowicz
@@ -151,84 +151,11 @@ static int svwks_tune_chipset (ide_drive_t *drive, u8 xferspeed)
if(dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4 &&
drive->media == ide_disk && speed >= XFER_UDMA_0)
BUG();
-
- pci_read_config_byte(dev, drive_pci[drive->dn], &pio_timing);
- pci_read_config_byte(dev, drive_pci2[drive->dn], &dma_timing);
+
pci_read_config_byte(dev, (0x56|hwif->channel), &ultra_timing);
pci_read_config_word(dev, 0x4A, &csb5_pio);
pci_read_config_byte(dev, 0x54, &ultra_enable);
- /* If we are in RAID mode (eg AMI MegaIDE) then we can't it
- turns out trust the firmware configuration */
-
- if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
- goto oem_setup_failed;
-
- /* Per Specified Design by OEM, and ASIC Architect */
- if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) ||
- (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) {
- if (!drive->init_speed) {
- u8 dma_stat = inb(hwif->dma_status);
-
- if (((ultra_enable << (7-drive->dn) & 0x80) == 0x80) &&
- ((dma_stat & (1<<(5+unit))) == (1<<(5+unit)))) {
- drive->current_speed = drive->init_speed = XFER_UDMA_0 + udma_modes[(ultra_timing >> (4*unit)) & ~(0xF0)];
- return 0;
- } else if ((dma_timing) &&
- ((dma_stat&(1<<(5+unit)))==(1<<(5+unit)))) {
- u8 dmaspeed;
-
- switch (dma_timing & 0x77) {
- case 0x20:
- dmaspeed = XFER_MW_DMA_2;
- break;
- case 0x21:
- dmaspeed = XFER_MW_DMA_1;
- break;
- case 0x77:
- dmaspeed = XFER_MW_DMA_0;
- break;
- default:
- goto dma_pio;
- }
-
- drive->current_speed = drive->init_speed = dmaspeed;
- return 0;
- }
-dma_pio:
- if (pio_timing) {
- u8 piospeed;
-
- switch (pio_timing & 0x7f) {
- case 0x20:
- piospeed = XFER_PIO_4;
- break;
- case 0x22:
- piospeed = XFER_PIO_3;
- break;
- case 0x34:
- piospeed = XFER_PIO_2;
- break;
- case 0x47:
- piospeed = XFER_PIO_1;
- break;
- case 0x5d:
- piospeed = XFER_PIO_0;
- break;
- default:
- goto oem_setup_failed;
- }
-
- drive->current_speed = drive->init_speed = piospeed;
- return 0;
- }
- }
- }
-
-oem_setup_failed:
-
- pio_timing = 0;
- dma_timing = 0;
ultra_timing &= ~(0x0F << (4*unit));
ultra_enable &= ~(0x01 << drive->dn);
csb5_pio &= ~(0x0F << (4*drive->dn));
@@ -402,9 +329,9 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha
return dev->irq;
}
-static unsigned int __devinit ata66_svwks_svwks (ide_hwif_t *hwif)
+static u8 __devinit ata66_svwks_svwks(ide_hwif_t *hwif)
{
- return 1;
+ return ATA_CBL_PATA80;
}
/* On Dell PowerEdge servers with a CSB5/CSB6, the top two bits
@@ -414,7 +341,7 @@ static unsigned int __devinit ata66_svwks_svwks (ide_hwif_t *hwif)
* Bit 14 clear = primary IDE channel does not have 80-pin cable.
* Bit 14 set = primary IDE channel has 80-pin cable.
*/
-static unsigned int __devinit ata66_svwks_dell (ide_hwif_t *hwif)
+static u8 __devinit ata66_svwks_dell(ide_hwif_t *hwif)
{
struct pci_dev *dev = hwif->pci_dev;
if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
@@ -422,8 +349,8 @@ static unsigned int __devinit ata66_svwks_dell (ide_hwif_t *hwif)
(dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE ||
dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE))
return ((1 << (hwif->channel + 14)) &
- dev->subsystem_device) ? 1 : 0;
- return 0;
+ dev->subsystem_device) ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
+ return ATA_CBL_PATA40;
}
/* Sun Cobalt Alpine hardware avoids the 80-pin cable
@@ -432,18 +359,18 @@ static unsigned int __devinit ata66_svwks_dell (ide_hwif_t *hwif)
*
* WARNING: this only works on Alpine hardware!
*/
-static unsigned int __devinit ata66_svwks_cobalt (ide_hwif_t *hwif)
+static u8 __devinit ata66_svwks_cobalt(ide_hwif_t *hwif)
{
struct pci_dev *dev = hwif->pci_dev;
if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN &&
dev->vendor == PCI_VENDOR_ID_SERVERWORKS &&
dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE)
return ((1 << (hwif->channel + 14)) &
- dev->subsystem_device) ? 1 : 0;
- return 0;
+ dev->subsystem_device) ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
+ return ATA_CBL_PATA40;
}
-static unsigned int __devinit ata66_svwks (ide_hwif_t *hwif)
+static u8 __devinit ata66_svwks(ide_hwif_t *hwif)
{
struct pci_dev *dev = hwif->pci_dev;
@@ -462,9 +389,9 @@ static unsigned int __devinit ata66_svwks (ide_hwif_t *hwif)
/* Per Specified Design by OEM, and ASIC Architect */
if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) ||
(dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2))
- return 1;
+ return ATA_CBL_PATA80;
- return 0;
+ return ATA_CBL_PATA40;
}
static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
@@ -495,8 +422,8 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
hwif->ide_dma_check = &svwks_config_drive_xfer_rate;
if (hwif->pci_dev->device != PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) {
- if (!hwif->udma_four)
- hwif->udma_four = ata66_svwks(hwif);
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = ata66_svwks(hwif);
}
if (!noautodma)
hwif->autodma = 1;
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index d3185e2..d396b29 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -316,14 +316,6 @@ static void sgiioc4_dma_host_off(ide_drive_t * drive)
sgiioc4_clearirq(drive);
}
-static int
-sgiioc4_ide_dma_lostirq(ide_drive_t * drive)
-{
- HWIF(drive)->resetproc(drive);
-
- return __ide_dma_lostirq(drive);
-}
-
static void
sgiioc4_resetproc(ide_drive_t * drive)
{
@@ -331,6 +323,14 @@ sgiioc4_resetproc(ide_drive_t * drive)
sgiioc4_clearirq(drive);
}
+static void
+sgiioc4_dma_lost_irq(ide_drive_t * drive)
+{
+ sgiioc4_resetproc(drive);
+
+ ide_dma_lost_irq(drive);
+}
+
static u8
sgiioc4_INB(unsigned long port)
{
@@ -607,8 +607,8 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
hwif->ide_dma_test_irq = &sgiioc4_ide_dma_test_irq;
hwif->dma_host_on = &sgiioc4_dma_host_on;
hwif->dma_host_off = &sgiioc4_dma_host_off;
- hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq;
- hwif->ide_dma_timeout = &__ide_dma_timeout;
+ hwif->dma_lost_irq = &sgiioc4_dma_lost_irq;
+ hwif->dma_timeout = &ide_dma_timeout;
hwif->INB = &sgiioc4_INB;
}
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 1a4444e..1c3e354 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -933,16 +933,17 @@ static void __devinit init_iops_siimage(ide_hwif_t *hwif)
* interface.
*/
-static unsigned int __devinit ata66_siimage(ide_hwif_t *hwif)
+static u8 __devinit ata66_siimage(ide_hwif_t *hwif)
{
unsigned long addr = siimage_selreg(hwif, 0);
- if (pci_get_drvdata(hwif->pci_dev) == NULL) {
- u8 ata66 = 0;
+ u8 ata66 = 0;
+
+ if (pci_get_drvdata(hwif->pci_dev) == NULL)
pci_read_config_byte(hwif->pci_dev, addr, &ata66);
- return (ata66 & 0x01) ? 1 : 0;
- }
+ else
+ ata66 = hwif->INB(addr);
- return (hwif->INB(addr) & 0x01) ? 1 : 0;
+ return (ata66 & 0x01) ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
}
/**
@@ -988,8 +989,9 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
hwif->atapi_dma = 1;
hwif->ide_dma_check = &siimage_config_drive_for_dma;
- if (!(hwif->udma_four))
- hwif->udma_four = ata66_siimage(hwif);
+
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = ata66_siimage(hwif);
if (hwif->mmio) {
hwif->ide_dma_test_irq = &siimage_mmio_ide_dma_test_irq;
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index ec0adad..f875183 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -1,5 +1,5 @@
/*
- * linux/drivers/ide/pci/sis5513.c Version 0.20 Mar 4, 2007
+ * linux/drivers/ide/pci/sis5513.c Version 0.25 Jun 10, 2007
*
* Copyright (C) 1999-2000 Andre Hedrick <andre@linux-ide.org>
* Copyright (C) 2002 Lionel Bouton <Lionel.Bouton@inet6.fr>, Maintainer
@@ -796,10 +796,33 @@ static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const c
return 0;
}
-static unsigned int __devinit ata66_sis5513 (ide_hwif_t *hwif)
+struct sis_laptop {
+ u16 device;
+ u16 subvendor;
+ u16 subdevice;
+};
+
+static const struct sis_laptop sis_laptop[] = {
+ /* devid, subvendor, subdev */
+ { 0x5513, 0x1043, 0x1107 }, /* ASUS A6K */
+ /* end marker */
+ { 0, }
+};
+
+static u8 __devinit ata66_sis5513(ide_hwif_t *hwif)
{
+ struct pci_dev *pdev = hwif->pci_dev;
+ const struct sis_laptop *lap = &sis_laptop[0];
u8 ata66 = 0;
+ while (lap->device) {
+ if (lap->device == pdev->device &&
+ lap->subvendor == pdev->subsystem_vendor &&
+ lap->subdevice == pdev->subsystem_device)
+ return ATA_CBL_PATA40_SHORT;
+ lap++;
+ }
+
if (chipset_family >= ATA_133) {
u16 regw = 0;
u16 reg_addr = hwif->channel ? 0x52: 0x50;
@@ -811,7 +834,8 @@ static unsigned int __devinit ata66_sis5513 (ide_hwif_t *hwif)
pci_read_config_byte(hwif->pci_dev, 0x48, ®48h);
ata66 = (reg48h & mask) ? 0 : 1;
}
- return ata66;
+
+ return ata66 ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
}
static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
@@ -841,8 +865,8 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
if (!chipset_family)
return;
- if (!(hwif->udma_four))
- hwif->udma_four = ata66_sis5513(hwif);
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = ata66_sis5513(hwif);
if (chipset_family > ATA_16) {
hwif->ide_dma_check = &sis5513_config_xfer_rate;
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 7c383d9..4878798 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -195,7 +195,7 @@ static inline void sl82c105_reset_host(struct pci_dev *dev)
* This function is called when the IDE timer expires, the drive
* indicates that it is READY, and we were waiting for DMA to complete.
*/
-static int sl82c105_ide_dma_lostirq(ide_drive_t *drive)
+static void sl82c105_dma_lost_irq(ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
@@ -222,9 +222,6 @@ static int sl82c105_ide_dma_lostirq(ide_drive_t *drive)
}
sl82c105_reset_host(dev);
-
- /* __ide_dma_lostirq would return 1, so we do as well */
- return 1;
}
/*
@@ -244,15 +241,12 @@ static void sl82c105_dma_start(ide_drive_t *drive)
ide_dma_start(drive);
}
-static int sl82c105_ide_dma_timeout(ide_drive_t *drive)
+static void sl82c105_dma_timeout(ide_drive_t *drive)
{
- ide_hwif_t *hwif = HWIF(drive);
- struct pci_dev *dev = hwif->pci_dev;
+ DBG(("sl82c105_dma_timeout(drive:%s)\n", drive->name));
- DBG(("sl82c105_ide_dma_timeout(drive:%s)\n", drive->name));
-
- sl82c105_reset_host(dev);
- return __ide_dma_timeout(drive);
+ sl82c105_reset_host(HWIF(drive)->pci_dev);
+ ide_dma_timeout(drive);
}
static int sl82c105_ide_dma_on(ide_drive_t *drive)
@@ -441,9 +435,9 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
hwif->ide_dma_check = &sl82c105_ide_dma_check;
hwif->ide_dma_on = &sl82c105_ide_dma_on;
hwif->dma_off_quietly = &sl82c105_dma_off_quietly;
- hwif->ide_dma_lostirq = &sl82c105_ide_dma_lostirq;
+ hwif->dma_lost_irq = &sl82c105_dma_lost_irq;
hwif->dma_start = &sl82c105_dma_start;
- hwif->ide_dma_timeout = &sl82c105_ide_dma_timeout;
+ hwif->dma_timeout = &sl82c105_dma_timeout;
if (!noautodma)
hwif->autodma = 1;
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index c40f291..575dbbd 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -199,10 +199,9 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
hwif->mwdma_mask = 0x06;
hwif->swdma_mask = 0x04;
- if (!hwif->udma_four) {
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
/* bit[0(1)]: 0:80, 1:40 */
- hwif->udma_four = (reg47 & mask) ? 0 : 1;
- }
+ hwif->cbl = (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
hwif->ide_dma_check = &slc90e66_config_drive_xfer_rate;
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c
index cee619b..8de1f8e 100644
--- a/drivers/ide/pci/tc86c001.c
+++ b/drivers/ide/pci/tc86c001.c
@@ -220,13 +220,13 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
hwif->ide_dma_check = &tc86c001_config_drive_xfer_rate;
hwif->dma_start = &tc86c001_dma_start;
- if (!hwif->udma_four) {
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
/*
* System Control 1 Register bit 13 (PDIAGN):
* 0=80-pin cable, 1=40-pin cable
*/
scr1 = hwif->INW(sc_base + 0x00);
- hwif->udma_four = (scr1 & 0x2000) ? 0 : 1;
+ hwif->cbl = (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
}
if (!noautodma)
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index a508550..d21dd2e 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -1,6 +1,6 @@
/*
*
- * Version 3.38
+ * Version 3.45
*
* VIA IDE driver for Linux. Supported southbridges:
*
@@ -9,6 +9,7 @@
* vt8235, vt8237, vt8237a
*
* Copyright (c) 2000-2002 Vojtech Pavlik
+ * Copyright (c) 2007 Bartlomiej Zolnierkiewicz
*
* Based on the work of:
* Michel Aubry
@@ -33,6 +34,8 @@
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/ide.h>
+#include <linux/dmi.h>
+
#include <asm/io.h>
#ifdef CONFIG_PPC_CHRP
@@ -41,8 +44,6 @@
#include "ide-timing.h"
-#define DISPLAY_VIA_TIMINGS
-
#define VIA_IDE_ENABLE 0x40
#define VIA_IDE_CONFIG 0x41
#define VIA_FIFO_CONFIG 0x43
@@ -54,18 +55,12 @@
#define VIA_ADDRESS_SETUP 0x4c
#define VIA_UDMA_TIMING 0x50
-#define VIA_UDMA 0x007
-#define VIA_UDMA_NONE 0x000
-#define VIA_UDMA_33 0x001
-#define VIA_UDMA_66 0x002
-#define VIA_UDMA_100 0x003
-#define VIA_UDMA_133 0x004
-#define VIA_BAD_PREQ 0x010 /* Crashes if PREQ# till DDACK# set */
-#define VIA_BAD_CLK66 0x020 /* 66 MHz clock doesn't work correctly */
-#define VIA_SET_FIFO 0x040 /* Needs to have FIFO split set */
-#define VIA_NO_UNMASK 0x080 /* Doesn't work with IRQ unmasking on */
-#define VIA_BAD_ID 0x100 /* Has wrong vendor ID (0x1107) */
-#define VIA_BAD_AST 0x200 /* Don't touch Address Setup Timing */
+#define VIA_BAD_PREQ 0x01 /* Crashes if PREQ# till DDACK# set */
+#define VIA_BAD_CLK66 0x02 /* 66 MHz clock doesn't work correctly */
+#define VIA_SET_FIFO 0x04 /* Needs to have FIFO split set */
+#define VIA_NO_UNMASK 0x08 /* Doesn't work with IRQ unmasking on */
+#define VIA_BAD_ID 0x10 /* Has wrong vendor ID (0x1107) */
+#define VIA_BAD_AST 0x20 /* Don't touch Address Setup Timing */
/*
* VIA SouthBridge chips.
@@ -76,36 +71,37 @@ static struct via_isa_bridge {
u16 id;
u8 rev_min;
u8 rev_max;
- u16 flags;
+ u8 udma_mask;
+ u8 flags;
} via_isa_bridges[] = {
- { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
- { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
- { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
- { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
- { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
- { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
- { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
- { "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
- { "vt8233c", PCI_DEVICE_ID_VIA_8233C_0, 0x00, 0x2f, VIA_UDMA_100 },
- { "vt8233", PCI_DEVICE_ID_VIA_8233_0, 0x00, 0x2f, VIA_UDMA_100 },
- { "vt8231", PCI_DEVICE_ID_VIA_8231, 0x00, 0x2f, VIA_UDMA_100 },
- { "vt82c686b", PCI_DEVICE_ID_VIA_82C686, 0x40, 0x4f, VIA_UDMA_100 },
- { "vt82c686a", PCI_DEVICE_ID_VIA_82C686, 0x10, 0x2f, VIA_UDMA_66 },
- { "vt82c686", PCI_DEVICE_ID_VIA_82C686, 0x00, 0x0f, VIA_UDMA_33 | VIA_BAD_CLK66 },
- { "vt82c596b", PCI_DEVICE_ID_VIA_82C596, 0x10, 0x2f, VIA_UDMA_66 },
- { "vt82c596a", PCI_DEVICE_ID_VIA_82C596, 0x00, 0x0f, VIA_UDMA_33 | VIA_BAD_CLK66 },
- { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x47, 0x4f, VIA_UDMA_33 | VIA_SET_FIFO },
- { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x40, 0x46, VIA_UDMA_33 | VIA_SET_FIFO | VIA_BAD_PREQ },
- { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x30, 0x3f, VIA_UDMA_33 | VIA_SET_FIFO },
- { "vt82c586a", PCI_DEVICE_ID_VIA_82C586_0, 0x20, 0x2f, VIA_UDMA_33 | VIA_SET_FIFO },
- { "vt82c586", PCI_DEVICE_ID_VIA_82C586_0, 0x00, 0x0f, VIA_UDMA_NONE | VIA_SET_FIFO },
- { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK },
- { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK | VIA_BAD_ID },
+ { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
+ { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
+ { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
+ { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
+ { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
+ { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
+ { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
+ { "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, ATA_UDMA6, VIA_BAD_AST },
+ { "vt8233c", PCI_DEVICE_ID_VIA_8233C_0, 0x00, 0x2f, ATA_UDMA5, },
+ { "vt8233", PCI_DEVICE_ID_VIA_8233_0, 0x00, 0x2f, ATA_UDMA5, },
+ { "vt8231", PCI_DEVICE_ID_VIA_8231, 0x00, 0x2f, ATA_UDMA5, },
+ { "vt82c686b", PCI_DEVICE_ID_VIA_82C686, 0x40, 0x4f, ATA_UDMA5, },
+ { "vt82c686a", PCI_DEVICE_ID_VIA_82C686, 0x10, 0x2f, ATA_UDMA4, },
+ { "vt82c686", PCI_DEVICE_ID_VIA_82C686, 0x00, 0x0f, ATA_UDMA2, VIA_BAD_CLK66 },
+ { "vt82c596b", PCI_DEVICE_ID_VIA_82C596, 0x10, 0x2f, ATA_UDMA4, },
+ { "vt82c596a", PCI_DEVICE_ID_VIA_82C596, 0x00, 0x0f, ATA_UDMA2, VIA_BAD_CLK66 },
+ { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x47, 0x4f, ATA_UDMA2, VIA_SET_FIFO },
+ { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x40, 0x46, ATA_UDMA2, VIA_SET_FIFO | VIA_BAD_PREQ },
+ { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x30, 0x3f, ATA_UDMA2, VIA_SET_FIFO },
+ { "vt82c586a", PCI_DEVICE_ID_VIA_82C586_0, 0x20, 0x2f, ATA_UDMA2, VIA_SET_FIFO },
+ { "vt82c586", PCI_DEVICE_ID_VIA_82C586_0, 0x00, 0x0f, 0x00, VIA_SET_FIFO },
+ { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, 0x00, VIA_SET_FIFO | VIA_NO_UNMASK },
+ { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, 0x00, VIA_SET_FIFO | VIA_NO_UNMASK | VIA_BAD_ID },
{ NULL }
};
static unsigned int via_clock;
-static char *via_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" };
+static char *via_dma[] = { "16", "25", "33", "44", "66", "100", "133" };
struct via82cxxx_dev
{
@@ -140,12 +136,12 @@ static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing)
pci_write_config_byte(dev, VIA_DRIVE_TIMING + (3 - dn),
((FIT(timing->active, 1, 16) - 1) << 4) | (FIT(timing->recover, 1, 16) - 1));
- switch (vdev->via_config->flags & VIA_UDMA) {
- case VIA_UDMA_33: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break;
- case VIA_UDMA_66: t = timing->udma ? (0xe8 | (FIT(timing->udma, 2, 9) - 2)) : 0x0f; break;
- case VIA_UDMA_100: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break;
- case VIA_UDMA_133: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break;
- default: return;
+ switch (vdev->via_config->udma_mask) {
+ case ATA_UDMA2: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break;
+ case ATA_UDMA4: t = timing->udma ? (0xe8 | (FIT(timing->udma, 2, 9) - 2)) : 0x0f; break;
+ case ATA_UDMA5: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break;
+ case ATA_UDMA6: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break;
+ default: return;
}
pci_write_config_byte(dev, VIA_UDMA_TIMING + (3 - dn), t);
@@ -173,12 +169,12 @@ static int via_set_drive(ide_drive_t *drive, u8 speed)
T = 1000000000 / via_clock;
- switch (vdev->via_config->flags & VIA_UDMA) {
- case VIA_UDMA_33: UT = T; break;
- case VIA_UDMA_66: UT = T/2; break;
- case VIA_UDMA_100: UT = T/3; break;
- case VIA_UDMA_133: UT = T/4; break;
- default: UT = T;
+ switch (vdev->via_config->udma_mask) {
+ case ATA_UDMA2: UT = T; break;
+ case ATA_UDMA4: UT = T/2; break;
+ case ATA_UDMA5: UT = T/3; break;
+ case ATA_UDMA6: UT = T/4; break;
+ default: UT = T;
}
ide_timing_compute(drive, speed, &t, T, UT);
@@ -208,8 +204,7 @@ static int via_set_drive(ide_drive_t *drive, u8 speed)
static void via82cxxx_tune_drive(ide_drive_t *drive, u8 pio)
{
if (pio == 255) {
- via_set_drive(drive,
- ide_find_best_mode(drive, XFER_PIO | XFER_EPIO));
+ via_set_drive(drive, ide_find_best_pio_mode(drive));
return;
}
@@ -226,16 +221,10 @@ static void via82cxxx_tune_drive(ide_drive_t *drive, u8 pio)
static int via82cxxx_ide_dma_check (ide_drive_t *drive)
{
- ide_hwif_t *hwif = HWIF(drive);
- struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev);
- u16 w80 = hwif->udma_four;
+ u8 speed = ide_max_dma_mode(drive);
- u16 speed = ide_find_best_mode(drive,
- XFER_PIO | XFER_EPIO | XFER_SWDMA | XFER_MWDMA |
- (vdev->via_config->flags & VIA_UDMA ? XFER_UDMA : 0) |
- (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_66 ? XFER_UDMA_66 : 0) |
- (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_100 ? XFER_UDMA_100 : 0) |
- (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_133 ? XFER_UDMA_133 : 0));
+ if (speed == 0)
+ speed = ide_find_best_pio_mode(drive);
via_set_drive(drive, speed);
@@ -272,8 +261,8 @@ static void __devinit via_cable_detect(struct via82cxxx_dev *vdev, u32 u)
{
int i;
- switch (vdev->via_config->flags & VIA_UDMA) {
- case VIA_UDMA_66:
+ switch (vdev->via_config->udma_mask) {
+ case ATA_UDMA4:
for (i = 24; i >= 0; i -= 8)
if (((u >> (i & 16)) & 8) &&
((u >> i) & 0x20) &&
@@ -286,7 +275,7 @@ static void __devinit via_cable_detect(struct via82cxxx_dev *vdev, u32 u)
}
break;
- case VIA_UDMA_100:
+ case ATA_UDMA5:
for (i = 24; i >= 0; i -= 8)
if (((u >> i) & 0x10) ||
(((u >> i) & 0x20) &&
@@ -298,7 +287,7 @@ static void __devinit via_cable_detect(struct via82cxxx_dev *vdev, u32 u)
}
break;
- case VIA_UDMA_133:
+ case ATA_UDMA6:
for (i = 24; i >= 0; i -= 8)
if (((u >> i) & 0x10) ||
(((u >> i) & 0x20) &&
@@ -353,7 +342,7 @@ static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const
via_cable_detect(vdev, u);
- if ((via_config->flags & VIA_UDMA) == VIA_UDMA_66) {
+ if (via_config->udma_mask == ATA_UDMA4) {
/* Enable Clk66 */
pci_write_config_dword(dev, VIA_UDMA_TIMING, u|0x80008);
} else if (via_config->flags & VIA_BAD_CLK66) {
@@ -416,16 +405,54 @@ static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const
*/
pci_read_config_byte(isa, PCI_REVISION_ID, &t);
- printk(KERN_INFO "VP_IDE: VIA %s (rev %02x) IDE %s "
+ printk(KERN_INFO "VP_IDE: VIA %s (rev %02x) IDE %sDMA%s "
"controller on pci%s\n",
via_config->name, t,
- via_dma[via_config->flags & VIA_UDMA],
+ via_config->udma_mask ? "U" : "MW",
+ via_dma[via_config->udma_mask ?
+ (fls(via_config->udma_mask) - 1) : 0],
pci_name(dev));
pci_dev_put(isa);
return 0;
}
+/*
+ * Cable special cases
+ */
+
+static struct dmi_system_id cable_dmi_table[] = {
+ {
+ .ident = "Acer Ferrari 3400",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "Acer,Inc."),
+ DMI_MATCH(DMI_BOARD_NAME, "Ferrari 3400"),
+ },
+ },
+ { }
+};
+
+static int via_cable_override(void)
+{
+ /* Systems by DMI */
+ if (dmi_check_system(cable_dmi_table))
+ return 1;
+ return 0;
+}
+
+static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif)
+{
+ struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev);
+
+ if (via_cable_override())
+ return ATA_CBL_PATA40_SHORT;
+
+ if ((vdev->via_80w >> hwif->channel) & 1)
+ return ATA_CBL_PATA80;
+ else
+ return ATA_CBL_PATA40;
+}
+
static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
{
struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev);
@@ -454,12 +481,14 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
return;
hwif->atapi_dma = 1;
- hwif->ultra_mask = 0x7f;
+
+ hwif->ultra_mask = vdev->via_config->udma_mask;
hwif->mwdma_mask = 0x07;
hwif->swdma_mask = 0x07;
- if (!hwif->udma_four)
- hwif->udma_four = (vdev->via_80w >> hwif->channel) & 1;
+ if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+ hwif->cbl = via82cxxx_cable_detect(hwif);
+
hwif->ide_dma_check = &via82cxxx_ide_dma_check;
if (!noautodma)
hwif->autodma = 1;
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 45fc36f..e46f472 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -942,8 +942,8 @@ pmac_ide_tune_chipset (ide_drive_t *drive, byte speed)
return 1;
case XFER_UDMA_4:
case XFER_UDMA_3:
- if (HWIF(drive)->udma_four == 0)
- return 1;
+ if (drive->hwif->cbl != ATA_CBL_PATA80)
+ return 1;
case XFER_UDMA_2:
case XFER_UDMA_1:
case XFER_UDMA_0:
@@ -1244,7 +1244,7 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
hwif->chipset = ide_pmac;
hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET] || pmif->mediabay;
hwif->hold = pmif->mediabay;
- hwif->udma_four = pmif->cable_80;
+ hwif->cbl = pmif->cable_80 ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
hwif->drives[0].unmask = 1;
hwif->drives[1].unmask = 1;
hwif->tuneproc = pmac_ide_tuneproc;
@@ -1821,28 +1821,11 @@ pmac_ide_dma_check(ide_drive_t *drive)
enable = 0;
if (enable) {
- short mode;
-
- map = XFER_MWDMA;
- if (pmif->kind == controller_kl_ata4
- || pmif->kind == controller_un_ata6
- || pmif->kind == controller_k2_ata6
- || pmif->kind == controller_sh_ata6) {
- map |= XFER_UDMA;
- if (pmif->cable_80) {
- map |= XFER_UDMA_66;
- if (pmif->kind == controller_un_ata6 ||
- pmif->kind == controller_k2_ata6 ||
- pmif->kind == controller_sh_ata6)
- map |= XFER_UDMA_100;
- if (pmif->kind == controller_sh_ata6)
- map |= XFER_UDMA_133;
- }
- }
- mode = ide_find_best_mode(drive, map);
- if (mode & XFER_UDMA)
+ u8 mode = ide_max_dma_mode(drive);
+
+ if (mode >= XFER_UDMA_0)
drive->using_dma = pmac_ide_udma_enable(drive, mode);
- else if (mode & XFER_MWDMA)
+ else if (mode >= XFER_MW_DMA_0)
drive->using_dma = pmac_ide_mdma_enable(drive, mode);
hwif->OUTB(0, IDE_CONTROL_REG);
/* Apply settings to controller */
@@ -2004,20 +1987,19 @@ static void pmac_ide_dma_host_on(ide_drive_t *drive)
{
}
-static int
-pmac_ide_dma_lostirq (ide_drive_t *drive)
+static void
+pmac_ide_dma_lost_irq (ide_drive_t *drive)
{
pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data;
volatile struct dbdma_regs __iomem *dma;
unsigned long status;
if (pmif == NULL)
- return 0;
+ return;
dma = pmif->dma_regs;
status = readl(&dma->status);
printk(KERN_ERR "ide-pmac lost interrupt, dma status: %lx\n", status);
- return 0;
}
/*
@@ -2057,8 +2039,8 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
hwif->ide_dma_test_irq = &pmac_ide_dma_test_irq;
hwif->dma_host_off = &pmac_ide_dma_host_off;
hwif->dma_host_on = &pmac_ide_dma_host_on;
- hwif->ide_dma_timeout = &__ide_dma_timeout;
- hwif->ide_dma_lostirq = &pmac_ide_dma_lostirq;
+ hwif->dma_timeout = &ide_dma_timeout;
+ hwif->dma_lost_irq = &pmac_ide_dma_lost_irq;
hwif->atapi_dma = 1;
switch(pmif->kind) {
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h
index 8fcae21..4663e8b 100644
--- a/include/asm-mips/mach-au1x00/au1xxx_ide.h
+++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h
@@ -88,26 +88,26 @@ static const struct drive_list_entry dma_white_list [] = {
/*
* Hitachi
*/
- { "HITACHI_DK14FA-20" , "ALL" },
- { "HTS726060M9AT00" , "ALL" },
+ { "HITACHI_DK14FA-20" , NULL },
+ { "HTS726060M9AT00" , NULL },
/*
* Maxtor
*/
- { "Maxtor 6E040L0" , "ALL" },
- { "Maxtor 6Y080P0" , "ALL" },
- { "Maxtor 6Y160P0" , "ALL" },
+ { "Maxtor 6E040L0" , NULL },
+ { "Maxtor 6Y080P0" , NULL },
+ { "Maxtor 6Y160P0" , NULL },
/*
* Seagate
*/
- { "ST3120026A" , "ALL" },
- { "ST320014A" , "ALL" },
- { "ST94011A" , "ALL" },
- { "ST340016A" , "ALL" },
+ { "ST3120026A" , NULL },
+ { "ST320014A" , NULL },
+ { "ST94011A" , NULL },
+ { "ST340016A" , NULL },
/*
* Western Digital
*/
- { "WDC WD400UE-00HCT0" , "ALL" },
- { "WDC WD400JB-00JJC0" , "ALL" },
+ { "WDC WD400UE-00HCT0" , NULL },
+ { "WDC WD400JB-00JJC0" , NULL },
{ NULL , NULL }
};
@@ -116,9 +116,9 @@ static const struct drive_list_entry dma_black_list [] = {
/*
* Western Digital
*/
- { "WDC WD100EB-00CGH0" , "ALL" },
- { "WDC WD200BB-00AUA1" , "ALL" },
- { "WDC AC24300L" , "ALL" },
+ { "WDC WD100EB-00CGH0" , NULL },
+ { "WDC WD200BB-00AUA1" , NULL },
+ { "WDC AC24300L" , NULL },
{ NULL , NULL }
};
#endif
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 1e365ac..19ab258 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -25,6 +25,7 @@
#include <asm/system.h>
#include <asm/io.h>
#include <asm/semaphore.h>
+#include <asm/mutex.h>
/******************************************************************************
* IDE driver configuration options (play with these as desired):
@@ -685,6 +686,8 @@ typedef struct hwif_s {
u8 mwdma_mask;
u8 swdma_mask;
+ u8 cbl; /* cable type */
+
hwif_chipset_t chipset; /* sub-module for tuning.. */
struct pci_dev *pci_dev; /* for pci chipsets */
@@ -735,8 +738,8 @@ typedef struct hwif_s {
void (*ide_dma_clear_irq)(ide_drive_t *drive);
void (*dma_host_on)(ide_drive_t *drive);
void (*dma_host_off)(ide_drive_t *drive);
- int (*ide_dma_lostirq)(ide_drive_t *drive);
- int (*ide_dma_timeout)(ide_drive_t *drive);
+ void (*dma_lost_irq)(ide_drive_t *drive);
+ void (*dma_timeout)(ide_drive_t *drive);
void (*OUTB)(u8 addr, unsigned long port);
void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port);
@@ -791,7 +794,6 @@ typedef struct hwif_s {
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 udma_four : 1; /* 1=ATA-66 capable, 0=default */
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 */
@@ -863,7 +865,7 @@ typedef struct hwgroup_s {
typedef struct ide_driver_s ide_driver_t;
-extern struct semaphore ide_setting_sem;
+extern struct mutex ide_setting_mtx;
int set_io_32bit(ide_drive_t *, int);
int set_pio_mode(ide_drive_t *, int);
@@ -1304,8 +1306,8 @@ extern int __ide_dma_check(ide_drive_t *);
extern int ide_dma_setup(ide_drive_t *);
extern void ide_dma_start(ide_drive_t *);
extern int __ide_dma_end(ide_drive_t *);
-extern int __ide_dma_lostirq(ide_drive_t *);
-extern int __ide_dma_timeout(ide_drive_t *);
+extern void ide_dma_lost_irq(ide_drive_t *);
+extern void ide_dma_timeout(ide_drive_t *);
#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
#else
@@ -1382,11 +1384,11 @@ extern const ide_pio_timings_t ide_pio_timings[6];
extern spinlock_t ide_lock;
-extern struct semaphore ide_cfg_sem;
+extern struct mutex ide_cfg_mtx;
/*
* Structure locking:
*
- * ide_cfg_sem and ide_lock together protect changes to
+ * ide_cfg_mtx and ide_lock together protect changes to
* ide_hwif_t->{next,hwgroup}
* ide_drive_t->next
*
^ permalink raw reply related [flat|nested] 67+ messages in thread* [git patches] ide update @ 2005-12-15 2:03 Bartlomiej Zolnierkiewicz 0 siblings, 0 replies; 67+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-12-15 2:03 UTC (permalink / raw) To: Linus Torvalds; +Cc: linux-ide, linux-kernel Some missing bits for 2.6.15. Please pull from: master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/ to obtain following changes: Bartlomiej Zolnierkiewicz: ide-disk: flush cache after calling del_gendisk() ide: cleanup ide.h ide: cleanup ide_driver_t ide-cd: remove write-only cmd field from struct cdrom_info Daniel Drake: via82cxxx IDE: Add VT8251 ISA bridge Jeremy Higdon: sgiioc4: check for no hwifs available Jordan Crouse: ide: core modifications for AU1200 ide: AU1200 IDE update Marcelo Tosatti: ide: MPC8xx IDE depends on IDE=y && BLK_DEV_IDE=y drivers/ide/Kconfig | 10 drivers/ide/ide-cd.c | 7 drivers/ide/ide-cd.h | 1 drivers/ide/ide-disk.c | 4 drivers/ide/ide-dma.c | 15 drivers/ide/mips/Makefile | 3 drivers/ide/mips/au1xxx-ide.c | 1496 ++++++++++-------------------- drivers/ide/pci/sgiioc4.c | 8 drivers/ide/pci/via82cxxx.c | 1 include/asm-mips/mach-au1x00/au1xxx_ide.h | 22 include/linux/ide.h | 131 -- include/linux/pci_ids.h | 1 12 files changed, 566 insertions(+), 1133 deletions(-) ^ permalink raw reply [flat|nested] 67+ messages in thread
* [git patches] ide update
@ 2005-11-19 23:46 Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 67+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-11-19 23:46 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-ide, linux-kernel
VT6410 and SiS965 support,
+ few trivial cleanups as a bonus.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/
to obtain following changes:
Aurelien Jarno:
sis5513: enable ATA133 for the SiS965 southbridge
Bartlomiej Zolnierkiewicz:
ide: remove duplicate documentation for ide_do_drive_cmd()
ide: remove unused ide_action_t:ide_next
ide: remove dead DEBUG_TASKFILE code
ide: remove dead code from flagged_taskfile()
ide: add missing __init tags to device drivers
Mathias Kretschmer:
via82cxxx: add VIA VT6410 IDE support
drivers/ide/ide-cd.c | 4 ++--
drivers/ide/ide-disk.c | 2 +-
drivers/ide/ide-floppy.c | 5 +----
drivers/ide/ide-io.c | 6 ------
drivers/ide/ide-tape.c | 5 +----
drivers/ide/ide-taskfile.c | 27 +++------------------------
drivers/ide/pci/sis5513.c | 1 +
drivers/ide/pci/via82cxxx.c | 30 +++++++++++++++++++++---------
include/linux/hdreg.h | 6 ++++--
include/linux/ide.h | 26 --------------------------
include/linux/pci_ids.h | 2 ++
11 files changed, 36 insertions(+), 78 deletions(-)
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -3510,8 +3510,8 @@ static void __exit ide_cdrom_exit(void)
{
driver_unregister(&ide_cdrom_driver.gen_driver);
}
-
-static int ide_cdrom_init(void)
+
+static int __init ide_cdrom_init(void)
{
return driver_register(&ide_cdrom_driver.gen_driver);
}
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -1266,7 +1266,7 @@ static void __exit idedisk_exit (void)
driver_unregister(&idedisk_driver.gen_driver);
}
-static int idedisk_init (void)
+static int __init idedisk_init(void)
{
return driver_register(&idedisk_driver.gen_driver);
}
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -2191,10 +2191,7 @@ static void __exit idefloppy_exit (void)
driver_unregister(&idefloppy_driver.gen_driver);
}
-/*
- * idefloppy_init will register the driver for each floppy.
- */
-static int idefloppy_init (void)
+static int __init idefloppy_init(void)
{
printk("ide-floppy driver " IDEFLOPPY_VERSION "\n");
return driver_register(&idefloppy_driver.gen_driver);
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1629,12 +1629,6 @@ EXPORT_SYMBOL(ide_init_drive_cmd);
* for the new rq to be completed. This is VERY DANGEROUS, and is
* intended for careful use by the ATAPI tape/cdrom driver code.
*
- * If action is ide_next, then the rq is queued immediately after
- * the currently-being-processed-request (if any), and the function
- * returns without waiting for the new rq to be completed. As above,
- * This is VERY DANGEROUS, and is intended for careful use by the
- * ATAPI tape/cdrom driver code.
- *
* If action is ide_end, then the rq is queued at the end of the
* request queue, and the function returns immediately without waiting
* for the new rq to be completed. This is again intended for careful
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -4916,10 +4916,7 @@ static void __exit idetape_exit (void)
unregister_chrdev(IDETAPE_MAJOR, "ht");
}
-/*
- * idetape_init will register the driver for each tape.
- */
-static int idetape_init (void)
+static int __init idetape_init(void)
{
int error = 1;
idetape_sysfs_class = class_create(THIS_MODULE, "ide_tape");
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -51,8 +51,6 @@
#include <asm/uaccess.h>
#include <asm/io.h>
-#define DEBUG_TASKFILE 0 /* unset when fixed */
-
static void ata_bswap_data (void *buffer, int wcount)
{
u16 *p = buffer;
@@ -765,9 +763,6 @@ ide_startstop_t flagged_taskfile (ide_dr
ide_hwif_t *hwif = HWIF(drive);
task_struct_t *taskfile = (task_struct_t *) task->tfRegister;
hob_struct_t *hobfile = (hob_struct_t *) task->hobRegister;
-#if DEBUG_TASKFILE
- u8 status;
-#endif
if (task->data_phase == TASKFILE_MULTI_IN ||
task->data_phase == TASKFILE_MULTI_OUT) {
@@ -778,19 +773,13 @@ ide_startstop_t flagged_taskfile (ide_dr
}
/*
- * (ks) Check taskfile in/out flags.
+ * (ks) Check taskfile in flags.
* If set, then execute as it is defined.
* If not set, then define default settings.
* The default values are:
- * write and read all taskfile registers (except data)
- * write and read the hob registers (sector,nsector,lcyl,hcyl)
+ * read all taskfile registers (except data)
+ * read the hob registers (sector, nsector, lcyl, hcyl)
*/
- if (task->tf_out_flags.all == 0) {
- task->tf_out_flags.all = IDE_TASKFILE_STD_OUT_FLAGS;
- if (drive->addressing == 1)
- task->tf_out_flags.all |= (IDE_HOB_STD_OUT_FLAGS << 8);
- }
-
if (task->tf_in_flags.all == 0) {
task->tf_in_flags.all = IDE_TASKFILE_STD_IN_FLAGS;
if (drive->addressing == 1)
@@ -803,16 +792,6 @@ ide_startstop_t flagged_taskfile (ide_dr
hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
SELECT_MASK(drive, 0);
-#if DEBUG_TASKFILE
- status = hwif->INB(IDE_STATUS_REG);
- if (status & 0x80) {
- printk("flagged_taskfile -> Bad status. Status = %02x. wait 100 usec ...\n", status);
- udelay(100);
- status = hwif->INB(IDE_STATUS_REG);
- printk("flagged_taskfile -> Status = %02x\n", status);
- }
-#endif
-
if (task->tf_out_flags.b.data) {
u16 data = taskfile->data + (hobfile->data << 8);
hwif->OUTW(data, IDE_DATA_REG);
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -87,6 +87,7 @@ static const struct {
u8 chipset_family;
u8 flags;
} SiSHostChipInfo[] = {
+ { "SiS965", PCI_DEVICE_ID_SI_965, ATA_133 },
{ "SiS745", PCI_DEVICE_ID_SI_745, ATA_100 },
{ "SiS735", PCI_DEVICE_ID_SI_735, ATA_100 },
{ "SiS733", PCI_DEVICE_ID_SI_733, ATA_100 },
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -79,6 +79,7 @@ static struct via_isa_bridge {
u8 rev_max;
u16 flags;
} via_isa_bridges[] = {
+ { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
@@ -467,24 +468,35 @@ static void __devinit init_hwif_via82cxx
hwif->drives[1].autodma = hwif->autodma;
}
-static ide_pci_device_t via82cxxx_chipset __devinitdata = {
- .name = "VP_IDE",
- .init_chipset = init_chipset_via82cxxx,
- .init_hwif = init_hwif_via82cxxx,
- .channels = 2,
- .autodma = NOAUTODMA,
- .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
- .bootable = ON_BOARD,
+static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
+ { /* 0 */
+ .name = "VP_IDE",
+ .init_chipset = init_chipset_via82cxxx,
+ .init_hwif = init_hwif_via82cxxx,
+ .channels = 2,
+ .autodma = NOAUTODMA,
+ .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
+ .bootable = ON_BOARD
+ },{ /* 1 */
+ .name = "VP_IDE",
+ .init_chipset = init_chipset_via82cxxx,
+ .init_hwif = init_hwif_via82cxxx,
+ .channels = 2,
+ .autodma = AUTODMA,
+ .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
+ .bootable = ON_BOARD,
+ }
};
static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
- return ide_setup_pci_device(dev, &via82cxxx_chipset);
+ return ide_setup_pci_device(dev, &via82cxxx_chipsets[id->driver_data]);
}
static struct pci_device_id via_pci_tbl[] = {
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+ { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_6410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ 0, },
};
MODULE_DEVICE_TABLE(pci, via_pci_tbl);
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h
--- a/include/linux/hdreg.h
+++ b/include/linux/hdreg.h
@@ -80,10 +80,12 @@
/*
* Define standard taskfile in/out register
*/
-#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
#define IDE_TASKFILE_STD_IN_FLAGS 0xFE
-#define IDE_HOB_STD_OUT_FLAGS 0x3C
#define IDE_HOB_STD_IN_FLAGS 0x3C
+#ifndef __KERNEL__
+#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
+#define IDE_HOB_STD_OUT_FLAGS 0x3C
+#endif
typedef unsigned char task_ioreg_t;
typedef unsigned long sata_ioreg_t;
diff --git a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1201,37 +1201,11 @@ extern u64 ide_get_error_location(ide_dr
*/
typedef enum {
ide_wait, /* insert rq at end of list, and wait for it */
- ide_next, /* insert rq immediately after current request */
ide_preempt, /* insert rq in front of current request */
ide_head_wait, /* insert rq in front of current request and wait for it */
ide_end /* insert rq at end of list, but don't wait for it */
} ide_action_t;
-/*
- * This function issues a special IDE device request
- * onto the request queue.
- *
- * If action is ide_wait, then the rq is queued at the end of the
- * request queue, and the function sleeps until it has been processed.
- * This is for use when invoked from an ioctl handler.
- *
- * If action is ide_preempt, then the rq is queued at the head of
- * the request queue, displacing the currently-being-processed
- * request and this function returns immediately without waiting
- * for the new rq to be completed. This is VERY DANGEROUS, and is
- * intended for careful use by the ATAPI tape/cdrom driver code.
- *
- * If action is ide_next, then the rq is queued immediately after
- * the currently-being-processed-request (if any), and the function
- * returns without waiting for the new rq to be completed. As above,
- * This is VERY DANGEROUS, and is intended for careful use by the
- * ATAPI tape/cdrom driver code.
- *
- * If action is ide_end, then the rq is queued at the end of the
- * request queue, and the function returns immediately without waiting
- * for the new rq to be completed. This is again intended for careful
- * use by the ATAPI tape/cdrom driver code.
- */
extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t);
/*
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -620,6 +620,7 @@
#define PCI_DEVICE_ID_SI_961 0x0961
#define PCI_DEVICE_ID_SI_962 0x0962
#define PCI_DEVICE_ID_SI_963 0x0963
+#define PCI_DEVICE_ID_SI_965 0x0965
#define PCI_DEVICE_ID_SI_5511 0x5511
#define PCI_DEVICE_ID_SI_5513 0x5513
#define PCI_DEVICE_ID_SI_5518 0x5518
@@ -1234,6 +1235,7 @@
#define PCI_DEVICE_ID_VIA_8703_51_0 0x3148
#define PCI_DEVICE_ID_VIA_8237_SATA 0x3149
#define PCI_DEVICE_ID_VIA_XN266 0x3156
+#define PCI_DEVICE_ID_VIA_6410 0x3164
#define PCI_DEVICE_ID_VIA_8754C_0 0x3168
#define PCI_DEVICE_ID_VIA_8235 0x3177
#define PCI_DEVICE_ID_VIA_8385_0 0x3188
^ permalink raw reply [flat|nested] 67+ messages in thread* [git patches] ide update
@ 2005-11-18 23:21 Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 67+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-11-18 23:21 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-ide, linux-kernel
Hi,
Some fixes, few obvious cleanups
and slight rework of via82cxxx driver.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/
to obtain following changes:
Alexey Dobriyan:
alim15x3: use KERN_WARNING
Amit Gud:
cs5520: fix return value of cs5520_init_one()
Daniel Drake:
via82cxxx IDE: remove /proc/via entry
via82cxxx IDE: support multiple controllers
Hanna Linder:
alim15x3: replace pci_find_device() with pci_dev_present()
James Bottomley:
ide: fix ide_toggle_bounce() to not try to bounce if we have an IOMMU
Jeff Garzik:
siimage: docs urls
Laurent Riffard:
ide: remove ide_driver_t.owner field
Ralf Baechle:
ide: make comment match reality
Thibaut VARENE:
pmac IDE: don't release empty interfaces
aec62xxx: remove all dead (#if0'd) code
drivers/ide/ide-cd.c | 2
drivers/ide/ide-disk.c | 2
drivers/ide/ide-floppy.c | 2
drivers/ide/ide-lib.c | 8
drivers/ide/ide-tape.c | 2
drivers/ide/pci/aec62xx.c | 47 -----
drivers/ide/pci/alim15x3.c | 9 -
drivers/ide/pci/cs5520.c | 5
drivers/ide/pci/siimage.c | 8
drivers/ide/pci/via82cxxx.c | 377 +++++++++++++-------------------------------
drivers/ide/ppc/pmac.c | 14 -
drivers/ide/setup-pci.c | 2
drivers/scsi/ide-scsi.c | 2
include/linux/ide.h | 4
14 files changed, 143 insertions(+), 341 deletions(-)
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -3328,8 +3328,8 @@ static ide_proc_entry_t idecd_proc[] = {
#endif
static ide_driver_t ide_cdrom_driver = {
- .owner = THIS_MODULE,
.gen_driver = {
+ .owner = THIS_MODULE,
.name = "ide-cdrom",
.bus = &ide_bus_type,
.probe = ide_cd_probe,
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -1089,8 +1089,8 @@ static void ide_device_shutdown(struct d
}
static ide_driver_t idedisk_driver = {
- .owner = THIS_MODULE,
.gen_driver = {
+ .owner = THIS_MODULE,
.name = "ide-disk",
.bus = &ide_bus_type,
.probe = ide_disk_probe,
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -1925,8 +1925,8 @@ static ide_proc_entry_t idefloppy_proc[]
static int ide_floppy_probe(struct device *);
static ide_driver_t idefloppy_driver = {
- .owner = THIS_MODULE,
.gen_driver = {
+ .owner = THIS_MODULE,
.name = "ide-floppy",
.bus = &ide_bus_type,
.probe = ide_floppy_probe,
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -410,10 +410,10 @@ void ide_toggle_bounce(ide_drive_t *driv
{
u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */
- if (on && drive->media == ide_disk) {
- if (!PCI_DMA_BUS_IS_PHYS)
- addr = BLK_BOUNCE_ANY;
- else if (HWIF(drive)->pci_dev)
+ if (!PCI_DMA_BUS_IS_PHYS) {
+ addr = BLK_BOUNCE_ANY;
+ } else if (on && drive->media == ide_disk) {
+ if (HWIF(drive)->pci_dev)
addr = HWIF(drive)->pci_dev->dma_mask;
}
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -4748,8 +4748,8 @@ static ide_proc_entry_t idetape_proc[] =
static int ide_tape_probe(struct device *);
static ide_driver_t idetape_driver = {
- .owner = THIS_MODULE,
.gen_driver = {
+ .owner = THIS_MODULE,
.name = "ide-tape",
.bus = &ide_bus_type,
.probe = ide_tape_probe,
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -65,23 +65,6 @@ static struct chipset_bus_clock_list_ent
#define BUSCLOCK(D) \
((struct chipset_bus_clock_list_entry *) pci_get_drvdata((D)))
-#if 0
- if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) {
- (void) pci_read_config_byte(dev, 0x54, &art);
- p += sprintf(p, "DMA Mode: %s(%s)",
- (c0&0x20)?((art&0x03)?"UDMA":" DMA"):" PIO",
- (art&0x02)?"2":(art&0x01)?"1":"0");
- p += sprintf(p, " %s(%s)",
- (c0&0x40)?((art&0x0c)?"UDMA":" DMA"):" PIO",
- (art&0x08)?"2":(art&0x04)?"1":"0");
- p += sprintf(p, " %s(%s)",
- (c1&0x20)?((art&0x30)?"UDMA":" DMA"):" PIO",
- (art&0x20)?"2":(art&0x10)?"1":"0");
- p += sprintf(p, " %s(%s)\n",
- (c1&0x40)?((art&0xc0)?"UDMA":" DMA"):" PIO",
- (art&0x80)?"2":(art&0x40)?"1":"0");
- } else {
-#endif
/*
* TO DO: active tuning and correction of cards without a bios.
@@ -112,13 +95,9 @@ static u8 aec62xx_ratemask (ide_drive_t
switch(hwif->pci_dev->device) {
case PCI_DEVICE_ID_ARTOP_ATP865:
case PCI_DEVICE_ID_ARTOP_ATP865R:
-#if 0
- mode = (hwif->INB(hwif->dma_master) & 0x10) ? 4 : 3;
-#else
mode = (hwif->INB(((hwif->channel) ?
hwif->mate->dma_status :
hwif->dma_status)) & 0x10) ? 4 : 3;
-#endif
break;
case PCI_DEVICE_ID_ARTOP_ATP860:
case PCI_DEVICE_ID_ARTOP_ATP860R:
@@ -263,35 +242,9 @@ static int aec62xx_irq_timeout (ide_driv
case PCI_DEVICE_ID_ARTOP_ATP865:
case PCI_DEVICE_ID_ARTOP_ATP865R:
printk(" AEC62XX time out ");
-#if 0
- {
- int i = 0;
- u8 reg49h = 0;
- pci_read_config_byte(HWIF(drive)->pci_dev, 0x49, ®49h);
- for (i=0;i<256;i++)
- pci_write_config_byte(HWIF(drive)->pci_dev, 0x49, reg49h|0x10);
- pci_write_config_byte(HWIF(drive)->pci_dev, 0x49, reg49h & ~0x10);
- }
- return 0;
-#endif
default:
break;
}
-#if 0
- {
- ide_hwif_t *hwif = HWIF(drive);
- struct pci_dev *dev = hwif->pci_dev;
- u8 tmp1 = 0, tmp2 = 0, mode6 = 0;
-
- pci_read_config_byte(dev, 0x44, &tmp1);
- pci_read_config_byte(dev, 0x45, &tmp2);
- printk(" AEC6280 r44=%x r45=%x ",tmp1,tmp2);
- mode6 = HWIF(drive)->INB(((hwif->channel) ?
- hwif->mate->dma_status :
- hwif->dma_status));
- printk(" AEC6280 133=%x ", (mode6 & 0x10));
- }
-#endif
return 0;
}
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -876,10 +876,15 @@ static ide_pci_device_t ali15x3_chipset
static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
+ static struct pci_device_id ati_rs100[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS100) },
+ { },
+ };
+
ide_pci_device_t *d = &ali15x3_chipset;
- if(pci_find_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS100, NULL))
- printk(KERN_ERR "Warning: ATI Radeon IGP Northbridge is not yet fully tested.\n");
+ if (pci_dev_present(ati_rs100))
+ printk(KERN_WARNING "alim15x3: ATI Radeon IGP Northbridge is not yet fully tested.\n");
#if defined(CONFIG_SPARC64)
d->init_hwif = init_hwif_common_ali15x3;
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -222,10 +222,9 @@ static int __devinit cs5520_init_one(str
/* We must not grab the entire device, it has 'ISA' space in its
BARS too and we will freak out other bits of the kernel */
- if(pci_enable_device_bars(dev, 1<<2))
- {
+ if (pci_enable_device_bars(dev, 1<<2)) {
printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name);
- return 1;
+ return -ENODEV;
}
pci_set_master(dev);
if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) {
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -6,7 +6,13 @@
*
* May be copied or modified under the terms of the GNU General Public License
*
- * Documentation available under NDA only
+ * Documentation for CMD680:
+ * http://gkernel.sourceforge.net/specs/sii/sii-0680a-v1.31.pdf.bz2
+ *
+ * Documentation for SiI 3112:
+ * http://gkernel.sourceforge.net/specs/sii/3112A_SiI-DS-0095-B2.pdf.bz2
+ *
+ * Errata and other documentation only available under NDA.
*
*
* FAQ Items:
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -100,185 +100,14 @@ static struct via_isa_bridge {
{ NULL }
};
-static struct via_isa_bridge *via_config;
-static unsigned int via_80w;
static unsigned int via_clock;
static char *via_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" };
-/*
- * VIA /proc entry.
- */
-
-#if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS)
-
-#include <linux/stat.h>
-#include <linux/proc_fs.h>
-
-static u8 via_proc = 0;
-static unsigned long via_base;
-static struct pci_dev *bmide_dev, *isa_dev;
-
-static char *via_control3[] = { "No limit", "64", "128", "192" };
-
-#define via_print(format, arg...) p += sprintf(p, format "\n" , ## arg)
-#define via_print_drive(name, format, arg...)\
- p += sprintf(p, name); for (i = 0; i < 4; i++) p += sprintf(p, format, ## arg); p += sprintf(p, "\n");
-
-
-/**
- * via_get_info - generate via /proc file
- * @buffer: buffer for data
- * @addr: set to start of data to use
- * @offset: current file offset
- * @count: size of read
- *
- * Fills in buffer with the debugging/configuration information for
- * the VIA chipset tuning and attached drives
- */
-
-static int via_get_info(char *buffer, char **addr, off_t offset, int count)
+struct via82cxxx_dev
{
- int speed[4], cycle[4], setup[4], active[4], recover[4], den[4],
- uen[4], udma[4], umul[4], active8b[4], recover8b[4];
- struct pci_dev *dev = bmide_dev;
- unsigned int v, u, i;
- int len;
- u16 c, w;
- u8 t, x;
- char *p = buffer;
-
- via_print("----------VIA BusMastering IDE Configuration"
- "----------------");
-
- via_print("Driver Version: 3.38");
- via_print("South Bridge: VIA %s",
- via_config->name);
-
- pci_read_config_byte(isa_dev, PCI_REVISION_ID, &t);
- pci_read_config_byte(dev, PCI_REVISION_ID, &x);
- via_print("Revision: ISA %#x IDE %#x", t, x);
- via_print("Highest DMA rate: %s",
- via_dma[via_config->flags & VIA_UDMA]);
-
- via_print("BM-DMA base: %#lx", via_base);
- via_print("PCI clock: %d.%dMHz",
- via_clock / 1000, via_clock / 100 % 10);
-
- pci_read_config_byte(dev, VIA_MISC_1, &t);
- via_print("Master Read Cycle IRDY: %dws",
- (t & 64) >> 6);
- via_print("Master Write Cycle IRDY: %dws",
- (t & 32) >> 5);
- via_print("BM IDE Status Register Read Retry: %s",
- (t & 8) ? "yes" : "no");
-
- pci_read_config_byte(dev, VIA_MISC_3, &t);
- via_print("Max DRDY Pulse Width: %s%s",
- via_control3[(t & 0x03)], (t & 0x03) ? " PCI clocks" : "");
-
- via_print("-----------------------Primary IDE"
- "-------Secondary IDE------");
- via_print("Read DMA FIFO flush: %10s%20s",
- (t & 0x80) ? "yes" : "no", (t & 0x40) ? "yes" : "no");
- via_print("End Sector FIFO flush: %10s%20s",
- (t & 0x20) ? "yes" : "no", (t & 0x10) ? "yes" : "no");
-
- pci_read_config_byte(dev, VIA_IDE_CONFIG, &t);
- via_print("Prefetch Buffer: %10s%20s",
- (t & 0x80) ? "yes" : "no", (t & 0x20) ? "yes" : "no");
- via_print("Post Write Buffer: %10s%20s",
- (t & 0x40) ? "yes" : "no", (t & 0x10) ? "yes" : "no");
-
- pci_read_config_byte(dev, VIA_IDE_ENABLE, &t);
- via_print("Enabled: %10s%20s",
- (t & 0x02) ? "yes" : "no", (t & 0x01) ? "yes" : "no");
-
- c = inb(via_base + 0x02) | (inb(via_base + 0x0a) << 8);
- via_print("Simplex only: %10s%20s",
- (c & 0x80) ? "yes" : "no", (c & 0x8000) ? "yes" : "no");
-
- via_print("Cable Type: %10s%20s",
- (via_80w & 1) ? "80w" : "40w", (via_80w & 2) ? "80w" : "40w");
-
- via_print("-------------------drive0----drive1"
- "----drive2----drive3-----");
-
- pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t);
- pci_read_config_dword(dev, VIA_DRIVE_TIMING, &v);
- pci_read_config_word(dev, VIA_8BIT_TIMING, &w);
-
- if (via_config->flags & VIA_UDMA)
- pci_read_config_dword(dev, VIA_UDMA_TIMING, &u);
- else u = 0;
-
- for (i = 0; i < 4; i++) {
-
- setup[i] = ((t >> ((3 - i) << 1)) & 0x3) + 1;
- recover8b[i] = ((w >> ((1 - (i >> 1)) << 3)) & 0xf) + 1;
- active8b[i] = ((w >> (((1 - (i >> 1)) << 3) + 4)) & 0xf) + 1;
- active[i] = ((v >> (((3 - i) << 3) + 4)) & 0xf) + 1;
- recover[i] = ((v >> ((3 - i) << 3)) & 0xf) + 1;
- udma[i] = ((u >> ((3 - i) << 3)) & 0x7) + 2;
- umul[i] = ((u >> (((3 - i) & 2) << 3)) & 0x8) ? 1 : 2;
- uen[i] = ((u >> ((3 - i) << 3)) & 0x20);
- den[i] = (c & ((i & 1) ? 0x40 : 0x20) << ((i & 2) << 2));
-
- speed[i] = 2 * via_clock / (active[i] + recover[i]);
- cycle[i] = 1000000 * (active[i] + recover[i]) / via_clock;
-
- if (!uen[i] || !den[i])
- continue;
-
- switch (via_config->flags & VIA_UDMA) {
-
- case VIA_UDMA_33:
- speed[i] = 2 * via_clock / udma[i];
- cycle[i] = 1000000 * udma[i] / via_clock;
- break;
-
- case VIA_UDMA_66:
- speed[i] = 4 * via_clock / (udma[i] * umul[i]);
- cycle[i] = 500000 * (udma[i] * umul[i]) / via_clock;
- break;
-
- case VIA_UDMA_100:
- speed[i] = 6 * via_clock / udma[i];
- cycle[i] = 333333 * udma[i] / via_clock;
- break;
-
- case VIA_UDMA_133:
- speed[i] = 8 * via_clock / udma[i];
- cycle[i] = 250000 * udma[i] / via_clock;
- break;
- }
- }
-
- via_print_drive("Transfer Mode: ", "%10s",
- den[i] ? (uen[i] ? "UDMA" : "DMA") : "PIO");
-
- via_print_drive("Address Setup: ", "%8dns",
- 1000000 * setup[i] / via_clock);
- via_print_drive("Cmd Active: ", "%8dns",
- 1000000 * active8b[i] / via_clock);
- via_print_drive("Cmd Recovery: ", "%8dns",
- 1000000 * recover8b[i] / via_clock);
- via_print_drive("Data Active: ", "%8dns",
- 1000000 * active[i] / via_clock);
- via_print_drive("Data Recovery: ", "%8dns",
- 1000000 * recover[i] / via_clock);
- via_print_drive("Cycle Time: ", "%8dns",
- cycle[i]);
- via_print_drive("Transfer Rate: ", "%4d.%dMB/s",
- speed[i] / 1000, speed[i] / 100 % 10);
-
- /* hoping it is less than 4K... */
- len = (p - buffer) - offset;
- *addr = buffer + offset;
-
- return len > count ? count : len;
-}
-
-#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */
+ struct via_isa_bridge *via_config;
+ unsigned int via_80w;
+};
/**
* via_set_speed - write timing registers
@@ -289,11 +118,13 @@ static int via_get_info(char *buffer, ch
* via_set_speed writes timing values to the chipset registers
*/
-static void via_set_speed(struct pci_dev *dev, u8 dn, struct ide_timing *timing)
+static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing)
{
+ struct pci_dev *dev = hwif->pci_dev;
+ struct via82cxxx_dev *vdev = ide_get_hwifdata(hwif);
u8 t;
- if (~via_config->flags & VIA_BAD_AST) {
+ if (~vdev->via_config->flags & VIA_BAD_AST) {
pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t);
t = (t & ~(3 << ((3 - dn) << 1))) | ((FIT(timing->setup, 1, 4) - 1) << ((3 - dn) << 1));
pci_write_config_byte(dev, VIA_ADDRESS_SETUP, t);
@@ -305,7 +136,7 @@ static void via_set_speed(struct pci_dev
pci_write_config_byte(dev, VIA_DRIVE_TIMING + (3 - dn),
((FIT(timing->active, 1, 16) - 1) << 4) | (FIT(timing->recover, 1, 16) - 1));
- switch (via_config->flags & VIA_UDMA) {
+ switch (vdev->via_config->flags & VIA_UDMA) {
case VIA_UDMA_33: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break;
case VIA_UDMA_66: t = timing->udma ? (0xe8 | (FIT(timing->udma, 2, 9) - 2)) : 0x0f; break;
case VIA_UDMA_100: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break;
@@ -329,6 +160,7 @@ static void via_set_speed(struct pci_dev
static int via_set_drive(ide_drive_t *drive, u8 speed)
{
ide_drive_t *peer = HWIF(drive)->drives + (~drive->dn & 1);
+ struct via82cxxx_dev *vdev = ide_get_hwifdata(drive->hwif);
struct ide_timing t, p;
unsigned int T, UT;
@@ -337,7 +169,7 @@ static int via_set_drive(ide_drive_t *dr
T = 1000000000 / via_clock;
- switch (via_config->flags & VIA_UDMA) {
+ switch (vdev->via_config->flags & VIA_UDMA) {
case VIA_UDMA_33: UT = T; break;
case VIA_UDMA_66: UT = T/2; break;
case VIA_UDMA_100: UT = T/3; break;
@@ -352,7 +184,7 @@ static int via_set_drive(ide_drive_t *dr
ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT);
}
- via_set_speed(HWIF(drive)->pci_dev, drive->dn, &t);
+ via_set_speed(HWIF(drive), drive->dn, &t);
if (!drive->init_speed)
drive->init_speed = speed;
@@ -390,20 +222,41 @@ static void via82cxxx_tune_drive(ide_dri
static int via82cxxx_ide_dma_check (ide_drive_t *drive)
{
- u16 w80 = HWIF(drive)->udma_four;
+ ide_hwif_t *hwif = HWIF(drive);
+ struct via82cxxx_dev *vdev = ide_get_hwifdata(hwif);
+ u16 w80 = hwif->udma_four;
u16 speed = ide_find_best_mode(drive,
XFER_PIO | XFER_EPIO | XFER_SWDMA | XFER_MWDMA |
- (via_config->flags & VIA_UDMA ? XFER_UDMA : 0) |
- (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_66 ? XFER_UDMA_66 : 0) |
- (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_100 ? XFER_UDMA_100 : 0) |
- (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_133 ? XFER_UDMA_133 : 0));
+ (vdev->via_config->flags & VIA_UDMA ? XFER_UDMA : 0) |
+ (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_66 ? XFER_UDMA_66 : 0) |
+ (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_100 ? XFER_UDMA_100 : 0) |
+ (w80 && (vdev->via_config->flags & VIA_UDMA) >= VIA_UDMA_133 ? XFER_UDMA_133 : 0));
via_set_drive(drive, speed);
if (drive->autodma && (speed & XFER_MODE) != XFER_PIO)
- return HWIF(drive)->ide_dma_on(drive);
- return HWIF(drive)->ide_dma_off_quietly(drive);
+ return hwif->ide_dma_on(drive);
+ return hwif->ide_dma_off_quietly(drive);
+}
+
+static struct via_isa_bridge *via_config_find(struct pci_dev **isa)
+{
+ struct via_isa_bridge *via_config;
+ u8 t;
+
+ for (via_config = via_isa_bridges; via_config->id; via_config++)
+ if ((*isa = pci_find_device(PCI_VENDOR_ID_VIA +
+ !!(via_config->flags & VIA_BAD_ID),
+ via_config->id, NULL))) {
+
+ pci_read_config_byte(*isa, PCI_REVISION_ID, &t);
+ if (t >= via_config->rev_min &&
+ t <= via_config->rev_max)
+ break;
+ }
+
+ return via_config;
}
/**
@@ -418,82 +271,28 @@ static int via82cxxx_ide_dma_check (ide_
static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const char *name)
{
struct pci_dev *isa = NULL;
+ struct via_isa_bridge *via_config;
u8 t, v;
unsigned int u;
- int i;
/*
* Find the ISA bridge to see how good the IDE is.
*/
-
- for (via_config = via_isa_bridges; via_config->id; via_config++)
- if ((isa = pci_find_device(PCI_VENDOR_ID_VIA +
- !!(via_config->flags & VIA_BAD_ID),
- via_config->id, NULL))) {
-
- pci_read_config_byte(isa, PCI_REVISION_ID, &t);
- if (t >= via_config->rev_min &&
- t <= via_config->rev_max)
- break;
- }
-
+ via_config = via_config_find(&isa);
if (!via_config->id) {
printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n");
return -ENODEV;
}
/*
- * Check 80-wire cable presence and setup Clk66.
+ * Setup or disable Clk66 if appropriate
*/
- switch (via_config->flags & VIA_UDMA) {
-
- case VIA_UDMA_66:
- /* Enable Clk66 */
- pci_read_config_dword(dev, VIA_UDMA_TIMING, &u);
- pci_write_config_dword(dev, VIA_UDMA_TIMING, u|0x80008);
- for (i = 24; i >= 0; i -= 8)
- if (((u >> (i & 16)) & 8) &&
- ((u >> i) & 0x20) &&
- (((u >> i) & 7) < 2)) {
- /*
- * 2x PCI clock and
- * UDMA w/ < 3T/cycle
- */
- via_80w |= (1 << (1 - (i >> 4)));
- }
- break;
-
- case VIA_UDMA_100:
- pci_read_config_dword(dev, VIA_UDMA_TIMING, &u);
- for (i = 24; i >= 0; i -= 8)
- if (((u >> i) & 0x10) ||
- (((u >> i) & 0x20) &&
- (((u >> i) & 7) < 4))) {
- /* BIOS 80-wire bit or
- * UDMA w/ < 60ns/cycle
- */
- via_80w |= (1 << (1 - (i >> 4)));
- }
- break;
-
- case VIA_UDMA_133:
- pci_read_config_dword(dev, VIA_UDMA_TIMING, &u);
- for (i = 24; i >= 0; i -= 8)
- if (((u >> i) & 0x10) ||
- (((u >> i) & 0x20) &&
- (((u >> i) & 7) < 6))) {
- /* BIOS 80-wire bit or
- * UDMA w/ < 60ns/cycle
- */
- via_80w |= (1 << (1 - (i >> 4)));
- }
- break;
-
- }
-
- /* Disable Clk66 */
- if (via_config->flags & VIA_BAD_CLK66) {
+ if ((via_config->flags & VIA_UDMA) == VIA_UDMA_66) {
+ /* Enable Clk66 */
+ pci_read_config_dword(dev, VIA_UDMA_TIMING, &u);
+ pci_write_config_dword(dev, VIA_UDMA_TIMING, u|0x80008);
+ } else if (via_config->flags & VIA_BAD_CLK66) {
/* Would cause trouble on 596a and 686 */
pci_read_config_dword(dev, VIA_UDMA_TIMING, &u);
pci_write_config_dword(dev, VIA_UDMA_TIMING, u & ~0x80008);
@@ -560,26 +359,78 @@ static unsigned int __devinit init_chips
via_dma[via_config->flags & VIA_UDMA],
pci_name(dev));
- /*
- * Setup /proc/ide/via entry.
- */
+ return 0;
+}
+
+/*
+ * Check and handle 80-wire cable presence
+ */
+static void __devinit via_cable_detect(struct pci_dev *dev, struct via82cxxx_dev *vdev)
+{
+ unsigned int u;
+ int i;
+ pci_read_config_dword(dev, VIA_UDMA_TIMING, &u);
+
+ switch (vdev->via_config->flags & VIA_UDMA) {
+
+ case VIA_UDMA_66:
+ for (i = 24; i >= 0; i -= 8)
+ if (((u >> (i & 16)) & 8) &&
+ ((u >> i) & 0x20) &&
+ (((u >> i) & 7) < 2)) {
+ /*
+ * 2x PCI clock and
+ * UDMA w/ < 3T/cycle
+ */
+ vdev->via_80w |= (1 << (1 - (i >> 4)));
+ }
+ break;
+
+ case VIA_UDMA_100:
+ for (i = 24; i >= 0; i -= 8)
+ if (((u >> i) & 0x10) ||
+ (((u >> i) & 0x20) &&
+ (((u >> i) & 7) < 4))) {
+ /* BIOS 80-wire bit or
+ * UDMA w/ < 60ns/cycle
+ */
+ vdev->via_80w |= (1 << (1 - (i >> 4)));
+ }
+ break;
+
+ case VIA_UDMA_133:
+ for (i = 24; i >= 0; i -= 8)
+ if (((u >> i) & 0x10) ||
+ (((u >> i) & 0x20) &&
+ (((u >> i) & 7) < 6))) {
+ /* BIOS 80-wire bit or
+ * UDMA w/ < 60ns/cycle
+ */
+ vdev->via_80w |= (1 << (1 - (i >> 4)));
+ }
+ break;
-#if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS)
- if (!via_proc) {
- via_base = pci_resource_start(dev, 4);
- bmide_dev = dev;
- isa_dev = isa;
- ide_pci_create_host_proc("via", via_get_info);
- via_proc = 1;
}
-#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */
- return 0;
}
static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
{
+ struct via82cxxx_dev *vdev = kmalloc(sizeof(struct via82cxxx_dev),
+ GFP_KERNEL);
+ struct pci_dev *isa = NULL;
int i;
+ if (vdev == NULL) {
+ printk(KERN_ERR "VP_IDE: out of memory :(\n");
+ return;
+ }
+
+ memset(vdev, 0, sizeof(struct via82cxxx_dev));
+ ide_set_hwifdata(hwif, vdev);
+
+ vdev->via_config = via_config_find(&isa);
+ via_cable_detect(hwif->pci_dev, vdev);
+
hwif->autodma = 0;
hwif->tuneproc = &via82cxxx_tune_drive;
@@ -594,7 +445,7 @@ static void __devinit init_hwif_via82cxx
for (i = 0; i < 2; i++) {
hwif->drives[i].io_32bit = 1;
- hwif->drives[i].unmask = (via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
+ hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
hwif->drives[i].autotune = 1;
hwif->drives[i].dn = hwif->channel * 2 + i;
}
@@ -608,7 +459,7 @@ static void __devinit init_hwif_via82cxx
hwif->swdma_mask = 0x07;
if (!hwif->udma_four)
- hwif->udma_four = (via_80w >> hwif->channel) & 1;
+ hwif->udma_four = (vdev->via_80w >> hwif->channel) & 1;
hwif->ide_dma_check = &via82cxxx_ide_dma_check;
if (!noautodma)
hwif->autodma = 1;
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1401,20 +1401,6 @@ pmac_ide_setup_device(pmac_ide_hwif_t *p
/* We probe the hwif now */
probe_hwif_init(hwif);
- /* The code IDE code will have set hwif->present if we have devices attached,
- * if we don't, the discard the interface except if we are on a media bay slot
- */
- if (!hwif->present && !pmif->mediabay) {
- printk(KERN_INFO "ide%d: Bus empty, interface released.\n",
- hwif->index);
- default_hwif_iops(hwif);
- for (i = IDE_DATA_OFFSET; i <= IDE_CONTROL_OFFSET; ++i)
- hwif->io_ports[i] = 0;
- hwif->chipset = ide_unknown;
- hwif->noprobe = 1;
- return -ENODEV;
- }
-
return 0;
}
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -787,7 +787,7 @@ static int pre_init = 1; /* Before firs
static LIST_HEAD(ide_pci_drivers);
/*
- * __ide_register_pci_driver - attach IDE driver
+ * __ide_pci_register_driver - attach IDE driver
* @driver: pci driver
* @module: owner module of the driver
*
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -784,8 +784,8 @@ static ide_proc_entry_t idescsi_proc[] =
#endif
static ide_driver_t idescsi_driver = {
- .owner = THIS_MODULE,
.gen_driver = {
+ .owner = THIS_MODULE,
.name = "ide-scsi",
.bus = &ide_bus_type,
.probe = ide_scsi_probe,
diff --git a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1089,9 +1089,11 @@ enum {
/*
* Subdrivers support.
+ *
+ * The gendriver.owner field should be set to the module owner of this driver.
+ * The gendriver.name field should be set to the name of this driver
*/
typedef struct ide_driver_s {
- struct module *owner;
const char *version;
u8 media;
unsigned supports_dsc_overlap : 1;
^ permalink raw reply [flat|nested] 67+ messages in thread* [git patches] ide update
@ 2005-11-10 1:00 Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 67+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-11-10 1:00 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-ide, linux-kernel
Hi,
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/
to obtain following changes:
drivers/ide/Kconfig | 9 +
drivers/ide/ide-floppy.c | 6
drivers/ide/ide-iops.c | 6
drivers/ide/ide-taskfile.c | 2
drivers/ide/ide.c | 1
drivers/ide/legacy/ide-cs.c | 7 -
drivers/ide/pci/Makefile | 1
drivers/ide/pci/amd74xx.c | 3
drivers/ide/pci/cs5535.c | 305 ++++++++++++++++++++++++++++++++++++++++++++
drivers/ide/pci/cy82c693.c | 2
drivers/ide/pci/siimage.c | 9 +
drivers/scsi/ide-scsi.c | 5
include/asm-alpha/ide.h | 4
include/asm-i386/ide.h | 6
include/asm-sh/ide.h | 4
include/asm-sh64/ide.h | 4
include/linux/ide.h | 5
include/linux/pci_ids.h | 3
18 files changed, 352 insertions(+), 30 deletions(-)
Adrian Bunk:
ide: possible cleanups
Alan Cox:
ide: explain the PCI bus test we do in <asm-i386/ide.h>
Bjorn Helgaas:
ide: move CONFIG_IDE_MAX_HWIFS into linux/ide.h
Hannes Reinecke:
ide: incorrect device link for ide-cs
Jaya Kumar:
ide: CS5535 driver
John W. Linville:
siimage: enable interrupts on Adaptec SA-1210 card
Jordan Crouse:
ide: AMD Geode GX/LX support
Ondrej Zary:
ide-floppy: software eject not working with LS-120 drive
Willem Riede:
ide: ide-scsi fails to call idescsi_check_condition for things like "Medium not present"
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -539,6 +539,15 @@ config BLK_DEV_CS5530
It is safe to say Y to this question.
+config BLK_DEV_CS5535
+ tristate "AMD CS5535 chipset support"
+ depends on X86 && !X86_64
+ help
+ Include support for UDMA on the NSC/AMD CS5535 companion chipset.
+ This will automatically be detected and configured if found.
+
+ It is safe to say Y to this question.
+
config BLK_DEV_HPT34X
tristate "HPT34X chipset support"
help
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -2038,11 +2038,9 @@ static int idefloppy_ioctl(struct inode
struct ide_floppy_obj *floppy = ide_floppy_g(bdev->bd_disk);
ide_drive_t *drive = floppy->drive;
void __user *argp = (void __user *)arg;
- int err = generic_ide_ioctl(drive, file, bdev, cmd, arg);
+ int err;
int prevent = (arg) ? 1 : 0;
idefloppy_pc_t pc;
- if (err != -EINVAL)
- return err;
switch (cmd) {
case CDROMEJECT:
@@ -2094,7 +2092,7 @@ static int idefloppy_ioctl(struct inode
case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
return idefloppy_get_format_progress(drive, argp);
}
- return -EINVAL;
+ return generic_ide_ioctl(drive, file, bdev, cmd, arg);
}
static int idefloppy_media_changed(struct gendisk *disk)
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -104,8 +104,6 @@ void default_hwif_iops (ide_hwif_t *hwif
hwif->INSL = ide_insl;
}
-EXPORT_SYMBOL(default_hwif_iops);
-
/*
* MMIO operations, typically used for SATA controllers
*/
@@ -329,8 +327,6 @@ void default_hwif_transport(ide_hwif_t *
hwif->atapi_output_bytes = atapi_output_bytes;
}
-EXPORT_SYMBOL(default_hwif_transport);
-
/*
* Beginning of Taskfile OPCODE Library and feature sets.
*/
@@ -529,8 +525,6 @@ int wait_for_ready (ide_drive_t *drive,
return 0;
}
-EXPORT_SYMBOL(wait_for_ready);
-
/*
* This routine busy-waits for the drive status to be not "busy".
* It then checks the status for all of the "good" bits and none
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -161,8 +161,6 @@ ide_startstop_t do_rw_taskfile (ide_driv
return ide_stopped;
}
-EXPORT_SYMBOL(do_rw_taskfile);
-
/*
* set_multmode_intr() is invoked on completion of a WIN_SETMULT cmd.
*/
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -803,6 +803,7 @@ found:
hwif->irq = hw->irq;
hwif->noprobe = 0;
hwif->chipset = hw->chipset;
+ hwif->gendev.parent = hw->dev;
if (!initializing) {
probe_hwif_init_with_fixup(hwif, fixup);
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -182,13 +182,14 @@ static void ide_detach(dev_link_t *link)
} /* ide_detach */
-static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq)
+static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
{
hw_regs_t hw;
memset(&hw, 0, sizeof(hw));
ide_init_hwif_ports(&hw, io, ctl, NULL);
hw.irq = irq;
hw.chipset = ide_pci;
+ hw.dev = &handle->dev;
return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
}
@@ -327,12 +328,12 @@ static void ide_config(dev_link_t *link)
/* retry registration in case device is still spinning up */
for (hd = -1, i = 0; i < 10; i++) {
- hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ);
+ hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, handle);
if (hd >= 0) break;
if (link->io.NumPorts1 == 0x20) {
outb(0x02, ctl_base + 0x10);
hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
- link->irq.AssignedIRQ);
+ link->irq.AssignedIRQ, handle);
if (hd >= 0) {
io_base += 0x10;
ctl_base += 0x10;
diff --git a/drivers/ide/pci/Makefile b/drivers/ide/pci/Makefile
--- a/drivers/ide/pci/Makefile
+++ b/drivers/ide/pci/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_BLK_DEV_ATIIXP) += atiixp.
obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o
obj-$(CONFIG_BLK_DEV_CS5520) += cs5520.o
obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o
+obj-$(CONFIG_BLK_DEV_CS5535) += cs5535.o
obj-$(CONFIG_BLK_DEV_SC1200) += sc1200.o
obj-$(CONFIG_BLK_DEV_CY82C693) += cy82c693.o
obj-$(CONFIG_BLK_DEV_HPT34X) += hpt34x.o
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -74,6 +74,7 @@ static struct amd_ide_chip {
{ PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 },
{ PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, 0x50, AMD_UDMA_133 },
{ PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE, 0x50, AMD_UDMA_133 },
+ { PCI_DEVICE_ID_AMD_CS5536_IDE, 0x40, AMD_UDMA_100 },
{ 0 }
};
@@ -491,6 +492,7 @@ static ide_pci_device_t amd74xx_chipsets
/* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"),
/* 15 */ DECLARE_NV_DEV("NFORCE-MCP51"),
/* 16 */ DECLARE_NV_DEV("NFORCE-MCP55"),
+ /* 17 */ DECLARE_AMD_DEV("AMD5536"),
};
static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
@@ -527,6 +529,7 @@ static struct pci_device_id amd74xx_pci_
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16 },
+ { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17 },
{ 0, },
};
MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
new file mode 100644
--- /dev/null
+++ b/drivers/ide/pci/cs5535.c
@@ -0,0 +1,305 @@
+/*
+ * linux/drivers/ide/pci/cs5535.c
+ *
+ * Copyright (C) 2004-2005 Advanced Micro Devices, Inc.
+ *
+ * History:
+ * 09/20/2005 - Jaya Kumar <jayakumar.ide@gmail.com>
+ * - Reworked tuneproc, set_drive, misc mods to prep for mainline
+ * - Work was sponsored by CIS (M) Sdn Bhd.
+ * Ported to Kernel 2.6.11 on June 26, 2005 by
+ * Wolfgang Zuleger <wolfgang.zuleger@gmx.de>
+ * Alexander Kiausch <alex.kiausch@t-online.de>
+ * Originally developed by AMD for 2.4/2.6
+ *
+ * Development of this chipset driver was funded
+ * by the nice folks at National Semiconductor/AMD.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * Documentation:
+ * CS5535 documentation available from AMD
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/ide.h>
+
+#include "ide-timing.h"
+
+#define MSR_ATAC_BASE 0x51300000
+#define ATAC_GLD_MSR_CAP (MSR_ATAC_BASE+0)
+#define ATAC_GLD_MSR_CONFIG (MSR_ATAC_BASE+0x01)
+#define ATAC_GLD_MSR_SMI (MSR_ATAC_BASE+0x02)
+#define ATAC_GLD_MSR_ERROR (MSR_ATAC_BASE+0x03)
+#define ATAC_GLD_MSR_PM (MSR_ATAC_BASE+0x04)
+#define ATAC_GLD_MSR_DIAG (MSR_ATAC_BASE+0x05)
+#define ATAC_IO_BAR (MSR_ATAC_BASE+0x08)
+#define ATAC_RESET (MSR_ATAC_BASE+0x10)
+#define ATAC_CH0D0_PIO (MSR_ATAC_BASE+0x20)
+#define ATAC_CH0D0_DMA (MSR_ATAC_BASE+0x21)
+#define ATAC_CH0D1_PIO (MSR_ATAC_BASE+0x22)
+#define ATAC_CH0D1_DMA (MSR_ATAC_BASE+0x23)
+#define ATAC_PCI_ABRTERR (MSR_ATAC_BASE+0x24)
+#define ATAC_BM0_CMD_PRIM 0x00
+#define ATAC_BM0_STS_PRIM 0x02
+#define ATAC_BM0_PRD 0x04
+#define CS5535_CABLE_DETECT 0x48
+
+/* Format I PIO settings. We seperate out cmd and data for safer timings */
+
+static unsigned int cs5535_pio_cmd_timings[5] =
+{ 0xF7F4, 0x53F3, 0x13F1, 0x5131, 0x1131 };
+static unsigned int cs5535_pio_dta_timings[5] =
+{ 0xF7F4, 0xF173, 0x8141, 0x5131, 0x1131 };
+
+static unsigned int cs5535_mwdma_timings[3] =
+{ 0x7F0FFFF3, 0x7F035352, 0x7f024241 };
+
+static unsigned int cs5535_udma_timings[5] =
+{ 0x7F7436A1, 0x7F733481, 0x7F723261, 0x7F713161, 0x7F703061 };
+
+/* Macros to check if the register is the reset value - reset value is an
+ invalid timing and indicates the register has not been set previously */
+
+#define CS5535_BAD_PIO(timings) ( (timings&~0x80000000UL) == 0x00009172 )
+#define CS5535_BAD_DMA(timings) ( (timings & 0x000FFFFF) == 0x00077771 )
+
+/****
+ * cs5535_set_speed - Configure the chipset to the new speed
+ * @drive: Drive to set up
+ * @speed: desired speed
+ *
+ * cs5535_set_speed() configures the chipset to a new speed.
+ */
+static void cs5535_set_speed(ide_drive_t *drive, u8 speed)
+{
+
+ u32 reg = 0, dummy;
+ int unit = drive->select.b.unit;
+
+
+ /* Set the PIO timings */
+ if ((speed & XFER_MODE) == XFER_PIO) {
+ u8 pioa;
+ u8 piob;
+ u8 cmd;
+
+ pioa = speed - XFER_PIO_0;
+ piob = ide_get_best_pio_mode(&(drive->hwif->drives[!unit]),
+ 255, 4, NULL);
+ cmd = pioa < piob ? pioa : piob;
+
+ /* Write the speed of the current drive */
+ reg = (cs5535_pio_cmd_timings[cmd] << 16) |
+ cs5535_pio_dta_timings[pioa];
+ wrmsr(unit ? ATAC_CH0D1_PIO : ATAC_CH0D0_PIO, reg, 0);
+
+ /* And if nessesary - change the speed of the other drive */
+ rdmsr(unit ? ATAC_CH0D0_PIO : ATAC_CH0D1_PIO, reg, dummy);
+
+ if (((reg >> 16) & cs5535_pio_cmd_timings[cmd]) !=
+ cs5535_pio_cmd_timings[cmd]) {
+ reg &= 0x0000FFFF;
+ reg |= cs5535_pio_cmd_timings[cmd] << 16;
+ wrmsr(unit ? ATAC_CH0D0_PIO : ATAC_CH0D1_PIO, reg, 0);
+ }
+
+ /* Set bit 31 of the DMA register for PIO format 1 timings */
+ rdmsr(unit ? ATAC_CH0D1_DMA : ATAC_CH0D0_DMA, reg, dummy);
+ wrmsr(unit ? ATAC_CH0D1_DMA : ATAC_CH0D0_DMA,
+ reg | 0x80000000UL, 0);
+ } else {
+ rdmsr(unit ? ATAC_CH0D1_DMA : ATAC_CH0D0_DMA, reg, dummy);
+
+ reg &= 0x80000000UL; /* Preserve the PIO format bit */
+
+ if (speed >= XFER_UDMA_0 && speed <= XFER_UDMA_7)
+ reg |= cs5535_udma_timings[speed - XFER_UDMA_0];
+ else if (speed >= XFER_MW_DMA_0 && speed <= XFER_MW_DMA_2)
+ reg |= cs5535_mwdma_timings[speed - XFER_MW_DMA_0];
+ else
+ return;
+
+ wrmsr(unit ? ATAC_CH0D1_DMA : ATAC_CH0D0_DMA, reg, 0);
+ }
+}
+
+static u8 cs5535_ratemask(ide_drive_t *drive)
+{
+ /* eighty93 will return 1 if it's 80core and capable of
+ exceeding udma2, 0 otherwise. we need ratemask to set
+ the max speed and if we can > udma2 then we return 2
+ which selects speed_max as udma4 which is the 5535's max
+ speed, and 1 selects udma2 which is the max for 40c */
+ if (!eighty_ninty_three(drive))
+ return 1;
+
+ return 2;
+}
+
+
+/****
+ * cs5535_set_drive - Configure the drive to the new speed
+ * @drive: Drive to set up
+ * @speed: desired speed
+ *
+ * cs5535_set_drive() configures the drive and the chipset to a
+ * new speed. It also can be called by upper layers.
+ */
+static int cs5535_set_drive(ide_drive_t *drive, u8 speed)
+{
+ speed = ide_rate_filter(cs5535_ratemask(drive), speed);
+ ide_config_drive_speed(drive, speed);
+ cs5535_set_speed(drive, speed);
+
+ return 0;
+}
+
+/****
+ * cs5535_tuneproc - PIO setup
+ * @drive: drive to set up
+ * @pio: mode to use (255 for 'best possible')
+ *
+ * A callback from the upper layers for PIO-only tuning.
+ */
+static void cs5535_tuneproc(ide_drive_t *drive, u8 xferspeed)
+{
+ u8 modes[] = { XFER_PIO_0, XFER_PIO_1, XFER_PIO_2, XFER_PIO_3,
+ XFER_PIO_4 };
+
+ /* cs5535 max pio is pio 4, best_pio will check the blacklist.
+ i think we don't need to rate_filter the incoming xferspeed
+ since we know we're only going to choose pio */
+ xferspeed = ide_get_best_pio_mode(drive, xferspeed, 4, NULL);
+ ide_config_drive_speed(drive, modes[xferspeed]);
+ cs5535_set_speed(drive, xferspeed);
+}
+
+static int cs5535_config_drive_for_dma(ide_drive_t *drive)
+{
+ u8 speed;
+
+ speed = ide_dma_speed(drive, cs5535_ratemask(drive));
+
+ /* If no DMA speed was available then let dma_check hit pio */
+ if (!speed) {
+ return 0;
+ }
+
+ cs5535_set_drive(drive, speed);
+ return ide_dma_enable(drive);
+}
+
+static int cs5535_dma_check(ide_drive_t *drive)
+{
+ ide_hwif_t *hwif = drive->hwif;
+ struct hd_driveid *id = drive->id;
+ u8 speed;
+
+ drive->init_speed = 0;
+
+ if ((id->capability & 1) && drive->autodma) {
+ if (ide_use_dma(drive)) {
+ if (cs5535_config_drive_for_dma(drive))
+ return hwif->ide_dma_on(drive);
+ }
+
+ goto fast_ata_pio;
+
+ } else if ((id->capability & 8) || (id->field_valid & 2)) {
+fast_ata_pio:
+ speed = ide_get_best_pio_mode(drive, 255, 4, NULL);
+ cs5535_set_drive(drive, speed);
+ return hwif->ide_dma_off_quietly(drive);
+ }
+ /* IORDY not supported */
+ return 0;
+}
+
+static u8 __devinit cs5535_cable_detect(struct pci_dev *dev)
+{
+ u8 bit;
+
+ /* if a 80 wire cable was detected */
+ pci_read_config_byte(dev, CS5535_CABLE_DETECT, &bit);
+ return (bit & 1);
+}
+
+/****
+ * init_hwif_cs5535 - Initialize one ide cannel
+ * @hwif: Channel descriptor
+ *
+ * This gets invoked by the IDE driver once for each channel. It
+ * performs channel-specific pre-initialization before drive probing.
+ *
+ */
+static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
+{
+ int i;
+
+ hwif->autodma = 0;
+
+ hwif->tuneproc = &cs5535_tuneproc;
+ hwif->speedproc = &cs5535_set_drive;
+ hwif->ide_dma_check = &cs5535_dma_check;
+
+ hwif->atapi_dma = 1;
+ hwif->ultra_mask = 0x1F;
+ hwif->mwdma_mask = 0x07;
+
+
+ hwif->udma_four = cs5535_cable_detect(hwif->pci_dev);
+
+ if (!noautodma)
+ hwif->autodma = 1;
+
+ /* just setting autotune and not worrying about bios timings */
+ for (i = 0; i < 2; i++) {
+ hwif->drives[i].autotune = 1;
+ hwif->drives[i].autodma = hwif->autodma;
+ }
+}
+
+static ide_pci_device_t cs5535_chipset __devinitdata = {
+ .name = "CS5535",
+ .init_hwif = init_hwif_cs5535,
+ .channels = 1,
+ .autodma = AUTODMA,
+ .bootable = ON_BOARD,
+};
+
+static int __devinit cs5535_init_one(struct pci_dev *dev,
+ const struct pci_device_id *id)
+{
+ return ide_setup_pci_device(dev, &cs5535_chipset);
+}
+
+static struct pci_device_id cs5535_pci_tbl[] =
+{
+ { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_IDE, PCI_ANY_ID,
+ PCI_ANY_ID, 0, 0, 0},
+ { 0, },
+};
+
+MODULE_DEVICE_TABLE(pci, cs5535_pci_tbl);
+
+static struct pci_driver driver = {
+ .name = "CS5535_IDE",
+ .id_table = cs5535_pci_tbl,
+ .probe = cs5535_init_one,
+};
+
+static int __init cs5535_ide_init(void)
+{
+ return ide_pci_register_driver(&driver);
+}
+
+module_init(cs5535_ide_init);
+
+MODULE_AUTHOR("AMD");
+MODULE_DESCRIPTION("PCI driver module for AMD/NS CS5535 IDE");
+MODULE_LICENSE("GPL");
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -469,7 +469,7 @@ static void __devinit init_hwif_cy82c693
static __devinitdata ide_hwif_t *primary;
-void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
+static void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
{
if (PCI_FUNC(hwif->pci_dev->devfn) == 1)
primary = hwif;
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -701,6 +701,7 @@ static unsigned int setup_mmio_siimage (
unsigned long barsize = pci_resource_len(dev, 5);
u8 tmpbyte = 0;
void __iomem *ioaddr;
+ u32 tmp, irq_mask;
/*
* Drop back to PIO if we can't map the mmio. Some
@@ -726,6 +727,14 @@ static unsigned int setup_mmio_siimage (
pci_set_drvdata(dev, (void *) ioaddr);
if (pdev_is_sata(dev)) {
+ /* make sure IDE0/1 interrupts are not masked */
+ irq_mask = (1 << 22) | (1 << 23);
+ tmp = readl(ioaddr + 0x48);
+ if (tmp & irq_mask) {
+ tmp &= ~irq_mask;
+ writel(tmp, ioaddr + 0x48);
+ readl(ioaddr + 0x48); /* flush */
+ }
writel(0, ioaddr + 0x148);
writel(0, ioaddr + 0x1C8);
}
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -395,6 +395,7 @@ static int idescsi_end_request (ide_driv
int log = test_bit(IDESCSI_LOG_CMD, &scsi->log);
struct Scsi_Host *host;
u8 *scsi_buf;
+ int errors = rq->errors;
unsigned long flags;
if (!(rq->flags & (REQ_SPECIAL|REQ_SENSE))) {
@@ -421,11 +422,11 @@ static int idescsi_end_request (ide_driv
printk (KERN_WARNING "ide-scsi: %s: timed out for %lu\n",
drive->name, pc->scsi_cmd->serial_number);
pc->scsi_cmd->result = DID_TIME_OUT << 16;
- } else if (rq->errors >= ERROR_MAX) {
+ } else if (errors >= ERROR_MAX) {
pc->scsi_cmd->result = DID_ERROR << 16;
if (log)
printk ("ide-scsi: %s: I/O error for %lu\n", drive->name, pc->scsi_cmd->serial_number);
- } else if (rq->errors) {
+ } else if (errors) {
if (log)
printk ("ide-scsi: %s: check condition for %lu\n", drive->name, pc->scsi_cmd->serial_number);
if (!idescsi_check_condition(drive, rq))
diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h
--- a/include/asm-alpha/ide.h
+++ b/include/asm-alpha/ide.h
@@ -15,10 +15,6 @@
#include <linux/config.h>
-#ifndef MAX_HWIFS
-#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
-#endif
-
#define IDE_ARCH_OBSOLETE_DEFAULTS
static inline int ide_default_irq(unsigned long base)
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -41,6 +41,12 @@ static __inline__ int ide_default_irq(un
static __inline__ unsigned long ide_default_io_base(int index)
{
+ /*
+ * If PCI is present then it is not safe to poke around
+ * the other legacy IDE ports. Only 0x1f0 and 0x170 are
+ * defined compatibility mode ports for PCI. A user can
+ * override this using ide= but we must default safe.
+ */
if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) {
switch(index) {
case 2: return 0x1e8;
diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h
--- a/include/asm-sh/ide.h
+++ b/include/asm-sh/ide.h
@@ -16,10 +16,6 @@
#include <linux/config.h>
-#ifndef MAX_HWIFS
-#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
-#endif
-
#define ide_default_io_ctl(base) (0)
#include <asm-generic/ide_iops.h>
diff --git a/include/asm-sh64/ide.h b/include/asm-sh64/ide.h
--- a/include/asm-sh64/ide.h
+++ b/include/asm-sh64/ide.h
@@ -17,10 +17,6 @@
#include <linux/config.h>
-#ifndef MAX_HWIFS
-#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
-#endif
-
/* Without this, the initialisation of PCI IDE cards end up calling
* ide_init_hwif_ports, which won't work. */
#ifdef CONFIG_BLK_DEV_IDEPCI
diff --git a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -230,6 +230,7 @@ typedef struct hw_regs_s {
int dma; /* our dma entry */
ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
hwif_chipset_t chipset;
+ struct device *dev;
} hw_regs_t;
/*
@@ -266,6 +267,10 @@ static inline void ide_std_init_ports(hw
#include <asm/ide.h>
+#ifndef MAX_HWIFS
+#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
+#endif
+
/* needed on alpha, x86/x86_64, ia64, mips, ppc32 and sh */
#ifndef IDE_ARCH_OBSOLETE_DEFAULTS
# define ide_default_io_base(index) (0)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -387,6 +387,7 @@
#define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511
#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515
#define PCI_DEVICE_ID_NS_87410 0xd001
+#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
#define PCI_VENDOR_ID_TSENG 0x100c
#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202
@@ -487,6 +488,8 @@
#define PCI_DEVICE_ID_AMD_8151_0 0x7454
#define PCI_DEVICE_ID_AMD_8131_APIC 0x7450
+#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A
+
#define PCI_VENDOR_ID_TRIDENT 0x1023
#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000
#define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001
^ permalink raw reply [flat|nested] 67+ messages in thread* [git patches] ide update
@ 2005-08-18 21:37 Bartlomiej Zolnierkiewicz
2005-08-18 22:15 ` Linus Torvalds
2005-08-18 23:08 ` Alan Cox
0 siblings, 2 replies; 67+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-08-18 21:37 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-ide, linux-kernel
Hi,
3 obvious fixes + support for 2 new controllers
(just new PCI IDs).
Please pull from:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6.git
diffstat/changelog/patch below
--
Bartlomiej
drivers/ide/Kconfig | 1 +
drivers/ide/ide-floppy.c | 2 +-
drivers/ide/pci/generic.c | 7 +++++++
drivers/ide/pci/serverworks.c | 23 +++++++++++++++++++++++
drivers/ide/ppc/pmac.c | 2 +-
drivers/ide/setup-pci.c | 1 +
include/linux/pci_ids.h | 6 +++++-
7 files changed, 39 insertions(+), 3 deletions(-)
commit 84f57fbc724e3b56dc87c37dddac89f82cf75ef6
Author: Narendra Sankar <nsankar@broadcom.com>
Date: Thu Aug 18 22:30:35 2005 +0200
[PATCH] serverworks: add support for new southbridge IDE
BCM5785 (HT1000) is a Opteron Southbridge from Serverworks/Broadcom that
incorporates a single channel ATA100 IDE controller that is functionally
identical to the Serverworks CSB6 IDE controller. This patch adds support
for the new PCI device ID and also the support for this controller.
Signed-off-by: Narendra Sankar <nsankar@broadcom.com>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
commit 2f09a7f4af131bf23c013ead89373deba1c7593c
Author: Matt Gillette <matt.gillette@netcell.com>
Date: Thu Aug 18 22:27:07 2005 +0200
[PATCH] ide: add support for Netcell Revolution to pci-ide generic driver
Adds support for Netcell Revolution to pci-ide generic driver by including
it in the list of devices matched. Includes the Revolution in the list of
simplex devices forced into DMA mode.
Signed-off-by: Matt Gillette <matt.gillette@netcell.com>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
commit b07e5eccaf512ae3209beae5cd2e3a27c92c300b
Author: Grant Coady <gcoady@gmail.com>
Date: Thu Aug 18 22:19:55 2005 +0200
[PATCH] ide: fix PCI_DEVIEC_ID_APPLE_UNI_N_ATA spelling
Signed-off-by: Grant Coady <gcoady@gmail.com>
commit 0ac72b351bdf29252e4181b07fa7feed8501b5d2
Author: Juha-Matti Tapio <jmtapio@verkkotelakka.net>
Date: Thu Aug 18 22:13:44 2005 +0200
[PATCH] ide: fix the BLK_DEV_IDEDMA_PCI dependency for drivers/ide/ppc/pmac.c
drivers/ide/ppc/pmac.c uses symbols ide_build_sglist,
__ide_dma_off_quietly, __ide_dma_on and __ide_dma_timeout when
CONFIG_BLK_DEV_IDEDMA_PMAC is defined. The declarations for these
symbols (in ide.h) depend on CONFIG_BLK_DEV_IDEDMA_PCI. There is a
missing dependency for this in drivers/ide/Kconfig which causes
drivers/ide/ppc/pmac.c to fail to build if CONFIG_BLK_DEV_IDEDMA_PMAC
is selected but CONFIG_BLK_DEV_IDEDMA_PCI is not.
Signed-off-by: Juha-Matti Tapio <jmtapio@verkkotelakka.net>
commit c40d3d38a8f04fff4394c7323db239bce780db60
Author: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Date: Thu Aug 18 22:09:21 2005 +0200
[PATCH] ide-floppy: fix IDEFLOPPY_TICKS_DELAY
* IDEFLOPPY_TICKS_DELAY assumed HZ == 100, fix it
* increase the delay to 50ms (to match comment in the code)
Thanks to Manfred Scherer <manfred.scherer.mhm@t-online.de>
for reporting the problem and testing the patch.
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -764,6 +764,7 @@ config BLK_DEV_IDE_PMAC_ATA100FIRST
config BLK_DEV_IDEDMA_PMAC
bool "PowerMac IDE DMA support"
depends on BLK_DEV_IDE_PMAC
+ select BLK_DEV_IDEDMA_PCI
help
This option allows the driver for the built-in IDE controller on
Power Macintoshes and PowerBooks to use DMA (direct memory access)
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -317,7 +317,7 @@ typedef struct ide_floppy_obj {
unsigned long flags;
} idefloppy_floppy_t;
-#define IDEFLOPPY_TICKS_DELAY 3 /* default delay for ZIP 100 */
+#define IDEFLOPPY_TICKS_DELAY HZ/20 /* default delay for ZIP 100 (50ms) */
/*
* Floppy flag bits values.
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c
--- a/drivers/ide/pci/generic.c
+++ b/drivers/ide/pci/generic.c
@@ -173,6 +173,12 @@ static ide_pci_device_t generic_chipsets
.channels = 2,
.autodma = NOAUTODMA,
.bootable = ON_BOARD,
+ },{ /* 14 */
+ .name = "Revolution",
+ .init_hwif = init_hwif_generic,
+ .channels = 2,
+ .autodma = AUTODMA,
+ .bootable = OFF_BOARD,
}
};
@@ -231,6 +237,7 @@ static struct pci_device_id generic_pci_
{ PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11},
{ PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
{ PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13},
+ { PCI_VENDOR_ID_NETCELL,PCI_DEVICE_ID_REVOLUTION, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14},
/* Must come last. If you add entries adjust this table appropriately and the init_one code */
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE << 8, 0xFFFFFF00UL, 0},
{ 0, },
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -21,6 +21,9 @@
*
* CSB6: `Champion South Bridge' IDE Interface (optional: third channel)
*
+ * HT1000: AKA BCM5785 - Hypertransport Southbridge for Opteron systems. IDE
+ * controller same as the CSB6. Single channel ATA100 only.
+ *
* Documentation:
* Available under NDA only. Errata info very hard to get.
*
@@ -71,6 +74,8 @@ static u8 svwks_ratemask (ide_drive_t *d
if (!svwks_revision)
pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision);
+ if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE)
+ return 2;
if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) {
u32 reg = 0;
if (isa_dev)
@@ -109,6 +114,7 @@ static u8 svwks_csb_check (struct pci_de
case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE:
case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE:
case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2:
+ case PCI_DEVICE_ID_SERVERWORKS_HT1000IDE:
return 1;
default:
break;
@@ -438,6 +444,13 @@ static unsigned int __devinit init_chips
btr |= (svwks_revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2;
pci_write_config_byte(dev, 0x5A, btr);
}
+ /* Setup HT1000 SouthBridge Controller - Single Channel Only */
+ else if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) {
+ pci_read_config_byte(dev, 0x5A, &btr);
+ btr &= ~0x40;
+ btr |= 0x3;
+ pci_write_config_byte(dev, 0x5A, btr);
+ }
return (dev->irq) ? dev->irq : 0;
}
@@ -629,6 +642,15 @@ static ide_pci_device_t serverworks_chip
.channels = 1, /* 2 */
.autodma = AUTODMA,
.bootable = ON_BOARD,
+ },{ /* 4 */
+ .name = "SvrWks HT1000",
+ .init_setup = init_setup_svwks,
+ .init_chipset = init_chipset_svwks,
+ .init_hwif = init_hwif_svwks,
+ .init_dma = init_dma_svwks,
+ .channels = 1, /* 2 */
+ .autodma = AUTODMA,
+ .bootable = ON_BOARD,
}
};
@@ -653,6 +675,7 @@ static struct pci_device_id svwks_pci_tb
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
{ PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
+ { PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
{ 0, },
};
MODULE_DEVICE_TABLE(pci, svwks_pci_tbl);
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1664,7 +1664,7 @@ static struct macio_driver pmac_ide_maci
};
static struct pci_device_id pmac_ide_pci_match[] = {
- { PCI_VENDOR_ID_APPLE, PCI_DEVIEC_ID_APPLE_UNI_N_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+ { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_K2_ATA100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_SH_ATA,
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -229,6 +229,7 @@ second_chance_to_dma:
case PCI_DEVICE_ID_AMD_VIPER_7409:
case PCI_DEVICE_ID_CMD_643:
case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE:
+ case PCI_DEVICE_ID_REVOLUTION:
simplex_stat = hwif->INB(dma_base + 2);
hwif->OUTB((simplex_stat&0x60),(dma_base + 2));
simplex_stat = hwif->INB(dma_base + 2);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -881,7 +881,7 @@
#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e
#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030
#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032
-#define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033
+#define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033
#define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034
#define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b
#define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e
@@ -1580,6 +1580,7 @@
#define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211
#define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212
#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213
+#define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214
#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217
#define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220
#define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB
@@ -2184,6 +2185,9 @@
#define PCI_VENDOR_ID_SIBYTE 0x166d
#define PCI_DEVICE_ID_BCM1250_HT 0x0002
+#define PCI_VENDOR_ID_NETCELL 0x169c
+#define PCI_DEVICE_ID_REVOLUTION 0x0044
+
#define PCI_VENDOR_ID_LINKSYS 0x1737
#define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032
#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064
^ permalink raw reply [flat|nested] 67+ messages in thread* Re: [git patches] ide update 2005-08-18 21:37 Bartlomiej Zolnierkiewicz @ 2005-08-18 22:15 ` Linus Torvalds 2005-08-18 22:19 ` Nish Aravamudan 2005-08-19 0:44 ` Mark Lord 2005-08-18 23:08 ` Alan Cox 1 sibling, 2 replies; 67+ messages in thread From: Linus Torvalds @ 2005-08-18 22:15 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, Linux Kernel Mailing List On Thu, 18 Aug 2005, Bartlomiej Zolnierkiewicz wrote: > > 3 obvious fixes + support for 2 new controllers > (just new PCI IDs). Btw, things like this: +#define IDEFLOPPY_TICKS_DELAY HZ/20 /* default delay for ZIP 100 (50ms) */ are just bugs waiting to happen. Hint: see what happens when you do something like this: high_byte = IDEFLOPPY_TICKS_DELAY >> 8; low_byte = (unsigned char) IDEFLOPPY_TICKS_DELAY; and watch in amazement how you get entirely the wrong value if HZ is 1000. Try it out.. Linus ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] ide update 2005-08-18 22:15 ` Linus Torvalds @ 2005-08-18 22:19 ` Nish Aravamudan 2005-08-19 0:44 ` Mark Lord 1 sibling, 0 replies; 67+ messages in thread From: Nish Aravamudan @ 2005-08-18 22:19 UTC (permalink / raw) To: Linus Torvalds Cc: Bartlomiej Zolnierkiewicz, linux-ide, Linux Kernel Mailing List On 8/18/05, Linus Torvalds <torvalds@osdl.org> wrote: > > > On Thu, 18 Aug 2005, Bartlomiej Zolnierkiewicz wrote: > > > > 3 obvious fixes + support for 2 new controllers > > (just new PCI IDs). > > Btw, things like this: > > +#define IDEFLOPPY_TICKS_DELAY HZ/20 /* default delay for ZIP 100 (50ms) */ > > are just bugs waiting to happen. <snip> Shouldn't this be msecs_to_jiffies(50) to avoid the rounding issues I mentioned on LKML a bit ago? Thanks, Nish ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] ide update 2005-08-18 22:15 ` Linus Torvalds 2005-08-18 22:19 ` Nish Aravamudan @ 2005-08-19 0:44 ` Mark Lord 1 sibling, 0 replies; 67+ messages in thread From: Mark Lord @ 2005-08-19 0:44 UTC (permalink / raw) To: Linus Torvalds Cc: Bartlomiej Zolnierkiewicz, linux-ide, Linux Kernel Mailing List Linus Torvalds wrote: > > Btw, things like this: > > +#define IDEFLOPPY_TICKS_DELAY HZ/20 /* default delay for ZIP 100 (50ms) */ > > are just bugs waiting to happen. Needs parenthesis: ((HZ)/20) Or one could just use the msecs_to_jiffies() macro. Cheers ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] ide update 2005-08-18 21:37 Bartlomiej Zolnierkiewicz 2005-08-18 22:15 ` Linus Torvalds @ 2005-08-18 23:08 ` Alan Cox 2005-08-19 9:02 ` Bartlomiej Zolnierkiewicz 1 sibling, 1 reply; 67+ messages in thread From: Alan Cox @ 2005-08-18 23:08 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: Linus Torvalds, linux-ide, linux-kernel On Iau, 2005-08-18 at 23:37 +0200, Bartlomiej Zolnierkiewicz wrote: > + },{ /* 14 */ > + .name = "Revolution", > + .init_hwif = init_hwif_generic, > + .channels = 2, > + .autodma = AUTODMA, > + .bootable = OFF_BOARD, > } This seems rather odd - the driver asks for AUTODMA yet because its IDE generic contains no code to retune the device interface for DMA ? BTW whats the status on the CS5535 driver that someone submitted a while back ? ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] ide update 2005-08-18 23:08 ` Alan Cox @ 2005-08-19 9:02 ` Bartlomiej Zolnierkiewicz 2005-08-19 18:06 ` Alan Cox 0 siblings, 1 reply; 67+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-08-19 9:02 UTC (permalink / raw) To: Alan Cox; +Cc: Bartlomiej Zolnierkiewicz, Linus Torvalds, linux-ide, linux-kernel On 8/19/05, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: > On Iau, 2005-08-18 at 23:37 +0200, Bartlomiej Zolnierkiewicz wrote: > > + },{ /* 14 */ > > + .name = "Revolution", > > + .init_hwif = init_hwif_generic, > > + .channels = 2, > > + .autodma = AUTODMA, > > + .bootable = OFF_BOARD, > > } > > This seems rather odd - the driver asks for AUTODMA yet because its IDE > generic contains no code to retune the device interface for DMA ? It is fine, grep drivers/ide/setup-pci.c for "d->autodma". You are confusing 'autodma' fields in ide_hwif_t and ide_pci_device_t. > BTW whats the status on the CS5535 driver that someone submitted a while > back ? lkml.org/lkml/2005/1/27/20 AFAIK CS5535 driver was never ported to 2.6.x. Somebody needs to port it to 2.6.x kernel, cleanup to match kernel coding standards and test. Bartlomiej ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] ide update 2005-08-19 9:02 ` Bartlomiej Zolnierkiewicz @ 2005-08-19 18:06 ` Alan Cox 2005-08-19 23:51 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 67+ messages in thread From: Alan Cox @ 2005-08-19 18:06 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz Cc: Bartlomiej Zolnierkiewicz, Linus Torvalds, linux-ide, linux-kernel On Gwe, 2005-08-19 at 11:02 +0200, Bartlomiej Zolnierkiewicz wrote: > lkml.org/lkml/2005/1/27/20 > > AFAIK CS5535 driver was never ported to 2.6.x. Somebody needs to > port it to 2.6.x kernel, cleanup to match kernel coding standards and test. That was done some time ago and posted to various people. ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] ide update 2005-08-19 18:06 ` Alan Cox @ 2005-08-19 23:51 ` Bartlomiej Zolnierkiewicz 2005-08-19 23:52 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 67+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-08-19 23:51 UTC (permalink / raw) To: Alan Cox; +Cc: Bartlomiej Zolnierkiewicz, Linus Torvalds, linux-ide, linux-kernel On 8/19/05, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: > On Gwe, 2005-08-19 at 11:02 +0200, Bartlomiej Zolnierkiewicz wrote: > > lkml.org/lkml/2005/1/27/20 > > > > AFAIK CS5535 driver was never ported to 2.6.x. Somebody needs to > > port it to 2.6.x kernel, cleanup to match kernel coding standards and test. > > That was done some time ago and posted to various people. This is a good news that cs5530 driver was ported. BTW posting to "various people" is really not the best method of submitting kernel patches (in this case linux-ide@vger.kernel.org + cc: me is). Bartlomiej ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] ide update 2005-08-19 23:51 ` Bartlomiej Zolnierkiewicz @ 2005-08-19 23:52 ` Bartlomiej Zolnierkiewicz 0 siblings, 0 replies; 67+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-08-19 23:52 UTC (permalink / raw) To: Alan Cox; +Cc: Bartlomiej Zolnierkiewicz, Linus Torvalds, linux-ide, linux-kernel On 8/20/05, Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote: > On 8/19/05, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote: > > On Gwe, 2005-08-19 at 11:02 +0200, Bartlomiej Zolnierkiewicz wrote: > > > lkml.org/lkml/2005/1/27/20 > > > > > > AFAIK CS5535 driver was never ported to 2.6.x. Somebody needs to > > > port it to 2.6.x kernel, cleanup to match kernel coding standards and test. > > > > That was done some time ago and posted to various people. > > This is a good news that cs5530 driver was ported. s/cs5530/cs5535/ ^ permalink raw reply [flat|nested] 67+ messages in thread
* [git patches] IDE update
@ 2005-07-03 16:52 Bartlomiej Zolnierkiewicz
2005-07-04 12:01 ` Al Boldi
2005-07-05 2:47 ` Jeff Garzik
0 siblings, 2 replies; 67+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-07-03 16:52 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-ide, linux-kernel
Hi,
Please pull from:
rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6.git
diffstat+changelog below
Bartlomiej
drivers/ide/Makefile | 1 -
drivers/ide/ide-lib.c | 13 +++++--------
drivers/ide/pci/alim15x3.c | 10 +++++-----
drivers/ide/pci/amd74xx.c | 7 +++++--
drivers/ide/pci/cs5530.c | 4 ++--
drivers/ide/pci/cy82c693.c | 8 ++++----
drivers/ide/pci/it8172.c | 4 ++--
drivers/ide/pci/ns87415.c | 2 +-
drivers/ide/pci/opti621.c | 2 +-
drivers/ide/pci/sc1200.c | 2 +-
drivers/ide/pci/sl82c105.c | 6 +++---
drivers/ide/pci/slc90e66.c | 2 +-
drivers/ide/pci/triflex.c | 2 +-
drivers/ide/pci/via82cxxx.c | 4 ++--
include/linux/pci_ids.h | 1 +
15 files changed, 34 insertions(+), 34 deletions(-)
commit 10e047b40aafefef1fdc8ea4ea7837b9557a9400
tree 4105ba774c775cdf53fb5fd3e07158b15218cb27
parent 21e2c01dc3e38d466eda5871645878d2c3a33261
author Adrian Bunk <bunk@stusta.de> Sun, 03 Jul 2005 17:44:10 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 17:44:10 +0200
[PATCH] drivers/ide/Makefile: kill dead CONFIG_BLK_DEV_IDE_TCQ entry
This patch kills the dead CONFIG_BLK_DEV_IDE_TCQ entry.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit 21e2c01dc3e38d466eda5871645878d2c3a33261
tree a2a4fb15b2295e635de9f734f720f783c97a6513
parent 13bbbf28fb914da6707aad44a073651f5c9d13a5
author Rob Punkunus <rpunkunus@nvidia.com> Sun, 03 Jul 2005 17:37:18 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 17:37:18 +0200
[PATCH] amd74xx: support MCP55 device IDs
From: Rob Punkunus <rpunkunus@nvidia.com>
Rob Punkunus recently submitted a patch to enable support for MCP51/MCP55 in
the amd74xx driver. This patch was whitespace-corrupted and didn't apply to
2.6.12 since MCP51 support was merged in the 2.6.12-rc series.
Gentoo would like to support this hardware for our upcoming release media, so
I fixed the patch, and here it is :)
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit 13bbbf28fb914da6707aad44a073651f5c9d13a5
tree 16cea5674a7da7aa1b318685598a87d7dc806ba1
parent f3718d3e135117f80de0ff219be91544baa75599
author Denis Vlasenko <vda@ilport.com.ua> Sun, 03 Jul 2005 17:09:13 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 17:09:13 +0200
[PATCH] ide: fix line break in ide messages
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>
--------------------------
commit f3718d3e135117f80de0ff219be91544baa75599
tree 48c98f74b12e7669b787bd9c75edf8fd20e07912
parent d6904ab66f74cb99793e3919fc589dd0163a7740
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:42:18 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:42:18 +0200
[PATCH] ide: hotplug mark __devinit via82cxxx.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit d6904ab66f74cb99793e3919fc589dd0163a7740
tree f68e6b3b5603d67b92a3276b35c623054c3ecdf9
parent 97319630b21c2022a55d51a6cfbf53cbb84a2f42
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:40:31 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:40:31 +0200
[PATCH] ide: hotplug mark __devinit triflex.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit 97319630b21c2022a55d51a6cfbf53cbb84a2f42
tree 5d831d1f2a2c264e1d3dc55f6f2f967b7c7c010c
parent 34a6224691e638dd36b393aa439d021a19578fcc
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:38:51 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:38:51 +0200
[PATCH] ide: hotplug mark __devinit slc90e66.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit 34a6224691e638dd36b393aa439d021a19578fcc
tree 0c6fb291d2d9657f83c7bb0427eacad8f6f05d81
parent 6a6e1b1cf41b0bf35fffbf18787e8d8f865b66d6
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:36:56 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:36:56 +0200
[PATCH] ide: hotplug mark __devinit sl82c105.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit 6a6e1b1cf41b0bf35fffbf18787e8d8f865b66d6
tree ead647e67974ce09bf14b194be6ad99787a0c176
parent 9307145700e869dd410d565477f98377e93e9160
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:35:07 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:35:07 +0200
[PATCH] ide: hotplug mark __devinit sc1200.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit 9307145700e869dd410d565477f98377e93e9160
tree bb887910e3dcef3b084a078004548268786d8166
parent c20530ed26e5b9e3b188b4088d0a5ab1d773a529
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:33:16 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:33:16 +0200
[PATCH] ide: hotplug mark __devinit opti621.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit c20530ed26e5b9e3b188b4088d0a5ab1d773a529
tree 5c68ff26c3c1fe342cc095a1a53b2d1aedada684
parent a380a8849f90ba81a5ff0c325fd5d8125c70b3bb
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:31:04 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:31:04 +0200
[PATCH] ide: hotplug mark __devinit ns87415.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit a380a8849f90ba81a5ff0c325fd5d8125c70b3bb
tree 5c0ee15020ff929536331d9a00a76cbfac0bf035
parent ddbc9fb47252f9b6966bfe9b0aa27bfeaa585cca
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:28:44 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:28:44 +0200
[PATCH] ide: hotplug mark __devinit it8172.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit ddbc9fb47252f9b6966bfe9b0aa27bfeaa585cca
tree 41eefbf36f12c095303eb0811c8e28ea6af895db
parent 88de8e996f16b958721368ed9b4fd4e29cdb923e
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:25:46 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:25:46 +0200
[PATCH] ide: hotplug mark __devinit cy82c693.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit 88de8e996f16b958721368ed9b4fd4e29cdb923e
tree 24f89d1a1f739a4c48376e11b8a73c1f46a71ccb
parent e895f926cd8b6d50a42cc985d470bdc9a70caeed
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:23:08 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:23:08 +0200
[PATCH] ide: hotplug mark __devinit cs5530.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit e895f926cd8b6d50a42cc985d470bdc9a70caeed
tree 8c2bc70f185842dfcd795f06afdb33d65e193d51
parent c2f12589bfc4119f2c331ecea8cca4945ed48497
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:15:41 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:15:41 +0200
[PATCH] ide: hotplug mark __devinit amd74xx.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
commit c2f12589bfc4119f2c331ecea8cca4945ed48497
tree d00d17e062b845f35c79b456a70e8d3b45b3b556
parent 1d6bebf2ecf92924492c491d9c3a72edba95f907
author Herbert Xu <herbert@gondor.apana.org.au> Sun, 03 Jul 2005 16:06:13 +0200
committer Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> Sun, 03 Jul 2005 16:06:13 +0200
[PATCH] ide: hotplug mark __devinit alim15x3.c
From: Herbert Xu <herbert@gondor.apana.org.au>
mark the __init section __devinit.
Splitted up from the Debian kernel patch.
see the thread about the pci hotplug crash on a stratus box.
http://marc.theaimsgroup.com/?l=linux-kernel&m=111930108613386&w=2
Signed-off-by: maximilian attems <janitor@sternwelten.at>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
--------------------------
^ permalink raw reply [flat|nested] 67+ messages in thread* RE: [git patches] IDE update 2005-07-03 16:52 [git patches] IDE update Bartlomiej Zolnierkiewicz @ 2005-07-04 12:01 ` Al Boldi 2005-07-04 12:30 ` Bartlomiej Zolnierkiewicz 2005-07-05 2:47 ` Jeff Garzik 1 sibling, 1 reply; 67+ messages in thread From: Al Boldi @ 2005-07-04 12:01 UTC (permalink / raw) To: 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds' Cc: linux-ide, linux-kernel Bartlomiej Zolnierkiewicz wrote: { Please pull from: rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6.git } Does it fix the idedriver int/dma problem? Al ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-04 12:01 ` Al Boldi @ 2005-07-04 12:30 ` Bartlomiej Zolnierkiewicz 2005-07-04 15:30 ` Al Boldi 0 siblings, 1 reply; 67+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-07-04 12:30 UTC (permalink / raw) To: Al Boldi; +Cc: Linus Torvalds, linux-ide, linux-kernel On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: > Bartlomiej Zolnierkiewicz wrote: { > Please pull from: > rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6.git > } > > Does it fix the idedriver int/dma problem? What is the "int/dma problem"? ^ permalink raw reply [flat|nested] 67+ messages in thread
* RE: [git patches] IDE update 2005-07-04 12:30 ` Bartlomiej Zolnierkiewicz @ 2005-07-04 15:30 ` Al Boldi 2005-07-04 15:41 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 67+ messages in thread From: Al Boldi @ 2005-07-04 15:30 UTC (permalink / raw) To: 'Bartlomiej Zolnierkiewicz' Cc: 'Linus Torvalds', linux-ide, linux-kernel Bartlomiej Zolnierkiewicz wrote: { What is the "int/dma problem"? } Hdparm -tT gives 38mb/s in 2.4.31 Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle Hdparm -tT gives 28mb/s in 2.6.12 Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT It feels like DMA is not being applied properly in 2.6.12. Your comments please. Thanks! ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-04 15:30 ` Al Boldi @ 2005-07-04 15:41 ` Bartlomiej Zolnierkiewicz 2005-07-04 17:06 ` Al Boldi 0 siblings, 1 reply; 67+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-07-04 15:41 UTC (permalink / raw) To: Al Boldi; +Cc: Linus Torvalds, linux-ide, linux-kernel On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: > Bartlomiej Zolnierkiewicz wrote: { > What is the "int/dma problem"? > } > > Hdparm -tT gives 38mb/s in 2.4.31 > Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle > > Hdparm -tT gives 28mb/s in 2.6.12 > Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT > > It feels like DMA is not being applied properly in 2.6.12. > > Your comments please. Are earlier 2.6.x kernels okay? dmesg output? Bartlomiej ^ permalink raw reply [flat|nested] 67+ messages in thread
* RE: [git patches] IDE update 2005-07-04 15:41 ` Bartlomiej Zolnierkiewicz @ 2005-07-04 17:06 ` Al Boldi 2005-07-04 17:38 ` Ondrej Zary 0 siblings, 1 reply; 67+ messages in thread From: Al Boldi @ 2005-07-04 17:06 UTC (permalink / raw) To: 'Bartlomiej Zolnierkiewicz' Cc: 'Linus Torvalds', linux-ide, linux-kernel Bartlomiej Zolnierkiewicz wrote: { > On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: > Hdparm -tT gives 38mb/s in 2.4.31 > Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle > > Hdparm -tT gives 28mb/s in 2.6.12 > Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT > > It feels like DMA is not being applied properly in 2.6.12. Are earlier 2.6.x kernels okay? dmesg output? } Same on 2.6.10,11,12. No errors though, only sluggish system. ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-04 17:06 ` Al Boldi @ 2005-07-04 17:38 ` Ondrej Zary 2005-07-04 19:51 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 67+ messages in thread From: Ondrej Zary @ 2005-07-04 17:38 UTC (permalink / raw) To: Al Boldi Cc: 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel Al Boldi wrote: > Bartlomiej Zolnierkiewicz wrote: { > >>On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: >>Hdparm -tT gives 38mb/s in 2.4.31 >>Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle >> >>Hdparm -tT gives 28mb/s in 2.6.12 >>Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT >> >>It feels like DMA is not being applied properly in 2.6.12. > > > Are earlier 2.6.x kernels okay? > > dmesg output? > } > > Same on 2.6.10,11,12. > No errors though, only sluggish system. Something like this http://lkml.org/lkml/2005/6/13/1 ? -- Ondrej Zary ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-04 17:38 ` Ondrej Zary @ 2005-07-04 19:51 ` Bartlomiej Zolnierkiewicz 2005-07-04 20:32 ` Al Boldi 0 siblings, 1 reply; 67+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-07-04 19:51 UTC (permalink / raw) To: Ondrej Zary; +Cc: Al Boldi, Linus Torvalds, linux-ide, linux-kernel On 7/4/05, Ondrej Zary <linux@rainbow-software.org> wrote: > Al Boldi wrote: > > Bartlomiej Zolnierkiewicz wrote: { > > > >>On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: > >>Hdparm -tT gives 38mb/s in 2.4.31 > >>Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle > >> > >>Hdparm -tT gives 28mb/s in 2.6.12 > >>Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT > >> > >>It feels like DMA is not being applied properly in 2.6.12. > > > > > > Are earlier 2.6.x kernels okay? > > > > dmesg output? > > } > > > > Same on 2.6.10,11,12. > > No errors though, only sluggish system. What about earlier kernels? Please try to narrow down the problem to a specific kernel version. > Something like this http://lkml.org/lkml/2005/6/13/1 ? It doesn't seem like IDE regression but... Bartlomiej ^ permalink raw reply [flat|nested] 67+ messages in thread
* RE: [git patches] IDE update 2005-07-04 19:51 ` Bartlomiej Zolnierkiewicz @ 2005-07-04 20:32 ` Al Boldi 2005-07-04 20:47 ` Bartlomiej Zolnierkiewicz 2005-07-04 23:25 ` André Tomt 0 siblings, 2 replies; 67+ messages in thread From: Al Boldi @ 2005-07-04 20:32 UTC (permalink / raw) To: 'Bartlomiej Zolnierkiewicz', 'Ondrej Zary' Cc: 'Linus Torvalds', linux-ide, linux-kernel Bartlomiej Zolnierkiewicz wrote: { > > > >>On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: > >>Hdparm -tT gives 38mb/s in 2.4.31 > >>Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle > >> > >>Hdparm -tT gives 28mb/s in 2.6.12 > >>Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT > >> > >>It feels like DMA is not being applied properly in 2.6.12. > > > > Same on 2.6.10,11,12. > > No errors though, only sluggish system. What about earlier kernels? Please try to narrow down the problem to a specific kernel version. } Don't know about 2.6.0-2.6.9, but 2.4.31 is ok. Bartlomiej, When you compare 2.4.31 with 2.6.12 don't you see this problem on your machine? If you have a fast system the slowdown won't show, but your IOWAIT will be higher anyway! It feels like running on PIO instead of DMA. ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-04 20:32 ` Al Boldi @ 2005-07-04 20:47 ` Bartlomiej Zolnierkiewicz 2005-07-04 23:25 ` André Tomt 1 sibling, 0 replies; 67+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-07-04 20:47 UTC (permalink / raw) To: Al Boldi; +Cc: Ondrej Zary, Linus Torvalds, linux-ide, linux-kernel On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: > Bartlomiej Zolnierkiewicz wrote: { > > > > > >>On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: > > >>Hdparm -tT gives 38mb/s in 2.4.31 > > >>Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle > > >> > > >>Hdparm -tT gives 28mb/s in 2.6.12 > > >>Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT > > >> > > >>It feels like DMA is not being applied properly in 2.6.12. > > > > > > Same on 2.6.10,11,12. > > > No errors though, only sluggish system. > > What about earlier kernels? > Please try to narrow down the problem to a specific kernel version. > } > > Don't know about 2.6.0-2.6.9, but 2.4.31 is ok. 2.4 -> 2.6 means zillions of changes. > Bartlomiej, > When you compare 2.4.31 with 2.6.12 don't you see this problem on your > machine? Unfortunately I've never encountered this problem on any machine. > If you have a fast system the slowdown won't show, but your IOWAIT will be > higher anyway! AFAIK high iowait is a known block layer problem > It feels like running on PIO instead of DMA. ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-04 20:32 ` Al Boldi 2005-07-04 20:47 ` Bartlomiej Zolnierkiewicz @ 2005-07-04 23:25 ` André Tomt 2005-07-05 10:01 ` Ondrej Zary 1 sibling, 1 reply; 67+ messages in thread From: André Tomt @ 2005-07-04 23:25 UTC (permalink / raw) To: Al Boldi Cc: 'Bartlomiej Zolnierkiewicz', 'Ondrej Zary', 'Linus Torvalds', linux-ide, linux-kernel Al Boldi wrote: > Bartlomiej Zolnierkiewicz wrote: { > >>>>On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: >>>>Hdparm -tT gives 38mb/s in 2.4.31 >>>>Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle >>>> >>>>Hdparm -tT gives 28mb/s in 2.6.12 >>>>Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT The "hdparm doesn't get as high scores as in 2.4" is a old discussed to death "problem" on LKML. So far nobody has been able to show it affects anything but that pretty useless quasi-benchmark. >>>>It feels like DMA is not being applied properly in 2.6.12. >>> >>>Same on 2.6.10,11,12. >>>No errors though, only sluggish system. Really sluggish or just "benchmark-sluggish"? If the former, try selecting a different IO elevator/sheduler. If the latter it doesn't matter much, at least not with the very simple hdparm test :-) >> >> What about earlier kernels? >> Please try to narrow down the problem to a specific kernel version. >> } > > Don't know about 2.6.0-2.6.9, but 2.4.31 is ok. > > Bartlomiej, > When you compare 2.4.31 with 2.6.12 don't you see this problem on your > machine? > If you have a fast system the slowdown won't show, but your IOWAIT will be > higher anyway! Nothing wrong with 73% iowait, I'd even consider it very low while putting load on a harddrive. Its just time spent waiting for data to be returned from disk, and thus I usually expect no lower than ~98-99% while stressing any disk. Harddisks are _slow as snails_ compared to cpu cycles ;-) Beware 2.4 didn't export that statistic at all to userspace, so 0% iowait gets reported from most 2.6-ready reporting tools on 2.4. ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-04 23:25 ` André Tomt @ 2005-07-05 10:01 ` Ondrej Zary 2005-07-05 10:14 ` Jens Axboe 0 siblings, 1 reply; 67+ messages in thread From: Ondrej Zary @ 2005-07-05 10:01 UTC (permalink / raw) To: André Tomt Cc: Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel André Tomt wrote: > Al Boldi wrote: > >> Bartlomiej Zolnierkiewicz wrote: { >> >>>>> On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: >>>>> Hdparm -tT gives 38mb/s in 2.4.31 >>>>> Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle >>>>> >>>>> Hdparm -tT gives 28mb/s in 2.6.12 >>>>> Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT > > > The "hdparm doesn't get as high scores as in 2.4" is a old discussed to > death "problem" on LKML. So far nobody has been able to show it affects > anything but that pretty useless quasi-benchmark. > No, it's not a problem with hdparm. hdparm only shows that there is _really_ a problem: 2.6.12 root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 count=1048576 1048576+0 records in 1048576+0 records out real 0m32.339s user 0m1.500s sys 0m14.560s 2.4.26 root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 count=1048576 1048576+0 records in 1048576+0 records out real 0m23.858s user 0m1.750s sys 0m15.180s -- Ondrej Zary ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 10:01 ` Ondrej Zary @ 2005-07-05 10:14 ` Jens Axboe 2005-07-05 10:19 ` Ondrej Zary 0 siblings, 1 reply; 67+ messages in thread From: Jens Axboe @ 2005-07-05 10:14 UTC (permalink / raw) To: Ondrej Zary Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel On Tue, Jul 05 2005, Ondrej Zary wrote: > André Tomt wrote: > >Al Boldi wrote: > > > >>Bartlomiej Zolnierkiewicz wrote: { > >> > >>>>>On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: > >>>>>Hdparm -tT gives 38mb/s in 2.4.31 > >>>>>Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle > >>>>> > >>>>>Hdparm -tT gives 28mb/s in 2.6.12 > >>>>>Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT > > > > > >The "hdparm doesn't get as high scores as in 2.4" is a old discussed to > >death "problem" on LKML. So far nobody has been able to show it affects > >anything but that pretty useless quasi-benchmark. > > > > No, it's not a problem with hdparm. hdparm only shows that there is > _really_ a problem: > > 2.6.12 > root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 > count=1048576 > 1048576+0 records in > 1048576+0 records out > > real 0m32.339s > user 0m1.500s > sys 0m14.560s > > 2.4.26 > root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 > count=1048576 > 1048576+0 records in > 1048576+0 records out > > real 0m23.858s > user 0m1.750s > sys 0m15.180s Perhaps some read-ahead bug. What happens if you use bs=128k for instance? -- Jens Axboe ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 10:14 ` Jens Axboe @ 2005-07-05 10:19 ` Ondrej Zary 2005-07-05 10:42 ` Jens Axboe 2005-07-06 20:56 ` Bill Davidsen 0 siblings, 2 replies; 67+ messages in thread From: Ondrej Zary @ 2005-07-05 10:19 UTC (permalink / raw) To: Jens Axboe Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel Jens Axboe wrote: > On Tue, Jul 05 2005, Ondrej Zary wrote: > >>André Tomt wrote: >> >>>Al Boldi wrote: >>> >>> >>>>Bartlomiej Zolnierkiewicz wrote: { >>>> >>>> >>>>>>>On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: >>>>>>>Hdparm -tT gives 38mb/s in 2.4.31 >>>>>>>Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle >>>>>>> >>>>>>>Hdparm -tT gives 28mb/s in 2.6.12 >>>>>>>Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT >>> >>> >>>The "hdparm doesn't get as high scores as in 2.4" is a old discussed to >>>death "problem" on LKML. So far nobody has been able to show it affects >>>anything but that pretty useless quasi-benchmark. >>> >> >>No, it's not a problem with hdparm. hdparm only shows that there is >>_really_ a problem: >> >>2.6.12 >>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 >>count=1048576 >>1048576+0 records in >>1048576+0 records out >> >>real 0m32.339s >>user 0m1.500s >>sys 0m14.560s >> >>2.4.26 >>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 >>count=1048576 >>1048576+0 records in >>1048576+0 records out >> >>real 0m23.858s >>user 0m1.750s >>sys 0m15.180s > > > Perhaps some read-ahead bug. What happens if you use bs=128k for > instance? > Nothing - it's still the same. root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=128k count=4096 4096+0 records in 4096+0 records out real 0m32.832s user 0m0.040s sys 0m15.670s -- Ondrej Zary ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 10:19 ` Ondrej Zary @ 2005-07-05 10:42 ` Jens Axboe 2005-07-05 12:35 ` Ondrej Zary 2005-07-06 20:56 ` Bill Davidsen 1 sibling, 1 reply; 67+ messages in thread From: Jens Axboe @ 2005-07-05 10:42 UTC (permalink / raw) To: Ondrej Zary Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel On Tue, Jul 05 2005, Ondrej Zary wrote: > Jens Axboe wrote: > >On Tue, Jul 05 2005, Ondrej Zary wrote: > > > >>André Tomt wrote: > >> > >>>Al Boldi wrote: > >>> > >>> > >>>>Bartlomiej Zolnierkiewicz wrote: { > >>>> > >>>> > >>>>>>>On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: > >>>>>>>Hdparm -tT gives 38mb/s in 2.4.31 > >>>>>>>Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle > >>>>>>> > >>>>>>>Hdparm -tT gives 28mb/s in 2.6.12 > >>>>>>>Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT > >>> > >>> > >>>The "hdparm doesn't get as high scores as in 2.4" is a old discussed to > >>>death "problem" on LKML. So far nobody has been able to show it affects > >>>anything but that pretty useless quasi-benchmark. > >>> > >> > >>No, it's not a problem with hdparm. hdparm only shows that there is > >>_really_ a problem: > >> > >>2.6.12 > >>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 > >>count=1048576 > >>1048576+0 records in > >>1048576+0 records out > >> > >>real 0m32.339s > >>user 0m1.500s > >>sys 0m14.560s > >> > >>2.4.26 > >>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 > >>count=1048576 > >>1048576+0 records in > >>1048576+0 records out > >> > >>real 0m23.858s > >>user 0m1.750s > >>sys 0m15.180s > > > > > >Perhaps some read-ahead bug. What happens if you use bs=128k for > >instance? > > > Nothing - it's still the same. > > root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=128k > count=4096 > 4096+0 records in > 4096+0 records out > > real 0m32.832s > user 0m0.040s > sys 0m15.670s Can you post full dmesg of 2.4 and 2.6 kernel boot? What does hdparm -I/-i say for both kernels? -- Jens Axboe ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 10:42 ` Jens Axboe @ 2005-07-05 12:35 ` Ondrej Zary 2005-07-05 12:51 ` Jens Axboe 0 siblings, 1 reply; 67+ messages in thread From: Ondrej Zary @ 2005-07-05 12:35 UTC (permalink / raw) To: Jens Axboe Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel [-- Attachment #1: Type: text/plain, Size: 1983 bytes --] Jens Axboe wrote: > On Tue, Jul 05 2005, Ondrej Zary wrote: > >>Jens Axboe wrote: >> >>>On Tue, Jul 05 2005, Ondrej Zary wrote: >>> >>> >>>>André Tomt wrote: >>>> >>>> >>>>>Al Boldi wrote: >>>>> >>>>> >>>>> >>>>>>Bartlomiej Zolnierkiewicz wrote: { >>>>>> >>>>>> >>>>>> >>>>>>>>>On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: >>>>>>>>>Hdparm -tT gives 38mb/s in 2.4.31 >>>>>>>>>Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle >>>>>>>>> >>>>>>>>>Hdparm -tT gives 28mb/s in 2.6.12 >>>>>>>>>Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT >>>>> >>>>> >>>>>The "hdparm doesn't get as high scores as in 2.4" is a old discussed to >>>>>death "problem" on LKML. So far nobody has been able to show it affects >>>>>anything but that pretty useless quasi-benchmark. >>>>> >>>> >>>>No, it's not a problem with hdparm. hdparm only shows that there is >>>>_really_ a problem: >>>> >>>>2.6.12 >>>>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 >>>>count=1048576 >>>>1048576+0 records in >>>>1048576+0 records out >>>> >>>>real 0m32.339s >>>>user 0m1.500s >>>>sys 0m14.560s >>>> >>>>2.4.26 >>>>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 >>>>count=1048576 >>>>1048576+0 records in >>>>1048576+0 records out >>>> >>>>real 0m23.858s >>>>user 0m1.750s >>>>sys 0m15.180s >>> >>> >>>Perhaps some read-ahead bug. What happens if you use bs=128k for >>>instance? >>> >> >>Nothing - it's still the same. >> >>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=128k >>count=4096 >>4096+0 records in >>4096+0 records out >> >>real 0m32.832s >>user 0m0.040s >>sys 0m15.670s > > > Can you post full dmesg of 2.4 and 2.6 kernel boot? What does hdparm > -I/-i say for both kernels? > The 2.4.26 kernel is the one from Slackware 10.0 bootable install CD. dmesg outputs attached, hdparm -i and hdparm -I shows the same in both kernels (compared using diff) - attached too. -- Ondrej Zary [-- Attachment #2: dmesg2426.txt --] [-- Type: text/plain, Size: 5775 bytes --] Linux version 2.4.26 (root@tree) (gcc version 3.3.4) #6 Mon Jun 14 19:07:27 PDT 2004 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009fc00 (usable) BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 0000000007ff0000 (usable) BIOS-e820: 0000000007ff0000 - 0000000007ff3000 (ACPI NVS) BIOS-e820: 0000000007ff3000 - 0000000008000000 (ACPI data) BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved) 127MB LOWMEM available. On node 0 totalpages: 32752 zone(0): 4096 pages. zone(1): 28656 pages. zone(2): 0 pages. Kernel command line: BOOT_IMAGE=/kernels/bare.i/bzImage initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=bare.i Initializing CPU#0 Detected 225.001 MHz processor. Console: colour VGA+ 80x25 Calibrating delay loop... 448.92 BogoMIPS Memory: 123608k/131008k available (1844k kernel code, 7012k reserved, 618k data, 120k init, 0k highmem) Checking if this processor honours the WP bit even in supervisor mode... Ok. Dentry cache hash table entries: 16384 (order: 5, 131072 bytes) Inode cache hash table entries: 8192 (order: 4, 65536 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 4096 (order: 2, 16384 bytes) Page-cache hash table entries: 32768 (order: 5, 131072 bytes) CPU: After generic, caps: 0080a135 00000000 00000000 00000004 CPU: Common caps: 0080a135 00000000 00000000 00000004 CPU: Cyrix M II 3x Core/Bus Clock stepping 04 Checking 'hlt' instruction... OK. POSIX conformance testing by UNIFIX mtrr: v1.40 (20010327) Richard Gooch (rgooch@atnf.csiro.au) mtrr: detected mtrr type: Cyrix ARR PCI: PCI BIOS revision 2.10 entry at 0xfb020, last bus=0 PCI: Using configuration type 1 PCI: Probing PCI hardware PCI: Probing PCI hardware (bus 00) PCI: Using IRQ router PIIX/ICH [8086/7110] at 00:07.0 PCI: Device 00:3a not found by BIOS PCI: Device 00:3b not found by BIOS Limiting direct PCI/PCI transfers. Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd VFS: Disk quotas vdquot_6.5.1 Journalled Block Device driver loaded pty: 512 Unix98 ptys configured Serial driver version 5.05c (2001-07-08) with HUB-6 MANY_PORTS MULTIPORT SHARE_IRQ SERIAL_PCI enabled ttyS00 at 0x03f8 (irq = 4) is a 16550A ttyS01 at 0x02f8 (irq = 3) is a 16550A Real Time Clock Driver v1.10f Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 RAMDISK driver initialized: 16 RAM disks of 6464K size 1024 blocksize loop: loaded (max 8 devices) Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx PIIX4: IDE controller at PCI slot 00:07.1 PIIX4: chipset revision 1 PIIX4: not 100% native mode: will probe irqs later ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:pio, hdb:pio ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:pio hda: WDC WD300BB-00AUA1, ATA DISK drive blk: queue c03b3360, I/O limit 4095Mb (mask 0xffffffff) hdd: MSI CD-RW MS-8340S, ATAPI CD/DVD-ROM drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 ide1 at 0x170-0x177,0x376 on irq 15 hda: attached ide-disk driver. hda: host protected area => 1 hda: 58633344 sectors (30020 MB) w/2048KiB Cache, CHS=3649/255/63, UDMA(33) hdd: attached ide-cdrom driver. hdd: ATAPI 48X CD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33) Uniform CD-ROM driver Revision: 3.12 Partition check: hda: hda2 hda3 < hda5 hda6 hda7 > SCSI subsystem driver Revision: 1.00 kmod: failed to exec /sbin/modprobe -s -k scsi_hostadapter, errno = 2 kmod: failed to exec /sbin/modprobe -s -k scsi_hostadapter, errno = 2 kmod: failed to exec /sbin/modprobe -s -k scsi_hostadapter, errno = 2 md: linear personality registered as nr 1 md: raid0 personality registered as nr 2 md: raid1 personality registered as nr 3 md: raid5 personality registered as nr 4 raid5: measuring checksumming speed 8regs : 319.600 MB/sec 32regs : 228.800 MB/sec pII_mmx : 334.800 MB/sec p5_mmx : 380.800 MB/sec raid5: using function: p5_mmx (380.800 MB/sec) md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27 md: Autodetecting RAID arrays. md: autorun ... md: ... autorun DONE. LVM version 1.0.8(17/11/2003) Initializing Cryptographic API NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP, IGMP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 8192 bind 16384) Linux IP multicast router 0.06 plus PIM-SM NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. RAMDISK: Compressed image found at block 0 Freeing initrd memory: 2607k freed EXT2-fs warning: checktime reached, running e2fsck is recommended VFS: Mounted root (ext2 filesystem). Freeing unused kernel memory: 120k freed usb.c: registered new driver usbdevfs usb.c: registered new driver hub uhci.c: USB Universal Host Controller Interface driver v1.1 PCI: Found IRQ 11 for device 00:07.2 uhci.c: USB UHCI at I/O 0x6400, IRQ 11 usb.c: new USB bus registered, assigned bus number 1 hub.c: USB hub found hub.c: 2 ports detected usb.c: registered new driver usbkbd usbkbd.c: :USB HID Boot Protocol keyboard driver usb.c: registered new driver hiddev usb.c: registered new driver hid hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz> hid-core.c: USB HID support drivers mice: PS/2 mouse device common for all mice Initializing USB Mass Storage driver... usb.c: registered new driver usb-storage USB Mass Storage support registered. kjournald starting. Commit interval 5 seconds EXT3 FS 2.4-0.9.19, 19 August 2002 on ide0(3,6), internal journal EXT3-fs: mounted filesystem with ordered data mode. [-- Attachment #3: dmesg2612.txt --] [-- Type: text/plain, Size: 8344 bytes --] Linux version 2.6.12-pentium (root@pentium) (gcc version 3.3.5) #3 Sun Jul 3 11:27:42 CEST 2005 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009fc00 (usable) BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 0000000007ff0000 (usable) BIOS-e820: 0000000007ff0000 - 0000000007ff3000 (ACPI NVS) BIOS-e820: 0000000007ff3000 - 0000000008000000 (ACPI data) BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved) 127MB LOWMEM available. On node 0 totalpages: 32752 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 28656 pages, LIFO batch:15 HighMem zone: 0 pages, LIFO batch:1 DMI 2.0 present. ACPI: RSDP (v000 123456 ) @ 0x000f6c40 ACPI: RSDT (v001 123456 AWRDACPI 0x00000000 0x00000000) @ 0x07ff3000 ACPI: FADT (v001 123456 AWRDACPI 0x00000000 0x00000000) @ 0x07ff3040 ACPI: DSDT (v001 123456 AWRDACPI 0x00001000 MSFT 0x01000007) @ 0x00000000 Allocating PCI resources starting at 08000000 (gap: 08000000:f7ff0000) Built 1 zonelists Kernel command line: auto BOOT_IMAGE=Linux2612 ro root=306 video=matroxfb:vesa:0x105,fv:85,left:192 Initializing CPU#0 PID hash table entries: 512 (order: 9, 8192 bytes) Detected 225.009 MHz processor. Using tsc for high-res timesource Console: colour VGA+ 80x25 Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) Inode-cache hash table entries: 16384 (order: 4, 65536 bytes) Memory: 125792k/131008k available (2078k kernel code, 4696k reserved, 944k data, 148k init, 0k highmem) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay loop... 448.92 BogoMIPS (lpj=2244608) Mount-cache hash table entries: 512 CPU: After generic identify, caps: 0080a135 00000000 00000000 00000000 00000000 00000000 00000000 CPU: After vendor identify, caps: 0080a135 00000000 00000000 00000000 00000000 00000000 00000000 CPU: After all inits, caps: 0080a135 00000000 00000000 00000004 00000000 00000000 00000000 CPU: Cyrix M II 3x Core/Bus Clock stepping 04 Checking 'hlt' instruction... OK. ACPI: setting ELCR to 0200 (from 0a00) NET: Registered protocol family 16 PCI: Using configuration type 1 mtrr: v2.0 (20020519) ACPI: Subsystem revision 20050309 ACPI-0216: *** Error: Return object type is incorrect [\_SB_.PCI0.ISA_.UAR1._PRW] (Node c1137fa0), AE_TYPE ACPI-0216: *** Error: Return object type is incorrect [\_SB_.PCI0.ISA_.UAR2._PRW] (Node c1137e80), AE_TYPE ACPI-0216: *** Error: Return object type is incorrect [\_SB_.PCI0.ISA_.LPT_._PRW] (Node c1137ca0), AE_TYPE ACPI: Interpreter enabled ACPI: Using PIC for interrupt routing ACPI: PCI Root Bridge [PCI0] (0000:00) PCI: Probing PCI hardware (bus 00) Boot video device is 0000:00:14.0 ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 11 12 14 15) *9 ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled. ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled. ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 10 *11 12 14 15) ACPI: Power Resource [PFAN] (on) Linux Plug and Play Support v0.97 (c) Adam Belay pnp: PnP ACPI init pnp: PnP ACPI: found 13 devices PnPBIOS: Disabled by ACPI PNP SCSI subsystem initialized usbcore: registered new driver usbfs usbcore: registered new driver hub PCI: Using ACPI for IRQ routing PCI: If a device doesn't work, try "pci=routeirq". If it helps, post a report Limiting direct PCI/PCI transfers. ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 11 PCI: setting IRQ 11 as level-triggered ACPI: PCI Interrupt 0000:00:14.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11 matroxfb: Matrox Mystique (PCI) detected matroxfb: MTRR's turned on matroxfb: 1024x768x8bpp (virtual: 1024x4096) matroxfb: framebuffer at 0xE1000000, mapped to 0xc8880000, size 4194304 Console: switching to colour frame buffer device 128x48 fb0: MATROX frame buffer device ACPI: Power Button (FF) [PWRF] ACPI: Fan [FAN] (on) ACPI: CPU0 (power states: C1[C1] C2[C2]) ACPI: Thermal Zone [THRM] (22 C) isapnp: Scanning for PnP cards... pnp: CMI8330 quirk - fixing interrupts and dma isapnp: Card 'AD-CHIPS Audio Adapter' isapnp: Card '3Com 3C509B EtherLink III' isapnp: 2 Plug & Play cards detected total lp: driver loaded but no devices found Real Time Clock Driver v1.12 Non-volatile memory driver v1.2 PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12 serio: i8042 AUX port at 0x60,0x64 irq 12 serio: i8042 KBD port at 0x60,0x64 irq 1 Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A parport: PnPBIOS parport detected. parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE,EPP] lp0: using parport0 (interrupt-driven). io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 loop: loaded (max 8 devices) Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx PIIX4: IDE controller at PCI slot 0000:00:07.1 PIIX4: chipset revision 1 PIIX4: not 100% native mode: will probe irqs later ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:pio, hdb:pio ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:pio Probing IDE interface ide0... hda: WDC WD300BB-00AUA1, ATA DISK drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 Probing IDE interface ide1... hdd: MSI CD-RW MS-8340S, ATAPI CD/DVD-ROM drive ide1 at 0x170-0x177,0x376 on irq 15 Probing IDE interface ide2... Probing IDE interface ide3... Probing IDE interface ide4... Probing IDE interface ide5... hda: max request size: 128KiB hda: 58633344 sectors (30020 MB) w/2048KiB Cache, CHS=58168/16/63, UDMA(33) hda: cache flushes not supported hda: hda2 hda3 < hda5 hda6 hda7 > hdd: ATAPI 48X CD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33) Uniform CD-ROM driver Revision: 3.20 usbmon: debugs is not available USB Universal Host Controller Interface driver v2.2 ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11 ACPI: PCI Interrupt 0000:00:07.2[D] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11 uhci_hcd 0000:00:07.2: Intel Corporation 82371AB/EB/MB PIIX4 USB uhci_hcd 0000:00:07.2: new USB bus registered, assigned bus number 1 uhci_hcd 0000:00:07.2: irq 11, io base 0x00006400 hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected Initializing USB Mass Storage driver... usbcore: registered new driver usb-storage USB Mass Storage support registered. pnp: Device 01:01.02 activated. gameport: NS558 PnP Gameport is pnp01:01.02/gameport0, io 0x200, speed 917kHz mice: PS/2 mouse device common for all mice input: PC Speaker i2c /dev entries driver piix4_smbus 0000:00:07.3: Found 0000:00:07.3 device input: AT Translated Set 2 keyboard on isa0060/serio0 Advanced Linux Sound Architecture Driver Version 1.0.9rc2 (Thu Mar 24 10:33:39 2005 UTC). ALSA device list: No soundcards found. NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP established hash table entries: 8192 (order: 4, 65536 bytes) TCP bind hash table entries: 8192 (order: 3, 32768 bytes) TCP: Hash tables configured (established 8192 bind 8192) NET: Registered protocol family 1 NET: Registered protocol family 17 input: ImPS/2 Generic Wheel Mouse on isa0060/serio1 EXT3-fs: mounted filesystem with ordered data mode. VFS: Mounted root (ext3 filesystem) readonly. Freeing unused kernel memory: 148k freed kjournald starting. Commit interval 5 seconds Adding 128480k swap on /dev/hda7. Priority:-1 extents:1 EXT3 FS on hda6, internal journal eth0: 3c5x9 found at 0x300, BNC port, address 00 20 af 49 ed b0, IRQ 10. 3c509.c:1.19b 08Nov2002 becker@scyld.com http://www.scyld.com/network/3c509.html eth0: Setting Rx mode to 1 addresses. EXT3 FS on loop0, internal journal EXT3-fs: mounted filesystem with ordered data mode. kjournald starting. Commit interval 5 seconds mtrr: 0xe1000000,0x800000 overlaps existing 0xe1000000,0x400000 init_special_inode: bogus i_mode (5102) [-- Attachment #4: hdparmi2612.txt --] [-- Type: text/plain, Size: 652 bytes --] /dev/hda: Model=WDC WD300BB-00AUA1, FwRev=18.20D18, SerialNo=WD-WMA6W1847372 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq } RawCHS=16383/16/63, TrkSize=57600, SectSize=600, ECCbytes=40 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=16 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=58633344 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio1 pio2 pio3 pio4 DMA modes: mdma0 mdma1 mdma2 UDMA modes: udma0 udma1 *udma2 AdvancedPM=no WriteCache=enabled Drive conforms to: device does not report version: * signifies the current active mode [-- Attachment #5: hdparmI2612.txt --] [-- Type: text/plain, Size: 1536 bytes --] /dev/hda: ATA device, with non-removable media Model Number: WDC WD300BB-00AUA1 Serial Number: WD-WMA6W1847372 Firmware Revision: 18.20D18 Standards: Supported: 5 4 3 2 Likely used: 6 Configuration: Logical max current cylinders 16383 16383 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16514064 LBA user addressable sectors: 58633344 device size with M = 1024*1024: 28629 MBytes device size with M = 1000*1000: 30020 MBytes (30 GB) Capabilities: LBA, IORDY(can be disabled) bytes avail on r/w long: 40 Queue depth: 1 Standby timer values: spec'd by Standard, with device specific minimum R/W multiple sector transfer: Max = 16 Current = 16 Recommended acoustic management value: 128, current value: 254 DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 Cycle time: min=120ns recommended=120ns PIO: pio0 pio1 pio2 pio3 pio4 Cycle time: no flow control=120ns IORDY flow control=120ns Commands/features: Enabled Supported: * READ BUFFER cmd * WRITE BUFFER cmd * Host Protected Area feature set * Look-ahead * Write cache * Power Management feature set Security Mode feature set * SMART feature set Automatic Acoustic Management feature set SET MAX security extension * DOWNLOAD MICROCODE cmd Security: supported not enabled not locked not frozen not expired: security count not supported: enhanced erase HW reset results: CBLID- above Vih Device num = 0 determined by the jumper ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 12:35 ` Ondrej Zary @ 2005-07-05 12:51 ` Jens Axboe 2005-07-05 13:02 ` Ondrej Zary 0 siblings, 1 reply; 67+ messages in thread From: Jens Axboe @ 2005-07-05 12:51 UTC (permalink / raw) To: Ondrej Zary Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel On Tue, 2005-07-05 at 14:35 +0200, Ondrej Zary wrote: > >>>>2.4.26 > >>>>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 > >>>>count=1048576 > >>>>1048576+0 records in > >>>>1048576+0 records out > >>>> > >>>>real 0m23.858s > >>>>user 0m1.750s > >>>>sys 0m15.180s > >>> > >>> > >>>Perhaps some read-ahead bug. What happens if you use bs=128k for > >>>instance? > >>> > >> > >>Nothing - it's still the same. > >> > >>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=128k > >>count=4096 > >>4096+0 records in > >>4096+0 records out > >> > >>real 0m32.832s > >>user 0m0.040s > >>sys 0m15.670s > > > > > > Can you post full dmesg of 2.4 and 2.6 kernel boot? What does hdparm > > -I/-i say for both kernels? > > > > The 2.4.26 kernel is the one from Slackware 10.0 bootable install CD. > dmesg outputs attached, hdparm -i and hdparm -I shows the same in both > kernels (compared using diff) - attached too. Ok, looks alright for both. Your machine is quite slow, perhaps that is showing the slower performance. Can you try and make HZ 100 in 2.6 and test again? 2.6.13-recent has it as a config option, otherwise edit include/asm/param.h appropriately. -- Jens Axboe <axboe@suse.de> ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 12:51 ` Jens Axboe @ 2005-07-05 13:02 ` Ondrej Zary 2005-07-05 13:11 ` Jens Axboe 0 siblings, 1 reply; 67+ messages in thread From: Ondrej Zary @ 2005-07-05 13:02 UTC (permalink / raw) To: Jens Axboe Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel Jens Axboe wrote: > On Tue, 2005-07-05 at 14:35 +0200, Ondrej Zary wrote: > >>>>>>2.4.26 >>>>>>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 >>>>>>count=1048576 >>>>>>1048576+0 records in >>>>>>1048576+0 records out >>>>>> >>>>>>real 0m23.858s >>>>>>user 0m1.750s >>>>>>sys 0m15.180s >>>>> >>>>> >>>>>Perhaps some read-ahead bug. What happens if you use bs=128k for >>>>>instance? >>>>> >>>> >>>>Nothing - it's still the same. >>>> >>>>root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=128k >>>>count=4096 >>>>4096+0 records in >>>>4096+0 records out >>>> >>>>real 0m32.832s >>>>user 0m0.040s >>>>sys 0m15.670s >>> >>> >>>Can you post full dmesg of 2.4 and 2.6 kernel boot? What does hdparm >>>-I/-i say for both kernels? >>> >> >>The 2.4.26 kernel is the one from Slackware 10.0 bootable install CD. >>dmesg outputs attached, hdparm -i and hdparm -I shows the same in both >>kernels (compared using diff) - attached too. > > > Ok, looks alright for both. Your machine is quite slow, perhaps that is > showing the slower performance. Can you try and make HZ 100 in 2.6 and > test again? 2.6.13-recent has it as a config option, otherwise edit > include/asm/param.h appropriately. > I forgot to write that my 2.6.12 kernel is already compiled with HZ 100 (it makes the system more responsive). I've just tried 2.6.8.1 with HZ 1000 and there is no difference in HDD performance comparing to 2.6.12. -- Ondrej Zary ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 13:02 ` Ondrej Zary @ 2005-07-05 13:11 ` Jens Axboe 2005-07-05 15:51 ` Ondrej Zary 0 siblings, 1 reply; 67+ messages in thread From: Jens Axboe @ 2005-07-05 13:11 UTC (permalink / raw) To: Ondrej Zary Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel On Tue, 2005-07-05 at 15:02 +0200, Ondrej Zary wrote: > > Ok, looks alright for both. Your machine is quite slow, perhaps that is > > showing the slower performance. Can you try and make HZ 100 in 2.6 and > > test again? 2.6.13-recent has it as a config option, otherwise edit > > include/asm/param.h appropriately. > > > > I forgot to write that my 2.6.12 kernel is already compiled with HZ 100 > (it makes the system more responsive). > I've just tried 2.6.8.1 with HZ 1000 and there is no difference in HDD > performance comparing to 2.6.12. OK, interesting. You could try and boot with profile=2 and do # readprofile -r # dd if=/dev/hda of=/dev/null bs=128k # readprofile > prof_output for each kernel and post it here, so we can see if anything sticks out. -- Jens Axboe <axboe@suse.de> ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 13:11 ` Jens Axboe @ 2005-07-05 15:51 ` Ondrej Zary 2005-07-05 14:21 ` Jens Axboe 0 siblings, 1 reply; 67+ messages in thread From: Ondrej Zary @ 2005-07-05 15:51 UTC (permalink / raw) To: Jens Axboe Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel [-- Attachment #1: Type: text/plain, Size: 966 bytes --] Jens Axboe wrote: > On Tue, 2005-07-05 at 15:02 +0200, Ondrej Zary wrote: > >>>Ok, looks alright for both. Your machine is quite slow, perhaps that is >>>showing the slower performance. Can you try and make HZ 100 in 2.6 and >>>test again? 2.6.13-recent has it as a config option, otherwise edit >>>include/asm/param.h appropriately. >>> >> >>I forgot to write that my 2.6.12 kernel is already compiled with HZ 100 >>(it makes the system more responsive). >>I've just tried 2.6.8.1 with HZ 1000 and there is no difference in HDD >>performance comparing to 2.6.12. > > > OK, interesting. You could try and boot with profile=2 and do > > # readprofile -r > # dd if=/dev/hda of=/dev/null bs=128k > # readprofile > prof_output > > for each kernel and post it here, so we can see if anything sticks out. > Here are the profiles (used dd with count=4096) from 2.4.26 and 2.6.12 (nothing from 2.6.8.1 because I don't have the .map file anymore). -- Ondrej Zary [-- Attachment #2: profile2426.txt --] [-- Type: text/plain, Size: 4121 bytes --] 448 default_idle 5.6000 4 __switch_to 0.0192 1 ret_from_sys_call 0.0588 3 handle_IRQ_event 0.0268 6 schedule 0.0072 8 __wake_up 0.0833 2 __constant_memcpy 0.0078 4 add_page_to_hash_queue 0.0625 2 __remove_inode_page 0.0156 6 add_to_page_cache_unique 0.0375 7 page_cache_read 0.0398 2 unlock_page 0.0179 7 generic_file_readahead 0.0168 11 do_generic_file_read 0.0101 1366 file_read_actor 8.5375 2 generic_file_read 0.0048 1 kmem_slab_destroy 0.0042 3 kmem_cache_grow 0.0057 2 kmem_cache_alloc 0.0625 28 kmem_cache_free 0.8750 2 kmem_cache_reap 0.0042 12 __kmem_cache_alloc 0.0536 4 lru_cache_add 0.0357 1 __lru_cache_del 0.0078 3 delta_nr_inactive_pages 0.0312 5 delta_nr_cache_pages 0.0521 17 shrink_cache 0.0180 1 refill_inactive 0.0031 16 __free_pages_ok 0.0200 20 rmqueue 0.0284 6 __alloc_pages 0.0091 1 __free_pages 0.0208 3 sys_read 0.0117 1 sys_write 0.0039 5 __remove_from_lru_list 0.0391 3 __remove_from_queues 0.0625 7 __put_unused_buffer_head 0.0729 3 get_unused_buffer_head 0.0234 24 set_bh_page 0.2143 32 create_buffers 0.1429 4 try_to_release_page 0.0500 4 create_empty_buffers 0.0417 24 block_read_full_page 0.0375 27 try_to_free_buffers 0.1055 10 max_block 0.0694 9 blkdev_get_block 0.1406 2 blkdev_direct_IO 0.0417 1 blkdev_readpage 0.0312 2 init_buffer_head 0.0312 25 __constant_c_and_count_memset 0.1736 2 write_profile 0.0417 114 __make_request 0.0642 27 generic_make_request 0.0844 25 submit_bh 0.0977 5 ide_inb 0.3125 7 ide_outb 0.4375 2 ide_outl 0.1250 1 ide_execute_command 0.0078 2 SELECT_DRIVE 0.0312 4 ide_start_request 0.0083 2 ide_do_request 0.0050 2 ide_get_queue 0.0312 4 ide_intr 0.0139 6 ide_dma_intr 0.0312 30 ide_build_sglist 0.0481 5 ide_build_dmatable 0.0120 1 __ide_dma_read 0.0042 1 __ide_dma_count 0.0312 3 __constant_c_and_count_memset 0.0208 67 idedisk_end_request 0.3490 2 __generic_copy_to_user 0.0312 0 *unknown* 2499 total 0.0013 [-- Attachment #3: profile2612.txt --] [-- Type: text/plain, Size: 5090 bytes --] 1 cpu_idle 0.0104 1 system_call 0.0200 1 __wake_up 0.0125 1 copy_mm 0.0011 1 profile_hit 0.0156 2 write_profile 0.0312 1 current_fs_time 0.0104 1 timespec_trunc 0.0156 1 __wake_up_bit 0.0208 5 handle_IRQ_event 0.0521 12 add_to_page_cache 0.0833 1 page_waitqueue 0.0156 2 __lock_page 0.0125 16 find_get_page 0.2500 7 do_generic_mapping_read 0.0049 8 file_read_actor 0.0312 2 __generic_file_aio_read 0.0038 1 generic_file_read 0.0052 9 mempool_alloc 0.0331 2 mempool_alloc_slab 0.1250 3 bad_range 0.0375 21 free_hot_cold_page 0.0772 22 buffered_rmqueue 0.0458 5 zone_watermark_ok 0.0284 5 __alloc_pages 0.0053 1 __read_page_state 0.0625 6 __mod_page_state 0.3750 1 get_dirty_limits 0.0048 4 test_clear_page_dirty 0.0179 2 read_pages 0.0074 11 __do_page_cache_readahead 0.0312 2 blockable_page_cache_readahead 0.0125 1 page_cache_readahead 0.0030 20 kmem_cache_alloc 0.4167 8 kmem_cache_free 0.1667 1 release_pages 0.0025 1 __pagevec_lru_add 0.0039 2 shrink_slab 0.0054 1 pageout 0.0037 43 shrink_list 0.0401 6 shrink_cache 0.0080 1 refill_inactive_zone 0.0009 2 balance_pgdat 0.0024 2 blk_queue_bounce 0.0312 1 unmap_vmas 0.0018 3 page_referenced 0.0234 1 rw_verify_area 0.0078 1 vfs_read 0.0045 1 vfs_write 0.0045 1 __clear_page_buffers 0.0156 5 alloc_page_buffers 0.0347 2 try_to_release_page 0.0312 12 create_empty_buffers 0.0833 14 block_read_full_page 0.0219 4 submit_bh 0.0147 7 drop_buffers 0.0486 7 try_to_free_buffers 0.0486 1 block_sync_page 0.0156 2 recalc_bh_state 0.0312 2 alloc_buffer_head 0.0250 1 free_buffer_head 0.0125 8 bio_alloc_bioset 0.0179 2 bio_put 0.0417 3 max_block 0.0268 2 blkdev_get_block 0.0312 2 blkdev_readpage 0.1250 2 update_atime 0.0114 1 __mark_inode_dirty 0.0024 2 mb_cache_shrink_fn 0.0043 1 radix_tree_preload 0.0063 998 __copy_to_user_ll 15.5938 1216 acpi_processor_idle 2.0033 9 blk_rq_map_sg 0.0256 3 get_request 0.0043 72 __make_request 0.0616 8 generic_make_request 0.0179 3 submit_bio 0.0170 61 ide_end_request 0.4236 1 start_request 0.0020 5 ide_do_request 0.0060 2 ide_intr 0.0052 2 ide_inb 0.1250 5 ide_outb 0.3125 1 ide_execute_command 0.0063 3 ide_build_sglist 0.0208 2 ide_build_dmatable 0.0066 1 ide_do_rw_disk 0.0089 8 schedule 0.0053 0 *unknown* 2734 total 0.0013 ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 15:51 ` Ondrej Zary @ 2005-07-05 14:21 ` Jens Axboe 2005-07-05 15:00 ` Ondrej Zary ` (2 more replies) 0 siblings, 3 replies; 67+ messages in thread From: Jens Axboe @ 2005-07-05 14:21 UTC (permalink / raw) To: Ondrej Zary Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel [-- Attachment #1: Type: text/plain, Size: 1261 bytes --] On Tue, Jul 05 2005, Ondrej Zary wrote: > Jens Axboe wrote: > >On Tue, 2005-07-05 at 15:02 +0200, Ondrej Zary wrote: > > > >>>Ok, looks alright for both. Your machine is quite slow, perhaps that is > >>>showing the slower performance. Can you try and make HZ 100 in 2.6 and > >>>test again? 2.6.13-recent has it as a config option, otherwise edit > >>>include/asm/param.h appropriately. > >>> > >> > >>I forgot to write that my 2.6.12 kernel is already compiled with HZ 100 > >>(it makes the system more responsive). > >>I've just tried 2.6.8.1 with HZ 1000 and there is no difference in HDD > >>performance comparing to 2.6.12. > > > > > >OK, interesting. You could try and boot with profile=2 and do > > > ># readprofile -r > ># dd if=/dev/hda of=/dev/null bs=128k > ># readprofile > prof_output > > > >for each kernel and post it here, so we can see if anything sticks out. > > > Here are the profiles (used dd with count=4096) from 2.4.26 and 2.6.12 > (nothing from 2.6.8.1 because I don't have the .map file anymore). Looks interesting, 2.6 spends oodles of times copying to user space. Lets check if raw reads perform ok, please try and time this app in 2.4 and 2.6 as well. # gcc -Wall -O2 -o oread oread.c # time ./oread /dev/hda -- Jens Axboe [-- Attachment #2: oread.c --] [-- Type: text/plain, Size: 644 bytes --] #include <stdio.h> #include <unistd.h> #define __USE_GNU #include <fcntl.h> #include <stdlib.h> #define BS (131072) #define BLOCKS (4096) #define ALIGN(buf) (char *) (((unsigned long) (buf) + 4095) & ~(4095)) int main(int argc, char *argv[]) { char *buffer; int fd, i; if (argc < 2) { printf("%s: <device>\n", argv[0]); return 1; } fd = open(argv[1], O_RDONLY | O_DIRECT); if (fd == -1) { perror("open"); return 2; } buffer = ALIGN(malloc(BS + 4095)); for (i = 0; i < BLOCKS; i++) { int ret = read(fd, buffer, BS); if (!ret) break; else if (ret < 0) { perror("read infile"); break; } } return 0; } ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 14:21 ` Jens Axboe @ 2005-07-05 15:00 ` Ondrej Zary 2005-07-05 19:18 ` Jens Axboe 2005-07-05 19:25 ` Jens Axboe 2005-07-05 17:27 ` Linus Torvalds 2005-07-06 0:35 ` Grant Coady 2 siblings, 2 replies; 67+ messages in thread From: Ondrej Zary @ 2005-07-05 15:00 UTC (permalink / raw) To: Jens Axboe Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel [-- Attachment #1: Type: text/plain, Size: 1664 bytes --] Jens Axboe wrote: > On Tue, Jul 05 2005, Ondrej Zary wrote: > >>Jens Axboe wrote: >> >>>On Tue, 2005-07-05 at 15:02 +0200, Ondrej Zary wrote: >>> >>> >>>>>Ok, looks alright for both. Your machine is quite slow, perhaps that is >>>>>showing the slower performance. Can you try and make HZ 100 in 2.6 and >>>>>test again? 2.6.13-recent has it as a config option, otherwise edit >>>>>include/asm/param.h appropriately. >>>>> >>>> >>>>I forgot to write that my 2.6.12 kernel is already compiled with HZ 100 >>>>(it makes the system more responsive). >>>>I've just tried 2.6.8.1 with HZ 1000 and there is no difference in HDD >>>>performance comparing to 2.6.12. >>> >>> >>>OK, interesting. You could try and boot with profile=2 and do >>> >>># readprofile -r >>># dd if=/dev/hda of=/dev/null bs=128k >>># readprofile > prof_output >>> >>>for each kernel and post it here, so we can see if anything sticks out. >>> >> >>Here are the profiles (used dd with count=4096) from 2.4.26 and 2.6.12 >>(nothing from 2.6.8.1 because I don't have the .map file anymore). > > > Looks interesting, 2.6 spends oodles of times copying to user space. > Lets check if raw reads perform ok, please try and time this app in 2.4 > and 2.6 as well. > > # gcc -Wall -O2 -o oread oread.c > # time ./oread /dev/hda > oread is faster than dd, but still not as fast as 2.4. In 2.6.12, HDD led is blinking, in 2.4 it's solid on during the read. 2.6.12: root@pentium:/home/rainbow# time ./oread /dev/hda real 0m25.082s user 0m0.000s sys 0m0.680s 2.4.26: root@pentium:/home/rainbow# time ./oread /dev/hda real 0m23.513s user 0m0.000s sys 0m2.360s -- Ondrej Zary [-- Attachment #2: profile-oread2426.txt --] [-- Type: text/plain, Size: 2354 bytes --] 2016 default_idle 25.2000 1 system_call 0.0156 2 handle_IRQ_event 0.0179 1 schedule 0.0012 1 __run_task_queue 0.0104 4 follow_page 0.0312 3 get_user_pages 0.0063 4 mark_dirty_kiobuf 0.0357 1 handle_mm_fault 0.0048 2 generic_file_direct_IO 0.0026 1 lru_cache_add 0.0089 2 init_buffer 0.0625 12 set_bh_page 0.1071 3 create_buffers 0.0134 30 generic_direct_IO 0.0457 17 brw_kiovec 0.0186 11 max_block 0.0764 9 blkdev_get_block 0.1406 2 blkdev_direct_IO 0.0417 1 write_profile 0.0208 2 generic_unplug_device 0.0312 93 __make_request 0.0524 25 generic_make_request 0.0781 20 submit_bh 0.0781 5 ide_inb 0.3125 12 ide_outb 0.7500 1 ide_outl 0.0625 1 ide_wait_stat 0.0030 4 ide_execute_command 0.0312 2 ide_do_request 0.0050 4 ide_get_queue 0.0625 2 ide_intr 0.0069 2 ide_dma_intr 0.0104 10 ide_build_sglist 0.0160 1 ide_build_dmatable 0.0024 1 __ide_dma_read 0.0042 1 __constant_c_and_count_memset 0.0069 1 __ide_do_rw_disk 0.0007 42 idedisk_end_request 0.2188 4 __rdtsc_delay 0.1250 0 *unknown* 2356 total 0.0013 [-- Attachment #3: profile-oread2612.txt --] [-- Type: text/plain, Size: 2183 bytes --] 1 sched_clock 0.0057 3 cond_resched_lock 0.0312 2 write_profile 0.0312 1 __wake_up_bit 0.0208 2 __generic_file_aio_read 0.0038 1 generic_file_read 0.0052 1 mempool_alloc 0.0037 1 set_page_dirty 0.0125 3 set_page_dirty_lock 0.0625 4 __follow_page 0.0227 7 get_user_pages 0.0072 2 do_wp_page 0.0025 8 __bio_add_page 0.0227 5 bio_add_page 0.1562 1 bio_set_map_data 0.0208 1 update_atime 0.0057 1 dio_get_page 0.0156 1 dio_bio_submit 0.0069 2 dio_bio_complete 0.0096 5 submit_page_section 0.0164 1 dio_zero_block 0.0078 13 do_direct_IO 0.0150 2 direct_io_worker 0.0014 2 __copy_to_user_ll 0.0312 2428 acpi_processor_idle 4.0000 4 blk_rq_map_sg 0.0114 10 __make_request 0.0086 1 generic_make_request 0.0022 1 as_set_request 0.0089 4 ide_end_request 0.0278 6 ide_do_request 0.0072 1 ide_intr 0.0026 5 ide_outb 0.3125 1 ide_execute_command 0.0063 2 ide_build_sglist 0.0139 5 schedule 0.0033 1 io_schedule 0.0312 0 *unknown* 2539 total 0.0012 ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 15:00 ` Ondrej Zary @ 2005-07-05 19:18 ` Jens Axboe 2005-07-05 19:25 ` Jens Axboe 1 sibling, 0 replies; 67+ messages in thread From: Jens Axboe @ 2005-07-05 19:18 UTC (permalink / raw) To: Ondrej Zary Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel On Tue, Jul 05 2005, Ondrej Zary wrote: > Jens Axboe wrote: > >On Tue, Jul 05 2005, Ondrej Zary wrote: > > > >>Jens Axboe wrote: > >> > >>>On Tue, 2005-07-05 at 15:02 +0200, Ondrej Zary wrote: > >>> > >>> > >>>>>Ok, looks alright for both. Your machine is quite slow, perhaps that is > >>>>>showing the slower performance. Can you try and make HZ 100 in 2.6 and > >>>>>test again? 2.6.13-recent has it as a config option, otherwise edit > >>>>>include/asm/param.h appropriately. > >>>>> > >>>> > >>>>I forgot to write that my 2.6.12 kernel is already compiled with HZ 100 > >>>>(it makes the system more responsive). > >>>>I've just tried 2.6.8.1 with HZ 1000 and there is no difference in HDD > >>>>performance comparing to 2.6.12. > >>> > >>> > >>>OK, interesting. You could try and boot with profile=2 and do > >>> > >>># readprofile -r > >>># dd if=/dev/hda of=/dev/null bs=128k > >>># readprofile > prof_output > >>> > >>>for each kernel and post it here, so we can see if anything sticks out. > >>> > >> > >>Here are the profiles (used dd with count=4096) from 2.4.26 and 2.6.12 > >>(nothing from 2.6.8.1 because I don't have the .map file anymore). > > > > > >Looks interesting, 2.6 spends oodles of times copying to user space. > >Lets check if raw reads perform ok, please try and time this app in 2.4 > >and 2.6 as well. > > > ># gcc -Wall -O2 -o oread oread.c > ># time ./oread /dev/hda > > > oread is faster than dd, but still not as fast as 2.4. In 2.6.12, HDD > led is blinking, in 2.4 it's solid on during the read. > > 2.6.12: > root@pentium:/home/rainbow# time ./oread /dev/hda > > real 0m25.082s > user 0m0.000s > sys 0m0.680s > > 2.4.26: > root@pentium:/home/rainbow# time ./oread /dev/hda > > real 0m23.513s > user 0m0.000s > sys 0m2.360s Hmm, still not as fast, not so good. 2.6 shows more idle time than 2.4, about 20% more. I seem to remember Ken Chen saying that 2.6 direct io was still a little slower than 2.4, your really slow hardware could be showing this to a much greater effect. I'll try and play with this tomorrow! -- Jens Axboe ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 15:00 ` Ondrej Zary 2005-07-05 19:18 ` Jens Axboe @ 2005-07-05 19:25 ` Jens Axboe 2005-07-05 21:36 ` Ondrej Zary 1 sibling, 1 reply; 67+ messages in thread From: Jens Axboe @ 2005-07-05 19:25 UTC (permalink / raw) To: Ondrej Zary Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel On Tue, Jul 05 2005, Ondrej Zary wrote: > oread is faster than dd, but still not as fast as 2.4. In 2.6.12, HDD > led is blinking, in 2.4 it's solid on during the read. Oh, and please do test 2.6 by first setting the deadline scheduler for hda. I can see you are using the 'as' scheduler right now. # echo deadline > /sys/block/hda/queue/scheduler Thanks! -- Jens Axboe ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 19:25 ` Jens Axboe @ 2005-07-05 21:36 ` Ondrej Zary 0 siblings, 0 replies; 67+ messages in thread From: Ondrej Zary @ 2005-07-05 21:36 UTC (permalink / raw) To: Jens Axboe Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel Jens Axboe wrote: > On Tue, Jul 05 2005, Ondrej Zary wrote: > >>oread is faster than dd, but still not as fast as 2.4. In 2.6.12, HDD >>led is blinking, in 2.4 it's solid on during the read. > > > Oh, and please do test 2.6 by first setting the deadline scheduler for > hda. I can see you are using the 'as' scheduler right now. > > # echo deadline > /sys/block/hda/queue/scheduler > No change, still >25 seconds. -- Ondrej Zary ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 14:21 ` Jens Axboe 2005-07-05 15:00 ` Ondrej Zary @ 2005-07-05 17:27 ` Linus Torvalds 2005-07-05 19:14 ` Jens Axboe 2005-07-06 0:35 ` Grant Coady 2 siblings, 1 reply; 67+ messages in thread From: Linus Torvalds @ 2005-07-05 17:27 UTC (permalink / raw) To: Jens Axboe Cc: Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', linux-ide, linux-kernel On Tue, 5 Jul 2005, Jens Axboe wrote: > > Looks interesting, 2.6 spends oodles of times copying to user space. > Lets check if raw reads perform ok, please try and time this app in 2.4 > and 2.6 as well. I think it's just that 2.4.x used to allow longer command queues. I think MAX_NR_REQUESTS is 1024 in 2.4.x, and just 128 in 2.6.x or something like that. Also, the congestion thresholds are questionable: we consider a queue congested if it is within 12% of full, but then we consider it uncongested whenever it falls to within 18% of full, which I bet means that for some streaming loads we have just a 6% "window" that we keep adding new requests to (we wait when we're almost full, but then we start adding requests again when we're _still_ almost full). Jens, we talked about this long ago, but I don't think we ever did any timings. Making things worse, things like this are only visible on stupid hardware that has long latencies to get started (many SCSI controllers used to have horrid latencies), so you'll never even see any difference on a lot of hardware. It's probably worth testing with a bigger request limit. I forget what the /proc interfaces are (and am too lazy to look it up), Jens can tell us ;) Linus ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 17:27 ` Linus Torvalds @ 2005-07-05 19:14 ` Jens Axboe 2005-07-05 21:39 ` Ondrej Zary 2005-07-11 14:21 ` Alan Cox 0 siblings, 2 replies; 67+ messages in thread From: Jens Axboe @ 2005-07-05 19:14 UTC (permalink / raw) To: Linus Torvalds Cc: Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', linux-ide, linux-kernel On Tue, Jul 05 2005, Linus Torvalds wrote: > > > On Tue, 5 Jul 2005, Jens Axboe wrote: > > > > Looks interesting, 2.6 spends oodles of times copying to user space. > > Lets check if raw reads perform ok, please try and time this app in 2.4 > > and 2.6 as well. > > I think it's just that 2.4.x used to allow longer command queues. I think > MAX_NR_REQUESTS is 1024 in 2.4.x, and just 128 in 2.6.x or something like > that. But for this case, you only have one command in flight. hdparm is highly synchronous, my oread case is as well. > Also, the congestion thresholds are questionable: we consider a queue > congested if it is within 12% of full, but then we consider it uncongested > whenever it falls to within 18% of full, which I bet means that for some > streaming loads we have just a 6% "window" that we keep adding new > requests to (we wait when we're almost full, but then we start adding > requests again when we're _still_ almost full). Jens, we talked about this > long ago, but I don't think we ever did any timings. In theory, the ioc batching should handle that case. But as you can see from recent commits, I'm not very happy with how this currently works. It should not impact this testing, though. > Making things worse, things like this are only visible on stupid hardware > that has long latencies to get started (many SCSI controllers used to have > horrid latencies), so you'll never even see any difference on a lot of > hardware. IDE still has much lower overhead per command than your average SCSI hardware. SATA with FIS even improves on this, definitely a good thing! > It's probably worth testing with a bigger request limit. I forget what the > /proc interfaces are (and am too lazy to look it up), Jens can tell us ;) It's /sys/block/<device>/queue/nr_requests now, can be changed at will. -- Jens Axboe ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 19:14 ` Jens Axboe @ 2005-07-05 21:39 ` Ondrej Zary 2005-07-11 14:21 ` Alan Cox 1 sibling, 0 replies; 67+ messages in thread From: Ondrej Zary @ 2005-07-05 21:39 UTC (permalink / raw) To: Jens Axboe Cc: Linus Torvalds, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', linux-ide, linux-kernel Jens Axboe wrote: > On Tue, Jul 05 2005, Linus Torvalds wrote: > >> >>On Tue, 5 Jul 2005, Jens Axboe wrote: >> >>>Looks interesting, 2.6 spends oodles of times copying to user space. >>>Lets check if raw reads perform ok, please try and time this app in 2.4 >>>and 2.6 as well. >> >>I think it's just that 2.4.x used to allow longer command queues. I think >>MAX_NR_REQUESTS is 1024 in 2.4.x, and just 128 in 2.6.x or something like >>that. > > > But for this case, you only have one command in flight. hdparm is highly > synchronous, my oread case is as well. > > >>Also, the congestion thresholds are questionable: we consider a queue >>congested if it is within 12% of full, but then we consider it uncongested >>whenever it falls to within 18% of full, which I bet means that for some >>streaming loads we have just a 6% "window" that we keep adding new >>requests to (we wait when we're almost full, but then we start adding >>requests again when we're _still_ almost full). Jens, we talked about this >>long ago, but I don't think we ever did any timings. > > > In theory, the ioc batching should handle that case. But as you can see > from recent commits, I'm not very happy with how this currently works. > It should not impact this testing, though. > > >>Making things worse, things like this are only visible on stupid hardware >>that has long latencies to get started (many SCSI controllers used to have >>horrid latencies), so you'll never even see any difference on a lot of >>hardware. > > > IDE still has much lower overhead per command than your average SCSI > hardware. SATA with FIS even improves on this, definitely a good thing! > > >>It's probably worth testing with a bigger request limit. I forget what the >>/proc interfaces are (and am too lazy to look it up), Jens can tell us ;) > > > It's /sys/block/<device>/queue/nr_requests now, can be changed at will. > Tested with default 128, 1024 and 4 (minimum) and no change. -- Ondrej Zary ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 19:14 ` Jens Axboe 2005-07-05 21:39 ` Ondrej Zary @ 2005-07-11 14:21 ` Alan Cox 1 sibling, 0 replies; 67+ messages in thread From: Alan Cox @ 2005-07-11 14:21 UTC (permalink / raw) To: Jens Axboe Cc: Linus Torvalds, Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', linux-ide, Linux Kernel Mailing List On Maw, 2005-07-05 at 20:14, Jens Axboe wrote: > IDE still has much lower overhead per command than your average SCSI > hardware. SATA with FIS even improves on this, definitely a good thing! But SCSI overlaps them while in PATA they are dead time. Thats why PATA is so demanding of large I/O block sizes ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 14:21 ` Jens Axboe 2005-07-05 15:00 ` Ondrej Zary 2005-07-05 17:27 ` Linus Torvalds @ 2005-07-06 0:35 ` Grant Coady 2005-07-06 0:51 ` Linus Torvalds 2005-07-07 22:32 ` Mark Lord 2 siblings, 2 replies; 67+ messages in thread From: Grant Coady @ 2005-07-06 0:35 UTC (permalink / raw) To: Jens Axboe Cc: Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel On Tue, 5 Jul 2005 16:21:26 +0200, Jens Axboe <axboe@suse.de> wrote: ># gcc -Wall -O2 -o oread oread.c ># time ./oread /dev/hda Executive Summary `````````````````` Comparing 'oread' with hdparm -tT on latest 2.4 vs 2.6 stable on various x86 boxen. Performance drops for 2.6, sometimes: 2.4.31-hf1 2.6.12.2 peetoo: 26MB/s -> 20MB/s, oread similar 120GB + 80GB silly: 22MB/s -> 8.5MB/s, oread similar 13GB tosh: 35MB/s -> 23MB/s, oread similar 40GB 2.5" pooh: 17MB/s -> 14MB/s, oread 30 -> 24 40GB menace: 11.5MB/s -> 13MB/s, oread similar 6GB 2.5" --Grant The details, config, dmesg, etc from linked resources: Intel SE440BX-2 with pII 400/100/512/2.0 CPU/FSB/L2/Vccp 512MB SDRAM on 440BX + PIIX4 http://scatter.mine.nu/test/linux-2.6/peetoo/ peetoo:~$ uname -r 2.4.31-hf1 peetoo:~$ time /home/share/install/oread /dev/hda real 0m20.065s user 0m0.010s sys 0m0.810s peetoo:~$ time /home/share/install/oread /dev/hdc real 0m18.484s user 0m0.000s sys 0m0.800s peetoo:~$ hdparm -tT /dev/hda /dev/hda: Timing cached reads: 444 MB in 2.00 seconds = 222.00 MB/sec Timing buffered disk reads: 84 MB in 3.06 seconds = 27.45 MB/sec peetoo:~$ hdparm -tT /dev/hda /dev/hda: Timing cached reads: 456 MB in 2.01 seconds = 226.87 MB/sec Timing buffered disk reads: 76 MB in 3.00 seconds = 25.33 MB/sec peetoo:~$ hdparm -tT /dev/hdc /dev/hdc: Timing cached reads: 464 MB in 2.01 seconds = 230.85 MB/sec Timing buffered disk reads: 76 MB in 3.00 seconds = 25.33 MB/sec peetoo:~$ hdparm -tT /dev/hdc /dev/hdc: Timing cached reads: 460 MB in 2.00 seconds = 230.00 MB/sec Timing buffered disk reads: 82 MB in 3.00 seconds = 27.33 MB/sec - - - peetoo:~$ uname -r 2.6.12.2b peetoo:~$ time /home/share/install/oread /dev/hda real 0m21.428s user 0m0.003s sys 0m0.436s peetoo:~$ time /home/share/install/oread /dev/hdc real 0m17.588s user 0m0.001s sys 0m0.455s peetoo:~$ cat /sys/block/hda/queue/scheduler noop [deadline] peetoo:~$ cat /sys/block/hdc/queue/scheduler noop [deadline] peetoo:~$ time /home/share/install/oread /dev/hda real 0m21.417s user 0m0.005s sys 0m0.462s peetoo:~$ time /home/share/install/oread /dev/hda real 0m18.626s user 0m0.006s sys 0m0.440s peetoo:~$ time /home/share/install/oread /dev/hdc real 0m17.555s user 0m0.005s sys 0m0.422s peetoo:~$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda3 2586348 563000 2023348 22% / /dev/hdc3 2586348 1582716 1003632 62% /usr /dev/hdc6 2586348 1217568 1368780 48% /usr/src /dev/hda9 20562504 10821500 9741004 53% /home/install /dev/hdc9 20562504 3634700 16927804 18% /home/public /dev/hda10 41446344 39676256 1770088 96% /home/archive deltree:/home/share 2064256 1042952 1021304 51% /home/share peetoo:~$ hdparm -tT /dev/hda /dev/hda: Timing cached reads: 448 MB in 2.00 seconds = 223.81 MB/sec Timing buffered disk reads: 62 MB in 3.07 seconds = 20.17 MB/sec peetoo:~$ hdparm -tT /dev/hda /dev/hda: Timing cached reads: 472 MB in 2.01 seconds = 234.40 MB/sec Timing buffered disk reads: 54 MB in 3.01 seconds = 17.97 MB/sec peetoo:~$ hdparm -tT /dev/hdc /dev/hdc: Timing cached reads: 456 MB in 2.01 seconds = 226.56 MB/sec Timing buffered disk reads: 62 MB in 3.08 seconds = 20.11 MB/sec peetoo:~$ hdparm -tT /dev/hdc o o o EPoX EP-61LXA-M: Intel 440LX chipset with pentiumII/266 on 66MHz FSB (4 x 66) with 128MB SDRAM http://scatter.mine.nu/test/linux-2.6/silly/ root@silly:~# uname -r 2.4.31-hf1 root@silly:~# time /home/share/install/oread /dev/hda real 0m23.657s user 0m0.000s sys 0m1.300s root@silly:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 356 MB in 2.02 seconds = 176.24 MB/sec Timing buffered disk reads: 68 MB in 3.04 seconds = 22.37 MB/sec root@silly:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 344 MB in 2.00 seconds = 172.00 MB/sec Timing buffered disk reads: 68 MB in 3.03 seconds = 22.44 MB/sec - - - root@silly:~# uname -r 2.6.12.2a root@silly:~# time /home/share/install/oread /dev/hda real 0m23.569s user 0m0.005s sys 0m0.563s root@silly:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 336 MB in 2.00 seconds = 167.77 MB/sec Timing buffered disk reads: 50 MB in 3.05 seconds = 16.37 MB/sec root@silly:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 340 MB in 2.01 seconds = 169.01 MB/sec Timing buffered disk reads: 28 MB in 3.22 seconds = 8.70 MB/sec root@silly:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 336 MB in 2.01 seconds = 167.44 MB/sec Timing buffered disk reads: 26 MB in 3.05 seconds = 8.52 MB/sec root@silly:~# echo deadline > /sys/block/hda/queue/scheduler root@silly:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 336 MB in 2.01 seconds = 166.77 MB/sec Timing buffered disk reads: 26 MB in 3.19 seconds = 8.14 MB/sec root@silly:~# o o o Intel Celeron (coppermine pIII) 500MHz with 192MB SDRAM on Intel 440BX/ZX + PIIX4E (Toshiba laptop) http://scatter.mine.nu/test/linux-2.6/tosh/ root@tosh:~# uname -r 2.4.31-hf1 root@tosh:~# time /home/share/install/oread /dev/hda real 0m18.079s user 0m0.000s sys 0m0.680s root@tosh:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 516 MB in 2.00 seconds = 258.00 MB/sec Timing buffered disk reads: 74 MB in 3.02 seconds = 24.50 MB/sec root@tosh:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 520 MB in 2.01 seconds = 258.71 MB/sec Timing buffered disk reads: 84 MB in 3.03 seconds = 27.72 MB/sec - - - root@tosh:~# uname -r 2.6.12.2a root@tosh:~# time /home/share/install/oread /dev/hda real 0m17.692s user 0m0.004s sys 0m0.319s root@tosh:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 500 MB in 2.00 seconds = 249.54 MB/sec Timing buffered disk reads: 70 MB in 3.03 seconds = 23.11 MB/sec root@tosh:~# echo deadline > /sys/block/hda/queue/scheduler root@tosh:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 520 MB in 2.01 seconds = 258.75 MB/sec Timing buffered disk reads: 70 MB in 3.06 seconds = 22.88 MB/sec o o o Gigabyte GA-5AA Ali Aladdin V AGPset (1542/1543C) with AMD K6-2/500 on 100MHz FSB with 192MB SDRAM http://scatter.mine.nu/test/linux-2.6/pooh/ root@pooh:~# uname -r 2.4.31-hf1 root@pooh:~# time /home/share/install/oread /dev/hda real 0m29.786s user 0m0.000s sys 0m0.910s root@pooh:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 248 MB in 2.00 seconds = 124.00 MB/sec Timing buffered disk reads: 54 MB in 3.11 seconds = 17.36 MB/sec - - - root@pooh:~# uname -r 2.6.12.2a root@pooh:~# time /home/share/install/oread /dev/hda real 0m23.566s user 0m0.004s sys 0m0.370s root@pooh:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 236 MB in 2.02 seconds = 117.02 MB/sec Timing buffered disk reads: 44 MB in 3.10 seconds = 14.20 MB/sec o o o Gigabyte GA-586TX3: Intel 430TX chipset with AMD K6-2/400 on 66MHz FSB (6 x 66) with 64MB SDRAM http://scatter.mine.nu/test/boxen/menace/ root@menace:~# uname -r 2.4.31-hf1 root@menace:~# time /home/share/install/oread /dev/hda real 0m39.490s user 0m0.010s sys 0m1.090s root@menace:~# time /home/share/install/oread /dev/hda real 0m39.329s user 0m0.010s sys 0m1.090s root@menace:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 176 MB in 2.03 seconds = 86.70 MB/sec Timing buffered disk reads: 36 MB in 3.14 seconds = 11.46 MB/sec root@menace:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 172 MB in 2.02 seconds = 85.15 MB/sec Timing buffered disk reads: 36 MB in 3.13 seconds = 11.50 MB/sec - - - root@menace:~# uname -r 2.6.12.2a root@menace:~# time /home/share/install/oread /dev/hda real 0m38.861s user 0m0.004s sys 0m0.515s root@menace:~# time /home/share/install/oread /dev/hda real 0m39.391s user 0m0.005s sys 0m0.522s root@menace:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 172 MB in 2.01 seconds = 85.42 MB/sec Timing buffered disk reads: 40 MB in 3.03 seconds = 13.20 MB/sec root@menace:~# hdparm -tT /dev/hda /dev/hda: Timing cached reads: 168 MB in 2.04 seconds = 82.16 MB/sec Timing buffered disk reads: 40 MB in 3.03 seconds = 13.21 MB/sec ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-06 0:35 ` Grant Coady @ 2005-07-06 0:51 ` Linus Torvalds 2005-07-06 3:26 ` Al Boldi 2005-07-06 4:56 ` Grant Coady 2005-07-07 22:32 ` Mark Lord 1 sibling, 2 replies; 67+ messages in thread From: Linus Torvalds @ 2005-07-06 0:51 UTC (permalink / raw) To: Grant Coady Cc: Jens Axboe, Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', linux-ide, linux-kernel On Wed, 6 Jul 2005, Grant Coady wrote: > > Executive Summary Btw, can you try this same thing (or at least a subset) with a large file on a filesystem? Does that show the same pattern, or is it always just the raw device? Linus ^ permalink raw reply [flat|nested] 67+ messages in thread
* RE: [git patches] IDE update 2005-07-06 0:51 ` Linus Torvalds @ 2005-07-06 3:26 ` Al Boldi 2005-07-06 4:56 ` Grant Coady 1 sibling, 0 replies; 67+ messages in thread From: Al Boldi @ 2005-07-06 3:26 UTC (permalink / raw) To: 'Linus Torvalds', 'Grant Coady' Cc: 'Jens Axboe', 'Ondrej Zary', 'André Tomt', 'Bartlomiej Zolnierkiewicz', linux-ide, linux-kernel Linus Torvalds wrote: { On Wed, 6 Jul 2005, Grant Coady wrote: > > Executive Summary Btw, can you try this same thing (or at least a subset) with a large file on a filesystem? Does that show the same pattern, or is it always just the raw device? } Linus, Cat /dev/hda > /dev/null and cat /tmp/tst.dsk > /dev/null show the same symptoms. The problem shows most when the cpu is slow and the hd is fast. When the cpu is fast and the hd is slow the cpu will make up for lost cycles and the problem will not show! ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-06 0:51 ` Linus Torvalds 2005-07-06 3:26 ` Al Boldi @ 2005-07-06 4:56 ` Grant Coady 2005-07-06 5:22 ` Linus Torvalds 1 sibling, 1 reply; 67+ messages in thread From: Grant Coady @ 2005-07-06 4:56 UTC (permalink / raw) To: Linus Torvalds Cc: Jens Axboe, Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', linux-ide, linux-kernel On Tue, 5 Jul 2005 17:51:50 -0700 (PDT), Linus Torvalds <torvalds@osdl.org> wrote: > >Btw, can you try this same thing (or at least a subset) with a large file >on a filesystem? Does that show the same pattern, or is it always just the >raw device? > Sure, take a while longer to vary by block size. One effect seems to be wrong is interaction between /dev/hda and /dev/hdc in 'peetoo', the IDE channels not independent? write: time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) read: time dd of=/dev/null bs=1M if=/zeroes summary 2.4.31-hf1 2.6.12.2 boxen \ time -> w r w r --------------- ---- ---- ---- ---- menace 58.5 50 57 47.5 pooh 24 24 22.5 27 peetoo 33 20 26.5 22 (simultaneuous 57 37.5 52 38.5) silly 54 24 49 25 tosh 30 19.5 27 19.5 filesystem: reiserfs 3.6, distro: slackware-10.1 + updates hardware config, etc: http://scatter.mine.nu/test/ --Grant the long story: root@menace:~# uname -r 2.4.31-hf1 root@menace:~# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda3 1991992 1074516 917476 54% / deltree:/home/share 2064256 1042968 1021288 51% /home/share root@menace:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m57.830s user 0m0.050s sys 0m20.940s root@menace:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m59.041s user 0m0.030s sys 0m21.780s root@menace:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m49.963s user 0m0.000s sys 0m15.510s - - - root@menace:~# uname -r 2.6.12.2a root@menace:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m57.199s user 0m0.022s sys 0m15.040s root@menace:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m56.825s user 0m0.024s sys 0m14.893s root@menace:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m47.560s user 0m0.017s sys 0m15.533s root@menace:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m47.842s user 0m0.012s sys 0m15.647s o o o root@pooh:~# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda3 3084380 2018240 1066140 66% / /dev/hda6 2056220 1049544 1006676 52% /usr/src /dev/hda7 256996 34260 222736 14% /usr/local /dev/hda8 256996 33896 223100 14% /home /dev/hda14 20562536 32840 20529696 1% /home/pooh deltree:/home/share 2064256 1042968 1021288 51% /home/share root@pooh:~# uname -r 2.4.31-hf1 root@pooh:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m23.912s user 0m0.010s sys 0m19.820s root@pooh:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m24.302s user 0m0.020s sys 0m16.760s - - - root@pooh:~# uname -r 2.6.12.2a root@pooh:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m22.449s user 0m0.017s sys 0m13.576s root@pooh:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m26.780s user 0m0.010s sys 0m13.398s o o o peetoo:~$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda3 2586348 1075652 1510696 42% / /dev/hdc3 2586348 2044228 542120 80% /usr /dev/hdc6 2586348 1217568 1368780 48% /usr/src /dev/hda9 20562504 10821500 9741004 53% /home/install /dev/hdc9 20562504 4329320 16233184 22% /home/public /dev/hda10 41446344 39676256 1770088 96% /home/archive deltree:/home/share 2064256 1042968 1021288 51% /home/share peetoo:~$ uname -r 2.4.31-hf1 peetoo:~$ time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m33.322s user 0m0.000s sys 0m13.650s peetoo:~$ time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m32.983s user 0m0.010s sys 0m13.740s peetoo:~$ time $(dd if=/dev/zero bs=1M count=500 of=/usr/zeroes; sync) 500+0 records in 500+0 records out real 0m30.775s user 0m0.000s sys 0m13.600s peetoo:~$ time $(dd if=/dev/zero bs=1M count=500 of=/usr/zeroes; sync) 500+0 records in 500+0 records out real 0m33.077s user 0m0.010s sys 0m13.740s peetoo:~$ time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m18.877s user 0m0.000s sys 0m5.600s peetoo:~$ time dd of=/dev/null bs=1M if=/usr/zeroes 500+0 records in 500+0 records out real 0m21.413s user 0m0.000s sys 0m5.360s peetoo:~$ time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m18.940s user 0m0.000s sys 0m5.390s peetoo:~$ time dd of=/dev/null bs=1M if=/usr/zeroes 500+0 records in 500+0 records out real 0m22.120s user 0m0.000s sys 0m5.520s peetoo:~$ time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m36.991s user 0m0.000s sys 0m5.810s peetoo:~$ time $(dd if=/dev/zero bs=1M count=500 of=/usr/zeroes; sync) 500+0 records in 500+0 records out real 0m57.718s user 0m0.000s sys 0m13.580s simultaneous: peetoo:~$ time dd of=/dev/null bs=1M if=/usr/zeroes 500+0 records in 500+0 records out real 0m38.057s user 0m0.010s sys 0m5.790s peetoo:~$ time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m57.164s user 0m0.020s sys 0m13.660s - - - peetoo:~$ uname -r 2.6.12.2b peetoo:~$ time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m26.779s user 0m0.017s sys 0m5.634s peetoo:~$ time $(dd if=/dev/zero bs=1M count=500 of=/usr/zeroes; sync) 500+0 records in 500+0 records out real 0m26.112s user 0m0.017s sys 0m5.358s peetoo:~$ time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m21.630s user 0m0.005s sys 0m5.405s peetoo:~$ time dd of=/dev/null bs=1M if=/usr/zeroes 500+0 records in 500+0 records out real 0m22.489s user 0m0.013s sys 0m5.378s simultaneous with other drive: peetoo:~$ time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m38.149s user 0m0.007s sys 0m5.559s peetoo:~$ time $(dd if=/dev/zero bs=1M count=500 of=/usr/zeroes; sync) 500+0 records in 500+0 records out real 0m52.272s user 0m0.012s sys 0m5.461s - - - second terminal: peetoo:~$ time dd of=/dev/null bs=1M if=/usr/zeroes 500+0 records in 500+0 records out real 0m38.998s user 0m0.006s sys 0m5.517s peetoo:~$ time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m51.610s user 0m0.018s sys 0m5.470s o o o root@silly:~# uname -r 2.4.31-hf1 root@silly:~# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda3 3084380 755932 2328448 25% / /dev/hda5 3084348 1168428 1915920 38% /usr/src /dev/hda6 256996 39768 217228 16% /usr/local /dev/hda7 514028 32864 481164 7% /home deltree:/home/share 2064256 1042968 1021288 51% /home/share root@silly:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m58.657s user 0m0.020s sys 0m16.810s root@silly:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m50.276s user 0m0.040s sys 0m17.240s root@silly:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m23.814s user 0m0.010s sys 0m8.470s root@silly:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m23.834s user 0m0.020s sys 0m8.500s - - - root@silly:~# uname -r 2.6.12.2a root@silly:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m49.564s user 0m0.021s sys 0m7.556s root@silly:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m48.234s user 0m0.016s sys 0m7.466s root@silly:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m24.900s user 0m0.009s sys 0m8.430s root@silly:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m25.205s user 0m0.015s sys 0m8.394s o o o root@tosh:~# uname -r 2.4.31-hf1 root@tosh:~# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda3 4112508 2997808 1114700 73% / /dev/hda6 124427 996 117007 1% /usr/local /dev/hda7 124427 99 117904 1% /home deltree:/home/share 2064256 1042968 1021288 51% /home/share root@tosh:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m33.789s user 0m0.040s sys 0m9.430s root@tosh:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m27.702s user 0m0.000s sys 0m9.940s root@tosh:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m19.878s user 0m0.000s sys 0m4.510s root@tosh:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m19.288s user 0m0.000s sys 0m4.580s - - - root@tosh:~# uname -r 2.6.12.2a root@tosh:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m27.120s user 0m0.010s sys 0m4.937s root@tosh:~# time $(dd if=/dev/zero bs=1M count=500 of=/zeroes; sync) 500+0 records in 500+0 records out real 0m27.015s user 0m0.010s sys 0m4.844s root@tosh:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m19.301s user 0m0.006s sys 0m4.558s root@tosh:~# time dd of=/dev/null bs=1M if=/zeroes 500+0 records in 500+0 records out real 0m19.513s user 0m0.009s sys 0m4.574s o o o end :) ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-06 4:56 ` Grant Coady @ 2005-07-06 5:22 ` Linus Torvalds 2005-07-08 8:48 ` Jens Axboe 0 siblings, 1 reply; 67+ messages in thread From: Linus Torvalds @ 2005-07-06 5:22 UTC (permalink / raw) To: Grant Coady Cc: Jens Axboe, Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', linux-ide, linux-kernel On Wed, 6 Jul 2005, Grant Coady wrote: > > Sure, take a while longer to vary by block size. One effect seems > to be wrong is interaction between /dev/hda and /dev/hdc in 'peetoo', > the IDE channels not independent? Well, looking at your numbers for "silly" and "tosh", which were perhaps the most extreme examples of slowdown on the /dev/hda thing: silly: 22MB/s -> 8.5MB/s, oread similar 13GB tosh: 35MB/s -> 23MB/s, oread similar 40GB 2.5" now it says: > summary 2.4.31-hf1 2.6.12.2 > boxen \ time -> w r w r > --------------- ---- ---- ---- ---- > silly 54 24 49 25 > tosh 30 19.5 27 19.5 ie here both silly and tosh do equally well on 2.4.x and 2.6.x on reads, and seem to perhaps show a bit of slowdown on writes (which I suspect may be due to the fact that we try to limit the queues a bit more, but hey, that's handwaving). The point being that the slowdown you see seems to really largely be limited to the raw partition code. Your filesystem throughput numbers for reads are generally _better_ on 2.6.x than on 2.4.x when doing filesystem accesses (but the differences aren't all that big). So my gut feel is that the reason hdparm and dd from the raw partition gives different performance is not so much the driver, but probably that we've tweaked read-ahead for file access or something like that. Maybe the maximum fs-level read-ahead changed? Linus ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-06 5:22 ` Linus Torvalds @ 2005-07-08 8:48 ` Jens Axboe 2005-07-08 10:20 ` Ingo Molnar 0 siblings, 1 reply; 67+ messages in thread From: Jens Axboe @ 2005-07-08 8:48 UTC (permalink / raw) To: Linus Torvalds Cc: Grant Coady, Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', linux-ide, linux-kernel, Ingo Molnar [-- Attachment #1: Type: text/plain, Size: 1893 bytes --] On Tue, Jul 05 2005, Linus Torvalds wrote: > So my gut feel is that the reason hdparm and dd from the raw partition > gives different performance is not so much the driver, but probably that > we've tweaked read-ahead for file access or something like that. Maybe > the maximum fs-level read-ahead changed? I don't think this is the case. I butchered a test system here and successfully got it running a P2 at 375MHz (don't ask, messing with multipliers and FSB with slot-1 cpu's has been a while) and 2.6 was still faster. But! I used hdparm -t solely, 2.6 was always ~5% faster than 2.4. But using -Tt slowed down the hd speed by about 30%. So it looks like some scheduler interaction, perhaps the memory timing loops gets it marked as batch or something? hdparm really does nothing special - it reads the disk in 2MiB chunks, calling getitimer() in between to stop at 3 seconds. bart:~ # uname -a Linux bart 2.6.13-rc2 #2 SMP Fri Jul 8 09:51:39 CEST 2005 i686 i686 i386 GNU/Linux bart:~ # hdparm -Tt /dev/hdc /dev/hdc: Timing buffer-cache reads: 380 MB in 2.00 seconds = 190.00 MB/sec Timing buffered disk reads: 64 MB in 3.06 seconds = 20.92 MB/sec bart:~ # hdparm -t /dev/hdc /dev/hdc: Timing buffered disk reads: 88 MB in 3.05 seconds = 28.85 MB/sec I'm attaching a silly test case that demonstrates the problem by reading 512MiB from a given disk. bart:~ # ./read_disk /dev/hdc Disk Throughput: 29 MiB/sec bart:~ # ./read_disk /dev/hdc 1 Mem Throughput: 102 MiB/sec Mem Throughput: 101 MiB/sec Disk Throughput: 21 MiB/sec Passing an extra argument to the program, makes it do the same priming loop as hdparm. That part runs at 100% system time, just copying data to user space and issuing an lseek for each read. Again, if I run this on my workstation (dual core em64t), it doesn't show the problem. hdparm strace -tt timings also attached. -- Jens Axboe [-- Attachment #2: hdparm-with-buffer --] [-- Type: text/plain, Size: 46074 bytes --] 10:23:13.833131 execve("/sbin/hdparm", ["hdparm", "-Tt", "/dev/hdc"], [/* 50 vars */]) = 0 10:23:13.834044 uname({sys="Linux", node="bart", ...}) = 0 10:23:13.835015 brk(0) = 0x8054000 10:23:13.835421 open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory) 10:23:13.835813 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000 10:23:13.836251 open("/etc/ld.so.cache", O_RDONLY) = 3 10:23:13.836563 fstat64(3, {st_mode=S_IFREG|0644, st_size=23320, ...}) = 0 10:23:13.837038 old_mmap(NULL, 23320, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000 10:23:13.837379 close(3) = 0 10:23:13.837678 open("/lib/tls/libc.so.6", O_RDONLY) = 3 10:23:13.837987 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0PS\1\000"..., 512) = 512 10:23:13.838392 fstat64(3, {st_mode=S_IFREG|0755, st_size=1345609, ...}) = 0 10:23:13.838804 old_mmap(NULL, 1132908, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4001e000 10:23:13.839152 madvise(0x4001e000, 1132908, MADV_SEQUENTIAL|0x1) = 0 10:23:13.839462 old_mmap(0x40128000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x109000) = 0x40128000 10:23:13.839901 old_mmap(0x40130000, 10604, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40130000 10:23:13.840264 close(3) = 0 10:23:13.841154 set_thread_area({entry_number:-1 -> 6, base_addr:0x40017860, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 10:23:13.841486 munmap(0x40018000, 23320) = 0 10:23:13.841925 stat64("/dev/hdc", {st_mode=S_IFBLK|0660, st_rdev=makedev(22, 0), ...}) = 0 10:23:13.842393 open("/dev/hdc", O_RDONLY|O_NONBLOCK) = 3 10:23:13.842806 fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 10:23:13.843225 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000 10:23:13.843537 write(1, "\n", 1) = 1 10:23:13.844335 write(1, "/dev/hdc:\n", 10) = 10 10:23:13.844974 shmget(IPC_PRIVATE, 2097152, 0600) = 557056 10:23:13.845333 shmctl(557056, IPC_64|SHM_LOCK, 0) = 0 10:23:13.845618 shmat(557056, 0, 0) = 0x40133000 10:23:13.845939 shmctl(557056, IPC_64|IPC_RMID, 0) = 0 10:23:13.846208 sync() = 0 10:23:13.859724 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 10:23:13.860118 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0 10:23:13.860429 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 10:23:13.860716 nanosleep({3, 0}, {3, 0}) = 0 10:23:16.875595 setitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={1000, 0}}, NULL) = 0 10:23:16.875920 lseek(3, 0, SEEK_SET) = 0 10:23:16.876192 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:16.961989 write(1, " Timing buffer-cache reads: ", 30) = 30 10:23:16.963078 sync() = 0 10:23:16.968622 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 10:23:16.968978 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0 10:23:16.969273 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 10:23:16.969561 nanosleep({1, 0}, {1, 0}) = 0 10:23:17.975598 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 910000}}) = 0 10:23:17.975895 lseek(3, 0, SEEK_SET) = 0 10:23:17.976156 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:17.997351 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 890000}}) = 0 10:23:17.997729 lseek(3, 0, SEEK_SET) = 0 10:23:17.997996 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.018996 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 870000}}) = 0 10:23:18.019349 lseek(3, 0, SEEK_SET) = 0 10:23:18.019615 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.040547 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 840000}}) = 0 10:23:18.040900 lseek(3, 0, SEEK_SET) = 0 10:23:18.041165 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.062054 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 820000}}) = 0 10:23:18.062621 lseek(3, 0, SEEK_SET) = 0 10:23:18.062892 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.083773 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 800000}}) = 0 10:23:18.084128 lseek(3, 0, SEEK_SET) = 0 10:23:18.084395 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.105290 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 780000}}) = 0 10:23:18.105681 lseek(3, 0, SEEK_SET) = 0 10:23:18.105947 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.126852 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 760000}}) = 0 10:23:18.127205 lseek(3, 0, SEEK_SET) = 0 10:23:18.127471 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.148381 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 740000}}) = 0 10:23:18.148734 lseek(3, 0, SEEK_SET) = 0 10:23:18.149001 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.169908 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 720000}}) = 0 10:23:18.170261 lseek(3, 0, SEEK_SET) = 0 10:23:18.170554 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.191453 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 690000}}) = 0 10:23:18.191805 lseek(3, 0, SEEK_SET) = 0 10:23:18.192071 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.212975 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 670000}}) = 0 10:23:18.213325 lseek(3, 0, SEEK_SET) = 0 10:23:18.213591 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.234492 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 650000}}) = 0 10:23:18.234844 lseek(3, 0, SEEK_SET) = 0 10:23:18.235110 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.256039 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 630000}}) = 0 10:23:18.256391 lseek(3, 0, SEEK_SET) = 0 10:23:18.256658 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.277555 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 610000}}) = 0 10:23:18.277906 lseek(3, 0, SEEK_SET) = 0 10:23:18.278172 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.299086 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 590000}}) = 0 10:23:18.299437 lseek(3, 0, SEEK_SET) = 0 10:23:18.299703 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.320774 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 560000}}) = 0 10:23:18.321126 lseek(3, 0, SEEK_SET) = 0 10:23:18.321394 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.342286 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 540000}}) = 0 10:23:18.342640 lseek(3, 0, SEEK_SET) = 0 10:23:18.342909 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.363812 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 520000}}) = 0 10:23:18.364168 lseek(3, 0, SEEK_SET) = 0 10:23:18.364436 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.385347 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 500000}}) = 0 10:23:18.385740 lseek(3, 0, SEEK_SET) = 0 10:23:18.386006 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.406890 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 480000}}) = 0 10:23:18.407243 lseek(3, 0, SEEK_SET) = 0 10:23:18.407509 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.428412 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 460000}}) = 0 10:23:18.428987 lseek(3, 0, SEEK_SET) = 0 10:23:18.429259 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.450135 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 430000}}) = 0 10:23:18.450513 lseek(3, 0, SEEK_SET) = 0 10:23:18.450778 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.471672 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 410000}}) = 0 10:23:18.472024 lseek(3, 0, SEEK_SET) = 0 10:23:18.472290 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.493187 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 390000}}) = 0 10:23:18.493539 lseek(3, 0, SEEK_SET) = 0 10:23:18.493804 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.515121 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 370000}}) = 0 10:23:18.515522 lseek(3, 0, SEEK_SET) = 0 10:23:18.515788 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.536692 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 350000}}) = 0 10:23:18.537044 lseek(3, 0, SEEK_SET) = 0 10:23:18.537309 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.558191 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 330000}}) = 0 10:23:18.558544 lseek(3, 0, SEEK_SET) = 0 10:23:18.558808 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.579710 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 310000}}) = 0 10:23:18.580063 lseek(3, 0, SEEK_SET) = 0 10:23:18.580352 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.602708 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 280000}}) = 0 10:23:18.603061 lseek(3, 0, SEEK_SET) = 0 10:23:18.603325 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.624180 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 260000}}) = 0 10:23:18.624530 lseek(3, 0, SEEK_SET) = 0 10:23:18.624797 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.645731 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 240000}}) = 0 10:23:18.646081 lseek(3, 0, SEEK_SET) = 0 10:23:18.646346 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.667234 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 220000}}) = 0 10:23:18.667585 lseek(3, 0, SEEK_SET) = 0 10:23:18.667851 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.688755 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 200000}}) = 0 10:23:18.689106 lseek(3, 0, SEEK_SET) = 0 10:23:18.689372 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.710936 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 170000}}) = 0 10:23:18.711288 lseek(3, 0, SEEK_SET) = 0 10:23:18.711554 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.732457 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 150000}}) = 0 10:23:18.732809 lseek(3, 0, SEEK_SET) = 0 10:23:18.733074 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.753990 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 130000}}) = 0 10:23:18.754343 lseek(3, 0, SEEK_SET) = 0 10:23:18.754609 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.775530 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 110000}}) = 0 10:23:18.775880 lseek(3, 0, SEEK_SET) = 0 10:23:18.776145 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.798381 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 90000}}) = 0 10:23:18.798925 lseek(3, 0, SEEK_SET) = 0 10:23:18.799194 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.819969 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 70000}}) = 0 10:23:18.820345 lseek(3, 0, SEEK_SET) = 0 10:23:18.820612 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.841526 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 40000}}) = 0 10:23:18.841877 lseek(3, 0, SEEK_SET) = 0 10:23:18.842142 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.863023 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 20000}}) = 0 10:23:18.863377 lseek(3, 0, SEEK_SET) = 0 10:23:18.863642 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.884835 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 0}}) = 0 10:23:18.885186 lseek(3, 0, SEEK_SET) = 0 10:23:18.885505 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.906443 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 980000}}) = 0 10:23:18.906795 lseek(3, 0, SEEK_SET) = 0 10:23:18.907060 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.927943 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 960000}}) = 0 10:23:18.928295 lseek(3, 0, SEEK_SET) = 0 10:23:18.928559 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.949465 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 940000}}) = 0 10:23:18.949816 lseek(3, 0, SEEK_SET) = 0 10:23:18.950081 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.970988 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 910000}}) = 0 10:23:18.971338 lseek(3, 0, SEEK_SET) = 0 10:23:18.971603 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:18.992499 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 890000}}) = 0 10:23:18.992851 lseek(3, 0, SEEK_SET) = 0 10:23:18.993115 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.014089 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 870000}}) = 0 10:23:19.014443 lseek(3, 0, SEEK_SET) = 0 10:23:19.014708 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.035629 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 850000}}) = 0 10:23:19.035982 lseek(3, 0, SEEK_SET) = 0 10:23:19.036247 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.057130 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 830000}}) = 0 10:23:19.057484 lseek(3, 0, SEEK_SET) = 0 10:23:19.057749 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.078662 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 810000}}) = 0 10:23:19.079014 lseek(3, 0, SEEK_SET) = 0 10:23:19.079280 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.100168 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 780000}}) = 0 10:23:19.100546 lseek(3, 0, SEEK_SET) = 0 10:23:19.100811 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.121707 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 760000}}) = 0 10:23:19.122062 lseek(3, 0, SEEK_SET) = 0 10:23:19.122327 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.143220 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 740000}}) = 0 10:23:19.143573 lseek(3, 0, SEEK_SET) = 0 10:23:19.143838 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.164743 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 720000}}) = 0 10:23:19.165096 lseek(3, 0, SEEK_SET) = 0 10:23:19.165590 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.186449 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 700000}}) = 0 10:23:19.186777 lseek(3, 0, SEEK_SET) = 0 10:23:19.187019 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.207875 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 680000}}) = 0 10:23:19.208204 lseek(3, 0, SEEK_SET) = 0 10:23:19.208445 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.229310 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 660000}}) = 0 10:23:19.229639 lseek(3, 0, SEEK_SET) = 0 10:23:19.229880 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.250799 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 630000}}) = 0 10:23:19.251126 lseek(3, 0, SEEK_SET) = 0 10:23:19.251366 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.272250 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 610000}}) = 0 10:23:19.272577 lseek(3, 0, SEEK_SET) = 0 10:23:19.272819 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.293706 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 590000}}) = 0 10:23:19.294033 lseek(3, 0, SEEK_SET) = 0 10:23:19.294274 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.315140 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 570000}}) = 0 10:23:19.315694 lseek(3, 0, SEEK_SET) = 0 10:23:19.315945 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.336838 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 550000}}) = 0 10:23:19.337164 lseek(3, 0, SEEK_SET) = 0 10:23:19.337405 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.358275 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 530000}}) = 0 10:23:19.358603 lseek(3, 0, SEEK_SET) = 0 10:23:19.358845 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.379706 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 510000}}) = 0 10:23:19.380034 lseek(3, 0, SEEK_SET) = 0 10:23:19.380299 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.401210 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 480000}}) = 0 10:23:19.401536 lseek(3, 0, SEEK_SET) = 0 10:23:19.401777 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.422641 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 460000}}) = 0 10:23:19.422969 lseek(3, 0, SEEK_SET) = 0 10:23:19.423211 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.444095 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 440000}}) = 0 10:23:19.444424 lseek(3, 0, SEEK_SET) = 0 10:23:19.444666 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.465555 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 420000}}) = 0 10:23:19.465881 lseek(3, 0, SEEK_SET) = 0 10:23:19.466122 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.486995 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 400000}}) = 0 10:23:19.487321 lseek(3, 0, SEEK_SET) = 0 10:23:19.487563 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.508435 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 380000}}) = 0 10:23:19.508764 lseek(3, 0, SEEK_SET) = 0 10:23:19.509006 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.529872 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 360000}}) = 0 10:23:19.530200 lseek(3, 0, SEEK_SET) = 0 10:23:19.530675 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.551521 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 330000}}) = 0 10:23:19.551848 lseek(3, 0, SEEK_SET) = 0 10:23:19.552090 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.572968 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 310000}}) = 0 10:23:19.573295 lseek(3, 0, SEEK_SET) = 0 10:23:19.573537 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.594420 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 290000}}) = 0 10:23:19.594748 lseek(3, 0, SEEK_SET) = 0 10:23:19.594989 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.615869 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 270000}}) = 0 10:23:19.616197 lseek(3, 0, SEEK_SET) = 0 10:23:19.616439 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.637311 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 250000}}) = 0 10:23:19.637637 lseek(3, 0, SEEK_SET) = 0 10:23:19.637878 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.658747 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 230000}}) = 0 10:23:19.659075 lseek(3, 0, SEEK_SET) = 0 10:23:19.659317 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.680183 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 200000}}) = 0 10:23:19.680538 lseek(3, 0, SEEK_SET) = 0 10:23:19.680780 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.701661 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 180000}}) = 0 10:23:19.701988 lseek(3, 0, SEEK_SET) = 0 10:23:19.702229 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.723097 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 160000}}) = 0 10:23:19.723424 lseek(3, 0, SEEK_SET) = 0 10:23:19.723667 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.744555 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 140000}}) = 0 10:23:19.744883 lseek(3, 0, SEEK_SET) = 0 10:23:19.745124 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.766000 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 120000}}) = 0 10:23:19.766325 lseek(3, 0, SEEK_SET) = 0 10:23:19.766567 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.787453 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 100000}}) = 0 10:23:19.787781 lseek(3, 0, SEEK_SET) = 0 10:23:19.788022 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.810184 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 70000}}) = 0 10:23:19.810536 lseek(3, 0, SEEK_SET) = 0 10:23:19.810778 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.831605 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 50000}}) = 0 10:23:19.831935 lseek(3, 0, SEEK_SET) = 0 10:23:19.832177 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.853058 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 30000}}) = 0 10:23:19.853385 lseek(3, 0, SEEK_SET) = 0 10:23:19.853627 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.874502 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 10000}}) = 0 10:23:19.874839 lseek(3, 0, SEEK_SET) = 0 10:23:19.875081 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.895976 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 990000}}) = 0 10:23:19.896302 lseek(3, 0, SEEK_SET) = 0 10:23:19.896544 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.917589 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 970000}}) = 0 10:23:19.917915 lseek(3, 0, SEEK_SET) = 0 10:23:19.918157 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.939041 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 950000}}) = 0 10:23:19.939368 lseek(3, 0, SEEK_SET) = 0 10:23:19.939610 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.960527 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 920000}}) = 0 10:23:19.960854 lseek(3, 0, SEEK_SET) = 0 10:23:19.961095 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:19.981968 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.982293 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.982552 lseek(3, 0, SEEK_SET) = 0 10:23:19.982789 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.983048 lseek(3, 0, SEEK_SET) = 0 10:23:19.983278 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.983537 lseek(3, 0, SEEK_SET) = 0 10:23:19.983768 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.984027 lseek(3, 0, SEEK_SET) = 0 10:23:19.984257 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.984516 lseek(3, 0, SEEK_SET) = 0 10:23:19.984745 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.985004 lseek(3, 0, SEEK_SET) = 0 10:23:19.985234 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.985536 lseek(3, 0, SEEK_SET) = 0 10:23:19.985768 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.986027 lseek(3, 0, SEEK_SET) = 0 10:23:19.986257 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.986516 lseek(3, 0, SEEK_SET) = 0 10:23:19.986747 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.987006 lseek(3, 0, SEEK_SET) = 0 10:23:19.987235 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.987494 lseek(3, 0, SEEK_SET) = 0 10:23:19.987724 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.987983 lseek(3, 0, SEEK_SET) = 0 10:23:19.988213 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.988472 lseek(3, 0, SEEK_SET) = 0 10:23:19.988702 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.988961 lseek(3, 0, SEEK_SET) = 0 10:23:19.989191 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.989450 lseek(3, 0, SEEK_SET) = 0 10:23:19.989680 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 900000}}) = 0 10:23:19.989939 lseek(3, 0, SEEK_SET) = 0 10:23:19.990169 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.990452 lseek(3, 0, SEEK_SET) = 0 10:23:19.990682 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.990942 lseek(3, 0, SEEK_SET) = 0 10:23:19.991172 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.991431 lseek(3, 0, SEEK_SET) = 0 10:23:19.991661 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.991920 lseek(3, 0, SEEK_SET) = 0 10:23:19.992150 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.992410 lseek(3, 0, SEEK_SET) = 0 10:23:19.992640 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.992899 lseek(3, 0, SEEK_SET) = 0 10:23:19.993129 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.993388 lseek(3, 0, SEEK_SET) = 0 10:23:19.993618 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.994087 lseek(3, 0, SEEK_SET) = 0 10:23:19.994322 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.994582 lseek(3, 0, SEEK_SET) = 0 10:23:19.994811 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.995070 lseek(3, 0, SEEK_SET) = 0 10:23:19.995300 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.995578 lseek(3, 0, SEEK_SET) = 0 10:23:19.995808 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.996067 lseek(3, 0, SEEK_SET) = 0 10:23:19.996296 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.996555 lseek(3, 0, SEEK_SET) = 0 10:23:19.996785 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.997044 lseek(3, 0, SEEK_SET) = 0 10:23:19.997274 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.997532 lseek(3, 0, SEEK_SET) = 0 10:23:19.997762 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.998021 lseek(3, 0, SEEK_SET) = 0 10:23:19.998251 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.998510 lseek(3, 0, SEEK_SET) = 0 10:23:19.998740 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.998999 lseek(3, 0, SEEK_SET) = 0 10:23:19.999228 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.999487 lseek(3, 0, SEEK_SET) = 0 10:23:19.999716 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 890000}}) = 0 10:23:19.999975 lseek(3, 0, SEEK_SET) = 0 10:23:20.000205 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.000499 lseek(3, 0, SEEK_SET) = 0 10:23:20.000730 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.000990 lseek(3, 0, SEEK_SET) = 0 10:23:20.001220 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.001479 lseek(3, 0, SEEK_SET) = 0 10:23:20.001711 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.001970 lseek(3, 0, SEEK_SET) = 0 10:23:20.002201 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.002460 lseek(3, 0, SEEK_SET) = 0 10:23:20.002690 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.002950 lseek(3, 0, SEEK_SET) = 0 10:23:20.003180 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.003439 lseek(3, 0, SEEK_SET) = 0 10:23:20.003670 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.003929 lseek(3, 0, SEEK_SET) = 0 10:23:20.004160 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.004420 lseek(3, 0, SEEK_SET) = 0 10:23:20.004650 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.004910 lseek(3, 0, SEEK_SET) = 0 10:23:20.005140 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.005399 lseek(3, 0, SEEK_SET) = 0 10:23:20.005645 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.005905 lseek(3, 0, SEEK_SET) = 0 10:23:20.006136 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.006395 lseek(3, 0, SEEK_SET) = 0 10:23:20.006626 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.006886 lseek(3, 0, SEEK_SET) = 0 10:23:20.007117 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.007377 lseek(3, 0, SEEK_SET) = 0 10:23:20.007607 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.007867 lseek(3, 0, SEEK_SET) = 0 10:23:20.008098 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.008358 lseek(3, 0, SEEK_SET) = 0 10:23:20.008589 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.008977 lseek(3, 0, SEEK_SET) = 0 10:23:20.009212 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.009473 lseek(3, 0, SEEK_SET) = 0 10:23:20.009703 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 880000}}) = 0 10:23:20.009963 lseek(3, 0, SEEK_SET) = 0 10:23:20.010193 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.010469 lseek(3, 0, SEEK_SET) = 0 10:23:20.010699 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.010959 lseek(3, 0, SEEK_SET) = 0 10:23:20.011188 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.011448 lseek(3, 0, SEEK_SET) = 0 10:23:20.011678 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.011938 lseek(3, 0, SEEK_SET) = 0 10:23:20.012168 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.012428 lseek(3, 0, SEEK_SET) = 0 10:23:20.012658 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.012918 lseek(3, 0, SEEK_SET) = 0 10:23:20.013148 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.013407 lseek(3, 0, SEEK_SET) = 0 10:23:20.013638 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.013897 lseek(3, 0, SEEK_SET) = 0 10:23:20.014127 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.014387 lseek(3, 0, SEEK_SET) = 0 10:23:20.014617 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.014876 lseek(3, 0, SEEK_SET) = 0 10:23:20.015106 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.015366 lseek(3, 0, SEEK_SET) = 0 10:23:20.015618 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.015878 lseek(3, 0, SEEK_SET) = 0 10:23:20.016108 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.016368 lseek(3, 0, SEEK_SET) = 0 10:23:20.016598 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.016858 lseek(3, 0, SEEK_SET) = 0 10:23:20.017088 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.017348 lseek(3, 0, SEEK_SET) = 0 10:23:20.017578 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.017838 lseek(3, 0, SEEK_SET) = 0 10:23:20.018068 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.018328 lseek(3, 0, SEEK_SET) = 0 10:23:20.018558 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.018818 lseek(3, 0, SEEK_SET) = 0 10:23:20.019048 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.019308 lseek(3, 0, SEEK_SET) = 0 10:23:20.019538 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.019798 lseek(3, 0, SEEK_SET) = 0 10:23:20.020028 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 870000}}) = 0 10:23:20.020303 lseek(3, 0, SEEK_SET) = 0 10:23:20.020534 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.020794 lseek(3, 0, SEEK_SET) = 0 10:23:20.021024 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.021284 lseek(3, 0, SEEK_SET) = 0 10:23:20.021514 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.021774 lseek(3, 0, SEEK_SET) = 0 10:23:20.022005 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.022265 lseek(3, 0, SEEK_SET) = 0 10:23:20.022495 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.022755 lseek(3, 0, SEEK_SET) = 0 10:23:20.022986 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.023246 lseek(3, 0, SEEK_SET) = 0 10:23:20.023476 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.023736 lseek(3, 0, SEEK_SET) = 0 10:23:20.024094 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.024356 lseek(3, 0, SEEK_SET) = 0 10:23:20.024586 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.024846 lseek(3, 0, SEEK_SET) = 0 10:23:20.025075 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.025336 lseek(3, 0, SEEK_SET) = 0 10:23:20.025582 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.025842 lseek(3, 0, SEEK_SET) = 0 10:23:20.026072 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.026332 lseek(3, 0, SEEK_SET) = 0 10:23:20.026562 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.026822 lseek(3, 0, SEEK_SET) = 0 10:23:20.027053 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.027312 lseek(3, 0, SEEK_SET) = 0 10:23:20.027543 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.027803 lseek(3, 0, SEEK_SET) = 0 10:23:20.028034 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.028293 lseek(3, 0, SEEK_SET) = 0 10:23:20.028524 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 860000}}) = 0 10:23:20.028939 write(1, "372 MB in 1.97 seconds = 188.83"..., 40) = 40 10:23:20.029779 fsync(3) = 0 10:23:20.030069 ioctl(3, BLKFLSBUF, 0) = 0 10:23:20.033348 ioctl(3, 0x31f, 0) = 0 10:23:20.033652 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 10:23:20.033970 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0 10:23:20.034239 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 10:23:20.034501 nanosleep({1, 0}, {1, 0}) = 0 10:23:21.045684 shmdt(0x40133000) = 0 10:23:21.049473 ioctl(3, BLKGETSIZE, 0x8053654) = 0 10:23:21.049726 shmget(IPC_PRIVATE, 2097152, 0600) = 589824 10:23:21.050007 shmctl(589824, IPC_64|SHM_LOCK, 0) = 0 10:23:21.050255 shmat(589824, 0, 0) = 0x40133000 10:23:21.050559 shmctl(589824, IPC_64|IPC_RMID, 0) = 0 10:23:21.050783 sync() = 0 10:23:21.059644 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 10:23:21.059968 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0 10:23:21.060235 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 10:23:21.060513 nanosleep({3, 0}, {3, 0}) = 0 10:23:24.075779 write(1, " Timing buffered disk reads: ", 30) = 30 10:23:24.076394 setitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={1000, 0}}, NULL) = 0 10:23:24.076668 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={1000, 10000}}) = 0 10:23:24.076927 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:24.180383 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 900000}}) = 0 10:23:24.180709 read(3, ";\n\tudelay(DelayValue);\n\tval = (d"..., 2097152) = 2097152 10:23:24.275463 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 810000}}) = 0 10:23:24.275817 read(3, "r receive packets.\n */\n#define P"..., 2097152) = 2097152 10:23:24.371503 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 710000}}) = 0 10:23:24.371829 read(3, " ? \"h,sg\" : \"sg\"\n\t\t);\n\n#ifdef PH"..., 2097152) = 2097152 10:23:24.466086 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 620000}}) = 0 10:23:24.466410 read(3, "ERN_ERR \"happymeal: Device does "..., 2097152) = 2097152 10:23:24.561413 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 520000}}) = 0 10:23:24.561740 read(3, "\0\3\206(\0\0\0\2#P\v\0349\0\0\3\211(\0\0\0\2#T\vD+\0\0"..., 2097152) = 2097152 10:23:24.656591 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 430000}}) = 0 10:23:24.656917 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:24.750603 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 330000}}) = 0 10:23:24.750932 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:24.848194 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 240000}}) = 0 10:23:24.848731 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:24.944340 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 140000}}) = 0 10:23:24.944667 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.040785 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 40000}}) = 0 10:23:25.041108 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.135071 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 950000}}) = 0 10:23:25.135398 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.229528 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 860000}}) = 0 10:23:25.229854 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.324099 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 760000}}) = 0 10:23:25.324425 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.418967 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 670000}}) = 0 10:23:25.419297 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.516288 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 570000}}) = 0 10:23:25.516612 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.610935 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 470000}}) = 0 10:23:25.611263 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.705288 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 380000}}) = 0 10:23:25.705634 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.799912 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 290000}}) = 0 10:23:25.800237 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.895995 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 190000}}) = 0 10:23:25.896319 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:25.992286 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 90000}}) = 0 10:23:25.992613 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:26.085528 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 0}}) = 0 10:23:26.085889 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:26.179350 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 910000}}) = 0 10:23:26.179678 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:26.272786 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 810000}}) = 0 10:23:26.273113 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:26.367078 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 720000}}) = 0 10:23:26.367404 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:26.460888 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 620000}}) = 0 10:23:26.461216 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:26.554987 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 530000}}) = 0 10:23:26.555315 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:26.649288 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 440000}}) = 0 10:23:26.649615 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:26.744671 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 340000}}) = 0 10:23:26.744998 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:26.838041 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 250000}}) = 0 10:23:26.838568 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:26.931709 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 150000}}) = 0 10:23:26.932035 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:27.027930 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 60000}}) = 0 10:23:27.028260 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:27.121558 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 960000}}) = 0 10:23:27.121965 write(1, " 64 MB in 3.05 seconds = 20.98"..., 40) = 40 10:23:27.122753 shmdt(0x40133000) = 0 10:23:27.126625 fsync(3) = 0 10:23:27.126890 ioctl(3, BLKFLSBUF, 0) = 0 10:23:27.220177 ioctl(3, 0x31f, 0) = 0 10:23:27.220551 close(3) = 0 10:23:27.220905 munmap(0x40018000, 4096) = 0 10:23:27.221177 exit_group(0) = ? [-- Attachment #3: hdparm-only-disk --] [-- Type: text/plain, Size: 11725 bytes --] 10:22:57.770823 execve("/sbin/hdparm", ["hdparm", "-t", "/dev/hdc"], [/* 50 vars */]) = 0 10:22:57.771705 uname({sys="Linux", node="bart", ...}) = 0 10:22:57.772689 brk(0) = 0x8054000 10:22:57.773054 open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory) 10:22:57.773452 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000 10:22:57.773925 open("/etc/ld.so.cache", O_RDONLY) = 3 10:22:57.774251 fstat64(3, {st_mode=S_IFREG|0644, st_size=23320, ...}) = 0 10:22:57.774737 old_mmap(NULL, 23320, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000 10:22:57.775115 close(3) = 0 10:22:57.775426 open("/lib/tls/libc.so.6", O_RDONLY) = 3 10:22:57.775747 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0PS\1\000"..., 512) = 512 10:22:57.776166 fstat64(3, {st_mode=S_IFREG|0755, st_size=1345609, ...}) = 0 10:22:57.776587 old_mmap(NULL, 1132908, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4001e000 10:22:57.776948 madvise(0x4001e000, 1132908, MADV_SEQUENTIAL|0x1) = 0 10:22:57.777269 old_mmap(0x40128000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x109000) = 0x40128000 10:22:57.777722 old_mmap(0x40130000, 10604, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40130000 10:22:57.778097 close(3) = 0 10:22:57.778982 set_thread_area({entry_number:-1 -> 6, base_addr:0x40017860, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 10:22:57.779324 munmap(0x40018000, 23320) = 0 10:22:57.779770 stat64("/dev/hdc", {st_mode=S_IFBLK|0660, st_rdev=makedev(22, 0), ...}) = 0 10:22:57.780248 open("/dev/hdc", O_RDONLY|O_NONBLOCK) = 3 10:22:57.780669 fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 10:22:57.781096 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000 10:22:57.781421 write(1, "\n", 1) = 1 10:22:57.782221 write(1, "/dev/hdc:\n", 10) = 10 10:22:57.782860 ioctl(3, BLKGETSIZE, 0x8053654) = 0 10:22:57.783205 shmget(IPC_PRIVATE, 2097152, 0600) = 524288 10:22:57.783544 shmctl(524288, IPC_64|SHM_LOCK, 0) = 0 10:22:57.783836 shmat(524288, 0, 0) = 0x40133000 10:22:57.784163 shmctl(524288, IPC_64|IPC_RMID, 0) = 0 10:22:57.784443 sync() = 0 10:22:57.797834 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 10:22:57.798231 rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0 10:22:57.798536 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 10:22:57.798834 nanosleep({3, 0}, {3, 0}) = 0 10:23:00.805197 write(1, " Timing buffered disk reads: ", 30) = 30 10:23:00.805870 setitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={1000, 0}}, NULL) = 0 10:23:00.806201 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={1000, 10000}}) = 0 10:23:00.806506 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:00.891530 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 920000}}) = 0 10:23:00.891925 read(3, ";\n\tudelay(DelayValue);\n\tval = (d"..., 2097152) = 2097152 10:23:00.962824 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 850000}}) = 0 10:23:00.963197 read(3, "r receive packets.\n */\n#define P"..., 2097152) = 2097152 10:23:01.033623 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 780000}}) = 0 10:23:01.033994 read(3, " ? \"h,sg\" : \"sg\"\n\t\t);\n\n#ifdef PH"..., 2097152) = 2097152 10:23:01.105972 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 710000}}) = 0 10:23:01.106340 read(3, "ERN_ERR \"happymeal: Device does "..., 2097152) = 2097152 10:23:01.173562 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 640000}}) = 0 10:23:01.173934 read(3, "\0\3\206(\0\0\0\2#P\v\0349\0\0\3\211(\0\0\0\2#T\vD+\0\0"..., 2097152) = 2097152 10:23:01.244453 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 570000}}) = 0 10:23:01.244819 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.311869 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 500000}}) = 0 10:23:01.312458 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.380664 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 430000}}) = 0 10:23:01.381040 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.448160 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 370000}}) = 0 10:23:01.448535 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.516988 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 300000}}) = 0 10:23:01.517363 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.584412 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 230000}}) = 0 10:23:01.584783 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.653234 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 160000}}) = 0 10:23:01.653607 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.720721 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 90000}}) = 0 10:23:01.721091 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.789568 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={999, 30000}}) = 0 10:23:01.789937 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.856968 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 960000}}) = 0 10:23:01.857339 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.924354 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 890000}}) = 0 10:23:01.924715 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:01.993331 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 820000}}) = 0 10:23:01.993704 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.060780 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 750000}}) = 0 10:23:02.061152 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.129649 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 690000}}) = 0 10:23:02.130019 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.197036 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 620000}}) = 0 10:23:02.197406 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.266060 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 550000}}) = 0 10:23:02.266431 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.333527 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 480000}}) = 0 10:23:02.333899 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.402453 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 410000}}) = 0 10:23:02.402823 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.469857 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 350000}}) = 0 10:23:02.470227 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.538380 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 280000}}) = 0 10:23:02.538752 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.607039 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 210000}}) = 0 10:23:02.607410 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.677108 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 140000}}) = 0 10:23:02.677479 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.744509 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 70000}}) = 0 10:23:02.745134 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.813384 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={998, 0}}) = 0 10:23:02.813754 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.880829 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 930000}}) = 0 10:23:02.881200 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:02.949803 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 870000}}) = 0 10:23:02.950174 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.017326 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 800000}}) = 0 10:23:03.017700 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.084622 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 730000}}) = 0 10:23:03.085032 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.153619 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 660000}}) = 0 10:23:03.153991 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.221053 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 590000}}) = 0 10:23:03.221423 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.305029 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 510000}}) = 0 10:23:03.305559 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.372482 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 440000}}) = 0 10:23:03.372853 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.441417 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 370000}}) = 0 10:23:03.441788 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.508725 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 310000}}) = 0 10:23:03.509094 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.576150 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 240000}}) = 0 10:23:03.576513 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.649065 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 170000}}) = 0 10:23:03.649425 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.718380 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 100000}}) = 0 10:23:03.718751 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.789756 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={997, 30000}}) = 0 10:23:03.790127 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2097152) = 2097152 10:23:03.857294 getitimer(ITIMER_REAL, {it_interval={1000, 0}, it_value={996, 960000}}) = 0 10:23:03.857859 write(1, " 88 MB in 3.05 seconds = 28.85"..., 40) = 40 10:23:03.858959 shmdt(0x40133000) = 0 10:23:03.862757 fsync(3) = 0 10:23:03.863055 ioctl(3, BLKFLSBUF, 0) = 0 10:23:03.992242 ioctl(3, 0x31f, 0) = 0 10:23:03.992635 close(3) = 0 10:23:03.993032 munmap(0x40018000, 4096) = 0 10:23:03.993340 exit_group(0) = ? [-- Attachment #4: read_disk.c --] [-- Type: text/plain, Size: 1400 bytes --] #include <stdio.h> #include <unistd.h> #define __USE_GNU #include <fcntl.h> #include <stdlib.h> #include <sys/time.h> #include <sys/ioctl.h> #include <linux/fs.h> #define BS (2048*1024) #define BLOCKS (256) #define ALIGN(buf) (char *) (((unsigned long) (buf) + 4095) & ~(4095)) void print_time(struct timeval *s, int memory) { unsigned long ms, mb; struct timeval e; mb = BS * BLOCKS / 1024; gettimeofday(&e, NULL); ms = (e.tv_sec - s->tv_sec) * 1000 + (e.tv_usec - s->tv_usec) / 1000; if (memory) printf("Mem Throughput: %lu MiB/sec\n", mb / ms); else printf("Disk Throughput: %lu MiB/sec\n", mb / ms); } void read_stuff(int fd, char *buffer, int memory) { struct timeval s; int i, ret; gettimeofday(&s, NULL); for (i = 0; i < BLOCKS; i++) { if (memory) lseek(fd, 0, SEEK_SET); ret = read(fd, buffer, BS); if (!ret) break; else if (ret < 0) { perror("read infile"); break; } } print_time(&s, memory); } int main(int argc, char *argv[]) { char *buffer; int fd, seek; if (argc < 2) { printf("%s: <device>\n", argv[0]); return 1; } if (argc == 3) seek = 1; else seek = 0; fd = open(argv[1], O_RDONLY); if (fd == -1) { perror("open"); return 2; } ioctl(fd, BLKFLSBUF, 0); buffer = ALIGN(malloc(BS + 4095)); if (seek) { read_stuff(fd, buffer, 1); read_stuff(fd, buffer, 1); } read_stuff(fd, buffer, 0); return 0; } ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-08 8:48 ` Jens Axboe @ 2005-07-08 10:20 ` Ingo Molnar 2005-07-08 11:45 ` Jens Axboe 0 siblings, 1 reply; 67+ messages in thread From: Ingo Molnar @ 2005-07-08 10:20 UTC (permalink / raw) To: Jens Axboe Cc: Linus Torvalds, Grant Coady, Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', linux-ide, linux-kernel * Jens Axboe <axboe@suse.de> wrote: > But! I used hdparm -t solely, 2.6 was always ~5% faster than 2.4. But > using -Tt slowed down the hd speed by about 30%. So it looks like some > scheduler interaction, perhaps the memory timing loops gets it marked > as batch or something? to check whether that could be the case, could you try: nice -n -20 hdparm -t /dev/hdc does that produce different results? Ingo ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-08 10:20 ` Ingo Molnar @ 2005-07-08 11:45 ` Jens Axboe 0 siblings, 0 replies; 67+ messages in thread From: Jens Axboe @ 2005-07-08 11:45 UTC (permalink / raw) To: Ingo Molnar Cc: Linus Torvalds, Grant Coady, Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', linux-ide, linux-kernel On Fri, Jul 08 2005, Ingo Molnar wrote: > > * Jens Axboe <axboe@suse.de> wrote: > > > But! I used hdparm -t solely, 2.6 was always ~5% faster than 2.4. But > > using -Tt slowed down the hd speed by about 30%. So it looks like some > > scheduler interaction, perhaps the memory timing loops gets it marked > > as batch or something? > > to check whether that could be the case, could you try: > > nice -n -20 hdparm -t /dev/hdc > > does that produce different results? Same result, see my next mail, it turned out to be a read-ahead bug. -- Jens Axboe ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-06 0:35 ` Grant Coady 2005-07-06 0:51 ` Linus Torvalds @ 2005-07-07 22:32 ` Mark Lord 2005-07-08 0:06 ` Grant Coady 1 sibling, 1 reply; 67+ messages in thread From: Mark Lord @ 2005-07-07 22:32 UTC (permalink / raw) To: Grant Coady Cc: Jens Axboe, Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel Note: hdparm can also use O_DIRECT for the -t timing test. Eg. hdparm --direct -t /dev/hda ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-07 22:32 ` Mark Lord @ 2005-07-08 0:06 ` Grant Coady 2005-07-08 11:37 ` Erik Slagter 0 siblings, 1 reply; 67+ messages in thread From: Grant Coady @ 2005-07-08 0:06 UTC (permalink / raw) To: Mark Lord Cc: Jens Axboe, Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel On Thu, 07 Jul 2005 18:32:52 -0400, Mark Lord <liml@rtr.ca> wrote: > >hdparm can also use O_DIRECT for the -t timing test. I've not been able to get dual channel I/O speed faster than single interface speed, either as 'md' RAID0 or simultaneous reading or writing done the other day: Time to write or read 500MB file: >summary 2.4.31-hf1 2.6.12.2 >boxen \ time -> w r w r >--------------- ---- ---- ---- ---- ... >peetoo 33 20 26.5 22 >(simultaneuous 57 37.5 52 38.5) MB/s 2.4.31-hf1 2.6.12.2 w r w r single 15 25 19 23 dual 17.5 27 19 26 These timings show very little happening in parallel, is that normal? Thanks, --Grant. ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-08 0:06 ` Grant Coady @ 2005-07-08 11:37 ` Erik Slagter 0 siblings, 0 replies; 67+ messages in thread From: Erik Slagter @ 2005-07-08 11:37 UTC (permalink / raw) To: Grant Coady Cc: Mark Lord, Jens Axboe, Ondrej Zary, André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel [-- Attachment #1: Type: text/plain, Size: 636 bytes --] On Fri, 2005-07-08 at 10:06 +1000, Grant Coady wrote: > I've not been able to get dual channel I/O speed faster than single > interface speed, either as 'md' RAID0 or simultaneous reading or > writing done the other day: > > Time to write or read 500MB file: > > >summary 2.4.31-hf1 2.6.12.2 > >boxen \ time -> w r w r > >--------------- ---- ---- ---- ---- > ... > >peetoo 33 20 26.5 22 > >(simultaneuous 57 37.5 52 38.5) > > MB/s 2.4.31-hf1 2.6.12.2 > w r w r > single 15 25 19 23 > dual 17.5 27 19 26 > > These timings show very little happening in parallel, is that normal? "me too" ;-) [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-05 10:19 ` Ondrej Zary 2005-07-05 10:42 ` Jens Axboe @ 2005-07-06 20:56 ` Bill Davidsen 2005-07-07 13:47 ` Ondrej Zary 2005-07-07 13:48 ` Bartlomiej Zolnierkiewicz 1 sibling, 2 replies; 67+ messages in thread From: Bill Davidsen @ 2005-07-06 20:56 UTC (permalink / raw) To: Ondrej Zary Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel Ondrej Zary wrote: > Jens Axboe wrote: > >> On Tue, Jul 05 2005, Ondrej Zary wrote: >> >>> André Tomt wrote: >>> >>>> Al Boldi wrote: >>>> >>>> >>>>> Bartlomiej Zolnierkiewicz wrote: { >>>>> >>>>> >>>>>>>> On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: >>>>>>>> Hdparm -tT gives 38mb/s in 2.4.31 >>>>>>>> Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle >>>>>>>> >>>>>>>> Hdparm -tT gives 28mb/s in 2.6.12 >>>>>>>> Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT >>>> >>>> >>>> >>>> The "hdparm doesn't get as high scores as in 2.4" is a old discussed >>>> to death "problem" on LKML. So far nobody has been able to show it >>>> affects anything but that pretty useless quasi-benchmark. >>>> >>> >>> No, it's not a problem with hdparm. hdparm only shows that there is >>> _really_ a problem: >>> >>> 2.6.12 >>> root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 >>> count=1048576 >>> 1048576+0 records in >>> 1048576+0 records out >>> >>> real 0m32.339s >>> user 0m1.500s >>> sys 0m14.560s >>> >>> 2.4.26 >>> root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 >>> count=1048576 >>> 1048576+0 records in >>> 1048576+0 records out >>> >>> real 0m23.858s >>> user 0m1.750s >>> sys 0m15.180s >> >> >> >> Perhaps some read-ahead bug. What happens if you use bs=128k for >> instance? >> > Nothing - it's still the same. > > root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=128k > count=4096 > 4096+0 records in > 4096+0 records out > > real 0m32.832s > user 0m0.040s > sys 0m15.670s > Why is the system time so high? I tried that test here, and got: oddball:root> time dd if=/dev/hda of=/dev/null bs=128k count=4096 4096+0 records in 4096+0 records out real 0m37.927s user 0m0.025s sys 0m6.547s oddball:root> uname -rn oddball.prodigy.com 2.6.11ac7 Now this is one of the slowest CPUs still in use (which I why I test responsiveness on it), and it uses far less CPU time. cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 5 model name : Pentium II (Deschutes) stepping : 1 cpu MHz : 348.507 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr bogomips : 686.08 The first post said it felt like running PIO, it certainly is using CPU like it as well. Now here's some dmesg from this system... PIIX4: IDE controller at PCI slot 0000:00:07.1 PIIX4: chipset revision 1 PIIX4: not 100% native mode: will probe irqs later ide0: BM-DMA at 0x1080-0x1087, BIOS settings: hda:DMA, hdb:pio ide1: BM-DMA at 0x1088-0x108f, BIOS settings: hdc:DMA, hdd:pio Probing IDE interface ide0... hda: Maxtor 90845D4, ATA DISK drive hdb: WDC AC31600H, ATA DISK drive hdb: Disabling (U)DMA for WDC AC31600H (blacklisted) ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 Probing IDE interface ide1... hdc: NEC CD-ROM DRIVE:28C, ATAPI CD/DVD-ROM drive ide1 at 0x170-0x177,0x376 on irq 15 hda: max request size: 128KiB hda: 16514064 sectors (8455 MB) w/512KiB Cache, CHS=16383/16/63, UDMA(33) hda: cache flushes not supported hda: hda1 hda2 hda3 hda4 < hda5 > hdb: max request size: 128KiB hdb: 3173184 sectors (1624 MB) w/128KiB Cache, CHS=3148/16/63 hdb: cache flushes not supported hdb: hdb1 hdb2 hdb3 hdc: ATAPI 32X CD-ROM drive, 128kB Cache, UDMA(33) Uniform CD-ROM driver Revision: 3.20 And indeed it does show hda as dma, and hdb as pio (older versions of the kernel let me set hdb to dma and it worked fine...). But in the posted demsg the BIOS settings show pio for hda. Is this in any way relevant, given that UDA(33) appears later? Ondrei: PIIX4: IDE controller at PCI slot 00:07.1 PIIX4: chipset revision 1 PIIX4: not 100% native mode: will probe irqs later ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:pio, hdb:pio ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:pio hda: WDC WD300BB-00AUA1, ATA DISK drive blk: queue c03b3360, I/O limit 4095Mb (mask 0xffffffff) hdd: MSI CD-RW MS-8340S, ATAPI CD/DVD-ROM drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 ide1 at 0x170-0x177,0x376 on irq 15 hda: attached ide-disk driver. hda: host protected area => 1 hda: 58633344 sectors (30020 MB) w/2048KiB Cache, CHS=3649/255/63, UDMA(33) Unless Ondrei's CPU is slower than a PI-350, maybe it is running pio for some reason, in spite of hdparm -i showing udma2 mode. I just mentioned it because the CPU usage doesn't seem compatible with DMA operation. ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-06 20:56 ` Bill Davidsen @ 2005-07-07 13:47 ` Ondrej Zary 2005-07-07 13:48 ` Bartlomiej Zolnierkiewicz 1 sibling, 0 replies; 67+ messages in thread From: Ondrej Zary @ 2005-07-07 13:47 UTC (permalink / raw) To: Bill Davidsen Cc: André Tomt, Al Boldi, 'Bartlomiej Zolnierkiewicz', 'Linus Torvalds', linux-ide, linux-kernel Bill Davidsen wrote: > Ondrej Zary wrote: > >> Jens Axboe wrote: >> >>> On Tue, Jul 05 2005, Ondrej Zary wrote: >>> >>>> André Tomt wrote: >>>> >>>>> Al Boldi wrote: >>>>> >>>>> >>>>>> Bartlomiej Zolnierkiewicz wrote: { >>>>>> >>>>>> >>>>>>>>> On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: >>>>>>>>> Hdparm -tT gives 38mb/s in 2.4.31 >>>>>>>>> Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle >>>>>>>>> >>>>>>>>> Hdparm -tT gives 28mb/s in 2.6.12 >>>>>>>>> Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT >>>>> >>>>> >>>>> >>>>> >>>>> The "hdparm doesn't get as high scores as in 2.4" is a old >>>>> discussed to death "problem" on LKML. So far nobody has been able >>>>> to show it affects anything but that pretty useless quasi-benchmark. >>>>> >>>> >>>> No, it's not a problem with hdparm. hdparm only shows that there is >>>> _really_ a problem: >>>> >>>> 2.6.12 >>>> root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 >>>> count=1048576 >>>> 1048576+0 records in >>>> 1048576+0 records out >>>> >>>> real 0m32.339s >>>> user 0m1.500s >>>> sys 0m14.560s >>>> >>>> 2.4.26 >>>> root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 >>>> count=1048576 >>>> 1048576+0 records in >>>> 1048576+0 records out >>>> >>>> real 0m23.858s >>>> user 0m1.750s >>>> sys 0m15.180s >>> >>> >>> >>> >>> Perhaps some read-ahead bug. What happens if you use bs=128k for >>> instance? >>> >> Nothing - it's still the same. >> >> root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=128k >> count=4096 >> 4096+0 records in >> 4096+0 records out >> >> real 0m32.832s >> user 0m0.040s >> sys 0m15.670s >> > Why is the system time so high? I tried that test here, and got: > > oddball:root> time dd if=/dev/hda of=/dev/null bs=128k count=4096 > 4096+0 records in > 4096+0 records out > > real 0m37.927s > user 0m0.025s > sys 0m6.547s > oddball:root> uname -rn > oddball.prodigy.com 2.6.11ac7 > > Now this is one of the slowest CPUs still in use (which I why I test > responsiveness on it), and it uses far less CPU time. > cat /proc/cpuinfo > processor : 0 > vendor_id : GenuineIntel > cpu family : 6 > model : 5 > model name : Pentium II (Deschutes) > stepping : 1 > cpu MHz : 348.507 > cache size : 512 KB > fdiv_bug : no > hlt_bug : no > f00f_bug : no > coma_bug : no > fpu : yes > fpu_exception : yes > cpuid level : 2 > wp : yes > flags : fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca > cmov pat pse36 mmx fxsr > bogomips : 686.08 > > > The first post said it felt like running PIO, it certainly is using CPU > like it as well. > > Now here's some dmesg from this system... > > PIIX4: IDE controller at PCI slot 0000:00:07.1 > PIIX4: chipset revision 1 > PIIX4: not 100% native mode: will probe irqs later > ide0: BM-DMA at 0x1080-0x1087, BIOS settings: hda:DMA, hdb:pio > ide1: BM-DMA at 0x1088-0x108f, BIOS settings: hdc:DMA, hdd:pio > Probing IDE interface ide0... > hda: Maxtor 90845D4, ATA DISK drive > hdb: WDC AC31600H, ATA DISK drive > hdb: Disabling (U)DMA for WDC AC31600H (blacklisted) > ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 > Probing IDE interface ide1... > hdc: NEC CD-ROM DRIVE:28C, ATAPI CD/DVD-ROM drive > ide1 at 0x170-0x177,0x376 on irq 15 > hda: max request size: 128KiB > hda: 16514064 sectors (8455 MB) w/512KiB Cache, CHS=16383/16/63, UDMA(33) > hda: cache flushes not supported > hda: hda1 hda2 hda3 hda4 < hda5 > > hdb: max request size: 128KiB > hdb: 3173184 sectors (1624 MB) w/128KiB Cache, CHS=3148/16/63 > hdb: cache flushes not supported > hdb: hdb1 hdb2 hdb3 > hdc: ATAPI 32X CD-ROM drive, 128kB Cache, UDMA(33) > Uniform CD-ROM driver Revision: 3.20 > > > And indeed it does show hda as dma, and hdb as pio (older versions of > the kernel let me set hdb to dma and it worked fine...). But in the > posted demsg the BIOS settings show pio for hda. Is this in any way > relevant, given that UDA(33) appears later? I've had AC31600H drive too and it used to run fine in DMA mode for ages (at least in Windows). No idea why it is blacklisted. > > Ondrei: > > PIIX4: IDE controller at PCI slot 00:07.1 > PIIX4: chipset revision 1 > PIIX4: not 100% native mode: will probe irqs later > ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:pio, hdb:pio > ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:pio > hda: WDC WD300BB-00AUA1, ATA DISK drive > blk: queue c03b3360, I/O limit 4095Mb (mask 0xffffffff) > hdd: MSI CD-RW MS-8340S, ATAPI CD/DVD-ROM drive > ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 > ide1 at 0x170-0x177,0x376 on irq 15 > hda: attached ide-disk driver. > hda: host protected area => 1 > hda: 58633344 sectors (30020 MB) w/2048KiB Cache, CHS=3649/255/63, UDMA(33) > > > Unless Ondrei's CPU is slower than a PI-350, maybe it is running pio for > some reason, in spite of hdparm -i showing udma2 mode. > > I just mentioned it because the CPU usage doesn't seem compatible with > DMA operation. > Yes, the CPU is slower. It's Cyrix MII PR300 (225MHz): root@pentium:/home/rainbow# cat /proc/cpuinfo processor : 0 vendor_id : CyrixInstead cpu family : 6 model : 2 model name : M II 3x Core/Bus Clock stepping : 4 cpu MHz : 225.004 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu de tsc msr cx8 pge cmov mmx cyrix_arr bogomips : 448.92 With PIO, it's much slower. -- Ondrej Zary ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-06 20:56 ` Bill Davidsen 2005-07-07 13:47 ` Ondrej Zary @ 2005-07-07 13:48 ` Bartlomiej Zolnierkiewicz 2005-07-07 19:34 ` Bill Davidsen 1 sibling, 1 reply; 67+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2005-07-07 13:48 UTC (permalink / raw) To: Bill Davidsen Cc: Ondrej Zary, André Tomt, Al Boldi, Linus Torvalds, linux-ide, linux-kernel On 7/6/05, Bill Davidsen <davidsen@tmr.com> wrote: > Ondrej Zary wrote: > > Jens Axboe wrote: > > > >> On Tue, Jul 05 2005, Ondrej Zary wrote: > >> > >>> André Tomt wrote: > >>> > >>>> Al Boldi wrote: > >>>> > >>>> > >>>>> Bartlomiej Zolnierkiewicz wrote: { > >>>>> > >>>>> > >>>>>>>> On 7/4/05, Al Boldi <a1426z@gawab.com> wrote: > >>>>>>>> Hdparm -tT gives 38mb/s in 2.4.31 > >>>>>>>> Cat /dev/hda > /dev/null gives 2% user 33% sys 65% idle > >>>>>>>> > >>>>>>>> Hdparm -tT gives 28mb/s in 2.6.12 > >>>>>>>> Cat /dev/hda > /dev/null gives 2% user 25% sys 0% idle 73% IOWAIT > >>>> > >>>> > >>>> > >>>> The "hdparm doesn't get as high scores as in 2.4" is a old discussed > >>>> to death "problem" on LKML. So far nobody has been able to show it > >>>> affects anything but that pretty useless quasi-benchmark. > >>>> > >>> > >>> No, it's not a problem with hdparm. hdparm only shows that there is > >>> _really_ a problem: > >>> > >>> 2.6.12 > >>> root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 > >>> count=1048576 > >>> 1048576+0 records in > >>> 1048576+0 records out > >>> > >>> real 0m32.339s > >>> user 0m1.500s > >>> sys 0m14.560s > >>> > >>> 2.4.26 > >>> root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=512 > >>> count=1048576 > >>> 1048576+0 records in > >>> 1048576+0 records out > >>> > >>> real 0m23.858s > >>> user 0m1.750s > >>> sys 0m15.180s > >> > >> > >> > >> Perhaps some read-ahead bug. What happens if you use bs=128k for > >> instance? > >> > > Nothing - it's still the same. > > > > root@pentium:/home/rainbow# time dd if=/dev/hda of=/dev/null bs=128k > > count=4096 > > 4096+0 records in > > 4096+0 records out > > > > real 0m32.832s > > user 0m0.040s > > sys 0m15.670s > > > Why is the system time so high? I tried that test here, and got: > > oddball:root> time dd if=/dev/hda of=/dev/null bs=128k count=4096 > 4096+0 records in > 4096+0 records out > > real 0m37.927s > user 0m0.025s > sys 0m6.547s > oddball:root> uname -rn > oddball.prodigy.com 2.6.11ac7 > > Now this is one of the slowest CPUs still in use (which I why I test > responsiveness on it), and it uses far less CPU time. > cat /proc/cpuinfo > processor : 0 > vendor_id : GenuineIntel > cpu family : 6 > model : 5 > model name : Pentium II (Deschutes) > stepping : 1 > cpu MHz : 348.507 > cache size : 512 KB > fdiv_bug : no > hlt_bug : no > f00f_bug : no > coma_bug : no > fpu : yes > fpu_exception : yes > cpuid level : 2 > wp : yes > flags : fpu vme de tsc msr pae mce cx8 apic sep mtrr pge mca > cmov pat pse36 mmx fxsr > bogomips : 686.08 > > > The first post said it felt like running PIO, it certainly is using CPU > like it as well. > > Now here's some dmesg from this system... > > PIIX4: IDE controller at PCI slot 0000:00:07.1 > PIIX4: chipset revision 1 > PIIX4: not 100% native mode: will probe irqs later > ide0: BM-DMA at 0x1080-0x1087, BIOS settings: hda:DMA, hdb:pio > ide1: BM-DMA at 0x1088-0x108f, BIOS settings: hdc:DMA, hdd:pio > Probing IDE interface ide0... > hda: Maxtor 90845D4, ATA DISK drive > hdb: WDC AC31600H, ATA DISK drive > hdb: Disabling (U)DMA for WDC AC31600H (blacklisted) > ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 > Probing IDE interface ide1... > hdc: NEC CD-ROM DRIVE:28C, ATAPI CD/DVD-ROM drive > ide1 at 0x170-0x177,0x376 on irq 15 > hda: max request size: 128KiB > hda: 16514064 sectors (8455 MB) w/512KiB Cache, CHS=16383/16/63, UDMA(33) > hda: cache flushes not supported > hda: hda1 hda2 hda3 hda4 < hda5 > > hdb: max request size: 128KiB > hdb: 3173184 sectors (1624 MB) w/128KiB Cache, CHS=3148/16/63 > hdb: cache flushes not supported > hdb: hdb1 hdb2 hdb3 > hdc: ATAPI 32X CD-ROM drive, 128kB Cache, UDMA(33) > Uniform CD-ROM driver Revision: 3.20 > > > And indeed it does show hda as dma, and hdb as pio (older versions of > the kernel let me set hdb to dma and it worked fine...). But in the > posted demsg the BIOS settings show pio for hda. Is this in any way > relevant, given that UDA(33) appears later? BIOS setting is irrelevant and ~14MB/s for UDMA33 is OK. CPU cycles are wasted somewhere else... ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-07 13:48 ` Bartlomiej Zolnierkiewicz @ 2005-07-07 19:34 ` Bill Davidsen 0 siblings, 0 replies; 67+ messages in thread From: Bill Davidsen @ 2005-07-07 19:34 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz Cc: Ondrej Zary, André Tomt, Al Boldi, linux-ide, linux-kernel Bartlomiej Zolnierkiewicz wrote: > BIOS setting is irrelevant and ~14MB/s for UDMA33 is OK. > CPU cycles are wasted somewhere else... After seeing how poorly Linux copes with bad info coming out of ACPI, I no longer assume that BIOS information is ignored. Thought it was worth mentioning. -- -bill davidsen (davidsen@tmr.com) "The secret to procrastination is to put things off until the last possible moment - but no longer" -me ^ permalink raw reply [flat|nested] 67+ messages in thread
* Re: [git patches] IDE update 2005-07-03 16:52 [git patches] IDE update Bartlomiej Zolnierkiewicz 2005-07-04 12:01 ` Al Boldi @ 2005-07-05 2:47 ` Jeff Garzik 1 sibling, 0 replies; 67+ messages in thread From: Jeff Garzik @ 2005-07-05 2:47 UTC (permalink / raw) To: linux-ide, linux-kernel; +Cc: Bartlomiej Zolnierkiewicz, Linus Torvalds Bartlomiej Zolnierkiewicz wrote: > > Hi, > > Please pull from: > rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6.git > > diffstat+changelog below > > Bartlomiej > > > drivers/ide/Makefile | 1 - > drivers/ide/ide-lib.c | 13 +++++-------- > drivers/ide/pci/alim15x3.c | 10 +++++----- > drivers/ide/pci/amd74xx.c | 7 +++++-- > drivers/ide/pci/cs5530.c | 4 ++-- > drivers/ide/pci/cy82c693.c | 8 ++++---- > drivers/ide/pci/it8172.c | 4 ++-- > drivers/ide/pci/ns87415.c | 2 +- > drivers/ide/pci/opti621.c | 2 +- > drivers/ide/pci/sc1200.c | 2 +- > drivers/ide/pci/sl82c105.c | 6 +++--- > drivers/ide/pci/slc90e66.c | 2 +- > drivers/ide/pci/triflex.c | 2 +- > drivers/ide/pci/via82cxxx.c | 4 ++-- > include/linux/pci_ids.h | 1 + > 15 files changed, 34 insertions(+), 34 deletions(-) FWIW, we should encourage the janitors to submit patches larger than simply one patch per file. Spreading the -same- logical change across multiple patches is really taking the "split it up" mantra too far. We want logical changes separated... but this just spams the log IMO. All of the __devinit changes could have been rolled into a single patch, since its going to a single maintainer (Bart). Jeff ^ permalink raw reply [flat|nested] 67+ messages in thread
end of thread, other threads:[~2007-07-09 21:31 UTC | newest] Thread overview: 67+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-05-09 22:46 [git patches] IDE update Bartlomiej Zolnierkiewicz 2007-05-09 22:46 ` Jeff Garzik 2007-05-09 23:20 ` David Miller 2007-05-09 23:23 ` Bartlomiej Zolnierkiewicz 2007-05-09 23:18 ` Jeff Garzik 2007-05-09 22:47 ` Jeff Garzik 2007-05-09 22:59 ` Andrew Morton 2007-05-09 23:15 ` Jeff Garzik -- strict thread matches above, loose matches on Subject: below -- 2007-07-09 21:46 Bartlomiej Zolnierkiewicz 2005-12-15 2:03 [git patches] ide update Bartlomiej Zolnierkiewicz 2005-11-19 23:46 Bartlomiej Zolnierkiewicz 2005-11-18 23:21 Bartlomiej Zolnierkiewicz 2005-11-10 1:00 Bartlomiej Zolnierkiewicz 2005-08-18 21:37 Bartlomiej Zolnierkiewicz 2005-08-18 22:15 ` Linus Torvalds 2005-08-18 22:19 ` Nish Aravamudan 2005-08-19 0:44 ` Mark Lord 2005-08-18 23:08 ` Alan Cox 2005-08-19 9:02 ` Bartlomiej Zolnierkiewicz 2005-08-19 18:06 ` Alan Cox 2005-08-19 23:51 ` Bartlomiej Zolnierkiewicz 2005-08-19 23:52 ` Bartlomiej Zolnierkiewicz 2005-07-03 16:52 [git patches] IDE update Bartlomiej Zolnierkiewicz 2005-07-04 12:01 ` Al Boldi 2005-07-04 12:30 ` Bartlomiej Zolnierkiewicz 2005-07-04 15:30 ` Al Boldi 2005-07-04 15:41 ` Bartlomiej Zolnierkiewicz 2005-07-04 17:06 ` Al Boldi 2005-07-04 17:38 ` Ondrej Zary 2005-07-04 19:51 ` Bartlomiej Zolnierkiewicz 2005-07-04 20:32 ` Al Boldi 2005-07-04 20:47 ` Bartlomiej Zolnierkiewicz 2005-07-04 23:25 ` André Tomt 2005-07-05 10:01 ` Ondrej Zary 2005-07-05 10:14 ` Jens Axboe 2005-07-05 10:19 ` Ondrej Zary 2005-07-05 10:42 ` Jens Axboe 2005-07-05 12:35 ` Ondrej Zary 2005-07-05 12:51 ` Jens Axboe 2005-07-05 13:02 ` Ondrej Zary 2005-07-05 13:11 ` Jens Axboe 2005-07-05 15:51 ` Ondrej Zary 2005-07-05 14:21 ` Jens Axboe 2005-07-05 15:00 ` Ondrej Zary 2005-07-05 19:18 ` Jens Axboe 2005-07-05 19:25 ` Jens Axboe 2005-07-05 21:36 ` Ondrej Zary 2005-07-05 17:27 ` Linus Torvalds 2005-07-05 19:14 ` Jens Axboe 2005-07-05 21:39 ` Ondrej Zary 2005-07-11 14:21 ` Alan Cox 2005-07-06 0:35 ` Grant Coady 2005-07-06 0:51 ` Linus Torvalds 2005-07-06 3:26 ` Al Boldi 2005-07-06 4:56 ` Grant Coady 2005-07-06 5:22 ` Linus Torvalds 2005-07-08 8:48 ` Jens Axboe 2005-07-08 10:20 ` Ingo Molnar 2005-07-08 11:45 ` Jens Axboe 2005-07-07 22:32 ` Mark Lord 2005-07-08 0:06 ` Grant Coady 2005-07-08 11:37 ` Erik Slagter 2005-07-06 20:56 ` Bill Davidsen 2005-07-07 13:47 ` Ondrej Zary 2005-07-07 13:48 ` Bartlomiej Zolnierkiewicz 2005-07-07 19:34 ` Bill Davidsen 2005-07-05 2:47 ` Jeff Garzik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).