Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1444125
| From | Russell King - ARM Linux <linux@armlinux.org.uk> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 7/8] uio: bind uio_dmem_genirq via OF |
| Date | 2016-07-15 11:50 +0200 |
| Message-ID | <rV7UR-5ff-7@gated-at.bofh.it> (permalink) |
| References | <rV7i9-52g-5@gated-at.bofh.it> <rV7i9-52g-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 7/8] uio: bind uio_dmem_genirq via OF Anup Patel <anup.patel@broadcom.com> - 2016-07-15 11:10 +0200
Re: [PATCH 7/8] uio: bind uio_dmem_genirq via OF Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-07-15 11:50 +0200
Re: [PATCH 7/8] uio: bind uio_dmem_genirq via OF Anup Patel <anup.patel@broadcom.com> - 2016-07-15 12:50 +0200
Re: [PATCH 7/8] uio: bind uio_dmem_genirq via OF Mark Rutland <mark.rutland@arm.com> - 2016-07-15 15:30 +0200
Re: [PATCH 7/8] uio: bind uio_dmem_genirq via OF Anup Patel <anup.patel@broadcom.com> - 2016-07-15 18:30 +0200
Re: [PATCH 7/8] uio: bind uio_dmem_genirq via OF Mark Rutland <mark.rutland@arm.com> - 2016-07-15 19:00 +0200
Re: [PATCH 7/8] uio: bind uio_dmem_genirq via OF Anup Patel <anup.patel@broadcom.com> - 2016-07-18 05:20 +0200
csiph-web