Updated from Linux LTS 3.10.21 to 3.10.22
This commit is contained in:
@@ -87,13 +87,6 @@ static const u8 pq_idx_to_field[] = { 1, 4, 5, 0, 1, 2, 4, 5 };
|
||||
static const u8 pq16_idx_to_field[] = { 1, 4, 1, 2, 3, 4, 5, 6, 7,
|
||||
0, 1, 2, 3, 4, 5, 6 };
|
||||
|
||||
/*
|
||||
* technically sources 1 and 2 do not require SED, but the op will have
|
||||
* at least 9 descriptors so that's irrelevant.
|
||||
*/
|
||||
static const u8 pq16_idx_to_sed[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1, 1, 1 };
|
||||
|
||||
static void ioat3_eh(struct ioat2_dma_chan *ioat);
|
||||
|
||||
static dma_addr_t xor_get_src(struct ioat_raw_descriptor *descs[2], int idx)
|
||||
@@ -135,12 +128,6 @@ static void pq_set_src(struct ioat_raw_descriptor *descs[2],
|
||||
pq->coef[idx] = coef;
|
||||
}
|
||||
|
||||
static int sed_get_pq16_pool_idx(int src_cnt)
|
||||
{
|
||||
|
||||
return pq16_idx_to_sed[src_cnt];
|
||||
}
|
||||
|
||||
static bool is_jf_ioat(struct pci_dev *pdev)
|
||||
{
|
||||
switch (pdev->device) {
|
||||
@@ -1182,9 +1169,6 @@ __ioat3_prep_pq16_lock(struct dma_chan *c, enum sum_check_flags *result,
|
||||
u8 op;
|
||||
int i, s, idx, num_descs;
|
||||
|
||||
/* this function only handles src_cnt 9 - 16 */
|
||||
BUG_ON(src_cnt < 9);
|
||||
|
||||
/* this function is only called with 9-16 sources */
|
||||
op = result ? IOAT_OP_PQ_VAL_16S : IOAT_OP_PQ_16S;
|
||||
|
||||
@@ -1212,8 +1196,7 @@ __ioat3_prep_pq16_lock(struct dma_chan *c, enum sum_check_flags *result,
|
||||
|
||||
descs[0] = (struct ioat_raw_descriptor *) pq;
|
||||
|
||||
desc->sed = ioat3_alloc_sed(device,
|
||||
sed_get_pq16_pool_idx(src_cnt));
|
||||
desc->sed = ioat3_alloc_sed(device, (src_cnt-2) >> 3);
|
||||
if (!desc->sed) {
|
||||
dev_err(to_dev(chan),
|
||||
"%s: no free sed entries\n", __func__);
|
||||
@@ -1271,13 +1254,21 @@ __ioat3_prep_pq16_lock(struct dma_chan *c, enum sum_check_flags *result,
|
||||
return &desc->txd;
|
||||
}
|
||||
|
||||
static int src_cnt_flags(unsigned int src_cnt, unsigned long flags)
|
||||
{
|
||||
if (dmaf_p_disabled_continue(flags))
|
||||
return src_cnt + 1;
|
||||
else if (dmaf_continue(flags))
|
||||
return src_cnt + 3;
|
||||
else
|
||||
return src_cnt;
|
||||
}
|
||||
|
||||
static struct dma_async_tx_descriptor *
|
||||
ioat3_prep_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
|
||||
unsigned int src_cnt, const unsigned char *scf, size_t len,
|
||||
unsigned long flags)
|
||||
{
|
||||
struct dma_device *dma = chan->device;
|
||||
|
||||
/* specify valid address for disabled result */
|
||||
if (flags & DMA_PREP_PQ_DISABLE_P)
|
||||
dst[0] = dst[1];
|
||||
@@ -1297,7 +1288,7 @@ ioat3_prep_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
|
||||
single_source_coef[0] = scf[0];
|
||||
single_source_coef[1] = 0;
|
||||
|
||||
return (src_cnt > 8) && (dma->max_pq > 8) ?
|
||||
return src_cnt_flags(src_cnt, flags) > 8 ?
|
||||
__ioat3_prep_pq16_lock(chan, NULL, dst, single_source,
|
||||
2, single_source_coef, len,
|
||||
flags) :
|
||||
@@ -1305,7 +1296,7 @@ ioat3_prep_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
|
||||
single_source_coef, len, flags);
|
||||
|
||||
} else {
|
||||
return (src_cnt > 8) && (dma->max_pq > 8) ?
|
||||
return src_cnt_flags(src_cnt, flags) > 8 ?
|
||||
__ioat3_prep_pq16_lock(chan, NULL, dst, src, src_cnt,
|
||||
scf, len, flags) :
|
||||
__ioat3_prep_pq_lock(chan, NULL, dst, src, src_cnt,
|
||||
@@ -1318,8 +1309,6 @@ ioat3_prep_pq_val(struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
|
||||
unsigned int src_cnt, const unsigned char *scf, size_t len,
|
||||
enum sum_check_flags *pqres, unsigned long flags)
|
||||
{
|
||||
struct dma_device *dma = chan->device;
|
||||
|
||||
/* specify valid address for disabled result */
|
||||
if (flags & DMA_PREP_PQ_DISABLE_P)
|
||||
pq[0] = pq[1];
|
||||
@@ -1331,7 +1320,7 @@ ioat3_prep_pq_val(struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
|
||||
*/
|
||||
*pqres = 0;
|
||||
|
||||
return (src_cnt > 8) && (dma->max_pq > 8) ?
|
||||
return src_cnt_flags(src_cnt, flags) > 8 ?
|
||||
__ioat3_prep_pq16_lock(chan, pqres, pq, src, src_cnt, scf, len,
|
||||
flags) :
|
||||
__ioat3_prep_pq_lock(chan, pqres, pq, src, src_cnt, scf, len,
|
||||
@@ -1342,7 +1331,6 @@ static struct dma_async_tx_descriptor *
|
||||
ioat3_prep_pqxor(struct dma_chan *chan, dma_addr_t dst, dma_addr_t *src,
|
||||
unsigned int src_cnt, size_t len, unsigned long flags)
|
||||
{
|
||||
struct dma_device *dma = chan->device;
|
||||
unsigned char scf[src_cnt];
|
||||
dma_addr_t pq[2];
|
||||
|
||||
@@ -1351,7 +1339,7 @@ ioat3_prep_pqxor(struct dma_chan *chan, dma_addr_t dst, dma_addr_t *src,
|
||||
flags |= DMA_PREP_PQ_DISABLE_Q;
|
||||
pq[1] = dst; /* specify valid address for disabled result */
|
||||
|
||||
return (src_cnt > 8) && (dma->max_pq > 8) ?
|
||||
return src_cnt_flags(src_cnt, flags) > 8 ?
|
||||
__ioat3_prep_pq16_lock(chan, NULL, pq, src, src_cnt, scf, len,
|
||||
flags) :
|
||||
__ioat3_prep_pq_lock(chan, NULL, pq, src, src_cnt, scf, len,
|
||||
@@ -1363,7 +1351,6 @@ ioat3_prep_pqxor_val(struct dma_chan *chan, dma_addr_t *src,
|
||||
unsigned int src_cnt, size_t len,
|
||||
enum sum_check_flags *result, unsigned long flags)
|
||||
{
|
||||
struct dma_device *dma = chan->device;
|
||||
unsigned char scf[src_cnt];
|
||||
dma_addr_t pq[2];
|
||||
|
||||
@@ -1377,8 +1364,7 @@ ioat3_prep_pqxor_val(struct dma_chan *chan, dma_addr_t *src,
|
||||
flags |= DMA_PREP_PQ_DISABLE_Q;
|
||||
pq[1] = pq[0]; /* specify valid address for disabled result */
|
||||
|
||||
|
||||
return (src_cnt > 8) && (dma->max_pq > 8) ?
|
||||
return src_cnt_flags(src_cnt, flags) > 8 ?
|
||||
__ioat3_prep_pq16_lock(chan, result, pq, &src[1], src_cnt - 1,
|
||||
scf, len, flags) :
|
||||
__ioat3_prep_pq_lock(chan, result, pq, &src[1], src_cnt - 1,
|
||||
|
||||
Reference in New Issue
Block a user