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

udev pwm vs gpio on 4.9.78-ti-r94 #1 SMP PREEMPT Fri Jan 26 21:26:24 UTC 2018 #139

Open
ghost opened this issue Oct 11, 2019 · 3 comments
Open

Comments

@ghost
Copy link

ghost commented Oct 11, 2019

Hello,
This is on BBB or BBG. Trying to have the /sys/class/pwm/pwmchip#/pwm# as non root:root.
IN the ditro I have there are udev rules for gpio and pwm to chown them as root:gpio and root:pwm on udev events, though...

/sys/class/gpio$ echo 24 > ./export it does
udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[46318.324637] add      /devices/platform/ocp/44e07000.gpio/gpiochip0/gpio/gpio24 (gpio)
UDEV  [46318.648582] add      /devices/platform/ocp/44e07000.gpio/gpiochip0/gpio/gpio24 (gpio)

and the new gpio24 is indeed owned by goio user,
but

/sys/devices/platform/ocp/48304000.epwmss/48304200.pwm/pwm/pwmchip6$ echo 0 >export
does not trigger any udev event,

and the new /sys/class/pwm/pwmchip6/pwm0 is owned by root

So, how do I make the new created node to be not owned by root:root

@RobertCNelson
Copy link
Member

@comarius this was fixed on Feb 5, 2018 with the release of 4.9.80-ti-r97, feel free to ugprade..

RobertCNelson/ti-linux-kernel-dev@09b7c9f#diff-e048185012bdb8bcbefadaf7c1c0dcd0

Regards,

@ghost ghost closed this as completed Oct 11, 2019
@ghost
Copy link
Author

ghost commented Oct 11, 2019

Thank you very much. Appreciated. I upgraded to 4.14.108-ti-r108
Now I see all the pwm's being at boot there, but any attempt to write to enable/duty/polarity

I did run config-pin on all PX.Y pwm's then I went to sys folder and ....

marius@beaglebone:/sys/class/pwm/pwmchip0/pwm-0:0$ echo 1 > polarity 
-bash: echo: write error: Invalid argument
marius@beaglebone:/sys/class/pwm/pwmchip0/pwm-0:0$ echo 1 > enable 
-bash: echo: write error: Invalid argument
marius@beaglebone:/sys/class/pwm/pwmchip0/pwm-0:0$ echo on > enable 
-bash: echo: write error: Invalid argument
marius@beaglebone:/sys/class/pwm/pwmchip0/pwm-0:0$ echo okay > enable 
-bash: echo: write error: Invalid argument
marius@beaglebone:/sys/class/pwm/pwmchip0/pwm-0:0$ echo 20000 > ./duty_cycle 
-bash: echo: write error: Invalid argument
marius@beaglebone:/sys/class/pwm/pwmchip0/pwm-0:0$ sudo su
[sudo] password for marius: 
root@beaglebone:/sys/devices/platform/ocp/48300000.epwmss/48300100.ecap/pwm/pwmchip0/pwm-0:0#  echo 20000 > ./duty_cycle
bash: echo: write error: Invalid argument
root@beaglebone:/sys/devices/platform/ocp/48300000.epwmss/48300100.ecap/pwm/pwmchip0/pwm-0:0#  echo 1 > ./enable 
bash: echo: write error: Invalid argument
root@beaglebone:/sys/devices/platform/ocp/48300000.epwmss/48300100.ecap/pwm/pwmchip0/pwm-0:0#  echo true > ./enable 
bash: echo: write error: Invalid argument
root@beaglebone:/sys/devices/platform/ocp/48300000.epwmss/48300100.ecap/pwm/pwmchip0/pwm-0:0#  echo on > ./enable 
bash: echo: write error: Invalid argument
root@beaglebone:/sys/devices/platform/ocp/48300000.epwmss/48300100.ecap/pwm/pwmchip0/pwm-0:0# 

@ghost ghost reopened this Oct 11, 2019
@RobertCNelson
Copy link
Member

@comarius at some point order of events changed.. do period before duty_cycle..

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant