Skip to content

Commit 6594d0b

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (27 commits) xsysace: Fix dereferencing of cf_id after hd_driveid removal at91_ide: turn on PIO 6 support at91_ide: remove unused ide_mm_{outb,inb} ide-cd: reverse NOT_READY sense key logic ide: refactor tf_read() method ide: refactor tf_load() method ide: call write_devctl() method from tf_read() method ide: move common code out of tf_load() method ide: simplify 'struct ide_taskfile' ide: replace IDE_TFLAG_* flags by IDE_VALID_* ide-cd: fix intendation in cdrom_decode_status() ide-cd: unify handling of fs and pc requests in cdrom_decode_status() ide-cd: convert cdrom_decode_status() to use switch statements ide-cd: update debugging support ide-cd: respect REQ_QUIET for fs requests in cdrom_decode_status() ide: remove unused #include <linux/version.h> tx4939ide: Fix tx4939ide_{in,out}put_data_swap argument tx493[89]ide: Remove big endian version of tx493[89]ide_tf_{load,read} ide-cd: carve out an ide_cd_breathe()-helper for fs write requests ide-cd: move status checking into the IRQ handler ...
2 parents 0534c8c + f0edef8 commit 6594d0b

26 files changed

+461
-916
lines changed

drivers/block/xsysace.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ static void ace_fsm_dostate(struct ace_device *ace)
563563
case ACE_FSM_STATE_IDENTIFY_PREPARE:
564564
/* Send identify command */
565565
ace->fsm_task = ACE_TASK_IDENTIFY;
566-
ace->data_ptr = &ace->cf_id;
566+
ace->data_ptr = ace->cf_id;
567567
ace->data_count = ACE_BUF_PER_SECTOR;
568568
ace_out(ace, ACE_SECCNTCMD, ACE_SECCNTCMD_IDENTIFY);
569569

@@ -608,8 +608,8 @@ static void ace_fsm_dostate(struct ace_device *ace)
608608
break;
609609

610610
case ACE_FSM_STATE_IDENTIFY_COMPLETE:
611-
ace_fix_driveid(&ace->cf_id[0]);
612-
ace_dump_mem(&ace->cf_id, 512); /* Debug: Dump out disk ID */
611+
ace_fix_driveid(ace->cf_id);
612+
ace_dump_mem(ace->cf_id, 512); /* Debug: Dump out disk ID */
613613

614614
if (ace->data_result) {
615615
/* Error occured, disable the disk */
@@ -622,9 +622,9 @@ static void ace_fsm_dostate(struct ace_device *ace)
622622

623623
/* Record disk parameters */
624624
set_capacity(ace->gd,
625-
ata_id_u32(&ace->cf_id, ATA_ID_LBA_CAPACITY));
625+
ata_id_u32(ace->cf_id, ATA_ID_LBA_CAPACITY));
626626
dev_info(ace->dev, "capacity: %i sectors\n",
627-
ata_id_u32(&ace->cf_id, ATA_ID_LBA_CAPACITY));
627+
ata_id_u32(ace->cf_id, ATA_ID_LBA_CAPACITY));
628628
}
629629

630630
/* We're done, drop to IDLE state and notify waiters */
@@ -923,7 +923,7 @@ static int ace_release(struct gendisk *disk, fmode_t mode)
923923
static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo)
924924
{
925925
struct ace_device *ace = bdev->bd_disk->private_data;
926-
u16 *cf_id = &ace->cf_id[0];
926+
u16 *cf_id = ace->cf_id;
927927

928928
dev_dbg(ace->dev, "ace_getgeo()\n");
929929

drivers/ide/at91_ide.c

Lines changed: 3 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
*
2121
*/
2222

23-
#include <linux/version.h>
2423
#include <linux/kernel.h>
2524
#include <linux/module.h>
2625
#include <linux/clk.h>
@@ -175,90 +174,6 @@ static void at91_ide_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
175174
leave_16bit(chipselect, mode);
176175
}
177176

178-
static u8 ide_mm_inb(unsigned long port)
179-
{
180-
return readb((void __iomem *) port);
181-
}
182-
183-
static void ide_mm_outb(u8 value, unsigned long port)
184-
{
185-
writeb(value, (void __iomem *) port);
186-
}
187-
188-
static void at91_ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd)
189-
{
190-
ide_hwif_t *hwif = drive->hwif;
191-
struct ide_io_ports *io_ports = &hwif->io_ports;
192-
struct ide_taskfile *tf = &cmd->tf;
193-
u8 HIHI = (cmd->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
194-
195-
if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED)
196-
HIHI = 0xFF;
197-
198-
if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE)
199-
ide_mm_outb(tf->hob_feature, io_ports->feature_addr);
200-
if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_NSECT)
201-
ide_mm_outb(tf->hob_nsect, io_ports->nsect_addr);
202-
if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_LBAL)
203-
ide_mm_outb(tf->hob_lbal, io_ports->lbal_addr);
204-
if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_LBAM)
205-
ide_mm_outb(tf->hob_lbam, io_ports->lbam_addr);
206-
if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_LBAH)
207-
ide_mm_outb(tf->hob_lbah, io_ports->lbah_addr);
208-
209-
if (cmd->tf_flags & IDE_TFLAG_OUT_FEATURE)
210-
ide_mm_outb(tf->feature, io_ports->feature_addr);
211-
if (cmd->tf_flags & IDE_TFLAG_OUT_NSECT)
212-
ide_mm_outb(tf->nsect, io_ports->nsect_addr);
213-
if (cmd->tf_flags & IDE_TFLAG_OUT_LBAL)
214-
ide_mm_outb(tf->lbal, io_ports->lbal_addr);
215-
if (cmd->tf_flags & IDE_TFLAG_OUT_LBAM)
216-
ide_mm_outb(tf->lbam, io_ports->lbam_addr);
217-
if (cmd->tf_flags & IDE_TFLAG_OUT_LBAH)
218-
ide_mm_outb(tf->lbah, io_ports->lbah_addr);
219-
220-
if (cmd->tf_flags & IDE_TFLAG_OUT_DEVICE)
221-
ide_mm_outb((tf->device & HIHI) | drive->select, io_ports->device_addr);
222-
}
223-
224-
static void at91_ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
225-
{
226-
ide_hwif_t *hwif = drive->hwif;
227-
struct ide_io_ports *io_ports = &hwif->io_ports;
228-
struct ide_taskfile *tf = &cmd->tf;
229-
230-
/* be sure we're looking at the low order bits */
231-
ide_mm_outb(ATA_DEVCTL_OBS, io_ports->ctl_addr);
232-
233-
if (cmd->tf_flags & IDE_TFLAG_IN_ERROR)
234-
tf->error = ide_mm_inb(io_ports->feature_addr);
235-
if (cmd->tf_flags & IDE_TFLAG_IN_NSECT)
236-
tf->nsect = ide_mm_inb(io_ports->nsect_addr);
237-
if (cmd->tf_flags & IDE_TFLAG_IN_LBAL)
238-
tf->lbal = ide_mm_inb(io_ports->lbal_addr);
239-
if (cmd->tf_flags & IDE_TFLAG_IN_LBAM)
240-
tf->lbam = ide_mm_inb(io_ports->lbam_addr);
241-
if (cmd->tf_flags & IDE_TFLAG_IN_LBAH)
242-
tf->lbah = ide_mm_inb(io_ports->lbah_addr);
243-
if (cmd->tf_flags & IDE_TFLAG_IN_DEVICE)
244-
tf->device = ide_mm_inb(io_ports->device_addr);
245-
246-
if (cmd->tf_flags & IDE_TFLAG_LBA48) {
247-
ide_mm_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr);
248-
249-
if (cmd->tf_flags & IDE_TFLAG_IN_HOB_ERROR)
250-
tf->hob_error = ide_mm_inb(io_ports->feature_addr);
251-
if (cmd->tf_flags & IDE_TFLAG_IN_HOB_NSECT)
252-
tf->hob_nsect = ide_mm_inb(io_ports->nsect_addr);
253-
if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAL)
254-
tf->hob_lbal = ide_mm_inb(io_ports->lbal_addr);
255-
if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAM)
256-
tf->hob_lbam = ide_mm_inb(io_ports->lbam_addr);
257-
if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAH)
258-
tf->hob_lbah = ide_mm_inb(io_ports->lbah_addr);
259-
}
260-
}
261-
262177
static void at91_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
263178
{
264179
struct ide_timing *timing;
@@ -284,8 +199,8 @@ static const struct ide_tp_ops at91_ide_tp_ops = {
284199
.write_devctl = ide_write_devctl,
285200

286201
.dev_select = ide_dev_select,
287-
.tf_load = at91_ide_tf_load,
288-
.tf_read = at91_ide_tf_read,
202+
.tf_load = ide_tf_load,
203+
.tf_read = ide_tf_read,
289204

290205
.input_data = at91_ide_input_data,
291206
.output_data = at91_ide_output_data,
@@ -300,7 +215,7 @@ static const struct ide_port_info at91_ide_port_info __initdata = {
300215
.tp_ops = &at91_ide_tp_ops,
301216
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA | IDE_HFLAG_SINGLE |
302217
IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_UNMASK_IRQS,
303-
.pio_mask = ATA_PIO5,
218+
.pio_mask = ATA_PIO6,
304219
};
305220

306221
/*

drivers/ide/falconide.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <asm/atarihw.h>
2121
#include <asm/atariints.h>
2222
#include <asm/atari_stdma.h>
23+
#include <asm/ide.h>
2324

2425
#define DRV_NAME "falconide"
2526

@@ -67,8 +68,10 @@ static void falconide_input_data(ide_drive_t *drive, struct ide_cmd *cmd,
6768
{
6869
unsigned long data_addr = drive->hwif->io_ports.data_addr;
6970

70-
if (drive->media == ide_disk && cmd && (cmd->tf_flags & IDE_TFLAG_FS))
71-
return insw(data_addr, buf, (len + 1) / 2);
71+
if (drive->media == ide_disk && cmd && (cmd->tf_flags & IDE_TFLAG_FS)) {
72+
__ide_mm_insw(data_addr, buf, (len + 1) / 2);
73+
return;
74+
}
7275

7376
raw_insw_swapw((u16 *)data_addr, buf, (len + 1) / 2);
7477
}
@@ -78,8 +81,10 @@ static void falconide_output_data(ide_drive_t *drive, struct ide_cmd *cmd,
7881
{
7982
unsigned long data_addr = drive->hwif->io_ports.data_addr;
8083

81-
if (drive->media == ide_disk && cmd && (cmd->tf_flags & IDE_TFLAG_FS))
82-
return outsw(data_addr, buf, (len + 1) / 2);
84+
if (drive->media == ide_disk && cmd && (cmd->tf_flags & IDE_TFLAG_FS)) {
85+
__ide_mm_outsw(data_addr, buf, (len + 1) / 2);
86+
return;
87+
}
8388

8489
raw_outsw_swapw((u16 *)data_addr, buf, (len + 1) / 2);
8590
}

drivers/ide/ide-acpi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,9 @@ static int do_drive_set_taskfiles(ide_drive_t *drive,
318318

319319
/* convert GTF to taskfile */
320320
memset(&cmd, 0, sizeof(cmd));
321-
memcpy(&cmd.tf_array[7], gtf, REGS_PER_GTF);
322-
cmd.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
321+
memcpy(&cmd.tf.feature, gtf, REGS_PER_GTF);
322+
cmd.valid.out.tf = IDE_VALID_OUT_TF | IDE_VALID_DEVICE;
323+
cmd.valid.in.tf = IDE_VALID_IN_TF | IDE_VALID_DEVICE;
323324

324325
err = ide_no_data_taskfile(drive, &cmd);
325326
if (err) {

drivers/ide/ide-atapi.c

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,13 @@ EXPORT_SYMBOL_GPL(ide_cd_get_xferlen);
254254

255255
void ide_read_bcount_and_ireason(ide_drive_t *drive, u16 *bcount, u8 *ireason)
256256
{
257-
struct ide_cmd cmd;
257+
struct ide_taskfile tf;
258258

259-
memset(&cmd, 0, sizeof(cmd));
260-
cmd.tf_flags = IDE_TFLAG_IN_LBAH | IDE_TFLAG_IN_LBAM |
261-
IDE_TFLAG_IN_NSECT;
259+
drive->hwif->tp_ops->tf_read(drive, &tf, IDE_VALID_NSECT |
260+
IDE_VALID_LBAM | IDE_VALID_LBAH);
262261

263-
drive->hwif->tp_ops->tf_read(drive, &cmd);
264-
265-
*bcount = (cmd.tf.lbah << 8) | cmd.tf.lbam;
266-
*ireason = cmd.tf.nsect & 3;
262+
*bcount = (tf.lbah << 8) | tf.lbam;
263+
*ireason = tf.nsect & 3;
267264
}
268265
EXPORT_SYMBOL_GPL(ide_read_bcount_and_ireason);
269266

@@ -439,12 +436,12 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
439436
return ide_started;
440437
}
441438

442-
static void ide_init_packet_cmd(struct ide_cmd *cmd, u32 tf_flags,
439+
static void ide_init_packet_cmd(struct ide_cmd *cmd, u8 valid_tf,
443440
u16 bcount, u8 dma)
444441
{
445-
cmd->protocol = dma ? ATAPI_PROT_DMA : ATAPI_PROT_PIO;
446-
cmd->tf_flags |= IDE_TFLAG_OUT_LBAH | IDE_TFLAG_OUT_LBAM |
447-
IDE_TFLAG_OUT_FEATURE | tf_flags;
442+
cmd->protocol = dma ? ATAPI_PROT_DMA : ATAPI_PROT_PIO;
443+
cmd->valid.out.tf = IDE_VALID_LBAH | IDE_VALID_LBAM |
444+
IDE_VALID_FEATURE | valid_tf;
448445
cmd->tf.command = ATA_CMD_PACKET;
449446
cmd->tf.feature = dma; /* Use PIO/DMA */
450447
cmd->tf.lbam = bcount & 0xff;
@@ -453,14 +450,11 @@ static void ide_init_packet_cmd(struct ide_cmd *cmd, u32 tf_flags,
453450

454451
static u8 ide_read_ireason(ide_drive_t *drive)
455452
{
456-
struct ide_cmd cmd;
457-
458-
memset(&cmd, 0, sizeof(cmd));
459-
cmd.tf_flags = IDE_TFLAG_IN_NSECT;
453+
struct ide_taskfile tf;
460454

461-
drive->hwif->tp_ops->tf_read(drive, &cmd);
455+
drive->hwif->tp_ops->tf_read(drive, &tf, IDE_VALID_NSECT);
462456

463-
return cmd.tf.nsect & 3;
457+
return tf.nsect & 3;
464458
}
465459

466460
static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason)
@@ -588,12 +582,12 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
588582
ide_expiry_t *expiry = NULL;
589583
struct request *rq = hwif->rq;
590584
unsigned int timeout;
591-
u32 tf_flags;
592585
u16 bcount;
586+
u8 valid_tf;
593587
u8 drq_int = !!(drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT);
594588

595589
if (dev_is_idecd(drive)) {
596-
tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
590+
valid_tf = IDE_VALID_NSECT | IDE_VALID_LBAL;
597591
bcount = ide_cd_get_xferlen(rq);
598592
expiry = ide_cd_expiry;
599593
timeout = ATAPI_WAIT_PC;
@@ -607,7 +601,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
607601
pc->xferred = 0;
608602
pc->cur_pos = pc->buf;
609603

610-
tf_flags = IDE_TFLAG_OUT_DEVICE;
604+
valid_tf = IDE_VALID_DEVICE;
611605
bcount = ((drive->media == ide_tape) ?
612606
pc->req_xfer :
613607
min(pc->req_xfer, 63 * 1024));
@@ -627,7 +621,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, struct ide_cmd *cmd)
627621
: WAIT_TAPE_CMD;
628622
}
629623

630-
ide_init_packet_cmd(cmd, tf_flags, bcount, drive->dma);
624+
ide_init_packet_cmd(cmd, valid_tf, bcount, drive->dma);
631625

632626
(void)do_rw_taskfile(drive, cmd);
633627

0 commit comments

Comments
 (0)