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:   Thu, 2 Aug 2018 02:00:19 +0000
From:   Andy Duan <fugang.duan@....com>
To:     Stefan Agner <stefan@...er.ch>,
        "davem@...emloft.net" <davem@...emloft.net>
CC:     "krzk@...nel.org" <krzk@...nel.org>,
        "robin.murphy@....com" <robin.murphy@....com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] net: fec: check DMA addressing limitations

From: Stefan Agner <stefan@...er.ch> Sent: 2018年8月1日 19:45
> Check DMA addressing limitations as suggested by the DMA API how-to.
> This does not fix a particular issue seen but is considered good style.
> 
> Signed-off-by: Stefan Agner <stefan@...er.ch>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index c729665107f5..af0fb200e936 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -3146,6 +3146,12 @@ static int fec_enet_init(struct net_device
> *ndev)
>  	fep->tx_align = 0x3;
>  #endif
> 
> +	/* Check mask of the streaming and coherent API */
> +	if (dma_set_mask_and_coherent(&fep->pdev->dev,
> DMA_BIT_MASK(32))) {
> +		dev_warn(&fep->pdev->dev, "No suitable DMA available\n");
> +		return -ENODEV;
It is better:

ret = dma_set_mask_and_coherent(&fep->pdev->dev, DMA_BIT_MASK(32));
if (ret < 0) {
	dev_warn(&fep->pdev->dev, "No suitable DMA available\n");
	return ret;
}


If the patch aim to "OF: Don't set default coherent DMA mask", I think not only this driver need to add the DMA mask limitations,  many other drivers also need.


> +	}
> +
>  	fec_enet_alloc_queue(ndev);
> 
>  	bd_size = (fep->total_tx_ring_size + fep->total_rx_ring_size) * dsize;
> --
> 2.18.0

Powered by blists - more mailing lists