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]
Date:	Fri, 20 Sep 2013 14:55:28 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Russell King <rmk+kernel@....linux.org.uk>
CC:	<netdev@...r.kernel.org>,
	Solarflare linux maintainers <linux-net-drivers@...arflare.com>
Subject: Re: [PATCH 13/51] DMA-API: net: sfc/efx.c: replace
 dma_set_mask()+dma_set_coherent_mask() with new helper

[Trimmed cc's]

On Thu, 2013-09-19 at 22:38 +0100, Russell King wrote:
> Replace the following sequence:
> 
> 	dma_set_mask(dev, mask);
> 	dma_set_coherent_mask(dev, mask);
> 
> with a call to the new helper dma_set_mask_and_coherent().
> 
> Signed-off-by: Russell King <rmk+kernel@....linux.org.uk>

Acked-by: Ben Hutchings <bhutchings@...arflare.com>

> ---
>  drivers/net/ethernet/sfc/efx.c |   12 +-----------
>  1 files changed, 1 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index 07c9bc4..2e27837 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -1121,7 +1121,7 @@ static int efx_init_io(struct efx_nic *efx)
>  	 */
>  	while (dma_mask > 0x7fffffffUL) {
>  		if (dma_supported(&pci_dev->dev, dma_mask)) {
> -			rc = dma_set_mask(&pci_dev->dev, dma_mask);
> +			rc = dma_set_mask_and_coherent(&pci_dev->dev, dma_mask);
>  			if (rc == 0)
>  				break;
>  		}
> @@ -1134,16 +1134,6 @@ static int efx_init_io(struct efx_nic *efx)
>  	}
>  	netif_dbg(efx, probe, efx->net_dev,
>  		  "using DMA mask %llx\n", (unsigned long long) dma_mask);
> -	rc = dma_set_coherent_mask(&pci_dev->dev, dma_mask);
> -	if (rc) {
> -		/* dma_set_coherent_mask() is not *allowed* to
> -		 * fail with a mask that dma_set_mask() accepted,
> -		 * but just in case...
> -		 */
> -		netif_err(efx, probe, efx->net_dev,
> -			  "failed to set consistent DMA mask\n");
> -		goto fail2;
> -	}
>  
>  	efx->membase_phys = pci_resource_start(efx->pci_dev, EFX_MEM_BAR);
>  	rc = pci_request_region(pci_dev, EFX_MEM_BAR, "sfc");

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
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