From: Bartlomiej Zolnierkiewicz Date: Sat, 13 Jun 2009 10:00:54 +0000 (+0200) Subject: Merge branch 'bp-remove-pc-buf' into for-next X-Git-Tag: v2.6.31-rc1~103^2~19 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=8dcce4081305d3d1629190edd112e6473c315cbc Merge branch 'bp-remove-pc-buf' into for-next Conflicts: drivers/ide/ide-tape.c --- 8dcce4081305d3d1629190edd112e6473c315cbc diff --cc drivers/ide/ide-atapi.c index bbdd2547f12a,1125ce29809b..6c73421c608b --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c @@@ -255,11 -254,9 +254,9 @@@ void ide_retry_pc(ide_drive_t *drive /* init pc from sense_rq */ ide_init_pc(pc); memcpy(pc->c, sense_rq->cmd, 12); - pc->buf = bio_data(sense_rq->bio); /* pointer to mapped address */ - pc->req_xfer = blk_rq_bytes(sense_rq); if (drive->media == ide_tape) - set_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags); + drive->atapi_flags |= IDE_AFLAG_IGNORE_DSC; /* * Push back the failed request and put request sense on top diff --cc drivers/ide/ide-tape.c index 4b447a8a49d4,9ca2665faf33..bb71e1e99dad --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@@ -789,11 -762,36 +755,38 @@@ static int ide_tape_read_position(ide_d debug_log(DBG_PROCS, "Enter %s\n", __func__); - idetape_create_read_position_cmd(&pc); - if (ide_queue_pc_tail(drive, tape->disk, &pc)) + /* prep cmd */ + ide_init_pc(&pc); + pc.c[0] = READ_POSITION; + pc.req_xfer = 20; + + if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) return -1; - position = tape->first_frame; - return position; + + if (!pc.error) { + debug_log(DBG_SENSE, "BOP - %s\n", + (buf[0] & 0x80) ? "Yes" : "No"); + debug_log(DBG_SENSE, "EOP - %s\n", + (buf[0] & 0x40) ? "Yes" : "No"); + + if (buf[0] & 0x4) { + printk(KERN_INFO "ide-tape: Block location is unknown" + "to the tape\n"); - clear_bit(IDE_AFLAG_ADDRESS_VALID, &drive->atapi_flags); ++ clear_bit(ilog2(IDE_AFLAG_ADDRESS_VALID), ++ &drive->atapi_flags); + return -1; + } else { + debug_log(DBG_SENSE, "Block Location - %u\n", + be32_to_cpup((__be32 *)&buf[4])); + + tape->partition = buf[1]; + tape->first_frame = be32_to_cpup((__be32 *)&buf[4]); - set_bit(IDE_AFLAG_ADDRESS_VALID, &drive->atapi_flags); ++ set_bit(ilog2(IDE_AFLAG_ADDRESS_VALID), ++ &drive->atapi_flags); + } + } + + return tape->first_frame; } static void idetape_create_locate_cmd(ide_drive_t *drive,