aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-05-27 16:13:43 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:01:10 -0400
commit3d0eab67cf556db4430a42fbb45dc90ef690d30c (patch)
tree45c33c8f15521acffa8f6048bc149b834396e6d4 /drivers/scsi/hpsa.c
parentf7c391015ab64c835a9bb403626b38a51d6432cc (diff)
[SCSI] hpsa: factor out hpsa_p600_dma_prefetch_quirk
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 62f9784ecf8f..9e81e0bcf1e2 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -3396,6 +3396,20 @@ static inline void hpsa_enable_scsi_prefetch(struct ctlr_info *h)
3396#endif 3396#endif
3397} 3397}
3398 3398
3399/* Disable DMA prefetch for the P600. Otherwise an ASIC bug may result
3400 * in a prefetch beyond physical memory.
3401 */
3402static inline void hpsa_p600_dma_prefetch_quirk(struct ctlr_info *h)
3403{
3404 u32 dma_prefetch;
3405
3406 if (h->board_id != 0x3225103C)
3407 return;
3408 dma_prefetch = readl(h->vaddr + I2O_DMA1_CFG);
3409 dma_prefetch |= 0x8000;
3410 writel(dma_prefetch, h->vaddr + I2O_DMA1_CFG);
3411}
3412
3399static int __devinit hpsa_pci_init(struct ctlr_info *h) 3413static int __devinit hpsa_pci_init(struct ctlr_info *h)
3400{ 3414{
3401 int i, prod_index, err; 3415 int i, prod_index, err;
@@ -3444,17 +3458,7 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h)
3444 goto err_out_free_res; 3458 goto err_out_free_res;
3445 } 3459 }
3446 hpsa_enable_scsi_prefetch(h); 3460 hpsa_enable_scsi_prefetch(h);
3447 3461 hpsa_p600_dma_prefetch_quirk(h);
3448 /* Disabling DMA prefetch for the P600
3449 * An ASIC bug may result in a prefetch beyond
3450 * physical memory.
3451 */
3452 if (h->board_id == 0x3225103C) {
3453 u32 dma_prefetch;
3454 dma_prefetch = readl(h->vaddr + I2O_DMA1_CFG);
3455 dma_prefetch |= 0x8000;
3456 writel(dma_prefetch, h->vaddr + I2O_DMA1_CFG);
3457 }
3458 3462
3459 h->max_commands = readl(&(h->cfgtable->CmdsOutMax)); 3463 h->max_commands = readl(&(h->cfgtable->CmdsOutMax));
3460 /* Update the field, and then ring the doorbell */ 3464 /* Update the field, and then ring the doorbell */