Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114182
b: refs/heads/master
c: 97100fc
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 13, 2008
1 parent 3d50579 commit 0d638ce
Show file tree
Hide file tree
Showing 27 changed files with 371 additions and 244 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be3c096ebdbe3c828aacb5473751a22840753eff
refs/heads/master: 97100fc816badbbc162644cfde7ad39ae9211fb4
12 changes: 7 additions & 5 deletions trunk/drivers/ide/ide-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ static int do_drive_get_GTF(ide_drive_t *drive,
DEBPRINT("ENTER: %s at %s, port#: %d, hard_port#: %d\n",
hwif->name, dev->bus_id, port, hwif->channel);

if (!drive->present) {
if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) {
DEBPRINT("%s drive %d:%d not present\n",
hwif->name, hwif->channel, port);
goto out;
Expand Down Expand Up @@ -420,8 +420,9 @@ static int do_drive_set_taskfiles(ide_drive_t *drive,

DEBPRINT("ENTER: %s, hard_port#: %d\n", drive->name, drive->dn);

if (!drive->present)
if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
goto out;

if (!gtf_count) /* shouldn't be here */
goto out;

Expand Down Expand Up @@ -660,7 +661,8 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on)
if (!drive->acpidata->obj_handle)
drive->acpidata->obj_handle = ide_acpi_drive_get_handle(drive);

if (drive->acpidata->obj_handle && drive->present) {
if (drive->acpidata->obj_handle &&
(drive->dev_flags & IDE_DFLAG_PRESENT)) {
acpi_bus_set_power(drive->acpidata->obj_handle,
on? ACPI_STATE_D0: ACPI_STATE_D3);
}
Expand Down Expand Up @@ -720,7 +722,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif)

memset(drive->acpidata, 0, sizeof(*drive->acpidata));

if (!drive->present)
if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
continue;

err = taskfile_lib_get_identify(drive, drive->acpidata->idbuff);
Expand All @@ -745,7 +747,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *hwif)
for (i = 0; i < MAX_DRIVES; i++) {
drive = &hwif->drives[i];

if (drive->present)
if (drive->dev_flags & IDE_DFLAG_PRESENT)
/* Execute ACPI startup code */
ide_acpi_exec_tfs(drive);
}
Expand Down
21 changes: 11 additions & 10 deletions trunk/drivers/ide/ide-atapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
ide_expiry_t *expiry;
unsigned int timeout, temp;
u16 bcount;
u8 stat, ireason, scsi = drive->scsi, dsc = 0;
u8 stat, ireason, scsi = !!(drive->dev_flags & IDE_DFLAG_SCSI), dsc = 0;

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

Expand Down Expand Up @@ -494,7 +494,8 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
}

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

if ((ireason & ATAPI_COD) == 0 || (ireason & ATAPI_IO)) {
Expand All @@ -512,7 +513,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
timeout = drive->pc_delay;
expiry = &ide_delayed_transfer_pc;
} else {
if (drive->scsi) {
if (drive->dev_flags & IDE_DFLAG_SCSI) {
timeout = ide_scsi_get_timeout(pc);
expiry = ide_scsi_expiry;
} else {
Expand Down Expand Up @@ -544,14 +545,14 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
struct ide_atapi_pc *pc = drive->pc;
ide_hwif_t *hwif = drive->hwif;
u16 bcount;
u8 dma = 0;
u8 dma = 0, scsi = !!(drive->dev_flags & IDE_DFLAG_SCSI);

/* We haven't transferred any data yet */
pc->xferred = 0;
pc->cur_pos = pc->buf;

/* Request to transfer the entire buffer at once */
if (drive->media == ide_tape && !drive->scsi)
if (drive->media == ide_tape && scsi == 0)
bcount = pc->req_xfer;
else
bcount = min(pc->req_xfer, 63 * 1024);
Expand All @@ -561,19 +562,19 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
ide_dma_off(drive);
}

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

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

ide_pktcmd_tf_load(drive, drive->scsi ? 0 : IDE_TFLAG_OUT_DEVICE,
bcount, dma);
ide_pktcmd_tf_load(drive, scsi ? 0 : IDE_TFLAG_OUT_DEVICE, bcount, dma);

/* Issue the packet command */
if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) {
Expand Down
17 changes: 10 additions & 7 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ static ide_startstop_t cdrom_seek_intr(ide_drive_t *drive)

if (retry && time_after(jiffies, info->start_seek + IDECD_SEEK_TIMER)) {
if (--retry == 0)
drive->dsc_overlap = 0;
drive->dev_flags &= ~IDE_DFLAG_DSC_OVERLAP;
}
return ide_stopped;
}
Expand Down Expand Up @@ -1129,7 +1129,7 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq)
}
cd->dma = 0;
} else
cd->dma = drive->using_dma;
cd->dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA);

if (write)
cd->devinfo.media_written = 1;
Expand Down Expand Up @@ -1166,7 +1166,7 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
else
buf = rq->data;

info->dma = drive->using_dma;
info->dma = !!(drive->dev_flags & IDE_DFLAG_USING_DMA);

/*
* check if dma is safe
Expand Down Expand Up @@ -1211,7 +1211,7 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
if (rq_data_dir(rq) == READ &&
IDE_LARGE_SEEK(info->last_block, block,
IDECD_SEEK_THRESHOLD) &&
drive->dsc_overlap) {
(drive->dev_flags & IDE_DFLAG_DSC_OVERLAP)) {
xferlen = 0;
fn = cdrom_start_seek_continuation;

Expand Down Expand Up @@ -1804,7 +1804,7 @@ static ide_proc_entry_t idecd_proc[] = {
{ NULL, 0, NULL, NULL }
};

ide_devset_rw_field(dsc_overlap, dsc_overlap);
ide_devset_rw_flag(dsc_overlap, IDE_DFLAG_DSC_OVERLAP);

static const struct ide_proc_devset idecd_settings[] = {
IDE_PROC_DEVSET(dsc_overlap, 0, 1),
Expand Down Expand Up @@ -1910,7 +1910,10 @@ static int ide_cdrom_setup(ide_drive_t *drive)
/* set correct block size */
blk_queue_hardsect_size(drive->queue, CD_FRAMESIZE);

drive->dsc_overlap = (drive->next != drive);
if (drive->next != drive)
drive->dev_flags |= IDE_DFLAG_DSC_OVERLAP;
else
drive->dev_flags &= ~IDE_DFLAG_DSC_OVERLAP;

if (ide_cdrom_register(drive, nslots)) {
printk(KERN_ERR "%s: %s failed to register device with the"
Expand Down Expand Up @@ -1944,7 +1947,7 @@ static void ide_cd_release(struct kref *kref)
kfree(info->toc);
if (devinfo->handle == drive)
unregister_cdrom(devinfo);
drive->dsc_overlap = 0;
drive->dev_flags &= ~IDE_DFLAG_DSC_OVERLAP;
drive->driver_data = NULL;
blk_queue_prep_rq(drive->queue, NULL);
g->private_data = NULL;
Expand Down
Loading

0 comments on commit 0d638ce

Please sign in to comment.