Real run test version (update_tail, kregbase+offset crash)

This commit is contained in:
Aram Santogidis
2017-08-16 15:06:07 +09:00
committed by Balazs Gerofi
parent 640dba627f
commit 7f03c18d4d
3 changed files with 11 additions and 19 deletions

View File

@ -475,13 +475,12 @@ ssize_t hfi1_aio_write(void *private_data, const struct iovec *iovec, unsigned l
reqs = ret; reqs = ret;
break; break;
} }
TP("-");
return 0;
dim -= count; dim -= count;
done += count; done += count;
reqs++; reqs++;
} }
hfi1_cdbg(AIOWRITE, "-"); hfi1_cdbg(AIOWRITE, "-");
TP("-");
return reqs; return reqs;
} }
#ifdef __HFI1_ORIG__ #ifdef __HFI1_ORIG__

View File

@ -2371,8 +2371,6 @@ static inline u16 submit_tx(struct sdma_engine *sde, struct sdma_txreq *tx)
for (i = 1; i < tx->num_desc; i++, descp++) { for (i = 1; i < tx->num_desc; i++, descp++) {
u64 qw1; u64 qw1;
TP("submitting descs qw[0] = %lu, qw[1] = %lu \n", descp->qw[0], descp->qw[1]); TP("submitting descs qw[0] = %lu, qw[1] = %lu \n", descp->qw[0], descp->qw[1]);
}
#ifdef __HFI1_ORIG__
sde->descq[tail].qw[0] = cpu_to_le64(descp->qw[0]); sde->descq[tail].qw[0] = cpu_to_le64(descp->qw[0]);
if (skip) { if (skip) {
/* edits don't have generation */ /* edits don't have generation */
@ -2396,11 +2394,9 @@ static inline u16 submit_tx(struct sdma_engine *sde, struct sdma_txreq *tx)
#endif #endif
sde->tx_ring[sde->tx_tail++ & sde->sdma_mask] = tx; sde->tx_ring[sde->tx_tail++ & sde->sdma_mask] = tx;
sde->desc_avail -= tx->num_desc; sde->desc_avail -= tx->num_desc;
TP("-");
hfi1_cdbg(AIOWRITE, "-"); hfi1_cdbg(AIOWRITE, "-");
return tail; return tail;
#endif /* __HFI1_ORIG__ */
TP("-");
return 0;
} }
/* /*
@ -2539,10 +2535,9 @@ int sdma_send_txlist(struct sdma_engine *sde, struct iowait_work *wait,
u32 submit_count = 0, flush_count = 0, total_count; u32 submit_count = 0, flush_count = 0, total_count;
TP("+"); TP("+");
hfi1_cdbg(AIOWRITE, "+"); hfi1_cdbg(AIOWRITE, "+");
spin_lock_irqsave(&sde->tail_lock, flags); // spin_lock_irqsave(&sde->tail_lock, flags);
retry: retry:
list_for_each_entry_safe(tx, tx_next, tx_list, list) { list_for_each_entry_safe(tx, tx_next, tx_list, list) {
#ifdef __HFI1_ORIG__
tx->wait = iowait_ioww_to_iow(wait); tx->wait = iowait_ioww_to_iow(wait);
if (unlikely(!__sdma_running(sde))) if (unlikely(!__sdma_running(sde)))
goto unlock_noconn; goto unlock_noconn;
@ -2552,32 +2547,31 @@ retry:
ret = -EINVAL; ret = -EINVAL;
goto update_tail; goto update_tail;
} }
#endif /* __HFI1_ORIG__ */
list_del_init(&tx->list); list_del_init(&tx->list);
tail = submit_tx(sde, tx); tail = submit_tx(sde, tx);
submit_count++; submit_count++;
#ifdef __HFI1_ORIG__
if (tail != INVALID_TAIL && if (tail != INVALID_TAIL &&
(submit_count & SDMA_TAIL_UPDATE_THRESH) == 0) { (submit_count & SDMA_TAIL_UPDATE_THRESH) == 0) {
sdma_update_tail(sde, tail); sdma_update_tail(sde, tail);
tail = INVALID_TAIL; tail = INVALID_TAIL;
} }
#endif /* __HFI1_ORIG__ */
} }
update_tail: update_tail:
TP("+ update_tail:");
total_count = submit_count + flush_count; total_count = submit_count + flush_count;
#ifdef __HFI1_ORIG__ #ifdef __HFI1_ORIG__
if (wait) if (wait)
iowait_sdma_add(iowait_ioww_to_iow(wait), total_count); iowait_sdma_add(iowait_ioww_to_iow(wait), total_count);
#endif /* __HFI1_ORIG__ */
if (tail != INVALID_TAIL) if (tail != INVALID_TAIL)
sdma_update_tail(sde, tail); sdma_update_tail(sde, tail);
#endif /* __HFI1_ORIG__ */ // spin_unlock_irqrestore(&sde->tail_lock, flags);
spin_unlock_irqrestore(&sde->tail_lock, flags);
*count_out = total_count; *count_out = total_count;
hfi1_cdbg(AIOWRITE, "-"); hfi1_cdbg(AIOWRITE, "-");
TP("-"); TP("-");
return ret; return ret;
unlock_noconn: unlock_noconn:
TP("+ unlock_noconn:");
spin_lock(&sde->flushlist_lock); spin_lock(&sde->flushlist_lock);
list_for_each_entry_safe(tx, tx_next, tx_list, list) { list_for_each_entry_safe(tx, tx_next, tx_list, list) {
tx->wait = iowait_ioww_to_iow(wait); tx->wait = iowait_ioww_to_iow(wait);
@ -2597,6 +2591,7 @@ unlock_noconn:
ret = -ECOMM; ret = -ECOMM;
goto update_tail; goto update_tail;
nodesc: nodesc:
TP("+ nodesc:");
ret = sdma_check_progress(sde, wait, tx); ret = sdma_check_progress(sde, wait, tx);
if (ret == -EAGAIN) { if (ret == -EAGAIN) {
ret = 0; ret = 0;

View File

@ -915,7 +915,6 @@ int hfi1_user_sdma_process_request(void *private_data, struct iovec *iovec,
dlid = be16_to_cpu(req->hdr.lrh[1]); dlid = be16_to_cpu(req->hdr.lrh[1]);
selector = dlid_to_selector(dlid); selector = dlid_to_selector(dlid);
selector += uctxt->ctxt + fd->subctxt; selector += uctxt->ctxt + fd->subctxt;
TP("+ sdma_select_user_engine");
req->sde = sdma_select_user_engine(dd, selector, vl); req->sde = sdma_select_user_engine(dd, selector, vl);
TP("- sdma_select_user_engine"); TP("- sdma_select_user_engine");
@ -1092,13 +1091,12 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, unsigned maxpkts)
TP("- !req->pq"); TP("- !req->pq");
pq = req->pq; pq = req->pq;
#ifdef __HFI1_ORIG__
/* If tx completion has reported an error, we are done. */ /* If tx completion has reported an error, we are done. */
if (test_bit(SDMA_REQ_HAS_ERROR, &req->flags)) { if (test_bit(SDMA_REQ_HAS_ERROR, &req->flags)) {
set_bit(SDMA_REQ_DONE_ERROR, &req->flags); set_bit(SDMA_REQ_DONE_ERROR, &req->flags);
TP("test_bit(SDMA_REQ_HAS_ERROR, &req->flags)");
return -EFAULT; return -EFAULT;
} }
#endif /* __HFI1_ORIG__ */
/* /*
* Check if we might have sent the entire request already * Check if we might have sent the entire request already
*/ */
@ -1282,7 +1280,6 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, unsigned maxpkts)
__FUNCTION__); __FUNCTION__);
} }
unsigned long base; unsigned long base;
TP("DBG: iovec->offset = %ld, iovec->iov.iov_len = %ld\n", iovec->offset, iovec->iov.iov_len);
const void *virt = (unsigned long)iovec->iov.iov_base + iovec->offset; const void *virt = (unsigned long)iovec->iov.iov_base + iovec->offset;
WARN_ON(iovec->iov.iov_len < iovec->offset); WARN_ON(iovec->iov.iov_len < iovec->offset);
unsigned len = (unsigned)iovec->iov.iov_len - iovec->offset; unsigned len = (unsigned)iovec->iov.iov_len - iovec->offset;
@ -1315,8 +1312,9 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, unsigned maxpkts)
} }
#ifdef __HFI1_ORIG__ #ifdef __HFI1_ORIG__
iov_offset += len; iov_offset += len;
#endif /* __HFI1_ORIG__ */ #else
iovec->offset += len; iovec->offset += len;
#endif /* __HFI1_ORIG__ */
queued += len; queued += len;
data_sent += len; data_sent += len;
#ifdef __HFI1_ORIG__ #ifdef __HFI1_ORIG__