mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] mci: dw_mmc: set dma mask to work correctly on 64bit platforms
Date: Fri, 11 Jun 2021 10:23:25 +0200	[thread overview]
Message-ID: <a08e527d-7557-a2fa-1bef-c3875a4c9072@pengutronix.de> (raw)
In-Reply-To: <20210610131032.6645-1-s.hauer@pengutronix.de>

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@pengutronix.de>

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

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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-06-11  8:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 13:10 Sascha Hauer
2021-06-11  8:23 ` Ahmad Fatoum [this message]
2021-06-11 10:02   ` Sascha Hauer
2021-06-11 10:40     ` Ahmad Fatoum
2021-06-11  8:26 ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a08e527d-7557-a2fa-1bef-c3875a4c9072@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox