[PATCH v3] drivers/tty: amba: defer probing DMA availability until hw_init

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Feb 25 16:56:01 PST 2015


On Wed, Feb 25, 2015 at 07:31:01PM -0500, Jorge Ramirez-Ortiz wrote:
> @@ -275,9 +277,16 @@ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *
>  	struct dma_chan *chan;
>  	dma_cap_mask_t mask;
>  
> -	chan = dma_request_slave_channel(dev, "tx");
> +	uap->dma_probed = true;
> +
> +	chan = dma_request_slave_channel_reason(dev, "tx");
> +	if (IS_ERR(chan)) {
> +		if (PTR_ERR(chan) == -EPROBE_DEFER) {
> +			dev_warn(uap->port.dev, "DMA driver not ready\n");
> +			return;
> +		}
> +		dev_info(uap->port.dev, "no OF or ACPI DMA data\n");

So if we get an -EPROBE_DEFER, we never try again, because uap->dma_probed
is left true?

Should we even emit a message here?  What if userspace opens and closes
the device multiple times before the DMA driver is ready?

Please get rid of that "no OF or ACPI DMA data" message.  There are
situations where we have a DMA engine, but there is quite legally no
DMA available on the port.  Such a message would be an annoyance.
DMA is optional.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.



More information about the linux-arm-kernel mailing list