Re: [PATCH] mci: dw_mmc: set dma mask to work correctly on 64bit platforms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Sascha,

On 10.06.21 15:10, Sascha Hauer wrote:
> The variant we support currently can only do 32bit DMA. Adjust dma mask
> accordingly. Also use dma_map_single() rather than dma_sync_single() to
> actually get errors when the mapping fails.
> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>

Tested-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>

On a StarFive JH7100 (64-bit CPU, 32-bit MMC controller, non-1:1 mapping for
coherent DMA).

>  	host->idmac = dma_alloc_coherent(sizeof(*host->idmac) * DW_MMC_NUM_IDMACS,
> -					 DMA_ADDRESS_BROKEN);
> +					 &host->idmac_dma);
> +	if (!host->idmac)

That works for Linux, but not for barebox: barebox dma_alloc_coherent doesn't have

a dev parameter, so it can't check for dma_mapping_error() internally.

dma_alloc_coherent also never returns NULL in barebox, all implementations, except

for kvx, abort if no memory could be allocated.

> +		return PTR_ERR(-ENOMEM);

-ENOMEM is no pointer.

>  
>  	host->mci.send_cmd = dwmci_cmd;
>  	host->mci.set_ios = dwmci_set_ios;
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux