NetBSD Problem Report #25904
Received: (qmail 25321 invoked by uid 605); 11 Jun 2004 18:42:49 -0000
Message-Id: <20040611204235.1847c20e.recht@netbsd.org>
Date: Fri, 11 Jun 2004 20:42:35 +0200
From: Marc Recht <recht@netbsd.org>
Sender: gnats-bugs-owner@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Cc: tls@netbsd.org, augustss@netbsd.org
Subject: the MAXBSIZE->MAXPHYS changes broke usb printing
>Number: 25904
>Category: kern
>Synopsis: the MAXBSIZE->MAXPHYS changes broke usb printing
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jun 11 18:43:00 +0000 2004
>Closed-Date: Fri Jul 09 22:19:31 +0000 2004
>Last-Modified: Fri Jul 09 22:19:31 +0000 2004
>Originator: Marc Recht
>Release: NetBSD 2.0_BETA
>Organization:
<organization of PR author (multiple lines)>
>Environment:
<The following information is extracted from your kernel.
Please>
<append output of "ldd", "ident" where relevant (multiple
lines).>
System: NetBSD leeloo.intern.geht.de 2.0_BETA NetBSD 2.0_BETA (LEELOO)
#0: Fri Jun 11 19:37:12 CEST 2004
#root@leeloo.intern.geht.de:/usr/obj/sys/arch/i386/compile/LEELOO i386
Architecture: i386
Machine: i386
>Description:
The MAXBSIZE->MAXPHYS change broke printing with my usb connected HP
LaserJet.
Reverting ulpt.c to 1.60, umassvar.h to 1.22 and (unimportant)
usscanner.c to 1.12 fixed the problem.
There's also a thread on netbsd-users@ about it:
http://mail-index.netbsd.org/netbsd-users/2004/06/01/0006.html
>How-To-Repeat:
Just try to print. ;-)
<code/input/activities to reproduce the problem (multiple
lines)>
>Fix:
<how to correct or work around the problem, if known (multiple
lines)>
--Signature=_Fri__11_Jun_2004_20_42_35_+0200_2tsKK4K1.Oz1mrk4
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)
iD8DBQFAyf0j7YQCetAaG3MRAlIaAJ9UIXHZGTB/aYOQCOXR26qpkeJ/xgCeNUCY
D715riwS/5U7KUCM+UyVfRU=
=XOPG
-----END PGP SIGNATURE-----
--Signature=_Fri__11_Jun_2004_20_42_35_+0200_2tsKK4K1.Oz1mrk4--
>Release-Note:
>Audit-Trail:
From: Thor Lancelot Simon <tls@NetBSD.org>
To: Marc Recht <recht@netbsd.org>, gnats-bugs@gnats.netbsd.org,
augustss@netbsd.org
Cc:
Subject: Re: kern/25904: the MAXBSIZE->MAXPHYS changes broke usb printing
Date: Fri, 11 Jun 2004 19:11:14 +0000
On Fri, Jun 11, 2004 at 08:42:35PM +0200, Marc Recht wrote:
>
> The MAXBSIZE->MAXPHYS change broke printing with my usb connected HP
> LaserJet.
> Reverting ulpt.c to 1.60, umassvar.h to 1.22 and (unimportant)
> usscanner.c to 1.12 fixed the problem.
I don't know what's wrong here, but it can't possibly be as simple as
you think it is; I tested that change on one of my own systems which
has both a umass and a ulpt attached, and on which I print pretty much
every day. More importantly, your proposed fix is just plain wrong;
MAXBSIZE is not a magical constant that equals 64K, it's valid for
MAXBSIZE to be less than MAXPHYS, and MAXPHYS is the maximum disk
transfer size. So:
1) If ulpt.c needs a magical 64K constant, it can't use MAXPHYS *or*
MAXBSIZE for this. The same thing is true for uscanner.
2) Reverting the change to umassvar.h will break umass completely on
systems where MAXBSIZE < MAXPHYS.
Maybe Lennart knows what the right thing to do here is.
Thor
From: Marc Recht <recht@netbsd.org>
To: Thor Lancelot Simon <tls@NetBSD.org>
Cc: gnats-bugs@gnats.netbsd.org, augustss@netbsd.org
Subject: Re: kern/25904: the MAXBSIZE->MAXPHYS changes broke usb printing
Date: Fri, 11 Jun 2004 21:21:16 +0200
> I don't know what's wrong here, but it can't possibly be as simple as
> you think it is; I tested that change on one of my own systems which
> has both a umass and a ulpt attached, and on which I print pretty much
> every day. More importantly, your proposed fix is just plain wrong;
[...]
Might be therefore I didn't put it in the "Fix" paragraph. All I can
that that it works for me (usb connected HP LaserJet 1300) with
reverting the changes.
For completeness a bit more info:
ehci0: companion controllers, 2 ports each: uhci0 uhci1 uhci2 uhci3
uhci2 at pci0 dev 16 function 2: vendor 0x1106 product 0x3038 (rev.
0x81)
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: vendor 0x1106 UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
uhub2: port error, restarting port 1
uhub2: port error, giving up port 1
ulpt0 at uhub2 port 2 configuration 1 interface 0
ulpt0: Hewlett-Packard hp LaserJet 1300, rev 1.10/1.00, addr 2, iclass
7/1
ulpt0: using bi-directional mode
Cheers,
Marc
From: Thor Lancelot Simon <tls@rek.tjls.com>
To: Marc Recht <recht@netbsd.org>, gnats-bugs@gnats.netbsd.org,
augustss@netbsd.org
Cc:
Subject: Re: kern/25904: the MAXBSIZE->MAXPHYS changes broke usb printing
Date: Fri, 11 Jun 2004 16:23:31 -0400
On Fri, Jun 11, 2004 at 09:21:16PM +0200, Marc Recht wrote:
> > I don't know what's wrong here, but it can't possibly be as simple as
> > you think it is; I tested that change on one of my own systems which
> > has both a umass and a ulpt attached, and on which I print pretty much
> > every day. More importantly, your proposed fix is just plain wrong;
> [...]
> Might be therefore I didn't put it in the "Fix" paragraph. All I can
> that that it works for me (usb connected HP LaserJet 1300) with
> reverting the changes.
Sorry -- the PR's filled out more than a little oddly and I couldn't
tell what was intended to be where (most sections aren't filled out
at all, for example).
Reverting the change in question will leave umass completely broken on
any system where MAXPHYS > MAXBSIZE; and it will leave the entire USB
subsystem using MAXBSIZE (which varies in size from port to port and
from kernel configuration to kernel configuration!) as a magic constant
which is _guaranteed_ to be the wrong size some of the time.
That's just not good. I hope Lennart can make it more clear which
devices here actually rely on which transfer size limits, so we can
actually encode them appropriately in the USB header files.
> For completeness a bit more info:
> ehci0: companion controllers, 2 ports each: uhci0 uhci1 uhci2 uhci3
> uhci2 at pci0 dev 16 function 2: vendor 0x1106 product 0x3038 (rev.
Hm. I assume it's still broken if you don't use ehci.
Thor
From: Marc Recht <recht@netbsd.org>
To: tls@rek.tjls.com
Cc: gnats-bugs@gnats.netbsd.org, augustss@netbsd.org
Subject: Re: kern/25904: the MAXBSIZE->MAXPHYS changes broke usb printing
Date: Fri, 11 Jun 2004 23:35:17 +0200
> Sorry -- the PR's filled out more than a little oddly and I couldn't
> tell what was intended to be where (most sections aren't filled out
> at all, for example).
Sorry, for that nb.o mail server didn't liked my local postfix so I
copy&pasted it into my mail client -- which did some wrapping which
wasn't too good..
> Reverting the change in question will leave umass completely broken on
> any system where MAXPHYS > MAXBSIZE; and it will leave the entire USB
> subsystem using MAXBSIZE (which varies in size from port to port and
> from kernel configuration to kernel configuration!) as a magic
> constant which is _guaranteed_ to be the wrong size some of the time.
Yes, I don't propage it as the way to go. I just wanted to point out a
problem with this change. (And some printing, actually.. ;)
> That's just not good. I hope Lennart can make it more clear which
> devices here actually rely on which transfer size limits, so we can
> actually encode them appropriately in the USB header files.
Indeed, that would be a much better solution.
> Hm. I assume it's still broken if you don't use ehci.
I'm pretty sure I tried that. IIRC I disabled EHCI completly in the
kernel. I could (re-)try this after my vacation.
Cheers,
Marc
From: Lennart Augustsson <lennart@augustsson.net>
To: tls@rek.tjls.com
Cc: Marc Recht <recht@netbsd.org>, gnats-bugs@gnats.netbsd.org,
augustss@netbsd.org
Subject: Re: kern/25904: the MAXBSIZE->MAXPHYS changes broke usb printing
Date: Fri, 11 Jun 2004 23:04:01 +0200
I don't understand your change from 1.60-1.61 at all. It is bound
to break many printers as it does no longer search for a good alternate
setting for a printer.
The ulpt driver does not use MAXPHYS nor MAXBSIZE so I don't understand
that comment either.
Please back out that change, it is just wrong.
-- Lennart
Thor Lancelot Simon wrote:
> On Fri, Jun 11, 2004 at 09:21:16PM +0200, Marc Recht wrote:
>
>>>I don't know what's wrong here, but it can't possibly be as simple as
>>>you think it is; I tested that change on one of my own systems which
>>>has both a umass and a ulpt attached, and on which I print pretty much
>>>every day. More importantly, your proposed fix is just plain wrong;
>>
>>[...]
>>Might be therefore I didn't put it in the "Fix" paragraph. All I can
>>that that it works for me (usb connected HP LaserJet 1300) with
>>reverting the changes.
>
>
> Sorry -- the PR's filled out more than a little oddly and I couldn't
> tell what was intended to be where (most sections aren't filled out
> at all, for example).
>
> Reverting the change in question will leave umass completely broken on
> any system where MAXPHYS > MAXBSIZE; and it will leave the entire USB
> subsystem using MAXBSIZE (which varies in size from port to port and
> from kernel configuration to kernel configuration!) as a magic constant
> which is _guaranteed_ to be the wrong size some of the time.
>
> That's just not good. I hope Lennart can make it more clear which
> devices here actually rely on which transfer size limits, so we can
> actually encode them appropriately in the USB header files.
>
>
>>For completeness a bit more info:
>>ehci0: companion controllers, 2 ports each: uhci0 uhci1 uhci2 uhci3
>>uhci2 at pci0 dev 16 function 2: vendor 0x1106 product 0x3038 (rev.
>
>
> Hm. I assume it's still broken if you don't use ehci.
>
> Thor
>
From: Thor Lancelot Simon <tls@rek.tjls.com>
To: Lennart Augustsson <lennart@augustsson.net>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/25904: the MAXBSIZE->MAXPHYS changes broke usb printing
Date: Sun, 13 Jun 2004 19:31:14 -0400
On Fri, Jun 11, 2004 at 11:04:01PM +0200, Lennart Augustsson wrote:
> I don't understand your change from 1.60-1.61 at all. It is bound
> to break many printers as it does no longer search for a good alternate
> setting for a printer.
Oh, crap. I must have accidentally committed a debugging change I had
in my local tree along with the other changes to eliminate (ab)use of
MAXBSIZE in the usb code. I agree -- the change to ulpt.c _only_ needs
to be backed out.
Thor
--
Thor Lancelot Simon tls@rek.tjls.com
But as he knew no bad language, he had called him all the names of common
objects that he could think of, and had screamed: "You lamp! You towel! You
plate!" and so on. --Sigmund Freud
From: Lennart Augustsson <lennart@augustsson.net>
To: tls@rek.tjls.com
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: kern/25904: the MAXBSIZE->MAXPHYS changes broke usb printing
Date: Mon, 14 Jun 2004 08:52:38 +0200
Yes, I was only talking about the ulpt.c change.
-- Lennart
Thor Lancelot Simon wrote:
> On Fri, Jun 11, 2004 at 11:04:01PM +0200, Lennart Augustsson wrote:
>
>>I don't understand your change from 1.60-1.61 at all. It is bound
>>to break many printers as it does no longer search for a good alternate
>>setting for a printer.
>
>
> Oh, crap. I must have accidentally committed a debugging change I had
> in my local tree along with the other changes to eliminate (ab)use of
> MAXBSIZE in the usb code. I agree -- the change to ulpt.c _only_ needs
> to be backed out.
>
> Thor
>
From: Marc Recht <recht@netbsd.org>
To: Lennart Augustsson <lennart@augustsson.net>, tls@rek.tjls.com
Cc: gnats-bugs@gnats.netbsd.org, augustss@netbsd.org
Subject: Re: kern/25904: the MAXBSIZE->MAXPHYS changes broke usb printing
Date: Sat, 03 Jul 2004 23:35:11 +0200
> Yes, I was only talking about the ulpt.c change.
I've tried now with backing out only the ulpt.c change and got a panic
(trap).
Unfortunally I don't have the netbsd.gdb not anymore.. So, the following
might not help much:
(gdb) target kcore netbsd.2.core
can not access 0xc037c01e, invalid translation (invalid PTE)
can not access 0xc037c01e, invalid translation (invalid PTE)
panic: trap
#0 0x00000001 in ?? ()
(gdb) bt
#0 0x00000001 in ?? ()
#1 0xc0298f43 in cpu_reboot ()
#2 0xc0223941 in panic ()
#3 0xc02a3f24 in trap ()
#4 0xc0102c53 in calltrap ()
#5 0xc0181b98 in uhci_abort_xfer ()
#6 0xc0181a03 in uhci_device_bulk_abort ()
#7 0xc030c892 in usbd_ar_pipe ()
#8 0xc030c4d3 in usbd_abort_pipe ()
#9 0xc031865d in ulptclose ()
#10 0xc0261fb7 in spec_close ()
#11 0xc01ce546 in ufsspec_close ()
#12 0xc025a142 in VOP_CLOSE ()
#13 0xc0258e84 in vn_close ()
#14 0xc02599bf in vn_closefile ()
#15 0xc01f2775 in closef ()
#16 0xc01f1626 in fdrelease ()
#17 0xc01f1679 in sys_close ()
#18 0xc02a37a9 in syscall_plain ()
(It happened immediately after the page has been printed.)
Might be useful:
$NetBSD: uhci.c,v 1.178 2004/03/02 16:32:05 martin Exp $
Please let me know if there's anything specific I could should try out (and
how to provide more helpful details).
Marc
!DSPAM:40e7269a156292090620175!
From: Marc Recht <recht@netbsd.org>
To: Lennart Augustsson <lennart@augustsson.net>, tls@rek.tjls.com
Cc: gnats-bugs@gnats.netbsd.org, augustss@netbsd.org
Subject: Re: kern/25904: the MAXBSIZE->MAXPHYS changes broke usb printing
Date: Mon, 05 Jul 2004 18:28:12 +0200
I must have done something wrong. After applying Lennarts' fx (r. 1.62 -
1.63) everything works just fine. Thanks!
I'm requesting a pullup for this change now.
Cheers,
Marc
!DSPAM:40e981a5141771568333018!
From: Havard Eidnes <he@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: pr/25904 CVS commit: [netbsd-2-0] src/sys/dev/usb
Date: Mon, 5 Jul 2004 22:07:13 +0000 (UTC)
Module Name: src
Committed By: he
Date: Mon Jul 5 22:07:13 UTC 2004
Modified Files:
src/sys/dev/usb [netbsd-2-0]: ulpt.c
Log Message:
Pull up revision 1.63 (requested by recht in ticket #604):
Remove change accidentally committed. Fixes PR#25904.
To generate a diff of this commit:
cvs rdiff -r1.61 -r1.61.2.1 src/sys/dev/usb/ulpt.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: recht
State-Changed-When: Fri Jul 9 22:17:58 UTC 2004
State-Changed-Why:
This bug is fixed and printing works now for me.
>Unformatted:
--Signature=_Fri__11_Jun_2004_20_42_35_+0200_2tsKK4K1.Oz1mrk4
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
<Please check that the above is correct for the bug being
reported,>
<and append source date of snapshot, if applicable (one line).>
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.