TechWell TW6869 driver does not generate interrupts on embedded device - linux-device-driver

I'm trying to get a Techwell TW6869 driver to work. This PCIe-chip is able to capture analog video signals. Therefore I'm using a driver which can be found here: GitHub
The chip is connected to a Freescale imx.6 processor which is running Angström distribution. The driver already worked on the target but I didn't use it for some time and somehow it doesn't do it's job anymore.
So what I did, was implementing kernel messages in the beginning of each function so I know what does happen exactly. Finally I found out, that no PCIe Interrupt is generated anymore. Though the interrupt is registered which I found out here:
root#freescaleimx6:~# cat /proc/interrupts | grep tw6869
155: 0 0 0 0 GIC tw6869
Running something on the videodevice unfortunately does not generate an interrupt.
root#freescaleimx6:~# gst-launch-1.0 v4l2src device=/dev/video2 ! imxipuvideosink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:08.992961001
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
root#freescaleimx6:~#
This could also possibly help (does it?)
root#freescaleimx6:~# cat /proc/bus/pci/devices
0000 16c3abcd 180 1000000 0 0 0 0 0 1200000 100000 0 0 0 0 0 10000 pcieport
0100 17976869 9b 1100008 0 0 0 0 0 0 1000 0 0 0 0 0 0 tw6869
Does anyone have an idea?

Related

ddrescue read non tried blocks

I'm trying to rescue a 1TB disk which has read errors. Because I didn't have a free 1TB drive, I created a raid 0 of two 500GB drives.
I used the command line from Wikipedia for the first run:
sudo ddrescue -f -n /dev/sdk /dev/md/md_test /home/user/rescue.map
ddrescue already completed this run after approximately 20 hours and more than 7000 read errors.
Now I'm trying to do a second run
sudo ddrescue -d -f -v -r3 /dev/sdk /dev/md/md_test /home/user/rescue.map
and read the non tried blocks but ddrescue gives me this:
GNU ddrescue 1.23
About to copy 1000 GBytes from '/dev/sdk' to '/dev/md/md_test'
Starting positions: infile = 0 B, outfile = 0 B
Copy block size: 128 sectors Initial skip size: 19584 sectors
Sector size: 512 Bytes
Press Ctrl-C to interrupt
Initial status (read from mapfile)
rescued: 635060 MB, tried: 0 B, bad-sector: 0 B, bad areas: 0
Current status
ipos: 1000 GB, non-trimmed: 0 B, current rate: 0 B/s
opos: 1000 GB, non-scraped: 0 B, average rate: 0 B/s
non-tried: 365109 MB, bad-sector: 0 B, error rate: 0 B/s
rescued: 635060 MB, bad areas: 0, run time: 0s
pct rescued: 63.49%, read errors: 0, remaining time: n/a
time since last successful read: n/a
Copying non-tried blocks... Pass 1 (forwards)
ddrescue: Write error: Invalid argument
I can't figure out what this write errors means, already searched the manual for answers.
Any help is appreciated! Thx!
After a while I found the cause for the write error, the capacity of the corrupt drive is 931,5G but the total capacity of the raid 0 was just 931,3G.
Realized it, while I took a closer look to the output of lsblk command.
So I rebuild the raid 0 array with 3 500G drives and ddrescue now works as expected.

How can I remove COM ports by command line (w/o installing)

The setup: An automated test station, built around a Windows 7 PC. The UUT (Unit Under Test) are connected and disconnected often, creating many COM ports.
The Problem: The test is searching for the device at a specific COM port, requiring the user to manually remove the "ghost" com ports.
The question: Since the software is used by several test stations in parallel, at a production floor, I cannot install additional software (e.g. Devcon, part of Windows SDK). Is there a command line option to remove the COM ports?
Based on This blog entry
The only thing that actually worked for me is not the intended solution... But it fit the case at hand:
Created a batch file at C:\windows\system32
The content:
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\COM Name Arbiter" /v ComDB /t REG_BINARY /d 0206 /f
The actual value of the registry key (0206 in my example) can either be read from that key (use regedit) or calculated from binary:
com8 com7 com6 com5 com4 com3 com2 com1 com16 com15 com14 com13 com12 com11 com10 com9
0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0
since I wished to keep com1, com2, com10 and com11 - 0000 0011 0000 0110 - which stand for 0206
executing this batch file will remove the unnecessary comports while leaving the one's I intended
*The batch should be at system32 to be executed as elevated (administrator)
*for more details refer to this PDF

PulseAudio: Play samples at a set volume

I have built a Raspberry Pi music player, with volume control. The issue is that when the volume is very low or very high, the sound effects (button press bleeps, etc.) are also too weak or too loud. The Raspberry Pi uses PulseAudio (system daemon), and this is its PulseAudio set-up:
# pactl list short
0 module-udev-detect
1 module-alsa-card device_id="0" name="platform-soc_sound" card_name="alsa_card.platform-soc_sound" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1"
2 module-native-protocol-unix auth-cookie-enabled=0
3 module-stream-restore
4 module-device-restore
5 module-default-device-restore
6 module-bluetooth-policy
7 module-bluetooth-discover
8 module-bluez5-discover
9 module-rescue-streams
10 module-always-sink
11 module-switch-on-connect
0 alsa_output.platform-soc_sound.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
0 alsa_output.platform-soc_sound.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz IDLE
1 0 0 protocol-native.c s24-32le 2ch 44100Hz
0 protocol-native.c mpd
48 protocol-native.c pactl
0 startup float32le 2ch 44100Hz 3.279
1 beep_60 float32le 1ch 44100Hz 0.119
2 beep_70 float32le 1ch 44100Hz 0.119
3 beep_60_70 float32le 1ch 44100Hz 0.166
4 error float32le 2ch 44100Hz 0.702
5 bt float32le 1ch 44100Hz 0.264
0 alsa_card.platform-soc_sound module-alsa-card.c
I play the samples, using:
pactl play-sample startup
This command can take an additional parameter, namely the PulseAudio sink on which to play.
The solution seems to, somehow, create a sink, attach it to the Alsa card and use that to play the samples. I assume this sink would have its own volume control.

How to check which process is occupying the most disk i/o in solaris

I am trying to check which process is taking up most disk i/o on my solaris server as it is behaving very much slow. Need help.
iostat -xtc
extended device statistics tty cpu
device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy wt id
sd1 75.9 979.9 113.3 3524.9 0.0 5.4 5.1 0 69 0 53 1 2 0 97
nfs1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
It is quite hard, iotop script from Brendan Gregg can help you.
Here is the script:
http://www.brendangregg.com/DTrace/iotop
Here is the explanatory paper:
http://www.brendangregg.com/Solaris/paper_diskubyp1.pdf

Solaris CPU run queue

Is there a command which can tell me whats in the Solaris run queue?
I can get a count using vmstat, but I need to know what processes/threads are in there.
The run-queue is always changing, so it's almost impossible to get the set of processes in the current run-queue.
That said, you can get an approximation by looking at the STAT (state) field of the process list from ps. When running the command below:
$ ps aux
...the if the STAT field begins with R, then the process is marked RUNNABLE by the kernel, which on most operating systems means that it is in the run-queue. Here's what a runnable process looks like on my machine:
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
root 78179 0.0 0.0 599828 480 s003 R+ 7:51AM 0:00.00 ps aux
On solaris, you can also use the prstat command and look at the STATE column. The value run indicates that the process is on the run-queue. (Also note that the value cpuN indicates that the process is currently running on processor N.
For example:
$ prstat -s cpu -n 5
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
13974 kincaid 888K 432K run 40 0 36:14.51 67% cpuhog/1
27354 kincaid 2216K 1928K run 31 0 314:48.51 27% server/5
14690 root 136M 46M sleep 59 0 0:00.59 2.3% Xsun/1
14797 kincaid 9192K 7496K sleep 59 0 0:00.10 0.9% dtwm/8
14851 kincaid 24M 14M sleep 48 0 0:00.03 0.3% netscape/1
Total: 97 processes, 190 lwps, load averages: 2.18, 2.15, 2.11
I was about to correct 0xfe answer when I saw you already did it. The run queue is containing theads not processes so the -L option is mandatory with the prstat command if you want to have the number of "state run" lines more or less matching the run queue. Beware that sampling artifacts will probably prevent to get accurate matches.
In any case, if you want to precisely know what processes/threads are sitting in the run queue you'd rather go the dtrace way assuming you are running Solaris 10 or newer.
The whoqueue.d script which might already been in /usr/demo/dtrace directory on your machine will be a good start:
# dtrace -s /usr/demo/dtrace/whoqueue.d
Run queue of length 1:
24349/1 (dtrace)
Run queue of length 3:
0/0 (sched)
0/0 (sched)
0/0 (sched)
Run queue of length 4:
22468/30 (java)
22468/17 (java)
22468/23 (java)
22468/10 (java)
Have a look at this page for details.