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.

DSPLINK_DPC_0,1,2,3

Other Parts Discussed in Thread: OMAP-L138

In out project we use C6Run to interface the ARM and DSP. If the ARM side ends unexpectedly, C6Run orphans 4 processes DSPLINK_DPC_0, DSPLINK_DPC_1, DSPLINK_DPC_2, DSPLINK_DPC_3. Is there anyway to ensure that these get cleaned up properly or to clean them up after an error?

  • Harry,

    We have recently added terminate support to DSPLink which would clean up the dpc threads. We plan on releasing this by end of month, but I can post a patch for you tomorrow. It would be great if you were able to test the patch. The patch would be based on DSPLink 1.65.01.06, you would need to be on this release in order to use the patch. I have a few questions.

    What device are you on?

    What version of Linux?

    Would you post a process list before and after the application termiantes (ps -eLo pid,ppid,cls,rtprio,pri,time,cmd).

    When the application terminates, what do you want to do with the dsp? I'm guessing you would want DSPLink to place the dsp into reset. Is this correct?

    ~Ramsey

  • OMAP-L138

    linux version: 2.6.33-rc4

    root@vipturbo:~# ps
    PID USER VSZ STAT COMMAND
    1 root 1652 S init [5]
    2 root 0 SW [kthreadd]
    3 root 0 SW [ksoftirqd/0]
    4 root 0 SW [events/0]
    5 root 0 SW [khelper]
    9 root 0 SW [async/mgr]
    215 root 0 SW [sync_supers]
    217 root 0 SW [bdi-default]
    219 root 0 SW [kblockd/0]
    227 root 0 SW [ata/0]
    228 root 0 SW [ata_aux]
    233 root 0 SW [ksuspend_usbd]
    237 root 0 SW [khubd]
    240 root 0 SW [kseriod]
    251 root 0 SW [kmmcd]
    257 root 0 SW [bluetooth]
    272 root 0 SW [rpciod/0]
    284 root 0 SW [kswapd0]
    331 root 0 SW [aio/0]
    340 root 0 SW [nfsiod]
    455 root 0 SW [scsi_eh_0]
    461 root 0 SW [mtdblockd]
    463 root 0 SW [spi_davinci.1]
    517 root 0 SW [kondemand/0]
    518 root 0 SW [kconservative/0]
    530 root 0 SW [usbhid_resumer]
    546 root 0 SW< [krfcommd]
    559 root 0 SW [mmcqd]
    563 root 0 SW [kjournald]
    606 root 1900 S < /sbin/udevd -d
    992 root 1632 S /home/root/hdled/hdled
    1005 root 1496 S /home/root/power/powerdtask
    1041 root 18148 S /home/root/hpasplitter/hpasplitter
    1046 root 2884 S /bin/sh /home/root/hpasplitter/hpagpsquery.sh
    1049 nobody 5100 S < /sbin/gpsd -b -n /dev/vgps
    1051 root 3252 S /bin/ntpd -g
    1074 root 2400 S /sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
    1076 root 7588 S /bin/php-cgi -c /etc/php/php.ini -b 127.0.0.1:7123
    1079 messageb 2380 S /usr/bin/dbus-daemon --system
    1088 root 7588 S /bin/php-cgi -c /etc/php/php.ini -b 127.0.0.1:7123
    1091 root 2184 S /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host_key -p 22
    1096 root 2880 S /usr/sbin/telnetd
    1101 root 2944 S /sbin/syslogd -n -C64 -m 20
    1103 root 2880 S /sbin/klogd -n
    1124 root 1912 S /sbin/getty 115200 ttyS2
    1125 root 1912 S /sbin/getty 38400 tty1
    2542 root 2372 S /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host_key -p 22
    2544 root 3072 S -sh
    6244 root 0 SW [flush-179:0]
    6632 root 107m S ./dspApp
    6633 root 0 SW< [DSPLINK_DPC_0]
    6634 root 0 SW< [DSPLINK_DPC_1]
    6635 root 0 SW< [DSPLINK_DPC_2]
    6637 root 0 SW< [DSPLINK_DPC_3]
    6656 root 2372 S /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host_key -p 22
    6658 root 3072 S -sh
    6732 root 2748 S sleep 1
    6733 root 3072 R ps

    /*After******************************************/

    root@vipturbo:~/444# ps
    PID USER VSZ STAT COMMAND
    1 root 1652 S init [5]
    2 root 0 SW [kthreadd]
    3 root 0 SW [ksoftirqd/0]
    4 root 0 SW [events/0]
    5 root 0 SW [khelper]
    9 root 0 SW [async/mgr]
    215 root 0 SW [sync_supers]
    217 root 0 SW [bdi-default]
    219 root 0 SW [kblockd/0]
    227 root 0 SW [ata/0]
    228 root 0 SW [ata_aux]
    233 root 0 SW [ksuspend_usbd]
    237 root 0 SW [khubd]
    240 root 0 SW [kseriod]
    251 root 0 SW [kmmcd]
    257 root 0 SW [bluetooth]
    272 root 0 SW [rpciod/0]
    284 root 0 SW [kswapd0]
    331 root 0 SW [aio/0]
    340 root 0 SW [nfsiod]
    455 root 0 SW [scsi_eh_0]
    461 root 0 SW [mtdblockd]
    463 root 0 SW [spi_davinci.1]
    517 root 0 SW [kondemand/0]
    518 root 0 SW [kconservative/0]
    530 root 0 SW [usbhid_resumer]
    546 root 0 SW< [krfcommd]
    559 root 0 SW [mmcqd]
    563 root 0 SW [kjournald]
    606 root 1900 S < /sbin/udevd -d
    992 root 1632 S /home/root/hdled/hdled
    1005 root 1496 S /home/root/power/powerdtask
    1041 root 18148 S /home/root/hpasplitter/hpasplitter
    1046 root 2884 S /bin/sh /home/root/hpasplitter/hpagpsquery.sh
    1049 nobody 5100 S < /sbin/gpsd -b -n /dev/vgps
    1051 root 3252 S /bin/ntpd -g
    1074 root 2400 S /sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
    1076 root 7588 S /bin/php-cgi -c /etc/php/php.ini -b 127.0.0.1:7123
    1079 messageb 2380 S /usr/bin/dbus-daemon --system
    1088 root 7588 S /bin/php-cgi -c /etc/php/php.ini -b 127.0.0.1:7123
    1091 root 2184 S /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host_key -p 22
    1096 root 2880 S /usr/sbin/telnetd
    1101 root 2944 S /sbin/syslogd -n -C64 -m 20
    1103 root 2880 S /sbin/klogd -n
    1124 root 1912 S /sbin/getty 115200 ttyS2
    1125 root 1912 S /sbin/getty 38400 tty1
    2542 root 2372 S /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host_key -p 22
    2544 root 3072 S -sh
    6244 root 0 SW [flush-179:0]
    6633 root 0 SW< [DSPLINK_DPC_0]
    6634 root 0 SW< [DSPLINK_DPC_1]
    6635 root 0 SW< [DSPLINK_DPC_2]
    6637 root 0 SW< [DSPLINK_DPC_3]
    6656 root 2372 S /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_host_key -p 22
    6658 root 3072 S -sh
    6943 root 2748 S sleep 1
    6944 root 3072 R ps

    Setting the dsp in reset would be good.

  • Harry,

    I've attached a patch file which will add some basic terminate support to the DSPLink 1.65.01.06 release. Apply the patch as follows. Use the --dry-run option to ensure all is well before actually applying the patch.

    cd dsplink_linux_1_65_01_06
    patch [--dry-run] -b -p0 -i 0001-terminate-support.patch

    You will need to clean and rebuild DSPLink and your application. With this patch, I am able to run the messageq sample and terminate it with CTRL+C. I can then run it again without any errors.

    % messagegpp message.out 0
    CTRL+C
    % messagegpp message.out 200

    The terminate support will place the DSP into reset and reclaim the resources allocated by the application. The DPC threads should be gone. The current support works for catchable signals (e.g. CTRL+C), but has more limited support for non-catchable signals (e.g. kill -9). If you application is terminated with a non-cachtable signal, then you must reinstall the driver, but it should not require a reboot.

    % messagegpp message.out 0 &
    % ps
     1099 ttyS2    00:00:07 messagegpp
    % kill -9 1099
    % rmmod dsplinkk
    % insmod dsplinkk.ko
    % messagegpp message.out 200

    It would be great if you could test this out and let us know your results. I've only tested with the messageq sample provided with DSPLink. I do not have a test bench setup for c6run as you do. We plan to release this terminate support in the next DSPLink 1.65.02 release planned for October. It would be great to include your feedback in this release.

    Many thanks.
    ~Ramsey

    0001-terminate-support.patch