aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-07-19 14:45:46 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:52:11 -0400
commitbfd63ee571ed2a1ab7af99544e326483f84c0544 (patch)
tree8cc6305c52d66fcafb6ae935359c76059339330e /drivers/block/cciss.c
parent322e304c4d71b79b3950ca560db4868cc3e04ee6 (diff)
cciss: factor out cciss_p600_dma_prefetch_quirk()
cciss: factor out cciss_p600_dma_prefetch_quirk() Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index b4264bcda618..e1c2bf1c6d64 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -4120,6 +4120,24 @@ static inline void cciss_enable_scsi_prefetch(ctlr_info_t *h)
4120#endif 4120#endif
4121} 4121}
4122 4122
4123/* Disable DMA prefetch for the P600. Otherwise an ASIC bug may result
4124 * in a prefetch beyond physical memory.
4125 */
4126static inline void cciss_p600_dma_prefetch_quirk(ctlr_info_t *h)
4127{
4128 u32 dma_prefetch;
4129 __u32 dma_refetch;
4130
4131 if (h->board_id != 0x3225103C)
4132 return;
4133 dma_prefetch = readl(h->vaddr + I2O_DMA1_CFG);
4134 dma_prefetch |= 0x8000;
4135 writel(dma_prefetch, h->vaddr + I2O_DMA1_CFG);
4136 pci_read_config_dword(h->pdev, PCI_COMMAND_PARITY, &dma_refetch);
4137 dma_refetch |= 0x1;
4138 pci_write_config_dword(h->pdev, PCI_COMMAND_PARITY, dma_refetch);
4139}
4140
4123static int __devinit cciss_pci_init(ctlr_info_t *c) 4141static int __devinit cciss_pci_init(ctlr_info_t *c)
4124{ 4142{
4125 int prod_index, err; 4143 int prod_index, err;
@@ -4182,24 +4200,7 @@ static int __devinit cciss_pci_init(ctlr_info_t *c)
4182 goto err_out_free_res; 4200 goto err_out_free_res;
4183 } 4201 }
4184 cciss_enable_scsi_prefetch(c); 4202 cciss_enable_scsi_prefetch(c);
4185 /* Disabling DMA prefetch and refetch for the P600. 4203 cciss_p600_dma_prefetch_quirk(c);
4186 * An ASIC bug may result in accesses to invalid memory addresses.
4187 * We've disabled prefetch for some time now. Testing with XEN
4188 * kernels revealed a bug in the refetch if dom0 resides on a P600.
4189 */
4190 if (c->board_id == 0x3225103C) {
4191 __u32 dma_prefetch;
4192 __u32 dma_refetch;
4193 dma_prefetch = readl(c->vaddr + I2O_DMA1_CFG);
4194 dma_prefetch |= 0x8000;
4195 writel(dma_prefetch, c->vaddr + I2O_DMA1_CFG);
4196 pci_read_config_dword(c->pdev, PCI_COMMAND_PARITY,
4197 &dma_refetch);
4198 dma_refetch |= 0x1;
4199 pci_write_config_dword(c->pdev, PCI_COMMAND_PARITY,
4200 dma_refetch);
4201 }
4202
4203#ifdef CCISS_DEBUG 4204#ifdef CCISS_DEBUG
4204 printk(KERN_WARNING "Trying to put board into Performant mode\n"); 4205 printk(KERN_WARNING "Trying to put board into Performant mode\n");
4205#endif /* CCISS_DEBUG */ 4206#endif /* CCISS_DEBUG */