eQEP error with 4.9 kernel

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 [] (dev_attr_show+0x2c/0x58)

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

thanks!
drew

I’ve experimenting more with this eQEP error on the 4.9 kernel:
https://gist.github.com/pdp7/fe07082d23f2bfbc362c733a7b0aea72

From drivers/misc/tieqep.c at found in this patch:
https://github.com/RobertCNelson/ti-linux-kernel-dev/tree/ti-linux-4.9.y/patches/drivers/ti/eqep

This readl() runs OK in eqep_probe():
https://github.com/RobertCNelson/ti-linux-kernel-dev/tree/ti-linux-4.9.y/patches/drivers/ti/eqep#L401

Line 697: dev_info(&pdev->dev, “QPOSCNT:0x%08x\n”, readl(eqep->mmio_base + QPOSCNT));

But the same readl() causes a seg fault in eqep_get_position():
https://github.com/RobertCNelson/ti-linux-kernel-dev/tree/ti-linux-4.9.y/patches/drivers/ti/eqep#L401

Line 401: position = readl(eqep->mmio_base + QPOSCNT);

I’m not sure what the difference is. Maybe the memory mapping changes in between the probe and reading the sysfs file?

Any ideas?

thanks,
drew