Thread (18 messages) 18 messages, 3 authors, 2022-01-12

Re: [PATCH v5 3/3] mmc: Add driver for LiteX's LiteSDCard interface

From: Andy Shevchenko <hidden>
Date: 2021-12-26 14:01:44
Also in: linux-mmc, lkml

On Sun, Dec 26, 2021 at 3:36 PM Gabriel L. Somlo [off-list ref] wrote:
On Sun, Dec 26, 2021 at 03:13:21PM +0200, Andy Shevchenko wrote:
quoted
On Sun, Dec 26, 2021 at 1:45 PM Gabriel L. Somlo [off-list ref] wrote:
quoted
On Sat, Dec 25, 2021 at 06:43:22PM +0200, Andy Shevchenko wrote:
quoted
On Wed, Dec 15, 2021 at 10:00 PM Gabriel Somlo [off-list ref] wrote:
...
quoted
quoted
quoted
quoted
+#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
Why under ifdeffery?
Because I only want to do it on 64-bit capable architectures.

The alternative would be to call

  dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));

on *all* architectures, but ignore the returned error (-EIO,
presumably on architetures that only support 32-bit DMA).
I don't understand why you are supposed to ignore errors and why you
expect to get such.
If I call `dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));`
on a machine where `CONFIG_ARCH_DMA_ADDR_T_64BIT` is *not* set, I
expect an error. The implicit default
(per Documentation/core-api/dma-api-howto.rst), is DMA_BIT_MASK(32).
I'm working under the impression that on machines with
CONFIG_ARCH_DMA_ADDR_T_64BIT I should increase that to DMA_BIT_MASK(64).

So if I don't #ifdef it, that call will fail on machines supporting
only 32-bits.

What am I missing?
This thread: https://lkml.org/lkml/2021/6/7/398 ?

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help