All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-next] RDMA/efa: Use dma_set_mask_and_coherent to simplify code
@ 2020-12-01  9:18 Gal Pressman
  2020-12-02  1:04 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Gal Pressman @ 2020-12-01  9:18 UTC (permalink / raw)
  To: Jason Gunthorpe, Doug Ledford
  Cc: linux-rdma, Gal Pressman, Firas JahJah, Yossi Leybovich

Use dma_set_mask_and_coherent() instead of pci_set_dma_mask() followed
by a pci_set_consistent_dma_mask().

Reviewed-by: Firas JahJah <firasj@amazon.com>
Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
---
 drivers/infiniband/hw/efa/efa_main.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/efa/efa_main.c b/drivers/infiniband/hw/efa/efa_main.c
index cb2f2c647ee5..0f578734bddb 100644
--- a/drivers/infiniband/hw/efa/efa_main.c
+++ b/drivers/infiniband/hw/efa/efa_main.c
@@ -384,19 +384,12 @@ static int efa_device_init(struct efa_com_dev *edev, struct pci_dev *pdev)
 		return err;
 	}
 
-	err = pci_set_dma_mask(pdev, DMA_BIT_MASK(dma_width));
+	err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(dma_width));
 	if (err) {
-		dev_err(&pdev->dev, "pci_set_dma_mask failed %d\n", err);
+		dev_err(&pdev->dev, "dma_set_mask_and_coherent failed %d\n", err);
 		return err;
 	}
 
-	err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(dma_width));
-	if (err) {
-		dev_err(&pdev->dev,
-			"err_pci_set_consistent_dma_mask failed %d\n",
-			err);
-		return err;
-	}
 	dma_set_max_seg_size(&pdev->dev, UINT_MAX);
 	return 0;
 }

base-commit: dd37d2f59eb839d51b988f6668ce5f0d533b23fd
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for-next] RDMA/efa: Use dma_set_mask_and_coherent to simplify code
  2020-12-01  9:18 [PATCH for-next] RDMA/efa: Use dma_set_mask_and_coherent to simplify code Gal Pressman
@ 2020-12-02  1:04 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2020-12-02  1:04 UTC (permalink / raw)
  To: Gal Pressman; +Cc: Doug Ledford, linux-rdma, Firas JahJah, Yossi Leybovich

On Tue, Dec 01, 2020 at 11:18:11AM +0200, Gal Pressman wrote:
> Use dma_set_mask_and_coherent() instead of pci_set_dma_mask() followed
> by a pci_set_consistent_dma_mask().
> 
> Reviewed-by: Firas JahJah <firasj@amazon.com>
> Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
> Signed-off-by: Gal Pressman <galpress@amazon.com>
> ---
>  drivers/infiniband/hw/efa/efa_main.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-02  1:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01  9:18 [PATCH for-next] RDMA/efa: Use dma_set_mask_and_coherent to simplify code Gal Pressman
2020-12-02  1:04 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.