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

Use of the uart1-midi overlay results in -22 (EINVAL) error when attempting to register UART1. #3700

Closed
billj-korg opened this issue Jul 1, 2020 · 4 comments

Comments

@billj-korg
Copy link

Describe the bug
This is a follow-up to issue #3312.

[    0.186001] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    0.186598] bcm2835-aux-uart 3f215040.serial: unable to register 8250 port - -22
[    0.186649] bcm2835-aux-uart: probe of 3f215040.serial failed with error -22

In that issue, @pelwell asked to try it without using the uart1-midi overlay. I have tried that and verified that UART1 successfully registers. However, when trying to use the uart1-midi overlay, the above error is encountered.

To reproduce

Expected behaviour
Should be able to use uart1-midi overlay without error.

Actual behaviour
EINVAL error code encountered when attempting to register UART1 when the uart1-midi overlay is specified.

System
Linux Korg 4.19.120-v8 #1 SMP PREEMPT Mon May 4 13:25:21 UTC 2020 aarch64 GNU/Linux

Running on a CM3.

vcgencmd version:
May 1 2020 18:00:21
Copyright (c) 2012 Broadcom
version 688a8f8f3d84e788f07f53c93693e1705f68c407 (clean) (release) (start)

Logs

Additional context

pelwell added a commit that referenced this issue Jul 2, 2020
See: #3700

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

pelwell commented Jul 2, 2020

There's a nasty initialisation-order problem caused by the fact that certain clocks are initialised very early. In this case, the fixed-factor-clock that adjusts the normal UART baud rate is initialised before the parent clock, and the clock framework handles this by pretending that the source clock is running at 0Hz. Unfortunately the UART only asks for the clock rate once, and zero isn't a useful number, so it is better to interpret that as meaning that the source clock isn't ready and returning -EPROBE_DEFER.

The fix is in the rpi-5.4.y source tree (857e41a). There will likely be a kernel+firmware release in the next few days, at which point you'll be able to sudo rpi-update to get the fix.

@billj-korg
Copy link
Author

I am using a custom yocto build, so the rpi-update method is not available. However, I was able to apply your patch to the 4.19 version that our recipe calls for and that allows the midi overlay to be used with UART1 successfully registering. I have a few more hoops to jump through here to be able to confirm that the serial port is indeed functioning as expected. I'll confirm those results as soon as I can test. Thank you for the quick response!

@billj-korg
Copy link
Author

Also confirmed that the serial port is working at the MIDI baud rate. This confirms that the fix in the patch above works when applied to the 4.19.120-v8 kernel.

pelwell added a commit that referenced this issue Jul 3, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
pelwell added a commit that referenced this issue Jul 3, 2020
See: #3700

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

pelwell commented Jul 3, 2020

I'm going to close this issue then.

@pelwell pelwell closed this as completed Jul 3, 2020
popcornmix pushed a commit that referenced this issue Jul 13, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jul 13, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jul 20, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 10, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
rsglobal pushed a commit to GloDroid/glodroid_forks that referenced this issue Aug 12, 2020
See: raspberrypi/linux#3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 12, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 15, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 15, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 19, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 19, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 1, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 1, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 10, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 11, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 15, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 15, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 28, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 28, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Oct 2, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Oct 7, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Oct 7, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Oct 12, 2020
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Feb 19, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Feb 19, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Feb 23, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Feb 23, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 5, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 5, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 5, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 11, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 11, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 19, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 19, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 27, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 27, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Mar 27, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 3, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 5, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 5, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 8, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 11, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 16, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 16, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 18, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 23, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 29, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Apr 29, 2024
See: #3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
jai-raptee pushed a commit to jai-raptee/iliteck1 that referenced this issue Apr 30, 2024
See: raspberrypi/linux#3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
jai-raptee pushed a commit to jai-raptee/iliteck1 that referenced this issue Apr 30, 2024
See: raspberrypi/linux#3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
jai-raptee pushed a commit to jai-raptee/iliteck1 that referenced this issue Apr 30, 2024
See: raspberrypi/linux#3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
jai-raptee pushed a commit to jai-raptee/iliteck1 that referenced this issue Apr 30, 2024
See: raspberrypi/linux#3700

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
jai-raptee pushed a commit to jai-raptee/iliteck1 that referenced this issue Apr 30, 2024
See: raspberrypi/linux#3700

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

2 participants