pietrushnic / rpi-dt-linux

This repository aims to handle all patches required for Raspberry Pi support in upstream Linux kernel.
Other
2 stars 0 forks source link

amba-pl011 request DMA even when controller does not support it #6

Open pietrushnic opened 9 years ago

pietrushnic commented 9 years ago

According to BCM2835 ARM Peripherals spec:

The following functionality is not supported :
● Infrared Data Association (IrDA)
● Serial InfraRed (SIR) protocol Encoder/Decoder (ENDEC)
● Direct Memory Access (DMA).

Despite that when we enable DMA we get:

of_dma_request_slave_channel: dma-names property of node '/soc/uart@7e201000' missing or empty
uart-pl011 20201000.uart: no DMA platform data

This checks should be ommited if DMA is not supported. We should figure out if want to fix it ? If yes then how ?

notro commented 9 years ago

This seems to be the call chain:

device_initcall(pl011_dma_initcall);

(see bottom of wiki for when device_initcall is called)

pl011_dma_initcall->pl011_dma_probe_initcall->dma_request_slave_channel->dma_request_slave_channel_reason->of_dma_request_slave_channel:

        count = of_property_count_strings(np, "dma-names");
        if (count < 0) {
                pr_err("%s: dma-names property of node '%s' missing or empty\n",
                        __func__, np->full_name);
                return ERR_PTR(-ENODEV);
        }

All of this is selected with (above pl011_dma_probe_initcall):

#ifdef CONFIG_DMA_ENGINE

So I guess it's not possible to loose this error?

pietrushnic commented 9 years ago

Yes, I also saw that in that form error will alway occure, but the question is why we always assume that amba-pl011 will have DMA enabled. As life shows it is possible that i.e. RPi has pl011 and dma is not enabled. I don't heve expeirence with think kind of annoying erro messages.

  1. if it is possible that DMA is not enabled on pl011 it should not indicate error to user
  2. why we do not check if this controller support DMA ? Is it even possible ?
  3. should we ignore this message or fix the code ?

I will write email to maintener.

matthiasklein commented 9 years ago

I agree with you, that the driver should check (if possible) if DMA is enabled.

But in a first upstreaming run I would look for functionality, and in a second run I would invest time in such messages ...

notro commented 9 years ago

Maybe adding this will silence the error message:

            dma-names = "n/a";

This will let it past the property check, but since there is no such channel, it will still return ENODEV.