Bug 2060490

Summary: kernels newer than 5.15.11-200.fc35 cause libgpiod to issue "Unknown error 517"
Product: [Fedora] Fedora Reporter: John Florian <trailtotale>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 35CC: acaringi, adscvr, airlied, alciregi, bcotton, bskeggs, droidbittin, hdegoede, jarodwilson, jeremy, jforbes, jglisse, jonathan, josef, jsavitz, kernel-maint, lgoncalv, linville, masami256, mattdm, mchehab, pbrobinson, ptalbert, pwhalen, steved, zulinx86
Target Milestone: ---Flags: bcotton: fedora_prioritized_bug-
trailtotale: needinfo-
Target Release: ---   
Hardware: aarch64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-30 08:57:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 245418    
Attachments:
Description Flags
journalctl -b --no-hostname -k (from 5.17.0-0.rc6.109.fc37.aarch64) none

Description John Florian 2022-03-03 15:42:25 UTC
Created attachment 1864021 [details]
journalctl -b --no-hostname -k (from 5.17.0-0.rc6.109.fc37.aarch64)

1. Please describe the problem:

libgpiod raises "Unknown error 517" for all attempts to manipulate GPIO pin states

2. What is the Version-Release number of the kernel:

Problem exists in kernel-5.15.12-200.fc35.aarch64 and later.  kernel-5.15.11-200.fc35.aarch64 and earlier work as expected.


3. Did it work previously in Fedora? If so, what kernel version did the issue
   *first* appear?  Old kernels are available for download at
   https://koji.fedoraproject.org/koji/packageinfo?packageID=8 :

Yes; see above.

4. Can you reproduce this issue? If so, please provide the steps to reproduce
   the issue below:

Yes, consistently.  Install an affected kernel (and libgpiod-utils) on a Raspberry Pi 4 and then:

# gpioset gpiochip0 22=1
gpioset: error setting the GPIO line values: Unknown error 517


5. Does this problem occur with the latest Rawhide kernel? To install the
   Rawhide kernel, run ``sudo dnf install fedora-repos-rawhide`` followed by
   ``sudo dnf update --enablerepo=rawhide kernel``:

Yes (using 5.17.0-0.rc6.109.fc37.aarch64)

6. Are you running any modules that not shipped with directly Fedora's kernel?:

None, everything is from fedora repos.

7. Please attach the kernel logs. You can get the complete kernel log
   for a boot with ``journalctl --no-hostname -k > dmesg.txt``. If the
   issue occurred on a previous boot, use the journalctl ``-b`` flag.

I didn't see anything notable, but it's attached nonetheless.

Comment 1 Justin M. Forbes 2022-03-03 17:56:50 UTC
https://lists.fedoraproject.org/archives/list/arm@lists.fedoraproject.org/thread/D5A7YLVSPXXOXGTNETIULVD4VW25EK5U/ might have some relevant information for you.

Comment 2 John Florian 2022-03-03 18:54:44 UTC
Thanks Justin, I hadn't stumbled onto that and it does look similar.  Also when creating this ticket I noticed #2047329 which also may be related.

Comment 3 Luna Jernberg 2022-04-06 14:47:56 UTC
<bcotton_, mattdm, jforbes> proposed #agreed BZ 2060490 is rejected as a Prioritized Bug as it appears to largely be an issue in upstream firmware

But the ARM and Kernel team, will work at it as they have time

Comment 4 Peter Robinson 2022-04-06 15:10:03 UTC
Can you try with a F-36 nightly image to see if it has the same issue please?

There's been changes between firmware <-> DT and <-> kernel that could cause this that should now be fixed but there's bits across the release that would need to be updated and I've not been updating RPi firmware on stable releases of late as they've tended to regress more than they fix.

Are you using DT overlays and the HAT configuration as per the wiki or just vanilla kernel DTs?

https://fedoraproject.org/w/index.php?title=Architectures/ARM/Raspberry_Pi/HATs#General_configuration

Comment 5 Peter Robinson 2022-06-30 08:57:12 UTC
So this is now known to work in Fedora 36/stable. Make sure you run rpi-uboot-update to ensure you have the latest stable versions of boot firmware.