Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff08784b authored by Ben Collins's avatar Ben Collins Committed by James Bottomley
Browse files

[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: default avatarBen Collins <bcollins@ubuntu.com>
Acked-by: default avatarAchim Leubner <Achim_Leubner@pmc-sierra.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 7e8a74b1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1052,10 +1052,11 @@ struct aac_dev
	struct adapter_ops	a_ops;
	unsigned long		fsrev;		/* Main driver's revision number */

	unsigned long		dbg_base;	/* address of UART
	resource_size_t		base_start;	/* main IO base */
	resource_size_t		dbg_base;	/* address of UART
						 * debug buffer */

	unsigned		base_size, dbg_size;	/* Size of
	resource_size_t		base_size, dbg_size;	/* Size of
							 *  mapped in region */

	struct aac_init		*init;		/* Holds initialization info to communicate with adapter */
+1 −1
Original line number Diff line number Diff line
@@ -1145,11 +1145,11 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
		goto out_disable_pdev;

	shost->irq = pdev->irq;
	shost->base = pci_resource_start(pdev, 0);
	shost->unique_id = unique_id;
	shost->max_cmd_len = 16;

	aac = (struct aac_dev *)shost->hostdata;
	aac->base_start = pci_resource_start(pdev, 0);
	aac->scsi_host_ptr = shost;
	aac->pdev = pdev;
	aac->name = aac_driver_template.name;
+2 −2
Original line number Diff line number Diff line
@@ -49,14 +49,14 @@ static int aac_nark_ioremap(struct aac_dev * dev, u32 size)
		dev->base = NULL;
		return 0;
	}
	dev->scsi_host_ptr->base = pci_resource_start(dev->pdev, 2);
	dev->base_start = pci_resource_start(dev->pdev, 2);
	dev->regs.rx = ioremap((u64)pci_resource_start(dev->pdev, 0) |
	  ((u64)pci_resource_start(dev->pdev, 1) << 32),
	  sizeof(struct rx_registers) - sizeof(struct rx_inbound));
	dev->base = NULL;
	if (dev->regs.rx == NULL)
		return -1;
	dev->base = ioremap(dev->scsi_host_ptr->base, size);
	dev->base = ioremap(dev->base_start, size);
	if (dev->base == NULL) {
		iounmap(dev->regs.rx);
		dev->regs.rx = NULL;
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ static int aac_rkt_ioremap(struct aac_dev * dev, u32 size)
		iounmap(dev->regs.rkt);
		return 0;
	}
	dev->base = dev->regs.rkt = ioremap(dev->scsi_host_ptr->base, size);
	dev->base = dev->regs.rkt = ioremap(dev->base_start, size);
	if (dev->base == NULL)
		return -1;
	dev->IndexRegs = &dev->regs.rkt->IndexRegs;
+2 −2
Original line number Diff line number Diff line
@@ -471,7 +471,7 @@ static int aac_rx_ioremap(struct aac_dev * dev, u32 size)
		iounmap(dev->regs.rx);
		return 0;
	}
	dev->base = dev->regs.rx = ioremap(dev->scsi_host_ptr->base, size);
	dev->base = dev->regs.rx = ioremap(dev->base_start, size);
	if (dev->base == NULL)
		return -1;
	dev->IndexRegs = &dev->regs.rx->IndexRegs;
@@ -653,7 +653,7 @@ int _aac_rx_init(struct aac_dev *dev)
			name, instance);
		goto error_iounmap;
	}
	dev->dbg_base = dev->scsi_host_ptr->base;
	dev->dbg_base = dev->base_start;
	dev->dbg_base_mapped = dev->base;
	dev->dbg_size = dev->base_size;

Loading