IDE updates [part 1]
Subsystems (5)
Hi,
A lot of stuff got queued for 2.6.27, for a start:
* Removal of the on-stack struct request instances + conversion of IDE code to use blk_execute_rq() from FUJITA Tomonori.
[ There also few small block patches included as they depend on
the above IDE changes - this was acked by Jens. ]
* ide_driveid_update() bugfix to correctly mask drive's interrupts from Mikhail Cherkashin.
* ATAPI support unification (generic code resides now in ide-atapi.c and ide-{floppy,tape,scsi} device drivers were converted to use it), in the process many bugs were shaken out and 300 LOC is gone.
* Code sanitization fixes from Borislav Petkov and Harvey Harrison.
* Removal of obsoleted old-style kernel parameters (another 300 LOC gone).
* Misc fixes/cleanups.
Linus, please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git/
to receive the following updates:
Documentation/kernel-parameters.txt | 3 - block/blk-core.c | 12 +- block/blk-exec.c | 6 +- drivers/block/paride/pd.c | 20 +- drivers/ide/Kconfig | 6 + drivers/ide/Makefile | 1 + drivers/ide/arm/palm_bk3710.c | 3 +- drivers/ide/h8300/ide-h8300.c | 6 +- drivers/ide/ide-acpi.c | 6 +- drivers/ide/ide-atapi.c | 296 ++++++++++++++++++ drivers/ide/ide-cd.c | 122 ++++---- drivers/ide/ide-cd.h | 4 +- drivers/ide/ide-cd_ioctl.c | 113 ++++---- drivers/ide/ide-disk.c | 13 +- drivers/ide/ide-dma.c | 4 +- drivers/ide/ide-floppy.c | 357 +++++------------------ drivers/ide/ide-io.c | 114 ++------ drivers/ide/ide-iops.c | 38 +-- drivers/ide/ide-probe.c | 10 +- drivers/ide/ide-tape.c | 561 ++++++++++------------------------- drivers/ide/ide-taskfile.c | 38 ++- drivers/ide/ide-timing.h | 1 - drivers/ide/ide.c | 360 ++--------------------- drivers/ide/legacy/ali14xx.c | 2 +- drivers/ide/legacy/gayle.c | 4 +- drivers/ide/legacy/ht6560b.c | 2 +- drivers/ide/legacy/qd65xx.c | 4 +- drivers/ide/pci/aec62xx.c | 2 +- drivers/ide/pci/alim15x3.c | 2 +- drivers/ide/pci/amd74xx.c | 16 +- drivers/ide/pci/cmd640.c | 8 +- drivers/ide/pci/cmd64x.c | 4 +- drivers/ide/pci/cy82c693.c | 2 +- drivers/ide/pci/hpt366.c | 3 +- drivers/ide/pci/ns87415.c | 4 +- drivers/ide/pci/scc_pata.c | 12 +- drivers/ide/pci/sgiioc4.c | 7 +- drivers/ide/pci/siimage.c | 25 +- drivers/ide/pci/via82cxxx.c | 16 +- drivers/ide/ppc/pmac.c | 6 +- drivers/ide/setup-pci.c | 4 +- drivers/scsi/ide-scsi.c | 302 +++++-------------- include/linux/blkdev.h | 1 - include/linux/ide.h | 55 ++-- 44 files changed, 927 insertions(+), 1648 deletions(-) create mode 100644 drivers/ide/ide-atapi.c
Bartlomiej Zolnierkiewicz (57):
ide: set REQ_PREEMPT request flag in ide_do_drive_cmd() users
ide: use __generic_unplug_device() in ide_do_drive_cmd() (take 2)
block: handle blk_pm_resume_request() requests in blk_execute_rq_nowait()
ide: remove obsoleted "idebus=" kernel parameter
ide: remove obsoleted "hdx=" kernel parameters
ide: cleanup init_ide_data()
ide: remove obsoleted "ide=" kernel parameters
ide: remove try_to_flush_leftover_data()
sgiioc4: use ->extra_base instead of ->dma_status for dma_handle
ide: remove commented out code from ide_config_drive_speed()
ide: fix do_probe() to use SELECT_DRIVE()
ide: remove IDE_TFLAG_NO_SELECT_MASK taskfile flag
ide: move IRQ unmasking out from ->tf_load method
ide: remove ->mmio flag from ide_hwif_t
ide: pass 'hwif *' instead of 'drive *' to ->OUTBSYNC method
ide: use ->OUTBSYNC in init_irq()
ide: use ->OUTBSYNC in ide_set_irq()
ide: remove drive->ctl
ide-scsi: fix race in idescsi_transfer_pc()
ide-scsi: fix DRQ checking for DMA transfers in idescsi_pc_intr()
ide-scsi: fix handling of DMA errors in idescsi_pc_intr()
ide-scsi: fix Interrupt Reason checking in idescsi_pc_intr()
ide-scsi: merge idescsi_input_buffers() and idescsi_output_buffers()
ide-scsi: remove superfluous BUG_ON() from idescsi_transfer_pc()
ide-scsi: add debug_log() macro
ide-tape: idetape_pc_intr() should use local_irq_enable_in_hardirq()
ide-tape: remove superfluous error message from idetape_pc_intr()
ide-tape: remove superfluous warning message from idetape_issue_pc()
ide-tape: remove unneeded CONFIG_BLK_DEV_IDEDMA ifdef
ide-tape: remove stale comments from idetape_pc_intr()
ide-tape: remove SIMULATE_ERRORS debug code
ide-floppy: merge idefloppy_transfer_pc() and idefloppy_transfer_pc1() ide-{floppy,tape,scsi}: log device name instead of driver name
ide-tape: make idetape_retry_pc() void
ide-tape: merge callbacks
ide-tape: make pc->idetape_callback void
ide-{floppy,tape}: merge pc->idefloppy_callback and pc->idetape_callback ide-{floppy,tape}: PC_FLAG_DMA_RECOMMENDED -> PC_FLAG_DMA_OK
ide-floppy: start DMA engine in idefloppy_transfer_pc1()
ide-tape: set PC_FLAG_DMA_IN_PROGRESS flag in idetape_transfer_pc()
ide-tape: factor out waiting for good ireason from idetape_transfer_pc()
ide: add PC_FLAG_ZIP_DRIVE pc flag
ide-{cd,floppy,tape}: remove checking for drive->scsi
ide-scsi: set drive->scsi flag for devices handled by the driver
ide: add ide_transfer_pc() helper
ide-scsi: move idescsi_map_sg() call out from idescsi_issue_pc()
ide: add PC_FLAG_DRQ_INTERRUPT pc flag
ide: add ide_issue_pc() helper
ide-{floppy,tape}: move checking of ->failed_pc to ->callback
ide-tape: factor out DSC handling from idetape_pc_intr()
ide-tape: add ide_tape_io_buffers() helper
ide-tape: always log debug info in idetape_pc_intr() if debugging is enabled
ide-floppy: add more debugging to idefloppy_pc_intr()
ide-scsi: use pc->callback
ide-scsi: add more debugging to idescsi_pc_intr() ide-{floppy,scsi}: read Status Register before stopping DMA engine
ide: add ide_pc_intr() helper
Borislav Petkov (3):
ide-floppy: merge callbacks
ide-tape: unify idetape_create_read/write_cmd
ide-floppy: fix unfortunate function naming
FUJITA Tomonori (15):
ide-cd: convert ide_cd_queue_pc to use blk_execute_rq
ide-cd: convert ide_do_drive_cmd path to use blk_execute_rq
ide-disk: convert ide_do_drive_cmd path to use blk_execute_rq
ide-floppy: convert ide_do_drive_cmd path to use blk_execute_rq
ide-taskfile: convert ide_do_drive_cmd path to use blk_execute_rq
ide-tape: convert ide_do_drive_cmd path to use blk_execute_rq
ide: convert ide_do_drive_cmd path to use blk_execute_rq
ide: remove ide_wait/head_wait path in ide_do_drive_cmd
ide: remove ide_init_drive_cmd
ide-cd: remove ide_cd_init_rq
block: convert pd_special_command to use blk_execute_rq
block: remove the checking for NULL queue in blk_put_request
block: unexport blk_end_sync_rq
ide-scsi: replace ide_do_drive_cmd with blk_execute_rq_nowait
ide: remove action argument in ide_do_drive_cmd
Harvey Harrison (3):
ide: eliminate FIT() macro
ide-tape: use clamp_t() rather than nested min_t()/max_t()
ide: use get_unaligned_* helpers
Mikhail Cherkashin (2):
palm_bk3710: fix tRP for UDMA mode 4
ide: disable drive interrupts in ide_driveid_update()
Documentation/kernel-parameters.txt +0 -3
@@ -722,9 +722,6 @@ and is between 256 and 4096 characters. It is defined in the file hd= [EIDE] (E)IDE hard drive subsystem geometry Format: <cyl>,<head>,<sect> - hd?= [HW] (E)IDE subsystem - hd?lun= See Documentation/ide/ide.txt. - highmem=nn[KMG] [KNL,BOOT] forces the highmem zone to have an exact size of <nn>. This works even on boxes that have no highmem otherwise. This also works to reduce highmem
block/blk-core.c +3 -9
@@ -1042,15 +1042,9 @@ void blk_put_request(struct request *req)unsigned long flags;struct request_queue *q = req->q; -/* -* Gee, IDE calls in w/ NULL q. Fix IDE and remove the -* following if (q) test. -*/ -if (q) { -spin_lock_irqsave (q->queue_lock, flags); -__blk_put_request (q, req); -spin_unlock_irqrestore (q->queue_lock, flags); - } +spin_lock_irqsave (q->queue_lock, flags); +__blk_put_request (q, req); +spin_unlock_irqrestore (q->queue_lock, flags); }EXPORT_SYMBOL (blk_put_request);
block/blk-exec.c +4 -2
@@ -18,7 +18,7 @@* @rq: request to complete * @error: end io status of the request */ -void blk_end_sync_rq (struct request *rq,int error) +static void blk_end_sync_rq (struct request *rq,int error) {struct completion *waiting = rq->end_io_data;
@@ -31,7 +31,6 @@ void blk_end_sync_rq(struct request *rq, int error)*/ complete (waiting); } -EXPORT_SYMBOL (blk_end_sync_rq);/** * blk_execute_rq_nowait - insert a request into queue for execution
@@ -58,6 +57,9 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,spin_lock_irq (q->queue_lock);__elv_add_request (q, rq, where,1 );__generic_unplug_device (q); +/* the queue is stopped so it won't be plugged+unplugged */ +if (blk_pm_resume_request (rq)) + q->request_fn (q);spin_unlock_irq (q->queue_lock); }EXPORT_SYMBOL_GPL (blk_execute_rq_nowait);
drivers/block/paride/pd.c +9 -11
@@ -712,19 +712,17 @@ static void do_pd_request(struct request_queue * q)static int pd_special_command (struct pd_unit *disk,enum action (*func)(struct pd_unit *disk)) { -DECLARE_COMPLETION_ONSTACK (wait); -struct request rq; +struct request *rq;int err =0 ; -blk_rq_init (NULL , &rq); - rq.rq_disk = disk->gd; - rq.end_io_data = &wait; - rq.end_io = blk_end_sync_rq; -blk_insert_request (disk->gd->queue, &rq,0 , func); -wait_for_completion (&wait); -if (rq.errors) - err = -EIO ; -blk_put_request (&rq); + rq =blk_get_request (disk->gd->queue,READ , __GFP_WAIT); + + rq->cmd_type =REQ_TYPE_SPECIAL ; + rq->special = func; + + err =blk_execute_rq (disk->gd->queue, disk->gd, rq,0 ); + +blk_put_request (rq);return err; }
drivers/ide/Kconfig +6 -0
@@ -98,6 +98,9 @@ if BLK_DEV_IDE comment "Please see Documentation/ide/ide.txt for help/info on IDE drives" +config IDE_ATAPI + bool + config BLK_DEV_IDE_SATA bool "Support for SATA (deprecated; conflicts with libata SATA driver)" default n
@@ -201,6 +204,7 @@ config BLK_DEV_IDECD_VERBOSE_ERRORS config BLK_DEV_IDETAPE tristate "Include IDE/ATAPI TAPE support" + select IDE_ATAPI help If you have an IDE tape drive using the ATAPI protocol, say Y. ATAPI is a newer protocol used by IDE tape and CD-ROM drives,
@@ -223,6 +227,7 @@ config BLK_DEV_IDETAPE config BLK_DEV_IDEFLOPPY tristate "Include IDE/ATAPI FLOPPY support" + select IDE_ATAPI ---help--- If you have an IDE floppy drive which uses the ATAPI protocol, answer Y. ATAPI is a newer protocol used by IDE CD-ROM/tape/floppy
@@ -246,6 +251,7 @@ config BLK_DEV_IDEFLOPPY config BLK_DEV_IDESCSI tristate "SCSI emulation support" depends on SCSI + select IDE_ATAPI ---help--- WARNING: ide-scsi is no longer needed for cd writing applications! The 2.6 kernel supports direct writing to ide-cd, which eliminates
drivers/ide/Makefile +1 -0
@@ -14,6 +14,7 @@ EXTRA_CFLAGS += -Idrivers/ide ide-core-y += ide.o ide-io.o ide-iops.o ide-lib.o ide-probe.o ide-taskfile.o # core IDE code +ide-core-$(CONFIG_IDE_ATAPI) += ide-atapi.o ide-core-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o ide-core-$(CONFIG_BLK_DEV_IDEDMA) += ide-dma.o ide-core-$(CONFIG_IDE_PROC_FS) += ide-proc.o
drivers/ide/arm/palm_bk3710.c +1 -2
@@ -83,7 +83,7 @@ static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = { {125, 160}, /* UDMA Mode 1 */ {100, 120}, /* UDMA Mode 2 */ {100, 90}, /* UDMA Mode 3 */ - {85, 60}, /* UDMA Mode 4 */ + {100, 60}, /* UDMA Mode 4 */ }; static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev,
@@ -405,7 +405,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)ide_init_port_data (hwif, i);ide_init_port_hw (hwif, &hw); - hwif->mmio =1 ;default_hwif_mmiops (hwif); idx[0 ] = i;
drivers/ide/h8300/ide-h8300.c +2 -4
@@ -52,8 +52,6 @@ static void h8300_tf_load(ide_drive_t *drive, ide_task_t *task)if (task->tf_flags &IDE_TFLAG_FLAGGED )HIHI =0xFF ; -ide_set_irq (drive,1 ); -if (task->tf_flags &IDE_TFLAG_OUT_DATA )mm_outw ((tf->hob_data <<8 ) | tf->data, io_ports->data_addr);
@@ -98,7 +96,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task) }/* be sure we're looking at the low order bits */ -outb (drive->ctl & ~0x80 , io_ports->ctl_addr); +outb (ATA_DEVCTL_OBS & ~0x80 , io_ports->ctl_addr);if (task->tf_flags &IDE_TFLAG_IN_NSECT ) tf->nsect =inb (io_ports->nsect_addr);
@@ -112,7 +110,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task) tf->device =inb (io_ports->device_addr);if (task->tf_flags &IDE_TFLAG_LBA48 ) { -outb (drive->ctl |0x80 , io_ports->ctl_addr); +outb (ATA_DEVCTL_OBS |0x80 , io_ports->ctl_addr);if (task->tf_flags &IDE_TFLAG_IN_HOB_FEATURE ) tf->hob_feature =inb (io_ports->feature_addr);
drivers/ide/ide-acpi.c +3 -3
@@ -60,15 +60,15 @@ struct ide_acpi_hwif_link { #define DEBPRINT(fmt, args...) do {} while (0)#endif /* DEBUGGING */ -int ide_noacpi; +static int ide_noacpi;module_param_named (noacpi, ide_noacpi, bool,0 );MODULE_PARM_DESC (noacpi,"disable IDE ACPI support" ); -int ide_acpigtf; +static int ide_acpigtf;module_param_named (acpigtf, ide_acpigtf, bool,0 );MODULE_PARM_DESC (acpigtf,"enable IDE ACPI _GTF support" ); -int ide_acpionboot; +static int ide_acpionboot;module_param_named (acpionboot, ide_acpionboot, bool,0 );MODULE_PARM_DESC (acpionboot,"call IDE ACPI methods on boot" );
drivers/ide/ide-atapi.c new file +296 -0
296 lines not on this page · raw message
drivers/ide/ide-cd.c +60 -62
221 lines not on this page · raw message
drivers/ide/ide-cd.h +2 -2
@@ -143,8 +143,8 @@ struct cdrom_info {void ide_cd_log_error (const char *,struct request *,struct request_sense *);/* ide-cd.c functions used by ide-cd_ioctl.c */ -void ide_cd_init_rq (ide_drive_t *,struct request *); -int ide_cd_queue_pc (ide_drive_t *,struct request *); +int ide_cd_queue_pc (ide_drive_t *,const unsigned char *,int ,void *, +unsigned *,struct request_sense *,int ,unsigned int );int ide_cd_read_toc (ide_drive_t *,struct request_sense *);int ide_cdrom_get_capabilities (ide_drive_t *,u8 *);void ide_cdrom_update_speed (ide_drive_t *,u8 *);
drivers/ide/ide-cd_ioctl.c +54 -59
218 lines not on this page · raw message
drivers/ide/ide-disk.c +7 -6
@@ -198,8 +198,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, }memset (&task,0 ,sizeof (task)); - task.tf_flags =IDE_TFLAG_NO_SELECT_MASK ;/* FIXME? */ - task.tf_flags |= (IDE_TFLAG_TF |IDE_TFLAG_DEVICE ); + task.tf_flags =IDE_TFLAG_TF |IDE_TFLAG_DEVICE ;if (drive->select.b.lba) {if (lba48) {
@@ -617,7 +616,8 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)*/ static int set_multcount (ide_drive_t *drive,int arg) { -struct request rq; +struct request *rq; +int error;if (arg <0 || arg > drive->id->max_multsect)return -EINVAL ;
@@ -625,12 +625,13 @@ static int set_multcount(ide_drive_t *drive, int arg)if (drive->special.b.set_multmode)return -EBUSY ; -ide_init_drive_cmd (&rq); - rq.cmd_type =REQ_TYPE_ATA_TASKFILE ; + rq =blk_get_request (drive->queue,READ , __GFP_WAIT); + rq->cmd_type =REQ_TYPE_ATA_TASKFILE ; drive->mult_req = arg; drive->special.b.set_multmode =1 ; - (void )ide_do_drive_cmd (drive, &rq, ide_wait); + error =blk_execute_rq (drive->queue,NULL , rq,0 ); +blk_put_request (rq);return (drive->mult_count == arg) ?0 : -EIO ; }
drivers/ide/ide-dma.c +2 -2
@@ -463,7 +463,7 @@ int ide_dma_setup(ide_drive_t *drive) }/* PRD table */ -if (hwif->mmio) +if (hwif->host_flags &IDE_HFLAG_MMIO )writel (hwif->dmatable_dma, (void __iomem *)(hwif->dma_base +ATA_DMA_TABLE_OFS ));else
@@ -692,7 +692,7 @@ static int ide_tune_dma(ide_drive_t *drive)ide_hwif_t *hwif = drive->hwif;u8 speed; -if (noautodma || drive->nodma || (drive->id->capability &1 ) ==0 ) +if (drive->nodma || (drive->id->capability &1 ) ==0 )return 0 ;/* consult the list of known "bad" drives */
drivers/ide/ide-floppy.c +71 -286
489 lines not on this page · raw message
drivers/ide/ide-io.c +18 -96
158 lines not on this page · raw message
drivers/ide/ide-iops.c +15 -23
@@ -42,7 +42,7 @@ static void ide_outb (u8 val, unsigned long port)outb (val, port); } -static void ide_outbsync (ide_drive_t *drive,u8 addr,unsigned long port) +static void ide_outbsync (ide_hwif_t *hwif,u8 addr,unsigned long port) {outb (addr, port); }
@@ -68,7 +68,7 @@ static void ide_mm_outb (u8 value, unsigned long port)writeb (value, (void __iomem *) port); } -static void ide_mm_outbsync (ide_drive_t *drive,u8 value,unsigned long port) +static void ide_mm_outbsync (ide_hwif_t *hwif,u8 value,unsigned long port) {writeb (value, (void __iomem *) port); }
@@ -95,7 +95,7 @@ void SELECT_DRIVE (ide_drive_t *drive) hwif->OUTB (drive->select.all, hwif->io_ports.device_addr); } -static void SELECT_MASK (ide_drive_t *drive,int mask) +void SELECT_MASK (ide_drive_t *drive,int mask) {const struct ide_port_ops *port_ops = drive->hwif->port_ops;
@@ -120,11 +120,6 @@ static void ide_tf_load(ide_drive_t *drive, ide_task_t *task)if (task->tf_flags &IDE_TFLAG_FLAGGED )HIHI =0xFF ; -ide_set_irq (drive,1 ); - -if ((task->tf_flags &IDE_TFLAG_NO_SELECT_MASK ) ==0 ) -SELECT_MASK (drive,0 ); -if (task->tf_flags &IDE_TFLAG_OUT_DATA ) {u16 data = (tf->hob_data <<8 ) | tf->data;
@@ -191,7 +186,7 @@ static void ide_tf_read(ide_drive_t *drive, ide_task_t *task) }/* be sure we're looking at the low order bits */ -tf_outb (drive->ctl & ~0x80 , io_ports->ctl_addr); +tf_outb (ATA_DEVCTL_OBS & ~0x80 , io_ports->ctl_addr);if (task->tf_flags &IDE_TFLAG_IN_NSECT ) tf->nsect =tf_inb (io_ports->nsect_addr);
@@ -205,7 +200,7 @@ static void ide_tf_read(ide_drive_t *drive, ide_task_t *task) tf->device =tf_inb (io_ports->device_addr);if (task->tf_flags &IDE_TFLAG_LBA48 ) { -tf_outb (drive->ctl |0x80 , io_ports->ctl_addr); +tf_outb (ATA_DEVCTL_OBS |0x80 , io_ports->ctl_addr);if (task->tf_flags &IDE_TFLAG_IN_HOB_FEATURE ) tf->hob_feature =tf_inb (io_ports->feature_addr);
@@ -689,9 +684,9 @@ int ide_driveid_update(ide_drive_t *drive)*/ SELECT_MASK (drive,1 ); -ide_set_irq (drive,1 ); +ide_set_irq (drive,0 );msleep (50 ); - hwif->OUTBSYNC (drive,WIN_IDENTIFY , hwif->io_ports.command_addr); + hwif->OUTBSYNC (hwif,WIN_IDENTIFY , hwif->io_ports.command_addr); timeout = jiffies +WAIT_WORSTCASE ; do { if (time_after(jiffies, timeout)) {
@@ -744,9 +739,6 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)int error =0 ;u8 stat; -// while (HWGROUP(drive)->busy) -// msleep(50); -#ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_ops)/* check if host supports DMA */ hwif->dma_ops->dma_host_set (drive,0 );
@@ -781,7 +773,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)ide_set_irq (drive,0 ); hwif->OUTB (speed, io_ports->nsect_addr); hwif->OUTB (SETFEATURES_XFER , io_ports->feature_addr); - hwif->OUTBSYNC (drive,WIN_SETFEATURES , io_ports->command_addr); + hwif->OUTBSYNC (hwif,WIN_SETFEATURES , io_ports->command_addr);if (drive->quirk_list ==2 )ide_set_irq (drive,1 );
@@ -889,7 +881,7 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler,spin_lock_irqsave (&ide_lock, flags);__ide_set_handler (drive, handler, timeout, expiry); - hwif->OUTBSYNC (drive, cmd, hwif->io_ports.command_addr); + hwif->OUTBSYNC (hwif, cmd, hwif->io_ports.command_addr);/* * Drive takes 400nS to respond, we must avoid the IRQ being * serviced before that.
@@ -907,7 +899,7 @@ void ide_execute_pkt_cmd(ide_drive_t *drive)unsigned long flags;spin_lock_irqsave (&ide_lock, flags); - hwif->OUTBSYNC (drive,WIN_PACKETCMD , hwif->io_ports.command_addr); + hwif->OUTBSYNC (hwif,WIN_PACKETCMD , hwif->io_ports.command_addr);ndelay (400 );spin_unlock_irqrestore (&ide_lock, flags); }
@@ -1102,7 +1094,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)pre_reset (drive);SELECT_DRIVE (drive);udelay (20 ); - hwif->OUTBSYNC (drive,WIN_SRST , io_ports->command_addr); + hwif->OUTBSYNC (hwif,WIN_SRST , io_ports->command_addr);ndelay (400 ); hwgroup->poll_timeout = jiffies +WAIT_WORSTCASE ; hwgroup->polling =1 ;
@@ -1133,14 +1125,14 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)* recover from reset very quickly, saving us the first 50ms wait time. */ /* set SRST and nIEN */ - hwif->OUTBSYNC (drive, drive->ctl|6 , io_ports->ctl_addr); + hwif->OUTBSYNC (hwif,ATA_DEVCTL_OBS |6 , io_ports->ctl_addr);/* more than enough time */ udelay (10 );if (drive->quirk_list ==2 ) - ctl = drive->ctl;/* clear SRST and nIEN */ + ctl =ATA_DEVCTL_OBS ;/* clear SRST and nIEN */ else - ctl = drive->ctl |2 ;/* clear SRST, leave nIEN */ - hwif->OUTBSYNC (drive, ctl, io_ports->ctl_addr); + ctl =ATA_DEVCTL_OBS |2 ;/* clear SRST, leave nIEN */ + hwif->OUTBSYNC (hwif, ctl, io_ports->ctl_addr);/* more than enough time */ udelay (10 ); hwgroup->poll_timeout = jiffies +WAIT_WORSTCASE ;
drivers/ide/ide-probe.c +5 -5
@@ -293,7 +293,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) hwif->OUTB (0 , io_ports->feature_addr);/* ask drive for ID */ - hwif->OUTBSYNC (drive, cmd, io_ports->command_addr); + hwif->OUTBSYNC (hwif, cmd, hwif->io_ports.command_addr); timeout = ((cmd ==WIN_IDENTIFY ) ?WAIT_WORSTCASE :WAIT_PIDENTIFY ) /2 ; timeout += jiffies;
@@ -478,9 +478,9 @@ static int do_probe (ide_drive_t *drive, u8 cmd)printk (KERN_ERR "%s: no response (status = 0x%02x), " "resetting drive\n" , drive->name, stat);msleep (50 ); - hwif->OUTB (drive->select.all, io_ports->device_addr); +SELECT_DRIVE (drive);msleep (50 ); - hwif->OUTBSYNC (drive,WIN_SRST , io_ports->command_addr); + hwif->OUTBSYNC (hwif,WIN_SRST , io_ports->command_addr); (void )ide_busy_sleep (hwif); rc =try_to_identify (drive, cmd); }
@@ -516,7 +516,7 @@ static void enable_nest (ide_drive_t *drive)printk ("%s: enabling %s -- " , hwif->name, drive->id->model);SELECT_DRIVE (drive);msleep (50 ); - hwif->OUTBSYNC (drive,EXABYTE_ENABLE_NEST , hwif->io_ports.command_addr); + hwif->OUTBSYNC (hwif,EXABYTE_ENABLE_NEST , hwif->io_ports.command_addr);if (ide_busy_sleep (hwif)) {printk (KERN_CONT "failed (timeout)\n" );
@@ -1065,7 +1065,7 @@ static int init_irq (ide_hwif_t *hwif)if (io_ports->ctl_addr)/* clear nIEN */ - hwif->OUTB (0x08 , io_ports->ctl_addr); + hwif->OUTBSYNC (hwif,ATA_DEVCTL_OBS , io_ports->ctl_addr);if (request_irq (hwif->irq,&ide_intr,sa,hwif->name,hwgroup)) goto out_unlink;
drivers/ide/ide-tape.c +158 -403
816 lines not on this page · raw message
drivers/ide/ide-taskfile.c +23 -15
@@ -109,13 +109,15 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)if ((task->tf_flags &IDE_TFLAG_DMA_PIO_FALLBACK ) ==0 ) {ide_tf_dump (drive->name, tf); +ide_set_irq (drive,1 ); +SELECT_MASK (drive,0 ); hwif->tf_load (drive, task); }switch (task->data_phase) {case TASKFILE_MULTI_OUT :case TASKFILE_OUT : - hwif->OUTBSYNC (drive, tf->command, hwif->io_ports.command_addr); + hwif->OUTBSYNC (hwif, tf->command, hwif->io_ports.command_addr);ndelay (400 );/* FIXME */ return pre_task_out_intr (drive, task->rq);case TASKFILE_MULTI_IN :
@@ -492,11 +494,12 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq)int ide_raw_taskfile (ide_drive_t *drive,ide_task_t *task,u8 *buf,u16 nsect) { -struct request rq; +struct request *rq; +int error; -blk_rq_init (NULL , &rq); - rq.cmd_type =REQ_TYPE_ATA_TASKFILE ; - rq.buffer = buf; + rq =blk_get_request (drive->queue,READ , __GFP_WAIT); + rq->cmd_type =REQ_TYPE_ATA_TASKFILE ; + rq->buffer = buf;/* * (ks) We transfer currently only whole sectors.
@@ -504,16 +507,19 @@ int ide_raw_taskfile(ide_drive_t *drive, ide_task_t *task, u8 *buf, u16 nsect)* if we would find a solution to transfer any size. * To support special commands like READ LONG. */ - rq.hard_nr_sectors = rq.nr_sectors = nsect; - rq.hard_cur_sectors = rq.current_nr_sectors = nsect; + rq->hard_nr_sectors = rq->nr_sectors = nsect; + rq->hard_cur_sectors = rq->current_nr_sectors = nsect;if (task->tf_flags &IDE_TFLAG_WRITE ) - rq.cmd_flags |=REQ_RW ; + rq->cmd_flags |=REQ_RW ; - rq.special = task; - task->rq = &rq; + rq->special = task; + task->rq = rq; -return ide_do_drive_cmd (drive, &rq, ide_wait); + error =blk_execute_rq (drive->queue,NULL , rq,0 ); +blk_put_request (rq); + +return error; }EXPORT_SYMBOL (ide_raw_taskfile);
@@ -739,12 +745,14 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)struct hd_driveid *id = drive->id;if (NULL == (void *) arg) { -struct request rq; +struct request *rq; -ide_init_drive_cmd (&rq); - rq.cmd_type =REQ_TYPE_ATA_TASKFILE ; + rq =blk_get_request (drive->queue,READ , __GFP_WAIT); + rq->cmd_type =REQ_TYPE_ATA_TASKFILE ; + err =blk_execute_rq (drive->queue,NULL , rq,0 ); +blk_put_request (rq); -return ide_do_drive_cmd (drive, &rq, ide_wait); +return err; }if (copy_from_user (args, (void __user *)arg,4 ))
drivers/ide/ide-timing.h +0 -1
@@ -95,7 +95,6 @@ static struct ide_timing ide_timing[] = {#define IDE_TIMING_UDMA 0x80#define IDE_TIMING_ALL 0xff -#define FIT (v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin)#define ENOUGH (v,unit) (((v)-1)/(unit)+1)#define EZ (v,unit) ((v)?ENOUGH(v,unit):0)
drivers/ide/ide.c +27 -333
331 lines not on this page · raw message
drivers/scsi/ide-scsi.c +80 -222
302 lines not on this page · raw message
include/linux/ide.h +24 -31
55 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.