aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid
diff options
context:
space:
mode:
authorBen Collins <bcollins@ubuntu.com>2012-06-11 14:05:02 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 03:58:43 -0400
commitff08784b41e1ab5da6776411b7a8381fe942f2cc (patch)
tree0f26c0cbd909089ccca01ba3516040eb771ad552 /drivers/scsi/aacraid
parent7e8a74b177f17d100916b6ad415450f7c9508691 (diff)
[SCSI] aacraid: Use resource_size_t for IO mem pointers and offsets
This also stops using the "legacy crap" in Scsi_Host (shost->base is an unsigned long). This affected 32-bit systems that have 64-bit resource sizes, causing the IO address to be truncated. Signed-off-by: Ben Collins <bcollins@ubuntu.com> Acked-by: Achim Leubner <Achim_Leubner@pmc-sierra.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/aacraid')
-rw-r--r--drivers/scsi/aacraid/aacraid.h5
-rw-r--r--drivers/scsi/aacraid/linit.c2
-rw-r--r--drivers/scsi/aacraid/nark.c4
-rw-r--r--drivers/scsi/aacraid/rkt.c2
-rw-r--r--drivers/scsi/aacraid/rx.c4
-rw-r--r--drivers/scsi/aacraid/sa.c4
-rw-r--r--drivers/scsi/aacraid/src.c7
7 files changed, 14 insertions, 14 deletions
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 3fcf62724fad..6ab32db73bb6 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1052,10 +1052,11 @@ struct aac_dev
1052 struct adapter_ops a_ops; 1052 struct adapter_ops a_ops;
1053 unsigned long fsrev; /* Main driver's revision number */ 1053 unsigned long fsrev; /* Main driver's revision number */
1054 1054
1055 unsigned long dbg_base; /* address of UART 1055 resource_size_t base_start; /* main IO base */
1056 resource_size_t dbg_base; /* address of UART
1056 * debug buffer */ 1057 * debug buffer */
1057 1058
1058 unsigned base_size, dbg_size; /* Size of 1059 resource_size_t base_size, dbg_size; /* Size of
1059 * mapped in region */ 1060 * mapped in region */
1060 1061
1061 struct aac_init *init; /* Holds initialization info to communicate with adapter */ 1062 struct aac_init *init; /* Holds initialization info to communicate with adapter */
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 0d279c445a30..fdfc4be9c7c6 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1145,11 +1145,11 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
1145 goto out_disable_pdev; 1145 goto out_disable_pdev;
1146 1146
1147 shost->irq = pdev->irq; 1147 shost->irq = pdev->irq;
1148 shost->base = pci_resource_start(pdev, 0);
1149 shost->unique_id = unique_id; 1148 shost->unique_id = unique_id;
1150 shost->max_cmd_len = 16; 1149 shost->max_cmd_len = 16;
1151 1150
1152 aac = (struct aac_dev *)shost->hostdata; 1151 aac = (struct aac_dev *)shost->hostdata;
1152 aac->base_start = pci_resource_start(pdev, 0);
1153 aac->scsi_host_ptr = shost; 1153 aac->scsi_host_ptr = shost;
1154 aac->pdev = pdev; 1154 aac->pdev = pdev;
1155 aac->name = aac_driver_template.name; 1155 aac->name = aac_driver_template.name;
diff --git a/drivers/scsi/aacraid/nark.c b/drivers/scsi/aacraid/nark.c
index f397d21a0c06..6c53b1d8b2ba 100644
--- a/drivers/scsi/aacraid/nark.c
+++ b/drivers/scsi/aacraid/nark.c
@@ -49,14 +49,14 @@ static int aac_nark_ioremap(struct aac_dev * dev, u32 size)
49 dev->base = NULL; 49 dev->base = NULL;
50 return 0; 50 return 0;
51 } 51 }
52 dev->scsi_host_ptr->base = pci_resource_start(dev->pdev, 2); 52 dev->base_start = pci_resource_start(dev->pdev, 2);
53 dev->regs.rx = ioremap((u64)pci_resource_start(dev->pdev, 0) | 53 dev->regs.rx = ioremap((u64)pci_resource_start(dev->pdev, 0) |
54 ((u64)pci_resource_start(dev->pdev, 1) << 32), 54 ((u64)pci_resource_start(dev->pdev, 1) << 32),
55 sizeof(struct rx_registers) - sizeof(struct rx_inbound)); 55 sizeof(struct rx_registers) - sizeof(struct rx_inbound));
56 dev->base = NULL; 56 dev->base = NULL;
57 if (dev->regs.rx == NULL) 57 if (dev->regs.rx == NULL)
58 return -1; 58 return -1;
59 dev->base = ioremap(dev->scsi_host_ptr->base, size); 59 dev->base = ioremap(dev->base_start, size);
60 if (dev->base == NULL) { 60 if (dev->base == NULL) {
61 iounmap(dev->regs.rx); 61 iounmap(dev->regs.rx);
62 dev->regs.rx = NULL; 62 dev->regs.rx = NULL;
diff --git a/drivers/scsi/aacraid/rkt.c b/drivers/scsi/aacraid/rkt.c
index be44de92429a..7d8013feedde 100644
--- a/drivers/scsi/aacraid/rkt.c
+++ b/drivers/scsi/aacraid/rkt.c
@@ -79,7 +79,7 @@ static int aac_rkt_ioremap(struct aac_dev * dev, u32 size)
79 iounmap(dev->regs.rkt); 79 iounmap(dev->regs.rkt);
80 return 0; 80 return 0;
81 } 81 }
82 dev->base = dev->regs.rkt = ioremap(dev->scsi_host_ptr->base, size); 82 dev->base = dev->regs.rkt = ioremap(dev->base_start, size);
83 if (dev->base == NULL) 83 if (dev->base == NULL)
84 return -1; 84 return -1;
85 dev->IndexRegs = &dev->regs.rkt->IndexRegs; 85 dev->IndexRegs = &dev->regs.rkt->IndexRegs;
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index b029c7cc785b..dada38aeacc0 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -471,7 +471,7 @@ static int aac_rx_ioremap(struct aac_dev * dev, u32 size)
471 iounmap(dev->regs.rx); 471 iounmap(dev->regs.rx);
472 return 0; 472 return 0;
473 } 473 }
474 dev->base = dev->regs.rx = ioremap(dev->scsi_host_ptr->base, size); 474 dev->base = dev->regs.rx = ioremap(dev->base_start, size);
475 if (dev->base == NULL) 475 if (dev->base == NULL)
476 return -1; 476 return -1;
477 dev->IndexRegs = &dev->regs.rx->IndexRegs; 477 dev->IndexRegs = &dev->regs.rx->IndexRegs;
@@ -653,7 +653,7 @@ int _aac_rx_init(struct aac_dev *dev)
653 name, instance); 653 name, instance);
654 goto error_iounmap; 654 goto error_iounmap;
655 } 655 }
656 dev->dbg_base = dev->scsi_host_ptr->base; 656 dev->dbg_base = dev->base_start;
657 dev->dbg_base_mapped = dev->base; 657 dev->dbg_base_mapped = dev->base;
658 dev->dbg_size = dev->base_size; 658 dev->dbg_size = dev->base_size;
659 659
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
index beb533630d4b..2244f315f33b 100644
--- a/drivers/scsi/aacraid/sa.c
+++ b/drivers/scsi/aacraid/sa.c
@@ -305,7 +305,7 @@ static int aac_sa_ioremap(struct aac_dev * dev, u32 size)
305 iounmap(dev->regs.sa); 305 iounmap(dev->regs.sa);
306 return 0; 306 return 0;
307 } 307 }
308 dev->base = dev->regs.sa = ioremap(dev->scsi_host_ptr->base, size); 308 dev->base = dev->regs.sa = ioremap(dev->base_start, size);
309 return (dev->base == NULL) ? -1 : 0; 309 return (dev->base == NULL) ? -1 : 0;
310} 310}
311 311
@@ -393,7 +393,7 @@ int aac_sa_init(struct aac_dev *dev)
393 name, instance); 393 name, instance);
394 goto error_iounmap; 394 goto error_iounmap;
395 } 395 }
396 dev->dbg_base = dev->scsi_host_ptr->base; 396 dev->dbg_base = dev->base_start;
397 dev->dbg_base_mapped = dev->base; 397 dev->dbg_base_mapped = dev->base;
398 dev->dbg_size = dev->base_size; 398 dev->dbg_size = dev->base_size;
399 399
diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
index 762820636304..27a3e77de17f 100644
--- a/drivers/scsi/aacraid/src.c
+++ b/drivers/scsi/aacraid/src.c
@@ -435,8 +435,7 @@ static int aac_src_ioremap(struct aac_dev *dev, u32 size)
435 dev->base = NULL; 435 dev->base = NULL;
436 if (dev->regs.src.bar1 == NULL) 436 if (dev->regs.src.bar1 == NULL)
437 return -1; 437 return -1;
438 dev->base = dev->regs.src.bar0 = ioremap(dev->scsi_host_ptr->base, 438 dev->base = dev->regs.src.bar0 = ioremap(dev->base_start, size);
439 size);
440 if (dev->base == NULL) { 439 if (dev->base == NULL) {
441 iounmap(dev->regs.src.bar1); 440 iounmap(dev->regs.src.bar1);
442 dev->regs.src.bar1 = NULL; 441 dev->regs.src.bar1 = NULL;
@@ -459,7 +458,7 @@ static int aac_srcv_ioremap(struct aac_dev *dev, u32 size)
459 dev->base = dev->regs.src.bar0 = NULL; 458 dev->base = dev->regs.src.bar0 = NULL;
460 return 0; 459 return 0;
461 } 460 }
462 dev->base = dev->regs.src.bar0 = ioremap(dev->scsi_host_ptr->base, size); 461 dev->base = dev->regs.src.bar0 = ioremap(dev->base_start, size);
463 if (dev->base == NULL) 462 if (dev->base == NULL)
464 return -1; 463 return -1;
465 dev->IndexRegs = &((struct src_registers __iomem *) 464 dev->IndexRegs = &((struct src_registers __iomem *)
@@ -764,7 +763,7 @@ int aac_srcv_init(struct aac_dev *dev)
764 name, instance); 763 name, instance);
765 goto error_iounmap; 764 goto error_iounmap;
766 } 765 }
767 dev->dbg_base = dev->scsi_host_ptr->base; 766 dev->dbg_base = dev->base_start;
768 dev->dbg_base_mapped = dev->base; 767 dev->dbg_base_mapped = dev->base;
769 dev->dbg_size = dev->base_size; 768 dev->dbg_size = dev->base_size;
770 769