提交 09ec8e7f 编写于 作者: M Manish Chopra 提交者: David S. Miller

qede: Fix DMA address APIs usage

Driver incorrectly uses dma_unmap_addr_set() to set
a variable which is in truth a dma_addr_t
[i.e not defined using DEFINE_DMA_UNMAP_ADDR()] and is
being used by the driver flows other than unmapping
physical addresses. This patch fixes driver fastpath
where CONFIG_NEED_DMA_MAP_STATE is not set.
Signed-off-by: NManish Chopra <manish.chopra@qlogic.com>
Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1968a0b8
...@@ -1076,8 +1076,7 @@ static void qede_tpa_start(struct qede_dev *edev, ...@@ -1076,8 +1076,7 @@ static void qede_tpa_start(struct qede_dev *edev,
* start until its over and we don't want to risk allocation failing * start until its over and we don't want to risk allocation failing
* here, so re-allocate when aggregation will be over. * here, so re-allocate when aggregation will be over.
*/ */
dma_unmap_addr_set(sw_rx_data_prod, mapping, sw_rx_data_prod->mapping = replace_buf->mapping;
dma_unmap_addr(replace_buf, mapping));
sw_rx_data_prod->data = replace_buf->data; sw_rx_data_prod->data = replace_buf->data;
rx_bd_prod->addr.hi = cpu_to_le32(upper_32_bits(mapping)); rx_bd_prod->addr.hi = cpu_to_le32(upper_32_bits(mapping));
...@@ -2655,7 +2654,7 @@ static void qede_free_sge_mem(struct qede_dev *edev, ...@@ -2655,7 +2654,7 @@ static void qede_free_sge_mem(struct qede_dev *edev,
if (replace_buf->data) { if (replace_buf->data) {
dma_unmap_page(&edev->pdev->dev, dma_unmap_page(&edev->pdev->dev,
dma_unmap_addr(replace_buf, mapping), replace_buf->mapping,
PAGE_SIZE, DMA_FROM_DEVICE); PAGE_SIZE, DMA_FROM_DEVICE);
__free_page(replace_buf->data); __free_page(replace_buf->data);
} }
...@@ -2755,7 +2754,7 @@ static int qede_alloc_sge_mem(struct qede_dev *edev, ...@@ -2755,7 +2754,7 @@ static int qede_alloc_sge_mem(struct qede_dev *edev,
goto err; goto err;
} }
dma_unmap_addr_set(replace_buf, mapping, mapping); replace_buf->mapping = mapping;
tpa_info->replace_buf.page_offset = 0; tpa_info->replace_buf.page_offset = 0;
tpa_info->replace_buf_mapping = mapping; tpa_info->replace_buf_mapping = mapping;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册