linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Intermittent udev failures with USB devices
@ 2008-07-10  0:36 Leonid
  2008-07-10 22:58 ` Kay Sievers
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Leonid @ 2008-07-10  0:36 UTC (permalink / raw)
  To: linux-hotplug

Hi all,

I believe a bug has been introduced in recent Linux kernels that
causes udev rules to not be applied when the system is overloaded with
other tasks.  This is more easily seen on single core machines since
it is easier to overload the system.

My goal is to give all users read and write permissions to a USB
device.  To more easily reproduce the problem, I used a pre-existing
hardware test circuit where I can automatically plug and unplug a USB
device through software control.  At the same time I had the OS
writing a large file over NFS with the "dd" command and performing
other tasks if needed.  Intermittently, my permissions were not being
properly set by udev.  Everything else about the enumeration process
with the device was correct.

I am using an un-programmed Cypress microcontroller as my device.
These devices have a VID of 0x04B4 and a PID of 0x8613.  Therefore, my
udev rules file /etc/udev/rules.d/99-test.rules is simply:

ACTION="add", SUBSYSTEMS="usb", ATTRS{idVendor}="04b4",
ATTRS{idProduct}="8613", MODE="0666"

The problem appears under kernel 2.6.25.6 and 2.6.25.9 on different
motherboards.  It can also be reproduced (albeit intermittently) when
manually attaching USB devices to the system, as opposed to using my
convenient automated hardware circuit.  The same behavior was also
observed with a full-speed device.

I have tried this on kernel 2.6.23.1 and found that this was not
susceptible to this issue.  I have also tried 118 and 124 versions of
udev, and found that these particular versions of udev had no effect
on the pass/failure rate of the test.

Any help would be much appreciated.

Best regards,
-Leonid

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Intermittent udev failures with USB devices
  2008-07-10  0:36 Intermittent udev failures with USB devices Leonid
@ 2008-07-10 22:58 ` Kay Sievers
  2008-07-11 20:54 ` Leonid
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2008-07-10 22:58 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Jul 10, 2008 at 02:36, Leonid <leonidv11@gmail.com> wrote:
> I believe a bug has been introduced in recent Linux kernels that
> causes udev rules to not be applied when the system is overloaded with
> other tasks.  This is more easily seen on single core machines since
> it is easier to overload the system.
>
> My goal is to give all users read and write permissions to a USB
> device.  To more easily reproduce the problem, I used a pre-existing
> hardware test circuit where I can automatically plug and unplug a USB
> device through software control.  At the same time I had the OS
> writing a large file over NFS with the "dd" command and performing
> other tasks if needed.  Intermittently, my permissions were not being
> properly set by udev.  Everything else about the enumeration process
> with the device was correct.
>
> I am using an un-programmed Cypress microcontroller as my device.
> These devices have a VID of 0x04B4 and a PID of 0x8613.  Therefore, my
> udev rules file /etc/udev/rules.d/99-test.rules is simply:
>
> ACTION="add", SUBSYSTEMS="usb", ATTRS{idVendor}="04b4",
> ATTRS{idProduct}="8613", MODE="0666"
>
> The problem appears under kernel 2.6.25.6 and 2.6.25.9 on different
> motherboards.  It can also be reproduced (albeit intermittently) when
> manually attaching USB devices to the system, as opposed to using my
> convenient automated hardware circuit.  The same behavior was also
> observed with a full-speed device.
>
> I have tried this on kernel 2.6.23.1 and found that this was not
> susceptible to this issue.  I have also tried 118 and 124 versions of
> udev, and found that these particular versions of udev had no effect
> on the pass/failure rate of the test.
>
> Any help would be much appreciated.

I guess you need:
  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h.5f10e4f0a9649186d8a8c793822b2e0dae8373

Kay

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Intermittent udev failures with USB devices
  2008-07-10  0:36 Intermittent udev failures with USB devices Leonid
  2008-07-10 22:58 ` Kay Sievers
@ 2008-07-11 20:54 ` Leonid
  2008-07-15 13:56 ` Kay Sievers
  2008-07-15 18:25 ` Leonid
  3 siblings, 0 replies; 5+ messages in thread
From: Leonid @ 2008-07-11 20:54 UTC (permalink / raw)
  To: linux-hotplug

Hi Kay,

> I guess you need:
>  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h.5f10e4f0a9649186d8a8c793822b2e0dae8373

I guess I was just a few months behind on reporting this problem!  I
tried 2.6.26 RC3 and the permissions now seem to be reliably applied.

I'm not sure why I didn't encounter this problem on 2.6.23 given that
the patch description states this was a long-standing issue, but I
suppose that that is not worth exploring further.

Thank you very much for the pointer to the patch.  Thanks also to Alan
Stern for his fixing of this issue.

-Leonid

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Intermittent udev failures with USB devices
  2008-07-10  0:36 Intermittent udev failures with USB devices Leonid
  2008-07-10 22:58 ` Kay Sievers
  2008-07-11 20:54 ` Leonid
@ 2008-07-15 13:56 ` Kay Sievers
  2008-07-15 18:25 ` Leonid
  3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2008-07-15 13:56 UTC (permalink / raw)
  To: linux-hotplug

On Fri, 2008-07-11 at 13:54 -0700, Leonid wrote:
> > I guess you need:
> >  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h.5f10e4f0a9649186d8a8c793822b2e0dae8373
> 
> I guess I was just a few months behind on reporting this problem!  I
> tried 2.6.26 RC3 and the permissions now seem to be reliably applied.
> 
> I'm not sure why I didn't encounter this problem on 2.6.23 given that
> the patch description states this was a long-standing issue, but I
> suppose that that is not worth exploring further.

I'm pretty sure it's the new process scheduler, that works that well,
that we hit the timing issue with the event process before the kernel
has created the files. Long ago Con's scheduler triggered the same
problem, but we didn't really understand what was going wrong that time.
It should be all fine now.

Thanks,
Kay



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Intermittent udev failures with USB devices
  2008-07-10  0:36 Intermittent udev failures with USB devices Leonid
                   ` (2 preceding siblings ...)
  2008-07-15 13:56 ` Kay Sievers
@ 2008-07-15 18:25 ` Leonid
  3 siblings, 0 replies; 5+ messages in thread
From: Leonid @ 2008-07-15 18:25 UTC (permalink / raw)
  To: linux-hotplug

Hi Kay,

> I'm pretty sure it's the new process scheduler, that works that well,
> that we hit the timing issue with the event process before the kernel
> has created the files. Long ago Con's scheduler triggered the same
> problem, but we didn't really understand what was going wrong that time.
> It should be all fine now.

That's interesting.  I had a suspicion it could be something like this
but wasn't sure.  Thanks for the explanation.

-Leonid

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-07-15 18:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-10  0:36 Intermittent udev failures with USB devices Leonid
2008-07-10 22:58 ` Kay Sievers
2008-07-11 20:54 ` Leonid
2008-07-15 13:56 ` Kay Sievers
2008-07-15 18:25 ` Leonid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).