Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nfc support #8

Open
rhjdvsgsgks opened this issue Jun 30, 2023 · 6 comments
Open

nfc support #8

rhjdvsgsgks opened this issue Jun 30, 2023 · 6 comments

Comments

@rhjdvsgsgks
Copy link

i saw on pmos wiki. there are some device have nfc support. but none of them are msm8974. is that due to some hardware limitation?

@minlexx
Copy link
Member

minlexx commented Jun 30, 2023

No

@rhjdvsgsgks
Copy link
Author

after some search. i found that bacon is using pn544. which already used on other mainline device (such as dumpling). so, seems like i only need to write a dt for it.
this is my first time about mainlining something. maybe it will lot of month and mostly will failed. if someone also interested in it. please ignore my progress and work. and do what you want

some reference i found:
https://github.com/LineageOS/android_kernel_oppo_msm8974/blob/lineage-18.1/arch/arm/boot/dts/msm8974-oppo/msm8974-oppo-nfc.dtsi
https://github.com/LineageOS/android_kernel_oneplus_msm8998/blob/lineage-20/arch/arm/boot/dts/qcom/dumpling.dtsi
https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi

z3ntu pushed a commit that referenced this issue Mar 10, 2024
Disable BH around the call to napi_schedule() to avoid following
error:
NOHZ tick-stop error: local softirq work is pending, handler #8!!!

Fixes: ec4c7e1 ("lan78xx: Introduce NAPI polling support")
Signed-off-by: Oleksij Rempel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
z3ntu pushed a commit that referenced this issue Mar 14, 2024
Fix softirq's not being handled during napi_schedule() call when
receiving marker packets for queue disable by disabling local bottom
half.

The issue can be seen on ifdown:
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #8!!!

Using ftrace to catch the failing scenario:
ifconfig   [003] d.... 22739.830624: softirq_raise: vec=3 [action=NET_RX]
<idle>-0   [003] ..s.. 22739.831357: softirq_entry: vec=3 [action=NET_RX]

No interrupt and CPU is idle.

After the patch when disabling local BH before calling napi_schedule:
ifconfig   [003] d.... 22993.928336: softirq_raise: vec=3 [action=NET_RX]
ifconfig   [003] ..s1. 22993.928337: softirq_entry: vec=3 [action=NET_RX]

Fixes: c2d548c ("idpf: add TX splitq napi poll support")
Reviewed-by: Jesse Brandeburg <[email protected]>
Reviewed-by: Przemek Kitszel <[email protected]>
Signed-off-by: Emil Tantilov <[email protected]>
Signed-off-by: Alan Brady <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Tested-by: Krishneil Singh <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
TheOrangeCat pushed a commit to TheOrangeCat/linux that referenced this issue Mar 20, 2024
Fix softirq's not being handled during napi_schedule() call when
receiving marker packets for queue disable by disabling local bottom
half.

The issue can be seen on ifdown:
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler msm8974-mainline#8!!!

Using ftrace to catch the failing scenario:
ifconfig   [003] d.... 22739.830624: softirq_raise: vec=3 [action=NET_RX]
<idle>-0   [003] ..s.. 22739.831357: softirq_entry: vec=3 [action=NET_RX]

No interrupt and CPU is idle.

After the patch when disabling local BH before calling napi_schedule:
ifconfig   [003] d.... 22993.928336: softirq_raise: vec=3 [action=NET_RX]
ifconfig   [003] ..s1. 22993.928337: softirq_entry: vec=3 [action=NET_RX]

Fixes: c2d548c ("idpf: add TX splitq napi poll support")
Reviewed-by: Jesse Brandeburg <[email protected]>
Reviewed-by: Przemek Kitszel <[email protected]>
Signed-off-by: Emil Tantilov <[email protected]>
Signed-off-by: Alan Brady <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Tested-by: Krishneil Singh <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
z3ntu pushed a commit that referenced this issue Apr 5, 2024
commit 4be9075 upstream.

The driver creates /sys/kernel/debug/dri/0/mob_ttm even when the
corresponding ttm_resource_manager is not allocated.
This leads to a crash when trying to read from this file.

Add a check to create mob_ttm, system_mob_ttm, and gmr_ttm debug file
only when the corresponding ttm_resource_manager is allocated.

crash> bt
PID: 3133409  TASK: ffff8fe4834a5000  CPU: 3    COMMAND: "grep"
 #0 [ffffb954506b3b20] machine_kexec at ffffffffb2a6bec3
 #1 [ffffb954506b3b78] __crash_kexec at ffffffffb2bb598a
 #2 [ffffb954506b3c38] crash_kexec at ffffffffb2bb68c1
 #3 [ffffb954506b3c50] oops_end at ffffffffb2a2a9b1
 #4 [ffffb954506b3c70] no_context at ffffffffb2a7e913
 #5 [ffffb954506b3cc8] __bad_area_nosemaphore at ffffffffb2a7ec8c
 #6 [ffffb954506b3d10] do_page_fault at ffffffffb2a7f887
 #7 [ffffb954506b3d40] page_fault at ffffffffb360116e
    [exception RIP: ttm_resource_manager_debug+0x11]
    RIP: ffffffffc04afd11  RSP: ffffb954506b3df0  RFLAGS: 00010246
    RAX: ffff8fe41a6d1200  RBX: 0000000000000000  RCX: 0000000000000940
    RDX: 0000000000000000  RSI: ffffffffc04b4338  RDI: 0000000000000000
    RBP: ffffb954506b3e08   R8: ffff8fee3ffad000   R9: 0000000000000000
    R10: ffff8fe41a76a000  R11: 0000000000000001  R12: 00000000ffffffff
    R13: 0000000000000001  R14: ffff8fe5bb6f3900  R15: ffff8fe41a6d1200
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 #8 [ffffb954506b3e00] ttm_resource_manager_show at ffffffffc04afde7 [ttm]
 #9 [ffffb954506b3e30] seq_read at ffffffffb2d8f9f3
    RIP: 00007f4c4eda8985  RSP: 00007ffdbba9e9f8  RFLAGS: 00000246
    RAX: ffffffffffffffda  RBX: 000000000037e000  RCX: 00007f4c4eda8985
    RDX: 000000000037e000  RSI: 00007f4c41573000  RDI: 0000000000000003
    RBP: 000000000037e000   R8: 0000000000000000   R9: 000000000037fe30
    R10: 0000000000000000  R11: 0000000000000246  R12: 00007f4c41573000
    R13: 0000000000000003  R14: 00007f4c41572010  R15: 0000000000000003
    ORIG_RAX: 0000000000000000  CS: 0033  SS: 002b

Signed-off-by: Jocelyn Falempe <[email protected]>
Fixes: af4a25b ("drm/vmwgfx: Add debugfs entries for various ttm resource managers")
Cc: <[email protected]>
Reviewed-by: Zack Rusin <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
@rhjdvsgsgks
Copy link
Author

ok. i get it able to list by nfctool -l. still working on make it able to enable

@z3ntu
Copy link
Member

z3ntu commented Jun 14, 2024

And please share your changes when you have something working!

@rhjdvsgsgks
Copy link
Author

finally. i get it works. what blocked me so long is that the pin for nfc defined in device tree is actually not used. the real pin is hard coded in the diver.

https://github.com/LineageOS/android_kernel_oneplus_msm8974/blob/675fd24b98e3a98695725dd17fb0216e7bd1895e/arch/arm/boot/dts/msm8974-oppo/msm8974-oppo-nfc.dtsi#L35-L37
https://github.com/LineageOS/android_kernel_oneplus_msm8974/blob/84bb8fee677f3d6b606e7c21efd34571cc4c818d/drivers/nfc/pn544-oppo_find7op.c#L49-L51

which branch should my pr based on? the wip one?

@z3ntu
Copy link
Member

z3ntu commented Jun 15, 2024

6.10-wip is good yes. Otherwise 6.9.y is also okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants