lkml.org 
[lkml]   [2008]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 01/22] ide-floppy: fixup ide_floppy_io_buffers()
map hwif->sg_{table,nents} on pc->{sg,sg_cnt} (multi-IRQs-per-sg fix)

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
I will fold this into the original patch later.

drivers/ide/ide-floppy.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

Index: b/drivers/ide/ide-floppy.c
===================================================================
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -213,12 +213,11 @@ static void ide_floppy_io_buffers(ide_dr
ide_hwif_t *hwif = drive->hwif;
const struct ide_tp_ops *tp_ops = hwif->tp_ops;
xfer_func_t *xf = direction ? tp_ops->output_data : tp_ops->input_data;
- struct scatterlist *sg = hwif->sg_table;
+ struct scatterlist *sg = pc->sg;
char *buf;
int count, done = 0;

while (bcount) {
-
count = min(sg->length - pc->b_count, bcount);
if (PageHighMem(sg_page(sg))) {
unsigned long flags;
@@ -237,9 +236,9 @@ static void ide_floppy_io_buffers(ide_dr
done += count;

if (pc->b_count == sg->length) {
- if (!--hwif->sg_nents)
+ if (!--pc->sg_cnt)
break;
- sg = sg_next(sg);
+ pc->sg = sg = sg_next(sg);
pc->b_count = 0;
}
}
@@ -576,6 +575,7 @@ static ide_startstop_t idefloppy_do_requ
struct request *rq, sector_t block_s)
{
idefloppy_floppy_t *floppy = drive->driver_data;
+ ide_hwif_t *hwif = drive->hwif;
struct ide_atapi_pc *pc;
unsigned long block = (unsigned long)block_s;

@@ -618,11 +618,14 @@ static ide_startstop_t idefloppy_do_requ
return ide_stopped;
}

- pc->rq = rq;
-
ide_init_sg_cmd(drive, rq);
ide_map_sg(drive, rq);

+ pc->sg = hwif->sg_table;
+ pc->sg_cnt = hwif->sg_nents;
+
+ pc->rq = rq;
+
return idefloppy_issue_pc(drive, pc);
}


\
 
 \ /
  Last update: 2008-08-10 17:41    [W:0.094 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site