2008-12-07 17:21:33

by Borislav Petkov

[permalink] [raw]
Subject: [PATCH 0/4] ide: remove ide-scsi remnants

Hi Bart,

here are the patches removing bits and pieces belonging to the late ide-scsi :).

drivers/ide/ide-atapi.c | 97 +++++++++++++++++++++++++++++++++++++---------
drivers/ide/ide-io.c | 3 +
drivers/ide/ide-ioctls.c | 3 +-
drivers/ide/ide-probe.c | 2 +
include/linux/ide.h | 34 ++++++++++------
5 files changed, 106 insertions(+), 33 deletions(-)


2008-12-07 17:21:47

by Borislav Petkov

[permalink] [raw]
Subject: [PATCH 1/4] ide-atapi: remove ide-scsi remnants from ide_issue_pc

Signed-off-by: Borislav Petkov <[email protected]>
---
drivers/ide/ide-atapi.c | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index c110329..ff6b567 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -602,7 +602,6 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout)
ide_expiry_t *expiry = NULL;
u32 tf_flags;
u16 bcount;
- u8 scsi = !!(drive->dev_flags & IDE_DFLAG_SCSI);

/* We haven't transferred any data yet */
pc->xferred = 0;
@@ -612,10 +611,6 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout)
tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
bcount = ide_cd_get_xferlen(hwif->hwgroup->rq);
expiry = ide_cd_expiry;
- } else if (scsi) {
- tf_flags = 0;
- bcount = min(pc->req_xfer, 63 * 1024);
- expiry = ide_scsi_expiry;
} else {
tf_flags = IDE_TFLAG_OUT_DEVICE;
bcount = ((drive->media == ide_tape) ?
@@ -630,13 +625,8 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout)

if (((pc->flags & PC_FLAG_DMA_OK) &&
(drive->dev_flags & IDE_DFLAG_USING_DMA)) ||
- drive->dma) {
- if (scsi)
- hwif->sg_mapped = 1;
+ drive->dma)
drive->dma = !hwif->dma_ops->dma_setup(drive);
- if (scsi)
- hwif->sg_mapped = 0;
- }

if (!drive->dma)
pc->flags &= ~PC_FLAG_DMA_OK;
--
1.6.0.4

2008-12-07 17:22:01

by Borislav Petkov

[permalink] [raw]
Subject: [PATCH 2/4] ide-atapi: remove ide-scsi remnants from ide_transfer_pc()

Signed-off-by: Borislav Petkov <[email protected]>
---
drivers/ide/ide-atapi.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index ff6b567..f5bf405 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -550,8 +550,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
}

ireason = ide_read_ireason(drive);
- if (drive->media == ide_tape &&
- (drive->dev_flags & IDE_DFLAG_SCSI) == 0)
+ if (drive->media == ide_tape)
ireason = ide_wait_ireason(drive, ireason);

if ((ireason & ATAPI_COD) == 0 || (ireason & ATAPI_IO)) {
@@ -569,14 +568,9 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
timeout = drive->pc_delay;
expiry = &ide_delayed_transfer_pc;
} else {
- if (drive->dev_flags & IDE_DFLAG_SCSI) {
- timeout = ide_scsi_get_timeout(pc);
- expiry = ide_scsi_expiry;
- } else {
- timeout = (drive->media == ide_floppy) ? WAIT_FLOPPY_CMD
- : WAIT_TAPE_CMD;
- expiry = NULL;
- }
+ timeout = (drive->media == ide_floppy) ? WAIT_FLOPPY_CMD
+ : WAIT_TAPE_CMD;
+ expiry = NULL;
}

/* Set the interrupt routine */
--
1.6.0.4

2008-12-07 17:22:30

by Borislav Petkov

[permalink] [raw]
Subject: [PATCH 3/4] ide-atapi: remove ide-scsi remnants from ide_pc_intr()

As a result, remove now unused ide_scsi_get_timeout and ide_scsi_expiry.

Signed-off-by: Borislav Petkov <[email protected]>
---
drivers/ide/ide-atapi.c | 68 +++++++++--------------------------------------
include/linux/ide.h | 6 ----
2 files changed, 13 insertions(+), 61 deletions(-)

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index f5bf405..7a04509 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -240,19 +240,6 @@ void ide_retry_pc(ide_drive_t *drive, struct gendisk *disk)
}
EXPORT_SYMBOL_GPL(ide_retry_pc);

-int ide_scsi_expiry(ide_drive_t *drive)
-{
- struct ide_atapi_pc *pc = drive->pc;
-
- debug_log("%s called for %lu at %lu\n", __func__,
- pc->scsi_cmd->serial_number, jiffies);
-
- pc->flags |= PC_FLAG_TIMEDOUT;
-
- return 0; /* we do not want the IDE subsystem to retry */
-}
-EXPORT_SYMBOL_GPL(ide_scsi_expiry);
-
int ide_cd_expiry(ide_drive_t *drive)
{
struct request *rq = HWGROUP(drive)->rq;
@@ -309,21 +296,14 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
struct request *rq = hwif->hwgroup->rq;
const struct ide_tp_ops *tp_ops = hwif->tp_ops;
xfer_func_t *xferfunc;
- ide_expiry_t *expiry;
unsigned int timeout, temp;
u16 bcount;
- u8 stat, ireason, scsi = !!(drive->dev_flags & IDE_DFLAG_SCSI), dsc = 0;
+ u8 stat, ireason, dsc = 0;

debug_log("Enter %s - interrupt handler\n", __func__);

- if (scsi) {
- timeout = ide_scsi_get_timeout(pc);
- expiry = ide_scsi_expiry;
- } else {
- timeout = (drive->media == ide_floppy) ? WAIT_FLOPPY_CMD
- : WAIT_TAPE_CMD;
- expiry = NULL;
- }
+ timeout = (drive->media == ide_floppy) ? WAIT_FLOPPY_CMD
+ : WAIT_TAPE_CMD;

if (pc->flags & PC_FLAG_TIMEDOUT) {
drive->pc_callback(drive, 0);
@@ -335,8 +315,8 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)

if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
if (hwif->dma_ops->dma_end(drive) ||
- (drive->media == ide_tape && !scsi && (stat & ATA_ERR))) {
- if (drive->media == ide_floppy && !scsi)
+ (drive->media == ide_tape && (stat & ATA_ERR))) {
+ if (drive->media == ide_floppy)
printk(KERN_ERR "%s: DMA %s error\n",
drive->name, rq_data_dir(pc->rq)
? "write" : "read");
@@ -358,7 +338,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)

local_irq_enable_in_hardirq();

- if (drive->media == ide_tape && !scsi &&
+ if (drive->media == ide_tape &&
(stat & ATA_ERR) && rq->cmd[0] == REQUEST_SENSE)
stat &= ~ATA_ERR;

@@ -366,11 +346,8 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
/* Error detected */
debug_log("%s: I/O error\n", drive->name);

- if (drive->media != ide_tape || scsi) {
+ if (drive->media != ide_tape)
pc->rq->errors++;
- if (scsi)
- goto cmd_finished;
- }

if (rq->cmd[0] == REQUEST_SENSE) {
printk(KERN_ERR "%s: I/O error in request sense"
@@ -386,7 +363,6 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
/* queued, but not started */
return ide_stopped;
}
-cmd_finished:
pc->error = 0;

if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) && (stat & ATA_DSC) == 0)
@@ -433,25 +409,8 @@ cmd_finished:
"us more data than expected - "
"discarding data\n",
drive->name);
- if (scsi)
- temp = pc->buf_size - pc->xferred;
- else
- temp = 0;
- if (temp) {
- if (pc->sg)
- drive->pc_io_buffers(drive, pc,
- temp, 0);
- else
- tp_ops->input_data(drive, NULL,
- pc->cur_pos, temp);
- printk(KERN_ERR "%s: transferred %d of "
- "%d bytes\n",
- drive->name,
- temp, bcount);
- }
- pc->xferred += temp;
- pc->cur_pos += temp;
- ide_pad_transfer(drive, 0, bcount - temp);
+
+ ide_pad_transfer(drive, 0, bcount);
goto next_irq;
}
debug_log("The device wants to send us more data than "
@@ -461,14 +420,13 @@ cmd_finished:
} else
xferfunc = tp_ops->output_data;

- if ((drive->media == ide_floppy && !scsi && !pc->buf) ||
- (drive->media == ide_tape && !scsi && pc->bh) ||
- (scsi && pc->sg)) {
+ if ((drive->media == ide_floppy && !pc->buf) ||
+ (drive->media == ide_tape && pc->bh)) {
int done = drive->pc_io_buffers(drive, pc, bcount,
!!(pc->flags & PC_FLAG_WRITING));

/* FIXME: don't do partial completions */
- if (drive->media == ide_floppy && !scsi)
+ if (drive->media == ide_floppy)
ide_end_request(drive, 1, done >> 9);
} else
xferfunc(drive, NULL, pc->cur_pos, bcount);
@@ -481,7 +439,7 @@ cmd_finished:
rq->cmd[0], bcount);
next_irq:
/* And set the interrupt handler again */
- ide_set_handler(drive, ide_pc_intr, timeout, expiry);
+ ide_set_handler(drive, ide_pc_intr, timeout, NULL);
return ide_started;
}

diff --git a/include/linux/ide.h b/include/linux/ide.h
index e20e0b5..257524e 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1248,12 +1248,6 @@ int ide_set_media_lock(ide_drive_t *, struct gendisk *, int);
void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *);
void ide_retry_pc(ide_drive_t *, struct gendisk *);

-static inline unsigned long ide_scsi_get_timeout(struct ide_atapi_pc *pc)
-{
- return max_t(unsigned long, WAIT_CMD, pc->timeout - jiffies);
-}
-
-int ide_scsi_expiry(ide_drive_t *);
int ide_cd_expiry(ide_drive_t *);

int ide_cd_get_xferlen(struct request *);
--
1.6.0.4

2008-12-07 17:22:45

by Borislav Petkov

[permalink] [raw]
Subject: [PATCH 4/4] ide: remove the last ide-scsi remnants

Signed-off-by: Borislav Petkov <[email protected]>
---
drivers/ide/ide-atapi.c | 3 +--
drivers/ide/ide-io.c | 3 ---
drivers/ide/ide-ioctls.c | 3 +--
drivers/ide/ide-probe.c | 2 --
include/linux/ide.h | 28 +++++++++++++---------------
5 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 7a04509..d412bd2 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -17,8 +17,7 @@

static inline int dev_is_idecd(ide_drive_t *drive)
{
- return (drive->media == ide_cdrom || drive->media == ide_optical) &&
- !(drive->dev_flags & IDE_DFLAG_SCSI);
+ return drive->media == ide_cdrom || drive->media == ide_optical;
}

/*
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 7743b0f..4136164 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -426,9 +426,6 @@ void ide_map_sg(ide_drive_t *drive, struct request *rq)
ide_hwif_t *hwif = drive->hwif;
struct scatterlist *sg = hwif->sg_table;

- if (hwif->sg_mapped) /* needed by ide-scsi */
- return;
-
if (rq->cmd_type != REQ_TYPE_ATA_TASKFILE) {
hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
} else {
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c
index 28232c6..1be263e 100644
--- a/drivers/ide/ide-ioctls.c
+++ b/drivers/ide/ide-ioctls.c
@@ -95,8 +95,7 @@ static int ide_set_nice_ioctl(ide_drive_t *drive, unsigned long arg)
return -EPERM;

if (((arg >> IDE_NICE_DSC_OVERLAP) & 1) &&
- (drive->media != ide_tape ||
- (drive->dev_flags & IDE_DFLAG_SCSI)))
+ (drive->media != ide_tape))
return -EPERM;

if ((arg >> IDE_NICE_DSC_OVERLAP) & 1)
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 966b74c..c5adb7b 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1141,8 +1141,6 @@ static struct kobject *ata_probe(dev_t dev, int *part, void *data)

if (drive->media == ide_disk)
request_module("ide-disk");
- if (drive->dev_flags & IDE_DFLAG_SCSI)
- request_module("ide-scsi");
if (drive->media == ide_cdrom || drive->media == ide_optical)
request_module("ide-cd");
if (drive->media == ide_tape)
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 257524e..ad57a44 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -559,28 +559,26 @@ enum {
IDE_DFLAG_NODMA = (1 << 16),
/* powermanagment told us not to do anything, so sleep nicely */
IDE_DFLAG_BLOCKED = (1 << 17),
- /* ide-scsi emulation */
- IDE_DFLAG_SCSI = (1 << 18),
/* sleeping & sleep field valid */
- IDE_DFLAG_SLEEPING = (1 << 19),
- IDE_DFLAG_POST_RESET = (1 << 20),
- IDE_DFLAG_UDMA33_WARNED = (1 << 21),
- IDE_DFLAG_LBA48 = (1 << 22),
+ IDE_DFLAG_SLEEPING = (1 << 18),
+ IDE_DFLAG_POST_RESET = (1 << 19),
+ IDE_DFLAG_UDMA33_WARNED = (1 << 20),
+ IDE_DFLAG_LBA48 = (1 << 21),
/* status of write cache */
- IDE_DFLAG_WCACHE = (1 << 23),
+ IDE_DFLAG_WCACHE = (1 << 22),
/* used for ignoring ATA_DF */
- IDE_DFLAG_NOWERR = (1 << 24),
+ IDE_DFLAG_NOWERR = (1 << 23),
/* retrying in PIO */
- IDE_DFLAG_DMA_PIO_RETRY = (1 << 25),
- IDE_DFLAG_LBA = (1 << 26),
+ IDE_DFLAG_DMA_PIO_RETRY = (1 << 24),
+ IDE_DFLAG_LBA = (1 << 25),
/* don't unload heads */
- IDE_DFLAG_NO_UNLOAD = (1 << 27),
+ IDE_DFLAG_NO_UNLOAD = (1 << 26),
/* heads unloaded, please don't reset port */
- IDE_DFLAG_PARKED = (1 << 28),
- IDE_DFLAG_MEDIA_CHANGED = (1 << 29),
+ IDE_DFLAG_PARKED = (1 << 27),
+ IDE_DFLAG_MEDIA_CHANGED = (1 << 28),
/* write protect */
- IDE_DFLAG_WP = (1 << 30),
- IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 31),
+ IDE_DFLAG_WP = (1 << 29),
+ IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30),
};

struct ide_drive_s {
--
1.6.0.4

2008-12-07 18:43:28

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH 0/4] ide: remove ide-scsi remnants

On Sun, Dec 07, 2008 at 06:21:07PM +0100, Borislav Petkov wrote:
> Hi Bart,
>
> here are the patches removing bits and pieces belonging to the late ide-scsi :).
>

here's the correct (and not reversed :)) diffstat though:

drivers/ide/ide-atapi.c | 97 +++++++++-------------------------------------
drivers/ide/ide-io.c | 3 -
drivers/ide/ide-ioctls.c | 3 +-
drivers/ide/ide-probe.c | 2 -
include/linux/ide.h | 34 ++++++----------
5 files changed, 33 insertions(+), 106 deletions(-)

--
Regards/Gruss,
Boris.

Subject: Re: [PATCH 0/4] ide: remove ide-scsi remnants

On Sunday 07 December 2008, Borislav Petkov wrote:
> On Sun, Dec 07, 2008 at 06:21:07PM +0100, Borislav Petkov wrote:
> > Hi Bart,
> >
> > here are the patches removing bits and pieces belonging to the late ide-scsi :).
> >
>
> here's the correct (and not reversed :)) diffstat though:
>
> drivers/ide/ide-atapi.c | 97 +++++++++-------------------------------------
> drivers/ide/ide-io.c | 3 -
> drivers/ide/ide-ioctls.c | 3 +-
> drivers/ide/ide-probe.c | 2 -
> include/linux/ide.h | 34 ++++++----------
> 5 files changed, 33 insertions(+), 106 deletions(-)

Thanks, applied (though you could have combined all patches into
single one -- it is one logical change after all).

Bart

2008-12-08 18:09:13

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH 0/4] ide: remove ide-scsi remnants

On Mon, Dec 8, 2008 at 6:33 PM, Bartlomiej Zolnierkiewicz
<[email protected]> wrote:
> On Sunday 07 December 2008, Borislav Petkov wrote:
>> On Sun, Dec 07, 2008 at 06:21:07PM +0100, Borislav Petkov wrote:
>> > Hi Bart,
>> >
>> > here are the patches removing bits and pieces belonging to the late ide-scsi :).
>> >
>>
>> here's the correct (and not reversed :)) diffstat though:
>>
>> drivers/ide/ide-atapi.c | 97 +++++++++-------------------------------------
>> drivers/ide/ide-io.c | 3 -
>> drivers/ide/ide-ioctls.c | 3 +-
>> drivers/ide/ide-probe.c | 2 -
>> include/linux/ide.h | 34 ++++++----------
>> 5 files changed, 33 insertions(+), 106 deletions(-)
>
> Thanks, applied (though you could have combined all patches into
> single one -- it is one logical change after all).

It was a single patch originally but it looked pretty big and
unreadable and that's why I split it.


--
Regards/Gruss,
Boris