aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike McGowen <[email protected]>2023-04-28 10:37:01 -0500
committerMartin K. Petersen <[email protected]>2023-05-08 07:17:11 -0400
commit3e7e55aa3df2d58b1d27e3380d293da525cf5a3b (patch)
tree3f53b5341885d30f7af6c02858aa08d644234130
parentac9a78681b921877518763ba0e89202254349d1b (diff)
scsi: smartpqi: Map full length of PCI BAR 0
Map full length of PCI BAR 0 at driver init. During driver initialization, the driver must make a kernel call to map the controller registers into kernel address space. A parameter to this call is the length of the memory to be mapped. The driver was specifying the wrong length. Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Kevin Barnett <[email protected]> Signed-off-by: Mike McGowen <[email protected]> Signed-off-by: Don Brace <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
-rw-r--r--drivers/scsi/smartpqi/smartpqi_init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 03de97cd72c2..29370757b07b 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -8560,7 +8560,7 @@ static int pqi_pci_init(struct pqi_ctrl_info *ctrl_info)
ctrl_info->iomem_base = ioremap(pci_resource_start(
ctrl_info->pci_dev, 0),
- sizeof(struct pqi_ctrl_registers));
+ pci_resource_len(ctrl_info->pci_dev, 0));
if (!ctrl_info->iomem_base) {
dev_err(&ctrl_info->pci_dev->dev,
"failed to map memory for controller registers\n");