hp-config_usb_printer is trying to configure HP keyboard and mouse

Bug #1266704 reported by Andrej Gogala
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
HPLIP
Fix Released
Undecided
Unassigned

Bug Description

After booting the computer (HP Elite 8300) with Ubuntu 13.10 load increases to 1.0. Syslog reports:

Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096318] INFO: task hp-config_usb_p:496 blocked for more than 120 seconds.
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096323] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096326] hp-config_usb_p D ffff88021ea54580 0 496 1 0x00000000
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096332] ffff880203de5e10 0000000000000046 ffff880203de5fd8 0000000000014580
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096336] ffff880203de5fd8 0000000000014580 ffff880203db2ee0 ffffffffa03ba040
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096340] ffffffffa03ba044 ffff880203db2ee0 00000000ffffffff ffffffffa03ba048
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096343] Call Trace:
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096360] [<ffffffff816ed519>] schedule_preempt_disabled+0x29/0x70
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096364] [<ffffffff816eb55f>] __mutex_lock_slowpath+0x13f/0x1c0
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096369] [<ffffffff816ea94f>] mutex_lock+0x1f/0x2f
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096375] [<ffffffffa03b7cd3>] pp_ioctl+0x23/0x50 [ppdev]
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096379] [<ffffffff811b9045>] do_vfs_ioctl+0x2e5/0x4d0
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096382] [<ffffffff811b92b1>] SyS_ioctl+0x81/0xa0
Jan 7 11:11:09 andrej-saucy kernel: [ 1321.096388] [<ffffffff816f721d>] system_call_fastpath+0x1a/0x1f

There are two processes hp-config_usb_printer:
$ ps -ef | grep hp-
root 492 1 0 10:49 ? 00:00:00 /usr/bin/python /usr/bin/hp-config_usb_printer 003:004
root 496 1 0 10:49 ? 00:00:00 /usr/bin/python /usr/bin/hp-config_usb_printer 003:005

Usb device 003:004 is HP Smart Card Terminal keyboard and Usb device 003:005 is HP mouse:

$ lsusb -D /dev/bus/usb/003/004 | grep Device
Device: ID 03f0:0036 Hewlett-Packard
Device Descriptor:
  bDeviceClass 0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bcdDevice 1.24
      bInterfaceClass 3 Human Interface Device
        HID Device Descriptor:
      bInterfaceClass 3 Human Interface Device
        HID Device Descriptor:
Device Status: 0x0000
$ lsusb -D /dev/bus/usb/003/005 | grep Device
Device: ID 03f0:0c4a Hewlett-Packard
Device Descriptor:
  bDeviceClass 0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bcdDevice 0.00
      bInterfaceClass 3 Human Interface Device
        HID Device Descriptor:
Device Status: 0x0000

After killing both processes load becomes normal.

Revision history for this message
Andrej Gogala (andrej-gogala) wrote :

After modifying /lib/udev/rules.d/56-hpmud.rules to exclude keyboard and mouse problem does not appear anymore:

*** /tmp/56-hpmud.rules 2014-01-07 11:40:08.970600087 +0100
--- /lib/udev/rules.d/56-hpmud.rules 2014-01-07 11:36:58.739442543 +0100
*************** SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_dev
*** 8,14 ****
  LABEL="hpmud_usb_rules"

  # ENV{ID_HPLIP}="1" is for Ubuntu udev-acl
! ATTR{idVendor}=="03f0", ATTR{idProduct}=="????", OWNER="root", GROUP="lp", MODE="0660", ENV{sane_hpaio}="yes", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1"

  # This rule will add the printer and install plugin
  ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/nohup /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi'"
--- 8,14 ----
  LABEL="hpmud_usb_rules"

  # ENV{ID_HPLIP}="1" is for Ubuntu udev-acl
! ATTR{idVendor}=="03f0", ATTR{idProduct}!="0036", ATTR{idProduct}!="0c4a", ATTR{idProduct}=="????", OWNER="root", GROUP="lp", MODE="0660", ENV{sane_hpaio}="yes", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1"

  # This rule will add the printer and install plugin
  ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/nohup /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi'"

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi Andrej,

Sorry for inconvenience caused.

Ideally when other than Printer is connected, hp-config_usb_printer script terminates with "Not a valid device error".
Seems like, if environment variables are not loaded, this issue might happen. So added /usr/bin/python before hp-config_usb_printer command

To analyse further, please make following changes and let us know if you are facing any issue.

--> take backup /lib/udev/rules.d/56-hpmud.rules file.
--> open /lib/udev/rules.d/56-hpmud.rules file and copy following data
#----------------------Start----------------

# HPLIP udev rules file. Notify console user if plugin support is required for this device.

ACTION!="add", GOTO="hpmud_rules_end"
SUBSYSTEM=="ppdev", OWNER="root", GROUP="lp", MODE="0660"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="hpmud_usb_rules"

LABEL="hpmud_usb_rules"

# ENV{ID_HPLIP}="1" is for Ubuntu udev-acl
ATTR{idVendor}=="03f0", ATTR{idProduct}=="????", OWNER="root", GROUP="lp", MODE="0660", ENV{sane_hpaio}="yes", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1"

# This rule will add the printer and install plugin
ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/python /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi &'"

# If sane-bankends is installed add hpaio backend support to dll.conf if needed.
ENV{sane_hpaio}=="yes", RUN+="/bin/sh -c 'grep -q ^#hpaio /etc/sane.d/dll.conf;if [ $$? -eq 0 ];then sed -i -e s/^#hpaio/hpaio/ /etc/sane.d/dll.conf;else grep -q ^hpaio /etc/sane.d/dll.conf;if [ $$? -ne 0 ];then echo hpaio >>/etc/sane.d/dll.conf;fi;fi'"

# The following rule will disable USB autosuspend for the device
ENV{libsane_matched}=="yes", RUN+="/bin/sh -c 'test -e /sys/$env{DEVPATH}/power/level && echo on > /sys/$env{DEVPATH}/power/level'"

LABEL="hpmud_rules_end"
#--------------------------------------end-------------------------------------------

--> restart system or reload udev rules using following command
$ udevadm control --reload

--> If anything fails, restore the backup file and reboot system.

Thanks & Regards,
Amarnath

Revision history for this message
Andrej Gogala (andrej-gogala) wrote :

HI Amarnath,

I've made the proposed changes. After running

$ udevadm control --reload

load has not increased. Also, there are no hp-config_usb_printer processes running.

So this fix works for me. Thanks for quick response.

Best regards,

Andrej

Revision history for this message
stephen schwetz (stephen-schwetz) wrote :

HI Amarnath,

I came across this issue as well. I can confirm that your solution worked in my case as well.

Regards

Stephen

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

This fix is released in HPLIP-3.14.3

Changed in hplip:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.