lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4110555.qb0XUyFHNE@avalon>
Date:	Fri, 27 Sep 2013 03:56:13 +0200
From:	Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:	Russell King <rmk+kernel@....linux.org.uk>
Cc:	alsa-devel@...a-project.org, b43-dev@...ts.infradead.org,
	devel@...verdev.osuosl.org, devicetree@...r.kernel.org,
	dri-devel@...ts.freedesktop.org, e1000-devel@...ts.sourceforge.net,
	linux-arm-kernel@...ts.infradead.org, linux-crypto@...r.kernel.org,
	linux-doc@...r.kernel.org, linux-fbdev@...r.kernel.org,
	linux-ide@...r.kernel.org, linux-media@...r.kernel.org,
	linux-mmc@...r.kernel.org, linux-nvme@...ts.infradead.org,
	linux-omap@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
	linux-samsung-soc@...r.kernel.org, linux-scsi@...r.kernel.org,
	linux-tegra@...r.kernel.org, linux-usb@...r.kernel.org,
	linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
	Solarflare linux maintainers <linux-net-drivers@...arflare.com>,
	uclinux-dist-devel@...ckfin.uclinux.org,
	Mauro Carvalho Chehab <m.chehab@...sung.com>
Subject: Re: [PATCH 31/51] DMA-API: media: omap3isp: use dma_coerce_mask_and_coherent()

Hi Russell,

Thank you for the patch.

On Thursday 19 September 2013 22:56:02 Russell King wrote:
> The code sequence:
> 	isp->raw_dmamask = DMA_BIT_MASK(32);
> 	isp->dev->dma_mask = &isp->raw_dmamask;
> 	isp->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> bypasses the architectures check on the DMA mask.  It can be replaced
> with dma_coerce_mask_and_coherent(), avoiding the direct initialization
> of this mask.
> 
> Signed-off-by: Russell King <rmk+kernel@....linux.org.uk>

Acked-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>

> ---
>  drivers/media/platform/omap3isp/isp.c |    6 +++---
>  drivers/media/platform/omap3isp/isp.h |    3 ---
>  2 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/omap3isp/isp.c
> b/drivers/media/platform/omap3isp/isp.c index df3a0ec..1c36080 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c
> @@ -2182,9 +2182,9 @@ static int isp_probe(struct platform_device *pdev)
>  	isp->pdata = pdata;
>  	isp->ref_count = 0;
> 
> -	isp->raw_dmamask = DMA_BIT_MASK(32);
> -	isp->dev->dma_mask = &isp->raw_dmamask;
> -	isp->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> +	ret = dma_coerce_mask_and_coherent(isp->dev, DMA_BIT_MASK(32));
> +	if (ret)
> +		return ret;
> 
>  	platform_set_drvdata(pdev, isp);
> 
> diff --git a/drivers/media/platform/omap3isp/isp.h
> b/drivers/media/platform/omap3isp/isp.h index cd3eff4..ce65d3a 100644
> --- a/drivers/media/platform/omap3isp/isp.h
> +++ b/drivers/media/platform/omap3isp/isp.h
> @@ -152,7 +152,6 @@ struct isp_xclk {
>   * @mmio_base_phys: Array with physical L4 bus addresses for ISP register
>   *                  regions.
>   * @mmio_size: Array with ISP register regions size in bytes.
> - * @raw_dmamask: Raw DMA mask
>   * @stat_lock: Spinlock for handling statistics
>   * @isp_mutex: Mutex for serializing requests to ISP.
>   * @crashed: Bitmask of crashed entities (indexed by entity ID)
> @@ -190,8 +189,6 @@ struct isp_device {
>  	unsigned long mmio_base_phys[OMAP3_ISP_IOMEM_LAST];
>  	resource_size_t mmio_size[OMAP3_ISP_IOMEM_LAST];
> 
> -	u64 raw_dmamask;
> -
>  	/* ISP Obj */
>  	spinlock_t stat_lock;	/* common lock for statistic drivers */
>  	struct mutex isp_mutex;	/* For handling ref_count field */
-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ