[Gta04-owner] Kernel 3.14-rc7

Dr. H. Nikolaus Schaller hns at goldelico.com
Mon Mar 17 19:24:17 CET 2014

Am 17.03.2014 um 18:57 schrieb Radek Polak:

> On Monday, March 17, 2014 05:16:46 PM Dr. H. Nikolaus Schaller wrote:
> > Finally it turns out that instantiating the drivers by DT gives them
> > different names and positions in the /sysfs - and therefore the udev rules
> > fail.
> > 
> > Even worse: it appears that the nodes are no longer in the same subtree
> > but in different ones.
> Sysfs paths were never very stable across different kernels - you can see it e.g. in QtMoko git log how many commits are just sysfs path changes.
> I always supported just one kernel in QtMoko userspace and made sure that sysfs files error handling is properly done - i.e. writing warnings if files were not found. I think you can achieve something similar for udev by using udevadm. It has options for debugging uevents.

The problem is not debugging them - it is known what is wrong.
It is one step before debugging: finding out how it should work (within the new environment). Then we can debug if it still isn't.


PS: the current rule is:

# 500 mA charger
SUBSYSTEM=="power_supply", ACTION=="change", DEVPATH=="*power_supply/twl4030_usb" ATTRS{1-0048/twl4030_usb/id}=="floating", ATTR{../../max_current}="500000"
# 1A charger
SUBSYSTEM=="power_supply", ACTION=="change", DEVPATH=="*power_supply/twl4030_usb" ATTRS{1-0048/twl4030_usb/id}=="102k", ATTR{../../max_current}="851000"
# 2A charger
SUBSYSTEM=="power_supply", ACTION=="change", DEVPATH=="*power_supply/twl4030_usb" ATTRS{1-0048/twl4030_usb/id}=="GND", ATTR{../../max_current}="851000"

* the devpath is at /sys/class/power_supply/twl4030_usb
* the 1-0048/twl4030_usb/id has moved to /sys/devices/68000000.ocp/48070000.i2c/i2c-0/0-0048/twl4030-usb.36/id
* the ../../max_current has moved to device/max_current (? if relative names are as I interpret them)

So the questions are specifically:
* how can a udev rule modify a "foreign" attribute (if at all)?
* does this need another rule that symlinks the twl4030-usb.36/id to a stable location in the file system?
* how can the udev rule know the path and number 36?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20140317/adbdd843/attachment.html>

More information about the Gta04-owner mailing list