Commit cf530091 authored by Martin Dalecki's avatar Martin Dalecki Committed by Linus Torvalds

[PATCH] 2.5.10 IDE 41

 - Revoke the TCQ stuff. Well having it for some time showed just nicely what
   has to be done before it can be included cleanly. But it's just not ready
   yet.

   For more explanations please simply track the usage of the special field of
   struct request - *both* in the generic request handling code and in overall
   driver code.
parent 5694e35c
...@@ -749,35 +749,6 @@ CONFIG_IDEDMA_ONLYDISK ...@@ -749,35 +749,6 @@ CONFIG_IDEDMA_ONLYDISK
Generally say N here. Generally say N here.
CONFIG_BLK_DEV_IDE_TCQ
Support for tagged command queueing on ATA disk drives. This enables
the IDE layer to have multiple in-flight requests on hardware that
supports it. For now this includes the IBM Deskstar series drives,
such as the 22GXP, 75GXP, 40GV, 60GXP, and 120GXP (ie any Deskstar made
in the last couple of years), and at least some of the Western
Digital drives in the Expert series.
If you have such a drive, say Y here.
CONFIG_BLK_DEV_IDE_TCQ_DEPTH
Maximum size of commands to enable per-drive. Any value between 1
and 32 is valid, with 32 being the maxium that the hardware supports.
You probably just want the default of 32 here. If you enter an invalid
number, the default value will be used.
CONFIG_BLK_DEV_IDE_TCQ_DEFAULT
Enabled tagged command queueing unconditionally on drives that report
support for it. Regardless of the chosen value here, tagging can be
controlled at run time:
echo "using_tcq:32" > /proc/ide/hdX/settings
where any value between 1-32 selects chosen queue depth and enables
TCQ, and 0 disables it.
Generally say Y here.
CONFIG_BLK_DEV_IT8172 CONFIG_BLK_DEV_IT8172
Say Y here to support the on-board IDE controller on the Integrated Say Y here to support the on-board IDE controller on the Integrated
Technology Express, Inc. ITE8172 SBC. Vendor page at Technology Express, Inc. ITE8172 SBC. Vendor page at
......
...@@ -47,11 +47,6 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then ...@@ -47,11 +47,6 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
dep_bool ' Use PCI DMA by default when available' CONFIG_IDEDMA_PCI_AUTO $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' Use PCI DMA by default when available' CONFIG_IDEDMA_PCI_AUTO $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' Enable DMA only for disks ' CONFIG_IDEDMA_ONLYDISK $CONFIG_IDEDMA_PCI_AUTO dep_bool ' Enable DMA only for disks ' CONFIG_IDEDMA_ONLYDISK $CONFIG_IDEDMA_PCI_AUTO
define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PCI define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' ATA tagged command queueing' CONFIG_BLK_DEV_IDE_TCQ $CONFIG_BLK_DEV_IDEDMA_PCI
dep_bool ' TCQ on by default' CONFIG_BLK_DEV_IDE_TCQ_DEFAULT $CONFIG_BLK_DEV_IDE_TCQ
if [ "$CONFIG_BLK_DEV_IDE_TCQ" != "n" ]; then
int ' Default queue depth' CONFIG_BLK_DEV_IDE_TCQ_DEPTH 32
fi
dep_bool ' ATA Work(s) In Progress (EXPERIMENTAL)' CONFIG_IDEDMA_PCI_WIP $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL dep_bool ' ATA Work(s) In Progress (EXPERIMENTAL)' CONFIG_IDEDMA_PCI_WIP $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL
dep_bool ' Good-Bad DMA Model-Firmware (WIP)' CONFIG_IDEDMA_NEW_DRIVE_LISTINGS $CONFIG_IDEDMA_PCI_WIP dep_bool ' Good-Bad DMA Model-Firmware (WIP)' CONFIG_IDEDMA_NEW_DRIVE_LISTINGS $CONFIG_IDEDMA_PCI_WIP
dep_bool ' AEC62XX chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' AEC62XX chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI
......
...@@ -44,7 +44,6 @@ ide-obj-$(CONFIG_BLK_DEV_HPT366) += hpt366.o ...@@ -44,7 +44,6 @@ ide-obj-$(CONFIG_BLK_DEV_HPT366) += hpt366.o
ide-obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o ide-obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o
ide-obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o ide-obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o
ide-obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o ide-obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o
ide-obj-$(CONFIG_BLK_DEV_IDE_TCQ) += ide-tcq.o
ide-obj-$(CONFIG_BLK_DEV_IDEPCI) += ide-pci.o ide-obj-$(CONFIG_BLK_DEV_IDEPCI) += ide-pci.o
ide-obj-$(CONFIG_BLK_DEV_ISAPNP) += ide-pnp.o ide-obj-$(CONFIG_BLK_DEV_ISAPNP) += ide-pnp.o
ide-obj-$(CONFIG_BLK_DEV_IDE_PMAC) += ide-pmac.o ide-obj-$(CONFIG_BLK_DEV_IDE_PMAC) += ide-pmac.o
......
...@@ -558,10 +558,6 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate) ...@@ -558,10 +558,6 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
if ((rq->flags & REQ_CMD) && !rq->current_nr_sectors) if ((rq->flags & REQ_CMD) && !rq->current_nr_sectors)
uptodate = 1; uptodate = 1;
#if 0
/* FIXME --mdcki */
HWGROUP(drive)->rq->special = NULL;
#endif
ide_end_request(drive, uptodate); ide_end_request(drive, uptodate);
} }
...@@ -1217,22 +1213,13 @@ static void restore_request (struct request *rq) ...@@ -1217,22 +1213,13 @@ static void restore_request (struct request *rq)
/* /*
* Start a read request from the CD-ROM. * Start a read request from the CD-ROM.
*/ */
static ide_startstop_t cdrom_start_read(struct ata_device *drive, struct ata_request *ar, unsigned int block) static ide_startstop_t cdrom_start_read (ide_drive_t *drive, unsigned int block)
{ {
struct cdrom_info *info = drive->driver_data; struct cdrom_info *info = drive->driver_data;
struct request *rq = ar->ar_rq; struct request *rq = HWGROUP(drive)->rq;
if (ar->ar_flags & ATA_AR_QUEUED) {
// spin_lock_irqsave(DRIVE_LOCK(drive), flags);
blkdev_dequeue_request(rq);
// spin_unlock_irqrestore(DRIVE_LOCK(drive), flags);
}
restore_request(rq); restore_request(rq);
rq->special = ar;
/* Satisfy whatever we can of this request from our cached sector. */ /* Satisfy whatever we can of this request from our cached sector. */
if (cdrom_read_from_buffer(drive)) if (cdrom_read_from_buffer(drive))
return ide_stopped; return ide_stopped;
...@@ -1665,30 +1652,8 @@ ide_cdrom_do_request(struct ata_device *drive, struct request *rq, sector_t bloc ...@@ -1665,30 +1652,8 @@ ide_cdrom_do_request(struct ata_device *drive, struct request *rq, sector_t bloc
if (IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap) if (IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap)
action = cdrom_start_seek (drive, block); action = cdrom_start_seek (drive, block);
else { else {
unsigned long flags;
struct ata_request *ar;
/*
* get a new command (push ar further down to avoid grabbing lock here
*/
spin_lock_irqsave(DRIVE_LOCK(drive), flags);
ar = ata_ar_get(drive);
/*
* we've reached maximum queue depth, bail
*/
if (!ar) {
spin_unlock_irqrestore(DRIVE_LOCK(drive), flags);
return ide_started;
}
ar->ar_rq = rq;
spin_unlock_irqrestore(DRIVE_LOCK(drive), flags);
if (rq_data_dir(rq) == READ) if (rq_data_dir(rq) == READ)
action = cdrom_start_read(drive, ar, block); action = cdrom_start_read(drive, block);
else else
action = cdrom_start_write(drive, rq); action = cdrom_start_write(drive, rq);
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -168,9 +168,6 @@ static inline void do_identify (ide_drive_t *drive, byte cmd) ...@@ -168,9 +168,6 @@ static inline void do_identify (ide_drive_t *drive, byte cmd)
} }
printk (" drive\n"); printk (" drive\n");
drive->type = type; drive->type = type;
goto init_queue;
return; return;
} }
...@@ -201,22 +198,6 @@ static inline void do_identify (ide_drive_t *drive, byte cmd) ...@@ -201,22 +198,6 @@ static inline void do_identify (ide_drive_t *drive, byte cmd)
if (drive->channel->quirkproc) if (drive->channel->quirkproc)
drive->quirk_list = drive->channel->quirkproc(drive); drive->quirk_list = drive->channel->quirkproc(drive);
init_queue:
/*
* it's an ata drive, build command list
*/
drive->queue_depth = 1;
#ifdef CONFIG_BLK_DEV_IDE_TCQ_DEPTH
drive->queue_depth = CONFIG_BLK_DEV_IDE_TCQ_DEPTH;
#else
drive->queue_depth = drive->id->queue_depth + 1;
#endif
if (drive->queue_depth < 1 || drive->queue_depth > IDE_MAX_TAG)
drive->queue_depth = IDE_MAX_TAG;
if (ide_init_commandlist(drive))
goto err_misc;
return; return;
err_misc: err_misc:
......
...@@ -308,8 +308,7 @@ void ata_poll_drive_ready(ide_drive_t *drive) ...@@ -308,8 +308,7 @@ void ata_poll_drive_ready(ide_drive_t *drive)
static ide_startstop_t pre_task_mulout_intr(ide_drive_t *drive, struct request *rq) static ide_startstop_t pre_task_mulout_intr(ide_drive_t *drive, struct request *rq)
{ {
struct ata_request *ar = rq->special; struct ata_taskfile *args = rq->special;
struct ata_taskfile *args = &ar->ar_task;
ide_startstop_t startstop; ide_startstop_t startstop;
/* /*
...@@ -464,35 +463,11 @@ ide_startstop_t ata_taskfile(ide_drive_t *drive, ...@@ -464,35 +463,11 @@ ide_startstop_t ata_taskfile(ide_drive_t *drive,
if (args->prehandler != NULL) if (args->prehandler != NULL)
return args->prehandler(drive, rq); return args->prehandler(drive, rq);
} else { } else {
ide_dma_action_t dmaaction; /* for dma commands we down set the handler */
u8 command; if (drive->using_dma &&
!(drive->channel->dmaproc(((args->taskfile.command == WIN_WRITEDMA)
if (!drive->using_dma) || (args->taskfile.command == WIN_WRITEDMA_EXT))
return ide_started; ? ide_dma_write : ide_dma_read, drive)));
command = args->taskfile.command;
#ifdef CONFIG_BLK_DEV_IDE_TCQ
if (drive->using_tcq) {
if (command == WIN_READDMA_QUEUED
|| command == WIN_READDMA_QUEUED_EXT
|| command == WIN_WRITEDMA_QUEUED
|| command == WIN_READDMA_QUEUED_EXT)
return ide_start_tag(ide_dma_queued_start, drive, rq->special);
}
#endif
if (command == WIN_WRITEDMA || command == WIN_WRITEDMA_EXT)
dmaaction = ide_dma_write;
else if (command == WIN_READDMA || command == WIN_READDMA_EXT)
dmaaction = ide_dma_read;
else
return ide_stopped;
if (!drive->channel->dmaproc(dmaaction, drive))
return ide_started;
return ide_stopped;
} }
return ide_started; return ide_started;
...@@ -544,31 +519,13 @@ ide_startstop_t recal_intr(ide_drive_t *drive) ...@@ -544,31 +519,13 @@ ide_startstop_t recal_intr(ide_drive_t *drive)
return ide_stopped; return ide_stopped;
} }
/*
* Quiet handler for commands without a data phase -- handy instead of
* task_no_data_intr() for commands we _know_ will fail (such as WIN_NOP)
*/
ide_startstop_t task_no_data_quiet_intr(ide_drive_t *drive)
{
struct ata_request *ar = IDE_CUR_AR(drive);
struct ata_taskfile *args = &ar->ar_task;
ide__sti(); /* local CPU only */
if (args)
ide_end_drive_cmd(drive, GET_STAT(), GET_ERR());
return ide_stopped;
}
/* /*
* Handler for commands without a data phase * Handler for commands without a data phase
*/ */
ide_startstop_t task_no_data_intr (ide_drive_t *drive) ide_startstop_t task_no_data_intr (ide_drive_t *drive)
{ {
struct ata_request *ar = IDE_CUR_AR(drive); struct ata_taskfile *args = HWGROUP(drive)->rq->special;
struct ata_taskfile *args = &ar->ar_task; byte stat = GET_STAT();
u8 stat = GET_STAT();
ide__sti(); /* local CPU only */ ide__sti(); /* local CPU only */
...@@ -628,8 +585,7 @@ static ide_startstop_t task_in_intr (ide_drive_t *drive) ...@@ -628,8 +585,7 @@ static ide_startstop_t task_in_intr (ide_drive_t *drive)
static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq) static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq)
{ {
struct ata_request *ar = rq->special; struct ata_taskfile *args = rq->special;
struct ata_taskfile *args = &ar->ar_task;
ide_startstop_t startstop; ide_startstop_t startstop;
if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) { if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) {
...@@ -909,7 +865,6 @@ void ide_cmd_type_parser(struct ata_taskfile *args) ...@@ -909,7 +865,6 @@ void ide_cmd_type_parser(struct ata_taskfile *args)
return; return;
case WIN_NOP: case WIN_NOP:
args->handler = task_no_data_quiet_intr;
args->command_type = IDE_DRIVE_TASK_NO_DATA; args->command_type = IDE_DRIVE_TASK_NO_DATA;
return; return;
...@@ -927,7 +882,7 @@ void ide_cmd_type_parser(struct ata_taskfile *args) ...@@ -927,7 +882,7 @@ void ide_cmd_type_parser(struct ata_taskfile *args)
/* /*
* This function is intended to be used prior to invoking ide_do_drive_cmd(). * This function is intended to be used prior to invoking ide_do_drive_cmd().
*/ */
void init_taskfile_request(struct request *rq) static void init_taskfile_request(struct request *rq)
{ {
memset(rq, 0, sizeof(*rq)); memset(rq, 0, sizeof(*rq));
rq->flags = REQ_DRIVE_TASKFILE; rq->flags = REQ_DRIVE_TASKFILE;
...@@ -936,29 +891,18 @@ void init_taskfile_request(struct request *rq) ...@@ -936,29 +891,18 @@ void init_taskfile_request(struct request *rq)
int ide_raw_taskfile(ide_drive_t *drive, struct ata_taskfile *args, byte *buf) int ide_raw_taskfile(ide_drive_t *drive, struct ata_taskfile *args, byte *buf)
{ {
struct request rq; struct request rq;
struct ata_request star;
int ret;
ata_ar_init(drive, &star);
init_taskfile_request(&rq); init_taskfile_request(&rq);
rq.buffer = buf;
memcpy(&star.ar_task, args, sizeof(*args)); rq.buffer = buf;
if (args->command_type != IDE_DRIVE_TASK_NO_DATA) if (args->command_type != IDE_DRIVE_TASK_NO_DATA)
rq.current_nr_sectors = rq.nr_sectors rq.current_nr_sectors = rq.nr_sectors
= (args->hobfile.sector_count << 8) = (args->hobfile.sector_count << 8)
| args->taskfile.sector_count; | args->taskfile.sector_count;
rq.special = &star; rq.special = args;
ret = ide_do_drive_cmd(drive, &rq, ide_wait); return ide_do_drive_cmd(drive, &rq, ide_wait);
/*
* copy back status etc
*/
memcpy(args, &star.ar_task, sizeof(*args));
return ret;
} }
/* /*
......
This diff is collapsed.
This diff is collapsed.
...@@ -1057,12 +1057,6 @@ int pdc202xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -1057,12 +1057,6 @@ int pdc202xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
case ide_dma_timeout: case ide_dma_timeout:
if (drive->channel->resetproc != NULL) if (drive->channel->resetproc != NULL)
drive->channel->resetproc(drive); drive->channel->resetproc(drive);
/*
* we cannot support queued operations on promise, so fail to
* to enable it...
*/
case ide_dma_queued_on:
return 1;
default: default:
break; break;
} }
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#define ECC_STAT 0x04 /* Corrected error */ #define ECC_STAT 0x04 /* Corrected error */
#define DRQ_STAT 0x08 #define DRQ_STAT 0x08
#define SEEK_STAT 0x10 #define SEEK_STAT 0x10
#define SERVICE_STAT SEEK_STAT
#define WRERR_STAT 0x20 #define WRERR_STAT 0x20
#define READY_STAT 0x40 #define READY_STAT 0x40
#define BUSY_STAT 0x80 #define BUSY_STAT 0x80
...@@ -50,13 +49,6 @@ ...@@ -50,13 +49,6 @@
#define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */ #define BBD_ERR 0x80 /* pre-EIDE meaning: block marked bad */
#define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */ #define ICRC_ERR 0x80 /* new meaning: CRC error during transfer */
/*
* bits of NSECTOR reg
*/
#define NSEC_CD 0x1
#define NSEC_IO 0x2
#define NSEC_REL 0x4
/* /*
* Command Header sizes for IOCTL commands * Command Header sizes for IOCTL commands
* HDIO_DRIVE_CMD and HDIO_DRIVE_TASK * HDIO_DRIVE_CMD and HDIO_DRIVE_TASK
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment