[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e9555775-f03d-de68-a49f-d0ae0a9fcd5a@deltatee.com>
Date: Tue, 5 Dec 2017 10:21:58 -0700
From: Logan Gunthorpe <logang@...tatee.com>
To: Jon Mason <jdmason@...zu.us>, Serge Semin <fancer.lancer@...il.com>
Cc: Dave Jiang <dave.jiang@...el.com>,
"Hubbe, Allen" <Allen.Hubbe@....com>,
"S-k, Shyam-sundar" <Shyam-sundar.S-k@....com>,
"Yu, Xiangliang" <Xiangliang.Yu@....com>,
Gary R Hook <gary.hook@....com>, Sergey.Semin@...latforms.ru,
linux-ntb <linux-ntb@...glegroups.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 02/15] NTB: Set dma mask and dma coherent mask to NTB
devices
On 05/12/17 09:51 AM, Jon Mason wrote:
> On Sun, Dec 3, 2017 at 2:17 PM, Serge Semin <fancer.lancer@...il.com> wrote:
>> The dma_mask and dma_coherent_mask fields of the NTB struct device
>> weren't initialized in hardware drivers. In fact it should be done
>> instead of PCIe interface usage, since NTB clients are supposed to
>> use NTB API only and left unaware of real hardware implementation.
>> In addition to that ntb_device_register() method shouldn't clear
>> the passed ntb_dev structure, since it dma_mask is initialized
>> by hardware drivers.
>
> This seems like a bug fix. Should this be broken out of this patch or
> is it not noticed without your changes?
I was digging into this a bit more and in addition to my earlier review
comments I think the patch is incorrect for a couple reasons:
1) dma_set_mask() (and friends) are meant to inform the kernel of device
specific restrictions it cannot know. Calling it with the parent PCI
device's mask seems pointless.
2) Every dma_alloc() call in the NTB subsystem uses the PCI device's
struct device. This is ugly in itself but until it changes this patch
does nothing.
Logan
Powered by blists - more mailing lists