Bug 162421 - usblp don't block if an application read from the device file
Summary: usblp don't block if an application read from the device file
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 5
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Pete Zaitcev
QA Contact: Brian Brock
URL:
Whiteboard: MassClosed
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-07-04 12:19 UTC by Jean-Jacques Sarton
Modified: 2008-01-20 04:38 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-20 04:38:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jean-Jacques Sarton 2005-07-04 12:19:11 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.7.8-1.3.1

Description of problem:
The read call on the usblp device file is not blocking.

example:

int fd;
int got;
unsigned char buf[512];
fd = open("/dev/usb/lp0", O_RDRW)
got = read(fd, buf, sizeof(buf));
printf("Read %d bytes\n");
close(fd);

This will terminate immediadly after reading of non present data from the
attached printer.

Version-Release number of selected component (if applicable):
all 2.6 kernels

How reproducible:
Always

Steps to Reproduce:
1. attach an usb printer
2. call cat /dev/usb/lp0
3.
  

Actual Results:  see above

Expected Results:  The read call shall block until informations are present or the timeout
has elapsed (return -1)

Additional info:

Comment 1 Dave Jones 2005-07-15 19:36:07 UTC
An update has been released for Fedora Core 3 (kernel-2.6.12-1.1372_FC3) which
may contain a fix for your problem.   Please update to this new kernel, and
report whether or not it fixes your problem.

If you have updated to Fedora Core 4 since this bug was opened, and the problem
still occurs with the latest updates for that release, please change the version
field of this bug to 'fc4'.

Thank you.

Comment 2 Jean-Jacques Sarton 2005-07-18 07:32:17 UTC
The new kernel don't fix the problem, the vanilla kernel 2.6.13.rc3 and the
previous kernel changelog don't tell anythings about the usblp driver.

The command "strace cat /dev/usb/lp0" (an printer is attached to the usb port)
show that the read call is always non nlockink:

# strace cat /dev/usb/lp0
execve("/bin/cat", ["cat", "/dev/usb/lp0"], [/* 23 vars */]) = 0
...
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
...
read(3, "", 4096)                       = 0

Comment 3 Peter Van Wieren 2005-10-22 00:42:46 UTC
Hello,

I am a complete newbie with respect to linux kernel/usb, however, I would like
to report what is perhaps to be a related issue.  In recent kernels, the usblp
driver appears to have been changed in a way that breaks hardware compatability.

I have a all-in-one USB printer-scanner that used to work (FC3) but now does not
(FC4).  The text in /var/log/messages seems to indicated that, usblp claims the
usb connection to the printer, but blocks the scanning program from actually
using the USB device.

/var/log/messages shows:
Oct 21 20:31:17 smith kernel: ohci_hcd 0000:00:03.2: wakeup
Oct 21 20:31:18 smith kernel: usb 4-1: new full speed USB device using ohci_hcd
and address 2
Oct 21 20:31:19 smith kernel: drivers/usb/class/usblp.c: usblp0: USB
Bidirectional printer dev 2 if 1 alt 0 proto 2 vid 0x04B8 pid 0x0808
Oct 21 20:31:19 smith kernel: usbcore: registered new driver usblp
Oct 21 20:31:19 smith kernel: drivers/usb/class/usblp.c: v0.13: USB Printer
Device Class driver
Oct 21 20:31:48 smith kernel: usb 4-1: usbfs: interface 1 claimed by usblp while
'iscan' sets config #1


strace shows:
read(3, 0xbf8216fc, 32)                 = -1 EAGAIN (Resource temporarily
unavailable)

Regards,
Pete



Comment 4 Dave Jones 2006-01-16 22:16:58 UTC
This is a mass-update to all currently open Fedora Core 3 kernel bugs.

Fedora Core 3 support has transitioned to the Fedora Legacy project.
Due to the limited resources of this project, typically only
updates for new security issues are released.

As this bug isn't security related, it has been migrated to a
Fedora Core 4 bug.  Please upgrade to this newer release, and
test if this bug is still present there.

This bug has been placed in NEEDINFO_REPORTER state.
Due to the large volume of inactive bugs in bugzilla, if this bug is
still in this state in two weeks time, it will be closed.

Should this bug still be relevant after this period, the reporter
can reopen the bug at any time. Any other users on the Cc: list
of this bug can request that the bug be reopened by adding a
comment to the bug.

Thank you.


Comment 5 Dave Jones 2006-02-03 06:36:59 UTC
This is a mass-update to all currently open kernel bugs.

A new kernel update has been released (Version: 2.6.15-1.1830_FC4)
based upon a new upstream kernel release.

Please retest against this new kernel, as a large number of patches
go into each upstream release, possibly including changes that
may address this problem.

This bug has been placed in NEEDINFO_REPORTER state.
Due to the large volume of inactive bugs in bugzilla, if this bug is
still in this state in two weeks time, it will be closed.

Should this bug still be relevant after this period, the reporter
can reopen the bug at any time. Any other users on the Cc: list
of this bug can request that the bug be reopened by adding a
comment to the bug.

If this bug is a problem preventing you from installing the
release this version is filed against, please see bug 169613.

Thank you.


Comment 6 Jean-Jacques Sarton 2006-02-12 14:40:40 UTC
With the 2.6.15 kernel (2.6.15-1.1831_FC4) the bug is still present

Comment 7 Dave Jones 2006-09-17 01:47:42 UTC
[This comment added as part of a mass-update to all open FC4 kernel bugs]

FC4 has now transitioned to the Fedora legacy project, which will continue to
release security related updates for the kernel.  As this bug is not security
related, it is unlikely to be fixed in an update for FC4, and has been migrated
to FC5.

Please retest with Fedora Core 5.

Thank you.

Comment 8 Jean-Jacques Sarton 2006-10-03 13:56:48 UTC
This a bug which was not fixed on 2.6.17 kernel as provided with FC5.

Comment 9 Jean-Jacques Sarton 2006-10-03 13:57:59 UTC
Behaviour still present witin FC5

Comment 10 Pete Zaitcev 2006-10-03 16:36:43 UTC
Please don't put bugs into NEEDINFO state, it drops them off the radar.


Comment 11 Dave Jones 2006-10-16 20:37:43 UTC
A new kernel update has been released (Version: 2.6.18-1.2200.fc5)
based upon a new upstream kernel release.

Please retest against this new kernel, as a large number of patches
go into each upstream release, possibly including changes that
may address this problem.

This bug has been placed in NEEDINFO state.
Due to the large volume of inactive bugs in bugzilla, if this bug is
still in this state in two weeks time, it will be closed.

Should this bug still be relevant after this period, the reporter
can reopen the bug at any time. Any other users on the Cc: list
of this bug can request that the bug be reopened by adding a
comment to the bug.

In the last few updates, some users upgrading from FC4->FC5
have reported that installing a kernel update has left their
systems unbootable. If you have been affected by this problem
please check you only have one version of device-mapper & lvm2
installed.  See bug 207474 for further details.

If this bug is a problem preventing you from installing the
release this version is filed against, please see bug 169613.

If this bug has been fixed, but you are now experiencing a different
problem, please file a separate bug for the new problem.

Thank you.

Comment 12 Jon Stanley 2008-01-20 04:38:05 UTC
(this is a mass-close to kernel bugs in NEEDINFO state)

As indicated previously there has been no update on the progress of this bug
therefore I am closing it as INSUFFICIENT_DATA. Please re-open if the issue
still occurs for you and I will try to assist in its resolution. Thank you for
taking the time to report the initial bug.

If you believe that this bug was closed in error, please feel free to reopen
this bug.


Note You need to log in before you can comment on or make changes to this bug.