Skip to content

Fixes #13: dma_set_coherent_mask to 64 bits#15

Merged
wesleywesley merged 1 commit intoMicrosemi:develfrom
glimchb:devel
Jun 11, 2018
Merged

Fixes #13: dma_set_coherent_mask to 64 bits#15
wesleywesley merged 1 commit intoMicrosemi:develfrom
glimchb:devel

Conversation

@glimchb
Copy link
Copy Markdown
Contributor

@glimchb glimchb commented Jun 3, 2018

to be able to allocate large memory using CMA

@glimchb
Copy link
Copy Markdown
Contributor Author

glimchb commented Jun 3, 2018

@wesleywesley @lsgunth @dmeyergio - please review and merge

@glimchb
Copy link
Copy Markdown
Contributor Author

glimchb commented Jun 6, 2018

@wesleywesley @lsgunth @dmeyergio - please review and merge

@lsgunth
Copy link
Copy Markdown
Collaborator

lsgunth commented Jun 6, 2018

I think the change belongs in the proper switchtec driver during PCI init. Not in the NTB code.

I'd also like to see this go upstream and for that we will need a better commit message and a sign-off tag.

Thanks,

Logan

@glimchb
Copy link
Copy Markdown
Contributor Author

glimchb commented Jun 6, 2018

@lsgunth do you mean inside switchtec_init_pci() function in switchtec.c ?
the basic management driver have no idea regarding DMA usage... so why it have to be there?

@lsgunth
Copy link
Copy Markdown
Collaborator

lsgunth commented Jun 6, 2018

The DMA mask is a property of the PCI device not really of the usage of that device and we don't need other potential client drivers competing over what/when to set the mask.

The latest changes for switchtec kernel also have started doing DMA requests too.

switchtec_init_pci() seems like a good spot.

Logan

This patch fixes the problem during large buffers allocation with CMA.
The result of cma_alloc() is checked against dma_mask value.
It seems like default dma_mask value is 32, however Microsemi
switch supports 64-bit DMA.

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
@glimchb
Copy link
Copy Markdown
Contributor Author

glimchb commented Jun 6, 2018

@lsgunth done, please review

@lsgunth
Copy link
Copy Markdown
Collaborator

lsgunth commented Jun 7, 2018

Looks good to me.

@glimchb
Copy link
Copy Markdown
Contributor Author

glimchb commented Jun 10, 2018

@wesleywesley please merge

@wesleywesley
Copy link
Copy Markdown
Contributor

One question:
Should we use
int dma_set_mask_and_coherent(struct device *dev, u64 mask);
instead of
int dma_set_mask_and_coherent(struct device *dev, u64 mask);
because the latter is only apply to consistent allocations, but the former API is for both streaming and coherent?

Regard,
Wesley

@lsgunth
Copy link
Copy Markdown
Collaborator

lsgunth commented Apr 11, 2019

Yes, dma_set_mask_and_coherent() is probably a better choice.

Logan

@wesleywesley
Copy link
Copy Markdown
Contributor

@lsgunth
Thx for comments.
Will draft a pull request for this.

Regard,
Wesley

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants