Skip to content

vcio rewrite #4624

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

Merged
merged 2 commits into from
Oct 15, 2021
Merged

vcio rewrite #4624

merged 2 commits into from
Oct 15, 2021

Conversation

pelwell
Copy link
Contributor

@pelwell pelwell commented Oct 12, 2021

#4620 identified a problem with kernel startup ordering that can break the vcio device. This PR avoids the problem by making vcio a platform device, instantiated from Device Tree.

Note that using the new driver will require a corresponding udev rule change (backwards-compatible):

KERNEL=="vcio", GROUP="video", MODE="0660"

(was SUBSYSTEM=="bcm2708_vcio", ...)

The old vcio driver is a simple character device that manually locates
the firmware driver. Initialising it before the firmware driver causes
a failure, and no retries are attempted.

Rewrite vcio as a platform driver that depends on a DT node for its
instantiation and the location of the firmware driver, making use of
the miscdevice framework to reduce the code size.

N.B. Using miscdevice changes the udev SUBSYSTEM string, so a change
to the companion udev rule is required in order to continue to set
the correct device permissions, e.g.:

    KERNEL="vcio", GROUP="video", MODE="0660"

See: raspberrypi#4620

Signed-off-by: Phil Elwell <[email protected]>
In order to resolve a potential startup order bug, the vcio driver has
been rewritten as a platform driver that depends on a DT node for
its instantiation and to locate the firmware driver.

Add that DT node.

See: raspberrypi#4620

Signed-off-by: Phil Elwell <[email protected]>
@pelwell pelwell marked this pull request as ready for review October 14, 2021 13:08
@pelwell
Copy link
Contributor Author

pelwell commented Oct 14, 2021

@vianpl @waveform80 @Dark-Sky @graysky2 I'd like to merge this PR soon but also want to warn you about the possible need to update your udev rules as shown above. If you are make that change, I would recommend also changing the rule for vchiq in the same way:

KERNEL=="vcio", GROUP="video", MODE="0660"
KERNEL=="vchiq", GROUP="video", MODE="0660"

@vianpl
Copy link
Contributor

vianpl commented Oct 14, 2021

@mbgg ⬆️
@pelwell Thanks for letting us know! 🙂

@graysky2
Copy link

@pelwell - Thanks for the heads-up

@pelwell
Copy link
Contributor Author

pelwell commented Oct 14, 2021

I should also have mentioned that it is safe to make the udev changes now - they are backwards compatible.

graysky2 added a commit to graysky2/kodi-standalone-service that referenced this pull request Oct 14, 2021
@graysky2
Copy link

@pelwell - For Arch ARM, I believe this change only affects a single line. Can you view the above mentioned commit in my udev rules for kodi for sanity?

@pelwell
Copy link
Contributor Author

pelwell commented Oct 14, 2021

That looks fine (although it doesn't need the extra space).

The vchiq change is only in linux-next at the moment, so you have plenty of time to roll out your patch.

@graysky2
Copy link

Thanks, if it is backwards compatible I will just work it in sooner than later or else I might forgot 😄

@Dark-Sky
Copy link

@pelwell Thank you very much for the heads up!

@pelwell pelwell merged commit 046e2dc into raspberrypi:rpi-5.10.y Oct 15, 2021
@pelwell pelwell deleted the vcio_rewrite branch October 15, 2021 11:18
@pelwell
Copy link
Contributor Author

pelwell commented Oct 15, 2021

Thank you all - this PR has now been merged. Send any complaints in my direction.

@pelwell
Copy link
Contributor Author

pelwell commented Oct 15, 2021

P.S. RPiOS users can install the updated udev rule with:

$ sudo apt update
$ sudo apt install libraspberrypi0

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Oct 15, 2021
See: raspberrypi/linux#4624

kernel: Wrap PWM output as GPIO
See: raspberrypi/linux#4629

kernel: mmc: sdhost: Pass DT pointer to rpi_firmware_get
kernel: ARM: dts: Give sdhost a firmware reference
See: raspberrypi/linux#4631

kernel: rtc: pcf85063: Always clear EXT_TEST from set_time
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Oct 15, 2021
See: raspberrypi/linux#4624

kernel: Wrap PWM output as GPIO
See: raspberrypi/linux#4629

kernel: mmc: sdhost: Pass DT pointer to rpi_firmware_get
kernel: ARM: dts: Give sdhost a firmware reference
See: raspberrypi/linux#4631

kernel: rtc: pcf85063: Always clear EXT_TEST from set_time
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

Successfully merging this pull request may close these issues.

4 participants