Debian Bug report logs - #274877
usb.agent broken -- does not always call hotplug script

version graph

Package: hotplug; Maintainer for hotplug is (unknown);

Reported by: Joachim Nilsson <joachim.nilsson@member.fsf.org>

Date: Mon, 4 Oct 2004 14:33:01 UTC

Severity: important

Found in version 0.0.20040329-15

Fixed in version hotplug/0.0.20040329-16

Done: Fumitoshi UKAI <ukai@debian.or.jp>

Bug is archived. No further changes may be made.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, joachim.nilsson@member.fsf.org, Fumitoshi UKAI <ukai@debian.or.jp>:
Bug#274877; Package hotplug. (full text, mbox, link).


Acknowledgement sent to Joachim Nilsson <joachim.nilsson@member.fsf.org>:
New Bug report received and forwarded. Copy sent to joachim.nilsson@member.fsf.org, Fumitoshi UKAI <ukai@debian.or.jp>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Joachim Nilsson <joachim.nilsson@member.fsf.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: usb.agent broken -- does not always call hotplug script
Date: Mon, 04 Oct 2004 16:17:16 +0200
Package: hotplug
Version: 0.0.20040329-15
Severity: important

There is a patch, see below, to the current hotplug package where
usb.agent checks if a driver already knows of a device.  The comment
says:

	"# XXX: check the driver already know the device or not"

This patch stops the hotplug scripts from being called properly.

Imagine a device which needs special firmware to be loaded each time
the device is plugged in.  When first plugged in the device reports
PRODUCT=4b4/8613/4 -- the modules.usbmap is searched for a suitable
driver and usbtest is loaded.  The hotplug script is called and the
firmware is loaded from that using the fxload tool. The device is
programmed with a new firmware, disconnects itself and comes back
up again with a new ID, PRODUCT=fff0/fff0/0 -- this time the hotplug
script is not run by the Debian hotplug package, instead a message
is displayed in /var/log/messages:

usbtest already know /devices/pci0000:00/0000:00:1d.7/usb4/4-4/4-4.1/4-4.1:1.0, skipped

Now the device is unplugged and the reconnected in the same port,
the firmware is lost because the device loses power when disconnected
et voila, the log says:

usbtest already know /devices/pci0000:00/0000:00:1d.7/usb4/4-4/4-4.1/4-4.1:1.0, skipped

The official usb.agent script from linux-hotplug.sf.net, in the tgz
hotplug-2004_03_29.tar.gz, does not have this patch so it's 
definately a Debian introduction that breaks the hotplug scripts.

The general idea of the hotplug scripts is that registered hotplug
scripts be run *every* time there is a hotplug event concerning the
associated device.  Thus the device hardware can be trusted to always
be initialized in a deterministic way.

Please remove this patch and upload a new .deb in time before
Sarge is released.

--- usb.agent   2004-03-26 23:36:38.000000000 +0100
+++ usb.agent-debian    2004-07-18 16:00:55.000000000 +0200
@@ -330,6 +333,24 @@
        fi

        # It was a match!
+
+       # XXX: check the driver already know the device or not
+       if [ "$DEVPATH" != "" -a -d "$SYSFS/bus/usb/drivers/$module" ]; then
+           found=false
+           devpath=$(readlink -f $SYSFS/$DEVPATH)
+           for devs in $SYSFS/bus/usb/drivers/$module/*
+           do
+              if [ -d $devs -a "$(readlink -f $devs)" = "$devpath" ]; then
+                  # this $module already know the device, so we dont
+                  # need to load the driver ?
+                  found=true
+              fi
+           done
+           if [ "$found" = "true" ]; then
+               debug_mesg " $module already know $DEVPATH, skipped"
+               continue
+           fi
+       fi
        DRIVERS="$module $DRIVERS"
        : drivers $DRIVERS
     done


Thanks
 /Jocke

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-1-686
Locale: LANG=C, LC_CTYPE=C

Versions of packages hotplug depends on:
ii  debconf                      1.4.30.7    Debian configuration management sy
ii  grep                         2.5.1.ds1-3 GNU grep, egrep and fgrep
ii  module-init-tools            3.1-pre5-7  tools for managing Linux kernel mo
ii  modutils                     2.4.26-1    Linux module utilities
ii  procps                       1:3.2.1-2   The /proc file system utilities

-- debconf information:
* hotplug/ignore_pci_class_display: true
* hotplug/net_agent_policy: hotplug
* hotplug/usb_keyboard:
* hotplug/static_module_list: cdc-acm
  hotplug/x11_usbmice_hack: false



Information forwarded to debian-bugs-dist@lists.debian.org, Fumitoshi UKAI <ukai@debian.or.jp>:
Bug#274877; Package hotplug. (full text, mbox, link).


Acknowledgement sent to Marco d'Itri <md@Linux.IT>:
Extra info received and forwarded to list. Copy sent to Fumitoshi UKAI <ukai@debian.or.jp>. (full text, mbox, link).


Message #10 received at 274877@bugs.debian.org (full text, mbox, reply):

From: Marco d'Itri <md@Linux.IT>
To: Joachim Nilsson <joachim.nilsson@member.fsf.org>, 274877@bugs.debian.org
Subject: Re: Bug#274877: usb.agent broken -- does not always call hotplug script
Date: Mon, 4 Oct 2004 19:50:51 +0200
On Oct 04, Joachim Nilsson <joachim.nilsson@member.fsf.org> wrote:
 
> This patch stops the hotplug scripts from being called properly.
After a first quick check, I think you are right.
Probably #237952 was bogus anyway (now I know about the support for
multiple interfaces introduced by 2.6 kernels).

-- 
ciao, |
Marco | [8352 di5r.qq1CAmPw]



Information forwarded to debian-bugs-dist@lists.debian.org, Fumitoshi UKAI <ukai@debian.or.jp>:
Bug#274877; Package hotplug. (full text, mbox, link).


Acknowledgement sent to Joachim Nilsson <crash@vmlinux.org>:
Extra info received and forwarded to list. Copy sent to Fumitoshi UKAI <ukai@debian.or.jp>. (full text, mbox, link).


Message #15 received at 274877@bugs.debian.org (full text, mbox, reply):

From: Joachim Nilsson <crash@vmlinux.org>
To: Marco d'Itri <md@Linux.IT>
Cc: Joachim Nilsson <joachim.nilsson@member.fsf.org>, 274877@bugs.debian.org
Subject: Re: Bug#274877: usb.agent broken -- does not always call hotplug script
Date: Mon, 4 Oct 2004 20:38:25 +0200
On Mon, Oct 04, 2004 at 07:50:51PM +0200, Marco d'Itri wrote:
> On Oct 04, Joachim Nilsson <joachim.nilsson@member.fsf.org> wrote:
> > This patch stops the hotplug scripts from being called properly.
> After a first quick check, I think you are right.
> Probably #237952 was bogus anyway (now I know about the support for
> multiple interfaces introduced by 2.6 kernels).

It's OK if hotplug tries to load the module when it's already
loaded.  In its current implementation the module load and
exec of the hotplug script are joined at the hip, so to speak,
so it does not matter.  As long as the hotplug script is 
allowed to run every time the kernel generates a hotplug
event we're home free.  

I forgot to mention in my first message that the usb.agent from
the upstream sources worked perfectly.  But maybe you could
extrapolate that from the rest of the message?

In cases where a device generates several hotplug events it
is either because of several stages of firmware load (e.g.,
a Cypress FX2 USB2 chip in stage one and an FPGA in the
second stage), or the device is broken and yields spurious
disconnects.  In either case the hotplug script needs to
run to load each of the stages in the first case or reload
the broken device in the second case.

There is of course a chance that the hotplug script used in
#237952 was broken -- or that the kernel/driver got stuck
somehow in calling request_firmware_load().  But that's just
guesswork, of course.

Regards
 /Joachim

--  
Joachim Nilsson  :: <joachim AT vmlinux DOT org>
+46-(0)21-123348 :: <http://joachim.vmlinux.org>



Reply sent to Fumitoshi UKAI <ukai@debian.or.jp>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Joachim Nilsson <joachim.nilsson@member.fsf.org>:
Bug acknowledged by developer. (full text, mbox, link).


Message #20 received at 274877-close@bugs.debian.org (full text, mbox, reply):

From: Fumitoshi UKAI <ukai@debian.or.jp>
To: 274877-close@bugs.debian.org
Subject: Bug#274877: fixed in hotplug 0.0.20040329-16
Date: Wed, 27 Oct 2004 22:32:06 -0400
Source: hotplug
Source-Version: 0.0.20040329-16

We believe that the bug you reported is fixed in the latest version of
hotplug, which is due to be installed in the Debian FTP archive:

hotplug_0.0.20040329-16.diff.gz
  to pool/main/h/hotplug/hotplug_0.0.20040329-16.diff.gz
hotplug_0.0.20040329-16.dsc
  to pool/main/h/hotplug/hotplug_0.0.20040329-16.dsc
hotplug_0.0.20040329-16_all.deb
  to pool/main/h/hotplug/hotplug_0.0.20040329-16_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 274877@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Fumitoshi UKAI <ukai@debian.or.jp> (supplier of updated hotplug package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 27 Oct 2004 03:45:57 +0900
Source: hotplug
Binary: hotplug
Architecture: source all
Version: 0.0.20040329-16
Distribution: unstable
Urgency: medium
Maintainer: Fumitoshi UKAI <ukai@debian.or.jp>
Changed-By: Fumitoshi UKAI <ukai@debian.or.jp>
Description: 
 hotplug    - Linux Hotplug Scripts
Closes: 261303 266054 266389 267020 267355 271151 274637 274877 275687 275821
Changes: 
 hotplug (0.0.20040329-16) unstable; urgency=medium
 .
   * debian/patches/013_load_drivers_check_module_dup:
     use | as separator
     closes: Bug#267020
   * debian/patches/012_usb.agent_check_driver: removed
     always try to load modules and call hotplug script
     closes: Bug#274877
     (Bug#237952 was broken)
   * debian/patches/012_usb.rc_fix_coldplugging: don't remove initialization
     of $PRODUCT or other environment variable
     fix D-I [i386] [netinst CD] [RC1] "Bad USB agent invocation" during
     reboot on linux 2.4
     closes: Bug#266054, Bug#261303
   * debian/patches/054_number_of_files_without_wc:
     introduce number_of_files that doesn't use wc -l, because
     /etc/hotplug/usb.rc broken when /usr is nfs mounted.
     closes: Bug#271151
   * debian/patches/055_which_by_command-v:
     use command -v in case /usr is not yet mounted (NFS for example)
   * debian/config, debian/hotplug.postinst: STATIC_MODULE_LIST should
     be space separated, whereas debconf use comma separated
     closes: Bug#274637
   * debian/hotplug: don't make unnecessary /etc/default/hotplug.dpkg-old
     closes: Bug#266389
   * debian/README.Debian: fix URL of ieee1394 FAQ
     closes: Bug#267355
   * debian/po/de.po: update
     closes: Bug#275821
   * debian/po/it.po: added
     closes: Bug#275687
Files: 
 d089153b9c5dd71347b2e0aca9db6e5c 673 admin standard hotplug_0.0.20040329-16.dsc
 6e877d73d43d12f7bf29aabd44b0d068 44057 admin standard hotplug_0.0.20040329-16.diff.gz
 bed56aeec2abf315122a78682400aaf4 62004 admin standard hotplug_0.0.20040329-16_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBf8qx9D5yZjzIjAkRAuX2AKCB0j1HUrORWYVo4IMqZq+NAlVv9wCgry/z
bBVXaf8NVj5AdNpMSwXeqn8=
=oha7
-----END PGP SIGNATURE-----




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Jan 23 19:51:08 2026; Machine Name: berlioz

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.