From: Tejun Heo <tj@home-tj.org>
To: bzolnier@gmail.com, linux-ide@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.11-rc2 04/04] ide: merge flagged_taskfile() into do_rw_taskfile()
Date: Sun, 6 Feb 2005 20:26:56 +0900 (KST) [thread overview]
Message-ID: <20050206112656.65BBF13264B@htj.dyndns.org> (raw)
In-Reply-To: <20050206112628.GA31274@htj.dyndns.org>
04_ide_merge_rw_and_flagged_taskfile.patch
Merged flagged_taskfile() into do_rw_taskfile(). During the
merge, the following change took place.
- Uses taskfile->data_phase to determine if dma trasfer is
requested. (previously, do_rw_taskfile() directly switched
on taskfile->command for all dma commands)
Signed-off-by: Tejun Heo <tj@home-tj.org>
Index: linux-ide-series3-export/drivers/ide/ide-io.c
===================================================================
--- linux-ide-series3-export.orig/drivers/ide/ide-io.c 2005-02-06 19:49:19.496897703 +0900
+++ linux-ide-series3-export/drivers/ide/ide-io.c 2005-02-06 19:49:19.839841988 +0900
@@ -657,8 +657,6 @@ static ide_startstop_t execute_drive_tas
break;
}
- if (args->tf_out_flags.all != 0)
- return flagged_taskfile(drive, args);
return do_rw_taskfile(drive, args);
}
Index: linux-ide-series3-export/drivers/ide/ide-taskfile.c
===================================================================
--- linux-ide-series3-export.orig/drivers/ide/ide-taskfile.c 2005-02-06 19:49:19.493898191 +0900
+++ linux-ide-series3-export/drivers/ide/ide-taskfile.c 2005-02-06 19:49:19.840841826 +0900
@@ -215,53 +215,57 @@ void ide_read_taskfile(ide_drive_t *driv
tf->command = stat;
}
-ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
+ide_startstop_t do_rw_taskfile(ide_drive_t *drive, ide_task_t *task)
{
- ide_hwif_t *hwif = HWIF(drive);
- task_struct_t *taskfile = (task_struct_t *) task->tfRegister;
+ ide_hwif_t *hwif = drive->hwif;
+ unsigned long *ports = drive->hwif->io_ports;
+ task_struct_t *tf = (task_struct_t *)task->tfRegister;
- /* ALL Command Block Executions SHALL clear nIEN, unless otherwise */
- if (IDE_CONTROL_REG) {
- /* clear nIEN */
- hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
+ /* We check this in ide_taskfile_ioctl(), but the setting could
+ have been changed inbetween. */
+ if (task->data_phase == TASKFILE_MULTI_IN ||
+ task->data_phase == TASKFILE_MULTI_OUT) {
+ if (!drive->mult_count) {
+ printk(KERN_ERR "%s: multimode not set!\n",
+ drive->name);
+ /* FIXME: this path is an infnite loop. - tj */
+ return ide_stopped;
+ }
}
+
+ /* ALL Command Block Executions SHALL clear nIEN. */
+ if (ports[IDE_CONTROL_OFFSET])
+ hwif->OUTB(drive->ctl, ports[IDE_CONTROL_OFFSET]);
SELECT_MASK(drive, 0);
ide_write_taskfile(drive, task);
if (task->handler != NULL) {
if (task->prehandler != NULL) {
- hwif->OUTBSYNC(drive, taskfile->command, IDE_COMMAND_REG);
+ hwif->OUTBSYNC(drive, tf->command,
+ ports[IDE_COMMAND_OFFSET]);
ndelay(400); /* FIXME */
return task->prehandler(drive, task->rq);
}
- ide_execute_command(drive, taskfile->command, task->handler, WAIT_WORSTCASE, NULL);
+ ide_execute_command(drive, tf->command, task->handler,
+ WAIT_WORSTCASE, NULL);
return ide_started;
}
- if (!drive->using_dma)
+ switch (task->data_phase) {
+ case TASKFILE_OUT_DMAQ:
+ case TASKFILE_OUT_DMA:
+ case TASKFILE_IN_DMAQ:
+ case TASKFILE_IN_DMA:
+ if (!hwif->dma_setup(drive)) {
+ hwif->dma_exec_cmd(drive, tf->command);
+ hwif->dma_start(drive);
+ return ide_started;
+ }
+ return ide_stopped;
+ default:
return ide_stopped;
-
- switch (taskfile->command) {
- case WIN_WRITEDMA_ONCE:
- case WIN_WRITEDMA:
- case WIN_WRITEDMA_EXT:
- case WIN_READDMA_ONCE:
- case WIN_READDMA:
- case WIN_READDMA_EXT:
- case WIN_IDENTIFY_DMA:
- if (!hwif->dma_setup(drive)) {
- hwif->dma_exec_cmd(drive, taskfile->command);
- hwif->dma_start(drive);
- return ide_started;
- }
- break;
- default:
- if (task->handler == NULL)
- return ide_stopped;
}
-
- return ide_stopped;
}
EXPORT_SYMBOL(do_rw_taskfile);
@@ -892,69 +896,3 @@ int ide_task_ioctl(ide_drive_t *drive, u
return ret;
}
-
-/*
- * NOTICE: This is additions from IBM to provide a discrete interface,
- * for selective taskregister access operations. Nice JOB Klaus!!!
- * Glad to be able to work and co-develop this with you and IBM.
- */
-ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
-{
- ide_hwif_t *hwif = HWIF(drive);
- task_struct_t *taskfile = (task_struct_t *) task->tfRegister;
-#if DEBUG_TASKFILE
- u8 status;
-#endif
-
- if (task->data_phase == TASKFILE_MULTI_IN ||
- task->data_phase == TASKFILE_MULTI_OUT) {
- if (!drive->mult_count) {
- printk(KERN_ERR "%s: multimode not set!\n", drive->name);
- return ide_stopped;
- }
- }
-
- /* ALL Command Block Executions SHALL clear nIEN, unless otherwise */
- if (IDE_CONTROL_REG)
- /* clear nIEN */
- 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
-
- ide_write_taskfile(drive, task);
-
- switch(task->data_phase) {
-
- case TASKFILE_OUT_DMAQ:
- case TASKFILE_OUT_DMA:
- case TASKFILE_IN_DMAQ:
- case TASKFILE_IN_DMA:
- hwif->dma_setup(drive);
- hwif->dma_exec_cmd(drive, taskfile->command);
- hwif->dma_start(drive);
- break;
-
- default:
- if (task->handler == NULL)
- return ide_stopped;
-
- /* Issue the command */
- if (task->prehandler) {
- hwif->OUTBSYNC(drive, taskfile->command, IDE_COMMAND_REG);
- ndelay(400); /* FIXME */
- return task->prehandler(drive, task->rq);
- }
- ide_execute_command(drive, taskfile->command, task->handler, WAIT_WORSTCASE, NULL);
- }
-
- return ide_started;
-}
Index: linux-ide-series3-export/include/linux/ide.h
===================================================================
--- linux-ide-series3-export.orig/include/linux/ide.h 2005-02-06 19:49:19.495897866 +0900
+++ linux-ide-series3-export/include/linux/ide.h 2005-02-06 19:49:19.841841663 +0900
@@ -1303,11 +1303,6 @@ void ide_read_taskfile(ide_drive_t *driv
*/
extern ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *);
-/*
- * Special Flagged Register Validation Caller
- */
-extern ide_startstop_t flagged_taskfile(ide_drive_t *, ide_task_t *);
-
extern ide_startstop_t set_multmode_intr(ide_drive_t *);
extern ide_startstop_t set_geometry_intr(ide_drive_t *);
extern ide_startstop_t recal_intr(ide_drive_t *);
prev parent reply other threads:[~2005-02-06 11:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-06 11:26 [PATCH 2.6.11-rc2] ide: driver updates, series 3 Tejun Heo
2005-02-06 11:26 ` [PATCH 2.6.11-rc2 02/04] ide: __ide_do_rw_disk() rewritten ide_write_taskfile() Tejun Heo
2005-02-06 11:26 ` [PATCH 2.6.11-rc2 01/04] ide: ide_write_taskfile() implemented Tejun Heo
2005-02-06 11:26 ` [PATCH 2.6.11-rc2 03/04] ide: ide_read_taskfile() implemented Tejun Heo
2005-02-06 11:26 ` Tejun Heo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050206112656.65BBF13264B@htj.dyndns.org \
--to=tj@home-tj.org \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®