-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Allow the default user to access the new gpio character device #2289
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
Comments
I'm in favour - an efficient user-space GPIO API has been long overdue. @XECDesign Can we insert this as line 6 of (*) Minor correction - on 4.14 the brcmvirt-gpio driver shows "led0" for line 0, but that's all. |
I remember a discussion with the gpio maintainer Linus Walleij on the
Raspberry Kernel mailing list, where the issue of labels came up. Some, me
included, pushed back against using the physical header pin numbers, as we
seem to have finally settled on GPIO numbers - and reverting this might
only add to confusion. Linus solicited feedback, but I don’t know what
became with the patch ultimately.
My prime motivation for wanting to try out this API is that I *believe* it
will allow us to set and clear pull-ups. Currently board seems to come up
with the pull-ups set to defaults as per datasheet, which seems pretty
random.
…On Mon 27. Nov 2017 at 14:22, Phil Elwell ***@***.***> wrote:
I'm in favour - an efficient user-space GPIO API has been long overdue.
@XECDesign <https://github.com/xecdesign> Can we insert this as line 6 of
/etc/udev/rules.d/99-com.rules? At some point we should also add the new
kernel-supplied tools (lsgpio, gpio-hammer and gpio-event-mon) to the
distro, but the current output isn't pretty - all the pins are marked as
unused, with no helpful labels(*).
(*) Minor correction - on 4.14 the brcmvirt-gpio driver shows "led0" for
line 0, but that's all.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2289 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEt2K59dlEvmsl-Uzi558xqUWuMETdmhks5s6rcwgaJpZM4Qq2_y>
.
|
I want to see BRCM GPIO/"pin" numbering everywhere - it's used exclusively by the firmware and the kernel, and it's guaranteed to make sense on any arbitrary hardware design (how would you use 40-pin header values on a Compute Module?). If you have any feedback for us in terms of how to make the new GPIO interface more usable, or warnings about problems you have encountered, then please let us know. |
Added: RPi-Distro/raspberrypi-sys-mods@bd5a201 I'll need to create a package for |
Thank you!
…On Mon 27. Nov 2017 at 15:07, XECDesign ***@***.***> wrote:
Added: ***@***.***
<RPi-Distro/raspberrypi-sys-mods@bd5a201>
It should show up in apt in a week or two.
I'll need to create a package for lsgpio and the others, but I'll save
that for later.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2289 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEt2K9HmPV90rVy58KmmxjLTJrmBGCFhks5s6sHTgaJpZM4Qq2_y>
.
|
As a reference here is the lsgpio output of a Raspberry Pi 1 B with upstream 4.14:
|
@XECDesign Can be closed? |
@JamesH65 The updated |
Wanted to correct what I posted above: I realized that currently the new API does not allow the setting and clearing of pull-up/down resistors. I confused them with setting open source / open drain, but these things seem to be orthogonal really. |
From my point of view it should be easier to add a pull-up/down IOCTL instead of extending the sysfs. |
I'm happy for us to be supporting the new interface, whether or not it supports the setting of pulls yet. Let's keep this open until we've added the new utilities. |
@lategoodbye Agree. The new (IOCTL) interface already has an extensible |
Anyone have any progress to report on this one? Would be nice to know what stage we are at. |
@pelwell Anything to report? |
Last we heard we were waiting for |
@XECDesign @spl237 Is this now in your court? |
I don't feel a sense of urgency to add the gpio-utils package. Very few distros include them and there are many other binaries we don't include. The original issue is resolved. The new package would be for bonus points. |
Sure there is no urgency, but the sysfs-gpio is obsolete since 2016. Edit: I know you don't care about mainline, but CONFIG_GPIO_SYSFS has been disabled in multi_v7_defconfig and arm64/defconfig since 2016-11-30 (Linux 4.10). |
This issue will be closed within 30 days unless further interactions are posted. If you wish this issue to remain open, please add a comment. A closed issue may be reopened if requested. |
Bumping it since it's probably time to package up gpio-utils. |
|
Nice. |
[ Upstream commit 2a9de42 ] ====================================================== WARNING: possible circular locking dependency detected 6.5.0-kfd-yangp #2289 Not tainted ------------------------------------------------------ kworker/0:2/996 is trying to acquire lock: (srcu){.+.+}-{0:0}, at: __synchronize_srcu+0x5/0x1a0 but task is already holding lock: ((work_completion)(&svms->deferred_list_work)){+.+.}-{0:0}, at: process_one_work+0x211/0x560 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 ((work_completion)(&svms->deferred_list_work)){+.+.}-{0:0}: __flush_work+0x88/0x4f0 svm_range_list_lock_and_flush_work+0x3d/0x110 [amdgpu] svm_range_set_attr+0xd6/0x14c0 [amdgpu] kfd_ioctl+0x1d1/0x630 [amdgpu] __x64_sys_ioctl+0x88/0xc0 -> #2 (&info->lock#2){+.+.}-{3:3}: __mutex_lock+0x99/0xc70 amdgpu_amdkfd_gpuvm_restore_process_bos+0x54/0x740 [amdgpu] restore_process_helper+0x22/0x80 [amdgpu] restore_process_worker+0x2d/0xa0 [amdgpu] process_one_work+0x29b/0x560 worker_thread+0x3d/0x3d0 -> #1 ((work_completion)(&(&process->restore_work)->work)){+.+.}-{0:0}: __flush_work+0x88/0x4f0 __cancel_work_timer+0x12c/0x1c0 kfd_process_notifier_release_internal+0x37/0x1f0 [amdgpu] __mmu_notifier_release+0xad/0x240 exit_mmap+0x6a/0x3a0 mmput+0x6a/0x120 do_exit+0x322/0xb90 do_group_exit+0x37/0xa0 __x64_sys_exit_group+0x18/0x20 do_syscall_64+0x38/0x80 -> #0 (srcu){.+.+}-{0:0}: __lock_acquire+0x1521/0x2510 lock_sync+0x5f/0x90 __synchronize_srcu+0x4f/0x1a0 __mmu_notifier_release+0x128/0x240 exit_mmap+0x6a/0x3a0 mmput+0x6a/0x120 svm_range_deferred_list_work+0x19f/0x350 [amdgpu] process_one_work+0x29b/0x560 worker_thread+0x3d/0x3d0 other info that might help us debug this: Chain exists of: srcu --> &info->lock#2 --> (work_completion)(&svms->deferred_list_work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&svms->deferred_list_work)); lock(&info->lock#2); lock((work_completion)(&svms->deferred_list_work)); sync(srcu); Signed-off-by: Philip Yang <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
[ Upstream commit 2a9de42 ] ====================================================== WARNING: possible circular locking dependency detected 6.5.0-kfd-yangp #2289 Not tainted ------------------------------------------------------ kworker/0:2/996 is trying to acquire lock: (srcu){.+.+}-{0:0}, at: __synchronize_srcu+0x5/0x1a0 but task is already holding lock: ((work_completion)(&svms->deferred_list_work)){+.+.}-{0:0}, at: process_one_work+0x211/0x560 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 ((work_completion)(&svms->deferred_list_work)){+.+.}-{0:0}: __flush_work+0x88/0x4f0 svm_range_list_lock_and_flush_work+0x3d/0x110 [amdgpu] svm_range_set_attr+0xd6/0x14c0 [amdgpu] kfd_ioctl+0x1d1/0x630 [amdgpu] __x64_sys_ioctl+0x88/0xc0 -> #2 (&info->lock#2){+.+.}-{3:3}: __mutex_lock+0x99/0xc70 amdgpu_amdkfd_gpuvm_restore_process_bos+0x54/0x740 [amdgpu] restore_process_helper+0x22/0x80 [amdgpu] restore_process_worker+0x2d/0xa0 [amdgpu] process_one_work+0x29b/0x560 worker_thread+0x3d/0x3d0 -> #1 ((work_completion)(&(&process->restore_work)->work)){+.+.}-{0:0}: __flush_work+0x88/0x4f0 __cancel_work_timer+0x12c/0x1c0 kfd_process_notifier_release_internal+0x37/0x1f0 [amdgpu] __mmu_notifier_release+0xad/0x240 exit_mmap+0x6a/0x3a0 mmput+0x6a/0x120 do_exit+0x322/0xb90 do_group_exit+0x37/0xa0 __x64_sys_exit_group+0x18/0x20 do_syscall_64+0x38/0x80 -> #0 (srcu){.+.+}-{0:0}: __lock_acquire+0x1521/0x2510 lock_sync+0x5f/0x90 __synchronize_srcu+0x4f/0x1a0 __mmu_notifier_release+0x128/0x240 exit_mmap+0x6a/0x3a0 mmput+0x6a/0x120 svm_range_deferred_list_work+0x19f/0x350 [amdgpu] process_one_work+0x29b/0x560 worker_thread+0x3d/0x3d0 other info that might help us debug this: Chain exists of: srcu --> &info->lock#2 --> (work_completion)(&svms->deferred_list_work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&svms->deferred_list_work)); lock(&info->lock#2); lock((work_completion)(&svms->deferred_list_work)); sync(srcu); Signed-off-by: Philip Yang <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
[ Upstream commit 2a9de42 ] ====================================================== WARNING: possible circular locking dependency detected 6.5.0-kfd-yangp #2289 Not tainted ------------------------------------------------------ kworker/0:2/996 is trying to acquire lock: (srcu){.+.+}-{0:0}, at: __synchronize_srcu+0x5/0x1a0 but task is already holding lock: ((work_completion)(&svms->deferred_list_work)){+.+.}-{0:0}, at: process_one_work+0x211/0x560 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 ((work_completion)(&svms->deferred_list_work)){+.+.}-{0:0}: __flush_work+0x88/0x4f0 svm_range_list_lock_and_flush_work+0x3d/0x110 [amdgpu] svm_range_set_attr+0xd6/0x14c0 [amdgpu] kfd_ioctl+0x1d1/0x630 [amdgpu] __x64_sys_ioctl+0x88/0xc0 -> #2 (&info->lock#2){+.+.}-{3:3}: __mutex_lock+0x99/0xc70 amdgpu_amdkfd_gpuvm_restore_process_bos+0x54/0x740 [amdgpu] restore_process_helper+0x22/0x80 [amdgpu] restore_process_worker+0x2d/0xa0 [amdgpu] process_one_work+0x29b/0x560 worker_thread+0x3d/0x3d0 -> #1 ((work_completion)(&(&process->restore_work)->work)){+.+.}-{0:0}: __flush_work+0x88/0x4f0 __cancel_work_timer+0x12c/0x1c0 kfd_process_notifier_release_internal+0x37/0x1f0 [amdgpu] __mmu_notifier_release+0xad/0x240 exit_mmap+0x6a/0x3a0 mmput+0x6a/0x120 do_exit+0x322/0xb90 do_group_exit+0x37/0xa0 __x64_sys_exit_group+0x18/0x20 do_syscall_64+0x38/0x80 -> #0 (srcu){.+.+}-{0:0}: __lock_acquire+0x1521/0x2510 lock_sync+0x5f/0x90 __synchronize_srcu+0x4f/0x1a0 __mmu_notifier_release+0x128/0x240 exit_mmap+0x6a/0x3a0 mmput+0x6a/0x120 svm_range_deferred_list_work+0x19f/0x350 [amdgpu] process_one_work+0x29b/0x560 worker_thread+0x3d/0x3d0 other info that might help us debug this: Chain exists of: srcu --> &info->lock#2 --> (work_completion)(&svms->deferred_list_work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&svms->deferred_list_work)); lock(&info->lock#2); lock((work_completion)(&svms->deferred_list_work)); sync(srcu); Signed-off-by: Philip Yang <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
I want to switch Processing from using the legacy sysfs interface to the new character device interface (
/dev/gpiochip*
). To make this possible, those devices should be owned by thegpio
group.The following line, added to
99-com.rules
achieves this:Could this be added for upcoming Raspbian releases? Thanks!
The text was updated successfully, but these errors were encountered: