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;
break;
}
TP("-");
return 0;
dim -= count;
done += count;
reqs++;
}
hfi1_cdbg(AIOWRITE, "-");
TP("-");
return reqs;
}
#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++) {
u64 qw1;
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]);
if (skip) {
/* edits don't have generation */
@ -2396,11 +2394,9 @@ static inline u16 submit_tx(struct sdma_engine *sde, struct sdma_txreq *tx)
#endif
sde->tx_ring[sde->tx_tail++ & sde->sdma_mask] = tx;
sde->desc_avail -= tx->num_desc;
TP("-");
hfi1_cdbg(AIOWRITE, "-");
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;
TP("+");
hfi1_cdbg(AIOWRITE, "+");
spin_lock_irqsave(&sde->tail_lock, flags);
// spin_lock_irqsave(&sde->tail_lock, flags);
retry:
list_for_each_entry_safe(tx, tx_next, tx_list, list) {
#ifdef __HFI1_ORIG__
tx->wait = iowait_ioww_to_iow(wait);
if (unlikely(!__sdma_running(sde)))
goto unlock_noconn;
@ -2552,32 +2547,31 @@ retry:
ret = -EINVAL;
goto update_tail;
}
#endif /* __HFI1_ORIG__ */
list_del_init(&tx->list);
tail = submit_tx(sde, tx);
submit_count++;
#ifdef __HFI1_ORIG__
if (tail != INVALID_TAIL &&
(submit_count & SDMA_TAIL_UPDATE_THRESH) == 0) {
sdma_update_tail(sde, tail);
tail = INVALID_TAIL;
}
#endif /* __HFI1_ORIG__ */
}
update_tail:
TP("+ update_tail:");
total_count = submit_count + flush_count;
#ifdef __HFI1_ORIG__
if (wait)
iowait_sdma_add(iowait_ioww_to_iow(wait), total_count);
#endif /* __HFI1_ORIG__ */
if (tail != INVALID_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;
hfi1_cdbg(AIOWRITE, "-");
TP("-");
return ret;
unlock_noconn:
TP("+ unlock_noconn:");
spin_lock(&sde->flushlist_lock);
list_for_each_entry_safe(tx, tx_next, tx_list, list) {
tx->wait = iowait_ioww_to_iow(wait);
@ -2597,6 +2591,7 @@ unlock_noconn:
ret = -ECOMM;
goto update_tail;
nodesc:
TP("+ nodesc:");
ret = sdma_check_progress(sde, wait, tx);
if (ret == -EAGAIN) {
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]);
selector = dlid_to_selector(dlid);
selector += uctxt->ctxt + fd->subctxt;
TP("+ sdma_select_user_engine");
req->sde = sdma_select_user_engine(dd, selector, vl);
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");
pq = req->pq;
#ifdef __HFI1_ORIG__
/* If tx completion has reported an error, we are done. */
if (test_bit(SDMA_REQ_HAS_ERROR, &req->flags)) {
set_bit(SDMA_REQ_DONE_ERROR, &req->flags);
TP("test_bit(SDMA_REQ_HAS_ERROR, &req->flags)");
return -EFAULT;
}
#endif /* __HFI1_ORIG__ */
/*
* 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__);
}
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;
WARN_ON(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__
iov_offset += len;
#endif /* __HFI1_ORIG__ */
#else
iovec->offset += len;
#endif /* __HFI1_ORIG__ */
queued += len;
data_sent += len;
#ifdef __HFI1_ORIG__