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] [day] [month] [year] [list]
Message-ID: <67533cef-83f0-05e4-1cb2-0071db3d8576@deltatee.com>
Date:   Thu, 30 Nov 2017 15:16:57 -0700
From:   Logan Gunthorpe <logang@...tatee.com>
To:     Serge Semin <fancer.lancer@...il.com>, jdmason@...zu.us,
        dave.jiang@...el.com, Allen.Hubbe@....com,
        Shyam-sundar.S-k@....com, Xiangliang.Yu@....com
Cc:     Sergey.Semin@...latforms.ru, linux-ntb@...glegroups.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] NTB: Set dma mask and dma coherent mask to NTB devices



On 30/11/17 02:39 PM, Serge Semin wrote:
> diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_amd.c
> index f0788aae05c9..3cfa46876239 100644
> --- a/drivers/ntb/hw/amd/ntb_hw_amd.c
> +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c
> @@ -1020,6 +1020,10 @@ static int amd_ntb_init_pci(struct amd_ntb_dev *ndev,
>   			goto err_dma_mask;
>   		dev_warn(&pdev->dev, "Cannot DMA consistent highmem\n");
>   	}
> +	rc = dma_coerce_mask_and_coherent(&ndev->ntb.dev,
> +					  dma_get_mask(&pdev->dev));
> +	if (rc)
> +		goto err_dma_mask;

I can't say I understand fully what this is solving. Perhaps you could 
explain it a little further in the commit message.

In any case, to me, it looks like it would be better in 
ntb_register_device() instead of every single driver.


> diff --git a/drivers/ntb/ntb.c b/drivers/ntb/ntb.c
> index 03b80d89b980..79e50a5f8902 100644
> --- a/drivers/ntb/ntb.c
> +++ b/drivers/ntb/ntb.c
> @@ -112,7 +112,6 @@ int ntb_register_device(struct ntb_dev *ntb)
>   
>   	init_completion(&ntb->released);
>   
> -	memset(&ntb->dev, 0, sizeof(ntb->dev));
>   	ntb->dev.bus = &ntb_bus;
>   	ntb->dev.parent = &ntb->pdev->dev;
>   	ntb->dev.release = ntb_dev_release;
> 

This is unrelated to above. I agree it should probably be removed but 
I'd suggest it should be in its own commit with its own justification.

Thanks,

Logan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ