From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Bechtold Date: Thu, 03 Mar 2011 09:52:03 +0000 Subject: Re: How to trigger a udev rule Message-Id: <4D6F64C3.20409@jpberlin.de> List-Id: References: <1299133287.2394.10.camel@salbei> In-Reply-To: <1299133287.2394.10.camel@salbei> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Hi Martin, On 03/03/11 09:54, Martin Pitt wrote: > Hello Thomas, > > funny that you ask, a few days ago someone asked exactly the same > thing in #udev. that was me:) > Thomas Bechtold [2011-03-03 7:21 +0100]: >> ### only check /dev/ttyS1 (atmel_usart.1) for modem ### >> ACTION!=3D"add|change", GOTO=3D"mm_platform_device_whitelist_end" >> SUBSYSTEM!=3D"platform", GOTO=3D"mm_platform_device_whitelist_end" >> DRIVERS=3D"atmel_usart",KERNELS=3D"atmel_usart.1",ENV{ID_MM_PLATFORM_DRI= VER_PROBE}=3D"1" >> LABEL=3D"mm_platform_device_whitelist_end" > > I'm afraid udevadm trigger doesn't support the same parental matching > as udev rules themselves do, so I don't think there can be a precise > trigger unless you already know the corresponding /dev/ttySn device > node. If you do, then just do > > udevadm trigger --sysname-match=3DttySn i know the device name. it's always ttyS1. But your trigger does not=20 match the rule: # udevadm trigger --sysname-match=3DttyS1 --verbose /sys/devices/platform/atmel_usart.1/tty/ttyS1 I tried to do this with udevadm (modemmanager is running in background=20 and log is written to sdtout): # udevadm trigger --action=ADd --subsystem-match=3Dtty=20 --subsystem-match=3Dplatform --sysname-match=3DttyS1 --verbose /sys/devices/platform/atmel_usart.1/tty/ttyS1 Here, ModemManager does nothing. When i execute the command with ttyS0, the output is: # udevadm trigger --action=ADd --subsystem-match=3Dtty=20 --subsystem-match=3Dplatform --sysname-match=3DttyS0 --verbose /sys/devices/platform/atmel_usart.1/tty/ttyS0 modem-manager[772]: [1299145393.216952] [mm-manager.c:802]=20 device_added(): (tty/ttyS0): port's parent platform driver is not=20 whitelisted Here, ModemManager detects the trigger. I think the question is how to set DRIVERS=3D"atmel_usart" and=20 KERNELS=3D"atmel_usart.1" !? Cheers, Tom