Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6:
  ide: remove stale comment from ide-lib.c
  ide: fix comment in init_irq()
  ide: ide_init_port() bugfix
  ide-disk: fix flush requests (take 2)
  ide: introduce CONFIG_BLK_DEV_IDEDMA_SFF option
  bast-ide: build fix
  ide-tape: remove never executed code
  ide: fix ide/legacy/gayle.c compilation
  ide-cd: replace ntohs with generic byteorder macro be16_to_cpu
  ide: remove stale version number
  pdc202xx_old: always enable burst mode
  palm_bk3710: use struct ide_port_info
  palm_bk3710: port initialization/probing bugfix
  palm_bk3710: fix ide_unregister() usage
  palm_bk3710: ide_register_hw() -> ide_device_add()
  ide: insert BUG_ON() into __ide_set_handler() (take 2)
  cs5520: remove stale comment
  ide: another possible ide panic fix for blk-end-request
  • Loading branch information
Linus Torvalds committed Feb 11, 2008
2 parents 9585ca0 + 467390a commit eedcdef
Show file tree
Hide file tree
Showing 16 changed files with 107 additions and 159 deletions.
26 changes: 7 additions & 19 deletions drivers/ide/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ config BLK_DEV_IDEPNP
would like the kernel to automatically detect and activate
it, say Y here.

config BLK_DEV_IDEDMA_SFF
bool

if PCI

comment "PCI IDE chipsets support"
Expand Down Expand Up @@ -459,6 +462,7 @@ config BLK_DEV_RZ1000
config BLK_DEV_IDEDMA_PCI
bool
select BLK_DEV_IDEPCI
select BLK_DEV_IDEDMA_SFF

config BLK_DEV_AEC62XX
tristate "AEC62XX chipset support"
Expand Down Expand Up @@ -688,23 +692,6 @@ config BLK_DEV_PDC202XX_OLD

If unsure, say N.

config PDC202XX_BURST
bool "Special UDMA Feature"
depends on BLK_DEV_PDC202XX_OLD
help
This option causes the pdc202xx driver to enable UDMA modes on the
PDC202xx even when the PDC202xx BIOS has not done so.

It was originally designed for the PDC20246/Ultra33, whose BIOS will
only setup UDMA on the first two PDC20246 cards. It has also been
used successfully on a PDC20265/Ultra100, allowing use of UDMA modes
when the PDC20265 BIOS has been disabled (for faster boot up).

Please read the comments at the top of
<file:drivers/ide/pci/pdc202xx_old.c>.

If unsure, say N.

config BLK_DEV_PDC202XX_NEW
tristate "PROMISE PDC202{68|69|70|71|75|76|77} support"
select BLK_DEV_IDEDMA_PCI
Expand Down Expand Up @@ -1016,7 +1003,7 @@ config BLK_DEV_Q40IDE
config BLK_DEV_PALMCHIP_BK3710
tristate "Palmchip bk3710 IDE controller support"
depends on ARCH_DAVINCI
select BLK_DEV_IDEDMA_PCI
select BLK_DEV_IDEDMA_SFF
help
Say Y here if you want to support the onchip IDE controller on the
TI DaVinci SoC
Expand Down Expand Up @@ -1124,7 +1111,8 @@ config BLK_DEV_UMC8672
endif

config BLK_DEV_IDEDMA
def_bool BLK_DEV_IDEDMA_PCI || BLK_DEV_IDEDMA_PMAC || BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \
BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA

config IDE_ARCH_OBSOLETE_INIT
def_bool ALPHA || (ARM && !ARCH_L7200) || BLACKFIN || X86 || IA64 || M32R || MIPS || PARISC || PPC || (SUPERH64 && BLK_DEV_IDEPCI) || SPARC
Expand Down
12 changes: 4 additions & 8 deletions drivers/ide/arm/bast-ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@
#include <asm/arch/bast-map.h>
#include <asm/arch/bast-irq.h>

/* list of registered interfaces */
static ide_hwif_t *ifs[2];

static int __init
bastide_register(unsigned int base, unsigned int aux, int irq,
ide_hwif_t **hwif)
static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
{
ide_hwif_t *hwif;
hw_regs_t hw;
Expand Down Expand Up @@ -76,8 +71,9 @@ static int __init bastide_init(void)

printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n");

bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0, &ifs[0]);
bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1, &ifs[1]);
bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0);
bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1);

return 0;
}

Expand Down
74 changes: 53 additions & 21 deletions drivers/ide/arm/palm_bk3710.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,37 @@ static void __devinit palm_bk3710_chipinit(void __iomem *base)
palm_bk3710_setpiomode(base, NULL, 0, 600, 0);
palm_bk3710_setpiomode(base, NULL, 1, 600, 0);
}

static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
{
return ATA_CBL_PATA80;
}

static void __devinit palm_bk3710_init_hwif(ide_hwif_t *hwif)
{
hwif->set_pio_mode = palm_bk3710_set_pio_mode;
hwif->set_dma_mode = palm_bk3710_set_dma_mode;

hwif->cable_detect = palm_bk3710_cable_detect;
}

static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
.init_hwif = palm_bk3710_init_hwif,
.host_flags = IDE_HFLAG_NO_DMA, /* hack (no PCI) */
.pio_mask = ATA_PIO4,
.udma_mask = ATA_UDMA4, /* (input clk 99MHz) */
.mwdma_mask = ATA_MWDMA2,
};

static int __devinit palm_bk3710_probe(struct platform_device *pdev)
{
hw_regs_t ide_ctlr_info;
int index = 0;
int pribase;
struct clk *clkp;
struct resource *mem, *irq;
ide_hwif_t *hwif;
void __iomem *base;
int pribase, i;
hw_regs_t hw;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };

clkp = clk_get(NULL, "IDECLK");
if (IS_ERR(clkp))
Expand All @@ -330,7 +352,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
ide_palm_clk = clk_get_rate(ideclkp)/100000;
ide_palm_clk = (10000/ide_palm_clk) + 1;
/* Register the IDE interface with Linux ATA Interface */
memset(&ide_ctlr_info, 0, sizeof(ide_ctlr_info));
memset(&hw, 0, sizeof(hw));

mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (mem == NULL) {
Expand All @@ -349,32 +371,42 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
palm_bk3710_chipinit(base);

pribase = mem->start + IDE_PALM_ATA_PRI_REG_OFFSET;
for (index = 0; index < IDE_NR_PORTS - 2; index++)
ide_ctlr_info.io_ports[index] = pribase + index;
ide_ctlr_info.io_ports[IDE_CONTROL_OFFSET] = mem->start +
for (i = 0; i < IDE_NR_PORTS - 2; i++)
hw.io_ports[i] = pribase + i;
hw.io_ports[IDE_CONTROL_OFFSET] = mem->start +
IDE_PALM_ATA_PRI_CTL_OFFSET;
ide_ctlr_info.irq = irq->start;
ide_ctlr_info.chipset = ide_palm3710;
hw.irq = irq->start;
hw.chipset = ide_palm3710;

if (ide_register_hw(&ide_ctlr_info, NULL, &hwif) < 0) {
printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
return -ENODEV;
}
hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]);
if (hwif == NULL)
goto out;

i = hwif->index;

if (hwif->present)
ide_unregister(i, 0, 0);
else if (!hwif->hold)
ide_init_port_data(hwif, i);

ide_init_port_hw(hwif, &hw);

hwif->set_pio_mode = &palm_bk3710_set_pio_mode;
hwif->set_dma_mode = &palm_bk3710_set_dma_mode;
hwif->mmio = 1;
default_hwif_mmiops(hwif);
hwif->cbl = ATA_CBL_PATA80;
hwif->ultra_mask = 0x1f; /* Ultra DMA Mode 4 Max
(input clk 99MHz) */
hwif->mwdma_mask = 0x7;
hwif->drives[0].autotune = 1;
hwif->drives[1].autotune = 1;

ide_setup_dma(hwif, mem->start);

idx[0] = i;

ide_device_add(idx, &palm_bk3710_port_info);

if (!hwif->present)
goto out;

return 0;
out:
printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
return -ENODEV;
}

static struct platform_driver platform_bk_driver = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
if (stat)
return stat;

toc->hdr.toc_length = ntohs (toc->hdr.toc_length);
toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length);

if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) {
toc->hdr.first_track = BCD2BIN(toc->hdr.first_track);
Expand Down
18 changes: 11 additions & 7 deletions drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,20 +590,24 @@ static ide_proc_entry_t idedisk_proc[] = {
static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
{
ide_drive_t *drive = q->queuedata;
ide_task_t task;
ide_task_t *task = kmalloc(sizeof(*task), GFP_ATOMIC);

memset(&task, 0, sizeof(task));
/* FIXME: map struct ide_taskfile on rq->cmd[] */
BUG_ON(task == NULL);

memset(task, 0, sizeof(*task));
if (ide_id_has_flush_cache_ext(drive->id) &&
(drive->capacity64 >= (1UL << 28)))
task.tf.command = WIN_FLUSH_CACHE_EXT;
task->tf.command = WIN_FLUSH_CACHE_EXT;
else
task.tf.command = WIN_FLUSH_CACHE;
task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
task.data_phase = TASKFILE_NO_DATA;
task->tf.command = WIN_FLUSH_CACHE;
task->tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE |
IDE_TFLAG_DYN;
task->data_phase = TASKFILE_NO_DATA;

rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
rq->cmd_flags |= REQ_SOFTBARRIER;
rq->special = &task;
rq->special = task;
}

/*
Expand Down
14 changes: 7 additions & 7 deletions drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)

EXPORT_SYMBOL_GPL(ide_build_sglist);

#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
/**
* ide_build_dmatable - build IDE DMA table
*
Expand Down Expand Up @@ -316,7 +316,7 @@ void ide_destroy_dmatable (ide_drive_t *drive)

EXPORT_SYMBOL_GPL(ide_destroy_dmatable);

#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
/**
* config_drive_for_dma - attempt to activate IDE DMA
* @drive: the drive to place in DMA mode
Expand Down Expand Up @@ -424,7 +424,7 @@ void ide_dma_host_set(ide_drive_t *drive, int on)
}

EXPORT_SYMBOL_GPL(ide_dma_host_set);
#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */

/**
* ide_dma_off_quietly - Generic DMA kill
Expand Down Expand Up @@ -474,7 +474,7 @@ void ide_dma_on(ide_drive_t *drive)
drive->hwif->dma_host_set(drive, 1);
}

#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
/**
* ide_dma_setup - begin a DMA phase
* @drive: target device
Expand Down Expand Up @@ -591,7 +591,7 @@ static int __ide_dma_test_irq(ide_drive_t *drive)
}
#else
static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */

int __ide_dma_bad_drive (ide_drive_t *drive)
{
Expand Down Expand Up @@ -840,7 +840,7 @@ void ide_check_dma_crc(ide_drive_t *drive)
ide_dma_on(drive);
}

#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
void ide_dma_lost_irq (ide_drive_t *drive)
{
printk("%s: DMA interrupt recovery\n", drive->name);
Expand Down Expand Up @@ -1002,4 +1002,4 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base)
}

EXPORT_SYMBOL_GPL(ide_setup_dma);
#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
19 changes: 12 additions & 7 deletions drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,17 +361,21 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
spin_unlock_irqrestore(&ide_lock, flags);

if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
ide_task_t *args = (ide_task_t *) rq->special;
ide_task_t *task = (ide_task_t *)rq->special;

if (rq->errors == 0)
rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT);
if (args) {
struct ide_taskfile *tf = &args->tf;
rq->errors = !OK_STAT(stat, READY_STAT, BAD_STAT);

if (task) {
struct ide_taskfile *tf = &task->tf;

tf->error = err;
tf->status = stat;

ide_tf_read(drive, args);
ide_tf_read(drive, task);

if (task->tf_flags & IDE_TFLAG_DYN)
kfree(task);
}
} else if (blk_pm_request(rq)) {
struct request_pm_state *pm = rq->data;
Expand All @@ -388,7 +392,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
spin_lock_irqsave(&ide_lock, flags);
HWGROUP(drive)->rq = NULL;
rq->errors = err;
if (__blk_end_request(rq, (rq->errors ? -EIO : 0), 0))
if (unlikely(__blk_end_request(rq, (rq->errors ? -EIO : 0),
blk_rq_bytes(rq))))
BUG();
spin_unlock_irqrestore(&ide_lock, flags);
}
Expand Down
10 changes: 2 additions & 8 deletions drivers/ide/ide-iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,15 +786,11 @@ static void __ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
{
ide_hwgroup_t *hwgroup = HWGROUP(drive);

if (hwgroup->handler != NULL) {
printk(KERN_CRIT "%s: ide_set_handler: handler not null; "
"old=%p, new=%p\n",
drive->name, hwgroup->handler, handler);
}
BUG_ON(hwgroup->handler);
hwgroup->handler = handler;
hwgroup->expiry = expiry;
hwgroup->timer.expires = jiffies + timeout;
hwgroup->req_gen_timer = hwgroup->req_gen;
hwgroup->req_gen_timer = hwgroup->req_gen;
add_timer(&hwgroup->timer);
}

Expand Down Expand Up @@ -827,11 +823,9 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler,
unsigned timeout, ide_expiry_t *expiry)
{
unsigned long flags;
ide_hwgroup_t *hwgroup = HWGROUP(drive);
ide_hwif_t *hwif = HWIF(drive);

spin_lock_irqsave(&ide_lock, flags);
BUG_ON(hwgroup->handler);
__ide_set_handler(drive, handler, timeout, expiry);
hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG);
/*
Expand Down
9 changes: 0 additions & 9 deletions drivers/ide/ide-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@
#include <asm/uaccess.h>
#include <asm/io.h>

/*
* IDE library routines. These are plug in code that most
* drivers can use but occasionally may be weird enough
* to want to do their own thing with
*
* Add common non I/O op stuff here. Make sure it has proper
* kernel-doc function headers or your patch will be rejected
*/

static const char *udma_str[] =
{ "UDMA/16", "UDMA/25", "UDMA/33", "UDMA/44",
"UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" };
Expand Down
4 changes: 2 additions & 2 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ static int init_irq (ide_hwif_t *hwif)
int sa = 0;
#if defined(__mc68000__)
sa = IRQF_SHARED;
#endif /* __mc68000__ || CONFIG_APUS */
#endif /* __mc68000__ */

if (IDE_CHIPSET_IS_PCI(hwif->chipset))
sa = IRQF_SHARED;
Expand Down Expand Up @@ -1355,7 +1355,7 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
hwif->ultra_mask = d->udma_mask;

/* reset DMA masks only for SFF-style DMA controllers */
if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0;

if (d->host_flags & IDE_HFLAG_RQSIZE_256)
Expand Down
Loading

0 comments on commit eedcdef

Please sign in to comment.