Skip to contentSkip to conversation

dmatest no longer works on ARC SDP with DW DMAC

DISCUSSION Eugeniy Paltsev 3 participants 4 messages Aug 10, 2016 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

dmatest on ARC SDP with DW DMAC became broken after df5c7386 ("dmaengine: dw: some Intel devices has no memcpy support") and 30cb2639 ("dmaengine: dw: don't override platform data with autocfg") commits.
* After df5c7386 commit "DMA_MEMCPY" capability option doesn't get set correctly in platform driver version.
* After 30cb2639 commit
"data_width" and "nollp" parameters don't get set correctly in platform driver version.

This happens because in old driver version there are three sources? of parameters: pdata, device tree and autoconfig hardware registers.? Some parameters were read from pdata and others from autoconfig hardware registers. If pdata was absent some pdata structure? fields were filled with parameters from device tree. But 30cb2639 commit disabled overriding pdata with autocfg, so if we use platform driver version without pdata some parameters will not be set.

I'm wondering what would be the best way to fix this situation? Should we strictly read parameters from only one source (pdata/device tree/autoconfig) or we may mix some of them (for example getting missing data from autoconf regs)?

#1 lore raw
Quoted 11 lines · Eugeniy Paltsev

dmatest on ARC SDP with DW DMAC became broken after df5c7386 ("dmaengine: dw: some Intel devices has no memcpy support") and 30cb2639 ("dmaengine: dw: don't override platform data with autocfg") commits.
* After df5c7386 commit "DMA_MEMCPY" capability option doesn't get set correctly in platform driver version.
* After 30cb2639 commit
"data_width" and "nollp" parameters don't get set correctly in platform
driver version.

Quoted 7 lines

This happens because in old driver version there are three sources? of parameters: pdata, device tree and autoconfig hardware registers.? Some parameters were read from pdata and others from autoconfig hardware registers. If pdata was absent some pdata structure? fields were filled with parameters from device tree. But 30cb2639 commit disabled overriding pdata with autocfg, so if we use platform driver version without pdata some parameters will not be set.

Yes, that's correct behaviour right now. You have to provide platform code which registers device with all platform data provided.

Quoted 1 line

I'm wondering what would be the best way to fix this situation?

Ideally we have to switch to use built-in device properties (drivers/base/property.c) and platform code in your case has to provide properties.

Quoted 3 lines

Should we strictly read parameters from only one source (pdata/device tree/autoconfig) or we may mix some of them (for example getting missing data from autoconf regs)?

See above.

Signature · 2 lines
Andy Shevchenko <andriy.shevchenko at linux.intel.com>
Intel Finland Oy
#2 lore raw

Hi Andy,

Quoted 21 lines · Andy Shevchenko
Quoted 12 lines · Eugeniy Paltsev

dmatest on ARC SDP with DW DMAC became broken after df5c7386 ("dmaengine: dw: some Intel devices has no memcpy support") and 30cb2639 ("dmaengine: dw: don't override platform data with autocfg") commits.
* After df5c7386 commit "DMA_MEMCPY" capability option doesn't get set correctly in platform driver version.
* After 30cb2639 commit
"data_width" and "nollp" parameters don't get set correctly in platform
driver version.

Quoted 7 lines

This happens because in old driver version there are three sources? of parameters: pdata, device tree and autoconfig hardware registers.? Some parameters were read from pdata and others from autoconfig hardware registers. If pdata was absent some pdata structure? fields were filled with parameters from device tree. But 30cb2639 commit disabled overriding pdata with autocfg, so if we use platform driver version without pdata some parameters will not be set.

Quoted 2 lines

Yes, that's correct behaviour right now. You have to provide platform code which registers device with all platform data provided.

But given autocfg registers exist in HW why don't we rely on their contents?

Quoted 5 lines
Quoted 1 line

I'm wondering what would be the best way to fix this situation?

Ideally we have to switch to use built-in device properties (drivers/base/property.c) and platform code in your case has to provide properties.

What do you mean saying "built-in device properties"? Setting pdata structure? In our particular case we use device tree for DW DMAC setup.

-Alexey

#3 lore raw
Quoted 30 lines · Alexey Brodkin

Hi Andy,

Quoted 27 lines · Andy Shevchenko
Quoted 24 lines · Eugeniy Paltsev

dmatest on ARC SDP with DW DMAC became broken after df5c7386 ("dmaengine: dw: some Intel devices has no memcpy support") and 30cb2639 ("dmaengine: dw: don't override platform data with autocfg")
commits.
* After df5c7386 commit "DMA_MEMCPY" capability option doesn't get set correctly in platform driver version.
* After 30cb2639 commit
"data_width" and "nollp" parameters don't get set correctly in platform
driver version.

This happens because in old driver version there are three sources?
of parameters: pdata, device tree and autoconfig hardware registers.?
Some parameters were read from pdata and others from autoconfig hardware registers. If pdata was absent some pdata structure? fields were filled with parameters from device tree. But 30cb2639 commit disabled overriding pdata with autocfg, so if we use platform
driver version without pdata some parameters will not be set.

Quoted 6 lines
Quoted 3 lines

Yes, that's correct behaviour right now. You have to provide platform
code which registers device with all platform data provided.

But given autocfg registers exist in HW why don't we rely on their contents?

And how exactly we can get that mem2mem support is absent / broken by some reason?

All those quirks (bool is_*) kinda semi-hardware related.

What we can do is to have two categories of properties: a) genuine hardware properties, and b) quirks.

So, refactor the ->probe() function in a way that will still copy quirks and other non-hardware properties from platform data, if provided, to the driver internals.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

I'm wondering what would be the best way to fix this situation?

Quoted 8 lines
Quoted 4 lines

Ideally we have to switch to use built-in device properties (drivers/base/property.c) and platform code in your case has to provide
properties.

What do you mean saying "built-in device properties"? Setting pdata structure? In our particular case we use device tree for DW DMAC setup.

Providing device properties instead of platform data. Again see above.

Signature · 2 lines
Andy Shevchenko <andriy.shevchenko at linux.intel.com>
Intel Finland Oy