mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 23:20:05 +00:00
ide: make ide_dma_timeout() available also for CONFIG_BLK_DEV_IDEDMA_SFF=n
Make ide_dma_timeout() available also for CONFIG_BLK_DEV_IDEDMA_SFF=n and convert {ics,au1xxx-}ide.c to use it. While at it: - dump ATA Status register content on error - use EXPORT_SYMBOL_GPL() to match the rest of SFF DMA functions Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
de23ec9ca8
commit
ffa15a6915
@ -372,20 +372,6 @@ static int icside_dma_test_irq(ide_drive_t *drive)
|
|||||||
ICS_ARCIN_V6_INTRSTAT_1)) & 1;
|
ICS_ARCIN_V6_INTRSTAT_1)) & 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void icside_dma_timeout(ide_drive_t *drive)
|
|
||||||
{
|
|
||||||
ide_hwif_t *hwif = drive->hwif;
|
|
||||||
|
|
||||||
printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name);
|
|
||||||
|
|
||||||
if (icside_dma_test_irq(drive))
|
|
||||||
return;
|
|
||||||
|
|
||||||
ide_dump_status(drive, "DMA timeout", hwif->tp_ops->read_status(hwif));
|
|
||||||
|
|
||||||
icside_dma_end(drive);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int icside_dma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
|
static int icside_dma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
|
||||||
{
|
{
|
||||||
hwif->dmatable_cpu = NULL;
|
hwif->dmatable_cpu = NULL;
|
||||||
@ -401,7 +387,7 @@ static const struct ide_dma_ops icside_v6_dma_ops = {
|
|||||||
.dma_start = icside_dma_start,
|
.dma_start = icside_dma_start,
|
||||||
.dma_end = icside_dma_end,
|
.dma_end = icside_dma_end,
|
||||||
.dma_test_irq = icside_dma_test_irq,
|
.dma_test_irq = icside_dma_test_irq,
|
||||||
.dma_timeout = icside_dma_timeout,
|
.dma_timeout = ide_dma_timeout,
|
||||||
.dma_lost_irq = ide_dma_lost_irq,
|
.dma_lost_irq = ide_dma_lost_irq,
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
|
@ -829,8 +829,7 @@ void ide_dma_lost_irq(ide_drive_t *drive)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(ide_dma_lost_irq);
|
EXPORT_SYMBOL_GPL(ide_dma_lost_irq);
|
||||||
|
|
||||||
#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
|
void ide_dma_timeout(ide_drive_t *drive)
|
||||||
void ide_dma_timeout (ide_drive_t *drive)
|
|
||||||
{
|
{
|
||||||
ide_hwif_t *hwif = HWIF(drive);
|
ide_hwif_t *hwif = HWIF(drive);
|
||||||
|
|
||||||
@ -839,11 +838,13 @@ void ide_dma_timeout (ide_drive_t *drive)
|
|||||||
if (hwif->dma_ops->dma_test_irq(drive))
|
if (hwif->dma_ops->dma_test_irq(drive))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ide_dump_status(drive, "DMA timeout", hwif->tp_ops->read_status(hwif));
|
||||||
|
|
||||||
hwif->dma_ops->dma_end(drive);
|
hwif->dma_ops->dma_end(drive);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(ide_dma_timeout);
|
||||||
|
|
||||||
EXPORT_SYMBOL(ide_dma_timeout);
|
#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
|
||||||
|
|
||||||
void ide_release_dma_engine(ide_hwif_t *hwif)
|
void ide_release_dma_engine(ide_hwif_t *hwif)
|
||||||
{
|
{
|
||||||
if (hwif->dmatable_cpu) {
|
if (hwif->dmatable_cpu) {
|
||||||
|
@ -366,18 +366,6 @@ static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 de
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
|
#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
|
||||||
static void auide_dma_timeout(ide_drive_t *drive)
|
|
||||||
{
|
|
||||||
ide_hwif_t *hwif = HWIF(drive);
|
|
||||||
|
|
||||||
printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name);
|
|
||||||
|
|
||||||
if (auide_dma_test_irq(drive))
|
|
||||||
return;
|
|
||||||
|
|
||||||
auide_dma_end(drive);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct ide_dma_ops au1xxx_dma_ops = {
|
static const struct ide_dma_ops au1xxx_dma_ops = {
|
||||||
.dma_host_set = auide_dma_host_set,
|
.dma_host_set = auide_dma_host_set,
|
||||||
.dma_setup = auide_dma_setup,
|
.dma_setup = auide_dma_setup,
|
||||||
@ -386,7 +374,7 @@ static const struct ide_dma_ops au1xxx_dma_ops = {
|
|||||||
.dma_end = auide_dma_end,
|
.dma_end = auide_dma_end,
|
||||||
.dma_test_irq = auide_dma_test_irq,
|
.dma_test_irq = auide_dma_test_irq,
|
||||||
.dma_lost_irq = ide_dma_lost_irq,
|
.dma_lost_irq = ide_dma_lost_irq,
|
||||||
.dma_timeout = auide_dma_timeout,
|
.dma_timeout = ide_dma_timeout,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
|
static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
|
||||||
|
@ -1437,11 +1437,11 @@ void ide_dma_exec_cmd(ide_drive_t *, u8);
|
|||||||
extern void ide_dma_start(ide_drive_t *);
|
extern void ide_dma_start(ide_drive_t *);
|
||||||
int ide_dma_end(ide_drive_t *);
|
int ide_dma_end(ide_drive_t *);
|
||||||
int ide_dma_test_irq(ide_drive_t *);
|
int ide_dma_test_irq(ide_drive_t *);
|
||||||
extern void ide_dma_timeout(ide_drive_t *);
|
|
||||||
extern const struct ide_dma_ops sff_dma_ops;
|
extern const struct ide_dma_ops sff_dma_ops;
|
||||||
#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
|
#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
|
||||||
|
|
||||||
void ide_dma_lost_irq(ide_drive_t *);
|
void ide_dma_lost_irq(ide_drive_t *);
|
||||||
|
void ide_dma_timeout(ide_drive_t *);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
|
static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user