diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-05-29 07:07:04 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-09 18:21:31 -0400 |
commit | 14d0f0b063f5363984dd305a792854f9c23e9e97 (patch) | |
tree | 6d3e62845bc5273244f3b9ec535159cf5a8bdbc6 /drivers/message/fusion/mptbase.h | |
parent | 238ddbb98c327a7392ced5ae65216c55969749ea (diff) |
[SCSI] mpt fusion: Fixing 1078 data corruption issue for 36GB memory region
The reason for this change is there is a data corruption when four different
physical memory regions in the 36GB to 37GB region are
accessed. This is only affecting 1078.
The solution is we need to use different addressing when filling in
the scatter gather table for the effected memory regions. So instead
of snooping on all four different memory holes, we treat any physical
addresses in the 36GB address with the same algorithm.
The fix is explained below
1) Ensure that the message frames are NOT located in the trouble
region. There is no remapping available for message frames, they must
be allocated outside the problem region.
2) Ensure that Sense buffers are NOT in the trouble region. There is
no remapping available.
3) Walk through the SGE entries and if any are inside the trouble region
then they need to be remapped as discussed below.
1) Set the Local Address bit in the SGE Flags field.
MPI_SGE_FLAGS_LOCAL_ADDRESS
2) Ensure we are using 64-bit SGEs
3) Set MSb (Bit 63) of the 64-bit address, this will indicate buffer
location is Host Memory.
Signed-off-by: Kashyap Desai <kadesai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/message/fusion/mptbase.h')
-rw-r--r-- | drivers/message/fusion/mptbase.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index b3e981d2a506..4a606764e317 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -76,8 +76,8 @@ | |||
76 | #define COPYRIGHT "Copyright (c) 1999-2008 " MODULEAUTHOR | 76 | #define COPYRIGHT "Copyright (c) 1999-2008 " MODULEAUTHOR |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #define MPT_LINUX_VERSION_COMMON "3.04.07" | 79 | #define MPT_LINUX_VERSION_COMMON "3.04.08" |
80 | #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.07" | 80 | #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.08" |
81 | #define WHAT_MAGIC_STRING "@" "(" "#" ")" | 81 | #define WHAT_MAGIC_STRING "@" "(" "#" ")" |
82 | 82 | ||
83 | #define show_mptmod_ver(s,ver) \ | 83 | #define show_mptmod_ver(s,ver) \ |
@@ -134,6 +134,7 @@ | |||
134 | 134 | ||
135 | #define MPT_COALESCING_TIMEOUT 0x10 | 135 | #define MPT_COALESCING_TIMEOUT 0x10 |
136 | 136 | ||
137 | |||
137 | /* | 138 | /* |
138 | * SCSI transfer rate defines. | 139 | * SCSI transfer rate defines. |
139 | */ | 140 | */ |
@@ -564,6 +565,10 @@ struct mptfc_rport_info | |||
564 | u8 flags; | 565 | u8 flags; |
565 | }; | 566 | }; |
566 | 567 | ||
568 | typedef void (*MPT_ADD_SGE)(void *pAddr, u32 flagslength, dma_addr_t dma_addr); | ||
569 | typedef void (*MPT_ADD_CHAIN)(void *pAddr, u8 next, u16 length, | ||
570 | dma_addr_t dma_addr); | ||
571 | |||
567 | /* | 572 | /* |
568 | * Adapter Structure - pci_dev specific. Maximum: MPT_MAX_ADAPTERS | 573 | * Adapter Structure - pci_dev specific. Maximum: MPT_MAX_ADAPTERS |
569 | */ | 574 | */ |
@@ -600,6 +605,10 @@ typedef struct _MPT_ADAPTER | |||
600 | int reply_depth; /* Num Allocated reply frames */ | 605 | int reply_depth; /* Num Allocated reply frames */ |
601 | int reply_sz; /* Reply frame size */ | 606 | int reply_sz; /* Reply frame size */ |
602 | int num_chain; /* Number of chain buffers */ | 607 | int num_chain; /* Number of chain buffers */ |
608 | MPT_ADD_SGE add_sge; /* Pointer to add_sge | ||
609 | function */ | ||
610 | MPT_ADD_CHAIN add_chain; /* Pointer to add_chain | ||
611 | function */ | ||
603 | /* Pool of buffers for chaining. ReqToChain | 612 | /* Pool of buffers for chaining. ReqToChain |
604 | * and ChainToChain track index of chain buffers. | 613 | * and ChainToChain track index of chain buffers. |
605 | * ChainBuffer (DMA) virt/phys addresses. | 614 | * ChainBuffer (DMA) virt/phys addresses. |
@@ -711,12 +720,15 @@ typedef struct _MPT_ADAPTER | |||
711 | struct workqueue_struct *fc_rescan_work_q; | 720 | struct workqueue_struct *fc_rescan_work_q; |
712 | struct scsi_cmnd **ScsiLookup; | 721 | struct scsi_cmnd **ScsiLookup; |
713 | spinlock_t scsi_lookup_lock; | 722 | spinlock_t scsi_lookup_lock; |
714 | 723 | u64 dma_mask; | |
715 | char reset_work_q_name[20]; | 724 | char reset_work_q_name[20]; |
716 | struct workqueue_struct *reset_work_q; | 725 | struct workqueue_struct *reset_work_q; |
717 | struct delayed_work fault_reset_work; | 726 | struct delayed_work fault_reset_work; |
718 | spinlock_t fault_reset_work_lock; | 727 | spinlock_t fault_reset_work_lock; |
719 | 728 | ||
729 | u8 sg_addr_size; | ||
730 | u8 SGE_size; | ||
731 | |||
720 | } MPT_ADAPTER; | 732 | } MPT_ADAPTER; |
721 | 733 | ||
722 | /* | 734 | /* |
@@ -753,13 +765,14 @@ typedef struct _mpt_sge { | |||
753 | dma_addr_t Address; | 765 | dma_addr_t Address; |
754 | } MptSge_t; | 766 | } MptSge_t; |
755 | 767 | ||
756 | #define mpt_addr_size() \ | ||
757 | ((sizeof(dma_addr_t) == sizeof(u64)) ? MPI_SGE_FLAGS_64_BIT_ADDRESSING : \ | ||
758 | MPI_SGE_FLAGS_32_BIT_ADDRESSING) | ||
759 | 768 | ||
760 | #define mpt_msg_flags() \ | 769 | #define mpt_msg_flags(ioc) \ |
761 | ((sizeof(dma_addr_t) == sizeof(u64)) ? MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 : \ | 770 | (ioc->sg_addr_size == sizeof(u64)) ? \ |
762 | MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32) | 771 | MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64 : \ |
772 | MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32 | ||
773 | |||
774 | #define MPT_SGE_FLAGS_64_BIT_ADDRESSING \ | ||
775 | (MPI_SGE_FLAGS_64_BIT_ADDRESSING << MPI_SGE_FLAGS_SHIFT) | ||
763 | 776 | ||
764 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 777 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
765 | /* | 778 | /* |
@@ -909,7 +922,6 @@ extern MPT_FRAME_HDR *mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc); | |||
909 | extern void mpt_free_msg_frame(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf); | 922 | extern void mpt_free_msg_frame(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf); |
910 | extern void mpt_put_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf); | 923 | extern void mpt_put_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf); |
911 | extern void mpt_put_msg_frame_hi_pri(u8 cb_idx, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf); | 924 | extern void mpt_put_msg_frame_hi_pri(u8 cb_idx, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf); |
912 | extern void mpt_add_sge(char *pAddr, u32 flagslength, dma_addr_t dma_addr); | ||
913 | 925 | ||
914 | extern int mpt_send_handshake_request(u8 cb_idx, MPT_ADAPTER *ioc, int reqBytes, u32 *req, int sleepFlag); | 926 | extern int mpt_send_handshake_request(u8 cb_idx, MPT_ADAPTER *ioc, int reqBytes, u32 *req, int sleepFlag); |
915 | extern int mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp); | 927 | extern int mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp); |
@@ -959,7 +971,6 @@ extern int mpt_fwfault_debug; | |||
959 | #define MPT_SGE_FLAGS_END_OF_BUFFER (0x40000000) | 971 | #define MPT_SGE_FLAGS_END_OF_BUFFER (0x40000000) |
960 | #define MPT_SGE_FLAGS_LOCAL_ADDRESS (0x08000000) | 972 | #define MPT_SGE_FLAGS_LOCAL_ADDRESS (0x08000000) |
961 | #define MPT_SGE_FLAGS_DIRECTION (0x04000000) | 973 | #define MPT_SGE_FLAGS_DIRECTION (0x04000000) |
962 | #define MPT_SGE_FLAGS_ADDRESSING (mpt_addr_size() << MPI_SGE_FLAGS_SHIFT) | ||
963 | #define MPT_SGE_FLAGS_END_OF_LIST (0x01000000) | 974 | #define MPT_SGE_FLAGS_END_OF_LIST (0x01000000) |
964 | 975 | ||
965 | #define MPT_SGE_FLAGS_TRANSACTION_ELEMENT (0x00000000) | 976 | #define MPT_SGE_FLAGS_TRANSACTION_ELEMENT (0x00000000) |
@@ -972,14 +983,12 @@ extern int mpt_fwfault_debug; | |||
972 | MPT_SGE_FLAGS_END_OF_BUFFER | \ | 983 | MPT_SGE_FLAGS_END_OF_BUFFER | \ |
973 | MPT_SGE_FLAGS_END_OF_LIST | \ | 984 | MPT_SGE_FLAGS_END_OF_LIST | \ |
974 | MPT_SGE_FLAGS_SIMPLE_ELEMENT | \ | 985 | MPT_SGE_FLAGS_SIMPLE_ELEMENT | \ |
975 | MPT_SGE_FLAGS_ADDRESSING | \ | ||
976 | MPT_TRANSFER_IOC_TO_HOST) | 986 | MPT_TRANSFER_IOC_TO_HOST) |
977 | #define MPT_SGE_FLAGS_SSIMPLE_WRITE \ | 987 | #define MPT_SGE_FLAGS_SSIMPLE_WRITE \ |
978 | (MPT_SGE_FLAGS_LAST_ELEMENT | \ | 988 | (MPT_SGE_FLAGS_LAST_ELEMENT | \ |
979 | MPT_SGE_FLAGS_END_OF_BUFFER | \ | 989 | MPT_SGE_FLAGS_END_OF_BUFFER | \ |
980 | MPT_SGE_FLAGS_END_OF_LIST | \ | 990 | MPT_SGE_FLAGS_END_OF_LIST | \ |
981 | MPT_SGE_FLAGS_SIMPLE_ELEMENT | \ | 991 | MPT_SGE_FLAGS_SIMPLE_ELEMENT | \ |
982 | MPT_SGE_FLAGS_ADDRESSING | \ | ||
983 | MPT_TRANSFER_HOST_TO_IOC) | 992 | MPT_TRANSFER_HOST_TO_IOC) |
984 | 993 | ||
985 | /*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 994 | /*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |