{"action":"created","issue":{"url":"https://api.github.com/repos/intel-iot-devkit/mraa/issues/456","repository_url":"https://api.github.com/repos/intel-iot-devkit/mraa","labels_url":"https://api.github.com/repos/intel-iot-devkit/mraa/issues/456/labels{/name}","comments_url":"https://api.github.com/repos/intel-iot-devkit/mraa/issues/456/comments","events_url":"https://api.github.com/repos/intel-iot-devkit/mraa/issues/456/events","html_url":"https://github.com/intel-iot-devkit/mraa/issues/456","id":138791492,"number":456,"title":"Edison SPI can't work on frequency more then 10 kHz","user":{"login":"ivictbor","id":1838656,"avatar_url":"https://avatars.githubusercontent.com/u/1838656?v=3","gravatar_id":"","url":"https://api.github.com/users/ivictbor","html_url":"https://github.com/ivictbor","followers_url":"https://api.github.com/users/ivictbor/followers","following_url":"https://api.github.com/users/ivictbor/following{/other_user}","gists_url":"https://api.github.com/users/ivictbor/gists{/gist_id}","starred_url":"https://api.github.com/users/ivictbor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivictbor/subscriptions","organizations_url":"https://api.github.com/users/ivictbor/orgs","repos_url":"https://api.github.com/users/ivictbor/repos","events_url":"https://api.github.com/users/ivictbor/events{/privacy}","received_events_url":"https://api.github.com/users/ivictbor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-06T13:34:17Z","updated_at":"2016-03-07T12:27:59Z","closed_at":null,"body":"Hello. \r\nI started using Edison with latest firmware **Release 2.1 Yocto* complete image**. But after first tries to make SPI exchanges on 1MHz I noticed freezing and errors in **dmesg** and found issue on communities https://communities.intel.com/thread/78149?start=0&tstart=0 .\r\nNow I followed recommendation in that topic and downgraded to **Release 2.0 Yocto* complete image**. (edison-image-ww25.5-15)\r\nSo now I on:\r\n```\r\ncat /proc/version  \r\nLinux version 3.10.17-poky-edison+ (sys_dswci@tlsndgbuild004) (gcc version 4.9.1 (GCC) ) #1 SMP PREEMPT Fri Jun 19 12:06:40 CEST 2015  \r\ncat /etc/*release  \r\nEDISON-3.0  \r\nCopyright Intel 2015  \r\nconfigure_edison --version  \r\n159  \r\nopkg install mraa\r\nPackage libmraa0 (0.7.3) installed in root is up to date.\r\n```\r\nIs this output correct for **edison-image-ww25.5-15** ? Or it is not downgraded correctly? (I copied zip to Edison Flash Drive and issued **reboot ota** via ssh)\r\nI wrote next simple test python2 script (needs **opkg install mraa**):\r\n```\r\nimport mraa  \r\nfrom time import sleep, time  \r\n  \r\nBULK_SIZE = 512  \r\nSPI_FREQ = 100e3 # 100KHz  \r\n  \r\nprint(\"Starting SPI test using bulks {} at {}\".format(BULK_SIZE, SPI_FREQ))  \r\n  \r\nspi = mraa.Spi(1)  \r\nspi.frequency(int(SPI_FREQ))  \r\nspi.lsbmode(True)  \r\nspi.mode(mraa.SPI_MODE3)  \r\n  \r\nstart = time()  \r\ntot_bytes = 0  \r\nwhile True:  \r\n    sleep(0.01)  \r\n    txbuf = bytearray([0xFF] * BULK_SIZE)  \r\n    rxbuf = spi.write(txbuf)  \r\n    tot_bytes += len(txbuf)  \r\n    print(\"{}: Rate: {} B/s\".format(time(), tot_bytes / (time() - start)))  \r\n```\r\nAfter working one or two minutes it hanged up. I can't kill it with **Ctrl+C**, or suspend with **Ctrl+Z**. I can only exit from SSH with **~.**, reconnect to Edison and see this script in ps.\r\nI can't kill it by **killall -9 python** or by pid with **kill**. Only reboot helps. After two minutes **dmesg** shows:\r\n```\r\n[  360.610725] INFO: task python2:345 blocked for more than 120 seconds.  \r\n[  360.610813] \"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\" disables this message.  \r\n[  360.610889] python2        D f5051d8c  6040  345    336 0x00000004  \r\n[  360.610929]  f5051dd4 00000086 f6c81bd0 f5051d8c c12726e3 c1d04000 f6c9e000 f73fdc00  \r\n[  360.610986]  00000046 f6c83d30 f73fdc00 f5d95900 f5d34344 f6c0e000 f5051d98 c12727bf  \r\n[  360.611040]  f5cd8400 f5051da0 c125ad6e f5051dbc c125c4e3 f5cd8400 00000005 f5d81600  \r\n[  360.611095] Call Trace:  \r\n[  360.611135]  [<c12726e3>] ? try_to_wake_up+0x193/0x250  \r\n[  360.611164]  [<c12727bf>] ? wake_up_process+0x1f/0x40  \r\n[  360.611191]  [<c125ad6e>] ? wake_up_worker+0x1e/0x20  \r\n[  360.611216]  [<c125c4e3>] ? insert_work+0x53/0x90  \r\n[  360.611246]  [<c18df1e7>] ? _raw_spin_unlock+0x17/0x40  \r\n[  360.611272]  [<c125ce8f>] ? __queue_work+0x10f/0x340  \r\n[  360.611299]  [<c18de0e3>] schedule+0x23/0x60  \r\n[  360.611324]  [<c18db745>] schedule_timeout+0x165/0x2a0  \r\n[  360.611355]  [<c1270ddb>] ? get_parent_ip+0xb/0x40  \r\n[  360.611380]  [<c18e2c75>] ? sub_preempt_count+0x95/0xf0  \r\n[  360.611408]  [<c18dd19b>] wait_for_completion+0xab/0xe0  \r\n[  360.611433]  [<c1272800>] ? wake_up_state+0x20/0x20  \r\n[  360.611463]  [<c15c1050>] spidev_sync+0x80/0xb0  \r\n[  360.611493]  [<c15c19df>] spidev_ioctl+0x65f/0x6f0  \r\n[  360.611518]  [<c18e2c75>] ? sub_preempt_count+0x95/0xf0  \r\n[  360.611549]  [<c15c1130>] ? spidev_write+0xb0/0xb0  \r\n[  360.611577]  [<c15c1380>] ? spidev_probe+0x190/0x190  \r\n[  360.611604]  [<c1336686>] do_vfs_ioctl+0x306/0x550  \r\n[  360.611632]  [<c1480cba>] ? inode_has_perm.isra.32.constprop.65+0x3a/0x50  \r\n[  360.611657]  [<c1480d57>] ? file_has_perm+0x87/0x90  \r\n[  360.611686]  [<c148113b>] ? selinux_file_ioctl+0x4b/0xe0  \r\n[  360.611712]  [<c1336930>] SyS_ioctl+0x60/0x90  \r\n[  360.611740]  [<c18df928>] syscall_call+0x7/0xb  \r\n[  360.611769]  [<c18d0000>] ? init_intel_cacheinfo+0x1b3/0x37e  \r\n[  480.599431] INFO: task python2:345 blocked for more than 120 seconds.  \r\n[  480.599522] \"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\" disables this message.  \r\n[  480.599598] python2        D f5051d8c  6040  345    336 0x00000004  \r\n[  480.599638]  f5051dd4 00000086 f6c81bd0 f5051d8c c12726e3 c1d04000 f6c9e000 f73fdc00  \r\n[  480.599695]  00000046 f6c83d30 f73fdc00 f5d95900 f5d34344 f6c0e000 f5051d98 c12727bf  \r\n[  480.599749]  f5cd8400 f5051da0 c125ad6e f5051dbc c125c4e3 f5cd8400 00000005 f5d81600  \r\n[  480.599804] Call Trace:  \r\n[  480.599845]  [<c12726e3>] ? try_to_wake_up+0x193/0x250  \r\n[  480.599875]  [<c12727bf>] ? wake_up_process+0x1f/0x40  \r\n[  480.599902]  [<c125ad6e>] ? wake_up_worker+0x1e/0x20  \r\n[  480.599928]  [<c125c4e3>] ? insert_work+0x53/0x90  \r\n[  480.599957]  [<c18df1e7>] ? _raw_spin_unlock+0x17/0x40  \r\n[  480.599983]  [<c125ce8f>] ? __queue_work+0x10f/0x340  \r\n[  480.600010]  [<c18de0e3>] schedule+0x23/0x60  \r\n[  480.600035]  [<c18db745>] schedule_timeout+0x165/0x2a0  \r\n[  480.600067]  [<c1270ddb>] ? get_parent_ip+0xb/0x40  \r\n[  480.600092]  [<c18e2c75>] ? sub_preempt_count+0x95/0xf0  \r\n[  480.600119]  [<c18dd19b>] wait_for_completion+0xab/0xe0  \r\n[  480.600144]  [<c1272800>] ? wake_up_state+0x20/0x20  \r\n[  480.600175]  [<c15c1050>] spidev_sync+0x80/0xb0  \r\n[  480.600205]  [<c15c19df>] spidev_ioctl+0x65f/0x6f0  \r\n[  480.600230]  [<c18e2c75>] ? sub_preempt_count+0x95/0xf0  \r\n[  480.600261]  [<c15c1130>] ? spidev_write+0xb0/0xb0  \r\n[  480.600289]  [<c15c1380>] ? spidev_probe+0x190/0x190  \r\n[  480.600315]  [<c1336686>] do_vfs_ioctl+0x306/0x550  \r\n[  480.600343]  [<c1480cba>] ? inode_has_perm.isra.32.constprop.65+0x3a/0x50  \r\n[  480.600369]  [<c1480d57>] ? file_has_perm+0x87/0x90  \r\n[  480.600397]  [<c148113b>] ? selinux_file_ioctl+0x4b/0xe0  \r\n[  480.600424]  [<c1336930>] SyS_ioctl+0x60/0x90  \r\n[  480.600452]  [<c18df928>] syscall_call+0x7/0xb  \r\n[  480.600481]  [<c18d0000>] ? init_intel_cacheinfo+0x1b3/0x37e  \r\n[  600.578598] INFO: task python2:345 blocked for more than 120 seconds.  \r\n[  600.578688] \"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\" disables this message.  \r\n[  600.578764] python2        D f5051d8c  6040  345    336 0x00000004  \r\n[  600.578805]  f5051dd4 00000086 f6c81bd0 f5051d8c c12726e3 c1d04000 f6c9e000 f73fdc00  \r\n[  600.578862]  00000046 f6c83d30 f73fdc00 f5d95900 f5d34344 f6c0e000 f5051d98 c12727bf  \r\n[  600.578916]  f5cd8400 f5051da0 c125ad6e f5051dbc c125c4e3 f5cd8400 00000005 f5d81600  \r\n[  600.578972] Call Trace:  \r\n[  600.579013]  [<c12726e3>] ? try_to_wake_up+0x193/0x250  \r\n[  600.579042]  [<c12727bf>] ? wake_up_process+0x1f/0x40  \r\n[  600.579070]  [<c125ad6e>] ? wake_up_worker+0x1e/0x20  \r\n[  600.579095]  [<c125c4e3>] ? insert_work+0x53/0x90  \r\n[  600.579125]  [<c18df1e7>] ? _raw_spin_unlock+0x17/0x40  \r\n[  600.579151]  [<c125ce8f>] ? __queue_work+0x10f/0x340  \r\n[  600.579177]  [<c18de0e3>] schedule+0x23/0x60  \r\n[  600.579202]  [<c18db745>] schedule_timeout+0x165/0x2a0  \r\n[  600.579233]  [<c1270ddb>] ? get_parent_ip+0xb/0x40  \r\n[  600.579258]  [<c18e2c75>] ? sub_preempt_count+0x95/0xf0  \r\n[  600.579286]  [<c18dd19b>] wait_for_completion+0xab/0xe0  \r\n[  600.579311]  [<c1272800>] ? wake_up_state+0x20/0x20  \r\n[  600.579341]  [<c15c1050>] spidev_sync+0x80/0xb0  \r\n[  600.579371]  [<c15c19df>] spidev_ioctl+0x65f/0x6f0  \r\n[  600.579396]  [<c18e2c75>] ? sub_preempt_count+0x95/0xf0  \r\n[  600.579427]  [<c15c1130>] ? spidev_write+0xb0/0xb0  \r\n[  600.579455]  [<c15c1380>] ? spidev_probe+0x190/0x190  \r\n[  600.579482]  [<c1336686>] do_vfs_ioctl+0x306/0x550  \r\n[  600.579510]  [<c1480cba>] ? inode_has_perm.isra.32.constprop.65+0x3a/0x50  \r\n[  600.579536]  [<c1480d57>] ? file_has_perm+0x87/0x90  \r\n[  600.579564]  [<c148113b>] ? selinux_file_ioctl+0x4b/0xe0  \r\n[  600.579590]  [<c1336930>] SyS_ioctl+0x60/0x90  \r\n[  600.579618]  [<c18df928>] syscall_call+0x7/0xb  \r\n[  600.579647]  [<c18d0000>] ? init_intel_cacheinfo+0x1b3/0x37e  \r\n[  720.558075] INFO: task python2:345 blocked for more than 120 seconds.  \r\n[  720.558166] \"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\" disables this message.  \r\n[  720.558242] python2        D f5051d8c  6040  345    336 0x00000004  \r\n[  720.558282]  f5051dd4 00000086 f6c81bd0 f5051d8c c12726e3 c1d04000 f6c9e000 f73fdc00  \r\n[  720.558339]  00000046 f6c83d30 f73fdc00 f5d95900 f5d34344 f6c0e000 f5051d98 c12727bf  \r\n[  720.558393]  f5cd8400 f5051da0 c125ad6e f5051dbc c125c4e3 f5cd8400 00000005 f5d81600  \r\n[  720.558449] Call Trace:  \r\n[  720.558488]  [<c12726e3>] ? try_to_wake_up+0x193/0x250  \r\n[  720.558517]  [<c12727bf>] ? wake_up_process+0x1f/0x40  \r\n[  720.558544]  [<c125ad6e>] ? wake_up_worker+0x1e/0x20  \r\n[  720.558570]  [<c125c4e3>] ? insert_work+0x53/0x90  \r\n[  720.558600]  [<c18df1e7>] ? _raw_spin_unlock+0x17/0x40  \r\n[  720.558626]  [<c125ce8f>] ? __queue_work+0x10f/0x340  \r\n[  720.558653]  [<c18de0e3>] schedule+0x23/0x60  \r\n[  720.558678]  [<c18db745>] schedule_timeout+0x165/0x2a0  \r\n[  720.558710]  [<c1270ddb>] ? get_parent_ip+0xb/0x40  \r\n[  720.558735]  [<c18e2c75>] ? sub_preempt_count+0x95/0xf0  \r\n[  720.558762]  [<c18dd19b>] wait_for_completion+0xab/0xe0  \r\n[  720.558787]  [<c1272800>] ? wake_up_state+0x20/0x20  \r\n[  720.558819]  [<c15c1050>] spidev_sync+0x80/0xb0  \r\n[  720.558849]  [<c15c19df>] spidev_ioctl+0x65f/0x6f0  \r\n[  720.558874]  [<c18e2c75>] ? sub_preempt_count+0x95/0xf0  \r\n[  720.558905]  [<c15c1130>] ? spidev_write+0xb0/0xb0  \r\n[  720.558933]  [<c15c1380>] ? spidev_probe+0x190/0x190  \r\n[  720.558960]  [<c1336686>] do_vfs_ioctl+0x306/0x550  \r\n[  720.558988]  [<c1480cba>] ? inode_has_perm.isra.32.constprop.65+0x3a/0x50  \r\n[  720.559013]  [<c1480d57>] ? file_has_perm+0x87/0x90  \r\n[  720.559042]  [<c148113b>] ? selinux_file_ioctl+0x4b/0xe0  \r\n[  720.559068]  [<c1336930>] SyS_ioctl+0x60/0x90  \r\n[  720.559097]  [<c18df928>] syscall_call+0x7/0xb  \r\n[  720.559125]  [<c18d0000>] ? init_intel_cacheinfo+0x1b3/0x37e  \r\n```\r\nIf I change **SPI_FREQ** to **10e3** it work for long time, if to **20e3** it may be hang after several minutes.\r\nWhat can be wrong? Do I need downgrade to some release earlier then 2.0? Where can I found it? Can I help to community to fix this? What I need for this? I tried also building latest mraa from git with python3.4 on Yocto 2.0 and 2.1, but the result was same in all cases."},"comment":{"url":"https://api.github.com/repos/intel-iot-devkit/mraa/issues/comments/193231391","html_url":"https://github.com/intel-iot-devkit/mraa/issues/456#issuecomment-193231391","issue_url":"https://api.github.com/repos/intel-iot-devkit/mraa/issues/456","id":193231391,"user":{"login":"ivictbor","id":1838656,"avatar_url":"https://avatars.githubusercontent.com/u/1838656?v=3","gravatar_id":"","url":"https://api.github.com/users/ivictbor","html_url":"https://github.com/ivictbor","followers_url":"https://api.github.com/users/ivictbor/followers","following_url":"https://api.github.com/users/ivictbor/following{/other_user}","gists_url":"https://api.github.com/users/ivictbor/gists{/gist_id}","starred_url":"https://api.github.com/users/ivictbor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivictbor/subscriptions","organizations_url":"https://api.github.com/users/ivictbor/orgs","repos_url":"https://api.github.com/users/ivictbor/repos","events_url":"https://api.github.com/users/ivictbor/events{/privacy}","received_events_url":"https://api.github.com/users/ivictbor/received_events","type":"User","site_admin":false},"created_at":"2016-03-07T12:27:59Z","updated_at":"2016-03-07T12:27:59Z","body":"@xbolshe as I wrote in issue I already downgraded it"}}