Skip to content

sc16is752 infinite interrupt loop in kernel module #2676

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

Closed
idsoftgit opened this issue Sep 10, 2018 · 7 comments
Closed

sc16is752 infinite interrupt loop in kernel module #2676

idsoftgit opened this issue Sep 10, 2018 · 7 comments

Comments

@idsoftgit
Copy link

I made a custom board with sc16is752. Everything work fine until kernel stall at 100% CPU usage and IRQ line hangs at low state and meander on the CS line. Looks like it run in circle in the sc16is7xx_port_irq handler. It is only possible if SC16IS7XX_IIR_NO_INT_BIT in IIR is active.
Any activity on RX line make it working back again.
This situation repeats at least 2-10 hr.

@idsoftgit
Copy link
Author

Looks like I found a solution. Errors from LSR reads only if something placed in receiver FIFO, but what happens if there is no data in FIFO and any error occurred? It's just return true from sc16is7xx_port_irq and keep poling further in the endless loop. It seems like a wrong behavior. I added "return true" if rxlen is zero and now it works without hanging, But I think the right way is call sc16is7xx_handle_rx(port, rxlen, iir) without any check of buffer length at all.
Is there somebody use this chip?

@pelwell
Copy link
Contributor

pelwell commented Sep 24, 2018

There are a number of users of this device. Please post your patch so I can better understand what you mean.

@idsoftgit
Copy link
Author

patch.txt
Ok, after a while of test I guess it works. Ofcourse it should be tested strongly enough.

@idsoftgit
Copy link
Author

It still hangs. But now it takes about 5 days for.

@idsoftgit
Copy link
Author

patch.txt
So, the reason of hangs was when interrupt occurs with zero buffer length and it leads to the infinite loop. Please add patch to mainline.

pelwell pushed a commit that referenced this issue Nov 6, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
pelwell pushed a commit that referenced this issue Nov 6, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
@pelwell
Copy link
Contributor

pelwell commented Nov 6, 2018

Thanks - that makes much more sense. It's now in rpi-4.14.y and rpi-4.19.y.

ahmedradaideh pushed a commit to ahmedradaideh/Pi-Kernel that referenced this issue Nov 10, 2018
See: raspberrypi/linux#2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Signed-off-by: ahmedradaideh <ahmed.radaideh@gmail.com>
ahmedradaideh pushed a commit to ahmedradaideh/Pi-Kernel that referenced this issue Nov 10, 2018
See: raspberrypi/linux#2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Signed-off-by: ahmedradaideh <ahmed.radaideh@gmail.com>
popcornmix pushed a commit that referenced this issue Nov 12, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 12, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix added a commit to raspberrypi/firmware that referenced this issue Nov 12, 2018
kernel: sc16is7xx: Don't spin if no data received
See: raspberrypi/linux#2676

kernel: overlays: uart0 - return GPIOs 14 and 15 to inputs
See: https://www.raspberrypi.org/forums/viewtopic.php?p=1388713#p1316977
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Nov 12, 2018
kernel: sc16is7xx: Don't spin if no data received
See: raspberrypi/linux#2676

kernel: overlays: uart0 - return GPIOs 14 and 15 to inputs
See: https://www.raspberrypi.org/forums/viewtopic.php?p=1388713#p1316977
popcornmix pushed a commit that referenced this issue Nov 13, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 15, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 19, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 21, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 23, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 28, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 28, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
lyakh pushed a commit to lyakh/linux that referenced this issue Nov 30, 2018
See: raspberrypi/linux#2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 4, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 4, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 6, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 10, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 10, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 14, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 17, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 17, 2018
See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Mar 10, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 10, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 10, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 13, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 13, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 17, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 24, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 25, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 25, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 31, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 7, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 7, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 10, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 14, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 14, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 14, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
nmbath pushed a commit to victronenergy/linux that referenced this issue Apr 22, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: raspberrypi/linux#2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 24, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 24, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 24, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 28, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 28, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 6, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 6, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 14, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 14, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 20, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 20, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 23, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue May 27, 2025
There are multiple causes of interrupts, errors being one, and only the
receipt of data warrants continued polling.

See: #2676

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
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