diff options
author | HighPoint Linux Team <linux@highpoint-tech.com> | 2012-06-14 03:47:07 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-07-20 03:58:30 -0400 |
commit | 23f0bb47a4ec4c662b2bbf0221d6289e91b06ece (patch) | |
tree | 60d4181c994194a8393db42d0c6e0ea3a29406a0 /drivers | |
parent | f3d8af9e27c8341222b9cce50b870b87239a1629 (diff) |
[SCSI] hptiop: fix RR312x in hosts with >12GB
As the limitation of RR312x's dma engine, the HBA can not access host memory
over 12GB. This fixes
https://bugzilla.kernel.org/show_bug.cgi?id=14311
[alan: resurrected bug from 2009 and pushed upstream]
Reported-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: HighPoint Linux Team <linux@highpoint-tech.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/hptiop.c | 10 | ||||
-rw-r--r-- | drivers/scsi/hptiop.h | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index 10b65556937..192724ed7a3 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c | |||
@@ -42,7 +42,7 @@ MODULE_DESCRIPTION("HighPoint RocketRAID 3xxx/4xxx Controller Driver"); | |||
42 | 42 | ||
43 | static char driver_name[] = "hptiop"; | 43 | static char driver_name[] = "hptiop"; |
44 | static const char driver_name_long[] = "RocketRAID 3xxx/4xxx Controller driver"; | 44 | static const char driver_name_long[] = "RocketRAID 3xxx/4xxx Controller driver"; |
45 | static const char driver_ver[] = "v1.6 (090910)"; | 45 | static const char driver_ver[] = "v1.6 (091225)"; |
46 | 46 | ||
47 | static int iop_send_sync_msg(struct hptiop_hba *hba, u32 msg, u32 millisec); | 47 | static int iop_send_sync_msg(struct hptiop_hba *hba, u32 msg, u32 millisec); |
48 | static void hptiop_finish_scsi_req(struct hptiop_hba *hba, u32 tag, | 48 | static void hptiop_finish_scsi_req(struct hptiop_hba *hba, u32 tag, |
@@ -958,6 +958,7 @@ static int __devinit hptiop_probe(struct pci_dev *pcidev, | |||
958 | { | 958 | { |
959 | struct Scsi_Host *host = NULL; | 959 | struct Scsi_Host *host = NULL; |
960 | struct hptiop_hba *hba; | 960 | struct hptiop_hba *hba; |
961 | struct hptiop_adapter_ops *iop_ops; | ||
961 | struct hpt_iop_request_get_config iop_config; | 962 | struct hpt_iop_request_get_config iop_config; |
962 | struct hpt_iop_request_set_config set_config; | 963 | struct hpt_iop_request_set_config set_config; |
963 | dma_addr_t start_phy; | 964 | dma_addr_t start_phy; |
@@ -978,7 +979,8 @@ static int __devinit hptiop_probe(struct pci_dev *pcidev, | |||
978 | pci_set_master(pcidev); | 979 | pci_set_master(pcidev); |
979 | 980 | ||
980 | /* Enable 64bit DMA if possible */ | 981 | /* Enable 64bit DMA if possible */ |
981 | if (pci_set_dma_mask(pcidev, DMA_BIT_MASK(64))) { | 982 | iop_ops = (struct hptiop_adapter_ops *)id->driver_data; |
983 | if (pci_set_dma_mask(pcidev, DMA_BIT_MASK(iop_ops->hw_dma_bit_mask))) { | ||
982 | if (pci_set_dma_mask(pcidev, DMA_BIT_MASK(32))) { | 984 | if (pci_set_dma_mask(pcidev, DMA_BIT_MASK(32))) { |
983 | printk(KERN_ERR "hptiop: fail to set dma_mask\n"); | 985 | printk(KERN_ERR "hptiop: fail to set dma_mask\n"); |
984 | goto disable_pci_device; | 986 | goto disable_pci_device; |
@@ -998,7 +1000,7 @@ static int __devinit hptiop_probe(struct pci_dev *pcidev, | |||
998 | 1000 | ||
999 | hba = (struct hptiop_hba *)host->hostdata; | 1001 | hba = (struct hptiop_hba *)host->hostdata; |
1000 | 1002 | ||
1001 | hba->ops = (struct hptiop_adapter_ops *)id->driver_data; | 1003 | hba->ops = iop_ops; |
1002 | hba->pcidev = pcidev; | 1004 | hba->pcidev = pcidev; |
1003 | hba->host = host; | 1005 | hba->host = host; |
1004 | hba->initialized = 0; | 1006 | hba->initialized = 0; |
@@ -1239,6 +1241,7 @@ static struct hptiop_adapter_ops hptiop_itl_ops = { | |||
1239 | .iop_intr = iop_intr_itl, | 1241 | .iop_intr = iop_intr_itl, |
1240 | .post_msg = hptiop_post_msg_itl, | 1242 | .post_msg = hptiop_post_msg_itl, |
1241 | .post_req = hptiop_post_req_itl, | 1243 | .post_req = hptiop_post_req_itl, |
1244 | .hw_dma_bit_mask = 64, | ||
1242 | }; | 1245 | }; |
1243 | 1246 | ||
1244 | static struct hptiop_adapter_ops hptiop_mv_ops = { | 1247 | static struct hptiop_adapter_ops hptiop_mv_ops = { |
@@ -1254,6 +1257,7 @@ static struct hptiop_adapter_ops hptiop_mv_ops = { | |||
1254 | .iop_intr = iop_intr_mv, | 1257 | .iop_intr = iop_intr_mv, |
1255 | .post_msg = hptiop_post_msg_mv, | 1258 | .post_msg = hptiop_post_msg_mv, |
1256 | .post_req = hptiop_post_req_mv, | 1259 | .post_req = hptiop_post_req_mv, |
1260 | .hw_dma_bit_mask = 33, | ||
1257 | }; | 1261 | }; |
1258 | 1262 | ||
1259 | static struct pci_device_id hptiop_id_table[] = { | 1263 | static struct pci_device_id hptiop_id_table[] = { |
diff --git a/drivers/scsi/hptiop.h b/drivers/scsi/hptiop.h index 0b871c0ae56..baa648d87fd 100644 --- a/drivers/scsi/hptiop.h +++ b/drivers/scsi/hptiop.h | |||
@@ -297,6 +297,7 @@ struct hptiop_adapter_ops { | |||
297 | int (*iop_intr)(struct hptiop_hba *hba); | 297 | int (*iop_intr)(struct hptiop_hba *hba); |
298 | void (*post_msg)(struct hptiop_hba *hba, u32 msg); | 298 | void (*post_msg)(struct hptiop_hba *hba, u32 msg); |
299 | void (*post_req)(struct hptiop_hba *hba, struct hptiop_request *_req); | 299 | void (*post_req)(struct hptiop_hba *hba, struct hptiop_request *_req); |
300 | int hw_dma_bit_mask; | ||
300 | }; | 301 | }; |
301 | 302 | ||
302 | #define HPT_IOCTL_RESULT_OK 0 | 303 | #define HPT_IOCTL_RESULT_OK 0 |