Dear NXP community,
I am currently trying to debug the NxpNfc stack in the OnePlus Nord open source kernel (GitHub link).
Unfortunately the NFC feature in the Android 11 kernel sources released by OnePlus have never been working properly which can also be seen when looking at the issues in the linked GitHub repository.
I was able to track the problem down to the open source kernel since NFC is working when using the stock prebuilt kernel extracted from the official firmware released by OnePlus.
The open source kernel has a NXP NFC driver which is included to the kernel sources but apparently they did not implement it correctly.
I would love to fix this issue since it would enable me and other members from the LineageOS team to have new possibilities when developing open source solutions.
Executing dmesg reveales a problem:
Nord:/ # dmesg | grep nfc
[ 0.545432] [ 0.545430]@7 nfc_parse_dt: 1168, 1146, 1169, 1160, error:0
[ 0.545614] [ 0.545613]@7 nfc_probe: probing NXP NFC exited successfully
[ 0.545616] [ 0.545615]@7 nfc_probe: Name of nfcc: 5-0028.
[ 1.773481] [ 1.773480]@7 init: Parsing file /vendor/etc/init/[email protected]...
[ 3.957900] [ 3.957898]@7 init: Verified that /data/nfc has the encryption policy 2e7c6a777cd2a5b6 v1 modes 127/4 flags 0x0
[ 5.495972] [ 5.495964]@6 init: starting service 'vendor.nfc_hal_service'...
[ 5.701402] [ 5.701400]@6 init: Unable to set property 'ro.nfc.port' from uid:0 gid:0 pid:537: SELinux permission check failed
[ 5.701793] [ 5.701790]@6 type=1107 audit(1632062033.537:27): uid=0 auid=4294967295 ses=4294967295 subj=u:r:init:s0 msg='avc: denied { set } for property=ro.nfc.port pid=537 uid=0 gid=0 scontext=u:r:vendor_init:s0 tcontext=u:object_r:default_prop:s0 tclass=property_service permissive=0'
[ 7.029990] [ 7.029988]@7 init: Could not start service 'nqnfcinfo' as part of class 'late_start': Cannot find '/system/vendor/bin/nqnfcinfo': No such file or directory
[ 26.911404] [20210919_16:34:14.751243]@3 nfc_dev_open: 10,123
[ 26.911441] [20210919_16:34:14.751284]@3 pn8xt_nfc_ese_ioctl bad ioctl 1074325761
[ 26.911450] [20210919_16:34:14.751293]@3 pn8xt_nfc_ioctl bad ioctl 1074325761
[ 26.911456] [20210919_16:34:14.751299]@3 nfc_dev_ioctl: ioctl: cmd = 1074325761, arg = 0
[ 26.921744] [20210919_16:34:14.761583]@4 pn8xt_nfc_ese_ioctl bad ioctl 1074325761
[ 26.921756] [20210919_16:34:14.761599]@4 pn8xt_nfc_ioctl bad ioctl 1074325761
[ 26.921762] [20210919_16:34:14.761605]@4 nfc_dev_ioctl: ioctl: cmd = 1074325761, arg = 1
[ 26.925556] [20210919_16:34:14.765401]@7 nfc_dev_write: i2c_master_send returned -107
[ 26.942551] [20210919_16:34:14.782396]@7 nfc_dev_write: i2c_master_send returned -107
[ 26.956926] [20210919_16:34:14.796770]@6 nfc_dev_write: i2c_master_send returned -107
[ 26.969815] [20210919_16:34:14.809658]@5 nfc_dev_write: i2c_master_send returned -107
[ 26.981549] [20210919_16:34:14.821392]@0 nfc_dev_write: i2c_master_send returned -107
[ 26.993709] [20210919_16:34:14.833552]@2 nfc_dev_write: i2c_master_send returned -107
[ 26.995007] [20210919_16:34:14.834849]@5 pn8xt_nfc_ese_ioctl bad ioctl 1074325761
[ 26.995016] [20210919_16:34:14.834859]@5 pn8xt_nfc_ioctl bad ioctl 1074325761
[ 26.995022] [20210919_16:34:14.834865]@5 nfc_dev_ioctl: ioctl: cmd = 1074325761, arg = 0
[ 27.005289] [20210919_16:34:14.845126]@5 pn8xt_nfc_ese_ioctl bad ioctl 1074325761
[ 27.005301] [20210919_16:34:14.845145]@5 pn8xt_nfc_ioctl bad ioctl 1074325761
[ 27.005307] [20210919_16:34:14.845151]@5 nfc_dev_ioctl: ioctl: cmd = 1074325761, arg = 1
[ 27.105652] [20210919_16:34:14.945490]@5 pn8xt_nfc_ese_ioctl bad ioctl 2148067587
[ 27.105663] [20210919_16:34:14.945506]@5 pn8xt_nfc_ioctl bad ioctl 2148067587
[ 27.105669] [20210919_16:34:14.945512]@5 nfc_dev_ioctl: ioctl: cmd = 2148067587, arg = 549520418672
[ 27.106020] [20210919_16:34:14.945863]@3 nfc_dev_write: i2c_master_send returned -107
[ 27.117865] [20210919_16:34:14.957708]@0 nfc_dev_write: i2c_master_send returned -107
[ 27.129837] [20210919_16:34:14.969680]@5 nfc_dev_write: i2c_master_send returned -107
[ 27.144574] [20210919_16:34:14.984417]@5 nfc_dev_write: i2c_master_send returned -107
[ 27.157052] [20210919_16:34:14.996895]@2 nfc_dev_write: i2c_master_send returned -107
[ 27.169871] [20210919_16:34:15.009714]@2 nfc_dev_write: i2c_master_send returned -107
[ 27.171426] [20210919_16:34:15.011265]@4 pn8xt_nfc_ese_ioctl bad ioctl 1074325761
[ 27.171439] [20210919_16:34:15.011282]@4 pn8xt_nfc_ioctl bad ioctl 1074325761
[ 27.171446] [20210919_16:34:15.011289]@4 nfc_dev_ioctl: ioctl: cmd = 1074325761, arg = 0
[ 27.181679] [20210919_16:34:15.021518]@0 pn8xt_nfc_ese_ioctl bad ioctl 1074325761
[ 27.181691] [20210919_16:34:15.021534]@0 pn8xt_nfc_ioctl bad ioctl 1074325761
[ 27.181697] [20210919_16:34:15.021540]@0 nfc_dev_ioctl: ioctl: cmd = 1074325761, arg = 1
It would be awesome if you could point me in the right direction for debugging this further.
Any help would be greatly appreciated.
Thanks!
Best regards,
MajorP93