lkml.org 
[lkml]   [2017]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2017-11-30 23:17    [W:0.346 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site