[lkml]   [2017]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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 <> 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.


 \ /
  Last update: 2017-12-05 18:22    [W:0.088 / U:49.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site