<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Am 17.03.2014 um 18:57 schrieb Radek Polak:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="font-family: 'DejaVu Sans Mono'; font-size: 9pt; font-weight: 400; font-style: normal; "><div style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">On Monday, March 17, 2014 05:16:46 PM Dr. H. Nikolaus Schaller wrote:</div><p style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> </p><div style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">> Finally it turns out that instantiating the drivers by DT gives them</div><div style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">> different names and positions in the /sysfs - and therefore the udev rules</div><div style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">> fail.</div><div style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">> </div><div style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">> Even worse: it appears that the nodes are no longer in the same subtree</div><div style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">> but in different ones.</div><p style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> </p><div style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">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.</div><p style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "> </p><div style="white-space: pre-wrap; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; ">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.</div></div></span></blockquote><br></div><div>The problem is not debugging them - it is known what is wrong.</div><div>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.</div><div><br></div><div>BR,</div><div>Nikolaus</div><div><br></div>PS: the current rule is:<div><br></div><div><div># 500 mA charger</div><div>SUBSYSTEM=="power_supply", ACTION=="change", DEVPATH=="*power_supply/twl4030_usb" ATTRS{1-0048/twl4030_usb/id}=="floating", ATTR{../../max_current}="500000"</div><div># 1A charger</div><div>SUBSYSTEM=="power_supply", ACTION=="change", DEVPATH=="*power_supply/twl4030_usb" ATTRS{1-0048/twl4030_usb/id}=="102k", ATTR{../../max_current}="851000"</div><div># 2A charger</div><div>SUBSYSTEM=="power_supply", ACTION=="change", DEVPATH=="*power_supply/twl4030_usb" ATTRS{1-0048/twl4030_usb/id}=="GND", ATTR{../../max_current}="851000"</div></div><div><br></div><div>* the devpath is at /sys/class/power_supply/twl4030_usb</div><div>* the 1-0048/twl4030_usb/id has moved to /sys/devices/68000000.ocp/48070000.i2c/i2c-0/0-0048/twl4030-usb.36/id</div><div>* the ../../max_current has moved to device/max_current (? if relative names are as I interpret them)</div><div><br></div><div>So the questions are specifically:</div><div>* how can a udev rule modify a "foreign" attribute (if at all)?</div><div>* does this need another rule that symlinks the twl4030-usb.36/id to a stable location in the file system?</div><div>* how can the udev rule know the path and number 36?</div><div><br></div></body></html>