cvs commit: patches/hotplug hotplug-2004_04_01-overcurrent-1.patch hotplug-2004_04_01-readlink-1.patch

jim at linuxfromscratch.org jim at linuxfromscratch.org
Mon May 17 10:53:36 PDT 2004


jim         04/05/17 11:53:36

  Added:       hotplug  hotplug-2004_04_01-overcurrent-1.patch
                        hotplug-2004_04_01-readlink-1.patch
  Log:
  Added: hotplug-2004_04_01-overcurrent-1.patch hotplug-2004_04_01-readlink-1.patch
  
  Revision  Changes    Path
  1.1                  patches/hotplug/hotplug-2004_04_01-overcurrent-1.patch
  
  Index: hotplug-2004_04_01-overcurrent-1.patch
  ===================================================================
  Submitted By: Alexander E. Patrakov
  Date: 2004-05-15
  Initial Package Version: 2004_04_01
  Upstream Status: needs more testing on LFS
  Origin: Alexander E. Patrakov
  Description: Probing wrong HCDs by brute force (as the original package does)
  may result in USB overcurrent messages from kernel. This patch removes such
  brute-force probing and relies on pci.rc to detect the proper HCD.
  May break functionality of non-PCI OHCI HCDs.
  
  diff -ur hotplug-2004_04_01/etc/hotplug/usb.rc hotplug-2004_04_01.tweaked/etc/hotplug/usb.rc
  --- hotplug-2004_04_01/etc/hotplug/usb.rc	2004-05-15 21:24:55.165442296 +0600
  +++ hotplug-2004_04_01.tweaked/etc/hotplug/usb.rc	2004-05-15 21:23:57.905147184 +0600
  @@ -139,6 +139,8 @@
       # assume we synthesize unless "usbfs" is clearly not initted (which
       # we currently need when synthesizing, anyway).
   
  +    # FIXME: this is wrong for LFS
  +
       SYNTHESIZE=true
       if [ ! -d /proc/bus/usb ]; then
   	SYNTHESIZE=false
  @@ -163,29 +165,9 @@
   	fi
       fi
   
  -    # Load Host Controller Drivers (HCDs) ... this automatically handles
  -    # systems with multiple controllers (EHCI, OHCI, UHCI) without needing
  -    # /proc or tools (lspci -v|grep USB, etc) to do so.  If hotplugging
  -    # is enabled on this system, initting a root hub will cause hotplug
  -    # events to fire for every device on the tree at that root.
  -
  -    # FIXME: some of this should be driven by PCI hotplugging, and have
  -    # the blacklist control which uhci driver gets used (before 2.5).
  -
  -    # "new style" HCDs ... more common code
  -    modprobe -q ehci-hcd >/dev/null 2>&1
  -    modprobe -q ohci-hcd >/dev/null 2>&1
  -    modprobe -q uhci-hcd >/dev/null 2>&1
  -
  -    # "old style" HCDs ... more driver-specific bugs
  -    modprobe -q usb-ohci >/dev/null 2>&1
  -    # NOTE: this prefers "uhci"; you may prefer "usb-uhci".
  -    # modprobe -q usb-uhci >/dev/null 2>&1 || modprobe -q uhci >/dev/null 2>&1
  -    modprobe -q uhci >/dev/null 2>&1 || modprobe -q usb-uhci >/dev/null 2>&1
  -
  -    # ... add any non-PCI HCDS here.  Examples include the
  -    # CRIS usb-host, Philips ISP-1161, Symlogic 811HS, and so on.
  -    # ohci-hcd can handle some non-pci variants.
  +    # Host Controller Drivers (HCDs) were loaded here in the original version...
  +    # But PCI hotplug already handles this, and probing wrong HCDs
  +    # leads to bogus overcurrent messages on Declan Moriarty's computer
   
       if [ -d /proc/bus/usb ]; then
   	# If we see there are no busses, we "failed" and
  @@ -211,6 +193,9 @@
       # hotplug events didn't fire during booting;
       # cope with devices that enumerated earlier
       # and may not have been fully configured.
  +
  +    # FIXME: why do they need sleep here?
  +
       if [ $SYNTHESIZE = true ]; then
   	sleep 1
       	usb_boot_events
  @@ -218,6 +203,9 @@
   
       # Some modules are statically loaded, perhaps because they are
       # needed to activate filesystem device nodes.
  +
  +    # FIXME: probably better handled by a separate "modules" script
  +
       for MODULE in $STATIC_MODULE_LIST; do
   	modprobe $MODULE
       done
  
  
  
  
  1.1                  patches/hotplug/hotplug-2004_04_01-readlink-1.patch
  
  Index: hotplug-2004_04_01-readlink-1.patch
  ===================================================================
  Submitted By: Alexander E. Patrakov
  Date: 2004-05-15
  Initial Package Version: 2004_04_01
  Upstream Status: Hack
  Origin: Alexander E. Patrakov
  Description: Readlink accepts only one argument but is called with two
  
  --- hotplug-2004_04_01/etc/hotplug/usb.agent	2004-05-15 21:50:59.000000000 +0600
  +++ hotplug-2004_04_01/etc/hotplug/usb.agent	2004-05-15 21:53:10.000000000 +0600
  @@ -342,14 +342,11 @@
   # declare a REMOVER name that the add action can use to create a
   # remover, or that the remove action can use to execute a remover.
   #
  -if [ "$DEVPATH" != "" ]; then
  -  # probably, 2.6.x
  -  REMOVER=/var/run/usb/$(readlink -f $SYSFS/$DEVPATH | sed -e 's;/;%;g')
  -elif [ "$DEVICE" != "" ]; then
  +if [ "$DEVICE" != "" ]; then
     # 2.4.x?
     REMOVER=/var/run/usb/$(echo $DEVICE | sed -e 's;/;%;g')
   else
     # should not happen?
     REMOVER=/var/run/usb/$(echo "$INTERFACE/$PRODUCT/$TYPE" | sed -e 's;/;%;g')
   fi
   export REMOVER
  
  
  



More information about the patches mailing list