mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Anup Patel <anup.patel@broadcom.com>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Scott Branden <sbranden@broadcom.com>,
	linux-doc@vger.kernel.org, Ray Jui <rjui@broadcom.com>,
	linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	bcm-kernel-feedback-list@broadcom.com,
	Ankit Jindal <thatsjindal@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	Jan Viktorin <viktorin@rehivetech.com>
Subject: Re: [PATCH 7/8] uio: bind uio_dmem_genirq via OF
Date: Fri, 15 Jul 2016 10:45:42 +0100	[thread overview]
Message-ID: <20160715094542.GE1041@n2100.armlinux.org.uk> (raw)
In-Reply-To: <1468573443-4670-8-git-send-email-anup.patel@broadcom.com>

On Fri, Jul 15, 2016 at 02:34:02PM +0530, Anup Patel wrote:
> +static int uio_dmem_genirq_alloc_platdata(struct platform_device *pdev)
> +{
> +	struct uio_dmem_genirq_pdata pdata;
> +	u32 dma_bits, regions;
> +	u32 sizes[MAX_UIO_MAPS];
> +	int ret;
> +
> +	memset(&pdata, 0, sizeof(pdata));
> +
> +	ret = of_property_read_u32(pdev->dev.of_node,
> +				   uio_of_dma_bits_prop, &dma_bits);
> +	if (ret) {
> +		dev_err(&pdev->dev,
> +			"Missing property %s\n", uio_of_dma_bits_prop);
> +		return ret;
> +	}
> +	if (dma_bits > 64)
> +		dma_bits = 64;
> +
> +	dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(dma_bits));

You really need to check the return value from this: this function
negotiates with the architecture, and if 64-bit DMA is not supported,
then the call will fail and you as a driver are expected to fall back
to 32-bit DMA only.

In that case, you're expected to call the same function with a 32-bit
mask, and if that fails, you're supposed to then decide that DMA is
not possible.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2016-07-15  9:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-15  9:03 [PATCH 0/8] Cache-coherent DMA access using UIO Anup Patel
2016-07-15  9:03 ` [PATCH 1/8] uio: code style cleanup Anup Patel
2016-07-15  9:03 ` [PATCH 2/8] uio: Add new UIO_MEM_PHYS_CACHE type for mem regions Anup Patel
2016-07-15  9:03 ` [PATCH 3/8] uio: Add new UIO_MEM_DEVICE " Anup Patel
2016-07-15  9:03 ` [PATCH 4/8] Documentation: Update documentation for UIO_MEM_PHYS_CACHE and UIO_MEM_DEVICE Anup Patel
2016-07-15  9:04 ` [PATCH 5/8] uio: fix dmem_region_start computation Anup Patel
2016-07-15 11:32   ` Greg Kroah-Hartman
2016-07-15 12:02     ` Jan Viktorin
2016-07-15  9:04 ` [PATCH 6/8] uio: UIO_IRQ_NONE is a valid option for uioinfo->irq Anup Patel
2016-07-15  9:04 ` [PATCH 7/8] uio: bind uio_dmem_genirq via OF Anup Patel
2016-07-15  9:45   ` Russell King - ARM Linux [this message]
2016-07-15 10:47     ` Anup Patel
2016-07-15 13:28   ` Mark Rutland
2016-07-15 16:27     ` Anup Patel
2016-07-15 16:52       ` Mark Rutland
2016-07-18  3:17         ` Anup Patel
2016-07-15  9:04 ` [PATCH 8/8] uio: Use new memtypes in uio_dmem_genirq Anup Patel

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=20160715094542.GE1041@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=anup.patel@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hjk@hansjkoch.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=thatsjindal@gmail.com \
    --cc=viktorin@rehivetech.com \
    /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

all inboxes | Powered by JetHome®