Skip to content

Instantly share code, notes, and snippets.

@pdp7
Last active February 2, 2017 19:24
Show Gist options
  • Save pdp7/fe07082d23f2bfbc362c733a7b0aea72 to your computer and use it in GitHub Desktop.
Save pdp7/fe07082d23f2bfbc362c733a7b0aea72 to your computer and use it in GitHub Desktop.
TI eQEP Rotary Encoder beaglebone 4.9.5-ti-r16
Has anyone tested the eQEP driver with the 4.9 kernel?

I'm attempting to use it with the 4.9.5-ti-r16 from 2017-01-23.

I get a Segmentation Fault when I read the position:
# config-pin p8.11 qep
# config-pin p8.12 qep
# cat /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep/position

It appears to occur in:
(eqep_get_position [tieqep]) from [<c08930d0>] (dev_attr_show+0x2c/0x58)

More details:
https://gist.github.com/pdp7/fe07082d23f2bfbc362c733a7b0aea72

thanks,
drew
# uname -r
4.9.5-ti-r16
# config-pin p8.11 qep
# config-pin p8.12 qep
# cat /sys/devices/platform/bone_capemgr/slots
# cat /sys/devices/platform/ocp/48304000.epwmss/48304180.eqep/position
[ 2591.653471] Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa304180
[ 2591.661300] pgd = dc51c000
[ 2591.664065] [fa304180] *pgd=48211452(bad)
[ 2591.668208] Internal error: : 1028 [#1] PREEMPT SMP ARM
[ 2591.673514] Modules linked in: c_can_platform c_can can_dev pwm_tiecap spi_omap2_mcspi omap_aes_driver crypto_engine omap_sham omap_rng rng_core evdev tps65217_charger uio_pdrv_genirq uio cpufreq_conservative cpufreq_ondemand usb_f_acm u_serial cpufreq_userspace usb_f_rndis g_multi usb_f_mass_storage u_ether cpufreq_powersave libcomposite 8021q garp mrp stp llc spidev tieqep pwm_tiehrpwm
[ 2591.708950] CPU: 0 PID: 2110 Comm: cat Not tainted 4.9.5-ti-r16 #1
[ 2591.715219] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 2591.721401] task: da857780 task.stack: da8ea000
[ 2591.726046] PC is at eqep_get_position+0x68/0x90 [tieqep]
[ 2591.731551] LR is at dev_attr_show+0x2c/0x58
[ 2591.735896] pc : [<bf005310>]    lr : [<c08930d0>]    psr: 600f0013
sp : da8ebe30  ip : 00000000  fp : da8ebe44
[ 2591.747517] r10: 00000001  r9 : dace8080  r8 : dabf5618
[ 2591.752873] r7 : dc3ba000  r6 : c0d85758  r5 : dc3ba000  r4 : dace8d80
[ 2591.759524] r3 : fa304180  r2 : dc3ba000  r1 : bf00652c  r0 : dabf5610
[ 2591.766179] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[ 2591.773446] Control: 10c5387d  Table: 9c51c019  DAC: 00000051
[ 2591.779308] Process cat (pid: 2110, stack limit = 0xda8ea218)
[ 2591.785171] Stack: (0xda8ebe30 to 0xda8ec000)
[ 2591.789640] be20:                                     dace8d80 bf00652c da8ebe5c da8ebe48
[ 2591.798007] be40: c08930d0 bf0052b4 dace8d80 00001000 da8ebe84 da8ebe60 c035f920 c08930b0
[ 2591.806373] be60: dace8d80 00000000 dab20180 c130414c da8ebf70 00000001 da8ebe94 da8ebe88
[ 2591.814739] be80: c035e2d0 c035f894 da8ebef4 da8ebe98 c0300d58 c035e2a8 da3305c0 da8ebf70
[ 2591.823104] bea0: dace8db0 b6d14000 da8ebeb0 00020000 00000000 00000000 00020000 dab20188
[ 2591.831469] bec0: 00000004 00040905 00000000 00020000 dab20180 b6d14000 da8ebf70 b6d14000
[ 2591.839835] bee0: dace8080 00000000 da8ebf2c da8ebef8 c035f0a0 c0300b7c da8ebf3c da8ebf08
[ 2591.848200] bf00: c02d8928 00020000 dab20180 b6d14000 da8ebf70 b6d14000 da8ea000 00000000
[ 2591.856566] bf20: da8ebf3c da8ebf30 c02d7c0c c035ef78 da8ebf6c da8ebf40 c02d8a68 c02d7bf0
[ 2591.864931] bf40: 000b6d13 c02fa7c8 da8ebf6c dab20180 c130414c dab20180 00020000 b6d14000
[ 2591.873296] bf60: da8ebfa4 da8ebf70 c02d9d04 c02d89d8 00000000 00000000 00000022 00040905
[ 2591.881661] bf80: 00000000 00020000 00020000 b6d14000 00000003 c01092c4 00000000 da8ebfa8
[ 2591.890025] bfa0: c0109100 c02d9cac 00020000 00020000 00000003 b6d14000 00020000 000271c4
[ 2591.898389] bfc0: 00020000 00020000 b6d14000 00000003 7fffe000 00000000 00000000 00020000
[ 2591.906753] bfe0: 00000000 be8b1a64 00013835 b6f49ea6 400f0030 00000003 00000000 00000000
[ 2591.915165] [<bf005310>] (eqep_get_position [tieqep]) from [<c08930d0>] (dev_attr_show+0x2c/0x58)
[ 2591.924261] [<c08930d0>] (dev_attr_show) from [<c035f920>] (sysfs_kf_seq_show+0x98/0x108)
[ 2591.932643] [<c035f920>] (sysfs_kf_seq_show) from [<c035e2d0>] (kernfs_seq_show+0x34/0x38)
[ 2591.941120] [<c035e2d0>] (kernfs_seq_show) from [<c0300d58>] (seq_read+0x1e8/0x538)
[ 2591.948972] [<c0300d58>] (seq_read) from [<c035f0a0>] (kernfs_fop_read+0x134/0x1c0)
[ 2591.956817] [<c035f0a0>] (kernfs_fop_read) from [<c02d7c0c>] (__vfs_read+0x28/0x48)
[ 2591.964660] [<c02d7c0c>] (__vfs_read) from [<c02d8a68>] (vfs_read+0x9c/0x168)
[ 2591.971942] [<c02d8a68>] (vfs_read) from [<c02d9d04>] (SyS_read+0x64/0xcc)
[ 2591.978974] [<c02d9d04>] (SyS_read) from [<c0109100>] (ret_fast_syscall+0x0/0x3c)
[ 2591.986643] Code: e1a04003 e320f000 eafffff3 e5933004 (e5934000) 
[ 2591.992891] ---[ end trace 98580f83455e4632 ]---
root@beaglebone:~# 
@pdp7
Copy link
Author

pdp7 commented Feb 2, 2017

UPDATE:
Fix merged by Robert C. Nelson:
tieqep: add patch to fix unhandled fault on 4.9 kernel
RobertCNelson/ti-linux-kernel-dev@f89418b

@pdp7
Copy link
Author

pdp7 commented Feb 2, 2017

UPDATE:
Fix merged by Robert C. Nelson:
tieqep: add patch to fix unhandled fault on 4.9 kernel
RobertCNelson/ti-linux-kernel-dev@f89418b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment