This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

edma engine, kernel 3.17.0 on am1808

Other Parts Discussed in Thread: OMAPL138, AM1808

Hi all,

this issue could be connected , or the primary cause of another issue i posted about mmc/ext4 errors on kernel 3.17.

Moving from 3.5.1 to this recent kernel, on boot i see:

davinci_mmc da830-mmc.1: Runtime PM disabled, clock forced on.
davinci_mmc da830-mmc.1: Runtime PM disabled, clock forced on.
davinci_mmc da830-mmc.1: Runtime PM disabled, clock forced on.
davinci_mmc da830-mmc.1: Can't get dma_tx channel

This make me think that mmc host driver is non functioning properly, since in older kernel it was using DMA channels for tx and rx.

So i realized that in this new kernel, the menuconfig

Driver, DMA Engine [*] -> and TI EDMA  must be enabled

Once done this, still the mmc host cannot get the dma channels, it calls

host->dma_tx =
		dma_request_slave_channel_compat(mask, edma_filter_fn,
				&host->txdma, mmc_dev(host->mmc), "tx");

but the filter function always returns "fasle".

Hope someone can help in the usage of this new edma engine.

Regards

 

  • Hi Angelo,

    Could you attach your complete bootup log.

    I'm able to enable MMC0 support in Linux 3.17 on OMAPL138 LCDK board.

    How about MMC0 on your board ?

    Attached linux bootup log OMAPL138 LCDK board.

    6175.Linux-3.17-log.txt
    NAND:  512 MiB
    MMC:   davinci: 0
    Bad block table found at page 262080, version 0x01
    Bad block table found at page 262016, version 0x01
    In:    serial
    Out:   serial
    Err:   serial
    ARM Clock : 300000000 Hz
    DDR Clock : 150000000 Hz
    Net:   Ethernet PHY: GENERIC @ 0x07
    DaVinci-EMAC
    Hit any key to stop autoboot:  0 
    U-Boot > 
    U-Boot > boort
    Unknown command 'boort' - try 'help'
    U-Boot > <INTERRUPT>
    U-Boot > boot
    Using DaVinci-EMAC device
    TFTP from server 10.100.1.94; our IP address is 10.100.1.15
    Filename 'uImage'.
    Load address: 0xc0700000
    Loading: #################################################################
             #################################################################
             ###########################################################
    done
    Bytes transferred = 2761344 (2a2280 hex)
    ## Booting kernel from Legacy Image at c0700000 ...
       Image Name:   Linux-3.17.1
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2761280 Bytes = 2.6 MiB
       Load Address: c0008000
       Entry Point:  c0008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK
    
    Starting kernel ...
    
    Uncompressing Linux... done, booting the kernel.
    Booting Linux on physical CPU 0x0
    Linux version 3.17.1 (titus@Titus) (gcc version 4.3.3 (GCC) ) #22 PREEMPT Tue Nov 18 15:35:07 IST 2014
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
    CPU: VIVT data cache, VIVT instruction cache
    Machine: AM18x/OMAP-L138 Hawkboard
    Memory policy: Data cache writethrough
    DaVinci da850/omap-l138/am18x variant 0x1
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
    Kernel command line: mem=32M console=/dev/ttyS2,115200 ip=dhcp nfsroot=10.100.1.94:/usr/local/filesystem_omapl138 root=/dev/nfs rw ro
    otwait
    PID hash table entries: 128 (order: -3, 512 bytes)
    Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
    Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
    Memory: 26760K/32768K available (3882K kernel code, 232K rwdata, 1180K rodata, 175K init, 179K bss, 6008K reserved)
    Virtual kernel memory layout:
        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap  : 0xffc00000 - 0xffe00000   (2048 kB)
        vmalloc : 0xc2800000 - 0xff000000   ( 968 MB)
        lowmem  : 0xc0000000 - 0xc2000000   (  32 MB)
        modules : 0xbf000000 - 0xc0000000   (  16 MB)
          .text : 0xc0008000 - 0xc04f9f34   (5064 kB)
          .init : 0xc04fa000 - 0xc0525ff4   ( 176 kB)
          .data : 0xc0526000 - 0xc0560360   ( 233 kB)
           .bss : 0xc0560360 - 0xc058d118   ( 180 kB)
    SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    Preemptible hierarchical RCU implementation.
    NR_IRQS:245
    sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
    Console: colour dummy device 80x30
    Calibrating delay loop... 148.88 BogoMIPS (lpj=744448)
    pid_max: default: 32768 minimum: 301
    Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    CPU: Testing write buffer coherency: ok
    Setting up static identity map for 0xc03d0c00 - 0xc03d0c58
    devtmpfs: initialized
    regulator-dummy: no parameters
    NET: Registered protocol family 16
    DMA: preallocated 256 KiB pool for atomic coherent allocations
    cpuidle: using governor ladder
    cpuidle: using governor menu
    EMAC: MII PHY configured
    MUX: initialized GPIO3_12
    MUX: initialized GPIO3_13
    MUX: initialized GPIO2_4
    MUX: initialized GPIO6_13
    edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver
    edma-dma-engine edma-dma-engine.1: TI EDMA DMA engine driver
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    Advanced Linux Sound Architecture Driver Initialized.
    Switched to clocksource timer0_1
    NET: Registered protocol family 2
    TCP established hash table entries: 1024 (order: 0, 4096 bytes)
    TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
    TCP: Hash tables configured (established 1024 bind 1024)
    TCP: reno registered
    UDP hash table entries: 256 (order: 0, 4096 bytes)
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    NET: Registered protocol family 1
    RPC: Registered named UNIX socket transport module.
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    futex hash table entries: 256 (order: -1, 3072 bytes)
    msgmni has been set to 52
    io scheduler noop registered (default)
    Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO 0x1c42000 (irq = 25, base_baud = 9375000) is a 16550A
    serial8250.1: ttyS1 at MMIO 0x1d0c000 (irq = 53, base_baud = 9375000) is a 16550A
    console [ttyS2] disabled
    serial8250.2: ttyS2 at MMIO 0x1d0d000 (irq = 61, base_baud = 9375000) is a 16550A
    console [ttyS2] enabled
    brd: module loaded
    davinci_mdio davinci_mdio.0: davinci mdio revision 1.5
    davinci_mdio davinci_mdio.0: detected phy mask ffffff7f
    libphy: davinci_mdio.0: probed
    davinci_mdio davinci_mdio.0: phy[7]: device davinci_mdio-0:07, driver unknown
    ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    ohci ohci.0: DA8xx OHCI
    ohci ohci.0: new USB bus registered, assigned bus number 1
    Waiting for USB PHY clock good...
    ohci ohci.0: irq 59, io mem 0x01e25000
    usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb1: Product: DA8xx OHCI
    usb usb1: Manufacturer: Linux 3.17.1 ohci_hcd
    usb usb1: SerialNumber: ohci.0
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    usbcore: registered new interface driver cdc_acm
    cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    usbcore: registered new interface driver usb-storage
    usbcore: registered new interface driver usbserial
    Waiting for USB PHY clock good...
    musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
    musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 2
    usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb2: Product: MUSB HDRC host driver
    usb usb2: Manufacturer: Linux 3.17.1 musb-hcd
    usb usb2: SerialNumber: musb-hdrc.1.auto
    hub 2-0:1.0: USB hub found
    hub 2-0:1.0: 1 port detected
    i2c /dev entries driver
    sdhci: Secure Digital Host Controller Interface driver
    sdhci: Copyright(c) Pierre Ossman
    mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
    davinci_mmc da830-mmc.0: Using DMA, 4-bit mode
    TCP: cubic registered
    NET: Registered protocol family 17
    console [netcon0] enabled
    netconsole: network logging started
    davinci_emac davinci_emac.1: using random MAC addr: 42:21:a4:13:52:48
    mmc0: new high speed SDHC card at address 0007
    drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
    mmcblk0: mmc0:0007 SD8GB 7.42 GiB (ro)
    davinci_mdio davinci_mdio.0: resetting idled controller
     mmcblk0: p1 p2 p3
    net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=davinci_mdio-0:07, id=7c0f1)
    davinci_emac davinci_emac.1 eth0: Link is Up - 100Mbps/Full - flow control rx/tx
    Sending DHCP requests ., OK
    IP-Config: Got DHCP answer from 10.100.1.1, my address is 10.100.1.18
    IP-Config: Complete:
         device=eth0, hwaddr=42:21:a4:13:52:48, ipaddr=10.100.1.18, mask=255.255.255.0, gw=10.100.1.1
         host=10.100.1.18, domain=lnties.com, nis-domain=(none)
         bootserver=0.0.0.0, rootserver=10.100.1.94, rootpath=
         nameserver0=10.9.48.31, nameserver1=10.20.28.5
    ALSA device list:
      No soundcards found.
    VFS: Mounted root (nfs filesystem) on device 0:14.
    devtmpfs: mounted
    Freeing unused kernel memory: 172K (c04fa000 - c0525000)
    INIT: version 2.88 booting
    Error opening /dev/fb0: No such file or directory
    Starting udev
    udev[1054]: starting version 164
    davinci-wdt davinci-wdt: heartbeat 60 sec
    EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
    kjournald starting.  Commit interval 5 seconds
    EXT3-fs (mmcblk0p3): mounted filesystem with ordered data mode
    kjournald starting.  Commit interval 5 seconds
    random: nonblocking pool is initialized
    Starting Bootlog daemon: NET: Registered protocol family 10
    
    

  • Hi Titusrathinaraj,


    many thanks for the hints.

    I have found the reason why dma is not working properly. The reason is that i added some hacks to my custom board.c to be able to boot the kernel in the old-way (without device tree blob), but this create a broken situation later, that is mainly the source of all my issues.

    So i am rolling back to a clean situation, i would like to proceed in the correct way.

    You said you are able to boot kernel 3.17, but, for what board ? Are you passing to the kernel a dt blob ? If not, how did you set up the kernel to boot without DT (old-way) ?

    Many thanks

    angelo

  • Hi Angelo,

    You said you are able to boot kernel 3.17, but, for what board ? Are you passing to the kernel a dt blob ? If not, how did you set up the kernel to boot without DT (old-way) ?

    I haven't enabled DT support and continued with old method.

    I have tested it with OMAPL138 LCDK board which is same as AM1808/OMAPL137.

    http://processors.wiki.ti.com/index.php/L138/C6748_Development_Kit_%28LCDK%29

  • Dear Titus,

    many thanks.

    I am on the right path to solve the issues i have. I have a last question.

    What is the proper way to boot without DT blobs ? I couldn't find detailed info for this, so i added a small hack to set machine type and skip dt blob check.

    Seems i cannot disable DT blob check in menuconfig, FDT is forced selected:

        -*- Flattened Device Tree support
          [*]   Support for the traditional ATAGS boot data passing

    Many thanks

    angelo

  • Hi Angelo,

    I'm in out of office now.

    I will send you the .config and steps tomorrow for that.

    Check the "depends" options for DT support in menuconfig.

    Also check the "help" messages in menuconfig for "Flattened device tree support"

  • Hi Angelo,

    8420.config_linux3.17.1.txt

    I'm also enabled the same device tree options for OMAPL138 LCDK board and never faced any boot issues and we can't disable since it is selected by all the architecture (Ex: Davinci, OMAP etc).

    It will get selected automatically when you enable "ARCH" type and can't disable it.

    If you want to disable, you can remove the "DAVINCI" arch name from the list in option "Selected by"

  • Many thanks, perfect,

     i cannot actually boot if i don't set

     __machine_arch_type = 2158;

    in arch/arm/kernel/setup.c, but this could be also u-boot related. For now i can boot correctly.

    Will investigate why and report back,

    Last issue i have open now is that dma for MMC/SD cards still have some issues, seems mmc host cannot get a "slot" for the channel, and i get this error at boot:

    dma-dma-engine edma-dma-engine.1: 
     pset[3]:
      chnum	65564
      slot	65659
      opt	0011c004
      src	01e1b028
      dst	c7249000
      abcnt	00080004
      ccnt	00000080
      bidx	00040000
      cidx	00200000
      lkrld	ffffffff
    edma-dma-engine edma-dma-engine.1: first transfer starting on channel 65564
    edma-dma-engine edma-dma-engine.1: vchan c797bac0: txd c70cd980[ac]: submitted
    edma-dma-engine edma-dma-engine.1: 
     pset[0]:
      chnum	65564
      slot	65564
      opt	0011c004
      src	01e1b028
      dst	c7239000
      abcnt	00080004
      ccnt	00000080
      bidx	00040000
      cidx	00200000
      lkrld	ffffffff
    edma-dma-engine edma-dma-engine.1: first transfer starting on channel 65564
    edma-dma-engine edma-dma-engine.1: edma_prep_slave_sg: Failed to allocate slot
    

    I have actually selected the driver -> DMA -> TI EDMA support.

    Regards

  • Well, once replace the SD card seems i could access and write it correctly. But at next boot, i get the same error.

    edma-dma-engine edma-dma-engine.1: edma_prep_slave_sg: Failed to allocate slot

    It seems to me i am accessing the mmc/sd in a wrong way, since also without DMA (PIO mode) i was someway briking / screwing the SD card.

     

    Could you maybe post the 3.17 options for MMC/SD and DMA drivers ? thanks

  • Dear Titus,

    some updates:

    - wherever i enable DMA or not, mmc access has issues.

    - on kernel 3.5.1, if i do mkfs.ext3 /dev/mmcblk0p1, format succed, and a next fsck.ext3 /dev/mmcblk0p1 gives a clean fs.

    - on kernel 3.17.0, if i do mkfs.ext3 /dev/mmcblk0p1, format succed, and a next fsck.ext3 /dev/mmcblk0p1 gives several errors.

    - both fdisk and card detection, shows same size and geometry in both 3.5.1 and 3.17.0

    - but on mkfs.ext3 output i see some differences on inodes number, 3.5.1 shows a bit more of a double inode count.

    kernel 3.5.1
    
    [root@barix ~]# mkfs.ext3 /dev/mmcblk0p1 
    mke2fs 1.42.4 (12-June-2012)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Stride=0 blocks, Stripe width=0 blocks
    488640 inodes, 1952881 blocks
    97644 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=2000683008
    60 block groups
    32768 blocks per group, 32768 fragments per group
    8144 inodes per group
    Superblock backups stored on blocks: 
    	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
    
    Allocating group tables: done                            
    Writing inode tables: done                            
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done 
    
    kernel 3.17.0
    
    [root@barix ~]# mkfs.ext3 /dev/mmcblk0p1 
    mke2fs 1.42.4 (12-June-2012)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Stride=0 blocks, Stripe width=0 blocks
    240000 inodes, 959232 blocks
    47961 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=985661440
    30 block groups
    32768 blocks per group, 32768 fragments per group
    8000 inodes per group
    Superblock backups stored on blocks: 
    	32768, 98304, 163840, 229376, 294912, 819200, 884736
    
    Allocating group tables: done                            
    Writing inode tables: done                            
    Creating journal (16384 blocks): done
    Writing superblocks and filesystem accounting information: done 

    Still investigating.

    Regards

  • Dear Titus and all,

    i finally could close all my mmc R/W error issues. I post here the text of the mail i sent to the linux-mmc mailing list.

    Finally, the issue was connected to the new DMA / TI EDMA engine, but related mainly to my board.c.

    Hi,
    
    i fixed my mmc r/w issues.
    
    In PIO 4-bit mode the davinci mmc host driver passed all the
    mmc_test driver tests. But for some reason, in kernel 3.17,
    i still have issues when i "fsck" just after the mkfs.
    I still see errors.
    
    So i moved back to DMA 4-bit mode (DMA/TI EDMA engine enabled),
    as my board was working in kernel 3.5.1.
    
    In DMA mode, there was some conditions where the mmc access
    was blocking. This was due to the fact that the davinci mmc
    host driver was not able to get all the edma chan slots needed
    for the r/w operations. This because my board.c was reserving
    several chans / slots for the audio.
    
    I reduced those reservations, and all is fine.
    
    Regards
    Angelo 

    Well, if some da830 / 850 based board using audio have similar issues, check the dma chan slot reservation into board.c.

    Many thanks to Titus and all , and for the high valuable support from TI.

    Regards,

    angelo

  • Hi Angelo,

    Sounds good.

    Thanks for your update and your solutions too.