Re: [PATCH] enic: Use dma_set_mask_and_coherent()

From: Christophe JAILLET
Date: Wed Jan 05 2022 - 14:51:55 EST


Le 03/01/2022 à 09:47, Christoph Hellwig a écrit :
On Sat, Jan 01, 2022 at 03:02:45PM +0100, Christophe JAILLET wrote:
- err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(47));
+ err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(47));
if (err) {
+ err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err) {
dev_err(dev, "No usable DMA configuration, aborting\n");
goto err_out_release_regions;
}
} else {
using_dac = 1;

There is no need for the callback. All the routines to set a DMA mask
will only fail if the passed in mask is too small, but never if it is
larger than what is supported. Also the using_dac variable is not
needed, NETIF_F_HIGHDMA can and should be set unconditionally.


Ok, thanks.
I was only aware of the 64 bits case.
The patch has already reached -next.

I'll send another patch on to of it to go one step further.

CJ