dmaengine: Stear users towards dma_request_slave_chan()
cover dmaengine: Stear users towards dma_request_slave_chan()
Hi,
dma_request_slave_channel_reason() no longer have user in mainline, it can be removed.
Advise users of dma_request_slave_channel() and dma_request_slave_channel_compat() to move to dma_request_slave_chan()
Regards,
Peter
---
Peter Ujfalusi (3):
dmaengine: Remove unused define for (dma_request_slave_channel_reason)()
dmaengine: Mark dma_request_slave_channel() deprecated
dmaengine: Encourage dma_request_slave_channel_compat() users to
migrate
drivers/dma/dmaengine.c | 18 ------------------ include/linux/dmaengine.h | 28 ++++++++++++++++++---------- 2 files changed, 18 insertions(+), 28 deletions(-)
Signature · 4 lines
Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
PATCH 1/3 dmaengine: Remove unused define for dma_request_slave_channel_reason()
No users left in the kernel, it can be removed.
--- include/linux/dmaengine.h | 2 -- 1 file changed, 2 deletions(-)
include/linux/dmaengine.h +0 -2
@@ -1495,8 +1495,6 @@ static inline int dma_get_slave_caps(struct dma_chan *chan, }#endif -#define dma_request_slave_channel_reason (dev, name) dma_request_chan(dev, name) -static inline int dmaengine_desc_set_reuse (struct dma_async_tx_descriptor *tx) {struct dma_slave_caps caps;
Signature · 4 lines
Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Re: [PATCH 1/3] dmaengine: Remove unused define for dma_request_slave_channel_reason()
Quoted 3 lines · Peter Ujfalusi
No users left in the kernel, it can be removed.
Signed-off-by Peter Ujfalusi <[email protected]>
Last user removed in commit f339f979bb333ed5 ("iio: buffer-dmaengine: Use dma_request_chan() directly for channel request"), so
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
PATCH 2/3 dmaengine: Mark dma_request_slave_channel() deprecated
In reply to Peter UjfalusiNew drivers should use dma_request_chan() insteaddma_request_slave_channel()
dma_request_slave_channel() is a simple wrapper for dma_request_chan() eating up the error code for channel request failure and makes deferred probing impossible.
Move the dma_request_slave_channel() into the header as inline function, mark it as deprecated.
--- drivers/dma/dmaengine.c | 18 ------------------ include/linux/dmaengine.h | 15 +++++++++------ 2 files changed, 9 insertions(+), 24 deletions(-)
drivers/dma/dmaengine.c +0 -18
@@ -781,24 +781,6 @@ struct dma_chan *dma_request_chan(struct device *dev, const char *name) }EXPORT_SYMBOL_GPL (dma_request_chan); -/** -* dma_request_slave_channel - try to allocate an exclusive slave channel -* @dev: pointer to client device structure -* @name: slave channel name -* -* Returns pointer to appropriate DMA channel on success or NULL. -*/ -struct dma_chan *dma_request_slave_channel (struct device *dev, -const char *name) -{ -struct dma_chan *ch =dma_request_chan (dev, name); -if (IS_ERR (ch)) -return NULL ; - -return ch; -} -EXPORT_SYMBOL_GPL (dma_request_slave_channel); -/** * dma_request_chan_by_mask - allocate a channel satisfying certain capabilities * @mask: capabilities that the channel must satisfy
include/linux/dmaengine.h +9 -6
@@ -1440,7 +1440,6 @@ void dma_issue_pending_all(void);struct dma_chan *__dma_request_channel (const dma_cap_mask_t *mask,dma_filter_fn fn,void *fn_param,struct device_node *np); -struct dma_chan *dma_request_slave_channel (struct device *dev,const char *name);struct dma_chan *dma_request_chan (struct device *dev,const char *name);struct dma_chan *dma_request_chan_by_mask (const dma_cap_mask_t *mask);
@@ -1470,11 +1469,6 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, {return NULL ; } -static inline struct dma_chan *dma_request_slave_channel (struct device *dev, -const char *name) -{ -return NULL ; -}static inline struct dma_chan *dma_request_chan (struct device *dev,const char *name) {
@@ -1544,6 +1538,15 @@ void dma_run_dependencies(struct dma_async_tx_descriptor *tx);#define dma_request_channel (mask, x, y) \ __dma_request_channel(&(mask), x, y, NULL) +/* Deprecated, please use dma_request_chan() directly */ +static inline struct dma_chan *__deprecated +dma_request_slave_channel (struct device *dev,const char *name) +{ +struct dma_chan *ch =dma_request_chan (dev, name); + +return IS_ERR (ch) ?NULL : ch; +} +static inline struct dma_chan *dma_request_slave_channel_compat(const dma_cap_mask_t mask, dma_filter_fn fn, void *fn_param,
Signature · 4 lines
Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
PATCH 3/3 dmaengine: Encourage dma_request_slave_channel_compat() users to migrate
In reply to Peter UjfalusiUsers of dma_request_slave_channel_compat() can be migrated to dma_request_chan() by correct dma_slave_map for the platform.
Start nagging users in hope that they will move.
--- include/linux/dmaengine.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
include/linux/dmaengine.h +9 -2
@@ -1547,6 +1547,10 @@ dma_request_slave_channel(struct device *dev, const char *name)return IS_ERR (ch) ?NULL : ch; } +/* +* Please use dma_request_chan() directly. +* Legacy support should use dma_slave_map + dma_request_chan() +*/ static inline struct dma_chan *dma_request_slave_channel_compat(const dma_cap_mask_t mask, dma_filter_fn fn, void *fn_param,
@@ -1554,13 +1558,16 @@ static inline struct dma_chan {struct dma_chan *chan; - chan =dma_request_slave_channel (dev, name); -if (chan) + chan =dma_request_chan (dev, name); +if (!IS_ERR (chan))return chan;if (!fn || !fn_param)return NULL ; +dev_info (dev,"Please add dma_slave_map entry for %s:%s and migrate to" +" dma_request_chan()" ,dev_name (dev), name); +return __dma_request_channel (&mask, fn, fn_param,NULL ); }
Signature · 4 lines
Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Re: [PATCH 3/3] dmaengine: Encourage dma_request_slave_channel_compat() users to migrate
include/linux/dmaengine.h static inline struct dma_chan · line 1569
Quoted 2 lines · Peter Ujfalusi
include/linux/dmaengine.h +2
-0+dev_info (dev,"Please add dma_slave_map entry for %s:%s and migrate to" +" dma_request_chan()" ,dev_name (dev), name);
Please, don't split string literals.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 5 lines · Peter Ujfalusi
dma_request_slave_channel_reason()no longer have user in mainline, it can be removed.Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()
How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions without taking care of (I'm talking now about dma release callback, for example) end users. They will be scary for no reason.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Hi Andy,
Quoted 10 lines · Andy Shevchenko
Quoted 5 lines · Peter Ujfalusi
dma_request_slave_channel_reason()no longer have user in mainline, it can be removed.Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions
The dma_slave_map support is added few years back for the legacy ARM boards, because we do care.
daVinci, OMAP1, pxa, s3cx4xx and even m68k/coldfire moved over.
Imho it is confusing to have 4+ APIs to do the same thing, but in a slightly different way.
Quoted 2 lines
without taking care of
(I'm talking now about dma release callback, for example) end users.
I have been converting users in the background, but the _compat() is a bit more problematic as I need to maintainers of those legacy platforms to craft the map. If they care.
Obviously the APIs are not going to be removed if we have a single user and if there is clearly a need for something the _compat() was doing and it can not be done via the dma_slave_map, then rest assured there will be a clean API to achieve just that.
Quoted 1 line
They will be scary for no reason.
There is a reason: to clean up the API to make it non confusing for the users.
New drivers should not use the old API i new code and developers tend to pick the API they use after a quick 'git grep dma_request_' and see what the majority is using.
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Quoted 6 lines · Peter Ujfalusi
Quoted 5 lines · Andy Shevchenko
Quoted 2 lines · Peter Ujfalusi
Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()
Quoted 6 lines
Quoted 2 lines
How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions
The
dma_slave_mapsupport is added few years back for the legacy ARM boards, because we do care.
daVinci, OMAP1, pxa, s3cx4xx and even m68k/coldfire moved over.
Then why simple not to convert (start converting) those few drivers to new API and simple remove the old one?
Quoted 2 lines
Imho it is confusing to have 4+ APIs to do the same thing, but in a slightly different way.
It was always an excuse by authors "that too many drivers to convert..."
Quoted 6 lines
Quoted 2 lines
without taking care of
(I'm talking now about dma release callback, for example) end users.I have been converting users in the background, but the
_compat()is a bit more problematic as I need to maintainers of those legacy platforms to craft the map. If they care.
Why not to remove them and don't punish users of new drivers / platforms?
Quoted 9 lines
Obviously the APIs are not going to be removed if we have a single user and if there is clearly a need for something the
_compat()was doing and it can not be done via thedma_slave_map, then rest assured there will be a clean API to achieve just that.Quoted 1 line
They will be scary for no reason.
There is a reason: to clean up the API to make it non confusing for the users.
No, it's a reason when you first take care of existing users and decide to obsolete an API followed by removal few releases later. But I see no reason to keep such APIs at all, so, instead of this *wonderful* messages perhaps somebody should do better work?
Quoted 3 lines
New drivers should not use the old API i new code and developers tend to pick the API they use after a quick 'git grep
dma_request_' and see what the majority is using.
Isn't it a point to do better review rather than scary end users?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Hi Andy,
Quoted 10 lines · Andy Shevchenko
Quoted 9 lines · Peter Ujfalusi
Quoted 7 lines · Andy Shevchenko
Quoted 2 lines · Peter Ujfalusi
Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions
Quoted 6 lines
Quoted 3 lines
The
dma_slave_mapsupport is added few years back for the legacy ARM boards, because we do care.
daVinci, OMAP1, pxa, s3cx4xx and even m68k/coldfire moved over.Then why simple not to convert (start converting) those few drivers to new API and simple remove the old one?
_if_ the dma_request_slave_channel_compat() is really falling back after dma_request_chan() - this is what it calls first, then it is not a simple convert to a new API.
1. The arch needs to define the dma_slave_map for the SoC.
2. The dma driver needs few lines to add it to DMAengine core (+pdata change).
After this the _compat() can be replaced with dma_request_chan()
In most cases I do not have access to documentation and boards to test.
Looking at the output of 'git grep dma_request_slave_channel_compat':drivers/mmc/host/renesas_sdhi_sys_dmac.c drivers/spi/spi-pxa2xx-dma.cdrivers/spi/spi-rspi.cdrivers/spi/spi-sh-msiof.c drivers/tty/serial/8250/8250_dma.c
From these rspi boots only in DT and I'm not sure about the others. 8250_dma is a tricky one as it is used as generic DMA layer for many arch.
Quoted 4 lines
Quoted 2 lines
Imho it is confusing to have 4+ APIs to do the same thing, but in a slightly different way.
It was always an excuse by authors "that too many drivers to convert..."
Sure, but before you accuse anyone with neglect, can you check the git log for 'dma_request_slave_channel' in the commit messages?
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
without taking care of
(I'm talking now about dma release callback, for example) end users.I have been converting users in the background, but the
_compat()is a bit more problematic as I need to maintainers of those legacy platforms to craft the map. If they care.Why not to remove them and don't punish users of new drivers / platforms?
The _compat() can not be removed, but we just don't know who really needs the fallback after dma_request_chan().
With the print the hope is that users will come forward and we can help migrate or address their specific needs.
Quoted 5 lines
Quoted 5 lines
Obviously the APIs are not going to be removed if we have a single user and if there is clearly a need for something the
_compat()was doing and it can not be done via thedma_slave_map, then rest assured there will be a clean API to achieve just that.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
They will be scary for no reason.
There is a reason: to clean up the API to make it non confusing for the users.
No, it's a reason when you first take care of existing users and decide to obsolete an API followed by removal few releases later.
I'm fine to drop the pr_info() and the __deprecated mark for dma_request_slave_channel.
Quoted 3 lines
But
I see no reason to keep such APIs at all, so, instead of this *wonderful* messages perhaps somebody should do better work?
To touch the _compat() variant one needs to have access to the documentation of the SoC on which the code falls back. It is not a matter of sloppy/poor/ignorant/etc work attitude.
I have kept clear on touching those few drivers using it [1] as I don't have documentation.
Quoted 5 lines
Quoted 3 lines
New drivers should not use the old API i new code and developers tend to pick the API they use after a quick 'git grep
dma_request_' and see what the majority is using.Isn't it a point to do better review rather than scary end users?
Sure, but we rarely CCd on new client drivers for DMAengine API usage.
[1] fwiw, there are drivers using dma_request_channel() and by the look their use is either _compat() or the dma_request_chan_by_mask() style and some even have a twist here and there...
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Quoted 27 lines · Peter Ujfalusi
Quoted 10 lines · Andy Shevchenko
Quoted 9 lines · Peter Ujfalusi
Quoted 7 lines · Andy Shevchenko
Quoted 2 lines · Peter Ujfalusi
Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions
Quoted 6 lines
Quoted 3 lines
The
dma_slave_mapsupport is added few years back for the legacy ARM boards, because we do care.
daVinci, OMAP1, pxa, s3cx4xx and even m68k/coldfire moved over.Then why simple not to convert (start converting) those few drivers to new API and simple remove the old one?
_if_ the
dma_request_slave_channel_compat()is really falling back afterdma_request_chan()- this is what it calls first, then it is not a simple convert to a new API.
1. The arch needs to define thedma_slave_mapfor the SoC.
2. The dma driver needs few lines to add it to DMAengine core (+pdata change).
After this the_compat()can be replaced withdma_request_chan()
Quoted 1 line
In most cases I do not have access to documentation and boards to test.
So, why everyone with the boards outside of your scope has to suffer?
...
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Imho it is confusing to have 4+ APIs to do the same thing, but in a slightly different way.
It was always an excuse by authors "that too many drivers to convert..."
Sure, but before you accuse anyone with neglect, can you check the git log for '
dma_request_slave_channel' in the commit messages?
It's good people, and you, are taking care of it, but make user suffer because somebody wants to call for *developers* is a bad idea. And it happened not first time in the DMA engine subsystem.
...
Quoted 4 lines
Quoted 2 lines
No, it's a reason when you first take care of existing users and decide to obsolete an API followed by removal few releases later.
I'm fine to drop the
pr_info()
Yes, please do.
Quoted 2 lines
and the
__deprecatedmark fordma_request_slave_channel.
This OTOH is for *developers* and its scope won't scary people. So, it's more or less fine.
Quoted 10 lines
Quoted 3 lines
But
I see no reason to keep such APIs at all, so, instead of this *wonderful* messages perhaps somebody should do better work?To touch the
_compat()variant one needs to have access to the documentation of the SoC on which the code falls back. It is not a matter of sloppy/poor/ignorant/etc work attitude.
I have kept clear on touching those few drivers using it [1] as I don't have documentation.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
New drivers should not use the old API i new code and developers tend to pick the API they use after a quick 'git grep
dma_request_' and see what the majority is using.Isn't it a point to do better review rather than scary end users?
Sure, but we rarely CCd on new client drivers for DMAengine API usage.
Linux Next allows people to git grep -n dma_slave_DO_NOT_CALL and tell developers. Isn't it the job good maintainer can do?
Quoted 3 lines
[1] fwiw, there are drivers using
dma_request_channel()and by the look their use is either_compat()or thedma_request_chan_by_mask()style and some even have a twist here and there...
Bottom line, if you need to tell *developers* about something, please don't bother *end users*.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Hi Peter,
Quoted 27 lines · Peter Ujfalusi
Quoted 9 lines · Andy Shevchenko
Quoted 8 lines · Peter Ujfalusi
Quoted 6 lines · Andy Shevchenko
Quoted 2 lines · Peter Ujfalusi
Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions
Quoted 6 lines
Quoted 3 lines
The
dma_slave_mapsupport is added few years back for the legacy ARM boards, because we do care.
daVinci, OMAP1, pxa, s3cx4xx and even m68k/coldfire moved over.Then why simple not to convert (start converting) those few drivers to new API and simple remove the old one?
_if_ the
dma_request_slave_channel_compat()is really falling back afterdma_request_chan()- this is what it calls first, then it is not a simple convert to a new API.
1. The arch needs to define thedma_slave_mapfor the SoC.
2. The dma driver needs few lines to add it to DMAengine core (+pdata change).
After this the_compat()can be replaced withdma_request_chan()In most cases I do not have access to documentation and boards to test.
Quoted 8 lines
Looking at the output of 'git grep
dma_request_slave_channel_compat':drivers/mmc/host/renesas_sdhi_sys_dmac.cdrivers/spi/spi-pxa2xx-dma.cdrivers/spi/spi-rspi.cdrivers/spi/spi-sh-msiof.cdrivers/tty/serial/8250/8250_dma.cFrom these rspi boots only in DT and I'm not sure about the others.
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
arch/sh/kernel/cpu/sh4a/setup-sh7757.c: .name = "rspi",
arch/sh/boards/mach-ecovec24/setup.c: .name = "spi_sh_msiof",
The former seems to be used with drivers/dma/sh/shdmac.c:
arch/sh/include/cpu-sh4/cpu/sh7757.h: SHDMA_SLAVE_RSPI_TX,
arch/sh/include/cpu-sh4/cpu/sh7757.h: SHDMA_SLAVE_RSPI_RX,
arch/sh/kernel/cpu/sh4a/setup-sh7757.c: .slave_id SHDMA_SLAVE_RSPI_TX,
arch/sh/kernel/cpu/sh4a/setup-sh7757.c: .slave_id SHDMA_SLAVE_RSPI_RX,
but I have no idea if it still works (and no hardware).
The latter doesn't seem to be used with DMA on ecovec24/sh7724, so probably we can just drop the _compat() from sh-sh-msiof.c.
BTW, we no longer support non-legacy DMA in drivers/tty/serial/sh-sci.c (DMA was completely broken in that driver when I added DT suppport), but it seems it was used at some point on various SH, cfr. e.g. arch/sh/kernel/cpu/sh4a/setup-sh7724.c still setting up the channels. Which might be a motivation for just dropping _compat() from spi-rspi.c, too? ;-)
Anyone who cares for DMA on SuperH?
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
John Paul Adrian Glaubitz
maintainerQuoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
Quoted 1 line
Anyone who cares for DMA on SuperH?
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer - [email protected] `. `' Freie Universitaet Berlin - [email protected] `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Hi Adrian,
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
True.
Quoted 4 lines
Quoted 1 line
Anyone who cares for DMA on SuperH?
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
It may make a few things slower.
Does any of your SuperH boards use DMA?
Anything interesting in /proc or /sys w.r.t. DMA?
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
John Paul Adrian Glaubitz
maintainerHi Geert!
Quoted 9 lines · Geert Uytterhoeven
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
True.
Would it be possible to keep DMA support if device tree support was added for SuperH? I think Rich eventually wanted to merge the patches, there were just some minor issues with them.
It would be great if we could still get them merged. I would be happy to help with the testing.
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
Anyone who cares for DMA on SuperH?
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
It may make a few things slower.
Does any of your SuperH boards use DMA?
Anything interesting in /proc or /sys w.r.t. DMA?
I have:
root@tirpitz:/sys> find . -iname "*dma*"
./bus/dma
./bus/dma/devices/dma0
./bus/dma/devices/dma1
./bus/dma/devices/dma2
./bus/dma/devices/dma3
./bus/dma/devices/dma4
./bus/dma/devices/dma5
./bus/dma/devices/dma6
./bus/dma/devices/dma7
./bus/dma/devices/dma8
./bus/dma/devices/dma9
./bus/dma/devices/dma10
./bus/dma/devices/dma11
./bus/platform/devices/sh_dmac
./bus/platform/devices/sh-dma-engine.0 ./bus/platform/devices/sh-dma-engine.1 ./devices/pci0000:00/0000:00:00.0/consistent_dma_mask_bits ./devices/pci0000:00/0000:00:00.0/dma_mask_bits ./devices/pci0000:00/0000:00:01.0/ata1/host0/scsi_host/host0/unchecked_isa_dma ./devices/pci0000:00/0000:00:01.0/ata1/link1/dev1.0/ata_device/dev1.0/dma_mode ./devices/pci0000:00/0000:00:01.0/ata2/host1/scsi_host/host1/unchecked_isa_dma ./devices/pci0000:00/0000:00:01.0/ata2/link2/dev2.0/ata_device/dev2.0/dma_mode ./devices/pci0000:00/0000:00:01.0/consistent_dma_mask_bits ./devices/pci0000:00/0000:00:01.0/dma_mask_bits
./devices/system/dma
./devices/system/dma/dma0
./devices/system/dma/dma1
./devices/system/dma/dma2
./devices/system/dma/dma3
./devices/system/dma/dma4
./devices/system/dma/dma5
./devices/system/dma/dma6
root@tirpitz:~> find /proc -iname "*dma*"/proc/dma/proc/irq/52/DMAC Address Error1/proc/irq/33/DMAC Address Error0/proc/sys/fs/nfs/idmap_cache_timeout
find: ‘/proc/5703’: No such file or directory
find: ‘/proc/5704’: No such file or directory
find: ‘/proc/5705’: No such file or directory
root@tirpitz:~> cat /proc/dma
root@tirpitz:~> find /sys -iname "*dma*"/sys/bus/dma/sys/bus/dma/devices/dma0/sys/bus/dma/devices/dma1/sys/bus/dma/devices/dma2/sys/bus/dma/devices/dma3/sys/bus/dma/devices/dma4/sys/bus/dma/devices/dma5/sys/bus/dma/devices/dma6/sys/bus/dma/devices/dma7/sys/bus/dma/devices/dma8/sys/bus/dma/devices/dma9/sys/bus/dma/devices/dma10/sys/bus/dma/devices/dma11/sys/bus/platform/devices/sh_dmac/sys/bus/platform/devices/sh-dma-engine.0 /sys/bus/platform/devices/sh-dma-engine.1 /sys/devices/pci0000:00/0000:00:00.0/consistent_dma_mask_bits /sys/devices/pci0000:00/0000:00:00.0/dma_mask_bits /sys/devices/pci0000:00/0000:00:01.0/ata1/host0/scsi_host/host0/unchecked_isa_dma /sys/devices/pci0000:00/0000:00:01.0/ata1/link1/dev1.0/ata_device/dev1.0/dma_mode /sys/devices/pci0000:00/0000:00:01.0/ata2/host1/scsi_host/host1/unchecked_isa_dma /sys/devices/pci0000:00/0000:00:01.0/ata2/link2/dev2.0/ata_device/dev2.0/dma_mode /sys/devices/pci0000:00/0000:00:01.0/consistent_dma_mask_bits /sys/devices/pci0000:00/0000:00:01.0/dma_mask_bits/sys/devices/system/dma/sys/devices/system/dma/dma0/sys/devices/system/dma/dma1/sys/devices/system/dma/dma2/sys/devices/system/dma/dma3/sys/devices/system/dma/dma4/sys/devices/system/dma/dma5/sys/devices/system/dma/dma6/sys/devices/system/dma/dma7/sys/devices/system/dma/dma8/sys/devices/system/dma/dma9/sys/devices/system/dma/dma10/sys/devices/system/dma/dma11/sys/devices/virtual/misc/cpu_dma_latency/sys/devices/platform/sh_dmac/sys/devices/platform/sh_dmac/dma0/sys/devices/platform/sh_dmac/dma1/sys/devices/platform/sh_dmac/dma2/sys/devices/platform/sh_dmac/dma3/sys/devices/platform/sh_dmac/dma4/sys/devices/platform/sh_dmac/dma5/sys/devices/platform/sh_dmac/dma6/sys/devices/platform/sh_dmac/dma7/sys/devices/platform/sh_dmac/dma8/sys/devices/platform/sh_dmac/dma9/sys/devices/platform/sh_dmac/dma10/sys/devices/platform/sh_dmac/dma11 /sys/devices/platform/r8a66597_hcd/usb1/1-1/1-1:1.0/host2/scsi_host/host2/unchecked_isa_dma /sys/devices/platform/sh-dma-engine.0/sys/devices/platform/sh-dma-engine.1/sys/class/misc/cpu_dma_latency /sys/module/nfs/parameters/nfs4_disable_idmapping /sys/module/nfs/parameters/nfs_idmap_cache_timeout /sys/module/libata/parameters/dma/sys/module/libata/parameters/atapi_dmadir
root@tirpitz:~>
On my SH-7785LCR.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer - [email protected] `. `' Freie Universitaet Berlin - [email protected] `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Hi Adrian,
Quoted 6 lines · John Paul Adrian Glaubitz
Quoted 5 lines · Geert Uytterhoeven
Quoted 3 lines · John Paul Adrian Glaubitz
Quoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
True.
Would it be possible to keep DMA support if device tree support was added for SuperH? I think Rich eventually wanted to merge the patches, there were just some minor issues with them.
Adding DT support would definitely make things easier, but would be a lot of work.
However, using dma_slave_map would be an alternative.
Quoted 21 lines
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
Anyone who cares for DMA on SuperH?
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
It may make a few things slower.
Does any of your SuperH boards use DMA?
Anything interesting in /proc or /sys w.r.t. DMA?I have:
root@tirpitz:/sys> find . -iname "*dma*"
./bus/dma
./bus/dma/devices/dma0
./bus/dma/devices/dma1
./bus/dma/devices/dma2
./bus/dma/devices/dma3
./bus/dma/devices/dma4
./bus/dma/devices/dma5
./bus/dma/devices/dma6
Quoted 8 lines
./bus/dma/devices/dma7
./bus/dma/devices/dma8
./bus/dma/devices/dma9
./bus/dma/devices/dma10
./bus/dma/devices/dma11
./bus/platform/devices/sh_dmac
./bus/platform/devices/sh-dma-engine.0
./bus/platform/devices/sh-dma-engine.1
So you do have the two dmaengines...
Quoted 1 line
On my SH-7785LCR.
... but are they actually used?
git grep -E "(SHDMA|sh_dmae_slave_config)" -- "arch/sh/*7785*" doesn't come up with any matches, so I don't think any sh7785 platform is wired to use DMA (yet), only sh7757 and sh772[234].
To double-check:
With current upstream, you can look for "slave" symlinks in sysfs. With older kernels, you can look at the interrupt counts for the DMACs in /proc/interrupts.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Hi Geert, Adrian,
Quoted 10 lines · Geert Uytterhoeven
Hi Adrian,
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
Quoted 8 lines
True.
Quoted 4 lines
Quoted 1 line
Anyone who cares for DMA on SuperH?
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
It may make a few things slower.
I would not drop DMA support but I would suggest to add dma_slave_map for non DT boot so the _compat() can be dropped.
Imho on lower spec SoC (and I believe SuperH is) the DMA makes big difference offloading data movement from the CPU.
Quoted 7 lines
Does any of your SuperH boards use DMA?
Anything interesting in /proc or /sys w.r.t. DMA?Gr{oetje,eeting}s,
Geert
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Hi Peter,
Quoted 13 lines · Peter Ujfalusi
Quoted 12 lines · Geert Uytterhoeven
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
True.
Quoted 2 lines
Quoted 1 line
Anyone who cares for DMA on SuperH?
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
It may make a few things slower.
I would not drop DMA support but I would suggest to add
dma_slave_mapfor non DT boot so the_compat()can be dropped.
Which is similar in spirit to gpiod_lookup and clk_register_clkdev(), right?
Quoted 2 lines
Imho on lower spec SoC (and I believe SuperH is) the DMA makes big difference offloading data movement from the CPU.
Assumed it is actually used...
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Hi Geert,
Quoted 19 lines · Geert Uytterhoeven
Hi Peter,
Quoted 16 lines · Peter Ujfalusi
Quoted 15 lines · Geert Uytterhoeven
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
True.
Quoted 4 lines
Quoted 1 line
Anyone who cares for DMA on SuperH?
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
It may make a few things slower.
I would not drop DMA support but I would suggest to add
dma_slave_mapfor non DT boot so the_compat()can be dropped.Which is similar in spirit to
gpiod_lookupandclk_register_clkdev(), right?
Yes, it is similar:
/* OMAP730, OMAP850 */
static const struct dma_slave_map omap7xx_sdma_map[] = {
{ "omap-mcbsp.1", "tx", SDMA_FILTER_PARAM(8) },
{ "omap-mcbsp.1", "rx", SDMA_FILTER_PARAM(9) },
{ "omap-mcbsp.2", "tx", SDMA_FILTER_PARAM(10) },
{ "omap-mcbsp.2", "rx", SDMA_FILTER_PARAM(11) },
{ "mmci-omap.0", "tx", SDMA_FILTER_PARAM(21) },
{ "mmci-omap.0", "rx", SDMA_FILTER_PARAM(22) },
{ "omap_udc", "rx0", SDMA_FILTER_PARAM(26) },
{ "omap_udc", "rx1", SDMA_FILTER_PARAM(27) },
{ "omap_udc", "rx2", SDMA_FILTER_PARAM(28) },
{ "omap_udc", "tx0", SDMA_FILTER_PARAM(29) },
{ "omap_udc", "tx1", SDMA_FILTER_PARAM(30) },
{ "omap_udc", "tx2", SDMA_FILTER_PARAM(31) },
};"device name", "channel name", "parameter for filter"
The in the DMA driver (omap-dma.c):
od->ddev.filter.map = od->plat->slave_map; od->ddev.filter.mapcnt = od->plat->slavecnt; od->ddev.filter.fn = omap_dma_filter_fn;
When things are converted the filter function no longer needs to be exported, it is local to the DMA driver.
Quoted 5 lines
Quoted 3 lines
Imho on lower spec SoC (and I believe SuperH is) the DMA makes big difference offloading data movement from the CPU.
Assumed it is actually used...
Right, imho (again) we should not decide if given SoC needs it or not. It is up to the drivers to use it or not, but with the dma_slave_map there is no difference between DT or legacy boot handling towards DMA.
Quoted 4 lines
Gr{oetje,eeting}s,
Geert
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Quoted 48 lines · Peter Ujfalusi
Hi Geert,
Quoted 19 lines · Geert Uytterhoeven
Hi Peter,
Quoted 16 lines · Peter Ujfalusi
Quoted 15 lines · Geert Uytterhoeven
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
True.
Quoted 4 lines
Quoted 1 line
Anyone who cares for DMA on SuperH?
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
It may make a few things slower.
I would not drop DMA support but I would suggest to add
dma_slave_mapfor non DT boot so the_compat()can be dropped.Which is similar in spirit to
gpiod_lookupandclk_register_clkdev(), right?Yes, it is similar:
/* OMAP730, OMAP850 */
static const struct dma_slave_map omap7xx_sdma_map[] = { { "omap-mcbsp.1", "tx", SDMA_FILTER_PARAM(8) }, { "omap-mcbsp.1", "rx", SDMA_FILTER_PARAM(9) }, { "omap-mcbsp.2", "tx", SDMA_FILTER_PARAM(10) }, { "omap-mcbsp.2", "rx", SDMA_FILTER_PARAM(11) }, { "mmci-omap.0", "tx", SDMA_FILTER_PARAM(21) }, { "mmci-omap.0", "rx", SDMA_FILTER_PARAM(22) }, { "omap_udc", "rx0", SDMA_FILTER_PARAM(26) }, { "omap_udc", "rx1", SDMA_FILTER_PARAM(27) }, { "omap_udc", "rx2", SDMA_FILTER_PARAM(28) }, { "omap_udc", "tx0", SDMA_FILTER_PARAM(29) }, { "omap_udc", "tx1", SDMA_FILTER_PARAM(30) }, { "omap_udc", "tx2", SDMA_FILTER_PARAM(31) }, };
Quoted 1 line
"device name", "channel name", "parameter for filter"
fwiw for EDMA on daVinci we have these (for da850):
static const struct dma_slave_map da850_edma0_map[] = {
{ "davinci-mcasp.0", "rx", EDMA_FILTER_PARAM(0, 0) },
{ "davinci-mcasp.0", "tx", EDMA_FILTER_PARAM(0, 1) },
{ "davinci-mcbsp.0", "rx", EDMA_FILTER_PARAM(0, 2) },
{ "davinci-mcbsp.0", "tx", EDMA_FILTER_PARAM(0, 3) },
{ "davinci-mcbsp.1", "rx", EDMA_FILTER_PARAM(0, 4) },
{ "davinci-mcbsp.1", "tx", EDMA_FILTER_PARAM(0, 5) },
{ "spi_davinci.0", "rx", EDMA_FILTER_PARAM(0, 14) },
{ "spi_davinci.0", "tx", EDMA_FILTER_PARAM(0, 15) },
{ "da830-mmc.0", "rx", EDMA_FILTER_PARAM(0, 16) },
{ "da830-mmc.0", "tx", EDMA_FILTER_PARAM(0, 17) },
{ "spi_davinci.1", "rx", EDMA_FILTER_PARAM(0, 18) },
{ "spi_davinci.1", "tx", EDMA_FILTER_PARAM(0, 19) },
};static const struct dma_slave_map da850_edma1_map[] = {
{ "da830-mmc.1", "rx", EDMA_FILTER_PARAM(1, 28) },
{ "da830-mmc.1", "tx", EDMA_FILTER_PARAM(1, 29) },
};and in the DMA driver:
ecc->dma_slave.filter.map = info->slave_map; ecc->dma_slave.filter.mapcnt = info->slavecnt; ecc->dma_slave.filter.fn = edma_filter_fn;
When I added the dma_slave_map support it was done in a way that it could be used by anyone having the same issue as we were facing with legacy daVinci and OMAP1 boards (no DT support in sight).
Drivers do not need to care about legacy/DT boot.
Quoted 21 lines
The in the DMA driver (
omap-dma.c):od->ddev.filter.map = od->plat->slave_map; od->ddev.filter.mapcnt = od->plat->slavecnt; od->ddev.filter.fn = omap_dma_filter_fn;When things are converted the filter function no longer needs to be exported, it is local to the DMA driver.
Quoted 5 lines
Quoted 3 lines
Imho on lower spec SoC (and I believe SuperH is) the DMA makes big difference offloading data movement from the CPU.
Assumed it is actually used...
Right, imho (again) we should not decide if given SoC needs it or not. It is up to the drivers to use it or not, but with the
dma_slave_mapthere is no difference between DT or legacy boot handling towards DMA.Quoted 2 lines
Gr{oetje,eeting}s,
Quoted 8 lines
Quoted 2 lines
Geert
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Quoted 20 lines · Geert Uytterhoeven
Hi Peter,
Quoted 17 lines · Peter Ujfalusi
Quoted 16 lines · Geert Uytterhoeven
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
True.
Quoted 4 lines
Quoted 1 line
Anyone who cares for DMA on SuperH?
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
It may make a few things slower.
The j-core stuff has DMA but we haven't hooked it up to dmaengine yet. (It's on the todo list but pretty far down.)
I fought with dmaengine in a 7760 board in 2018, and got it to run its tests but the ship deadline arrived before I got the ethernet working with it.
I found the documentation fairly impenetrable, is there a good primer on what's _current_ for new implementations? (I had similar questions for gpio. It's easy to google for "here's how you did it in 2010"...)
Quoted 10 lines
Quoted 2 lines
I would not drop DMA support but I would suggest to add
dma_slave_mapfor non DT boot so the_compat()can be dropped.Which is similar in spirit to
gpiod_lookupandclk_register_clkdev(), right?Quoted 2 lines
Imho on lower spec SoC (and I believe SuperH is) the DMA makes big difference offloading data movement from the CPU.
Assumed it is actually used...
The turtle boards need it USB, ethernet, and sdcard, but Rich Felker hasn't finished the j32 port yet (we just got him the updated docs last month) and the existing implementation is nommu so the things that are using it are reaching around behind the OS's back...
Rob
Hi Rob,
Quoted 15 lines · Rob Landley
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Peter Ujfalusi
Quoted 12 lines · Geert Uytterhoeven
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
True.
Quoted 2 lines
Quoted 1 line
Anyone who cares for DMA on SuperH?
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
It may make a few things slower.
The j-core stuff has DMA but we haven't hooked it up to dmaengine yet. (It's on the todo list but pretty far down.)
And would use DT. Hence the issue is not applicable to j-core.
Quoted 4 lines
The turtle boards need it USB, ethernet, and sdcard, but Rich Felker hasn't finished the j32 port yet (we just got him the updated docs last month) and the existing implementation is nommu so the things that are using it are reaching around behind the OS's back...
Is j32 the (rebranded) j4?
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Quoted 13 lines · Geert Uytterhoeven
Hi Rob,
Quoted 10 lines · Rob Landley
Quoted 9 lines · Geert Uytterhoeven
Quoted 8 lines · Peter Ujfalusi
Quoted 7 lines · Geert Uytterhoeven
Quoted 5 lines · John Paul Adrian Glaubitz
Quoted 1 line · Geert Uytterhoeven
Both rspi and sh-msiof have users on legacy SH (i.e. without DT):
FWIW, there is a patch set by Yoshinori Sato to add device tree support for classical SuperH hardware. It was never merged, unfortunately :(.
The problem with converting everything else to j-core has always been regression testing. I have 2 pieces of classing sh4 hardware, and one classing sh2 board, and none of them are currently on the same continent I am. :)
(I've got 3 different j-core boards, though. And am currently in the same room as 2 others. :)
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
True.
Quoted 4 lines
Quoted 1 line
Anyone who cares for DMA on SuperH?
What is DMA used for on SuperH? Wouldn't dropping it cut support for essential hardware features?
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
It may make a few things slower.
The j-core stuff has DMA but we haven't hooked it up to dmaengine yet. (It's on the todo list but pretty far down.)
And would use DT. Hence the issue is not applicable to j-core.
Indeed.
The last classic sh4 board I used did not have DMA hooked up in Linux, and trying to make current kernels work hit the fact that the device tree people kept breaking various pre-device tree APIs, and my patches to fix them were met with "you should convert everything to device tree rather than fix this obvious regression we caused" and thus never went upstream. (Johnson Controls shipped them locally and I handed the patches over to the lawyers to do the license compliance tarball before I left. And of course I posted the fixes to this list...)
It's nice that at least this time somebody is _asking_ before breaking non-device-tree support for stuff that used to work...
Quoted 6 lines
Quoted 4 lines
The turtle boards need it USB, ethernet, and sdcard, but Rich Felker hasn't finished the j32 port yet (we just got him the updated docs last month) and the existing implementation is nommu so the things that are using it are reaching around behind the OS's back...
Is j32 the (rebranded) j4?
Yes.
Rob
Vinod Koul
maintainerQuoted 11 lines · Andy Shevchenko
Quoted 5 lines · Peter Ujfalusi
dma_request_slave_channel_reason()no longer have user in mainline, it can be removed.Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions without taking care of (I'm talking now about dma release callback, for example) end users.
Can you elaborate issue you are seeing with dma_release callback?
Signature · 1 line
~Vinod
Quoted 7 lines · Vinod Koul
Quoted 5 lines · Andy Shevchenko
Quoted 3 lines · Peter Ujfalusi
dma_request_slave_channel_reason()no longer have user in mainline, it can be removed.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions without taking care of (I'm talking now about dma release callback, for example) end users.
Can you elaborate issue you are seeing with
dma_releasecallback?
[ 7.980381] intel-lpss 0000:00:1e.3: WARN: Device release is not
defined so it is not safe to unbind this driver while in use
It's not limited to that driver, but actually all I'm maintaining.
Users are not happy!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Vinod Koul
maintainerQuoted 15 lines · Andy Shevchenko
Quoted 14 lines · Vinod Koul
Quoted 11 lines · Andy Shevchenko
Quoted 5 lines · Peter Ujfalusi
dma_request_slave_channel_reason()no longer have user in mainline, it can be removed.Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions without taking care of (I'm talking now about dma release callback, for example) end users.
Quoted 5 lines
Quoted 1 line
Can you elaborate issue you are seeing with
dma_releasecallback?[ 7.980381] intel-lpss 0000:00:1e.3: WARN: Device release is notdefined so it is not safe to unbind this driver while in use
Yes that is expected but is not valid in your case.
Anyway this will be turned off before the release.
Quoted 7 lines
It's not limited to that driver, but actually all I'm maintaining.
Users are not happy!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Signature · 1 line
~Vinod
Vinod,
Quoted 16 lines · Vinod Koul
Quoted 15 lines · Andy Shevchenko
Quoted 14 lines · Vinod Koul
Quoted 11 lines · Andy Shevchenko
Quoted 5 lines · Peter Ujfalusi
dma_request_slave_channel_reason()no longer have user in mainline, it can be removed.Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions without taking care of (I'm talking now about dma release callback, for example) end users.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Can you elaborate issue you are seeing with
dma_releasecallback?[ 7.980381] intel-lpss 0000:00:1e.3: WARN: Device release is notdefined so it is not safe to unbind this driver while in use
Yes that is expected but is not valid in your case.
In which case it is valid?
Quoted 1 line
Anyway this will be turned off before the release.
Looking at the commit which added it and I still don't get the point. If any of the channel is in use then we should not allow the DMA driver to go away at all.
Imho there should be a function to check if we can proceed with the .remove of the driver and fail it if any of the channels are in use.
Hrm, base/dd.c __device_release_driver() does not check the .remove's return value, so it can not fail.
What is expected if the .remove returns with OK but we still have channels in use?
After the remove all sorts of things got yanked which might makes the still in use channels cause issues down the road.
I'm curious why it is a good thing to remotely try to support unbind when the driver is in use.
It is like one wants to support ext4 removal even when your rootfs is ext4.
I think krefing the DMA driver for channel request/release is just fine, if user wants to break the system we should not assist...
Quoted 8 lines
Quoted 7 lines
It's not limited to that driver, but actually all I'm maintaining.
Users are not happy!
Signature · 2 lines
With Best Regards, Andy Shevchenko
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Vinod Koul
maintainerHi Peter,
Quoted 22 lines · Peter Ujfalusi
Vinod,
Quoted 19 lines · Vinod Koul
Quoted 18 lines · Andy Shevchenko
Quoted 15 lines · Vinod Koul
Quoted 11 lines · Andy Shevchenko
Quoted 5 lines · Peter Ujfalusi
dma_request_slave_channel_reason()no longer have user in mainline, it can be removed.Advise users of
dma_request_slave_channel()anddma_request_slave_channel_compat()to move todma_request_slave_chan()How? There are legacy ARM boards you have to care / remove before. DMAengine subsystem makes a p*s off decisions without taking care of (I'm talking now about dma release callback, for example) end users.
Can you elaborate issue you are seeing with
dma_releasecallback?
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
[ 7.980381] intel-lpss 0000:00:1e.3: WARN: Device release is notdefined so it is not safe to unbind this driver while in use
Yes that is expected but is not valid in your case.
In which case it is valid?
It is valid for cases where device can be hotplugged. We didnt handle that very well earlier. TBH we never had a reason as most of the embedded cases that is not really doable.
Quoted 5 lines
Quoted 1 line
Anyway this will be turned off before the release.
Looking at the commit which added it and I still don't get the point. If any of the channel is in use then we should not allow the DMA driver to go away at all.
Not really, if the device is already gone, we cant do much about it. We have to handle that gracefully rather than oopsing
The important part is that the device is gone. Think about a device on PCI card which is yanked off or a USB device unplugged. Device is already gone, you can't communicate with it anymore. So all we can do is handle the condition and exit, hence the new method to let driver know.
Quoted 32 lines
Imho there should be a function to check if we can proceed with the .remove of the driver and fail it if any of the channels are in use.
Hrm,
base/dd.c__device_release_driver()does not check the .remove's return value, so it can not fail.What is expected if the .remove returns with OK but we still have channels in use?
After the remove all sorts of things got yanked which might makes the still in use channels cause issues down the road.
I'm curious why it is a good thing to remotely try to support unbind when the driver is in use.
It is like one wants to support ext4 removal even when your rootfs is ext4.I think krefing the DMA driver for channel request/release is just fine, if user wants to break the system we should not assist...
Quoted 8 lines
Quoted 7 lines
It's not limited to that driver, but actually all I'm maintaining.
Users are not happy!
Signature · 2 lines
With Best Regards, Andy Shevchenko- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Signature · 1 line
~Vinod
Hi Vinod,
Quoted 6 lines · Vinod Koul
Quoted 3 lines
Looking at the commit which added it and I still don't get the point. If any of the channel is in use then we should not allow the DMA driver to go away at all.
Not really, if the device is already gone, we cant do much about it. We have to handle that gracefully rather than oopsing
Ah, I have not thought about that. True.
Quoted 4 lines
The important part is that the device is gone. Think about a device on PCI card which is yanked off or a USB device unplugged. Device is already gone, you can't communicate with it anymore. So all we can do is handle the condition and exit, hence the new method to let driver know.
But for most devices this is not applicable, I also wondered what should I do in order to silence the print. Just add an empty device_release?
Quoted 28 lines
Quoted 28 lines
Imho there should be a function to check if we can proceed with the .remove of the driver and fail it if any of the channels are in use.
Hrm,
base/dd.c__device_release_driver()does not check the .remove's return value, so it can not fail.What is expected if the .remove returns with OK but we still have channels in use?
After the remove all sorts of things got yanked which might makes the still in use channels cause issues down the road.
I'm curious why it is a good thing to remotely try to support unbind when the driver is in use.
It is like one wants to support ext4 removal even when your rootfs is ext4.I think krefing the DMA driver for channel request/release is just fine, if user wants to break the system we should not assist...
Quoted 8 lines
Quoted 7 lines
It's not limited to that driver, but actually all I'm maintaining.
Users are not happy!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 5 lines
Quoted 4 lines
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Vinod Koul
maintainerQuoted 12 lines · Peter Ujfalusi
Hi Vinod,
Quoted 6 lines · Vinod Koul
Quoted 3 lines
Looking at the commit which added it and I still don't get the point. If any of the channel is in use then we should not allow the DMA driver to go away at all.
Not really, if the device is already gone, we cant do much about it. We have to handle that gracefully rather than oopsing
Ah, I have not thought about that. True.
Quoted 7 lines
Quoted 4 lines
The important part is that the device is gone. Think about a device on PCI card which is yanked off or a USB device unplugged. Device is already gone, you can't communicate with it anymore. So all we can do is handle the condition and exit, hence the new method to let driver know.
But for most devices this is not applicable, I also wondered what should I do in order to silence the print. Just add an empty
device_release?
I will send a patch removing this before we hit release :) so nothing to be done unless you have a hotpluggable device then would be good to add this.
Thanks
Signature · 1 line
~Vinod