Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

HighPoint Linux Team and committed by
James Bottomley
23f0bb47 f3d8af9e

+8 -3
+7 -3
drivers/scsi/hptiop.c
··· 42 42 43 43 static char driver_name[] = "hptiop"; 44 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 47 static int iop_send_sync_msg(struct hptiop_hba *hba, u32 msg, u32 millisec); 48 48 static void hptiop_finish_scsi_req(struct hptiop_hba *hba, u32 tag, ··· 958 958 { 959 959 struct Scsi_Host *host = NULL; 960 960 struct hptiop_hba *hba; 961 + struct hptiop_adapter_ops *iop_ops; 961 962 struct hpt_iop_request_get_config iop_config; 962 963 struct hpt_iop_request_set_config set_config; 963 964 dma_addr_t start_phy; ··· 979 978 pci_set_master(pcidev); 980 979 981 980 /* Enable 64bit DMA if possible */ 982 - if (pci_set_dma_mask(pcidev, DMA_BIT_MASK(64))) { 981 + iop_ops = (struct hptiop_adapter_ops *)id->driver_data; 982 + if (pci_set_dma_mask(pcidev, DMA_BIT_MASK(iop_ops->hw_dma_bit_mask))) { 983 983 if (pci_set_dma_mask(pcidev, DMA_BIT_MASK(32))) { 984 984 printk(KERN_ERR "hptiop: fail to set dma_mask\n"); 985 985 goto disable_pci_device; ··· 1000 998 1001 999 hba = (struct hptiop_hba *)host->hostdata; 1002 1000 1003 - hba->ops = (struct hptiop_adapter_ops *)id->driver_data; 1001 + hba->ops = iop_ops; 1004 1002 hba->pcidev = pcidev; 1005 1003 hba->host = host; 1006 1004 hba->initialized = 0; ··· 1241 1239 .iop_intr = iop_intr_itl, 1242 1240 .post_msg = hptiop_post_msg_itl, 1243 1241 .post_req = hptiop_post_req_itl, 1242 + .hw_dma_bit_mask = 64, 1244 1243 }; 1245 1244 1246 1245 static struct hptiop_adapter_ops hptiop_mv_ops = { ··· 1257 1254 .iop_intr = iop_intr_mv, 1258 1255 .post_msg = hptiop_post_msg_mv, 1259 1256 .post_req = hptiop_post_req_mv, 1257 + .hw_dma_bit_mask = 33, 1260 1258 }; 1261 1259 1262 1260 static struct pci_device_id hptiop_id_table[] = {
+1
drivers/scsi/hptiop.h
··· 297 297 int (*iop_intr)(struct hptiop_hba *hba); 298 298 void (*post_msg)(struct hptiop_hba *hba, u32 msg); 299 299 void (*post_req)(struct hptiop_hba *hba, struct hptiop_request *_req); 300 + int hw_dma_bit_mask; 300 301 }; 301 302 302 303 #define HPT_IOCTL_RESULT_OK 0