Commit 4949833a authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Anton Blanchard

[PATCH] switch ide to taskfile IO

- rewrite taskfile PIO handlers
  (they now comply with ide state machine and use bio walking)
- switch ide-disk.c to use *only* taskfile IO
- swicth pdc4030.c to use *only* taskfile IO (untested)
- remove old cruft (>600 lines)
parent 319a0865
......@@ -219,7 +219,6 @@ config IDE_TASK_IOCTL
If you are unsure, say N here.
#bool ' IDE Taskfile IO' CONFIG_IDE_TASKFILE_IO
comment "IDE chipset support/bugfixes"
depends on BLK_DEV_IDE
......@@ -1071,11 +1070,6 @@ config BLK_DEV_PDC202XX
If unsure, say N.
##if [ "$CONFIG_IDE_TASKFILE_IO" = "y" ]; then
## dep_mbool CONFIG_BLK_DEV_TF_DISK $CONFIG_BLK_DEV_IDEDISK
##else
## dep_mbool CONFIG_BLK_DEV_NTF_DISK $CONFIG_BLK_DEV_IDEDISK
##fi
config BLK_DEV_IDE_MODES
bool
depends on BLK_DEV_4DRIVES || BLK_DEV_ALI14XX || BLK_DEV_DTC2278 || BLK_DEV_HT6560B || BLK_DEV_PDC4030 || BLK_DEV_QD65XX || BLK_DEV_UMC8672 || BLK_DEV_AEC62XX=y || BLK_DEV_ALI15X3=y || BLK_DEV_AMD74XX=y || BLK_DEV_CMD640 || BLK_DEV_CMD64X=y || BLK_DEV_CS5530=y || BLK_DEV_CY82C693=y || BLK_DEV_HPT34X=y || BLK_DEV_HPT366=y || BLK_DEV_IDE_PMAC || BLK_DEV_IT8172 || BLK_DEV_MPC8xx_IDE || BLK_DEV_NFORCE=y || BLK_DEV_OPTI621=y || BLK_DEV_PDC202XX || BLK_DEV_PIIX=y || BLK_DEV_SVWKS=y || BLK_DEV_SIIMAGE=y || BLK_DEV_SIS5513=y || BLK_DEV_SL82C105=y || BLK_DEV_SLC90E66=y || BLK_DEV_VIA82CXXX=y
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -457,6 +457,7 @@ extern void blk_queue_invalidate_tags(request_queue_t *);
extern void blk_congestion_wait(int rw, long timeout);
extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
extern void blk_rq_prep_restart(struct request *);
#define MAX_PHYS_SEGMENTS 128
#define MAX_HW_SEGMENTS 128
......
......@@ -817,33 +817,25 @@ typedef struct ide_dma_ops_s {
*
* temporarily mapping a (possible) highmem bio for PIO transfer
*/
#define ide_rq_offset(rq) \
(((rq)->hard_cur_sectors - (rq)->current_nr_sectors) << 9)
/*
* taskfiles really should use hard_cur_sectors as well!
*/
#define task_rq_offset(rq) \
(((rq)->nr_sectors - (rq)->current_nr_sectors) * SECTOR_SIZE)
static inline void *ide_map_buffer(struct request *rq, unsigned long *flags)
static inline void *task_map_rq(struct request *rq, unsigned long *flags)
{
/*
* fs request
*/
if (rq->bio)
return bio_kmap_irq(rq->bio, flags) + ide_rq_offset(rq);
if (rq->cbio)
return rq_map_buffer(rq, flags);
/*
* task request
*/
return rq->buffer + task_rq_offset(rq);
return rq->buffer + blk_rq_offset(rq);
}
static inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned long *flags)
static inline void task_unmap_rq(struct request *rq, char *buffer, unsigned long *flags)
{
if (rq->bio)
bio_kunmap_irq(buffer, flags);
if (rq->cbio)
rq_unmap_buffer(buffer, flags);
}
#define IDE_CHIPSET_PCI_MASK \
......@@ -1418,6 +1410,31 @@ extern void atapi_output_bytes(ide_drive_t *, void *, u32);
extern void taskfile_input_data(ide_drive_t *, void *, u32);
extern void taskfile_output_data(ide_drive_t *, void *, u32);
#define IDE_PIO_IN 0
#define IDE_PIO_OUT 1
static inline void task_sectors(ide_drive_t *drive, struct request *rq,
unsigned nsect, int rw)
{
unsigned long flags;
char *buf;
buf = task_map_rq(rq, &flags);
/*
* IRQ can happen instantly after reading/writing
* last sector of the datablock.
*/
process_that_request_first(rq, nsect);
if (rw == IDE_PIO_OUT)
taskfile_output_data(drive, buf, nsect * SECTOR_WORDS);
else
taskfile_input_data(drive, buf, nsect * SECTOR_WORDS);
task_unmap_rq(rq, buf, &flags);
}
extern int drive_is_ready(ide_drive_t *);
extern int wait_for_ready(ide_drive_t *, int /* timeout */);
......
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