aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptbase.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r--drivers/message/fusion/mptbase.c75
1 files changed, 48 insertions, 27 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 57543603d6c8..43308df64623 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -368,20 +368,21 @@ static irqreturn_t
368mpt_interrupt(int irq, void *bus_id, struct pt_regs *r) 368mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
369{ 369{
370 MPT_ADAPTER *ioc = bus_id; 370 MPT_ADAPTER *ioc = bus_id;
371 u32 pa; 371 u32 pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo);
372
373 if (pa == 0xFFFFFFFF)
374 return IRQ_NONE;
372 375
373 /* 376 /*
374 * Drain the reply FIFO! 377 * Drain the reply FIFO!
375 */ 378 */
376 while (1) { 379 do {
377 pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo); 380 if (pa & MPI_ADDRESS_REPLY_A_BIT)
378 if (pa == 0xFFFFFFFF)
379 return IRQ_HANDLED;
380 else if (pa & MPI_ADDRESS_REPLY_A_BIT)
381 mpt_reply(ioc, pa); 381 mpt_reply(ioc, pa);
382 else 382 else
383 mpt_turbo_reply(ioc, pa); 383 mpt_turbo_reply(ioc, pa);
384 } 384 pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo);
385 } while (pa != 0xFFFFFFFF);
385 386
386 return IRQ_HANDLED; 387 return IRQ_HANDLED;
387} 388}
@@ -1219,31 +1220,25 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1219 port = psize = 0; 1220 port = psize = 0;
1220 for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) { 1221 for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) {
1221 if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) { 1222 if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) {
1223 if (psize)
1224 continue;
1222 /* Get I/O space! */ 1225 /* Get I/O space! */
1223 port = pci_resource_start(pdev, ii); 1226 port = pci_resource_start(pdev, ii);
1224 psize = pci_resource_len(pdev,ii); 1227 psize = pci_resource_len(pdev,ii);
1225 } else { 1228 } else {
1229 if (msize)
1230 continue;
1226 /* Get memmap */ 1231 /* Get memmap */
1227 mem_phys = pci_resource_start(pdev, ii); 1232 mem_phys = pci_resource_start(pdev, ii);
1228 msize = pci_resource_len(pdev,ii); 1233 msize = pci_resource_len(pdev,ii);
1229 break;
1230 } 1234 }
1231 } 1235 }
1232 ioc->mem_size = msize; 1236 ioc->mem_size = msize;
1233 1237
1234 if (ii == DEVICE_COUNT_RESOURCE) {
1235 printk(KERN_ERR MYNAM ": ERROR - MPT adapter has no memory regions defined!\n");
1236 kfree(ioc);
1237 return -EINVAL;
1238 }
1239
1240 dinitprintk((KERN_INFO MYNAM ": MPT adapter @ %lx, msize=%dd bytes\n", mem_phys, msize));
1241 dinitprintk((KERN_INFO MYNAM ": (port i/o @ %lx, psize=%dd bytes)\n", port, psize));
1242
1243 mem = NULL; 1238 mem = NULL;
1244 /* Get logical ptr for PciMem0 space */ 1239 /* Get logical ptr for PciMem0 space */
1245 /*mem = ioremap(mem_phys, msize);*/ 1240 /*mem = ioremap(mem_phys, msize);*/
1246 mem = ioremap(mem_phys, 0x100); 1241 mem = ioremap(mem_phys, msize);
1247 if (mem == NULL) { 1242 if (mem == NULL) {
1248 printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n"); 1243 printk(KERN_ERR MYNAM ": ERROR - Unable to map adapter memory!\n");
1249 kfree(ioc); 1244 kfree(ioc);
@@ -1343,11 +1338,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1343 ioc->bus_type = SAS; 1338 ioc->bus_type = SAS;
1344 ioc->errata_flag_1064 = 1; 1339 ioc->errata_flag_1064 = 1;
1345 } 1340 }
1346 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066) {
1347 ioc->prod_name = "LSISAS1066";
1348 ioc->bus_type = SAS;
1349 ioc->errata_flag_1064 = 1;
1350 }
1351 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) { 1341 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068) {
1352 ioc->prod_name = "LSISAS1068"; 1342 ioc->prod_name = "LSISAS1068";
1353 ioc->bus_type = SAS; 1343 ioc->bus_type = SAS;
@@ -1357,14 +1347,14 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1357 ioc->prod_name = "LSISAS1064E"; 1347 ioc->prod_name = "LSISAS1064E";
1358 ioc->bus_type = SAS; 1348 ioc->bus_type = SAS;
1359 } 1349 }
1360 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1066E) {
1361 ioc->prod_name = "LSISAS1066E";
1362 ioc->bus_type = SAS;
1363 }
1364 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) { 1350 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1068E) {
1365 ioc->prod_name = "LSISAS1068E"; 1351 ioc->prod_name = "LSISAS1068E";
1366 ioc->bus_type = SAS; 1352 ioc->bus_type = SAS;
1367 } 1353 }
1354 else if (pdev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
1355 ioc->prod_name = "LSISAS1078";
1356 ioc->bus_type = SAS;
1357 }
1368 1358
1369 if (ioc->errata_flag_1064) 1359 if (ioc->errata_flag_1064)
1370 pci_disable_io_access(pdev); 1360 pci_disable_io_access(pdev);
@@ -3184,6 +3174,37 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
3184 u32 diag1val = 0; 3174 u32 diag1val = 0;
3185#endif 3175#endif
3186 3176
3177 if (ioc->pcidev->device == MPI_MANUFACTPAGE_DEVID_SAS1078) {
3178 drsprintk((MYIOC_s_WARN_FMT "%s: Doorbell=%p; 1078 reset "
3179 "address=%p\n", ioc->name, __FUNCTION__,
3180 &ioc->chip->Doorbell, &ioc->chip->Reset_1078));
3181 CHIPREG_WRITE32(&ioc->chip->Reset_1078, 0x07);
3182 if (sleepFlag == CAN_SLEEP)
3183 msleep(1);
3184 else
3185 mdelay(1);
3186
3187 for (count = 0; count < 60; count ++) {
3188 doorbell = CHIPREG_READ32(&ioc->chip->Doorbell);
3189 doorbell &= MPI_IOC_STATE_MASK;
3190
3191 drsprintk((MYIOC_s_INFO_FMT
3192 "looking for READY STATE: doorbell=%x"
3193 " count=%d\n",
3194 ioc->name, doorbell, count));
3195 if (doorbell == MPI_IOC_STATE_READY) {
3196 return 0;
3197 }
3198
3199 /* wait 1 sec */
3200 if (sleepFlag == CAN_SLEEP)
3201 msleep(1000);
3202 else
3203 mdelay(1000);
3204 }
3205 return -1;
3206 }
3207
3187 /* Clear any existing interrupts */ 3208 /* Clear any existing interrupts */
3188 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); 3209 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
3189 3210