omap_hsmmc DT DMA Client support
Subsystems (3)
cover omap_hsmmc DT DMA Client support
This series adds DT DMA Engine Client support to the omap_hsmmc. It leverages the generic DMA OF helpers in -next and the dma_request_slave_channel_compat() wrapper introduced in the AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.
These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific omap_hsmmc changes.
The series depends on the following patches:
- dmaengine DT support and edma dmaengine driver fix from the git://git.infradead.org/users/vkoul/slave-dma.git next branch
- dma_request_slave_channel_compat() support
https://patchwork.kernel.org/patch/2081671/
The series with all dependencies can be found at
https://github.com/ohporter/linux/tree/omap-hsmmc-dt-dmaengine-v1
Matt Porter (2):
mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()
mmc: omap_hsmmc: add generic DMA request support to the DT binding
Santosh Shilimkar (1):
mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case
.../devicetree/bindings/mmc/ti-omap-hsmmc.txt | 26 +++++++++++++- drivers/mmc/host/omap_hsmmc.c | 38 ++++++++++++-------- 2 files changed, 48 insertions(+), 16 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 2/3 mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case
From: Santosh Shilimkar <[email protected]>
MMC driver probe will abort for DT case because of failed platform_get_resource_byname() lookup. Fix it by skipping resource byname lookup for device tree build.
Issue is hidden because hwmod popullates the IO resources which helps to succeed platform_get_resource_byname() and probe.
--- drivers/mmc/host/omap_hsmmc.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/mmc/host/omap_hsmmc.c +15 -13
@@ -1896,21 +1896,23 @@ static int omap_hsmmc_probe(struct platform_device *pdev)omap_hsmmc_conf_bus_power (host); - res =platform_get_resource_byname (pdev,IORESOURCE_DMA ,"tx" ); -if (!res) { -dev_err (mmc_dev (host->mmc),"cannot get DMA TX channel\n" ); - ret = -ENXIO ; - goto err_irq; - } - tx_req = res->start; +if (!pdev->dev.of_node) { + res =platform_get_resource_byname (pdev,IORESOURCE_DMA ,"tx" ); +if (!res) { +dev_err (mmc_dev (host->mmc),"cannot get DMA TX channel\n" ); + ret = -ENXIO ; + goto err_irq; + } + tx_req = res->start; - res =platform_get_resource_byname (pdev,IORESOURCE_DMA ,"rx" ); -if (!res) { -dev_err (mmc_dev (host->mmc),"cannot get DMA RX channel\n" ); - ret = -ENXIO ; - goto err_irq; + res =platform_get_resource_byname (pdev,IORESOURCE_DMA ,"rx" ); +if (!res) { +dev_err (mmc_dev (host->mmc),"cannot get DMA RX channel\n" ); + ret = -ENXIO ; + goto err_irq; + } + rx_req = res->start; } - rx_req = res->start;dma_cap_zero (mask);dma_cap_set (DMA_SLAVE , mask);
Signature · 1 line
1.7.9.5
PATCH 3/3 mmc: omap_hsmmc: add generic DMA request support to the DT binding
In reply to Matt PorterThe binding definition is based on the generic DMA request binding.
--- .../devicetree/bindings/mmc/ti-omap-hsmmc.txt | 26 +++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt +25 -1
@@ -20,8 +20,29 @@ ti,dual-volt: boolean, supports dual voltage cards ti,non-removable: non-removable slot (like eMMC) ti,needs-special-reset: Requires a special softreset sequence ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed +dmas: List of DMA specifiers with the controller specific format +as described in the generic DMA client binding. A tx and rx +specifier is required. +dma-names: List of DMA request names. These strings correspond +1:1 with the DMA specifiers listed in dmas. The string naming is +to be "rx" and "tx" for RX and TX DMA requests, respectively. + +Examples: + +[hwmod populated DMA resources] + + mmc1: mmc@0x4809c000 { + compatible = "ti,omap4-hsmmc"; + reg = <0x4809c000 0x400>; + ti,hwmods = "mmc1"; + ti,dual-volt; + bus-width = <4>; + vmmc-supply = <&vmmc>; /* phandle to regulator node */ + ti,non-removable; + }; + +[generic DMA request binding] -Example: mmc1: mmc@0x4809c000 { compatible = "ti,omap4-hsmmc"; reg = <0x4809c000 0x400>;
@@ -30,4 +51,7 @@ Example: bus-width = <4>; vmmc-supply = <&vmmc>; /* phandle to regulator node */ ti,non-removable; + dmas = <&edma 24 + &edma 25>; + dma-names = "tx", "rx"; };
Signature · 1 line
1.7.9.5
PATCH 1/3 mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()
In reply to Matt PorterConvert dmaengine channel requests to use dma_request_slave_channel_compat(). This supports platforms booting with or without DT populated.
--- drivers/mmc/host/omap_hsmmc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/mmc/host/omap_hsmmc.c +8 -2
@@ -1915,14 +1915,20 @@ static int omap_hsmmc_probe(struct platform_device *pdev)dma_cap_zero (mask);dma_cap_set (DMA_SLAVE , mask); - host->rx_chan =dma_request_channel (mask, omap_dma_filter_fn, &rx_req); + host->rx_chan = +dma_request_slave_channel_compat (mask, omap_dma_filter_fn, + &rx_req, &pdev->dev,"rx" ); +if (!host->rx_chan) {dev_err (mmc_dev (host->mmc),"unable to obtain RX DMA engine channel %u\n" , rx_req); ret = -ENXIO ; goto err_irq; } - host->tx_chan =dma_request_channel (mask, omap_dma_filter_fn, &tx_req); + host->tx_chan = +dma_request_slave_channel_compat (mask, omap_dma_filter_fn, + &tx_req, &pdev->dev,"tx" ); +if (!host->tx_chan) {dev_err (mmc_dev (host->mmc),"unable to obtain TX DMA engine channel %u\n" , tx_req); ret = -ENXIO ;
Signature · 1 line
1.7.9.5
Re: [PATCH 1/3] mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()
Quoted 7 lines · Matt Porter
Convert dmaengine channel requests to use
dma_request_slave_channel_compat(). This supports platforms booting with or without DT populated.Signed-off-by Matt Porter <[email protected]>Acked-by Tony Lindgren <[email protected]>---
Re: [PATCH 3/3] mmc: omap_hsmmc: add generic DMA request support to the DT binding
In reply to Matt PorterQuoted 5 lines · Matt Porter
The binding definition is based on the generic DMA request binding.
Signed-off-by Matt Porter <[email protected]>Acked-by Tony Lindgren <[email protected]>---
Hi Matt!
At first thanks for you efforts on DMA Engine on AM33XX.
Quoted 11 lines · Matt Porter
This series adds DT DMA Engine Client support to the
omap_hsmmc. It leverages the generic DMA OF helpers in -next and thedma_request_slave_channel_compat()wrapper introduced in the AM33XX DMA Engine series to support DMA inomap_hsmmcon platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific
omap_hsmmcchanges.The series depends on the following patches:
Quoted 8 lines
- dmaengine DT support and edma dmaengine driver fix from the
git://git.infradead.org/users/vkoul/slave-dma.gitnext branch
-dma_request_slave_channel_compat()support
https://patchwork.kernel.org/patch/2081671/The series with all dependencies can be found at
https://github.com/ohporter/linux/tree/omap-hsmmc-dt-dmaengine-v1
I cloned your github repository and did short testing with it. I get the following error when the kernel mounts my sd-card:
Starting udev
[ 5.884738] udevd[72]: starting version 182 [ 8.879651] edma-dma-engine edma-dma-engine.0: Exceeded max SG segments 33
Quoted 1 line
16
[ 8.887377] omap_hsmmc mmc.3: prep_slave_sg() failed [ 8.892588] omap_hsmmc mmc.3: MMC start dma failure [ 8.897725] mmcblk0: unknown error -1 sending read/write command, card status 0x900 [ 8.905889] end_request: I/O error, dev mmcblk0, sector 17039 [ 8.911926] end_request: I/O error, dev mmcblk0, sector 17047 [ 8.917934] end_request: I/O error, dev mmcblk0, sector 17055 [ 8.923960] end_request: I/O error, dev mmcblk0, sector 17063 [ 8.929967] end_request: I/O error, dev mmcblk0, sector 17071 [ 8.935988] end_request: I/O error, dev mmcblk0, sector 17079 [ 8.942010] end_request: I/O error, dev mmcblk0, sector 17087 [ 8.948016] end_request: I/O error, dev mmcblk0, sector 17095 [ 8.954037] end_request: I/O error, dev mmcblk0, sector 17103 [ 8.960043] end_request: I/O error, dev mmcblk0, sector 17111 [ 9.020919] EXT4-fs error (device mmcblk0p2): __ext4_get_inode_loc:3764: inode #8: block 239: comm mount: unable to read itable block [ 9.033514] EXT4-fs (mmcblk0p2): no journal found [ 9.043799] kjournald starting. Commit interval 5 seconds [ 9.049589] EXT3-fs (mmcblk0p2): warning: mounting fs with errors, running e2fsck is recommended [ 9.060940] EXT3-fs (mmcblk0p2): using internal journal [ 9.066437] EXT3-fs (mmcblk0p2): recovery complete [ 9.071460] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
After that the filesystem on the sd-card has an error that I have to fix with e2fsck. As rootfs I use a nfsroot.
In my quick tests, same setup, I don't get any error on edma-dmaengine- am33xx-v5 branch of your repository.
If you need any further information, let me now.
Regards,
Lars
Quoted 25 lines · Lars Poeschel
Hi Matt!
At first thanks for you efforts on DMA Engine on AM33XX.
Quoted 11 lines · Matt Porter
This series adds DT DMA Engine Client support to the
omap_hsmmc. It leverages the generic DMA OF helpers in -next and thedma_request_slave_channel_compat()wrapper introduced in the AM33XX DMA Engine series to support DMA inomap_hsmmcon platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific
omap_hsmmcchanges.The series depends on the following patches:
Quoted 8 lines
- dmaengine DT support and edma dmaengine driver fix from the
git://git.infradead.org/users/vkoul/slave-dma.gitnext branch
-dma_request_slave_channel_compat()support
https://patchwork.kernel.org/patch/2081671/The series with all dependencies can be found at
https://github.com/ohporter/linux/tree/omap-hsmmc-dt-dmaengine-v1
Quoted 6 lines
I cloned your github repository and did short testing with it. I get the following error when the kernel mounts my sd-card:
Starting udev
[ 5.884738] udevd[72]: starting version 182 [ 8.879651] edma-dma-engine edma-dma-engine.0: Exceeded max SG segments 33
Hi Lars,
I left it somewhat ambiguous as to what this series claims to support, sorry about that. This series, by itself, supports only platforms using SDMA (omap 2/3/4/5 assuming you add the appropriate DMA dts bits). This is only part of what am33xx requires for working mmc support. I've also posted v3 of dmaengine slave sg caps series at
https://lkml.org/lkml/2013/2/4/561
I have to rebase the am33xx specific bits for omap_hsmmc on top of that and post. That was previously all contained in one series but I didn't want to block omap2/3/4/5 from working DMA on DT support until the api change is resolved for am33xx.
-Matt
Quoted 36 lines
[ 8.887377] omap_hsmmc mmc.3: prep_slave_sg() failed [ 8.892588] omap_hsmmc mmc.3: MMC start dma failure [ 8.897725] mmcblk0: unknown error -1 sending read/write command, card status 0x900 [ 8.905889] end_request: I/O error, dev mmcblk0, sector 17039 [ 8.911926] end_request: I/O error, dev mmcblk0, sector 17047 [ 8.917934] end_request: I/O error, dev mmcblk0, sector 17055 [ 8.923960] end_request: I/O error, dev mmcblk0, sector 17063 [ 8.929967] end_request: I/O error, dev mmcblk0, sector 17071 [ 8.935988] end_request: I/O error, dev mmcblk0, sector 17079 [ 8.942010] end_request: I/O error, dev mmcblk0, sector 17087 [ 8.948016] end_request: I/O error, dev mmcblk0, sector 17095 [ 8.954037] end_request: I/O error, dev mmcblk0, sector 17103 [ 8.960043] end_request: I/O error, dev mmcblk0, sector 17111 [ 9.020919] EXT4-fs error (device mmcblk0p2): __ext4_get_inode_loc:3764: inode #8: block 239: comm mount: unable to read itable block [ 9.033514] EXT4-fs (mmcblk0p2): no journal found [ 9.043799] kjournald starting. Commit interval 5 seconds [ 9.049589] EXT3-fs (mmcblk0p2): warning: mounting fs with errors, running e2fsck is recommended [ 9.060940] EXT3-fs (mmcblk0p2): using internal journal [ 9.066437] EXT3-fs (mmcblk0p2): recovery complete [ 9.071460] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data modeAfter that the filesystem on the sd-card has an error that I have to fix with e2fsck. As rootfs I use a nfsroot.
In my quick tests, same setup, I don't get any error on edma-dmaengine- am33xx-v5 branch of your repository.
If you need any further information, let me now.Regards,
Lars
_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss
Quoted 12 lines · Matt Porter
This series adds DT DMA Engine Client support to the
omap_hsmmc. It leverages the generic DMA OF helpers in -next and thedma_request_slave_channel_compat()wrapper introduced in the AM33XX DMA Engine series to support DMA inomap_hsmmcon platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific
omap_hsmmcchanges.The series depends on the following patches:
Quoted 8 lines
- dmaengine DT support and edma dmaengine driver fix from the
git://git.infradead.org/users/vkoul/slave-dma.gitnext branch
-dma_request_slave_channel_compat()support
https://patchwork.kernel.org/patch/2081671/The series with all dependencies can be found at
https://github.com/ohporter/linux/tree/omap-hsmmc-dt-dmaengine-v1
Nice series,
Hi Matt,
Quoted 8 lines · Matt Porter
This series adds DT DMA Engine Client support to the
omap_hsmmc. It leverages the generic DMA OF helpers in -next and thedma_request_slave_channel_compat()wrapper introduced in the AM33XX DMA Engine series to support DMA inomap_hsmmcon platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific
omap_hsmmcchanges.
Thanks, pushed to mmc-next for 3.9.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child