summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/xgi_cmdlist.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/linux-core/xgi_cmdlist.c b/linux-core/xgi_cmdlist.c
index b67a40f6..f8aacea2 100644
--- a/linux-core/xgi_cmdlist.c
+++ b/linux-core/xgi_cmdlist.c
@@ -198,17 +198,24 @@ void xgi_submit_cmdlist(struct xgi_info * info, struct xgi_cmd_info * pCmdInfo)
(U32 *) xgi_find_pcie_virt(info,
s_cmdring._lastBatchStartAddr);
- lastBatchVirtAddr[1] =
- BEGIN_LINK_ENABLE_MASK + pCmdInfo->_firstSize;
- lastBatchVirtAddr[2] = pCmdInfo->_firstBeginAddr >> 4;
- lastBatchVirtAddr[3] = 0;
- //barrier();
- lastBatchVirtAddr[0] =
- (beginPort << 22) + (BEGIN_VALID_MASK) +
- (0xffff & pCmdInfo->_curDebugID);
-
- /* Jong 06/12/2006; system hang; marked for test */
- triggerHWCommandList(info, pCmdInfo->_beginCount);
+ /* lastBatchVirtAddr should *never* be NULL. However, there
+ * are currently some bugs that cause this to happen. The
+ * if-statement here prevents some fatal (i.e., hard lock
+ * requiring the reset button) oopses.
+ */
+ if (lastBatchVirtAddr) {
+ lastBatchVirtAddr[1] =
+ BEGIN_LINK_ENABLE_MASK + pCmdInfo->_firstSize;
+ lastBatchVirtAddr[2] = pCmdInfo->_firstBeginAddr >> 4;
+ lastBatchVirtAddr[3] = 0;
+ //barrier();
+ lastBatchVirtAddr[0] =
+ (beginPort << 22) + (BEGIN_VALID_MASK) +
+ (0xffff & pCmdInfo->_curDebugID);
+
+ /* Jong 06/12/2006; system hang; marked for test */
+ triggerHWCommandList(info, pCmdInfo->_beginCount);
+ }
XGI_INFO
("Jong-xgi_submit_cmdlist-s_cmdring._lastBatchStartAddr != 0 - End\n");