From: Logan Gunthorpe <logang@deltatee.com>
To: Serge Semin <fancer.lancer@gmail.com>,
jdmason@kudzu.us, dave.jiang@intel.com, Allen.Hubbe@emc.com,
Shyam-sundar.S-k@amd.com, Xiangliang.Yu@amd.com
Cc: Sergey.Semin@t-platforms.ru, linux-ntb@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] NTB: Set dma mask and dma coherent mask to NTB devices
Date: Thu, 30 Nov 2017 15:16:57 -0700 [thread overview]
Message-ID: <67533cef-83f0-05e4-1cb2-0071db3d8576@deltatee.com> (raw)
In-Reply-To: <20171130213910.21052-1-fancer.lancer@gmail.com>
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
prev parent reply other threads:[~2017-11-30 22:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 21:39 Serge Semin
2017-11-30 22:16 ` Logan Gunthorpe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=67533cef-83f0-05e4-1cb2-0071db3d8576@deltatee.com \
--to=logang@deltatee.com \
--cc=Allen.Hubbe@emc.com \
--cc=Sergey.Semin@t-platforms.ru \
--cc=Shyam-sundar.S-k@amd.com \
--cc=Xiangliang.Yu@amd.com \
--cc=dave.jiang@intel.com \
--cc=fancer.lancer@gmail.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ntb@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®