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

sc16is752 infinite interrupt loop in kernel module #2676

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
pelwell pushed a commit that referenced this issue Nov 6, 2018
@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 <[email protected]>
Signed-off-by: ahmedradaideh <[email protected]>
ahmedradaideh pushed a commit to ahmedradaideh/Pi-Kernel that referenced this issue Nov 10, 2018
See: raspberrypi/linux#2676

Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: ahmedradaideh <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 12, 2018
popcornmix pushed a commit that referenced this issue Nov 12, 2018
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
popcornmix pushed a commit that referenced this issue Nov 15, 2018
popcornmix pushed a commit that referenced this issue Nov 19, 2018
popcornmix pushed a commit that referenced this issue Nov 21, 2018
popcornmix pushed a commit that referenced this issue Nov 23, 2018
popcornmix pushed a commit that referenced this issue Nov 28, 2018
popcornmix pushed a commit that referenced this issue Nov 28, 2018
lyakh pushed a commit to lyakh/linux that referenced this issue Nov 30, 2018
popcornmix pushed a commit that referenced this issue Dec 4, 2018
popcornmix pushed a commit that referenced this issue Dec 4, 2018
popcornmix pushed a commit that referenced this issue Dec 6, 2018
popcornmix pushed a commit that referenced this issue Dec 10, 2018
popcornmix pushed a commit that referenced this issue Dec 10, 2018
popcornmix pushed a commit that referenced this issue Dec 14, 2018
popcornmix pushed a commit that referenced this issue Dec 17, 2018
popcornmix pushed a commit that referenced this issue Dec 17, 2018
popcornmix pushed a commit that referenced this issue Oct 10, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Oct 10, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Oct 14, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Oct 14, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Oct 17, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Oct 21, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Oct 23, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Oct 28, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 1, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 5, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 6, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 8, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 11, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 18, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 18, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 18, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 25, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Nov 25, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 7, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 9, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 10, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 16, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 16, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Dec 20, 2024
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 <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 2, 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 <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 2, 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 <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 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 <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 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 <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 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 <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 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 <[email protected]>
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