From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40231 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OYhzm-0003ye-9R for qemu-devel@nongnu.org; Tue, 13 Jul 2010 12:06:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OYhzh-0003aM-6h for qemu-devel@nongnu.org; Tue, 13 Jul 2010 12:06:09 -0400 Received: from adelie.canonical.com ([91.189.90.139]:37792) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OYhzh-0003aB-0D for qemu-devel@nongnu.org; Tue, 13 Jul 2010 12:06:05 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1OYhzf-00028h-5Y for ; Tue, 13 Jul 2010 17:06:03 +0100 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id CA8A52E8477 for ; Tue, 13 Jul 2010 17:05:52 +0100 (BST) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Tue, 13 Jul 2010 15:56:52 -0000 From: MarkusRechberger Sender: bounces@canonical.com References: <20100322211328.28473.3965.malonedeb@gandwana.canonical.com> <20100713151405.22864.21330.malone@wampee.canonical.com> Message-Id: Errors-To: bounces@canonical.com Subject: [Qemu-devel] Re: [Bug 544527] Re: usbfs is bugged with >2.6.32.9 and <=2.6.33 (breaks VMWare, Qemu, sane scanners, ...) Reply-To: Bug 544527 <544527@bugs.launchpad.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Tue, Jul 13, 2010 at 5:14 PM, David K=C3=BChling <544527@bugs.launchpad.net> wrote: > This bugfix is incomplete. =C2=A0Isochronous transfers are still broken, = when > running 32-bit software on a 64-bit kernel. =C2=A0Function > processcompl_compat() in devio.c needs a similar fix to the fix that was > applied to processcompl(). =C2=A0Looking at processcompl_compat() I see: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (as->userbuffer && urb->actual_length) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (copy_to_user(a= s->userbuffer, urb->transfer_buffer, > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 urb->actual_length)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0return -EFAULT; > > correct code would be something like > > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (as->userbuffer && urb->actual_length) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (urb->number_of= _packets > 0) =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Isochronous */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0i =3D urb->transfer_buffer_length; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Non-Isoc */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0i =3D urb->actual_length; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (copy_to_user(a= s->userbuffer, urb->transfer_buffer, i)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0goto err_out; > =C2=A0 =C2=A0 =C2=A0 =C2=A0} > > (note the difference between urb->actual_length and > urb->transfer_buffer_length). > > With kernel 2.6.32-23-generic x86_64 on Ubuntu 10.04, using proprietary > USB-hardware hooked up to the USB bus (with software compiled for > 32-bit), I can directly observe how isochronous transfers retrieved via > ioctl(.. USBDEVFS_REAPURB ..) are too short, i.e. the kernel does not > write the end of the data packet to the supplied buffer. =C2=A0Booting on= the > 2.6.31 kernel still present from before I upgraded from Ubuntu 9.10, the > same software runs flawlessly. > > As a workaround I'll use the older kernel for now (also I could compile > for 64-bit, actually...). > yes you're right, since we distribute 64 and 32bit drivers it doesn't really affect us. before applying any change you can submit some patches to us and we can test them if needed. Things should definitely not go upstream untested anymore as it used to happen in the past with various kernel releases. (isochronous is bugged with 2.6.26/27/28 (memory leak) and 32/33 (copying wrong memory area). Luckily our hardware supports switching from ISO to BULK in order to work around those issues - but bulk transfers have a bad performance in userspace Markus > cheers, > > David > > -- > usbfs is bugged with >2.6.32.9 and <=3D2.6.33 (breaks VMWare, Qemu, sane = scanners, ...) > https://bugs.launchpad.net/bugs/544527 > You received this bug notification because you are a direct subscriber > of the bug. > -- = usbfs is bugged with >2.6.32.9 and <=3D2.6.33 (breaks VMWare, Qemu, sane sc= anners, ...) https://bugs.launchpad.net/bugs/544527 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. Status in QEMU: Fix Committed Status in SANE-backends - Backends for SANE: Fix Committed Status in Tv Time: Fix Committed Status in Virtualbox: Fix Committed Status in =E2=80=9Clinux=E2=80=9D package in Ubuntu: Fix Committed Bug description: Binary package hint: tvtime There's a problem with isochronous and usbfs, suse tried to improve usbfs b= ut it end up that it broke usbfs. For isochronous the entire packet needs to be copied and not only a part of= it. http://lkml.org/lkml/2010/2/26/490 (Report) http://lkml.org/lkml/2010/2/27/226 (Bugfix) please merge this bugfix asap. ProblemType: Bug Architecture: amd64 Date: Mon Mar 22 21:09:00 2010 DistroRelease: Ubuntu 10.04 LiveMediaBuild: Ubuntu 10.04 "Lucid Lynx" - Alpha amd64 (20100322) Package: tvtime 1.0.2-5ubuntu2 ProcEnviron: LANG=3Dde_DE.UTF-8 SHELL=3D/bin/bash ProcVersionSignature: Ubuntu 2.6.32-16.25-generic SourcePackage: tvtime Uname: Linux 2.6.32-16-generic x86_64