diff options
author | Xiangliang Yu <yuxiangl@marvell.com> | 2011-05-24 22:31:47 +0800 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-07-26 10:33:11 +0400 |
commit | 83c7b61cf49c2659829050fec240601415c7f9d9 (patch) | |
tree | 44dda12fb01e6e6d4e1a3e9b0f9994ed72b16c00 /drivers/scsi/mvsas/mv_64xx.c | |
parent | f1f82a919d7fff21ee8c0ef4b9731fb38f2a65db (diff) |
[SCSI] mvsas: Add driver version and interrupt coalescing to device attributes in sysfs
Signed-off-by: Xiangliang Yu <yuxiangl@marvell.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/mvsas/mv_64xx.c')
-rw-r--r-- | drivers/scsi/mvsas/mv_64xx.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/scsi/mvsas/mv_64xx.c b/drivers/scsi/mvsas/mv_64xx.c index 0e13e6441da..c88b8a7ed39 100644 --- a/drivers/scsi/mvsas/mv_64xx.c +++ b/drivers/scsi/mvsas/mv_64xx.c @@ -402,7 +402,7 @@ static int __devinit mvs_64xx_init(struct mvs_info *mvi) tmp = 0; mw32(MVS_INT_COAL, tmp); - tmp = 0x100; + tmp = 0x10000 | interrupt_coalescing; mw32(MVS_INT_COAL_TMOUT, tmp); /* ladies and gentlemen, start your engines */ @@ -758,6 +758,28 @@ void mvs_64xx_fix_dma(dma_addr_t buf_dma, int buf_len, int from, void *prd) } #endif +static void mvs_64xx_tune_interrupt(struct mvs_info *mvi, u32 time) +{ + void __iomem *regs = mvi->regs; + u32 tmp = 0; + /* interrupt coalescing may cause missing HW interrput in some case, + * and the max count is 0x1ff, while our max slot is 0x200, + * it will make count 0. + */ + if (time == 0) { + mw32(MVS_INT_COAL, 0); + mw32(MVS_INT_COAL_TMOUT, 0x10000); + } else { + if (MVS_CHIP_SLOT_SZ > 0x1ff) + mw32(MVS_INT_COAL, 0x1ff|COAL_EN); + else + mw32(MVS_INT_COAL, MVS_CHIP_SLOT_SZ|COAL_EN); + + tmp = 0x10000 | time; + mw32(MVS_INT_COAL_TMOUT, tmp); + } +} + const struct mvs_dispatch mvs_64xx_dispatch = { "mv64xx", mvs_64xx_init, @@ -811,6 +833,7 @@ const struct mvs_dispatch mvs_64xx_dispatch = { #ifndef DISABLE_HOTPLUG_DMA_FIX mvs_64xx_fix_dma, #endif + mvs_64xx_tune_interrupt, NULL, }; |